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

« back to all changes in this revision

Viewing changes to src/mame/drivers/stadhero.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:
20
20
 
21
21
/******************************************************************************/
22
22
 
23
 
static READ16_HANDLER( stadhero_control_r )
 
23
READ16_MEMBER(stadhero_state::stadhero_control_r)
24
24
{
25
25
        switch (offset<<1)
26
26
        {
27
27
                case 0:
28
 
                        return input_port_read(space->machine(), "INPUTS");
 
28
                        return ioport("INPUTS")->read();
29
29
 
30
30
                case 2:
31
 
                        return input_port_read(space->machine(), "COIN");
 
31
                        return ioport("COIN")->read();
32
32
 
33
33
                case 4:
34
 
                        return input_port_read(space->machine(), "DSW");
 
34
                        return ioport("DSW")->read();
35
35
        }
36
36
 
37
 
        logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",cpu_get_pc(&space->device()),0x30c000+offset);
 
37
        logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",cpu_get_pc(&space.device()),0x30c000+offset);
38
38
        return ~0;
39
39
}
40
40
 
41
 
static WRITE16_HANDLER( stadhero_control_w )
 
41
WRITE16_MEMBER(stadhero_state::stadhero_control_w)
42
42
{
43
43
        switch (offset<<1)
44
44
        {
45
45
                case 4: /* Interrupt ack (VBL - IRQ 5) */
46
46
                        break;
47
47
                case 6: /* 6502 sound cpu */
48
 
                        soundlatch_w(space, 0, data & 0xff);
49
 
                        cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
 
48
                        soundlatch_byte_w(space, 0, data & 0xff);
 
49
                        cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
50
50
                        break;
51
51
                default:
52
 
                        logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(&space->device()),data,0x30c010+offset);
 
52
                        logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(&space.device()),data,0x30c010+offset);
53
53
                        break;
54
54
        }
55
55
}
57
57
 
58
58
/******************************************************************************/
59
59
 
60
 
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16 )
 
60
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, stadhero_state )
61
61
        AM_RANGE(0x000000, 0x01ffff) AM_ROM
62
 
        AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(stadhero_pf1_data_w) AM_BASE_MEMBER(stadhero_state, m_pf1_data)
63
 
        AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("tilegen1", deco_bac06_pf_control_0_w)                                                 /* text layer */
64
 
        AM_RANGE(0x240010, 0x240017) AM_DEVWRITE("tilegen1", deco_bac06_pf_control_1_w)
65
 
        AM_RANGE(0x260000, 0x261fff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
 
62
        AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(stadhero_pf1_data_w) AM_SHARE("pf1_data")
 
63
        AM_RANGE(0x240000, 0x240007) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_0_w)                                                  /* text layer */
 
64
        AM_RANGE(0x240010, 0x240017) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_1_w)
 
65
        AM_RANGE(0x260000, 0x261fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
66
66
        AM_RANGE(0x30c000, 0x30c00b) AM_READWRITE(stadhero_control_r, stadhero_control_w)
67
 
        AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
 
67
        AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
68
68
        AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* Main ram */
69
 
        AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x000800) AM_RAM AM_BASE_MEMBER(stadhero_state, m_spriteram)
 
69
        AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x000800) AM_RAM AM_SHARE("spriteram")
70
70
ADDRESS_MAP_END
71
71
 
72
72
/******************************************************************************/
73
73
 
74
 
static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8 )
 
74
static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, stadhero_state )
75
75
        AM_RANGE(0x0000, 0x05ff) AM_RAM
76
 
        AM_RANGE(0x0800, 0x0801) AM_DEVWRITE("ym1", ym2203_w)
77
 
        AM_RANGE(0x1000, 0x1001) AM_DEVWRITE("ym2", ym3812_w)
78
 
        AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r)
79
 
        AM_RANGE(0x3800, 0x3800) AM_DEVREADWRITE_MODERN("oki", okim6295_device, read, write)
 
76
        AM_RANGE(0x0800, 0x0801) AM_DEVWRITE_LEGACY("ym1", ym2203_w)
 
77
        AM_RANGE(0x1000, 0x1001) AM_DEVWRITE_LEGACY("ym2", ym3812_w)
 
78
        AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r)
 
79
        AM_RANGE(0x3800, 0x3800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
80
80
        AM_RANGE(0x8000, 0xffff) AM_ROM
81
81
ADDRESS_MAP_END
82
82
 
139
139
        PORT_DIPUNUSED( 0x8000, IP_ACTIVE_LOW )
140
140
 
141
141
        PORT_START("COIN")      /* 0x30c002 & 0x30c003 */
142
 
        PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE")
143
 
        PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom_port_read, "FAKE")
 
142
        PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "FAKE")
 
143
        PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "FAKE")
144
144
 
145
145
        PORT_START("FAKE")
146
146
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )            /* related to music/sound */
150
150
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
151
151
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
152
152
        PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
153
 
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
 
153
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
154
154
INPUT_PORTS_END
155
155
 
156
156
/******************************************************************************/