Previous 15994 Revisions Next

r13690 Friday 23rd December, 2011 at 11:02:35 UTC by Barry Rodewald
alphatro: put bit 7 of port 0x10 under a 10us timer. System now runs faster. (no whatsnew)
[src/mess/drivers]alphatro.c

src/mess/drivers/alphatro.c
r13689r13690
4343   DECLARE_READ8_MEMBER(keyboard_r);
4444   DECLARE_WRITE8_MEMBER(video_w);
4545   DECLARE_READ8_MEMBER(video_r);
46   DECLARE_READ8_MEMBER(vblank_r);
46   DECLARE_READ8_MEMBER(port10_r);
47   DECLARE_INPUT_CHANGED_MEMBER(alphatro_break);
4748
4849   emu_timer* m_sys_timer;
4950   UINT8 *m_p_videoram;
r13689r13690
5354   virtual void machine_reset();
5455   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
5556    virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
57
5658private:
5759    static const device_timer_id SYSTEM_TIMER = 0;
58
60    UINT8 m_timer_bit;
5961};
6062
63READ8_MEMBER( alphatro_state::port10_r)
64{
65   //return (space.machine().device<screen_device>("screen")->vblank() ? 0x00 : 0x80);
66   return (m_timer_bit ? 0x80 : 0x00);
67}
68
6169void alphatro_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
6270{
6371   switch(id)
6472   {
6573   case SYSTEM_TIMER:
66      device_set_input_line(m_maincpu,INPUT_LINE_IRQ0,HOLD_LINE);
74      {
75         if(m_timer_bit == 0)
76            m_timer_bit = 1;
77         else
78            m_timer_bit = 0;
79      }
6780      break;
6881   }
6982}
7083
71READ8_MEMBER( alphatro_state::vblank_r)
72{
73   return (space.machine().device<screen_device>("screen")->vblank() ? 0x80 : 0x00);
74}
75
7684READ8_MEMBER( alphatro_state::keyboard_r )
7785{
7886   switch(offset)
r13689r13690
165173   }
166174}
167175
176INPUT_CHANGED_MEMBER( alphatro_state::alphatro_break )
177{
178   device_set_input_line(m_maincpu,INPUT_LINE_IRQ0,HOLD_LINE);
179}
180
168181static ADDRESS_MAP_START( alphatro_map, AS_PROGRAM, 8, alphatro_state )
169182   AM_RANGE(0x0000, 0xefff) AM_RAMBANK("bank1") // this is really ram, basic gets copied to here when it is needed
170183//   AM_RANGE(0x6000, 0xdfff) AM_RAM
r13689r13690
178191static ADDRESS_MAP_START( alphatro_io, AS_IO, 8, alphatro_state )
179192   ADDRESS_MAP_GLOBAL_MASK(0xff)
180193   ADDRESS_MAP_UNMAP_HIGH
181   AM_RANGE(0x10, 0x10) AM_READ(vblank_r)
194   AM_RANGE(0x10, 0x10) AM_READ(port10_r)
182195   AM_RANGE(0x20, 0x2f) AM_READ(keyboard_r) // keyboard in?
183196   AM_RANGE(0x50, 0x50) AM_DEVWRITE("crtc", mc6845_device, address_w)
184197   AM_RANGE(0x51, 0x51) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
r13689r13690
290303    PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2)
291304    PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1)
292305
306    PORT_START("other")
307    PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Break") PORT_CODE(KEYCODE_ESC) PORT_CHANGED_MEMBER(DEVICE_SELF,alphatro_state,alphatro_break,0)
293308INPUT_PORTS_END
294309
295310static const gfx_layout charlayout =
r13689r13690
314329
315330void alphatro_state::machine_reset()
316331{
332   // do what the IPL does
317333   UINT8* RAM = machine().device<ram_device>("ram")->pointer();
318334   UINT8* ROM = machine().region("maincpu")->base();
319335   cpu_set_reg(machine().device("maincpu"), STATE_GENPC, 0xe000);
320336   memcpy(RAM,ROM,0x10000); // copy BASIC to RAM, which the undumped IPL is supposed to do.
321337   memory_set_bankptr(machine(), "bank1",RAM);
322   // m_sys_timer->adjust(attotime::zero,0,attotime::from_msec(10));  // interrupts aren't enabled yet, so not much point in setting this
338
339   // probably not the correct, exact meaning of port is unknown, vblank/vsync is too slow.
340   m_sys_timer->adjust(attotime::from_usec(10),0,attotime::from_usec(10));
323341}
324342
325343//static PALETTE_INIT( alphatro )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team