(MESS)sms.c: Improved memory initialization on Japanese and Korean consoles. This fixes softwre list entries alibaba and blockhol. [Enik Land]

This commit is contained in:
Wilbert Pol 2013-01-13 11:11:36 +00:00
parent e81b792d28
commit b56e1fdc69
2 changed files with 18 additions and 2 deletions

View File

@ -329,7 +329,7 @@
</part>
</software>
<software name="alibaba" supported="no">
<software name="alibaba">
<description>Alibaba and 40 Thieves (Kor)</description>
<year>1989</year>
<publisher>HiCom</publisher>
@ -851,7 +851,7 @@
</part>
</software>
<software name="blockhol" supported="no">
<software name="blockhol">
<description>Block Hole (Kor)</description>
<year>1990</year>
<publisher>Zemina</publisher>

View File

@ -1927,6 +1927,22 @@ MACHINE_START_MEMBER(sms_state,sms)
/* Check if lightgun has been chosen as input: if so, enable crosshair */
machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(sms_state::lightgun_tick),this));
// alibaba and blockhol are ports of games for the MSX system. The
// MSX bios usually initializes callback "vectors" at the top of RAM.
// The code in alibaba does not do this so the IRQ vector only contains
// the "call $4010" without a following RET statement. That is basically
// a bug in the program code. The only way this cartridge could have run
// successfully on a real unit is if the RAM would be initialized with
// a F0 pattern on power up; F0 = RET P.
//
// alibaba and blockhol SMS cartridges rely on uninitialized RAM,
// then fill it with a F0 pattern ("RET P"), but only for consoles
// in Japan region (including KR), until confirmed on other consoles.
if (m_is_region_japan)
{
memset((UINT8*)m_space->get_write_ptr(0xc000), 0xf0, 0x1FF0);
}
}
MACHINE_RESET_MEMBER(sms_state,sms)