Previous 15994 Revisions Next

r5764 Thursday 17th September, 2009 at 12:31:10 UTC by Roberto Zandonà
[JR200] added some read handler for keyboard
[src/mess/drivers]jr200.c

src/mess/drivers/jr200.c
r5763r5764
2020#include "cpu/m6800/m6800.h"
2121
2222static UINT8 *textram;
23static UINT16 timer = 0;
2423
25static READ8_HANDLER( test_r )
24static READ8_HANDLER( test1_r )
2625{
27   timer++;
28   if (timer == 0x100)
29   {
30      timer = 0;
31      return 1;
32   }
33   return 0x20;
26   if (debug_global_input_code_pressed(KEYCODE_Q)) return 0x50;
27return 0x50;
3428}
3529
30static READ8_HANDLER( test2_r )
31{
32   if (debug_global_input_code_pressed(KEYCODE_Q)) return 0x01;
33return 0x01;
34}
35
36static READ8_HANDLER( test3_r )
37{
38   if (debug_global_input_code_pressed(KEYCODE_Q)) return 0x10;
39return 0x10;
40}
41
3642/*
3743   0000-3fff RAM
3844   4000-4fff RAM ( 4k expansion)
r5763r5764
4551
4652static ADDRESS_MAP_START(jr200_mem, ADDRESS_SPACE_PROGRAM, 8)
4753   AM_RANGE(0x0000, 0x000c) AM_RAM
48   AM_RANGE(0x000d, 0x000d) AM_RAM AM_READ(test_r)
54   AM_RANGE(0x000d, 0x000d) AM_RAM
4955   AM_RANGE(0x000e, 0x3fff) AM_RAM
5056   AM_RANGE(0xa000, 0xbfff) AM_ROM
51   AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE(&textram)
57   AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_BASE(&textram)
58   AM_RANGE(0xc801, 0xc801) AM_RAM AM_READ(test1_r)
59   AM_RANGE(0xc81c, 0xc81c) AM_RAM AM_READ(test2_r)
60   AM_RANGE(0xc81d, 0xc81d) AM_RAM AM_READ(test3_r)
5261   AM_RANGE(0xe000, 0xffff) AM_ROM
5362ADDRESS_MAP_END
5463
r5763r5764
107116   GFXDECODE_ENTRY( "char", 0, tiles8x8_layout, 0, 0x100 )
108117GFXDECODE_END
109118
119
120static INTERRUPT_GEN( jr200_irq )
121{
122   cpu_set_input_line(device, 0, HOLD_LINE);
123
124}
125
126static INTERRUPT_GEN( jr200_nmi )
127{
128   cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
129}
130
110131static MACHINE_DRIVER_START( jr200 )
111132   /* basic machine hardware */
112133   MDRV_CPU_ADD("maincpu", M6802, XTAL_4MHz) /* MN1800A */
113134   MDRV_CPU_PROGRAM_MAP(jr200_mem)
114135   MDRV_CPU_IO_MAP(jr200_io)
136MDRV_CPU_VBLANK_INT("screen", jr200_irq)
137MDRV_CPU_PERIODIC_INT(jr200_nmi,60)
115138/*
116139   MDRV_CPU_ADD("mn1544", MN1544, ?)
117140*/

Previous 15994 Revisions Next


© 1998-2018 The MESS Team