Added a fix for a programming bug in Dirt Racer (Europe)

The game relies on uninitialized memory containing certain values.
The game will periodically freeze at boot even on real hardware.
This commit adds a workaround to allow the game to always boot.
This commit is contained in:
byuu 2019-09-02 10:53:53 +09:00
parent 23467b5b1f
commit 556ab4c809
4 changed files with 11 additions and 0 deletions

View File

@ -37,6 +37,7 @@ struct Game {
string sha256;
string label;
string name;
string title;
string region;
string revision;
string board;
@ -50,6 +51,7 @@ auto Game::load(string_view text) -> void {
sha256 = document["game/sha256"].text();
label = document["game/label"].text();
name = document["game/name"].text();
title = document["game/title"].text();
region = document["game/region"].text();
revision = document["game/revision"].text();
board = document["game/board"].text();

View File

@ -65,6 +65,7 @@ auto Cartridge::load() -> bool {
if(auto fp = platform->open(ID::SuperFamicom, "manifest.bml", File::Read, File::Required)) {
game.load(fp->reads());
} else return false;
loadCartridge(game.document);
//Game Boy

View File

@ -1,6 +1,7 @@
struct Cartridge {
auto pathID() const -> uint { return information.pathID; }
auto region() const -> string { return information.region; }
auto headerTitle() const -> string { return game.title; }
auto hashes() const -> vector<string>;
auto manifests() const -> vector<string>;

View File

@ -96,6 +96,13 @@ auto CPU::power(bool reset) -> void {
if(!reset) random.array(wram, sizeof(wram));
//Dirt Racer (Europe) relies on uninitialized memory containing certain values to boot without freezing.
//the game itself is broken and will fail to run sometimes on real hardware, but for the sake of expedience,
//WRAM is initialized to a constant value that will allow this game to always boot in successfully.
if(cartridge.headerTitle() == "DIRT RACER") {
for(auto& byte : wram) byte = 0xff;
}
for(uint n : range(8)) {
channels[n] = {};
if(n != 7) channels[n].next = channels[n + 1];