summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/video
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-09-30 17:21:14 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2015-09-30 17:21:14 +0200
commit1fc48ce120a376c288daeeed98daccecf1b60d7b (patch)
tree72cefcede17f3a27fa8256b43bfac9756db82312 /src/mess/video
parent87a576c55501bd7125b51ca786a010229669df0e (diff)
move mess into mame (nw)
Diffstat (limited to 'src/mess/video')
-rw-r--r--src/mess/video/733_asr.c815
-rw-r--r--src/mess/video/733_asr.h88
-rw-r--r--src/mess/video/911_chr.h3516
-rw-r--r--src/mess/video/911_key.h4028
-rw-r--r--src/mess/video/911_vdt.c844
-rw-r--r--src/mess/video/911_vdt.h118
-rw-r--r--src/mess/video/abc1600.c1259
-rw-r--r--src/mess/video/abc1600.h151
-rw-r--r--src/mess/video/abc80.c205
-rw-r--r--src/mess/video/abc800.c311
-rw-r--r--src/mess/video/abc802.c220
-rw-r--r--src/mess/video/abc806.c507
-rw-r--r--src/mess/video/ac1.c61
-rw-r--r--src/mess/video/advision.c110
-rw-r--r--src/mess/video/alesis.c167
-rw-r--r--src/mess/video/apollo.c1978
-rw-r--r--src/mess/video/apple1.c392
-rw-r--r--src/mess/video/apple2.c1540
-rw-r--r--src/mess/video/apple2.h61
-rw-r--r--src/mess/video/apple2gs.c168
-rw-r--r--src/mess/video/apple3.c518
-rw-r--r--src/mess/video/aquarius.c80
-rw-r--r--src/mess/video/arcadia.c676
-rw-r--r--src/mess/video/atarist.c1131
-rw-r--r--src/mess/video/atarist.h41
-rw-r--r--src/mess/video/aussiebyte.c196
-rw-r--r--src/mess/video/avigo.c118
-rw-r--r--src/mess/video/b2m.c60
-rw-r--r--src/mess/video/bbc.c306
-rw-r--r--src/mess/video/bk.c40
-rw-r--r--src/mess/video/busicom.c1860
-rw-r--r--src/mess/video/cgc7900.c237
-rw-r--r--src/mess/video/channelf.c71
-rw-r--r--src/mess/video/comquest.c24
-rw-r--r--src/mess/video/comx35.c126
-rw-r--r--src/mess/video/crt.c184
-rw-r--r--src/mess/video/crt.h93
-rw-r--r--src/mess/video/dai.c764
-rw-r--r--src/mess/video/dgn_beta.c286
-rw-r--r--src/mess/video/electron.c273
-rw-r--r--src/mess/video/fm7.c1493
-rw-r--r--src/mess/video/fmtowns.c1729
-rw-r--r--src/mess/video/galaxy.c134
-rw-r--r--src/mess/video/galeb.c45
-rw-r--r--src/mess/video/gamecom.c71
-rw-r--r--src/mess/video/gb_lcd.c2852
-rw-r--r--src/mess/video/gb_lcd.h215
-rw-r--r--src/mess/video/gba.c1901
-rw-r--r--src/mess/video/gime.c2077
-rw-r--r--src/mess/video/gime.h311
-rw-r--r--src/mess/video/hec2video.c141
-rw-r--r--src/mess/video/hp48.c203
-rw-r--r--src/mess/video/intv.c137
-rw-r--r--src/mess/video/k1ge.c918
-rw-r--r--src/mess/video/k1ge.h92
-rw-r--r--src/mess/video/kaypro.c312
-rw-r--r--src/mess/video/kc.c240
-rw-r--r--src/mess/video/kramermc.c46
-rw-r--r--src/mess/video/kyocera.c89
-rw-r--r--src/mess/video/llc.c96
-rw-r--r--src/mess/video/lviv.c91
-rw-r--r--src/mess/video/mac.c1257
-rw-r--r--src/mess/video/maria.c484
-rw-r--r--src/mess/video/maria.h72
-rw-r--r--src/mess/video/mbc55x.c186
-rw-r--r--src/mess/video/mbee.c495
-rw-r--r--src/mess/video/mc80.c173
-rw-r--r--src/mess/video/microtan.c57
-rw-r--r--src/mess/video/mikro80.c40
-rw-r--r--src/mess/video/mikromik.c126
-rw-r--r--src/mess/video/mz700.c128
-rw-r--r--src/mess/video/mz80.c143
-rw-r--r--src/mess/video/nc.c120
-rw-r--r--src/mess/video/nes.c62
-rw-r--r--src/mess/video/newbrain.c130
-rw-r--r--src/mess/video/newport.c1667
-rw-r--r--src/mess/video/newport.h163
-rw-r--r--src/mess/video/nick.c1055
-rw-r--r--src/mess/video/nick.h178
-rw-r--r--src/mess/video/ondra.c47
-rw-r--r--src/mess/video/orao.c38
-rw-r--r--src/mess/video/orion.c114
-rw-r--r--src/mess/video/osi.c180
-rw-r--r--src/mess/video/p2000m.c60
-rw-r--r--src/mess/video/pc1251.c163
-rw-r--r--src/mess/video/pc1350.c165
-rw-r--r--src/mess/video/pc1401.c213
-rw-r--r--src/mess/video/pc1403.c246
-rw-r--r--src/mess/video/pc1512.c606
-rw-r--r--src/mess/video/pc4.c196
-rw-r--r--src/mess/video/pc8401a.c102
-rw-r--r--src/mess/video/pc_t1t.c1033
-rw-r--r--src/mess/video/pc_t1t.h147
-rw-r--r--src/mess/video/pcd.c396
-rw-r--r--src/mess/video/pcd.h98
-rw-r--r--src/mess/video/pcw.c187
-rw-r--r--src/mess/video/pcw16.c268
-rw-r--r--src/mess/video/pdp1.c591
-rw-r--r--src/mess/video/pecom.c109
-rw-r--r--src/mess/video/pk8020.c59
-rw-r--r--src/mess/video/pocketc.c70
-rw-r--r--src/mess/video/poisk1.c322
-rw-r--r--src/mess/video/poisk1.h10
-rw-r--r--src/mess/video/poly88.c102
-rw-r--r--src/mess/video/pp01.c56
-rw-r--r--src/mess/video/primo.c47
-rw-r--r--src/mess/video/rm380z.c406
-rw-r--r--src/mess/video/rmnimbus.c514
-rw-r--r--src/mess/video/samcoupe.c171
-rw-r--r--src/mess/video/special.c153
-rw-r--r--src/mess/video/spectrum.c298
-rw-r--r--src/mess/video/ssystem3.c236
-rw-r--r--src/mess/video/stic.c974
-rw-r--r--src/mess/video/stic.h559
-rw-r--r--src/mess/video/super80.c426
-rw-r--r--src/mess/video/thomson.c1387
-rw-r--r--src/mess/video/ti85.c194
-rw-r--r--src/mess/video/timex.c270
-rw-r--r--src/mess/video/tmc1800.c70
-rw-r--r--src/mess/video/tmc600.c141
-rw-r--r--src/mess/video/trs80.c588
-rw-r--r--src/mess/video/tx0.c469
-rw-r--r--src/mess/video/ut88.c44
-rw-r--r--src/mess/video/uv201.c589
-rw-r--r--src/mess/video/uv201.h159
-rw-r--r--src/mess/video/v1050.c124
-rw-r--r--src/mess/video/vc4000.c650
-rw-r--r--src/mess/video/vector06.c61
-rw-r--r--src/mess/video/vtech2.c312
-rw-r--r--src/mess/video/vtvideo.c956
-rw-r--r--src/mess/video/vtvideo.h113
-rw-r--r--src/mess/video/wswan_video.c1216
-rw-r--r--src/mess/video/wswan_video.h149
-rw-r--r--src/mess/video/x68k.c1267
-rw-r--r--src/mess/video/z88.c175
-rw-r--r--src/mess/video/zx.c223
-rw-r--r--src/mess/video/zx8301.c334
-rw-r--r--src/mess/video/zx8301.h123
138 files changed, 0 insertions, 62328 deletions
diff --git a/src/mess/video/733_asr.c b/src/mess/video/733_asr.c
deleted file mode 100644
index da1286d69f5..00000000000
--- a/src/mess/video/733_asr.c
+++ /dev/null
@@ -1,815 +0,0 @@
-// license:GPL-2.0+
-// copyright-holders:Raphael Nabet
-/*
- 733 ASR emulation
-
- We are emulating a TI Model 733 ASR ("Silent 700") data terminal,
- interfaced through a TI asynchronous EIA/TTY interface module.
-
- The ASR features a printer, a keyboard and a tape unit (which is not
- emulated). The ASR is attached to the computer with a serial interface.
-
- References:
- 945401-9701 Model 990/4 Computer System Field Maintenance Manual p. C-1,
- 945250-9701 990 Computer Family Systems Handbook pp. 5-9 through 5-16,
- 0943442-9701 Model 990 Computer Reference Manual Preliminary pp. 3-13
- through 3-21 and 3-39 through 3-44.
-
- TODO:
- * separate ASR emulation from EIA interface emulation?
- * implement tape interface?
-
- Raphael Nabet 2003
-
- Rewritten as class
- Michael Zapf, 2014
-*/
-
-#include "emu.h"
-#include "733_asr.h"
-
-enum
-{
- /*ASROutQueueSize = 32,*/
-
- asr_window_offset_x = 0,
- asr_window_offset_y = 0,
- asr_window_width = 640,
- asr_window_height = 480,
- asr_scroll_step = 8
-};
-
-enum
-{
- AS_wrq_mask = 1 << 3,
- AS_rrq_mask = 1 << 4,
- AS_dsr_mask = 1 << 6,
- AS_int_mask = 1 << 7,
-
- AM_dtr_mask = 1 << 1,
- AM_rts_mask = 1 << 2,
- AM_enint_mask = 1 << 6
-};
-
-enum
-{
- asrfontdata_size = 96/*128*/*8
-};
-
-static const gfx_layout fontlayout =
-{
- 6, 8, /* 6*8 characters */
- /*96*/128, /* 96 characters */
- 1, /* 1 bit per pixel */
- { 0 },
- { 0, 1, 2, 3, 4, 5, 6, 7 }, /* straightforward layout */
- { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
- 8*8 /* every char takes 8 consecutive bytes */
-};
-
-static GFXDECODE_START( asr733 )
- GFXDECODE_ENTRY( asr733_chr_region, 0, fontlayout, 0, 1 )
-GFXDECODE_END
-
-PALETTE_INIT_MEMBER(asr733_device, asr733)
-{
- palette.set_pen_color(0,rgb_t::white); /* white */
- palette.set_pen_color(1,rgb_t::black); /* black */
-}
-
-
-const device_type ASR733 = &device_creator<asr733_device>;
-
-asr733_device::asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, ASR733, "733 ASR", tag, owner, clock, "asr733", __FILE__),
- m_palette(*this, "palette"),
- m_gfxdecode(*this, "gfxdecode"),
- m_keyint_line(*this),
- m_lineint_line(*this)
-{
-}
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void asr733_device::device_config_complete()
-{
-}
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void asr733_device::device_start()
-{
- screen_device *screen = machine().first_screen();
- int width = screen->width();
- int height = screen->height();
- const rectangle &visarea = screen->visible_area();
-
- m_last_key_pressed = 0x80;
- m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
-
- m_bitmap->fill(0, visarea);
-
- m_keyint_line.resolve();
- m_lineint_line.resolve();
-
- m_line_timer = timer_alloc(0);
-
- UINT8 *dst;
-
- static const unsigned char fontdata6x8[asrfontdata_size] =
- { /* ASCII characters */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,
- 0x50,0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0xf8,0x50,0xf8,0x50,0x00,0x00,
- 0x20,0x70,0xc0,0x70,0x18,0xf0,0x20,0x00,0x40,0xa4,0x48,0x10,0x20,0x48,0x94,0x08,
- 0x60,0x90,0xa0,0x40,0xa8,0x90,0x68,0x00,0x10,0x20,0x40,0x00,0x00,0x00,0x00,0x00,
- 0x20,0x40,0x40,0x40,0x40,0x40,0x20,0x00,0x10,0x08,0x08,0x08,0x08,0x08,0x10,0x00,
- 0x20,0xa8,0x70,0xf8,0x70,0xa8,0x20,0x00,0x00,0x20,0x20,0xf8,0x20,0x20,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x60,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,
- 0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x10,0x30,0x10,0x10,0x10,0x10,0x10,0x00,
- 0x70,0x88,0x08,0x10,0x20,0x40,0xf8,0x00,0x70,0x88,0x08,0x30,0x08,0x88,0x70,0x00,
- 0x10,0x30,0x50,0x90,0xf8,0x10,0x10,0x00,0xf8,0x80,0xf0,0x08,0x08,0x88,0x70,0x00,
- 0x70,0x80,0xf0,0x88,0x88,0x88,0x70,0x00,0xf8,0x08,0x08,0x10,0x20,0x20,0x20,0x00,
- 0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x88,0x78,0x08,0x70,0x00,
- 0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x00,0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,
- 0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x00,0x00,0x00,0xf8,0x00,0xf8,0x00,0x00,0x00,
- 0x40,0x20,0x10,0x08,0x10,0x20,0x40,0x00,0x70,0x88,0x08,0x10,0x20,0x00,0x20,0x00,
- 0x70,0x88,0xb8,0xa8,0xb8,0x80,0x70,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x00,
- 0xf0,0x88,0x88,0xf0,0x88,0x88,0xf0,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x00,
- 0xf0,0x88,0x88,0x88,0x88,0x88,0xf0,0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x00,
- 0xf8,0x80,0x80,0xf0,0x80,0x80,0x80,0x00,0x70,0x88,0x80,0x98,0x88,0x88,0x70,0x00,
- 0x88,0x88,0x88,0xf8,0x88,0x88,0x88,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,
- 0x08,0x08,0x08,0x08,0x88,0x88,0x70,0x00,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x00,
- 0x80,0x80,0x80,0x80,0x80,0x80,0xf8,0x00,0x88,0xd8,0xa8,0x88,0x88,0x88,0x88,0x00,
- 0x88,0xc8,0xa8,0x98,0x88,0x88,0x88,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00,
- 0xf0,0x88,0x88,0xf0,0x80,0x80,0x80,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x08,
- 0xf0,0x88,0x88,0xf0,0x88,0x88,0x88,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x00,
- 0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,
- 0x88,0x88,0x88,0x88,0x88,0x50,0x20,0x00,0x88,0x88,0x88,0x88,0xa8,0xd8,0x88,0x00,
- 0x88,0x50,0x20,0x20,0x20,0x50,0x88,0x00,0x88,0x88,0x88,0x50,0x20,0x20,0x20,0x00,
- 0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x00,0x30,0x20,0x20,0x20,0x20,0x20,0x30,0x00,
- 0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x30,0x10,0x10,0x10,0x10,0x10,0x30,0x00,
- 0x20,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
- 0x40,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x00,
- 0x80,0x80,0xf0,0x88,0x88,0x88,0xf0,0x00,0x00,0x00,0x70,0x88,0x80,0x80,0x78,0x00,
- 0x08,0x08,0x78,0x88,0x88,0x88,0x78,0x00,0x00,0x00,0x70,0x88,0xf8,0x80,0x78,0x00,
- 0x18,0x20,0x70,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x78,0x88,0x88,0x78,0x08,0x70,
- 0x80,0x80,0xf0,0x88,0x88,0x88,0x88,0x00,0x20,0x00,0x20,0x20,0x20,0x20,0x20,0x00,
- 0x20,0x00,0x20,0x20,0x20,0x20,0x20,0xc0,0x80,0x80,0x90,0xa0,0xe0,0x90,0x88,0x00,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0xf0,0xa8,0xa8,0xa8,0xa8,0x00,
- 0x00,0x00,0xb0,0xc8,0x88,0x88,0x88,0x00,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x00,
- 0x00,0x00,0xf0,0x88,0x88,0xf0,0x80,0x80,0x00,0x00,0x78,0x88,0x88,0x78,0x08,0x08,
- 0x00,0x00,0xb0,0xc8,0x80,0x80,0x80,0x00,0x00,0x00,0x78,0x80,0x70,0x08,0xf0,0x00,
- 0x20,0x20,0x70,0x20,0x20,0x20,0x18,0x00,0x00,0x00,0x88,0x88,0x88,0x98,0x68,0x00,
- 0x00,0x00,0x88,0x88,0x88,0x50,0x20,0x00,0x00,0x00,0xa8,0xa8,0xa8,0xa8,0x50,0x00,
- 0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x00,0x00,0x00,0x88,0x88,0x88,0x78,0x08,0x70,
- 0x00,0x00,0xf8,0x10,0x20,0x40,0xf8,0x00,0x08,0x10,0x10,0x20,0x10,0x10,0x08,0x00,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x20,0x20,0x10,0x20,0x20,0x40,0x00,
- 0x00,0x68,0xb0,0x00,0x00,0x00,0x00,0x00,0x20,0x50,0x20,0x50,0xa8,0x50,0x00,0x00
- };
-
- dst = machine().root_device().memregion(asr733_chr_region)->base();
-
- memcpy(dst, fontdata6x8, asrfontdata_size);
-}
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void asr733_device::device_reset()
-{
- /*m_OutQueueLen = 0;*/
-
- m_status = AS_dsr_mask | AS_wrq_mask;
- m_mode = 0;
- m_line_timer->adjust(attotime::from_msec(0), 0, attotime::from_hz(60));
-
- set_interrupt_line();
-}
-
-void asr733_device::set_interrupt_line()
-{
- if ((m_mode & AM_enint_mask) && (m_new_status_flag)) /* right??? */
- {
- m_status |= AS_int_mask;
- m_keyint_line(ASSERT_LINE);
- }
- else
- {
- m_status &= ~AS_int_mask;
- m_keyint_line(CLEAR_LINE);
- }
-}
-
-/* write a single char on screen */
-void asr733_device::draw_char(int character, int x, int y, int color)
-{
- m_gfxdecode->gfx(0)->opaque(*m_bitmap, m_bitmap->cliprect(), character-32, color, 0, 0, x+1, y);
-}
-
-void asr733_device::linefeed()
-{
- UINT8 buf[asr_window_width];
-
- for (int y=asr_window_offset_y; y<asr_window_offset_y+asr_window_height-asr_scroll_step; y++)
- {
- extract_scanline8(*m_bitmap, asr_window_offset_x, y+asr_scroll_step, asr_window_width, buf);
- draw_scanline8(*m_bitmap, asr_window_offset_x, y, asr_window_width, buf, m_palette->pens());
- }
-
- const rectangle asr_scroll_clear_window(
- asr_window_offset_x, /* min_x */
- asr_window_offset_x+asr_window_width-1, /* max_x */
- asr_window_offset_y+asr_window_height-asr_scroll_step, /* min_y */
- asr_window_offset_y+asr_window_height-1 /* max_y */
- );
- m_bitmap->fill(0, asr_scroll_clear_window);
-}
-
-void asr733_device::transmit(UINT8 data)
-{
- switch (data)
- {
- /* aux device control chars */
- case 0x05:
- /* ENQ -> "WRU": ??? */
- break;
-
- case 0x11:
- /* DC1 -> "X-ON": transmit on??? */
- break;
-
- case 0x12:
- /* DC2 -> "X-OFF": transmit off??? */
- break;
-
- case 0x13:
- /* DC3 -> "TAPE": tape on??? */
- break;
-
- case 0x14:
- /* DC4 -> "-T-A-P-E-" ("TAPE" with overstrike): tape off??? */
- break;
-
-
- /* printer control chars */
- case 0x07:
- /* BELL: 250ms beep */
- break;
-
- case 0x08:
- /* BS: backspace */
- if (m_x > 0)
- m_x--;
- break;
-
- case 0x0A:
- /* LF: line feed */
- linefeed();
- break;
-
- case 0x0D:
- /* CR: carriage return */
- m_x = 0;
- break;
-
-
- default:
- if ((data < 0x20) || (data == 0x7f) || (data >= 0x80))
- /* ignore control characters */
- break;
-
- if (m_x == 80)
- {
- m_x = 0;
- linefeed();
- }
- draw_char(data, asr_window_offset_x + m_x*8, asr_window_offset_y+asr_window_height-8, 0);
- m_x++;
- break;
- }
-
- m_status |= AS_wrq_mask;
- m_new_status_flag = 1; /* right??? */
- set_interrupt_line();
-}
-
-#if 0
-void asr733_device::receive_callback(int dummy)
-{
- (void) dummy;
-
- m_recv_buf = m_OutQueue[m_OutQueueHead];
- m_OutQueueHead = (m_OutQueueHead + 1) % ASROutQueueSize;
- m_OutQueueLen--;
-
- m_status |= AS_rrq_mask;
- m_new_status_flag = 1; /* right??? */
- set_interrupt_line();
-}
-#endif
-
-/*
- 0-7: receive buffer
- 8: XMITING transmit in progress, 1 if transmitting
- 9: TIMERR timing error, 1 if error
- 10: RCR reverse channel receive, not used
- "ASR733/33 ID" 1 -> TTY (???) (2270509-9701 pp. G-9 & G-10)
- 11: WRQ write request, 1 if ready to transmit
- 12: RRQ read request, 1 if ready to receive
- 13: DCD data carrier detect, not used
- 14: DSR data set ready, 1 if online
- 15: INT interrupt, 1 if interrupt
-*/
-READ8_MEMBER( asr733_device::cru_r )
-{
- int reply = 0;
-
- switch (offset)
- {
- case 0:
- /* receive buffer */
- reply = m_recv_buf;
- break;
-
- case 1:
- /* status register */
- reply = m_status;
- break;
- }
-
- return reply;
-}
-
-/*
- 0-7: transmit buffer
- 8: not used
- 9: DTR data terminal ready (set to 1)
- 10: RTS request to send (set to 1)
- 11: CLRWRQ clear write request (write any value to execute)
- 12: CLRRRQ clear read request (write any value to execute)
- 13: CLRNSF clear new status flag - clear DSR/DCD interrupts (write any value to execute)
- 14: enable interrupts, 1 to enable interrupts
- 15: diagnostic mode, 0 for normal mode
-*/
-WRITE8_MEMBER( asr733_device::cru_w )
-{
- switch (offset)
- {
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- /* transmit buffer */
- if (data)
- m_xmit_buf |= 1 << offset;
- else
- m_xmit_buf &= ~ (1 << offset);
- if ((offset == 7) && (m_mode & AM_dtr_mask) && (m_mode & AM_rts_mask)) /* right??? */
- transmit(m_xmit_buf);
- break;
-
- case 8: /* not used */
- break;
-
- case 9: /* data terminal ready (set to 1) */
- case 10: /* request to send (set to 1) */
- case 14: /* enable interrupts, 1 to enable interrupts */
- case 15: /* diagnostic mode, 0 for normal mode */
- if (data)
- m_mode |= 1 << (offset - 8);
- else
- m_mode &= ~ (1 << (offset - 8));
- if (offset == 14)
- set_interrupt_line();
- break;
-
- case 11: /* clear write request (write any value to execute) */
- case 12: /* clear read request (write any value to execute) */
- m_status &= ~ (1 << (offset - 8));
- set_interrupt_line();
- break;
-
- case 13: /* clear new status flag - whatever it means (write any value to execute) */
- m_new_status_flag = 0;
- set_interrupt_line();
- break;
- }
-}
-
-/*
- Video refresh
-*/
-void asr733_device::refresh(bitmap_ind16 &bitmap, int x, int y)
-{
- copybitmap(bitmap, *m_bitmap, 0, 0, x, y, m_bitmap->cliprect());
-}
-
-
-/*
- Time callbacks
-*/
-void asr733_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- check_keyboard();
- m_lineint_line(ASSERT_LINE);
- m_lineint_line(CLEAR_LINE);
-}
-
-static const unsigned char key_translate[3][51] =
-{
- { /* unshifted */
- '1',
- '2',
- '3',
- '4',
- '5',
- '6',
- '7',
- '8',
- '9',
- '0',
- ':',
- '-',
-
- 0x1b,
- 'Q',
- 'W',
- 'E',
- 'R',
- 'T',
- 'Y',
- 'U',
- 'I',
- 'O',
- 'P',
- 0x0a,
- 0x0d,
-
- 0,
- 'A',
- 'S',
- 'D',
- 'F',
- 'G',
- 'H',
- 'J',
- 'K',
- 'L',
- ';',
- 0x08,
- 0,
-
- 0,
- 'Z',
- 'X',
- 'C',
- 'V',
- 'B',
- 'N',
- 'M',
- ',',
- '.',
- '/',
- 0,
-
- ' '
- },
- { /* shifted */
- '!',
- '"',
- '#',
- '$',
- '%',
- '&',
- '^',
- '(',
- ')',
- ' ',
- '*',
- '=',
-
- 0x1b,
- 'Q',
- 'W',
- 'E',
- 'R',
- 'T',
- 'Y',
- 'U',
- 'I',
- '_',
- '@',
- 0x0a,
- 0x0d,
-
- 0,
- 'A',
- 'S',
- 'D',
- 'F',
- 'G',
- 'H',
- 'J',
- 0,
- '/',
- '+',
- 0x08,
- 0,
-
- 0,
- 'Z',
- 'X',
- 'C',
- 'V',
- 'B',
- '^',
- '|',
- '<',
- '>',
- '?',
- 0,
-
- ' '
- },
- { /* control */
- '1',
- '2',
- '3',
- '4',
- '5',
- '6',
- '7',
- '8',
- '9',
- '0',
- ':',
- '-',
-
- 0x1b,
- 0x11,
- 0x17,
- 0x05,
- 0x12,
- 0x14,
- 0x19,
- 0x15,
- 0x09,
- 0x0f,
- 0x10,
- 0x0a,
- 0x0d,
-
- 0,
- 0x01,
- 0x13,
- 0x04,
- 0x06,
- 0x07,
- 0x08,
- 0x0a,
- 0x0b,
- 0x0c,
- ';',
- 0x08,
- 0,
-
- 0,
- 0x1a,
- 0x18,
- 0x03,
- 0x16,
- 0x02,
- 0x0e,
- 0x0d,
- ',',
- '.',
- '/',
- 0,
-
- ' '
- }
-};
-
-
-/*
- keyboard handler: should be called regularly by machine code, for instance
- every Video Blank Interrupt.
-*/
-void asr733_device::check_keyboard()
-{
- enum modifier_state_t
- {
- /* key modifier states */
- unshifted = 0, shift, control,
- /* special value to stop repeat if the modifier state changes */
- special_debounce = -1
- } ;
-
- enum { repeat_delay = 5 /* approx. 1/10s */ };
-
- //UINT16 key_buf[6];
- UINT16 key_buf[4];
- int i, j;
- modifier_state_t modifier_state;
- int repeat_mode;
-
- static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
-
- /* read current key state */
- /* 2008-05 FP: in 733_asr.h there are only 4 input ports defined... */
- /* for (i = 0; i < 6; i++) */
- for (i = 0; i < 4; i++)
- {
- key_buf[i] = ioport(keynames[i])->read();
- }
-
- /* process key modifiers */
- if (key_buf[1] & 0x0200)
- modifier_state = control;
- else if ((key_buf[2] & 0x0040) || (key_buf[3] & 0x0002))
- modifier_state = shift;
- else
- modifier_state = unshifted;
-
- /* test repeat key */
- repeat_mode = key_buf[2] & 0x0020;
-
- /* remove modifier keys */
- key_buf[1] &= ~0x0200;
- key_buf[2] &= ~0x0060;
- key_buf[3] &= ~0x0002;
-
- if (! repeat_mode)
- /* reset REPEAT timer if the REPEAT key is not pressed */
- m_repeat_timer = 0;
-
- if ( !(m_last_key_pressed & 0x80) && (key_buf[m_last_key_pressed >> 4] & (1 << (m_last_key_pressed & 0xf))))
- {
- /* last key has not been released */
- if (modifier_state == m_last_modifier_state)
- {
- /* handle REPEAT mode if applicable */
- if ((repeat_mode) && (++m_repeat_timer == repeat_delay))
- {
- if (m_status & AS_rrq_mask)
- { /* keyboard buffer full */
- m_repeat_timer--;
- }
- else
- { /* repeat current key */
- m_status |= AS_rrq_mask;
- m_new_status_flag = 1; /* right??? */
- set_interrupt_line();
- m_repeat_timer = 0;
- }
- }
- }
- else
- {
- m_repeat_timer = 0;
- m_last_modifier_state = special_debounce;
- }
- }
- else
- {
- m_last_key_pressed = 0x80;
-
- if (m_status & AS_rrq_mask)
- { /* keyboard buffer full */
- /* do nothing */
- }
- else
- {
- //for (i=0; i<6; i++)
- for (i=0; i<4; i++)
- {
- for (j=0; j<16; j++)
- {
- if (key_buf[i] & (1 << j))
- {
- m_last_key_pressed = (i << 4) | j;
- m_last_modifier_state = modifier_state;
-
- m_recv_buf = (int)key_translate[modifier_state][m_last_key_pressed];
- m_status |= AS_rrq_mask;
- m_new_status_flag = 1; /* right??? */
- set_interrupt_line();
- return;
- }
- }
- }
- }
- }
-}
-
-UINT32 asr733_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- refresh(bitmap, 0, 0);
- return 0;
-}
-
-static MACHINE_CONFIG_FRAGMENT( asr733 )
- MCFG_GFXDECODE_ADD("gfxdecode", "palette", asr733)
-
- MCFG_PALETTE_ADD("palette", 2)
- MCFG_PALETTE_INIT_OWNER(asr733_device, asr733)
-
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, asr733_device, screen_update)
-
- MCFG_SCREEN_SIZE(640, 480)
- MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
- MCFG_SCREEN_PALETTE("palette")
-MACHINE_CONFIG_END
-
-INPUT_PORTS_START( asr733 )
- PORT_START("KEY0") /* keys 1-16 */ \
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) \
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) \
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) \
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) \
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) \
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) \
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) \
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) \
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) \
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) \
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(":") PORT_CODE(KEYCODE_MINUS) \
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_EQUALS) \
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) \
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) \
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) \
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) \
- \
- PORT_START("KEY1") /* keys 17-32 */ \
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) \
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) \
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) \
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) \
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) \
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) \
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) \
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LINE FEED") PORT_CODE(KEYCODE_CLOSEBRACE) \
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) \
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) \
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) \
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) \
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) \
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) \
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) \
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) \
- \
- PORT_START("KEY2") /* keys 33-48 */ \
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) \
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) \
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) \
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(";") PORT_CODE(KEYCODE_COLON) \
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RUB OUT") PORT_CODE(KEYCODE_BACKSPACE) \
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("REPEAT") PORT_CODE(KEYCODE_RALT) \
- /* hack for my mac that does not disciminate the right ALT key */ \
- /* PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("REPEAT") PORT_CODE(KEYCODE_LALT) */ \
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) \
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) \
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) \
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) \
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) \
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) \
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) \
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) \
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA) \
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP) \
- \
- PORT_START("KEY3") /* keys 49-51 */ \
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH) \
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_RSHIFT) \
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(SPACE)") PORT_CODE(KEYCODE_SPACE)
-INPUT_PORTS_END
-
-ioport_constructor asr733_device::device_input_ports() const
-{
- return INPUT_PORTS_NAME( asr733 );
-}
-
-//-------------------------------------------------
-// machine_config_additions - return a pointer to
-// the device's machine fragment
-//-------------------------------------------------
-
-machine_config_constructor asr733_device::device_mconfig_additions() const
-{
- return MACHINE_CONFIG_NAME( asr733 );
-}
diff --git a/src/mess/video/733_asr.h b/src/mess/video/733_asr.h
deleted file mode 100644
index 6182a21eb52..00000000000
--- a/src/mess/video/733_asr.h
+++ /dev/null
@@ -1,88 +0,0 @@
-// license:GPL-2.0+
-// copyright-holders:Raphael Nabet
-
-#define asr733_chr_region ":gfx1"
-
-enum
-{
- /* 8 bytes per character definition */
- asr733_single_char_len = 8,
- asr733_chr_region_len = 128*asr733_single_char_len
-};
-
-class asr733_device : public device_t
-{
-public:
- asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
- DECLARE_PALETTE_INIT(asr733);
-
- DECLARE_READ8_MEMBER(cru_r);
- DECLARE_WRITE8_MEMBER(cru_w);
-
- template<class _Object> static devcb_base &static_set_keyint_callback(device_t &device, _Object object)
- {
- return downcast<asr733_device &>(device).m_keyint_line.set_callback(object);
- }
- template<class _Object> static devcb_base &static_set_lineint_callback(device_t &device, _Object object)
- {
- return downcast<asr733_device &>(device).m_lineint_line.set_callback(object);
- }
-
- UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
-
-protected:
- // device-level overrides
- void device_config_complete();
- void device_start();
- void device_reset();
- machine_config_constructor device_mconfig_additions() const;
- void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
- ioport_constructor device_input_ports() const;
-
-private:
- // internal state
-#if 0
- UINT8 m_OutQueue[ASROutQueueSize];
- int m_OutQueueHead;
- int m_OutQueueLen;
-#endif
-
- void check_keyboard();
- void refresh(bitmap_ind16 &bitmap, int x, int y);
-
- void set_interrupt_line();
- void draw_char(int character, int x, int y, int color);
- void linefeed();
- void transmit(UINT8 data);
-
- emu_timer *m_line_timer; // screen line timer
-
- UINT8 m_recv_buf;
- UINT8 m_xmit_buf;
-
- UINT8 m_status;
- UINT8 m_mode;
- UINT8 m_last_key_pressed;
- int m_last_modifier_state;
-
- unsigned char m_repeat_timer;
- int m_new_status_flag;
-
- int m_x;
-
- bitmap_ind16* m_bitmap;
-
- required_device<palette_device> m_palette;
- required_device<gfxdecode_device> m_gfxdecode;
- devcb_write_line m_keyint_line;
- devcb_write_line m_lineint_line;
-};
-
-extern const device_type ASR733;
-
-#define MCFG_ASR733_KEYINT_HANDLER( _intcallb ) \
- devcb = &asr733_device::static_set_keyint_callback( *device, DEVCB_##_intcallb );
-
-#define MCFG_ASR733_LINEINT_HANDLER( _intcallb ) \
- devcb = &asr733_device::static_set_lineint_callback( *device, DEVCB_##_intcallb );
diff --git a/src/mess/video/911_chr.h b/src/mess/video/911_chr.h
deleted file mode 100644
index 6d24b5d0415..00000000000
--- a/src/mess/video/911_chr.h
+++ /dev/null
@@ -1,3516 +0,0 @@
-// license:GPL-2.0+
-// copyright-holders:Raphael Nabet
-/*
- 911_chr.h: character definitions for 911_vdt.c
-
- We define the character matrix for each character.
-
- The US terminal uses the standard 7-bit ASCII character set, with
- additional graphic characters in the 32 first positions.
-
- The various European terminals use variants of the 7-bit ASCII character
- set with national characters instead of various punctuation characters.
- I think these national character sets were standardized at a point, but
- I don't know how close to this standard the character sets used by the
- 911 VDT are.
-
- The Japanese terminal uses 8-bit character codes. The 128 first characters
- are identical to the US character set (except that '\' is replaced by the
- Yen symbol), and the next 128 characters include the katakana syllabus.
- Kanji ideograms are not supported in this scheme.
-
- The Arabic terminal uses 8-bit character codes, too. It requires
- additional code in the TI990 OS for correct operation, as the keyboard
- returns codes for isolated characters (i.e. without ligatures), which need
- to be substituted with codes with correct context-dependent ligatures.
- And both OS and application programs need to support the fact that the
- writing direction can be either right-to-left or left-to-right, according
- to whether the characters are Latin or Arabic.
-
- As the original ROMs have not been dumped yet, I recreated the matrices
- from various matrix printouts in TI documentation.
-*/
-/*
- The Arabic character set is not implemented, because documentation is ambiguous
- (it says there are 115 characters, but I can hardly see 80 characters in the
- attached table), and the character matrices are not documented.
-*/
-
-
-/*
- Offsets in the char_defs array
-*/
-enum
-{
- /* US ASCII: 128 characters (32 symbols + 95 ASCII + 1 blank (delete character)) */
- char_defs_US_base = 0,
- /* additionnal katakana set (128 characters, including JIS set) */
- char_defs_katakana_base = char_defs_US_base+128,
- /* extra symbols for national character sets */
- char_defs_pound = char_defs_katakana_base+128, /* pound sign (UK 0x23, French WP 0x23) */
- char_defs_yen, /* yen sign (Japan 0x5C) */
- char_defs_auml, /* Latin small letter a with diaeresis (Swedish/Finish 0x7B, German 0x7B) */
- char_defs_Auml, /* Latin capital letter A with diaeresis (Swedish/Finish 0x5B, German 0x5B) */
- char_defs_Aring, /* Latin capital letter A with ring above (Swedish/Finish 0x5D, Norwegian/Danish 0x5D) */
- char_defs_uuml, /* Latin small letter u with diaeresis (Swedish/Finish 0x7E, German 0x7D) */
- char_defs_aring, /* Latin small letter a with ring above (Swedish/Finish 0x7D, Norwegian/Danish 0x7D) */
- char_defs_Uuml, /* Latin capital letter U with diaeresis (German 0x5D) */
- char_defs_ouml, /* Latin small letter o with diaeresis (German 0x7C) */
- char_defs_Ouml, /* Latin capital letter O with diaeresis (German 0x5C) */
- char_defs_szlig, /* Latin small letter sharp s (German 0x7E) */
- char_defs_aelig, /* Latin small letter ae (Norwegian/Danish 0x7B) */
- char_defs_AElig, /* Latin capital letter AE (Norwegian/Danish 0x5B) */
- char_defs_oslash, /* Latin small letter o with stroke (Norwegian/Danish 0x7C) */
- char_defs_Oslash, /* Latin capital letter O with stroke (Norwegian/Danish 0x5C) */
- char_defs_agrave, /* Latin small letter a with grave (French WP 0x40) */
- char_defs_deg, /* degree sign (French WP 0x5B) */
- char_defs_ccedil, /* Latin small letter c with cedilla (French WP 0x5C) */
- char_defs_sect, /* section sign (French WP 0x5D) */
- char_defs_egrave, /* Latin small letter e with grave (French WP 0x7B) */
- char_defs_ugrave, /* Latin small letter u with grave (French WP 0x7C) */
- char_defs_eacute, /* Latin small letter e with acute (French WP 0x7D) */
- char_defs_uml, /* diaeresis (French WP 0x7E) */
-
- char_defs_count /* total character count */
-};
-
-/* structure used to describe differences between national character sets and
-US character set */
-/* much more compact than defining the complete 128-char vector */
-struct char_override_t
-{
- unsigned char char_index; /* char to replace */
- unsigned short symbol_index; /* replacement symbol */
-};
-
-/* One UK-specific character */
-static const char_override_t UK_overrides[1] =
-{
- { 0x23, char_defs_pound }
-};
-
-/* One Japan-specific character (see below for the 128 additionnal characters) */
-static const char_override_t japanese_overrides[1] =
-{
- { 0x5C, char_defs_yen }
-};
-
-/* 5 Sweden/Finland-specific characters */
-static const char_override_t swedish_overrides[/*5*/7] =
-{
- { 0x7B, char_defs_auml },
- { 0x5B, char_defs_Auml },
- { 0x5D, char_defs_Aring },
- { 0x7E, char_defs_uuml },
- { 0x7D, char_defs_aring },
- /* next characters described in D-4 but not 1-10 */
- { 0x5C, char_defs_Ouml },
- { 0x7C, char_defs_ouml }
-};
-
-/* 7 German-specific characters */
-static const char_override_t german_overrides[7] =
-{
- { 0x5D, char_defs_Uuml },
- { 0x7D, char_defs_uuml },
- { 0x7C, char_defs_ouml },
- { 0x5C, char_defs_Ouml },
- { 0x7B, char_defs_auml },
- { 0x7E, char_defs_szlig },
- { 0x5B, char_defs_Auml } /* 945423-9701 rev. B p. 1-10 says 0x5D, but it must be a mistake */
-};
-
-/* 6 Norway/Denmark-specific characters */
-static const char_override_t norwegian_overrides[6] =
-{
- { 0x5D, char_defs_Aring },
- { 0x7B, char_defs_aelig },
- { 0x5B, char_defs_AElig },
- { 0x7D, char_defs_aring },
- { 0x7C, char_defs_oslash},
- { 0x5C, char_defs_Oslash}
-};
-
-/* 9 French-specific characters (word-processing model only: the data-processing model uses
-the US character set, although the keyboard mapping is different from the US model) */
-/* WARNING: I have created the character matrices from scratch, as I have no printout of
-the original matrices. */
-static const char_override_t frenchWP_overrides[9] =
-{
- { 0x23, char_defs_pound },
- { 0x40, char_defs_agrave},
- { 0x5B, char_defs_deg },
- { 0x5C, char_defs_ccedil},
- { 0x5D, char_defs_sect },
- { 0x7B, char_defs_eacute}, /* 945423-9701 rev. B says char_defs_egrave, but it must be a mistake */
- { 0x7C, char_defs_ugrave},
- { 0x7D, char_defs_egrave}, /* 945423-9701 rev. B says char_defs_eacute, but it must be a mistake */
- { 0x7E, char_defs_uml }
-};
-
-/*
- char_defs array: character matrices for each character
-*/
-static const UINT8 char_defs[char_defs_count][10] =
-{
-/* US character set: 128 7*10 character matrix */
- { /* 0x00 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x1c
- },
- { /* 0x01 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x1c
- },
- { /* 0x02 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 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x00,
- 0x00
- },
- { /* 0x0E */
- 0x01,
- 0x03,
- 0x06,
- 0x04,
- 0x08,
- 0x08,
- 0x10,
- 0x30,
- 0x60,
- 0x40
- },
- { /* 0x0F */
- 0x00,
- 0x00,
- 0x7f,
- 0x00,
- 0x00,
- 0x00,
- 0x7f,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x10 */
- 0x00,
- 0x00,
- 0x00,
- 0x40,
- 0x40,
- 0x40,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x11 */
- 0x00,
- 0x00,
- 0x00,
- 0x60,
- 0x60,
- 0x60,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x12 */
- 0x00,
- 0x00,
- 0x00,
- 0x70,
- 0x70,
- 0x70,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x13 */
- 0x00,
- 0x00,
- 0x00,
- 0x78,
- 0x78,
- 0x78,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x14*/
- 0x00,
- 0x00,
- 0x00,
- 0x7c,
- 0x7c,
- 0x7c,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x15 */
- 0x00,
- 0x00,
- 0x00,
- 0x7e,
- 0x7e,
- 0x7e,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x16 */
- 0x00,
- 0x00,
- 0x00,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x17*/
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x18 */
- 0x1c,
- 0x1c,
- 0x1c,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x19 */
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f
- },
- { /* 0x1A */
- 0x00,
- 0x00,
- 0x00,
- 0x7c,
- 0x7c,
- 0x7c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x1B */
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1f,
- 0x1f,
- 0x1f,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x1C */
- 0x1c,
- 0x1c,
- 0x1c,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x1D */
- 0x1c,
- 0x1c,
- 0x1c,
- 0x7c,
- 0x7c,
- 0x7c,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x1E */
- 0x40,
- 0x60,
- 0x30,
- 0x10,
- 0x08,
- 0x08,
- 0x04,
- 0x06,
- 0x03,
- 0x01
- },
- { /* 0x1F */
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22
- },
- { /* 0x20 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x21 */
- 0x00,
- 0x18,
- 0x18,
- 0x18,
- 0x18,
- 0x18,
- 0x00,
- 0x18,
- 0x00,
- 0x00
- },
- { /* 0x22 */
- 0x00,
- 0x14,
- 0x14,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x23 */
- 0x00,
- 0x00,
- 0x14,
- 0x36,
- 0x00,
- 0x36,
- 0x14,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x24 */
- 0x00,
- 0x1c,
- 0x2a,
- 0x28,
- 0x1c,
- 0x0a,
- 0x2a,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x25 */
- 0x00,
- 0x30,
- 0x32,
- 0x04,
- 0x08,
- 0x10,
- 0x26,
- 0x06,
- 0x00,
- 0x00
- },
- { /* 0x26 */
- 0x00,
- 0x10,
- 0x28,
- 0x28,
- 0x10,
- 0x2a,
- 0x24,
- 0x1a,
- 0x00,
- 0x00
- },
- { /* 0x27 */
- 0x00,
- 0x04,
- 0x08,
- 0x10,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x28 */
- 0x00,
- 0x02,
- 0x04,
- 0x08,
- 0x08,
- 0x08,
- 0x04,
- 0x02,
- 0x00,
- 0x00
- },
- { /* 0x29 */
- 0x00,
- 0x20,
- 0x10,
- 0x08,
- 0x08,
- 0x08,
- 0x10,
- 0x20,
- 0x00,
- 0x00
- },
- { /* 0x2A */
- 0x00,
- 0x00,
- 0x08,
- 0x1c,
- 0x3e,
- 0x1c,
- 0x08,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x2B */
- 0x00,
- 0x00,
- 0x08,
- 0x08,
- 0x3e,
- 0x08,
- 0x08,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x2C */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x18,
- 0x18,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0x2D */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x2E */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x18,
- 0x18,
- 0x00,
- 0x00
- },
- { /* 0x2F */
- 0x00,
- 0x00,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x20,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x30 */
- 0x00,
- 0x0c,
- 0x12,
- 0x12,
- 0x12,
- 0x12,
- 0x12,
- 0x0c,
- 0x00,
- 0x00
- },
- { /* 0x31 */
- 0x00,
- 0x08,
- 0x18,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x32 */
- 0x00,
- 0x1c,
- 0x22,
- 0x02,
- 0x1c,
- 0x20,
- 0x20,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0x33 */
- 0x00,
- 0x1c,
- 0x22,
- 0x02,
- 0x0c,
- 0x02,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x34 */
- 0x00,
- 0x04,
- 0x0c,
- 0x14,
- 0x24,
- 0x3e,
- 0x04,
- 0x04,
- 0x00,
- 0x00
- },
- { /* 0x35 */
- 0x00,
- 0x3e,
- 0x20,
- 0x3c,
- 0x02,
- 0x02,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x36 */
- 0x00,
- 0x0c,
- 0x10,
- 0x20,
- 0x3c,
- 0x22,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x37 */
- 0x00,
- 0x3e,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0x38 */
- 0x00,
- 0x1c,
- 0x22,
- 0x22,
- 0x1c,
- 0x22,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x39 */
- 0x00,
- 0x1c,
- 0x22,
- 0x22,
- 0x1e,
- 0x02,
- 0x04,
- 0x18,
- 0x00,
- 0x00
- },
- { /* 0x3A */
- 0x00,
- 0x00,
- 0x18,
- 0x18,
- 0x00,
- 0x18,
- 0x18,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x3B */
- 0x00,
- 0x18,
- 0x18,
- 0x00,
- 0x18,
- 0x18,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0x3C */
- 0x00,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x08,
- 0x04,
- 0x02,
- 0x00,
- 0x00
- },
- { /* 0x3D */
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x00,
- 0x3e,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x3E */
- 0x00,
- 0x20,
- 0x10,
- 0x08,
- 0x04,
- 0x08,
- 0x10,
- 0x20,
- 0x00,
- 0x00
- },
- { /* 0x3F */
- 0x00,
- 0x1c,
- 0x22,
- 0x04,
- 0x08,
- 0x08,
- 0x00,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0x40 */
- 0x00,
- 0x1c,
- 0x22,
- 0x2e,
- 0x2a,
- 0x2e,
- 0x20,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x41 */
- 0x00,
- 0x1c,
- 0x22,
- 0x22,
- 0x3e,
- 0x22,
- 0x22,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x42 */
- 0x00,
- 0x3c,
- 0x12,
- 0x12,
- 0x1c,
- 0x12,
- 0x12,
- 0x3c,
- 0x00,
- 0x00
- },
- { /* 0x43 */
- 0x00,
- 0x1c,
- 0x22,
- 0x20,
- 0x20,
- 0x20,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x44 */
- 0x00,
- 0x3c,
- 0x12,
- 0x12,
- 0x12,
- 0x12,
- 0x12,
- 0x3c,
- 0x00,
- 0x00
- },
- { /* 0x45 */
- 0x00,
- 0x3e,
- 0x20,
- 0x20,
- 0x3c,
- 0x20,
- 0x20,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0x46 */
- 0x00,
- 0x3e,
- 0x20,
- 0x20,
- 0x3c,
- 0x20,
- 0x20,
- 0x20,
- 0x00,
- 0x00
- },
- { /* 0x47 */
- 0x00,
- 0x1e,
- 0x20,
- 0x20,
- 0x2e,
- 0x22,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x48 */
- 0x00,
- 0x22,
- 0x22,
- 0x22,
- 0x3e,
- 0x22,
- 0x22,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x49 */
- 0x00,
- 0x1c,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x4A */
- 0x00,
- 0x02,
- 0x02,
- 0x02,
- 0x02,
- 0x02,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x4B */
- 0x00,
- 0x22,
- 0x24,
- 0x28,
- 0x30,
- 0x28,
- 0x24,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x4C */
- 0x00,
- 0x20,
- 0x20,
- 0x20,
- 0x20,
- 0x20,
- 0x20,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0x4D */
- 0x00,
- 0x22,
- 0x36,
- 0x2a,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x4E */
- 0x00,
- 0x22,
- 0x32,
- 0x2a,
- 0x26,
- 0x22,
- 0x22,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x4F */
- 0x00,
- 0x3e,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0x50 */
- 0x00,
- 0x3c,
- 0x22,
- 0x22,
- 0x3c,
- 0x20,
- 0x20,
- 0x20,
- 0x00,
- 0x00
- },
- { /* 0x51 */
- 0x00,
- 0x3e,
- 0x22,
- 0x22,
- 0x22,
- 0x2a,
- 0x24,
- 0x3a,
- 0x00,
- 0x00
- },
- { /* 0x52 */
- 0x00,
- 0x3c,
- 0x22,
- 0x22,
- 0x3c,
- 0x28,
- 0x24,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x53 */
- 0x00,
- 0x1c,
- 0x20,
- 0x10,
- 0x08,
- 0x04,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x54 */
- 0x00,
- 0x3e,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0x55 */
- 0x00,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x56 */
- 0x00,
- 0x22,
- 0x22,
- 0x22,
- 0x14,
- 0x14,
- 0x08,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0x57 */
- 0x00,
- 0x22,
- 0x22,
- 0x22,
- 0x2a,
- 0x2a,
- 0x2a,
- 0x14,
- 0x00,
- 0x00
- },
- { /* 0x58 */
- 0x00,
- 0x22,
- 0x22,
- 0x14,
- 0x08,
- 0x14,
- 0x22,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x59 */
- 0x00,
- 0x22,
- 0x22,
- 0x14,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0x5A */
- 0x00,
- 0x3e,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x20,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0x5B */
- 0x00,
- 0x0e,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x0e,
- 0x00,
- 0x00
- },
- { /* 0x5C */
- 0x00,
- 0x00,
- 0x20,
- 0x10,
- 0x08,
- 0x04,
- 0x02,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x5D */
- 0x00,
- 0x38,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x38,
- 0x00,
- 0x00
- },
- { /* 0x5E */
- 0x00,
- 0x08,
- 0x14,
- 0x22,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x5F */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0x60 */
- 0x00,
- 0x10,
- 0x08,
- 0x04,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x61 */
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x22,
- 0x3e,
- 0x22,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x62 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x12,
- 0x1c,
- 0x12,
- 0x3c,
- 0x00,
- 0x00
- },
- { /* 0x63 */
- 0x00,
- 0x00,
- 0x00,
- 0x1e,
- 0x20,
- 0x20,
- 0x20,
- 0x1e,
- 0x00,
- 0x00
- },
- { /* 0x64 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x12,
- 0x12,
- 0x12,
- 0x3c,
- 0x00,
- 0x00
- },
- { /* 0x65 */
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x20,
- 0x3c,
- 0x20,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0x66 */
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x20,
- 0x3c,
- 0x20,
- 0x20,
- 0x00,
- 0x00
- },
- { /* 0x67 */
- 0x00,
- 0x00,
- 0x00,
- 0x1e,
- 0x20,
- 0x2e,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x68 */
- 0x00,
- 0x00,
- 0x00,
- 0x22,
- 0x22,
- 0x3e,
- 0x22,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x69 */
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x08,
- 0x08,
- 0x08,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x6A */
- 0x00,
- 0x00,
- 0x00,
- 0x0e,
- 0x04,
- 0x04,
- 0x24,
- 0x3c,
- 0x00,
- 0x00
- },
- { /* 0x6B */
- 0x00,
- 0x00,
- 0x00,
- 0x22,
- 0x24,
- 0x38,
- 0x24,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x6C */
- 0x00,
- 0x00,
- 0x00,
- 0x20,
- 0x20,
- 0x20,
- 0x20,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0x6D */
- 0x00,
- 0x00,
- 0x00,
- 0x22,
- 0x36,
- 0x2a,
- 0x22,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x6E */
- 0x00,
- 0x00,
- 0x00,
- 0x22,
- 0x32,
- 0x2a,
- 0x26,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x6F */
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x22,
- 0x22,
- 0x22,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0x70 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x22,
- 0x3c,
- 0x20,
- 0x20,
- 0x00,
- 0x00
- },
- { /* 0x71 */
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x22,
- 0x2a,
- 0x24,
- 0x3a,
- 0x00,
- 0x00
- },
- { /* 0x72 */
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x22,
- 0x3e,
- 0x24,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x73 */
- 0x00,
- 0x00,
- 0x00,
- 0x1e,
- 0x20,
- 0x1c,
- 0x02,
- 0x3c,
- 0x00,
- 0x00
- },
- { /* 0x74 */
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0x75 */
- 0x00,
- 0x00,
- 0x00,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0x76 */
- 0x00,
- 0x00,
- 0x00,
- 0x22,
- 0x22,
- 0x24,
- 0x28,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0x77 */
- 0x00,
- 0x00,
- 0x00,
- 0x22,
- 0x22,
- 0x2a,
- 0x36,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x78 */
- 0x00,
- 0x00,
- 0x00,
- 0x22,
- 0x14,
- 0x08,
- 0x14,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0x79 */
- 0x00,
- 0x00,
- 0x00,
- 0x22,
- 0x14,
- 0x08,
- 0x08,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0x7A */
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x04,
- 0x08,
- 0x10,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0x7B */
- 0x00,
- 0x06,
- 0x08,
- 0x08,
- 0x10,
- 0x08,
- 0x08,
- 0x06,
- 0x00,
- 0x00
- },
- { /* 0x7C */
- 0x00,
- 0x08,
- 0x08,
- 0x08,
- 0x00,
- 0x08,
- 0x08,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0x7D */
- 0x00,
- 0x30,
- 0x08,
- 0x08,
- 0x04,
- 0x08,
- 0x08,
- 0x30,
- 0x00,
- 0x00
- },
- { /* 0x7E */
- 0x00,
- 0x10,
- 0x2a,
- 0x04,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x7F */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
-
-
-/* 128 additional characters for Japanese terminals */
- { /* 0x80 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x1c
- },
- { /* 0x81 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x1c
- },
- { /* 0x82 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x83 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x84 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x85 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x86 */
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x87 */
- 0x00,
- 0x00,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x88 */
- 0x00,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x89 */
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x8A */
- 0x00,
- 0x00,
- 0x00,
- 0x1f,
- 0x1f,
- 0x1f,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x8B */
- 0x1c,
- 0x1c,
- 0x1c,
- 0x7c,
- 0x7c,
- 0x7c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x8C */
- 0x00,
- 0x00,
- 0x00,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x8D */
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1f,
- 0x1f,
- 0x1f,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x8E */
- 0x01,
- 0x03,
- 0x06,
- 0x04,
- 0x08,
- 0x08,
- 0x10,
- 0x30,
- 0x30,
- 0x20
- },
- { /* 0x8F */
- 0x00,
- 0x00,
- 0x7f,
- 0x00,
- 0x00,
- 0x00,
- 0x7f,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x90 */
- 0x00,
- 0x00,
- 0x00,
- 0x40,
- 0x40,
- 0x40,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x91 */
- 0x00,
- 0x00,
- 0x00,
- 0x60,
- 0x60,
- 0x60,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x92 */
- 0x00,
- 0x00,
- 0x00,
- 0x70,
- 0x70,
- 0x70,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x93 */
- 0x00,
- 0x00,
- 0x00,
- 0x78,
- 0x78,
- 0x78,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x94*/
- 0x00,
- 0x00,
- 0x00,
- 0x7c,
- 0x7c,
- 0x7c,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x95 */
- 0x00,
- 0x00,
- 0x00,
- 0x7e,
- 0x7e,
- 0x7e,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x96 */
- 0x00,
- 0x00,
- 0x00,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x97*/
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x98 */
- 0x1c,
- 0x1c,
- 0x1c,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x99 */
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x7f
- },
- { /* 0x9A */
- 0x00,
- 0x00,
- 0x00,
- 0x7c,
- 0x7c,
- 0x7c,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x9B */
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1f,
- 0x1f,
- 0x1f,
- 0x1c,
- 0x1c,
- 0x1c,
- 0x1c
- },
- { /* 0x9C */
- 0x1c,
- 0x1c,
- 0x1c,
- 0x7f,
- 0x7f,
- 0x7f,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x9D */
- 0x1c,
- 0x1c,
- 0x1c,
- 0x7c,
- 0x7c,
- 0x7c,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0x9E */
- 0x40,
- 0x60,
- 0x30,
- 0x10,
- 0x08,
- 0x08,
- 0x04,
- 0x06,
- 0x06,
- 0x02
- },
- { /* 0x9F */
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x22
- },
- { /* 0xA0 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xA1 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x38,
- 0x28,
- 0x38,
- 0x00,
- 0x00
- },
- { /* 0xA2 */
- 0x00,
- 0x0e,
- 0x08,
- 0x08,
- 0x08,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xA3 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x08,
- 0x08,
- 0x08,
- 0x38,
- 0x00,
- 0x00
- },
- { /* 0xA4 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x10,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0xA5 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x10,
- 0x10,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xA6 */
- 0x00,
- 0x00,
- 0x3e,
- 0x02,
- 0x1e,
- 0x02,
- 0x04,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0xA7 */
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x02,
- 0x0c,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xA8 */
- 0x00,
- 0x00,
- 0x00,
- 0x04,
- 0x08,
- 0x18,
- 0x28,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0xA9 */
- 0x00,
- 0x00,
- 0x00,
- 0x08,
- 0x3e,
- 0x22,
- 0x02,
- 0x0c,
- 0x00,
- 0x00
- },
- { /* 0xAA */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x08,
- 0x08,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0xAB */
- 0x00,
- 0x00,
- 0x00,
- 0x04,
- 0x3e,
- 0x0c,
- 0x14,
- 0x24,
- 0x00,
- 0x00
- },
- { /* 0xAC */
- 0x00,
- 0x00,
- 0x00,
- 0x10,
- 0x3e,
- 0x12,
- 0x14,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xAD */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x1c,
- 0x04,
- 0x04,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0xAE */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x04,
- 0x3c,
- 0x04,
- 0x3c,
- 0x00,
- 0x00
- },
- { /* 0xAF */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x2a,
- 0x2a,
- 0x02,
- 0x0c,
- 0x00,
- 0x00
- },
- { /* 0xB0 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xB1 */
- 0x00,
- 0x00,
- 0x3e,
- 0x02,
- 0x0c,
- 0x08,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xB2 */
- 0x00,
- 0x04,
- 0x08,
- 0x18,
- 0x28,
- 0x08,
- 0x08,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0xB3 */
- 0x00,
- 0x08,
- 0x3e,
- 0x22,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xB4 */
- 0x00,
- 0x00,
- 0x3e,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0xB5 */
- 0x00,
- 0x04,
- 0x3e,
- 0x04,
- 0x0c,
- 0x14,
- 0x24,
- 0x04,
- 0x00,
- 0x00
- },
- { /* 0xB6 */
- 0x00,
- 0x08,
- 0x08,
- 0x3e,
- 0x0a,
- 0x0a,
- 0x12,
- 0x24,
- 0x00,
- 0x00
- },
- { /* 0xB7 */
- 0x00,
- 0x08,
- 0x3e,
- 0x08,
- 0x3e,
- 0x08,
- 0x08,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0xB8 */
- 0x00,
- 0x00,
- 0x1e,
- 0x12,
- 0x22,
- 0x04,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xB9 */
- 0x00,
- 0x10,
- 0x10,
- 0x1e,
- 0x24,
- 0x04,
- 0x04,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0xBA */
- 0x00,
- 0x00,
- 0x3e,
- 0x02,
- 0x02,
- 0x02,
- 0x02,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0xBB */
- 0x00,
- 0x14,
- 0x3e,
- 0x14,
- 0x14,
- 0x04,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xBC */
- 0x00,
- 0x00,
- 0x30,
- 0x00,
- 0x32,
- 0x02,
- 0x04,
- 0x38,
- 0x00,
- 0x00
- },
- { /* 0xBD */
- 0x00,
- 0x00,
- 0x3e,
- 0x02,
- 0x04,
- 0x08,
- 0x14,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0xBE */
- 0x00,
- 0x10,
- 0x3e,
- 0x12,
- 0x14,
- 0x10,
- 0x10,
- 0x1e,
- 0x00,
- 0x00
- },
- { /* 0xBF */
- 0x00,
- 0x00,
- 0x22,
- 0x22,
- 0x12,
- 0x02,
- 0x04,
- 0x18,
- 0x00,
- 0x00
- },
- { /* 0xC0 */
- 0x00,
- 0x00,
- 0x1e,
- 0x12,
- 0x2a,
- 0x04,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xC1 */
- 0x00,
- 0x04,
- 0x38,
- 0x08,
- 0x3e,
- 0x08,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xC2 */
- 0x00,
- 0x00,
- 0x2a,
- 0x2a,
- 0x2a,
- 0x02,
- 0x04,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0xC3 */
- 0x00,
- 0x00,
- 0x1c,
- 0x00,
- 0x3e,
- 0x08,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xC4 */
- 0x00,
- 0x10,
- 0x10,
- 0x10,
- 0x18,
- 0x14,
- 0x10,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xC5 */
- 0x00,
- 0x08,
- 0x08,
- 0x3e,
- 0x08,
- 0x08,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xC6 */
- 0x00,
- 0x00,
- 0x1c,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0xC7 */
- 0x00,
- 0x00,
- 0x3e,
- 0x02,
- 0x14,
- 0x08,
- 0x14,
- 0x20,
- 0x00,
- 0x00
- },
- { /* 0xC8 */
- 0x00,
- 0x08,
- 0x3e,
- 0x04,
- 0x08,
- 0x1c,
- 0x2a,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0xC9 */
- 0x00,
- 0x04,
- 0x04,
- 0x04,
- 0x04,
- 0x04,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xCA */
- 0x00,
- 0x00,
- 0x04,
- 0x02,
- 0x12,
- 0x12,
- 0x12,
- 0x22,
- 0x00,
- 0x00
- },
- { /* 0xCB */
- 0x00,
- 0x00,
- 0x20,
- 0x20,
- 0x3e,
- 0x20,
- 0x20,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0xCC */
- 0x00,
- 0x00,
- 0x3e,
- 0x02,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xCD */
- 0x00,
- 0x00,
- 0x10,
- 0x28,
- 0x04,
- 0x02,
- 0x02,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xCE */
- 0x00,
- 0x08,
- 0x3e,
- 0x08,
- 0x2a,
- 0x2a,
- 0x2a,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0xCF */
- 0x00,
- 0x00,
- 0x3e,
- 0x02,
- 0x02,
- 0x14,
- 0x08,
- 0x04,
- 0x00,
- 0x00
- },
- { /* 0xD0 */
- 0x00,
- 0x10,
- 0x0e,
- 0x00,
- 0x0e,
- 0x00,
- 0x10,
- 0x0e,
- 0x00,
- 0x00
- },
- { /* 0xD1 */
- 0x00,
- 0x00,
- 0x04,
- 0x08,
- 0x10,
- 0x22,
- 0x3e,
- 0x02,
- 0x00,
- 0x00
- },
- { /* 0xD2 */
- 0x00,
- 0x00,
- 0x02,
- 0x02,
- 0x14,
- 0x08,
- 0x14,
- 0x20,
- 0x00,
- 0x00
- },
- { /* 0xD3 */
- 0x00,
- 0x00,
- 0x3c,
- 0x10,
- 0x3e,
- 0x10,
- 0x10,
- 0x1e,
- 0x00,
- 0x00
- },
- { /* 0xD4 */
- 0x00,
- 0x10,
- 0x10,
- 0x3e,
- 0x12,
- 0x14,
- 0x10,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xD5 */
- 0x00,
- 0x00,
- 0x1c,
- 0x04,
- 0x04,
- 0x04,
- 0x04,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0xD6 */
- 0x00,
- 0x00,
- 0x3e,
- 0x02,
- 0x3e,
- 0x02,
- 0x02,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0xD7 */
- 0x00,
- 0x00,
- 0x1c,
- 0x00,
- 0x3e,
- 0x02,
- 0x02,
- 0x0c,
- 0x00,
- 0x00
- },
- { /* 0xD8 */
- 0x00,
- 0x00,
- 0x12,
- 0x12,
- 0x12,
- 0x02,
- 0x04,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0xD9 */
- 0x00,
- 0x00,
- 0x28,
- 0x28,
- 0x28,
- 0x2a,
- 0x2a,
- 0x2c,
- 0x00,
- 0x00
- },
- { /* 0xDA */
- 0x00,
- 0x00,
- 0x20,
- 0x20,
- 0x22,
- 0x24,
- 0x28,
- 0x30,
- 0x00,
- 0x00
- },
- { /* 0xDB */
- 0x00,
- 0x00,
- 0x3e,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0xDC */
- 0x00,
- 0x00,
- 0x3e,
- 0x22,
- 0x22,
- 0x02,
- 0x04,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0xDD */
- 0x00,
- 0x00,
- 0x30,
- 0x00,
- 0x02,
- 0x02,
- 0x04,
- 0x38,
- 0x00,
- 0x00
- },
- { /* 0xDE */
- 0x00,
- 0x28,
- 0x28,
- 0x28,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xDF */
- 0x00,
- 0x38,
- 0x28,
- 0x38,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xE0 */
- 0x00,
- 0x1c,
- 0x22,
- 0x04,
- 0x08,
- 0x08,
- 0x00,
- 0x08,
- 0x00,
- 0x00
- },
- { /* 0xE1 */
- 0x00,
- 0x18,
- 0x18,
- 0x18,
- 0x18,
- 0x00,
- 0x18,
- 0x18,
- 0x00,
- 0x00
- },
- { /* 0xE2 */
- 0x00,
- 0x14,
- 0x14,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xE3 */
- 0x00,
- 0x00,
- 0x14,
- 0x36,
- 0x00,
- 0x36,
- 0x14,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xE4 */
- 0x00,
- 0x1c,
- 0x2a,
- 0x28,
- 0x1c,
- 0x0a,
- 0x2a,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0xE5 */
- 0x00,
- 0x30,
- 0x32,
- 0x04,
- 0x08,
- 0x10,
- 0x26,
- 0x06,
- 0x00,
- 0x00
- },
- { /* 0xE6 */
- 0x00,
- 0x10,
- 0x28,
- 0x28,
- 0x10,
- 0x2a,
- 0x24,
- 0x1a,
- 0x00,
- 0x00
- },
- { /* 0xE7 */
- 0x00,
- 0x04,
- 0x08,
- 0x10,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xE8 */
- 0x00,
- 0x02,
- 0x04,
- 0x08,
- 0x08,
- 0x08,
- 0x04,
- 0x02,
- 0x00,
- 0x00
- },
- { /* 0xE9 */
- 0x00,
- 0x20,
- 0x10,
- 0x08,
- 0x08,
- 0x08,
- 0x10,
- 0x20,
- 0x00,
- 0x00
- },
- { /* 0xEA */
- 0x00,
- 0x00,
- 0x08,
- 0x1c,
- 0x3e,
- 0x1c,
- 0x08,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xEB */
- 0x00,
- 0x00,
- 0x08,
- 0x08,
- 0x3e,
- 0x08,
- 0x08,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xEC */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x18,
- 0x18,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xED */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xEE */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x18,
- 0x18,
- 0x00,
- 0x00
- },
- { /* 0xEF */
- 0x00,
- 0x00,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x20,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xF0 */
- 0x00,
- 0x0c,
- 0x12,
- 0x12,
- 0x12,
- 0x12,
- 0x12,
- 0x0c,
- 0x00,
- 0x00
- },
- { /* 0xF1 */
- 0x00,
- 0x08,
- 0x18,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0xF2 */
- 0x00,
- 0x1c,
- 0x22,
- 0x02,
- 0x1c,
- 0x20,
- 0x20,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* 0xF3 */
- 0x00,
- 0x1c,
- 0x22,
- 0x02,
- 0x0c,
- 0x02,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0xF4 */
- 0x00,
- 0x04,
- 0x0c,
- 0x14,
- 0x24,
- 0x3e,
- 0x04,
- 0x04,
- 0x00,
- 0x00
- },
- { /* 0xF5 */
- 0x00,
- 0x3e,
- 0x20,
- 0x3c,
- 0x02,
- 0x02,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0xF6 */
- 0x00,
- 0x0c,
- 0x10,
- 0x20,
- 0x3c,
- 0x22,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0xF7 */
- 0x00,
- 0x3e,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xF8 */
- 0x00,
- 0x1c,
- 0x22,
- 0x22,
- 0x1c,
- 0x22,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* 0xF9 */
- 0x00,
- 0x1c,
- 0x22,
- 0x22,
- 0x1e,
- 0x02,
- 0x04,
- 0x18,
- 0x00,
- 0x00
- },
- { /* 0xFA */
- 0x00,
- 0x00,
- 0x18,
- 0x18,
- 0x00,
- 0x18,
- 0x18,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xFB */
- 0x00,
- 0x18,
- 0x18,
- 0x00,
- 0x18,
- 0x18,
- 0x08,
- 0x10,
- 0x00,
- 0x00
- },
- { /* 0xFC */
- 0x00,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x08,
- 0x04,
- 0x02,
- 0x00,
- 0x00
- },
- { /* 0xFD */
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x00,
- 0x3e,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* 0xFE */
- 0x00,
- 0x20,
- 0x10,
- 0x08,
- 0x04,
- 0x08,
- 0x10,
- 0x20,
- 0x00,
- 0x00
- },
- { /* 0xFF */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
-
-
-/* extra symbols for various national terminals, which use slightly modified
-variants of the US character set */
- { /* pound */
- 0x00,
- 0x0c,
- 0x12,
- 0x10,
- 0x38,
- 0x10,
- 0x3a,
- 0x34,
- 0x00,
- 0x00
- },
- { /* yen */
- 0x00,
- 0x22,
- 0x14,
- 0x08,
- 0x3e,
- 0x08,
- 0x3e,
- 0x08,
- 0x00,
- 0x00
- },
- { /* auml */
- 0x00,
- 0x00,
- 0x22,
- 0x00,
- 0x1c,
- 0x22,
- 0x3e,
- 0x22,
- 0x00,
- 0x00
- },
- { /* Auml */
- 0x00,
- 0x22,
- 0x00,
- 0x1c,
- 0x22,
- 0x3e,
- 0x22,
- 0x22,
- 0x00,
- 0x00
- },
- { /* Aring */
- 0x00,
- 0x08,
- 0x00,
- 0x1c,
- 0x22,
- 0x3e,
- 0x22,
- 0x22,
- 0x00,
- 0x00
- },
- { /* uuml */
- 0x00,
- 0x00,
- 0x22,
- 0x00,
- 0x22,
- 0x22,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* aring */
- 0x00,
- 0x00,
- 0x08,
- 0x00,
- 0x1c,
- 0x22,
- 0x3e,
- 0x22,
- 0x00,
- 0x00
- },
-
- { /* Uuml */
- 0x00,
- 0x22,
- 0x00,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
-
- { /* ouml */
- 0x00,
- 0x00,
- 0x22,
- 0x00,
- 0x3e,
- 0x22,
- 0x22,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* Ouml */
- 0x00,
- 0x22,
- 0x00,
- 0x3e,
- 0x22,
- 0x22,
- 0x22,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* szlig */
- 0x00,
- 0x18,
- 0x24,
- 0x24,
- 0x2c,
- 0x22,
- 0x22,
- 0x2c,
- 0x00,
- 0x00
- },
- { /* aelig */
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x28,
- 0x3e,
- 0x28,
- 0x2e,
- 0x00,
- 0x00
- },
- { /* AElig */
- 0x00,
- 0x3e,
- 0x28,
- 0x28,
- 0x3e,
- 0x28,
- 0x28,
- 0x2e,
- 0x00,
- 0x00
- },
- { /* Oslash */
- 0x00,
- 0x00,
- 0x00,
- 0x3e,
- 0x26,
- 0x2a,
- 0x32,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* oslash */
- 0x00,
- 0x3e,
- 0x22,
- 0x26,
- 0x2a,
- 0x32,
- 0x22,
- 0x3e,
- 0x00,
- 0x00
- },
-/* WARNING: I have created the next 8 French character matrices from scratch,
-as I have no printout of the original matrices. */
- { /* agrave */
- 0x00,
- 0x10,
- 0x08,
- 0x00,
- 0x1c,
- 0x22,
- 0x3e,
- 0x22,
- 0x00,
- 0x00
- },
- { /* deg */
- 0x00,
- 0x38,
- 0x28,
- 0x38,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- },
- { /* ccedil */
- 0x00,
- 0x00,
- 0x00,
- 0x1e,
- 0x20,
- 0x20,
- 0x20,
- 0x1e,
- 0x08,
- 0x04
- },
- { /* sect */
- 0x00,
- 0x1c,
- 0x20,
- 0x1c,
- 0x22,
- 0x1c,
- 0x02,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* egrave */
- 0x00,
- 0x10,
- 0x08,
- 0x3e,
- 0x20,
- 0x3c,
- 0x20,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* ugrave */
- 0x00,
- 0x10,
- 0x08,
- 0x22,
- 0x22,
- 0x22,
- 0x22,
- 0x1c,
- 0x00,
- 0x00
- },
- { /* eacute */
- 0x00,
- 0x04,
- 0x08,
- 0x3e,
- 0x20,
- 0x3c,
- 0x20,
- 0x3e,
- 0x00,
- 0x00
- },
- { /* uml */
- 0x00,
- 0x22,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
- }
-};
diff --git a/src/mess/video/911_key.h b/src/mess/video/911_key.h
deleted file mode 100644
index 108bf85fd7d..00000000000
--- a/src/mess/video/911_key.h
+++ /dev/null
@@ -1,4028 +0,0 @@
-// license:GPL-2.0+
-// copyright-holders:Raphael Nabet
-/*
- key translation table for both US and UK terminals
-
- The only difference is that the US # character is a Pound character in UK.
-*/
-static const unsigned char US_key_translate[4][91] =
-{
- { /* lower case */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x31,
- 0x32,
- 0x33,
- 0x34,
- 0x35,
- 0x36,
- 0x37,
- 0x38,
- 0x39,
- 0x30,
- 0x2B,
- 0x2D,
- 0x5F,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x71,
- 0x77,
- 0x65,
- 0x72,
- 0x74,
- 0x79,
- 0x75,
- 0x69,
- 0x6F,
- 0x70,
- 0x88,
- 0x87,
- 0x0D,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x61,
- 0x73,
- 0x64,
- 0x66,
- 0x67,
- 0x68,
- 0x6A,
- 0x6B,
- 0x6C,
- 0x3B,
- 0x27,
- 0,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x7A,
- 0x78,
- 0x63,
- 0x76,
- 0x62,
- 0x6E,
- 0x6D,
- 0x2C,
- 0x2E,
- 0x2F,
- 0,
-
- 0x30,
- 0x2E,
-
- 0,
- 0x20,
- 0
- },
- { /* upper case */
- 0x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 0,
- 0x20,
- 0
- }
-};
-
-
-/*
- key translation table for French terminals
-*/
-static const unsigned char French_key_translate[4][91] =
-{
- { /* lower case */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x31,
- 0x32,
- 0x33,
- 0x34,
- 0x35,
- 0x36,
- 0x37,
- 0x38,
- 0x39,
- 0x30,
- 0x2B,
- 0x2D,
- 0x5F,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x61,
- 0x7A,
- 0x65,
- 0x72,
- 0x74,
- 0x79,
- 0x75,
- 0x69,
- 0x6F,
- 0x70,
- 0x88,
- 0x87,
- 0x0D,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x71,
- 0x73,
- 0x64,
- 0x66,
- 0x67,
- 0x68,
- 0x6A,
- 0x6B,
- 0x6C,
- 0x6D,
- 0x27,
- 0,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x77,
- 0x78,
- 0x63,
- 0x76,
- 0x62,
- 0x6E,
- 0x3B,
- 0x2C,
- 0x2E,
- 0x2F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0
- },
- { /* upper case */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x31,
- 0x32,
- 0x33,
- 0x34,
- 0x35,
- 0x36,
- 0x37,
- 0x38,
- 0x39,
- 0x30,
- 0x2B,
- 0x2D,
- 0x5F,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
-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x56,
- 0x42,
- 0x4E,
- 0x3A,
- 0x3C,
- 0x3E,
- 0x3F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0
- },
- { /* control */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x90,
- 0x91,
- 0x00,
- 0xA1,
- 0x8D,
- 0x8E,
- 0x8F,
- 0x7C,
- 0x60,
- 0x7E,
- 0x1D,
- 0x7F,
- 0x5C,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x01,
- 0x1A,
- 0x05,
- 0x12,
- 0x14,
- 0x19,
- 0x15,
- 0x09,
- 0x0F,
- 0x10,
- 0x88,
- 0x87,
- 0x0D,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x11,
- 0x13,
- 0x04,
- 0x06,
- 0x07,
- 0x08,
- 0x0A,
- 0x0B,
- 0x0C,
- 0x0D,
- 0x7D,
- 0,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x17,
- 0x18,
- 0x03,
- 0x16,
- 0x02,
- 0x0E,
- 0x7B,
- 0x1C,
- 0x1E,
- 0x1F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0
- }
-};
-
-
-/*
- key translation table for German terminals
-*/
-static const unsigned char German_key_translate[4][91] =
-{
- { /* lower case */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x31,
- 0x32,
- 0x33,
- 0x34,
- 0x35,
- 0x36,
- 0x37,
- 0x38,
- 0x39,
- 0x30,
-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- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x59,
- 0x58,
- 0x43,
- 0x56,
- 0x42,
- 0x4E,
- 0x4D,
- 0x2C,
- 0x2E,
- 0x2F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0x0D
- },
- { /* shifted */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x21,
- 0x40,
- 0x23,
- 0x24,
- 0x25,
- 0x5E,
- 0x26,
- 0x2A,
- 0x28,
- 0x29,
- 0x5F,
- 0x3D,
- 0x22,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x51,
- 0x57,
- 0x45,
- 0x52,
- 0x54,
- 0x5A,
- 0x55,
- 0x49,
- 0x4F,
- 0x50,
- 0x5D,
- 0x8A,
- 0x8C,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x41,
- 0x53,
- 0x44,
- 0x46,
- 0x47,
- 0x48,
- 0x4A,
- 0x4B,
- 0x4C,
- 0x5C,
- 0x5B,
- 0x3A,
- 0x83, /* 945423-9701 rev. B says 0x85, but it must be a mistake */
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x59,
- 0x58,
- 0x43,
- 0x56,
- 0x42,
- 0x4E,
- 0x4D,
- 0x3C,
- 0x3E,
- 0x3F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0x0D
- },
- { /* control */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x90,
- 0x91,
- 0x00,
- 0xA1,
- 0x8D,
- 0x8E,
- 0x8F,
- 0x7C,
- 0x60,
- 0x00,
- 0x1D,
- 0x7F,
- 0x00,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x11,
- 0x17,
- 0x05,
- 0x12,
- 0x14,
- 0x1A,
- 0x15,
- 0x09,
- 0x0F,
- 0x10,
- 0x00,
- 0x88,
- 0x87,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x01,
- 0x13,
- 0x04,
- 0x06,
- 0x07,
- 0x08,
- 0x0A,
- 0x0B,
- 0x0C,
- 0x00,
- 0x00,
- 0x00,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x19,
- 0x18,
- 0x03,
- 0x16,
- 0x02,
- 0x0E,
- 0x0D,
- 0x1C,
- 0x1E,
- 0x1F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0x0D
- }
-};
-
-
-/*
- key translation table for Swedish/Finnish terminals
-*/
-static const unsigned char Swedish_key_translate[4][91] =
-{
- { /* lower case */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x31,
- 0x32,
- 0x33,
- 0x34,
- 0x35,
- 0x36,
- 0x37,
- 0x38,
- 0x39,
- 0x30,
- 0x2B,
- 0x2D,
- 0x7E,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x71,
- 0x77,
- 0x65,
- 0x72,
- 0x74,
- 0x79,
- 0x75,
- 0x69,
- 0x6F,
- 0x70,
- 0x7D,
- 0x88,
- 0x87,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x61,
- 0x73,
- 0x64,
- 0x66,
- 0x67,
- 0x68,
- 0x6A,
- 0x6B,
- 0x6C,
- 0x7C,
- 0x7B,
- 0x3B,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x7A,
- 0x78,
- 0x63,
- 0x76,
- 0x62,
- 0x6E,
- 0x6D,
- 0x2C,
- 0x2E,
- 0x2F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0x0D
- },
- { /* upper case */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x31,
- 0x32,
- 0x33,
- 0x34,
- 0x35,
- 0x36,
- 0x37,
- 0x38,
- 0x39,
- 0x30,
- 0x2B,
- 0x2D,
- 0x27,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x51,
- 0x57,
- 0x45,
- 0x52,
- 0x54,
- 0x59,
- 0x55,
- 0x49,
- 0x4F,
- 0x50,
- 0x5D,
- 0x88,
- 0x87,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x41,
- 0x53,
- 0x44,
- 0x46,
- 0x47,
- 0x48,
- 0x4A,
- 0x4B,
- 0x4C,
- 0x5C,
- 0x5B,
- 0x3B,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x5A,
- 0x58,
- 0x43,
- 0x56,
- 0x42,
- 0x4E,
- 0x4D,
- 0x2C,
- 0x2E,
- 0x2F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0x0D
- },
- { /* shifted */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x21,
- 0x40,
- 0x23,
- 0x24,
- 0x25,
- 0x5E,
- 0x26,
- 0x2A,
- 0x28,
- 0x29,
- 0x5F,
- 0x3D,
- 0x22,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x51,
- 0x57,
- 0x45,
- 0x52,
- 0x54,
- 0x59,
- 0x55,
- 0x49,
- 0x4F,
- 0x50,
- 0x5D,
- 0x8A,
- 0x8C,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x41,
- 0x53,
- 0x44,
- 0x46,
- 0x47,
- 0x48,
- 0x4A,
- 0x4B,
- 0x4C,
- 0x5C,
- 0x5B,
- 0x3A,
- 0x83, /* 945423-9701 rev. B says 0x85, but it must be a mistake */
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x5A,
- 0x58,
- 0x43,
- 0x56,
- 0x42,
- 0x4E,
- 0x4D,
- 0x3C,
- 0x3E,
- 0x3F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0x0D
- },
- { /* control */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x90,
- 0x91,
- 0x00,
- 0xA1,
- 0x8D,
- 0x8E,
- 0x8F,
- 0x00,
- 0x60,
- 0x00,
- 0x1D,
- 0x7F,
- 0x00,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x11,
- 0x17,
- 0x05,
- 0x12,
- 0x14,
- 0x19,
- 0x15,
- 0x09,
- 0x0F,
- 0x10,
- 0x00,
- 0x88,
- 0x87,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x01,
- 0x13,
- 0x04,
- 0x06,
- 0x07,
- 0x08,
- 0x0A,
- 0x0B,
- 0x0C,
- 0x00,
- 0x00,
- 0x00,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x1A,
- 0x18,
- 0x03,
- 0x16,
- 0x02,
- 0x0E,
- 0x0D,
- 0x1C,
- 0x1E,
- 0x1F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0x0D
- }
-};
-
-
-/*
- key translation table for Norwegian/Danish terminals
-*/
-static const unsigned char Norwegian_key_translate[4][91] =
-{
- { /* lower case */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x31,
- 0x32,
- 0x33,
- 0x34,
- 0x35,
- 0x36,
- 0x37,
- 0x38,
- 0x39,
- 0x30,
- 0x2B,
- 0x2D,
- 0x27,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x71,
- 0x77,
- 0x65,
- 0x72,
- 0x74,
- 0x79,
- 0x75,
- 0x69,
- 0x6F,
- 0x70,
- 0x7D,
- 0x88,
- 0x87,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x61,
- 0x73,
- 0x64,
- 0x66,
- 0x67,
- 0x68,
- 0x6A,
- 0x6B,
- 0x6C,
- 0x7B,
- 0x7C,
- 0x3B,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x7A,
- 0x78,
- 0x63,
- 0x76,
- 0x62,
- 0x6E,
- 0x6D,
- 0x2C,
- 0x2E,
- 0x2F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0x0D
- },
- { /* upper case */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x31,
- 0x32,
- 0x33,
- 0x34,
- 0x35,
- 0x36,
- 0x37,
- 0x38,
- 0x39,
- 0x30,
- 0x2B,
- 0x2D,
- 0x27,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x51,
- 0x57,
- 0x45,
- 0x52,
- 0x54,
- 0x59,
- 0x55,
- 0x49,
- 0x4F,
- 0x50,
- 0x5D,
- 0x88,
- 0x87,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x41,
- 0x53,
- 0x44,
- 0x46,
- 0x47,
- 0x48,
- 0x4A,
- 0x4B,
- 0x4C,
- 0x5B,
- 0x5C,
- 0x3B,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x5A,
- 0x58,
- 0x43,
- 0x56,
- 0x42,
- 0x4E,
- 0x4D,
- 0x2C,
- 0x2E,
- 0x2F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0x0D
- },
- { /* shifted */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x21,
- 0x40,
- 0x23,
- 0x24,
- 0x25,
- 0x5E,
- 0x26,
- 0x2A,
- 0x28,
- 0x29,
- 0x5F,
- 0x3D,
- 0x22,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x51,
- 0x57,
- 0x45,
- 0x52,
- 0x54,
- 0x59,
- 0x55,
- 0x49,
- 0x4F,
- 0x50,
- 0x5D,
- 0x8A, /* 945423-9701 rev. B says 0x88, but it must be a mistake */
- 0x8C, /* 945423-9701 rev. B says 0x87, but it must be a mistake */
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x41,
- 0x53,
- 0x44,
- 0x46,
- 0x47,
- 0x48,
- 0x4A,
- 0x4B,
- 0x4C,
- 0x5B,
- 0x5C,
- 0x3A,
- 0x83,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x5A,
- 0x58,
- 0x43,
- 0x56,
- 0x42,
- 0x4E,
- 0x4D,
- 0x3C,
- 0x3E,
- 0x3F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0x0D
- },
- { /* control */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x90,
- 0x91,
- 0x00,
- 0xA1,
- 0x8D,
- 0x8E,
- 0x8F,
- 0x00,
- 0x60,
- 0x00,
- 0x1D,
- 0x7F,
- 0x00,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x11,
- 0x17,
- 0x05,
- 0x12,
- 0x14,
- 0x19,
- 0x15,
- 0x09,
- 0x0F,
- 0x10,
- 0x00,
- 0x88, /* 945423-9701 rev. B says 0x8A, but it must be a mistake */
- 0x87, /* 945423-9701 rev. B says 0x8C, but it must be a mistake */
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x01,
- 0x13,
- 0x04,
- 0x06,
- 0x07,
- 0x08,
- 0x0A,
- 0x0B,
- 0x0C,
- 0x00,
- 0x00,
- 0x00,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x1A,
- 0x18,
- 0x03,
- 0x16,
- 0x02,
- 0x0E,
- 0x0D,
- 0x1C,
- 0x1E,
- 0x1F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0x0D
- }
-};
-
-
-/*
- key translation table for Japanese katakana terminals
-*/
-static const unsigned char Japanese_key_translate[6][91] =
-{
- { /* lower case */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x31,
- 0x32,
- 0x33,
- 0x34,
- 0x35,
- 0x36,
- 0x37,
- 0x38,
- 0x39,
- 0x30,
- 0x2B,
- 0x2D,
- 0x5F,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x71,
- 0x77,
- 0x65,
- 0x72,
- 0x74,
- 0x79,
- 0x75,
- 0x69,
- 0x6F,
- 0x70,
- 0x88,
- 0x87,
- 0x0D,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x61,
- 0x73,
- 0x64,
- 0x66,
- 0x67,
- 0x68,
- 0x6A,
- 0x6B,
- 0x6C,
- 0x3B,
- 0x27,
- 0x5C,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x7A,
- 0x78,
- 0x63,
- 0x76,
- 0x62,
- 0x6E,
- 0x6D,
- 0x2C,
- 0x2E,
- 0x2F,
- 0,
-
- 0x30,
- 0x2E,
-
- 0,
- 0x20,
- 0
- },
- { /* upper case */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x31,
- 0x32,
- 0x33,
- 0x34,
- 0x35,
- 0x36,
- 0x37,
- 0x38,
- 0x39,
- 0x30,
- 0x2B,
- 0x2D,
- 0x5F,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x51,
- 0x57,
- 0x45,
- 0x52,
- 0x54,
- 0x59,
- 0x55,
- 0x49,
- 0x4F,
- 0x50,
- 0x88,
- 0x87,
- 0x0D,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x41,
- 0x53,
- 0x44,
- 0x46,
- 0x47,
- 0x48,
- 0x4A,
- 0x4B,
- 0x4C,
- 0x3B,
- 0x27,
- 0x5C,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x5A,
- 0x58,
- 0x43,
- 0x56,
- 0x42,
- 0x4E,
- 0x4D,
- 0x2C,
- 0x2E,
- 0x2F,
- 0,
-
- 0x30,
- 0x2E,
-
- 0,
- 0x20,
- 0
- },
- { /* shifted */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x21,
- 0x40,
- 0x23,
- 0x24,
- 0x25,
- 0x5E,
- 0x26,
- 0x2A,
- 0x28,
- 0x29,
- 0x5B,
- 0x5D,
- 0x3D,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x51,
- 0x57,
- 0x45,
- 0x52,
- 0x54,
- 0x59,
- 0x55,
- 0x49,
- 0x4F,
- 0x50,
- 0x8A,
- 0x8C,
- 0x0D,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x41,
- 0x53,
- 0x44,
- 0x46,
- 0x47,
- 0x48,
- 0x4A,
- 0x4B,
- 0x4C,
- 0x3A,
- 0x22,
- 0x00,
- 0x83,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x5A,
- 0x58,
- 0x43,
- 0x56,
- 0x42,
- 0x4E,
- 0x4D,
- 0x3C,
- 0x3E,
- 0x3F,
- 0,
-
- 0x30,
- 0x2E,
-
- 0,
- 0x20,
- 0
- },
- { /* control */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x90,
- 0x91,
- 0x00,
- 0xA1,
- 0x8D,
- 0x8E,
- 0x8F,
- 0x7C,
- 0x60,
- 0x7E,
- 0x1D,
- 0x7F,
- 0x5C, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays the back quote character, whereas it actually display the Yen symbol) */
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x11,
- 0x17,
- 0x05,
- 0x12,
- 0x14,
- 0x19,
- 0x15,
- 0x09,
- 0x0F,
- 0x10,
- 0x88,
- 0x87,
- 0x0D,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x01,
- 0x13,
- 0x04,
- 0x06,
- 0x07,
- 0x08,
- 0x0A,
- 0x0B,
- 0x0C,
- 0x7B,
- 0x7D,
- 0x00,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x1A,
- 0x18,
- 0x03,
- 0x16,
- 0x02,
- 0x0E,
- 0x0D,
- 0x1C,
- 0x1E,
- 0x1F,
- 0,
-
- 0x30,
- 0x2E,
-
- 0,
- 0x20,
- 0
- },
- { /* katakana */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0xC7,
- 0xCC,
- 0xB1,
- 0xB3,
- 0xB4,
- 0xB5,
- 0xD4,
- 0xD5,
- 0xD6,
- 0xDC,
- 0xCE,
- 0xCD,
- 0xDB,
- 0x1B, /* 945423-9701 rev. B says 0x00, but it must be a mistake */
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0xC0,
- 0xC3,
- 0xB2,
- 0xBD,
- 0xB6,
- 0xDD,
- 0xC5,
- 0xC6,
- 0xD7,
- 0xBE,
- 0x88, /* 945423-9701 rev. B says 0x00, but it must be a mistake */
- 0x87, /* 945423-9701 rev. B says 0x00, but it must be a mistake */
- 0x0D, /* 945423-9701 rev. B says 0x00, but it must be a mistake */
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0xC1,
- 0xC4,
- 0xBC,
- 0xCA,
- 0xB7,
- 0xB8,
- 0xCF,
- 0xC9,
- 0xD8, /* 945423-9701 rev. B says 0xC8, but it must be a mistake */
- 0xDA,
- 0xB9,
- 0xD1,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0xC2,
- 0xBB,
- 0xBF,
- 0xCB,
- 0xBA,
- 0xD0,
- 0xD3,
- 0xC8,
- 0xD9,
- 0xD2,
- 0,
-
- 0x30,
- 0x2E,
-
- 0,
- 0x20,
- 0
- },
- { /* shifted katakana */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x00,
- 0x00,
- 0xA7,
- 0xA9,
- 0xAA,
- 0xAB,
- 0xAC,
- 0xAD,
- 0xAE,
- 0xA6,
- 0xDE,
- 0xDF,
- 0xB0,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x00,
- 0x00,
- 0xAB,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x8A,
- 0x8C,
- 0x0D,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0xA2,
- 0xA3,
- 0x83,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0xAF,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0xA4,
- 0xA1,
- 0xA5,
- 0,
-
- 0x30,
- 0x2E,
-
- 0,
- 0x20,
- 0
- }
-};
-
-
-#if 0
-/*
- key translation table for Arabic terminals
-*/
-static const unsigned char Arabic_key_translate[6][91] =
-{
- { /* lower case */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x31,
- 0x32,
- 0x33,
- 0x34,
- 0x35,
- 0x36,
- 0x37,
- 0x38,
- 0x39,
- 0x30,
- 0x2B,
- 0x2D,
- 0x5F,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x71,
- 0x77,
- 0x65,
- 0x72,
- 0x74,
- 0x79,
- 0x75,
- 0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- 0x05,
- 0x12,
- 0x14,
- 0x19,
- 0x15,
- 0x09,
- 0x0F,
- 0x10,
- 0x88,
- 0x87,
- 0x0D,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x01,
- 0x13,
- 0x04,
- 0x06,
- 0x07,
- 0x08,
- 0x0A,
- 0x0B,
- 0x0C,
- 0x7B,
- 0x7D,
- 0x00,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x1A,
- 0x18,
- 0x03,
- 0x16,
- 0x02,
- 0x0E,
- 0x0D,
- 0x1C,
- 0x1E,
- 0x1F,
- 0,
-
- 0x30,
- 0x2E,
-
- 0,
- 0x20,
- 0
- },
- { /* arabic */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0xC7,
- 0xCC,
- 0xB1,
- 0xB3,
- 0xB4,
- 0xB5,
- 0xD4,
- 0xD5,
- 0xD6,
- 0xDC,
- 0xCE,
- 0xCD,
- 0xDB,
- 0x1B,
-
- 0x37, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x38, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x39, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0xC0,
- 0xC3,
- 0xB2,
- 0xBD,
- 0xB6,
- 0xDD,
- 0xC5,
- 0xC6,
- 0xD7,
- 0xBE,
- 0x88,
- 0x87,
- 0x0D,
-
- 0x34, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x35, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x36, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0xC1,
- 0xC4,
- 0xBC,
- 0xCA,
- 0xB7,
- 0xB8,
- 0xCF,
- 0xC9,
- 0xD8,
- 0xDA,
- 0xB9,
- 0xD1,
- 0x85,
-
- 0x31, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x32, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x33, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0xC2,
- 0xBB,
- 0xBF,
- 0xCB,
- 0xBA,
- 0xD0,
- 0xD3,
- 0xC8,
- 0xD9,
- 0xD2,
- 0,
-
- 0x30, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x2E,
-
- 0,
- 0x20,
- 0
- },
- { /* shifted arabic */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x00,
- 0x00,
- 0xA7,
- 0xA9,
- 0xAA,
- 0xAB,
- 0xAC,
- 0xAD,
- 0xAE,
- 0xA6,
- 0xDE,
- 0xDF,
- 0xB0,
- 0x1B,
-
- 0x37, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x38, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x39, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x00,
- 0x00,
- 0xAB,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x8A,
- 0x8C,
- 0x0D,
-
- 0x34, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x35, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x36, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0xA2,
- 0xA3,
- 0x83,
-
- 0x31, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x32, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x33, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0xAF,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0xA4,
- 0xA1,
- 0xA5,
- 0,
-
- 0x30, /* 945423-9701 rev. B says so, but it might be a mistake (it claims it displays arabic-style digits, whereas it actually displays western-style digits) */
- 0x2E,
-
- 0,
- 0x20,
- 0
- }
-};
-#endif
-
-
-/*
- key translation table for French word-processing terminals
-*/
-static const unsigned char FrenchWP_key_translate[4][91] =
-{
- { /* lower case */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,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0x51,
- 0x53,
- 0x44,
- 0x46,
- 0x47,
- 0x48,
- 0x4A,
- 0x4B,
- 0x4C,
- 0x4D,
- 0x25,
- 0x60,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x57,
- 0x58,
- 0x43,
- 0x56,
- 0x42,
- 0x4E,
- 0x3F,
- 0x2E,
- 0x2F,
- 0x2B,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0
- },
- { /* shifted */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x31,
- 0x32,
- 0x33,
- 0x34,
- 0x35,
- 0x36,
- 0x37,
- 0x38,
- 0x39,
- 0x30,
- 0x5B,
- 0x5F,
- 0x23,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x41,
- 0x5A,
- 0x45,
- 0x52,
- 0x54,
- 0x59,
- 0x55,
- 0x49,
- 0x4F,
- 0x50,
- 0x7E,
- 0x8C,
- 0x0D,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x51,
- 0x53,
- 0x44,
- 0x46,
- 0x47,
- 0x48,
- 0x4A,
- 0x4B,
- 0x4C,
- 0x4D,
- 0x25,
- 0x60,
- 0x83,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x57,
- 0x58,
- 0x43,
- 0x56,
- 0x42,
- 0x4E,
- 0x3F,
- 0x2E,
- 0x2F,
- 0x2B,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0
- },
- { /* control */
- 0x92,
- 0x93,
- 0x94,
- 0x95,
- 0x96,
- 0x97,
- 0x98,
- 0x99,
- 0x9B,
- 0x9C,
-
-
- 0x80,
- 0x81,
- 0x9F,
-
- 0,
- 0x90,
- 0x91,
- 0x00,
- 0xA1,
- 0x8D,
- 0x8E,
- 0x8F,
- 0x3C,
- 0x3E,
- 0x00,
- 0x1D,
- 0x7F,
- 0x00,
- 0x1B,
-
- 0x37,
- 0x38,
- 0x39,
-
-
- 0x9A,
- 0x89,
- 0,
-
- 0xA0,
- 0x01,
- 0x1A,
- 0x05,
- 0x12,
- 0x14,
- 0x19,
- 0x15,
- 0x09,
- 0x0F,
- 0x10,
- 0x00,
- 0x87,
- 0x0D,
-
- 0x34,
- 0x35,
- 0x36,
-
-
- 0x88,
- 0x82,
- 0x8A,
-
- 0,
- 0x11,
- 0x13,
- 0x04,
- 0x06,
- 0x07,
- 0x08,
- 0x0A,
- 0x0B,
- 0x0C,
- 0x0D,
- 0x00,
- 0x00,
- 0x85,
-
- 0x31,
- 0x32,
- 0x33,
-
-
- 0x86,
- 0x8B,
- 0x84,
-
- 0,
- 0x17,
- 0x18,
- 0x03,
- 0x16,
- 0x02,
- 0x0E,
- 0x00,
- 0x1C,
- 0x1E,
- 0x1F,
- 0,
-
- 0x30,
- 0x2C,
-
- 0,
- 0x20,
- 0
- }
-};
diff --git a/src/mess/video/911_vdt.c b/src/mess/video/911_vdt.c
deleted file mode 100644
index c0d30600681..00000000000
--- a/src/mess/video/911_vdt.c
+++ /dev/null
@@ -1,844 +0,0 @@
-// license:GPL-2.0+
-// copyright-holders:Raphael Nabet
-/*
- TI 911 VDT core. To be operated with the TI 990 line of computers (can be connected to
- any model, as communication uses the CRU bus).
-
- Raphael Nabet 2002
-
-TODO:
- * add more flexibility, so that we can create multiple-terminal configurations.
- * support test mode???
-*/
-
-
-#include "emu.h"
-#include "911_vdt.h"
-#include "911_chr.h"
-#include "911_key.h"
-
-#define MAX_VDT 1
-
-static const gfx_layout fontlayout_7bit =
-{
- 7, 10, /* 7*10 characters */
- 128, /* 128 characters */
- 1, /* 1 bit per pixel */
- { 0 },
- { 1, 2, 3, 4, 5, 6, 7 }, /* straightforward layout */
- { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8 },
- 10*8 /* every char takes 10 consecutive bytes */
-};
-
-static const gfx_layout fontlayout_8bit =
-{
- 7, 10, /* 7*10 characters */
- 128, /* 128 characters */
- 1, /* 1 bit per pixel */
- { 0 },
- { 1, 2, 3, 4, 5, 6, 7 }, /* straightforward layout */
- { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8 },
- 10*8 /* every char takes 10 consecutive bytes */
-};
-
-static GFXDECODE_START( vdt911 )
- // Caution: Array must use same order as vdt911_model_t
- // US
- GFXDECODE_ENTRY( vdt911_chr_region, vdt911_US_chr_offset, fontlayout_7bit, 0, 4 )
-
- // UK
- GFXDECODE_ENTRY( vdt911_chr_region, vdt911_UK_chr_offset, fontlayout_7bit, 0, 4 )
-
- // French (without accented characters)
- GFXDECODE_ENTRY( vdt911_chr_region, vdt911_US_chr_offset, fontlayout_7bit, 0, 4 )
-
- // German
- GFXDECODE_ENTRY( vdt911_chr_region, vdt911_german_chr_offset, fontlayout_7bit, 0, 4 )
-
- // Swedish
- GFXDECODE_ENTRY( vdt911_chr_region, vdt911_swedish_chr_offset, fontlayout_7bit, 0, 4 )
-
- // Norwegian
- GFXDECODE_ENTRY( vdt911_chr_region, vdt911_norwegian_chr_offset, fontlayout_7bit, 0, 4 )
-
- // Japanese
- GFXDECODE_ENTRY( vdt911_chr_region, vdt911_japanese_chr_offset, fontlayout_8bit, 0, 4 )
-
- // Arabic
- // GFXDECODE_ENTRY( vdt911_chr_region, vdt911_arabic_chr_offset, fontlayout_8bit, 0, 4 )
-
- // FrenchWP (contains accented characters)
- GFXDECODE_ENTRY( vdt911_chr_region, vdt911_frenchWP_chr_offset, fontlayout_7bit, 0, 4 )
-GFXDECODE_END
-
-static const unsigned char vdt911_colors[] =
-{
- 0x00,0x00,0x00, /* black */
- 0xC0,0xC0,0xC0, /* low intensity */
- 0xFF,0xFF,0xFF /* high intensity */
-};
-
-static const unsigned short vdt911_palette[] =
-{
- 0, 2, /* high intensity */
- 0, 1, /* low intensity */
- 2, 0, /* high intensity, reverse */
- 2, 1 /* low intensity, reverse */
-};
-
-/*
- Macros for model features
-*/
-/* TRUE for Japanese and Arabic terminals, which use 8-bit charcodes and keyboard shift modes */
-#define USES_8BIT_CHARCODES() ((m_model == vdt911_model_Japanese) /*|| (m_model == vdt911_model_Arabic)*/)
-/* TRUE for keyboards which have this extra key (on the left of TAB/SKIP)
- (Most localized keyboards have it) */
-#define HAS_EXTRA_KEY_67() (! ((m_model == vdt911_model_US) || (m_model == vdt911_model_UK) || (m_model == vdt911_model_French)))
-/* TRUE for keyboards which have this extra key (on the right of space),
- AND do not use it as a modifier */
-#define HAS_EXTRA_KEY_91() ((m_model == vdt911_model_German) || (m_model == vdt911_model_Swedish) || (m_model == vdt911_model_Norwegian))
-
-/*
- Initialize vdt911 palette
-*/
-PALETTE_INIT_MEMBER(vdt911_device, vdt911)
-{
- UINT8 i, r, g, b;
-
- for ( i = 0; i < 3; i++ )
- {
- r = vdt911_colors[i*3]; g = vdt911_colors[i*3+1]; b = vdt911_colors[i*3+2];
- palette.set_indirect_color(i, rgb_t(r, g, b));
- }
-
- for(i=0;i<8;i++)
- palette.set_pen_indirect(i, vdt911_palette[i]);
-}
-
-/*
- Copy a character bitmap array to another location in memory
-*/
-static void copy_character_matrix_array(const UINT8 char_array[128][10], UINT8 *dest)
-{
- int i, j;
-
- for (i=0; i<128; i++)
- for (j=0; j<10; j++)
- *(dest++) = char_array[i][j];
-}
-
-/*
- Patch a character bitmap array according to an array of char_override_t
-*/
-static void apply_char_overrides(int nb_char_overrides, const char_override_t char_overrides[], UINT8 *dest)
-{
- int i, j;
-
- for (i=0; i<nb_char_overrides; i++)
- {
- for (j=0; j<10; j++)
- dest[char_overrides[i].char_index*10+j] = char_defs[char_overrides[i].symbol_index][j];
- }
-}
-
-const device_type VDT911 = &device_creator<vdt911_device>;
-
-vdt911_device::vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, VDT911, "911 VDT", tag, owner, clock, "vdt911", __FILE__),
- m_beeper(*this, "beeper"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette"),
- m_keyint_line(*this),
- m_lineint_line(*this)
-{
-}
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void vdt911_device::device_config_complete()
-{
-}
-
-enum
-{
- BLINK_TIMER,
- BEEP_TIMER,
- LINE_TIMER
-};
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void vdt911_device::device_start()
-{
- m_last_key_pressed = 0x80;
-
- m_keyboard_data_ready = false;
- m_display_enable = false;
- m_blink_state = false;
-
- m_keyint_line.resolve();
- m_lineint_line.resolve();
-
- /* set up cursor blink clock. 2Hz frequency -> .25s half-period. */
- /*m_blink_clock =*/
-
- // m_beeper->set_frequency(2000);
-
- m_blink_timer = timer_alloc(BLINK_TIMER);
- m_beep_timer = timer_alloc(BEEP_TIMER);
- m_line_timer = timer_alloc(LINE_TIMER);
-
- m_blink_timer->adjust(attotime::from_msec(0), 0, attotime::from_msec(250));
-
- UINT8 *base;
- UINT8 *chr = machine().root_device().memregion(vdt911_chr_region)->base();
-
- /* set up US character definitions */
- base = chr+vdt911_US_chr_offset;
- copy_character_matrix_array(char_defs+char_defs_US_base, base);
-
- /* set up UK character definitions */
- base = chr+vdt911_UK_chr_offset;
- copy_character_matrix_array(char_defs+char_defs_US_base, base);
- apply_char_overrides(sizeof(UK_overrides)/sizeof(char_override_t), UK_overrides, base);
-
- /* French character set is identical to US character set */
-
- /* set up German character definitions */
- base = chr+vdt911_german_chr_offset;
- copy_character_matrix_array(char_defs+char_defs_US_base, base);
- apply_char_overrides(sizeof(german_overrides)/sizeof(char_override_t), german_overrides, base);
-
- /* set up Swedish/Finnish character definitions */
- base = chr+vdt911_swedish_chr_offset;
- copy_character_matrix_array(char_defs+char_defs_US_base, base);
- apply_char_overrides(sizeof(swedish_overrides)/sizeof(char_override_t), swedish_overrides, base);
-
- /* set up Norwegian/Danish character definitions */
- base = chr+vdt911_norwegian_chr_offset;
- copy_character_matrix_array(char_defs+char_defs_US_base, base);
- apply_char_overrides(sizeof(norwegian_overrides)/sizeof(char_override_t), norwegian_overrides, base);
-
- /* set up French word processing character definitions */
- base = chr+vdt911_frenchWP_chr_offset;
- copy_character_matrix_array(char_defs+char_defs_US_base, base);
- apply_char_overrides(sizeof(frenchWP_overrides)/sizeof(char_override_t), frenchWP_overrides, base);
-
- /* set up Katakana Japanese character definitions */
- base = chr+vdt911_japanese_chr_offset;
- copy_character_matrix_array(char_defs+char_defs_US_base, base);
- apply_char_overrides(sizeof(japanese_overrides)/sizeof(char_override_t), japanese_overrides, base);
- base = chr+vdt911_japanese_chr_offset+128*vdt911_single_char_len;
- copy_character_matrix_array(char_defs+char_defs_katakana_base, base);
-
-#if 0
- /* set up Arabic character definitions */
- base = chr+vdt911_arabic_chr_offset;
- copy_character_matrix_array(char_defs+char_defs_US_base, base);
- apply_char_overrides(sizeof(arabic_overrides)/sizeof(char_override_t), arabic_overrides, base);
- base = chr+vdt911_arabic_chr_offset+128*vdt911_single_char_len;
- copy_character_matrix_array(char_defs+char_defs_arabic_base, base);
-#endif
-}
-
-
-void vdt911_device::device_reset()
-{
- m_model = (vdt911_model_t)ioport("LOCALE")->read();
- m_screen_size = (vdt911_screen_size_t)ioport("SCREEN")->read();
-
- if (m_screen_size == char_960)
- m_cursor_address_mask = 0x3ff; /* 1kb of RAM */
- else
- m_cursor_address_mask = 0x7ff; /* 2 kb of RAM */
-
- m_line_timer->adjust(attotime::from_msec(0), 0, attotime::from_hz(get_refresh_rate()));
-}
-
-/*
- Timer callbacks
-*/
-void vdt911_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- switch (id)
- {
- case BLINK_TIMER:
- m_blink_state = !m_blink_state;
- break;
- case BEEP_TIMER:
- m_beeper->set_state(0);
- break;
- case LINE_TIMER:
- check_keyboard();
- m_lineint_line(ASSERT_LINE);
- m_lineint_line(CLEAR_LINE);
- break;
- }
-}
-
-/*
- CRU interface read
-*/
-READ8_MEMBER( vdt911_device::cru_r )
-{
- int reply=0;
-
- offset &= 0x1;
-
- if (!m_word_select)
- { /* select word 0 */
- switch (offset)
- {
- case 0:
- reply = m_display_RAM[m_cursor_address];
- break;
-
- case 1:
- reply = m_keyboard_data & 0x7f;
- if (m_keyboard_data_ready)
- reply |= 0x80;
- break;
- }
- }
- else
- { /* select word 1 */
- switch (offset)
- {
- case 0:
- reply = m_cursor_address & 0xff;
- break;
-
- case 1:
- reply = (m_cursor_address >> 8) & 0x07;
- if (m_keyboard_data & 0x80)
- reply |= 0x08;
- /*if (!m_terminal_ready)
- reply |= 0x10;*/
- if (m_previous_word_select)
- reply |= 0x20;
- /*if (m_keyboard_parity_error)
- reply |= 0x40;*/
- if (m_keyboard_data_ready)
- reply |= 0x80;
- break;
- }
- }
-
- return reply;
-}
-
-/*
- CRU interface write
-*/
-WRITE8_MEMBER( vdt911_device::cru_w )
-{
- offset &= 0xf;
-
- if (!m_word_select)
- { /* select word 0 */
- switch (offset)
- {
- case 0x0:
- case 0x1:
- case 0x2:
- case 0x3:
- case 0x4:
- case 0x5:
- case 0x6:
- case 0x7:
- /* display memory write data */
- if (data)
- m_data_reg |= (1 << offset);
- else
- m_data_reg &= ~ (1 << offset);
- break;
-
- case 0x8:
- /* write data strobe */
- m_display_RAM[m_cursor_address] = m_data_reg;
- break;
-
- case 0x9:
- /* test mode */
- /* ... */
- break;
-
- case 0xa:
- /* cursor move */
- if (data)
- m_cursor_address--;
- else
- m_cursor_address++;
- m_cursor_address &= m_cursor_address_mask;
- break;
-
- case 0xb:
- /* blinking cursor enable */
- m_blinking_cursor_enable = data;
- break;
-
- case 0xc:
- /* keyboard interrupt enable */
- m_keyboard_interrupt_enable = data;
- m_keyint_line(m_keyboard_interrupt_enable && m_keyboard_data_ready);
- break;
-
- case 0xd:
- /* dual intensity enable */
- m_dual_intensity_enable = data;
- break;
-
- case 0xe:
- /* display enable */
- m_display_enable = data;
- break;
-
- case 0xf:
- /* select word */
- m_previous_word_select = m_word_select;
- m_word_select = data;
- break;
- }
- }
- else
- { /* select word 1 */
- switch (offset)
- {
- case 0x0:
- case 0x1:
- case 0x2:
- case 0x3:
- case 0x4:
- case 0x5:
- case 0x6:
- case 0x7:
- case 0x8:
- case 0x9:
- case 0xa:
- /* cursor address */
- if (data)
- m_cursor_address |= (1 << offset);
- else
- m_cursor_address &= ~ (1 << offset);
- m_cursor_address &= m_cursor_address_mask;
- break;
-
- case 0xb:
- /* not used */
- break;
-
- case 0xc:
- /* display cursor */
- m_display_cursor = data;
- break;
-
- case 0xd:
- /* keyboard acknowledge */
- if (m_keyboard_data_ready)
- {
- m_keyboard_data_ready = 0;
- if (m_keyboard_interrupt_enable)
- m_keyint_line(CLEAR_LINE);
- }
- /*m_keyboard_parity_error = 0;*/
- break;
-
- case 0xe:
- /* beep enable strobe - not tested */
- m_beeper->set_state(1);
- m_beep_timer->adjust(attotime::from_usec(300));
- break;
-
- case 0xf:
- /* select word */
- m_previous_word_select = m_word_select;
- m_word_select = data;
- break;
- }
- }
-}
-
-/*
- Video refresh
-*/
-void vdt911_device::refresh(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y)
-{
- gfx_element *gfx = m_gfxdecode->gfx(m_model);
- int height = (m_screen_size == char_960) ? 12 : /*25*/24;
-
- int use_8bit_charcodes = USES_8BIT_CHARCODES();
- int address = 0;
- int i, j;
- int cur_char;
- int color;
-
- /*if (use_8bit_charcodes)
- color = vdt->dual_intensity_enable ? 1 : 0;*/
-
- if (!m_display_enable)
- {
- rectangle my_rect(x, x + 80*7 - 1, y, y + height*10 - 1);
-
- bitmap.fill(0, my_rect);
- }
- else
- {
- for (i=0; i<height; i++)
- {
- for (j=0; j<80; j++)
- {
- cur_char = m_display_RAM[address];
- /* does dual intensity work with 8-bit character set? */
- color = (m_dual_intensity_enable && (cur_char & 0x80)) ? 1 : 0;
- if (!use_8bit_charcodes)
- cur_char &= 0x7f;
-
- /* display cursor in reverse video */
- if ((address == m_cursor_address) && m_display_cursor
- && ((!m_blinking_cursor_enable) || m_blink_state))
- color += 2;
-
- address++;
-
- gfx->opaque(bitmap, cliprect, cur_char, color, 0, 0,
- x+j*7, y+i*10);
- }
- }
- }
-}
-
-static const unsigned char (*const key_translate[])[91] =
-{ /* array must use same order as vdt911_model_t!!! */
- /* US */
- US_key_translate,
- /* UK */
- US_key_translate,
- /* French */
- French_key_translate,
- /* German */
- German_key_translate,
- /* Swedish */
- Swedish_key_translate,
- /* Norwegian */
- Norwegian_key_translate,
- /* Japanese */
- Japanese_key_translate,
- /* Arabic */
- /*Arabic_key_translate,*/
- /* FrenchWP */
- FrenchWP_key_translate
-};
-
-/*
- keyboard handler: should be called regularly by machine code, for instance
- every Video Blank Interrupt.
-*/
-void vdt911_device::check_keyboard()
-{
- enum modifier_state_t
- {
- /* states for Western keyboards and katakana/Arabic keyboards in romaji/Latin mode */
- lower_case = 0, upper_case, shift, control,
- /* states for katakana/Arabic keyboards in katakana/Arabic mode */
- foreign, foreign_shift,
- /* special value to stop repeat if the modifier state changes */
- special_debounce = -1
- };
-
- static unsigned char repeat_timer;
- enum { repeat_delay = 5 /* approx. 1/10s */ };
-
- UINT16 key_buf[6];
- int i, j;
- modifier_state_t modifier_state;
- int repeat_mode;
-
- static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
-
- /* read current key state */
- for (i = 0; i < 6; i++)
- {
- key_buf[i] = ioport(keynames[i])->read();
- }
-
- /* parse modifier keys */
- if ((USES_8BIT_CHARCODES())
- && ((key_buf[5] & 0x0400) || ((!(key_buf[5] & 0x0100)) && m_foreign_mode)))
- { /* we are in katakana/Arabic mode */
- m_foreign_mode = true;
-
- if ((key_buf[4] & 0x0400) || (key_buf[5] & 0x0020))
- modifier_state = foreign_shift;
- else
- modifier_state = foreign;
- }
- else
- { /* we are using a Western keyboard, or a katakana/Arabic keyboard in
- romaji/Latin mode */
- m_foreign_mode = false;
-
- if (key_buf[3] & 0x0040)
- modifier_state = control;
- else if ((key_buf[4] & 0x0400) || (key_buf[5] & 0x0020))
- modifier_state = shift;
- else if ((key_buf[0] & 0x2000))
- modifier_state = upper_case;
- else
- modifier_state = lower_case;
- }
-
-
- /* test repeat key */
- repeat_mode = key_buf[2] & 0x0002;
-
-
- /* remove modifier keys */
- key_buf[0] &= ~0x2000;
- key_buf[2] &= ~0x0002;
- key_buf[3] &= ~0x0040;
- key_buf[4] &= ~0x0400;
- key_buf[5] &= ~0x0120;
-
- /* remove unused keys */
- if (! HAS_EXTRA_KEY_91())
- key_buf[5] &= ~0x0400;
-
- if (! HAS_EXTRA_KEY_67())
- key_buf[4] &= ~0x0004;
-
-
- if (! repeat_mode)
- /* reset REPEAT timer if the REPEAT key is not pressed */
- repeat_timer = 0;
-
- if (!(m_last_key_pressed & 0x80) && (key_buf[m_last_key_pressed >> 4] & (1 << (m_last_key_pressed & 0xf))))
- {
- /* last key has not been released */
- if (modifier_state == m_last_modifier_state)
- {
- /* handle REPEAT mode if applicable */
- if ((repeat_mode) && (++repeat_timer == repeat_delay))
- {
- if (m_keyboard_data_ready)
- { /* keyboard buffer full */
- repeat_timer--;
- }
- else
- { /* repeat current key */
- m_keyboard_data_ready = 1;
- repeat_timer = 0;
- }
- }
- }
- else
- {
- repeat_timer = 0;
- m_last_modifier_state = special_debounce;
- }
- }
- else
- {
- m_last_key_pressed = 0x80;
-
- if (m_keyboard_data_ready)
- { /* keyboard buffer full */
- /* do nothing */
- }
- else
- {
- for (i=0; i<6; i++)
- {
- for (j=0; j<16; j++)
- {
- if (key_buf[i] & (1 << j))
- {
- m_last_key_pressed = (i << 4) | j;
- m_last_modifier_state = modifier_state;
-
- m_keyboard_data = (int)key_translate[m_model][modifier_state][m_last_key_pressed];
- m_keyboard_data_ready = 1;
- if (m_keyboard_interrupt_enable)
- m_keyint_line(ASSERT_LINE);
- return;
- }
- }
- }
- }
- }
-}
-
-int vdt911_device::get_refresh_rate()
-{
- // European models have 50 Hz
- return ((m_model == vdt911_model_US) || (m_model == vdt911_model_Japanese))? 60 : 50;
-}
-
-UINT32 vdt911_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- refresh(bitmap, cliprect, 0, 0);
- return 0;
-}
-
-INPUT_PORTS_START( vdt911 )
- PORT_START( "LOCALE" )
- PORT_CONFNAME( 0x0f, 0x00, "Terminal language" )
- PORT_CONFSETTING( vdt911_model_US, "English US" )
- PORT_CONFSETTING( vdt911_model_UK, "English UK" )
- PORT_CONFSETTING( vdt911_model_French, "French" )
- PORT_CONFSETTING( vdt911_model_German, "German" )
- PORT_CONFSETTING( vdt911_model_Swedish, "Swedish" )
- PORT_CONFSETTING( vdt911_model_Norwegian, "Norwegian" )
- PORT_CONFSETTING( vdt911_model_Japanese, "Japanese" )
- // PORT_CONFSETTING( vdt911_model_Arabic, "Arabic" )
- PORT_CONFSETTING( vdt911_model_FrenchWP, "French Word Processing" )
-
- PORT_START( "SCREEN" )
- PORT_CONFNAME( 0x01, char_960, "Terminal screen size" )
- PORT_CONFSETTING( char_960, "960 chars (12 lines)")
- PORT_CONFSETTING( char_1920, "1920 chars (24 lines)")
-
- PORT_START("KEY0") /* keys 1-16 */ \
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) \
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) \
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) \
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) \
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) \
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) \
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) \
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F8") PORT_CODE(KEYCODE_F8) \
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CMD") PORT_CODE(KEYCODE_F9) \
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(red)") PORT_CODE(KEYCODE_F10) \
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ERASE FIELD") PORT_CODE(KEYCODE_END) \
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ERASE INPUT") PORT_CODE(KEYCODE_PGDN) \
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(grey)") PORT_CODE(KEYCODE_F11) \
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("UPPER CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE\
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1 !") PORT_CODE(KEYCODE_1) \
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2 @") PORT_CODE(KEYCODE_2) \
- \
- PORT_START("KEY1") /* keys 17-32 */ \
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3 #") PORT_CODE(KEYCODE_3) \
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) \
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5 %") PORT_CODE(KEYCODE_5) \
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6 ^") PORT_CODE(KEYCODE_6) \
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7 &") PORT_CODE(KEYCODE_7) \
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8 *") PORT_CODE(KEYCODE_8) \
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9 (") PORT_CODE(KEYCODE_9) \
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0 )") PORT_CODE(KEYCODE_0) \
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("+ [") PORT_CODE(KEYCODE_MINUS) \
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("- ]") PORT_CODE(KEYCODE_EQUALS) \
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("_ =") PORT_CODE(KEYCODE_BACKSPACE) \
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) \
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7 (numpad)") PORT_CODE(KEYCODE_7_PAD) \
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8 (numpad)") PORT_CODE(KEYCODE_8_PAD) \
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9 (numpad)") PORT_CODE(KEYCODE_9_PAD) \
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("PRINT") PORT_CODE(KEYCODE_PRTSCR) \
- \
- PORT_START("KEY2") /* keys 33-48 */ \
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(up)") PORT_CODE(KEYCODE_UP) \
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("REPEAT") PORT_CODE(KEYCODE_LALT) \
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER_PAD) \
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) \
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) \
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) \
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) \
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) \
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) \
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) \
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) \
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) \
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) \
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CHAR (left/right)") PORT_CODE(KEYCODE_OPENBRACE) \
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("FIELD (left/right)") PORT_CODE(KEYCODE_CLOSEBRACE) \
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) \
- \
- PORT_START("KEY3") /* keys 49-64 */ \
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4 (numpad)") PORT_CODE(KEYCODE_4_PAD) \
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5 (numpad)") PORT_CODE(KEYCODE_5_PAD) \
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6 (numpad)") PORT_CODE(KEYCODE_6_PAD) \
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(left)") PORT_CODE(KEYCODE_LEFT) \
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("HOME") PORT_CODE(KEYCODE_HOME) \
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(right)") PORT_CODE(KEYCODE_RIGHT) \
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CONTROL") PORT_CODE(KEYCODE_LCONTROL) \
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) \
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) \
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) \
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) \
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) \
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) \
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) \
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) \
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) \
- \
- PORT_START("KEY4") /* keys 65-80 */ \
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("; :") PORT_CODE(KEYCODE_COLON) \
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("' \"") PORT_CODE(KEYCODE_QUOTE) \
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(not on US keyboard)") PORT_CODE(KEYCODE_BACKSLASH) \
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SKIP TAB") PORT_CODE(KEYCODE_TAB) \
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1 (numpad)") PORT_CODE(KEYCODE_1_PAD) \
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2 (numpad)") PORT_CODE(KEYCODE_2_PAD) \
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3 (numpad)") PORT_CODE(KEYCODE_3_PAD) \
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("INS CHAR") PORT_CODE(KEYCODE_INSERT) \
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(down)") PORT_CODE(KEYCODE_DOWN) \
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DEL CHAR") PORT_CODE(KEYCODE_DEL) \
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) \
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) \
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) \
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) \
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) \
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) \
- \
- PORT_START("KEY5") /* keys 81-91 */ \
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) \
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) \
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) \
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) \
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH) \
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_RSHIFT) \
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0 (numpad)") PORT_CODE(KEYCODE_0_PAD) \
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(". (numpad)") PORT_CODE(KEYCODE_DEL_PAD) \
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(not on US keyboard)") PORT_CODE(KEYCODE_MINUS_PAD) \
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) \
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(not on US keyboard)") PORT_CODE(KEYCODE_PLUS_PAD)
-INPUT_PORTS_END
-
-static MACHINE_CONFIG_FRAGMENT( vdt911 )
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, vdt911_device, screen_update)
-
- MCFG_SCREEN_SIZE(560, 280)
- MCFG_SCREEN_VISIBLE_AREA(0, 560-1, 0, /*250*/280-1)
- MCFG_SCREEN_PALETTE("palette")
-
- MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_SOUND_ADD("beeper", BEEP, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.50)
-
- MCFG_PALETTE_ADD("palette", 8)
- MCFG_PALETTE_INDIRECT_ENTRIES(3)
- MCFG_PALETTE_INIT_OWNER(vdt911_device, vdt911)
-
- MCFG_GFXDECODE_ADD("gfxdecode", "palette", vdt911)
-MACHINE_CONFIG_END
-
-//-------------------------------------------------
-// machine_config_additions - return a pointer to
-// the device's machine fragment
-//-------------------------------------------------
-
-machine_config_constructor vdt911_device::device_mconfig_additions() const
-{
- return MACHINE_CONFIG_NAME( vdt911 );
-}
-
-ioport_constructor vdt911_device::device_input_ports() const
-{
- return INPUT_PORTS_NAME( vdt911 );
-}
diff --git a/src/mess/video/911_vdt.h b/src/mess/video/911_vdt.h
deleted file mode 100644
index 7eb0f55dbc1..00000000000
--- a/src/mess/video/911_vdt.h
+++ /dev/null
@@ -1,118 +0,0 @@
-// license:GPL-2.0+
-// copyright-holders:Raphael Nabet
-
-#include "sound/beep.h"
-
-#define vdt911_chr_region ":gfx1"
-enum
-{
- /* 10 bytes per character definition */
- vdt911_single_char_len = 10,
-
- vdt911_US_chr_offset = 0,
- vdt911_UK_chr_offset = vdt911_US_chr_offset+128*vdt911_single_char_len,
- vdt911_german_chr_offset = vdt911_UK_chr_offset+128*vdt911_single_char_len,
- vdt911_swedish_chr_offset = vdt911_german_chr_offset+128*vdt911_single_char_len,
- vdt911_norwegian_chr_offset = vdt911_swedish_chr_offset+128*vdt911_single_char_len,
- vdt911_frenchWP_chr_offset = vdt911_norwegian_chr_offset+128*vdt911_single_char_len,
- vdt911_japanese_chr_offset = vdt911_frenchWP_chr_offset+128*vdt911_single_char_len,
-
- vdt911_chr_region_len = vdt911_japanese_chr_offset+256*vdt911_single_char_len
-};
-
-enum vdt911_screen_size_t { char_960 = 0, char_1920 };
-enum vdt911_model_t
-{
- vdt911_model_US = 0,
- vdt911_model_UK,
- vdt911_model_French,
- vdt911_model_German,
- vdt911_model_Swedish, // Swedish/Finnish
- vdt911_model_Norwegian, // Norwegian/Danish
- vdt911_model_Japanese, // Katakana Japanese
- /*vdt911_model_Arabic,*/ // Arabic
- vdt911_model_FrenchWP // French word processing
-};
-
-class vdt911_device : public device_t
-{
-public:
- vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
- DECLARE_READ8_MEMBER(cru_r);
- DECLARE_WRITE8_MEMBER(cru_w);
-
- DECLARE_PALETTE_INIT(vdt911);
-
- template<class _Object> static devcb_base &static_set_keyint_callback(device_t &device, _Object object)
- {
- return downcast<vdt911_device &>(device).m_keyint_line.set_callback(object);
- }
-
- template<class _Object> static devcb_base &static_set_lineint_callback(device_t &device, _Object object)
- {
- return downcast<vdt911_device &>(device).m_lineint_line.set_callback(object);
- }
-
- UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
-
-protected:
- // device-level overrides
- void device_config_complete();
- void device_start();
- void device_reset();
-
- machine_config_constructor device_mconfig_additions() const;
- ioport_constructor device_input_ports() const;
-
- void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
-
-private:
- void refresh(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y);
- int get_refresh_rate();
- void check_keyboard();
-
- vdt911_screen_size_t m_screen_size; // char_960 for 960-char, 12-line model; char_1920 for 1920-char, 24-line model
- vdt911_model_t m_model; // country code
-
- UINT8 m_data_reg; // dt911 write buffer
- UINT8 m_display_RAM[2048]; // vdt911 char buffer (1kbyte for 960-char model, 2kbytes for 1920-char model)
-
- unsigned int m_cursor_address; // current cursor address (controlled by the computer, affects both display and I/O protocol)
- unsigned int m_cursor_address_mask; // 1023 for 960-char model, 2047 for 1920-char model
-
- emu_timer *m_beep_timer; // beep clock (beeps ends when timer times out)
- emu_timer *m_blink_timer; // cursor blink clock
- emu_timer *m_line_timer; // screen line timer
-
- UINT8 m_keyboard_data; // last code pressed on keyboard
- bool m_keyboard_data_ready; // true if there is a new code in keyboard_data
- bool m_keyboard_interrupt_enable; // true when keybord interrupts are enabled
-
- bool m_display_enable; // screen is black when false
- bool m_dual_intensity_enable; // if true, MSBit of ASCII codes controls character highlight
- bool m_display_cursor; // if true, the current cursor location is displayed on screen
- bool m_blinking_cursor_enable; // if true, the cursor will blink when displayed
- bool m_blink_state; // current cursor blink state
-
- bool m_word_select; // CRU interface mode
- bool m_previous_word_select; // value of word_select is saved here
-
- UINT8 m_last_key_pressed;
- int m_last_modifier_state;
- char m_foreign_mode;
-
- required_device<beep_device> m_beeper;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
- devcb_write_line m_keyint_line;
- devcb_write_line m_lineint_line;
-};
-
-extern const device_type VDT911;
-
-#define MCFG_VDT911_KEYINT_HANDLER( _intcallb ) \
- devcb = &vdt911_device::static_set_keyint_callback( *device, DEVCB_##_intcallb );
-
-#define MCFG_VDT911_LINEINT_HANDLER( _intcallb ) \
- devcb = &vdt911_device::static_set_lineint_callback( *device, DEVCB_##_intcallb );
diff --git a/src/mess/video/abc1600.c b/src/mess/video/abc1600.c
deleted file mode 100644
index 2a312cb3ae7..00000000000
--- a/src/mess/video/abc1600.c
+++ /dev/null
@@ -1,1259 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Curt Coder
-/**********************************************************************
-
- Luxor ABC 1600 Mover emulation
-
-**********************************************************************/
-
-#include "includes/abc1600.h"
-#include "abc1600.lh"
-
-
-
-//**************************************************************************
-// CONSTANTS / MACROS
-//**************************************************************************
-
-#define LOG 0
-
-
-#define SY6845E_TAG "sy6845e"
-
-
-// video RAM
-#define VIDEORAM_SIZE 0x40000
-#define VIDEORAM16_MASK 0x3ffff
-#define VIDEORAM8_MASK 0x7fffe
-
-
-// flag register
-#define L_P BIT(m_flag, 0)
-#define BLANK BIT(m_flag, 1)
-#define PIX_POL BIT(m_flag, 2)
-#define FRAME_POL BIT(m_flag, 3)
-#define HOLD_FY BIT(m_flag, 4)
-#define HOLD_FX BIT(m_flag, 5)
-#define COMP_MOVE BIT(m_flag, 6)
-#define REPLACE BIT(m_flag, 7)
-
-
-
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type ABC1600_MOVER = &device_creator<abc1600_mover_device>;
-
-
-DEVICE_ADDRESS_MAP_START( vram_map, 8, abc1600_mover_device )
- AM_RANGE(0x00000, 0x7ffff) AM_READWRITE(video_ram_r, video_ram_w)
-ADDRESS_MAP_END
-
-DEVICE_ADDRESS_MAP_START( crtc_map, 8, abc1600_mover_device )
- AM_RANGE(0x00, 0x00) AM_MIRROR(0xfe) AM_DEVREADWRITE(SY6845E_TAG, mc6845_device, status_r, address_w)
- AM_RANGE(0x01, 0x01) AM_MIRROR(0xfe) AM_DEVREADWRITE(SY6845E_TAG, mc6845_device, register_r, register_w)
-ADDRESS_MAP_END
-
-DEVICE_ADDRESS_MAP_START( io_map, 8, abc1600_mover_device )
- AM_RANGE(0x000, 0x000) AM_MIRROR(0xff) AM_READ(iord0_r)
- AM_RANGE(0x000, 0x000) AM_MIRROR(0xf8) AM_WRITE(ldsx_hb_w)
- AM_RANGE(0x001, 0x001) AM_MIRROR(0xf8) AM_WRITE(ldsx_lb_w)
- AM_RANGE(0x002, 0x002) AM_MIRROR(0xf8) AM_WRITE(ldsy_hb_w)
- AM_RANGE(0x003, 0x003) AM_MIRROR(0xf8) AM_WRITE(ldsy_lb_w)
- AM_RANGE(0x004, 0x004) AM_MIRROR(0xf8) AM_WRITE(ldtx_hb_w)
- AM_RANGE(0x005, 0x005) AM_MIRROR(0xf8) AM_WRITE(ldtx_lb_w)
- AM_RANGE(0x006, 0x006) AM_MIRROR(0xf8) AM_WRITE(ldty_hb_w)
- AM_RANGE(0x007, 0x007) AM_MIRROR(0xf8) AM_WRITE(ldty_lb_w)
- AM_RANGE(0x100, 0x100) AM_MIRROR(0xf8) AM_WRITE(ldfx_hb_w)
- AM_RANGE(0x101, 0x101) AM_MIRROR(0xf8) AM_WRITE(ldfx_lb_w)
- AM_RANGE(0x102, 0x102) AM_MIRROR(0xf8) AM_WRITE(ldfy_hb_w)
- AM_RANGE(0x103, 0x103) AM_MIRROR(0xf8) AM_WRITE(ldfy_lb_w)
- AM_RANGE(0x105, 0x105) AM_MIRROR(0xf8) AM_WRITE(wrml_w)
- AM_RANGE(0x107, 0x107) AM_MIRROR(0xf8) AM_WRITE(wrdl_w)
- AM_RANGE(0x200, 0x200) AM_MIRROR(0xf8) AM_WRITE(wrmask_strobe_hb_w)
- AM_RANGE(0x201, 0x201) AM_MIRROR(0xf8) AM_WRITE(wrmask_strobe_lb_w)
- AM_RANGE(0x202, 0x202) AM_MIRROR(0xf8) AM_WRITE(enable_clocks_w)
- AM_RANGE(0x203, 0x203) AM_MIRROR(0xf8) AM_WRITE(flag_strobe_w)
- AM_RANGE(0x204, 0x204) AM_MIRROR(0xf8) AM_WRITE(endisp_w)
-ADDRESS_MAP_END
-
-
-static ADDRESS_MAP_START( mover_map, AS_0, 16, abc1600_mover_device )
- AM_RANGE(0x00000, 0x7ffff) AM_RAM
-ADDRESS_MAP_END
-
-
-//-------------------------------------------------
-// ROM( abc1600_mover )
-//-------------------------------------------------
-
-ROM_START( abc1600_mover )
- ROM_REGION16_BE( 0x2000, "wrmsk", 0 )
- ROM_LOAD16_BYTE( "wrmskl 6490362-01.1g", 0x0001, 0x1000, CRC(bc737538) SHA1(80e2c3757eb7f713018808d6e41ebef612425028) )
- ROM_LOAD16_BYTE( "wrmskh 6490363-01.1j", 0x0000, 0x1000, CRC(6b7c9f0b) SHA1(7155a993adcf08a5a8a2f22becf9fd66fda698be) )
-
- ROM_REGION( 0x200, "shinf", 0 )
- ROM_LOAD( "shinf 6490361-01.1f", 0x000, 0x200, CRC(20260f8f) SHA1(29bf49c64e7cc7592e88cde2768ac57c7ce5e085) )
-
- ROM_REGION16_BE( 0x40, "drmsk", 0 )
- ROM_LOAD16_BYTE( "drmskl 6490359-01.1k", 0x01, 0x20, CRC(6e71087c) SHA1(0acf67700d6227f4b315cf8fb0fb31c0e7fb9496) )
- ROM_LOAD16_BYTE( "drmskh 6490358-01.1l", 0x00, 0x20, CRC(a4a9a9dc) SHA1(d8575c0335d6021cbb5f7bcd298b41c35294a80a) )
-
- ROM_REGION( 0x104, "plds", 0 )
- ROM_LOAD( "drmsk 6490360-01.1m", 0x000, 0x104, CRC(5f7143c1) SHA1(1129917845f8e505998b15288f02bf907487e4ac) ) // mover word mixer @ 1m,1n,1t,2t
-ROM_END
-
-
-//-------------------------------------------------
-// rom_region - device-specific ROM region
-//-------------------------------------------------
-
-const rom_entry *abc1600_mover_device::device_rom_region() const
-{
- return ROM_NAME( abc1600_mover );
-}
-
-
-//-------------------------------------------------
-// mc6845
-//-------------------------------------------------
-
-inline UINT16 abc1600_mover_device::get_crtca(UINT16 ma, UINT8 ra, UINT8 column)
-{
- /*
-
- bit description
-
- CRTCA0 0
- CRTCA1 0
- CRTCA2 CC1/MA1
- CRTCA3 CC2/MA2
- CRTCA4 CC3/MA3
- CRTCA5 CC4/MA4
- CRTCA6 RA0
- CRTCA7 RA1
- CRTCA8 RA2
- CRTCA9 RA3
- CRTCA10 CR0/MA8
- CRTCA11 CR1/MA9
- CRTCA12 CR2/MA10
- CRTCA13 CR3/MA11
- CRTCA14 CR4/MA12
- CRTCA15 CR5/MA13
-
- */
-
- UINT8 cc = (ma & 0xff) + column;
- UINT8 cr = ma >> 8;
-
- return (cr << 10) | ((ra & 0x0f) << 6) | ((cc << 1) & 0x3c);
-}
-
-MC6845_UPDATE_ROW(abc1600_mover_device::crtc_update_row)
-{
- int x = 0;
- const pen_t *pen = m_palette->pens();
-
- for (int column = 0; column < x_count; column += 2)
- {
- UINT16 dma = get_crtca(ma, ra, column);
-
- // data is read out of video RAM in nibble mode by strobing CAS 4 times
- for (int cas = 0; cas < 4; cas++)
- {
- UINT16 data = read_videoram(dma + cas);
-
- for (int bit = 0; bit < 16; bit++)
- {
- int color = ((BIT(data, 15) ^ PIX_POL) && !BLANK) && de;
-
- bitmap.pix32(vbp + y, hbp + x++) = pen[color];
-
- data <<= 1;
- }
- }
- }
-}
-
-MC6845_ON_UPDATE_ADDR_CHANGED( abc1600_mover_device::crtc_update )
-{
-}
-
-//-------------------------------------------------
-// MACHINE_CONFIG_FRAGMENT( abc1600_mover )
-//-------------------------------------------------
-
-static MACHINE_CONFIG_FRAGMENT( abc1600_mover )
- MCFG_DEFAULT_LAYOUT(layout_abc1600)
-
- MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate
- MCFG_SCREEN_UPDATE_DRIVER(abc1600_mover_device, screen_update)
- MCFG_SCREEN_SIZE(958, 1067)
- MCFG_SCREEN_VISIBLE_AREA(0, 958-1, 0, 1067-1)
-
- MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
-
- MCFG_MC6845_ADD(SY6845E_TAG, SY6845E, SCREEN_TAG, XTAL_64MHz/32)
- MCFG_MC6845_SHOW_BORDER_AREA(true)
- MCFG_MC6845_CHAR_WIDTH(32)
- MCFG_MC6845_UPDATE_ROW_CB(abc1600_mover_device, crtc_update_row)
- MCFG_MC6845_ADDR_CHANGED_CB(abc1600_mover_device, crtc_update)
-MACHINE_CONFIG_END
-
-
-//-------------------------------------------------
-// machine_config_additions - device-specific
-// machine configurations
-//-------------------------------------------------
-
-machine_config_constructor abc1600_mover_device::device_mconfig_additions() const
-{
- return MACHINE_CONFIG_NAME( abc1600_mover );
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// abc1600_mover_device - constructor
-//-------------------------------------------------
-
-abc1600_mover_device::abc1600_mover_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- device_t(mconfig, ABC1600_MOVER, "ABC 1600 Mover", tag, owner, clock, "abc1600mover", __FILE__),
- device_memory_interface(mconfig, *this),
- m_space_config("vram", ENDIANNESS_BIG, 16, 18, -1, *ADDRESS_MAP_NAME(mover_map)),
- m_crtc(*this, SY6845E_TAG),
- m_palette(*this, "palette"),
- m_wrmsk_rom(*this, "wrmsk"),
- m_shinf_rom(*this, "shinf"),
- m_drmsk_rom(*this, "drmsk")
-{
-}
-
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void abc1600_mover_device::device_start()
-{
- // state saving
- save_item(NAME(m_endisp));
- save_item(NAME(m_clocks_disabled));
- save_item(NAME(m_gmdi));
- save_item(NAME(m_wrm));
- save_item(NAME(m_ms));
- save_item(NAME(m_ds));
- save_item(NAME(m_flag));
- save_item(NAME(m_xsize));
- save_item(NAME(m_ysize));
- save_item(NAME(m_udx));
- save_item(NAME(m_udy));
- save_item(NAME(m_xfrom));
- save_item(NAME(m_xto));
- save_item(NAME(m_yto));
- save_item(NAME(m_ty));
- save_item(NAME(m_mfa));
- save_item(NAME(m_mta));
- save_item(NAME(m_sh));
- save_item(NAME(m_mdor));
- save_item(NAME(m_hold_1w_cyk));
- save_item(NAME(m_wrms0));
- save_item(NAME(m_wrms1));
- save_item(NAME(m_rmc));
- save_item(NAME(m_cmc));
-}
-
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void abc1600_mover_device::device_reset()
-{
- // disable display
- m_clocks_disabled = 1;
- m_endisp = 0;
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
-
-const address_space_config *abc1600_mover_device::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == AS_0) ? &m_space_config : NULL;
-}
-
-
-//-------------------------------------------------
-// read_videoram -
-//-------------------------------------------------
-
-inline UINT16 abc1600_mover_device::read_videoram(offs_t offset)
-{
- return space().read_word((offset & VIDEORAM16_MASK) << 1);
-}
-
-
-//-------------------------------------------------
-// write_videoram -
-//-------------------------------------------------
-
-inline void abc1600_mover_device::write_videoram(offs_t offset, UINT16 data, UINT16 mask)
-{
- UINT16 old_data = read_videoram(offset);
-
- space().write_word((offset & VIDEORAM16_MASK) << 1, (data & mask) | (old_data & (mask ^ 0xffff)));
-}
-
-
-//-------------------------------------------------
-// video_ram_r -
-//-------------------------------------------------
-
-READ8_MEMBER( abc1600_mover_device::video_ram_r )
-{
- offs_t addr = (offset & VIDEORAM8_MASK) >> 1;
- UINT8 data = 0;
-
- if (offset & 0x01)
- {
- data = read_videoram(addr) & 0xff;
- }
- else
- {
- data = read_videoram(addr) >> 8;
- }
-
- return data;
-}
-
-
-//-------------------------------------------------
-// video_ram_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::video_ram_w )
-{
- offs_t addr = (offset & VIDEORAM8_MASK) >> 1;
-
- if (offset & 0x01)
- {
- if (REPLACE)
- {
- // WRPORT_LB
- m_wrm = (m_wrm & 0xff00) | data;
- if (LOG) logerror("WRM LB %02x -> %04x\n", data, m_wrm);
- }
- else
- {
- // DATAPORT_LB
- m_gmdi = (m_gmdi & 0xff00) | data;
- if (LOG) logerror("GMDI LB %02x -> %04x\n", data, m_gmdi);
- }
-
- write_videoram(addr, m_gmdi, m_wrm & 0x00ff);
-
- if (LOG) logerror("Video RAM write LB to %05x : %04x\n", addr, read_videoram(addr));
- }
- else
- {
- if (REPLACE)
- {
- // WRPORT_HB
- m_wrm = (data << 8) | (m_wrm & 0xff);
- if (LOG) logerror("WRM HB %02x -> %04x\n", data, m_wrm);
- }
- else
- {
- // DATAPORT_HB
- m_gmdi = (data << 8) | (m_gmdi & 0xff);
- if (LOG) logerror("GMDI HB %02x -> %04x\n", data, m_gmdi);
- }
-
- write_videoram(addr, m_gmdi, m_wrm & 0xff00);
-
- if (LOG) logerror("Video RAM write HB to %05x : %04x\n", addr, read_videoram(addr));
- }
-}
-
-
-//-------------------------------------------------
-// iord0_r -
-//-------------------------------------------------
-
-READ8_MEMBER( abc1600_mover_device::iord0_r )
-{
- /*
-
- bit description
-
- 0 0
- 1 SCREENPOS
- 2
- 3
- 4
- 5
- 6 VSYNC
- 7 BUSY
-
- */
-
- UINT8 data = 0;
-
- // monitor orientation (portrait/landscape)
- data |= machine().render().first_target()->view() << 1;
-
- // vertical sync
- data |= m_crtc->vsync_r() << 6;
-
- return data;
-}
-
-
-//-------------------------------------------------
-// ldsx_hb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::ldsx_hb_w )
-{
- /*
-
- bit description
-
- 0 XSIZE8
- 1 XSIZE9
- 2 U/D* Y
- 3 U/D* X
- 4
- 5
- 6
- 7
-
- */
-
- if (LOG) logerror("%s LDSX HB: %02x\n", machine().describe_context(), data);
-
- m_xsize = ((data & 0x03) << 8) | (m_xsize & 0xff);
- m_udy = BIT(data, 2);
- m_udx = BIT(data, 3);
-}
-
-
-//-------------------------------------------------
-// ldsx_lb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::ldsx_lb_w )
-{
- /*
-
- bit description
-
- 0 XSIZE0
- 1 XSIZE1
- 2 XSIZE2
- 3 XSIZE3
- 4 XSIZE4
- 5 XSIZE5
- 6 XSIZE6
- 7 XSIZE7
-
- */
-
- if (LOG) logerror("%s LDSX LB: %02x\n", machine().describe_context(), data);
-
- m_xsize = (m_xsize & 0x300) | data;
-}
-
-
-//-------------------------------------------------
-// ldsy_hb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::ldsy_hb_w )
-{
- /*
-
- bit description
-
- 0 YSIZE8
- 1 YSIZE9
- 2 YSIZE10
- 3 YSIZE11
- 4
- 5
- 6
- 7
-
- */
-
- if (LOG) logerror("%s LDSY HB: %02x\n", machine().describe_context(), data);
-
- m_ysize = ((data & 0x0f) << 8) | (m_ysize & 0xff);
-}
-
-
-//-------------------------------------------------
-// ldsy_lb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::ldsy_lb_w )
-{
- /*
-
- bit description
-
- 0 YSIZE0
- 1 YSIZE1
- 2 YSIZE2
- 3 YSIZE3
- 4 YSIZE4
- 5 YSIZE5
- 6 YSIZE6
- 7 YSIZE7
-
- */
-
- if (LOG) logerror("%s LDSY LB: %02x\n", machine().describe_context(), data);
-
- m_ysize = (m_ysize & 0xf00) | data;
-}
-
-
-//-------------------------------------------------
-// ldtx_hb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::ldtx_hb_w )
-{
- /*
-
- bit description
-
- 0 XTO8, MTA4
- 1 XTO9, MTA5
- 2
- 3
- 4
- 5
- 6
- 7
-
- */
-
- if (LOG) logerror("%s LDTX HB: %02x\n", machine().describe_context(), data);
-
- m_xto = ((data & 0x03) << 8) | (m_xto & 0xff);
- m_mta = (m_mta & 0x3ffcf) | ((data & 0x03) << 4);
-}
-
-
-//-------------------------------------------------
-// ldtx_lb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::ldtx_lb_w )
-{
- /*
-
- bit description
-
- 0 XTO0
- 1 XTO1
- 2 XTO2
- 3 XTO3
- 4 XTO4, MTA0
- 5 XTO5, MTA1
- 6 XTO6, MTA2
- 7 XTO7, MTA3
-
- */
-
- if (LOG) logerror("%s LDTX LB: %02x\n", machine().describe_context(), data);
-
- m_xto = (m_xto & 0x300) | data;
- m_mta = (m_mta & 0x3fff0) | (data >> 4);
-}
-
-
-//-------------------------------------------------
-// ldty_hb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::ldty_hb_w )
-{
- /*
-
- bit description
-
- 0 YTO8, MTA14
- 1 YTO9, MTA15
- 2 YTO10, MTA16
- 3 YTO11, MTA17
- 4
- 5
- 6
- 7
-
- */
-
- if (LOG) logerror("%s LDTY HB: %02x\n", machine().describe_context(), data);
-
- if (L_P) return;
-
- m_ty = ((data & 0x0f) << 8) | (m_yto & 0xff);
- m_yto = ((data & 0x0f) << 8) | (m_yto & 0xff);
- m_mta = ((data & 0x0f) << 14) | (m_mta & 0x3fff);
-}
-
-
-//-------------------------------------------------
-// ldty_lb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::ldty_lb_w )
-{
- /*
-
- bit description
-
- 0 YTO0, MTA6
- 1 YTO1, MTA7
- 2 YTO2, MTA8
- 3 YTO3, MTA9
- 4 YTO4, MTA10
- 5 YTO5, MTA11
- 6 YTO6, MTA12
- 7 YTO7, MTA13
-
- */
-
- if (LOG) logerror("%s LDTY LB: %02x\n", machine().describe_context(), data);
-
- if (L_P) return;
-
- m_ty = (m_ty & 0xf00) | data;
- m_yto = (m_yto & 0xf00) | data;
- m_mta = (m_mta & 0x3c03f) | (data << 6);
-}
-
-
-//-------------------------------------------------
-// ldfx_hb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::ldfx_hb_w )
-{
- /*
-
- bit description
-
- 0 XFROM8, MFA4
- 1 XFROM9, MFA5
- 2
- 3
- 4
- 5
- 6
- 7
-
- */
-
- if (LOG) logerror("%s LDFX HB: %02x\n", machine().describe_context(), data);
-
- m_xfrom = ((data & 0x03) << 8) | (m_xfrom & 0xff);
- m_mfa = (m_mfa & 0x3ffcf) | ((data & 0x03) << 4);
-}
-
-
-//-------------------------------------------------
-// ldfx_lb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::ldfx_lb_w )
-{
- /*
-
- bit description
-
- 0 XFROM0
- 1 XFROM1
- 2 XFROM2
- 3 XFROM3
- 4 XFROM4, MFA0
- 5 XFROM5, MFA1
- 6 XFROM6, MFA2
- 7 XFROM7, MFA3
-
- */
-
- if (LOG) logerror("%s LDFX LB: %02x\n", machine().describe_context(), data);
-
- m_xfrom = (m_xfrom & 0x300) | data;
- m_mfa = (m_mfa & 0x3fff0) | (data >> 4);
-}
-
-
-//-------------------------------------------------
-// ldfy_hb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::ldfy_hb_w )
-{
- /*
-
- bit description
-
- 0 MFA14
- 1 MFA15
- 2 MFA16
- 3 MFA17
- 4
- 5
- 6
- 7
-
- */
-
- if (LOG) logerror("%s LDFY HB: %02x\n", machine().describe_context(), data);
-
- m_mfa = ((data & 0x0f) << 14) | (m_mfa & 0x3fff);
-}
-
-
-//-------------------------------------------------
-// ldfy_lb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::ldfy_lb_w )
-{
- /*
-
- bit description
-
- 0 MFA6
- 1 MFA7
- 2 MFA8
- 3 MFA9
- 4 MFA10
- 5 MFA11
- 6 MFA12
- 7 MFA13
-
- */
-
- if (LOG) logerror("%s LDFY LB: %02x\n", machine().describe_context(), data);
-
- m_mfa = (m_mfa & 0x3c03f) | (data << 6);
-
- mover();
-}
-
-
-//-------------------------------------------------
-// wrml_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::wrml_w )
-{
- /*
-
- bit description
-
- 0 MOVE CYK CLK
- 1 DISP CYC SEL / DISP CYK PRE FETCH (+1 PIXCLK)
- 2 DATA CLK
- 3 _DISP MEM WE
- 4 _CAS HB
- 5 DTACK CLK / BLANK TEST (+2 PIXCLK)
- 6 DISPREC CLK
- 7 _RAS HB
-
- */
-
- if (LOG) logerror("MS %u : %02x\n", (offset >> 4) & 0x0f, data);
-
- if (m_clocks_disabled)
- {
- m_ms[(offset >> 4) & 0x0f] = data;
- }
-}
-
-
-//-------------------------------------------------
-// wrdl_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::wrdl_w )
-{
- /*
-
- bit description
-
- 0 MOVE CYK CLK
- 1 DISP CYC SEL / DISP CYK PRE FETCH (+1 PIXCLK)
- 2 DATA CLK
- 3 _DISP MEM WE
- 4 _CAS HB
- 5 DTACK CLK / BLANK TEST (+2 PIXCLK)
- 6 DISPREC CLK
- 7 _RAS HB
-
- */
-
- if (LOG) logerror("WS %u : %02x\n", (offset >> 4) & 0x0f, data);
-
- if (m_clocks_disabled)
- {
- m_ds[(offset >> 4) & 0x0f] = data;
- }
-}
-
-
-//-------------------------------------------------
-// wrmask_strobe_hb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::wrmask_strobe_hb_w )
-{
- if (REPLACE)
- {
- // DATAPORT_HB
- m_gmdi = (data << 8) | (m_gmdi & 0xff);
- if (LOG) logerror("GMDI HB %04x\n", m_gmdi);
- }
- else
- {
- // WRPORT_HB
- m_wrm = (data << 8) | (m_wrm & 0xff);
- if (LOG) logerror("WRM HB %04x\n", m_gmdi);
- }
-}
-
-
-//-------------------------------------------------
-// wrmask_strobe_lb_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::wrmask_strobe_lb_w )
-{
- if (REPLACE)
- {
- // DATAPORT_LB
- m_gmdi = (m_gmdi & 0xff00) | data;
- if (LOG) logerror("GMDI LB %04x\n", m_gmdi);
- }
- else
- {
- // WRPORT_LB
- m_wrm = (m_wrm & 0xff00) | data;
- if (LOG) logerror("WRM LB %04x\n", m_gmdi);
- }
-}
-
-
-//-------------------------------------------------
-// enable_clocks_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::enable_clocks_w )
-{
- if (LOG) logerror("ENABLE CLOCKS\n");
- m_clocks_disabled = 0;
-}
-
-
-//-------------------------------------------------
-// flag_strobe_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::flag_strobe_w )
-{
- /*
-
- bit description
-
- 0 L/_P FLAG
- 1 BLANK FLAG
- 2 PIX POL
- 3 FRAME POL
- 4 HOLD FY
- 5 HOLD FX
- 6 COMP MOVE FLAG
- 7 REPLACE/SET & RESET
-
- */
-
- m_flag = data;
- if (LOG) logerror("FLAG %02x\n", m_flag);
-}
-
-
-//-------------------------------------------------
-// endisp_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc1600_mover_device::endisp_w )
-{
- m_endisp = 1;
- if (LOG) logerror("ENDISP\n");
-}
-
-
-
-//**************************************************************************
-// MOVER
-//**************************************************************************
-
-//-------------------------------------------------
-// clock_mfa_x -
-//-------------------------------------------------
-
-inline void abc1600_mover_device::clock_mfa_x()
-{
- UINT16 mfa_y = m_mfa >> 6;
- UINT8 mfa_x = m_mfa & 0x3f;
-
- if (!HOLD_FX)
- {
- mfa_x += m_udx ? 1 : -1;
- mfa_x &= 0x3f;
- }
-
- m_mfa = (mfa_y << 6) | mfa_x;
-}
-
-
-//-------------------------------------------------
-// clock_mfa_y -
-//-------------------------------------------------
-
-inline void abc1600_mover_device::clock_mfa_y()
-{
- UINT16 mfa_y = m_mfa >> 6;
- UINT8 mfa_x = m_mfa & 0x3f;
-
- if (!HOLD_FY)
- {
- mfa_y += m_udy ? 1 : -1;
- mfa_y &= 0xfff;
- }
-
- m_mfa = (mfa_y << 6) | mfa_x;
-}
-
-
-//-------------------------------------------------
-// clock_mta_x -
-//-------------------------------------------------
-
-inline void abc1600_mover_device::clock_mta_x()
-{
- UINT16 mta_y = m_mta >> 6;
- UINT8 mta_x = m_mta & 0x3f;
-
- mta_x += m_udx ? 1 : -1;
- mta_x &= 0x3f;
-
- m_mta = (mta_y << 6) | mta_x;
-}
-
-
-//-------------------------------------------------
-// clock_mta_y -
-//-------------------------------------------------
-
-inline void abc1600_mover_device::clock_mta_y()
-{
- UINT16 mta_y = m_mta >> 6;
- UINT8 mta_x = m_mta & 0x3f;
-
- mta_y += m_udy ? 1 : -1;
- mta_y &= 0xfff;
-
- m_mta = (mta_y << 6) | mta_x;
-}
-
-
-//-------------------------------------------------
-// load_mfa_x -
-//-------------------------------------------------
-
-inline void abc1600_mover_device::load_mfa_x()
-{
- UINT16 mfa_y = m_mfa >> 6;
- UINT8 mfa_x = m_xfrom >> 4;
-
- m_mfa = (mfa_y << 6) | mfa_x;
-}
-
-
-//-------------------------------------------------
-// load_mta_x -
-//-------------------------------------------------
-
-inline void abc1600_mover_device::load_mta_x()
-{
- UINT16 mta_y = m_mta >> 6;
- UINT8 mta_x = m_xto >> 4;
-
- m_mta = (mta_y << 6) | mta_x;
-}
-
-
-//-------------------------------------------------
-// load_xy_reg -
-//-------------------------------------------------
-
-inline void abc1600_mover_device::load_xy_reg()
-{
- if (L_P) return;
-
- UINT16 sum = m_xto + m_xsize;
-
- m_xto = sum & 0x3ff;
- m_yto = m_ty & 0xfff;
- m_mta = (m_ty << 6) | (sum >> 4);
-}
-
-
-//-------------------------------------------------
-// compare_mta_x -
-//-------------------------------------------------
-
-inline void abc1600_mover_device::compare_mta_x()
-{
- UINT8 mta_x_end = ((m_xto + m_xsize) >> 4) & 0x3f;
- UINT8 mta_x = m_mta & 0x3f;
-
- if (mta_x == mta_x_end)
- {
- m_cmc = 0;
- }
-
- m_wrms1 = m_cmc & m_amm;
-}
-
-
-//-------------------------------------------------
-// compare_mta_y -
-//-------------------------------------------------
-
-inline void abc1600_mover_device::compare_mta_y()
-{
- int mta_y_end = (m_yto + m_ysize) & 0xfff;
- UINT16 mta_y = m_mta >> 6;
-
- if (mta_y == mta_y_end)
- {
- m_rmc = 0;
- }
-}
-
-
-//-------------------------------------------------
-// get_shinf -
-//-------------------------------------------------
-
-inline void abc1600_mover_device::get_shinf()
-{
- /*
-
- bit description
-
- A0 XFROM0
- A1 XFROM1
- A2 XFROM2
- A3 XFROM3
- A4 XTO0
- A5 XTO1
- A6 XTO2
- A7 XTO3
- A8 U/D* X
-
- */
-
- UINT16 shinf_addr = (m_udx << 8) | ((m_xto & 0x0f) << 4) | (m_xfrom & 0x0f);
- UINT8 shinf = m_shinf_rom[shinf_addr];
-
- m_sh = shinf & 0x0f;
- m_hold_1w_cyk = BIT(shinf, 5);
-}
-
-
-//-------------------------------------------------
-// get_drmsk -
-//-------------------------------------------------
-
-inline UINT16 abc1600_mover_device::get_drmsk()
-{
- /*
-
- bit description
-
- A0 SH0
- A1 SH1
- A2 SH2
- A3 SH3
- A4 U/D* X
-
- */
-
- UINT16 drmsk_addr = (m_udx << 4) | (m_sh & 0x0f);
- return m_drmsk_rom[drmsk_addr];
-}
-
-
-//-------------------------------------------------
-// get_wrmsk - get mover write mask
-//-------------------------------------------------
-
-inline UINT16 abc1600_mover_device::get_wrmsk()
-{
- /*
-
- bit description
-
- A0 XTO0
- A1 XTO1
- A2 XTO2
- A3 XTO3
- A4 XSIZE0
- A5 XSIZE1
- A6 XSIZE2
- A7 XSIZE3
- A8 U/D* X
- A9 ANDED MASKS
- A10 WRMS0
- A11 WRMS1
-
- */
-
- UINT16 wrmsk_addr = (m_wrms1 << 11) | (m_wrms0 << 10) | ((!m_wrms1 && !m_wrms0) << 9) | (m_udx << 8) | ((m_xsize & 0x0f) << 4) | (m_xto & 0x0f);
- return m_wrmsk_rom[wrmsk_addr] ^ 0xffff;
-}
-
-
-//-------------------------------------------------
-// barrel_shift -
-//-------------------------------------------------
-
-inline UINT16 abc1600_mover_device::barrel_shift(UINT16 gmdr)
-{
- UINT16 rot = gmdr;
-
- for (int sh = 0; sh < m_sh; sh++)
- {
- int msb = BIT(rot, 15);
- rot <<= 1;
- rot |= msb;
- }
-
- return rot;
-}
-
-
-//-------------------------------------------------
-// word_mixer -
-//-------------------------------------------------
-
-inline UINT16 abc1600_mover_device::word_mixer(UINT16 rot)
-{
- UINT16 drmsk = get_drmsk();
- UINT16 gmdi = (rot & drmsk) | (m_mdor & (drmsk ^ 0xffff));
-
- if (COMP_MOVE)
- {
- gmdi ^= 0xffff;
- }
-
- m_mdor = rot;
-
- return gmdi;
-}
-
-
-//-------------------------------------------------
-// mover -
-//-------------------------------------------------
-
-void abc1600_mover_device::mover()
-{
- if (LOG) logerror("XFROM %u XSIZE %u YSIZE %u XTO %u YTO %u MFA %05x MTA %05x U/D*X %u U/D*Y %u\n", m_xfrom, m_xsize, m_ysize, m_xto, m_yto, m_mfa, m_mta, m_udx, m_udy);
-
- m_amm = 1;
-
- m_rmc = 1;
- get_shinf();
-
- do
- {
- compare_mta_y();
-
- load_mfa_x();
- load_mta_x();
- m_cmc = 1;
- m_wrms0 = 0;
-
- if (m_hold_1w_cyk)
- {
- // read one word in advance
- UINT16 gmdr = read_videoram(m_mfa);
- UINT16 rot = barrel_shift(gmdr);
- word_mixer(rot);
-
- clock_mfa_x();
- }
-
- do
- {
- compare_mta_x();
-
- UINT16 gmdr = read_videoram(m_mfa);
- UINT16 rot = barrel_shift(gmdr);
- UINT16 gmdi = word_mixer(rot);
- UINT16 mask = get_wrmsk();
-
- write_videoram(m_mta, gmdi, mask);
-
- clock_mfa_x();
- clock_mta_x();
-
- m_wrms0 = 1;
- }
- while (m_cmc);
-
- clock_mfa_y();
- clock_mta_y();
- }
- while (m_rmc);
-
- load_xy_reg();
-
- m_amm = 0;
-}
-
-UINT32 abc1600_mover_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- if (m_endisp)
- {
- bitmap.fill(m_palette->pen(FRAME_POL), cliprect);
- m_crtc->screen_update(screen, bitmap, cliprect);
- }
- else
- {
- bitmap.fill(rgb_t::black, cliprect);
- }
-
- return 0;
-}
diff --git a/src/mess/video/abc1600.h b/src/mess/video/abc1600.h
deleted file mode 100644
index 172967c783d..00000000000
--- a/src/mess/video/abc1600.h
+++ /dev/null
@@ -1,151 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Curt Coder
-/**********************************************************************
-
- Luxor ABC 1600 Mover emulation
-
-**********************************************************************/
-
-#pragma once
-
-#ifndef __ABC1600_MOVER__
-#define __ABC1600_MOVER__
-
-#include "emu.h"
-#include "video/mc6845.h"
-
-
-
-///*************************************************************************
-// INTERFACE CONFIGURATION MACROS
-///*************************************************************************
-
-#define ABC1600_MOVER_TAG "mover"
-
-
-#define MCFG_ABC1600_MOVER_ADD() \
- MCFG_DEVICE_ADD(ABC1600_MOVER_TAG, ABC1600_MOVER, 0)
-
-
-
-///*************************************************************************
-// TYPE DEFINITIONS
-///*************************************************************************
-
-// ======================> abc1600_mover_device
-
-class abc1600_mover_device : public device_t,
- public device_memory_interface
-{
-public:
- // construction/destruction
- abc1600_mover_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
- // optional information overrides
- virtual const rom_entry *device_rom_region() const;
- virtual machine_config_constructor device_mconfig_additions() const;
-
- virtual DECLARE_ADDRESS_MAP(vram_map, 8);
- virtual DECLARE_ADDRESS_MAP(crtc_map, 8);
- virtual DECLARE_ADDRESS_MAP(io_map, 8);
-
- UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
-
- MC6845_UPDATE_ROW(crtc_update_row);
- MC6845_ON_UPDATE_ADDR_CHANGED(crtc_update);
-
-protected:
- // device-level overrides
- virtual void device_start();
- virtual void device_reset();
-
- // device_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
-private:
- inline UINT16 get_drmsk();
- inline void get_shinf();
- inline UINT16 get_wrmsk();
- inline UINT16 barrel_shift(UINT16 gmdr);
- inline UINT16 word_mixer(UINT16 rot);
- inline void clock_mfa_x();
- inline void clock_mfa_y();
- inline void clock_mta_x();
- inline void clock_mta_y();
- inline void load_mfa_x();
- inline void load_mta_x();
- inline void compare_mta_x();
- inline void compare_mta_y();
- inline void load_xy_reg();
- void mover();
-
- DECLARE_READ8_MEMBER( video_ram_r );
- DECLARE_WRITE8_MEMBER( video_ram_w );
-
- DECLARE_READ8_MEMBER( iord0_r );
- DECLARE_WRITE8_MEMBER( ldsx_hb_w );
- DECLARE_WRITE8_MEMBER( ldsx_lb_w );
- DECLARE_WRITE8_MEMBER( ldsy_hb_w );
- DECLARE_WRITE8_MEMBER( ldsy_lb_w );
- DECLARE_WRITE8_MEMBER( ldtx_hb_w );
- DECLARE_WRITE8_MEMBER( ldtx_lb_w );
- DECLARE_WRITE8_MEMBER( ldty_hb_w );
- DECLARE_WRITE8_MEMBER( ldty_lb_w );
- DECLARE_WRITE8_MEMBER( ldfx_hb_w );
- DECLARE_WRITE8_MEMBER( ldfx_lb_w );
- DECLARE_WRITE8_MEMBER( ldfy_hb_w );
- DECLARE_WRITE8_MEMBER( ldfy_lb_w );
- DECLARE_WRITE8_MEMBER( wrml_w );
- DECLARE_WRITE8_MEMBER( wrdl_w );
- DECLARE_WRITE8_MEMBER( wrmask_strobe_hb_w );
- DECLARE_WRITE8_MEMBER( wrmask_strobe_lb_w );
- DECLARE_WRITE8_MEMBER( enable_clocks_w );
- DECLARE_WRITE8_MEMBER( flag_strobe_w );
- DECLARE_WRITE8_MEMBER( endisp_w );
-
- inline UINT16 read_videoram(offs_t offset);
- inline void write_videoram(offs_t offset, UINT16 data, UINT16 mask);
- inline UINT16 get_crtca(UINT16 ma, UINT8 ra, UINT8 column);
-
- const address_space_config m_space_config;
-
- required_device<mc6845_device> m_crtc;
- required_device<palette_device> m_palette;
- required_region_ptr<UINT16> m_wrmsk_rom;
- required_region_ptr<UINT8> m_shinf_rom;
- required_region_ptr<UINT16> m_drmsk_rom;
-
- int m_endisp; // enable display
- int m_clocks_disabled; // clocks disabled
- UINT16 m_gmdi; // video RAM data latch
- UINT16 m_wrm; // write mask latch
- UINT8 m_ms[16]; // mover sequence control
- UINT8 m_ds[16]; // display sequence control
- UINT8 m_flag; // flags
- UINT16 m_xsize; // X size
- UINT16 m_ysize; // Y size
- int m_udx; // up/down X
- int m_udy; // up/down Y
- UINT16 m_xfrom; // X from
- UINT16 m_xto; // X to
- UINT16 m_yto; // Y to
- UINT16 m_ty; // to Y
- UINT32 m_mfa; // mover from address
- UINT32 m_mta; // mover to address
- UINT8 m_sh; //
- UINT16 m_mdor; //
- int m_hold_1w_cyk; //
- int m_wrms0; //
- int m_wrms1; //
- int m_rmc; // row match count
- int m_cmc; // column match count
- int m_amm; // active mover mask
-};
-
-
-// device type definition
-extern const device_type ABC1600_MOVER;
-
-
-
-#endif
diff --git a/src/mess/video/abc80.c b/src/mess/video/abc80.c
deleted file mode 100644
index 30272f3b0ea..00000000000
--- a/src/mess/video/abc80.c
+++ /dev/null
@@ -1,205 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Curt Coder
-/*****************************************************************************
- *
- * video/abc80.c
- *
- ****************************************************************************/
-
-#include "emu.h"
-#include "includes/abc80.h"
-
-
-
-//-------------------------------------------------
-// gfx_layout charlayout
-//-------------------------------------------------
-
-static const gfx_layout charlayout =
-{
- 6, 10,
- 128,
- 1,
- { 0 },
- { 0, 1, 2, 3, 4, 5 },
- { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8 },
- 10*8
-};
-
-
-//-------------------------------------------------
-// GFXDECODE( abc80 )
-//-------------------------------------------------
-
-static GFXDECODE_START( abc80 )
- GFXDECODE_ENTRY( "chargen", 0, charlayout, 0, 1 ) // normal characters
- GFXDECODE_ENTRY( "chargen", 0x500, charlayout, 0, 1 ) // graphics characters
-GFXDECODE_END
-
-
-//-------------------------------------------------
-// update_screen -
-//-------------------------------------------------
-
-void abc80_state::update_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- int c = 0;
- int r = 0;
- int mode = 0;
-
- for (int y = 0; y < 312; y++)
- {
- UINT8 vsync_data = m_vsync_prom->base()[y];
- UINT8 l = m_line_prom->base()[y];
- int dv = (vsync_data & ABC80_K2_DV) ? 1 : 0;
-
- if (!(vsync_data & ABC80_K2_FRAME_RESET))
- {
- // reset F2
- r = 0;
- }
-
- for (int sx = 0; sx < 64; sx++)
- {
- UINT8 hsync_data = m_hsync_prom->base()[sx];
- int dh = (hsync_data & ABC80_K5_DH) ? 1 : 0;
- UINT8 data = 0;
-
- if (hsync_data & ABC80_K5_LINE_END)
- {
- // reset F4
- c = 0;
-
- // reset J5
- mode = 0;
- }
-
- /*
-
- Video RAM Addressing Scheme
-
- A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
- R2 R1 R0 xx xx xx xx C2 C1 C0
-
- A6 A5 A4 A3 = 00 C5 C4 C3 + R4 R3 R4 R3
-
- */
-
- int a = (c >> 3) & 0x07;
- int b = ((r >> 1) & 0x0c) | ((r >> 3) & 0x03);
- int s = (a + b) & 0x0f;
- UINT16 videoram_addr = ((r & 0x07) << 7) | (s << 3) | (c & 0x07);
- UINT8 videoram_data = m_latch;
- UINT8 attr_addr = ((dh & dv) << 7) | (videoram_data & 0x7f);
- UINT8 attr_data = m_attr_prom->base()[attr_addr];
-
- int blank = (attr_data & ABC80_J3_BLANK) ? 1 : 0;
- int j = (attr_data & ABC80_J3_TEXT) ? 1 : 0;
- int k = (attr_data & ABC80_J3_GRAPHICS) ? 1 : 0;
- int versal = (attr_data & ABC80_J3_VERSAL) ? 1 : 0;
- int cursor = (videoram_data & ABC80_CHAR_CURSOR) ? 1 : 0;
-
- if (!j && k) mode = 0;
- if (j && !k) mode = 1;
- if (j && k) mode = !mode;
-
- if (mode & versal)
- {
- // graphics mode
- int r0 = 1, r1 = 1, r2 = 1;
-
- if (l < 3) r0 = 0; else if (l < 7) r1 = 0; else r2 = 0;
-
- int c0 = BIT(videoram_data, 0) | r0;
- int c1 = BIT(videoram_data, 1) | r0;
- int c2 = BIT(videoram_data, 2) | r1;
- int c3 = BIT(videoram_data, 3) | r1;
- int c4 = BIT(videoram_data, 4) | r2;
- int c5 = BIT(videoram_data, 6) | r2;
-
- if (!(c0 & c2 & c4)) data |= 0xe0;
- if (!(c1 & c3 & c5)) data |= 0x1c;
- }
- else
- {
- // text mode
- UINT16 chargen_addr = ((videoram_data & 0x7f) * 10) + l;
-
- data = m_char_rom->base()[chargen_addr];
- }
-
- // shift out pixels
- for (int bit = 0; bit < 6; bit++)
- {
- int color = BIT(data, 7);
- int x = (sx * 6) + bit;
-
- color ^= (cursor & m_blink);
- color &= blank;
-
- bitmap.pix32(y, x) = m_palette->pen(color);
-
- data <<= 1;
- }
-
- m_latch = m_video_ram[videoram_addr];
-
- if (hsync_data & ABC80_K5_ROW_START)
- {
- // clock F4
- c++;
- }
- }
-
- if (vsync_data & ABC80_K2_FRAME_END)
- {
- // clock F2
- r++;
- }
- }
-}
-
-
-void abc80_state::video_start()
-{
- screen_device *screen = machine().device<screen_device>(SCREEN_TAG);
-
- // start timers
- m_pio_timer = timer_alloc(TIMER_ID_PIO);
- m_pio_timer->adjust(screen->time_until_pos(0, 0), 0, screen->scan_period());
-
- m_blink_timer = timer_alloc(TIMER_ID_BLINK);
- m_blink_timer->adjust(attotime::from_hz(XTAL_11_9808MHz/2/6/64/312/16), 0, attotime::from_hz(XTAL_11_9808MHz/2/6/64/312/16));
-
- m_vsync_on_timer = timer_alloc(TIMER_ID_VSYNC_ON);
- m_vsync_on_timer->adjust(screen->time_until_pos(0, 0), 0, screen->frame_period());
-
- m_vsync_off_timer = timer_alloc(TIMER_ID_VSYNC_OFF);
- m_vsync_off_timer->adjust(screen->time_until_pos(16, 0), 0, screen->frame_period());
-
- // allocate memory
- m_video_ram.allocate(0x400);
-}
-
-
-UINT32 abc80_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- update_screen(bitmap, cliprect);
-
- return 0;
-}
-
-
-//-------------------------------------------------
-// MACHINE_CONFIG_FRAGMENT( abc80_video )
-//-------------------------------------------------
-
-MACHINE_CONFIG_FRAGMENT( abc80_video )
- MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
- MCFG_SCREEN_UPDATE_DRIVER(abc80_state, screen_update)
-
- MCFG_SCREEN_RAW_PARAMS(XTAL_11_9808MHz/2, ABC80_HTOTAL, ABC80_HBEND, ABC80_HBSTART, ABC80_VTOTAL, ABC80_VBEND, ABC80_VBSTART)
-
- MCFG_GFXDECODE_ADD("gfxdecode", "palette", abc80)
- MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
-MACHINE_CONFIG_END
diff --git a/src/mess/video/abc800.c b/src/mess/video/abc800.c
deleted file mode 100644
index ee9fc3a19de..00000000000
--- a/src/mess/video/abc800.c
+++ /dev/null
@@ -1,311 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Curt Coder
-/*****************************************************************************
- *
- * video/abc800.c
- *
- ****************************************************************************/
-
-#include "includes/abc80x.h"
-
-
-
-// these are needed because the MC6845 emulation does
-// not position the active display area correctly
-#define HORIZONTAL_PORCH_HACK 115
-#define VERTICAL_PORCH_HACK 29
-
-
-
-//**************************************************************************
-// HIGH RESOLUTION GRAPHICS
-//**************************************************************************
-
-//-------------------------------------------------
-// hrs_w - high resolution scanline write
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc800_state::hrs_w )
-{
- m_hrs = data;
-}
-
-
-//-------------------------------------------------
-// hrc_w - high resolution color write
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc800_state::hrc_w )
-{
- m_fgctl = data;
-}
-
-
-
-//**************************************************************************
-// ABC 800 COLOR
-//**************************************************************************
-
-//-------------------------------------------------
-// translate_trom_offset -
-//-------------------------------------------------
-
-offs_t abc800c_state::translate_trom_offset(offs_t offset)
-{
- int row = offset / 40;
- int col = offset % 40;
-
- offset = ((row & 0x07) * 0x80) + col;
-
- if (row & 0x08) offset += 0x28;
- if (row & 0x10) offset += 0x50;
-
- return offset;
-}
-
-
-//-------------------------------------------------
-// hr_update - high resolution screen update
-//-------------------------------------------------
-
-void abc800c_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- const pen_t *pen = m_palette->pens();
-
- UINT16 addr = 0;
-
- for (int y = m_hrs; y < MIN(cliprect.max_y + 1, m_hrs + 480); y += 2)
- {
- int x = 0;
-
- for (int sx = 0; sx < 64; sx++)
- {
- UINT8 data = m_video_ram[addr++];
-
- for (int dot = 0; dot < 4; dot++)
- {
- UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03);
- UINT8 fgctl = m_fgctl_prom->base()[fgctl_addr];
- int color = fgctl & 0x07;
-
- if (color)
- {
- bool black = bitmap.pix32(y, x) == rgb_t::black;
- bool opaque = !BIT(fgctl, 3);
-
- if (black || opaque)
- {
- bitmap.pix32(y, x) = pen[color];
- bitmap.pix32(y, x + 1) = pen[color];
-
- bitmap.pix32(y + 1, x) = pen[color];
- bitmap.pix32(y + 1, x + 1) = pen[color];
- }
- }
-
- data <<= 2;
- x += 2;
- }
- }
- }
-}
-
-
-void abc800_state::video_start()
-{
- // register for state saving
- save_item(NAME(m_hrs));
- save_item(NAME(m_fgctl));
-}
-
-
-//-------------------------------------------------
-// SCREEN_UPDATE( abc800c )
-//-------------------------------------------------
-
-UINT32 abc800c_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- // clear screen
- bitmap.fill(rgb_t::black, cliprect);
-
- // draw text
- if (!BIT(m_fgctl, 7))
- {
- m_trom->screen_update(screen, bitmap, cliprect);
- }
-
- // draw HR graphics
- hr_update(bitmap, cliprect);
-
- return 0;
-}
-
-
-//-------------------------------------------------
-// SAA5050_INTERFACE( trom_intf )
-//-------------------------------------------------
-
-READ8_MEMBER( abc800c_state::char_ram_r )
-{
- return m_char_ram[translate_trom_offset(offset)];
-}
-
-
-//-------------------------------------------------
-// PALETTE_INIT( abc800c )
-//-------------------------------------------------
-
-PALETTE_INIT_MEMBER( abc800c_state, abc800c )
-{
- palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); // black
- palette.set_pen_color(1, rgb_t(0xff, 0x00, 0x00)); // red
- palette.set_pen_color(2, rgb_t(0x00, 0xff, 0x00)); // green
- palette.set_pen_color(3, rgb_t(0xff, 0xff, 0x00)); // yellow
- palette.set_pen_color(4, rgb_t(0x00, 0x00, 0xff)); // blue
- palette.set_pen_color(5, rgb_t(0xff, 0x00, 0xff)); // magenta
- palette.set_pen_color(6, rgb_t(0x00, 0xff, 0xff)); // cyan
- palette.set_pen_color(7, rgb_t(0xff, 0xff, 0xff)); // white
-}
-
-
-//-------------------------------------------------
-// MACHINE_CONFIG_FRAGMENT( abc800c_video )
-//-------------------------------------------------
-
-MACHINE_CONFIG_FRAGMENT( abc800c_video )
- MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
- MCFG_SCREEN_UPDATE_DRIVER(abc800c_state, screen_update)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
- MCFG_SCREEN_SIZE(480, 480)
- MCFG_SCREEN_VISIBLE_AREA(0, 480-1, 0, 480-1)
-
- MCFG_PALETTE_ADD("palette", 8)
- MCFG_PALETTE_INIT_OWNER(abc800c_state, abc800c)
-
- MCFG_DEVICE_ADD(SAA5052_TAG, SAA5052, XTAL_12MHz/2)
- MCFG_SAA5050_D_CALLBACK(READ8(abc800c_state, char_ram_r))
- MCFG_SAA5050_SCREEN_SIZE(40, 24, 40)
-MACHINE_CONFIG_END
-
-
-
-//**************************************************************************
-// ABC 800 MONOCHROME
-//**************************************************************************
-
-//-------------------------------------------------
-// hr_update - high resolution screen update
-//-------------------------------------------------
-
-void abc800m_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- UINT16 addr = 0;
-
- const pen_t *pen = m_palette->pens();
-
- for (int y = m_hrs + VERTICAL_PORCH_HACK; y < MIN(cliprect.max_y + 1, m_hrs + VERTICAL_PORCH_HACK + 240); y++)
- {
- int x = HORIZONTAL_PORCH_HACK;
-
- for (int sx = 0; sx < 64; sx++)
- {
- UINT8 data = m_video_ram[addr++];
-
- for (int dot = 0; dot < 4; dot++)
- {
- UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03);
- int color = (m_fgctl_prom->base()[fgctl_addr] & 0x07) ? 1 : 0;
-
- bitmap.pix32(y, x++) = pen[color];
- bitmap.pix32(y, x++) = pen[color];
-
- data <<= 2;
- }
- }
- }
-}
-
-
-//-------------------------------------------------
-// MC6845_UPDATE_ROW( abc800m_update_row )
-//-------------------------------------------------
-
-MC6845_UPDATE_ROW( abc800m_state::abc800m_update_row )
-{
- int column;
- rgb_t fgpen = m_palette->pen(1);
-
- y += vbp;
-
- for (column = 0; column < x_count; column++)
- {
- int bit;
-
- UINT16 address = (m_char_ram[(ma + column) & 0x7ff] << 4) | (ra & 0x0f);
- UINT8 data = (m_char_rom->base()[address & 0x7ff] & 0x3f);
-
- if (column == cursor_x)
- {
- data = 0x3f;
- }
-
- data <<= 2;
-
- for (bit = 0; bit < ABC800_CHAR_WIDTH; bit++)
- {
- int x = hbp + (column * ABC800_CHAR_WIDTH) + bit;
-
- if (BIT(data, 7) && de)
- {
- bitmap.pix32(y, x) = fgpen;
- }
-
- data <<= 1;
- }
- }
-}
-
-
-//-------------------------------------------------
-// SCREEN_UPDATE( abc800m )
-//-------------------------------------------------
-
-UINT32 abc800m_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- // clear screen
- bitmap.fill(rgb_t::black, cliprect);
-
- // draw HR graphics
- hr_update(bitmap, cliprect);
-
- // draw text
- if (!BIT(m_fgctl, 7))
- {
- m_crtc->screen_update(screen, bitmap, cliprect);
- }
-
- return 0;
-}
-
-
-//-------------------------------------------------
-// MACHINE_CONFIG_FRAGMENT( abc800m_video )
-//-------------------------------------------------
-
-MACHINE_CONFIG_FRAGMENT( abc800m_video )
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, ABC800_CCLK)
- MCFG_MC6845_SHOW_BORDER_AREA(true)
- MCFG_MC6845_CHAR_WIDTH(ABC800_CHAR_WIDTH)
- MCFG_MC6845_UPDATE_ROW_CB(abc800m_state, abc800m_update_row)
- MCFG_MC6845_OUT_VSYNC_CB(DEVWRITELINE(Z80DART_TAG, z80dart_device, rib_w))
-
- MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
- MCFG_SCREEN_UPDATE_DRIVER(abc800m_state, screen_update)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
- MCFG_SCREEN_SIZE(768, 312)
- MCFG_SCREEN_VISIBLE_AREA(0,768-1, 0, 312-1)
-
- MCFG_PALETTE_ADD_MONOCHROME_YELLOW("palette")
-MACHINE_CONFIG_END
diff --git a/src/mess/video/abc802.c b/src/mess/video/abc802.c
deleted file mode 100644
index 667f8cfe931..00000000000
--- a/src/mess/video/abc802.c
+++ /dev/null
@@ -1,220 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Curt Coder
-/*****************************************************************************
- *
- * video/abc802.c
- *
- ****************************************************************************/
-
-#include "includes/abc80x.h"
-
-
-
-//-------------------------------------------------
-// MC6845_UPDATE_ROW( abc802_update_row )
-//-------------------------------------------------
-
-MC6845_UPDATE_ROW( abc802_state::abc802_update_row )
-{
- /*
-
- PAL16R4 equation:
-
- IF (VCC) *OS = FC + RF / RC
- *RG: = HS / *RG + *ATE / *RG + ATD / *RG + LL /
- *RG + AT1 / *RG + AT0 / ATE + *ATD + *LL +
- *AT1 + *AT0
- *RI: = *RI + *INV / *RI + LL / *INV + *LL
- *RF: = HS / *RF + *ATE / *RF + ATD / *RF + LL /
- *RF + AT1 / *RF + AT0 / ATE + *ATD + *LL +
- *AT1 + AT0
- *RC: = HS / *RC + *ATE / *RC + *ATD / *RC + LL /
- *RC + *ATI / *RC + AT0 / ATE + *LL + *AT1 +
- *AT0
- IF (VCC) *O0 = *CUR + *AT0 / *CUR + ATE
- *O1 = *CUR + *AT1 / *CUR + ATE
-
-
- + = AND
- / = OR
- * = Inverted
-
- ATD Attribute data
- ATE Attribute enable
- AT0,AT1 Attribute address
- CUR Cursor
- FC FLSH clock
- HS Horizontal sync
- INV Inverted signal input
- LL Load when Low
- OEL Output Enable when Low
- RC Row clear
- RF Row flash
- RG Row graphic
- RI Row inverted
-
- */
-
- const pen_t *pen = m_palette->pens();
-
- int rf = 0, rc = 0, rg = 0;
-
- y += vbp;
-
- for (int column = 0; column < x_count; column++)
- {
- UINT8 code = m_char_ram[(ma + column) & 0x7ff];
- UINT16 address = code << 4;
- UINT8 ra_latch = ra;
- UINT8 data;
-
- int ri = (code & ABC802_INV) ? 1 : 0;
-
- if (column == cursor_x)
- {
- ra_latch = 0x0f;
- }
-
- if ((m_flshclk && rf) || rc)
- {
- ra_latch = 0x0e;
- }
-
- if (rg)
- {
- address |= 0x800;
- }
-
- data = m_char_rom->base()[(address + ra_latch) & 0xfff];
-
- if (data & ABC802_ATE)
- {
- int attr = data & 0x03;
- int value = (data & ABC802_ATD) ? 1 : 0;
-
- switch (attr)
- {
- case 0x00:
- // Row Graphic
- rg = value;
- break;
-
- case 0x01:
- // Row Flash
- rf = value;
- break;
-
- case 0x02:
- // Row Clear
- rc = value;
- break;
-
- case 0x03:
- // undefined
- break;
- }
- }
- else
- {
- data <<= 2;
-
- if (m_80_40_mux)
- {
- for (int bit = 0; bit < ABC800_CHAR_WIDTH; bit++)
- {
- int x = hbp + ((column + 3) * ABC800_CHAR_WIDTH) + bit;
- int color = (BIT(data, 7) ^ ri) && de;
-
- bitmap.pix32(y, x) = pen[color];
-
- data <<= 1;
- }
- }
- else
- {
- for (int bit = 0; bit < ABC800_CHAR_WIDTH; bit++)
- {
- int x = hbp + ((column + 3) * ABC800_CHAR_WIDTH) + (bit << 1);
- int color = (BIT(data, 7) ^ ri) && de;
-
- bitmap.pix32(y, x) = pen[color];
- bitmap.pix32(y, x + 1) = pen[color];
-
- data <<= 1;
- }
-
- column++;
- }
- }
- }
-}
-
-
-//-------------------------------------------------
-// vs_w - vertical sync write
-//-------------------------------------------------
-
-WRITE_LINE_MEMBER( abc802_state::vs_w )
-{
- if (!state)
- {
- // flash clock
- if (m_flshclk_ctr & 0x20)
- {
- m_flshclk = !m_flshclk;
- m_flshclk_ctr = 0;
- }
- else
- {
- m_flshclk_ctr++;
- }
- }
-
- // signal _DEW to DART
- m_dart->rib_w(!state);
-}
-
-
-void abc802_state::video_start()
-{
- // register for state saving
- save_item(NAME(m_flshclk_ctr));
- save_item(NAME(m_flshclk));
- save_item(NAME(m_80_40_mux));
-}
-
-
-//-------------------------------------------------
-// SCREEN_UPDATE( abc802 )
-//-------------------------------------------------
-
-UINT32 abc802_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- // draw text
- m_crtc->screen_update(screen, bitmap, cliprect);
-
- return 0;
-}
-
-
-//-------------------------------------------------
-// MACHINE_CONFIG_FRAGMENT( abc802_video )
-//-------------------------------------------------
-
-MACHINE_CONFIG_FRAGMENT( abc802_video )
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, ABC800_CCLK)
- MCFG_MC6845_SHOW_BORDER_AREA(true)
- MCFG_MC6845_CHAR_WIDTH(ABC800_CHAR_WIDTH)
- MCFG_MC6845_UPDATE_ROW_CB(abc802_state, abc802_update_row)
- MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(abc802_state, vs_w))
-
- MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
- MCFG_SCREEN_UPDATE_DRIVER(abc802_state, screen_update)
-
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
- MCFG_SCREEN_SIZE(768, 312)
- MCFG_SCREEN_VISIBLE_AREA(0,768-1, 0, 312-1)
-
- MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette")
-MACHINE_CONFIG_END
diff --git a/src/mess/video/abc806.c b/src/mess/video/abc806.c
deleted file mode 100644
index f958b025b1c..00000000000
--- a/src/mess/video/abc806.c
+++ /dev/null
@@ -1,507 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Curt Coder
-/*****************************************************************************
- *
- * video/abc806.c
- *
- ****************************************************************************/
-
-#include "includes/abc80x.h"
-
-
-
-#define HORIZONTAL_PORCH_HACK 109
-#define VERTICAL_PORCH_HACK 27
-
-
-
-//-------------------------------------------------
-// hrs_w - high resolution memory banking
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc806_state::hrs_w )
-{
- /*
-
- bit signal description
-
- 0 VM14 visible screen memory area bit 0
- 1 VM15 visible screen memory area bit 1
- 2 VM16 visible screen memory area bit 2
- 3 VM17 visible screen memory area bit 3
- 4 F14 cpu accessible screen memory area bit 0
- 5 F15 cpu accessible screen memory area bit 1
- 6 F16 cpu accessible screen memory area bit 2
- 7 F17 cpu accessible screen memory area bit 3
-
- */
-
- m_hrs = data;
-}
-
-
-//-------------------------------------------------
-// hrc_w - high resolution color write
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc806_state::hrc_w )
-{
- int reg = (offset >> 8) & 0x0f;
-
- m_hrc[reg] = data;
-}
-
-
-//-------------------------------------------------
-// charram_r - character RAM read
-//-------------------------------------------------
-
-READ8_MEMBER( abc806_state::charram_r )
-{
- m_attr_data = m_attr_ram[offset];
-
- return m_char_ram[offset];
-}
-
-
-//-------------------------------------------------
-// charram_w - character RAM write
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc806_state::charram_w )
-{
- m_attr_ram[offset] = m_attr_data;
-
- m_char_ram[offset] = data;
-}
-
-
-//-------------------------------------------------
-// ami_r - attribute memory read
-//-------------------------------------------------
-
-READ8_MEMBER( abc806_state::ami_r )
-{
- return m_attr_data;
-}
-
-
-//-------------------------------------------------
-// amo_w - attribute memory write
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc806_state::amo_w )
-{
- m_attr_data = data;
-}
-
-
-//-------------------------------------------------
-// cli_r - palette PROM read
-//-------------------------------------------------
-
-READ8_MEMBER( abc806_state::cli_r )
-{
- /*
-
- bit description
-
- 0 HRU II data bit 0
- 1 HRU II data bit 1
- 2 HRU II data bit 2
- 3 HRU II data bit 3
- 4
- 5
- 6
- 7 RTC data output
-
- */
-
- UINT16 hru2_addr = (m_hru2_a8 << 8) | (offset >> 8);
- UINT8 data = m_hru2_prom->base()[hru2_addr] & 0x0f;
-
- logerror("HRU II %03x : %01x\n", hru2_addr, data);
-
- data |= m_rtc->dio_r() << 7;
-
- return data;
-}
-
-
-//-------------------------------------------------
-// sti_r - protection device read
-//-------------------------------------------------
-
-READ8_MEMBER( abc806_state::sti_r )
-{
- /*
-
- bit description
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7 PROT DOUT
-
- */
-
- return 0x7f;
-}
-
-
-//-------------------------------------------------
-// sto_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc806_state::sto_w )
-{
- int level = BIT(data, 7);
-
- switch (data & 0x07)
- {
- case 0:
- // external memory enable
- m_eme = level;
- break;
- case 1:
- // 40/80 column display
- m_40 = level;
- break;
- case 2:
- // HRU II address line 8, PROT A0
- m_hru2_a8 = level;
- break;
- case 3:
- // PROT INI
- break;
- case 4:
- // text display enable
- m_txoff = level;
- break;
- case 5:
- // RTC chip select
- m_rtc->cs_w(!level);
- break;
- case 6:
- // RTC clock
- m_rtc->clk_w(level);
- break;
- case 7:
- // RTC data in, PROT DIN
- m_rtc->dio_w(level);
- break;
- }
-}
-
-
-//-------------------------------------------------
-// sso_w - sync offset write
-//-------------------------------------------------
-
-WRITE8_MEMBER( abc806_state::sso_w )
-{
- m_sync = data & 0x3f;
-}
-
-
-//-------------------------------------------------
-// MC6845_UPDATE_ROW( abc806_update_row )
-//-------------------------------------------------
-
-MC6845_UPDATE_ROW( abc806_state::abc806_update_row )
-{
- const pen_t *pen = m_palette->pens();
-
- int fg_color = 7;
- int bg_color = 0;
- int underline = 0;
- int flash = 0;
- int e5 = m_40;
- int e6 = m_40;
- int th = 0;
-
- y += m_sync + vbp;
-
- for (int column = 0; column < x_count; column++)
- {
- UINT8 data = m_char_ram[(ma + column) & 0x7ff];
- UINT8 attr = m_attr_ram[(ma + column) & 0x7ff];
- UINT8 rad_data;
-
- if ((attr & 0x07) == ((attr >> 3) & 0x07))
- {
- // special case
- switch (attr >> 6)
- {
- case 0:
- // use previously selected attributes
- break;
-
- case 1:
- // reserved for future use
- break;
-
- case 2:
- // blank
- fg_color = 0;
- bg_color = 0;
- underline = 0;
- flash = 0;
- break;
-
- case 3:
- // double width
- e5 = BIT(attr, 0);
- e6 = BIT(attr, 1);
-
- // read attributes from next byte
- attr = m_attr_ram[(ma + column + 1) & 0x7ff];
-
- if (attr != 0x00)
- {
- fg_color = attr & 0x07;
- bg_color = (attr >> 3) & 0x07;
- underline = BIT(attr, 6);
- flash = BIT(attr, 7);
- }
- break;
- }
- }
- else
- {
- // normal case
- fg_color = attr & 0x07;
- bg_color = (attr >> 3) & 0x07;
- underline = BIT(attr, 6);
- flash = BIT(attr, 7);
- e5 = m_40;
- e6 = m_40;
- }
-
- if (column == cursor_x)
- {
- rad_data = 0x0f;
- }
- else
- {
- UINT16 rad_addr = (e6 << 8) | (e5 << 7) | (flash << 6) | (underline << 4) | (m_flshclk << 5) | (ra & 0x0f);
- rad_data = m_rad_prom->base()[rad_addr] & 0x0f;
- }
-
- UINT16 chargen_addr = (th << 12) | (data << 4) | rad_data;
- UINT8 chargen_data = m_char_rom->base()[chargen_addr & 0xfff] << 2;
- int x = hbp + (column + 4) * ABC800_CHAR_WIDTH;
-
- for (int bit = 0; bit < ABC800_CHAR_WIDTH; bit++)
- {
- int color = BIT(chargen_data, 7) ? fg_color : bg_color;
- if (!de) color = 0;
-
- bitmap.pix32(y, x++) = pen[color];
-
- if (e5 || e6)
- {
- bitmap.pix32(y, x++) = pen[color];
- }
-
- chargen_data <<= 1;
- }
-
- if (e5 || e6)
- {
- column++;
- }
- }
-}
-
-
-//-------------------------------------------------
-// hs_w - horizontal sync write
-//-------------------------------------------------
-
-WRITE_LINE_MEMBER( abc806_state::hs_w )
-{
- int vsync;
-
- if (!state)
- {
- m_v50_addr++;
-
- // clock current vsync value into the shift register
- m_vsync_shift <<= 1;
- m_vsync_shift |= m_vsync;
-
- vsync = BIT(m_vsync_shift, m_sync);
-
- if (!m_d_vsync && vsync)
- {
- // clear V50 address
- m_v50_addr = 0;
- }
- else if (m_d_vsync && !vsync)
- {
- // flash clock
- if (m_flshclk_ctr & 0x20)
- {
- m_flshclk = !m_flshclk;
- m_flshclk_ctr = 0;
- }
- else
- {
- m_flshclk_ctr++;
- }
- }
-
- if (m_d_vsync != vsync)
- {
- // signal _DEW to DART
- m_dart->rib_w(!vsync);
- }
-
- m_d_vsync = vsync;
- }
-}
-
-
-//-------------------------------------------------
-// vs_w - vertical sync write
-//-------------------------------------------------
-
-WRITE_LINE_MEMBER( abc806_state::vs_w )
-{
- m_vsync = state;
-}
-
-
-//-------------------------------------------------
-// hr_update - high resolution screen update
-//-------------------------------------------------
-
-void abc806_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- const pen_t *pen = m_palette->pens();
-
- UINT32 addr = (m_hrs & 0x0f) << 15;
-
- for (int y = m_sync + VERTICAL_PORCH_HACK; y < MIN(cliprect.max_y + 1, m_sync + VERTICAL_PORCH_HACK + 240); y++)
- {
- for (int sx = 0; sx < 128; sx++)
- {
- UINT8 data = m_video_ram[addr++];
- UINT16 dot = (m_hrc[data >> 4] << 8) | m_hrc[data & 0x0f];
-
- for (int pixel = 0; pixel < 4; pixel++)
- {
- int x = HORIZONTAL_PORCH_HACK + (ABC800_CHAR_WIDTH * 4) - 16 + (sx * 4) + pixel;
-
- if (BIT(dot, 15) || (bitmap.pix32(y, x) == rgb_t::black))
- {
- bitmap.pix32(y, x) = pen[(dot >> 12) & 0x07];
- }
-
- dot <<= 4;
- }
- }
- }
-}
-
-
-void abc806_state::video_start()
-{
- // initialize variables
- for (int i = 0; i < 16; i++)
- {
- m_hrc[i] = 0;
- }
-
- m_sync = 10;
- m_d_vsync = 1;
- m_vsync = 1;
- m_40 = 1;
-
- // allocate memory
- m_char_ram.allocate(ABC806_CHAR_RAM_SIZE);
- m_attr_ram.allocate(ABC806_ATTR_RAM_SIZE);
-
- // register for state saving
- save_item(NAME(m_txoff));
- save_item(NAME(m_40));
- save_item(NAME(m_flshclk_ctr));
- save_item(NAME(m_flshclk));
- save_item(NAME(m_attr_data));
- save_item(NAME(m_hrs));
- save_item(NAME(m_hrc));
- save_item(NAME(m_sync));
- save_item(NAME(m_v50_addr));
- save_item(NAME(m_hru2_a8));
- save_item(NAME(m_vsync_shift));
- save_item(NAME(m_vsync));
- save_item(NAME(m_d_vsync));
-}
-
-
-//-------------------------------------------------
-// SCREEN_UPDATE( abc806 )
-//-------------------------------------------------
-
-UINT32 abc806_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- // clear screen
- bitmap.fill(rgb_t::black, cliprect);
-
- if (!m_txoff)
- {
- // draw text
- m_crtc->screen_update(screen, bitmap, cliprect);
- }
-
- // draw HR graphics
- hr_update(bitmap, cliprect);
-
- return 0;
-}
-
-
-//-------------------------------------------------
-// PALETTE_INIT( abc806 )
-//-------------------------------------------------
-
-PALETTE_INIT_MEMBER( abc806_state, abc806 )
-{
- palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); // black
- palette.set_pen_color(1, rgb_t(0xff, 0x00, 0x00)); // red
- palette.set_pen_color(2, rgb_t(0x00, 0xff, 0x00)); // green
- palette.set_pen_color(3, rgb_t(0xff, 0xff, 0x00)); // yellow
- palette.set_pen_color(4, rgb_t(0x00, 0x00, 0xff)); // blue
- palette.set_pen_color(5, rgb_t(0xff, 0x00, 0xff)); // magenta
- palette.set_pen_color(6, rgb_t(0x00, 0xff, 0xff)); // cyan
- palette.set_pen_color(7, rgb_t(0xff, 0xff, 0xff)); // white
-}
-
-
-//-------------------------------------------------
-// MACHINE_CONFIG_FRAGMENT( abc806_video )
-//-------------------------------------------------
-
-MACHINE_CONFIG_FRAGMENT( abc806_video )
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, ABC800_CCLK)
- MCFG_MC6845_SHOW_BORDER_AREA(true)
- MCFG_MC6845_CHAR_WIDTH(ABC800_CHAR_WIDTH)
- MCFG_MC6845_UPDATE_ROW_CB(abc806_state, abc806_update_row)
- MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(abc806_state, hs_w))
- MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(abc806_state, vs_w))
-
- MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
- MCFG_SCREEN_UPDATE_DRIVER(abc806_state, screen_update)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
- MCFG_SCREEN_SIZE(768, 312)
- MCFG_SCREEN_VISIBLE_AREA(0, 768-1, 0, 312-1)
-
- MCFG_PALETTE_ADD("palette", 8)
- MCFG_PALETTE_INIT_OWNER(abc806_state, abc806)
-MACHINE_CONFIG_END
diff --git a/src/mess/video/ac1.c b/src/mess/video/ac1.c
deleted file mode 100644
index 8af6b695baa..00000000000
--- a/src/mess/video/ac1.c
+++ /dev/null
@@ -1,61 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
-/***************************************************************************
-
- AC1 video driver by Miodrag Milanovic
-
- 15/01/2009 Preliminary driver.
-
-****************************************************************************/
-
-#include "emu.h"
-#include "includes/ac1.h"
-
-#define AC1_VIDEO_MEMORY 0x1000
-
-const gfx_layout ac1_charlayout =
-{
- 6, 8, /* 6x8 characters */
- 256, /* 256 characters */
- 1, /* 1 bits per pixel */
- {0}, /* no bitplanes; 1 bit per pixel */
- {7, 6, 5, 4, 3, 2},
- {0 * 8, 1 * 8, 2 * 8, 3 * 8, 4 * 8, 5 * 8, 6 * 8, 7 * 8},
- 8*8 /* size of one char */
-};
-
-void ac1_state::video_start()
-{
-}
-
-UINT32 ac1_state::screen_update_ac1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- int x,y;
- address_space &space = m_maincpu->space(AS_PROGRAM);
-
- for(y = 0; y < 16; y++ )
- {
- for(x = 0; x < 64; x++ )
- {
- int code = space.read_byte(AC1_VIDEO_MEMORY + x + y*64);
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, code , 0, 0,0, 63*6-x*6,15*8-y*8);
- }
- }
- return 0;
-}
-
-UINT32 ac1_state::screen_update_ac1_32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- int x,y;
- address_space &space = m_maincpu->space(AS_PROGRAM);
-
- for(y = 0; y < 32; y++ )
- {
- for(x = 0; x < 64; x++ )
- {
- int code = space.read_byte(AC1_VIDEO_MEMORY + x + y*64);
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, code , 0, 0,0, 63*6-x*6,31*8-y*8);
- }
- }
- return 0;
-}
diff --git a/src/mess/video/advision.c b/src/mess/video/advision.c
deleted file mode 100644
index 086f61c6175..00000000000
--- a/src/mess/video/advision.c
+++ /dev/null
@@ -1,110 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Nathan Woods
-/***************************************************************************
-
- video/advision.c
-
- Routines to control the Adventurevision video hardware
-
- Video hardware is composed of a vertical array of 40 LEDs which is
- reflected off a spinning mirror, to give a resolution of 150 x 40 at 15 FPS.
-
-***************************************************************************/
-
-#include "emu.h"
-#include "includes/advision.h"
-
-/***************************************************************************
-
- Start the video hardware emulation.
-
-***************************************************************************/
-
-void advision_state::video_start()
-{
- m_video_hpos = 0;
- m_display.resize(8 * 8 * 256);
- memset(&m_display[0], 0, 8*8*256);
- save_item(NAME(m_display));
- save_item(NAME(m_video_hpos));
-}
-
-/***************************************************************************
-
- Initialise the palette.
-
-***************************************************************************/
-
-PALETTE_INIT_MEMBER(advision_state, advision)
-{
- for (int i = 0; i < 8; i++)
- {
- /* 8 shades of RED */
- m_palette->set_pen_color(i, i * 0x22, 0x00, 0x00);
- }
-}
-
-/***************************************************************************
-
- Update the display data.
-
-***************************************************************************/
-
-void advision_state::vh_write(int data)
-{
- if (m_video_bank >= 1 && m_video_bank <=5)
- {
- m_led_latch[m_video_bank] = data;
- }
-}
-
-void advision_state::vh_update(int x)
-{
- UINT8 *dst = &m_display[x];
-
- for (int y = 0; y < 8; y++)
- {
- UINT8 data = m_led_latch[7 - y];
-
- for (int i = 0; i < 8; i++)
- {
- if (!BIT(data, 7 - i))
- dst[i * 256] = 8;
- }
-
- m_led_latch[7 - y] = 0xff;
- dst += 8 * 256;
- }
-}
-
-
-/***************************************************************************
-
- Refresh the video screen
-
-***************************************************************************/
-
-UINT32 advision_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- if ((m_frame_count++ % 4) == 0)
- {
- m_frame_start = 1;
- m_video_hpos = 0;
- }
-
- for (int x = 0; x < 150; x++)
- {
- UINT8 *led = &m_display[x];
-
- for (int y = 0; y < 128; y+=2)
- {
- if (*led > 0)
- bitmap.pix16(30 + y, 85 + x) = --(*led);
- else
- bitmap.pix16(30 + y, 85 + x) = 0;
-
- led += 256;
- }
- }
- return 0;
-}
diff --git a/src/mess/video/alesis.c b/src/mess/video/alesis.c
deleted file mode 100644
index 08f4554a4f2..00000000000
--- a/src/mess/video/alesis.c
+++ /dev/null
@@ -1,167 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Sandro Ronco
-/***************************************************************************
-
- Alesis SR-16 LCD emulation
-
-****************************************************************************/
-
-#include "emu.h"
-#include "includes/alesis.h"
-
-
-void alesis_state::update_lcd_symbols(bitmap_ind16 &bitmap, UINT8 pos, UINT8 y, UINT8 x, int state)
-{
- if (pos == 6)
- {
- switch(x)
- {
- case 0:
- switch(y)
- {
- case 0: output_set_value("a_next", state); break;
- case 1: output_set_value("b_next", state); break;
- case 2: output_set_value("fill_next", state); break;
- case 3: output_set_value("user_next", state); break;
- case 4: output_set_value("play", state); break;
- case 5: output_set_value("record", state); break;
- case 6: output_set_value("compose", state); break;
- case 7: output_set_value("perform", state); break;
- }
- break;
- case 1:
- if (y == 0)
- {
- output_set_value("song", state);
- }
- else if (y < 8)
- {
- if (state)
- m_lcd_digits[0] |= (1<<(y-1));
- else
- m_lcd_digits[0] &= ~(1<<(y-1));
-
- output_set_value("digit0", BITSWAP8(m_lcd_digits[0],7,3,1,4,6,5,2,0));
- }
- break;
- case 2:
- if (y == 0)
- {
- output_set_value("pattern", state);
- }
- else if (y < 8)
- {
- if (state)
- m_lcd_digits[1] |= (1<<(y-1));
- else
- m_lcd_digits[1] &= ~(1<<(y-1));
-
- output_set_value("digit1", BITSWAP8(m_lcd_digits[1],7,3,1,4,6,5,2,0));
- }
- break;
- case 3:
- switch(y)
- {
- case 0: output_set_value("b", state); break;
- case 1: output_set_value("a", state); break;
- case 2: output_set_value("fill", state); break;
- case 3: output_set_value("user", state); break;
- case 4: output_set_value("edited", state); break;
- case 5: output_set_value("set", state); break;
- case 6: output_set_value("drum", state); break;
- case 7: output_set_value("press_play", state); break;
- }
- break;
- case 4:
- if (y == 7)
- {
- output_set_value("metronome", state);
- }
- else if (y < 7)
- {
- if (state)
- m_lcd_digits[4] |= (1<<y);
- else
- m_lcd_digits[4] &= ~(1<<y);
-
- output_set_value("digit4", BITSWAP8(m_lcd_digits[4],7,3,5,2,0,1,4,6));
- }
- break;
- }
- }
- else
- {
- switch(x)
- {
- case 0:
- if (y == 7)
- {
- output_set_value("tempo", state);
- }
- else if (y < 7)
- {
- if (state)
- m_lcd_digits[3] |= (1<<y);
- else
- m_lcd_digits[3] &= ~(1<<y);
-
- output_set_value("digit3", BITSWAP8(m_lcd_digits[3],7,3,5,2,0,1,4,6));
- }
- break;
- case 1:
- if (y == 7)
- {
- output_set_value("page", state);
- }
- else if (y < 7)
- {
- if (state)
- m_lcd_digits[2] |= (1<<y);
- else
- m_lcd_digits[2] &= ~(1<<y);
-
- output_set_value("digit2", BITSWAP8(m_lcd_digits[2],7,3,5,2,0,1,4,6));
- }
- break;
- case 2:
- switch(y)
- {
- case 0: output_set_value("step_edit", state); break;
- case 1: output_set_value("swing_off", state); break;
- case 2: output_set_value("swing_62", state); break;
- case 3: output_set_value("click_l1", state); break;
- case 4: output_set_value("click_note", state); break;
- case 5: output_set_value("click_l2", state); break;
- case 6: output_set_value("click_3", state); break;
- case 7: output_set_value("backup", state); break;
- }
- break;
- case 3:
- switch(y)
- {
- case 0: output_set_value("drum_set", state); break;
- case 1: output_set_value("swing", state); break;
- case 2: output_set_value("swing_58", state); break;
- case 3: output_set_value("click_off", state); break;
- case 4: output_set_value("click", state); break;
- case 5: output_set_value("quantize_off", state); break;
- case 6: output_set_value("quantize_3", state); break;
- case 7: output_set_value("midi_setup", state); break;
- }
- break;
- case 4:
- switch(y)
- {
- case 0: output_set_value("record_setup", state); break;
- case 1: output_set_value("quantize", state); break;
- case 2: output_set_value("swing_54", state); break;
- case 3: output_set_value("quantize_l1", state); break;
- case 4: output_set_value("quantize_l2", state); break;
- case 5: output_set_value("quantize_l3", state); break;
- case 6: output_set_value("quantize_note", state); break;
- case 7: output_set_value("setup", state); break;
- }
- break;
- }
- }
-}
diff --git a/src/mess/video/apollo.c b/src/mess/video/apollo.c
deleted file mode 100644
index c79464355c3..00000000000
--- a/src/mess/video/apollo.c
+++ /dev/null
@@ -1,1978 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Hans Ostermeyer, R. Belmont
-/*
- * video/apollo.c
- *
- * Created on: April 25, 2013
- * Author: Hans Ostermeyer
- *
- * see also:
- * - Domain Series 3000/Series 4000 Hardware Architecture Handbook (Order No. 007861 Rev. 02)
- * - http://www.bitsavers.org/pdf/apollo/002398-04_Domain_Engineering_Handbook_Rev4_Jan87.pdf (page 12-16 ...)
- * - http://www.bitsavers.org/pdf/brooktree/Brooktree_1991.pdf (page 305 ...)
- *
- */
-
-#define VERBOSE 0
-
-#include "includes/apollo.h"
-
-#include "apollo.lh"
-#include "apollo_15i.lh"
-
-/***************************************************************************
- TYPE DEFINITIONS
- ***************************************************************************/
-
-// monochrome 1280x1024
-#define SCREEN_DEVICE_ID_19I 9
-
-// monochrome 1024x800
-#define SCREEN_DEVICE_ID_15I 11
-
-// 4 plane color 1024x800
-#define SCREEN_DEVICE_ID_C4P 8
-
-// 8 plane color 1024x800
-#define SCREEN_DEVICE_ID_C8P 10
-
-#define VIDEO_SCREEN_TAG "screen"
-
-// status register
-#define SR_BLANK 0x80
-#define SR_V_BLANK 0x40
-#define SR_H_SYNC 0x20
-#define SR_DONE 0x20 // 4- and 8-plane color
-#define SR_R_M_W 0x10
-#define SR_ALT 0x08
-#define SR_V_SYNC 0x04
-#define SR_SYNC 0x04 // 4- and 8-plane color
-#define SR_H_CK 0x02
-#define SR_V_DATA 0x01
-#define SR_V_FLAG 0x01 // 4-plane color
-#define SR_LUT_OK 0x01 // 8-plane color
-// control register 0
-#define CR0_MODE(a) ((a) >> 5)
-#define CR0_MODE_0 0
-#define CR0_MODE_1 1
-#define CR0_MODE_VECTOR 2
-#define CR0_MODE_3 3
-#define CR0_MODE_BLT 4
-#define CR0_MODE_NORMAL 7
-#define CR0_SHIFT(a) ((a) & 0x1f)
-
-// control register 1
-#define CR1_INV 0x80
-#define CR1_AD_BIT 0x80 // 4- and 8-plane color
-#define CR1_DADDR_16 0x40
-#define CR1_DV_CK 0x40 // 4- and 8-plane color
-#define CR1_DH_CK 0x20
-#define CR1_ROP_EN 0x10
-#define CR1_RESET 0x08
-#define CR1_DP_CK 0x04
-#define CR1_SYNC_EN 0x02
-#define CR1_DISP_EN 0x01
-
-// control register 2
-#define CR2_S_DATA(a) ((a) >> 6)
-#define CR2_CONST_ACCESS 0x00
-#define CR2_PIXEL_ACCESS 0x01
-#define CR2_SHIFT_ACCESS 0x02
-#define CR2_PLANE_ACCESS 0x03
-#define CR2_S_PLANE(a) (((a) >> 4) & 0x03)
-#define CR2_D_PLANE(a) ((a) & 0x0f)
-#define CR2B_S_PLANE(a) ((a) & 0x07)
-#define CR2A_D_PLANE(a) (a)
-
-// Lookup table control register
-#define LUT_AD_CS 0x80
-#define LUT_CPAL_CS 0x40
-#define LUT_FIFO_CS 0x20
-#define LUT_FIFO_RST 0x10
-#define LUT_ST_LUK 0x08
-#define LUT_R_W 0x04
-#define LUT_C1 0x02
-#define LUT_C0 0x01
-#define LUT_C1_C0(a) ((a)& (LUT_C1|LUT_C0))
-
-
-apollo_graphics_15i::bt458::bt458(running_machine &running_machine)
-{
- m_machine = &running_machine;
-}
-
-void apollo_graphics_15i::bt458::start()
-{
- MLOG1(("start apollo_graphics_15i::bt458"));
-}
-
-void apollo_graphics_15i::bt458::reset()
-{
- MLOG1(("reset apollo_graphics_15i::bt458"));
-
- m_color_counter = 0;
- m_red = 0;
- m_green = 0;
-
- m_address_register = 0;
- memset(m_color_palette_RAM, 0, sizeof(m_color_palette_RAM));
- memset(m_overlay_color, 0, sizeof(m_overlay_color));
- m_read_mask_register = 0;
- m_blink_mask_register = 0;
- m_command_register = 0;
- m_control_test_register = 0;
-}
-
-void apollo_graphics_15i::bt458::write(UINT8 data, UINT8 c10)
-{
- MLOG1(("writing Bt458 data=%02x C1,C0=%d", data, c10));
- switch (c10)
- {
- case 0: // address register
- m_address_register = data;
- m_color_counter = 0;
- MLOG1(("bt458::write 0: addr=%02x", data));
- break;
- case 1: // color palette RAM
- switch (m_color_counter)
- {
- case 0:
- m_red = data;
- m_color_counter++;
- break;
- case 1:
- m_green = data;
- m_color_counter++;
- break;
- case 2:
- m_color_palette_RAM[m_address_register] = (m_red << 16) | (m_green << 8) | data;
- m_address_register++;
- m_color_counter = 0;
- break;
- }
- break;
- case 2: // registers
- switch (m_address_register)
- {
- case 0x04:
- m_read_mask_register = data;
- MLOG1(("bt458::write: writing Bt458 m_read_mask_register=%02x", data))
- break;
- case 0x05:
- m_blink_mask_register = data;
- MLOG1(("bt458::write: writing Bt458 m_blink_mask_register=%02x", data))
- break;
- case 0x06:
- m_command_register = data;
- MLOG1(("bt458::write: writing Bt458 m_command_register=%02x", data))
- break;
- case 0x07:
- m_control_test_register = data;
- break;
- default:
- MLOG1(("bt458::write: writing unexpected Bt458 data=%02x C1,C0=%d at %02x", data, c10, m_address_register))
- break;
- }
- break;
- case 3: // overlay color
- switch (m_address_register)
- {
- case 0x00:
- case 0x01:
- case 0x02:
- case 0x03:
- m_overlay_color[m_address_register] = data;
- MLOG1(("bt458::write: writing Bt458 m_overlay_color[%d]=%02x",m_address_register, data));
- break;
- default:
- MLOG1(("bt458::write: writing unexpected Bt458 data=%02x C1,C0=%d at %02x", data, c10, m_address_register));
- break;
- }
- break;
- default:
- MLOG1(("bt458::write: writing unexpected Bt458 data=%02x C1,C0=%d", data, c10))
- ;
- break;
- }
-}
-
-UINT8 apollo_graphics_15i::bt458::read(UINT8 c10)
-{
- UINT8 data = 0xff;
-
- switch (c10)
- {
- case 0: // address register
- data = m_address_register;
- break;
- case 1: // color palette RAM
- switch (m_color_counter)
- {
- case 0: // red
- data = (m_color_palette_RAM[m_address_register] >> 16) & 0xff;
- m_color_counter++;
- break;
- case 1: // Green
- data = (m_color_palette_RAM[m_address_register] >> 8) & 0xff;
- m_color_counter++;
- break;
- case 2: // blue
- data = m_color_palette_RAM[m_address_register] & 0xff;
- m_address_register++;
- m_color_counter = 0;
- break;
- }
- break;
- case 2: // registers
- switch (m_address_register)
- {
- case 0x04:
- data = m_read_mask_register;
- MLOG1(("bt458::read: reading Bt458 m_read_mask_register=%02x", data))
- break;
- case 0x05:
- data = m_blink_mask_register;
- MLOG1(("bt458::read: reading Bt458 m_blink_mask_register=%02x", data))
- break;
- case 0x06:
- data = m_command_register;
- MLOG1(("bt458::read: reading Bt458 m_command_register=%02x", data))
- break;
- case 0x07:
- {
- UINT32 rgb = m_color_palette_RAM[0];
- switch (m_control_test_register & 0x0f)
- {
- case 0x01: data = 0x01 | ((rgb >> 16) & 0xf0); break;
- case 0x09: data = 0x09 | ((rgb >> 12) & 0xf0); break;
- case 0x02: data = 0x02 | ((rgb >> 8) & 0xf0); break;
- case 0x0a: data = 0x0a | ((rgb >> 4) & 0xf0); break;
- case 0x04: data = 0x04 | ((rgb >> 0) & 0xf0); break;
- case 0x0c: data = 0x0c | ((rgb << 4) & 0xf0); break;
- default: data = 0xff; break;
- }
- }
- break;
- default:
- MLOG1(("bt458::read: reading unexpected Bt458 data=%02x C1,C0=%d at %02x", data, c10, m_address_register))
- break;
- }
- break;
- default:
- MLOG1(("bt458::read: reading unexpected Bt458 data=%02x C1,C0=%d at %02x", data, c10, m_address_register))
- break;
- }
-
-// MLOG1(("reading Bt458 data=%02x cs=%d", m_data, c10));
- return data;
-}
-
-UINT32 apollo_graphics_15i::bt458::get_rgb(UINT8 index)
-{
- return m_color_palette_RAM[index];
-}
-
-/***************************************************************************
- Monochrome Controller Registers at 0x5d800 - 0x5dc07
- ***************************************************************************/
-
-const char *apollo_graphics_15i::cr_text(offs_t offset, UINT8 data, UINT8 rw)
-{
- static const char *cr0[8] =
- { "cr0 mode=0 CPU dest BLT", "cr0 mode=1 Alternating BLT",
- "cr0 mode=2 Vector mode", "cr0 mode=3 CPU Source BLT",
- "cr0 mode=4 Double access BLT ", "cr0 mode=5 ???",
- "cr0 mode=6 ???", "cr0 mode=7 Normal" };
-
- static const char *cr2[4] =
- { "cr2 Constant access", "cr2 Pixel access", "cr2 ???",
- "cr2 Plane access" };
-
- static const char *cr2b[4] =
- { "cr2b Constant access", "cr2b Pixel access", "cr2b ???",
- "cr2b Plane access" };
-
- switch (offset & 0x407)
- {
- case 0:
- return rw ? "sr" : "we";
- case 1:
- return rw ? "id" : "we";
- case 2:
- case 3:
- return "rop0";
- case 4:
- case 5:
- return m_n_planes == 8 ? "rop1" : "mem refresh";
- case 6:
- case 7:
- return m_n_planes == 8 ? "mem refresh" : "???";
- case 0x400:
- return cr0[data >> 5];
- case 0x401:
- return m_n_planes == 8 ? "LUT data" : "red";
- case 0x402:
- return "cr1";
- case 0x403:
- return m_n_planes == 8 ? "LUT ctrl" : "green";
- case 0x404:
- return m_n_planes == 8 ? "cr2a" : cr2[data >> 6];
- case 0x405:
- return m_n_planes == 8 ? cr2b[data >> 6] : "blue";
- case 0x406:
- return "cr3";
- case 0x407:
- return m_n_planes == 8 ? "cr3b" : "a/d";
- default:
- return "???";
- }
-}
-
-void apollo_graphics_15i::log_cr1(const char * text)
-{
- MLOG2(("%s: cr0=%02x cr1=%02x sr=%02x pixel_clock=%3d/%3d bl=%d vb=%d vs=%d hs=%d hc=%d vck=%d hck=%d pck=%d vd=%d",
- text,
- m_cr0,
- m_cr1,
- m_sr,
- m_p_clock,
- m_data_clock,
- m_sr & SR_BLANK ? 1 : 0,
- m_sr & SR_V_BLANK ? 1 : 0,
- m_sr & SR_V_SYNC ? 1 : 0,
- m_sr & SR_H_SYNC ? 1 : 0,
- m_sr & SR_H_CK ? 1 : 0,
- m_cr1 & CR1_DV_CK ? 1 : 0,
- m_cr1 & CR1_DH_CK ? 1 : 0,
- m_cr1 & CR1_DP_CK ? 1 : 0,
- m_sr & SR_V_DATA ? 1 : 0));
-}
-
-void apollo_graphics_15i::increment_h_clock()
-{
- MLOG1(("increment_h_clock: sr=%02x m_h_clock=%d", m_sr, m_h_clock));
-
- if (m_device_id == SCREEN_DEVICE_ID_19I)
- {
- // DISP7A.DEX Test 5
- // Note: 108 = 80 + 28 = 1280/16 + 448/16
- switch (m_h_clock %= 108)
- {
- case 8: // Not blanking
- m_sr |= SR_BLANK;
- break;
- case 88: // blanking
- m_sr &= ~SR_BLANK;
- break;
- case 93: // HSync active
- m_sr &= ~SR_H_SYNC;
- // DISP7A.DEX.1 Test 6
- increment_v_clock();
- break;
- case 104: // HSync inactive
- m_sr |= SR_H_SYNC;
- break;
- }
- }
- else if (m_n_planes == 1)
- {
- switch (m_h_clock %= 84)
- {
- case 1: // HSync inactive
- m_sr |= SR_H_SYNC;
- break;
- case 8: // Not blanking
- m_sr |= SR_BLANK;
- break;
- case 72: // blanking
- m_sr &= ~SR_BLANK;
- break;
- case 77: // HSync active
- m_sr &= ~SR_H_SYNC;
- // DISP7D.DEX.1 Test 6
- increment_v_clock();
- break;
- }
- }
- else if (m_n_planes == 4)
- {
- switch (m_h_clock %= 84)
- {
- case 8: // Not blanking
- m_sr |= SR_BLANK;
- if (m_sr & SR_V_BLANK)
- {
- m_sr |= SR_V_FLAG;
- }
- break;
- case 73: // blanking
- m_sr &= ~SR_BLANK;
- if (m_sr & SR_V_BLANK)
- {
- m_sr &= ~SR_V_FLAG;
- }
- break;
- }
- }
- else // m_n_planes == 8
- {
- switch (m_h_clock %= 84)
- {
- case 9: // Not blanking
- m_sr |= SR_BLANK;
- break;
- case 73: // blanking
- m_sr &= ~SR_BLANK;
- break;
- }
- }
- m_h_clock++;
-}
-
-void apollo_graphics_15i::increment_v_clock()
-{
- MLOG1(("increment_v_clock: sr=%02x m_v_clock=%d", m_sr, m_v_clock));
-
- if (m_device_id == SCREEN_DEVICE_ID_19I)
- {
- switch (m_v_clock %= 1066)
- {
- case 1023: // blanking
- m_sr &= ~(SR_V_BLANK | SR_BLANK);
- break;
- case 1028: // VSync active
- m_sr &= ~SR_V_SYNC;
- break;
- case 1032: // VSync inactive
- m_sr |= SR_V_SYNC;
- break;
- case 1065: // not blanking
- m_sr |= (SR_V_BLANK | SR_BLANK);
- break;
- }
- }
- else if (m_n_planes == 1)
- {
- switch (m_v_clock %= 842)
- {
- case 799:
- m_sr &= ~SR_V_BLANK;
- break;
- case 804:
- m_sr &= ~SR_SYNC;
- break;
- case 808:
- m_sr |= SR_SYNC;
- break;
- case 841:
- m_sr |= SR_V_BLANK;
- break;
- }
- }
- else if (m_n_planes == 4)
- {
- // DISP7B.DEX Test 6 and Test 20
- switch (m_v_clock %= 842)
- {
- case 799:
- m_sr &= ~SR_V_BLANK;
- m_sr &= ~SR_V_FLAG;
- break;
- case 803:
- m_sr &= ~SR_SYNC;
- break;
- case 807:
- m_sr |= SR_SYNC;
- break;
- case 836:
- m_sr |= SR_V_FLAG;
- break;
- case 841:
- m_sr |= SR_V_BLANK;
- break;
- }
- }
- else if (m_n_planes == 8)
- {
- // DISP7C.DEX Test 50
- switch (m_v_clock %= 842)
- {
- case 800:
- m_sr &= ~SR_V_BLANK;
- break;
- case 804:
- m_sr &= ~SR_SYNC;
- break;
- case 808:
- m_sr |= SR_SYNC;
- break;
- case 0:
- m_sr |= SR_V_BLANK;
- break;
- }
- }
- m_v_clock++;
- m_p_clock = 0;
- m_data_clock = 0;
-}
-
-void apollo_graphics_15i::increment_p_clock()
-{
- if (m_n_planes == 1)
- {
- if ((m_cr1 & CR1_DISP_EN) == 0)
- {
- m_sr &= ~SR_V_DATA;
- }
- else
- {
- int pixel_offset = (m_device_id == SCREEN_DEVICE_ID_19I) ? 10 : 8;
-
- if (m_p_clock > pixel_offset)
- {
- // FIXME: ok for DEX Test 5 6 17 19 - nok for 20
- int pixel_addr = m_v_clock * m_width + m_data_clock;
-
- // FIXME: ok for DEX Test 5 6 17 20 - nok for 19
- // Note: for dn3500_19i DEX Test 17 18 20 will fail !!!!
- // Note: must NOT reset m_data_clock in increment_p_clock !
-// int pixel_addr = m_data_clock * 32;
-
- UINT16 pixel = m_image_memory[pixel_addr / 16] & (0x8000 >> (pixel_addr % 16));
-
- pixel = (pixel ? 1 : 0) ^ ((m_cr1 & CR1_INV) ? 0 : 1);
-
- m_sr = pixel ? (m_sr | SR_V_DATA) : (m_sr & ~SR_V_DATA);
-
- m_data_clock++;
- }
-
- m_p_clock++;
-
- // DEX Test 4: Pixel Counter Test
- if ((m_p_clock % 8) == 0)
- {
- m_sr ^= SR_H_CK;
- }
- }
- }
- else if (m_n_planes == 4)
- {
- if ((m_p_clock % 8) == 0 && m_p_clock > 0)
- {
- m_sr ^= SR_H_CK;
- }
- m_p_clock++;
- }
- else // m_n_planes == 8
- {
- if ((m_p_clock % 8) == 1 && m_p_clock > 1)
- {
- m_sr ^= SR_H_CK;
- }
- m_p_clock++;
- }
-}
-
-void apollo_graphics_15i::set_cr1(UINT8 data)
-{
- UINT8 diffs = m_cr1 ^ data;
- m_cr1 = data;
-
- UINT8 dp_clock = (diffs & CR1_DP_CK) && (m_cr1 & CR1_DP_CK) == 0;
- UINT8 dh_clock = (diffs & CR1_DH_CK) && (m_cr1 & CR1_DH_CK) == 0;
- UINT8 dv_clock = m_n_planes == 1 ? 0 : ((diffs & CR1_DV_CK) && (m_cr1 & CR1_DV_CK) == 0);
-
- if ((m_cr1 & CR1_RESET) == 0)
- {
- if (diffs & CR1_RESET)
- {
- MLOG1(("!!! set_cr1: CR1_RESET"));
-
- m_blt_cycle_count = 0;
- m_sr &= ~SR_ALT;
- m_image_offset = 0;
- memset(m_guard_latch, 0, sizeof(m_guard_latch));
-
- m_h_clock = 0;
- m_v_clock = 0;
- m_p_clock = 0;
- m_data_clock = 0;
-
- if (m_device_id == SCREEN_DEVICE_ID_19I)
- {
- m_sr = SR_H_CK | SR_V_BLANK | SR_H_SYNC | SR_V_SYNC;
- }
- else if (m_n_planes == 1)
- {
- m_sr = SR_V_BLANK | SR_V_SYNC;
- }
- else
- {
- m_sr = SR_H_CK | SR_V_BLANK | SR_SYNC | SR_DONE;
- }
- }
- log_cr1("CR1_RESET");
- }
- else
- {
- if ((diffs & CR1_RESET) && (m_cr1 & CR1_RESET) != 0)
- {
- log_cr1("CR1_RESET");
- }
-
- if (dh_clock)
- {
- increment_h_clock();
- log_cr1("CR1_DH_CK");
- }
-
- if (dv_clock)
- {
- increment_v_clock();
- log_cr1("CR1_DV_CK");
- }
-
- if (dp_clock)
- {
- increment_p_clock();
- log_cr1("CR1_DP_CK");
- }
-
- if ((m_sr & SR_V_BLANK) == 0)
- {
- m_sr &= ~SR_BLANK;
- }
-
- if (diffs & CR1_DISP_EN)
- {
- // update screen
- m_update_flag = 1;
- }
- }
-}
-
-void apollo_graphics_15i::set_cr3a(UINT8 data)
-{
- m_cr3a = data;
- if ((data & 0x80) == 0)
- {
- int shift = (data & 0x0f) >> 1;
- UINT8 bit_mask = 1 << shift;
- if (data & 0x01)
- {
- set_cr1(m_cr1 | bit_mask);
- }
- else
- {
- set_cr1(m_cr1 & ~bit_mask);
- }
- }
-}
-
-void apollo_graphics_15i::set_cr3b(UINT8 data)
-{
- m_cr3b = data;
- if ((data & 0x80) == 0)
- {
- int shift = (data & 0x0f) >> 1;
- UINT8 bit_mask = 1 << shift;
- if (data & 0x01)
- {
- set_lut_cr(m_lut_control | bit_mask);
- }
- else
- {
- set_lut_cr(m_lut_control & ~bit_mask);
- }
- }
-}
-
-void apollo_graphics_15i::set_lut_cr(UINT8 data)
-{
- UINT8 diffs = m_lut_control ^ data;
- m_lut_control = data;
-
- if ((diffs & LUT_CPAL_CS) && (data & LUT_CPAL_CS) != 0)
- {
- MLOG1(("writing Color Graphics Controller: LUT_CPAL_CS Disabled"));
- while (!m_lut_fifo->is_empty())
- {
- m_bt458->write(m_lut_fifo->get(), LUT_C1_C0(m_lut_control));
- }
- }
-
- if ((diffs & LUT_FIFO_RST) && (data & LUT_FIFO_RST) == 0)
- {
- MLOG1(("writing Color Graphics Controller: LUT_FIFO_RST Active"));
- m_lut_fifo->reset();
- m_sr |= SR_LUT_OK;
- }
-
- if ((diffs & LUT_FIFO_CS) && (data & LUT_FIFO_CS) == 0)
- {
- MLOG1(("writing Color Graphics Controller: LUT_FIFO_CS Enabled"));
- }
-
- if ((diffs & LUT_ST_LUK) && (data & LUT_ST_LUK) == 0)
- {
- MLOG1(("writing Color Graphics Controller: LUT_ST_LUK Active"));
- m_sr &= ~SR_LUT_OK;
- }
-}
-
-READ8_MEMBER( apollo_graphics_15i::apollo_mcr_r )
-{
- UINT8 data;
- switch (offset & 0x407)
- {
- case 0:
- data = m_sr;
- if (m_ad_pending)
- {
- m_ad_pending = 0;
- m_sr &= ~SR_DONE;
- }
- break;
- case 1:
- data = m_n_planes == 1 ? m_device_id : 0xff;
- break;
- case 0x400:
- data = m_cr0;
- break;
- case 0x402:
- data = m_cr1;
- break;
- case 0x404:
- data = m_cr2;
- break;
- case 0x406:
- data = m_cr3a;
- break;
- default:
- data = 0xff;
- break;
- }
-
- // omit excessive logging
- static UINT8 status0 = 0xff;
- if ((offset != 1) && (offset != 0 || data != status0))
- {
- if (offset == 0)
- status0 = data;
- MLOG1(("reading Graphics Controller at offset %03x = %02x (%s)", offset, data, cr_text(offset, data, 1)));
- }
-
- return data;
-}
-
-WRITE8_MEMBER( apollo_graphics_15i::apollo_mcr_w )
-{
- MLOG1(("writing Graphics Controller at offset %03x = %02x (%s)", offset, data, cr_text(offset, data, 0)));
- switch (offset & 0x407)
- {
- case 0:
- m_write_enable_register = set_lsb0(m_write_enable_register, data);
- break;
- case 1:
- m_write_enable_register = set_msb0(m_write_enable_register, data);
- // FIXME: seems to be necessary for dex
- m_blt_cycle_count = 0;
- m_sr &= ~SR_ALT;
- break;
- case 2:
- m_rop_register = set_lsb0(m_rop_register, data);
- break;
- case 3:
- m_rop_register = set_msb0(m_rop_register, data);
- set_status_rmw();
- break;
- case 4:
- case 5:
- // trigger memory refresh in diagnostic mode
- m_diag_mem_request = data;
- break;
- case 0x400:
- m_cr0 = data;
- break;
- case 0x402:
- set_cr1(data);
- break;
- case 0x404:
- m_cr2 = data;
- m_cr2_s_data = CR2_S_DATA(data);
- m_cr2_s_plane = 0x00;
- m_cr2_d_plane = 0x0e;
- // for DISP7B.DEX Test 16
- m_sr |= SR_R_M_W;
- break;
- case 0x406:
- set_cr3a(data);
- break;
- case 0x407: // A/D Channel Register
- m_ad_pending = 1;
- m_sr |= SR_DONE;
- break;
- }
-}
-
-void apollo_graphics_15i::set_status_rmw()
-{
- UINT8 plane, d_plane_bit;
- UINT32 rop_reg;
-
- m_sr &= ~SR_R_M_W;
- rop_reg = m_rop_register;
- d_plane_bit = 0x01;
- for (plane = 0; plane < m_n_planes; plane++)
- {
- if ((m_cr2_d_plane & d_plane_bit) == 0)
- {
- switch (rop_reg & 0x0f)
- {
- case 0: // zero
- case 3: // Source
- case 0x0c: // ~Source
- case 0x0f: // one
- break;
- default:
- m_sr |= SR_R_M_W;
- break;
- }
- }
- rop_reg >>= 4;
- d_plane_bit <<= 1;
- }
-}
-
-UINT16 apollo_graphics_15i::rop(UINT16 dest_data, UINT16 src_data, UINT8 plane)
-{
- UINT16 src_data1 = src_data;
- if (m_cr1 & CR1_ROP_EN)
- {
- switch ((m_rop_register >> (plane * 4)) & 0x0f)
- {
- case 0: // zero
- src_data = 0;
- break;
- case 1: // Source AND Destination
- src_data = src_data & dest_data;
- break;
- case 2: // Source AND ~Destination
- src_data = src_data & (~dest_data);
- break;
- case 3: // Source
- break;
- case 4: // ~Source AND Destination
- src_data = (~src_data) & dest_data;
- break;
- case 5: // Destination
- src_data = dest_data;
- break;
- case 6: // Source XOR Destination
- src_data = src_data ^ dest_data;
- break;
- case 7: // Source OR Destination
- src_data = src_data | dest_data;
- break;
- case 8: // Source NOR Destination
- src_data = ~(src_data | dest_data);
- break;
- case 9: // Source XNOR Destination
- src_data = ~(src_data ^ dest_data);
- break;
- case 0x0a: // ~Destination
- src_data = ~dest_data;
- break;
- case 0x0b: // Source OR ~Destination
- src_data = src_data | (~dest_data);
- break;
- case 0x0c: // ~Source
- src_data = ~src_data;
- break;
- case 0x0d: // ~Source OR Destination
- src_data = (~src_data) | dest_data;
- break;
- case 0x0e: // Source NAND Destination
- src_data = ~(src_data & dest_data);
- break;
- case 0x0f: // One
- src_data = 0xffff;
- break;
- }
- }
- MLOG2(("rop: cr0=%02x cr1=%02x cr2=%02x rop_register=%08x dest=%04x src=%04x plane=%d s_plane=%d ->%04x", m_cr0, m_cr1, m_cr2, m_rop_register,dest_data, src_data1, plane, m_cr2_s_plane, src_data ))
- return src_data;
-}
-
-void apollo_graphics_15i::set_source_data(UINT32 offset)
-{
- if (m_n_planes == 1 || (m_cr1 & CR1_AD_BIT))
- {
- offset += m_image_plane_size * m_cr2_s_plane;
- m_guard_latch[m_cr2_s_plane] <<= 16;
- m_guard_latch[m_cr2_s_plane] |= m_image_memory[offset];
- }
- else
- {
- UINT8 plane;
- for (plane = 0; plane < m_n_planes; plane++)
- {
- m_guard_latch[plane] <<= 16;
- m_guard_latch[plane] |= m_image_memory[offset];
- offset += m_image_plane_size;
- }
- }
-}
-
-UINT32 apollo_graphics_15i::get_source_data(UINT8 plane)
-{
- UINT32 src_data;
-
- if (m_n_planes == 1 || (m_cr1 & CR1_AD_BIT))
- {
- src_data = m_guard_latch[m_cr2_s_plane];
- }
- else
- {
- src_data = m_guard_latch[plane];
- }
-
- switch (m_cr2_s_data)
- {
- case CR2_CONST_ACCESS: // 0x00
- // set source to all ones (used for vectors)
- src_data = 0xffff;
- break;
- case CR2_PIXEL_ACCESS: // 0x01
- // replicate 4 LSB of data bus
- src_data = src_data & (1 << plane) ? 0xffff : 0;
- break;
- case CR2_SHIFT_ACCESS: // 0x02
- // replicate LSB of shifter
- src_data = src_data & 1 ? 0xffff : 0;
- break;
- case CR2_PLANE_ACCESS: // 0x03
- // use source data unchanged (normal use)
- if (CR0_SHIFT(m_cr0) >= 16)
- {
- src_data = (src_data << 16) | (src_data >> 16);
- }
- src_data >>= (CR0_SHIFT(m_cr0) & 0x0f);
- break;
- }
- return src_data;
-}
-
-void apollo_graphics_15i::blt(UINT32 dest_addr, UINT16 mem_mask)
-{
- UINT16 src_data, dest_data;
- UINT8 d_plane_bit;
- UINT8 plane;
-
- d_plane_bit = 0x01;
- for (plane = 0; plane < m_n_planes; plane++)
- {
- if ((m_cr2_d_plane & d_plane_bit) == 0)
- {
- dest_data = m_image_memory[dest_addr];
- src_data = get_source_data(plane);
- src_data = rop(dest_data, src_data, plane);
- src_data &= ~(m_write_enable_register | ~mem_mask);
- dest_data &= (m_write_enable_register | ~mem_mask);
- m_image_memory[dest_addr] = dest_data | src_data;
- }
- dest_addr += m_image_plane_size;
- d_plane_bit <<= 1;
- }
-}
-
-/***************************************************************************
- Monochrome graphics memory space at FA0000 - FDFFFF
- Color graphics memory space at A0000 - BFFFF
- ***************************************************************************/
-
-READ16_MEMBER( apollo_graphics_15i::apollo_mem_r )
-{
- UINT16 data;
- UINT32 src_addr;
-
- if (offset >= m_image_memory_size)
- {
- // 128 kB display buffer of 15" screen seems to be shadowed from $fa0000 to $fc0000
- MLOG1(("reading Graphics Memory at invalid offset %05x", offset));
- offset %= m_image_memory_size;
- }
-
- src_addr = offset + m_image_plane_size * m_cr2_s_plane;
-
- switch (CR0_MODE(m_cr0))
- {
- case CR0_MODE_VECTOR: // vector or fill mode
- case CR0_MODE_3: // CPU source BLT: read internal data bus
- data = m_guard_latch[m_cr2_s_plane];
- break;
-
- default:
- set_source_data(offset);
- data = m_image_memory[src_addr];
- break;
- }
-
- // omit excessive logging
- if ((offset & (m_image_plane_size - 1)) < 8)
- {
- MLOG1(("reading Graphics Memory with mode %d: src_addr %05x = %04x & %04x", CR0_MODE(m_cr0), src_addr, data, mem_mask));
- }
- else if ((offset & (m_image_plane_size - 1)) == 8)
- {
- MLOG1(("..."));
- }
- return data;
-}
-
-WRITE16_MEMBER( apollo_graphics_15i::apollo_mem_w )
-{
- UINT32 dest_addr;
- UINT32 src_addr;
-
- if (offset >= m_image_memory_size)
- {
- // 128 kB display buffer of 15" screen seems to be shadowed from $fa0000 to $fc0000
- MLOG1(("writing Graphics Memory at invalid offset %05x = %04x & %04x ", offset, data, mem_mask));
- offset %= m_image_memory_size;
- }
-
- // omit excessive logging
- if (offset < 24)
- {
- MLOG1(("writing Graphics Memory with mode %d: offset=%04x data=%04x mask=%04x", CR0_MODE(m_cr0), offset, data, mem_mask));
- }
- else if (offset == 24)
- {
- MLOG1(("..."));
- }
-
- switch (CR0_MODE(m_cr0))
- {
- case CR0_MODE_0:
- // CPU destination BLT
- // 1. bus write to provide display memory address
- // 2. bus read to get data
- src_addr = offset + m_image_plane_size * m_cr2_s_plane;
- m_guard_latch[m_cr2_s_plane] <<= 16;
- m_guard_latch[m_cr2_s_plane] |= m_image_memory[src_addr];
- break;
-
- case CR0_MODE_1:
- // Alternating BLT
- // alternating bus writes provide src/dest address
- // second write provides Write-enables
- if (++m_blt_cycle_count == 1)
- {
- m_sr |= SR_ALT;
- set_source_data(offset);
- }
- else
- {
- m_blt_cycle_count = 0;
- m_sr &= ~SR_ALT;
- m_write_enable_register = data;
- blt(offset, mem_mask);
- }
- break;
-
- case CR0_MODE_VECTOR:
- // Vector or fill mode
- // write provides Write-enables and address
- m_write_enable_register = data;
- blt(offset, mem_mask);
- break;
-
- case CR0_MODE_3:
- // CPU source BLT
- // 1. bus write to provide src data
- // 2. bus write to provide Write-enables and address
- if (++m_blt_cycle_count == 1)
- {
- m_sr |= SR_ALT;
-
- // strange: must fix byte access for /systest/grtest on sr10.2
- if (mem_mask == 0xff00)
- {
- data >>= 8;
- mem_mask >>= 8;
- }
-
- m_guard_latch[m_cr2_s_plane] <<= 16;
- m_guard_latch[m_cr2_s_plane] |= (data & mem_mask);
- }
- else
- {
- m_blt_cycle_count = 0;
- m_sr &= ~SR_ALT;
-
- m_write_enable_register = data;
- blt(offset, mem_mask);
- }
- break;
-
- case CR0_MODE_BLT:
- // Double access BLT
- // bus write to provide src addr on address lines
- // dest addr on data lines (16-bit WORD Offset)
-
- set_source_data(offset);
- dest_addr = (data & mem_mask);
- if (m_device_id == SCREEN_DEVICE_ID_19I && (m_cr1 & CR1_DADDR_16))
- {
- dest_addr += 0x10000;
- }
- blt(dest_addr, 0xffff);
- break;
-
- case CR0_MODE_NORMAL:
- m_guard_latch[m_cr2_s_plane] <<= 16;
- m_guard_latch[m_cr2_s_plane] |= (data & mem_mask);
- blt(offset, mem_mask);
- break;
-
- default:
- MLOG(("writing Graphics Memory - unexpected cr0 mode %d", CR0_MODE(m_cr0)))
- ;
- break;
- }
- m_update_flag = 1;
-}
-
-/***************************************************************************
- Color Screen
- ***************************************************************************/
-
-READ8_MEMBER( apollo_graphics_15i::apollo_ccr_r )
-{
- UINT8 data;
-
- if (m_n_planes == 4)
- {
- switch (offset & 0x407)
- {
- case 1:
- data = m_n_planes == 4 ? m_device_id : 0xff;
- break;
- case 0x407:
- data = m_ad_result;
- break;
- default:
- return apollo_mcr_r(space, offset, mem_mask);
- }
- }
- else if (m_n_planes == 8)
- {
- switch (offset & 0x407)
- {
- case 1:
- data = m_n_planes == 8 ? m_device_id : 0xff;
- break;
- case 4:
- data = get_lsb1(m_rop_register);
- break;
- case 5:
- data = get_msb1(m_rop_register);
- break;
-
- case 0x401:
- // LUT data register
- if ((m_lut_control & LUT_FIFO_CS) == 0)
- {
- data = m_lut_fifo->get();
- }
- else if ((m_lut_control & LUT_R_W) == 0)
- {
- MLOG1(("apollo_graphics_15i::apollo_ccr_r: reading LUT data register with unexpected RW = 0 in LUT Control register"));
- data = m_lut_data;
- }
- else if ((m_lut_control & LUT_AD_CS) == 0)
- {
- data = m_ad_result;
- }
- else if ((m_lut_control & LUT_CPAL_CS) == 0)
- {
- data = m_bt458->read(LUT_C1_C0(m_lut_control));
- }
- else
- {
- MLOG1(("apollo_graphics_15i::apollo_ccr_r: reading LUT data register with unexpected CS in LUT Control register"));
- data = m_lut_data;
- }
- break;
- case 0x403:
- // LUT control register
- data = m_lut_control;
- break;
- case 0x404:
- // cr2a
- data = m_cr2;
- break;
- case 0x405:
- // cr2b
- data = m_cr2b;
- break;
- case 0x407:
- // cr3b
- data = m_cr3b;
- break;
- default:
- return apollo_mcr_r(space, offset, mem_mask);
- }
- }
- else
- {
- data = 0xff;
- }
-
- // omit excessive logging
- static UINT8 status1 = 0xff;
- if ((offset != 1) && (offset != 0 || data != status1))
- {
- if (offset == 0)
- status1 = data;
- MLOG1(("reading Color Graphics Controller at offset %03x = %02x (%s)", offset, data, cr_text(offset, data, 1)));
- }
-
- return data;
-}
-
-UINT8 apollo_graphics_15i::get_pixel(UINT32 offset, UINT16 mask)
-{
- UINT8 data = 0;
- UINT16 *source_ptr = m_image_memory + offset;
-
- if (m_n_planes == 4)
- {
- UINT16 data0 = source_ptr[0];
- UINT16 data1 = source_ptr[m_image_plane_size];
- UINT16 data2 = source_ptr[m_image_plane_size * 2];
- UINT16 data3 = source_ptr[m_image_plane_size * 3];
-
- data = (data0 & mask) ? 1 : 0;
- data |= (data1 & mask) ? 2 : 0;
- data |= (data2 & mask) ? 4 : 0;
- data |= (data3 & mask) ? 8 : 0;
- }
- else if (m_n_planes == 8)
- {
- UINT16 data0 = source_ptr[0];
- UINT16 data1 = source_ptr[m_image_plane_size];
- UINT16 data2 = source_ptr[m_image_plane_size * 2];
- UINT16 data3 = source_ptr[m_image_plane_size * 3];
- UINT16 data4 = source_ptr[m_image_plane_size * 4];
- UINT16 data5 = source_ptr[m_image_plane_size * 5];
- UINT16 data6 = source_ptr[m_image_plane_size * 6];
- UINT16 data7 = source_ptr[m_image_plane_size * 7];
-
- data = (data0 & mask) ? 1 : 0;
- data |= (data1 & mask) ? 2 : 0;
- data |= (data2 & mask) ? 4 : 0;
- data |= (data3 & mask) ? 8 : 0;
- data |= (data4 & mask) ? 0x10 : 0;
- data |= (data5 & mask) ? 0x20 : 0;
- data |= (data6 & mask) ? 0x40 : 0;
- data |= (data7 & mask) ? 0x80 : 0;
- }
-
- return data;
-}
-
-// read the 4-plane ADC value for data
-
-UINT8 apollo_graphics_15i::c4p_read_adc(UINT8 data)
-{
- UINT8 value = 0;
-
- if ((data & 0x0c) == 0x04)
- {
- UINT8 red, green, blue;
- UINT8 pixel = get_pixel((m_v_clock * m_buffer_width / 16) + m_h_clock,
- 0x8000);
- UINT32 rgb = m_color_lookup_table[pixel];
-
- if ((m_sr & SR_BLANK) != 0)
- {
- // not blanking
- red = 30 + ((rgb >> 16) & 0xff) / 4;
- green = 60 + ((rgb >> 8) & 0xff) / 4;
- blue = 30 + (rgb & 0xff) / 4;
- }
- else if (m_h_clock > 2)
- {
- // blanking
- red = 20;
- green = 50;
- blue = 20;
- }
- else
- {
- // sync
- red = 20;
- green = 10;
- blue = 20;
- }
-
- switch (data & 3)
- {
- case 0: // Red
- value = red;
- break;
- case 1: // Green
- value = green;
- break;
- case 2: // Blue
- value = blue;
- break;
- default: // unused
- value = 0;
- break;
- }
- }
- return value;
-}
-
-// read the 8-plane ADC value for data
-
-UINT8 apollo_graphics_15i::c8p_read_adc(UINT8 data)
-{
- UINT8 value = 0;
-
- if ((data & 0x0c) == 0x04)
- {
- UINT8 red, green, blue;
- UINT8 pixel = get_pixel((m_v_clock * m_buffer_width / 16) + m_h_clock, 0x8000);
- UINT32 rgb = m_bt458->get_rgb(pixel);
-
- if ((m_sr & SR_BLANK) != 0)
- {
- // not blanking
- red = 10 + ((rgb >> 16) & 0xff) / 2;
- green = 70 + ((rgb >> 8) & 0xff) / 2;
- blue = 10 + (rgb & 0xff) / 2;
- }
- else if (m_h_clock < 20)
- {
- // blanking
- red = 5;
- green = 60;
- blue = 5;
- }
- else
- {
- // sync
- red = 5;
- green = 5;
- blue = 5;
- }
-
- switch (data & 3)
- {
- case 0: // Red
- value = red;
- break;
- case 1: // Green
- value = green;
- break;
- case 2: // Blue
- value = blue;
- break;
- default: // unused
- value = 0;
- break;
- }
- }
- return value;
-}
-
-WRITE8_MEMBER( apollo_graphics_15i::apollo_ccr_w )
-{
- static const UINT8 rgb_value[16] =
- { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
- 0xcc, 0xdd, 0xee, 0xff };
-
- if (m_n_planes == 4)
- {
- switch (offset & 0x407)
- {
- case 0x401:
- // red lookup table register
- m_color_lookup_table[data >> 4] &= 0xff00ffff;
- m_color_lookup_table[data >> 4] |= rgb_value[data & 0x0f] << 16;
- break;
- case 0x403:
- // green lookup table register
- m_color_lookup_table[data >> 4] &= 0xffff00ff;
- m_color_lookup_table[data >> 4] |= rgb_value[data & 0x0f] << 8;
- break;
- case 0x404:
- // cr2
- m_cr2 = data;
- m_cr2_s_data = CR2_S_DATA(data);
- m_cr2_s_plane = CR2_S_PLANE(data);
- m_cr2_d_plane = CR2_D_PLANE(data);
- // for DISP7B.DEX Test 16
- m_sr |= SR_R_M_W;
- break;
- case 0x405:
- // blue lookup table register
- m_color_lookup_table[data >> 4] &= 0xffffff00;
- m_color_lookup_table[data >> 4] |= rgb_value[data & 0x0f];
- break;
- case 0x407:
- // A/D channel register
- m_ad_result = c4p_read_adc(data);
- m_ad_pending = 1;
- m_sr |= SR_DONE;
- break;
- default:
- apollo_mcr_w(space, offset, data, mem_mask);
- return;
- }
- }
- else if (m_n_planes == 8)
- {
- switch (offset & 0x407)
- {
- case 2:
- m_rop_register = set_lsb0(m_rop_register, data);
- break;
- case 3:
- m_rop_register = set_msb0(m_rop_register, data);
- set_status_rmw();
- break;
- case 4:
- m_rop_register = set_lsb1(m_rop_register, data);
- break;
- case 5:
- m_rop_register = set_msb1(m_rop_register, data);
- set_status_rmw();
- break;
- case 6:
- case 7:
- // trigger memory refresh in diagnostic mode
- m_diag_mem_request = data;
- break;
- case 0x401:
- // LUT data register
- m_lut_data = data;
- if ((m_lut_control & LUT_R_W) == 1)
- {
- MLOG1(("apollo_graphics_15i::apollo_ccr_w: writing LUT data register with RW = 1 in LUT Control register"));
- }
- else if ((m_lut_control & LUT_AD_CS) == 0)
- {
- m_ad_result = c8p_read_adc(data);
- m_ad_pending = 1;
- m_sr |= SR_DONE;
- }
- else if ((m_lut_control & LUT_CPAL_CS) == 0)
- {
- m_bt458->write(data, LUT_C1_C0(m_lut_control));
- }
- else if ((m_lut_control & LUT_FIFO_CS) == 0)
- {
- m_lut_fifo->put(data);
- }
- else
- {
- MLOG1(("apollo_graphics_15i::apollo_ccr_w: writing LUT data register with unexpected CS in LUT Control register"));
- }
- break;
- case 0x403:
- // LUT control register
- set_lut_cr(data);
- break;
- case 0x404:
- // cr2a
- m_cr2 = data;
- m_cr2_d_plane = CR2A_D_PLANE(data);
- m_sr |= SR_R_M_W;
- break;
- case 0x405:
- // cr2b
- m_cr2b = data;
- m_cr2_s_data = CR2_S_DATA(data);
- m_cr2_s_plane = CR2B_S_PLANE(data);
- break;
- case 0x407:
- // cr3b
- set_cr3b(data);
- break;
- default:
- apollo_mcr_w(space, offset, data, mem_mask);
- return;
- }
- }
-
- MLOG1(("writing Color Graphics Controller at offset %03x = %02x (%s)", offset, data, cr_text(offset, data, 0)));
-}
-
-READ16_MEMBER( apollo_graphics_15i::apollo_cgm_r )
-{
- if (!is_mono())
- {
- return apollo_mem_r(space, offset, mem_mask);
- }
- else
- {
- return 0xffff;
- }
-}
-
-WRITE16_MEMBER( apollo_graphics_15i::apollo_cgm_w )
-{
- if (!is_mono())
- {
- apollo_mem_w(space, offset, data, mem_mask);
- }
-}
-
-/***************************************************************************
- VIDEO HARDWARE
- ***************************************************************************/
-
-UINT32 apollo_graphics_15i::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- int has_changed = 0;
-
- if (m_update_flag && !m_update_pending)
- {
- has_changed = 1;
- m_update_flag = 0;
- m_update_pending = 1;
- screen_update1(bitmap, cliprect);
- m_update_pending = 0;
- }
- return has_changed ? 0 : UPDATE_HAS_NOT_CHANGED;
-}
-
-void apollo_graphics_15i::screen_update1(bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- UINT16 *source_ptr = m_image_memory;
- int x, y;
- UINT16 data, mask;
- UINT16 inverse = (m_cr1 & CR1_INV) ? 0xffff : 0;
-
- MLOG1(("screen_update1: size=%0x rowpixels=%d", m_image_memory_size, bitmap.rowpixels()));
-
- if ((m_cr1 & CR1_DISP_EN) == 0)
- {
- // display is disabled
- for (y = 0; y < m_height; y++)
- {
- int dest = 0;
- for (x = 0; x < m_width; x += 16)
- {
- for (mask = 0x8000; mask; mask >>= 1)
- {
- bitmap.pix32(y, dest++) = 0;
- }
- }
- source_ptr += (m_buffer_width - m_width) / 16;
- }
- }
- else if (m_n_planes == 4)
- {
- for (y = 0; y < m_height; y++)
- {
- int dest = 0;
- for (x = 0; x < m_width; x += 16)
- {
- UINT16 data0 = source_ptr[0];
- UINT16 data1 = source_ptr[m_image_plane_size];
- UINT16 data2 = source_ptr[m_image_plane_size * 2];
- UINT16 data3 = source_ptr[m_image_plane_size * 3];
- source_ptr++;
- for (mask = 0x8000; mask; mask >>= 1)
- {
- data = (data0 & mask) ? 1 : 0;
- data |= (data1 & mask) ? 2 : 0;
- data |= (data2 & mask) ? 4 : 0;
- data |= (data3 & mask) ? 8 : 0;
- bitmap.pix32(y, dest++) = m_color_lookup_table[data];
- }
- }
- source_ptr += (m_buffer_width - m_width) / 16;
- }
- }
- else if (m_n_planes == 8)
- {
- for (y = 0; y < m_height; y++)
- {
- int dest = 0;
- for (x = 0; x < m_width; x += 16)
- {
- UINT16 data0 = source_ptr[0];
- UINT16 data1 = source_ptr[m_image_plane_size];
- UINT16 data2 = source_ptr[m_image_plane_size * 2];
- UINT16 data3 = source_ptr[m_image_plane_size * 3];
- UINT16 data4 = source_ptr[m_image_plane_size * 4];
- UINT16 data5 = source_ptr[m_image_plane_size * 5];
- UINT16 data6 = source_ptr[m_image_plane_size * 6];
- UINT16 data7 = source_ptr[m_image_plane_size * 7];
- source_ptr++;
- for (mask = 0x8000; mask; mask >>= 1)
- {
- data = (data0 & mask) ? 1 : 0;
- data |= (data1 & mask) ? 2 : 0;
- data |= (data2 & mask) ? 4 : 0;
- data |= (data3 & mask) ? 8 : 0;
- data |= (data4 & mask) ? 0x10 : 0;
- data |= (data5 & mask) ? 0x20 : 0;
- data |= (data6 & mask) ? 0x40 : 0;
- data |= (data7 & mask) ? 0x80 : 0;
- bitmap.pix32(y, dest++) = m_bt458->get_rgb(data);
- }
- }
- source_ptr += (m_buffer_width - m_width) / 16;
- }
- }
- else // m_n_planes == 1
- {
- for (y = 0; y < m_height; y++)
- {
- int dest = 0;
- for (x = 0; x < m_width; x += 16)
- {
- data = *source_ptr++ ^ inverse;
- for (mask = 0x8000; mask; mask >>= 1)
- {
- bitmap.pix32(y, dest++) = data & mask ? 0 : 0x00ffffff;
- }
- }
- source_ptr += (m_buffer_width - m_width) / 16;
- }
- }
-}
-
-/*-------------------------------------------------
- vblank_state_changed -
- called on each state change of the VBLANK signal
- -------------------------------------------------*/
-
-void apollo_graphics_15i::vblank_state_changed(screen_device &screen, bool vblank_state)
-{
- if ((m_cr1 & CR1_RESET) && (m_cr1 & CR1_SYNC_EN))
- {
- if (vblank_state)
- {
- m_sr &= ~(SR_V_BLANK | SR_BLANK);
- if (m_n_planes == 1)
- {
- // faking V_DATA for disp.dex test 16
- if (m_image_memory[0])
- {
- m_sr |= SR_V_DATA;
- }
- }
- else if (m_n_planes == 4)
- {
- m_sr &= ~SR_V_FLAG;
- }
- }
- else
- {
- m_sr |= (SR_V_BLANK | SR_BLANK);
- if (m_n_planes == 1)
- {
- m_sr &= ~SR_V_DATA;
- }
- else if (m_n_planes == 4)
- {
- m_sr |= SR_V_FLAG;
- }
- }
- }
-}
-
-void apollo_graphics_15i::register_vblank_callback()
-{
- MLOG1(("register_vblank_callback"));
-
- /* register for VBLANK callbacks */
- screen_device *screen = (screen_device *)machine().device(VIDEO_SCREEN_TAG);
- screen->register_vblank_callback(vblank_state_delegate(FUNC(apollo_graphics_15i::vblank_state_changed),this));
-}
-
-
-/***************************************************************************
- MACHINE DRIVERS
- ***************************************************************************/
-
-MACHINE_CONFIG_FRAGMENT( apollo_graphics )
- MCFG_DEFAULT_LAYOUT( layout_apollo_15i )
- MCFG_SCREEN_ADD(VIDEO_SCREEN_TAG, RASTER)
- MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
- MCFG_SCREEN_REFRESH_RATE(76)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(657))
- MCFG_SCREEN_SIZE(1024, 800)
- MCFG_SCREEN_VISIBLE_AREA(0, 1023, 0, 799)
- MCFG_SCREEN_UPDATE_DEVICE(APOLLO_SCREEN_TAG, apollo_graphics_15i, screen_update)
-MACHINE_CONFIG_END
-
-const device_type APOLLO_GRAPHICS = &device_creator<apollo_graphics_15i> ;
-
-apollo_graphics_15i::apollo_graphics_15i(const machine_config &mconfig,const char *tag, device_t *owner, UINT32 clock) :
- device_t(mconfig, APOLLO_GRAPHICS, "Apollo Screen", tag, owner, clock,"apollo_graphics_15i", __FILE__),
- m_lut_fifo(NULL),
- m_bt458(NULL)
-{
-}
-
-apollo_graphics_15i::apollo_graphics_15i(const machine_config &mconfig,const char *tag, device_t *owner, UINT32 clock, device_type type,const char *name, const char *shortname, const char *source) :
- device_t(mconfig, type, name, tag, owner, clock, shortname, source),
- m_lut_fifo(NULL),
- m_bt458(NULL)
-{
-}
-
-apollo_graphics_15i::~apollo_graphics_15i()
-{
- if (m_lut_fifo) global_free(m_lut_fifo);
- if (m_bt458) global_free(m_bt458);
-}
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void apollo_graphics_15i::device_config_complete()
-{
-}
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void apollo_graphics_15i::device_start()
-{
- MLOG1(("apollo_graphics_15i::device_start"))
-
- m_n_planes = 0;
- m_width = 0;
- m_height = 0;
- m_buffer_width = 0;
- m_buffer_height = 0;
-
- m_sr = 0;
- m_device_id = 0;
- m_write_enable_register = 0;
- m_rop_register = 0;
- m_diag_mem_request = 0;
- m_cr0 = 0;
- m_cr1 = 0;
- m_cr2 = 0;
- m_cr2b = 0;
- m_cr2_s_data = 0;
- m_cr2_s_plane = 0x00;
- m_cr2_d_plane = 0x0e;
- m_cr3a = 0;
- m_cr3b = 0;
- m_ad_result = 0;
- m_ad_pending = 0;
-
- m_lut_control = 0;
- m_lut_data = 0;
-
- m_update_flag = 0;
- m_update_pending = 0;
-
- m_blt_cycle_count = 0;
- m_image_offset = 0;
- memset(m_guard_latch, 0, sizeof(m_guard_latch));
-
- m_h_clock = 0;
- m_v_clock = 0;
- m_p_clock = 0;
- m_data_clock = 0;
-
- m_image_memory = 0;
- m_image_plane_size = 0;
- m_image_memory_size = 0;
-
- memset(m_color_lookup_table, 0, sizeof(m_color_lookup_table));
-
- m_lut_fifo = NULL;
- m_bt458 = NULL;
-}
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void apollo_graphics_15i::device_reset()
-{
- MLOG1(("apollo_graphics_15i::device_reset"));
-
- if (m_n_planes == 0)
- {
- if (apollo_config(APOLLO_CONF_MONO_19I))
- {
- // monochrome 1280x1024
- m_n_planes = 1;
- m_device_id = SCREEN_DEVICE_ID_19I;
- m_width = 1280;
- m_height = 1024;
- m_buffer_width = 2048;
- m_buffer_height = 1024;
- }
- else if (apollo_config(APOLLO_CONF_MONO_15I))
- {
- // monochrome 1024x800
- m_n_planes = 1;
- m_device_id = SCREEN_DEVICE_ID_15I;
- m_width = 1024;
- m_height = 800;
- m_buffer_width = 1024;
- m_buffer_height = 1024;
- }
- else if (apollo_config(APOLLO_CONF_4_PLANES))
- {
- // 4-planes color 1024x800
- m_n_planes = 4;
- m_device_id = SCREEN_DEVICE_ID_C4P;
- m_width = 1024;
- m_height = 800;
- m_buffer_width = 1024;
- m_buffer_height = 1024;
- }
- else
- {
- // 8-planes color 1024x800
- m_n_planes = 8;
- m_device_id = SCREEN_DEVICE_ID_C8P;
- m_width = 1024;
- m_height = 800;
- m_buffer_width = 1024;
- m_buffer_height = 1024;
-
- if (m_lut_fifo) global_free(m_lut_fifo);
- if (m_bt458) global_free(m_bt458);
-
- m_lut_fifo = global_alloc(lut_fifo);
-
- m_bt458 = global_alloc(bt458(machine()));
- m_bt458->start();
- m_bt458->reset();
- }
- }
-
- if (m_image_memory == NULL)
- {
- /* allocate the memory image */
- m_image_plane_size = m_buffer_height * m_buffer_width / 16;
- m_image_memory_size = m_image_plane_size * m_n_planes;
- m_image_memory
- = auto_alloc_array(machine(), UINT16, m_image_memory_size);
- assert(m_image_memory != NULL);
-
- MLOG1(("device reset apollo graphics: buffer=%p size=%0x", (void *) m_image_memory, m_image_memory_size));
- }
-
- memset(m_color_lookup_table, 0, sizeof(m_color_lookup_table));
- memset(m_image_memory, 0, m_image_memory_size * 2);
-
- // register_vblank_callback(this);
-
- /* FIXME: register for VBLANK callbacks */
- register_vblank_callback();
-}
-
-//-------------------------------------------------
-
-MACHINE_CONFIG_FRAGMENT( apollo_mono19i )
- MCFG_DEFAULT_LAYOUT( layout_apollo )
- MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
- MCFG_SCREEN_ADD(VIDEO_SCREEN_TAG, RASTER)
- MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
- MCFG_SCREEN_REFRESH_RATE(64)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(616))
- MCFG_SCREEN_SIZE(1280, 1024)
- MCFG_SCREEN_VISIBLE_AREA(0, 1279, 0, 1023)
- MCFG_SCREEN_UPDATE_DEVICE(APOLLO_SCREEN_TAG, apollo_graphics_19i, screen_update)
- MACHINE_CONFIG_END
-
-const device_type APOLLO_MONO19I = &device_creator<apollo_graphics_19i> ;
-
-apollo_graphics_19i::apollo_graphics_19i(const machine_config &mconfig,
- const char *tag, device_t *owner, UINT32 clock) :
- apollo_graphics_15i(mconfig, tag, owner, clock, APOLLO_MONO19I,
- "Apollo 19\" Monochrome Screen", "apollo_graphics_19i", __FILE__)
-{
-}
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void apollo_graphics_19i::device_config_complete()
-{
-}
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void apollo_graphics_19i::device_start()
-{
- MLOG1(("apollo_graphics_19i::device_start"));
-
- apollo_graphics_15i::device_start();
-}
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void apollo_graphics_19i::device_reset()
-{
- MLOG1(("apollo_graphics_19i::device_reset"));
-
- if (m_n_planes == 0)
- {
- // monochrome 1280x1024
- m_n_planes = 1;
- m_device_id = SCREEN_DEVICE_ID_19I;
- m_width = 1280;
- m_height = 1024;
- m_buffer_width = 2048;
- m_buffer_height = 1024;
- }
-
- apollo_graphics_15i::device_reset();
-
- /* FIXME: register for VBLANK callbacks */
- register_vblank_callback();
-}
-
-
-READ16_MEMBER( apollo_graphics_15i::apollo_mgm_r )
-{
- if (is_mono())
- {
- return apollo_mem_r(space, offset, mem_mask);
- }
- else
- {
- return 0xffff;
- }
-}
-
-WRITE16_MEMBER( apollo_graphics_15i::apollo_mgm_w )
-{
- if (is_mono())
- {
- apollo_mem_w(space, offset, data, mem_mask);
- }
-}
diff --git a/src/mess/video/apple1.c b/src/mess/video/apple1.c
deleted file mode 100644
index f6485dc7ee5..00000000000
--- a/src/mess/video/apple1.c
+++ /dev/null
@@ -1,392 +0,0 @@
-// license:???
-// copyright-holders:Paul Daniels, Colin Howell, R. Belmont
-/***************************************************************************
-
- apple1.c
-
- Functions to emulate the video hardware of the Apple I.
-
- The Apple I video hardware was basically a dumb video terminal; in
- fact it was based on Steve Wozniak's own design for a simple video
- terminal. It had 40 columns by 24 lines of uppercase-only text.
- Text could only be output at 60 characters per second, one character
- per video frame. The cursor (a blinking @) could only be advanced
- using spaces or carriage returns. Carriage returns were the only
- control characters recognized. Previously written text could not be
- altered, only scrolled off the top of the screen.
-
- The video memory used seven 1k-bit dynamic shift registers. Six of
- these held the 6-bit visible character codes, and one stored the
- cursor location as a simple bitmap--the bit for the cursor position
- was set to 0, and all the other bits were 1.
-
- These shift registers were continuously recirculated, completing one
- cycle per video frame. As a new line of characters was about to be
- scanned by the video beam, that character line would be recirculated
- into the shift registers and would simultaneously be stored into a
- 6x40-bit line buffer (also a shift register). At this point, if the
- cursor location was in this line, a new character could be written
- into that location in the shift registers and the cursor could be
- advanced. (Carriage returns were not written into the shift
- registers; they only advanced the cursor.)
-
- The characters in the line buffer were recirculated 7 times to
- display the 8 scan lines of the characters, before being replaced by
- a new line of characters from the main shift registers.
-
- Cursor blinking was performed by a Signetics 555 timer IC whose
- output was gated into the character code signals as they passed into
- the line buffer.
-
- Character images were provided by a Signetics 2513 character
- generator ROM, a chip also used in computer terminals such as the
- ADM-3A. This ROM had 9 address lines and 5 data lines; it contained
- 64 character images, each 5 pixels wide by 8 pixels high, with one
- line of pixels being blank for vertical separation. The video
- circuitry added the 2 pixels of horizontal separation for each
- character.
-
- A special CLEAR SCREEN switch on the keyboard, directly connected to
- the video hardware, could be used to clear the video memory and
- return the cursor to the home position. This was completely
- independent of the processor.
-
- A schematic of the Apple I video hardware can be found in the
- Apple-1 Operation Manual; look for the schematic titled "Terminal
- Section". Most of the functionality modeled here was determined by
- reading this schematic. Many of the chips used were standard 74xx
- TTL chips, but the shift registers used for the video memory and
- line buffer were Signetics 25xx PMOS ICs. These were already
- becoming obsolete when the Apple I was built, and detailed
- information on them is very hard to find today.
-
-***************************************************************************/
-
-#include "emu.h"
-#include "includes/apple1.h"
-
-
-/***************************************************************************
-
- Terminal code
-
-***************************************************************************/
-
-TILE_GET_INFO_MEMBER(apple1_state::terminal_gettileinfo)
-{
- int ch, gfxfont, code, color;
-
- ch = m_current_terminal->mem[tile_index];
- code = ch & ((1 << m_current_terminal->char_bits) - 1);
- color = ch >> m_current_terminal->char_bits;
- gfxfont = m_current_terminal->gfx;
-
- if ((tile_index == m_current_terminal->cur_offset) && !m_current_terminal->cur_hidden && m_current_terminal->getcursorcode)
- code = m_current_terminal->getcursorcode(code);
-
- SET_TILE_INFO_MEMBER(gfxfont, /* gfx */
- code, /* character */
- color, /* color */
- 0); /* flags */
-}
-
-void apple1_state::terminal_draw(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, terminal_t *terminal)
-{
- m_current_terminal = terminal;
- terminal->tm->draw(screen, dest, cliprect, 0, 0);
- m_current_terminal = NULL;
-}
-
-void apple1_state::verify_coords(terminal_t *terminal, int x, int y)
-{
- assert(x >= 0);
- assert(y >= 0);
- assert(x < terminal->num_cols);
- assert(y < terminal->num_rows);
-}
-
-void apple1_state::terminal_putchar(terminal_t *terminal, int x, int y, int ch)
-{
- int offs;
-
- verify_coords(terminal, x, y);
-
- offs = y * terminal->num_cols + x;
- if (terminal->mem[offs] != ch)
- {
- terminal->mem[offs] = ch;
- terminal->tm->mark_tile_dirty(offs);
- }
-}
-
-int apple1_state::terminal_getchar(terminal_t *terminal, int x, int y)
-{
- int offs;
-
- verify_coords(terminal, x, y);
- offs = y * terminal->num_cols + x;
- return terminal->mem[offs];
-}
-
-void apple1_state::terminal_putblank(terminal_t *terminal, int x, int y)
-{
- terminal_putchar(terminal, x, y, terminal->blank_char);
-}
-
-void apple1_state::terminal_dirtycursor(terminal_t *terminal)
-{
- if (terminal->cur_offset >= 0)
- terminal->tm->mark_tile_dirty(terminal->cur_offset);
-}
-
-void apple1_state::terminal_setcursor(terminal_t *terminal, int x, int y)
-{
- terminal_dirtycursor(terminal);
- terminal->cur_offset = y * terminal->num_cols + x;
- terminal_dirtycursor(terminal);
-}
-
-void apple1_state::terminal_hidecursor(terminal_t *terminal)
-{
- terminal->cur_hidden = 1;
- terminal_dirtycursor(terminal);
-}
-
-void apple1_state::terminal_showcursor(terminal_t *terminal)
-{
- terminal->cur_hidden = 0;
- terminal_dirtycursor(terminal);
-}
-
-void apple1_state::terminal_getcursor(terminal_t *terminal, int *x, int *y)
-{
- *x = terminal->cur_offset % terminal->num_cols;
- *y = terminal->cur_offset / terminal->num_cols;
-}
-
-void apple1_state::terminal_fill(terminal_t *terminal, int val)
-{
- int i;
- for (i = 0; i < terminal->num_cols * terminal->num_rows; i++)
- terminal->mem[i] = val;
- terminal->tm->mark_all_dirty();
-}
-
-void apple1_state::terminal_clear(terminal_t *terminal)
-{
- terminal_fill(terminal, terminal->blank_char);
-}
-
-terminal_t *apple1_state::terminal_create(
- int gfx, int blank_char, int char_bits,
- int (*getcursorcode)(int original_code),
- int num_cols, int num_rows)
-{
- terminal_t *term;
- int char_width, char_height;
-
- char_width = m_gfxdecode->gfx(gfx)->width();
- char_height = m_gfxdecode->gfx(gfx)->height();
-
- term = (terminal_t *) auto_alloc_array(machine(), char, sizeof(terminal_t) - sizeof(term->mem)
- + (num_cols * num_rows * sizeof(termchar_t)));
-
- term->tm = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(apple1_state::terminal_gettileinfo),this), TILEMAP_SCAN_ROWS,
- char_width, char_height, num_cols, num_rows);
-
- term->gfx = gfx;
- term->blank_char = blank_char;
- term->char_bits = char_bits;
- term->num_cols = num_cols;
- term->num_rows = num_rows;
- term->getcursorcode = getcursorcode;
- term->cur_offset = -1;
- term->cur_hidden = 0;
- terminal_clear(term);
- return term;
-}
-
-
-/**************************************************************************/
-
-
-
-/* The cursor blinking is generated by a free-running timer with a
- 0.52-second period. It is on for 2/3 of this period and off for
- 1/3. */
-#define CURSOR_OFF_LENGTH (0.52/3)
-
-/**************************************************************************/
-
-static int apple1_getcursorcode(int original_code)
-{
- /* Cursor uses symbol 0 (an @ sign) in the character generator ROM. */
- return 0;
-}
-
-/**************************************************************************/
-
-void apple1_state::video_start()
-{
- m_blink_on = 1; /* cursor is visible initially */
- m_terminal = terminal_create(
- 0, /* graphics font 0 (the only one we have) */
- 32, /* Blank character is symbol 32 in the ROM */
- 8, /* use 8 bits for the character code */
- apple1_getcursorcode,
- 40, 24); /* 40 columns, 24 rows */
-
- terminal_setcursor(m_terminal, 0, 0);
-}
-
-/* This function handles all writes to the video display. */
-void apple1_state::apple1_vh_dsp_w (int data)
-{
- int x, y;
- int cursor_x, cursor_y;
-
- /* While CLEAR SCREEN is being held down, the hardware is forced
- to clear the video memory, so video writes have no effect. */
- if (m_vh_clrscrn_pressed)
- return;
-
- /* The video display port only accepts the 7 lowest bits of the char. */
- data &= 0x7f;
-
- terminal_getcursor(m_terminal, &cursor_x, &cursor_y);
-
- if (data == '\r') {
- /* Carriage-return moves the cursor to the start of the next
- line. */
- cursor_x = 0;
- cursor_y++;
- }
- else if (data < ' ') {
- /* Except for carriage-return, the video hardware completely
- ignores all control characters. */
- return;
- }
- else {
- /* For visible characters, only 6 bits of the ASCII code are
- used, because the 2513 character generator ROM only
- contains 64 symbols. The low 5 bits of the ASCII code are
- used directly. Bit 6 is ignored, since it is the same for
- all the available characters in the ROM. Bit 7 is inverted
- before being used as the high bit of the 6-bit ROM symbol
- index, because the block of 32 ASCII symbols containing the
- uppercase letters comes first in the ROM. */
-
- int romindx = (data & 0x1f) | (((data ^ 0x40) & 0x40) >> 1);
-
- terminal_putchar(m_terminal, cursor_x, cursor_y, romindx);
- if (cursor_x < 39)
- {
- cursor_x++;
- }
- else
- {
- cursor_x = 0;
- cursor_y++;
- }
- }
-
- /* If the cursor went past the bottom line, scroll the text up one line. */
- if (cursor_y == 24)
- {
- for (y = 1; y < 24; y++)
- for (x = 0; x < 40; x++)
- terminal_putchar(m_terminal, x, y-1,
- terminal_getchar(m_terminal, x, y));
-
- for (x = 0; x < 40; x++)
- terminal_putblank(m_terminal, x, 23);
-
- cursor_y--;
- }
-
- terminal_setcursor(m_terminal, cursor_x, cursor_y);
-}
-
-/* This function handles clearing the video display on cold-boot or in
- response to a press of the CLEAR SCREEN switch. */
-void apple1_state::apple1_vh_dsp_clr ()
-{
- terminal_setcursor(m_terminal, 0, 0);
- terminal_clear(m_terminal);
-}
-
-/* Calculate how long it will take for the display to assert the RDA
- signal in response to a video display write. This signal indicates
- the display has completed the write and is ready to accept another
- write. */
-attotime apple1_state::apple1_vh_dsp_time_to_ready ()
-{
- int cursor_x, cursor_y;
- int cursor_scanline;
- double scanline_period = m_screen->scan_period().as_double();
- double cursor_hfrac;
-
- /* The video hardware refreshes the screen by reading the
- character codes from its circulating shift-register memory.
- Because of the way this memory works, a new character can only
- be written into the cursor location at the moment this location
- is about to be read. This happens during the first scanline of
- the cursor's character line, when the beam reaches the cursor's
- horizontal position. */
-
- terminal_getcursor(m_terminal, &cursor_x, &cursor_y);
- cursor_scanline = cursor_y * apple1_charlayout.height;
-
- /* Each scanline is composed of 455 pixel times. The first 175 of
- these are the horizontal blanking period; the remaining 280 are
- for the visible part of the scanline. */
- cursor_hfrac = (175 + cursor_x * apple1_charlayout.width) / 455;
-
- if (m_screen->vpos() == cursor_scanline) {
- /* video_screen_get_hpos() doesn't account for the horizontal
- blanking interval; it acts as if the scanline period is
- entirely composed of visible pixel times. However, we can
- still use it to find what fraction of the current scanline
- period has elapsed. */
- double current_hfrac = m_screen->hpos() /
- m_screen->width();
- if (current_hfrac < cursor_hfrac)
- return attotime::from_double(scanline_period * (cursor_hfrac - current_hfrac));
- }
-
- return attotime::from_double(
- m_screen->time_until_pos(cursor_scanline, 0).as_double() +
- scanline_period * cursor_hfrac);
-}
-
-/* Blink the cursor on or off, as appropriate. */
-void apple1_state::apple1_vh_cursor_blink ()
-{
- int new_blink_on;
-
- /* The cursor is on for 2/3 of its blink period and off for 1/3.
- This is most easily handled by dividing the total elapsed time
- by the length of the off-portion of the cycle, giving us the
- number of one-third-cycles elapsed, then checking the result
- modulo 3. */
-
- if (((int) (machine().time().as_double() / CURSOR_OFF_LENGTH)) % 3 < 2)
- new_blink_on = 1;
- else
- new_blink_on = 0;
-
- if (new_blink_on != m_blink_on) { /* have we changed state? */
- if (new_blink_on)
- terminal_showcursor(m_terminal);
- else
- terminal_hidecursor(m_terminal);
- m_blink_on = new_blink_on;
- }
-}
-
-UINT32 apple1_state::screen_update_apple1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- apple1_vh_cursor_blink();
- terminal_draw(screen, bitmap, cliprect, m_terminal);
- return 0;
-}
diff --git a/src/mess/video/apple2.c b/src/mess/video/apple2.c
deleted file mode 100644
index 195fed4ce8f..00000000000
--- a/src/mess/video/apple2.c
+++ /dev/null
@@ -1,1540 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:R. Belmont
-/***************************************************************************
-
- video/apple2.c
-
-***************************************************************************/
-
-#include "emu.h"
-#include "includes/apple2.h"
-#include "machine/ram.h"
-
-#include "video/apple2.h"
-
-/***************************************************************************/
-
-
-#define BLACK 0
-#define DKRED 1
-#define DKBLUE 2
-#define PURPLE 3
-#define DKGREEN 4
-#define DKGRAY 5
-#define BLUE 6
-#define LTBLUE 7
-#define BROWN 8
-#define ORANGE 9
-#define GRAY 10
-#define PINK 11
-#define GREEN 12
-#define YELLOW 13
-#define AQUA 14
-#define WHITE 15
-
-#define ALWAYS_REFRESH 0
-#define PROFILER_VIDEOTOUCH PROFILER_USER3
-
-/***************************************************************************
- HELPERS
-***************************************************************************/
-
-/*-------------------------------------------------
- effective_a2 - calculates the effective a2
- register
--------------------------------------------------*/
-
-inline UINT32 apple2_state::effective_a2()
-{
- return m_flags & m_a2_videomask;
-}
-
-
-/*-------------------------------------------------
- compute_video_address - performs funky Apple II
- video address lookup
--------------------------------------------------*/
-
-UINT32 apple2_state::compute_video_address(int col, int row)
-{
- /* special Apple II addressing - gotta love it */
- return (((row & 0x07) << 7) | ((row & 0x18) * 5 + col));
-}
-
-
-
-/*-------------------------------------------------
- adjust_begin_and_end_row - processes the cliprect
--------------------------------------------------*/
-
-void apple2_state::adjust_begin_and_end_row(const rectangle &cliprect, int *beginrow, int *endrow)
-{
- /* assumptions of the code */
- assert((*beginrow % 8) == 0);
- assert((*endrow % 8) == 7);
-
- *beginrow = MAX(*beginrow, cliprect.min_y - (cliprect.min_y % 8));
- *endrow = MIN(*endrow, cliprect.max_y - (cliprect.max_y % 8) + 7);
-
- /* sanity check again */
- assert((*beginrow % 8) == 0);
- assert((*endrow % 8) == 7);
-}
-
-
-
-/***************************************************************************
- TEXT
-***************************************************************************/
-
-/*-------------------------------------------------
- apple2_plot_text_character - plots a single
- textual character
--------------------------------------------------*/
-
-inline void apple2_state::apple2_plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code,
- const UINT8 *textgfx_data, UINT32 textgfx_datalen, UINT32 my_a2)
-{
- int x, y, i;
- int fg = m_fgcolor;
- int bg = m_bgcolor;
- const UINT8 *chardata;
- UINT16 color;
-
- if (m_sysconfig != NULL)
- {
- switch (m_sysconfig->read() & 0x03)
- {
- case 0:
- break; // leave alone
-
- case 1:
- if ((m_machinetype == APPLE_II) || (m_machinetype == LABA2P) || (m_machinetype == SPACE84))
- {
- bg = WHITE;
- }
- else
- {
- fg = WHITE;
- }
- break;
-
- case 2:
- if ((m_machinetype == APPLE_II) || (m_machinetype == LABA2P) || (m_machinetype == SPACE84))
- {
- bg = GREEN;
- }
- else
- {
- fg = GREEN;
- }
- break;
-
- case 3:
- if ((m_machinetype == APPLE_II) || (m_machinetype == LABA2P) || (m_machinetype == SPACE84))
- {
- bg = ORANGE;
- }
- else
- {
- fg = ORANGE;
- }
- break;
- }
- }
-
-
- if (my_a2 & VAR_ALTCHARSET)
- {
- /* we're using an alternate charset */
- code |= m_alt_charset_value;
- }
- else if (m_flash && (code >= 0x40) && (code <= 0x7f))
- {
- /* we're flashing; swap */
- i = fg;
- fg = bg;
- bg = i;
- }
-
- /* look up the character data */
- chardata = &textgfx_data[(code * 8) % textgfx_datalen];
-
- /* and finally, plot the character itself */
- if ((m_machinetype == SPACE84) || (m_machinetype == LABA2P))
- {
- for (y = 0; y < 8; y++)
- {
- for (x = 0; x < 7; x++)
- {
- color = (chardata[y] & (1 << (6-x))) ? bg : fg;
-
- for (i = 0; i < xscale; i++)
- {
- bitmap.pix16(ypos + y, xpos + (x * xscale) + i) = color;
- }
- }
- }
- }
- else
- {
- for (y = 0; y < 8; y++)
- {
- for (x = 0; x < 7; x++)
- {
- color = (chardata[y] & (1 << x)) ? bg : fg;
-
- for (i = 0; i < xscale; i++)
- {
- bitmap.pix16(ypos + y, xpos + (x * xscale) + i) = color;
- }
- }
- }
- }
-}
-
-
-
-/*-------------------------------------------------
- apple2_text_draw - renders text (either 40
- column or 80 column)
--------------------------------------------------*/
-
-void apple2_state::apple2_text_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int page, int beginrow, int endrow)
-{
- int row, col;
- UINT32 start_address = (page ? 0x0800 : 0x0400);
- UINT32 address;
- UINT32 my_a2 = effective_a2();
-
- /* perform adjustments */
- adjust_begin_and_end_row(cliprect, &beginrow, &endrow);
-
- for (row = beginrow; row <= endrow; row += 8)
- {
- for (col = 0; col < 40; col++)
- {
- /* calculate adderss */
- address = start_address + compute_video_address(col, row / 8);
-
- if (my_a2 & VAR_80COL)
- {
- apple2_plot_text_character(bitmap, col * 14 + 0, row, 1, m_a2_videoaux[address],
- m_textgfx_data, m_textgfx_datalen, my_a2);
- apple2_plot_text_character(bitmap, col * 14 + 7, row, 1, m_a2_videoram[address],
- m_textgfx_data, m_textgfx_datalen, my_a2);
- }
- else
- {
- apple2_plot_text_character(bitmap, col * 14, row, 2, m_a2_videoram[address],
- m_textgfx_data, m_textgfx_datalen, my_a2);
- }
- }
- }
-}
-
-
-/*-------------------------------------------------
- apple2_lores_draw - renders lo-res text
--------------------------------------------------*/
-
-void apple2_state::apple2_lores_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int page, int beginrow, int endrow)
-{
- int row, col, y, x;
- UINT8 code;
- UINT32 start_address = (page ? 0x0800 : 0x0400);
- UINT32 address;
-
- /* perform adjustments */
- adjust_begin_and_end_row(cliprect, &beginrow, &endrow);
-
- for (row = beginrow; row <= endrow; row += 8)
- {
- for (col = 0; col < 40; col++)
- {
- /* calculate adderss */
- address = start_address + compute_video_address(col, row / 8);
-
- /* perform the lookup */
- code = m_a2_videoram[address];
-
- /* and now draw */
- for (y = 0; y < 4; y++)
- {
- for (x = 0; x < 14; x++)
- bitmap.pix16(row + y, col * 14 + x) = (code >> 0) & 0x0F;
- }
- for (y = 4; y < 8; y++)
- {
- for (x = 0; x < 14; x++)
- bitmap.pix16(row + y, col * 14 + x) = (code >> 4) & 0x0F;
- }
- }
- }
-}
-
-
-/***************************************************************************
- HIGH RESOLUTION GRAPHICS
-***************************************************************************/
-
-void apple2_state::apple2_hires_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int page, int beginrow, int endrow)
-{
- const UINT8 *vram, *vaux;
- int row, col, b;
- int offset;
- int columns;
- UINT8 vram_row[82];
- UINT16 v;
- UINT16 *p;
- UINT32 w;
- UINT16 *artifact_map_ptr;
- int mon_type = 0;
-
- if (m_sysconfig != NULL)
- {
- mon_type = m_sysconfig->read() & 0x03;
- }
-
- /* sanity checks */
- if (beginrow < cliprect.min_y)
- beginrow = cliprect.min_y;
- if (endrow > cliprect.max_y)
- endrow = cliprect.max_y;
- if (endrow < beginrow)
- return;
-
- if (m_machinetype == TK2000)
- {
- vram = m_a2_videoram + (page ? 0xa000 : 0x2000);
- vaux = m_a2_videoaux + (page ? 0xa000 : 0x2000);
- }
- else
- {
- vram = m_a2_videoram + (page ? 0x4000 : 0x2000);
- vaux = m_a2_videoaux + (page ? 0x4000 : 0x2000);
- }
- columns = ((effective_a2() & (VAR_DHIRES|VAR_80COL)) == (VAR_DHIRES|VAR_80COL)) ? 80 : 40;
-
- vram_row[0] = 0;
- vram_row[columns + 1] = 0;
-
- for (row = beginrow; row <= endrow; row++)
- {
- for (col = 0; col < 40; col++)
- {
- offset = compute_video_address(col, row / 8) | ((row & 7) << 10);
-
- switch(columns)
- {
- case 40:
- vram_row[1+col] = vram[offset];
- break;
-
- case 80:
- vram_row[1+(col*2)+0] = vaux[offset];
- vram_row[1+(col*2)+1] = vram[offset];
- break;
-
- default:
- fatalerror("Invalid column count\n");
- }
- }
-
- p = &bitmap.pix16(row);
-
- for (col = 0; col < columns; col++)
- {
- w = (((UINT32) vram_row[col+0] & 0x7f) << 0)
- | (((UINT32) vram_row[col+1] & 0x7f) << 7)
- | (((UINT32) vram_row[col+2] & 0x7f) << 14);
-
- switch(columns)
- {
- case 40:
- switch (mon_type)
- {
- case 0:
- artifact_map_ptr = &m_hires_artifact_map[((vram_row[col+1] & 0x80) >> 7) * 16];
- for (b = 0; b < 7; b++)
- {
- v = artifact_map_ptr[((w >> (b + 7-1)) & 0x07) | (((b ^ col) & 0x01) << 3)];
- *(p++) = v;
- *(p++) = v;
- }
- break;
-
- case 1:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? WHITE : BLACK;
- *(p++) = v ? WHITE : BLACK;
- }
- break;
-
- case 2:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? GREEN : BLACK;
- *(p++) = v ? GREEN : BLACK;
- }
- break;
-
- case 3:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? ORANGE : BLACK;
- *(p++) = v ? ORANGE : BLACK;
- }
- break;
- }
- break;
-
- case 80:
- if (m_monochrome_dhr)
- {
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? WHITE : BLACK;
- }
- }
- else
- {
- switch (mon_type)
- {
- case 0:
- for (b = 0; b < 7; b++)
- {
- v = m_dhires_artifact_map[((((w >> (b + 7-1)) & 0x0F) * 0x11) >> (((2-(col*7+b))) & 0x03)) & 0x0F];
- *(p++) = v;
- }
- break;
-
- case 1:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? WHITE : BLACK;
- }
- break;
-
- case 2:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? GREEN : BLACK;
- }
- break;
-
- case 3:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? ORANGE : BLACK;
- }
- break;
- }
- }
- break;
-
- default:
- fatalerror("Invalid column count\n");
- }
- }
- }
-}
-
-
-
-/***************************************************************************
- VIDEO CORE
-***************************************************************************/
-
-void apple2_state::apple2_video_start(const UINT8 *vram, const UINT8 *aux_vram, UINT32 ignored_softswitches, int hires_modulo)
-{
- int i, j;
- UINT16 c;
- UINT8 *apple2_font;
-
- static const UINT8 hires_artifact_color_table[] =
- {
- BLACK, PURPLE, GREEN, WHITE,
- BLACK, BLUE, ORANGE, WHITE
- };
-
- static const UINT8 dhires_artifact_color_table[] =
- {
- BLACK, DKGREEN, BROWN, GREEN,
- DKRED, DKGRAY, ORANGE, YELLOW,
- DKBLUE, BLUE, GRAY, AQUA,
- PURPLE, LTBLUE, PINK, WHITE
- };
-
- m_fgcolor = 15;
- m_bgcolor = 0;
- m_flash = 0;
- apple2_font = memregion("gfx1")->base();
- m_alt_charset_value = memregion("gfx1")->bytes() / 16;
- m_a2_videoram = vram;
- m_a2_videoaux = aux_vram;
-
- m_textgfx_data = memregion("gfx1")->base();
- m_textgfx_datalen = memregion("gfx1")->bytes();
-
- /* 2^3 dependent pixels * 2 color sets * 2 offsets */
- m_hires_artifact_map = auto_alloc_array(machine(), UINT16, 8 * 2 * 2);
-
- /* 2^4 dependent pixels */
- m_dhires_artifact_map = auto_alloc_array(machine(), UINT16, 16);
-
- /* build hires artifact map */
- for (i = 0; i < 8; i++)
- {
- for (j = 0; j < 2; j++)
- {
- if (i & 0x02)
- {
- if ((i & 0x05) != 0)
- c = 3;
- else
- c = j ? 2 : 1;
- }
- else
- {
- if ((i & 0x05) == 0x05)
- c = j ? 1 : 2;
- else
- c = 0;
- }
- m_hires_artifact_map[ 0 + j*8 + i] = hires_artifact_color_table[(c + 0) % hires_modulo];
- m_hires_artifact_map[16 + j*8 + i] = hires_artifact_color_table[(c + 4) % hires_modulo];
- }
- }
-
- /* Fix for Ivel Ultra */
- if (!strcmp(machine().system().name, "ivelultr")) {
- int len = memregion("gfx1")->bytes();
- for (i = 0; i < len; i++)
- {
- apple2_font[i] = BITSWAP8(apple2_font[i], 7, 7, 6, 5, 4, 3, 2, 1);
- }
- }
-
- /* do we need to flip the gfx? */
- if (!strcmp(machine().system().name, "apple2")
- || !strcmp(machine().system().name, "apple2p")
- || !strcmp(machine().system().name, "prav82")
- || !strcmp(machine().system().name, "prav8m")
- || !strcmp(machine().system().name, "ivelultr")
- || !strcmp(machine().system().name, "apple2jp"))
- {
- int len = memregion("gfx1")->bytes();
- for (i = 0; i < len; i++)
- {
- apple2_font[i] = BITSWAP8(apple2_font[i], 7, 0, 1, 2, 3, 4, 5, 6);
- }
- }
-
-
- /* build double hires artifact map */
- for (i = 0; i < 16; i++)
- {
- m_dhires_artifact_map[i] = dhires_artifact_color_table[i];
- }
-
- memset(&m_old_a2, 0, sizeof(m_old_a2));
- m_a2_videomask = ~ignored_softswitches;
-}
-
-
-
-VIDEO_START_MEMBER(apple2_state,apple2)
-{
- apple2_video_start(m_ram->pointer(), m_ram->pointer()+0x10000, VAR_80COL | VAR_ALTCHARSET | VAR_DHIRES, 4);
-
- /* hack to fix the colors on apple2/apple2p */
- m_fgcolor = 0;
- m_bgcolor = 15;
-
- m_monochrome_dhr = false;
-}
-
-
-VIDEO_START_MEMBER(apple2_state,apple2p)
-{
- apple2_video_start(m_ram->pointer(), m_ram->pointer(), VAR_80COL | VAR_ALTCHARSET | VAR_DHIRES, 8);
-
- /* hack to fix the colors on apple2/apple2p */
- m_fgcolor = 0;
- m_bgcolor = 15;
-
- m_monochrome_dhr = false;
-}
-
-
-VIDEO_START_MEMBER(apple2_state,apple2e)
-{
- device_a2eauxslot_card_interface *auxslotdevice = m_a2eauxslot->get_a2eauxslot_card();
- if (auxslotdevice)
- {
- apple2_video_start(m_ram->pointer(), auxslotdevice->get_vram_ptr(), auxslotdevice->allow_dhr() ? 0 : VAR_DHIRES, 8);
- }
- else
- {
- apple2_video_start(m_ram->pointer(), m_ram->pointer(), VAR_80COL | VAR_DHIRES, 8);
- }
-}
-
-
-VIDEO_START_MEMBER(apple2_state,apple2c)
-{
- apple2_video_start(m_ram->pointer(), m_ram->pointer()+0x10000, 0, 8);
-}
-
-UINT32 apple2_state::screen_update_apple2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- int page;
- UINT32 new_a2;
-
- /* calculate the m_flash value */
- m_flash = ((machine().time() * 4).seconds() & 1) ? 1 : 0;
-
- /* read out relevant softswitch variables; to see what has changed */
- new_a2 = effective_a2();
- if (new_a2 & VAR_80STORE)
- new_a2 &= ~VAR_PAGE2;
- new_a2 &= VAR_TEXT | VAR_MIXED | VAR_HIRES | VAR_DHIRES | VAR_80COL | VAR_PAGE2 | VAR_ALTCHARSET;
-
- if (ALWAYS_REFRESH || (new_a2 != m_old_a2))
- {
- m_old_a2 = new_a2;
- }
-
- /* choose which page to use */
- page = (new_a2 & VAR_PAGE2) ? 1 : 0;
-
- /* choose the video mode to draw */
- if (effective_a2() & VAR_TEXT)
- {
- /* text screen - TK2000 uses HGR for text */
- if (m_machinetype == TK2000)
- {
- apple2_hires_draw(bitmap, cliprect, page, 0, 191);
- }
- else
- {
- apple2_text_draw(bitmap, cliprect, page, 0, 191);
- }
- }
- else if ((effective_a2() & VAR_HIRES) && (effective_a2() & VAR_MIXED))
- {
- /* hi-res on top; text at bottom */
- apple2_hires_draw(bitmap, cliprect, page, 0, 159);
- apple2_text_draw(bitmap, cliprect, page, 160, 191);
- }
- else if (effective_a2() & VAR_HIRES)
- {
- /* hi-res screen */
- apple2_hires_draw(bitmap, cliprect, page, 0, 191);
- }
- else if (effective_a2() & VAR_MIXED)
- {
- /* lo-res on top; text at bottom */
- apple2_lores_draw(bitmap, cliprect, page, 0, 159);
- apple2_text_draw(bitmap, cliprect, page, 160, 191);
- }
- else
- {
- /* lo-res screen */
- apple2_lores_draw(bitmap, cliprect, page, 0, 191);
- }
- return 0;
-}
-
-/*
- New implementation
-*/
-
-const device_type APPLE2_VIDEO = &device_creator<a2_video_device>;
-
-//-------------------------------------------------
-// a2_video_device - constructor
-//-------------------------------------------------
-
-a2_video_device::a2_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, APPLE2_VIDEO, "Apple II video", tag, owner, clock, "a2video", __FILE__)
-{
-}
-
-void a2_video_device::device_start()
-{
- static const UINT8 hires_artifact_color_table[] =
- {
- BLACK, PURPLE, GREEN, WHITE,
- BLACK, BLUE, ORANGE, WHITE
- };
- static const UINT8 dhires_artifact_color_table[] =
- {
- BLACK, DKGREEN, BROWN, GREEN,
- DKRED, DKGRAY, ORANGE, YELLOW,
- DKBLUE, BLUE, GRAY, AQUA,
- PURPLE, LTBLUE, PINK, WHITE
- };
-
- // generate hi-res artifact data
- int i, j;
- UINT16 c;
-
- /* 2^3 dependent pixels * 2 color sets * 2 offsets */
- m_hires_artifact_map = auto_alloc_array(machine(), UINT16, 8 * 2 * 2);
-
- /* build hires artifact map */
- for (i = 0; i < 8; i++)
- {
- for (j = 0; j < 2; j++)
- {
- if (i & 0x02)
- {
- if ((i & 0x05) != 0)
- c = 3;
- else
- c = j ? 2 : 1;
- }
- else
- {
- if ((i & 0x05) == 0x05)
- c = j ? 1 : 2;
- else
- c = 0;
- }
- m_hires_artifact_map[ 0 + j*8 + i] = hires_artifact_color_table[(c + 0) % 8];
- m_hires_artifact_map[16 + j*8 + i] = hires_artifact_color_table[(c + 4) % 8];
- }
- }
-
- /* 2^4 dependent pixels */
- m_dhires_artifact_map = auto_alloc_array(machine(), UINT16, 16);
-
- /* build double hires artifact map */
- for (i = 0; i < 16; i++)
- {
- m_dhires_artifact_map[i] = dhires_artifact_color_table[i];
- }
-
- save_item(NAME(m_page2));
- save_item(NAME(m_flash));
- save_item(NAME(m_mix));
- save_item(NAME(m_graphics));
- save_item(NAME(m_hires));
- save_item(NAME(m_dhires));
- save_item(NAME(m_80col));
- save_item(NAME(m_altcharset));
-}
-
-void a2_video_device::device_reset()
-{
- m_page2 = false;
- m_graphics = false;
- m_hires = false;
- m_80col = false;
- m_altcharset = false;
- m_dhires = false;
- m_flash = false;
- m_mix = false;
- m_sysconfig = 0;
-}
-
-void a2_video_device::plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code,
- const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg)
-{
- int x, y, i;
- const UINT8 *chardata;
- UINT16 color;
-
- if (!m_altcharset)
- {
- if ((code >= 0x40) && (code <= 0x7f))
- {
- code &= 0x3f;
-
- if (m_flash)
- {
- i = fg;
- fg = bg;
- bg = i;
- }
- }
- }
- else
- {
- if ((code >= 0x60) && (code <= 0x7f))
- {
- code |= 0x80; // map to lowercase normal
- i = fg; // and flip the color
- fg = bg;
- bg = i;
- }
- }
-
- /* look up the character data */
- chardata = &textgfx_data[(code * 8)];
-
- for (y = 0; y < 8; y++)
- {
- for (x = 0; x < 7; x++)
- {
- color = (chardata[y] & (1 << x)) ? bg : fg;
-
- for (i = 0; i < xscale; i++)
- {
- bitmap.pix16(ypos + y, xpos + (x * xscale) + i) = color;
- }
- }
- }
-}
-
-void a2_video_device::plot_text_character_orig(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code,
- const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg)
-{
- int x, y, i;
- const UINT8 *chardata;
- UINT16 color;
-
- if ((code >= 0x40) && (code <= 0x7f))
- {
- if (m_flash)
- {
- i = fg;
- fg = bg;
- bg = i;
- }
- }
-
- /* look up the character data */
- chardata = &textgfx_data[(code * 8)];
-
- for (y = 0; y < 8; y++)
- {
- for (x = 0; x < 7; x++)
- {
- color = (chardata[y] & (1 << (6-x))) ? fg : bg;
-
- for (i = 0; i < xscale; i++)
- {
- bitmap.pix16(ypos + y, xpos + (x * xscale) + i) = color;
- }
- }
- }
-}
-
-void a2_video_device::plot_text_character_ultr(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code,
- const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg)
-{
- int x, y, i;
- const UINT8 *chardata;
- UINT16 color;
-
- if ((code >= 0x40) && (code <= 0x7f))
- {
- if (m_flash)
- {
- i = fg;
- fg = bg;
- bg = i;
- }
- }
-
- /* look up the character data */
- chardata = &textgfx_data[(code * 8)];
-
- for (y = 0; y < 8; y++)
- {
- for (x = 1; x < 8; x++)
- {
- color = (chardata[y] & (1 << x)) ? fg : bg;
-
- for (i = 0; i < xscale; i++)
- {
- bitmap.pix16(ypos + y, xpos + ((x-1) * xscale) + i) = color;
- }
- }
- }
-}
-
-void a2_video_device::lores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
-{
- int row, col, y, x;
- UINT8 code;
- UINT32 start_address = m_page2 ? 0x0800 : 0x0400;
- UINT32 address;
- int fg = 0;
-
- switch (m_sysconfig & 0x03)
- {
- case 0: fg = WHITE; break;
- case 1: fg = WHITE; break;
- case 2: fg = GREEN; break;
- case 3: fg = ORANGE; break;
- }
-
- /* perform adjustments */
- beginrow = MAX(beginrow, cliprect.min_y - (cliprect.min_y % 8));
- endrow = MIN(endrow, cliprect.max_y - (cliprect.max_y % 8) + 7);
-
- if (!(m_sysconfig & 0x03))
- {
- for (row = beginrow; row <= endrow; row += 8)
- {
- for (col = 0; col < 40; col++)
- {
- /* calculate adderss */
- address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col));
-
- /* perform the lookup */
- code = m_ram_ptr[address];
-
- /* and now draw */
- for (y = 0; y < 4; y++)
- {
- for (x = 0; x < 14; x++)
- bitmap.pix16(row + y, col * 14 + x) = (code >> 0) & 0x0F;
- }
- for (y = 4; y < 8; y++)
- {
- for (x = 0; x < 14; x++)
- bitmap.pix16(row + y, col * 14 + x) = (code >> 4) & 0x0F;
- }
- }
- }
- }
- else
- {
- for (row = beginrow; row <= endrow; row += 8)
- {
- for (col = 0; col < 40; col++)
- {
- UINT8 bits;
-
- /* calculate adderss */
- address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col));
-
- /* perform the lookup */
- code = m_ram_ptr[address];
-
- bits = (code >> 0) & 0x0F;
- /* and now draw */
- for (y = 0; y < 4; y++)
- {
- for (x = 0; x < 14; x++)
- {
- bitmap.pix16(row + y, col * 14 + x) = bits & (1 << (x % 4)) ? fg : 0;
- }
- }
-
- bits = (code >> 4) & 0x0F;
- for (y = 4; y < 8; y++)
- {
- for (x = 0; x < 14; x++)
- bitmap.pix16(row + y, col * 14 + x) = bits & (1 << (x % 4)) ? fg : 0;
- }
- }
- }
- }
-}
-
-void a2_video_device::dlores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
-{
- int row, col, y;
- UINT8 code, auxcode;
- UINT32 start_address = m_page2 ? 0x0800 : 0x0400;
- UINT32 address;
- static const int aux_colors[16] = { 0, 2, 4, 6, 8, 0xa, 0xc, 0xe, 1, 3, 5, 7, 9, 0xb, 0xd, 0xf };
- int fg = 0;
-
- switch (m_sysconfig & 0x03)
- {
- case 0: fg = WHITE; break;
- case 1: fg = WHITE; break;
- case 2: fg = GREEN; break;
- case 3: fg = ORANGE; break;
- }
-
- /* perform adjustments */
- beginrow = MAX(beginrow, cliprect.min_y - (cliprect.min_y % 8));
- endrow = MIN(endrow, cliprect.max_y - (cliprect.max_y % 8) + 7);
-
- if (!(m_sysconfig & 0x03))
- {
- for (row = beginrow; row <= endrow; row += 8)
- {
- for (col = 0; col < 40; col++)
- {
- /* calculate adderss */
- address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col));
-
- /* perform the lookup */
- code = m_ram_ptr[address];
- auxcode = m_aux_ptr[address];
-
- /* and now draw */
- for (y = 0; y < 4; y++)
- {
- UINT16 *vram = &bitmap.pix16(row + y, (col * 14));
-
- *vram++ = aux_colors[(auxcode >> 0) & 0x0F];
- *vram++ = aux_colors[(auxcode >> 0) & 0x0F];
- *vram++ = aux_colors[(auxcode >> 0) & 0x0F];
- *vram++ = aux_colors[(auxcode >> 0) & 0x0F];
- *vram++ = aux_colors[(auxcode >> 0) & 0x0F];
- *vram++ = aux_colors[(auxcode >> 0) & 0x0F];
- *vram++ = aux_colors[(auxcode >> 0) & 0x0F];
- *vram++ = (code >> 0) & 0x0F;
- *vram++ = (code >> 0) & 0x0F;
- *vram++ = (code >> 0) & 0x0F;
- *vram++ = (code >> 0) & 0x0F;
- *vram++ = (code >> 0) & 0x0F;
- *vram++ = (code >> 0) & 0x0F;
- *vram++ = (code >> 0) & 0x0F;
- }
- for (y = 4; y < 8; y++)
- {
- UINT16 *vram = &bitmap.pix16(row + y, (col * 14));
-
- *vram++ = aux_colors[(auxcode >> 4) & 0x0F];
- *vram++ = aux_colors[(auxcode >> 4) & 0x0F];
- *vram++ = aux_colors[(auxcode >> 4) & 0x0F];
- *vram++ = aux_colors[(auxcode >> 4) & 0x0F];
- *vram++ = aux_colors[(auxcode >> 4) & 0x0F];
- *vram++ = aux_colors[(auxcode >> 4) & 0x0F];
- *vram++ = aux_colors[(auxcode >> 4) & 0x0F];
- *vram++ = (code >> 4) & 0x0F;
- *vram++ = (code >> 4) & 0x0F;
- *vram++ = (code >> 4) & 0x0F;
- *vram++ = (code >> 4) & 0x0F;
- *vram++ = (code >> 4) & 0x0F;
- *vram++ = (code >> 4) & 0x0F;
- *vram++ = (code >> 4) & 0x0F;
- }
- }
- }
- }
- else
- {
- for (row = beginrow; row <= endrow; row += 8)
- {
- for (col = 0; col < 40; col++)
- {
- UINT8 bits, abits;
-
- /* calculate adderss */
- address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col));
-
- /* perform the lookup */
- code = m_ram_ptr[address];
- auxcode = m_aux_ptr[address];
-
- bits = (code >> 0) & 0x0F;
- abits = (auxcode >> 0) & 0x0F;
-
- /* and now draw */
- for (y = 0; y < 4; y++)
- {
- UINT16 *vram = &bitmap.pix16(row + y, (col * 14));
-
- *vram++ = abits & (1 << 0) ? fg : 0;
- *vram++ = abits & (1 << 1) ? fg : 0;
- *vram++ = abits & (1 << 2) ? fg : 0;
- *vram++ = abits & (1 << 3) ? fg : 0;
- *vram++ = abits & (1 << 0) ? fg : 0;
- *vram++ = abits & (1 << 1) ? fg : 0;
- *vram++ = abits & (1 << 2) ? fg : 0;
- *vram++ = bits & (1 << 0) ? fg : 0;
- *vram++ = bits & (1 << 1) ? fg : 0;
- *vram++ = bits & (1 << 2) ? fg : 0;
- *vram++ = bits & (1 << 3) ? fg : 0;
- *vram++ = bits & (1 << 0) ? fg : 0;
- *vram++ = bits & (1 << 1) ? fg : 0;
- *vram++ = bits & (1 << 2) ? fg : 0;
- }
-
- bits = (code >> 4) & 0x0F;
- abits = (auxcode >> 4) & 0x0F;
-
- for (y = 4; y < 8; y++)
- {
- UINT16 *vram = &bitmap.pix16(row + y, (col * 14));
-
- *vram++ = abits & (1 << 0) ? fg : 0;
- *vram++ = abits & (1 << 1) ? fg : 0;
- *vram++ = abits & (1 << 2) ? fg : 0;
- *vram++ = abits & (1 << 3) ? fg : 0;
- *vram++ = abits & (1 << 0) ? fg : 0;
- *vram++ = abits & (1 << 1) ? fg : 0;
- *vram++ = abits & (1 << 2) ? fg : 0;
- *vram++ = bits & (1 << 0) ? fg : 0;
- *vram++ = bits & (1 << 1) ? fg : 0;
- *vram++ = bits & (1 << 2) ? fg : 0;
- *vram++ = bits & (1 << 3) ? fg : 0;
- *vram++ = bits & (1 << 0) ? fg : 0;
- *vram++ = bits & (1 << 1) ? fg : 0;
- *vram++ = bits & (1 << 2) ? fg : 0;
- }
- }
- }
- }
-}
-
-void a2_video_device::text_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
-{
- int row, col;
- UINT32 start_address;
- UINT32 address;
- UINT8 *aux_page = m_ram_ptr;
- int fg = 0;
- int bg = 0;
-
- if (m_80col)
- {
- start_address = 0x400;
- if (m_aux_ptr)
- {
- aux_page = m_aux_ptr;
- }
- }
- else
- {
- start_address = m_page2 ? 0x800 : 0x400;
- }
-
- beginrow = MAX(beginrow, cliprect.min_y - (cliprect.min_y % 8));
- endrow = MIN(endrow, cliprect.max_y - (cliprect.max_y % 8) + 7);
-
- switch (m_sysconfig & 0x03)
- {
- case 0: fg = WHITE; break;
- case 1: fg = WHITE; break;
- case 2: fg = GREEN; break;
- case 3: fg = ORANGE; break;
- }
-
- for (row = beginrow; row <= endrow; row += 8)
- {
- if (m_80col)
- {
- for (col = 0; col < 40; col++)
- {
- /* calculate address */
- address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col));
-
- plot_text_character(bitmap, col * 14, row, 1, aux_page[address],
- m_char_ptr, m_char_size, fg, bg);
- plot_text_character(bitmap, col * 14 + 7, row, 1, m_ram_ptr[address],
- m_char_ptr, m_char_size, fg, bg);
- }
- }
- else
- {
- for (col = 0; col < 40; col++)
- {
- /* calculate address */
- address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col));
- plot_text_character(bitmap, col * 14, row, 2, m_ram_ptr[address],
- m_char_ptr, m_char_size, fg, bg);
- }
- }
- }
-}
-
-void a2_video_device::text_update_orig(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
-{
- int row, col;
- UINT32 start_address = m_page2 ? 0x800 : 0x400;
- UINT32 address;
- int fg = 0;
- int bg = 0;
-
- beginrow = MAX(beginrow, cliprect.min_y - (cliprect.min_y % 8));
- endrow = MIN(endrow, cliprect.max_y - (cliprect.max_y % 8) + 7);
-
- switch (m_sysconfig & 0x03)
- {
- case 0: fg = WHITE; break;
- case 1: fg = WHITE; break;
- case 2: fg = GREEN; break;
- case 3: fg = ORANGE; break;
- }
-
- for (row = beginrow; row <= endrow; row += 8)
- {
- for (col = 0; col < 40; col++)
- {
- /* calculate address */
- address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col));
- plot_text_character_orig(bitmap, col * 14, row, 2, m_ram_ptr[address],
- m_char_ptr, m_char_size, fg, bg);
- }
- }
-}
-
-void a2_video_device::text_update_ultr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
-{
- int row, col;
- UINT32 start_address = m_page2 ? 0x800 : 0x400;
- UINT32 address;
- int fg = 0;
- int bg = 0;
-
- beginrow = MAX(beginrow, cliprect.min_y - (cliprect.min_y % 8));
- endrow = MIN(endrow, cliprect.max_y - (cliprect.max_y % 8) + 7);
-
- switch (m_sysconfig & 0x03)
- {
- case 0: fg = WHITE; break;
- case 1: fg = WHITE; break;
- case 2: fg = GREEN; break;
- case 3: fg = ORANGE; break;
- }
-
- for (row = beginrow; row <= endrow; row += 8)
- {
- for (col = 0; col < 40; col++)
- {
- /* calculate address */
- address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col));
- plot_text_character_ultr(bitmap, col * 14, row, 2, m_ram_ptr[address],
- m_char_ptr, m_char_size, fg, bg);
- }
- }
-}
-
-void a2_video_device::hgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
-{
- const UINT8 *vram;
- int row, col, b;
- int offset;
- UINT8 vram_row[42];
- UINT16 v;
- UINT16 *p;
- UINT32 w;
- UINT16 *artifact_map_ptr;
- int mon_type = m_sysconfig & 0x03;
-
- /* sanity checks */
- if (beginrow < cliprect.min_y)
- beginrow = cliprect.min_y;
- if (endrow > cliprect.max_y)
- endrow = cliprect.max_y;
- if (endrow < beginrow)
- return;
-
- vram = &m_ram_ptr[(m_page2 ? 0x4000 : 0x2000)];
-
- vram_row[0] = 0;
- vram_row[41] = 0;
-
- for (row = beginrow; row <= endrow; row++)
- {
- for (col = 0; col < 40; col++)
- {
- offset = ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col)) | ((row & 7) << 10);
- vram_row[1+col] = vram[offset];
- }
-
- p = &bitmap.pix16(row);
-
- for (col = 0; col < 40; col++)
- {
- w = (((UINT32) vram_row[col+0] & 0x7f) << 0)
- | (((UINT32) vram_row[col+1] & 0x7f) << 7)
- | (((UINT32) vram_row[col+2] & 0x7f) << 14);
-
- switch (mon_type)
- {
- case 0:
- // verified on h/w: setting dhires w/o 80col emulates a rev. 0 Apple ][ with no orange/blue
- if (m_dhires)
- {
- artifact_map_ptr = m_hires_artifact_map;
- }
- else
- {
- artifact_map_ptr = &m_hires_artifact_map[((vram_row[col + 1] & 0x80) >> 7) * 16];
- }
- for (b = 0; b < 7; b++)
- {
- v = artifact_map_ptr[((w >> (b + 7-1)) & 0x07) | (((b ^ col) & 0x01) << 3)];
- *(p++) = v;
- *(p++) = v;
- }
- break;
-
- case 1:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? WHITE : BLACK;
- *(p++) = v ? WHITE : BLACK;
- }
- break;
-
- case 2:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? GREEN : BLACK;
- *(p++) = v ? GREEN : BLACK;
- }
- break;
-
- case 3:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? ORANGE : BLACK;
- *(p++) = v ? ORANGE : BLACK;
- }
- break;
- }
- }
- }
-}
-
-// similar to regular A2 except page 2 is at $A000
-void a2_video_device::hgr_update_tk2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
-{
- const UINT8 *vram;
- int row, col, b;
- int offset;
- UINT8 vram_row[42];
- UINT16 v;
- UINT16 *p;
- UINT32 w;
- UINT16 *artifact_map_ptr;
- int mon_type = m_sysconfig & 0x03;
-
- /* sanity checks */
- if (beginrow < cliprect.min_y)
- beginrow = cliprect.min_y;
- if (endrow > cliprect.max_y)
- endrow = cliprect.max_y;
- if (endrow < beginrow)
- return;
-
- vram = &m_ram_ptr[(m_page2 ? 0xa000 : 0x2000)];
-
- vram_row[0] = 0;
- vram_row[41] = 0;
-
- for (row = beginrow; row <= endrow; row++)
- {
- for (col = 0; col < 40; col++)
- {
- offset = ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col)) | ((row & 7) << 10);
- vram_row[1+col] = vram[offset];
- }
-
- p = &bitmap.pix16(row);
-
- for (col = 0; col < 40; col++)
- {
- w = (((UINT32) vram_row[col+0] & 0x7f) << 0)
- | (((UINT32) vram_row[col+1] & 0x7f) << 7)
- | (((UINT32) vram_row[col+2] & 0x7f) << 14);
-
- switch (mon_type)
- {
- case 0:
- artifact_map_ptr = &m_hires_artifact_map[((vram_row[col+1] & 0x80) >> 7) * 16];
- for (b = 0; b < 7; b++)
- {
- v = artifact_map_ptr[((w >> (b + 7-1)) & 0x07) | (((b ^ col) & 0x01) << 3)];
- *(p++) = v;
- *(p++) = v;
- }
- break;
-
- case 1:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? WHITE : BLACK;
- *(p++) = v ? WHITE : BLACK;
- }
- break;
-
- case 2:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? GREEN : BLACK;
- *(p++) = v ? GREEN : BLACK;
- }
- break;
-
- case 3:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? ORANGE : BLACK;
- *(p++) = v ? ORANGE : BLACK;
- }
- break;
- }
- }
- }
-}
-
-void a2_video_device::dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
-{
- const UINT8 *vram, *vaux;
- int row, col, b;
- int offset;
- UINT8 vram_row[82];
- UINT16 v;
- UINT16 *p;
- UINT32 w;
- int page = m_page2 ? 0x4000 : 0x2000;
- int mon_type = m_sysconfig & 0x03;
-
- /* sanity checks */
- if (beginrow < cliprect.min_y)
- beginrow = cliprect.min_y;
- if (endrow > cliprect.max_y)
- endrow = cliprect.max_y;
- if (endrow < beginrow)
- return;
-
- vram = &m_ram_ptr[page];
- if (m_aux_ptr)
- {
- vaux = m_aux_ptr;
- }
- else
- {
- vaux = vram;
- }
- vaux += page;
-
- vram_row[0] = 0;
- vram_row[81] = 0;
-
- for (row = beginrow; row <= endrow; row++)
- {
- for (col = 0; col < 40; col++)
- {
- offset = ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col)) | ((row & 7) << 10);
- vram_row[1+(col*2)+0] = vaux[offset];
- vram_row[1+(col*2)+1] = vram[offset];
- }
-
- p = &bitmap.pix16(row);
-
- for (col = 0; col < 80; col++)
- {
- w = (((UINT32) vram_row[col+0] & 0x7f) << 0)
- | (((UINT32) vram_row[col+1] & 0x7f) << 7)
- | (((UINT32) vram_row[col+2] & 0x7f) << 14);
-
- switch (mon_type)
- {
- case 0:
- for (b = 0; b < 7; b++)
- {
- v = m_dhires_artifact_map[((((w >> (b + 7-1)) & 0x0F) * 0x11) >> (((2-(col*7+b))) & 0x03)) & 0x0F];
- *(p++) = v;
- }
- break;
-
- case 1:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? WHITE : BLACK;
- }
- break;
-
- case 2:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? GREEN : BLACK;
- }
- break;
-
- case 3:
- w >>= 7;
- for (b = 0; b < 7; b++)
- {
- v = (w & 1);
- w >>= 1;
- *(p++) = v ? ORANGE : BLACK;
- }
- break;
- }
- }
- }
-}
-
-/* according to Steve Nickolas (author of Dapple), our original palette would
- * have been more appropriate for an Apple IIgs. So we've substituted in the
- * Robert Munafo palette instead, which is more accurate on 8-bit Apples
- */
-static const rgb_t apple2_palette[] =
-{
- rgb_t::black,
- rgb_t(0xE3, 0x1E, 0x60), /* Dark Red */
- rgb_t(0x60, 0x4E, 0xBD), /* Dark Blue */
- rgb_t(0xFF, 0x44, 0xFD), /* Purple */
- rgb_t(0x00, 0xA3, 0x60), /* Dark Green */
- rgb_t(0x9C, 0x9C, 0x9C), /* Dark Gray */
- rgb_t(0x14, 0xCF, 0xFD), /* Medium Blue */
- rgb_t(0xD0, 0xC3, 0xFF), /* Light Blue */
- rgb_t(0x60, 0x72, 0x03), /* Brown */
- rgb_t(0xFF, 0x6A, 0x3C), /* Orange */
- rgb_t(0x9C, 0x9C, 0x9C), /* Light Grey */
- rgb_t(0xFF, 0xA0, 0xD0), /* Pink */
- rgb_t(0x14, 0xF5, 0x3C), /* Light Green */
- rgb_t(0xD0, 0xDD, 0x8D), /* Yellow */
- rgb_t(0x72, 0xFF, 0xD0), /* Aquamarine */
- rgb_t(0xFF, 0xFF, 0xFF) /* White */
-};
-
-/* Initialize the palette */
-PALETTE_INIT_MEMBER(a2_video_device, apple2)
-{
- palette.set_pen_colors(0, apple2_palette, ARRAY_LENGTH(apple2_palette));
-}
diff --git a/src/mess/video/apple2.h b/src/mess/video/apple2.h
deleted file mode 100644
index 6f5f76e4cbf..00000000000
--- a/src/mess/video/apple2.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:R. Belmont
-/*********************************************************************
-
- video/apple2.h - Video handling for 8-bit Apple IIs
-
-*********************************************************************/
-
-#ifndef __A2_VIDEO__
-#define __A2_VIDEO__
-
-#include "emu.h"
-
-class a2_video_device :
- public device_t
-{
-public:
- // construction/destruction
- a2_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
- DECLARE_PALETTE_INIT(apple2);
-
- bool m_page2;
- bool m_flash;
- bool m_mix;
- bool m_graphics;
- bool m_hires;
- bool m_dhires;
- bool m_80col;
- bool m_altcharset;
- UINT16 *m_hires_artifact_map;
- UINT16 *m_dhires_artifact_map;
-
- UINT8 *m_ram_ptr, *m_aux_ptr, *m_char_ptr;
- int m_char_size;
-
- int m_sysconfig;
-
- void text_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
- void text_update_ultr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
- void text_update_orig(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
- void lores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
- void dlores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
- void hgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
- void hgr_update_tk2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
- void dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
-
-protected:
- virtual void device_reset();
- virtual void device_start();
-
-private:
- void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg);
- void plot_text_character_ultr(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg);
- void plot_text_character_orig(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg);
-};
-
-// device type definition
-extern const device_type APPLE2_VIDEO;
-
-#endif
diff --git a/src/mess/video/apple2gs.c b/src/mess/video/apple2gs.c
deleted file mode 100644
index fb00047c30a..00000000000
--- a/src/mess/video/apple2gs.c
+++ /dev/null
@@ -1,168 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Nathan Woods,R. Belmont
-/*********************************************************************
-
- video/apple2gs.c
-
- Apple IIgs video code
-
-*********************************************************************/
-
-
-#include "emu.h"
-#include "includes/apple2.h"
-#include "includes/apple2gs.h"
-
-
-
-VIDEO_START_MEMBER(apple2gs_state,apple2gs)
-{
- m_bordercolor = 0;
- apple2_video_start(m_slowmem, m_slowmem+0x10000, 0, 8);
- m_legacy_gfx = auto_bitmap_ind16_alloc(machine(), 560, 192);
-
- save_item(m_bordercolor, "BORDERCLR");
- save_item(NAME(m_fgcolor));
- save_item(NAME(m_bgcolor));
-}
-
-
-
-UINT32 apple2gs_state::screen_update_apple2gs(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- const UINT8 *vram;
- UINT32 *scanline;
- UINT8 scb, b;
- int col, palette;
- UINT32 last_pixel = 0, pixel;
- int beamy;
- UINT16 *a2pixel;
-
- beamy = cliprect.min_y;
-
- if (m_newvideo & 0x80)
- {
- // in top or bottom border?
- if ((beamy < BORDER_TOP) || (beamy >= 200+BORDER_TOP))
- {
- // don't draw past the bottom border
- if (beamy >= 231+BORDER_TOP)
- {
- return 0;
- }
-
- scanline = &bitmap.pix32(beamy);
- for (col = 0; col < BORDER_LEFT+BORDER_RIGHT+640; col++)
- {
- scanline[col] = m_a2_palette[m_bordercolor];
- }
- }
- else // regular screen area
- {
- int shrline = beamy - BORDER_TOP;
-
- scb = m_slowmem[0x19D00 + shrline];
- palette = ((scb & 0x0f) << 4);
-
- vram = &m_slowmem[0x12000 + (shrline * 160)];
- scanline = &bitmap.pix32(beamy);
-
- // draw left and right borders
- for (col = 0; col < BORDER_LEFT; col++)
- {
- scanline[col] = m_a2_palette[m_bordercolor];
- scanline[col+BORDER_LEFT+640] = m_a2_palette[m_bordercolor];
- }
-
- if (scb & 0x80) // 640 mode
- {
- for (col = 0; col < 160; col++)
- {
- b = vram[col];
- scanline[col * 4 + 0 + BORDER_LEFT] = m_shr_palette[palette + 0 + ((b >> 6) & 0x03)];
- scanline[col * 4 + 1 + BORDER_LEFT] = m_shr_palette[palette + 4 + ((b >> 4) & 0x03)];
- scanline[col * 4 + 2 + BORDER_LEFT] = m_shr_palette[palette + 8 + ((b >> 2) & 0x03)];
- scanline[col * 4 + 3 + BORDER_LEFT] = m_shr_palette[palette + 12 + ((b >> 0) & 0x03)];
- }
- }
- else // 320 mode
- {
- for (col = 0; col < 160; col++)
- {
- b = vram[col];
- pixel = (b >> 4) & 0x0f;
-
- if ((scb & 0x20) && !pixel)
- pixel = last_pixel;
- else
- last_pixel = pixel;
- pixel += palette;
- scanline[col * 4 + 0 + BORDER_LEFT] = m_shr_palette[pixel];
- scanline[col * 4 + 1 + BORDER_LEFT] = m_shr_palette[pixel];
-
- b = vram[col];
- pixel = (b >> 0) & 0x0f;
-
- if ((scb & 0x20) && !pixel)
- pixel = last_pixel;
- else
- last_pixel = pixel;
- pixel += palette;
- scanline[col * 4 + 2 + BORDER_LEFT] = m_shr_palette[pixel];
- scanline[col * 4 + 3 + BORDER_LEFT] = m_shr_palette[pixel];
- }
- }
- }
- }
- else
- {
- /* call legacy Apple II video rendering at scanline 0 to draw into the off-screen buffer */
- if (beamy == 0)
- {
- // check if DHR should be monochrome 560x192
- if (m_newvideo & 0x20)
- {
- m_monochrome_dhr = true;
- }
- else
- {
- m_monochrome_dhr = false;
- }
-
- rectangle new_cliprect(0, 559, 0, 191);
- screen_update_apple2(screen, *m_legacy_gfx, new_cliprect);
- }
-
- if ((beamy < (BORDER_TOP+4)) || (beamy >= (192+4+BORDER_TOP)))
- {
- if (beamy >= (231+BORDER_TOP))
- {
- return 0;
- }
-
- scanline = &bitmap.pix32(beamy);
- for (col = 0; col < BORDER_LEFT+BORDER_RIGHT+640; col++)
- {
- scanline[col] = m_a2_palette[m_bordercolor];
- }
- }
- else
- {
- scanline = &bitmap.pix32(beamy);
-
- // draw left and right borders
- for (col = 0; col < BORDER_LEFT + 40; col++)
- {
- scanline[col] = m_a2_palette[m_bordercolor];
- scanline[col+BORDER_LEFT+600] = m_a2_palette[m_bordercolor];
- }
-
- a2pixel = &m_legacy_gfx->pix16(beamy-(BORDER_TOP+4));
- for (int x = 0; x < 560; x++)
- {
- scanline[40 + BORDER_LEFT + x] = m_a2_palette[*a2pixel++];
- }
- }
- }
- return 0;
-}
diff --git a/src/mess/video/apple3.c b/src/mess/video/apple3.c
deleted file mode 100644
index e733199bd87..00000000000
--- a/src/mess/video/apple3.c
+++ /dev/null
@@ -1,518 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Nathan Woods,R. Belmont
-/***************************************************************************
-
- video/apple3.c
-
- Apple ///
-
-***************************************************************************/
-
-
-#include "emu.h"
-#include "includes/apple3.h"
-#include "machine/ram.h"
-
-#define BLACK 0
-#define DKRED 1
-#define DKBLUE 2
-#define PURPLE 3
-#define DKGREEN 4
-#define DKGRAY 5
-#define BLUE 6
-#define LTBLUE 7
-#define BROWN 8
-#define ORANGE 9
-#define GRAY 10
-#define PINK 11
-#define GREEN 12
-#define YELLOW 13
-#define AQUA 14
-#define WHITE 15
-
-// derived from the IIgs palette then adjusted to match Sara
-static const unsigned char apple3_palette[] =
-{
- // text colors, which don't match the Apple II palette
- 0x0, 0x0, 0x0, /* Black $0 */
- 0x5, 0x0, 0x5, /* Magenta $1 */
- 0x0, 0x0, 0x9, /* Dark Blue $2 */
- 0xD, 0x2, 0xD, /* Purple $3 */
- 0x0, 0x7, 0x2, /* Dark Green $4 */
- 0xa, 0xa, 0xa, /* Light Gray $5 */
- 0x2, 0x2, 0xF, /* Medium Blue $6 */
- 0x6, 0xA, 0xF, /* Light Blue $7 */
- 0x8, 0x5, 0x0, /* Brown $8 */
- 0xF, 0x6, 0x0, /* Orange $9 */
- 0x5, 0x5, 0x5, /* Dark Gray $A */
- 0xF, 0x9, 0xF, /* Pink $B */
- 0x1, 0xD, 0x0, /* Light Green $C */
- 0xe, 0xe, 0x0, /* Yellow $D */
- 0x4, 0xe, 0xd, /* Cyan $E */
- 0xF, 0xF, 0xF, /* White $F */
- // graphics colors, which *are* Apple II order
- 0x0, 0x0, 0x0, /* Black $0 */
- 0xD, 0x0, 0x3, /* Deep Red $1 */
- 0x0, 0x0, 0x9, /* Dark Blue $2 */
- 0xD, 0x2, 0xD, /* Purple $3 */
- 0x0, 0x7, 0x2, /* Dark Green $4 */
- 0x5, 0x5, 0x5, /* Dark Gray $5 */
- 0x2, 0x2, 0xF, /* Medium Blue $6 */
- 0x6, 0xA, 0xF, /* Light Blue $7 */
- 0x8, 0x5, 0x0, /* Brown $8 */
- 0xF, 0x6, 0x0, /* Orange $9 */
- 0xA, 0xA, 0xA, /* Light Gray $A */
- 0xF, 0x9, 0x8, /* Pink $B */
- 0x1, 0xD, 0x0, /* Light Green $C */
- 0xF, 0xF, 0x0, /* Yellow $D */
- 0x4, 0xF, 0x9, /* Aquamarine $E */
- 0xF, 0xF, 0xF /* White $F */
-
-};
-
-static const UINT32 text_map[] =
-{
- 0x400, 0x480, 0x500, 0x580, 0x600, 0x680, 0x700, 0x780,
- 0x428, 0x4a8, 0x528, 0x5a8, 0x628, 0x6a8, 0x728, 0x7a8,
- 0x450, 0x4d0, 0x550, 0x5d0, 0x650, 0x6d0, 0x750, 0x7d0
-};
-
-
-PALETTE_INIT_MEMBER(apple3_state, apple3)
-{
- int i;
-
- for (i = 0; i < 32; i++)
- {
- m_palette->set_pen_color(i,
- apple3_palette[(3*i)]*17,
- apple3_palette[(3*i)+1]*17,
- apple3_palette[(3*i)+2]*17);
- }
-}
-
-void apple3_state::apple3_write_charmem()
-{
- address_space& space = m_maincpu->space(AS_PROGRAM);
- static const UINT32 screen_hole_map[] =
- {
- 0x478, 0x4f8, 0x578, 0x5f8, 0x678, 0x6f8, 0x778, 0x7f8
- };
- int i, j, addr;
- UINT8 val;
-
- for (i = 0; i < 8; i++)
- {
- for (j = 0; j < 4; j++)
- {
- addr = 0x7f & space.read_byte(screen_hole_map[i] + 0x400 + j + 0);
- val = space.read_byte(screen_hole_map[i] + j + 0);
- m_char_mem[((addr * 8) + ((i & 3) * 2) + 0) & 0x3ff] = val;
-
- addr = 0x7f & space.read_byte(screen_hole_map[i] + 0x400 + j + 4);
- val = space.read_byte(screen_hole_map[i] + j + 4);
- m_char_mem[((addr * 8) + ((i & 3) * 2) + 1) & 0x3ff] = val;
- }
- }
-}
-
-
-
-VIDEO_START_MEMBER(apple3_state,apple3)
-{
- int i, j;
- UINT32 v;
-
- memset(m_char_mem, 0, 0x800);
-
- m_hgr_map = auto_alloc_array(machine(), UINT32, 192);
- for (i = 0; i < 24; i++)
- {
- v = text_map[i] - 0x0400;
- for (j = 0; j < 8; j++)
- {
- m_hgr_map[(i * 8) + j] = 0x2000 + v + (j * 0x400);
- }
- }
-}
-
-
-
-void apple3_state::apple3_video_text40(bitmap_ind16 &bitmap)
-{
- int x, y, col, row, lc;
- offs_t offset;
- UINT8 ch;
- const UINT8 *char_data;
- pen_t fg, bg, temp;
- UINT16 *dest;
- UINT8 *ram = m_ram->pointer();
- UINT32 ram_size = m_ram->size();
- int smooth = m_va | (m_vb << 1) | (m_vc << 2);
-
- for (y = 0; y < 24; y++)
- {
- for (x = 0; x < 40; x++)
- {
- offset = ram_size - 0x8000 + text_map[y] + x + (m_flags & VAR_VM2 ? 0x0400 : 0x0000);
- ch = ram[offset];
-
- // no color text in emulation mode
- if ((m_flags & VAR_VM0) && (m_via_1_a & 0x40))
- {
- /* color text */
- offset = ram_size - 0x8000 + text_map[y] + x + (m_flags & VAR_VM2 ? 0x0000 : 0x0400);
- bg = (ram[offset] >> 0) & 0x0F;
- fg = (ram[offset] >> 4) & 0x0F;
- }
- else
- {
- /* monochrome - on a real /// with an RGB monitor, text is white */
- bg = BLACK;
- fg = WHITE;
- }
-
- /* inverse? */
- if (!(ch & 0x80))
- {
- temp = fg;
- fg = bg;
- bg = temp;
- }
-
- char_data = &m_char_mem[(ch & 0x7F) * 8];
-
- for (row = 0; row < 8; row++)
- {
- for (col = 0; col < 7; col++)
- {
- if (m_smoothscr)
- {
- // get the offset into the group of 8 lines
- lc = (col + smooth) & 7;
- }
- else
- {
- lc = col;
- }
-
- dest = &bitmap.pix16(y * 8 + row, x * 14 + lc * 2);
- dest[0] = (char_data[row] & (1 << col)) ? fg : bg;
- dest[1] = (char_data[row] & (1 << col)) ? fg : bg;
- }
- }
- }
- }
-}
-
-
-
-void apple3_state::apple3_video_text80(bitmap_ind16 &bitmap)
-{
- int x, y, col, row, lc;
- offs_t offset;
- UINT8 ch;
- const UINT8 *char_data;
- pen_t fg, bg;
- UINT16 *dest;
- UINT8 *ram = m_ram->pointer();
- UINT32 ram_size = m_ram->size();
- int smooth = m_va | (m_vb << 1) | (m_vc << 2);
-
- for (y = 0; y < 24; y++)
- {
- for (x = 0; x < 40; x++)
- {
- offset = ram_size - 0x8000 + text_map[y] + x;
-
- /* first character */
- ch = ram[offset + 0x0000];
- char_data = &m_char_mem[(ch & 0x7F) * 8];
- fg = (ch & 0x80) ? GREEN : BLACK;
- bg = (ch & 0x80) ? BLACK : GREEN;
-
- for (row = 0; row < 8; row++)
- {
- for (col = 0; col < 7; col++)
- {
- if (m_smoothscr)
- {
- // get the offset into the group of 8 lines
- lc = (col + smooth) & 7;
- }
- else
- {
- lc = col;
- }
-
- dest = &bitmap.pix16(y * 8 + row, x * 14 + lc + 0);
- *dest = (char_data[row] & (1 << col)) ? fg : bg;
- }
- }
-
- /* second character */
- ch = ram[offset + 0x0400];
- char_data = &m_char_mem[(ch & 0x7F) * 8];
- fg = (ch & 0x80) ? GREEN : BLACK;
- bg = (ch & 0x80) ? BLACK : GREEN;
-
- for (row = 0; row < 8; row++)
- {
- for (col = 0; col < 7; col++)
- {
- dest = &bitmap.pix16(y * 8 + row, x * 14 + col + 7);
- *dest = (char_data[row] & (1 << col)) ? fg : bg;
- }
- }
- }
- }
-}
-
-
-
-void apple3_state::apple3_video_graphics_hgr(bitmap_ind16 &bitmap)
-{
- /* hi-res mode: 280x192x2 */
- int y, i, x, ly, lyb;
- const UINT8 *pix_info;
- UINT16 *ptr;
- UINT8 b;
- UINT8 *ram = m_ram->pointer();
- int smooth = m_va | (m_vb << 1) | (m_vc << 2);
-
- for (y = 0; y < 192; y++)
- {
- ly = y;
- if (m_smoothscr)
- {
- // get our base Y position
- ly = y & ~7;
- // get the offset into the group of 8 lines
- lyb = ((y % 8) + smooth) & 7;
- // add to the base
- ly += lyb;
- }
-
- if (m_flags & VAR_VM2)
- pix_info = &ram[m_hgr_map[ly]];
- else
- pix_info = &ram[m_hgr_map[ly] - 0x2000];
- ptr = &bitmap.pix16(y);
-
- for (i = 0; i < 40; i++)
- {
- b = *(pix_info++);
-
- for (x = 0; x < 7; x++)
- {
- ptr[0] = ptr[1] = (b & 0x01) ? WHITE : BLACK;
- ptr += 2;
- b >>= 1;
- }
- }
- }
-}
-
-void apple3_state::apple3_video_graphics_chgr(bitmap_ind16 &bitmap)
-{
- /* color hi-res mode: 280x192x16 */
- int y, i, x, ly, lyb;
- const UINT8 *pix_info;
- const UINT8 *col_info;
- UINT16 *ptr;
- UINT8 b;
- UINT16 fgcolor, bgcolor;
- UINT8 *ram = m_ram->pointer();
- int smooth = m_va | (m_vb << 1) | (m_vc << 2);
-
- for (y = 0; y < 192; y++)
- {
- ly = y;
- if (m_smoothscr)
- {
- // get our base Y position
- ly = y & ~7;
- // get the offset into the group of 8 lines
- lyb = ((y % 8) + smooth) & 7;
- // add to the base
- ly += lyb;
- }
-
- if (m_flags & VAR_VM2)
- {
- pix_info = &ram[m_hgr_map[ly] + 0x2000];
- col_info = &ram[m_hgr_map[ly] + 0x4000];
- }
- else
- {
- pix_info = &ram[m_hgr_map[ly] - 0x2000];
- col_info = &ram[m_hgr_map[ly]];
- }
- ptr = &bitmap.pix16(y);
-
- for (i = 0; i < 40; i++)
- {
- bgcolor = ((*col_info >> 0) & 0x0F) + 16;
- fgcolor = ((*col_info >> 4) & 0x0F) + 16;
-
- b = *pix_info;
-
- for (x = 0; x < 7; x++)
- {
- ptr[0] = ptr[1] = (b & 1) ? fgcolor : bgcolor;
- ptr += 2;
- b >>= 1;
- }
- pix_info++;
- col_info++;
- }
- }
-}
-
-
-
-void apple3_state::apple3_video_graphics_shgr(bitmap_ind16 &bitmap)
-{
- /* super hi-res mode: 560x192x2 */
- int y, i, x, ly, lyb;
- const UINT8 *pix_info1;
- const UINT8 *pix_info2;
- UINT16 *ptr;
- UINT8 b1, b2;
- UINT8 *ram = m_ram->pointer();
- int smooth = m_va | (m_vb << 1) | (m_vc << 2);
-
- for (y = 0; y < 192; y++)
- {
- ly = y;
- if (m_smoothscr)
- {
- // get our base Y position
- ly = y & ~7;
- // get the offset into the group of 8 lines
- lyb = ((y % 8) + smooth) & 7;
- // add to the base
- ly += lyb;
- }
-
- if (m_flags & VAR_VM2)
- {
- pix_info1 = &ram[m_hgr_map[ly] + 0x2000];
- pix_info2 = &ram[m_hgr_map[ly] + 0x4000];
- }
- else
- {
- pix_info1 = &ram[m_hgr_map[ly] - 0x2000];
- pix_info2 = &ram[m_hgr_map[ly]];
- }
- ptr = &bitmap.pix16(y);
-
- for (i = 0; i < 40; i++)
- {
- b1 = *(pix_info1++);
- b2 = *(pix_info2++);
-
- for (x = 0; x < 7; x++)
- {
- *(ptr++) = (b1 & 0x01) ? WHITE : BLACK;
- b1 >>= 1;
- }
-
- for (x = 0; x < 7; x++)
- {
- *(ptr++) = (b2 & 0x01) ? WHITE : BLACK;
- b2 >>= 1;
- }
- }
- }
-}
-
-
-
-void apple3_state::apple3_video_graphics_chires(bitmap_ind16 &bitmap)
-{
- UINT16 *pen;
- UINT8 p1, p2, p3, p4;
- int y, i, ly, lyb;
- UINT8 *ram = m_ram->pointer();
- int smooth = m_va | (m_vb << 1) | (m_vc << 2);
-
- for (y = 0; y < 192; y++)
- {
- ly = y;
- if (m_smoothscr)
- {
- // get our base Y position
- ly = y & ~7;
- // get the offset into the group of 8 lines
- lyb = ((y % 8) + smooth) & 7;
- // add to the base
- ly += lyb;
- }
-
- pen = &bitmap.pix16(y);
- for (i = 0; i < 20; i++)
- {
- if (m_flags & VAR_VM2)
- {
- p1 = ram[m_hgr_map[ly] + 0x2000 + (i * 2) + 0];
- p2 = ram[m_hgr_map[ly] + 0x4000 + (i * 2) + 0];
- p3 = ram[m_hgr_map[ly] + 0x2000 + (i * 2) + 1];
- p4 = ram[m_hgr_map[ly] + 0x4000 + (i * 2) + 1];
- }
- else
- {
- p1 = ram[m_hgr_map[ly] - 0x2000 + (i * 2) + 0];
- p2 = ram[m_hgr_map[ly] - 0x0000 + (i * 2) + 0];
- p3 = ram[m_hgr_map[ly] - 0x2000 + (i * 2) + 1];
- p4 = ram[m_hgr_map[ly] - 0x0000 + (i * 2) + 1];
- }
-
- pen[ 0] = pen[ 1] = pen[ 2] = pen[ 3] = (p1 & 0x0f);
- pen[ 4] = pen[ 5] = pen[ 6] = pen[ 7] = ((p1 >> 4) & 0x07) | ((p2 & 1) << 3);
- pen[ 8] = pen[ 9] = pen[10] = pen[11] = ((p2 >> 1) & 0x0F);
- pen[12] = pen[13] = pen[14] = pen[15] = ((p2 >> 5) & 0x03) | ((p3 & 3) << 2);
- pen[16] = pen[17] = pen[18] = pen[19] = ((p3 >> 2) & 0x0F);
- pen[20] = pen[21] = pen[22] = pen[23] = ((p3 >> 6) & 0x01) | ((p4 << 1) & 0xe);
- pen[24] = pen[25] = pen[26] = pen[27] = ((p4 >> 3) & 0x0F);
- pen += 28;
- }
- }
-}
-
-
-
-UINT32 apple3_state::screen_update_apple3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
-// printf("gfx mode %x\n", m_flags & (VAR_VM3|VAR_VM1|VAR_VM0));
-
- switch(m_flags & (VAR_VM3|VAR_VM1|VAR_VM0))
- {
- case 0:
- case VAR_VM0:
- apple3_video_text40(bitmap);
- break;
-
- case VAR_VM1:
- case VAR_VM1|VAR_VM0:
- apple3_video_text80(bitmap);
- break;
-
- case VAR_VM3:
- apple3_video_graphics_hgr(bitmap); /* hgr mode */
- break;
-
- case VAR_VM3|VAR_VM0:
- apple3_video_graphics_chgr(bitmap);
- break;
-
- case VAR_VM3|VAR_VM1:
- apple3_video_graphics_shgr(bitmap);
- break;
-
- case VAR_VM3|VAR_VM1|VAR_VM0:
- apple3_video_graphics_chires(bitmap);
- break;
- }
- return 0;
-}
diff --git a/src/mess/video/aquarius.c b/src/mess/video/aquarius.c
deleted file mode 100644
index 3d644bfd8b2..00000000000
--- a/src/mess/video/aquarius.c
+++ /dev/null
@@ -1,80 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Nathan Woods
-/***************************************************************************
-
- aquarius.c
-
- Functions to emulate the video hardware of the aquarius.
-
-***************************************************************************/
-
-#include "emu.h"
-#include "includes/aquarius.h"
-
-
-static const unsigned short aquarius_palette[] =
-{
- 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0,10, 0,11, 0,12, 0,13, 0,14, 0,15, 0,
- 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1,10, 1,11, 1,12, 1,13, 1,14, 1,15, 1,
- 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2,10, 2,11, 2,12, 2,13, 2,14, 2,15, 2,
- 0, 3, 1, 3, 2, 3, 3, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 3, 9, 3,10, 3,11, 3,12, 3,13, 3,14, 3,15, 3,
- 0, 4, 1, 4, 2, 4, 3, 4, 4, 4, 5, 4, 6, 4, 7, 4, 8, 4, 9, 4,10, 4,11, 4,12, 4,13, 4,14, 4,15, 4,
- 0, 5, 1, 5, 2, 5, 3, 5, 4, 5, 5, 5, 6, 5, 7, 5, 8, 5, 9, 5,10, 5,11, 5,12, 5,13, 5,14, 5,15, 5,
- 0, 6, 1, 6, 2, 6, 3, 6, 4, 6, 5, 6, 6, 6, 7, 6, 8, 6, 9, 6,10, 6,11, 6,12, 6,13, 6,14, 6,15, 6,
- 0, 7, 1, 7, 2, 7, 3, 7, 4, 7, 5, 7, 6, 7, 7, 7, 8, 7, 9, 7,10, 7,11, 7,12, 7,13, 7,14, 7,15, 7,
- 0, 8, 1, 8, 2, 8, 3, 8, 4, 8, 5, 8, 6, 8, 7, 8, 8, 8, 9, 8,10, 8,11, 8,12, 8,13, 8,14, 8,15, 8,
- 0, 9, 1, 9, 2, 9, 3, 9, 4, 9, 5, 9, 6, 9, 7, 9, 8, 9, 9, 9,10, 9,11, 9,12, 9,13, 9,14, 9,15, 9,
- 0,10, 1,10, 2,10, 3,10, 4,10, 5,10, 6,10, 7,10, 8,10, 9,10,10,10,11,10,12,10,13,10,14,10,15,10,
- 0,11, 1,11, 2,11, 3,11, 4,11, 5,11, 6,11, 7,11, 8,11, 9,11,10,11,11,11,12,11,13,11,14,11,15,11,
- 0,12, 1,12, 2,12, 3,12, 4,12, 5,12, 6,12, 7,12, 8,12, 9,12,10,12,11,12,12,12,13,12,14,12,15,12,
- 0,13, 1,13, 2,13, 3,13, 4,13, 5,13, 6,13, 7,13, 8,13, 9,13,10,13,11,13,12,13,13,13,14,13,15,13,
- 0,14, 1,14, 2,14, 3,14, 4,14, 5,14, 6,14, 7,14, 8,14, 9,14,10,14,11,14,12,14,13,14,14,14,15,14,
- 0,15, 1,15, 2,15, 3,15, 4,15, 5,15, 6,15, 7,15, 8,15, 9,15,10,15,11,15,12,15,13,15,14,15,15,15,
-};
-
-PALETTE_INIT_MEMBER(aquarius_state, aquarius)
-{
- int i;
-
- for (i = 0; i < 16; i++)
- m_palette->set_indirect_color(i, m_tea1002->color(i));
-
- for (i = 0; i < 512; i++)
- m_palette->set_pen_indirect(i, aquarius_palette[i]);
-}
-
-WRITE8_MEMBER(aquarius_state::aquarius_videoram_w)
-{
- UINT8 *videoram = m_videoram;
- videoram[offset] = data;
- m_tilemap->mark_tile_dirty(offset);
-}
-
-WRITE8_MEMBER(aquarius_state::aquarius_colorram_w)
-{
- m_colorram[offset] = data;
- m_tilemap->mark_tile_dirty(offset);
-}
-
-TILE_GET_INFO_MEMBER(aquarius_state::aquarius_gettileinfo)
-{
- UINT8 *videoram = m_videoram;
- int bank = 0;
- int code = videoram[tile_index];
- int color = m_colorram[tile_index];
- int flags = 0;
-
- SET_TILE_INFO_MEMBER(bank, code, color, flags);
-}
-
-void aquarius_state::video_start()
-{
- m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(aquarius_state::aquarius_gettileinfo),this), TILEMAP_SCAN_ROWS, 8, 8, 40, 25);
-}
-
-UINT32 aquarius_state::screen_update_aquarius(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- m_tilemap->draw(screen, bitmap, cliprect, 0, 0);
-
- return 0;
-}
diff --git a/src/mess/video/arcadia.c b/src/mess/video/arcadia.c
deleted file mode 100644
index 869439aef10..00000000000
--- a/src/mess/video/arcadia.c
+++ /dev/null
@@ -1,676 +0,0 @@
-// license:GPL-2.0+
-// copyright-holders:Peter Trauner
-/******************************************************************************
-Consolidation and enhancment of documentation by Manfred Schneider based on previous work from
- PeT mess@utanet.at and Paul Robson (autismuk@aol.com)
-
- Schematics, manuals and anything you can desire for at http://amigan.1emu.net/
-
- TODO: find a dump of the charactyer ROM
- convert the drawing code to tilemap
-
- emulation of signetics 2637 video/audio device
-
-General
-The UVI is capable of controlling 512 Bytes of RAM. It also generates a select signal
-for a 128 byte wide area.
-This whole addres space maps in the arcadia and compatible machines from $1800 - $1AFF.
-
-1. Video Memory
-
-The screen table is at 1800-CF and 1A00-CF. Each page has 13 lines of the
-screen (16 bytes per line,26 lines in total, 208 scan lines). The 2 most
-significant bits of each byte are colour data, the 6 least significant
-are character data. The resolution of the Arcadia is 128 x 208 pixels.
-
-It is possible to halve the screen resolution so 1A00..1ACF can
-be used for code. This is controlled by bit 6 of $19F8.
-
-The byte at location $18FF is the current Character Line address, lower
-4 bits only. The start line goes from 1800 to 18C0 then from 1900 to 19C0.
-The 4 least significant bits of this count 0123456789ABC0123456789ABC,
-going to D when in vertical blank. The 4 most significant bits are always
-'1'. Some games do use this for scrolling effects - a good example of this
-is the routine at $010F in Alien Invaders which scrolls the various bits of
-the screen about using the memory locations $18FF and $18FE.
-
-The screen can be scrolled upto 7 pixels to the left using the high 3 bits
-of $18FE. This is used in Alien Invaders.
-
-A line beginning with $C0 contains block graphics. Each square contains
-3 wide x 2 high pixels, coloured as normal. The 3 least significant bits
-are the top, the next 3 bits are the bottom. Alien Invaders uses this for
-shields. The graphics are returned to normal for the next line.
-
-The VBlank signal (maybe VSYNC) is connected to the SENSE input. This is
-logic '1' when the system is in VBLANK.
-
-The Flag line does.... something graphical - it might make the sprites
-half width/double height perhaps. Breakaway sets this when the bats are
-double size in vertical mode.
-
-
-2. Character codes
-
-Character codes 00..37 to be in a ROM somewhere in the Emerson. These
-are known, others may be discovered by comparing the screen snapshots
-against the character tables. If the emulator displays an exclamation
-mark you've found one. Get a snapshot to see what it looks like
-normally and let me know. Codes 38..3F are taken from RAM.
-
-00 (space)
-01..0F Graphic Characters
-10..19 0..9
-1A..33 A..Z
-34 Decimal Point
-35 comma
-36 +
-37 $
-38..3F User Defined Characters (8 off, from 1980..19FF)
-
-Character data is stored 8 bits per character , as a single plane graphic
-The 2nd and 3rd bits of palette data come from the screen tables, so there
-are two colours per character and 4 possible palette selections for the
-background.
-
-
-3. Sound
-
-fixed frequency sound and random Noise generator.
-18FD pitch (lower 7 bits)
-18FE volume ( bits 0 - 2)
-18fe bit 3 set means sound on
-18fe bit 4 set means random noise on
-
-Calculation of sound frequency is done as follows
- 1/Freq = 2 (pitch +1) * (horizontal line period)
-
-
-4. Sprites
-
-Sprite pointers are at 18F0..18F7 (there are four of them). The graphics
-used are the ones in the 1980..19BF UDG table (the first four).
-
-Sprite addresses (x,y) are converted to offsets in the 128 x 208 as follows:
-
-1) 1's complement the y coordinate
-2) subtract 16 from the y coordinate
-3) subtract 43 from the x coordinate
-
-5. Palette
-
-The Palette is encoded between 19F8-19FB. This section describes the method
-by which colours are allocated. There are 8 colours, information is coded
-3 bits per colour (usually 2 colours per byte)
-
- Colour Code Name
- ------ ----- -------
- 7 111 Black
- 6 110 Blue
- 5 101 Red
- 4 100 Magenta
- 3 011 Green
- 2 010 Cyan
- 1 001 Yellow
- 0 000 White
-
-Bits 0..2 of $19F9 are the screen colour
-Bits 3..5 of $19F9 are the colours of characters
-Bit 6 of $19f9 is for poti axis
-Bit 7 of $19f9 is for character size (1 = 8x8; 0 = 8x16)
-Bits 0..5 of $19FA are the colours of Sprites 2 & 3 (sprite 3 is low bits)
-Bit 6 of $19FA is for size of sprite 3 (0 = 8x16; 1 = 8x8)
-Bit 7 of $19FA is for size of sprite 2 (0 = 8x16; 1 = 8x8)
-Bits 0..5 of $19FB are the colours of Sprites 0 & 1 (sprite 1 is low bits)
-Bit 6 of $19FB is for size of sprite 1 (0 = 8x16; 1 = 8x8)
-Bit 7 of $19FB is for size of sprite 0 (0 = 8x16; 1 = 8x8)
-
-
-6. Collision Detection
-
-Bits are set to zero on a collision - I think they are reset at the
-frame start. There are two locations : one is for sprite/background
-collisions, one is for sprite/sprite collisions.
-
-19FC bits 0..3 are collision between sprites 0..3 and the background.
-
-19FD bit 0 is sprite 0 / 1 collision
- bit 1 is sprite 0 / 2 collision
- bit 2 is sprite 0 / 3 collision
- bit 3 is sprite 1 / 2 collision
- bit 4 is sprite 1 / 3 collision (guess)
- bit 5 is sprite 2 / 3 collision (guess)
-
-
-7. Graphic Mode
-19f8 bit 7 graphics mode on (lower 6 bits descripe rectangles)
-0xc0 in line switches to graphics mode in this line
-0x40 in line switches to char mode in this line
- 22211100
- 22211100
- 22211100
- 22211100
- 55544433
- 55544433
- 55544433
- 55544433
-
- 8. Memory Map
- The offsets in the following memory Map are from the view of the UVI.
- In the arcadia and compatibles the base offset is $1800 thats how the CPU sees the UVI
-
- 0000 - 00FF external RAM
- 0000 - 00CF upper screen character/graphics codes organised as 16 char x 13 rows
- 00D0 - 00EF RAM (not used by UVI, can be used by CPU)
- 00F0 vertical offset object 0
- 00F1 horizontal offset object 0
- 00F2 vertical offset object 1
- 00F3 horizontal offset object 1
- 00F4 vertical offset object 2
- 00F5 horizontal offset object 2
- 00F6 vertical offset object 3
- 00F7 horizontal offset object 3
- 00F8 - 00FB RAM (not used by UVI, can be used by CPU)
- 00FC complement number of rows from the trailing edge of VRST
- to the start of character display
- 00FD bit0 - 6 sound frequeny, bit 7 color mode
- 00FE bit0 - 2 loudness, bit 3 sound enable when set, bit 4 random noise enable when set
- bit 5 - 7 delay for row of characters
- 00FF bit 0 - 3 DMA number, bit 4 - 7 unused
-0100 - 017F CE area. In arcadia used for keypad.
-0180 - 01FF internal UVI registers
- 0180 - 0187 image of object 0 or UDC-code $38
- 0188 - 018F image of object 1 or UDC-code $39
- 0190 - 0197 image of object 2 or UDC-code $3A
- 0198 - 019F image of object 3 or UDC-code $3B
- 01A0 - 01A7 image of UDC-code $3C
- 01A8 - 01AF image of UDC-code $3D
- 01B0 - 01B7 image of UDC-code $3E
- 01B8 - 01BF image of UDC-code $3F
- 01C0 - 01F7 unused
- 01F8 bit 0 - 2 alternate screen color, bit 3 - 5 alternate character color
- bit 6 Refresh mode when set entire character field will be display twice
- bit 7 Grahics mode
- 01F9 bit 0 - 2 screen color, bit 3 - 5 character color
- bit 6 poti mux control
- bit 7 character size when set size=8x8 else size=8x16
- 01FA bit 0 - 2 color of object 3, bit 3 - 5 color of object 2
- bit 6 size of object 3 when set size=8x8 else size=8x16
- bit 7 size of object 2 when set size=8x8 else size=8x16
- 01FB bit 0 - 2 color of object 1, bit 3 - 5 color of object 0
- bit 6 size of object 1 when set size=8x8 else size=8x16
- bit 7 size of object 0 when set size=8x8 else size=8x16
- 01FC object - character collision bits
- bit 0 when low object 0 collided with character
- bit 1 when low object 1 collided with character
- bit 2 when low object 2 collided with character
- bit 3 when low object 3 collided with character
- bit 4 - 7 unused set to high
- 01FD inter object collision
- bit 0 - when low object 1 and 2 collide
- bit 1 - when low object 1 and 3 collide
- bit 2 - when low object 1 and 4 collide
- bit 3 - when low object 2 and 3 collide
- bit 4 - when low object 2 and 4 collide
- bit 5 - when low object 3 and 4 collide
- bit 6 - 7 unused set to high
- 01FE digital value of POT1 or POT3 input. Valid only during VRST
- 01FF digital value of POT2 or POT4 input. Valid only furing VRST
-0200 - 02FF 2nd external RAM
- 0200 - 02CF lower screen character/graphics codes organised as 16 char x 13 rows
- 02D0 - 02FF RAM (not used by UVI, can be used by CPU)
-*/
-
-
-#include "includes/arcadia.h"
-
-static const UINT8 chars[0x40][8]={
- // read from the screen generated from a palladium
- { 0,0,0,0,0,0,0,0 }, // 00 (space)
- { 1,2,4,8,16,32,64,128 }, // 01 (\)
- { 128,64,32,16,8,4,2,1 }, // 02 (/)
- { 255,255,255,255,255,255,255,255 }, // 03 (solid block)
- { 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00 },// 04 (?)
- { 3,3,3,3,3,3,3,3 }, // 05 (half square right on)
- { 0,0,0,0,0,0,255,255 }, // 06 (horz lower line)
- { 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 },// 07 (half square left on)
- { 0xff,0xff,3,3,3,3,3,3 }, // 08 (?)
- { 0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 },// 09 (?)
- { 192,192,192,192,192,192,255,255 }, // 0A (!_)
- { 3,3,3,3,3,3,255,255 }, // 0B (_!)
- { 1,3,7,15,31,63,127,255 }, // 0C (diagonal block)
- { 128,192,224,240,248,252,254,255 }, // 0D (diagonal block)
- { 255,254,252,248,240,224,192,128 }, // 0E (diagonal block)
- { 255,127,63,31,15,7,3,1 }, // 0F (diagonal block)
- { 0x00,0x1c,0x22,0x26,0x2a,0x32,0x22,0x1c },// 10 0
- { 0x00,0x08,0x18,0x08,0x08,0x08,0x08,0x1c },// 11 1
- { 0x00,0x1c,0x22,0x02,0x0c,0x10,0x20,0x3e },// 12 2
- { 0x00,0x3e,0x02,0x04,0x0c,0x02,0x22,0x1c },// 13 3
- { 0x00,0x04,0x0c,0x14,0x24,0x3e,0x04,0x04 },// 14 4
- { 0x00,0x3e,0x20,0x3c,0x02,0x02,0x22,0x1c },// 15 5
- { 0x00,0x0c,0x10,0x20,0x3c,0x22,0x22,0x1c },// 16 6
- { 0x00,0x7c,0x02,0x04,0x08,0x10,0x10,0x10 },// 17 7
- { 0x00,0x1c,0x22,0x22,0x1c,0x22,0x22,0x1c },// 18 8
- { 0x00,0x1c,0x22,0x22,0x3e,0x02,0x04,0x18 },// 19 9
- { 0x00,0x08,0x14,0x22,0x22,0x3e,0x22,0x22 },// 1A A
- { 0x00,0x3c,0x22,0x22,0x3c,0x22,0x22,0x3c },// 1B B
- { 0x00,0x1c,0x22,0x20,0x20,0x20,0x22,0x1c },// 1C C
- { 0x00,0x3c,0x22,0x22,0x22,0x22,0x22,0x3c },// 1D D
- { 0x00,0x3e,0x20,0x20,0x3c,0x20,0x20,0x3e },// 1E E
- { 0x00,0x3e,0x20,0x20,0x3c,0x20,0x20,0x20 },// 1F F
- { 0x00,0x1e,0x20,0x20,0x20,0x26,0x22,0x1e },// 20 G
- { 0x00,0x22,0x22,0x22,0x3e,0x22,0x22,0x22 },// 21 H
- { 0x00,0x1c,0x08,0x08,0x08,0x08,0x08,0x1c },// 22 I
- { 0x00,0x02,0x02,0x02,0x02,0x02,0x22,0x1c },// 23 J
- { 0x00,0x22,0x24,0x28,0x30,0x28,0x24,0x22 },// 24 K
- { 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x3e },// 25 L
- { 0x00,0x22,0x36,0x2a,0x2a,0x22,0x22,0x22 },// 26 M
- { 0x00,0x22,0x22,0x32,0x2a,0x26,0x22,0x22 },// 27 N
- { 0x00,0x1c,0x22,0x22,0x22,0x22,0x22,0x1c },// 28 O
- { 0x00,0x3c,0x22,0x22,0x3c,0x20,0x20,0x20 },// 29 P
- { 0x00,0x1c,0x22,0x22,0x22,0x2a,0x24,0x1a },// 2A Q
- { 0x00,0x3c,0x22,0x22,0x3c,0x28,0x24,0x22 },// 2B R
- { 0x00,0x1c,0x22,0x20,0x1c,0x02,0x22,0x1c },// 2C S
- { 0x00,0x3e,0x08,0x08,0x08,0x08,0x08,0x08 },// 2D T
- { 0x00,0x22,0x22,0x22,0x22,0x22,0x22,0x1c },// 2E U
- { 0x00,0x22,0x22,0x22,0x22,0x22,0x14,0x08 },// 2F V
- { 0x00,0x22,0x22,0x22,0x2a,0x2a,0x36,0x22 },// 30 W
- { 0x00,0x22,0x22,0x14,0x08,0x14,0x22,0x22 },// 31 X
- { 0x00,0x22,0x22,0x14,0x08,0x08,0x08,0x08 },// 32 Y
- { 0x00,0x3e,0x02,0x04,0x08,0x10,0x20,0x3e },// 33 Z
- { 0,0,0,0,0,0,0,8 }, // 34 .
- { 0,0,0,0,0,8,8,0x10 }, // 35 ,
- { 0,0,8,8,0x3e,8,8,0 }, // 36 +
- { 0,8,0x1e,0x28,0x1c,0xa,0x3c,8 }, // 37 $
- // 8x user defined
-};
-
-void arcadia_state::video_start()
-{
- int i;
- memcpy(&m_chars, chars, sizeof(chars));
- for (i=0; i<0x40; i++)
- {
- m_rectangle[i][0]=0;
- m_rectangle[i][4]=0;
- if (i&1) m_rectangle[i][0]|=3;
- if (i&2) m_rectangle[i][0]|=0x1c;
- if (i&4) m_rectangle[i][0]|=0xe0;
- if (i&8) m_rectangle[i][4]|=3;
- if (i&0x10) m_rectangle[i][4]|=0x1c;
- if (i&0x20) m_rectangle[i][4]|=0xe0;
- m_rectangle[i][1]=m_rectangle[i][2]=m_rectangle[i][3]=m_rectangle[i][0];
- m_rectangle[i][5]=m_rectangle[i][6]=m_rectangle[i][7]=m_rectangle[i][4];
- }
-
- {
- int width = m_screen->width();
- int height = m_screen->height();
- m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
- }
-}
-
-READ8_MEMBER( arcadia_state::video_r )
-{
- UINT8 data=0;
- switch (offset)
- {
- case 0xff: data = m_charline|0xf0;break;
- case 0x100: data = m_controller1_col1->read();break;
- case 0x101: data = m_controller1_col2->read();break;
- case 0x102: data = m_controller1_col3->read();break;
- case 0x103: data = m_controller1_extra->read();break;
- case 0x104: data = m_controller2_col1->read();break;
- case 0x105: data = m_controller2_col2->read();break;
- case 0x106: data = m_controller2_col3->read();break;
- case 0x107: data = m_controller2_extra->read();break;
- case 0x108: data = m_panel->read();break;
-#if 0
- case 0x1fe:
- if (m_ad_select)
- data=ioport("controller1_joy_y")->read()<<3;
- else
- data=ioport("controller1_joy_x")->read()<<3;
- break;
- case 0x1ff:
- if (m_ad_select)
- data=ioport("controller2_joy_y")->read()<<3;
- else
- data=ioport("controller2_joy_x")->read()<<3;
- break;
-#else
- case 0x1fe:
- data = 0x80;
- if (m_ad_select)
- {
- if (m_joysticks->read()&0x10) data=0;
- if (m_joysticks->read()&0x20) data=0xff;
- }
- else
- {
- if (m_joysticks->read()&0x40) data=0xff;
- if (m_joysticks->read()&0x80) data=0;
- }
- break;
- case 0x1ff:
- data = 0x6f; // 0x7f too big for alien invaders (move right)
- if (m_ad_select)
- {
- if (m_joysticks->read()&0x1) data=0;
- if (m_joysticks->read()&0x2) data=0xff;
- }
- else
- {
- if (m_joysticks->read()&0x4) data=0xff;
- if (m_joysticks->read()&0x8) data=0;
- }
- break;
-#endif
- default:
- data = m_reg.data[offset];
- }
- return data;
-}
-
-WRITE8_MEMBER( arcadia_state::video_w )
-{
- m_reg.data[offset]=data;
- switch (offset)
- {
- case 0xfc:
- m_ypos=255-data+YPOS;
- break;
- case 0xfd:
- m_custom->write(space, offset&3, data);
- m_multicolor = data & 0x80;
- break;
- case 0xfe:
- m_custom->write(space, offset&3, data);
- m_shift = (data>>5);
- break;
- case 0xf0:
- case 0xf2:
- case 0xf4:
- case 0xf6:
- m_pos[(offset>>1)&3].y = (data^0xff)+1;
- break;
- case 0xf1:
- case 0xf3:
- case 0xf5:
- case 0xf7:
- m_pos[(offset>>1)&3].x = data-43;
- break;
- case 0x180: case 0x181: case 0x182: case 0x183: case 0x184: case 0x185: case 0x186: case 0x187:
- case 0x188: case 0x189: case 0x18a: case 0x18b: case 0x18c: case 0x18d: case 0x18e: case 0x18f:
- case 0x190: case 0x191: case 0x192: case 0x193: case 0x194: case 0x195: case 0x196: case 0x197:
- case 0x198: case 0x199: case 0x19a: case 0x19b: case 0x19c: case 0x19d: case 0x19e: case 0x19f:
- case 0x1a0: case 0x1a1: case 0x1a2: case 0x1a3: case 0x1a4: case 0x1a5: case 0x1a6: case 0x1a7:
- case 0x1a8: case 0x1a9: case 0x1aa: case 0x1ab: case 0x1ac: case 0x1ad: case 0x1ae: case 0x1af:
- case 0x1b0: case 0x1b1: case 0x1b2: case 0x1b3: case 0x1b4: case 0x1b5: case 0x1b6: case 0x1b7:
- case 0x1b8: case 0x1b9: case 0x1ba: case 0x1bb: case 0x1bc: case 0x1bd: case 0x1be: case 0x1bf:
- m_chars[0x38|((offset>>3)&7)][offset&7] = data;
- break;
- case 0x1f8:
- m_lines26 = data & 0x40;
- m_graphics = data & 0x80;
- break;
- case 0x1f9:
- m_doublescan =! (data&0x80);
- m_ad_delay = 10;
- break;
- }
-}
-
-void arcadia_state::draw_char(UINT8 *ch, int charcode, int y, int x)
-{
- int k,b,cc,sc, colour;
- if (m_multicolor)
- {
- if (charcode&0x40)
- cc=((m_reg.d.pal[1]>>3)&7);
- else
- cc=((m_reg.d.pal[0]>>3)&7);
-
- if (charcode&0x80)
- sc=(m_reg.d.pal[1]&7);
- else
- sc=(m_reg.d.pal[0]&7);
- }
- else
- {
- cc=((m_reg.d.pal[1]>>3)&1)|((charcode>>5)&6);
- sc=(m_reg.d.pal[1]&7);
- }
- colour = (((sc << 3) | cc) + 4);
-
- if (m_doublescan)
- {
- for (k=0; (k<8)&&(y<m_bitmap->height()); k++, y+=2)
- {
- b=ch[k];
- m_bg[y][x>>3]|=b>>(x&7);
- m_bg[y][(x>>3)+1]|=b<<(8-(x&7));
-
- if (y+1<m_bitmap->height())
- {
- m_bg[y+1][x>>3]|=b>>(x&7);
- m_bg[y+1][(x>>3)+1]|=b<<(8-(x&7));
- m_gfxdecode->gfx(0)->opaque(*m_bitmap,m_bitmap->cliprect(), b,colour, 0,0,x,y);
- m_gfxdecode->gfx(0)->opaque(*m_bitmap,m_bitmap->cliprect(), b,colour, 0,0,x,y+1);
- }
- }
- }
- else
- {
- for (k=0; (k<8)&&(y<m_bitmap->height()); k++, y++)
- {
- b=ch[k];
- m_bg[y][x>>3]|=b>>(x&7);
- m_bg[y][(x>>3)+1]|=b<<(8-(x&7));
-
- m_gfxdecode->gfx(0)->opaque(*m_bitmap,m_bitmap->cliprect(), b,colour, 0,0,x,y);
- }
- }
-}
-
-
-void arcadia_state::vh_draw_line(int y, UINT8 chars1[16])
-{
- int x, ch, j, h;
- int graphics = m_graphics;
- h = m_doublescan ? 16 : 8 ;
-
- if (m_bitmap->height() - m_line < h)
- h = m_bitmap->height() - m_line;
-
- m_bitmap->plot_box(0, y, m_bitmap->width(), h, (m_reg.d.pal[1]&7));
- memset(m_bg[y], 0, sizeof(m_bg[0])*h);
-
- for (x=XPOS+m_shift, j=0; j<16;j++,x+=8)
- {
- ch=chars1[j];
-// hangman switches with 0x40
-// alien invaders shield lines start with 0xc0
- if ((ch&0x3f)==0)
- {
- switch (ch)
- {
- case 0xc0: graphics=TRUE;break;
- case 0x40: graphics=FALSE;break;
-// case 0x80:
-// alien invaders shields are empty 0x80
-// popmessage(5, "graphics code 0x80 used");
- }
- }
- if (graphics)
- draw_char(m_rectangle[ch&0x3f], ch, y, x);
- else
- draw_char(m_chars[ch&0x3f], ch, y, x);
- }
-}
-
-
-int arcadia_state::sprite_collision(int n1, int n2)
-{
- int k, b1, b2, x;
- if (m_pos[n1].x+8<=m_pos[n2].x)
- return FALSE;
- if (m_pos[n1].x>=m_pos[n2].x+8)
- return FALSE;
-
- for (k=0; k<8; k++)
- {
- if (m_pos[n1].y+k<m_pos[n2].y)
- continue;
- if (m_pos[n1].y+k>=m_pos[n2].y+8)
- break;
- x=m_pos[n1].x-m_pos[n2].x;
- b1=m_reg.d.chars[n1][k];
- b2=m_reg.d.chars[n2][m_pos[n1].y+k-m_pos[n2].y];
- if (x<0)
- b2>>=-x;
- if (x>0)
- b1>>=x;
- if (b1&b2)
- return TRUE;
- }
- return FALSE;
-}
-
-
-void arcadia_state::draw_sprites()
-{
- int i, k, x, y, color=0;
- UINT8 b;
-
- m_reg.d.collision_bg|=0xf;
- m_reg.d.collision_sprite|=0x3f;
- for (i=0; i<4; i++)
- {
- int doublescan = FALSE;
- if (m_pos[i].y<=-YPOS) continue;
- if (m_pos[i].y>=m_bitmap->height()-YPOS-8) continue;
- if (m_pos[i].x<=-XPOS) continue;
- if (m_pos[i].x>=128+XPOS-8) continue;
-
- switch (i)
- {
- case 0:
- color=(m_reg.d.pal[3]>>3)&7;
- doublescan=m_reg.d.pal[3]&0x80?FALSE:TRUE;
- break;
- case 1:
- color=m_reg.d.pal[3]&7;
- doublescan=m_reg.d.pal[3]&0x40?FALSE:TRUE;
- break;
- case 2:
- color=(m_reg.d.pal[2]>>3)&7;
- doublescan=m_reg.d.pal[2]&0x80?FALSE:TRUE;
- break;
- case 3:
- color=m_reg.d.pal[2]&7;
- doublescan=m_reg.d.pal[2]&0x40?FALSE:TRUE;
- break;
- }
- for (k=0; k<8; k++)
- {
- int j, m;
- b=m_reg.d.chars[i][k];
- x=m_pos[i].x+XPOS;
- if (!doublescan)
- {
- y=m_pos[i].y+YPOS+k;
- for (j=0,m=0x80; j<8; j++, m>>=1)
- {
- if (b & m)
- m_bitmap->pix16(y, x + j) = color;
- }
- }
- else
- {
- y=m_pos[i].y+YPOS+k*2;
- for (j=0,m=0x80; j<8; j++, m>>=1)
- {
- if (b & m)
- {
- m_bitmap->pix16(y, x + j) = color;
- m_bitmap->pix16(y+1, x + j) = color;
- }
- }
- }
- if (m_reg.d.collision_bg&(1<<i))
- {
- if ( (b<<(8-(x&7))) & ((m_bg[y][x>>3]<<8) | m_bg[y][(x>>3)+1]) )
- m_reg.d.collision_bg&=~(1<<i);
- }
- }
- }
- if (sprite_collision(0,1)) m_reg.d.collision_sprite&=~1;
- if (sprite_collision(0,2)) m_reg.d.collision_sprite&=~2;
- if (sprite_collision(0,3)) m_reg.d.collision_sprite&=~4;
- if (sprite_collision(1,2)) m_reg.d.collision_sprite&=~8;
- if (sprite_collision(1,3)) m_reg.d.collision_sprite&=~0x10; //guess
- if (sprite_collision(2,3)) m_reg.d.collision_sprite&=~0x20; //guess
-}
-
-INTERRUPT_GEN_MEMBER(arcadia_state::video_line)
-{
- int width = m_screen->width();
-
- if (m_ad_delay<=0)
- m_ad_select=m_reg.d.pal[1]&0x40;
- else m_ad_delay--;
-
- m_line++;
- m_line%=262;
- // unbelievable, reflects only charline, but alien invaders uses it for
- // alien scrolling
-
- if (m_line<m_ypos)
- {
- m_bitmap->plot_box(0, m_line, width, 1, (m_reg.d.pal[1])&7);
- memset(m_bg[m_line], 0, sizeof(m_bg[0]));
- }
- else
- {
- int h=m_doublescan?16:8;
-
- m_charline=(m_line-m_ypos)/h;
-
- if (m_charline<13)
- {
- if (((m_line-m_ypos)&(h-1))==0)
- {
- vh_draw_line(m_charline*h+m_ypos, m_reg.d.chars1[m_charline]);
- }
- }
- else
- if (m_lines26 && (m_charline<26))
- {
- if (((m_line-m_ypos)&(h-1))==0)
- {
- vh_draw_line(m_charline*h+m_ypos, m_reg.d.chars2[m_charline-13]);
- }
- m_charline-=13;
- }
- else
- {
- m_charline=0xd;
- m_bitmap->plot_box(0, m_line, width, 1, (m_reg.d.pal[1])&7);
- memset(m_bg[m_line], 0, sizeof(m_bg[0]));
- }
- }
- if (m_line==261)
- draw_sprites();
-}
-
-READ8_MEMBER( arcadia_state::vsync_r )
-{
- return m_line>=216 ? 0x80 : 0 ;
-}
-
-UINT32 arcadia_state::screen_update_arcadia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- copybitmap(bitmap, *m_bitmap, 0, 0, 0, 0, cliprect);
- return 0;
-}
diff --git a/src/mess/video/atarist.c b/src/mess/video/atarist.c
deleted file mode 100644
index 2c80d6beb9a..00000000000
--- a/src/mess/video/atarist.c
+++ /dev/null
@@ -1,1131 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Curt Coder, Olivier Galibert
-/*
-
- TODO:
-
- - rewrite shifter
- - STe pixelofs
- - blitter hog
- - high resolution
-
-*/
-
-#include "emu.h"
-#include "cpu/m68000/m68000.h"
-#include "machine/ram.h"
-#include "video/atarist.h"
-#include "includes/atarist.h"
-
-
-
-//**************************************************************************
-// CONSTANTS / MACROS
-//**************************************************************************
-
-#define LOG 0
-
-static const int BLITTER_NOPS[16][4] =
-{
- { 1, 1, 1, 1 },
- { 2, 2, 3, 3 },
- { 2, 2, 3, 3 },
- { 1, 1, 2, 2 },
- { 2, 2, 3, 3 },
- { 2, 2, 2, 2 },
- { 2, 2, 3, 3 },
- { 2, 2, 3, 3 },
- { 2, 2, 3, 3 },
- { 2, 2, 3, 3 },
- { 2, 2, 2, 2 },
- { 2, 2, 3, 3 },
- { 1, 1, 2, 2 },
- { 2, 2, 3, 3 },
- { 2, 2, 3, 3 },
- { 1, 1, 1, 1 }
-};
-
-
-//**************************************************************************
-// SHIFTER
-//**************************************************************************
-
-//-------------------------------------------------
-// shift_mode_0 -
-//-------------------------------------------------
-
-inline pen_t st_state::shift_mode_0()
-{
- int color = (BIT(m_shifter_rr[3], 15) << 3) | (BIT(m_shifter_rr[2], 15) << 2) | (BIT(m_shifter_rr[1], 15) << 1) | BIT(m_shifter_rr[0], 15);
-
- m_shifter_rr[0] <<= 1;
- m_shifter_rr[1] <<= 1;
- m_shifter_rr[2] <<= 1;
- m_shifter_rr[3] <<= 1;
-
- return m_palette->pen(color);
-}
-
-
-//-------------------------------------------------
-// shift_mode_1 -
-//-------------------------------------------------
-
-inline pen_t st_state::shift_mode_1()
-{
- int color = (BIT(m_shifter_rr[1], 15) << 1) | BIT(m_shifter_rr[0], 15);
-
- m_shifter_rr[0] <<= 1;
- m_shifter_rr[1] <<= 1;
- m_shifter_shift++;
-
- if (m_shifter_shift == 16)
- {
- m_shifter_rr[0] = m_shifter_rr[2];
- m_shifter_rr[1] = m_shifter_rr[3];
- m_shifter_rr[2] = m_shifter_rr[3] = 0;
- m_shifter_shift = 0;
- }
-
- return m_palette->pen(color);
-}
-
-
-//-------------------------------------------------
-// shift_mode_2 -
-//-------------------------------------------------
-
-inline pen_t st_state::shift_mode_2()
-{
- int color = BIT(m_shifter_rr[0], 15);
-
- m_shifter_rr[0] <<= 1;
- m_shifter_shift++;
-
- switch (m_shifter_shift)
- {
- case 16:
- m_shifter_rr[0] = m_shifter_rr[1];
- m_shifter_rr[1] = m_shifter_rr[2];
- m_shifter_rr[2] = m_shifter_rr[3];
- m_shifter_rr[3] = 0;
- break;
-
- case 32:
- m_shifter_rr[0] = m_shifter_rr[1];
- m_shifter_rr[1] = m_shifter_rr[2];
- m_shifter_rr[2] = 0;
- break;
-
- case 48:
- m_shifter_rr[0] = m_shifter_rr[1];
- m_shifter_rr[1] = 0;
- m_shifter_shift = 0;
- break;
- }
-
- return m_palette->pen(color);
-}
-
-
-//-------------------------------------------------
-// shifter_tick -
-//-------------------------------------------------
-
-void st_state::shifter_tick()
-{
- int y = machine().first_screen()->vpos();
- int x = machine().first_screen()->hpos();
-
- pen_t pen;
-
- switch (m_shifter_mode)
- {
- case 0:
- pen = shift_mode_0();
- break;
-
- case 1:
- pen = shift_mode_1();
- break;
-
- case 2:
- pen = shift_mode_2();
- break;
-
- default:
- pen = m_palette->black_pen();
- break;
- }
-
- m_bitmap.pix32(y, x) = pen;
-}
-
-
-//-------------------------------------------------
-// shifter_load -
-//-------------------------------------------------
-
-inline void st_state::shifter_load()
-{
- address_space &program = m_maincpu->space(AS_PROGRAM);
- UINT16 data = program.read_word(m_shifter_ofs);
-
- m_shifter_ir[m_shifter_bitplane] = data;
- m_shifter_bitplane++;
- m_shifter_ofs += 2;
-
- if (m_shifter_bitplane == 4)
- {
- m_shifter_bitplane = 0;
-
- m_shifter_rr[0] = m_shifter_ir[0];
- m_shifter_rr[1] = m_shifter_ir[1];
- m_shifter_rr[2] = m_shifter_ir[2];
- m_shifter_rr[3] = m_shifter_ir[3];
- }
-}
-
-
-//-------------------------------------------------
-// glue_tick -
-//-------------------------------------------------
-
-void st_state::glue_tick()
-{
- int y = machine().first_screen()->vpos();
- int x = machine().first_screen()->hpos();
-
- int v = (y >= m_shifter_y_start) && (y < m_shifter_y_end);
- int h = (x >= m_shifter_x_start) && (x < m_shifter_x_end);
-
- if(m_shifter_mode == 1) {
- int dt = 8;
- h = (x >= m_shifter_x_start-dt) && (x < m_shifter_x_end-dt);
- }
- int de = h && v;
-
- if(!x) {
- m_shifter_bitplane = 0;
- m_shifter_shift = 0;
- }
-
- if (de != m_shifter_de)
- {
- m_mfp->tbi_w(de);
- m_shifter_de = de;
- }
-
- if (de)
- {
- shifter_load();
- }
-
- if ((y == m_shifter_vblank_start) && (x == 0))
- {
- m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE);
- m_shifter_ofs = m_shifter_base;
- }
-
- if (x == m_shifter_hblank_start)
- {
- m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
-// m_shifter_ofs += (m_shifter_lineofs * 2); // STe
- }
-
- pen_t pen;
-
- switch (m_shifter_mode)
- {
- case 0:
- pen = shift_mode_0();
- m_bitmap.pix32(y, x) = pen;
- m_bitmap.pix32(y, x+1) = pen;
- pen = shift_mode_0();
- m_bitmap.pix32(y, x+2) = pen;
- m_bitmap.pix32(y, x+3) = pen;
- pen = shift_mode_0();
- m_bitmap.pix32(y, x+4) = pen;
- m_bitmap.pix32(y, x+5) = pen;
- pen = shift_mode_0();
- m_bitmap.pix32(y, x+6) = pen;
- m_bitmap.pix32(y, x+7) = pen;
- break;
-
- case 1:
- pen = shift_mode_1();
- m_bitmap.pix32(y, x) = pen;
- pen = shift_mode_1();
- m_bitmap.pix32(y, x+1) = pen;
- pen = shift_mode_1();
- m_bitmap.pix32(y, x+2) = pen;
- pen = shift_mode_1();
- m_bitmap.pix32(y, x+3) = pen;
- pen = shift_mode_1();
- m_bitmap.pix32(y, x+4) = pen;
- pen = shift_mode_1();
- m_bitmap.pix32(y, x+5) = pen;
- pen = shift_mode_1();
- m_bitmap.pix32(y, x+6) = pen;
- pen = shift_mode_1();
- m_bitmap.pix32(y, x+7) = pen;
- break;
-
- case 2:
- pen = shift_mode_2();
- break;
-
- default:
- pen = m_palette->black_pen();
- break;
- }
-}
-
-
-//-------------------------------------------------
-// set_screen_parameters -
-//-------------------------------------------------
-
-void st_state::set_screen_parameters()
-{
- if (m_shifter_sync & 0x02)
- {
- m_shifter_x_start = ATARIST_HBDEND_PAL*2;
- m_shifter_x_end = ATARIST_HBDSTART_PAL*2;
- m_shifter_y_start = ATARIST_VBDEND_PAL;
- m_shifter_y_end = ATARIST_VBDSTART_PAL;
- m_shifter_hblank_start = ATARIST_HBSTART_PAL*2;
- m_shifter_vblank_start = ATARIST_VBSTART_PAL;
- }
- else
- {
- m_shifter_x_start = ATARIST_HBDEND_NTSC*2;
- m_shifter_x_end = ATARIST_HBDSTART_NTSC*2;
- m_shifter_y_start = ATARIST_VBDEND_NTSC;
- m_shifter_y_end = ATARIST_VBDSTART_NTSC;
- m_shifter_hblank_start = ATARIST_HBSTART_NTSC*2;
- m_shifter_vblank_start = ATARIST_VBSTART_NTSC;
- }
-}
-
-
-//-------------------------------------------------
-// shifter_base_r -
-//-------------------------------------------------
-
-READ8_MEMBER( st_state::shifter_base_r )
-{
- UINT8 data = 0;
-
- switch (offset)
- {
- case 0x00:
- data = (m_shifter_base >> 16) & 0x3f;
- break;
-
- case 0x01:
- data = (m_shifter_base >> 8) & 0xff;
- break;
- }
-
- return data;
-}
-
-
-//-------------------------------------------------
-// shifter_base_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( st_state::shifter_base_w )
-{
- switch (offset)
- {
- case 0x00:
- m_shifter_base = (m_shifter_base & 0x00ff00) | (data & 0x3f) << 16;
- logerror("SHIFTER Video Base Address %06x\n", m_shifter_base);
- break;
-
- case 0x01:
- m_shifter_base = (m_shifter_base & 0x3f0000) | (data << 8);
- logerror("SHIFTER Video Base Address %06x\n", m_shifter_base);
- break;
- }
-}
-
-
-//-------------------------------------------------
-// shifter_counter_r -
-//-------------------------------------------------
-
-READ8_MEMBER( st_state::shifter_counter_r )
-{
- UINT8 data = 0;
-
- switch (offset)
- {
- case 0x00:
- data = (m_shifter_ofs >> 16) & 0x3f;
- break;
-
- case 0x01:
- data = (m_shifter_ofs >> 8) & 0xff;
- break;
-
- case 0x02:
- data = m_shifter_ofs & 0xff;
- break;
- }
-
- return data;
-}
-
-
-//-------------------------------------------------
-// shifter_sync_r -
-//-------------------------------------------------
-
-READ8_MEMBER( st_state::shifter_sync_r )
-{
- return m_shifter_sync;
-}
-
-
-//-------------------------------------------------
-// shifter_sync_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( st_state::shifter_sync_w )
-{
- m_shifter_sync = data;
- logerror("SHIFTER Sync %x\n", m_shifter_sync);
- set_screen_parameters();
-}
-
-
-//-------------------------------------------------
-// shifter_mode_r -
-//-------------------------------------------------
-
-READ8_MEMBER( st_state::shifter_mode_r )
-{
- return m_shifter_mode;
-}
-
-
-//-------------------------------------------------
-// shifter_mode_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( st_state::shifter_mode_w )
-{
- m_shifter_mode = data;
- logerror("SHIFTER Mode %x\n", m_shifter_mode);
-}
-
-
-//-------------------------------------------------
-// shifter_palette_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::shifter_palette_r )
-{
- return m_shifter_palette[offset] | 0xf888;
-}
-
-
-//-------------------------------------------------
-// shifter_palette_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::shifter_palette_w )
-{
- m_shifter_palette[offset] = data;
- // logerror("SHIFTER Palette[%x] = %x\n", offset, data);
-
- m_palette->set_pen_color(offset, pal3bit(data >> 8), pal3bit(data >> 4), pal3bit(data));
-}
-
-
-
-//**************************************************************************
-// STE SHIFTER
-//**************************************************************************
-
-//-------------------------------------------------
-// shifter_base_low_r -
-//-------------------------------------------------
-
-READ8_MEMBER( ste_state::shifter_base_low_r )
-{
- return m_shifter_base & 0xfe;
-}
-
-
-//-------------------------------------------------
-// shifter_base_low_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( ste_state::shifter_base_low_w )
-{
- m_shifter_base = (m_shifter_base & 0x3fff00) | (data & 0xfe);
- logerror("SHIFTER Video Base Address %06x\n", m_shifter_base);
-}
-
-
-//-------------------------------------------------
-// shifter_counter_r -
-//-------------------------------------------------
-
-READ8_MEMBER( ste_state::shifter_counter_r )
-{
- UINT8 data = 0;
-
- switch (offset)
- {
- case 0x00:
- data = (m_shifter_ofs >> 16) & 0x3f;
- break;
-
- case 0x01:
- data = (m_shifter_ofs >> 8) & 0xff;
- break;
-
- case 0x02:
- data = m_shifter_ofs & 0xfe;
- break;
- }
-
- return data;
-}
-
-
-//-------------------------------------------------
-// shifter_counter_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( ste_state::shifter_counter_w )
-{
- switch (offset)
- {
- case 0x00:
- m_shifter_ofs = (m_shifter_ofs & 0x00fffe) | (data & 0x3f) << 16;
- logerror("SHIFTER Video Address Counter %06x\n", m_shifter_ofs);
- break;
-
- case 0x01:
- m_shifter_ofs = (m_shifter_ofs & 0x3f00fe) | (data << 8);
- logerror("SHIFTER Video Address Counter %06x\n", m_shifter_ofs);
- break;
-
- case 0x02:
- m_shifter_ofs = (m_shifter_ofs & 0x3fff00) | (data & 0xfe);
- logerror("SHIFTER Video Address Counter %06x\n", m_shifter_ofs);
- break;
- }
-}
-
-
-//-------------------------------------------------
-// shifter_palette_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( ste_state::shifter_palette_w )
-{
- int r = ((data >> 7) & 0x0e) | BIT(data, 11);
- int g = ((data >> 3) & 0x0e) | BIT(data, 7);
- int b = ((data << 1) & 0x0e) | BIT(data, 3);
-
- m_shifter_palette[offset] = data;
- logerror("SHIFTER palette %x = %x\n", offset, data);
-
- m_palette->set_pen_color(offset, r, g, b);
-}
-
-
-//-------------------------------------------------
-// shifter_lineofs_r -
-//-------------------------------------------------
-
-READ8_MEMBER( ste_state::shifter_lineofs_r )
-{
- return m_shifter_lineofs;
-}
-
-
-//-------------------------------------------------
-// shifter_lineofs_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( ste_state::shifter_lineofs_w )
-{
- m_shifter_lineofs = data;
- logerror("SHIFTER Line Offset %x\n", m_shifter_lineofs);
-}
-
-
-//-------------------------------------------------
-// shifter_pixelofs_r -
-//-------------------------------------------------
-
-READ8_MEMBER( ste_state::shifter_pixelofs_r )
-{
- return m_shifter_pixelofs;
-}
-
-
-//-------------------------------------------------
-// shifter_pixelofs_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( ste_state::shifter_pixelofs_w )
-{
- m_shifter_pixelofs = data & 0x0f;
- logerror("SHIFTER Pixel Offset %x\n", m_shifter_pixelofs);
-}
-
-
-
-//**************************************************************************
-// BLITTER
-//**************************************************************************
-
-//-------------------------------------------------
-// blitter_source -
-//-------------------------------------------------
-
-void st_state::blitter_source()
-{
- address_space &program = m_maincpu->space(AS_PROGRAM);
- UINT16 data = program.read_word(m_blitter_src);
-
- if (m_blitter_src_inc_x < 0)
- {
- m_blitter_srcbuf = (data << 16) | (m_blitter_srcbuf >> 16);
- }
- else
- {
- m_blitter_srcbuf = (m_blitter_srcbuf << 16) | data;
- }
-}
-
-
-//-------------------------------------------------
-// blitter_hop -
-//-------------------------------------------------
-
-UINT16 st_state::blitter_hop()
-{
- UINT16 source = m_blitter_srcbuf >> (m_blitter_skew & 0x0f);
- UINT16 halftone = m_blitter_halftone[m_blitter_ctrl & 0x0f];
-
- if (m_blitter_ctrl & ATARIST_BLITTER_CTRL_SMUDGE)
- {
- halftone = m_blitter_halftone[source & 0x0f];
- }
-
- switch (m_blitter_hop)
- {
- case 0:
- return 0xffff;
- case 1:
- return halftone;
- case 2:
- return source;
- case 3:
- return source & halftone;
- }
-
- return 0;
-}
-
-
-//-------------------------------------------------
-// blitter_op -
-//-------------------------------------------------
-
-void st_state::blitter_op(UINT16 s, UINT32 dstaddr, UINT16 mask)
-{
- address_space &program = m_maincpu->space(AS_PROGRAM);
-
- UINT16 d = program.read_word(dstaddr);
- UINT16 result = 0;
-
- if (m_blitter_op & 0x08) result = (~s & ~d);
- if (m_blitter_op & 0x04) result |= (~s & d);
- if (m_blitter_op & 0x02) result |= (s & ~d);
- if (m_blitter_op & 0x01) result |= (s & d);
-
- program.write_word(dstaddr, result);
-}
-
-
-//-------------------------------------------------
-// blitter_tick -
-//-------------------------------------------------
-
-void st_state::blitter_tick()
-{
- do
- {
- if (m_blitter_skew & ATARIST_BLITTER_SKEW_FXSR)
- {
- blitter_source();
- m_blitter_src += m_blitter_src_inc_x;
- }
-
- blitter_source();
- blitter_op(blitter_hop(), m_blitter_dst, m_blitter_endmask1);
- m_blitter_xcount--;
-
- while (m_blitter_xcount > 0)
- {
- m_blitter_src += m_blitter_src_inc_x;
- m_blitter_dst += m_blitter_dst_inc_x;
-
- if (m_blitter_xcount == 1)
- {
- if (!(m_blitter_skew & ATARIST_BLITTER_SKEW_NFSR))
- {
- blitter_source();
- }
-
- blitter_op(blitter_hop(), m_blitter_dst, m_blitter_endmask3);
- }
- else
- {
- blitter_source();
- blitter_op(blitter_hop(), m_blitter_dst, m_blitter_endmask2);
- }
-
- m_blitter_xcount--;
- }
-
- m_blitter_src += m_blitter_src_inc_y;
- m_blitter_dst += m_blitter_dst_inc_y;
-
- if (m_blitter_dst_inc_y < 0)
- {
- m_blitter_ctrl = (m_blitter_ctrl & 0xf0) | (((m_blitter_ctrl & 0x0f) - 1) & 0x0f);
- }
- else
- {
- m_blitter_ctrl = (m_blitter_ctrl & 0xf0) | (((m_blitter_ctrl & 0x0f) + 1) & 0x0f);
- }
-
- m_blitter_xcount = m_blitter_xcountl;
- m_blitter_ycount--;
- }
- while (m_blitter_ycount > 0);
-
- m_blitter_ctrl &= 0x7f;
-
- m_mfp->i3_w(0);
-}
-
-
-//-------------------------------------------------
-// blitter_halftone_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::blitter_halftone_r )
-{
- return m_blitter_halftone[offset];
-}
-
-
-//-------------------------------------------------
-// blitter_src_inc_x_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::blitter_src_inc_x_r )
-{
- return m_blitter_src_inc_x;
-}
-
-
-//-------------------------------------------------
-// blitter_src_inc_y_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::blitter_src_inc_y_r )
-{
- return m_blitter_src_inc_y;
-}
-
-
-//-------------------------------------------------
-// blitter_src_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::blitter_src_r )
-{
- switch (offset)
- {
- case 0:
- return (m_blitter_src >> 16) & 0xff;
- case 1:
- return m_blitter_src & 0xfffe;
- }
-
- return 0;
-}
-
-
-//-------------------------------------------------
-// blitter_end_mask_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::blitter_end_mask_r )
-{
- switch (offset)
- {
- case 0:
- return m_blitter_endmask1;
- case 1:
- return m_blitter_endmask2;
- case 2:
- return m_blitter_endmask3;
- }
-
- return 0;
-}
-
-
-//-------------------------------------------------
-// blitter_dst_inc_x_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::blitter_dst_inc_x_r )
-{
- return m_blitter_dst_inc_x;
-}
-
-
-//-------------------------------------------------
-// blitter_dst_inc_y_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::blitter_dst_inc_y_r )
-{
- return m_blitter_dst_inc_y;
-}
-
-
-//-------------------------------------------------
-// blitter_dst_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::blitter_dst_r )
-{
- switch (offset)
- {
- case 0:
- return (m_blitter_dst >> 16) & 0xff;
- case 1:
- return m_blitter_dst & 0xfffe;
- }
-
- return 0;
-}
-
-
-//-------------------------------------------------
-// blitter_count_x_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::blitter_count_x_r )
-{
- return m_blitter_xcount;
-}
-
-
-//-------------------------------------------------
-// blitter_count_y_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::blitter_count_y_r )
-{
- return m_blitter_ycount;
-}
-
-
-//-------------------------------------------------
-// blitter_op_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::blitter_op_r )
-{
- if (ACCESSING_BITS_0_7)
- {
- return m_blitter_hop;
- }
- else
- {
- return m_blitter_op;
- }
-}
-
-
-//-------------------------------------------------
-// blitter_ctrl_r -
-//-------------------------------------------------
-
-READ16_MEMBER( st_state::blitter_ctrl_r )
-{
- if (ACCESSING_BITS_0_7)
- {
- return m_blitter_ctrl;
- }
- else
- {
- return m_blitter_skew;
- }
-}
-
-
-//-------------------------------------------------
-// blitter_halftone_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::blitter_halftone_w )
-{
- m_blitter_halftone[offset] = data;
-}
-
-
-//-------------------------------------------------
-// blitter_src_inc_x_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::blitter_src_inc_x_w )
-{
- m_blitter_src_inc_x = data & 0xfffe;
-}
-
-
-//-------------------------------------------------
-// blitter_src_inc_y_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::blitter_src_inc_y_w )
-{
- m_blitter_src_inc_y = data & 0xfffe;
-}
-
-
-//-------------------------------------------------
-// blitter_src_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::blitter_src_w )
-{
- switch (offset)
- {
- case 0:
- m_blitter_src = (data & 0xff) | (m_blitter_src & 0xfffe);
- break;
-
- case 1:
- m_blitter_src = (m_blitter_src & 0xff0000) | (data & 0xfffe);
- break;
- }
-}
-
-
-//-------------------------------------------------
-// blitter_end_mask_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::blitter_end_mask_w )
-{
- switch (offset)
- {
- case 0:
- m_blitter_endmask1 = data;
- break;
-
- case 1:
- m_blitter_endmask2 = data;
- break;
-
- case 2:
- m_blitter_endmask3 = data;
- break;
- }
-}
-
-
-//-------------------------------------------------
-// blitter_dst_inc_x_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::blitter_dst_inc_x_w )
-{
- m_blitter_dst_inc_x = data & 0xfffe;
-}
-
-
-//-------------------------------------------------
-// blitter_dst_inc_y_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::blitter_dst_inc_y_w )
-{
- m_blitter_dst_inc_y = data & 0xfffe;
-}
-
-
-//-------------------------------------------------
-// blitter_dst_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::blitter_dst_w )
-{
- switch (offset)
- {
- case 0:
- m_blitter_dst = (data & 0xff) | (m_blitter_dst & 0xfffe);
- break;
-
- case 1:
- m_blitter_dst = (m_blitter_dst & 0xff0000) | (data & 0xfffe);
- break;
- }
-}
-
-
-//-------------------------------------------------
-// blitter_count_x_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::blitter_count_x_w )
-{
- m_blitter_xcount = data;
-}
-
-
-//-------------------------------------------------
-// blitter_count_y_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::blitter_count_y_w )
-{
- m_blitter_ycount = data;
-}
-
-
-//-------------------------------------------------
-// blitter_op_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::blitter_op_w )
-{
- if (ACCESSING_BITS_0_7)
- {
- m_blitter_hop = (data >> 8) & 0x03;
- }
- else
- {
- m_blitter_op = data & 0x0f;
- }
-}
-
-
-//-------------------------------------------------
-// blitter_ctrl_w -
-//-------------------------------------------------
-
-WRITE16_MEMBER( st_state::blitter_ctrl_w )
-{
- if (ACCESSING_BITS_0_7)
- {
- m_blitter_ctrl = (data >> 8) & 0xef;
-
- if (!(m_blitter_ctrl & ATARIST_BLITTER_CTRL_BUSY))
- {
- if ((data >> 8) & ATARIST_BLITTER_CTRL_BUSY)
- {
- m_mfp->i3_w(1);
-
- int nops = BLITTER_NOPS[m_blitter_op][m_blitter_hop]; // each NOP takes 4 cycles
- timer_set(attotime::from_hz((Y2/4)/(4*nops)), TIMER_BLITTER_TICK);
- }
- }
- }
- else
- {
- m_blitter_skew = data & 0xcf;
- }
-}
-
-
-
-//**************************************************************************
-// VIDEO
-//**************************************************************************
-
-void st_state::video_start()
-{
- m_shifter_timer = timer_alloc(TIMER_SHIFTER_TICK);
- m_glue_timer = timer_alloc(TIMER_GLUE_TICK);
-
-// m_shifter_timer->adjust(machine().first_screen()->time_until_pos(0), 0, attotime::from_hz(Y2/4)); // 125 ns
- m_glue_timer->adjust(machine().first_screen()->time_until_pos(0), 0, attotime::from_hz(Y2/16)); // 500 ns
-
- machine().first_screen()->register_screen_bitmap(m_bitmap);
-
- /* register for state saving */
- save_item(NAME(m_shifter_base));
- save_item(NAME(m_shifter_ofs));
- save_item(NAME(m_shifter_sync));
- save_item(NAME(m_shifter_mode));
- save_item(NAME(m_shifter_palette));
- save_item(NAME(m_shifter_rr));
- save_item(NAME(m_shifter_ir));
- save_item(NAME(m_shifter_bitplane));
- save_item(NAME(m_shifter_shift));
- save_item(NAME(m_shifter_h));
- save_item(NAME(m_shifter_v));
- save_item(NAME(m_shifter_de));
-
- save_item(NAME(m_blitter_halftone));
- save_item(NAME(m_blitter_src_inc_x));
- save_item(NAME(m_blitter_src_inc_y));
- save_item(NAME(m_blitter_dst_inc_x));
- save_item(NAME(m_blitter_dst_inc_y));
- save_item(NAME(m_blitter_src));
- save_item(NAME(m_blitter_dst));
- save_item(NAME(m_blitter_endmask1));
- save_item(NAME(m_blitter_endmask2));
- save_item(NAME(m_blitter_endmask3));
- save_item(NAME(m_blitter_xcount));
- save_item(NAME(m_blitter_ycount));
- save_item(NAME(m_blitter_xcountl));
- save_item(NAME(m_blitter_hop));
- save_item(NAME(m_blitter_op));
- save_item(NAME(m_blitter_ctrl));
- save_item(NAME(m_blitter_skew));
-
- set_screen_parameters();
-}
-
-
-void ste_state::video_start()
-{
- st_state::video_start();
-
- // register for state saving
- save_item(NAME(m_shifter_lineofs));
- save_item(NAME(m_shifter_pixelofs));
-}
-
-void stbook_state::video_start()
-{
-}
-
-
-UINT32 st_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect);
- return 0;
-}
diff --git a/src/mess/video/atarist.h b/src/mess/video/atarist.h
deleted file mode 100644
index da66ff3a17e..00000000000
--- a/src/mess/video/atarist.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Curt Coder, Olivier Galibert
-#ifndef _VIDEO_ATARIST_H_
-#define _VIDEO_ATARIST_H_
-
-// 32028400 also exists
-#define Y2 32084988.0
-#define Y2_NTSC 32042400.0
-
-#define ATARIST_HBSTART_PAL 128*4
-#define ATARIST_HBEND_PAL 0
-#define ATARIST_HBSTART_NTSC 127*4
-#define ATARIST_HBEND_NTSC 0
-#define ATARIST_HTOT_PAL 129*4
-#define ATARIST_HTOT_NTSC 128*4
-
-#define ATARIST_HBDEND_PAL 14*4
-#define ATARIST_HBDSTART_PAL 94*4
-#define ATARIST_HBDEND_NTSC 13*4
-#define ATARIST_HBDSTART_NTSC 93*4
-
-#define ATARIST_VBEND_PAL 0
-#define ATARIST_VBEND_NTSC 0
-#define ATARIST_VBSTART_PAL 312
-#define ATARIST_VBSTART_NTSC 262
-#define ATARIST_VTOT_PAL 313
-#define ATARIST_VTOT_NTSC 263
-
-#define ATARIST_VBDEND_PAL 63
-#define ATARIST_VBDSTART_PAL 263
-#define ATARIST_VBDEND_NTSC 34
-#define ATARIST_VBDSTART_NTSC 234
-
-#define ATARIST_BLITTER_SKEW_NFSR 0x40
-#define ATARIST_BLITTER_SKEW_FXSR 0x80
-
-#define ATARIST_BLITTER_CTRL_SMUDGE 0x20
-#define ATARIST_BLITTER_CTRL_HOG 0x40
-#define ATARIST_BLITTER_CTRL_BUSY 0x80
-
-#endif
diff --git a/src/mess/video/aussiebyte.c b/src/mess/video/aussiebyte.c
deleted file mode 100644
index f3f758fe4f6..00000000000
--- a/src/mess/video/aussiebyte.c
+++ /dev/null
@@ -1,196 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Robbbert
-/***********************************************************
-
- Video
- Graphics not working properly.
- Mode 0 - lores (wide, chunky)
- Mode 1 - external, *should* be ok
- Mode 2 - thin graphics, not explained well enough to code
- Mode 3 - alphanumeric, works
-
-
-
-************************************************************/
-#include "includes/aussiebyte.h"
-/***********************************************************
-
- I/O Ports
-
-************************************************************/
-
-// dummy read port, forces requested action to happen
-READ8_MEMBER( aussiebyte_state::port33_r )
-{
- return 0xff;
-}
-
-/*
-Video control - needs to be fully understood
-d0, d1, d2, d3 - can replace RA0-3 in graphics mode
-d4 - GS - unknown
-d5 - /SRRD - controls write of data to either vram or aram (1=vram, 0=aram)
-d6 - /VWR - 0 = enable write vdata to vram, read from aram to vdata ; 1 = enable write to aram from vdata
-d7 - OE on port 35
-*/
-WRITE8_MEMBER( aussiebyte_state::port34_w )
-{
- m_port34 = data;
-}
-
-WRITE8_MEMBER( aussiebyte_state::port35_w )
-{
- m_port35 = data;
-}
-
-READ8_MEMBER( aussiebyte_state::port36_r )
-{
- if BIT(m_port34, 5)
- {
- if BIT(m_p_attribram[m_alpha_address & 0x7ff], 7)
- return m_p_videoram[m_alpha_address];
- else
- return m_p_videoram[m_graph_address];
- }
- else
- return m_p_attribram[m_alpha_address & 0x7ff];
-}
-
-READ8_MEMBER( aussiebyte_state::port37_r )
-{
- return m_crtc->de_r() ? 0xff : 0xfe;
-}
-
-
-/***********************************************************
-
- Video
-
-************************************************************/
-MC6845_ON_UPDATE_ADDR_CHANGED( aussiebyte_state::crtc_update_addr )
-{
-/* not sure what goes in here - parameters passed are device, address, strobe */
-// m_video_address = address;// & 0x7ff;
-}
-
-WRITE8_MEMBER( aussiebyte_state::address_w )
-{
- m_crtc->address_w( space, 0, data );
-
- m_video_index = data & 0x1f;
-
- if (m_video_index == 31)
- {
- m_alpha_address++;
- m_alpha_address &= 0x3fff;
- m_graph_address = (m_alpha_address << 4) | (m_port34 & 15);
-
- if BIT(m_port34, 5)
- {
- if BIT(m_p_attribram[m_alpha_address & 0x7ff], 7)
- m_p_videoram[m_alpha_address] = m_port35;
- else
- m_p_videoram[m_graph_address] = m_port35;
- }
- else
- m_p_attribram[m_alpha_address & 0x7ff] = m_port35;
- }
-}
-
-WRITE8_MEMBER( aussiebyte_state::register_w )
-{
- m_crtc->register_w( space, 0, data );
- UINT16 temp = m_alpha_address;
-
- // Get transparent address
- if (m_video_index == 18)
- m_alpha_address = (data << 8 ) | (temp & 0xff);
- else
- if (m_video_index == 19)
- m_alpha_address = data | (temp & 0xff00);
-}
-
-UINT8 aussiebyte_state::crt8002(UINT8 ac_ra, UINT8 ac_chr, UINT8 ac_attr, UINT16 ac_cnt, bool ac_curs)
-{
- UINT8 gfx = 0;
- switch (ac_attr & 3)
- {
- case 0: // lores gfx
- switch (ac_ra)
- {
- case 0:
- case 1:
- case 2:
- gfx = (BIT(ac_chr, 7) ? 0xf8 : 0) | (BIT(ac_chr, 3) ? 7 : 0);
- break;
- case 3:
- case 4:
- case 5:
- gfx = (BIT(ac_chr, 6) ? 0xf8 : 0) | (BIT(ac_chr, 2) ? 7 : 0);
- break;
- case 6:
- case 7:
- case 8:
- gfx = (BIT(ac_chr, 5) ? 0xf8 : 0) | (BIT(ac_chr, 1) ? 7 : 0);
- break;
- default:
- gfx = (BIT(ac_chr, 4) ? 0xf8 : 0) | (BIT(ac_chr, 0) ? 7 : 0);
- break;
- }
- break;
- case 1: // external mode
- gfx = BITSWAP8(ac_chr, 0,1,2,3,4,5,6,7);
- break;
- case 2: // thin gfx
- break;
- case 3: // alpha
- gfx = m_p_chargen[((ac_chr & 0x7f)<<4) | ac_ra];
- break;
- }
-
- if (BIT(ac_attr, 3) & (ac_ra == 11)) // underline
- gfx = 0xff;
- if (BIT(ac_attr, 2) & ((ac_ra == 5) | (ac_ra == 6))) // strike-through
- gfx = 0xff;
- if (BIT(ac_attr, 6) & BIT(ac_cnt, 13)) // flash
- gfx = 0;
- if BIT(ac_attr, 5) // blank
- gfx = 0;
- if (ac_curs & BIT(ac_cnt, 14)) // cursor
- gfx ^= 0xff;
- if BIT(ac_attr, 4) // reverse video
- gfx ^= 0xff;
- return gfx;
-}
-
-MC6845_UPDATE_ROW( aussiebyte_state::crtc_update_row )
-{
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- UINT8 chr,gfx,attr;
- UINT16 mem,x;
- UINT32 *p = &bitmap.pix32(y);
- ra &= 15;
- m_cnt++;
-
- for (x = 0; x < x_count; x++)
- {
- mem = ma + x;
- attr = m_p_attribram[mem & 0x7ff];
- if BIT(attr, 7)
- chr = m_p_videoram[mem & 0x3fff]; // alpha
- else
- chr = m_p_videoram[(mem << 4) | ra]; // gfx
-
- gfx = crt8002(ra, chr, attr, m_cnt, (x==cursor_x));
-
- /* Display a scanline of a character (8 pixels) */
- *p++ = palette[BIT(gfx, 7)];
- *p++ = palette[BIT(gfx, 6)];
- *p++ = palette[BIT(gfx, 5)];
- *p++ = palette[BIT(gfx, 4)];
- *p++ = palette[BIT(gfx, 3)];
- *p++ = palette[BIT(gfx, 2)];
- *p++ = palette[BIT(gfx, 1)];
- *p++ = palette[BIT(gfx, 0)];
- }
-}
diff --git a/src/mess/video/avigo.c b/src/mess/video/avigo.c
deleted file mode 100644
index 0177023fe9f..00000000000
--- a/src/mess/video/avigo.c
+++ /dev/null
@@ -1,118 +0,0 @@
-// license:GPL-2.0+
-// copyright-holders:Kevin Thacker,Sandro Ronco
-/***************************************************************************
-
- avigo.c
-
- Functions to emulate the video hardware of the TI Avigo 10 PDA
-
-***************************************************************************/
-
-#include "emu.h"
-#include "includes/avigo.h"
-
-/***************************************************************************
- Start the video hardware emulation.
-***************************************************************************/
-
-/* mem size = 0x017c0 */
-
-
-/* current column to read/write */
-
-#define AVIGO_VIDEO_DEBUG 0
-#define LOG(x) do { if (AVIGO_VIDEO_DEBUG) logerror x; } while (0)
-
-
-READ8_MEMBER(avigo_state::vid_memory_r)
-{
- if (!offset)
- return m_screen_column;
-
- if ((offset<0x0100) || (offset>=0x01f0) || (m_screen_column >= (AVIGO_SCREEN_WIDTH>>3)))
- {
- LOG(("vid mem read: %04x\n", offset));
- return 0;
- }
-
- /* 0x0100-0x01f0 contains data for selected column */
- return m_video_memory[m_screen_column + ((offset&0xff)*(AVIGO_SCREEN_WIDTH>>3))];
-}
-
-WRITE8_MEMBER(avigo_state::vid_memory_w)
-{
- if (!offset)
- {
- /* select column to read/write */
- m_screen_column = data;
-
- LOG(("vid mem column write: %02x\n",data));
-
- if (data>=(AVIGO_SCREEN_WIDTH>>3))
- {
- LOG(("error: vid mem column write: %02x\n",data));
- }
- return;
- }
-
- if ((offset<0x0100) || (offset>=0x01f0) || (m_screen_column >= (AVIGO_SCREEN_WIDTH>>3)))
- {
- LOG(("vid mem write: %04x %02x\n", offset, data));
- return;
- }
-
- /* 0x0100-0x01f0 contains data for selected column */
- m_video_memory[m_screen_column + ((offset&0xff)*(AVIGO_SCREEN_WIDTH>>3))] = data;
-}
-
-void avigo_state::video_start()
-{
- /* current selected column to read/write */
- m_screen_column = 0;
-
- /* allocate video memory */
- m_video_memory = machine().memory().region_alloc( "videoram", (AVIGO_SCREEN_WIDTH>>3) * AVIGO_SCREEN_HEIGHT + 1, 1, ENDIANNESS_LITTLE )->base();
- memset(m_video_memory, 0, (AVIGO_SCREEN_WIDTH>>3) * AVIGO_SCREEN_HEIGHT + 1);
-
- save_pointer(NAME(m_video_memory), (AVIGO_SCREEN_WIDTH>>3) * AVIGO_SCREEN_HEIGHT + 1);
-}
-
-/* Initialise the palette */
-PALETTE_INIT_MEMBER(avigo_state, avigo)
-{
- m_palette->set_pen_color(0,rgb_t(0xff,0xff,0xff)); /* white */
- m_palette->set_pen_color(1,rgb_t(0x00,0x00,0x00)); /* black */
-}
-
-UINT32 avigo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- int y;
- int b;
- int x;
-
- /* draw avigo display */
- for (y=0; y<AVIGO_SCREEN_HEIGHT; y++)
- {
- int by;
- UINT8 *line_ptr = m_video_memory + (y*(AVIGO_SCREEN_WIDTH>>3));
-
- x = 0;
- for (by=((AVIGO_SCREEN_WIDTH>>3)-1); by>=0; by--)
- {
- int px;
- UINT8 byte = line_ptr[0];
-
- px = x;
- for (b=7; b>=0; b--)
- {
- bitmap.pix16(y, px) = ((byte>>7) & 0x01);
- px++;
- byte = byte<<1;
- }
-
- x = px;
- line_ptr = line_ptr+1;
- }
- }
- return 0;
-}
diff --git a/src/mess/video/b2m.c b/src/mess/video/b2m.c
deleted file mode 100644
index 9cd59b2ec42..00000000000
--- a/src/mess/video/b2m.c
+++ /dev/null
@@ -1,60 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
-/***************************************************************************
-
- Bashkiria-2M video driver by Miodrag Milanovic
-
- 28/03/2008 Preliminary driver.
-
-****************************************************************************/
-
-
-#include "emu.h"
-#include "includes/b2m.h"
-#include "machine/ram.h"
-
-void b2m_state::video_start()
-{
-}
-
-UINT32 b2m_state::screen_update_b2m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- UINT8 code1;
- UINT8 code2;
- UINT8 col;
- int y, x, b;
- UINT8 *ram = m_ram->pointer();
-
- for (x = 0; x < 48; x++)
- {
- for (y = 0; y < 256; y++)
- {
- if (m_b2m_video_page==0) {
- code1 = ram[0x11000 + x*256 + ((y + m_b2m_video_scroll) & 0xff)];
- code2 = ram[0x15000 + x*256 + ((y + m_b2m_video_scroll) & 0xff)];
- } else {
- code1 = ram[0x19000 + x*256 + ((y + m_b2m_video_scroll) & 0xff)];
- code2 = ram[0x1d000 + x*256 + ((y + m_b2m_video_scroll) & 0xff)];
- }
- for (b = 7; b >= 0; b--)
- {
- col = (((code2 >> b) & 0x01)<<1) + ((code1 >> b) & 0x01);
- bitmap.pix16(y, x*8+b) = col;
- }
- }
- }
-
- return 0;
-}
-
-static const rgb_t b2m_palette[4] = {
- rgb_t(0x00, 0x00, 0x00), // 0
- rgb_t(0x00, 0x00, 0x00), // 1
- rgb_t(0x00, 0x00, 0x00), // 2
- rgb_t(0x00, 0x00, 0x00), // 3
-};
-
-PALETTE_INIT_MEMBER(b2m_state, b2m)
-{
- palette.set_pen_colors(0, b2m_palette, ARRAY_LENGTH(b2m_palette));
-}
diff --git a/src/mess/video/bbc.c b/src/mess/video/bbc.c
deleted file mode 100644
index 5e059647705..00000000000
--- a/src/mess/video/bbc.c
+++ /dev/null
@@ -1,306 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Gordon Jefferyes, Nigel Barnes
-/******************************************************************************
- BBC Model B
-
- MESS Driver By:
-
- Gordon Jefferyes
- mess_bbc@romvault.com
-
- This is the first go around at converting the BBC code over to using
- mames built in mc6845, there are a number of features now incorrect
- or missing in this build:
-
- BBC split modes no longer work (Like is used in Elite.)
-
-******************************************************************************/
-
-#include "emu.h"
-#include "includes/bbc.h"
-#include "video/saa5050.h"
-#include "video/mc6845.h"
-
-/************************************************************************
- * C0 and C1 along with MA12 output from the 6845 drive 4 NAND gates in ICs 27,36 and 40
- * the outputs from these NAND gates (B1 to B4) along with MA8 to MA11 from the 6845 (A1 to B4) are added together
- * in IC39 74LS283 4 bit adder to form (S1 to S4) the logic is used to loop the screen memory for hardware scrolling.
- * when MA13 from the 6845 is low the latches IC8 and IC9 are enabled
- * they control the memory addressing for the Hi-Res modes.
- * when MA13 from the 6845 is high the latches IC10 and IC11 are enabled
- * they control the memory addressing for the Teletext mode.
- * IC 8 or IC10 drives the row select in the memory (the lower 7 bits in the memory address) and
- * IC 9 or IC11 drives the column select in the memory (the next 7 bits in the memory address) this
- * gives control of the bottom 14 bits of the memory, in a 32K model B 15 bits are needed to access
- * all the RAM, so S4 for the adder drives the CAS0 and CAS1 to access the top bit, in a 16K model A
- * the output of S4 is linked out to a 0v supply by link S25 to just access the 16K memory area.
- ************************************************************************/
-
-unsigned int bbc_state::calculate_video_address(int ma,int ra)
-{
- // ma = output from IC2 6845 MA address
-
- int c0=m_b4_video0; // output from IC32 74LS259 bits 4 and 5
- int c1=m_b5_video1;
-
- /* the 4 bit input port b on IC39 are produced by 4 NAND gates.
- these NAND gates take their
- inputs from c0 and c1 (from IC32) and ma12 (from the 6845) */
-
- /* get bit m12 from the 6845 */
- int ma12=(ma>>12)&1;
-
- // 4 bit input B on IC39 74LS283 (4 bit adder)
- /* 3 input NAND part of IC 36 */
- int b1=(~(c1 & c0 & ma12)) & 1;
- /* 2 input NAND part of IC40 (b3 is calculated before b2 and b4 because b3 feed back into b2 and b4) */
- int b3=(~(c0 & ma12)) & 1;
- /* 3 input NAND part of IC 36 */
- int b2=(~(c1 & b3 & ma12)) & 1;
- /* 2 input NAND part of IC 27 */
- int b4=(~(b3 & ma12)) & 1;
-
- /* inputs port b to IC39 are taken from the NAND gates b1 to b4 */
- int b=(b1<<0)|(b2<<1)|(b3<<2)|(b4<<3);
-
- /* inputs port a to IC39 are MA8 to MA11 from the 6845 */
- int a=(ma>>8)&0xf;
-
- /* IC39 performs the 4 bit add with the carry input set high */
- int s=(a+b+1)&0xf;
-
- /* if MA13 (TTXVDU) is low then IC8 and IC9 are used to calculate
- the memory location required for the hi res video.
- if MA13 is hight then IC10 and IC11 are used to calculate the memory location for the teletext chip*/
- unsigned int m;
- if ((ma>>13)&1)
- {
- // IC 10 and IC 11
- m=((ma&0x3ff)|0x3c00)|((s&0x8)<<11);
- } else {
- // IC 8 and IC 9
- m=((ma&0xff)<<3)|(s<<11)|(ra&0x7);
- }
- if (m_memorySize==16)
- return m & 0x3fff;
-
- return m;
-}
-
-/************************************************************************
- * VideoULA
- ************************************************************************/
-
-static const int pixels_per_byte_set[8]={ 2,4,8,16,1,2,4,8 };
-
-static const int width_of_cursor_set[8]={ 0,0,1,2,1,0,2,4 };
-
-/* this is a quick lookup array that puts bits 0,2,4,6 into bits 0,1,2,3
- this is used by the palette lookup in the video ULA */
-void bbc_state::set_pixel_lookup()
-{
- for (int i=0; i<256; i++)
- {
- m_pixel_bits[i] = (((i>>7)&1)<<3) | (((i>>5)&1)<<2) | (((i>>3)&1)<<1) | (((i>>1)&1)<<0);
- }
-}
-
-
-WRITE8_MEMBER(bbc_state::bbc_videoULA_w)
-{
- // Make sure vpos is never <0 2008-10-11 PHS.
- int vpos=machine().first_screen()->vpos();
- if(vpos==0)
- machine().first_screen()->update_partial(vpos);
- else
- machine().first_screen()->update_partial(vpos -1 );
-
- logerror("setting videoULA %.4x to:%.4x at :%d \n",data,offset,machine().first_screen()->vpos() );
-
-
- switch (offset&0x01)
- {
- // Set the control register in the Video ULA
- case 0:
- {
- m_videoULA_Reg=data;
- m_videoULA_master_cursor_size= (m_videoULA_Reg>>7)&0x01;
- m_videoULA_width_of_cursor= (m_videoULA_Reg>>5)&0x03;
- m_videoULA_6845_clock_rate= (m_videoULA_Reg>>4)&0x01;
- m_videoULA_characters_per_line= (m_videoULA_Reg>>2)&0x03;
- m_videoULA_teletext_normal_select=(m_videoULA_Reg>>1)&0x01;
- m_videoULA_flash_colour_select= m_videoULA_Reg &0x01;
-
- m_videoULA_pallet_lookup=m_videoULA_flash_colour_select?m_videoULA_pallet0:m_videoULA_pallet1;
-
- m_emulation_cursor_size=width_of_cursor_set[m_videoULA_width_of_cursor|(m_videoULA_master_cursor_size<<2)];
-
- // this is the number of BBC pixels held in each byte
- if (m_videoULA_teletext_normal_select)
- {
- m_pixels_per_byte=6;
- } else {
- m_pixels_per_byte=pixels_per_byte_set[m_videoULA_characters_per_line|(m_videoULA_6845_clock_rate<<2)];
- }
- m_mc6845->set_hpixels_per_column(m_pixels_per_byte);
- if (m_videoULA_6845_clock_rate)
- m_mc6845->set_clock(2000000);
- else
- m_mc6845->set_clock(1000000);
- }
- break;
- // Set a pallet register in the Video ULA
- case 1:
- int tpal=(data>>4)&0x0f;
- int tcol=data&0x0f;
- m_videoULA_pallet0[tpal]=tcol;
- m_videoULA_pallet1[tpal]=tcol<8?tcol:tcol^7;
- break;
- }
-}
-
-/************************************************************************
- * BBC circuits controlled by 6845 Outputs
- ************************************************************************/
-
-MC6845_UPDATE_ROW( bbc_state::crtc_update_row )
-{
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
-
- if (m_videoULA_teletext_normal_select)
- {
- m_trom->lose_w(1);
- m_trom->lose_w(0);
-
- for(int x_pos=0; x_pos<x_count; x_pos++)
- {
- //Teletext Latch bits 0 to 5 go to bits 0 to 5 on the Teletext chip
- //Teletext Latch bit 6 is only passed onto bits 6 on the Teletext chip if DE is true
- //Teletext Latch bit 7 goes to LOSE on the Teletext chip
-
- if (((ma>>13)&1)==0)
- {
- m_Teletext_Latch=0;
- }
- else
- {
- m_Teletext_Latch=(m_BBC_Video_RAM[calculate_video_address(ma+x_pos,ra)]);
- }
-
- m_trom->write((m_Teletext_Latch&0x3f)|(m_Teletext_Latch&0x40));
-
- m_trom->f1_w(1);
- m_trom->f1_w(0);
-
- for(int pixelno=0;pixelno<6;pixelno++)
- {
- m_trom->tr6_w(1);
- m_trom->tr6_w(0);
-
- int col=m_trom->get_rgb() ^ ((x_pos==cursor_x) ? 7 : 0);
-
- int r = BIT(col, 0) * 0xff;
- int g = BIT(col, 1) * 0xff;
- int b = BIT(col, 2) * 0xff;
-
- rgb_t rgb = rgb_t(r, g, b);
-
- bitmap.pix32(y, (x_pos*m_pixels_per_byte)+pixelno) = rgb;
- }
- }
-
- if (ra == 18)
- {
- m_trom->lose_w(1);
- m_trom->lose_w(0);
- }
- }
- else
- {
- // this is IC38 and IC41 takes 6845 DisplayEnabled and 6845 RA3
- int DE= !(ra>=8);
-
- if (DE)
- {
- for(int x_pos=0; x_pos<x_count; x_pos++)
- {
- int vmem=calculate_video_address(ma+x_pos,ra);
- unsigned char i=m_BBC_Video_RAM[vmem];
-
- for(int pixelno=0;pixelno<m_pixels_per_byte;pixelno++)
- {
- int col=m_videoULA_pallet_lookup[m_pixel_bits[i]] ^ ((x_pos==cursor_x) ? 7 : 0);
- bitmap.pix32(y, (x_pos*m_pixels_per_byte)+pixelno)=palette[col];
- i=(i<<1)|1;
- }
- }
- }
- else
- {
- for(int x_pos=0; x_pos<x_count; x_pos++)
- {
- for(int pixelno=0;pixelno<m_pixels_per_byte;pixelno++)
- {
- bitmap.pix32(y, (x_pos*m_pixels_per_byte)+pixelno)=palette[7];
- }
- }
- }
- }
-}
-
-WRITE_LINE_MEMBER(bbc_state::bbc_vsync)
-{
- m_trom->dew_w(state);
-}
-
-
-/**** BBC B+ Shadow Ram change ****/
-
-void bbc_state::bbcbp_setvideoshadow(int vdusel)
-{
- if (vdusel)
- {
- m_BBC_Video_RAM= m_region_maincpu->base()+0x8000;
- } else {
- m_BBC_Video_RAM= m_region_maincpu->base();
- }
-}
-
-/************************************************************************
- * bbc_vh_start
- * Initialize the BBC video emulation
- ************************************************************************/
-
-void bbc_state::common_init(int memorySize)
-{
- m_emulation_cursor_size = 1;
-
- m_VideoULA_CR = 7;
- m_VideoULA_CR_counter = 0;
-
- set_pixel_lookup();
-
- m_BBC_Video_RAM = m_region_maincpu->base();
- m_memorySize=memorySize;
-
-}
-
-VIDEO_START_MEMBER(bbc_state,bbca)
-{
- common_init(m_ram->size()/1024);
-}
-
-VIDEO_START_MEMBER(bbc_state,bbcb)
-{
- common_init(32);
-}
-
-VIDEO_START_MEMBER(bbc_state,bbcbp)
-{
- common_init(32);
-}
-
-VIDEO_START_MEMBER(bbc_state,bbcm)
-{
- common_init(32);
-}
diff --git a/src/mess/video/bk.c b/src/mess/video/bk.c
deleted file mode 100644
index 103c78779bd..00000000000
--- a/src/mess/video/bk.c
+++ /dev/null
@@ -1,40 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
-/***************************************************************************
-
- BK video driver by Miodrag Milanovic
-
- 10/03/2008 Preliminary driver.
-
-****************************************************************************/
-
-
-#include "emu.h"
-#include "includes/bk.h"
-
-
-void bk_state::video_start()
-{
-}
-
-UINT32 bk_state::screen_update_bk0010(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- UINT16 code;
- int y, x, b;
- int nOfs;
-
- nOfs = (m_scrool - 728) % 256;
-
- for (y = 0; y < 256; y++)
- {
- for (x = 0; x < 32; x++)
- {
- code = m_bk0010_video_ram[((y+nOfs) %256)*32 + x];
- for (b = 0; b < 16; b++)
- {
- bitmap.pix16(y, x*16 + b) = (code >> b) & 0x01;
- }
- }
- }
- return 0;
-}
diff --git a/src/mess/video/busicom.c b/src/mess/video/busicom.c
deleted file mode 100644
index 0c97258a002..00000000000
--- a/src/mess/video/busicom.c
+++ /dev/null
@@ -1,1860 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
-/***************************************************************************
-
- Busicom 141-PF
-
- 04/08/2009 Initial driver by Miodrag Milanovic
-
-****************************************************************************/
-#include "emu.h"
-#include "includes/busicom.h"
-
-// Printer font 34x44 as provided by MIT Media Lab
-
-
-static const UINT8 printer_font[]= {
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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