Previous 15994 Revisions Next

r9248 Tuesday 28th September, 2010 at 02:35:20 UTC by Robbbert
[MBEE] Some work on mbeeppc.
[src/mess/drivers]mbee.c
[src/mess/includes]mbee.h
[src/mess/video]mbee.c

src/mess/video/mbee.c
r9247r9248
6666static UINT8 *gfxram;
6767static UINT8 *colorram;
6868static UINT8 *videoram;
69static UINT8 *attribram;
6970static UINT8 mbee_08;
7071static UINT8 mbee_0a;
7172static UINT8 mbee_0b;
73static UINT8 mbee_1c;
7274static UINT8 mc6845_cursor[16];            // cursor shape
7375static void mc6845_cursor_configure(void);
7476static void mc6845_screen_configure(running_machine *machine);
7577
78
7679READ8_HANDLER( mbee_low_r )
7780{
7881   if (mbee_0b & 1)
r9247r9248
143146   memory_set_bank(space->machine, "pak", data & 7);
144147}
145148
149WRITE8_HANDLER ( mbeeppc_0a_w )
150{
151   mbee_0a = data;
152   memory_set_bank(space->machine, "pak", (data&15) >> 1);
153}
146154
155READ8_HANDLER ( mbeepc_telcom_low_r )
156{
157/* Read of port 0A - set Telcom rom to first half */
158   memory_set_bank(space->machine, "telcom", 0);
159   return mbee_0a;
160}
147161
162READ8_HANDLER ( mbeepc_telcom_high_r )
163{
164/* Read of port 10A - set Telcom rom to 2nd half */
165   memory_set_bank(space->machine, "telcom", 1);
166   return mbee_0a;
167}
168
169READ8_HANDLER ( mbeeppc_1c_r )
170{
171   return mbee_1c;
172}
173
174WRITE8_HANDLER( mbeeppc_1c_w )
175{
176/*  d7 extended graphics - not emulated
177    d5 bankswitch basic rom
178    d4 select attribute ram
179    d3..d0 select videoram bank */
180
181   mbee_1c = data;
182   memory_set_bank(space->machine, "basic", (data & 0x20) ? 1 : 0);
183}
184
185READ8_HANDLER( mbeeppc_low_r )
186{
187   if (mbee_1c & 16)
188      return attribram[offset];
189   else
190   if (mbee_0b & 1)
191      return gfxram[offset];
192   else
193      return videoram[offset];
194}
195
196WRITE8_HANDLER( mbeeppc_low_w )
197{
198   if (mbee_1c & 16)
199      attribram[offset] = data;
200   else
201      videoram[offset] = data;
202}
203
204READ8_HANDLER( mbeeppc_high_r )
205{
206   if (mbee_08 & 0x40)
207      return colorram[offset];
208   else
209      return gfxram[(((mbee_1c & 15) + 1) << 11) | offset];
210}
211
212WRITE8_HANDLER ( mbeeppc_high_w )
213{
214   if ((mbee_08 & 0x40) && (~mbee_0b & 1))
215      colorram[offset] = data;
216   else
217      gfxram[(((mbee_1c & 15) + 1) << 11) | offset] = data;
218}
219
220
148221static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
149222
150223/* The direction keys are used by the pc85 menu. Do not know what uses the "insert" key. */
r9247r9248
193266
194267
195268
196WRITE8_HANDLER ( mbeeppc_0a_w )
197{
198   mbee_0a = data;
199   memory_set_bank(space->machine, "pak", (data&15) >> 1);
200}
201269
202READ8_HANDLER ( mbeepc_telcom_low_r )
203{
204/* Read of port 0A - set Telcom rom to first half */
205   memory_set_bank(space->machine, "telcom", 0);
206   return mbee_0a;
207}
208270
209READ8_HANDLER ( mbeepc_telcom_high_r )
210{
211/* Read of port 10A - set Telcom rom to 2nd half */
212   memory_set_bank(space->machine, "telcom", 1);
213   return mbee_0a;
214}
215271
216WRITE8_HANDLER( mbeeppc_1c_w )
217{
218/*  d7 extended graphics - not emulated
219    d5 bankswitch basic rom
220    d4 select attribute ram - not emulated
221    d3..d0 select videoram bank - not emulated */
222
223   memory_set_bank(space->machine, "bank6", (data & 0x20) ? 1 : 0);
224}
225
226
227272static void m6545_update_strobe(running_machine *machine, int param)
228273{
229274   keyboard_matrix_r(machine, param);
r9247r9248
507552   gfxram = memory_region(machine, "gfx")+0x1000;
508553}
509554
555VIDEO_START( mbeeppc )
556{
557   videoram = memory_region(machine, "videoram");
558   colorram = memory_region(machine, "colorram");
559   gfxram = memory_region(machine, "gfx")+0x1000;
560   attribram = memory_region(machine, "attrib");
561}
562
510563VIDEO_UPDATE( mbee )
511564{
512565   UINT8 y,ra,chr,gfx;
r9247r9248
623676   return 0;
624677}
625678
679/* Need to find how the colour works on this model */
680VIDEO_UPDATE( mbeeppc )
681{
682   UINT8 y,ra,gfx,fg,bg;
683   UINT16 mem,sy=0,ma=0,x,col,chr;
684   UINT8 speed = crt.cursor_top&0x20, flash = crt.cursor_top&0x40;            // cursor modes
685   UINT16 cursor = (crt.cursor_address_hi<<8) | crt.cursor_address_lo;         // get cursor position
686   UINT16 screen_home = (crt.screen_address_hi<<8) | crt.screen_address_lo;      // screen home offset (usually zero)
687   UINT16 colourm = (mbee_08 & 0x0e) << 7;
688
689   framecnt++;
690
691   for (y = 0; y < crt.vertical_displayed; y++)                  // for each row of chars
692   {
693      for (ra = 0; ra < (crt.scan_lines&15)+1; ra++)               // for each scanline - RA4 is used as an update strobe for the keyboard
694      {
695         UINT16  *p = BITMAP_ADDR16(bitmap, sy++, 0);
696
697         for (x = ma; x < ma + crt.horizontal_displayed; x++)         // for each character
698         {
699            UINT8 inv=0;
700            mem = (x + screen_home) & 0x7ff;
701            chr = videoram[mem];
702            col = colorram[mem] | colourm;               // read a byte of colour
703
704            if (chr & 0x80)
705               chr += (attribram[mem] << 7);            // bump chr to its particular pcg definition
706
707            if ((x & 15) == 0)
708            {
709               if (mbee_wait_time)
710                  mbee_wait_time--;
711               else
712                  m6545_update_strobe(screen->machine, x);
713            }
714
715            /* process cursor */
716            if ((((!flash) && (!speed)) ||               // (5,6)=(0,0) = cursor on always
717               ((flash) && (speed) && (framecnt & 0x10)) ||      // (5,6)=(1,1) = cycle per 32 frames
718               ((flash) && (!speed) && (framecnt & 8))) &&      // (5,6)=(0,1) = cycle per 16 frames
719               (mem == cursor))               // displaying at cursor position?
720                  inv ^= mc6845_cursor[ra];         // cursor scan row
721
722            /* get pattern of pixels for that character scanline */
723            gfx = gfxram[(chr<<4) | ra] ^ inv;
724            fg = (col & 0x001f) | 64;               // map to foreground palette
725            bg = (col & 0x07e0) >> 5;               // and background palette
726
727            /* Display a scanline of a character (8 pixels) */
728            *p = ( gfx & 0x80 ) ? fg : bg; p++;
729            *p = ( gfx & 0x40 ) ? fg : bg; p++;
730            *p = ( gfx & 0x20 ) ? fg : bg; p++;
731            *p = ( gfx & 0x10 ) ? fg : bg; p++;
732            *p = ( gfx & 0x08 ) ? fg : bg; p++;
733            *p = ( gfx & 0x04 ) ? fg : bg; p++;
734            *p = ( gfx & 0x02 ) ? fg : bg; p++;
735            *p = ( gfx & 0x01 ) ? fg : bg; p++;
736         }
737      }
738      ma+=crt.horizontal_displayed;
739   }
740   return 0;
741}
742
743
626744PALETTE_INIT( mbeeic )
627745{
628746   UINT16 i;
src/mess/includes/mbee.h
r9247r9248
6666READ8_HANDLER ( mbeepc_telcom_low_r );
6767READ8_HANDLER ( mbeepc_telcom_high_r );
6868WRITE8_HANDLER ( mbeeppc_0a_w );
69READ8_HANDLER ( mbeeppc_1c_r );
6970WRITE8_HANDLER ( mbeeppc_1c_w );
71READ8_HANDLER( mbeeppc_low_r );
72READ8_HANDLER( mbeeppc_high_r );
73WRITE8_HANDLER( mbeeppc_high_w );
74WRITE8_HANDLER( mbeeppc_low_w );
7075
76
7177VIDEO_START( mbee );
7278VIDEO_UPDATE( mbee );
73
7479VIDEO_START( mbeeic );
7580VIDEO_UPDATE( mbeeic );
81VIDEO_START( mbeeppc );
82VIDEO_UPDATE( mbeeppc );
7683PALETTE_INIT( mbeeic );
7784
7885#endif /* MBEE_H_ */
src/mess/drivers/mbee.c
r9247r9248
134134static ADDRESS_MAP_START(mbeeppc_mem, ADDRESS_SPACE_PROGRAM, 8)
135135   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot")
136136   AM_RANGE(0x1000, 0x7fff) AM_RAM
137   AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank6")
137   AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("basic")
138138   AM_RANGE(0xa000, 0xbfff) AM_ROM
139139   AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("pak")
140140   AM_RANGE(0xe000, 0xefff) AM_ROMBANK("telcom")
141   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbee_low_r, mbee_low_w)
142   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbeeic_high_r, mbeeic_high_w)
141   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbeeppc_low_r, mbeeppc_low_w)
142   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbeeppc_high_r, mbeeppc_high_w)
143143ADDRESS_MAP_END
144144
145145static ADDRESS_MAP_START(mbee56_mem, ADDRESS_SPACE_PROGRAM, 8)
r9247r9248
204204
205205static ADDRESS_MAP_START(mbeeppc_io, ADDRESS_SPACE_IO, 8)
206206   ADDRESS_MAP_UNMAP_HIGH
207   AM_RANGE(0x0000, 0x0003) AM_MIRROR(0xff00) AM_DEVREADWRITE("z80pio", z80pio_ba_cd_r, z80pio_ba_cd_w)
208   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff00) AM_READWRITE(mbeeic_08_r, mbeeic_08_w)
209   AM_RANGE(0x000a, 0x000a) AM_MIRROR(0xfe00) AM_READWRITE(mbeepc_telcom_low_r, mbeeppc_0a_w)
210   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff00) AM_READWRITE(mbee_0b_r, mbee_0b_w)
207   AM_RANGE(0x0000, 0x0003) AM_MIRROR(0xff10) AM_DEVREADWRITE("z80pio", z80pio_ba_cd_r, z80pio_ba_cd_w)
208   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff10) AM_READWRITE(mbeeic_08_r, mbeeic_08_w)
209   AM_RANGE(0x000a, 0x000a) AM_MIRROR(0xfe10) AM_READWRITE(mbeepc_telcom_low_r, mbeeppc_0a_w)
210   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff10) AM_READWRITE(mbee_0b_r, mbee_0b_w)
211211   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff00) AM_READWRITE(m6545_status_r, m6545_index_w)
212   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff00) AM_READWRITE(m6545_data_r, m6545_data_w)
213   AM_RANGE(0x001c, 0x001c) AM_MIRROR(0xff00) AM_WRITE(mbeeppc_1c_w)
214   AM_RANGE(0x010a, 0x010a) AM_MIRROR(0xfe00) AM_READWRITE(mbeepc_telcom_high_r, mbeeppc_0a_w)
212   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff10) AM_READWRITE(m6545_data_r, m6545_data_w)
213   AM_RANGE(0x001c, 0x001c) AM_MIRROR(0xff00) AM_READWRITE(mbeeppc_1c_r,mbeeppc_1c_w)
214   AM_RANGE(0x010a, 0x010a) AM_MIRROR(0xfe10) AM_READWRITE(mbeepc_telcom_high_r, mbeeppc_0a_w)
215215ADDRESS_MAP_END
216216
217217static ADDRESS_MAP_START(mbee56_io, ADDRESS_SPACE_IO, 8)
r9247r9248
499499   MDRV_CPU_IO_MAP(mbeepc85_io)
500500MACHINE_CONFIG_END
501501
502static MACHINE_CONFIG_DERIVED( mbeeppc, mbeepc85 )
502static MACHINE_CONFIG_DERIVED( mbeeppc, mbeeic )
503503   MDRV_CPU_MODIFY( "maincpu" )
504504   MDRV_CPU_PROGRAM_MAP(mbeeppc_mem)
505505   MDRV_CPU_IO_MAP(mbeeppc_io)
506   MDRV_VIDEO_START(mbeeppc)
507   MDRV_VIDEO_UPDATE(mbeeppc)
506508MACHINE_CONFIG_END
507509
508static MACHINE_CONFIG_DERIVED( mbee56, mbeepc85 )
510static MACHINE_CONFIG_DERIVED( mbee56, mbeeic )
509511   MDRV_CPU_MODIFY( "maincpu" )
510512   MDRV_CPU_PROGRAM_MAP(mbee56_mem)
511513   MDRV_CPU_IO_MAP(mbee56_io)
r9247r9248
513515   MDRV_FLOPPY_2_DRIVES_ADD(mbee_floppy_config)
514516MACHINE_CONFIG_END
515517
516static MACHINE_CONFIG_DERIVED( mbee64, mbeepc85 )
518static MACHINE_CONFIG_DERIVED( mbee64, mbeeic )
517519   MDRV_CPU_MODIFY( "maincpu" )
518520   MDRV_CPU_PROGRAM_MAP(mbee64_mem)
519521   MDRV_CPU_IO_MAP(mbee64_io)
r9247r9248
575577static DRIVER_INIT( mbeeppc )
576578{
577579   UINT8 *RAM = memory_region(machine, "maincpu");
578   memory_configure_bank(machine, "boot", 0, 2, &RAM[0x0000],  0x30000);
579   memory_configure_bank(machine, "bank6", 0, 2, &RAM[0x30000], 0x2000);
580   memory_configure_bank(machine, "boot", 0, 1, &RAM[0x0000], 0x0000);
580581
582   RAM = memory_region(machine, "basicrom");
583   memory_configure_bank(machine, "basic", 0, 2, &RAM[0x0000], 0x2000);
584   memory_configure_bank(machine, "boot", 1, 1, &RAM[0x0000], 0x0000);
585
581586   RAM = memory_region(machine, "telcomrom");
582587   memory_configure_bank(machine, "telcom", 0, 2, &RAM[0x0000], 0x1000);
583588
r9247r9248
586591
587592   memory_set_bank(machine, "pak", 5);
588593   memory_set_bank(machine, "telcom", 0);
589   memory_set_bank(machine, "bank6", 0);
594   memory_set_bank(machine, "basic", 0);
590595   mbee_size = 0x8000;
591596}
592597
r9247r9248
745750ROM_END
746751
747752ROM_START( mbeeppc )
748   ROM_REGION(0x40000,"maincpu", ROMREGION_ERASEFF )
753   ROM_REGION(0x10000,"maincpu", ROMREGION_ERASEFF )
749754   ROM_LOAD("bas529b.rom",           0xa000,  0x2000, CRC(a1bd986b) SHA1(5d79f210c9042db5aefc85a0bdf45210cb9e9899) )
750   ROM_LOAD("bas529a.rom",           0x30000, 0x4000, CRC(fe8242e1) SHA1(ff790edf4fcc7a134d451dbad7779157b07f6abf) )
751755
756   ROM_REGION(0x4000, "basicrom", 0)
757   ROM_LOAD("bas529a.rom",           0x0000,  0x4000, CRC(fe8242e1) SHA1(ff790edf4fcc7a134d451dbad7779157b07f6abf) )
758
752759   ROM_REGION(0x2000, "telcomrom", 0)
753760   ROM_LOAD_OPTIONAL("telco321.rom", 0x0000,  0x2000, CRC(36852a11) SHA1(c45b8d03629e86231c6b256a7435abd87d8872a4) )
754761
r9247r9248
762769   ROM_LOAD_OPTIONAL("vtex235.rom",  0x8000,  0x2000, CRC(8c30ecb2) SHA1(cf068462d7def885bdb5d3a265851b88c727c0d7) ) // 4
763770   ROM_LOAD("ppcshell.rom",          0xa000,  0x2000, CRC(1e793555) SHA1(ddeaa081ec4408e80e3fb192865d87daa035c701) ) // 5
764771
765   ROM_REGION(0x2000, "gfx", 0)
772   ROM_REGION(0x9800, "gfx", 0)
766773   ROM_LOAD("charrom.bin",           0x1000,  0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0) )
767774   ROM_RELOAD( 0x0000, 0x1000 )
768775
r9247r9248
770777   ROM_LOAD( "82s123.ic7",           0x0000,  0x0020, CRC(61b9c16c) SHA1(0ee72377831c21339360c376f7248861d476dc20) )
771778   ROM_LOAD_OPTIONAL( "82s123.ic16", 0x0020,  0x0020, CRC(4e779985) SHA1(cd2579cf65032c30b3fe7d6d07b89d4633687481) )   /* video switching prom, not needed for emulation purposes */
772779
773   ROM_REGION( 0x1000, "videoram", ROMREGION_ERASE00 )
780   ROM_REGION( 0x0800, "videoram", ROMREGION_ERASE00 )
774781   ROM_REGION( 0x0800, "colorram", ROMREGION_ERASE00 )
782   ROM_REGION( 0x0800, "attrib", ROMREGION_ERASE00 )
775783ROM_END
776784
777785ROM_START( mbee56 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team