Previous 199869 Revisions Next

r32519 Saturday 4th October, 2014 at 03:48:09 UTC by Fabio Priuli
(MESS) vboy uses no bankswitch, so we can gain back most
speed with the same direct rom mapping used for gba. nw.
[src/emu/bus/vboy]slot.c
[src/mess/drivers]vboy.c

trunk/src/emu/bus/vboy/slot.c
r32518r32519
171171         seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
172172         return IMAGE_INIT_FAIL;
173173      }
174     
175      m_cart->rom_alloc(len, tag());
174
175      // always alloc 0x200000 so to be able to directly map the region
176      // to the address map (speeding up emulation a bit)
177      m_cart->rom_alloc(0x200000, tag());
176178      if (has_eeprom)
177179         m_cart->eeprom_alloc(get_software_region_length("eeprom"));
178180         
r32518r32519
183185      else
184186         memcpy(ROM, get_software_region("rom"), len);
185187
188      if (len < 0x080000) { memcpy(ROM + 0x040000, ROM, 0x040000); }
189      if (len < 0x100000) { memcpy(ROM + 0x080000, ROM, 0x080000); }
190      if (len < 0x200000) { memcpy(ROM + 0x100000, ROM, 0x100000); }
191     
186192      if (software_entry() == NULL)
187193         m_type = vboy_get_pcb_id("vb_rom");
188194      else
trunk/src/mess/drivers/vboy.c
r32518r32519
157157   required_device<vboy_cart_slot_device> m_cart;
158158   required_device<timer_device> m_maintimer;
159159   required_device<palette_device> m_palette;
160   memory_region *m_cart_rom;
160161
161162   DECLARE_READ32_MEMBER(io_r);
162163   DECLARE_WRITE32_MEMBER(io_w);
r32518r32519
11111112   //AM_RANGE( 0x04000000, 0x04ffffff ) // Expansion area
11121113   AM_RANGE( 0x05000000, 0x0500ffff ) AM_MIRROR(0x0ff0000) AM_RAM AM_SHARE("wram")// Main RAM - 64K mask 0xffff
11131114   AM_RANGE( 0x06000000, 0x06003fff ) AM_DEVREADWRITE("cartslot", vboy_cart_slot_device, read_eeprom, write_eeprom) // Cart RAM - 8K NVRAM
1114   AM_RANGE( 0x07000000, 0x071fffff ) AM_MIRROR(0x0e00000) AM_DEVREAD("cartslot", vboy_cart_slot_device, read_cart) /* ROM */
1115//   AM_RANGE( 0x07000000, 0x071fffff ) AM_MIRROR(0x0e00000) AM_DEVREAD("cartslot", vboy_cart_slot_device, read_cart) /* ROM */
11151116ADDRESS_MAP_END
11161117
11171118static ADDRESS_MAP_START( vboy_io, AS_IO, 32, vboy_state )
r32518r32519
11401141//  AM_RANGE( 0x04000000, 0x04ffffff ) // Expansion area
11411142   AM_RANGE( 0x05000000, 0x0500ffff ) AM_MIRROR(0x0ff0000) AM_RAM AM_SHARE("wram") // Main RAM - 64K mask 0xffff
11421143   AM_RANGE( 0x06000000, 0x06003fff ) AM_NOP // Cart RAM - 8K NVRAM ?
1143   AM_RANGE( 0x07000000, 0x071fffff ) AM_MIRROR(0x0e00000) AM_DEVREAD("cartslot", vboy_cart_slot_device, read_cart) /* ROM */
1144//   AM_RANGE( 0x07000000, 0x071fffff ) AM_MIRROR(0x0e00000) AM_DEVREAD("cartslot", vboy_cart_slot_device, read_cart) /* ROM */
11441145ADDRESS_MAP_END
11451146
11461147/* Input ports */
r32518r32519
11671168
11681169void vboy_state::machine_start()
11691170{
1171   // install the cart ROM as a bank into the address map.
1172   // this speeds up the rom access, by skipping the m_cart->read_rom
1173   // trampoline (but forces us to alloc always a 0x200000-wide region)
11701174   if (m_cart->exists())
1175   {
1176      astring region_tag;
1177      m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(VBOYSLOT_ROM_REGION_TAG));
1178
1179      m_maincpu->space(AS_PROGRAM).install_read_bank(0x07000000, 0x071fffff, 0, 0x0e00000, "prog_cart_bank");
1180      m_maincpu->space(AS_IO).install_read_bank(0x07000000, 0x071fffff, 0, 0x0e00000, "io_cart_bank");
1181      membank("prog_cart_bank")->set_base(m_cart_rom->base());
1182      membank("io_cart_bank")->set_base(m_cart_rom->base());
1183
11711184      m_cart->save_eeprom();
1185   }
11721186}
11731187
11741188void vboy_state::machine_reset()

Previous 199869 Revisions Next


© 1997-2024 The MAME Team