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

« back to all changes in this revision

Viewing changes to src/mame/drivers/srumbler.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:
17
17
#include "includes/srumbler.h"
18
18
 
19
19
 
20
 
static WRITE8_HANDLER( srumbler_bankswitch_w )
 
20
WRITE8_MEMBER(srumbler_state::srumbler_bankswitch_w)
21
21
{
22
22
        /*
23
23
      banking is controlled by two PROMs. 0000-4fff is mapped to the same
28
28
      that as well to be 100% accurate.
29
29
     */
30
30
        int i;
31
 
        UINT8 *ROM = space->machine().region("user1")->base();
32
 
        UINT8 *prom1 = space->machine().region("proms")->base() + (data & 0xf0);
33
 
        UINT8 *prom2 = space->machine().region("proms")->base() + 0x100 + ((data & 0x0f) << 4);
 
31
        UINT8 *ROM = memregion("user1")->base();
 
32
        UINT8 *prom1 = memregion("proms")->base() + (data & 0xf0);
 
33
        UINT8 *prom2 = memregion("proms")->base() + 0x100 + ((data & 0x0f) << 4);
34
34
 
35
35
        for (i = 0x05;i < 0x10;i++)
36
36
        {
39
39
                /* bit 2 of prom1 selects ROM or RAM - not supported */
40
40
 
41
41
                sprintf(bankname, "%04x", i*0x1000);
42
 
                memory_set_bankptr(space->machine(), bankname,&ROM[bank*0x1000]);
 
42
                membank(bankname)->set_base(&ROM[bank*0x1000]);
43
43
        }
44
44
}
45
45
 
47
47
{
48
48
        address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
49
49
        /* initialize banked ROM pointers */
50
 
        srumbler_bankswitch_w(space,0,0);
 
50
        srumbler_state *state = machine.driver_data<srumbler_state>();
 
51
        state->srumbler_bankswitch_w(*space,0,0);
51
52
}
52
53
 
53
54
static TIMER_DEVICE_CALLBACK( srumbler_interrupt )
72
73
Ignore the warnings about writing to unmapped memory.
73
74
*/
74
75
 
75
 
static ADDRESS_MAP_START( srumbler_map, AS_PROGRAM, 8 )
 
76
static ADDRESS_MAP_START( srumbler_map, AS_PROGRAM, 8, srumbler_state )
76
77
        AM_RANGE(0x0000, 0x1dff) AM_RAM  /* RAM (of 1 sort or another) */
77
 
        AM_RANGE(0x1e00, 0x1fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
78
 
        AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(srumbler_background_w) AM_BASE_MEMBER(srumbler_state, m_backgroundram)
 
78
        AM_RANGE(0x1e00, 0x1fff) AM_RAM AM_SHARE("spriteram")
 
79
        AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(srumbler_background_w) AM_SHARE("backgroundram")
79
80
        AM_RANGE(0x4008, 0x4008) AM_READ_PORT("SYSTEM") AM_WRITE(srumbler_bankswitch_w)
80
81
        AM_RANGE(0x4009, 0x4009) AM_READ_PORT("P1") AM_WRITE(srumbler_4009_w)
81
82
        AM_RANGE(0x400a, 0x400a) AM_READ_PORT("P2")
82
83
        AM_RANGE(0x400b, 0x400b) AM_READ_PORT("DSW1")
83
84
        AM_RANGE(0x400c, 0x400c) AM_READ_PORT("DSW2")
84
85
        AM_RANGE(0x400a, 0x400d) AM_WRITE(srumbler_scroll_w)
85
 
        AM_RANGE(0x400e, 0x400e) AM_WRITE(soundlatch_w)
86
 
        AM_RANGE(0x5000, 0x5fff) AM_ROMBANK("5000")     AM_WRITE(srumbler_foreground_w) AM_BASE_MEMBER(srumbler_state, m_foregroundram) /* Banked ROM */
 
86
        AM_RANGE(0x400e, 0x400e) AM_WRITE(soundlatch_byte_w)
 
87
        AM_RANGE(0x5000, 0x5fff) AM_ROMBANK("5000")     AM_WRITE(srumbler_foreground_w) AM_SHARE("foregroundram") /* Banked ROM */
87
88
        AM_RANGE(0x6000, 0x6fff) AM_ROMBANK("6000")     /* Banked ROM */
88
89
        AM_RANGE(0x6000, 0x6fff) AM_WRITENOP    /* Video RAM 2 ??? (not used) */
89
90
        AM_RANGE(0x7000, 0x7fff) AM_ROMBANK("7000")     /* Banked ROM */
90
 
        AM_RANGE(0x7000, 0x73ff) AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE_GENERIC(paletteram)
 
91
        AM_RANGE(0x7000, 0x73ff) AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram")
91
92
        AM_RANGE(0x8000, 0x8fff) AM_ROMBANK("8000")     /* Banked ROM */
92
93
        AM_RANGE(0x9000, 0x9fff) AM_ROMBANK("9000")     /* Banked ROM */
93
94
        AM_RANGE(0xa000, 0xafff) AM_ROMBANK("a000")     /* Banked ROM */
98
99
        AM_RANGE(0xf000, 0xffff) AM_ROMBANK("f000")     /* Banked ROM */
99
100
ADDRESS_MAP_END
100
101
 
101
 
static ADDRESS_MAP_START( srumbler_sound_map, AS_PROGRAM, 8 )
 
102
static ADDRESS_MAP_START( srumbler_sound_map, AS_PROGRAM, 8, srumbler_state )
102
103
        AM_RANGE(0x0000, 0x7fff) AM_ROM
103
 
        AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ym1", ym2203_w)
104
 
        AM_RANGE(0xa000, 0xa001) AM_DEVWRITE("ym2", ym2203_w)
 
104
        AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ym1", ym2203_w)
 
105
        AM_RANGE(0xa000, 0xa001) AM_DEVWRITE_LEGACY("ym2", ym2203_w)
105
106
        AM_RANGE(0xc000, 0xc7ff) AM_RAM
106
 
        AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
 
107
        AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r)
107
108
ADDRESS_MAP_END
108
109
 
109
110
 
248
249
        MCFG_MACHINE_START(srumbler)
249
250
 
250
251
        /* video hardware */
251
 
        MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
 
252
        MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
252
253
 
253
254
        MCFG_SCREEN_ADD("screen", RASTER)
254
255
        MCFG_SCREEN_REFRESH_RATE(60)
256
257
        MCFG_SCREEN_SIZE(64*8, 32*8)
257
258
        MCFG_SCREEN_VISIBLE_AREA(10*8, (64-10)*8-1, 1*8, 31*8-1 )
258
259
        MCFG_SCREEN_UPDATE_STATIC(srumbler)
259
 
        MCFG_SCREEN_VBLANK_STATIC(srumbler)
 
260
        MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
260
261
 
261
262
        MCFG_GFXDECODE(srumbler)
262
263
        MCFG_PALETTE_LENGTH(512)