~ubuntu-branches/debian/wheezy/mame/wheezy

« back to all changes in this revision

Viewing changes to src/mame/drivers/sshangha.c

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Emmanuel Kasper, Félix Arreola Rodríguez, Jordi Mallach
  • Date: 2011-05-11 21:06:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110511210650-jizvh8a6x117y9hr
Tags: 0.142-1
[ Emmanuel Kasper ]
* New upstream release
* Set NOWERROR=1 to allow compiling with gcc-4.6
* Remove fix_powerpc_build.patch, as upstream has taken it in this release
* Add gnome-video-arcade front end as a suggested package

[ Félix Arreola Rodríguez ]
* Add kfreebsd-build.patch to quilt series, to fix build on kfreebsd

[ Jordi Mallach ]
* Remove unneeded and bogus addition of --with-quilt to the dh invocation.
* Add Cesare Falco (long time Ubuntu maintainer) to Uploaders, and wrap
  them into multiple lines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
  Emulation by Bryan McPhail, mish@tendril.co.uk
20
20
 
 
21
  ToDo:
 
22
 
 
23
  Palette handling is somewhat hacked, see paletteram16_xbgr_word_be_sprites_w
 
24
 
 
25
  ----
21
26
 
22
27
Stephh's notes (based on the games M68000 code and some tests) :
23
28
 
38
43
  - The "Use Mahjong Tiles" Dip Switch only has an effect when playing
39
44
    "Shanghai Advanced".
40
45
 
41
 
1) 'sshangha'
42
 
 
43
 
  - There are writes to 0x100000-0x10000f (code from 0x000964 to 0x000a8c),
44
 
    but their effect is unknown.
45
 
 
46
 
2) 'sshanghb'
47
 
 
48
 
  - There are writes to 0x101000-0x10100f (code from 0x000964 to 0x000a8c),
49
 
    but their effect is unknown. Note that the code is the SAME as the one
50
 
    in 'sshangha' (only the 0x10?00? addresses are different).
51
 
 
52
46
***************************************************************************/
53
47
 
54
48
#include "emu.h"
57
51
#include "sound/2203intf.h"
58
52
#include "sound/okim6295.h"
59
53
#include "includes/sshangha.h"
 
54
#include "video/decospr.h"
 
55
#include "video/deco16ic.h"
60
56
 
61
57
#define SSHANGHA_HACK   0
62
58
 
63
 
static UINT16 *sshangha_prot_data;
64
59
 
65
 
static UINT16 *sshangha_sound_shared_ram;
66
60
 
67
61
/******************************************************************************/
68
62
 
69
63
static WRITE16_HANDLER( sshangha_protection16_w )
70
64
{
71
 
        COMBINE_DATA(&sshangha_prot_data[offset]);
 
65
        sshangha_state *state = space->machine().driver_data<sshangha_state>();
 
66
        COMBINE_DATA(&state->m_prot_data[offset]);
72
67
 
73
 
        logerror("CPU #0 PC %06x: warning - write unmapped control address %06x %04x\n",cpu_get_pc(space->cpu),offset<<1,data);
 
68
        logerror("CPU #0 PC %06x: warning - write unmapped control address %06x %04x\n",cpu_get_pc(&space->device()),offset<<1,data);
74
69
}
75
70
 
76
71
/* Protection/IO chip 146 */
77
72
static READ16_HANDLER( sshangha_protection16_r )
78
73
{
 
74
        sshangha_state *state = space->machine().driver_data<sshangha_state>();
79
75
        switch (offset)
80
76
        {
81
77
                case 0x050 >> 1:
82
 
                        return input_port_read(space->machine, "INPUTS");
 
78
                        return input_port_read(space->machine(), "INPUTS");
83
79
                case 0x76a >> 1:
84
 
                        return input_port_read(space->machine, "SYSTEM");
 
80
                        return input_port_read(space->machine(), "SYSTEM");
85
81
                case 0x0ac >> 1:
86
 
                        return input_port_read(space->machine, "DSW");
 
82
                        return input_port_read(space->machine(), "DSW");
87
83
 
88
84
                // Protection TODO
89
85
        }
90
86
 
91
 
        logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",cpu_get_pc(space->cpu),offset<<1);
92
 
        return sshangha_prot_data[offset];
 
87
        logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",cpu_get_pc(&space->device()),offset<<1);
 
88
        return state->m_prot_data[offset];
93
89
}
94
90
 
95
91
static READ16_HANDLER( sshanghb_protection16_r )
96
92
{
 
93
        sshangha_state *state = space->machine().driver_data<sshangha_state>();
97
94
        switch (offset)
98
95
        {
99
96
                case 0x050 >> 1:
100
 
                        return input_port_read(space->machine, "INPUTS");
 
97
                        return input_port_read(space->machine(), "INPUTS");
101
98
                case 0x76a >> 1:
102
 
                        return input_port_read(space->machine, "SYSTEM");
 
99
                        return input_port_read(space->machine(), "SYSTEM");
103
100
                case 0x0ac >> 1:
104
 
                        return input_port_read(space->machine, "DSW");
 
101
                        return input_port_read(space->machine(), "DSW");
105
102
        }
106
103
 
107
 
        return sshangha_prot_data[offset];
 
104
        return state->m_prot_data[offset];
108
105
}
109
106
 
110
107
/* Probably returns 0xffff when sprite DMA is complete, the game waits on it */
117
114
 
118
115
static MACHINE_RESET( sshangha )
119
116
{
120
 
        address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
121
 
        /* Such thing is needed as there is no code to turn the screen
122
 
       to normal orientation when the game is reset.
123
 
       I'm using the value that forces the screen to be in normal
124
 
         orientation when entering the "test mode"
125
 
         (check the game code from 0x0006b8 to 0x0006f0).
126
 
       I can't tell however if this is accurate or not. */
127
 
        sshangha_control_0_w(space, 0, 0x10, 0x00ff);
128
117
}
129
118
 
130
119
/******************************************************************************/
131
120
 
132
 
static ADDRESS_MAP_START( sshangha_map, ADDRESS_SPACE_PROGRAM, 16 )
 
121
INLINE void set_color_888(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT32 data)
 
122
{
 
123
        palette_set_color_rgb(machine, color, (data >> rshift) & 0xff, (data >> gshift) & 0xff, (data >> bshift) & 0xff);
 
124
}
 
125
 
 
126
 
 
127
WRITE16_HANDLER( paletteram16_xbgr_word_be_sprites2_w )
 
128
{
 
129
        sshangha_state *state = space->machine().driver_data<sshangha_state>();
 
130
        COMBINE_DATA(&state->m_sprite_paletteram2[offset]);
 
131
        set_color_888(space->machine(), (offset/2)+0x100, 0, 8, 16, state->m_sprite_paletteram2[(offset) | 1] | (state->m_sprite_paletteram2[(offset) & ~1] << 16) );
 
132
}
 
133
 
 
134
WRITE16_HANDLER( paletteram16_xbgr_word_be_sprites_w )
 
135
{
 
136
        // hack??? we have to call this otherwise the sprite colours for some selected tiles are wrong (most noticable on the 2nd level of quest mode)
 
137
        // however if we simply mirror the memory both ways the how to play screen ends up with bad colours
 
138
        // we use the 2nd copy of palette ram for low priority tiles only..
 
139
        // is this related to the bootleg only, or does the original have this issue too?
 
140
        // maybe related to sprite DMA on the original, or the apparent lack of a 2nd sprite controller on the bootleg.
 
141
        paletteram16_xbgr_word_be_sprites2_w(space,offset,data,mem_mask);
 
142
 
 
143
        sshangha_state *state = space->machine().driver_data<sshangha_state>();
 
144
        COMBINE_DATA(&state->m_sprite_paletteram[offset]);
 
145
        set_color_888(space->machine(), (offset/2)+0x000, 0, 8, 16, state->m_sprite_paletteram[(offset) | 1] | (state->m_sprite_paletteram[(offset) & ~1] << 16) );
 
146
}
 
147
 
 
148
WRITE16_HANDLER( paletteram16_xbgr_word_be_tilelow_w )
 
149
{
 
150
        sshangha_state *state = space->machine().driver_data<sshangha_state>();
 
151
        COMBINE_DATA(&state->m_tile_paletteram1[offset]);
 
152
        set_color_888(space->machine(), (offset/2)+0x200, 0, 8, 16, state->m_tile_paletteram1[(offset) | 1] | (state->m_tile_paletteram1[(offset) & ~1] << 16) );
 
153
}
 
154
 
 
155
WRITE16_HANDLER( paletteram16_xbgr_word_be_tilehigh_w )
 
156
{
 
157
        sshangha_state *state = space->machine().driver_data<sshangha_state>();
 
158
        COMBINE_DATA(&state->m_tile_paletteram2[offset]);
 
159
        set_color_888(space->machine(), (offset/2)+0x300, 0, 8, 16, state->m_tile_paletteram2[(offset) | 1] | (state->m_tile_paletteram2[(offset) & ~1] << 16) );
 
160
}
 
161
 
 
162
static ADDRESS_MAP_START( sshangha_map, AS_PROGRAM, 16 )
133
163
        AM_RANGE(0x000000, 0x03ffff) AM_ROM
134
 
        AM_RANGE(0x100000, 0x10000f) AM_RAM AM_BASE(&sshangha_sound_shared_ram)
 
164
        AM_RANGE(0x100000, 0x10000f) AM_RAM AM_BASE_MEMBER(sshangha_state, m_sound_shared_ram)
135
165
 
136
 
        AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(sshangha_pf1_data_w) AM_BASE(&sshangha_pf1_data)
137
 
        AM_RANGE(0x202000, 0x203fff) AM_RAM_WRITE(sshangha_pf2_data_w) AM_BASE(&sshangha_pf2_data)
138
 
        AM_RANGE(0x204000, 0x2047ff) AM_RAM AM_BASE(&sshangha_pf1_rowscroll)
139
 
        AM_RANGE(0x206000, 0x2067ff) AM_RAM AM_BASE(&sshangha_pf2_rowscroll)
 
166
        AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
 
167
        AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
 
168
        AM_RANGE(0x204000, 0x2047ff) AM_RAM AM_BASE_MEMBER(sshangha_state, m_pf1_rowscroll)
 
169
        AM_RANGE(0x206000, 0x2067ff) AM_RAM AM_BASE_MEMBER(sshangha_state, m_pf2_rowscroll)
140
170
        AM_RANGE(0x206800, 0x207fff) AM_RAM
141
 
        AM_RANGE(0x300000, 0x30000f) AM_WRITE(sshangha_control_0_w)
 
171
        AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("tilegen1", deco16ic_pf_control_w)
142
172
        AM_RANGE(0x320000, 0x320001) AM_WRITE(sshangha_video_w)
143
173
        AM_RANGE(0x320002, 0x320005) AM_WRITENOP
144
174
        AM_RANGE(0x320006, 0x320007) AM_READNOP //irq ack
149
179
        AM_RANGE(0x360000, 0x360fff) AM_RAM AM_BASE_GENERIC(spriteram2)
150
180
        AM_RANGE(0x370000, 0x370001) AM_READ(deco_71_r)
151
181
        AM_RANGE(0x370000, 0x370007) AM_WRITENOP
152
 
        AM_RANGE(0x380000, 0x383fff) AM_RAM_WRITE(paletteram16_xbgr_word_be_w) AM_BASE_GENERIC(paletteram)
153
 
        AM_RANGE(0x3c0000, 0x3c0fff) AM_RAM     /* Sprite ram buffer on bootleg only?? */
 
182
 
 
183
        AM_RANGE(0x380000, 0x3803ff) AM_RAM_WRITE(paletteram16_xbgr_word_be_sprites_w) AM_BASE_MEMBER(sshangha_state, m_sprite_paletteram)
 
184
        AM_RANGE(0x380400, 0x3807ff) AM_RAM_WRITE(paletteram16_xbgr_word_be_tilehigh_w) AM_BASE_MEMBER(sshangha_state, m_tile_paletteram2)
 
185
        AM_RANGE(0x380800, 0x380bff) AM_RAM_WRITE(paletteram16_xbgr_word_be_sprites2_w) AM_BASE_MEMBER(sshangha_state, m_sprite_paletteram2)
 
186
        AM_RANGE(0x380c00, 0x380fff) AM_RAM_WRITE(paletteram16_xbgr_word_be_tilelow_w) AM_BASE_MEMBER(sshangha_state, m_tile_paletteram1)
 
187
        AM_RANGE(0x381000, 0x383fff) AM_RAM // unused palette area
 
188
 
154
189
        AM_RANGE(0xfec000, 0xff3fff) AM_RAM
155
 
        AM_RANGE(0xff4000, 0xff47ff) AM_READWRITE(sshangha_protection16_r,sshangha_protection16_w) AM_BASE(&sshangha_prot_data)
 
190
        AM_RANGE(0xff4000, 0xff47ff) AM_READWRITE(sshangha_protection16_r,sshangha_protection16_w) AM_BASE_MEMBER(sshangha_state, m_prot_data)
156
191
ADDRESS_MAP_END
157
192
 
158
 
static ADDRESS_MAP_START( sshanghb_map, ADDRESS_SPACE_PROGRAM, 16 )
 
193
static ADDRESS_MAP_START( sshanghb_map, AS_PROGRAM, 16 )
159
194
        AM_RANGE(0x000000, 0x03ffff) AM_ROM
160
195
        AM_RANGE(0x084000, 0x0847ff) AM_READ(sshanghb_protection16_r)
161
 
        AM_RANGE(0x101000, 0x10100f) AM_RAM AM_BASE(&sshangha_sound_shared_ram) /* the bootleg writes here */
 
196
        AM_RANGE(0x101000, 0x10100f) AM_RAM AM_BASE_MEMBER(sshangha_state, m_sound_shared_ram) /* the bootleg writes here */
162
197
 
163
 
        AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(sshangha_pf1_data_w) AM_BASE(&sshangha_pf1_data)
164
 
        AM_RANGE(0x202000, 0x203fff) AM_RAM_WRITE(sshangha_pf2_data_w) AM_BASE(&sshangha_pf2_data)
165
 
        AM_RANGE(0x204000, 0x2047ff) AM_RAM AM_BASE(&sshangha_pf1_rowscroll)
166
 
        AM_RANGE(0x206000, 0x2067ff) AM_RAM AM_BASE(&sshangha_pf2_rowscroll)
 
198
        AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
 
199
        AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
 
200
        AM_RANGE(0x204000, 0x2047ff) AM_RAM AM_BASE_MEMBER(sshangha_state, m_pf1_rowscroll)
 
201
        AM_RANGE(0x206000, 0x2067ff) AM_RAM AM_BASE_MEMBER(sshangha_state, m_pf2_rowscroll)
167
202
        AM_RANGE(0x206800, 0x207fff) AM_RAM
168
 
        AM_RANGE(0x300000, 0x30000f) AM_WRITE(sshangha_control_0_w)
 
203
        AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("tilegen1", deco16ic_pf_control_w)
169
204
        AM_RANGE(0x320000, 0x320001) AM_WRITE(sshangha_video_w)
170
205
        AM_RANGE(0x320002, 0x320005) AM_WRITENOP
171
206
        AM_RANGE(0x320006, 0x320007) AM_READNOP //irq ack
172
207
 
173
 
        AM_RANGE(0x340000, 0x340fff) AM_RAM AM_BASE_GENERIC(spriteram)
174
 
        AM_RANGE(0x350000, 0x350001) AM_READ(deco_71_r)
175
 
        AM_RANGE(0x350000, 0x350007) AM_WRITENOP
176
 
        AM_RANGE(0x360000, 0x360fff) AM_RAM AM_BASE_GENERIC(spriteram2)
177
 
        AM_RANGE(0x370000, 0x370001) AM_READ(deco_71_r)
178
 
        AM_RANGE(0x370000, 0x370007) AM_WRITENOP
179
 
        AM_RANGE(0x380000, 0x383fff) AM_RAM_WRITE(paletteram16_xbgr_word_be_w) AM_BASE_GENERIC(paletteram)
180
 
        AM_RANGE(0x3c0000, 0x3c0fff) AM_RAM     /* Sprite ram buffer on bootleg only?? */
 
208
        AM_RANGE(0x340000, 0x340fff) AM_RAM // original spriteram
 
209
 
 
210
        AM_RANGE(0x380000, 0x3803ff) AM_RAM_WRITE(paletteram16_xbgr_word_be_sprites_w) AM_BASE_MEMBER(sshangha_state, m_sprite_paletteram)
 
211
        AM_RANGE(0x380400, 0x3807ff) AM_RAM_WRITE(paletteram16_xbgr_word_be_tilehigh_w) AM_BASE_MEMBER(sshangha_state, m_tile_paletteram2)
 
212
        AM_RANGE(0x380800, 0x380bff) AM_RAM_WRITE(paletteram16_xbgr_word_be_sprites2_w) AM_BASE_MEMBER(sshangha_state, m_sprite_paletteram2)
 
213
        AM_RANGE(0x380c00, 0x380fff) AM_RAM_WRITE(paletteram16_xbgr_word_be_tilelow_w) AM_BASE_MEMBER(sshangha_state, m_tile_paletteram1)
 
214
        AM_RANGE(0x381000, 0x383fff) AM_RAM // unused palette area
 
215
 
 
216
        AM_RANGE(0x3c0000, 0x3c0fff) AM_RAM AM_BASE_GENERIC(spriteram) // bootleg spriteram
181
217
        AM_RANGE(0xfec000, 0xff3fff) AM_RAM
182
218
        AM_RANGE(0xff4000, 0xff47ff) AM_RAM
183
219
ADDRESS_MAP_END
188
224
 
189
225
static READ8_HANDLER(sshangha_sound_shared_r)
190
226
{
191
 
        return sshangha_sound_shared_ram[offset] & 0xff;
 
227
        sshangha_state *state = space->machine().driver_data<sshangha_state>();
 
228
        return state->m_sound_shared_ram[offset] & 0xff;
192
229
}
193
230
 
194
231
static WRITE8_HANDLER(sshangha_sound_shared_w)
195
232
{
196
 
        sshangha_sound_shared_ram[offset] = data & 0xff;
 
233
        sshangha_state *state = space->machine().driver_data<sshangha_state>();
 
234
        state->m_sound_shared_ram[offset] = data & 0xff;
197
235
}
198
236
 
199
237
/* Note: there's rom data after 0x8000 but the game never seem to call a rom bank, left-over? */
200
 
static ADDRESS_MAP_START( sshangha_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
 
238
static ADDRESS_MAP_START( sshangha_sound_map, AS_PROGRAM, 8 )
201
239
        AM_RANGE(0x0000, 0x7fff) AM_ROM
202
240
        AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2203_r,ym2203_w)
203
241
        AM_RANGE(0xc200, 0xc201) AM_DEVREADWRITE_MODERN("oki", okim6295_device, read, write)
320
358
};
321
359
 
322
360
static GFXDECODE_START( sshangha )
323
 
        GFXDECODE_ENTRY( "gfx1", 0, charlayout,  256, 64 ) /* Characters 8x8 */
324
 
        GFXDECODE_ENTRY( "gfx1", 0, tilelayout,  256, 64 ) /* Tiles 16x16 */
325
 
        GFXDECODE_ENTRY( "gfx2", 0, tilelayout,    0, 32 ) /* Sprites 16x16 */
 
361
        GFXDECODE_ENTRY( "gfx1", 0, charlayout,  0x200, 64 ) /* Characters 8x8 */
 
362
        GFXDECODE_ENTRY( "gfx1", 0, tilelayout,  0x200, 64 ) /* Tiles 16x16 */
 
363
        GFXDECODE_ENTRY( "gfx2", 0, tilelayout,    0, 64 ) /* Sprites 16x16 */
326
364
GFXDECODE_END
327
365
 
328
366
/******************************************************************************/
329
367
 
330
368
static void irqhandler(device_t *device, int state)
331
369
{
332
 
        cputag_set_input_line(device->machine, "audiocpu", 0, state);
 
370
        cputag_set_input_line(device->machine(), "audiocpu", 0, state);
333
371
}
334
372
 
335
373
static const ym2203_interface ym2203_config =
342
380
        irqhandler
343
381
};
344
382
 
345
 
static MACHINE_CONFIG_START( sshangha, driver_device )
 
383
static int sshangha_bank_callback( int bank )
 
384
{
 
385
        bank = bank >> 4;
 
386
        return bank * 0x1000;
 
387
}
 
388
 
 
389
static const deco16ic_interface sshangha_deco16ic_tilegen1_intf =
 
390
{
 
391
        "screen",
 
392
        0, 1,
 
393
        0x0f, 0x0f,     /* trans masks (default values) */
 
394
        0x10, 0x00, /* color base */
 
395
        0x0f, 0x0f,     /* color masks (default values) */
 
396
        sshangha_bank_callback,
 
397
        sshangha_bank_callback,
 
398
        0,1
 
399
};
 
400
 
 
401
 
 
402
static MACHINE_CONFIG_START( sshangha, sshangha_state )
346
403
 
347
404
        /* basic machine hardware */
348
405
        MCFG_CPU_ADD("maincpu", M68000, 28000000/2)
352
409
        MCFG_CPU_ADD("audiocpu", Z80, 16000000/4)
353
410
        MCFG_CPU_PROGRAM_MAP(sshangha_sound_map)
354
411
 
355
 
        MCFG_QUANTUM_TIME(HZ(6000))
 
412
        MCFG_QUANTUM_TIME(attotime::from_hz(6000))
356
413
 
357
414
        MCFG_MACHINE_RESET(sshangha)    /* init machine */
358
415
 
359
 
        /* video hardware */
360
 
        /*MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)*/
361
 
 
362
416
        MCFG_SCREEN_ADD("screen", RASTER)
363
417
        MCFG_SCREEN_REFRESH_RATE(60)
364
418
        MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529))
365
 
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
 
419
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
366
420
        MCFG_SCREEN_SIZE(40*8, 32*8)
367
421
        MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
 
422
        MCFG_SCREEN_UPDATE(sshangha)
368
423
 
369
424
        MCFG_GFXDECODE(sshangha)
370
 
        MCFG_PALETTE_LENGTH(4096)
 
425
        MCFG_PALETTE_LENGTH(0x4000)
 
426
 
 
427
        MCFG_DECO16IC_ADD("tilegen1", sshangha_deco16ic_tilegen1_intf)
 
428
 
 
429
        MCFG_DEVICE_ADD("spritegen1", decospr_, 0)
 
430
        decospr_device_config::set_gfx_region(device, 2);
 
431
 
 
432
        MCFG_DEVICE_ADD("spritegen2", decospr_, 0)
 
433
        decospr_device_config::set_gfx_region(device, 2);
 
434
 
371
435
 
372
436
        MCFG_VIDEO_START(sshangha)
373
 
        MCFG_VIDEO_UPDATE(sshangha)
374
437
 
375
438
        /* sound hardware */
376
439
        MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") /* sure it's stereo? */
439
502
#if SSHANGHA_HACK
440
503
        /* This is a hack to allow you to use the extra features
441
504
         of the first "Unused" Dip Switch (see notes above). */
442
 
        UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
 
505
        UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
443
506
        RAM[0x000384/2] = 0x4e71;
444
507
        RAM[0x000386/2] = 0x4e71;
445
508
        RAM[0x000388/2] = 0x4e71;