Previous 199869 Revisions Next

r31923 Friday 5th September, 2014 at 15:24:35 UTC by Fabio Priuli
(MESS) gameboy: added dump of Color GameBoy 188 in 1 multicart,
and partially implemented the required mapper [Team Europe, Fabio Priuli]


after selecting a game, the CPU always points to the correct bank of the cart,
but some games don't work anyway (e.g. Duck Tales, PacMan, etc.)
I don't have time to further debug this, at the moment, so I leave it to whoever
wants to take a look
[hash]gameboy.xml
[src/emu/bus/gameboy]gb_slot.c gb_slot.h mbc.c mbc.h
[src/mess/drivers]gb.c

trunk/hash/gameboy.xml
r31922r31923
2385123851   </software>
2385223852
2385323853
23854   <software name="188in1" supported="partial">
23855      <description>Color GameBoy 188 in 1 (HK)</description>
23856      <year>199?</year>
23857      <publisher>&lt;unknown&gt;</publisher>
23858      <part name="cart" interface="gameboy_cart">
23859         <feature name="slot" value="rom_188in1" />
23860         <dataarea name="rom" size="8388608">
23861            <rom name="m29w640ft.u2" size="8388608" crc="e4068d7d" sha1="e61ee50ed39fd5b5cc8bdcb96fe1c3cccdcfc76f" offset="000000" />
23862         </dataarea>
23863      </part>
23864   </software>
23865
23866
2385423867<!-- Non game cartridges -->
2385523868
2385623869   <software name="ggenie" supported="no">
trunk/src/emu/bus/gameboy/mbc.h
r31922r31923
3535{
3636public:
3737   // construction/destruction
38   gb_rom_mbc1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
3839   gb_rom_mbc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3940
4041   // device-level overrides
r31922r31923
176177   UINT8 m_bank_mask, m_bank, m_reg;
177178};
178179
180// ======================> gb_rom_188in1_device
181class gb_rom_188in1_device : public gb_rom_mbc1_device
182{
183public:
184   // construction/destruction
185   gb_rom_188in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
186   
187   // device-level overrides
188   virtual void device_start() { shared_start(); save_item(NAME(m_game_base)); };
189   virtual void device_reset() { shared_reset(); m_game_base = 0; };
190   
191   // reading and writing
192   virtual DECLARE_READ8_MEMBER(read_rom);
193   virtual DECLARE_WRITE8_MEMBER(write_bank);
194
195private:
196   UINT32 m_game_base;
197};
198
179199// ======================> gb_rom_sintax_device
180200class gb_rom_sintax_device : public gb_rom_mbc_device
181201{
r31922r31923
293313extern const device_type GB_ROM_MBC6;
294314extern const device_type GB_ROM_MBC7;
295315extern const device_type GB_ROM_MMM01;
316extern const device_type GB_ROM_188IN1;
296317extern const device_type GB_ROM_SINTAX;
297318extern const device_type GB_ROM_CHONGWU;
298319extern const device_type GB_ROM_LICHENG;
trunk/src/emu/bus/gameboy/gb_slot.c
r31922r31923
220220   { GB_MBC_SM3SP, "rom_sm3sp" },
221221   { GB_MBC_UNK01, "rom_unk01" },
222222   { GB_MBC_DKONG5, "rom_dkong5" },
223   { GB_MBC_CAMERA, "rom_camera" }
223   { GB_MBC_CAMERA, "rom_camera" },
224   { GB_MBC_188IN1, "rom_188in1" }
224225};
225226
226227static int gb_get_pcb_id(const char *slot)
trunk/src/emu/bus/gameboy/gb_slot.h
r31922r31923
2727   GB_MBC_LASAMA,       /*    ?? ROM,    ?? RAM - Appears in La Sa Ma */
2828   GB_MBC_ATVRACIN,
2929   GB_MBC_CAMERA,
30   GB_MBC_188IN1,
3031   GB_MBC_SINTAX,
3132   GB_MBC_CHONGWU,
3233   GB_MBC_LICHENG,
trunk/src/emu/bus/gameboy/mbc.c
r31922r31923
2424const device_type GB_ROM_MBC6 = &device_creator<gb_rom_mbc6_device>;
2525const device_type GB_ROM_MBC7 = &device_creator<gb_rom_mbc7_device>;
2626const device_type GB_ROM_MMM01 = &device_creator<gb_rom_mmm01_device>;
27const device_type GB_ROM_188IN1 = &device_creator<gb_rom_188in1_device>;
2728const device_type GB_ROM_SINTAX = &device_creator<gb_rom_sintax_device>;
2829const device_type GB_ROM_CHONGWU = &device_creator<gb_rom_chongwu_device>;
2930const device_type GB_ROM_LICHENG = &device_creator<gb_rom_licheng_device>;
r31922r31923
3839{
3940}
4041
42gb_rom_mbc1_device::gb_rom_mbc1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
43               : gb_rom_mbc_device(mconfig, type, name, tag, owner, clock, shortname, source)
44{
45}
46
4147gb_rom_mbc1_device::gb_rom_mbc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4248               : gb_rom_mbc_device(mconfig, GB_ROM_MBC1, "GB MBC1 Carts", tag, owner, clock, "gb_rom_mbc1", __FILE__)
4349{
r31922r31923
8389{
8490}
8591
92gb_rom_188in1_device::gb_rom_188in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
93               : gb_rom_mbc1_device(mconfig, GB_ROM_188IN1, "GB 188in1", tag, owner, clock, "gb_rom_188in1", __FILE__)
94{
95}
96
8697gb_rom_sintax_device::gb_rom_sintax_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
8798               : gb_rom_mbc_device(mconfig, GB_ROM_SINTAX, "GB MBC5 Sintax Carts", tag, owner, clock, "gb_rom_sintax", __FILE__)
8899{
r31922r31923
262273
263274// MBC1
264275
265
266276READ8_MEMBER(gb_rom_mbc1_device::read_rom)
267277{
268278   if (offset < 0x4000)
r31922r31923
689699   }
690700}
691701
702// 188 in 1 pirate (only preliminary)
703
704READ8_MEMBER(gb_rom_188in1_device::read_rom)
705{
706   if (offset < 0x4000)
707      return m_rom[m_game_base + rom_bank_map[m_latch_bank] * 0x4000 + (offset & 0x3fff)];
708   else
709      return m_rom[m_game_base + rom_bank_map[m_latch_bank2] * 0x4000 + (offset & 0x3fff)];
710}
711
712WRITE8_MEMBER(gb_rom_188in1_device::write_bank)
713{
714   if (offset == 0x7b00)
715   {
716      if (data < 0x80)
717         logerror("write to 0x%X data 0x%X\n", offset, data);
718      else
719      {
720         data -= 0x80;
721         m_game_base = 0x400000 + (data * 0x8000);
722         //logerror("offset 0x%X\n", m_game_base);
723      }
724   }
725   else if (offset == 0x7b01 || offset == 0x7b02)
726   {
727      // what do these writes do?
728      printf("write to 0x%X data 0x%X\n", offset, data);
729   }
730   else
731      gb_rom_mbc1_device::write_bank(space, offset, data);
732}
733
734
692735// MBC5 variant used by Li Cheng / Niutoude games
693736
694737WRITE8_MEMBER(gb_rom_licheng_device::write_bank)
trunk/src/mess/drivers/gb.c
r31922r31923
627627   SLOT_INTERFACE_INTERNAL("rom_lasama",  GB_ROM_LASAMA)
628628   SLOT_INTERFACE_INTERNAL("rom_atvrac",  GB_ROM_ATVRAC)
629629   SLOT_INTERFACE_INTERNAL("rom_camera",  GB_STD_ROM)
630   SLOT_INTERFACE_INTERNAL("rom_188in1",  GB_ROM_188IN1)
630631   SLOT_INTERFACE_INTERNAL("rom_sintax",  GB_ROM_SINTAX)
631632   SLOT_INTERFACE_INTERNAL("rom_chong",   GB_ROM_CHONGWU)
632633   SLOT_INTERFACE_INTERNAL("rom_licheng", GB_ROM_LICHENG)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team