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

« back to all changes in this revision

Viewing changes to src/mame/drivers/battlera.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:
31
31
 
32
32
/******************************************************************************/
33
33
 
34
 
static WRITE8_HANDLER( battlera_sound_w )
 
34
WRITE8_MEMBER(battlera_state::battlera_sound_w)
35
35
{
36
36
        if (offset == 0)
37
37
        {
38
 
                soundlatch_w(space,0,data);
39
 
                cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
 
38
                soundlatch_byte_w(space,0,data);
 
39
                cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE);
40
40
        }
41
41
}
42
42
 
43
43
/******************************************************************************/
44
44
 
45
 
static WRITE8_HANDLER( control_data_w )
 
45
WRITE8_MEMBER(battlera_state::control_data_w)
46
46
{
47
 
        battlera_state *state = space->machine().driver_data<battlera_state>();
48
 
        state->m_control_port_select=data;
 
47
        m_control_port_select=data;
49
48
}
50
49
 
51
 
static READ8_HANDLER( control_data_r )
 
50
READ8_MEMBER(battlera_state::control_data_r)
52
51
{
53
 
        battlera_state *state = space->machine().driver_data<battlera_state>();
54
 
        switch (state->m_control_port_select)
 
52
        switch (m_control_port_select)
55
53
        {
56
 
                case 0xfe: return input_port_read(space->machine(), "IN0"); /* Player 1 */
57
 
                case 0xfd: return input_port_read(space->machine(), "IN1"); /* Player 2 */
58
 
                case 0xfb: return input_port_read(space->machine(), "IN2"); /* Coins */
59
 
                case 0xf7: return input_port_read(space->machine(), "DSW2"); /* Dip 2 */
60
 
                case 0xef: return input_port_read(space->machine(), "DSW1"); /* Dip 1 */
 
54
                case 0xfe: return ioport("IN0")->read(); /* Player 1 */
 
55
                case 0xfd: return ioport("IN1")->read(); /* Player 2 */
 
56
                case 0xfb: return ioport("IN2")->read(); /* Coins */
 
57
                case 0xf7: return ioport("DSW2")->read(); /* Dip 2 */
 
58
                case 0xef: return ioport("DSW1")->read(); /* Dip 1 */
61
59
        }
62
60
 
63
61
    return 0xff;
65
63
 
66
64
/******************************************************************************/
67
65
 
68
 
static ADDRESS_MAP_START( battlera_map, AS_PROGRAM, 8 )
 
66
static ADDRESS_MAP_START( battlera_map, AS_PROGRAM, 8, battlera_state )
69
67
        AM_RANGE(0x000000, 0x0fffff) AM_ROM
70
68
        AM_RANGE(0x100000, 0x10ffff) AM_READWRITE(HuC6270_debug_r, HuC6270_debug_w) /* Cheat to edit vram data */
71
69
        AM_RANGE(0x1e0800, 0x1e0801) AM_WRITE(battlera_sound_w)
72
 
        AM_RANGE(0x1e1000, 0x1e13ff) AM_WRITE(battlera_palette_w) AM_BASE_GENERIC(paletteram)
 
70
        AM_RANGE(0x1e1000, 0x1e13ff) AM_WRITE(battlera_palette_w) AM_SHARE("paletteram")
73
71
        AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") /* Main ram */
74
72
        AM_RANGE(0x1fe000, 0x1fe001) AM_READWRITE(HuC6270_register_r, HuC6270_register_w)
75
73
        AM_RANGE(0x1fe002, 0x1fe003) AM_WRITE(HuC6270_data_w)
76
74
        AM_RANGE(0x1ff000, 0x1ff001) AM_READWRITE(control_data_r, control_data_w)
77
 
        AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE(h6280_irq_status_w)
 
75
        AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w)
78
76
ADDRESS_MAP_END
79
77
 
80
 
static ADDRESS_MAP_START( battlera_portmap, AS_IO, 8 )
 
78
static ADDRESS_MAP_START( battlera_portmap, AS_IO, 8, battlera_state )
81
79
        AM_RANGE(0x00, 0x01) AM_WRITE(HuC6270_register_w)
82
80
        AM_RANGE(0x02, 0x03) AM_WRITE(HuC6270_data_w)
83
81
ADDRESS_MAP_END
97
95
                cputag_set_input_line(device->machine(), "audiocpu", 1, HOLD_LINE);
98
96
}
99
97
 
100
 
static WRITE8_HANDLER( battlera_adpcm_data_w )
 
98
WRITE8_MEMBER(battlera_state::battlera_adpcm_data_w)
101
99
{
102
 
        battlera_state *state = space->machine().driver_data<battlera_state>();
103
 
        state->m_msm5205next = data;
 
100
        m_msm5205next = data;
104
101
}
105
102
 
106
103
static WRITE8_DEVICE_HANDLER( battlera_adpcm_reset_w )
108
105
        msm5205_reset_w(device, 0);
109
106
}
110
107
 
111
 
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
 
108
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, battlera_state )
112
109
        AM_RANGE(0x000000, 0x00ffff) AM_ROM
113
 
        AM_RANGE(0x040000, 0x040001) AM_DEVWRITE("ymsnd", ym2203_w)
 
110
        AM_RANGE(0x040000, 0x040001) AM_DEVWRITE_LEGACY("ymsnd", ym2203_w)
114
111
        AM_RANGE(0x080000, 0x080001) AM_WRITE(battlera_adpcm_data_w)
115
 
        AM_RANGE(0x1fe800, 0x1fe80f) AM_DEVWRITE("c6280", c6280_w)
 
112
        AM_RANGE(0x1fe800, 0x1fe80f) AM_DEVWRITE_LEGACY("c6280", c6280_w)
116
113
        AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank7") /* Main ram */
117
 
        AM_RANGE(0x1ff000, 0x1ff001) AM_READ(soundlatch_r) AM_DEVWRITE("msm", battlera_adpcm_reset_w)
118
 
        AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE(h6280_irq_status_w)
 
114
        AM_RANGE(0x1ff000, 0x1ff001) AM_READ(soundlatch_byte_r) AM_DEVWRITE_LEGACY("msm", battlera_adpcm_reset_w)
 
115
        AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w)
119
116
ADDRESS_MAP_END
120
117
 
121
118
/******************************************************************************/