46
46
*************************************/
48
static READ16_HANDLER( shuuz_atarivc_r )
48
READ16_MEMBER(shuuz_state::shuuz_atarivc_r)
50
return atarivc_r(*space->machine().primary_screen, offset);
50
return atarivc_r(*machine().primary_screen, offset);
54
static WRITE16_HANDLER( shuuz_atarivc_w )
54
WRITE16_MEMBER(shuuz_state::shuuz_atarivc_w)
56
atarivc_w(*space->machine().primary_screen, offset, data, mem_mask);
56
atarivc_w(*machine().primary_screen, offset, data, mem_mask);
93
93
*************************************/
95
static READ16_HANDLER( leta_r )
95
READ16_MEMBER(shuuz_state::leta_r)
97
shuuz_state *state = space->machine().driver_data<shuuz_state>();
98
97
/* trackball -- rotated 45 degrees? */
99
98
int which = offset & 1;
101
100
/* when reading the even ports, do a real analog port update */
104
int dx = (INT8)input_port_read(space->machine(), "TRACKX");
105
int dy = (INT8)input_port_read(space->machine(), "TRACKY");
103
int dx = (INT8)ioport("TRACKX")->read();
104
int dy = (INT8)ioport("TRACKY")->read();
107
state->m_cur[0] = dx + dy;
108
state->m_cur[1] = dx - dy;
111
110
/* clip the result to -0x3f to +0x3f to remove directional ambiguities */
112
return state->m_cur[which];
139
138
*************************************/
141
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16 )
140
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, shuuz_state )
142
141
AM_RANGE(0x000000, 0x03ffff) AM_ROM
143
AM_RANGE(0x100000, 0x100fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom")
144
AM_RANGE(0x101000, 0x101fff) AM_WRITE(atarigen_eeprom_enable_w)
142
AM_RANGE(0x100000, 0x100fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom")
143
AM_RANGE(0x101000, 0x101fff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
145
144
AM_RANGE(0x102000, 0x102001) AM_WRITE(watchdog_reset16_w)
146
145
AM_RANGE(0x103000, 0x103003) AM_READ(leta_r)
147
146
AM_RANGE(0x105000, 0x105001) AM_READWRITE(special_port0_r, latch_w)
148
147
AM_RANGE(0x105002, 0x105003) AM_READ_PORT("BUTTONS")
149
AM_RANGE(0x106000, 0x106001) AM_DEVREADWRITE8_MODERN("oki", okim6295_device, read, write, 0x00ff)
148
AM_RANGE(0x106000, 0x106001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
150
149
AM_RANGE(0x107000, 0x107007) AM_NOP
151
AM_RANGE(0x3e0000, 0x3e087f) AM_RAM_WRITE(atarigen_666_paletteram_w) AM_BASE_GENERIC(paletteram)
152
AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE(shuuz_atarivc_r, shuuz_atarivc_w) AM_BASE_MEMBER(shuuz_state, m_atarivc_data)
153
AM_RANGE(0x3f4000, 0x3f5eff) AM_RAM_WRITE(atarigen_playfield_latched_msb_w) AM_BASE_MEMBER(shuuz_state, m_playfield)
154
AM_RANGE(0x3f5f00, 0x3f5f7f) AM_RAM AM_BASE_MEMBER(shuuz_state, m_atarivc_eof_data)
155
AM_RANGE(0x3f5f80, 0x3f5fff) AM_READWRITE(atarimo_0_slipram_r, atarimo_0_slipram_w)
156
AM_RANGE(0x3f6000, 0x3f7fff) AM_RAM_WRITE(atarigen_playfield_upper_w) AM_BASE_MEMBER(shuuz_state, m_playfield_upper)
150
AM_RANGE(0x3e0000, 0x3e087f) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram")
151
AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE(shuuz_atarivc_r, shuuz_atarivc_w) AM_SHARE("atarivc_data")
152
AM_RANGE(0x3f4000, 0x3f5eff) AM_RAM_WRITE_LEGACY(atarigen_playfield_latched_msb_w) AM_SHARE("playfield")
153
AM_RANGE(0x3f5f00, 0x3f5f7f) AM_RAM AM_SHARE("atarivc_eof")
154
AM_RANGE(0x3f5f80, 0x3f5fff) AM_READWRITE_LEGACY(atarimo_0_slipram_r, atarimo_0_slipram_w)
155
AM_RANGE(0x3f6000, 0x3f7fff) AM_RAM_WRITE_LEGACY(atarigen_playfield_upper_w) AM_SHARE("playfield_up")
157
156
AM_RANGE(0x3f8000, 0x3fcfff) AM_RAM
158
AM_RANGE(0x3fd000, 0x3fd3ff) AM_READWRITE(atarimo_0_spriteram_r, atarimo_0_spriteram_w)
157
AM_RANGE(0x3fd000, 0x3fd3ff) AM_READWRITE_LEGACY(atarimo_0_spriteram_r, atarimo_0_spriteram_w)
159
158
AM_RANGE(0x3fd400, 0x3fffff) AM_RAM
172
171
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
173
172
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
174
173
PORT_BIT( 0x07fc, IP_ACTIVE_LOW, IPT_UNUSED )
175
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_VBLANK )
174
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
176
175
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
178
177
PORT_START("BUTTONS")
199
198
PORT_BIT( 0x00fc, IP_ACTIVE_LOW, IPT_UNUSED )
200
199
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Step Debug SW") PORT_CODE(KEYCODE_S)
201
200
PORT_BIT( 0x0600, IP_ACTIVE_LOW, IPT_UNUSED )
202
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_VBLANK )
201
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
203
202
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Playfield Debug SW") PORT_CODE(KEYCODE_Y)
204
203
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reset Debug SW") PORT_CODE(KEYCODE_E)
205
204
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Crosshair Debug SW") PORT_CODE(KEYCODE_C)