~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/mame/drivers/eolith.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
 
101
101
 
102
102
 
103
 
static READ32_HANDLER( eolith_custom_r )
 
103
READ32_MEMBER(eolith_state::eolith_custom_r)
104
104
{
105
105
        /*
106
106
        bit 3 = eeprom bit
110
110
        bit 8 = ???
111
111
        bit 9 = ???
112
112
    */
113
 
        eolith_speedup_read(space);
 
113
        eolith_speedup_read(&space);
114
114
 
115
 
        return (input_port_read(space->machine(), "IN0") & ~0x300) | (space->machine().rand() & 0x300);
 
115
        return (ioport("IN0")->read() & ~0x300) | (machine().rand() & 0x300);
116
116
}
117
117
 
118
 
static WRITE32_HANDLER( systemcontrol_w )
 
118
WRITE32_MEMBER(eolith_state::systemcontrol_w)
119
119
{
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);
124
123
 
125
 
        input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
 
124
        ioport("EEPROMOUT")->write(data, 0xff);
126
125
 
127
126
        // bit 0x100 and 0x040 ?
128
127
}
129
128
 
130
 
static READ32_HANDLER( hidctch3_pen1_r )
131
 
{
132
 
        //320 x 240
133
 
        int xpos = input_port_read(space->machine(), "PEN_X_P1");
134
 
        int ypos = input_port_read(space->machine(), "PEN_Y_P1");
135
 
 
136
 
        return xpos + (ypos*168*2);
137
 
}
138
 
 
139
 
static READ32_HANDLER( hidctch3_pen2_r )
140
 
{
141
 
        //320 x 240
142
 
        int xpos = input_port_read(space->machine(), "PEN_X_P2");
143
 
        int ypos = input_port_read(space->machine(), "PEN_Y_P2");
144
 
 
145
 
        return xpos + (ypos*168*2);
146
 
}
147
 
 
148
 
static ADDRESS_MAP_START( eolith_map, AS_PROGRAM, 32 )
 
129
READ32_MEMBER(eolith_state::hidctch3_pen1_r)
 
130
{
 
131
        //320 x 240
 
132
        int xpos = ioport("PEN_X_P1")->read();
 
133
        int ypos = ioport("PEN_Y_P1")->read();
 
134
 
 
135
        return xpos + (ypos*168*2);
 
136
}
 
137
 
 
138
READ32_MEMBER(eolith_state::hidctch3_pen2_r)
 
139
{
 
140
        //320 x 240
 
141
        int xpos = ioport("PEN_X_P2")->read();
 
142
        int ypos = ioport("PEN_Y_P2")->read();
 
143
 
 
144
        return xpos + (ypos*168*2);
 
145
}
 
146
 
 
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 */
1315
1314
 
1316
1315
        state->m_coin_counter_bit = 0x2000;
1320
1319
static DRIVER_INIT( hidctch2 )
1321
1320
{
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);
1326
1325
}
1331
1330
 
1332
1331
        // It is not clear why the first reads are needed too
1333
1332
 
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));
1336
1336
 
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));
1339
1339
 
1340
1340
        init_eolith_speedup(machine);
1341
1341
}