Previous 15994 Revisions Next

r9320 Tuesday 5th October, 2010 at 07:04:25 UTC by Robbbert
[MBEE] mbee64 - Added proper banking, now it really does have 64k of RAM.
[src/mess/drivers]mbee.c
[src/mess/includes]mbee.h
[src/mess/machine]mbee.c
[src/mess/video]mbee.c

src/mess/machine/mbee.c
r9319r9320
205205   //wd17xx_set_complete_command_delay(mbee_fdc, 50);   /* default is 12 usec if not set */
206206}
207207
208MACHINE_RESET( mbee64 )
209{
210   memory_set_bank(machine, "boot", 1);
211   memory_set_bank(machine, "bankl", 1);
212   memory_set_bank(machine, "bankh", 1);
213   mbee_z80pio = machine->device("z80pio");
214   mbee_speaker = machine->device("speaker");
215   mbee_cassette = machine->device("cassette");
216   mbee_printer = machine->device("centronics");
217   mbee_fdc = machine->device("wd179x");
218   mbee_rtc = machine->device<mc146818_device>("rtc");
219}
208220
209221INTERRUPT_GEN( mbee_interrupt )
210222{
223// Due to the uncertainly and hackage here, this is commented out for now - Robbbert - 05-Oct-2010
224#if 0
225
211226   address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
212   /* once per frame, pulse the PIO B bit 7 */
213//   mbee_vsync = 1;
227   /* once per frame, pulse the PIO B bit 7 - it is in the schematic as an option,
228   but need to find out what it does */
229   mbee_vsync = 1;
214230
215231   /* The printer status connects to the pio ASTB pin, and the printer changing to not
216232        busy should signal an interrupt routine at B61C, (next line) but this doesn't work.
r9319r9320
219235   z80pio_astb_w( mbee_z80pio, centronics_busy_r(mbee_printer));   /* signal int when not busy (L->H) */
220236
221237   space->write_byte(0x109, centronics_busy_r(mbee_printer));
238
239   /* But it would break any program loaded to that area of memory, such as CP/M programs */
240#endif
222241}
223242
224243DRIVER_INIT( mbee )
r9319r9320
313332DRIVER_INIT( mbee64 )
314333{
315334   UINT8 *RAM = memory_region(machine, "maincpu");
316   memory_configure_bank(machine, "boot", 0, 2, &RAM[0x0000],  0xe000);
317   mbee_size = 0xe000;
335   memory_configure_bank(machine, "boot", 0, 1, &RAM[0x0000],  0x0000);
336   memory_configure_bank(machine, "bankl", 0, 1, &RAM[0x1000],  0x0000);
337   memory_configure_bank(machine, "bankl", 1, 1, &RAM[0x9000],  0x0000);
338   memory_configure_bank(machine, "bankh", 0, 1, &RAM[0x8000],  0x0000);
318339
340   RAM = memory_region(machine, "bootrom");
341   memory_configure_bank(machine, "bankh", 1, 1, &RAM[0x0000], 0x0000);
342   memory_configure_bank(machine, "boot", 1, 1, &RAM[0x0000], 0x0000);
343
344   mbee_size = 0xf000;
345
319346   timer_pulse(machine, ATTOTIME_IN_HZ(1),NULL,0,mbee_rtc_irq);   /* timer for rtc */
320347}
321348
src/mess/video/mbee.c
r9319r9320
178178   memory_set_bank(space->machine, "basic", (data & 0x20) ? 1 : 0);
179179}
180180
181WRITE8_HANDLER( mbee64_50_w )
182{
183/* This does a number of other things in the 128k (and later) models - not sure if
184    they exist in the 64k */
185
186   if (data & 4)
187   {
188      memory_set_bank(space->machine, "boot", 0);
189      memory_set_bank(space->machine, "bankl", 0);
190      memory_set_bank(space->machine, "bankh", 0);
191   }
192   else
193   {
194      memory_set_bank(space->machine, "bankl", 1);
195      memory_set_bank(space->machine, "bankh", 1);
196   }
197}
198
199
181200READ8_HANDLER( mbeeppc_low_r )
182201{
183202   if (mbee_1c & 16)
r9319r9320
261280   if( data )
262281   {
263282      crt.lpen_lo = offs;
264      crt.lpen_hi = offs >> 8;
283      crt.lpen_hi = (offs >> 8) & 0x3f;
265284      crt.lpen_strobe = 1;
266285   }
267286}
src/mess/includes/mbee.h
r9319r9320
4343DRIVER_INIT( mbee56 );
4444DRIVER_INIT( mbee64 );
4545MACHINE_RESET( mbee );
46MACHINE_RESET( mbee64 );
4647WRITE8_HANDLER( mbee_04_w );
4748WRITE8_HANDLER( mbee_06_w );
4849READ8_HANDLER( mbee_07_r );
r9319r9320
8182READ8_HANDLER( mbeeppc_high_r );
8283WRITE8_HANDLER( mbeeppc_high_w );
8384WRITE8_HANDLER( mbeeppc_low_w );
85WRITE8_HANDLER( mbee64_50_w );
8486
8587
8688VIDEO_START( mbee );
src/mess/drivers/mbee.c
r9319r9320
6363
6464    TODO:
6565    - Printer is working, but with improper code. This needs to be fixed.
66   05-Oct-2010 printer hack commented out for now.. it doesn't work any more
6667    - Roms for mbeepc to be checked (I think they are correct)
6768    - Fix Paste (it loses most of the characters)
6869    - Fix the rtc (it's in as per the manuals, but it is completely ignored)
r9319r9320
153154
154155static ADDRESS_MAP_START(mbee64_mem, ADDRESS_SPACE_PROGRAM, 8)
155156   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot")
156   AM_RANGE(0x1000, 0xdfff) AM_RAM
157   AM_RANGE(0xe000, 0xefff) AM_ROM
157   AM_RANGE(0x1000, 0x7fff) AM_RAMBANK("bankl")
158   AM_RANGE(0x8000, 0xefff) AM_RAMBANK("bankh")
158159   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbee_low_r, mbee_low_w)
159160   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbeeic_high_r, mbeeic_high_w)
160161ADDRESS_MAP_END
r9319r9320
255256   AM_RANGE(0x0d, 0x0d) AM_MIRROR(0x10) AM_READWRITE(m6545_data_r, m6545_data_w)
256257   AM_RANGE(0x44, 0x47) AM_DEVREADWRITE("wd179x", wd17xx_r, wd17xx_w)
257258   AM_RANGE(0x48, 0x48) AM_READWRITE(mbee_fdc_status_r, mbee_fdc_motor_w)
259   AM_RANGE(0x50, 0x50) AM_WRITE(mbee64_50_w)
258260ADDRESS_MAP_END
259261
260262static INPUT_PORTS_START( mbee )
r9319r9320
545547   MDRV_CPU_MODIFY( "maincpu" )
546548   MDRV_CPU_PROGRAM_MAP(mbee64_mem)
547549   MDRV_CPU_IO_MAP(mbee64_io)
550   MDRV_MACHINE_RESET( mbee64 )
548551   MDRV_WD179X_ADD("wd179x", mbee_wd17xx_interface )
549552   MDRV_FLOPPY_2_DRIVES_ADD(mbee_floppy_config)
550553MACHINE_CONFIG_END
r9319r9320
777780
778781ROM_START( mbee64 )
779782   ROM_REGION(0x10000,"maincpu", ROMREGION_ERASEFF)
780   ROM_LOAD("rom1.bin",              0xdf00,  0x2000, CRC(995c53db) SHA1(46e1a5cfd5795b8cf528bacf9dc79398ff7d64af) )
781783
784   ROM_REGION(0x2000,"bootrom", ROMREGION_ERASEFF)
785   ROM_LOAD("rom1.bin",              0x0000,  0x2000, CRC(995c53db) SHA1(46e1a5cfd5795b8cf528bacf9dc79398ff7d64af) )
786
782787   ROM_REGION(0x2000, "gfx", 0)
783788   ROM_LOAD("charrom.bin",           0x1000,  0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0) )
784789   ROM_RELOAD( 0x0000, 0x1000 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team