Previous 199869 Revisions Next

r20819 Thursday 7th February, 2013 at 21:50:11 UTC by Wilbert Pol
(MESS) irisha.c: Reduce tagmap lookups (nw)
[src/mess/includes]irisha.h
[src/mess/machine]irisha.c
[src/mess/video]irisha.c

trunk/src/mess/machine/irisha.c
r20818r20819
2626
2727void irisha_state::machine_start()
2828{
29   static const char *const keynames[] = {
30      "LINE0", "LINE1", "LINE2", "LINE3", "LINE4",
31      "LINE5", "LINE6", "LINE7", "LINE8", "LINE9"
32   };
33
34   for ( int i = 0; i < 10; i++ )
35   {
36      m_io_ports[i] = ioport( keynames[i] );
37   }
38
2939   machine().scheduler().timer_pulse(attotime::from_msec(30), timer_expired_delegate(FUNC(irisha_state::irisha_key),this));
3040}
3141
r20818r20819
4151   speaker_level_w(m_speaker, level);
4252}
4353
44static const char *const keynames[] = {
45                     "LINE0", "LINE1", "LINE2", "LINE3",
46                     "LINE4", "LINE5", "LINE6", "LINE7",
47                     "LINE8", "LINE9"
48};
4954
5055READ8_MEMBER(irisha_state::irisha_8255_portb_r)
5156{
r20818r20819
6772{
6873   UINT8 keycode;
6974   if (m_keyboard_cnt!=0 && m_keyboard_cnt<11) {
70      keycode = ioport(keynames[m_keyboard_cnt-1])->read() ^ 0xff;
75      keycode = m_io_ports[m_keyboard_cnt-1]->read() ^ 0xff;
7176   } else {
7277      keycode = 0xff;
7378   }
r20818r20819
119124
120125WRITE_LINE_MEMBER(irisha_state::irisha_pic_set_int_line)
121126{
122   machine().device("maincpu")->execute().set_input_line(0, state ? HOLD_LINE : CLEAR_LINE);
127   m_maincpu->set_input_line(0, state ? HOLD_LINE : CLEAR_LINE);
123128}
124129
125130const struct pic8259_interface irisha_pic8259_config =
trunk/src/mess/includes/irisha.h
r20818r20819
1919{
2020public:
2121   irisha_state(const machine_config &mconfig, device_type type, const char *tag)
22      : driver_device(mconfig, type, tag),
23         m_pit(*this, "pit8253"),
24         m_speaker(*this, SPEAKER_TAG)
22      : driver_device(mconfig, type, tag)
23      , m_maincpu(*this, "maincpu")
24      , m_pit(*this, "pit8253")
25      , m_speaker(*this, SPEAKER_TAG)
2526      { }
2627
28   required_device<cpu_device> m_maincpu;
2729   required_device<pit8253_device> m_pit;
2830   required_device<speaker_sound_device> m_speaker;
2931
r20818r20819
4951   UINT32 screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5052   TIMER_CALLBACK_MEMBER(irisha_key);
5153   DECLARE_WRITE_LINE_MEMBER(irisha_pic_set_int_line);
54
55   ioport_port *m_io_ports[10];
5256};
5357
5458
trunk/src/mess/video/irisha.c
r20818r20819
2020   UINT8 code1; //, code2;
2121   UINT8 col;
2222   int y, x, b;
23   address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
23   address_space &space = m_maincpu->space(AS_PROGRAM);
2424
2525   // draw image
2626   for (y = 0; y < 200; y++)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team