Previous 199869 Revisions Next

r32225 Saturday 20th September, 2014 at 06:38:07 UTC by Fabio Priuli
another round of generic carts / sockets. nw.
[src/mess/drivers]aim65.c pegasus.c pencil2.c sorcerer.c sv8000.c ti74.c uzebox.c
[src/mess/includes]sorcerer.h
[src/mess/machine]sorcerer.c

trunk/src/mess/machine/sorcerer.c
r32224r32225
372372      space.unmap_readwrite(0x8000, endmem);
373373      break;
374374   }
375
376   if (m_cart->cart_mounted())
377      space.install_read_handler(0xc000, 0xdfff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart));
375378}
376379
377380MACHINE_START_MEMBER(sorcerer_state,sorcererd)
trunk/src/mess/includes/sorcerer.h
r32224r32225
1515#include "bus/centronics/ctronics.h"
1616#include "bus/centronics/covox.h"
1717#include "machine/ram.h"
18#include "imagedev/cartslot.h"
1918#include "imagedev/cassette.h"
2019#include "imagedev/snapquik.h"
2120#include "imagedev/flopdrv.h"
2221#include "formats/sorc_dsk.h"
2322#include "formats/sorc_cas.h"
2423#include "machine/micropolis.h"
24#include "bus/generic/slot.h"
25#include "bus/generic/carts.h"
2526
2627#define SORCERER_USING_RS232 0
2728
r32224r32225
5859      , m_wave2(*this, WAVE2_TAG)
5960      , m_uart(*this, "uart")
6061      , m_centronics(*this, "centronics")
62      , m_cart(*this, "cartslot")
6163      , m_ram(*this, RAM_TAG)
6264      , m_iop_config(*this, "CONFIG")
6365      , m_iop_vs(*this, "VS")
r32224r32225
9698   required_device<wave_device> m_wave2;
9799   required_device<ay31015_device> m_uart;
98100   required_device<centronics_device> m_centronics;
101   required_device<generic_slot_device> m_cart;
99102   required_device<ram_device> m_ram;
100103   required_ioport m_iop_config;
101104   required_ioport m_iop_vs;
trunk/src/mess/drivers/aim65.c
r32224r32225
146146
147147int aim65_state::load_cart(device_image_interface &image, generic_slot_device *slot, const char *slot_tag)
148148{
149   UINT32 size = slot->common_get_size("rom");
150   
149   UINT32 size = slot->common_get_size(slot_tag);
150
151151   if (size > 0x1000)
152152   {
153153      image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
trunk/src/mess/drivers/sv8000.c
r32224r32225
2727
2828#include "emu.h"
2929#include "cpu/z80/z80.h"
30#include "imagedev/cartslot.h"
3130#include "machine/i8255.h"
3231#include "sound/ay8910.h"
3332#include "video/mc6847.h"
33#include "bus/generic/slot.h"
34#include "bus/generic/carts.h"
3435
3536
3637class sv8000_state : public driver_device
r32224r32225
4041      : driver_device(mconfig, type, tag)
4142      , m_maincpu(*this, "maincpu")
4243      , m_s68047p(*this, "s68047p")
44      , m_cart(*this, "cartslot")
4345      , m_videoram(*this, "videoram")
4446      , m_io_row0(*this, "ROW0")
4547      , m_io_row1(*this, "ROW1")
r32224r32225
6971
7072   required_device<cpu_device> m_maincpu;
7173   required_device<s68047_device> m_s68047p;
74   required_device<generic_slot_device> m_cart;
7275   required_shared_ptr<UINT8> m_videoram;
7376   required_ioport m_io_row0;
7477   required_ioport m_io_row1;
r32224r32225
9194
9295static ADDRESS_MAP_START(sv8000_mem, AS_PROGRAM, 8, sv8000_state)
9396   ADDRESS_MAP_UNMAP_HIGH
94   AM_RANGE( 0x0000, 0x0fff ) AM_ROM
97   //AM_RANGE(0x0000, 0x0fff)      // mapped by the cartslot
9598   AM_RANGE( 0x8000, 0x83ff ) AM_RAM // Work RAM??
9699   AM_RANGE( 0xc000, 0xcbff ) AM_RAM AM_SHARE("videoram")
97100ADDRESS_MAP_END
r32224r32225
170173   m_intext = 0;
171174   m_inv = 0;
172175
176   if (m_cart->cart_mounted())
177      m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x0fff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart));
178
173179   save_item(NAME(m_column));
174180   save_item(NAME(m_ag));
175181   save_item(NAME(m_gm2));
r32224r32225
190196
191197DEVICE_IMAGE_LOAD_MEMBER( sv8000_state, cart )
192198{
193   UINT8 *cart = memregion("maincpu")->base();
194
195   if (image.software_entry() == NULL)
199   UINT32 size = m_cart->common_get_size("rom");
200   
201   if (size != 0x1000)
196202   {
197      UINT32 filesize = image.length();
198
199      if (filesize != 0x1000)
200      {
201         image.seterror(IMAGE_ERROR_UNSPECIFIED, "Incorrect or not support cartridge size");
202         return IMAGE_INIT_FAIL;
203      }
204
205      if (image.fread( cart, filesize) != filesize)
206      {
207         image.seterror(IMAGE_ERROR_UNSPECIFIED, "Error loading file");
208         return IMAGE_INIT_FAIL;
209      }
203      image.seterror(IMAGE_ERROR_UNSPECIFIED, "Incorrect or not support cartridge size");
204      return IMAGE_INIT_FAIL;
210205   }
211   else
212   {
213      memcpy(cart, image.get_software_region("rom"), image.get_software_region_length("rom"));
214   }
215
206   
207   m_cart->rom_alloc(size, 1);
208   m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");         
209   
216210   return IMAGE_INIT_PASS;
217211}
218212
r32224r32225
261255READ8_MEMBER( sv8000_state::i8255_portc_r )
262256{
263257   //logerror("i8255_portc_r\n");
264   return 0xFF;
258   return 0xff;
265259}
266260
267261
r32224r32225
274268
275269READ8_MEMBER( sv8000_state::ay_port_a_r )
276270{
277   UINT8 data = 0xFF;
271   UINT8 data = 0xff;
278272
279273   //logerror("ay_port_a_r\n");
280274   return data;
r32224r32225
404398   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
405399
406400   /* cartridge */
407   MCFG_CARTSLOT_ADD("cart")
408   MCFG_CARTSLOT_EXTENSION_LIST("bin")
409   MCFG_CARTSLOT_MANDATORY
410   MCFG_CARTSLOT_LOAD(sv8000_state,cart)
411   MCFG_CARTSLOT_INTERFACE("sv8000_cart")
401   MCFG_GENERIC_CARTSLOT_ADD("cartslot", GENERIC_ROM8_WIDTH, generic_plain_slot, "sv8000_cart")
402   MCFG_GENERIC_MANDATORY
403   MCFG_GENERIC_LOAD(sv8000_state, cart)
412404
413405   /* software lists */
414406   MCFG_SOFTWARE_LIST_ADD("cart_list","sv8000")
trunk/src/mess/drivers/pegasus.c
r32224r32225
3333    hardware.
3434
3535    TO DO:
36    - Identify which rom slots the multi-rom programs should be fitted to.
3736    - Work on the other non-working programs
3837
3938****************************************************************************/
r32224r32225
4140#include "emu.h"
4241#include "cpu/m6809/m6809.h"
4342#include "machine/6821pia.h"
44#include "imagedev/cartslot.h"
4543#include "imagedev/cassette.h"
4644#include "sound/wave.h"
45#include "bus/generic/slot.h"
46#include "bus/generic/carts.h"
4747
4848
4949
r32224r32225
5656   m_cass(*this, "cassette"),
5757   m_pia_s(*this, "pia_s"),
5858   m_pia_u(*this, "pia_u"),
59   m_exp_00(*this, "exp00"),
60   m_exp_01(*this, "exp01"),
61   m_exp_02(*this, "exp02"),
62   m_exp_0c(*this, "exp0c"),
63   m_exp_0d(*this, "exp0d"),
5964   m_p_videoram(*this, "p_videoram"){ }
6065
6166   required_device<cpu_device> m_maincpu;
6267   required_device<cassette_image_device> m_cass;
6368   required_device<pia6821_device> m_pia_s;
6469   required_device<pia6821_device> m_pia_u;
70   required_device<generic_slot_device> m_exp_00;
71   required_device<generic_slot_device> m_exp_01;
72   required_device<generic_slot_device> m_exp_02;
73   required_device<generic_slot_device> m_exp_0c;
74   required_device<generic_slot_device> m_exp_0d;
6575   DECLARE_READ8_MEMBER( pegasus_keyboard_r );
6676   DECLARE_READ8_MEMBER( pegasus_protection_r );
6777   DECLARE_READ8_MEMBER( pegasus_pcg_r );
r32224r32225
8494   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8595   DECLARE_DRIVER_INIT(pegasus);
8696   TIMER_DEVICE_CALLBACK_MEMBER(pegasus_firq);
87   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_1);
88   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_2);
89   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_3);
90   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_4);
91   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_5);
92   void pegasus_decrypt_rom( UINT16 addr );
97   void pegasus_decrypt_rom(UINT8 *ROM);
98   
99   int load_cart(device_image_interface &image, generic_slot_device *slot, const char *reg_tag);
100   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp00_load) { return load_cart(image, m_exp_00, "0000"); }
101   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp01_load) { return load_cart(image, m_exp_01, "1000"); }
102   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp02_load) { return load_cart(image, m_exp_02, "2000"); }
103   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp0c_load) { return load_cart(image, m_exp_0c, "c000"); }
104   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp0d_load) { return load_cart(image, m_exp_0d, "d000"); }
93105};
94106
95107TIMER_DEVICE_CALLBACK_MEMBER(pegasus_state::pegasus_firq)
r32224r32225
171183
172184static ADDRESS_MAP_START(pegasus_mem, AS_PROGRAM, 8, pegasus_state)
173185   ADDRESS_MAP_UNMAP_HIGH
174   AM_RANGE(0x0000, 0x2fff) AM_ROM
186   //AM_RANGE(0x0000, 0x2fff)      // mapped by the cartslots 1-3
175187   AM_RANGE(0xb000, 0xbdff) AM_RAM
176188   AM_RANGE(0xbe00, 0xbfff) AM_RAM AM_SHARE("p_videoram")
177   AM_RANGE(0xc000, 0xdfff) AM_ROM AM_WRITENOP
189   //AM_RANGE(0xc000, 0xdfff)      // mapped by the cartslots 4-5
178190   AM_RANGE(0xe000, 0xe1ff) AM_READ(pegasus_protection_r)
179191   AM_RANGE(0xe200, 0xe3ff) AM_READWRITE(pegasus_pcg_r,pegasus_pcg_w)
180192   AM_RANGE(0xe400, 0xe403) AM_MIRROR(0x1fc) AM_DEVREADWRITE("pia_u", pia6821_device, read, write)
r32224r32225
377389
378390/* An encrypted single rom starts with 02, decrypted with 20. Not sure what
379391    multipart roms will have. */
380void pegasus_state::pegasus_decrypt_rom( UINT16 addr )
392void pegasus_state::pegasus_decrypt_rom(UINT8 *ROM)
381393{
382   UINT8 b, *ROM = memregion("maincpu")->base();
383   UINT16 i, j;
384   UINT8 buff[0x1000];
385   if (ROM[addr] == 0x02)
394   UINT8 b;
395   UINT16 j;
396   dynamic_buffer temp_copy;
397   temp_copy.resize(0x1000);
398
399   if (ROM[0] == 0x02)
386400   {
387      for (i = 0; i < 0x1000; i++)
401      for (int i = 0; i < 0x1000; i++)
388402      {
389         b = ROM[addr|i];
390         j = BITSWAP16( i, 15, 14, 13, 12, 11, 10, 9, 8, 0, 1, 2, 3, 4, 5, 6, 7 );
391         b = BITSWAP8( b, 3, 2, 1, 0, 7, 6, 5, 4 );
392         buff[j&0xfff] = b;
403         b = ROM[i];
404         j = BITSWAP16(i, 15, 14, 13, 12, 11, 10, 9, 8, 0, 1, 2, 3, 4, 5, 6, 7);
405         b = BITSWAP8(b, 3, 2, 1, 0, 7, 6, 5, 4);
406         temp_copy[j & 0xfff] = b;
393407      }
394      for (i = 0; i < 0x1000; i++)
395         ROM[addr|i] = buff[i];
408      memcpy(ROM, temp_copy, 0x1000);
396409   }
397410}
398411
399DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_1 )
412int pegasus_state::load_cart(device_image_interface &image, generic_slot_device *slot, const char *reg_tag)
400413{
401   image.fread(memregion("maincpu")->base() + 0x0000, 0x1000);
402   pegasus_decrypt_rom( 0x0000 );
414   UINT32 size = slot->common_get_size(reg_tag);
415   bool any_socket = false;
416   
417   if (size > 0x1000)
418   {
419      image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
420      return IMAGE_INIT_FAIL;
421   }
422   
423   if (image.software_entry() != NULL && size == 0)
424   {
425      // we might be loading a cart compatible with all sockets!
426      // so try to get region "rom"
427      printf("universal\n");     
428      size = slot->common_get_size("rom");
429      any_socket = true;
403430
404   return IMAGE_INIT_PASS;
405}
431      if (size == 0)
432      {
433         astring errmsg;
434         errmsg.printf("Attempted to load a file that does not work in this socket.\nPlease check \"Usage\" field in the software list for the correct socket(s) to use.");
435         image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.cstr());
436         return IMAGE_INIT_FAIL;
437      }
438   }
406439
407DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_2 )
408{
409   image.fread(memregion("maincpu")->base() + 0x1000, 0x1000);
410   pegasus_decrypt_rom( 0x1000 );
411
440   slot->rom_alloc(0x1000, 1);   // we alloc 0x1000 also for smaller roms!
441   slot->common_load_rom(slot->get_rom_base(), size, any_socket ? "rom" : reg_tag);
442   
443   // raw images have to be decrypted
444   pegasus_decrypt_rom(slot->get_rom_base());
445   
412446   return IMAGE_INIT_PASS;
413447}
414448
415DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_3 )
416{
417   image.fread(memregion("maincpu")->base() + 0x2000, 0x1000);
418   pegasus_decrypt_rom( 0x2000 );
419
420   return IMAGE_INIT_PASS;
421}
422
423DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_4 )
424{
425   image.fread(memregion("maincpu")->base() + 0xc000, 0x1000);
426   pegasus_decrypt_rom( 0xc000 );
427
428   return IMAGE_INIT_PASS;
429}
430
431DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_5 )
432{
433   image.fread(memregion("maincpu")->base() + 0xd000, 0x1000);
434   pegasus_decrypt_rom( 0xd000 );
435
436   return IMAGE_INIT_PASS;
437}
438
439449void pegasus_state::machine_start()
440450{
441451   m_p_pcgram = memregion("pcg")->base();
452
453   if (m_exp_00->cart_mounted())
454      m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x0fff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_exp_00));
455   if (m_exp_01->cart_mounted())
456      m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_exp_01));
457   if (m_exp_02->cart_mounted())
458      m_maincpu->space(AS_PROGRAM).install_read_handler(0x2000, 0x2fff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_exp_02));
459   if (m_exp_0c->cart_mounted())
460      m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xcfff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_exp_0c));
461   if (m_exp_0d->cart_mounted())
462      m_maincpu->space(AS_PROGRAM).install_read_handler(0xd000, 0xdfff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_exp_0d));
442463}
443464
444465void pegasus_state::machine_reset()
r32224r32225
448469   m_control_bits = 0;
449470}
450471
451DRIVER_INIT_MEMBER(pegasus_state,pegasus)
472DRIVER_INIT_MEMBER(pegasus_state, pegasus)
452473{
453   pegasus_decrypt_rom( 0xf000 );
474   // decrypt monitor
475   UINT8 *base = memregion("maincpu")->base() + 0xf000;
476   pegasus_decrypt_rom(base);
454477}
455478
456479static MACHINE_CONFIG_START( pegasus, pegasus_state )
r32224r32225
488511   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6809e_device, irq_line))
489512   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6809e_device, irq_line))
490513
491   MCFG_DEVICE_ADD( "pia_u", PIA6821, 0)
514   MCFG_DEVICE_ADD("pia_u", PIA6821, 0)
492515   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6809e_device, irq_line))
493516   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6809e_device, irq_line))
494517
495   MCFG_CARTSLOT_ADD("cart1")
496   MCFG_CARTSLOT_EXTENSION_LIST("bin")
497   MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_1)
498   MCFG_CARTSLOT_ADD("cart2")
499   MCFG_CARTSLOT_EXTENSION_LIST("bin")
500   MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_2)
501   MCFG_CARTSLOT_ADD("cart3")
502   MCFG_CARTSLOT_EXTENSION_LIST("bin")
503   MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_3)
504   MCFG_CARTSLOT_ADD("cart4")
505   MCFG_CARTSLOT_EXTENSION_LIST("bin")
506   MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_4)
507   MCFG_CARTSLOT_ADD("cart5")
508   MCFG_CARTSLOT_EXTENSION_LIST("bin")
509   MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_5)
510   MCFG_CASSETTE_ADD( "cassette" )
518   MCFG_GENERIC_SOCKET_ADD("exp00", GENERIC_ROM8_WIDTH, generic_plain_slot, "pegasus_cart")
519   MCFG_GENERIC_LOAD(pegasus_state, exp00_load)
520
521   MCFG_GENERIC_SOCKET_ADD("exp01", GENERIC_ROM8_WIDTH, generic_plain_slot, "pegasus_cart")
522   MCFG_GENERIC_LOAD(pegasus_state, exp01_load)
523
524   MCFG_GENERIC_SOCKET_ADD("exp02", GENERIC_ROM8_WIDTH, generic_plain_slot, "pegasus_cart")
525   MCFG_GENERIC_LOAD(pegasus_state, exp02_load)
526
527   MCFG_GENERIC_SOCKET_ADD("exp0c", GENERIC_ROM8_WIDTH, generic_plain_slot, "pegasus_cart")
528   MCFG_GENERIC_LOAD(pegasus_state, exp0c_load)
529
530   MCFG_GENERIC_SOCKET_ADD("exp0d", GENERIC_ROM8_WIDTH, generic_plain_slot, "pegasus_cart")
531   MCFG_GENERIC_LOAD(pegasus_state, exp0d_load)
532
533   MCFG_CASSETTE_ADD("cassette")
511534   MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED|CASSETTE_MOTOR_ENABLED)
535
536   /* Software lists */
537   MCFG_SOFTWARE_LIST_ADD("cart_list", "pegasus_cart")
512538MACHINE_CONFIG_END
513539
514540static MACHINE_CONFIG_DERIVED( pegasusm, pegasus )
trunk/src/mess/drivers/uzebox.c
r32224r32225
1616#include "emu.h"
1717#include "cpu/avr8/avr8.h"
1818#include "sound/dac.h"
19#include "imagedev/cartslot.h"
19#include "bus/generic/slot.h"
20#include "bus/generic/carts.h"
2021
2122// overclocked to 8 * NTSC burst frequency
2223#define MASTER_CLOCK 28618180
r32224r32225
2829public:
2930   uzebox_state(const machine_config &mconfig, device_type type, const char *tag)
3031      : driver_device(mconfig, type, tag),
31      m_maincpu(*this, "maincpu")
32   {
33   }
32      m_maincpu(*this, "maincpu"),
33      m_cart(*this, "cartslot")
34   { }
3435
3536   required_device<avr8_device> m_maincpu;
37   required_device<generic_slot_device> m_cart;
3638
3739   DECLARE_READ8_MEMBER(port_a_r);
3840   DECLARE_WRITE8_MEMBER(port_a_w);
r32224r32225
6466void uzebox_state::machine_start()
6567{
6668   machine().first_screen()->register_screen_bitmap(m_bitmap);
69
70   if (m_cart->cart_mounted())
71      m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0xffff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart));
6772}
6873
6974void uzebox_state::machine_reset()
r32224r32225
265270   return 0;
266271}
267272
268DEVICE_IMAGE_LOAD_MEMBER(uzebox_state,uzebox_cart)
273DEVICE_IMAGE_LOAD_MEMBER(uzebox_state, uzebox_cart)
269274{
270   UINT8* rom = (UINT8*)(*memregion("maincpu"));
275   UINT32 size = m_cart->common_get_size("rom");
276   
277   m_cart->rom_alloc(size, 1);
271278
272   memset(rom, 0xff, memregion("maincpu")->bytes());
273
274279   if (image.software_entry() == NULL)
275280   {
276      UINT32 size = image.length();
277281      dynamic_buffer data(size);
278
279282      image.fread(data, size);
280283
281284      if (!strncmp((const char*)&data[0], "UZEBOX", 6))
282         memcpy(rom, data + 0x200, size - 0x200);
285         memcpy(m_cart->get_rom_base(), data + 0x200, size - 0x200);
283286      else
284         memcpy(rom, data, size);
287         memcpy(m_cart->get_rom_base(), data, size);
285288   }
286289   else
287   {
288      memcpy(rom, image.get_software_region("rom"), image.get_software_region_length("rom"));
289   }
290      memcpy(m_cart->get_rom_base(), image.get_software_region("rom"), size);
290291
291292   return IMAGE_INIT_PASS;
292293}
r32224r32225
323324   MCFG_SOUND_ADD("dac", DAC, 0)
324325   MCFG_SOUND_ROUTE(0, "avr8", 1.00)
325326
326   MCFG_CARTSLOT_ADD("cart1")
327   MCFG_CARTSLOT_EXTENSION_LIST("bin,uze")
328   MCFG_CARTSLOT_MANDATORY
329   MCFG_CARTSLOT_LOAD(uzebox_state,uzebox_cart)
330   MCFG_CARTSLOT_INTERFACE("uzebox")
327   MCFG_GENERIC_CARTSLOT_ADD("cartslot", GENERIC_ROM8_WIDTH, generic_plain_slot, "uzebox")
328   MCFG_GENERIC_EXTENSIONS("bin,uze")
329   MCFG_GENERIC_MANDATORY
330   MCFG_GENERIC_LOAD(uzebox_state, uzebox_cart)
331
331332   MCFG_SOFTWARE_LIST_ADD("eprom_list","uzebox")
332333MACHINE_CONFIG_END
333334
trunk/src/mess/drivers/pencil2.c
r32224r32225
3838U22    74LS05
3939U23-24 SN74LS541
4040
41BASIC CART PEN-700 11-50332-31 Rev.0
42SD-BASIC VERSION 2.0 FOR PENCIL II
43(c) 1983 SOUNDIC ELECTRONICS LTD HONG KONG ALL RIGHTS RESERVED
41
42SD-BASIC usage:
4443All commands must be in uppercase, which is the default at boot.
4544The 'capslock' is done by pressing Shift and Esc together, and the
4645cursor will change to a checkerboard pattern.
471 x 2732
482 x 2764
49The roms were dumped by attaching a cable from the printer port to
50a Super-80 and writing programs in Basic to transfer the bytes.
51Therefore it is not known which rom "202" or "203" is which address range.
5246
5347
5448MEMORY MAP
r32224r32225
6155but is banked out of view of a BASIC program.
6256
6357
64KNOWN CARTS
65SD-BASIC V1.0
66SD-BASIC V2.0
67Zaxxon
68Smurf
69
70
7158ToDo:
7259- Cassette isn't working
7360- Joysticks (no info)
74- Cart slot (only 1 cart has been dumped, so probably no point coding it)
7561
7662****************************************************************************/
7763
r32224r32225
8066#include "video/tms9928a.h"
8167#include "sound/sn76496.h"
8268#include "bus/centronics/ctronics.h"
83//#include "imagedev/cartslot.h"
8469#include "imagedev/cassette.h"
8570#include "sound/wave.h"
71#include "bus/generic/slot.h"
72#include "bus/generic/carts.h"
8673
8774
8875class pencil2_state : public driver_device
r32224r32225
9380      , m_maincpu(*this, "maincpu")
9481      , m_centronics(*this, "centronics")
9582      , m_cass(*this, "cassette")
83      , m_cart(*this, "cartslot")
9684   {}
9785
9886   DECLARE_WRITE8_MEMBER(port10_w);
r32224r32225
10593   DECLARE_CUSTOM_INPUT_MEMBER(printer_ready_r);
10694   DECLARE_CUSTOM_INPUT_MEMBER(printer_ack_r);
10795private:
108   virtual void machine_reset();
96   virtual void machine_start();
10997   int m_centronics_busy;
11098   int m_centronics_ack;
11199   required_device<cpu_device> m_maincpu;
112100   required_device<centronics_device> m_centronics;
113101   required_device<cassette_image_device> m_cass;
102   required_device<generic_slot_device> m_cart;
114103};
115104
116105static ADDRESS_MAP_START(pencil2_mem, AS_PROGRAM, 8, pencil2_state)
117106   ADDRESS_MAP_UNMAP_HIGH
118107   AM_RANGE(0x0000, 0x1fff) AM_ROM
119   AM_RANGE(0x2000, 0x5FFF) AM_WRITENOP  // stop error log filling up
108   AM_RANGE(0x2000, 0x5fff) AM_WRITENOP  // stop error log filling up
120109   AM_RANGE(0x6000, 0x67ff) AM_MIRROR(0x1800) AM_RAM
121   AM_RANGE(0x8000, 0xffff) AM_ROM
110   //AM_RANGE(0x8000, 0xffff)      // mapped by the cartslot
122111ADDRESS_MAP_END
123112
124113static ADDRESS_MAP_START(pencil2_io, AS_IO, 8, pencil2_state)
r32224r32225
283272INPUT_PORTS_END
284273
285274
286void pencil2_state::machine_reset()
275void pencil2_state::machine_start()
287276{
277   if (m_cart->cart_mounted())
278      m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xffff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart));
288279}
289280
290281static MACHINE_CONFIG_START( pencil2, pencil2_state )
r32224r32225
310301   MCFG_CASSETTE_ADD( "cassette" )
311302
312303   /* cartridge */
313//  MCFG_CARTSLOT_ADD("cart")
314//  MCFG_CARTSLOT_EXTENSION_LIST("rom")
315//  MCFG_CARTSLOT_NOT_MANDATORY
316//  MCFG_CARTSLOT_LOAD(pencil2_cart)
317//  MCFG_CARTSLOT_INTERFACE("pencil2_cart")
304   MCFG_GENERIC_CARTSLOT_ADD("cartslot", GENERIC_ROM8_WIDTH, generic_plain_slot, "pencil2_cart")
318305
319306   /* printer */
320307   MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer")
r32224r32225
322309   MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(pencil2_state, write_centronics_busy))
323310
324311   MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
312
313   /* Software lists */
314   MCFG_SOFTWARE_LIST_ADD("cart_list", "pencil2")
325315MACHINE_CONFIG_END
326316
327317/* ROM definition */
328318ROM_START( pencil2 )
329319   ROM_REGION(0x10000, "maincpu", 0)
330320   ROM_LOAD( "mt.u4", 0x0000, 0x2000, CRC(338d7b59) SHA1(2f89985ac06971e00210ff992bf1e30a296d10e7) )
331   ROM_LOAD( "1-or",  0xa000, 0x1000, CRC(1ddedccd) SHA1(5fc0d30b5997224b67bf286725468194359ced5a) )
332   ROM_RELOAD(        0xb000, 0x1000 )
333   ROM_LOAD( "203",   0x8000, 0x2000, CRC(f502175c) SHA1(cb2190e633e98586758008577265a7a2bc088233) )
334   ROM_LOAD( "202",   0xc000, 0x2000, CRC(5171097d) SHA1(171999bc04dc98c74c0722b2866310d193dc0f82) )
335//  ROM_CART_LOAD("cart", 0x8000, 0x8000, ROM_OPTIONAL)
336321ROM_END
337322
338323/* Driver */
trunk/src/mess/drivers/sorcerer.c
r32224r32225
163163   ADDRESS_MAP_UNMAP_HIGH
164164   AM_RANGE(0x0000, 0x07ff) AM_RAMBANK("boot")
165165   AM_RANGE(0x0800, 0xbfff) AM_RAM
166   AM_RANGE(0xc000, 0xefff) AM_ROM                     /* rom pac and bios */
166   //AM_RANGE(0xc000, 0xdfff)      // mapped by the cartslot
167   AM_RANGE(0xe000, 0xefff) AM_ROM                     /* rom pac and bios */
167168   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_REGION("maincpu", 0xf000)        /* screen ram */
168169   AM_RANGE(0xf800, 0xfbff) AM_ROM                     /* char rom */
169170   AM_RANGE(0xfc00, 0xffff) AM_RAM AM_REGION("maincpu", 0xfc00)        /* programmable chars */
r32224r32225
175176   AM_RANGE(0x0800, 0xbbff) AM_RAM
176177   AM_RANGE(0xbc00, 0xbcff) AM_ROM
177178   AM_RANGE(0xbe00, 0xbe03) AM_DEVREADWRITE("fdc", micropolis_device, read, write)
178   AM_RANGE(0xc000, 0xefff) AM_ROM                     /* rom pac and bios */
179   //AM_RANGE(0xc000, 0xdfff)      // mapped by the cartslot
180   AM_RANGE(0xe000, 0xefff) AM_ROM                     /* rom pac and bios */
179181   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_REGION("maincpu", 0xf000)        /* screen ram */
180182   AM_RANGE(0xf800, 0xfbff) AM_ROM                     /* char rom */
181183   AM_RANGE(0xfc00, 0xffff) AM_RAM AM_REGION("maincpu", 0xfc00)        /* programmable chars */
r32224r32225
400402   MCFG_CPU_PROGRAM_MAP(sorcerer_mem)
401403   MCFG_CPU_IO_MAP(sorcerer_io)
402404
403
404405   /* video hardware */
405406   MCFG_SCREEN_ADD("screen", RASTER)
406407   MCFG_SCREEN_REFRESH_RATE(50)
r32224r32225
449450   MCFG_CASSETTE_INTERFACE("sorcerer_cass")
450451
451452   /* cartridge */
452   MCFG_CARTSLOT_ADD("cart")
453   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
454   MCFG_CARTSLOT_INTERFACE("sorcerer_cart")
453   MCFG_GENERIC_CARTSLOT_ADD("cartslot", GENERIC_ROM8_WIDTH, generic_plain_slot, "sorcerer_cart")
454   MCFG_GENERIC_EXTENSIONS("bin,rom")
455455
456456   /* software lists */
457457   MCFG_SOFTWARE_LIST_ADD("cart_list","sorcerer_cart")
r32224r32225
477477MACHINE_CONFIG_END
478478
479479
480DRIVER_INIT_MEMBER(sorcerer_state,sorcerer)
480DRIVER_INIT_MEMBER(sorcerer_state, sorcerer)
481481{
482482   UINT8 *RAM = memregion("maincpu")->base();
483483   membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0xe000);
r32224r32225
493493   ROM_LOAD("exmo1-1.dat", 0xe000, 0x0800, CRC(ac924f67) SHA1(72fcad6dd1ed5ec0527f967604401284d0e4b6a1) ) /* monitor roms */
494494   ROM_LOAD("exmo1-2.dat", 0xe800, 0x0800, CRC(ead1d0f6) SHA1(c68bed7344091bca135e427b4793cc7d49ca01be) )
495495   ROM_LOAD("exchr-1.dat", 0xf800, 0x0400, CRC(4a7e1cdd) SHA1(2bf07a59c506b6e0c01ec721fb7b747b20f5dced) ) /* char rom */
496   ROM_CART_LOAD("cart",   0xc000, 0x2000, ROM_OPTIONAL)
497496ROM_END
498497
499498ROM_START(sorcererd)
r32224r32225
502501   ROM_LOAD("exmo1-1.dat", 0xe000, 0x0800, CRC(ac924f67) SHA1(72fcad6dd1ed5ec0527f967604401284d0e4b6a1) ) /* monitor roms */
503502   ROM_LOAD("exmo1-2.dat", 0xe800, 0x0800, CRC(ead1d0f6) SHA1(c68bed7344091bca135e427b4793cc7d49ca01be) )
504503   ROM_LOAD("exchr-1.dat", 0xf800, 0x0400, CRC(4a7e1cdd) SHA1(2bf07a59c506b6e0c01ec721fb7b747b20f5dced) ) /* char rom */
505   ROM_CART_LOAD("cart",   0xc000, 0x2000, ROM_OPTIONAL)
506504
507505   ROM_REGION( 0x200, "proms", 0 )
508506   ROM_LOAD_OPTIONAL("bruce.dat",  0x0000, 0x0020, CRC(fae922cb) SHA1(470a86844cfeab0d9282242e03ff1d8a1b2238d1) ) /* video prom */
trunk/src/mess/drivers/ti74.c
r32224r32225
7373#include "cpu/tms7000/tms7000.h"
7474#include "video/hd44780.h"
7575#include "machine/nvram.h"
76#include "imagedev/cartslot.h"
76#include "bus/generic/slot.h"
77#include "bus/generic/carts.h"
7778
7879#include "ti74.lh"
7980#include "ti95.lh"
r32224r32225
8586   ti74_state(const machine_config &mconfig, device_type type, const char *tag)
8687      : driver_device(mconfig, type, tag),
8788      m_maincpu(*this, "maincpu"),
89      m_cart(*this, "cartslot"),
8890      m_battery_inp(*this, "BATTERY")
8991   { }
9092
9193   required_device<tms70c46_device> m_maincpu;
94   required_device<generic_slot_device> m_cart;
9295   required_ioport m_battery_inp;
9396
9497   ioport_port *m_key_matrix[8];
r32224r32225
120123
121124DEVICE_IMAGE_LOAD_MEMBER(ti74_state, ti74_cartridge)
122125{
123   UINT8* pos = memregion("user1")->base();
124   offs_t size;
126   UINT32 size = m_cart->common_get_size("rom");
125127
126   if (image.software_entry() == NULL)
127      size = image.length();
128   else
129      size = image.get_software_region_length("rom");
130
131128   // max size is 32KB
132129   if (size > 0x8000)
133130   {
134131      image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid file size");
135132      return IMAGE_INIT_FAIL;
136133   }
137
138   if (image.software_entry() == NULL)
139   {
140      if (image.fread(pos, size) != size)
141      {
142         image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unable to fully read file");
143         return IMAGE_INIT_FAIL;
144      }
145   }
146   else
147      memcpy(pos, image.get_software_region("rom"), size);
148
134   
135   m_cart->rom_alloc(size, 1);
136   m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");         
137   
149138   return IMAGE_INIT_PASS;
150139}
151140
r32224r32225
276265   ADDRESS_MAP_UNMAP_HIGH
277266   AM_RANGE(0x1000, 0x1001) AM_DEVREADWRITE("hd44780", hd44780_device, read, write)
278267   AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("sysram.ic3")
279   AM_RANGE(0x4000, 0xbfff) AM_ROM AM_REGION("user1", 0)
268   //AM_RANGE(0x4000, 0xbfff)      // mapped by the cartslot
280269   AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("sysbank")
281270ADDRESS_MAP_END
282271
r32224r32225
507496   for (int i = 0; i < 8; i++)
508497      m_key_matrix[i] = ioport(tags[i]);
509498
499   if (m_cart->cart_mounted())
500      m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0xbfff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart));
501
510502   membank("sysbank")->configure_entries(0, 4, memregion("system")->base(), 0x2000);
511503   membank("sysbank")->set_entry(0);
512504
r32224r32225
546538   MCFG_HD44780_PIXEL_UPDATE_CB(ti74_pixel_update)
547539
548540   /* cartridge */
549   MCFG_CARTSLOT_ADD("cart")
550   MCFG_CARTSLOT_EXTENSION_LIST("bin,rom,256")
551   MCFG_CARTSLOT_NOT_MANDATORY
552   MCFG_CARTSLOT_LOAD(ti74_state, ti74_cartridge)
553   MCFG_CARTSLOT_INTERFACE("ti74_cart")
541   MCFG_GENERIC_CARTSLOT_ADD("cartslot", GENERIC_ROM8_WIDTH, generic_plain_slot, "ti74_cart")
542   MCFG_GENERIC_EXTENSIONS("bin,rom,256")
543   MCFG_GENERIC_LOAD(ti74_state, ti74_cartridge)
544
554545   MCFG_SOFTWARE_LIST_ADD("cart_list", "ti74_cart")
555546MACHINE_CONFIG_END
556547
r32224r32225
581572   MCFG_HD44780_PIXEL_UPDATE_CB(ti95_pixel_update)
582573
583574   /* cartridge */
584   MCFG_CARTSLOT_ADD("cart")
585   MCFG_CARTSLOT_EXTENSION_LIST("bin,rom,256")
586   MCFG_CARTSLOT_NOT_MANDATORY
587   MCFG_CARTSLOT_LOAD(ti74_state, ti74_cartridge)
588   MCFG_CARTSLOT_INTERFACE("ti95_cart")
575   MCFG_GENERIC_CARTSLOT_ADD("cartslot", GENERIC_ROM8_WIDTH, generic_plain_slot, "ti95_cart")
576   MCFG_GENERIC_EXTENSIONS("bin,rom,256")
577   MCFG_GENERIC_LOAD(ti74_state, ti74_cartridge)
578
589579   //MCFG_SOFTWARE_LIST_ADD("cart_list", "ti95_cart")
590580MACHINE_CONFIG_END
591581
r32224r32225
603593
604594   ROM_REGION( 0x8000, "system", 0 )
605595   ROM_LOAD( "hn61256pc93.ic1", 0x0000, 0x8000, CRC(019aaa2f) SHA1(04a1e694a49d50602e45a7834846de4d9f7d587d) ) // system rom, banked
606
607   ROM_REGION( 0x8000, "user1", ROMREGION_ERASEFF ) // cartridge area
608596ROM_END
609597
610598
r32224r32225
614602
615603   ROM_REGION( 0x8000, "system", 0 )
616604   ROM_LOAD( "hn61256pc95.ic1", 0x0000, 0x8000, CRC(c46d29ae) SHA1(c653f08590dbc28241a9f5a6c2541641bdb0208b) ) // system rom, banked
617
618   ROM_REGION( 0x8000, "user1", ROMREGION_ERASEFF ) // cartridge area
619605ROM_END
620606
621607

Previous 199869 Revisions Next


© 1997-2024 The MAME Team