Previous 199869 Revisions Next

r32185 Thursday 18th September, 2014 at 20:36:02 UTC by Fabio Priuli
(MESS) unified some functions for generic socket / cart and
converted a few more drivers to use the new code instead of
old cartslot. nw.
[src/emu/bus/generic]slot.c slot.h
[src/mess/drivers]aquarius.c atarist.c bbcbc.c pv2000.c rx78.c supracan.c
[src/mess/includes]aquarius.h atarist.h

trunk/src/emu/bus/generic/slot.c
r32184r32185
135135      }
136136      else
137137      {
138         UINT32 len = (software_entry() == NULL) ? length() : get_software_region_length("rom");
139         UINT8 *ROM;
138         UINT32 len = common_get_size("rom");
140139         
141         rom_alloc(len, m_width);         
142         ROM = get_rom_base();
143         
144         if (software_entry() == NULL)
145            fread(ROM, len);
146         else
147            memcpy(ROM, get_software_region("rom"), len);
148         
140         rom_alloc(len, m_width);
141         common_load_rom(get_rom_base(), len, "rom");         
149142         m_empty = FALSE;
150143
151144         return IMAGE_INIT_PASS;
r32184r32185
188181   software_get_default_slot(result, m_default_card);
189182}
190183
184
185/**************************************************
186
187 Implementation
188 
189 **************************************************/
190
191
191192/*-------------------------------------------------
193 common_get_size - it gets image file size both
194 for fullpath and for softlist
195 -------------------------------------------------*/
196
197UINT32 generic_slot_device::common_get_size(const char *region)
198{
199   // if we are loading from softlist, you have to specify a region
200   assert((software_entry() != NULL) && !region);
201
202   return (software_entry() == NULL) ? length() : get_software_region_length(region);
203}
204
205/*-------------------------------------------------
206 common_load_rom - it loads from image file both
207 for fullpath and for softlist
208 -------------------------------------------------*/
209
210void generic_slot_device::common_load_rom(UINT8 *ROM, UINT32 len, const char *region)
211{
212   // basic sanity check
213   assert((ROM != NULL) && (len > 0));
214
215   // if we are loading from softlist, you have to specify a region
216   assert((software_entry() == NULL) || (region != NULL));
217
218   if (software_entry() == NULL)
219      fread(ROM, len);
220   else
221      memcpy(ROM, get_software_region(region), len);
222}
223
224/*-------------------------------------------------
192225 read_rom
193226 -------------------------------------------------*/
194227
r32184r32185
225258}
226259
227260/*-------------------------------------------------
228 write
261 write_ram
229262 -------------------------------------------------*/
230263
231264WRITE8_MEMBER(generic_slot_device::write_ram)
trunk/src/emu/bus/generic/slot.h
r32184r32185
101101   virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry);
102102
103103   bool cart_mounted() { return !m_empty; }
104   UINT32 common_get_size(const char *region);
105   void common_load_rom(UINT8 *ROM, UINT32 len, const char *region);
104106
105107   virtual iodevice_t image_type() const { return IO_CARTSLOT; }
106108   virtual bool is_readable()  const { return 1; }
trunk/src/mess/drivers/pv2000.c
r32184r32185
360360
361361DEVICE_IMAGE_LOAD_MEMBER( pv2000_state, pv2000_cart )
362362{
363   UINT8 *cart;
364   UINT32 size;
363   UINT32 size = m_cart->common_get_size("rom");
365364   
366   if (image.software_entry() == NULL)
367      size = image.length();
368   else
369      size = image.get_software_region_length("rom");
370   
371365   if (size != 0x2000 && size != 0x4000)
372366   {
373367      image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
r32184r32185
375369   }
376370   
377371   m_cart->rom_alloc(size, 1);
378   cart = m_cart->get_rom_base();
372   m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");         
379373   
380   if (image.software_entry() == NULL)
381      image.fread(cart, size);
382   else
383      memcpy(cart, image.get_software_region("rom"), size);
384   
385374   return IMAGE_INIT_PASS;
386375}
387376
trunk/src/mess/drivers/aquarius.c
r32184r32185
171171
172172READ8_MEMBER(aquarius_state::cartridge_r)
173173{
174   UINT8 *rom = m_rom->base() + 0xc000;
175   return rom[offset] ^ m_scrambler;
174   UINT8 data = 0;
175   if (m_cart->cart_mounted())
176      data = m_cart->read_rom(space, offset);
177
178   return data ^ m_scrambler;
176179}
177180
178181
r32184r32185
373376   MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED)
374377
375378   /* cartridge */
376   MCFG_CARTSLOT_ADD("cart")
377   MCFG_CARTSLOT_EXTENSION_LIST("bin")
378   MCFG_CARTSLOT_NOT_MANDATORY
379   MCFG_CARTSLOT_INTERFACE("aquarius_cart")
379   MCFG_GENERIC_CARTSLOT_ADD("cartslot", GENERIC_ROM8_WIDTH, generic_linear_slot, "aquarius_cart")
380380
381381   /* internal ram */
382382   MCFG_RAM_ADD(RAM_TAG)
r32184r32185
402402   ROM_SYSTEM_BIOS(1, "rev2", "Revision 2")
403403   ROMX_LOAD("aq2.u2", 0x0000, 0x2000, CRC(a2d15bcf) SHA1(ca6ef55e9ead41453efbf5062d6a60285e9661a6), ROM_BIOS(2))
404404
405   /* cartridge */
406   ROM_CART_LOAD("cart", 0xc000, 0x4000, ROM_MIRROR)
407
408405   /* charrom */
409406   ROM_REGION(0x800, "gfx1", 0)
410407   ROM_LOAD("aq2.u5", 0x000, 0x800, CRC(e117f57c) SHA1(3588c0267c67dfbbda615bcf8dc3d3a5c5bd815a))
trunk/src/mess/drivers/atarist.c
r32184r32185
12281228   AM_RANGE(0x000008, 0x1fffff) AM_RAM
12291229   AM_RANGE(0x200000, 0x3fffff) AM_RAM
12301230   AM_RANGE(0x400000, 0xf9ffff) AM_READWRITE(berr_r, berr_w)
1231   AM_RANGE(0xfa0000, 0xfbffff) AM_ROM AM_REGION("cart", 0)
1231   //AM_RANGE(0xfa0000, 0xfbffff)      // mapped by the cartslot
12321232   AM_RANGE(0xfc0000, 0xfeffff) AM_ROM AM_REGION(M68000_TAG, 0) AM_WRITE(berr_w)
12331233   AM_RANGE(0xff8000, 0xff8001) AM_READWRITE8(mmu_r, mmu_w, 0x00ff)
12341234   AM_RANGE(0xff8200, 0xff8203) AM_READWRITE8(shifter_base_r, shifter_base_w, 0x00ff)
r32184r32185
12721272   AM_RANGE(0x000000, 0x000007) AM_ROM AM_REGION(M68000_TAG, 0)
12731273   AM_RANGE(0x000008, 0x1fffff) AM_RAM
12741274   AM_RANGE(0x200000, 0x3fffff) AM_RAM
1275   AM_RANGE(0xfa0000, 0xfbffff) AM_ROM AM_REGION("cart", 0)
1275   //AM_RANGE(0xfa0000, 0xfbffff)      // mapped by the cartslot
12761276   AM_RANGE(0xfc0000, 0xfeffff) AM_ROM AM_REGION(M68000_TAG, 0)
12771277//  AM_RANGE(0xff7f30, 0xff7f31) AM_READWRITE(blitter_dst_inc_y_r, blitter_dst_inc_y_w) // for TOS 1.02
12781278   AM_RANGE(0xff8000, 0xff8001) AM_READWRITE8(mmu_r, mmu_w, 0x00ff)
r32184r32185
19371937   // configure RAM banking
19381938   configure_memory();
19391939
1940   if (m_cart->cart_mounted())
1941      m_maincpu->space(AS_PROGRAM).install_read_handler(0xfa0000, 0xfbffff, read16_delegate(FUNC(generic_slot_device::read16_rom),(generic_slot_device*)m_cart));
1942
19401943   // allocate timers
19411944   if(m_mousex) {
19421945      m_mouse_timer = timer_alloc(TIMER_MOUSE_TICK);
r32184r32185
19951998   /* configure RAM banking */
19961999   configure_memory();
19972000
2001   if (m_cart->cart_mounted())
2002      m_maincpu->space(AS_PROGRAM).install_read_handler(0xfa0000, 0xfbffff, read16_delegate(FUNC(generic_slot_device::read16_rom),(generic_slot_device*)m_cart));
2003
19982004   /* allocate timers */
19992005   m_dmasound_timer = timer_alloc(TIMER_DMASOUND_TICK);
20002006   m_microwire_timer = timer_alloc(TIMER_MICROWIRE_TICK);
r32184r32185
20372043      break;
20382044   }
20392045
2046   if (m_cart->cart_mounted())
2047      m_maincpu->space(AS_PROGRAM).install_read_handler(0xfa0000, 0xfbffff, read16_delegate(FUNC(generic_slot_device::read16_rom),(generic_slot_device*)m_cart));
2048
20402049   /* register for state saving */
20412050   ste_state::state_save();
20422051
r32184r32185
21332142   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(st_state, write_acia_clock))
21342143
21352144   // cartridge
2136   MCFG_CARTSLOT_ADD("cart")
2137   MCFG_CARTSLOT_EXTENSION_LIST("bin,rom")
2138   MCFG_CARTSLOT_NOT_MANDATORY
2139   MCFG_CARTSLOT_INTERFACE("st_cart")
2145   MCFG_GENERIC_CARTSLOT_ADD("cartslot", GENERIC_ROM16_WIDTH, generic_linear_slot, "st_cart")
2146   MCFG_GENERIC_EXTENSIONS("bin,rom")
21402147   MCFG_SOFTWARE_LIST_ADD("cart_list", "st_cart")
21412148
21422149   // internal ram
r32184r32185
22242231   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(st_state, write_acia_clock))
22252232
22262233   // cartridge
2227   MCFG_CARTSLOT_ADD("cart")
2228   MCFG_CARTSLOT_EXTENSION_LIST("bin,rom")
2229   MCFG_CARTSLOT_NOT_MANDATORY
2230   MCFG_CARTSLOT_INTERFACE("st_cart")
2234   MCFG_GENERIC_CARTSLOT_ADD("cartslot", GENERIC_ROM16_WIDTH, generic_linear_slot, "st_cart")
2235   MCFG_GENERIC_EXTENSIONS("bin,rom")
22312236   MCFG_SOFTWARE_LIST_ADD("cart_list", "st_cart")
22322237
22332238   // internal ram
r32184r32185
23222327   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(st_state, write_acia_clock))
23232328
23242329   // cartridge
2325   MCFG_CARTSLOT_ADD("cart")
2326   MCFG_CARTSLOT_EXTENSION_LIST("bin,rom")
2327   MCFG_CARTSLOT_NOT_MANDATORY
2328   MCFG_CARTSLOT_INTERFACE("st_cart")
2330   MCFG_GENERIC_CARTSLOT_ADD("cartslot", GENERIC_ROM16_WIDTH, generic_linear_slot, "st_cart")
2331   MCFG_GENERIC_EXTENSIONS("bin,rom")
23292332//  MCFG_SOFTWARE_LIST_ADD("cart_list", "ste_cart")
23302333
23312334   // internal ram
r32184r32185
24282431   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(st_state, write_acia_clock))
24292432
24302433   // cartridge
2431   MCFG_CARTSLOT_ADD("cart")
2432   MCFG_CARTSLOT_EXTENSION_LIST("bin,rom")
2433   MCFG_CARTSLOT_NOT_MANDATORY
2434   MCFG_CARTSLOT_INTERFACE("st_cart")
2434   MCFG_GENERIC_CARTSLOT_ADD("cartslot", GENERIC_ROM16_WIDTH, generic_linear_slot, "st_cart")
2435   MCFG_GENERIC_EXTENSIONS("bin,rom")
24352436   MCFG_SOFTWARE_LIST_ADD("cart_list", "st_cart")
24362437
24372438   /* internal ram */
r32184r32185
24862487   ROM_SYSTEM_BIOS( 3, "tos104", "TOS 1.04 (Rainbow TOS)" )
24872488   ROMX_LOAD( "tos104.bin", 0x00000, 0x30000, BAD_DUMP CRC(90f4fbff) SHA1(2487f330b0895e5d88d580d4ecb24061125e88ad), ROM_BIOS(4) )
24882489
2489   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2490   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2491
24922490   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
24932491   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
24942492ROM_END
r32184r32185
25082506   ROM_SYSTEM_BIOS( 2, "tos104", "TOS 1.04 (Rainbow TOS)" )
25092507   ROMX_LOAD( "tos104uk.bin", 0x00000, 0x30000, BAD_DUMP CRC(a50d1d43) SHA1(9526ef63b9cb1d2a7109e278547ae78a5c1db6c6), ROM_BIOS(3) )
25102508
2511   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2512   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2513
25142509   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
25152510   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
25162511ROM_END
r32184r32185
25372532   ROMX_LOAD( "st 7c1 a2.u2", 0x20000, 0x08000, CRC(d0513329) SHA1(49855a3585e2f75b2af932dd4414ed64e6d9501f), ROM_SKIP(1) | ROM_BIOS(4) )
25382533   ROMX_LOAD( "st 7c1 b1.u5", 0x20001, 0x08000, CRC(c115cbc8) SHA1(2b52b81a1a4e0818d63f98ee4b25c30e2eba61cb), ROM_SKIP(1) | ROM_BIOS(4) )
25392534
2540   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2541   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2542
25432535   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
25442536   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
25452537ROM_END
r32184r32185
25662558   ROMX_LOAD( "c101656-001.u48", 0x20000, 0x08000, CRC(dbd93fb8) SHA1(cf9ec11e4bc2465490e7e6c981d9f61eae6cb359), ROM_SKIP(1) | ROM_BIOS(4) )
25672559   ROMX_LOAD( "c101659-001.u53", 0x20001, 0x08000, CRC(67c9785a) SHA1(917a17e9f83bee015c25b327780eebb11cb2c5a5), ROM_SKIP(1) | ROM_BIOS(4) )
25682560
2569   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2570   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2571
25722561   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
25732562   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
25742563ROM_END
r32184r32185
25842573   ROM_SYSTEM_BIOS( 0, "tos104", "TOS 1.04 (Rainbow TOS)" )
25852574   ROMX_LOAD( "tos104es.bin", 0x00000, 0x30000, BAD_DUMP CRC(f4e8ecd2) SHA1(df63f8ac09125d0877b55d5ba1282779b7f99c16), ROM_BIOS(1) )
25862575
2587   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2588   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2589
25902576   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
25912577   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
25922578ROM_END
r32184r32185
26022588   ROM_SYSTEM_BIOS( 0, "tos104", "TOS 1.04 (Rainbow TOS)" )
26032589   ROMX_LOAD( "tos104nl.bin", 0x00000, 0x30000, BAD_DUMP CRC(bb4370d4) SHA1(6de7c96b2d2e5c68778f4bce3eaf85a4e121f166), ROM_BIOS(1) )
26042590
2605   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2606   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2607
26082591   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
26092592   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
26102593ROM_END
r32184r32185
26222605   ROM_SYSTEM_BIOS( 1, "tos104", "TOS 1.04 (Rainbow TOS)" )
26232606   ROMX_LOAD( "tos104se.bin", 0x00000, 0x30000, BAD_DUMP CRC(80ecfdce) SHA1(b7ad34d5cdfbe86ea74ae79eca11dce421a7bbfd), ROM_BIOS(2) )
26242607
2625   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2626   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2627
26282608   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
26292609   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
26302610ROM_END
r32184r32185
26422622   ROM_SYSTEM_BIOS( 1, "tos104", "TOS 1.04 (Rainbow TOS)" )
26432623   ROMX_LOAD( "tos104sg.bin", 0x00000, 0x30000, BAD_DUMP CRC(e58f0bdf) SHA1(aa40bf7203f02b2251b9e4850a1a73ff1c7da106), ROM_BIOS(2) )
26442624
2645   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2646   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2647
26482625   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
26492626   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
26502627ROM_END
r32184r32185
26622639   ROM_SYSTEM_BIOS( 1, "tos104", "TOS 1.04 (Rainbow TOS)" )
26632640   ROMX_LOAD( "tos104.bin", 0x00000, 0x30000, BAD_DUMP CRC(90f4fbff) SHA1(2487f330b0895e5d88d580d4ecb24061125e88ad), ROM_BIOS(2) )
26642641
2665   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2666   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2667
26682642   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
26692643   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
26702644ROM_END
r32184r32185
26822656   ROM_SYSTEM_BIOS( 1, "tos104", "TOS 1.04 (Rainbow TOS)" )
26832657   ROMX_LOAD( "tos104uk.bin", 0x00000, 0x30000, BAD_DUMP CRC(a50d1d43) SHA1(9526ef63b9cb1d2a7109e278547ae78a5c1db6c6), ROM_BIOS(2) )
26842658
2685   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2686   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2687
26882659   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
26892660   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
26902661ROM_END
r32184r32185
27022673   ROM_SYSTEM_BIOS( 1, "tos104", "TOS 1.04 (Rainbow TOS)" )
27032674   ROMX_LOAD( "tos104de.bin", 0x00000, 0x30000, BAD_DUMP CRC(62b82b42) SHA1(5313733f91b083c6265d93674cb9d0b7efd02da8), ROM_BIOS(2) )
27042675
2705   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2706   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2707
27082676   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
27092677   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
27102678ROM_END
r32184r32185
27222690   ROM_SYSTEM_BIOS( 1, "tos104", "TOS 1.04 (Rainbow TOS)" )
27232691   ROMX_LOAD( "tos104fr.bin", 0x00000, 0x30000, BAD_DUMP CRC(a305a404) SHA1(20dba880344b810cf63cec5066797c5a971db870), ROM_BIOS(2) )
27242692
2725   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2726   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2727
27282693   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
27292694   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
27302695ROM_END
r32184r32185
27422707   ROM_SYSTEM_BIOS( 1, "tos104", "TOS 1.04 (Rainbow TOS)" )
27432708   ROMX_LOAD( "tos104se.bin", 0x00000, 0x30000, BAD_DUMP CRC(80ecfdce) SHA1(b7ad34d5cdfbe86ea74ae79eca11dce421a7bbfd), ROM_BIOS(2) )
27442709
2745   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2746   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2747
27482710   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
27492711   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
27502712ROM_END
r32184r32185
27622724   ROM_SYSTEM_BIOS( 1, "tos104", "TOS 1.04 (Rainbow TOS)" )
27632725   ROMX_LOAD( "tos104sg.bin", 0x00000, 0x30000, BAD_DUMP CRC(e58f0bdf) SHA1(aa40bf7203f02b2251b9e4850a1a73ff1c7da106), ROM_BIOS(2) )
27642726
2765   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2766   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2767
27682727   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
27692728   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
27702729ROM_END
r32184r32185
27802739   ROM_SYSTEM_BIOS( 0, "tos104", "TOS 1.04 (Rainbow TOS)" )
27812740   ROMX_LOAD( "tos104.bin", 0x00000, 0x30000, BAD_DUMP CRC(a50d1d43) SHA1(9526ef63b9cb1d2a7109e278547ae78a5c1db6c6), ROM_BIOS(1) )
27822741
2783   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2784   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2785
27862742   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
27872743   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
27882744ROM_END
r32184r32185
28032759   ROM_SYSTEM_BIOS( 2, "tos206", "TOS 2.06 (ST/STE TOS)" )
28042760   ROMX_LOAD( "tos206.bin", 0x00000, 0x40000, BAD_DUMP CRC(3f2f840f) SHA1(ee58768bdfc602c9b14942ce5481e97dd24e7c83), ROM_BIOS(3) )
28052761
2806   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2807   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2808
28092762   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
28102763   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
28112764ROM_END
r32184r32185
28252778   ROM_SYSTEM_BIOS( 2, "tos206", "TOS 2.06 (ST/STE TOS)" )
28262779   ROMX_LOAD( "tos206uk.bin", 0x00000, 0x40000, BAD_DUMP CRC(08538e39) SHA1(2400ea95f547d6ea754a99d05d8530c03f8b28e3), ROM_BIOS(3) )
28272780
2828   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2829   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2830
28312781   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
28322782   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
28332783ROM_END
r32184r32185
28472797   ROM_SYSTEM_BIOS( 2, "tos206", "TOS 2.06 (ST/STE TOS)" )
28482798   ROMX_LOAD( "tos206de.bin", 0x00000, 0x40000, BAD_DUMP CRC(143cd2ab) SHA1(d1da866560734289c4305f1028c36291d331d417), ROM_BIOS(3) )
28492799
2850   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2851   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2852
28532800   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
28542801   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
28552802ROM_END
r32184r32185
28652812   ROM_SYSTEM_BIOS( 0, "tos106", "TOS 1.06 (STE TOS, Revision 1)" )
28662813   ROMX_LOAD( "tos106es.bin", 0x00000, 0x40000, BAD_DUMP CRC(5cd2a540) SHA1(3a18f342c8288c0bc1879b7a209c73d5d57f7e81), ROM_BIOS(1) )
28672814
2868   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2869   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2870
28712815   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
28722816   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
28732817ROM_END
r32184r32185
28872831   ROM_SYSTEM_BIOS( 2, "tos206", "TOS 2.06 (ST/STE TOS)" )
28882832   ROMX_LOAD( "tos206fr.bin", 0x00000, 0x40000, BAD_DUMP CRC(e3a99ca7) SHA1(387da431e6e3dd2e0c4643207e67d06cf33618c3), ROM_BIOS(3) )
28892833
2890   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2891   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2892
28932834   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
28942835   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
28952836ROM_END
r32184r32185
29052846   ROM_SYSTEM_BIOS( 0, "tos106", "TOS 1.06 (STE TOS, Revision 1)" )
29062847   ROMX_LOAD( "tos106it.bin", 0x00000, 0x40000, BAD_DUMP CRC(d3a55216) SHA1(28dc74e5e0fa56b685bbe15f9837f52684fee9fd), ROM_BIOS(1) )
29072848
2908   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2909   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2910
29112849   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
29122850   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
29132851ROM_END
r32184r32185
29252863   ROM_SYSTEM_BIOS( 1, "tos206", "TOS 2.06 (ST/STE TOS)" )
29262864   ROMX_LOAD( "tos206se.bin", 0x00000, 0x40000, BAD_DUMP CRC(be61906d) SHA1(ebdf5a4cf08471cd315a91683fcb24e0f029d451), ROM_BIOS(2) )
29272865
2928   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2929   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2930
29312866   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
29322867   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
29332868ROM_END
r32184r32185
29432878   ROM_SYSTEM_BIOS( 0, "tos206", "TOS 2.06 (ST/STE TOS)" )
29442879   ROMX_LOAD( "tos206sg.bin", 0x00000, 0x40000, BAD_DUMP CRC(8c4fe57d) SHA1(c7a9ae3162f020dcac0c2a46cf0c033f91b98644), ROM_BIOS(1) )
29452880
2946   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2947   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2948
29492881   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
29502882   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
29512883ROM_END
r32184r32185
29632895   ROM_SYSTEM_BIOS( 1, "tos206", "TOS 2.06 (ST/STE TOS)" )
29642896   ROMX_LOAD( "tos206.bin", 0x00000, 0x40000, BAD_DUMP CRC(3f2f840f) SHA1(ee58768bdfc602c9b14942ce5481e97dd24e7c83), ROM_BIOS(2) )
29652897
2966   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2967   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2968
29692898   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
29702899   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
29712900ROM_END
r32184r32185
29902919   ROMX_LOAD( "tos206uk.bin", 0x00000, 0x40000, BAD_DUMP CRC(08538e39) SHA1(2400ea95f547d6ea754a99d05d8530c03f8b28e3), ROM_BIOS(1) )
29912920#endif
29922921
2993   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
2994   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
2995
29962922   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
29972923   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
29982924ROM_END
r32184r32185
30102936   ROM_SYSTEM_BIOS( 1, "tos206", "TOS 2.06 (ST/STE TOS)" )
30112937   ROMX_LOAD( "tos206fr.bin", 0x00000, 0x40000, BAD_DUMP CRC(e3a99ca7) SHA1(387da431e6e3dd2e0c4643207e67d06cf33618c3), ROM_BIOS(2) )
30122938
3013   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3014   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3015
30162939   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
30172940   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
30182941ROM_END
r32184r32185
30302953   ROM_SYSTEM_BIOS( 1, "tos206", "TOS 2.06 (ST/STE TOS)" )
30312954   ROMX_LOAD( "tos206de.bin", 0x00000, 0x40000, BAD_DUMP CRC(143cd2ab) SHA1(d1da866560734289c4305f1028c36291d331d417), ROM_BIOS(2) )
30322955
3033   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3034   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3035
30362956   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
30372957   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
30382958ROM_END
r32184r32185
30482968   ROM_SYSTEM_BIOS( 0, "tos205", "TOS 2.05 (Mega STE TOS)" )
30492969   ROMX_LOAD( "tos205es.bin", 0x00000, 0x40000, BAD_DUMP CRC(2a426206) SHA1(317715ad8de718b5acc7e27ecf1eb833c2017c91), ROM_BIOS(1) )
30502970
3051   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3052   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3053
30542971   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
30552972   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
30562973ROM_END
r32184r32185
30662983   ROM_SYSTEM_BIOS( 0, "tos205", "TOS 2.05 (Mega STE TOS)" )
30672984   ROMX_LOAD( "tos205it.bin", 0x00000, 0x40000, BAD_DUMP CRC(b28bf5a1) SHA1(8e0581b442384af69345738849cf440d72f6e6ab), ROM_BIOS(1) )
30682985
3069   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3070   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3071
30722986   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
30732987   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
30742988ROM_END
r32184r32185
30863000   ROM_SYSTEM_BIOS( 1, "tos206", "TOS 2.06 (ST/STE TOS)" )
30873001   ROMX_LOAD( "tos206se.bin", 0x00000, 0x40000, BAD_DUMP CRC(be61906d) SHA1(ebdf5a4cf08471cd315a91683fcb24e0f029d451), ROM_BIOS(2) )
30883002
3089   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3090   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3091
30923003   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
30933004   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
30943005ROM_END
r32184r32185
31043015   ROM_SYSTEM_BIOS( 0, "tos208", "TOS 2.08" )
31053016   ROMX_LOAD( "tos208.bin", 0x00000, 0x40000, NO_DUMP, ROM_BIOS(1) )
31063017
3107   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3108   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3109
31103018   ROM_REGION( 0x1000, COP888_TAG, 0 )
31113019   ROM_LOAD( "cop888c0.u703", 0x0000, 0x1000, NO_DUMP )
31123020ROM_END
r32184r32185
31223030   ROM_REGION16_BE( 0x40000, M68000_TAG, 0 )
31233031   ROM_SYSTEM_BIOS( 0, "tos205", "TOS 2.05" )
31243032   ROMX_LOAD( "tos205.bin", 0x00000, 0x40000, NO_DUMP, ROM_BIOS(1) )
3125
3126   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3127   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
31283033ROM_END
31293034#endif
31303035
r32184r32185
31393044   ROM_SYSTEM_BIOS( 0, "tos306", "TOS 3.06 (TT TOS)" )
31403045   ROMX_LOAD( "tos306.bin", 0x00000, 0x80000, BAD_DUMP CRC(e65adbd7) SHA1(b15948786278e1f2abc4effbb6d40786620acbe8), ROM_BIOS(1) )
31413046
3142   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3143   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3144
31453047   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
31463048   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
31473049ROM_END
r32184r32185
31573059   ROM_SYSTEM_BIOS( 0, "tos306", "TOS 3.06 (TT TOS)" )
31583060   ROMX_LOAD( "tos306uk.bin", 0x00000, 0x80000, BAD_DUMP CRC(75dda215) SHA1(6325bdfd83f1b4d3afddb2b470a19428ca79478b), ROM_BIOS(1) )
31593061
3160   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3161   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3162
31633062   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
31643063   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
31653064ROM_END
r32184r32185
31753074   ROM_SYSTEM_BIOS( 0, "tos306", "TOS 3.06 (TT TOS)" )
31763075   ROMX_LOAD( "tos306de.bin", 0x00000, 0x80000, BAD_DUMP CRC(4fcbb59d) SHA1(80af04499d1c3b8551fc4d72142ff02c2182e64a), ROM_BIOS(1) )
31773076
3178   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3179   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3180
31813077   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
31823078   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
31833079ROM_END
r32184r32185
31933089   ROM_SYSTEM_BIOS( 0, "tos306", "TOS 3.06 (TT TOS)" )
31943090   ROMX_LOAD( "tos306fr.bin", 0x00000, 0x80000, BAD_DUMP CRC(1945511c) SHA1(6bb19874e1e97dba17215d4f84b992c224a81b95), ROM_BIOS(1) )
31953091
3196   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3197   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3198
31993092   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
32003093   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
32013094ROM_END
r32184r32185
32113104   ROM_SYSTEM_BIOS( 0, "tos306", "TOS 3.06 (TT TOS)" )
32123105   ROMX_LOAD( "tos306pl.bin", 0x00000, 0x80000, BAD_DUMP CRC(4f2404bc) SHA1(d122b8ceb202b52754ff0d442b1c81f8b4de3436), ROM_BIOS(1) )
32133106
3214   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3215   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3216
32173107   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
32183108   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
32193109ROM_END
r32184r32185
32293119   ROM_SYSTEM_BIOS( 0, "tos207", "TOS 2.07" )
32303120   ROMX_LOAD( "tos207.bin", 0x00000, 0x40000, NO_DUMP, ROM_BIOS(1) )
32313121
3232   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3233   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3234
32353122   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
32363123   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
32373124ROM_END
r32184r32185
32633150   ROMX_LOAD( "tos404.bin", 0x00000, 0x80000, BAD_DUMP CRC(028b561d) SHA1(27dcdb31b0951af99023b2fb8c370d8447ba6ebc), ROM_BIOS(3) )
32643151#endif
32653152
3266   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3267   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3268
32693153   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
32703154   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
32713155ROM_END
r32184r32185
32803164   ROM_SYSTEM_BIOS( 0, "tos492", "TOS 4.92" )
32813165   ROMX_LOAD( "tos492.bin", 0x00000, 0x7d314, BAD_DUMP CRC(bc8e497f) SHA1(747a38042844a6b632dcd9a76d8525fccb5eb892), ROM_BIOS(2) )
32823166
3283   ROM_REGION( 0x20000, "cart", ROMREGION_ERASE00 )
3284   ROM_CART_LOAD( "cart", 0x00000, 0x20000, ROM_MIRROR | ROM_OPTIONAL )
3285
32863167   ROM_REGION( 0x1000, HD6301V1_TAG, 0 )
32873168   ROM_LOAD( "keyboard.u1", 0x0000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
32883169ROM_END
trunk/src/mess/drivers/rx78.c
r32184r32185
416416
417417DEVICE_IMAGE_LOAD_MEMBER( rx78_state, rx78_cart )
418418{
419   UINT8 *cart;
420   UINT32 size;
421
422   if (image.software_entry() == NULL)
423      size = image.length();
424   else
425      size = image.get_software_region_length("rom");
426
419   UINT32 size = m_cart->common_get_size("rom");
420   
427421   if (size != 0x2000 && size != 0x4000)
428422   {
429423      image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
r32184r32185
431425   }
432426   
433427   m_cart->rom_alloc(size, 1);
434   cart = m_cart->get_rom_base();
428   m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");         
435429   
436   if (image.software_entry() == NULL)
437      image.fread(cart, size);
438   else
439      memcpy(cart, image.get_software_region("rom"), size);
440   
441430   return IMAGE_INIT_PASS;
442431}
443432
trunk/src/mess/drivers/bbcbc.c
r32184r32185
1616#include "video/tms9928a.h"
1717#include "machine/z80pio.h"
1818#include "cpu/z80/z80daisy.h"
19#include "imagedev/cartslot.h"
19#include "bus/generic/slot.h"
20#include "bus/generic/carts.h"
2021
2122
2223class bbcbc_state : public driver_device
r32184r32185
2425public:
2526   bbcbc_state(const machine_config &mconfig, device_type type, const char *tag)
2627      : driver_device(mconfig, type, tag),
27   m_maincpu(*this, "maincpu")
28      m_maincpu(*this, "maincpu"),
29      m_cart(*this, "cartslot")
2830   { }
2931
3032   required_device<cpu_device> m_maincpu;
33   required_device<generic_slot_device> m_cart;
3134   virtual void machine_start();
3235   virtual void machine_reset();
3336   DECLARE_WRITE_LINE_MEMBER(tms_interrupt);
34
35   DECLARE_DEVICE_IMAGE_LOAD_MEMBER( bbcbc_cart );
3637};
3738
3839
r32184r32185
4142
4243static ADDRESS_MAP_START( bbcbc_prg, AS_PROGRAM, 8, bbcbc_state )
4344   AM_RANGE(0x0000, 0x3fff) AM_ROM
44   AM_RANGE(0x4000, 0xbfff) AM_ROM
45   //AM_RANGE(0x4000, 0xbfff)   // mapped by the cartslot
4546   AM_RANGE(0xe000, 0xe02f) AM_RAM
4647   AM_RANGE(0xe030, 0xe030) AM_READ_PORT("LINE01")
4748   AM_RANGE(0xe031, 0xe031) AM_READ_PORT("LINE02")
r32184r32185
115116};
116117
117118
118DEVICE_IMAGE_LOAD_MEMBER( bbcbc_state, bbcbc_cart )
119{
120   UINT8 *cart = memregion("maincpu" )->base() + 0x4000;
121
122   if ( image.software_entry() == NULL )
123   {
124      int size = image.length();
125      if ( image.fread(cart, size ) != size ) {
126         image.seterror( IMAGE_ERROR_UNSPECIFIED, "Unable to fully read from file" );
127         return IMAGE_INIT_FAIL;
128      }
129   }
130   else
131   {
132      UINT8 *reg = image.get_software_region( "rom" );
133      int reg_len = image.get_software_region_length( "rom" );
134
135      memcpy( cart, reg, MIN(reg_len, 0x8000) );
136   }
137
138   return IMAGE_INIT_PASS;
139
140}
141
142119void bbcbc_state::machine_start()
143120{
121   if (m_cart->cart_mounted())
122      m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0xbfff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart));
144123}
145124
146125void bbcbc_state::machine_reset()
r32184r32185
162141   MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" )
163142   MCFG_SCREEN_UPDATE_DEVICE( "tms9129", tms9928a_device, screen_update )
164143
165   MCFG_CARTSLOT_ADD("cart")
166   MCFG_CARTSLOT_NOT_MANDATORY
167   MCFG_CARTSLOT_INTERFACE("bbcbc_cart")
168   MCFG_CARTSLOT_LOAD( bbcbc_state, bbcbc_cart )
144   MCFG_GENERIC_CARTSLOT_ADD("cartslot", GENERIC_ROM8_WIDTH, generic_plain_slot, "bbcbc_cart")
169145
170146   /* Software lists */
171147   MCFG_SOFTWARE_LIST_ADD("cart_list","bbcbc")
trunk/src/mess/drivers/supracan.c
r32184r32185
17531753
17541754DEVICE_IMAGE_LOAD_MEMBER( supracan_state, supracan_cart )
17551755{
1756   UINT8 *cart;
1757   UINT32 size;
1756   UINT32 size = m_cart->common_get_size("rom");
17581757   
1759   if (image.software_entry() == NULL)
1760      size = image.length();
1761   else
1762      size = image.get_software_region_length("rom");
1763   
17641758   if (size > 0x400000)
17651759   {
17661760      image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
17671761      return IMAGE_INIT_FAIL;
17681762   }
1763
1764   m_cart->rom_alloc(size, 2);
1765   m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");         
17691766   
1770   m_cart->rom_alloc(size, 1);
1771   cart = m_cart->get_rom_base();
1772   
1773   if (image.software_entry() == NULL)
1774      image.fread(cart, size);
1775   else
1776      memcpy(cart, image.get_software_region("rom"), size);
1777   
17781767   return IMAGE_INIT_PASS;
17791768}
17801769
trunk/src/mess/includes/aquarius.h
r32184r32185
99
1010#include "emu.h"
1111#include "cpu/z80/z80.h"
12#include "imagedev/cartslot.h"
1312#include "imagedev/cassette.h"
1413#include "machine/ram.h"
1514#include "sound/ay8910.h"
1615#include "sound/speaker.h"
16#include "bus/generic/slot.h"
17#include "bus/generic/carts.h"
1718
1819class aquarius_state : public driver_device
1920{
r32184r32185
2324         m_maincpu(*this, "maincpu"),
2425         m_cassette(*this, "cassette"),
2526         m_speaker(*this, "speaker"),
27         m_cart(*this, "cartslot"),
2628         m_ram(*this, RAM_TAG),
27         m_rom(*this, "maincpu"),
2829         m_videoram(*this, "videoram"),
2930         m_colorram(*this, "colorram"),
3031         m_y0(*this, "Y0"),
r32184r32185
4344   required_device<cpu_device> m_maincpu;
4445   required_device<cassette_image_device> m_cassette;
4546   required_device<speaker_sound_device> m_speaker;
47   required_device<generic_slot_device> m_cart;
4648   required_device<ram_device> m_ram;
47   required_memory_region m_rom;
4849   required_shared_ptr<UINT8> m_videoram;
4950   required_shared_ptr<UINT8> m_colorram;
5051   required_ioport m_y0;
trunk/src/mess/includes/atarist.h
r32184r32185
88#include "bus/rs232/rs232.h"
99#include "cpu/m68000/m68000.h"
1010#include "cpu/m6800/m6800.h"
11#include "imagedev/cartslot.h"
1211#include "machine/6850acia.h"
1312#include "machine/8530scc.h"
1413#include "bus/centronics/ctronics.h"
14#include "bus/generic/slot.h"
15#include "bus/generic/carts.h"
1516#include "machine/mc68901.h"
1617#include "machine/ram.h"
1718#include "machine/rescap.h"
r32184r32185
8788         m_acia0(*this, MC6850_0_TAG),
8889         m_acia1(*this, MC6850_1_TAG),
8990         m_centronics(*this, CENTRONICS_TAG),
91         m_cart(*this, "cartslot"),
9092         m_ram(*this, RAM_TAG),
9193         m_rs232(*this, RS232_TAG),
9294         m_p31(*this, "P31"),
r32184r32185
127129   required_device<acia6850_device> m_acia0;
128130   required_device<acia6850_device> m_acia1;
129131   required_device<centronics_device> m_centronics;
132   required_device<generic_slot_device> m_cart;
130133   required_device<ram_device> m_ram;
131134   required_device<rs232_port_device> m_rs232;
132135   required_ioport m_p31;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team