29
29
#include "sound/3812intf.h"
30
30
#include "sound/okim6295.h"
31
31
#include "includes/actfancr.h"
32
#include "video/decbac06.h"
33
#include "video/decmxc06.h"
34
35
/******************************************************************************/
36
37
static WRITE8_HANDLER( triothep_control_select_w )
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;
42
43
static READ8_HANDLER( triothep_control_r )
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)
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 */
57
58
static WRITE8_HANDLER( actfancr_sound_w )
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);
64
65
/******************************************************************************/
66
static ADDRESS_MAP_START( actfan_map, ADDRESS_SPACE_PROGRAM, 8 )
67
static WRITE8_HANDLER( actfancr_buffer_spriteram_w)
69
actfancr_state *state = space->machine().driver_data<actfancr_state>();
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++)
77
state->m_spriteram16[i] = buffered_spriteram[i*2] | (buffered_spriteram[(i*2)+1] <<8);
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 */
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)
102
121
/******************************************************************************/
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)
279
298
static MACHINE_START( actfancr )
281
actfancr_state *state = machine->driver_data<actfancr_state>();
300
actfancr_state *state = machine.driver_data<actfancr_state>();
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");
287
306
static MACHINE_START( triothep )
289
actfancr_state *state = machine->driver_data<actfancr_state>();
308
actfancr_state *state = machine.driver_data<actfancr_state>();
291
310
MACHINE_START_CALL(actfancr);
293
state_save_register_global(machine, state->trio_control_select);
312
state->save_item(NAME(state->m_trio_control_select));
296
315
static MACHINE_RESET( actfancr )
298
actfancr_state *state = machine->driver_data<actfancr_state>();
301
state->flipscreen = 0;
302
for (i = 0; i < 0x20; i++)
304
state->control_1[i] = 0;
305
state->control_2[i] = 0;
317
actfancr_state *state = machine.driver_data<actfancr_state>();
318
state->m_flipscreen = 0;
309
321
static MACHINE_RESET( triothep )
311
actfancr_state *state = machine->driver_data<actfancr_state>();
323
actfancr_state *state = machine.driver_data<actfancr_state>();
313
325
MACHINE_RESET_CALL(actfancr);
314
state->trio_control_select = 0;
326
state->m_trio_control_select = 0;
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)
341
355
MCFG_GFXDECODE(actfan)
342
356
MCFG_PALETTE_LENGTH(768)
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);
363
MCFG_DEVICE_ADD("spritegen", deco_mxc06_, 0)
364
deco_mxc06_device_config::set_gfx_region(device, 1);
344
366
MCFG_VIDEO_START(actfancr)
345
MCFG_VIDEO_UPDATE(actfancr)
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)
386
409
MCFG_GFXDECODE(triothep)
387
410
MCFG_PALETTE_LENGTH(768)
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);
417
MCFG_DEVICE_ADD("spritegen", deco_mxc06_, 0)
418
deco_mxc06_device_config::set_gfx_region(device, 1);
420
MCFG_VIDEO_START(actfancr)
392
422
/* sound hardware */
393
423
MCFG_SPEAKER_STANDARD_MONO("mono")
577
607
/******************************************************************************/
579
static READ8_HANDLER( cycle_r )
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];
586
return state->main_ram[0x27];
588
if (pc == 0xe29a && ret == 0)
590
cpu_spinuntil_int(space->cpu);
597
static READ8_HANDLER( cyclej_r )
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];
604
return state->main_ram[0x27];
606
if (pc == 0xe2b1 && ret == 0)
608
cpu_spinuntil_int(space->cpu);
615
static DRIVER_INIT( actfancr )
617
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f0026, 0x1f0027, 0, 0, cycle_r);
620
static DRIVER_INIT( actfancrj )
622
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f0026, 0x1f0027, 0, 0, cyclej_r);
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 )