Add render position hack and clean up rest.

This removes the "known bad dumps" section, which probably aren't
relevant anymore. It also removes commented out APU hacks which are
no longer needed.
This commit is contained in:
Brandon Wright 2019-11-12 16:25:41 -06:00
parent a6e423a413
commit 20f6dab047
1 changed files with 57 additions and 111 deletions

View File

@ -2604,6 +2604,9 @@ void CMemory::InitROM (void)
and the NMI handler, time enough for an instruction or two. */ and the NMI handler, time enough for an instruction or two. */
// Wild Guns, Mighty Morphin Power Rangers - The Fighting Edition // Wild Guns, Mighty Morphin Power Rangers - The Fighting Edition
Timings.NMIDMADelay = 24; Timings.NMIDMADelay = 24;
Timings.IRQTriggerCycles = 14;
Timings.APUSpeedup = 0;
S9xAPUTimingSetSpeedup(Timings.APUSpeedup);
IPPU.TotalEmulatedFrames = 0; IPPU.TotalEmulatedFrames = 0;
@ -3596,131 +3599,74 @@ void CMemory::ApplyROMFixes (void)
{ {
Settings.BlockInvalidVRAMAccess = Settings.BlockInvalidVRAMAccessMaster; Settings.BlockInvalidVRAMAccess = Settings.BlockInvalidVRAMAccessMaster;
//// Warnings if (Settings.DisableGameSpecificHacks)
return;
// Reject strange hacked games // APU timing hacks
if ((ROMCRC32 == 0x6810aa95) || if (match_na("CIRCUIT USA"))
(ROMCRC32 == 0x340f23e5) || Timings.APUSpeedup = 3;
(ROMCRC32 == 0x77fd806a) ||
(match_nn("HIGHWAY BATTLE 2")) ||
(match_na("FX SKIING NINTENDO 96") && (ROM[0x7fda] == 0)) ||
(match_nn("HONKAKUHA IGO GOSEI") && (ROM[0xffd5] != 0x31)))
{
Settings.DisplayColor = BUILD_PIXEL(31, 0, 0);
SET_UI_COLOR(255, 0, 0);
}
//// APU timing hacks :(
Timings.APUSpeedup = 0;
if (!Settings.DisableGameSpecificHacks)
{
//if (match_id("AVCJ")) // Rendering Ranger R2
// Timings.APUSpeedup = 2;
if (match_na("CIRCUIT USA"))
Timings.APUSpeedup = 3;
/* if (match_na("GAIA GENSOUKI 1 JPN") || // Gaia Gensouki
match_id("JG ") || // Illusion of Gaia
match_id("CQ ") || // Stunt Race FX
match_na("SOULBLADER - 1") || // Soul Blader
match_na("SOULBLAZER - 1 USA") || // Soul Blazer
match_na("SLAP STICK 1 JPN") || // Slap Stick
match_id("E9 ") || // Robotrek
match_nn("ACTRAISER") || // Actraiser
match_nn("ActRaiser-2") || // Actraiser 2
match_id("AQT") || // Tenchi Souzou, Terranigma
match_id("ATV") || // Tales of Phantasia
match_id("ARF") || // Star Ocean
match_id("APR") || // Zen-Nippon Pro Wrestling 2 - 3-4 Budoukan
match_id("A4B") || // Super Bomberman 4
match_id("Y7 ") || // U.F.O. Kamen Yakisoban - Present Ban
match_id("Y9 ") || // U.F.O. Kamen Yakisoban - Shihan Ban
match_id("APB") || // Super Bomberman - Panic Bomber W
match_na("DARK KINGDOM") || // Dark Kingdom
match_na("ZAN3 SFC") || // Zan III Spirits
match_na("HIOUDEN") || // Hiouden - Mamono-tachi Tono Chikai
match_na("\xC3\xDD\xBC\xC9\xB3\xC0") || // Tenshi no Uta
match_na("FORTUNE QUEST") || // Fortune Quest - Dice wo Korogase
match_na("FISHING TO BASSING") || // Shimono Masaki no Fishing To Bassing
match_na("OHMONO BLACKBASS") || // Oomono Black Bass Fishing - Jinzouko Hen
match_na("MASTERS") || // Harukanaru Augusta 2 - Masters
match_na("SFC \xB6\xD2\xDD\xD7\xB2\xC0\xDE\xB0") || // Kamen Rider
match_na("ZENKI TENCHIMEIDOU") || // Kishin Douji Zenki - Tenchi Meidou
match_nn("TokyoDome '95Battle 7") || // Shin Nippon Pro Wrestling Kounin '95 - Tokyo Dome Battle 7
match_nn("SWORD WORLD SFC") || // Sword World SFC/2
match_nn("LETs PACHINKO(") || // BS Lets Pachinko Nante Gindama 1/2/3/4
match_nn("THE FISHING MASTER") || // Mark Davis The Fishing Master
match_nn("Parlor") || // Parlor mini/2/3/4/5/6/7, Parlor Parlor!/2/3/4/5
match_na("HEIWA Parlor!Mini8") || // Parlor mini 8
match_nn("SANKYO Fever! \xCC\xA8\xB0\xCA\xDE\xB0!")) // SANKYO Fever! Fever!
Timings.APUSpeedup = 1; */
}
S9xAPUTimingSetSpeedup(Timings.APUSpeedup); S9xAPUTimingSetSpeedup(Timings.APUSpeedup);
//// Other timing hacks :( // Other timing hacks
// The delay to sync CPU and DMA which Snes9x does not emulate.
Timings.HDMAStart = SNES_HDMA_START_HC + Settings.HDMATimingHack - 100; // Some games need really severe delay timing...
Timings.HBlankStart = SNES_HBLANK_START_HC + Timings.HDMAStart - SNES_HDMA_START_HC; if (match_na("BATTLE GRANDPRIX")) // Battle Grandprix
Timings.IRQTriggerCycles = 14; Timings.DMACPUSync = 20;
else if (match_na("KORYU NO MIMI ENG")) // Koryu no Mimi translation by rpgone)
if (!Settings.DisableGameSpecificHacks)
{ {
// The delay to sync CPU and DMA which Snes9x cannot emulate. // An infinite loop reads $4210 and checks NMI flag. This only works if LDA instruction executes before the NMI triggers,
// Some games need really severe delay timing... // which doesn't work very well with s9x's default DMA timing.
if (match_na("BATTLE GRANDPRIX")) // Battle Grandprix Timings.DMACPUSync = 20;
{
Timings.DMACPUSync = 20;
printf("DMA sync: %d\n", Timings.DMACPUSync);
}
else if (match_na("KORYU NO MIMI ENG")) // Koryu no Mimi translation by rpgone)
{
// An infinite loop reads $4210 and checks NMI flag. This only works if LDA instruction executes before the NMI triggers,
// which doesn't work very well with s9x's default DMA timing.
Timings.DMACPUSync = 20;
printf("DMA sync: %d\n", Timings.DMACPUSync);
}
} }
//// SRAM initial value if (Timings.DMACPUSync != 18)
printf("DMA sync: %d\n", Timings.DMACPUSync);
if (!Settings.DisableGameSpecificHacks) // SRAM initial value
if (match_na("HITOMI3"))
{ {
if (match_na("HITOMI3")) SRAMSize = 1;
{ SRAMMask = ((1 << (SRAMSize + 3)) * 128) - 1;
SRAMSize = 1;
SRAMMask = ((1 << (SRAMSize + 3)) * 128) - 1;
}
// SRAM value fixes
if (match_na("SUPER DRIFT OUT") || // Super Drift Out
match_na("SATAN IS OUR FATHER!") ||
match_na("goemon 4")) // Ganbare Goemon Kirakira Douchuu
SNESGameFixes.SRAMInitialValue = 0x00;
// Additional game fixes by sanmaiwashi ...
// XXX: unnecessary?
if (match_na("SFX \xC5\xB2\xC4\xB6\xDE\xDD\xC0\xDE\xD1\xD3\xC9\xB6\xDE\xC0\xD8 1")) // SD Gundam Gaiden - Knight Gundam Monogatari
SNESGameFixes.SRAMInitialValue = 0x6b;
// others: BS and ST-01x games are 0x00.
} }
//// OAM hacks :( // SRAM value fixes
if (match_na("SUPER DRIFT OUT") || // Super Drift Out
match_na("SATAN IS OUR FATHER!") ||
match_na("goemon 4")) // Ganbare Goemon Kirakira Douchuu
SNESGameFixes.SRAMInitialValue = 0x00;
if (!Settings.DisableGameSpecificHacks) // Additional game fixes by sanmaiwashi ...
// XXX: unnecessary?
if (match_na("SFX \xC5\xB2\xC4\xB6\xDE\xDD\xC0\xDE\xD1\xD3\xC9\xB6\xDE\xC0\xD8 1")) // SD Gundam Gaiden - Knight Gundam Monogatari
SNESGameFixes.SRAMInitialValue = 0x6b;
// others: BS and ST-01x games are 0x00.
// OAM hacks :(
// OAM hacks because we don't fully understand the behavior of the SNES.
// Totally wacky display in 2P mode...
// seems to need a disproven behavior, so we're definitely overlooking some other bug?
if (match_nn("UNIRACERS")) // Uniracers
{ {
// OAM hacks because we don't fully understand the behavior of the SNES. SNESGameFixes.Uniracers = TRUE;
// Totally wacky display in 2P mode... printf("Applied Uniracers hack.\n");
// seems to need a disproven behavior, so we're definitely overlooking some other bug?
if (match_nn("UNIRACERS")) // Uniracers
{
SNESGameFixes.Uniracers = TRUE;
printf("Applied Uniracers hack.\n");
}
} }
// Render Position
if (match_na("Sugoro Quest++"))
Timings.RenderPos = 128;
else if (match_na("FIREPOWER 2000"))
Timings.RenderPos = 32;
else if (match_na("DERBY STALLION 98"))
Timings.RenderPos = 128;
else if (match_na("AIR STRIKE PATROL") || match_na("DESERT FIGHTER"))
Timings.RenderPos = 128; // Just hides shadow
// From bsnes
else if (match_na("NHL '94") || match_na("NHL PROHOCKEY'94"))
Timings.RenderPos = 32;
else if (match_na("ADVENTURES OF FRANKEN") && Settings.PAL)
Timings.RenderPos = 32;
} }
// BPS % UPS % IPS // BPS % UPS % IPS