summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2014-04-06 18:47:51 +0000
committer Curt Coder <curtcoder@mail.com>2014-04-06 18:47:51 +0000
commit4985d470e0892816a0e16077c8e868cd6d9d2b57 (patch)
tree18186c25200d232fb9e6428448e4d9e810a1ab22 /src
parentd455e3806a4d34c7bd6172c0a3fbe5c396c768d5 (diff)
(MESS) tandy2k: Hacked in some video. (nw)
Diffstat (limited to 'src')
-rw-r--r--src/emu/video/crt9007.c2
-rw-r--r--src/mess/drivers/tandy2k.c43
-rw-r--r--src/mess/includes/tandy2k.h1
3 files changed, 39 insertions, 7 deletions
diff --git a/src/emu/video/crt9007.c b/src/emu/video/crt9007.c
index 0aa9b0b96f8..e302545f8db 100644
--- a/src/emu/video/crt9007.c
+++ b/src/emu/video/crt9007.c
@@ -398,6 +398,7 @@ inline void crt9007_t::update_dma_timer()
inline void crt9007_t::recompute_parameters()
{
+#ifdef UNUSED_FOR_NOW
// check that necessary registers have been loaded
if (!HAS_VALID_PARAMETERS) return;
@@ -441,6 +442,7 @@ inline void crt9007_t::recompute_parameters()
m_vsync_timer->adjust(m_screen->time_until_pos(0, 0));
m_vlt_timer->adjust(m_screen->time_until_pos(0, m_vlt_start), 1);
m_drb_timer->adjust(m_screen->time_until_pos(0, 0));
+#endif
}
diff --git a/src/mess/drivers/tandy2k.c b/src/mess/drivers/tandy2k.c
index 20e36262238..bf9fefebeef 100644
--- a/src/mess/drivers/tandy2k.c
+++ b/src/mess/drivers/tandy2k.c
@@ -335,6 +335,34 @@ INPUT_PORTS_END
// Video
+UINT32 tandy2k_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+{
+ const pen_t *pen = m_palette->pens();
+ address_space &program = m_maincpu->space(AS_PROGRAM);
+
+ for (int y = 0; y < 400; y++)
+ {
+ UINT8 cgra = y % 16;
+
+ for (int sx = 0; sx < 80; sx++)
+ {
+ offs_t addr = 0x1ec00 + (((y / 16) * 80) + sx) * 2;
+ UINT8 vidla = program.read_word(addr);
+ UINT8 data = m_char_ram[(vidla << 4) | cgra];
+ logerror("y %u sx %u addr %06x vidla %02x data %02x\n",y,sx,addr,vidla,data);
+
+ for (int x = 0; x < 8; x++)
+ {
+ int color = BIT(data, 7);
+ bitmap.pix32(y, (sx * 8) + x) = pen[color];
+ data <<= 1;
+ }
+ }
+ }
+
+ return 0;
+}
+
WRITE_LINE_MEMBER( tandy2k_state::vpac_vlt_w )
{
m_drb0->ren_w(state);
@@ -721,15 +749,16 @@ static MACHINE_CONFIG_START( tandy2k, tandy2k_state )
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
MCFG_SCREEN_REFRESH_RATE(50)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate
- MCFG_SCREEN_SIZE(640, 480)
- MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
- MCFG_SCREEN_UPDATE_DEVICE(CRT9021B_TAG, crt9021_t, screen_update)
+ MCFG_SCREEN_SIZE(640, 400)
+ MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1)
+ //MCFG_SCREEN_UPDATE_DEVICE(CRT9021B_TAG, crt9021_t, screen_update)
+ MCFG_SCREEN_UPDATE_DRIVER(tandy2k_state, screen_update)
MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
- MCFG_DEVICE_ADD(CRT9007_TAG, CRT9007, XTAL_16MHz*28/16/10)
+ MCFG_DEVICE_ADD(CRT9007_TAG, CRT9007, XTAL_16MHz*28/20/8)
MCFG_DEVICE_ADDRESS_MAP(AS_0, vpac_mem)
- MCFG_CRT9007_CHARACTER_WIDTH(10)
+ MCFG_CRT9007_CHARACTER_WIDTH(8)
MCFG_CRT9007_INT_CALLBACK(DEVWRITELINE(I8259A_1_TAG, pic8259_device, ir1_w))
MCFG_CRT9007_VS_CALLBACK(DEVWRITELINE(CRT9021B_TAG, crt9021_t, vsync_w))
MCFG_CRT9007_VLT_CALLBACK(WRITELINE(tandy2k_state, vpac_vlt_w))
@@ -749,10 +778,10 @@ static MACHINE_CONFIG_START( tandy2k, tandy2k_state )
MCFG_CRT9212_WEN2_VCC()
MCFG_CRT9212_DOUT_CALLBACK(WRITE8(tandy2k_state, drb_attr_w))
- MCFG_DEVICE_ADD(CRT9021B_TAG, CRT9021, XTAL_16MHz*28/16)
+ MCFG_DEVICE_ADD(CRT9021B_TAG, CRT9021, XTAL_16MHz*28/20)
MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
- MCFG_TIMER_DRIVER_ADD_PERIODIC("vidldsh", tandy2k_state, vidldsh_tick, attotime::from_hz(XTAL_16MHz*28/16))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("vidldsh", tandy2k_state, vidldsh_tick, attotime::from_hz(XTAL_16MHz*28/20/8))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/includes/tandy2k.h b/src/mess/includes/tandy2k.h
index 3d2324ad6a4..290743dcdc9 100644
--- a/src/mess/includes/tandy2k.h
+++ b/src/mess/includes/tandy2k.h
@@ -125,6 +125,7 @@ public:
optional_shared_ptr<UINT8> m_char_ram;
virtual void machine_start();
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void update_drq();
void dma_request(int line, int state);