Previous 199869 Revisions Next

r31892 Wednesday 3rd September, 2014 at 16:22:41 UTC by Fabio Priuli
fixed pokey mapping in the a7800 carts. nw.
[src/emu/bus/a7800]a78_carts.h rom.c rom.h xboard.c
[src/mess/drivers]a7800.c

trunk/src/mess/drivers/a7800.c
r31891r31892
13141314   save_item(NAME(m_ctrl_reg));
13151315   save_item(NAME(m_maria_flag));
13161316   
1317   // install additional POKEY handlers
1317   // install additional handlers, if needed
13181318   switch (m_cartslot->get_cart_type())
13191319   {
1320      case A78_TYPE1:
1321      case A78_TYPE3:
1322      case A78_TYPEB:
1323      case A78_XB_BOARD:
1324         m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0400, 0x047f, read8_delegate(FUNC(a78_cart_slot_device::read_04xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_04xx),(a78_cart_slot_device*)m_cartslot));
1325         break;
13261320      case A78_HSC:
1321         // ROM+NVRAM accesses for HiScore
13271322         m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x17ff, read8_delegate(FUNC(a78_cart_slot_device::read_10xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_10xx),(a78_cart_slot_device*)m_cartslot));
13281323         m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x3000, 0x3fff, read8_delegate(FUNC(a78_cart_slot_device::read_30xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_30xx),(a78_cart_slot_device*)m_cartslot));
13291324         break;
1325      case A78_XB_BOARD:
1326         // POKEY and RAM regs at 0x400-0x47f
1327         m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0400, 0x047f, read8_delegate(FUNC(a78_cart_slot_device::read_04xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_04xx),(a78_cart_slot_device*)m_cartslot));
1328         break;
13301329      case A78_XM_BOARD:
1330         // POKEY and RAM and YM regs at 0x400-0x47f
13311331         m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0400, 0x047f, read8_delegate(FUNC(a78_cart_slot_device::read_04xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_04xx),(a78_cart_slot_device*)m_cartslot));
1332         // ROM+NVRAM accesses for HiScore
13321333         m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x17ff, read8_delegate(FUNC(a78_cart_slot_device::read_10xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_10xx),(a78_cart_slot_device*)m_cartslot));
13331334         m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x3000, 0x3fff, read8_delegate(FUNC(a78_cart_slot_device::read_30xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_30xx),(a78_cart_slot_device*)m_cartslot));
13341335         break;
trunk/src/emu/bus/a7800/rom.c
r31891r31892
194194/*-------------------------------------------------
195195
196196 Carts with no bankswitch + POKEY chip
197 The Pokey chips is accessed at 0x0450-0x045f or
198 by writing at 0x4000-0x7fff in some games.
197 The Pokey chips is accessed by writing at
198 0x4000-0x7fff.
199199 
200200 GAMES: Ballblazer, Beef Drop (homebrew)
201201 
r31891r31892
207207      m_pokey->write(space, offset & 0x0f, data);
208208}
209209
210READ8_MEMBER(a78_rom_pokey_device::read_04xx)
211{
212   if (offset >= 0x50 && offset < 0x60)
213      return m_pokey->read(space, offset & 0x0f);
214   else
215      return 0xff;
216}
217
218WRITE8_MEMBER(a78_rom_pokey_device::write_04xx)
219{
220   if (offset >= 0x50 && offset < 0x60)
221      m_pokey->write(space, offset & 0x0f, data);
222}
223
224210machine_config_constructor a78_rom_pokey_device::device_mconfig_additions() const
225211{
226212   return MACHINE_CONFIG_NAME( a78_pokey );
r31891r31892
264250/*-------------------------------------------------
265251
266252 Carts with SuperGame bankswitch + POKEY chip
267 As above, the Pokey chips is accessed at
253 As above + Pokey chip access
268254 
269255 GAMES: Commando
270256 
r31891r31892
278264      m_bank = data & m_bank_mask;
279265}
280266
281READ8_MEMBER(a78_rom_sg_pokey_device::read_04xx)
282{
283   if (offset >= 0x50 && offset < 0x60)
284      return m_pokey->read(space, offset & 0x0f);
285   else
286      return 0xff;
287}
288
289WRITE8_MEMBER(a78_rom_sg_pokey_device::write_04xx)
290{
291   if (offset >= 0x50 && offset < 0x60)
292      m_pokey->write(space, offset & 0x0f, data);
293}
294
295267machine_config_constructor a78_rom_sg_pokey_device::device_mconfig_additions() const
296268{
297269   return MACHINE_CONFIG_NAME( a78_pokey );
r31891r31892
405377      m_bank = (data & m_bank_mask) + 1;
406378}
407379
408READ8_MEMBER(a78_rom_xm_device::read_04xx)
409{
410   if (offset >= 0x50 && offset < 0x60)
411      return m_pokey->read(space, offset & 0x0f);
412   else
413      return 0xff;
414}
415
416WRITE8_MEMBER(a78_rom_xm_device::write_04xx)
417{
418   if (offset >= 0x50 && offset < 0x60)
419      m_pokey->write(space, offset & 0x0f, data);
420}
421
422380machine_config_constructor a78_rom_xm_device::device_mconfig_additions() const
423381{
424382   return MACHINE_CONFIG_NAME( a78_pokey );
425383}
426384
427
428385/*-------------------------------------------------
429386 
430387 Carts with Absolute bankswitch:
trunk/src/emu/bus/a7800/xboard.c
r31891r31892
2323 +-------------------------------+
2424 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
2525 +-------------------------------+
26 |   |   |   |   |   |   |   |
27 |   |   |   |   |   |   |   +-- Bank select bit 0 \
28 |   |   |   |   |   |   +------ Bank select bit 1  | Totally 128 KByte in 16 KByte banks
29 |   |   |   |   |   +---------- Bank select bit 2 /
30 |   |   |   |   +-------------- Enable memory bit** (1 = Memory enabled, 0 after power on)
31 |   |   |   +------------------ Enable POKEY bit (1 = POKEY enabled, 0 after power on)
32 |   |   |
33 NA  NA  NA = Not Available or Not Used
26   |   |   |   |   |   |   |   |
27   |   |   |   |   |   |   |   +-- Bank select bit 0 \
28   |   |   |   |   |   |   +------ Bank select bit 1  | Totally 128 KByte in 16 KByte banks
29   |   |   |   |   |   +---------- Bank select bit 2 /
30   |   |   |   |   +-------------- Enable memory bit (1 = Memory enabled, 0 after power on)
31   |   |   |   +------------------ Enable POKEY bit** (1 = POKEY enabled, 0 after power on)
32   |   |   |
33   NA  NA  NA = Not Available or Not Used
3434 
3535 * = Can be mounted piggy back on the first POKEY. Description how to do this will come when i have tried it out.
3636 ** This bit controls both POKEY chip select signals.
r31891r31892
234234      m_ram_bank = m_reg & 7;
235235   }
236236}
237
trunk/src/emu/bus/a7800/a78_carts.h
r31891r31892
1717   // not sure which dev cart support banked ram, nor whether there shall be a 9banks or a non-sg version of this...
1818   SLOT_INTERFACE_INTERNAL("a78_bankram",  A78_ROM_BANKRAM)   
1919   SLOT_INTERFACE_INTERNAL("a78_sg9",      A78_ROM_SG_9BANKS)
20   SLOT_INTERFACE_INTERNAL("a78_xmc",      A78_ROM_XM)   // carts compatible with the expansions below (basically a 9Banks+POKEY)
20   SLOT_INTERFACE_INTERNAL("a78_xmc",      A78_ROM_XM)    // carts compatible with the expansions below (basically a 9Banks+POKEY)
2121   SLOT_INTERFACE_INTERNAL("a78_abs",      A78_ROM_ABSOLUTE)
2222   SLOT_INTERFACE_INTERNAL("a78_act",      A78_ROM_ACTIVISION)
2323   SLOT_INTERFACE_INTERNAL("a78_hsc",      A78_HISCORE)
trunk/src/emu/bus/a7800/rom.h
r31891r31892
3636   virtual machine_config_constructor device_mconfig_additions() const;
3737   
3838   // reading and writing
39   virtual DECLARE_READ8_MEMBER(read_04xx);
40   virtual DECLARE_WRITE8_MEMBER(write_04xx);
4139   virtual DECLARE_WRITE8_MEMBER(write_40xx);
4240   
4341protected:
r31891r31892
7977   virtual machine_config_constructor device_mconfig_additions() const;
8078   
8179   // reading and writing
82   virtual DECLARE_READ8_MEMBER(read_04xx);
83   virtual DECLARE_WRITE8_MEMBER(write_04xx);
8480   virtual DECLARE_WRITE8_MEMBER(write_40xx);
8581   
8682protected:
r31891r31892
150146   virtual machine_config_constructor device_mconfig_additions() const;
151147   
152148   // reading and writing
153   virtual DECLARE_READ8_MEMBER(read_04xx);
154   virtual DECLARE_WRITE8_MEMBER(write_04xx);
155149   virtual DECLARE_WRITE8_MEMBER(write_40xx);
156150   
157151protected:

Previous 199869 Revisions Next


© 1997-2024 The MAME Team