added random RAM pattern initialization on Mark-III & Japanese Master System (fixes "Alibaba and 40 Thieves" & "Block Hole")

This commit is contained in:
ekeeke31 2012-02-05 17:00:50 +00:00
parent cca17c642f
commit 83d4312e3c
2 changed files with 19 additions and 11 deletions

View File

@ -38,9 +38,6 @@
#include "shared.h"
#include "terebi_oekaki.h"
#ifdef NGC
#include "cheats.h"
#endif
#define MAPPER_NONE (0)
#define MAPPER_TEREBI (1)
@ -52,7 +49,7 @@
#define MAPPER_93C46 (7)
#define MAPPER_MULTI (8)
#define GAME_DATABASE_CNT (188)
#define GAME_DATABASE_CNT (190)
typedef struct
{
@ -133,6 +130,10 @@ static const rominfo_t game_list[GAME_DATABASE_CNT] =
{0xBD1CC7DF, 0, 0, SYSTEM_MS_GAMEPAD, MAPPER_SEGA, SYSTEM_MARKIII, REGION_JAPAN_NTSC}, /* Super Tetris (K) */
{0x6D309AC5, 0, 0, SYSTEM_MS_GAMEPAD, MAPPER_SEGA, SYSTEM_MARKIII, REGION_JAPAN_NTSC}, /* Power Boggle Boggle (K) */
/* games requiring random RAM pattern initialization */
{0x08BF3DE3, 0, 0, SYSTEM_MS_GAMEPAD, MAPPER_NONE, SYSTEM_MARKIII, REGION_JAPAN_NTSC}, /* Alibaba and 40 Thieves (KR) */
{0x643B6B76, 0, 0, SYSTEM_MS_GAMEPAD, MAPPER_NONE, SYSTEM_MARKIII, REGION_JAPAN_NTSC}, /* Block Hole (KR) */
/* games requiring PAL timings */
{0x72420F38, 0, 0, SYSTEM_MS_GAMEPAD, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* Addams Familly */
{0x2D48C1D3, 0, 0, SYSTEM_MS_GAMEPAD, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* Back to the Future Part III */
@ -932,9 +933,9 @@ static void mapper_8k_w(int offset, unsigned int data)
}
}
#ifdef NGC
/* update ROM patches */
ROMCheatUpdate();
#ifdef CHEATS_UPDATE
/* update ROM patches when banking has changed */
CHEATS_UPDATE();
#endif
}
@ -1076,9 +1077,9 @@ static void mapper_16k_w(int offset, unsigned int data)
}
}
#ifdef NGC
/* update ROM patches */
ROMCheatUpdate();
#ifdef CHEATS_UPDATE
/* update ROM patches when banking has changed */
CHEATS_UPDATE();
#endif
}

View File

@ -218,7 +218,7 @@ void gen_reset(int hard_reset)
/* System Reset */
if (hard_reset)
{
/* clear RAM (TODO: use random bit patterns as on real hardware) */
/* clear RAM (TODO: use random bit patterns for all systems, like on real hardware) */
memset(work_ram, 0x00, sizeof (work_ram));
memset(zram, 0x00, sizeof (zram));
}
@ -286,6 +286,13 @@ void gen_reset(int hard_reset)
}
else
{
/* RAM state at power-on is undefined on some systems */
if ((system_hw == SYSTEM_MARKIII) || ((system_hw & SYSTEM_SMS) && (region_code == REGION_JAPAN_NTSC)))
{
/* some korean games rely on RAM to be initialized with values different from $00 or $ff */
memset(work_ram, 0xf0, sizeof(work_ram));
}
/* Z80 cycles should be a multiple of 15 to avoid rounding errors */
mcycles_z80 = (mcycles_z80 / 15) * 15;