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

« back to all changes in this revision

Viewing changes to src/mame/drivers/fastlane.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:
28
28
}
29
29
 
30
30
 
31
 
static WRITE8_HANDLER( k007121_registers_w )
 
31
WRITE8_MEMBER(fastlane_state::k007121_registers_w)
32
32
{
33
 
        fastlane_state *state = space->machine().driver_data<fastlane_state>();
34
33
 
35
34
        if (offset < 8)
36
 
                k007121_ctrl_w(state->m_k007121, offset, data);
 
35
                k007121_ctrl_w(m_k007121, offset, data);
37
36
        else    /* scroll registers */
38
 
                state->m_k007121_regs[offset] = data;
 
37
                m_k007121_regs[offset] = data;
39
38
}
40
39
 
41
 
static WRITE8_HANDLER( fastlane_bankswitch_w )
 
40
WRITE8_MEMBER(fastlane_state::fastlane_bankswitch_w)
42
41
{
43
 
        fastlane_state *state = space->machine().driver_data<fastlane_state>();
44
42
 
45
43
        /* bits 0 & 1 coin counters */
46
 
        coin_counter_w(space->machine(), 0,data & 0x01);
47
 
        coin_counter_w(space->machine(), 1,data & 0x02);
 
44
        coin_counter_w(machine(), 0,data & 0x01);
 
45
        coin_counter_w(machine(), 1,data & 0x02);
48
46
 
49
47
        /* bits 2 & 3 = bank number */
50
 
        memory_set_bank(space->machine(), "bank1", (data & 0x0c) >> 2);
 
48
        membank("bank1")->set_entry((data & 0x0c) >> 2);
51
49
 
52
50
        /* bit 4: bank # for the 007232 (chip 2) */
53
 
        k007232_set_bank(state->m_konami2, 0 + ((data & 0x10) >> 4), 2 + ((data & 0x10) >> 4));
 
51
        k007232_set_bank(m_konami2, 0 + ((data & 0x10) >> 4), 2 + ((data & 0x10) >> 4));
54
52
 
55
53
        /* other bits seems to be unused */
56
54
}
69
67
}
70
68
 
71
69
 
72
 
static ADDRESS_MAP_START( fastlane_map, AS_PROGRAM, 8 )
73
 
        AM_RANGE(0x0000, 0x005f) AM_RAM_WRITE(k007121_registers_w) AM_BASE_MEMBER(fastlane_state, m_k007121_regs)       /* 007121 registers */
 
70
static ADDRESS_MAP_START( fastlane_map, AS_PROGRAM, 8, fastlane_state )
 
71
        AM_RANGE(0x0000, 0x005f) AM_RAM_WRITE(k007121_registers_w) AM_SHARE("k007121_regs")     /* 007121 registers */
74
72
        AM_RANGE(0x0800, 0x0800) AM_READ_PORT("DSW3")
75
73
        AM_RANGE(0x0801, 0x0801) AM_READ_PORT("P2")
76
74
        AM_RANGE(0x0802, 0x0802) AM_READ_PORT("P1")
79
77
        AM_RANGE(0x0901, 0x0901) AM_READ_PORT("DSW2")
80
78
        AM_RANGE(0x0b00, 0x0b00) AM_WRITE(watchdog_reset_w)                                                                                     /* watchdog reset */
81
79
        AM_RANGE(0x0c00, 0x0c00) AM_WRITE(fastlane_bankswitch_w)                                                                        /* bankswitch control */
82
 
        AM_RANGE(0x0d00, 0x0d0d) AM_DEVREADWRITE("konami1", fastlane_k007232_r, fastlane_k007232_w)     /* 007232 registers (chip 1) */
83
 
        AM_RANGE(0x0e00, 0x0e0d) AM_DEVREADWRITE("konami2", fastlane_k007232_r, fastlane_k007232_w)     /* 007232 registers (chip 2) */
84
 
        AM_RANGE(0x0f00, 0x0f1f) AM_DEVREADWRITE("k051733", k051733_r, k051733_w)                                                                       /* 051733 (protection) */
85
 
        AM_RANGE(0x1000, 0x17ff) AM_RAM AM_BASE_MEMBER(fastlane_state, m_paletteram)                                                                            /* Palette RAM */
 
80
        AM_RANGE(0x0d00, 0x0d0d) AM_DEVREADWRITE_LEGACY("konami1", fastlane_k007232_r, fastlane_k007232_w)      /* 007232 registers (chip 1) */
 
81
        AM_RANGE(0x0e00, 0x0e0d) AM_DEVREADWRITE_LEGACY("konami2", fastlane_k007232_r, fastlane_k007232_w)      /* 007232 registers (chip 2) */
 
82
        AM_RANGE(0x0f00, 0x0f1f) AM_DEVREADWRITE_LEGACY("k051733", k051733_r, k051733_w)                                                                        /* 051733 (protection) */
 
83
        AM_RANGE(0x1000, 0x17ff) AM_RAM AM_SHARE("paletteram")                                                                          /* Palette RAM */
86
84
        AM_RANGE(0x1800, 0x1fff) AM_RAM                                                                                                                         /* Work RAM */
87
 
        AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(fastlane_vram1_w) AM_BASE_MEMBER(fastlane_state, m_videoram1)             /* Video RAM (chip 1) */
88
 
        AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(fastlane_vram2_w) AM_BASE_MEMBER(fastlane_state, m_videoram2)             /* Video RAM (chip 2) */
89
 
        AM_RANGE(0x3000, 0x3fff) AM_RAM AM_BASE_MEMBER(fastlane_state, m_spriteram)                                                                                     /* Sprite RAM */
 
85
        AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(fastlane_vram1_w) AM_SHARE("videoram1")           /* Video RAM (chip 1) */
 
86
        AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(fastlane_vram2_w) AM_SHARE("videoram2")           /* Video RAM (chip 2) */
 
87
        AM_RANGE(0x3000, 0x3fff) AM_RAM AM_SHARE("spriteram")                                                                                   /* Sprite RAM */
90
88
        AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")                                                                                                            /* banked ROM */
91
89
        AM_RANGE(0x8000, 0xffff) AM_ROM                                                                                                                         /* ROM */
92
90
ADDRESS_MAP_END
196
194
static MACHINE_START( fastlane )
197
195
{
198
196
        fastlane_state *state = machine.driver_data<fastlane_state>();
199
 
        UINT8 *ROM = machine.region("maincpu")->base();
 
197
        UINT8 *ROM = state->memregion("maincpu")->base();
200
198
 
201
 
        memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
 
199
        state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
202
200
 
203
201
        state->m_konami2 = machine.device("konami2");
204
202
        state->m_k007121 = machine.device("k007121");