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

« back to all changes in this revision

Viewing changes to src/mame/drivers/compgolf.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:
34
34
        state->m_scrolly_lo = data;
35
35
}
36
36
 
37
 
static WRITE8_HANDLER( compgolf_ctrl_w )
 
37
WRITE8_MEMBER(compgolf_state::compgolf_ctrl_w)
38
38
{
39
 
        compgolf_state *state = space->machine().driver_data<compgolf_state>();
40
39
 
41
40
        /* bit 4 and 6 are always set */
42
41
 
43
42
        int new_bank = (data & 4) >> 2;
44
43
 
45
 
        if (state->m_bank != new_bank)
 
44
        if (m_bank != new_bank)
46
45
        {
47
 
                state->m_bank = new_bank;
48
 
                memory_set_bank(space->machine(), "bank1", state->m_bank);
 
46
                m_bank = new_bank;
 
47
                membank("bank1")->set_entry(m_bank);
49
48
        }
50
49
 
51
 
        state->m_scrollx_hi = (data & 1) << 8;
52
 
        state->m_scrolly_hi = (data & 2) << 7;
 
50
        m_scrollx_hi = (data & 1) << 8;
 
51
        m_scrolly_hi = (data & 2) << 7;
53
52
}
54
53
 
55
54
 
59
58
 *
60
59
 *************************************/
61
60
 
62
 
static ADDRESS_MAP_START( compgolf_map, AS_PROGRAM, 8 )
 
61
static ADDRESS_MAP_START( compgolf_map, AS_PROGRAM, 8, compgolf_state )
63
62
        AM_RANGE(0x0000, 0x07ff) AM_RAM
64
 
        AM_RANGE(0x1000, 0x17ff) AM_RAM_WRITE(compgolf_video_w) AM_BASE_MEMBER(compgolf_state, m_videoram)
65
 
        AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(compgolf_back_w) AM_BASE_MEMBER(compgolf_state, m_bg_ram)
66
 
        AM_RANGE(0x2000, 0x2060) AM_RAM AM_BASE_MEMBER(compgolf_state, m_spriteram)
 
63
        AM_RANGE(0x1000, 0x17ff) AM_RAM_WRITE(compgolf_video_w) AM_SHARE("videoram")
 
64
        AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(compgolf_back_w) AM_SHARE("bg_ram")
 
65
        AM_RANGE(0x2000, 0x2060) AM_RAM AM_SHARE("spriteram")
67
66
        AM_RANGE(0x2061, 0x2061) AM_WRITENOP
68
67
        AM_RANGE(0x3000, 0x3000) AM_READ_PORT("P1")
69
68
        AM_RANGE(0x3001, 0x3001) AM_READ_PORT("P2") AM_WRITE(compgolf_ctrl_w)
70
69
        AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW1")
71
70
        AM_RANGE(0x3003, 0x3003) AM_READ_PORT("DSW2")
72
 
        AM_RANGE(0x3800, 0x3801) AM_DEVREADWRITE("ymsnd", ym2203_r, ym2203_w)
 
71
        AM_RANGE(0x3800, 0x3801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w)
73
72
        AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
74
73
        AM_RANGE(0x8000, 0xffff) AM_ROM
75
74
ADDRESS_MAP_END
100
99
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
101
100
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
102
101
        PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
103
 
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
 
102
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
104
103
 
105
104
        PORT_START("DSW1")
106
105
        PORT_DIPNAME( 0x03,   0x03, DEF_STR( Coin_A ) )
347
346
 
348
347
static void compgolf_expand_bg(running_machine &machine)
349
348
{
350
 
        UINT8 *GFXDST = machine.region("gfx2")->base();
351
 
        UINT8 *GFXSRC = machine.region("gfx4")->base();
 
349
        UINT8 *GFXDST = machine.root_device().memregion("gfx2")->base();
 
350
        UINT8 *GFXSRC = machine.root_device().memregion("gfx4")->base();
352
351
 
353
352
        int x;
354
353
 
361
360
 
362
361
static DRIVER_INIT( compgolf )
363
362
{
364
 
        memory_configure_bank(machine, "bank1", 0, 2, machine.region("user1")->base(), 0x4000);
 
363
        machine.root_device().membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("user1")->base(), 0x4000);
365
364
        compgolf_expand_bg(machine);
366
365
}
367
366