(MESS) NES: hopefully fixed a crash occurring at exit when PRG is not a multiple of 16KB.

Also promoted to working state two other SMB clones running on the same pcb as 
SMB Malee 2 (whose support was added a few days ago). nw.
This commit is contained in:
Fabio Priuli 2013-04-24 21:49:57 +00:00
parent 9619440925
commit ee33a7bfaf
2 changed files with 51 additions and 34 deletions

View File

@ -60832,40 +60832,6 @@ We don't include these hacks because they were not burned into real carts nor so
</part>
</software>
<software name="tinchoml" supported="no">
<description>Tin Choi Ma Lei (Chi)</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="mmalee2" />
<feature name="pcb" value="BTL-MARIO1-MALEE2" />
<dataarea name="chr" size="8192">
<rom name="tin choi ma lei (ch) [u].chr" size="8192" crc="078a4304" sha1="05056bace92931aeaa6b86a13e44f2da75e7a765" offset="00000" status="baddump" />
</dataarea>
<dataarea name="prg" size="65536"> <!-- CHECK THIS -->
<rom name="tin choi ma lei (ch) [u].prg0" size="32768" crc="ddf910b2" sha1="3977f975b2db0fba6cce8621d7d49a2b86ff2c43" offset="00000" status="baddump" />
<rom name="tin choi ma lei (ch) [u].prg1" size="2048" crc="2ee84bd0" sha1="51239bdc89ee3f1b7c9b17a63bff1fc20a36b244" offset="0x08000" status="baddump" />
</dataarea>
</part>
</software>
<software name="tinchomla" cloneof="tinchoml" supported="no">
<description>Tin Choi Ma Lei (Chi, Alt)</description>
<year>19??</year>
<publisher>JMH MTV Corp?</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="mmalee2" />
<feature name="pcb" value="BTL-MARIO1-MALEE2" />
<dataarea name="chr" size="8192">
<rom name="genius merio bros. (tin choi ma lei).chr" size="8192" crc="da934ea9" sha1="ee09df7a90c2a39cce87fdcdfa6e65aed01767ff" offset="00000" status="baddump" />
</dataarea>
<dataarea name="prg" size="65536"> <!-- CHECK THIS -->
<rom name="genius merio bros. (tin choi ma lei).prg0" size="32768" crc="ddf910b2" sha1="3977f975b2db0fba6cce8621d7d49a2b86ff2c43" offset="00000" status="baddump" />
<rom name="genius merio bros. (tin choi ma lei).prg1" size="2048" crc="2ee84bd0" sha1="51239bdc89ee3f1b7c9b17a63bff1fc20a36b244" offset="0x08000" status="baddump" />
</dataarea>
</part>
</software>
<software name="ttoons6" supported="no">
<description>Tiny Toon Adventures 6 (Asia)</description>
<year>19??</year>
@ -63403,6 +63369,48 @@ Also notice that VRAM & WRAM are probably incorrect for some of these sets, at t
</part>
</software>
<software name="tinchoml" cloneof="smb">
<description>Tin Choi Ma Lei (Chi)</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="mmalee2" />
<feature name="pcb" value="BTL-MARIO1-MALEE2" />
<feature name="mirroring" value="vertical" />
<dataarea name="chr" size="8192">
<rom name="tin choi ma lei (ch) [u].chr" size="8192" crc="078a4304" sha1="05056bace92931aeaa6b86a13e44f2da75e7a765" offset="00000" status="baddump" />
</dataarea>
<dataarea name="prg" size="65536">
<rom name="tin choi ma lei (ch) [u].prg0" size="32768" crc="ddf910b2" sha1="3977f975b2db0fba6cce8621d7d49a2b86ff2c43" offset="00000" status="baddump" />
<rom name="tin choi ma lei (ch) [u].prg1" size="2048" crc="2ee84bd0" sha1="51239bdc89ee3f1b7c9b17a63bff1fc20a36b244" offset="0x08000" status="baddump" />
</dataarea>
<!-- 2k WRAM on cartridge -->
<dataarea name="wram" size="2048">
</dataarea>
</part>
</software>
<software name="geniusm" cloneof="smb">
<description>Genius Merio Bros. (Chi)</description>
<year>19??</year>
<publisher>JMH MTV Corp?</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="mmalee2" />
<feature name="pcb" value="BTL-MARIO1-MALEE2" />
<feature name="mirroring" value="vertical" />
<dataarea name="chr" size="8192">
<rom name="genius merio bros. (tin choi ma lei).chr" size="8192" crc="da934ea9" sha1="ee09df7a90c2a39cce87fdcdfa6e65aed01767ff" offset="00000" status="baddump" />
</dataarea>
<dataarea name="prg" size="65536">
<rom name="genius merio bros. (tin choi ma lei).prg0" size="32768" crc="ddf910b2" sha1="3977f975b2db0fba6cce8621d7d49a2b86ff2c43" offset="00000" status="baddump" />
<rom name="genius merio bros. (tin choi ma lei).prg1" size="2048" crc="2ee84bd0" sha1="51239bdc89ee3f1b7c9b17a63bff1fc20a36b244" offset="0x08000" status="baddump" />
</dataarea>
<!-- 2k WRAM on cartridge -->
<dataarea name="wram" size="2048">
</dataarea>
</part>
</software>
<software name="smb2fdsa" cloneof="smb2fds">
<description>Super Mario Bros. 2 (FDS conversion)</description>
<year>19??</year>

View File

@ -118,6 +118,15 @@ void device_nes_cart_interface::prg_alloc(running_machine &machine, size_t size)
m_prg = auto_alloc_array_clear(machine, UINT8, size);
m_prg_size = size;
m_prg_chunks = size / 0x4000;
if (size % 0x4000)
{
// A few pirate carts have PRG made of 32K + 2K or some weird similar config
// in this case we treat the banking as if this 'extra' PRG is not present and
// the pcb code has to handle it by accessing directly m_prg!
printf("Warning! The loaded PRG has size not a multiple of 16KB (0x%X)\n", (UINT32)size);
m_prg_chunks--;
}
m_prg_mask = ((m_prg_chunks << 1) - 1);
// printf("first mask %x!\n", m_prg_mask);