113
eolith_speedup_read(space);
113
eolith_speedup_read(&space);
115
return (input_port_read(space->machine(), "IN0") & ~0x300) | (space->machine().rand() & 0x300);
115
return (ioport("IN0")->read() & ~0x300) | (machine().rand() & 0x300);
118
static WRITE32_HANDLER( systemcontrol_w )
118
WRITE32_MEMBER(eolith_state::systemcontrol_w)
120
eolith_state *state = space->machine().driver_data<eolith_state>();
121
state->m_buffer = (data & 0x80) >> 7;
122
coin_counter_w(space->machine(), 0, data & state->m_coin_counter_bit);
123
set_led_status(space->machine(), 0, data & 1);
120
m_buffer = (data & 0x80) >> 7;
121
coin_counter_w(machine(), 0, data & m_coin_counter_bit);
122
set_led_status(machine(), 0, data & 1);
125
input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
124
ioport("EEPROMOUT")->write(data, 0xff);
127
126
// bit 0x100 and 0x040 ?
130
static READ32_HANDLER( hidctch3_pen1_r )
133
int xpos = input_port_read(space->machine(), "PEN_X_P1");
134
int ypos = input_port_read(space->machine(), "PEN_Y_P1");
136
return xpos + (ypos*168*2);
139
static READ32_HANDLER( hidctch3_pen2_r )
142
int xpos = input_port_read(space->machine(), "PEN_X_P2");
143
int ypos = input_port_read(space->machine(), "PEN_Y_P2");
145
return xpos + (ypos*168*2);
148
static ADDRESS_MAP_START( eolith_map, AS_PROGRAM, 32 )
129
READ32_MEMBER(eolith_state::hidctch3_pen1_r)
132
int xpos = ioport("PEN_X_P1")->read();
133
int ypos = ioport("PEN_Y_P1")->read();
135
return xpos + (ypos*168*2);
138
READ32_MEMBER(eolith_state::hidctch3_pen2_r)
141
int xpos = ioport("PEN_X_P2")->read();
142
int ypos = ioport("PEN_Y_P2")->read();
144
return xpos + (ypos*168*2);
147
static ADDRESS_MAP_START( eolith_map, AS_PROGRAM, 32, eolith_state )
149
148
AM_RANGE(0x00000000, 0x001fffff) AM_RAM // fort2b wants ram here
150
149
AM_RANGE(0x40000000, 0x401fffff) AM_RAM
151
150
AM_RANGE(0x90000000, 0x9003ffff) AM_READWRITE(eolith_vram_r, eolith_vram_w)
168
167
PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
169
168
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 )
170
169
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED )
171
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(eolith_speedup_getvblank, NULL)
170
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, eolith_state, eolith_speedup_getvblank, NULL)
172
171
PORT_BIT( 0x00003f80, IP_ACTIVE_LOW, IPT_UNUSED )
173
172
PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_SERVICE1 )
174
173
PORT_SERVICE_NO_TOGGLE( 0x00008000, IP_ACTIVE_LOW )
206
205
PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
207
206
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 )
208
207
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED )
209
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(eolith_speedup_getvblank, NULL)
208
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, eolith_state, eolith_speedup_getvblank, NULL)
210
209
PORT_BIT( 0x00003f80, IP_ACTIVE_LOW, IPT_UNUSED )
211
210
PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNUSED )
212
211
PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED )
389
388
PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
390
389
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 )
391
390
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED )
392
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(stealsee_speedup_getvblank, NULL)
391
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, eolith_state, stealsee_speedup_getvblank, NULL)
393
392
PORT_BIT( 0x00003f80, IP_ACTIVE_LOW, IPT_UNUSED )
394
393
PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_SERVICE1 )
395
394
PORT_SERVICE_NO_TOGGLE( 0x00008000, IP_ACTIVE_LOW )
1310
1309
//it fails compares with memories:
1311
1310
//$4002d338 -> $4002d348 .... $4002d33f -> $4002d34f
1312
1311
//related with bits 0x100 - 0x200 read at startup from input(0) ?
1313
UINT32 *rombase = (UINT32*)machine.region("maincpu")->base();
1312
UINT32 *rombase = (UINT32*)state->memregion("maincpu")->base();
1314
1313
rombase[0x14f00/4] = (rombase[0x14f00/4] & 0xffff) | 0x03000000; /* Change BR to NOP */
1316
1315
state->m_coin_counter_bit = 0x2000;
1320
1319
static DRIVER_INIT( hidctch2 )
1322
1321
//it fails compares in memory like in landbrka
1323
UINT32 *rombase = (UINT32*)machine.region("maincpu")->base();
1322
UINT32 *rombase = (UINT32*)machine.root_device().memregion("maincpu")->base();
1324
1323
rombase[0xbcc8/4] = (rombase[0xbcc8/4] & 0xffff) | 0x03000000; /* Change BR to NOP */
1325
1324
init_eolith_speedup(machine);
1332
1331
// It is not clear why the first reads are needed too
1334
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfce00000, 0xfce00003, FUNC(hidctch3_pen1_r));
1335
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfce80000, 0xfce80003, FUNC(hidctch3_pen1_r));
1333
eolith_state *state = machine.driver_data<eolith_state>();
1334
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xfce00000, 0xfce00003, read32_delegate(FUNC(eolith_state::hidctch3_pen1_r),state));
1335
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xfce80000, 0xfce80003, read32_delegate(FUNC(eolith_state::hidctch3_pen1_r),state));
1337
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfcf00000, 0xfcf00003, FUNC(hidctch3_pen2_r));
1338
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfcf80000, 0xfcf80003, FUNC(hidctch3_pen2_r));
1337
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xfcf00000, 0xfcf00003, read32_delegate(FUNC(eolith_state::hidctch3_pen2_r),state));
1338
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xfcf80000, 0xfcf80003, read32_delegate(FUNC(eolith_state::hidctch3_pen2_r),state));
1340
1340
init_eolith_speedup(machine);