mirror of
https://github.com/holub/mame
synced 2025-06-06 12:53:46 +03:00
(MESS) pet2001: Rewrote the PET 2001 series. [Curt Coder]
This commit is contained in:
parent
fa364e9f4e
commit
daea35e7d5
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -6139,6 +6139,7 @@ src/mess/drivers/pencil2.c svneol=native#text/plain
|
||||
src/mess/drivers/pentagon.c svneol=native#text/plain
|
||||
src/mess/drivers/pes.c svneol=native#text/plain
|
||||
src/mess/drivers/pet.c svneol=native#text/plain
|
||||
src/mess/drivers/pet2001.c svneol=native#text/plain
|
||||
src/mess/drivers/phc25.c svneol=native#text/plain
|
||||
src/mess/drivers/phunsy.c svneol=native#text/plain
|
||||
src/mess/drivers/pimps.c svneol=native#text/plain
|
||||
@ -6496,6 +6497,7 @@ src/mess/includes/pdp1.h svneol=native#text/plain
|
||||
src/mess/includes/pecom.h svneol=native#text/plain
|
||||
src/mess/includes/pes.h svneol=native#text/plain
|
||||
src/mess/includes/pet.h svneol=native#text/plain
|
||||
src/mess/includes/pet2001.h svneol=native#text/plain
|
||||
src/mess/includes/phc25.h svneol=native#text/plain
|
||||
src/mess/includes/pk8020.h svneol=native#text/plain
|
||||
src/mess/includes/plus4.h svneol=native#text/plain
|
||||
|
@ -730,7 +730,7 @@ MACHINE_CONFIG_END
|
||||
static MACHINE_CONFIG_DERIVED( petb, pet )
|
||||
MCFG_PIA6821_MODIFY( "pia_0", petb_pia0 )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
#if 0
|
||||
static MACHINE_CONFIG_DERIVED( pet2001, pet_general )
|
||||
MCFG_QUICKLOAD_ADD("quickload", cbm_pet1, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
|
||||
MCFG_FRAGMENT_ADD(pet_cartslot)
|
||||
@ -743,7 +743,7 @@ static MACHINE_CONFIG_DERIVED( pet2001, pet_general )
|
||||
/* IEEE bus */
|
||||
MCFG_CBM_IEEE488_ADD(ieee488_intf, "c4040")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
#endif
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( pet40, pet )
|
||||
MCFG_CPU_MODIFY( "maincpu" )
|
||||
@ -1162,9 +1162,6 @@ ROM_END
|
||||
|
||||
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */
|
||||
|
||||
COMP(1977, pet2001, 0, 0, pet2001, pet, pet_state, pet2001, "Commodore Business Machines", "PET 2001", GAME_NOT_WORKING | GAME_NO_SOUND)
|
||||
COMP(1979, pet2001n, pet2001, 0, pet, pet, pet_state, pet, "Commodore Business Machines", "PET 2001-N", GAME_NOT_WORKING | GAME_NO_SOUND)
|
||||
COMP(1979, pet2001b, pet2001, 0, petb, petb, pet_state, pet, "Commodore Business Machines", "PET 2001-B", GAME_NOT_WORKING | GAME_NO_SOUND)
|
||||
COMP(1979, cbm30, pet2001, 0, pet, pet, pet_state, pet, "Commodore Business Machines", "CBM 30xx", GAME_NOT_WORKING | GAME_NO_SOUND)
|
||||
COMP(1979, cbm30b, pet2001, 0, petb, petb, pet_state, pet, "Commodore Business Machines", "CBM 30xx (Business keyboard)", GAME_NOT_WORKING | GAME_NO_SOUND)
|
||||
COMP(1979, cbm30nor, pet2001, 0, petb, petb, pet_state, pet, "Commodore Business Machines", "CBM 30xx (Norway, Business keyboard)", GAME_NOT_WORKING | GAME_NO_SOUND)
|
||||
|
958
src/mess/drivers/pet2001.c
Normal file
958
src/mess/drivers/pet2001.c
Normal file
@ -0,0 +1,958 @@
|
||||
/*
|
||||
|
||||
TODO:
|
||||
|
||||
- cursor
|
||||
- accurate video timings
|
||||
- user port
|
||||
- memory expansion port
|
||||
|
||||
*/
|
||||
|
||||
#include "includes/pet2001.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INTERRUPTS
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// check_interrupts -
|
||||
//-------------------------------------------------
|
||||
|
||||
void pet2001_state::check_interrupts()
|
||||
{
|
||||
int irq = m_via_irq || m_pia1a_irq || m_pia1b_irq || m_pia2a_irq || m_pia2b_irq || m_exp_irq;
|
||||
|
||||
m_maincpu->set_input_line(M6502_IRQ_LINE, irq);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// read -
|
||||
//-------------------------------------------------
|
||||
|
||||
READ8_MEMBER( pet2001_state::read )
|
||||
{
|
||||
UINT8 data = 0;
|
||||
|
||||
switch (offset >> 12)
|
||||
{
|
||||
case SEL0:
|
||||
case SEL1:
|
||||
case SEL2:
|
||||
case SEL3:
|
||||
case SEL4:
|
||||
case SEL5:
|
||||
case SEL6:
|
||||
case SEL7:
|
||||
if (offset < m_ram->size())
|
||||
{
|
||||
data = m_ram->pointer()[offset];
|
||||
}
|
||||
break;
|
||||
|
||||
case SEL8:
|
||||
data = m_video_ram[offset & 0x3ff];
|
||||
break;
|
||||
|
||||
case SELE:
|
||||
if (BIT(offset, 11))
|
||||
{
|
||||
if (BIT(offset, 4))
|
||||
{
|
||||
data = m_pia1->read(space, offset & 0x03);
|
||||
}
|
||||
if (BIT(offset, 5))
|
||||
{
|
||||
data = m_pia2->read(space, offset & 0x03);
|
||||
}
|
||||
if (BIT(offset, 6))
|
||||
{
|
||||
data = m_via->read(space, offset & 0x0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
data = m_rom->base()[offset & 0x3fff];
|
||||
}
|
||||
break;
|
||||
|
||||
case SELC:
|
||||
case SELD:
|
||||
case SELF:
|
||||
data = m_rom->base()[offset & 0x3fff];
|
||||
break;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write -
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER( pet2001_state::write )
|
||||
{
|
||||
switch (offset >> 12)
|
||||
{
|
||||
case SEL0:
|
||||
case SEL1:
|
||||
case SEL2:
|
||||
case SEL3:
|
||||
case SEL4:
|
||||
case SEL5:
|
||||
case SEL6:
|
||||
case SEL7:
|
||||
if (offset < m_ram->size())
|
||||
{
|
||||
m_ram->pointer()[offset] = data;
|
||||
}
|
||||
break;
|
||||
|
||||
case SEL8:
|
||||
m_video_ram[offset & 0x3ff] = data;
|
||||
break;
|
||||
|
||||
case SELE:
|
||||
if (BIT(offset, 11))
|
||||
{
|
||||
if (BIT(offset, 4))
|
||||
{
|
||||
m_pia1->write(space, offset & 0x03, data);
|
||||
}
|
||||
if (BIT(offset, 5))
|
||||
{
|
||||
m_pia2->write(space, offset & 0x03, data);
|
||||
}
|
||||
if (BIT(offset, 6))
|
||||
{
|
||||
m_via->write(space, offset & 0x0f, data);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// ADDRESS MAPS
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// ADDRESS_MAP( pet2001_mem )
|
||||
//-------------------------------------------------
|
||||
|
||||
static ADDRESS_MAP_START( pet2001_mem, AS_PROGRAM, 8, pet2001_state )
|
||||
AM_RANGE(0x0000, 0xffff) AM_READWRITE(read, write)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INPUT PORTS
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// INPUT_PORTS( pet )
|
||||
//-------------------------------------------------
|
||||
|
||||
static INPUT_PORTS_START( pet )
|
||||
PORT_START( "ROW0" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Crsr Right Left") PORT_CODE(KEYCODE_PGDN) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Home Clr Screen") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME))
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x86\x90") PORT_CODE(KEYCODE_MINUS) PORT_CHAR(0x2190)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('(')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('&')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('%')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('#')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('!')
|
||||
|
||||
PORT_START( "ROW1" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Del Inst") PORT_CODE(KEYCODE_DEL) PORT_CHAR(8) PORT_CHAR(UCHAR_MAMEKEY(INSERT))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Crsr Down Up") PORT_CODE(KEYCODE_PGUP) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CHAR(UCHAR_MAMEKEY(UP))
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR(')')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('\\')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('\'')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('$')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('"')
|
||||
|
||||
PORT_START( "ROW2" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR('9')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x86\x91 Pi") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR(0x2191) PORT_CHAR(0x03C0)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
|
||||
|
||||
PORT_START( "ROW3" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHAR('/')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('8')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
|
||||
|
||||
PORT_START( "ROW4" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('6')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR('4')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
|
||||
|
||||
PORT_START( "ROW5" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('*')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR('5')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S')
|
||||
|
||||
PORT_START( "ROW6" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR('3')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR(';')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
|
||||
|
||||
PORT_START( "ROW7" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR('+')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('2')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('?')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
|
||||
|
||||
PORT_START( "ROW8" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR('-')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR('0')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift (Right)") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('>')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(']')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('@')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift (Left)") PORT_CODE(KEYCODE_LSHIFT)
|
||||
|
||||
PORT_START( "ROW9" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad =") PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR('=')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR('.')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Stop Run") PORT_CODE(KEYCODE_QUOTE)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('<')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('[')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Rvs Off") PORT_CODE(KEYCODE_TAB)
|
||||
|
||||
PORT_START( "LOCK" )
|
||||
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// INPUT_PORTS( petb )
|
||||
//-------------------------------------------------
|
||||
|
||||
INPUT_PORTS_START( petb )
|
||||
PORT_START( "ROW0" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Crsr Right Left") PORT_CODE(KEYCODE_PGUP) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD))
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('-') PORT_CHAR('=')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('\\')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"')
|
||||
|
||||
PORT_START( "ROW1" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x86\x91") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(0x2191)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD))
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD))
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
|
||||
|
||||
PORT_START( "ROW2" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC))
|
||||
|
||||
PORT_START( "ROW3" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('@')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
|
||||
|
||||
PORT_START( "ROW4" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Del Inst") PORT_CODE(KEYCODE_DEL) PORT_CHAR(8) PORT_CHAR(UCHAR_MAMEKEY(INSERT))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('\\')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t')
|
||||
|
||||
PORT_START( "ROW5" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Crsr Down Up") PORT_CODE(KEYCODE_PGDN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CHAR(UCHAR_MAMEKEY(UP))
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
|
||||
|
||||
PORT_START( "ROW6" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift (Right)") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD))
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift (Left)") PORT_CODE(KEYCODE_LSHIFT)
|
||||
|
||||
PORT_START( "ROW7" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Repeat") PORT_CODE(KEYCODE_LALT)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
|
||||
|
||||
PORT_START( "ROW8" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Home Clr Screen") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME))
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Rvs Off") PORT_CODE(KEYCODE_INSERT)
|
||||
|
||||
PORT_START( "ROW9" )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR(':') PORT_CHAR('*')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Stop Run") PORT_CODE(KEYCODE_END)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('\'')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x86\x90") PORT_CODE(KEYCODE_TILDE) PORT_CHAR(0x2190)
|
||||
|
||||
PORT_START( "LOCK" )
|
||||
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE CONFIGURATION
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// via6522_interface via_intf
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER( pet2001_state::via_irq_w )
|
||||
{
|
||||
m_via_irq = state;
|
||||
|
||||
check_interrupts();
|
||||
}
|
||||
|
||||
READ8_MEMBER( pet2001_state::via_pb_r )
|
||||
{
|
||||
/*
|
||||
|
||||
bit description
|
||||
|
||||
PB0 _NDAC IN
|
||||
PB1
|
||||
PB2
|
||||
PB3
|
||||
PB4
|
||||
PB5 SYNC IN
|
||||
PB6 _NRFD IN
|
||||
PB7 _DAV IN
|
||||
|
||||
*/
|
||||
|
||||
UINT8 data = 0;
|
||||
|
||||
// video sync
|
||||
data |= m_sync << 5;
|
||||
|
||||
// IEEE-488
|
||||
data |= m_ieee->ndac_r();
|
||||
data |= m_ieee->nrfd_r() << 6;
|
||||
data |= m_ieee->dav_r() << 7;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( pet2001_state::via_pb_w )
|
||||
{
|
||||
/*
|
||||
|
||||
bit description
|
||||
|
||||
PB0
|
||||
PB1 _NRFD OUT
|
||||
PB2 _ATN OUT
|
||||
PB3 CASS WRITE
|
||||
PB4 #2 CASS MOTOR
|
||||
PB5
|
||||
PB6
|
||||
PB7
|
||||
|
||||
*/
|
||||
|
||||
// IEEE-488
|
||||
m_ieee->nrfd_w(BIT(data, 1));
|
||||
m_ieee->atn_w(BIT(data, 2));
|
||||
|
||||
// cassette
|
||||
m_cassette->write(BIT(data, 3));
|
||||
m_cassette2->write(BIT(data, 3));
|
||||
m_cassette2->motor_w(BIT(data, 4));
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( pet2001_state::via_ca2_w )
|
||||
{
|
||||
m_graphic = state;
|
||||
}
|
||||
|
||||
const via6522_interface via_intf =
|
||||
{
|
||||
DEVCB_NULL,//DEVCB_DEVICE_MEMBER(PET_USER_PORT_TAG, pet_user_port_device, pa_r),
|
||||
DEVCB_DRIVER_MEMBER(pet2001_state, via_pb_r),
|
||||
DEVCB_NULL,
|
||||
DEVCB_DEVICE_LINE_MEMBER(PET_DATASSETTE_PORT2_TAG, pet_datassette_port_device, read),
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,//DEVCB_DEVICE_MEMBER(PET_USER_PORT_TAG, pet_user_port_device, pa_w),
|
||||
DEVCB_DRIVER_MEMBER(pet2001_state, via_pb_w),
|
||||
DEVCB_NULL,//DEVCB_DEVICE_LINE_MEMBER(PET_USER_PORT_TAG, pet_user_port_device, ca1_w),
|
||||
DEVCB_DRIVER_LINE_MEMBER(pet2001_state, via_ca2_w),
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,//DEVCB_DEVICE_LINE_MEMBER(PET_USER_PORT_TAG, pet_user_port_device, cb2_w),
|
||||
DEVCB_DRIVER_LINE_MEMBER(pet2001_state, via_irq_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// pia6821_interface pia1_intf
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER( pet2001_state::pia1_irqa_w )
|
||||
{
|
||||
m_pia1a_irq = state;
|
||||
|
||||
check_interrupts();
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( pet2001_state::pia1_irqb_w )
|
||||
{
|
||||
m_pia1b_irq = state;
|
||||
|
||||
check_interrupts();
|
||||
}
|
||||
|
||||
READ8_MEMBER( pet2001_state::pia1_pa_r )
|
||||
{
|
||||
/*
|
||||
|
||||
bit description
|
||||
|
||||
PA0 KEY A
|
||||
PA1 KEY B
|
||||
PA2 KEY C
|
||||
PA3 KEY D
|
||||
PA4 #1 CASS SWITCH
|
||||
PA5 #2 CASS SWITCH
|
||||
PA6 _EOI IN
|
||||
PA7 DIAG JUMPER
|
||||
|
||||
*/
|
||||
|
||||
UINT8 data = 0;
|
||||
|
||||
// keyboard
|
||||
data |= m_key;
|
||||
|
||||
// cassette
|
||||
data |= m_cassette->sense_r() << 4;
|
||||
data |= m_cassette2->sense_r() << 5;
|
||||
|
||||
// IEEE-488
|
||||
data |= m_ieee->eoi_r() << 6;
|
||||
|
||||
// diagnostic jumper
|
||||
data |= 0x80;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( pet2001_state::pia1_pa_w )
|
||||
{
|
||||
/*
|
||||
|
||||
bit description
|
||||
|
||||
PA0 KEY A
|
||||
PA1 KEY B
|
||||
PA2 KEY C
|
||||
PA3 KEY D
|
||||
PA4
|
||||
PA5
|
||||
PA6
|
||||
PA7
|
||||
|
||||
*/
|
||||
|
||||
// keyboard
|
||||
m_key = data & 0x0f;
|
||||
}
|
||||
|
||||
READ8_MEMBER( pet2001_state::pia1_pb_r )
|
||||
{
|
||||
UINT8 data = 0xff;
|
||||
|
||||
switch (m_key)
|
||||
{
|
||||
case 0: data &= m_row0->read(); break;
|
||||
case 1: data &= m_row1->read(); break;
|
||||
case 2: data &= m_row2->read(); break;
|
||||
case 3: data &= m_row3->read(); break;
|
||||
case 4: data &= m_row4->read(); break;
|
||||
case 5: data &= m_row5->read(); break;
|
||||
case 6: data &= m_row6->read(); break;
|
||||
case 7: data &= m_row7->read(); break;
|
||||
case 8: data &= m_row8->read() & m_lock->read(); break;
|
||||
case 9: data &= m_row9->read(); break;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
READ8_MEMBER( pet2001b_state::pia1_pb_r )
|
||||
{
|
||||
UINT8 data = 0xff;
|
||||
|
||||
switch (m_key)
|
||||
{
|
||||
case 0: data &= m_row0->read(); break;
|
||||
case 1: data &= m_row1->read(); break;
|
||||
case 2: data &= m_row2->read(); break;
|
||||
case 3: data &= m_row3->read(); break;
|
||||
case 4: data &= m_row4->read(); break;
|
||||
case 5: data &= m_row5->read(); break;
|
||||
case 6: data &= m_row6->read() & m_lock->read(); break;
|
||||
case 7: data &= m_row7->read(); break;
|
||||
case 8: data &= m_row8->read(); break;
|
||||
case 9: data &= m_row9->read(); break;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER( pet2001_state::pia1_cb1_r )
|
||||
{
|
||||
return m_sync;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( pet2001_state::pia1_ca2_w )
|
||||
{
|
||||
m_ieee->eoi_w(state);
|
||||
|
||||
m_blanktv = state;
|
||||
}
|
||||
|
||||
const pia6821_interface pia1_intf =
|
||||
{
|
||||
DEVCB_DRIVER_MEMBER(pet2001_state, pia1_pa_r),
|
||||
DEVCB_DRIVER_MEMBER(pet2001_state, pia1_pb_r),
|
||||
DEVCB_DEVICE_LINE_MEMBER(PET_DATASSETTE_PORT_TAG, pet_datassette_port_device, read),
|
||||
DEVCB_DRIVER_LINE_MEMBER(pet2001_state, pia1_cb1_r),
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_DRIVER_MEMBER(pet2001_state, pia1_pa_w),
|
||||
DEVCB_NULL,
|
||||
DEVCB_DRIVER_LINE_MEMBER(pet2001_state, pia1_ca2_w),
|
||||
DEVCB_DEVICE_LINE_MEMBER(PET_DATASSETTE_PORT_TAG, pet_datassette_port_device, motor_w),
|
||||
DEVCB_DRIVER_LINE_MEMBER(pet2001_state, pia1_irqa_w),
|
||||
DEVCB_DRIVER_LINE_MEMBER(pet2001_state, pia1_irqb_w)
|
||||
};
|
||||
|
||||
const pia6821_interface pet2001b_pia1_intf =
|
||||
{
|
||||
DEVCB_DRIVER_MEMBER(pet2001_state, pia1_pa_r),
|
||||
DEVCB_DRIVER_MEMBER(pet2001b_state, pia1_pb_r),
|
||||
DEVCB_DEVICE_LINE_MEMBER(PET_DATASSETTE_PORT_TAG, pet_datassette_port_device, read),
|
||||
DEVCB_DRIVER_LINE_MEMBER(pet2001_state, pia1_cb1_r),
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_DRIVER_MEMBER(pet2001_state, pia1_pa_w),
|
||||
DEVCB_NULL,
|
||||
DEVCB_DRIVER_LINE_MEMBER(pet2001_state, pia1_ca2_w),
|
||||
DEVCB_DEVICE_LINE_MEMBER(PET_DATASSETTE_PORT_TAG, pet_datassette_port_device, motor_w),
|
||||
DEVCB_DRIVER_LINE_MEMBER(pet2001_state, pia1_irqa_w),
|
||||
DEVCB_DRIVER_LINE_MEMBER(pet2001_state, pia1_irqb_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// pia6821_interface pia2_intf
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER( pet2001_state::pia2_irqa_w )
|
||||
{
|
||||
m_pia2a_irq = state;
|
||||
|
||||
check_interrupts();
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( pet2001_state::pia2_irqb_w )
|
||||
{
|
||||
m_pia2b_irq = state;
|
||||
|
||||
check_interrupts();
|
||||
}
|
||||
|
||||
const pia6821_interface pia2_intf =
|
||||
{
|
||||
DEVCB_DEVICE_MEMBER(IEEE488_TAG, ieee488_device, dio_r),
|
||||
DEVCB_NULL,
|
||||
DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, atn_r),
|
||||
DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, srq_r),
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_DEVICE_MEMBER(IEEE488_TAG, ieee488_device, dio_w),
|
||||
DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, ndac_w),
|
||||
DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, dav_w),
|
||||
DEVCB_DRIVER_LINE_MEMBER(pet2001_state, pia2_irqa_w),
|
||||
DEVCB_DRIVER_LINE_MEMBER(pet2001_state, pia2_irqb_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// IEEE488_INTERFACE( ieee488_intf )
|
||||
//-------------------------------------------------
|
||||
|
||||
static IEEE488_INTERFACE( ieee488_intf )
|
||||
{
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_DEVICE_LINE_MEMBER(M6520_2_TAG, pia6821_device, cb1_w),
|
||||
DEVCB_DEVICE_LINE_MEMBER(M6520_2_TAG, pia6821_device, ca1_w),
|
||||
DEVCB_NULL
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
|
||||
//-------------------------------------------------
|
||||
|
||||
static PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
|
||||
{
|
||||
DEVCB_DEVICE_LINE_MEMBER(M6520_1_TAG, pia6821_device, ca1_w)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// PET_DATASSETTE_PORT_INTERFACE( datassette2_intf )
|
||||
//-------------------------------------------------
|
||||
|
||||
static PET_DATASSETTE_PORT_INTERFACE( datassette2_intf )
|
||||
{
|
||||
DEVCB_DEVICE_LINE_MEMBER(M6522_TAG, via6522_device, write_cb1)
|
||||
};
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// VIDEO
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// TIMER_DEVICE_CALLBACK( sync_tick )
|
||||
//-------------------------------------------------
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER( pet2001_state::sync_tick )
|
||||
{
|
||||
m_sync = !m_sync;
|
||||
|
||||
m_pia1->cb1_w(m_sync);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SCREEN_UPDATE( pet2001 )
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT32 pet2001_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
for (int y = 0; y < 200; y++)
|
||||
{
|
||||
for (int sx = 0; sx < 40; sx++)
|
||||
{
|
||||
int sy = y / 8;
|
||||
offs_t video_addr = (sy * 40) + sx;
|
||||
UINT8 code = m_video_ram[video_addr];
|
||||
|
||||
int ra = y & 0x07;
|
||||
offs_t char_addr = (m_graphic << 10) | (code << 3) | ra;
|
||||
UINT8 data = m_char_rom->base()[char_addr];
|
||||
|
||||
for (int x = 0; x < 8; x++)
|
||||
{
|
||||
int color = BIT(data, 7);
|
||||
|
||||
bitmap.pix32(y, (sx * 8) + x) = RGB_MONOCHROME_GREEN[color];
|
||||
|
||||
data <<= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MACHINE INITIALIZATION
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_START( pet2001 )
|
||||
//-------------------------------------------------
|
||||
|
||||
void pet2001_state::machine_start()
|
||||
{
|
||||
// allocate memory
|
||||
m_video_ram.allocate(0x400);
|
||||
|
||||
// initialize memory
|
||||
UINT8 data = 0xff;
|
||||
|
||||
for (offs_t offset = 0; offset < m_ram->size(); offset++)
|
||||
{
|
||||
m_ram->pointer()[offset] = data;
|
||||
if (!(offset % 64)) data ^= 0xff;
|
||||
}
|
||||
|
||||
data = 0xff;
|
||||
|
||||
for (offs_t offset = 0; offset < 0x400; offset++)
|
||||
{
|
||||
m_video_ram[offset] = data;
|
||||
if (!(offset % 64)) data ^= 0xff;
|
||||
}
|
||||
|
||||
// state saving
|
||||
save_item(NAME(m_key));
|
||||
save_item(NAME(m_sync));
|
||||
save_item(NAME(m_graphic));
|
||||
save_item(NAME(m_blanktv));
|
||||
save_item(NAME(m_via_irq));
|
||||
save_item(NAME(m_pia1a_irq));
|
||||
save_item(NAME(m_pia1b_irq));
|
||||
save_item(NAME(m_pia2a_irq));
|
||||
save_item(NAME(m_pia2b_irq));
|
||||
save_item(NAME(m_exp_irq));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_RESET( pet2001 )
|
||||
//-------------------------------------------------
|
||||
|
||||
void pet2001_state::machine_reset()
|
||||
{
|
||||
m_maincpu->reset();
|
||||
|
||||
m_via->reset();
|
||||
m_pia1->reset();
|
||||
m_pia2->reset();
|
||||
//m_exp->reset();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MACHINE DRIVERS
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_CONFIG( pet2001 )
|
||||
//-------------------------------------------------
|
||||
|
||||
static MACHINE_CONFIG_START( pet2001, pet2001_state )
|
||||
// basic machine hardware
|
||||
MCFG_CPU_ADD(M6502_TAG, M6502, XTAL_8MHz/8)
|
||||
MCFG_CPU_PROGRAM_MAP(pet2001_mem)
|
||||
|
||||
// video hardware
|
||||
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
|
||||
MCFG_SCREEN_SIZE(320, 200)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(pet2001_state, screen_update)
|
||||
MCFG_TIMER_DRIVER_ADD_PERIODIC("sync_timer", pet2001_state, sync_tick, attotime::from_hz(120))
|
||||
|
||||
// devices
|
||||
MCFG_VIA6522_ADD(M6522_TAG, XTAL_8MHz/8, via_intf)
|
||||
MCFG_PIA6821_ADD(M6520_1_TAG, pia1_intf)
|
||||
MCFG_PIA6821_ADD(M6520_2_TAG, pia2_intf)
|
||||
MCFG_CBM_IEEE488_ADD(ieee488_intf, "c4040")
|
||||
MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c1530", NULL)
|
||||
MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT2_TAG, datassette2_intf, cbm_datassette_devices, NULL, NULL)
|
||||
//MCFG_QUICKLOAD_ADD("quickload", cbm_pet, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
|
||||
//MCFG_PET_EXPANSION_SLOT_ADD(PET_EXPANSION_SLOT_TAG, XTAL_8MHz/8, pet_expansion_cards, NULL, NULL)
|
||||
//MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, user_intf, pet_user_port_cards, NULL, NULL)
|
||||
|
||||
// internal RAM
|
||||
MCFG_RAM_ADD(RAM_TAG)
|
||||
MCFG_RAM_DEFAULT_SIZE("4K")
|
||||
MCFG_RAM_EXTRA_OPTIONS("8K")
|
||||
|
||||
// software lists
|
||||
MCFG_SOFTWARE_LIST_ADD("rom_list", "pet_rom")
|
||||
MCFG_SOFTWARE_LIST_ADD("flop_list", "pet_flop")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_CONFIG( pet2001n )
|
||||
//-------------------------------------------------
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( pet2001n, pet2001 )
|
||||
MCFG_RAM_MODIFY(RAM_TAG)
|
||||
MCFG_RAM_DEFAULT_SIZE("8K")
|
||||
MCFG_RAM_EXTRA_OPTIONS("16K,32K")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_CONFIG( pet2001b )
|
||||
//-------------------------------------------------
|
||||
|
||||
static MACHINE_CONFIG_DERIVED_CLASS( pet2001b, pet2001, pet2001b_state )
|
||||
MCFG_DEVICE_REMOVE(M6520_1_TAG)
|
||||
MCFG_PIA6821_ADD(M6520_1_TAG, pet2001b_pia1_intf)
|
||||
|
||||
MCFG_RAM_MODIFY(RAM_TAG)
|
||||
MCFG_RAM_DEFAULT_SIZE("8K")
|
||||
MCFG_RAM_EXTRA_OPTIONS("16K,32K")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// ROMS
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// ROM( pet2001 )
|
||||
//-------------------------------------------------
|
||||
|
||||
ROM_START( pet2001 )
|
||||
ROM_REGION( 0x4000, M6502_TAG, 0 )
|
||||
ROM_DEFAULT_BIOS( "basic1r" )
|
||||
ROM_SYSTEM_BIOS( 0, "basic1o", "Original" )
|
||||
ROMX_LOAD( "901447-01.h1", 0x0000, 0x0800, CRC(a055e33a) SHA1(831db40324113ee996c434d38b4add3fd1f820bd), ROM_BIOS(1) )
|
||||
ROM_SYSTEM_BIOS( 1, "basic1r", "Revised" )
|
||||
ROMX_LOAD( "901447-09.h1", 0x0000, 0x0800, CRC(03cf16d0) SHA1(1330580c0614d3556a389da4649488ba04a60908), ROM_BIOS(2) )
|
||||
ROM_LOAD( "901447-02.h5", 0x0800, 0x0800, CRC(69fd8a8f) SHA1(70c0f4fa67a70995b168668c957c3fcf2c8641bd) )
|
||||
ROM_LOAD( "901447-03.h2", 0x1000, 0x0800, CRC(d349f2d4) SHA1(4bf2c20c51a63d213886957485ebef336bb803d0) )
|
||||
ROM_LOAD( "901447-04.h6", 0x1800, 0x0800, CRC(850544eb) SHA1(d293972d529023d8fd1f493149e4777b5c253a69) )
|
||||
ROM_LOAD( "901447-05.h3", 0x2000, 0x0800, CRC(9e1c5cea) SHA1(f02f5fb492ba93dbbd390f24c10f7a832dec432a) )
|
||||
ROM_LOAD( "901447-06.h4", 0x3000, 0x0800, CRC(661a814a) SHA1(960717282878e7de893d87242ddf9d1512be162e) )
|
||||
ROM_LOAD( "901447-07.h7", 0x3800, 0x0800, CRC(c4f47ad1) SHA1(d440f2510bc52e20c3d6bc8b9ded9cea7f462a9c) )
|
||||
|
||||
ROM_REGION( 0x800, "gfx1", 0 )
|
||||
ROM_LOAD( "901447-08.a2", 0x000, 0x800, CRC(54f32f45) SHA1(3e067cc621e4beafca2b90cb8f6dba975df2855b) )
|
||||
ROM_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ROM( pet2001n )
|
||||
//-------------------------------------------------
|
||||
|
||||
ROM_START( pet2001n )
|
||||
ROM_REGION( 0x4000, M6502_TAG, 0 )
|
||||
ROM_LOAD( "901465-01.ud6", 0x0000, 0x1000, CRC(63a7fe4a) SHA1(3622111f486d0e137022523657394befa92bde44) ) // BASIC 2
|
||||
ROM_LOAD( "901465-02.ud7", 0x1000, 0x1000, CRC(ae4cb035) SHA1(1bc0ebf27c9bb62ad71bca40313e874234cab6ac) ) // BASIC 2
|
||||
ROM_LOAD( "901447-24.ud8", 0x2000, 0x0800, CRC(e459ab32) SHA1(5e5502ce32f5a7e387d65efe058916282041e54b) ) // Screen Editor (40 columns, no CRTC, Normal Keyb)
|
||||
ROM_LOAD( "901465-03.ud9", 0x3000, 0x1000, CRC(f02238e2) SHA1(38742bdf449f629bcba6276ef24d3daeb7da6e84) ) // Kernal
|
||||
|
||||
ROM_REGION( 0x800, "gfx1", 0 )
|
||||
ROM_LOAD( "901447-10.uf10", 0x000, 0x800, CRC(d8408674) SHA1(0157a2d55b7ac4eaeb38475889ebeea52e2593db) ) // Character Generator
|
||||
ROM_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ROM( pet2001b )
|
||||
//-------------------------------------------------
|
||||
|
||||
ROM_START( pet2001b )
|
||||
ROM_REGION( 0x4000, M6502_TAG, 0 )
|
||||
ROM_LOAD( "901465-01.ud6", 0x0000, 0x1000, CRC(63a7fe4a) SHA1(3622111f486d0e137022523657394befa92bde44) ) // BASIC 2
|
||||
ROM_LOAD( "901465-02.ud7", 0x1000, 0x1000, CRC(ae4cb035) SHA1(1bc0ebf27c9bb62ad71bca40313e874234cab6ac) ) // BASIC 2
|
||||
ROM_LOAD( "901474-01.ud8", 0x2000, 0x0800, CRC(05db957e) SHA1(174ace3a8c0348cd21d39cc864e2adc58b0101a9) ) // Screen Editor (40 columns, no CRTC, Business Keyb)
|
||||
ROM_LOAD( "901465-03.ud9", 0x3000, 0x1000, CRC(f02238e2) SHA1(38742bdf449f629bcba6276ef24d3daeb7da6e84) ) // Kernal
|
||||
|
||||
ROM_REGION( 0x800, "gfx1", 0 )
|
||||
ROM_LOAD( "901447-10.uf10", 0x000, 0x800, CRC(d8408674) SHA1(0157a2d55b7ac4eaeb38475889ebeea52e2593db) ) // Character Generator
|
||||
ROM_END
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// SYSTEM DRIVERS
|
||||
//**************************************************************************
|
||||
|
||||
// YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS
|
||||
COMP( 1977, pet2001, 0, 0, pet2001, pet, driver_device, 0, "Commodore Business Machines", "PET 2001", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW )
|
||||
COMP( 1979, pet2001n, pet2001, 0, pet2001n, pet, driver_device, 0, "Commodore Business Machines", "PET 2001-N", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW )
|
||||
COMP( 1979, pet2001b, pet2001, 0, pet2001b, petb, driver_device, 0, "Commodore Business Machines", "PET 2001-B", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW )
|
166
src/mess/includes/pet2001.h
Normal file
166
src/mess/includes/pet2001.h
Normal file
@ -0,0 +1,166 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __PET2001__
|
||||
#define __PET2001__
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
#include "machine/6821pia.h"
|
||||
#include "machine/6522via.h"
|
||||
#include "machine/cbmipt.h"
|
||||
#include "machine/ieee488.h"
|
||||
#include "machine/petcass.h"
|
||||
#include "machine/ram.h"
|
||||
#include "video/mc6845.h"
|
||||
|
||||
#define M6502_TAG "f3"
|
||||
#define M6522_TAG "a5"
|
||||
#define M6520_1_TAG "g8"
|
||||
#define M6520_2_TAG "b8"
|
||||
#define SCREEN_TAG "screen"
|
||||
|
||||
class pet2001_state : public driver_device
|
||||
{
|
||||
public:
|
||||
pet2001_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, M6502_TAG),
|
||||
m_via(*this, M6522_TAG),
|
||||
m_pia1(*this, M6520_1_TAG),
|
||||
m_pia2(*this, M6520_2_TAG),
|
||||
m_ieee(*this, IEEE488_TAG),
|
||||
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
|
||||
m_cassette2(*this, PET_DATASSETTE_PORT2_TAG),
|
||||
//m_exp(*this, PET_EXPANSION_SLOT_TAG),
|
||||
//m_user(*this, PET_USER_PORT_TAG),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_rom(*this, M6502_TAG),
|
||||
m_char_rom(*this, "gfx1"),
|
||||
m_video_ram(*this, "video_ram"),
|
||||
m_row0(*this, "ROW0"),
|
||||
m_row1(*this, "ROW1"),
|
||||
m_row2(*this, "ROW2"),
|
||||
m_row3(*this, "ROW3"),
|
||||
m_row4(*this, "ROW4"),
|
||||
m_row5(*this, "ROW5"),
|
||||
m_row6(*this, "ROW6"),
|
||||
m_row7(*this, "ROW7"),
|
||||
m_row8(*this, "ROW8"),
|
||||
m_row9(*this, "ROW9"),
|
||||
m_lock(*this, "LOCK"),
|
||||
m_key(0),
|
||||
m_sync(0),
|
||||
m_graphic(0),
|
||||
m_blanktv(0),
|
||||
m_via_irq(CLEAR_LINE),
|
||||
m_pia1a_irq(CLEAR_LINE),
|
||||
m_pia1b_irq(CLEAR_LINE),
|
||||
m_pia2a_irq(CLEAR_LINE),
|
||||
m_pia2b_irq(CLEAR_LINE),
|
||||
m_exp_irq(CLEAR_LINE)
|
||||
{ }
|
||||
|
||||
required_device<m6502_device> m_maincpu;
|
||||
required_device<via6522_device> m_via;
|
||||
required_device<pia6821_device> m_pia1;
|
||||
required_device<pia6821_device> m_pia2;
|
||||
required_device<ieee488_device> m_ieee;
|
||||
required_device<pet_datassette_port_device> m_cassette;
|
||||
required_device<pet_datassette_port_device> m_cassette2;
|
||||
//required_device<pet_expansion_slot_device> m_exp;
|
||||
//required_device<pet_user_port_device> m_user;
|
||||
required_device<ram_device> m_ram;
|
||||
required_memory_region m_rom;
|
||||
required_memory_region m_char_rom;
|
||||
optional_shared_ptr<UINT8> m_video_ram;
|
||||
required_ioport m_row0;
|
||||
required_ioport m_row1;
|
||||
required_ioport m_row2;
|
||||
required_ioport m_row3;
|
||||
required_ioport m_row4;
|
||||
required_ioport m_row5;
|
||||
required_ioport m_row6;
|
||||
required_ioport m_row7;
|
||||
required_ioport m_row8;
|
||||
required_ioport m_row9;
|
||||
required_ioport m_lock;
|
||||
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
|
||||
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
|
||||
void check_interrupts();
|
||||
|
||||
DECLARE_READ8_MEMBER( read );
|
||||
DECLARE_WRITE8_MEMBER( write );
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( via_irq_w );
|
||||
DECLARE_READ8_MEMBER( via_pb_r );
|
||||
DECLARE_WRITE8_MEMBER( via_pb_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( via_ca2_w );
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( pia1_irqa_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( pia1_irqb_w );
|
||||
DECLARE_READ8_MEMBER( pia1_pa_r );
|
||||
DECLARE_READ8_MEMBER( pia1_pb_r );
|
||||
DECLARE_WRITE8_MEMBER( pia1_pa_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( pia1_ca2_w );
|
||||
DECLARE_READ_LINE_MEMBER( pia1_cb1_r );
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( pia2_irqa_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( pia2_irqb_w );
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER( sync_tick );
|
||||
|
||||
enum
|
||||
{
|
||||
SEL0 = 0,
|
||||
SEL1,
|
||||
SEL2,
|
||||
SEL3,
|
||||
SEL4,
|
||||
SEL5,
|
||||
SEL6,
|
||||
SEL7,
|
||||
SEL8,
|
||||
SEL9,
|
||||
SELA,
|
||||
SELB,
|
||||
SELC,
|
||||
SELD,
|
||||
SELE,
|
||||
SELF
|
||||
};
|
||||
|
||||
// keyboard state
|
||||
UINT8 m_key;
|
||||
|
||||
// video state
|
||||
int m_sync;
|
||||
int m_graphic;
|
||||
int m_blanktv;
|
||||
|
||||
// interrupt state
|
||||
int m_via_irq;
|
||||
int m_pia1a_irq;
|
||||
int m_pia1b_irq;
|
||||
int m_pia2a_irq;
|
||||
int m_pia2b_irq;
|
||||
int m_exp_irq;
|
||||
};
|
||||
|
||||
|
||||
class pet2001b_state : public pet2001_state
|
||||
{
|
||||
public:
|
||||
pet2001b_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: pet2001_state(mconfig, type, tag)
|
||||
{ }
|
||||
|
||||
DECLARE_READ8_MEMBER( pia1_pb_r );
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -824,6 +824,7 @@ $(MESSOBJ)/casio.a: \
|
||||
$(MESS_VIDEO)/hd44352.o \
|
||||
|
||||
$(MESSOBJ)/cbm.a: \
|
||||
$(MESS_DRIVERS)/pet2001.o \
|
||||
$(MESS_VIDEO)/pet.o \
|
||||
$(MESS_DRIVERS)/pet.o \
|
||||
$(MESS_MACHINE)/pet.o \
|
||||
|
Loading…
Reference in New Issue
Block a user