67
67
*************************************/
69
static WRITE16_HANDLER( interrupt_scan_w )
69
WRITE16_MEMBER(toobin_state::interrupt_scan_w)
71
toobin_state *state = space->machine().driver_data<toobin_state>();
72
int oldword = state->m_interrupt_scan[offset];
71
int oldword = m_interrupt_scan[offset];
73
72
int newword = oldword;
74
73
COMBINE_DATA(&newword);
76
75
/* if something changed, update the word in memory */
77
76
if (oldword != newword)
79
state->m_interrupt_scan[offset] = newword;
80
atarigen_scanline_int_set(*space->machine().primary_screen, newword & 0x1ff);
78
m_interrupt_scan[offset] = newword;
79
atarigen_scanline_int_set(*machine().primary_screen, newword & 0x1ff);
90
89
*************************************/
92
static READ16_HANDLER( special_port1_r )
91
READ16_MEMBER(toobin_state::special_port1_r)
94
toobin_state *state = space->machine().driver_data<toobin_state>();
95
int result = input_port_read(space->machine(), "FF9000");
96
if (atarigen_get_hblank(*space->machine().primary_screen)) result ^= 0x8000;
97
if (state->m_cpu_to_sound_ready) result ^= 0x2000;
93
int result = ioport("FF9000")->read();
94
if (atarigen_get_hblank(*machine().primary_screen)) result ^= 0x8000;
95
if (m_cpu_to_sound_ready) result ^= 0x2000;
107
105
*************************************/
109
107
/* full address map decoded from schematics */
110
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16 )
108
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, toobin_state )
111
109
ADDRESS_MAP_GLOBAL_MASK(0xc7ffff)
112
110
AM_RANGE(0x000000, 0x07ffff) AM_ROM
113
AM_RANGE(0xc00000, 0xc07fff) AM_RAM_WRITE(atarigen_playfield_large_w) AM_BASE_MEMBER(toobin_state, m_playfield)
114
AM_RANGE(0xc08000, 0xc097ff) AM_MIRROR(0x046000) AM_RAM_WRITE(atarigen_alpha_w) AM_BASE_MEMBER(toobin_state, m_alpha)
115
AM_RANGE(0xc09800, 0xc09fff) AM_MIRROR(0x046000) AM_READWRITE(atarimo_0_spriteram_r, atarimo_0_spriteram_w)
116
AM_RANGE(0xc10000, 0xc107ff) AM_MIRROR(0x047800) AM_RAM_WRITE(toobin_paletteram_w) AM_BASE_GENERIC(paletteram)
111
AM_RANGE(0xc00000, 0xc07fff) AM_RAM_WRITE_LEGACY(atarigen_playfield_large_w) AM_SHARE("playfield")
112
AM_RANGE(0xc08000, 0xc097ff) AM_MIRROR(0x046000) AM_RAM_WRITE_LEGACY(atarigen_alpha_w) AM_SHARE("alpha")
113
AM_RANGE(0xc09800, 0xc09fff) AM_MIRROR(0x046000) AM_READWRITE_LEGACY(atarimo_0_spriteram_r, atarimo_0_spriteram_w)
114
AM_RANGE(0xc10000, 0xc107ff) AM_MIRROR(0x047800) AM_RAM_WRITE_LEGACY(toobin_paletteram_w) AM_SHARE("paletteram")
117
115
AM_RANGE(0xff6000, 0xff6001) AM_READNOP /* who knows? read at controls time */
118
116
AM_RANGE(0xff8000, 0xff8001) AM_MIRROR(0x4500fe) AM_WRITE(watchdog_reset16_w)
119
AM_RANGE(0xff8100, 0xff8101) AM_MIRROR(0x4500fe) AM_WRITE(atarigen_sound_w)
120
AM_RANGE(0xff8300, 0xff8301) AM_MIRROR(0x45003e) AM_WRITE(toobin_intensity_w)
121
AM_RANGE(0xff8340, 0xff8341) AM_MIRROR(0x45003e) AM_WRITE(interrupt_scan_w) AM_BASE_MEMBER(toobin_state, m_interrupt_scan)
122
AM_RANGE(0xff8380, 0xff8381) AM_MIRROR(0x45003e) AM_READWRITE(atarimo_0_slipram_r, toobin_slip_w)
123
AM_RANGE(0xff83c0, 0xff83c1) AM_MIRROR(0x45003e) AM_WRITE(atarigen_scanline_int_ack_w)
124
AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x4500fe) AM_WRITE(atarigen_sound_reset_w)
125
AM_RANGE(0xff8500, 0xff8501) AM_MIRROR(0x4500fe) AM_WRITE(atarigen_eeprom_enable_w)
126
AM_RANGE(0xff8600, 0xff8601) AM_MIRROR(0x4500fe) AM_WRITE(toobin_xscroll_w) AM_BASE_MEMBER(toobin_state, m_xscroll)
127
AM_RANGE(0xff8700, 0xff8701) AM_MIRROR(0x4500fe) AM_WRITE(toobin_yscroll_w) AM_BASE_MEMBER(toobin_state, m_yscroll)
117
AM_RANGE(0xff8100, 0xff8101) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(atarigen_sound_w)
118
AM_RANGE(0xff8300, 0xff8301) AM_MIRROR(0x45003e) AM_WRITE_LEGACY(toobin_intensity_w)
119
AM_RANGE(0xff8340, 0xff8341) AM_MIRROR(0x45003e) AM_WRITE(interrupt_scan_w) AM_SHARE("interrupt_scan")
120
AM_RANGE(0xff8380, 0xff8381) AM_MIRROR(0x45003e) AM_READWRITE_LEGACY(atarimo_0_slipram_r, toobin_slip_w)
121
AM_RANGE(0xff83c0, 0xff83c1) AM_MIRROR(0x45003e) AM_WRITE_LEGACY(atarigen_scanline_int_ack_w)
122
AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(atarigen_sound_reset_w)
123
AM_RANGE(0xff8500, 0xff8501) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
124
AM_RANGE(0xff8600, 0xff8601) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(toobin_xscroll_w) AM_SHARE("xscroll")
125
AM_RANGE(0xff8700, 0xff8701) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(toobin_yscroll_w) AM_SHARE("yscroll")
128
126
AM_RANGE(0xff8800, 0xff8801) AM_MIRROR(0x4507fe) AM_READ_PORT("FF8800")
129
127
AM_RANGE(0xff9000, 0xff9001) AM_MIRROR(0x4507fe) AM_READ(special_port1_r)
130
AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x4507fe) AM_READ(atarigen_sound_r)
131
AM_RANGE(0xffa000, 0xffafff) AM_MIRROR(0x451000) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom")
128
AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x4507fe) AM_READ_LEGACY(atarigen_sound_r)
129
AM_RANGE(0xffa000, 0xffafff) AM_MIRROR(0x451000) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom")
132
130
AM_RANGE(0xffc000, 0xffffff) AM_MIRROR(0x450000) AM_RAM
160
158
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
161
159
PORT_SERVICE( 0x1000, IP_ACTIVE_LOW )
162
160
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
163
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_VBLANK )
161
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
164
162
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
166
164
PORT_INCLUDE( atarijsa_i ) /* audio port */