trunk/src/mess/machine/gb_mbc.c
| r21444 | r21445 | |
| 25 | 25 | const device_type GB_ROM_MBC7 = &device_creator<gb_rom_mbc7_device>; |
| 26 | 26 | const device_type GB_ROM_MMM01 = &device_creator<gb_rom_mmm01_device>; |
| 27 | 27 | const device_type GB_ROM_SINTAX = &device_creator<gb_rom_sintax_device>; |
| 28 | const device_type GB_ROM_CHONGWU = &device_creator<gb_rom_chongwu_device>; |
| 28 | 29 | |
| 29 | 30 | |
| 30 | 31 | gb_rom_mbc_device::gb_rom_mbc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) |
| r21444 | r21445 | |
| 53 | 54 | { |
| 54 | 55 | } |
| 55 | 56 | |
| 57 | gb_rom_mbc5_device::gb_rom_mbc5_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) |
| 58 | : gb_rom_mbc_device(mconfig, type, name, tag, owner, clock) |
| 59 | { |
| 60 | } |
| 61 | |
| 56 | 62 | gb_rom_mbc5_device::gb_rom_mbc5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 57 | 63 | : gb_rom_mbc_device(mconfig, GB_ROM_MBC5, "GB MBC5 Carts", tag, owner, clock) |
| 58 | 64 | { |
| r21444 | r21445 | |
| 78 | 84 | { |
| 79 | 85 | } |
| 80 | 86 | |
| 87 | gb_rom_chongwu_device::gb_rom_chongwu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 88 | : gb_rom_mbc5_device(mconfig, GB_ROM_CHONGWU, "GB Chong Wu Xiao Jing Ling", tag, owner, clock) |
| 89 | { |
| 90 | } |
| 81 | 91 | |
| 92 | |
| 82 | 93 | void gb_rom_mbc_device::device_start() |
| 83 | 94 | { |
| 84 | 95 | has_timer = FALSE; |
| r21444 | r21445 | |
| 275 | 286 | save_item(NAME(m_xor5)); |
| 276 | 287 | } |
| 277 | 288 | |
| 289 | void gb_rom_chongwu_device::device_start() |
| 290 | { |
| 291 | has_timer = FALSE; |
| 292 | has_rumble = FALSE; |
| 293 | |
| 294 | m_latch_bank = 0; |
| 295 | m_latch_bank2 = 1; |
| 296 | m_ram_bank = 0; |
| 297 | m_ram_enable = 0; |
| 298 | m_mode = 0; |
| 299 | m_protection_checked = 0; |
| 300 | save_item(NAME(m_latch_bank)); |
| 301 | save_item(NAME(m_latch_bank2)); |
| 302 | save_item(NAME(m_ram_bank)); |
| 303 | save_item(NAME(m_ram_enable)); |
| 304 | save_item(NAME(m_mode)); |
| 305 | save_item(NAME(m_protection_checked)); |
| 306 | } |
| 278 | 307 | |
| 308 | |
| 279 | 309 | /*------------------------------------------------- |
| 280 | 310 | mapper specific handlers |
| 281 | 311 | -------------------------------------------------*/ |
| r21444 | r21445 | |
| 727 | 757 | } |
| 728 | 758 | } |
| 729 | 759 | |
| 760 | // MBC5 variant used by Chong Wu Xiao Jing Ling (this appears to be a re-release of a Li Cheng / Niutoude game, |
| 761 | // given that it contains the Niutoude logo, with most protection checks patched out) |
| 762 | |
| 763 | READ8_MEMBER(gb_rom_chongwu_device::read_rom) |
| 764 | { |
| 765 | // protection check at the first read here... |
| 766 | if (offset == 0x41c3 && !m_protection_checked) |
| 767 | { |
| 768 | m_protection_checked = 1; |
| 769 | return 0x5d; |
| 770 | } |
| 771 | |
| 772 | if (offset < 0x4000) |
| 773 | return m_rom[rom_bank_map[m_latch_bank] * 0x4000 + (offset & 0x3fff)]; |
| 774 | else |
| 775 | return m_rom[rom_bank_map[m_latch_bank2] * 0x4000 + (offset & 0x3fff)]; |
| 776 | } |
| 777 | |
| 730 | 778 | // MBC5 variant used by Sintax games |
| 731 | 779 | |
| 732 | 780 | void gb_rom_sintax_device::set_xor_for_bank(UINT8 bank) |
| r21444 | r21445 | |
| 809 | 857 | m_sintax_mode = data; |
| 810 | 858 | write_bank(space, 0x2000, 1); //force a fake bank switch |
| 811 | 859 | } |
| 812 | | printf("sintax mode %x\n", m_sintax_mode & 0xf); |
| 860 | // printf("sintax mode %x\n", m_sintax_mode & 0xf); |
| 813 | 861 | } |
| 814 | 862 | else if (offset >= 0x7000) |
| 815 | 863 | { |
| r21444 | r21445 | |
| 848 | 896 | if (m_ram && m_ram_enable) |
| 849 | 897 | m_ram[ram_bank_map[m_ram_bank] * 0x2000 + (offset & 0x1fff)] = data; |
| 850 | 898 | } |
| 899 | |
trunk/src/mess/machine/gb_mbc.h
| r21444 | r21445 | |
| 105 | 105 | { |
| 106 | 106 | public: |
| 107 | 107 | // construction/destruction |
| 108 | gb_rom_mbc5_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 108 | 109 | gb_rom_mbc5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 109 | 110 | |
| 110 | 111 | // device-level overrides |
| r21444 | r21445 | |
| 172 | 173 | UINT8 m_bank_mask, m_bank, m_reg; |
| 173 | 174 | }; |
| 174 | 175 | |
| 176 | // ======================> gb_rom_chongwu_device |
| 177 | |
| 178 | class gb_rom_chongwu_device : public gb_rom_mbc5_device |
| 179 | { |
| 180 | public: |
| 181 | // construction/destruction |
| 182 | gb_rom_chongwu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 183 | |
| 184 | // device-level overrides |
| 185 | virtual void device_start(); |
| 186 | virtual void device_config_complete() { m_shortname = "gb_rom_chongwu"; } |
| 187 | |
| 188 | virtual DECLARE_READ8_MEMBER(read_rom); |
| 189 | UINT8 m_protection_checked; |
| 190 | }; |
| 191 | |
| 175 | 192 | // ======================> gb_rom_sintax_device |
| 176 | 193 | class gb_rom_sintax_device : public gb_rom_mbc_device |
| 177 | 194 | { |
| r21444 | r21445 | |
| 207 | 224 | extern const device_type GB_ROM_MBC7; |
| 208 | 225 | extern const device_type GB_ROM_MMM01; |
| 209 | 226 | extern const device_type GB_ROM_SINTAX; |
| 227 | extern const device_type GB_ROM_CHONGWU; |
| 210 | 228 | |
| 211 | 229 | #endif |
trunk/hash/gbcolor.xml
| r21444 | r21445 | |
| 23361 | 23361 | </software> |
| 23362 | 23362 | |
| 23363 | 23363 | <!-- 1byte difference between this and the hacked version... check what is about! --> |
| 23364 | | <software name="chongwu" supported="no"> |
| 23364 | <software name="chongwu"> |
| 23365 | <!-- at 0x1e0 starts a routine which (at 0x1ec) reads from $41c3, then compares |
| 23366 | the value with 0x5d. if comparison fails, the code enters a routine at 0x780 |
| 23367 | where it gets stuck. if comparison works, then the code goes to 0x150 as the |
| 23368 | patched version does (because the single modified byte replaces the jump to |
| 23369 | 0x1e0 with the jump to 0x150). Not sure yet if current workaround is correct... --> |
| 23365 | 23370 | <description>Chong Wu Xiao Jing Ling - Jie Jin Ta Zhi Wang (Chi)</description> |
| 23366 | 23371 | <year>20??</year> |
| 23367 | 23372 | <publisher><unknown></publisher> |
| 23368 | 23373 | <info name="alt_title" value="宠物小精灵 结金塔之王"/> |
| 23369 | 23374 | <part name="cart" interface="gameboy_cart"> |
| 23370 | | <feature name="slot" value="rom_mbc5" /> |
| 23375 | <feature name="slot" value="rom_chong" /> |
| 23371 | 23376 | <!-- cartridge ram --> |
| 23372 | 23377 | <dataarea name="rom" size="1048576"> |
| 23373 | 23378 | <rom name="chong wu xiao jing ling - jie jin ta zhi wang (unlicensed, chinese) [raw dump].bin" size="1048576" crc="620e785d" sha1="74da832c2eeb27a4260fe6f42514539473f48b11" offset="000000" /> |
| r21444 | r21445 | |
| 23377 | 23382 | </part> |
| 23378 | 23383 | </software> |
| 23379 | 23384 | |
| 23380 | | <software name="chongwuh" cloneof="chongwu"> |
| 23381 | | <description>Chong Wu Xiao Jing Ling - Jie Jin Ta Zhi Wang (Chi, Hacked)</description> |
| 23382 | | <year>20??</year> |
| 23383 | | <publisher><unknown></publisher> |
| 23384 | | <info name="alt_title" value="宠物小精灵 结金塔之王"/> |
| 23385 | | <part name="cart" interface="gameboy_cart"> |
| 23386 | | <feature name="slot" value="rom_mbc5" /> |
| 23387 | | <!-- cartridge ram --> |
| 23388 | | <dataarea name="rom" size="1048576"> |
| 23389 | | <rom name="chong wu xiao jing ling - jie jin ta zhi wang (unlicensed, chinese) [fixed].bin" size="1048576" crc="24ee5c85" sha1="9fc1a8a1a75fd535980aee8966f4d5f8609e5ef5" offset="000000" /> |
| 23390 | | </dataarea> |
| 23391 | | <dataarea name="nvram" size="32768"> |
| 23392 | | </dataarea> |
| 23393 | | </part> |
| 23394 | | </software> |
| 23395 | | |
| 23396 | 23385 | <software name="jyqxc2"> |
| 23397 | 23386 | <description>Jin Yong Qun Xia Chuan II (Chi)</description> |
| 23398 | 23387 | <year>20??</year> |