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

« back to all changes in this revision

Viewing changes to src/mame/drivers/tubep.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:
114
114
 *************************************/
115
115
 
116
116
 
117
 
static WRITE8_HANDLER( tubep_LS259_w )
 
117
WRITE8_MEMBER(tubep_state::tubep_LS259_w)
118
118
{
119
119
        switch(offset)
120
120
        {
124
124
                    port b0: bit0 - coin 1 counter
125
125
                    port b1  bit0 - coin 2 counter
126
126
                */
127
 
                                coin_counter_w(space->machine(), offset,data&1);
 
127
                                coin_counter_w(machine(), offset,data&1);
128
128
                                break;
129
129
                case 2:
130
130
                                //something...
144
144
}
145
145
 
146
146
 
147
 
static ADDRESS_MAP_START( tubep_main_map, AS_PROGRAM, 8 )
 
147
static ADDRESS_MAP_START( tubep_main_map, AS_PROGRAM, 8, tubep_state )
148
148
        AM_RANGE(0x0000, 0x7fff) AM_ROM
149
149
        AM_RANGE(0xa000, 0xa7ff) AM_RAM
150
 
        AM_RANGE(0xc000, 0xc7ff) AM_WRITE(tubep_textram_w) AM_BASE_MEMBER(tubep_state, m_textram)       /* RAM on GFX PCB @B13 */
 
150
        AM_RANGE(0xc000, 0xc7ff) AM_WRITE(tubep_textram_w) AM_SHARE("textram")  /* RAM on GFX PCB @B13 */
151
151
        AM_RANGE(0xe000, 0xe7ff) AM_WRITEONLY AM_SHARE("share1")
152
 
        AM_RANGE(0xe800, 0xebff) AM_WRITEONLY AM_SHARE("share4")                                /* row of 8 x 2147 RAMs on main PCB */
 
152
        AM_RANGE(0xe800, 0xebff) AM_WRITEONLY AM_SHARE("backgroundram")                         /* row of 8 x 2147 RAMs on main PCB */
153
153
ADDRESS_MAP_END
154
154
 
155
155
 
156
 
static WRITE8_HANDLER( main_cpu_irq_line_clear_w )
 
156
WRITE8_MEMBER(tubep_state::main_cpu_irq_line_clear_w)
157
157
{
158
 
        tubep_state *state = space->machine().driver_data<tubep_state>();
159
 
        cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
160
 
        logerror("CPU#0 VBLANK int clear at scanline=%3i\n", state->m_curr_scanline);
 
158
        cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE);
 
159
        logerror("CPU#0 VBLANK int clear at scanline=%3i\n", m_curr_scanline);
161
160
        return;
162
161
}
163
162
 
164
163
 
165
 
static WRITE8_HANDLER( tubep_soundlatch_w )
 
164
WRITE8_MEMBER(tubep_state::tubep_soundlatch_w)
166
165
{
167
 
        tubep_state *state = space->machine().driver_data<tubep_state>();
168
 
        state->m_sound_latch = (data&0x7f) | 0x80;
 
166
        m_sound_latch = (data&0x7f) | 0x80;
169
167
}
170
168
 
171
 
static ADDRESS_MAP_START( tubep_main_portmap, AS_IO, 8 )
 
169
static ADDRESS_MAP_START( tubep_main_portmap, AS_IO, 8, tubep_state )
172
170
        ADDRESS_MAP_GLOBAL_MASK(0xff)
173
171
        AM_RANGE(0x80, 0x80) AM_READ_PORT("DSW1")
174
172
        AM_RANGE(0x90, 0x90) AM_READ_PORT("DSW2")
191
189
 *
192
190
 *************************************/
193
191
 
194
 
static WRITE8_HANDLER( second_cpu_irq_line_clear_w )
 
192
WRITE8_MEMBER(tubep_state::second_cpu_irq_line_clear_w)
195
193
{
196
 
        tubep_state *state = space->machine().driver_data<tubep_state>();
197
 
        cputag_set_input_line(space->machine(), "slave", 0, CLEAR_LINE);
198
 
        logerror("CPU#1 VBLANK int clear at scanline=%3i\n", state->m_curr_scanline);
 
194
        cputag_set_input_line(machine(), "slave", 0, CLEAR_LINE);
 
195
        logerror("CPU#1 VBLANK int clear at scanline=%3i\n", m_curr_scanline);
199
196
        return;
200
197
}
201
198
 
202
199
 
203
 
static ADDRESS_MAP_START( tubep_second_map, AS_PROGRAM, 8 )
 
200
static ADDRESS_MAP_START( tubep_second_map, AS_PROGRAM, 8, tubep_state )
204
201
        AM_RANGE(0x0000, 0x7fff) AM_ROM
205
202
        AM_RANGE(0xa000, 0xa000) AM_WRITE(tubep_background_a000_w)
206
203
        AM_RANGE(0xc000, 0xc000) AM_WRITE(tubep_background_c000_w)
207
204
        AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("share1")                                                              /* 6116 #1 */
208
 
        AM_RANGE(0xe800, 0xebff) AM_WRITEONLY AM_SHARE("share4") AM_BASE_MEMBER(tubep_state, m_backgroundram)   /* row of 8 x 2147 RAMs on main PCB */
209
 
        AM_RANGE(0xf000, 0xf3ff) AM_WRITEONLY AM_SHARE("share3")                                                /* sprites color lookup table */
 
205
        AM_RANGE(0xe800, 0xebff) AM_WRITEONLY AM_SHARE("backgroundram") /* row of 8 x 2147 RAMs on main PCB */
 
206
        AM_RANGE(0xf000, 0xf3ff) AM_WRITEONLY AM_SHARE("sprite_color")                                          /* sprites color lookup table */
210
207
        AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share2")                                                                      /* program copies here part of shared ram ?? */
211
208
ADDRESS_MAP_END
212
209
 
213
210
 
214
 
static ADDRESS_MAP_START( tubep_second_portmap, AS_IO, 8 )
 
211
static ADDRESS_MAP_START( tubep_second_portmap, AS_IO, 8, tubep_state )
215
212
        ADDRESS_MAP_GLOBAL_MASK(0xff)
216
213
        AM_RANGE(0x7f, 0x7f) AM_WRITE(second_cpu_irq_line_clear_w)
217
214
ADDRESS_MAP_END
218
215
 
219
216
 
220
 
static READ8_HANDLER( tubep_soundlatch_r )
 
217
READ8_MEMBER(tubep_state::tubep_soundlatch_r)
221
218
{
222
 
        tubep_state *state = space->machine().driver_data<tubep_state>();
223
219
        int res;
224
220
 
225
 
        res = state->m_sound_latch;
226
 
        state->m_sound_latch = 0; /* "=0" ????  or "&= 0x7f" ?????  works either way */
 
221
        res = m_sound_latch;
 
222
        m_sound_latch = 0; /* "=0" ????  or "&= 0x7f" ?????  works either way */
227
223
 
228
224
        return res;
229
225
}
230
226
 
231
 
static READ8_HANDLER( tubep_sound_irq_ack )
 
227
READ8_MEMBER(tubep_state::tubep_sound_irq_ack)
232
228
{
233
 
        cputag_set_input_line(space->machine(), "soundcpu", 0, CLEAR_LINE);
 
229
        cputag_set_input_line(machine(), "soundcpu", 0, CLEAR_LINE);
234
230
        return 0;
235
231
}
236
232
 
237
 
static WRITE8_HANDLER( tubep_sound_unknown )
 
233
WRITE8_MEMBER(tubep_state::tubep_sound_unknown)
238
234
{
239
235
        /*logerror("Sound CPU writes to port 0x07 - unknown function\n");*/
240
236
        return;
241
237
}
242
238
 
243
239
 
244
 
static ADDRESS_MAP_START( tubep_sound_map, AS_PROGRAM, 8 )
 
240
static ADDRESS_MAP_START( tubep_sound_map, AS_PROGRAM, 8, tubep_state )
245
241
        AM_RANGE(0x0000, 0x3fff) AM_ROM
246
242
        AM_RANGE(0xd000, 0xd000) AM_READ(tubep_sound_irq_ack)
247
243
        AM_RANGE(0xe000, 0xe7ff) AM_RAM         /* 6116 #3 */
248
244
ADDRESS_MAP_END
249
245
 
250
246
 
251
 
static ADDRESS_MAP_START( tubep_sound_portmap, AS_IO, 8 )
 
247
static ADDRESS_MAP_START( tubep_sound_portmap, AS_IO, 8, tubep_state )
252
248
        ADDRESS_MAP_GLOBAL_MASK(0xff)
253
 
        AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_address_data_w)
254
 
        AM_RANGE(0x02, 0x03) AM_DEVWRITE("ay2", ay8910_address_data_w)
255
 
        AM_RANGE(0x04, 0x05) AM_DEVWRITE("ay3", ay8910_address_data_w)
 
249
        AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
 
250
        AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
 
251
        AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
256
252
        AM_RANGE(0x06, 0x06) AM_READ(tubep_soundlatch_r)
257
253
        AM_RANGE(0x07, 0x07) AM_WRITE(tubep_sound_unknown)
258
254
ADDRESS_MAP_END
364
360
 *************************************/
365
361
 
366
362
/* MS2010-A CPU (equivalent to NSC8105 with one new opcode: 0xec) on graphics PCB */
367
 
static ADDRESS_MAP_START( nsc_map, AS_PROGRAM, 8 )
368
 
        AM_RANGE(0x0000, 0x03ff) AM_RAM AM_SHARE("share3") AM_BASE_MEMBER(tubep_state, m_sprite_colorsharedram)
 
363
static ADDRESS_MAP_START( nsc_map, AS_PROGRAM, 8, tubep_state )
 
364
        AM_RANGE(0x0000, 0x03ff) AM_RAM AM_SHARE("sprite_color")
369
365
        AM_RANGE(0x0800, 0x0fff) AM_RAM AM_SHARE("share2")
370
366
        AM_RANGE(0x2000, 0x2009) AM_WRITE(tubep_sprite_control_w)
371
367
        AM_RANGE(0x200a, 0x200b) AM_WRITENOP /* not used by the games - perhaps designed for debugging */
380
376
 *
381
377
 *************************************/
382
378
 
383
 
static WRITE8_HANDLER( rjammer_LS259_w )
 
379
WRITE8_MEMBER(tubep_state::rjammer_LS259_w)
384
380
{
385
381
        switch(offset)
386
382
        {
387
383
                case 0:
388
384
                case 1:
389
 
                                coin_counter_w(space->machine(), offset,data&1);        /* bit 0 = coin counter */
 
385
                                coin_counter_w(machine(), offset,data&1);       /* bit 0 = coin counter */
390
386
                                break;
391
387
                case 5:
392
388
                                //screen_flip_w(offset,data&1); /* bit 0 = screen flip, active high */
397
393
}
398
394
 
399
395
 
400
 
static WRITE8_HANDLER( rjammer_soundlatch_w )
 
396
WRITE8_MEMBER(tubep_state::rjammer_soundlatch_w)
401
397
{
402
 
        tubep_state *state = space->machine().driver_data<tubep_state>();
403
 
        state->m_sound_latch = data;
404
 
        cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
 
398
        m_sound_latch = data;
 
399
        cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
405
400
}
406
401
 
407
402
 
408
 
static ADDRESS_MAP_START( rjammer_main_map, AS_PROGRAM, 8 )
 
403
static ADDRESS_MAP_START( rjammer_main_map, AS_PROGRAM, 8, tubep_state )
409
404
        AM_RANGE(0x0000, 0x9fff) AM_ROM
410
405
        AM_RANGE(0xa000, 0xa7ff) AM_RAM                                                                 /* MB8416 SRAM on daughterboard on main PCB (there are two SRAMs, this is the one on the left) */
411
 
        AM_RANGE(0xc000, 0xc7ff) AM_WRITE(tubep_textram_w) AM_BASE_MEMBER(tubep_state, m_textram)/* RAM on GFX PCB @B13 */
 
406
        AM_RANGE(0xc000, 0xc7ff) AM_WRITE(tubep_textram_w) AM_SHARE("textram")/* RAM on GFX PCB @B13 */
412
407
        AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("share1")                                              /* MB8416 SRAM on daughterboard (the one on the right) */
413
408
ADDRESS_MAP_END
414
409
 
415
410
 
416
 
static ADDRESS_MAP_START( rjammer_main_portmap, AS_IO, 8 )
 
411
static ADDRESS_MAP_START( rjammer_main_portmap, AS_IO, 8, tubep_state )
417
412
        ADDRESS_MAP_GLOBAL_MASK(0xff)
418
413
        AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW2")       /* a bug in game code (during attract mode) */
419
414
        AM_RANGE(0x80, 0x80) AM_READ_PORT("DSW2")
428
423
ADDRESS_MAP_END
429
424
 
430
425
 
431
 
static ADDRESS_MAP_START( rjammer_second_map, AS_PROGRAM, 8 )
 
426
static ADDRESS_MAP_START( rjammer_second_map, AS_PROGRAM, 8, tubep_state )
432
427
        AM_RANGE(0x0000, 0x7fff) AM_ROM
433
428
        AM_RANGE(0xa000, 0xa7ff) AM_RAM                                                 /* M5M5117P @21G */
434
429
        AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("share1")                              /* MB8416 on daughterboard (the one on the right) */
435
 
        AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE_MEMBER(tubep_state, m_rjammer_backgroundram)/* M5M5117P @19B (background) */
 
430
        AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("rjammer_bgram")/* M5M5117P @19B (background) */
436
431
        AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share2")
437
432
ADDRESS_MAP_END
438
433
 
439
434
 
440
 
static ADDRESS_MAP_START( rjammer_second_portmap, AS_IO, 8 )
 
435
static ADDRESS_MAP_START( rjammer_second_portmap, AS_IO, 8, tubep_state )
441
436
        ADDRESS_MAP_GLOBAL_MASK(0xff)
442
437
        AM_RANGE(0xb0, 0xb0) AM_WRITE(rjammer_background_page_w)
443
438
        AM_RANGE(0xd0, 0xd0) AM_WRITE(rjammer_background_LS377_w)
529
524
 *
530
525
 *************************************/
531
526
 
532
 
static READ8_HANDLER( rjammer_soundlatch_r )
 
527
READ8_MEMBER(tubep_state::rjammer_soundlatch_r)
533
528
{
534
 
        tubep_state *state = space->machine().driver_data<tubep_state>();
535
 
        int res = state->m_sound_latch;
 
529
        int res = m_sound_latch;
536
530
        return res;
537
531
}
538
532
 
578
572
}
579
573
 
580
574
 
581
 
static WRITE8_HANDLER( rjammer_voice_input_w )
 
575
WRITE8_MEMBER(tubep_state::rjammer_voice_input_w)
582
576
{
583
 
        tubep_state *state = space->machine().driver_data<tubep_state>();
584
577
        /* 8 bits of adpcm data for MSM5205 */
585
578
        /* need to buffer the data, and switch two nibbles on two following interrupts*/
586
579
 
587
 
        state->m_ls377 = data;
 
580
        m_ls377 = data;
588
581
 
589
582
 
590
583
        /* NOTE: game resets interrupt line on ANY access to ANY I/O port.
591
584
            I do it here because this port (0x80) is first one accessed
592
585
            in the interrupt routine.
593
586
    */
594
 
        cputag_set_input_line(space->machine(), "soundcpu", 0, CLEAR_LINE );
 
587
        cputag_set_input_line(machine(), "soundcpu", 0, CLEAR_LINE );
595
588
        return;
596
589
}
597
590
 
598
591
 
599
 
static WRITE8_HANDLER( rjammer_voice_intensity_control_w )
 
592
WRITE8_MEMBER(tubep_state::rjammer_voice_intensity_control_w)
600
593
{
601
594
        /* 4 LSB bits select the intensity (analog circuit that alters the output from MSM5205) */
602
595
        /* need to buffer the data */
604
597
}
605
598
 
606
599
 
607
 
static ADDRESS_MAP_START( rjammer_sound_map, AS_PROGRAM, 8 )
 
600
static ADDRESS_MAP_START( rjammer_sound_map, AS_PROGRAM, 8, tubep_state )
608
601
        AM_RANGE(0x0000, 0x7fff) AM_ROM
609
602
        AM_RANGE(0xe000, 0xe7ff) AM_RAM         /* M5M5117P (M58125P @2C on schematics) */
610
603
ADDRESS_MAP_END
611
604
 
612
605
 
613
 
static ADDRESS_MAP_START( rjammer_sound_portmap, AS_IO, 8 )
 
606
static ADDRESS_MAP_START( rjammer_sound_portmap, AS_IO, 8, tubep_state )
614
607
        ADDRESS_MAP_GLOBAL_MASK(0xff)
615
608
        AM_RANGE(0x00, 0x00) AM_READ(rjammer_soundlatch_r)
616
 
        AM_RANGE(0x10, 0x10) AM_DEVWRITE("msm", rjammer_voice_startstop_w)
617
 
        AM_RANGE(0x18, 0x18) AM_DEVWRITE("msm", rjammer_voice_frequency_select_w)
 
609
        AM_RANGE(0x10, 0x10) AM_DEVWRITE_LEGACY("msm", rjammer_voice_startstop_w)
 
610
        AM_RANGE(0x18, 0x18) AM_DEVWRITE_LEGACY("msm", rjammer_voice_frequency_select_w)
618
611
        AM_RANGE(0x80, 0x80) AM_WRITE(rjammer_voice_input_w)
619
 
        AM_RANGE(0x90, 0x91) AM_DEVWRITE("ay1", ay8910_address_data_w)
620
 
        AM_RANGE(0x92, 0x93) AM_DEVWRITE("ay2", ay8910_address_data_w)
621
 
        AM_RANGE(0x94, 0x95) AM_DEVWRITE("ay3", ay8910_address_data_w)
 
612
        AM_RANGE(0x90, 0x91) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
 
613
        AM_RANGE(0x92, 0x93) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
 
614
        AM_RANGE(0x94, 0x95) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
622
615
        AM_RANGE(0x96, 0x96) AM_WRITE(rjammer_voice_intensity_control_w)
623
616
ADDRESS_MAP_END
624
617