mirror of
https://github.com/holub/mame
synced 2025-04-25 17:56:43 +03:00
orao.c: reduce tagmap lookups (nw)
This commit is contained in:
parent
774bdbfb60
commit
9195d9bd9f
@ -34,129 +34,129 @@ ADDRESS_MAP_END
|
||||
|
||||
/* Input ports */
|
||||
static INPUT_PORTS_START( orao )
|
||||
PORT_START("LINE0")
|
||||
PORT_START("LINE.0")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
|
||||
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
|
||||
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
|
||||
|
||||
PORT_START("LINE1")
|
||||
PORT_START("LINE.1")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL)
|
||||
PORT_BIT(0xC0, IP_ACTIVE_LOW, IPT_UNUSED)
|
||||
|
||||
PORT_START("LINE2")
|
||||
PORT_START("LINE.2")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1))
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2))
|
||||
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3))
|
||||
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4))
|
||||
|
||||
PORT_START("LINE3")
|
||||
PORT_START("LINE.3")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
|
||||
PORT_BIT(0xC0, IP_ACTIVE_LOW, IPT_UNUSED)
|
||||
|
||||
PORT_START("LINE4")
|
||||
PORT_START("LINE.4")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
|
||||
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T')
|
||||
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
|
||||
|
||||
PORT_START("LINE5")
|
||||
PORT_START("LINE.5")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
|
||||
PORT_BIT(0xC0, IP_ACTIVE_LOW, IPT_UNUSED)
|
||||
|
||||
PORT_START("LINE6")
|
||||
PORT_START("LINE.6")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
|
||||
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U')
|
||||
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
|
||||
|
||||
PORT_START("LINE7")
|
||||
PORT_START("LINE.7")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
|
||||
PORT_BIT(0xC0, IP_ACTIVE_LOW, IPT_UNUSED)
|
||||
|
||||
PORT_START("LINE8")
|
||||
PORT_START("LINE.8")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
|
||||
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
|
||||
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
|
||||
|
||||
PORT_START("LINE9")
|
||||
PORT_START("LINE.9")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
|
||||
PORT_BIT(0xC0, IP_ACTIVE_LOW, IPT_UNUSED)
|
||||
|
||||
PORT_START("LINE10")
|
||||
PORT_START("LINE.10")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J')
|
||||
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K')
|
||||
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('M')
|
||||
|
||||
PORT_START("LINE11")
|
||||
PORT_START("LINE.11")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
|
||||
PORT_BIT(0xC0, IP_ACTIVE_LOW, IPT_UNUSED)
|
||||
|
||||
PORT_START("LINE12")
|
||||
PORT_START("LINE.12")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
|
||||
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S')
|
||||
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
|
||||
|
||||
PORT_START("LINE13")
|
||||
PORT_START("LINE.13")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C')
|
||||
PORT_BIT(0xC0, IP_ACTIVE_LOW, IPT_UNUSED)
|
||||
|
||||
PORT_START("LINE14")
|
||||
PORT_START("LINE.14")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
|
||||
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
|
||||
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N')
|
||||
|
||||
PORT_START("LINE15")
|
||||
PORT_START("LINE.15")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
|
||||
PORT_BIT(0xC0, IP_ACTIVE_LOW, IPT_UNUSED)
|
||||
|
||||
PORT_START("LINE16")
|
||||
PORT_START("LINE.16")
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ch") PORT_CODE(KEYCODE_COLON)
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Cj") PORT_CODE(KEYCODE_QUOTE)
|
||||
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Zh") PORT_CODE(KEYCODE_SLASH)
|
||||
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR(':') PORT_CHAR('*')
|
||||
|
||||
PORT_START("LINE17")
|
||||
PORT_START("LINE.17")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Del") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('^') PORT_CHAR('@')
|
||||
PORT_BIT(0xC0, IP_ACTIVE_LOW, IPT_UNUSED)
|
||||
|
||||
PORT_START("LINE18")
|
||||
PORT_START("LINE.18")
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Dj") PORT_CODE(KEYCODE_CLOSEBRACE)
|
||||
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Sh") PORT_CODE(KEYCODE_OPENBRACE)
|
||||
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR(';') PORT_CHAR('+')
|
||||
|
||||
PORT_START("LINE19")
|
||||
PORT_START("LINE.19")
|
||||
PORT_BIT(0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=')
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
|
||||
|
@ -20,10 +20,10 @@ public:
|
||||
m_video_ram(*this, "video_ram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_dac(*this, "dac"),
|
||||
m_cassette(*this, "cassette") { }
|
||||
m_cassette(*this, "cassette"),
|
||||
m_line(*this, "LINE")
|
||||
{ }
|
||||
|
||||
required_shared_ptr<UINT8> m_memory;
|
||||
required_shared_ptr<UINT8> m_video_ram;
|
||||
DECLARE_READ8_MEMBER(orao_io_r);
|
||||
DECLARE_WRITE8_MEMBER(orao_io_w);
|
||||
DECLARE_DRIVER_INIT(orao);
|
||||
@ -31,9 +31,14 @@ public:
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_orao(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
private:
|
||||
required_shared_ptr<UINT8> m_memory;
|
||||
required_shared_ptr<UINT8> m_video_ram;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<dac_device> m_dac;
|
||||
required_device<cassette_image_device> m_cassette;
|
||||
required_ioport_array<20> m_line;
|
||||
};
|
||||
|
||||
#endif /* ORAO_H_ */
|
||||
|
@ -36,26 +36,26 @@ READ8_MEMBER(orao_state::orao_io_r)
|
||||
|
||||
switch(offset) {
|
||||
/* Keyboard*/
|
||||
case 0x07FC : return ioport("LINE0")->read();
|
||||
case 0x07FD : return ioport("LINE1")->read();
|
||||
case 0x07FA : return ioport("LINE2")->read();
|
||||
case 0x07FB : return ioport("LINE3")->read();
|
||||
case 0x07F6 : return ioport("LINE4")->read();
|
||||
case 0x07F7 : return ioport("LINE5")->read();
|
||||
case 0x07EE : return ioport("LINE6")->read();
|
||||
case 0x07EF : return ioport("LINE7")->read();
|
||||
case 0x07DE : return ioport("LINE8")->read();
|
||||
case 0x07DF : return ioport("LINE9")->read();
|
||||
case 0x07BE : return ioport("LINE10")->read();
|
||||
case 0x07BF : return ioport("LINE11")->read();
|
||||
case 0x077E : return ioport("LINE12")->read();
|
||||
case 0x077F : return ioport("LINE13")->read();
|
||||
case 0x06FE : return ioport("LINE14")->read();
|
||||
case 0x06FF : return ioport("LINE15")->read();
|
||||
case 0x05FE : return ioport("LINE16")->read();
|
||||
case 0x05FF : return ioport("LINE17")->read();
|
||||
case 0x03FE : return ioport("LINE18")->read();
|
||||
case 0x03FF : return ioport("LINE19")->read();
|
||||
case 0x07FC : return m_line[0]->read();
|
||||
case 0x07FD : return m_line[1]->read();
|
||||
case 0x07FA : return m_line[2]->read();
|
||||
case 0x07FB : return m_line[3]->read();
|
||||
case 0x07F6 : return m_line[4]->read();
|
||||
case 0x07F7 : return m_line[5]->read();
|
||||
case 0x07EE : return m_line[6]->read();
|
||||
case 0x07EF : return m_line[7]->read();
|
||||
case 0x07DE : return m_line[8]->read();
|
||||
case 0x07DF : return m_line[9]->read();
|
||||
case 0x07BE : return m_line[10]->read();
|
||||
case 0x07BF : return m_line[11]->read();
|
||||
case 0x077E : return m_line[12]->read();
|
||||
case 0x077F : return m_line[13]->read();
|
||||
case 0x06FE : return m_line[14]->read();
|
||||
case 0x06FF : return m_line[15]->read();
|
||||
case 0x05FE : return m_line[16]->read();
|
||||
case 0x05FF : return m_line[17]->read();
|
||||
case 0x03FE : return m_line[18]->read();
|
||||
case 0x03FF : return m_line[19]->read();
|
||||
/* Tape */
|
||||
case 0x07FF :
|
||||
level = m_cassette->input();
|
||||
|
Loading…
Reference in New Issue
Block a user