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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Emmanuel Kasper, Félix Arreola Rodríguez, Jordi Mallach
  • Date: 2011-05-11 21:06:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110511210650-jizvh8a6x117y9hr
Tags: 0.142-1
[ Emmanuel Kasper ]
* New upstream release
* Set NOWERROR=1 to allow compiling with gcc-4.6
* Remove fix_powerpc_build.patch, as upstream has taken it in this release
* Add gnome-video-arcade front end as a suggested package

[ Félix Arreola Rodríguez ]
* Add kfreebsd-build.patch to quilt series, to fix build on kfreebsd

[ Jordi Mallach ]
* Remove unneeded and bogus addition of --with-quilt to the dh invocation.
* Add Cesare Falco (long time Ubuntu maintainer) to Uploaders, and wrap
  them into multiple lines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "sound/3812intf.h"
30
30
#include "sound/okim6295.h"
31
31
#include "includes/actfancr.h"
32
 
 
 
32
#include "video/decbac06.h"
 
33
#include "video/decmxc06.h"
33
34
 
34
35
/******************************************************************************/
35
36
 
36
37
static WRITE8_HANDLER( triothep_control_select_w )
37
38
{
38
 
        actfancr_state *state = space->machine->driver_data<actfancr_state>();
39
 
        state->trio_control_select = data;
 
39
        actfancr_state *state = space->machine().driver_data<actfancr_state>();
 
40
        state->m_trio_control_select = data;
40
41
}
41
42
 
42
43
static READ8_HANDLER( triothep_control_r )
43
44
{
44
 
        actfancr_state *state = space->machine->driver_data<actfancr_state>();
45
 
        switch (state->trio_control_select)
 
45
        actfancr_state *state = space->machine().driver_data<actfancr_state>();
 
46
        switch (state->m_trio_control_select)
46
47
        {
47
 
                case 0: return input_port_read(space->machine, "P1");
48
 
                case 1: return input_port_read(space->machine, "P2");
49
 
                case 2: return input_port_read(space->machine, "DSW1");
50
 
                case 3: return input_port_read(space->machine, "DSW2");
51
 
                case 4: return input_port_read(space->machine, "SYSTEM");       /* VBL */
 
48
                case 0: return input_port_read(space->machine(), "P1");
 
49
                case 1: return input_port_read(space->machine(), "P2");
 
50
                case 2: return input_port_read(space->machine(), "DSW1");
 
51
                case 3: return input_port_read(space->machine(), "DSW2");
 
52
                case 4: return input_port_read(space->machine(), "SYSTEM");     /* VBL */
52
53
        }
53
54
 
54
55
        return 0xff;
56
57
 
57
58
static WRITE8_HANDLER( actfancr_sound_w )
58
59
{
59
 
        actfancr_state *state = space->machine->driver_data<actfancr_state>();
 
60
        actfancr_state *state = space->machine().driver_data<actfancr_state>();
60
61
        soundlatch_w(space, 0, data & 0xff);
61
 
        cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
 
62
        device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
62
63
}
63
64
 
64
65
/******************************************************************************/
65
66
 
66
 
static ADDRESS_MAP_START( actfan_map, ADDRESS_SPACE_PROGRAM, 8 )
 
67
static WRITE8_HANDLER( actfancr_buffer_spriteram_w)
 
68
{
 
69
        actfancr_state *state = space->machine().driver_data<actfancr_state>();
 
70
 
 
71
        UINT8* buffered_spriteram = space->machine().generic.buffered_spriteram.u8;
 
72
        // make a buffered copy
 
73
        memcpy(buffered_spriteram, space->machine().generic.spriteram.u8, 0x800);
 
74
        // copy to a 16-bit region for our sprite draw code too
 
75
        for (int i=0;i<0x800/2;i++)
 
76
        {
 
77
                state->m_spriteram16[i] = buffered_spriteram[i*2] | (buffered_spriteram[(i*2)+1] <<8);
 
78
        }
 
79
}
 
80
 
 
81
static ADDRESS_MAP_START( actfan_map, AS_PROGRAM, 8 )
67
82
        AM_RANGE(0x000000, 0x02ffff) AM_ROM
68
 
        AM_RANGE(0x060000, 0x06001f) AM_WRITE(actfancr_pf1_control_w)
69
 
        AM_RANGE(0x062000, 0x063fff) AM_READWRITE(actfancr_pf1_data_r, actfancr_pf1_data_w) AM_BASE_MEMBER(actfancr_state, pf1_data)
70
 
        AM_RANGE(0x070000, 0x07001f) AM_WRITE(actfancr_pf2_control_w)
71
 
        AM_RANGE(0x072000, 0x0727ff) AM_READWRITE(actfancr_pf2_data_r, actfancr_pf2_data_w) AM_BASE_MEMBER(actfancr_state, pf2_data)
 
83
        AM_RANGE(0x060000, 0x060007) AM_DEVWRITE("tilegen1", deco_bac06_pf_control0_8bit_w)
 
84
        AM_RANGE(0x060010, 0x06001f) AM_DEVWRITE("tilegen1", deco_bac06_pf_control1_8bit_swap_w)
 
85
        AM_RANGE(0x062000, 0x063fff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
 
86
        AM_RANGE(0x070000, 0x070007) AM_DEVWRITE("tilegen2", deco_bac06_pf_control0_8bit_w)
 
87
        AM_RANGE(0x070010, 0x07001f) AM_DEVWRITE("tilegen2", deco_bac06_pf_control1_8bit_swap_w)
 
88
        AM_RANGE(0x072000, 0x0727ff) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
72
89
        AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
73
 
        AM_RANGE(0x110000, 0x110001) AM_WRITE(buffer_spriteram_w)
 
90
        AM_RANGE(0x110000, 0x110001) AM_WRITE(actfancr_buffer_spriteram_w)
74
91
        AM_RANGE(0x120000, 0x1205ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE_GENERIC(paletteram)
75
92
        AM_RANGE(0x130000, 0x130000) AM_READ_PORT("P1")
76
93
        AM_RANGE(0x130001, 0x130001) AM_READ_PORT("P2")
78
95
        AM_RANGE(0x130003, 0x130003) AM_READ_PORT("DSW2")
79
96
        AM_RANGE(0x140000, 0x140001) AM_READ_PORT("SYSTEM")     /* VBL */
80
97
        AM_RANGE(0x150000, 0x150001) AM_WRITE(actfancr_sound_w)
81
 
        AM_RANGE(0x1f0000, 0x1f3fff) AM_RAM AM_BASE_MEMBER(actfancr_state, main_ram) /* Main ram */
 
98
        AM_RANGE(0x1f0000, 0x1f3fff) AM_RAM AM_BASE_MEMBER(actfancr_state, m_main_ram) /* Main ram */
82
99
ADDRESS_MAP_END
83
100
 
84
 
static ADDRESS_MAP_START( triothep_map, ADDRESS_SPACE_PROGRAM, 8 )
 
101
static ADDRESS_MAP_START( triothep_map, AS_PROGRAM, 8 )
85
102
        AM_RANGE(0x000000, 0x03ffff) AM_ROM
86
 
        AM_RANGE(0x040000, 0x04001f) AM_WRITE(actfancr_pf2_control_w)
87
 
        AM_RANGE(0x044000, 0x045fff) AM_READWRITE(actfancr_pf2_data_r, actfancr_pf2_data_w) AM_BASE_MEMBER(actfancr_state, pf2_data)
88
 
        AM_RANGE(0x046400, 0x0467ff) AM_WRITENOP /* Pf2 rowscroll - is it used? */
89
 
        AM_RANGE(0x060000, 0x06001f) AM_WRITE(actfancr_pf1_control_w)
90
 
        AM_RANGE(0x064000, 0x0647ff) AM_READWRITE(actfancr_pf1_data_r, actfancr_pf1_data_w) AM_BASE_MEMBER(actfancr_state, pf1_data)
91
 
        AM_RANGE(0x066400, 0x0667ff) AM_WRITEONLY AM_BASE_MEMBER(actfancr_state, pf1_rowscroll_data)
 
103
        AM_RANGE(0x040000, 0x040007) AM_DEVWRITE("tilegen2", deco_bac06_pf_control0_8bit_w)
 
104
        AM_RANGE(0x040010, 0x04001f) AM_DEVWRITE("tilegen2", deco_bac06_pf_control1_8bit_swap_w)
 
105
        AM_RANGE(0x044000, 0x045fff) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
 
106
        AM_RANGE(0x046400, 0x0467ff) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_rowscroll_8bit_swap_r, deco_bac06_pf_rowscroll_8bit_swap_w)
 
107
        AM_RANGE(0x060000, 0x060007) AM_DEVWRITE("tilegen1", deco_bac06_pf_control0_8bit_w)
 
108
        AM_RANGE(0x060010, 0x06001f) AM_DEVWRITE("tilegen1", deco_bac06_pf_control1_8bit_swap_w)
 
109
        AM_RANGE(0x064000, 0x0647ff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
 
110
        AM_RANGE(0x066400, 0x0667ff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_rowscroll_8bit_swap_r, deco_bac06_pf_rowscroll_8bit_swap_w)
92
111
        AM_RANGE(0x100000, 0x100001) AM_WRITE(actfancr_sound_w)
93
 
        AM_RANGE(0x110000, 0x110001) AM_WRITE(buffer_spriteram_w)
 
112
        AM_RANGE(0x110000, 0x110001) AM_WRITE(actfancr_buffer_spriteram_w)
94
113
        AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
95
114
        AM_RANGE(0x130000, 0x1305ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE_GENERIC(paletteram)
96
115
        AM_RANGE(0x140000, 0x140001) AM_READNOP /* Value doesn't matter */
97
 
        AM_RANGE(0x1f0000, 0x1f3fff) AM_RAM AM_BASE_MEMBER(actfancr_state, main_ram) /* Main ram */
 
116
        AM_RANGE(0x1f0000, 0x1f3fff) AM_RAM AM_BASE_MEMBER(actfancr_state, m_main_ram) /* Main ram */
98
117
        AM_RANGE(0x1ff000, 0x1ff001) AM_READWRITE(triothep_control_r, triothep_control_select_w)
99
118
        AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE(h6280_irq_status_w)
100
119
ADDRESS_MAP_END
101
120
 
102
121
/******************************************************************************/
103
122
 
104
 
static ADDRESS_MAP_START( dec0_s_map, ADDRESS_SPACE_PROGRAM, 8 )
 
123
static ADDRESS_MAP_START( dec0_s_map, AS_PROGRAM, 8 )
105
124
        AM_RANGE(0x0000, 0x07ff) AM_RAM
106
125
        AM_RANGE(0x0800, 0x0801) AM_DEVWRITE("ym1", ym2203_w)
107
126
        AM_RANGE(0x1000, 0x1001) AM_DEVWRITE("ym2", ym3812_w)
265
284
 
266
285
static void sound_irq(device_t *device, int linestate)
267
286
{
268
 
        actfancr_state *state = device->machine->driver_data<actfancr_state>();
269
 
        cpu_set_input_line(state->audiocpu, 0, linestate); /* IRQ */
 
287
        actfancr_state *state = device->machine().driver_data<actfancr_state>();
 
288
        device_set_input_line(state->m_audiocpu, 0, linestate); /* IRQ */
270
289
}
271
290
 
272
291
static const ym3812_interface ym3812_config =
278
297
 
279
298
static MACHINE_START( actfancr )
280
299
{
281
 
        actfancr_state *state = machine->driver_data<actfancr_state>();
 
300
        actfancr_state *state = machine.driver_data<actfancr_state>();
282
301
 
283
 
        state->maincpu = machine->device("maincpu");
284
 
        state->audiocpu = machine->device("audiocpu");
 
302
        state->m_maincpu = machine.device("maincpu");
 
303
        state->m_audiocpu = machine.device("audiocpu");
285
304
}
286
305
 
287
306
static MACHINE_START( triothep )
288
307
{
289
 
        actfancr_state *state = machine->driver_data<actfancr_state>();
 
308
        actfancr_state *state = machine.driver_data<actfancr_state>();
290
309
 
291
310
        MACHINE_START_CALL(actfancr);
292
311
 
293
 
        state_save_register_global(machine, state->trio_control_select);
 
312
        state->save_item(NAME(state->m_trio_control_select));
294
313
}
295
314
 
296
315
static MACHINE_RESET( actfancr )
297
316
{
298
 
        actfancr_state *state = machine->driver_data<actfancr_state>();
299
 
        int i;
300
 
 
301
 
        state->flipscreen = 0;
302
 
        for (i = 0; i < 0x20; i++)
303
 
        {
304
 
                state->control_1[i] = 0;
305
 
                state->control_2[i] = 0;
306
 
        }
 
317
        actfancr_state *state = machine.driver_data<actfancr_state>();
 
318
        state->m_flipscreen = 0;
307
319
}
308
320
 
309
321
static MACHINE_RESET( triothep )
310
322
{
311
 
        actfancr_state *state = machine->driver_data<actfancr_state>();
 
323
        actfancr_state *state = machine.driver_data<actfancr_state>();
312
324
 
313
325
        MACHINE_RESET_CALL(actfancr);
314
 
        state->trio_control_select = 0;
 
326
        state->m_trio_control_select = 0;
315
327
}
316
328
 
317
329
/******************************************************************************/
338
350
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
339
351
        MCFG_SCREEN_SIZE(32*8, 32*8)
340
352
        MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
 
353
        MCFG_SCREEN_UPDATE(actfancr)
 
354
 
341
355
        MCFG_GFXDECODE(actfan)
342
356
        MCFG_PALETTE_LENGTH(768)
343
357
 
 
358
        MCFG_DEVICE_ADD("tilegen1", deco_bac06_, 0)
 
359
        deco_bac06_device_config::set_gfx_region_wide(device, 2,2,1);
 
360
        MCFG_DEVICE_ADD("tilegen2", deco_bac06_, 0)
 
361
        deco_bac06_device_config::set_gfx_region_wide(device, 0,0,0);
 
362
 
 
363
        MCFG_DEVICE_ADD("spritegen", deco_mxc06_, 0)
 
364
        deco_mxc06_device_config::set_gfx_region(device, 1);
 
365
 
344
366
        MCFG_VIDEO_START(actfancr)
345
 
        MCFG_VIDEO_UPDATE(actfancr)
346
367
 
347
368
        /* sound hardware */
348
369
        MCFG_SPEAKER_STANDARD_MONO("mono")
383
404
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
384
405
        MCFG_SCREEN_SIZE(32*8, 32*8)
385
406
        MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
 
407
        MCFG_SCREEN_UPDATE(actfancr)
 
408
 
386
409
        MCFG_GFXDECODE(triothep)
387
410
        MCFG_PALETTE_LENGTH(768)
388
411
 
389
 
        MCFG_VIDEO_START(triothep)
390
 
        MCFG_VIDEO_UPDATE(triothep)
 
412
        MCFG_DEVICE_ADD("tilegen1", deco_bac06_, 0)
 
413
        deco_bac06_device_config::set_gfx_region_wide(device, 2,2,0);
 
414
        MCFG_DEVICE_ADD("tilegen2", deco_bac06_, 0)
 
415
        deco_bac06_device_config::set_gfx_region_wide(device, 0,0,0);
 
416
 
 
417
        MCFG_DEVICE_ADD("spritegen", deco_mxc06_, 0)
 
418
        deco_mxc06_device_config::set_gfx_region(device, 1);
 
419
 
 
420
        MCFG_VIDEO_START(actfancr)
391
421
 
392
422
        /* sound hardware */
393
423
        MCFG_SPEAKER_STANDARD_MONO("mono")
576
606
 
577
607
/******************************************************************************/
578
608
 
579
 
static READ8_HANDLER( cycle_r )
580
 
{
581
 
        actfancr_state *state = space->machine->driver_data<actfancr_state>();
582
 
        int pc = cpu_get_pc(space->cpu);
583
 
        int ret = state->main_ram[0x26];
584
 
 
585
 
        if (offset == 1)
586
 
                return state->main_ram[0x27];
587
 
 
588
 
        if (pc == 0xe29a && ret == 0)
589
 
        {
590
 
                cpu_spinuntil_int(space->cpu);
591
 
                return 1;
592
 
        }
593
 
 
594
 
        return ret;
595
 
}
596
 
 
597
 
static READ8_HANDLER( cyclej_r )
598
 
{
599
 
        actfancr_state *state = space->machine->driver_data<actfancr_state>();
600
 
        int pc = cpu_get_pc(space->cpu);
601
 
        int ret = state->main_ram[0x26];
602
 
 
603
 
        if (offset == 1)
604
 
                return state->main_ram[0x27];
605
 
 
606
 
        if (pc == 0xe2b1 && ret == 0)
607
 
        {
608
 
                cpu_spinuntil_int(space->cpu);
609
 
                return 1;
610
 
        }
611
 
 
612
 
        return ret;
613
 
}
614
 
 
615
 
static DRIVER_INIT( actfancr )
616
 
{
617
 
        memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f0026, 0x1f0027, 0, 0, cycle_r);
618
 
}
619
 
 
620
 
static DRIVER_INIT( actfancrj )
621
 
{
622
 
        memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f0026, 0x1f0027, 0, 0, cyclej_r);
623
 
}
624
 
 
625
 
 
626
 
GAME( 1989, actfancr, 0,        actfancr, actfancr, actfancr, ROT0, "Data East Corporation", "Act-Fancer Cybernetick Hyper Weapon (World revision 2)", GAME_SUPPORTS_SAVE )
627
 
GAME( 1989, actfancr1,actfancr, actfancr, actfancr, actfancr, ROT0, "Data East Corporation", "Act-Fancer Cybernetick Hyper Weapon (World revision 1)", GAME_SUPPORTS_SAVE )
628
 
GAME( 1989, actfancrj,actfancr, actfancr, actfancr, actfancrj,ROT0, "Data East Corporation", "Act-Fancer Cybernetick Hyper Weapon (Japan revision 1)", GAME_SUPPORTS_SAVE )
629
 
GAME( 1989, triothep, 0,        triothep, triothep, 0,        ROT0, "Data East Corporation", "Trio The Punch - Never Forget Me... (World)", GAME_SUPPORTS_SAVE )
630
 
GAME( 1989, triothepj,triothep, triothep, triothep, 0,        ROT0, "Data East Corporation", "Trio The Punch - Never Forget Me... (Japan)", GAME_SUPPORTS_SAVE )
 
609
GAME( 1989, actfancr, 0,        actfancr, actfancr, 0, ROT0, "Data East Corporation", "Act-Fancer Cybernetick Hyper Weapon (World revision 2)", GAME_SUPPORTS_SAVE )
 
610
GAME( 1989, actfancr1,actfancr, actfancr, actfancr, 0, ROT0, "Data East Corporation", "Act-Fancer Cybernetick Hyper Weapon (World revision 1)", GAME_SUPPORTS_SAVE )
 
611
GAME( 1989, actfancrj,actfancr, actfancr, actfancr, 0, ROT0, "Data East Corporation", "Act-Fancer Cybernetick Hyper Weapon (Japan revision 1)", GAME_SUPPORTS_SAVE )
 
612
GAME( 1989, triothep, 0,        triothep, triothep, 0, ROT0, "Data East Corporation", "Trio The Punch - Never Forget Me... (World)", GAME_SUPPORTS_SAVE )
 
613
GAME( 1989, triothepj,triothep, triothep, triothep, 0, ROT0, "Data East Corporation", "Trio The Punch - Never Forget Me... (Japan)", GAME_SUPPORTS_SAVE )