Previous 15994 Revisions Next

r1855 Friday 7th March, 2008 at 04:57:37 UTC by Robbbert
[MBEE]Stability fix
[src/mess/drivers]mbee.c
[src/mess/machine]mbee.c

src/mess/machine/mbee.c
r1854r1855
3232static UINT8 fdc_status = 0;
3333static void pio_interrupt(int state);
3434static void mbee_fdc_callback(wd17xx_state_t event, void *param);
35static UINT8 mbee_busnop = 0;
3635
3736UINT8 *mbee_workram;
3837
r1854r1855
4948}
5049
5150/*
52  NOTE: the original hardware has a "busnop" circuit which is enabled on reset/poweron.
53  It causes all reads to return 0x00 until A15 is asserted (e.g. a read at or above 0x8000).
54  The following stuff emulates that functionality.
51  On reset or power on, a circuit forces rom 8000-8FFF to appear at 0000-0FFF, while ram is disabled.
52  It gets set back to normal on the first attempt to write to memory. (/WR line goes active).
53  The previous code caused the debugger to show $FF always in RAM, soft reset to hang, and many games to not work.
5554*/
5655
57READ8_HANDLER( mbee_lowram_r )
58{
59   if (mbee_busnop)
60   {
61      return 0;
62   }
6356
64   return mbee_workram[offset];
65}
66
67static OPBASE_HANDLER( mbee_opbase_handler )
57/* after the first 4 bytes have been read from ROM, switch the ram back in */
58static TIMER_CALLBACK( mbee_reset )
6859{
69   if (address > 0x7fff)
70   {
71      mbee_busnop = 0;
72   }
73
74   return address;
60   memory_set_bank(1, 0);
7561}
7662
77static OPBASE_HANDLER( mbee56_opbase_handler )
78{
79   if (address > 0xdfff)
80   {
81      mbee_busnop = 0;
82   }
83
84   return address;
85}
86
8763MACHINE_RESET( mbee )
8864{
89   mbee_busnop = 1;
90}
91
92static void mbee_machine_start(opbase_handler handler)
93{
9465   z80pio_init(0, &pio_intf);
95   wd17xx_init(WD_TYPE_179X,mbee_fdc_callback, NULL);
96   memory_set_opbase_handler(0, handler);
66   timer_set(ATTOTIME_IN_USEC(4), NULL, 0, mbee_reset);
67   memory_set_bank(1, 1);
9768}
9869
9970MACHINE_START( mbee )
10071{
101   mbee_machine_start(mbee_opbase_handler);
72   wd17xx_init(WD_TYPE_179X,mbee_fdc_callback, NULL);
10273}
10374
104MACHINE_START( mbee56 )
105{
106   mbee_machine_start(mbee56_opbase_handler);
107}
108
10975static mess_image *cassette_device_image(void)
11076{
11177   return image_from_devtype_and_index(IO_CASSETTE, 0);
src/mess/drivers/mbee.c
r1854r1855
4848#include "cpu/z80/z80daisy.h"
4949
5050static ADDRESS_MAP_START(mbee_mem, ADDRESS_SPACE_PROGRAM, 8)
51   AM_RANGE(0x0000, 0x7fff) AM_RAM AM_READ( mbee_lowram_r ) AM_BASE( &mbee_workram )
51   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK(1)
52   AM_RANGE(0x1000, 0x7fff) AM_RAM
5253   AM_RANGE(0x8000, 0xbfff) AM_ROM
5354   AM_RANGE(0xc000, 0xdfff) AM_ROM
5455   AM_RANGE(0xe000, 0xefff) AM_ROM
r1854r1855
5859
5960
6061static ADDRESS_MAP_START(mbee56_mem, ADDRESS_SPACE_PROGRAM, 8)
61   AM_RANGE(0x0000, 0xdfff) AM_RAM
62   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK(1)
63   AM_RANGE(0x1000, 0xdfff) AM_RAM
6264   AM_RANGE(0xe000, 0xefff) AM_ROM
6365   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbee_videoram_r, mbee_videoram_w) AM_BASE(&pcgram) AM_SIZE(&videoram_size)
6466   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbee_pcg_color_r, mbee_pcg_color_w)
r1854r1855
252254   MDRV_CPU_ADD_TAG("main", Z80, 3375000)         /* 3.37500 Mhz */
253255   MDRV_CPU_PROGRAM_MAP(mbee_mem, 0)
254256   MDRV_CPU_IO_MAP(mbee_ports, 0)
255   /* MDRV_CPU_CONFIG(mbee_daisy_chain) */
257   MDRV_CPU_CONFIG(mbee_daisy_chain)
256258   MDRV_CPU_VBLANK_INT(mbee_interrupt,1)
257259   MDRV_INTERLEAVE(1)
258260
r1854r1855
285287   MDRV_IMPORT_FROM( mbee )
286288   MDRV_CPU_MODIFY( "main" )
287289   MDRV_CPU_PROGRAM_MAP(mbee56_mem, 0)
288   MDRV_MACHINE_START( mbee56 )
289290MACHINE_DRIVER_END
290291
292static DRIVER_INIT( mbee )
293{
294   UINT8 *RAM = memory_region(REGION_CPU1);
295   memory_configure_bank(1, 0, 2, &RAM[0x0000], 0x8000);
296}
291297
298static DRIVER_INIT( mbee56 )
299{
300   UINT8 *RAM = memory_region(REGION_CPU1);
301   memory_configure_bank(1, 0, 2, &RAM[0x0000], 0xe000);
302}
303
292304ROM_START( mbee )
293305    ROM_REGION(0x10000,REGION_CPU1,0)
294306    ROM_LOAD("bas522a.rom",  0x8000, 0x2000, CRC(7896a696) SHA1(a158f7803296766160e1f258dfc46134735a9477))
r1854r1855
383395SYSTEM_CONFIG_END
384396
385397/*    YEAR  NAME      PARENT    COMPAT  MACHINE   INPUT     INIT      CONFIG    COMPANY   FULLNAME */
386COMP( 1982, mbee,     0,   0,   mbee,     mbee,     0,        mbee,      "Applied Technology",  "Microbee 32 IC" , 0)
387COMP( 1982, mbeepc,   mbee,   0,   mbee,     mbee,     0,        mbee,      "Applied Technology",  "Microbee 32 PC" , 0)
388COMP( 1985?,mbeepc85, mbee,   0,   mbee,     mbee,     0,        mbee,      "Applied Technology",  "Microbee 32 PC85" , 0)
389COMP( 1983, mbee56,   mbee,   0,   mbee56,   mbee,     0,        mbee,      "Applied Technology",  "Microbee 56" , 0)
398COMP( 1982, mbee,     0,   0,   mbee,     mbee,     mbee,     mbee,      "Applied Technology",  "Microbee 32 IC" , 0)
399COMP( 1982, mbeepc,   mbee,   0,   mbee,     mbee,     mbee,     mbee,      "Applied Technology",  "Microbee 32 PC" , 0)
400COMP( 1985?,mbeepc85, mbee,   0,   mbee,     mbee,     mbee,     mbee,      "Applied Technology",  "Microbee 32 PC85" , 0)
401COMP( 1983, mbee56,   mbee,   0,   mbee56,   mbee,     mbee56,   mbee,      "Applied Technology",  "Microbee 56" , 0)
390402

Previous 15994 Revisions Next


© 1998-2018 The MESS Team