src/mess/drivers/jr200.c
| r5763 | r5764 | |
| 20 | 20 | #include "cpu/m6800/m6800.h" |
| 21 | 21 | |
| 22 | 22 | static UINT8 *textram; |
| 23 | | static UINT16 timer = 0; |
| 24 | 23 | |
| 25 | | static READ8_HANDLER( test_r ) |
| 24 | static READ8_HANDLER( test1_r ) |
| 26 | 25 | { |
| 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; |
| 27 | return 0x50; |
| 34 | 28 | } |
| 35 | 29 | |
| 30 | static READ8_HANDLER( test2_r ) |
| 31 | { |
| 32 | if (debug_global_input_code_pressed(KEYCODE_Q)) return 0x01; |
| 33 | return 0x01; |
| 34 | } |
| 35 | |
| 36 | static READ8_HANDLER( test3_r ) |
| 37 | { |
| 38 | if (debug_global_input_code_pressed(KEYCODE_Q)) return 0x10; |
| 39 | return 0x10; |
| 40 | } |
| 41 | |
| 36 | 42 | /* |
| 37 | 43 | 0000-3fff RAM |
| 38 | 44 | 4000-4fff RAM ( 4k expansion) |
| r5763 | r5764 | |
| 45 | 51 | |
| 46 | 52 | static ADDRESS_MAP_START(jr200_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 47 | 53 | AM_RANGE(0x0000, 0x000c) AM_RAM |
| 48 | | AM_RANGE(0x000d, 0x000d) AM_RAM AM_READ(test_r) |
| 54 | AM_RANGE(0x000d, 0x000d) AM_RAM |
| 49 | 55 | AM_RANGE(0x000e, 0x3fff) AM_RAM |
| 50 | 56 | 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) |
| 52 | 61 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 53 | 62 | ADDRESS_MAP_END |
| 54 | 63 | |
| r5763 | r5764 | |
| 107 | 116 | GFXDECODE_ENTRY( "char", 0, tiles8x8_layout, 0, 0x100 ) |
| 108 | 117 | GFXDECODE_END |
| 109 | 118 | |
| 119 | |
| 120 | static INTERRUPT_GEN( jr200_irq ) |
| 121 | { |
| 122 | cpu_set_input_line(device, 0, HOLD_LINE); |
| 123 | |
| 124 | } |
| 125 | |
| 126 | static INTERRUPT_GEN( jr200_nmi ) |
| 127 | { |
| 128 | cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); |
| 129 | } |
| 130 | |
| 110 | 131 | static MACHINE_DRIVER_START( jr200 ) |
| 111 | 132 | /* basic machine hardware */ |
| 112 | 133 | MDRV_CPU_ADD("maincpu", M6802, XTAL_4MHz) /* MN1800A */ |
| 113 | 134 | MDRV_CPU_PROGRAM_MAP(jr200_mem) |
| 114 | 135 | MDRV_CPU_IO_MAP(jr200_io) |
| 136 | MDRV_CPU_VBLANK_INT("screen", jr200_irq) |
| 137 | MDRV_CPU_PERIODIC_INT(jr200_nmi,60) |
| 115 | 138 | /* |
| 116 | 139 | MDRV_CPU_ADD("mn1544", MN1544, ?) |
| 117 | 140 | */ |