Previous 15994 Revisions Next

r1928 Tuesday 11th March, 2008 at 21:07:10 UTC by Curt Coder
[ABC80X] Added some bits for ABC 806 video. Added port mirroring.
[src/mess/drivers]abc80x.c
[src/mess/includes]abc80x.h
[src/mess/video]abc80x.c

src/mess/includes/abc80x.h
r1927r1928
1919
2020void abc802_mux80_40_w(int level);
2121
22READ8_HANDLER( abc806_videoram_r );
23WRITE8_HANDLER( abc806_videoram_w );
24READ8_HANDLER( abc806_colorram_r );
25WRITE8_HANDLER( abc806_colorram_w );
26READ8_HANDLER( abc806_fgctlprom_r );
27WRITE8_HANDLER( abc806_sync_w );
28
2229#endif /* __ABC80X__ */
src/mess/video/abc80x.c
r1927r1928
265265static int abc802_flshclk;
266266static int abc802_mux80_40;
267267
268static UINT8 *abc806_colorram;
269
270static UINT8 abc806_v50_addr;
271static UINT8 abc806_hrui_addr;
272static UINT16 abc806_colorram_address_latch;
273
274static int abc806_eme;
275static int abc806_txoff;
276static int abc806_40;
277static int abc806_flshclk;
278
268279extern mc6845_t *abc800_mc6845;
269280
270281/* Palette Initialization */
r1927r1928
294305   abc802_mux80_40 = level;
295306}
296307
308READ8_HANDLER( abc806_videoram_r )
309{
310   abc806_colorram_address_latch = offset;
311
312   return videoram[offset];
313}
314
315WRITE8_HANDLER( abc806_videoram_w )
316{
317   abc806_colorram_address_latch = offset;
318
319   videoram[offset] = data;
320}
321
322READ8_HANDLER( abc806_colorram_r )
323{
324   return abc806_colorram[abc806_colorram_address_latch];
325}
326
327WRITE8_HANDLER( abc806_colorram_w )
328{
329   abc806_colorram[abc806_colorram_address_latch] = data;
330}
331
332READ8_HANDLER( abc806_fgctlprom_r )
333{
334   /*
335
336      bit      description
337
338      0      EME
339      1      40
340      2      HRU II A8, PROT A0
341      3      PROT INI
342      4      TXOFF
343      5      E05-16 CS
344      6      E05-16 CLK
345      7      E05-16 DI/O, PROT DIN
346
347   */
348
349   UINT8 data = 0;
350
351   //data |= e0516_dio_r() << 7;
352
353   return data;
354}
355
356WRITE8_HANDLER( abc806_sync_w )
357{
358   /*
359
360      bit      description
361
362      0      EME
363      1      40
364      2      HRU II A8, PROT A0
365      3      PROT INI
366      4      TXOFF
367      5      E05-16 CS
368      6      E05-16 CLK
369      7      E05-16 DI/O, PROT DIN
370
371   */
372
373   abc806_eme = BIT(data, 0);
374   abc806_40 = BIT(data, 1);
375   abc806_txoff = BIT(data, 4);
376
377   //e0516_cs_w(BIT(data, 5));
378   //e0516_clk_w(BIT(data, 6));
379   //e0516_dio_w(BIT(data, 7));
380}
381
297382/* Timer Callbacks */
298383
299384static TIMER_CALLBACK( abc802_flash_tick )
r1927r1928
357442         ra_latch = 0x0f;
358443      }
359444
360      data = charrom[(address + ra_latch) & 0x7ff];
445      data = charrom[(address + ra_latch) & 0x1fff];
361446
362447      if (data & ABC802_ATE)
363448      {
r1927r1928
394479         }
395480
396481         // reload data and mask out two bottom bits
397         data = charrom[(address + ra_latch) & 0x7ff] & 0xfc;
482         data = charrom[(address + ra_latch) & 0x1fff] & 0xfc;
398483      }
399484
400485      if (abc802_mux80_40)
r1927r1928
425510   }
426511}
427512
513static MC6845_UPDATE_ROW( abc806_update_row )
514{
515   // DEN+3, CUR+4
516
517   int col;
518
519   for (col = 0; col < x_count; col++)
520   {
521      int bit;
522
523      UINT8 *charrom = memory_region(REGION_GFX1);
524      UINT8 code = videoram[(ma + col) & 0x7ff];
525//      UINT8 attr = abc806_colorram[(ma + col) & 0x7ff];
526      UINT16 address = ((code & 0x80) << 5) | ((code & 0x7f) << 4);
527      UINT8 ra_latch = ra;
528      UINT8 data;
529
530      if (col == cursor_x)
531      {
532         ra_latch = 0x0f;
533      }
534
535      data = charrom[(address + ra_latch) & 0xfff] << 2;
536
537      for (bit = 0; bit < ABC800_CHAR_WIDTH; bit++)
538      {
539         int x = (col * ABC800_CHAR_WIDTH) + bit;
540         int color = BIT(data, 7) ? 1 : 0;
541
542         if (abc806_txoff)
543         {
544            color = 0;
545         }
546
547         *BITMAP_ADDR16(bitmap, y, x) = color;
548
549         data <<= 1;
550      }
551   }
552}
553
554static MC6845_ON_HSYNC_CHANGED(abc806_hsync_changed)
555{
556   if (!hsync)
557   {
558      abc806_v50_addr++;
559   }
560}
561
562static MC6845_ON_VSYNC_CHANGED(abc806_vsync_changed)
563{
564   if (vsync)
565   {
566      abc806_v50_addr = 0;
567   }
568}
569
428570/* MC6845 Interfaces */
429571
430572static const mc6845_interface abc800m_crtc6845_interface = {
r1927r1928
451593   NULL
452594};
453595
596static const mc6845_interface abc806_crtc6845_interface = {
597   0,
598   ABC800_CCLK,
599   ABC800_CHAR_WIDTH,
600   NULL,
601   abc806_update_row,
602   NULL,
603   NULL,
604   abc806_hsync_changed,
605   abc806_vsync_changed
606};
607
454608/* Video Start */
455609
456610static VIDEO_START( abc800 )
r1927r1928
466620   timer_adjust_periodic(abc802_flash_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC802_FLSHCLK));
467621}
468622
623static VIDEO_START(abc806)
624{
625   state_save_register_global(abc806_v50_addr);
626   state_save_register_global(abc806_hrui_addr);
627   state_save_register_global(abc806_colorram_address_latch);
628   state_save_register_global(abc806_txoff);
629   state_save_register_global(abc806_eme);
630   state_save_register_global(abc806_40);
631   state_save_register_global(abc806_flshclk);
632
633   abc806_colorram = auto_malloc(0x800);
634}
635
469636/* Video Update */
470637
471638static VIDEO_UPDATE( abc800 )
r1927r1928
525692MACHINE_DRIVER_END
526693
527694MACHINE_DRIVER_START( abc806_video )
528   MDRV_IMPORT_FROM(abc800m_video)
695   // device interface
696   MDRV_DEVICE_ADD("crtc", MC6845)
697   MDRV_DEVICE_CONFIG(abc806_crtc6845_interface)
698
699   // video hardware
700   MDRV_SCREEN_ADD("main", RASTER)
701   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
702
703   MDRV_SCREEN_REFRESH_RATE(60)
704   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
705   MDRV_SCREEN_SIZE(640, 400)
706   MDRV_SCREEN_VISIBLE_AREA(0,640-1, 0, 400-1)
707
708   MDRV_PALETTE_LENGTH(8)
709
710   MDRV_PALETTE_INIT(abc800c)
711   MDRV_VIDEO_START(abc806)
712   MDRV_VIDEO_UPDATE(abc800)
529713MACHINE_DRIVER_END
src/mess/drivers/abc80x.c
r1927r1928
9595
9696/* Read/Write Handlers */
9797
98// CRTC
99
10098// HR
10199
102100static WRITE8_HANDLER( hrs_w )
r1927r1928
118116{
119117}
120118
121static READ8_HANDLER( attribute_r )
122{
123   return 0;
124}
125
126static WRITE8_HANDLER( attribute_w )
127{
128}
129
130static READ8_HANDLER( sync_r )
131{
132   return 0;
133}
134
135static WRITE8_HANDLER( fgctlprom_w )
136{
137}
138
139119static WRITE8_HANDLER( ram_ctrl_w )
140120{
141121}
r1927r1928
256236   }
257237
258238//  abc77_beep = data & 0x10;
259   z80dart_set_dcd(0, 0, (data & 0x40) ? 0 : 1);
239   z80dart_set_dcd(0, 0, !BIT(data, 6));
240   z80dart_set_dcd(0, 0, BIT(data, 6));
260241//  abc77_hys = data & 0x80;
261242}
262243
r1927r1928
278259
279260static ADDRESS_MAP_START( abc800_io_map, ADDRESS_SPACE_IO, 8 )
280261   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) | AMEF_UNMAP(1) )
281   AM_RANGE(0x00, 0x00) AM_READWRITE(abcbus_data_r, abcbus_data_w)
282   AM_RANGE(0x01, 0x01) AM_READWRITE(abcbus_status_r, abcbus_channel_w)
283   AM_RANGE(0x02, 0x05) AM_WRITE(abcbus_command_w)
284   AM_RANGE(0x06, 0x06) AM_WRITE(hrs_w)
285   AM_RANGE(0x07, 0x07) AM_READWRITE(abcbus_reset_r, hrc_w)
286   AM_RANGE(0x20, 0x23) AM_READWRITE(dart_r, dart_w)
262   AM_RANGE(0x00, 0x00) AM_MIRROR(0x18) AM_READWRITE(abcbus_data_r, abcbus_data_w)
263   AM_RANGE(0x01, 0x01) AM_MIRROR(0x18) AM_READWRITE(abcbus_status_r, abcbus_channel_w)
264   AM_RANGE(0x02, 0x05) AM_MIRROR(0x18) AM_WRITE(abcbus_command_w)
265   AM_RANGE(0x06, 0x06) AM_MIRROR(0x18) AM_WRITE(hrs_w)
266   AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_READWRITE(abcbus_reset_r, hrc_w)
267   AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_READWRITE(dart_r, dart_w)
287268   AM_RANGE(0x30, 0x32) AM_WRITE(ram_ctrl_w)
288   AM_RANGE(0x31, 0x31) AM_DEVREAD(MC6845, "crtc", mc6845_register_r)
289   AM_RANGE(0x38, 0x38) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
290   AM_RANGE(0x39, 0x39) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
291   AM_RANGE(0x40, 0x43) AM_READWRITE(sio2_r, sio2_w)
292   AM_RANGE(0x50, 0x53) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
293   AM_RANGE(0x80, 0xff) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
269   AM_RANGE(0x31, 0x31) AM_MIRROR(0x06) AM_DEVREAD(MC6845, "crtc", mc6845_register_r)
270   AM_RANGE(0x38, 0x38) AM_MIRROR(0x06) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
271   AM_RANGE(0x39, 0x39) AM_MIRROR(0x06) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
272   AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_READWRITE(sio2_r, sio2_w)
273   AM_RANGE(0x50, 0x53) AM_MIRROR(0x1c) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
274   AM_RANGE(0x80, 0x80) AM_MIRROR(0x7f) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
294275ADDRESS_MAP_END
295276
296277// ABC 77 keyboard
r1927r1928
300281ADDRESS_MAP_END
301282
302283static ADDRESS_MAP_START( abc77_io_map, ADDRESS_SPACE_IO, 8 )
303   AM_RANGE(I8039_p1, I8039_p1) AM_READ(abc77_data_r)
304   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(abc77_data_w)
284   AM_RANGE(0x00, 0x3f) AM_RAM
285   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(abc77_data_w)
286   AM_RANGE(I8039_p2, I8039_p2) AM_READ(abc77_data_r)
305287   AM_RANGE(I8039_t1, I8039_t1) AM_READ(abc77_clock_r)
306288   AM_RANGE(I8039_bus, I8039_bus) AM_READ_PORT("DSW")
307289   AM_RANGE(I8039_ea, I8039_ea) AM_READ(abc77_ea_r)
r1927r1928
337319static ADDRESS_MAP_START( abc806_map, ADDRESS_SPACE_PROGRAM, 8 )
338320   ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) )
339321   AM_RANGE(0x0000, 0x77ff) AM_RAMBANK(1)
340   AM_RANGE(0x7800, 0x7fff) AM_RAM AM_BASE(&videoram)
322   AM_RANGE(0x7800, 0x7fff) AM_READWRITE(abc806_videoram_r, abc806_videoram_w) AM_BASE(&videoram)
341323   AM_RANGE(0x8000, 0xffff) AM_RAM
342324ADDRESS_MAP_END
343325
344326static ADDRESS_MAP_START( abc806_io_map, ADDRESS_SPACE_IO, 8 )
345327   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) | AMEF_UNMAP(1) )
346   AM_RANGE(0x00, 0x00) AM_READWRITE(abcbus_data_r, abcbus_data_w)
347   AM_RANGE(0x01, 0x01) AM_READWRITE(abcbus_status_r, abcbus_channel_w)
348   AM_RANGE(0x02, 0x05) AM_WRITE(abcbus_command_w)
349   AM_RANGE(0x06, 0x06) AM_WRITE(hrs_w)
350   AM_RANGE(0x07, 0x07) AM_READWRITE(abcbus_reset_r, hrc_w)
351   AM_RANGE(0x20, 0x23) AM_READWRITE(dart_r, dart_w)
352   AM_RANGE(0x31, 0x31) AM_DEVREAD(MC6845, "crtc", mc6845_register_r)
328//   AM_RANGE(0x00, 0x00) AM_MIRROR(0x1f) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
329   AM_RANGE(0x00, 0x00) AM_MIRROR(0x18) AM_READWRITE(abcbus_data_r, abcbus_data_w)
330   AM_RANGE(0x01, 0x01) AM_MIRROR(0x18) AM_READWRITE(abcbus_status_r, abcbus_channel_w)
331   AM_RANGE(0x02, 0x05) AM_MIRROR(0x18) AM_WRITE(abcbus_command_w)
332   AM_RANGE(0x06, 0x06) AM_MIRROR(0x18) AM_WRITE(hrs_w)
333   AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_READWRITE(abcbus_reset_r, hrc_w)
334   AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_READWRITE(dart_r, dart_w)
335   AM_RANGE(0x31, 0x31) AM_MIRROR(0x06) AM_DEVREAD(MC6845, "crtc", mc6845_register_r)
353336   AM_RANGE(0x34, 0x34) AM_READWRITE(bankswitch_r, bankswitch_w)
354   AM_RANGE(0x35, 0x35) AM_READWRITE(attribute_r, attribute_w)
355   AM_RANGE(0x37, 0x37) AM_READWRITE(sync_r, fgctlprom_w)
356   AM_RANGE(0x38, 0x38) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
357   AM_RANGE(0x39, 0x39) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
358   AM_RANGE(0x40, 0x41) AM_READWRITE(sio2_r, sio2_w)
359   AM_RANGE(0x60, 0x63) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
360   AM_RANGE(0x80, 0xff) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
337   AM_RANGE(0x35, 0x35) AM_READWRITE(abc806_colorram_r, abc806_colorram_w)
338   AM_RANGE(0x37, 0x37) AM_READWRITE(abc806_fgctlprom_r, abc806_sync_w)
339   AM_RANGE(0x38, 0x38) AM_MIRROR(0x06) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
340   AM_RANGE(0x39, 0x39) AM_MIRROR(0x06) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
341   AM_RANGE(0x40, 0x41) AM_MIRROR(0x1c) AM_READWRITE(sio2_r, sio2_w)
342   AM_RANGE(0x60, 0x63) AM_MIRROR(0x1c) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
343   AM_RANGE(0x80, 0x80) AM_MIRROR(0x7f) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
361344ADDRESS_MAP_END
362345
363346/* Input Ports */
r1927r1928
834817   ROM_REGION( 0x2000, REGION_GFX1, 0 )
835818   ROM_LOAD( "abct2-11.3g",  0x0000, 0x2000, CRC(e21601ee) SHA1(2e838ebd7692e5cb9ba4e80fe2aa47ea2584133a) )
836819
837   ROM_REGION( 0x400, REGION_PROMS, 0 )
820   ROM_REGION( 0x400, REGION_PLDS, 0 )
838821   ROM_LOAD( "abcp2-11.2g", 0x0000, 0x0400, NO_DUMP ) // PAL16R4
839822ROM_END
840823
r1927r1928
861844   ROM_REGION( 0x1000, REGION_GFX1, 0 )
862845   ROM_LOAD( "abct6-11.7c",   0x0000, 0x1000, CRC(b17c51c5) SHA1(e466e80ec989fbd522c89a67d274b8f0bed1ff72) ) // 6490243-01
863846
864   ROM_REGION( 0x400, REGION_PROMS, 0 )
865   ROM_LOAD( "rad.9b",       0x0000, 0x0400, NO_DUMP ) // 7621/7643 (82S131/82S137)
847   ROM_REGION( 0x620, REGION_PROMS, 0 )
848   ROM_LOAD( "rad.9b",       0x0000, 0x0200, NO_DUMP ) // 7621/7643 (82S131/82S137)
849   ROM_LOAD( "hrui.6e",    0x0200, 0x0020, NO_DUMP ) // 7603 (82S123)
850   ROM_LOAD( "hruii.12g",    0x0220, 0x0200, NO_DUMP ) // 7621 (82S131)
851   ROM_LOAD( "v50.7e",       0x0420, 0x0200, NO_DUMP ) // 7621 (82S131)
852
853   ROM_REGION( 0x400, REGION_PLDS, 0 )
866854   ROM_LOAD( "atthand.11c", 0x0000, 0x0400, NO_DUMP ) // 40033A (?)
867   ROM_LOAD( "hrui.6e",    0x0000, 0x0400, NO_DUMP ) // 7603 (82S123)
868   ROM_LOAD( "hru11.12g",    0x0000, 0x0400, NO_DUMP ) // 7621 (82S131)
869   ROM_LOAD( "v50.7e",       0x0000, 0x0400, NO_DUMP ) // 7621 (82S131)
870   ROM_LOAD( "abcp3-11.1a", 0x0000, 0x0400, NO_DUMP ) // PAL16R4
855   ROM_LOAD( "abcp3-11.1b", 0x0000, 0x0400, NO_DUMP ) // PAL16R4
871856   ROM_LOAD( "abcp4-11.2d", 0x0000, 0x0400, NO_DUMP ) // PAL16L8
872857ROM_END
873858

Previous 15994 Revisions Next


© 1998-2018 The MESS Team