mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
(MESS) Laser 3000: add first-pass keyboard, 80-column text, hi-res, and double hi-res graphics support [R. Belmont]
This commit is contained in:
parent
0dc460c40e
commit
cc6a2f5a64
@ -20,11 +20,11 @@
|
||||
http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Computers/LASER/LASER%203000/Manuals/The%20Cat%20Technical%20Reference%20Manual.pdf
|
||||
|
||||
TODO:
|
||||
- keyboard
|
||||
- graphics modes
|
||||
- 80-column text
|
||||
- figure out where the C800 ROM pages for the printer and FDC are (currently the 80-col f/w's pages are mapped there)
|
||||
- Finish keyboard
|
||||
- RGB graphics mode
|
||||
- FDC C800 page appears to be inside the FDC cartridge, need a dump :( (can hack to use IWM in the meantime)
|
||||
- Centronics printer port (data at 3c090, read ack at 3c1c0, read busy at 3c1c2)
|
||||
- cassette
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
@ -32,9 +32,35 @@
|
||||
#include "cpu/m6502/m6502.h"
|
||||
#include "machine/bankdev.h"
|
||||
#include "machine/ram.h"
|
||||
#include "machine/kb3600.h"
|
||||
#include "sound/speaker.h"
|
||||
#include "sound/sn76496.h"
|
||||
|
||||
enum
|
||||
{
|
||||
TEXT = 0,
|
||||
HIRES,
|
||||
RGB,
|
||||
DHIRES
|
||||
};
|
||||
|
||||
#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
|
||||
|
||||
class laser3k_state : public driver_device
|
||||
{
|
||||
public:
|
||||
@ -46,8 +72,10 @@ public:
|
||||
, m_bank1(*this, "bank1")
|
||||
, m_bank2(*this, "bank2")
|
||||
, m_bank3(*this, "bank3")
|
||||
, m_ay3600(*this, "ay3600")
|
||||
, m_speaker(*this, "speaker")
|
||||
, m_sn(*this, "sn76489")
|
||||
, m_kbspecial(*this, "keyb_special")
|
||||
{ }
|
||||
|
||||
required_device<m6502_device> m_maincpu;
|
||||
@ -56,8 +84,10 @@ public:
|
||||
required_device<address_map_bank_device> m_bank1;
|
||||
required_device<address_map_bank_device> m_bank2;
|
||||
required_device<address_map_bank_device> m_bank3;
|
||||
required_device<ay3600_device> m_ay3600;
|
||||
required_device<speaker_sound_device> m_speaker;
|
||||
required_device<sn76489_device> m_sn;
|
||||
required_ioport m_kbspecial;
|
||||
|
||||
READ8_MEMBER( ram_r );
|
||||
WRITE8_MEMBER( ram_w );
|
||||
@ -65,18 +95,34 @@ public:
|
||||
WRITE8_MEMBER( io_w );
|
||||
READ8_MEMBER( io2_r );
|
||||
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
DECLARE_PALETTE_INIT(laser3k);
|
||||
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void text_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 dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
|
||||
|
||||
DECLARE_READ_LINE_MEMBER(ay3600_shift_r);
|
||||
DECLARE_READ_LINE_MEMBER(ay3600_control_r);
|
||||
DECLARE_WRITE_LINE_MEMBER(ay3600_data_ready_w);
|
||||
|
||||
private:
|
||||
UINT8 m_bank0val, m_bank1val, m_bank2val, m_bank3val;
|
||||
int m_flash;
|
||||
int m_speaker_state;
|
||||
int m_disp_page;
|
||||
int m_bg_color;
|
||||
int m_bg_color, m_fg_color, m_border_color;
|
||||
UINT16 m_lastchar, m_strobe;
|
||||
UINT8 m_transchar;
|
||||
bool m_80col;
|
||||
bool m_mix;
|
||||
int m_gfxmode;
|
||||
UINT16 *m_hires_artifact_map;
|
||||
UINT16 *m_dhires_artifact_map;
|
||||
|
||||
void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen);
|
||||
void do_io(int offset);
|
||||
};
|
||||
|
||||
/***************************************************************************
|
||||
@ -98,6 +144,61 @@ static ADDRESS_MAP_START( banks_map, AS_PROGRAM, 8, laser3k_state )
|
||||
AM_RANGE(0x3c200, 0x3ffff) AM_ROM AM_REGION("maincpu", 0x4200)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
void laser3k_state::machine_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
|
||||
};
|
||||
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);
|
||||
|
||||
/* 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) % 8];
|
||||
m_hires_artifact_map[16 + j*8 + i] = hires_artifact_color_table[(c + 4) % 8];
|
||||
}
|
||||
}
|
||||
|
||||
/* build double hires artifact map */
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
m_dhires_artifact_map[i] = dhires_artifact_color_table[i];
|
||||
}
|
||||
}
|
||||
|
||||
void laser3k_state::machine_reset()
|
||||
{
|
||||
m_bank0val = 0;
|
||||
@ -117,6 +218,14 @@ void laser3k_state::machine_reset()
|
||||
m_speaker_state = 0;
|
||||
m_disp_page = 0;
|
||||
m_bg_color = 0;
|
||||
m_fg_color = 15;
|
||||
m_border_color = 0;
|
||||
m_strobe = 0;
|
||||
m_transchar = 0;
|
||||
m_lastchar = 0;
|
||||
m_80col = 0;
|
||||
m_mix = false;
|
||||
m_gfxmode = TEXT;
|
||||
|
||||
UINT8 *rom = (UINT8 *)memregion("maincpu")->base();
|
||||
|
||||
@ -134,18 +243,35 @@ WRITE8_MEMBER( laser3k_state::ram_w )
|
||||
m_ram->write(offset, data);
|
||||
}
|
||||
|
||||
READ8_MEMBER( laser3k_state::io_r )
|
||||
// most softswitches don't care about read vs write, so handle them here
|
||||
void laser3k_state::do_io(int offset)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
case 0x00: // keyboard latch
|
||||
return 0x00;
|
||||
|
||||
case 0x08: // set border color to black
|
||||
m_border_color = 0;
|
||||
break;
|
||||
case 0x09: // set border color to red
|
||||
m_border_color = 1;
|
||||
break;
|
||||
case 0x0a: // set border color to green
|
||||
m_border_color = 12;
|
||||
break;
|
||||
case 0x0b: // set border color to yellow
|
||||
m_border_color = 13;
|
||||
break;
|
||||
case 0x0c: // set border color to blue
|
||||
m_border_color = 6;
|
||||
break;
|
||||
case 0x0d: // set border color to magenta
|
||||
m_border_color = 3;
|
||||
break;
|
||||
case 0x0e: // set border color to cyan
|
||||
m_border_color = 14;
|
||||
break;
|
||||
case 0x0f: // set border color to white
|
||||
m_border_color = 15;
|
||||
break;
|
||||
|
||||
case 0x10: // keyboard strobe
|
||||
return 0x00;
|
||||
|
||||
case 0x18: // set bg color to black
|
||||
m_bg_color = 0;
|
||||
@ -172,10 +298,29 @@ READ8_MEMBER( laser3k_state::io_r )
|
||||
m_bg_color = 15;
|
||||
break;
|
||||
|
||||
case 0x28: // "enable multi-color mode" - not sure what this means
|
||||
case 0x28: // set fg color to normal
|
||||
m_fg_color = 15;
|
||||
break;
|
||||
|
||||
case 0x4c: // low resolution (40 column)
|
||||
case 0x29: // set fg color to red
|
||||
m_fg_color = 1;
|
||||
break;
|
||||
case 0x2a: // set fg color to green
|
||||
m_fg_color = 12;
|
||||
break;
|
||||
case 0x2b: // set fg color to yellow
|
||||
m_fg_color = 13;
|
||||
break;
|
||||
case 0x2c: // set fg color to blue
|
||||
m_fg_color = 6;
|
||||
break;
|
||||
case 0x2d: // set fg color to magenta
|
||||
m_fg_color = 3;
|
||||
break;
|
||||
case 0x2e: // set fg color to cyan
|
||||
m_fg_color = 14;
|
||||
break;
|
||||
case 0x2f: // set fg color to white
|
||||
m_fg_color = 15;
|
||||
break;
|
||||
|
||||
case 0x30:
|
||||
@ -183,7 +328,40 @@ READ8_MEMBER( laser3k_state::io_r )
|
||||
m_speaker->level_w(m_speaker_state);
|
||||
break;
|
||||
|
||||
case 0x4c: // low resolution (40 column)
|
||||
m_80col = false;
|
||||
m_maincpu->set_unscaled_clock(1021800);
|
||||
break;
|
||||
|
||||
case 0x4d: // RGB mode
|
||||
m_gfxmode = RGB;
|
||||
break;
|
||||
|
||||
case 0x4e: // double hi-res
|
||||
m_80col = true;
|
||||
m_gfxmode = DHIRES;
|
||||
m_maincpu->set_unscaled_clock(1021800*2);
|
||||
break;
|
||||
|
||||
case 0x4f: // high resolution (80 column). Yes, the CPU clock also doubles when the pixel clock does (!)
|
||||
m_80col = true;
|
||||
m_maincpu->set_unscaled_clock(1021800*2);
|
||||
break;
|
||||
|
||||
case 0x50: // graphics mode
|
||||
m_gfxmode = HIRES;
|
||||
break;
|
||||
|
||||
case 0x51: // text mode
|
||||
m_gfxmode = TEXT;
|
||||
break;
|
||||
|
||||
case 0x52: // no mix
|
||||
m_mix = false;
|
||||
break;
|
||||
|
||||
case 0x53: // mixed mode
|
||||
m_mix = true;
|
||||
break;
|
||||
|
||||
case 0x54: // set page 1
|
||||
@ -197,6 +375,27 @@ READ8_MEMBER( laser3k_state::io_r )
|
||||
case 0x56: // disable emulation (?)
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("do_io: unknown softswitch @ %x\n", offset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
READ8_MEMBER( laser3k_state::io_r )
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
case 0x00: // keyboard latch
|
||||
return m_transchar | m_strobe;
|
||||
|
||||
case 0x10: // keyboard strobe
|
||||
{
|
||||
UINT8 rv = m_transchar | m_strobe;
|
||||
m_strobe = 0;
|
||||
return rv;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x7c:
|
||||
return m_bank0val;
|
||||
|
||||
@ -210,7 +409,7 @@ READ8_MEMBER( laser3k_state::io_r )
|
||||
return m_bank3val;
|
||||
|
||||
default:
|
||||
printf("io_r @ unknown %x\n", offset);
|
||||
do_io(offset);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -222,14 +421,7 @@ WRITE8_MEMBER( laser3k_state::io_w )
|
||||
switch (offset)
|
||||
{
|
||||
case 0x10: // clear keyboard latch
|
||||
break;
|
||||
|
||||
case 0x30: // speaker toggle sound
|
||||
m_speaker_state ^= 1;
|
||||
m_speaker->level_w(m_speaker_state);
|
||||
break;
|
||||
|
||||
case 0x4c: // low resolution
|
||||
m_strobe = 0;
|
||||
break;
|
||||
|
||||
case 0x68: // SN76489 sound
|
||||
@ -240,27 +432,27 @@ WRITE8_MEMBER( laser3k_state::io_w )
|
||||
break;
|
||||
|
||||
case 0x7c: // bank 0
|
||||
m_bank0val = data;
|
||||
m_bank0val = data & 0xf;
|
||||
m_bank0->set_bank(m_bank0val);
|
||||
break;
|
||||
|
||||
case 0x7d: // bank 1
|
||||
m_bank1val = data;
|
||||
m_bank1val = data & 0xf;
|
||||
m_bank1->set_bank(m_bank1val);
|
||||
break;
|
||||
|
||||
case 0x7e: // bank 2
|
||||
m_bank2val = data;
|
||||
m_bank2val = data & 0xf;
|
||||
m_bank2->set_bank(m_bank2val);
|
||||
break;
|
||||
|
||||
case 0x7f: // bank 3
|
||||
m_bank3val = data;
|
||||
m_bank3val = data & 0xf;
|
||||
m_bank3->set_bank(m_bank3val);
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("io_w %02x @ unknown %x\n", data, offset);
|
||||
do_io(offset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -290,7 +482,7 @@ void laser3k_state::plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos
|
||||
const UINT8 *textgfx_data, UINT32 textgfx_datalen)
|
||||
{
|
||||
int x, y, i;
|
||||
int fg = 15;
|
||||
int fg = m_fg_color;
|
||||
int bg = m_bg_color;
|
||||
const UINT8 *chardata;
|
||||
UINT16 color;
|
||||
@ -320,13 +512,21 @@ void laser3k_state::plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos
|
||||
}
|
||||
}
|
||||
|
||||
UINT32 laser3k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
void laser3k_state::text_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
|
||||
{
|
||||
int row, col;
|
||||
UINT32 start_address = (m_disp_page == 0) ? 0x400 : 0x800;
|
||||
UINT32 start_address;
|
||||
UINT32 address;
|
||||
UINT8 *m_a2_videoram = m_ram->pointer();
|
||||
int beginrow = 0, endrow = 191;
|
||||
|
||||
if (m_80col)
|
||||
{
|
||||
start_address = (m_disp_page == 0) ? 0x1000 : 0x1800;
|
||||
}
|
||||
else
|
||||
{
|
||||
start_address = (m_disp_page == 0) ? 0x400 : 0x800;
|
||||
}
|
||||
|
||||
m_flash = ((machine().time() * 4).seconds & 1) ? 1 : 0;
|
||||
|
||||
@ -334,20 +534,278 @@ UINT32 laser3k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
|
||||
endrow = MIN(endrow, cliprect.max_y - (cliprect.max_y % 8) + 7);
|
||||
|
||||
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 * 7, row, 1, m_a2_videoram[address],
|
||||
memregion("gfx1")->base(), memregion("gfx1")->bytes());
|
||||
plot_text_character(bitmap, (col + 40) * 7, row, 1, m_a2_videoram[address+0x400],
|
||||
memregion("gfx1")->base(), memregion("gfx1")->bytes());
|
||||
}
|
||||
}
|
||||
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_a2_videoram[address],
|
||||
memregion("gfx1")->base(), memregion("gfx1")->bytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void laser3k_state::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;
|
||||
|
||||
/* 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->pointer() + (m_disp_page ? 0x4000 : 0x2000);
|
||||
|
||||
vram_row[0] = 0;
|
||||
vram_row[41] = 0;
|
||||
|
||||
for (row = beginrow; row <= endrow; row++)
|
||||
{
|
||||
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_a2_videoram[address],
|
||||
memregion("gfx1")->base(), memregion("gfx1")->bytes());
|
||||
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);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void laser3k_state::dhgr_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[82];
|
||||
UINT16 v;
|
||||
UINT16 *p;
|
||||
UINT32 w;
|
||||
|
||||
/* 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->pointer() + (m_disp_page ? 0x8000 : 0x4000);
|
||||
|
||||
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);
|
||||
if (col < 40)
|
||||
{
|
||||
vram_row[1+(col*2)+0] = vram[offset];
|
||||
vram_row[1+(col*2)+1] = vram[offset+1];
|
||||
}
|
||||
else
|
||||
{
|
||||
vram_row[1+(col*2)+0] = vram[offset+0x2000];
|
||||
vram_row[1+(col*2)+1] = vram[offset+0x2001];
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UINT32 laser3k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
switch (m_gfxmode)
|
||||
{
|
||||
case TEXT:
|
||||
text_update(screen, bitmap, cliprect, 0, 191);
|
||||
break;
|
||||
|
||||
case HIRES:
|
||||
if (m_mix)
|
||||
{
|
||||
hgr_update(screen, bitmap, cliprect, 0, 159);
|
||||
text_update(screen, bitmap, cliprect, 160, 191);
|
||||
}
|
||||
else
|
||||
{
|
||||
hgr_update(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
break;
|
||||
|
||||
case RGB:
|
||||
break;
|
||||
|
||||
case DHIRES:
|
||||
if (m_mix)
|
||||
{
|
||||
dhgr_update(screen, bitmap, cliprect, 0, 159);
|
||||
text_update(screen, bitmap, cliprect, 160, 191);
|
||||
}
|
||||
else
|
||||
{
|
||||
dhgr_update(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER(laser3k_state::ay3600_shift_r)
|
||||
{
|
||||
// either shift key
|
||||
if (m_kbspecial->read() & 0x06)
|
||||
{
|
||||
return ASSERT_LINE;
|
||||
}
|
||||
|
||||
return CLEAR_LINE;
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER(laser3k_state::ay3600_control_r)
|
||||
{
|
||||
if (m_kbspecial->read() & 0x08)
|
||||
{
|
||||
return ASSERT_LINE;
|
||||
}
|
||||
|
||||
return CLEAR_LINE;
|
||||
}
|
||||
|
||||
static const UINT8 key_remap[0x32][4] =
|
||||
{
|
||||
/* norm shft ctrl both */
|
||||
{ 0x33,0x23,0x33,0x23 }, /* 3 # 00 */
|
||||
{ 0x34,0x24,0x34,0x24 }, /* 4 $ 01 */
|
||||
{ 0x35,0x25,0x35,0x25 }, /* 5 % 02 */
|
||||
{ 0x36,0x5e,0x35,0x53 }, /* 6 ^ 03 */
|
||||
{ 0x37,0x26,0x37,0x26 }, /* 7 & 04 */
|
||||
{ 0x38,0x2a,0x38,0x2a }, /* 8 * 05 */
|
||||
{ 0x39,0x28,0x39,0x28 }, /* 9 ( 06 */
|
||||
{ 0x30,0x29,0x30,0x29 }, /* 0 ) 07 */
|
||||
{ 0x3b,0x3a,0x3b,0x3a }, /* ; : 08 */
|
||||
{ 0x2d,0x5f,0x2d,0x1f }, /* - _ 09 */
|
||||
{ 0x51,0x51,0x11,0x11 }, /* q Q 0a */
|
||||
{ 0x57,0x57,0x17,0x17 }, /* w W 0b */
|
||||
{ 0x45,0x45,0x05,0x05 }, /* e E 0c */
|
||||
{ 0x52,0x52,0x12,0x12 }, /* r R 0d */
|
||||
{ 0x54,0x54,0x14,0x14 }, /* t T 0e */
|
||||
{ 0x59,0x59,0x19,0x19 }, /* y Y 0f */
|
||||
{ 0x55,0x55,0x15,0x15 }, /* u U 10 */
|
||||
{ 0x49,0x49,0x09,0x09 }, /* i I 11 */
|
||||
{ 0x4f,0x4f,0x0f,0x0f }, /* o O 12 */
|
||||
{ 0x50,0x50,0x10,0x10 }, /* p P 13 */
|
||||
{ 0x44,0x44,0x04,0x04 }, /* d D 14 */
|
||||
{ 0x46,0x46,0x06,0x06 }, /* f F 15 */
|
||||
{ 0x47,0x47,0x07,0x07 }, /* g G 16 */
|
||||
{ 0x48,0x48,0x08,0x08 }, /* h H 17 */
|
||||
{ 0x4a,0x4a,0x0a,0x0a }, /* j J 18 */
|
||||
{ 0x4b,0x4b,0x0b,0x0b }, /* k K 19 */
|
||||
{ 0x4c,0x4c,0x0c,0x0c }, /* l L 1a */
|
||||
{ 0x3d,0x2b,0x3d,0x2b }, /* = + 1b */
|
||||
{ 0x08,0x08,0x08,0x08 }, /* Left 1c */
|
||||
{ 0x15,0x15,0x15,0x15 }, /* Right 1d */
|
||||
{ 0x5a,0x5a,0x1a,0x1a }, /* z Z 1e */
|
||||
{ 0x58,0x58,0x18,0x18 }, /* x X 1f */
|
||||
{ 0x43,0x43,0x03,0x03 }, /* c C 20 */
|
||||
{ 0x56,0x56,0x16,0x16 }, /* v V 21 */
|
||||
{ 0x42,0x42,0x02,0x02 }, /* b B 22 */
|
||||
{ 0x4e,0x4e,0x0e,0x0e }, /* n N 23 */
|
||||
{ 0x4d,0x4d,0x0d,0x0d }, /* m M 24 */
|
||||
{ 0x2c,0x3c,0x2c,0x3c }, /* , < 25 */
|
||||
{ 0x2e,0x3e,0x2e,0x3e }, /* . > 26 */
|
||||
{ 0x2f,0x3f,0x2f,0x3f }, /* / ? 27 */
|
||||
{ 0x53,0x53,0x13,0x13 }, /* s S 28 */
|
||||
{ 0x32,0x40,0x32,0x00 }, /* 2 @ 29 */
|
||||
{ 0x31,0x21,0x31,0x31 }, /* 1 ! 2a */
|
||||
{ 0x9b,0x9b,0x9b,0x9b }, /* Escape 2b */
|
||||
{ 0x41,0x41,0x01,0x01 }, /* a A 2c */
|
||||
{ 0x20,0x20,0x20,0x20 }, /* Space 2d */
|
||||
{ 0x27,0x22,0x27,0x22 }, /* ' " 2e */
|
||||
{ 0x00,0x00,0x00,0x00 }, /* 0x2f unused */
|
||||
{ 0x00,0x00,0x00,0x00 }, /* 0x30 unused */
|
||||
{ 0x0d,0x0d,0x0d,0x0d }, /* Enter 31 */
|
||||
};
|
||||
|
||||
WRITE_LINE_MEMBER(laser3k_state::ay3600_data_ready_w)
|
||||
{
|
||||
if (state == ASSERT_LINE)
|
||||
{
|
||||
int mod = 0;
|
||||
m_lastchar = m_ay3600->b_r();
|
||||
|
||||
mod = (m_kbspecial->read() & 0x06) ? 0x01 : 0x00;
|
||||
mod |= (m_kbspecial->read() & 0x08) ? 0x02 : 0x00;
|
||||
|
||||
// printf("lastchar = %02x\n", m_lastchar & 0x3f);
|
||||
|
||||
m_transchar = key_remap[m_lastchar&0x3f][mod];
|
||||
|
||||
if (m_transchar != 0)
|
||||
{
|
||||
m_strobe = 0x80;
|
||||
// printf("new char = %04x (%02x)\n", m_lastchar&0x3f, m_transchar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
INPUT PORTS
|
||||
***************************************************************************/
|
||||
@ -408,7 +866,7 @@ static INPUT_PORTS_START( laser3k )
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
|
||||
@ -540,6 +998,21 @@ static MACHINE_CONFIG_START( laser3k, laser3k_state )
|
||||
MCFG_RAM_ADD("mainram")
|
||||
MCFG_RAM_DEFAULT_SIZE("192K")
|
||||
|
||||
/* the 8048 isn't dumped, so substitute modified real Apple II h/w */
|
||||
MCFG_DEVICE_ADD("ay3600", AY3600, 0)
|
||||
MCFG_AY3600_MATRIX_X0(IOPORT("X0"))
|
||||
MCFG_AY3600_MATRIX_X1(IOPORT("X1"))
|
||||
MCFG_AY3600_MATRIX_X2(IOPORT("X2"))
|
||||
MCFG_AY3600_MATRIX_X3(IOPORT("X3"))
|
||||
MCFG_AY3600_MATRIX_X4(IOPORT("X4"))
|
||||
MCFG_AY3600_MATRIX_X5(IOPORT("X5"))
|
||||
MCFG_AY3600_MATRIX_X6(IOPORT("X6"))
|
||||
MCFG_AY3600_MATRIX_X7(IOPORT("X7"))
|
||||
MCFG_AY3600_MATRIX_X8(IOPORT("X8"))
|
||||
MCFG_AY3600_SHIFT_CB(READLINE(laser3k_state, ay3600_shift_r))
|
||||
MCFG_AY3600_CONTROL_CB(READLINE(laser3k_state, ay3600_control_r))
|
||||
MCFG_AY3600_DATA_READY_CB(WRITELINE(laser3k_state, ay3600_data_ready_w))
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user