Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BS2 PAL Revision boot #259

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Requirements: CMake, pthread.

## Progress

![progress_ikaruga](/imgstore/progress_ikaruga.png)
|![progress_bs2](/imgstore/progress_bs2.png)|![progress_ikaruga](/imgstore/progress_ikaruga.png)|
|---|---|

## Credits

Expand Down
4 changes: 2 additions & 2 deletions build/Data/Json/DebuggerJdi.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"usage": [
"Syntax: StartProfiler <json> [ms]",
"Specify the Json file name where the collected information will be saved, after calling the StopProfiler command.",
"The interval is specified in milliseconds. Possible values are 2-50. The default is 5.",
"Example: StartProfiler Data\\sampleData.json 10"
"The interval is specified in emulated Gekko milliseconds. Possible values are 2-50. The default is 5.",
"Example: StartProfiler Data/sampleData.json 10"
]
},

Expand Down
Binary file added imgstore/progress_bs2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/bootrtc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,3 +640,14 @@ void BootROM(bool dvd, bool rtc, uint32_t consoleVer)
ReadFST(); // load FST, for demos
}
}

bool IsBootromPALRevision()
{
if (mi.BootromPresent) {

if (strstr((char*)mi.bootrom, "PAL")) {
return true;
}
}
return false;
}
5 changes: 5 additions & 0 deletions src/bootrtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ void MXTransfer(); // to EXI
void IPLDescrambler(uint8_t* data, size_t size);

void BootROM(bool dvd, bool rtc, uint32_t consoleVer);

/// <summary>
/// Checks that the bootstrap (if present) is of PAL revision. This is determined by the "PAL" substring in the first unencoded 0x100 bytes with copyright.
/// </summary>
bool IsBootromPALRevision();
6 changes: 6 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,4 +964,10 @@ void LoadFile(const std::wstring& filename)
DVD::Region region = DVD::RegionById(id);
VISetEncoderFuse(DVD::IsNtsc(region) ? 0 : 1);
}

// Do the same for the bootstrap.
if (bootrom) {

VISetEncoderFuse(IsBootromPALRevision() ? 1 : 0);
}
}
11 changes: 11 additions & 0 deletions src/pi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,16 @@ static void read_config(uint32_t addr, uint32_t* reg)
*reg = 0;
}

//
// PI_STRGTH
//

static void write_strength(uint32_t addr, uint32_t data)
{
// Just so the BS doesn't give an error on unmapped HW.
Report(Channel::PI, "Strength: 0x%08x\n", data);
}

//
// PI fifo (CPU)
//
Expand Down Expand Up @@ -682,6 +692,7 @@ void PIOpen(HWConfig* config)
PISetTrap(32, PI_CHIPID, read_FlipperID, nullptr);
PISetTrap(8, PI_CONFIG, read_config, write_config);
PISetTrap(32, PI_CONFIG, read_config, write_config);
PISetTrap(32, PI_STRGTH, nullptr, write_strength);

// Processor interface CP fifo.
// Some of the CP FIFO registers are mapped to PI registers for the reason that writes to the FIFO Stream Pointer are made by the Gekko Burst transactions and are serviced by PI.
Expand Down