Previous 15994 Revisions Next

r2465 Friday 25th April, 2008 at 09:44:41 UTC by Robbbert
[MBEE] Replaced read handlers with banking, because of a core memory bug.
[src/mess/drivers]mbee.c
[src/mess/includes]mbee.h
[src/mess/video]mbee.c

src/mess/includes/mbee.h
r2464r2465
4646 READ8_HANDLER ( mbee_pcg_color_latch_r );
4747WRITE8_HANDLER ( mbee_pcg_color_latch_w );
4848
49 READ8_HANDLER ( mbee_videoram_r );
5049WRITE8_HANDLER ( mbee_videoram_w );
51
52 READ8_HANDLER ( mbee_pcg_color_r );
5350WRITE8_HANDLER ( mbee_pcg_color_w );
54
55 READ8_HANDLER ( mbee_pcg_r );
5651WRITE8_HANDLER ( mbee_pcg_w );
5752
5853VIDEO_START( mbee );
src/mess/video/mbee.c
r2464r2465
5555WRITE8_HANDLER ( mbee_pcg_color_latch_w )
5656{
5757   mbee_pcg_color_latch = data;
58   if (data & 0x40)
59      memory_set_bank( 3, 1);
60   else
61      memory_set_bank( 3, 0);
5862}
5963
6064 READ8_HANDLER ( mbee_pcg_color_latch_r )
r2464r2465
6771   videoram[offset] = data;
6872}
6973
70 READ8_HANDLER ( mbee_videoram_r )
71{
72   if( m6545_video_bank & 0x01 )
73      return pcgram[offset];
74   else
75      return videoram[offset];
76}
77
7874WRITE8_HANDLER ( mbee_pcg_w )
7975{
8076   if( pcgram[0x0800+offset] != data )
r2464r2465
8682   }
8783}
8884
89 READ8_HANDLER ( mbee_pcg_r )
90{
91   return pcgram[0x0800+offset];
92}
93
9485WRITE8_HANDLER ( mbee_pcg_color_w )
9586{
9687   if( (m6545_video_bank & 0x01) || (mbee_pcg_color_latch & 0x40) == 0 )
r2464r2465
10798      colorram[offset] = data;
10899}
109100
110 READ8_HANDLER ( mbee_pcg_color_r )
111{
112
113   if ( mbee_pcg_color_latch & 0x40 )
114      return colorram[offset];
115   else
116      return pcgram[0x0800+offset];
117}
118
119101static int keyboard_matrix_r(int offs)
120102{
121103   char portname[6];
r2464r2465
179161WRITE8_HANDLER ( mbee_video_bank_w )
180162{
181163   m6545_video_bank = data;
164   if (data & 1)
165      memory_set_bank( 2, 0);
166   else
167      memory_set_bank( 2, 1);
182168}
183169
184170static void m6545_update_strobe(int param)
r2464r2465
365351         break;
366352      crt.screen_address_hi = data;
367353      addr = 0x17000+((data & 32) << 6);
368      memcpy(memory_region(REGION_CPU1)+0xf000, memory_region(REGION_CPU1)+addr, 0x800);
354      memcpy(pcgram, memory_region(REGION_CPU1)+addr, 0x800);
369355      for (i = 0; i < 128; i++)
370356            decodechar(machine->gfx[0],i, pcgram);
371357      break;
r2464r2465
461447
462448VIDEO_START( mbee )
463449{
464   videoram = auto_malloc(0x800);
465   pcgram = memory_region(REGION_CPU1)+0xf000;
450   videoram = memory_region(REGION_CPU1)+0x15000;
451   pcgram = memory_region(REGION_CPU1)+0x11000;
466452}
467453
468454VIDEO_START( mbeeic )
469455{
470   videoram = auto_malloc(0x800);
471   colorram = auto_malloc(0x800);
472   pcgram = memory_region(REGION_CPU1)+0xf000;
456   videoram = memory_region(REGION_CPU1)+0x15000;
457   colorram = memory_region(REGION_CPU1)+0x15800;
458   pcgram = memory_region(REGION_CPU1)+0x11000;
473459}
474460
475461VIDEO_UPDATE( mbee )
src/mess/drivers/mbee.c
r2464r2465
6969   AM_RANGE(0x1000, 0x3fff) AM_RAM
7070   AM_RANGE(0x4000, 0x7fff) AM_WRITENOP   /* Needed because quickload to here will crash MESS otherwise */
7171   AM_RANGE(0x8000, 0xefff) AM_ROM
72   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbee_videoram_r, mbee_videoram_w) AM_BASE(&pcgram) AM_SIZE(&videoram_size)
73   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbee_pcg_r, mbee_pcg_w)
72   AM_RANGE(0xf000, 0xf7ff) AM_RAMBANK(2) AM_WRITE(mbee_videoram_w) AM_SIZE(&videoram_size)
73   AM_RANGE(0xf800, 0xffff) AM_RAMBANK(3) AM_WRITE(mbee_pcg_w)
7474ADDRESS_MAP_END
7575
7676static ADDRESS_MAP_START(mbeeic_mem, ADDRESS_SPACE_PROGRAM, 8)
r2464r2465
7878   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK(1)
7979   AM_RANGE(0x1000, 0x7fff) AM_RAM
8080   AM_RANGE(0x8000, 0xefff) AM_ROM
81   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbee_videoram_r, mbee_videoram_w) AM_BASE(&pcgram) AM_SIZE(&videoram_size)
82   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbee_pcg_color_r, mbee_pcg_color_w)
81   AM_RANGE(0xf000, 0xf7ff) AM_RAMBANK(2) AM_WRITE(mbee_videoram_w) AM_SIZE(&videoram_size)
82   AM_RANGE(0xf800, 0xffff) AM_RAMBANK(3) AM_WRITE(mbee_pcg_color_w)
8383ADDRESS_MAP_END
8484
8585static ADDRESS_MAP_START(mbee56_mem, ADDRESS_SPACE_PROGRAM, 8)
r2464r2465
8787   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK(1)
8888   AM_RANGE(0x1000, 0xdfff) AM_RAM
8989   AM_RANGE(0xe000, 0xefff) AM_ROM
90   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbee_videoram_r, mbee_videoram_w) AM_BASE(&pcgram) AM_SIZE(&videoram_size)
91   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbee_pcg_color_r, mbee_pcg_color_w)
90   AM_RANGE(0xf000, 0xf7ff) AM_RAMBANK(2) AM_WRITE(mbee_videoram_w) AM_SIZE(&videoram_size)
91   AM_RANGE(0xf800, 0xffff) AM_RAMBANK(3) AM_WRITE(mbee_pcg_color_w)
9292ADDRESS_MAP_END
9393
9494
r2464r2465
106106   ADDRESS_MAP_UNMAP_HIGH
107107   AM_RANGE(0x00, 0x03) AM_MIRROR(0x10) AM_READWRITE(mbee_pio_r, mbee_pio_w)
108108   AM_RANGE(0x08, 0x08) AM_MIRROR(0x10) AM_READWRITE(mbee_pcg_color_latch_r, mbee_pcg_color_latch_w)
109   // AM_RANGE(0x09, 0x09) AM_MIRROR(0x10)  Listed as "Colour Wait Off or USART 2651" but doesn't appear in the schematics
109   // AM_RANGE(0x09, 0x09) AM_MIRROR(0x10)  Listed as "Colour Wait Off" or "USART 2651" but doesn't appear in the schematics
110110   AM_RANGE(0x0a, 0x0a) AM_MIRROR(0x10) AM_READWRITE(mbee_color_bank_r, mbee_color_bank_w)
111111   AM_RANGE(0x0b, 0x0b) AM_MIRROR(0x10) AM_READWRITE(mbee_video_bank_r, mbee_video_bank_w)
112112   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x10) AM_READWRITE(m6545_status_r, m6545_index_w)
r2464r2465
227227};
228228
229229static GFXDECODE_START( mbee )
230   GFXDECODE_ENTRY( REGION_CPU1, 0xf000, mbee_charlayout, 0, 1 )
230   GFXDECODE_ENTRY( REGION_CPU1, 0x11000, mbee_charlayout, 0, 1 )
231231GFXDECODE_END
232232
233233static GFXDECODE_START( mbeeic )
234   GFXDECODE_ENTRY( REGION_CPU1, 0xf000, mbee_charlayout, 0, 4096 )
234   GFXDECODE_ENTRY( REGION_CPU1, 0x11000, mbee_charlayout, 0, 4096 )
235235GFXDECODE_END
236236
237237static PALETTE_INIT( mbee )
r2464r2465
364364{
365365   UINT8 *RAM = memory_region(REGION_CPU1);
366366   memory_configure_bank(1, 0, 2, &RAM[0x0000], 0x8000);
367   memory_configure_bank(2, 0, 2, &RAM[0x11000], 0x4000);
368   memory_configure_bank(3, 0, 2, &RAM[0x11800], 0x4000);
369   memory_set_bank(2, 1);
370   memory_set_bank(3, 0);
367371}
368372
369373static DRIVER_INIT( mbee56 )
370374{
371375   UINT8 *RAM = memory_region(REGION_CPU1);
372376   memory_configure_bank(1, 0, 2, &RAM[0x0000], 0xe000);
377   memory_configure_bank(2, 0, 2, &RAM[0x11000], 0x4000);
378   memory_configure_bank(3, 0, 2, &RAM[0x11800], 0x4000);
379   memory_set_bank(2, 1);
380   memory_set_bank(3, 0);
373381}
374382
375383ROM_START( mbee )
r2464r2465
381389   ROM_LOAD("edasma.ic31",   0xc000, 0x1000, CRC(120c3dea) SHA1(32c9bb6e54dd50d5218bb43cc921885a0307161d) )
382390   ROM_LOAD("edasmb.ic33",   0xd000, 0x1000, CRC(a23bf3c8) SHA1(73a57c2800a1c744b527d0440b170b8b03351753) )
383391   ROM_LOAD("telcom11.rom",  0xe000, 0x1000, CRC(15516499) SHA1(2d4953f994b66c5d3b1d457b8c92d9a0a69eb8b8) )
384   ROM_LOAD("charrom.ic13",  0xf000, 0x0800, CRC(b149737b) SHA1(a3cd4f5d0d3c71137cd1f0f650db83333a2e3597) )
392   ROM_LOAD("charrom.ic13",  0x11000, 0x0800, CRC(b149737b) SHA1(a3cd4f5d0d3c71137cd1f0f650db83333a2e3597) )
385393   ROM_RELOAD( 0x17000, 0x0800 )
386394   ROM_RELOAD( 0x17800, 0x0800 )
387395
r2464r2465
395403   ROM_LOAD("bas522b.rom",   0xa000, 0x2000, CRC(b21d9679) SHA1(332844433763331e9483409cd7da3f90ac58259d))
396404   ROM_LOAD("edasm.rom",     0xc000, 0x2000, CRC(1af1b3a9) SHA1(d035a997c2dbbb3918b3395a3a5a1076aa203ee5))
397405   ROM_LOAD("telcom12.rom",  0xe000, 0x1000, CRC(0231bda3) SHA1(be7b32499034f985cc8f7865f2bc2b78c485585c) )
398   ROM_LOAD("charrom.bin",   0xf000, 0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0))
406   ROM_LOAD("charrom.bin",   0x11000, 0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0))
399407   ROM_RELOAD( 0x17000, 0x1000 )
400408
401409   ROM_REGION( 0x0040, REGION_PROMS, 0 )
r2464r2465
408416   ROM_LOAD("bas522a.rom",   0x8000, 0x2000, CRC(7896a696) SHA1(a158f7803296766160e1f258dfc46134735a9477))
409417   ROM_LOAD("bas522b.rom",   0xa000, 0x2000, CRC(b21d9679) SHA1(332844433763331e9483409cd7da3f90ac58259d))
410418   ROM_LOAD("wbee12.rom",    0xc000, 0x2000, CRC(0fc21cb5) SHA1(33b3995988fc51ddef1568e160dfe699867adbd5))
411   ROM_LOAD("charrom.bin",   0xf000, 0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0))
419   ROM_LOAD("charrom.bin",   0x11000, 0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0))
412420   ROM_RELOAD( 0x17000, 0x1000 )
413421
414422   ROM_REGION( 0x0040, REGION_PROMS, 0 )
r2464r2465
422430   ROM_LOAD("bas522b.rom",   0xa000, 0x2000, CRC(b21d9679) SHA1(332844433763331e9483409cd7da3f90ac58259d))
423431   /* This telcom rom is banked between its 2 halves, hooked to port 0A -  not emulated yet */
424432   ROM_LOAD("telc321.rom",   0xe000, 0x2000, CRC(b07eefaa) SHA1(5dab90b2c232673282d215845c9947cc5bdd50c8))
425   ROM_LOAD("charrom.bin",   0xf000, 0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0))
433   ROM_LOAD("charrom.bin",   0x11000, 0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0))
426434   ROM_RELOAD( 0x17000, 0x1000 )
427435
428436   ROM_REGION( 0x0040, REGION_PROMS, 0 )
r2464r2465
433441ROM_START( mbee56 )
434442   ROM_REGION(0x18000,REGION_CPU1,0)
435443   ROM_LOAD("56kb.rom",      0xe000, 0x1000, CRC(28211224) SHA1(b6056339402a6b2677b0e6c57bd9b78a62d20e4f))
436   ROM_LOAD("charrom.bin",   0xf000, 0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0))
444   ROM_LOAD("charrom.bin",   0x11000, 0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0))
437445   ROM_RELOAD( 0x17000, 0x1000 )
438446
439447   ROM_REGION( 0x0040, REGION_PROMS, 0 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team