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

« back to all changes in this revision

Viewing changes to mess/src/mame/drivers/wwfwfest.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jordi Mallach, Emmanuel Kasper
  • Date: 2011-12-19 22:56:27 UTC
  • mfrom: (0.1.2)
  • Revision ID: package-import@ubuntu.com-20111219225627-ub5oga1oys4ogqzm
Tags: 0.144-1
[ Jordi Mallach ]
* Fix syntax errors in DEP5 copyright file (lintian).
* Use a versioned copyright Format specification field.
* Update Vcs-* URLs.
* Move transitional packages to the new metapackages section, and make
  them priority extra.
* Remove references to GNU/Linux and MESS sources from copyright.
* Add build variables for s390x.
* Use .xz tarballs as it cuts 4MB for the upstream sources.
* Add nplayers.ini as a patch. Update copyright file to add CC-BY-SA-3.0.

[ Emmanuel Kasper ]
* New upstream release. Closes: #651538.
* Add Free Desktop compliant png icons of various sizes taken from
  the hydroxygen iconset
* Mess is now built from a new source package, to avoid possible source
  incompatibilities between mame and the mess overlay.
* Mame-tools are not built from the mame source package anymore, but
  from the mess source package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*******************************************************************************
2
 
 WWF Wrestlefest (C) 1991 Technos Japan  (drivers/wwfwfest.c)
3
 
********************************************************************************
4
 
 driver by David Haywood
5
 
 
6
 
 Special Thanks to:
7
 
 
8
 
 Richard Bush & the Rest of the Raine Team - Raine's WWF Wrestlefest driver on
9
 
 which some of this driver has been based.
10
 
 
11
 
********************************************************************************
12
 
 
13
 
 Hardware:
14
 
 
15
 
 Primary CPU : 68000 - 12MHz
16
 
 
17
 
 Sound CPUs : Z80 - 3.579MHz
18
 
 
19
 
 Sound Chips : YM2151, M6295
20
 
 
21
 
 4 Layers from now on if mentioned will be refered to as
22
 
 
23
 
 BG0 - Background Layer 0
24
 
 BG1 - Background Layer 1
25
 
 SPR - Sprites
26
 
 FG0 - Foreground / Text Layer
27
 
 
28
 
 Priorities of BG0, BG1 and SPR can be changed
29
 
 
30
 
********************************************************************************
31
 
 
32
 
 Change Log:
33
 
 20 Jun 2001 | Did Pretty Much everything else, the game is now playable.
34
 
 19 Jun 2001 | Started the driver, based on Raine, the WWF Superstars driver,
35
 
             | and the Double Dragon 3 Driver, got most of the basics done,
36
 
             | the game will boot showing some graphics.
37
 
 
38
 
*******************************************************************************/
39
 
 
40
 
#include "emu.h"
41
 
#include "cpu/m68000/m68000.h"
42
 
#include "cpu/z80/z80.h"
43
 
#include "includes/wwfwfest.h"
44
 
#include "sound/2151intf.h"
45
 
#include "sound/okim6295.h"
46
 
 
47
 
#define MASTER_CLOCK            XTAL_24MHz
48
 
#define CPU_CLOCK                       MASTER_CLOCK / 2
49
 
#define PIXEL_CLOCK             MASTER_CLOCK / 4
50
 
 
51
 
/*- in this file -*/
52
 
static READ16_HANDLER( wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_r );
53
 
static WRITE16_HANDLER( wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_w );
54
 
static WRITE16_HANDLER( wwfwfest_1410_write ); /* priority write */
55
 
static WRITE16_HANDLER( wwfwfest_scroll_write ); /* scrolling write */
56
 
static WRITE8_DEVICE_HANDLER( oki_bankswitch_w );
57
 
static WRITE16_HANDLER ( wwfwfest_soundwrite );
58
 
static WRITE16_HANDLER ( wwfwfest_flipscreen_w );
59
 
static WRITE16_HANDLER ( wwfwfest_irq_ack_w );
60
 
 
61
 
/*******************************************************************************
62
 
 Memory Maps
63
 
********************************************************************************
64
 
 Pretty Straightforward
65
 
 
66
 
 still some unknown writes however, sound cpu memory map is the same as dd3
67
 
*******************************************************************************/
68
 
 
69
 
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16 )
70
 
        AM_RANGE(0x000000, 0x07ffff) AM_ROM
71
 
        AM_RANGE(0x0c0000, 0x0c1fff) AM_RAM_WRITE(wwfwfest_fg0_videoram_w) AM_BASE_MEMBER(wwfwfest_state, m_fg0_videoram)       /* FG0 Ram - 4 bytes per tile */
72
 
        AM_RANGE(0x0c2000, 0x0c3fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)                                             /* SPR Ram */
73
 
        AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(wwfwfest_bg0_videoram_w) AM_BASE_MEMBER(wwfwfest_state, m_bg0_videoram)       /* BG0 Ram - 4 bytes per tile */
74
 
        AM_RANGE(0x082000, 0x082fff) AM_RAM_WRITE(wwfwfest_bg1_videoram_w) AM_BASE_MEMBER(wwfwfest_state, m_bg1_videoram)       /* BG1 Ram - 2 bytes per tile */
75
 
        AM_RANGE(0x100000, 0x100007) AM_WRITE(wwfwfest_scroll_write)
76
 
        AM_RANGE(0x10000a, 0x10000b) AM_WRITE(wwfwfest_flipscreen_w)
77
 
        AM_RANGE(0x140000, 0x140003) AM_WRITE(wwfwfest_irq_ack_w)
78
 
        AM_RANGE(0x14000c, 0x14000d) AM_WRITE(wwfwfest_soundwrite)
79
 
        AM_RANGE(0x140010, 0x140011) AM_WRITE(wwfwfest_1410_write)
80
 
        AM_RANGE(0x140020, 0x140021) AM_READ_PORT("P1")
81
 
        AM_RANGE(0x140022, 0x140023) AM_READ_PORT("P2")
82
 
        AM_RANGE(0x140024, 0x140025) AM_READ_PORT("P3")
83
 
        AM_RANGE(0x140026, 0x140027) AM_READ_PORT("P4")
84
 
        AM_RANGE(0x180000, 0x18ffff) AM_READWRITE(wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_r,wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
85
 
        AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM /* Work Ram */
86
 
ADDRESS_MAP_END
87
 
 
88
 
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
89
 
        AM_RANGE(0x0000, 0xbfff) AM_ROM
90
 
        AM_RANGE(0xc000, 0xc7ff) AM_RAM
91
 
        AM_RANGE(0xc800, 0xc801) AM_DEVREADWRITE("ymsnd", ym2151_r, ym2151_w)
92
 
        AM_RANGE(0xd800, 0xd800) AM_DEVREADWRITE_MODERN("oki", okim6295_device, read, write)
93
 
        AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
94
 
        AM_RANGE(0xe800, 0xe800) AM_DEVWRITE("oki", oki_bankswitch_w)
95
 
ADDRESS_MAP_END
96
 
 
97
 
/*******************************************************************************
98
 
 Read / Write Handlers
99
 
********************************************************************************
100
 
 as used by the above memory map
101
 
*******************************************************************************/
102
 
 
103
 
static WRITE16_HANDLER( wwfwfest_irq_ack_w )
104
 
{
105
 
        if (offset == 0)
106
 
                cputag_set_input_line(space->machine(), "maincpu", 3, CLEAR_LINE);
107
 
 
108
 
        else
109
 
                cputag_set_input_line(space->machine(), "maincpu", 2, CLEAR_LINE);
110
 
}
111
 
 
112
 
static WRITE16_HANDLER( wwfwfest_flipscreen_w )
113
 
{
114
 
        flip_screen_set(space->machine(), data&1);
115
 
}
116
 
 
117
 
/*- Palette Reads/Writes -*/
118
 
 
119
 
static READ16_HANDLER( wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_r )
120
 
{
121
 
        offset = (offset & 0x000f) | (offset & 0x7fc0) >> 2;
122
 
        return space->machine().generic.paletteram.u16[offset];
123
 
}
124
 
 
125
 
static WRITE16_HANDLER( wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_w )
126
 
{
127
 
        offset = (offset & 0x000f) | (offset & 0x7fc0) >> 2;
128
 
        paletteram16_xxxxBBBBGGGGRRRR_word_w (space, offset, data, mem_mask);
129
 
}
130
 
 
131
 
/*- Priority Control -*/
132
 
 
133
 
 
134
 
static WRITE16_HANDLER( wwfwfest_1410_write )
135
 
{
136
 
        wwfwfest_state *state = space->machine().driver_data<wwfwfest_state>();
137
 
        state->m_pri = data;
138
 
}
139
 
 
140
 
/*- Scroll Control -*/
141
 
 
142
 
static WRITE16_HANDLER( wwfwfest_scroll_write )
143
 
{
144
 
        wwfwfest_state *state = space->machine().driver_data<wwfwfest_state>();
145
 
        switch (offset) {
146
 
                case 0x00:
147
 
                        state->m_bg0_scrollx = data;
148
 
                        break;
149
 
                case 0x01:
150
 
                        state->m_bg0_scrolly = data;
151
 
                        break;
152
 
                case 0x02:
153
 
                        state->m_bg1_scrollx = data;
154
 
                        break;
155
 
                case 0x03:
156
 
                        state->m_bg1_scrolly = data;
157
 
                        break;
158
 
        }
159
 
}
160
 
 
161
 
/*- Sound Related (from dd3) -*/
162
 
 
163
 
static WRITE8_DEVICE_HANDLER( oki_bankswitch_w )
164
 
{
165
 
        downcast<okim6295_device *>(device)->set_bank_base((data & 1) * 0x40000);
166
 
}
167
 
 
168
 
static WRITE16_HANDLER ( wwfwfest_soundwrite )
169
 
{
170
 
        soundlatch_w(space,1,data & 0xff);
171
 
        cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
172
 
}
173
 
 
174
 
/*******************************************************************************
175
 
 Input Ports
176
 
********************************************************************************
177
 
 There are 4 players, 2 sets of dipswitches and 2 misc
178
 
*******************************************************************************/
179
 
 
180
 
/* DIPs are spread accross the other input ports */
181
 
static CUSTOM_INPUT( dsw_3f_r )
182
 
{
183
 
        const char *tag = (const char *)param;
184
 
        return input_port_read(field.machine(), tag) & 0x3f;
185
 
}
186
 
 
187
 
static CUSTOM_INPUT( dsw_c0_r )
188
 
{
189
 
        const char *tag = (const char *)param;
190
 
        return (input_port_read(field.machine(), tag) & 0xc0) >> 6;
191
 
}
192
 
 
193
 
 
194
 
static INPUT_PORTS_START( wwfwfest )
195
 
        PORT_START("P1")
196
 
        PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
197
 
        PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
198
 
        PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
199
 
        PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
200
 
        PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
201
 
        PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
202
 
        PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
203
 
        PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
204
 
        PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
205
 
        PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SERVICE1 )
206
 
        PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
207
 
        PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
208
 
        PORT_BIT( 0x3000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(dsw_c0_r, "DSW2")
209
 
        PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
210
 
        PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
211
 
 
212
 
        PORT_START("P2")
213
 
        PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
214
 
        PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
215
 
        PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
216
 
        PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
217
 
        PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
218
 
        PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
219
 
        PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
220
 
        PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 )
221
 
        PORT_BIT( 0x3f00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(dsw_3f_r, "DSW2")
222
 
 
223
 
        PORT_START("P3")
224
 
        PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
225
 
        PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
226
 
        PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
227
 
        PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
228
 
        PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
229
 
        PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
230
 
        PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
231
 
        PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START3 )
232
 
        PORT_BIT( 0x3f00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(dsw_3f_r, "DSW1")
233
 
 
234
 
        PORT_START("P4")
235
 
        PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
236
 
        PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
237
 
        PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
238
 
        PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
239
 
        PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
240
 
        PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
241
 
        PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
242
 
        PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START4 )
243
 
        PORT_BIT( 0x0300, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(dsw_c0_r, "DSW1")
244
 
        PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_VBLANK )
245
 
        PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
246
 
        PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
247
 
        PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
248
 
        PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
249
 
        PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
250
 
 
251
 
        /* Nb:  There are actually 3 dips on the board, 2 * 8, and 1 *4 */
252
 
        PORT_START("DSW1")
253
 
        PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
254
 
        PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C )  )
255
 
        PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C )  )
256
 
        PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C )  )
257
 
        PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C )  )
258
 
        PORT_DIPNAME( 0x04, 0x04, "Buy In Price"  ) PORT_DIPLOCATION("SW1:3")
259
 
        PORT_DIPSETTING(    0x04, "1 Coin" )
260
 
        PORT_DIPSETTING(    0x00, "As start price" )
261
 
        PORT_DIPNAME( 0x08, 0x08, "Regain Power Price"  ) PORT_DIPLOCATION("SW1:4")
262
 
        PORT_DIPSETTING(    0x08, "1 Coin" )
263
 
        PORT_DIPSETTING(    0x00, "As start price" )
264
 
        PORT_DIPNAME( 0x10, 0x00, DEF_STR( Continue_Price )  ) PORT_DIPLOCATION("SW1:5")
265
 
        PORT_DIPSETTING(    0x10, "1 Coin" )
266
 
        PORT_DIPSETTING(    0x00, "As start price" )
267
 
        PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
268
 
        PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
269
 
        PORT_DIPSETTING(    0x20, DEF_STR( On ) )
270
 
        PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen )  ) PORT_DIPLOCATION("SW1:7")
271
 
        PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
272
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
273
 
        PORT_DIPNAME( 0x80, 0x80, "FBI Logo" ) PORT_DIPLOCATION("SW1:8")
274
 
        PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
275
 
        PORT_DIPSETTING(    0x80, DEF_STR( On ) )
276
 
 
277
 
        PORT_START("DSW2")
278
 
        PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
279
 
        PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
280
 
        PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
281
 
        PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
282
 
        PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
283
 
        PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Players ) ) PORT_DIPLOCATION("SW2:3,4") /* Nothing listed for seting ON/ON IE:0x00 */
284
 
        PORT_DIPSETTING(    0x04, "2" )
285
 
        PORT_DIPSETTING(    0x08, "3" )
286
 
        PORT_DIPSETTING(    0x0c, "4" )
287
 
        PORT_DIPUNUSED_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW2:5" )
288
 
        PORT_DIPNAME( 0x60, 0x60, "Clear Stage Power Up" ) PORT_DIPLOCATION("SW2:6,7")
289
 
        PORT_DIPSETTING(    0x00, "0" )
290
 
        PORT_DIPSETTING(    0x20, "12" )
291
 
        PORT_DIPSETTING(    0x60, "24" )
292
 
        PORT_DIPSETTING(    0x40, "32" )
293
 
        PORT_DIPNAME( 0x80, 0x80, "Championship Game" ) PORT_DIPLOCATION("SW2:8")
294
 
        PORT_DIPSETTING(    0x00, "4th" )
295
 
        PORT_DIPSETTING(    0x80, "5th" )
296
 
INPUT_PORTS_END
297
 
 
298
 
/*******************************************************************************
299
 
 Graphic Decoding
300
 
*******************************************************************************/
301
 
static const gfx_layout tiles8x8_layout =
302
 
{
303
 
        8,8,
304
 
        RGN_FRAC(1,1),
305
 
        4,
306
 
        { 0, 2, 4, 6 },
307
 
        { 1, 0, 8*8+1, 8*8+0, 16*8+1, 16*8+0, 24*8+1, 24*8+0 },
308
 
        { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
309
 
        32*8
310
 
};
311
 
 
312
 
static const gfx_layout tile_layout =
313
 
{
314
 
        16,16,  /* 16*16 tiles */
315
 
        4096,   /* 8192 tiles */
316
 
        4,      /* 4 bits per pixel */
317
 
        { 8, 0, 0x40000*8+8 , 0x40000*8+0 },    /* the bitplanes are separated */
318
 
        { 0, 1, 2, 3, 4, 5, 6, 7,
319
 
                        32*8+0, 32*8+1, 32*8+2, 32*8+3, 32*8+4, 32*8+5, 32*8+6, 32*8+7 },
320
 
        { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
321
 
                        16*8, 16*9, 16*10, 16*11, 16*12, 16*13, 16*14, 16*15 },
322
 
        64*8    /* every tile takes 64 consecutive bytes */
323
 
};
324
 
 
325
 
static const gfx_layout sprite_layout = {
326
 
        16,16,  /* 16*16 tiles */
327
 
        RGN_FRAC(1,4),
328
 
        4,      /* 4 bits per pixel */
329
 
        { 0, 0x200000*8, 2*0x200000*8 , 3*0x200000*8 }, /* the bitplanes are separated */
330
 
        { 0, 1, 2, 3, 4, 5, 6, 7,
331
 
                16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 },
332
 
        { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
333
 
                8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
334
 
        32*8    /* every tile takes 32 consecutive bytes */
335
 
};
336
 
 
337
 
static GFXDECODE_START( wwfwfest )
338
 
        GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0x0000, 16 )
339
 
        GFXDECODE_ENTRY( "gfx2", 0, sprite_layout,   0x0400, 16 )
340
 
        GFXDECODE_ENTRY( "gfx3", 0, tile_layout,     0x1000, 16 )
341
 
        GFXDECODE_ENTRY( "gfx3", 0, tile_layout,     0x0c00, 16 )
342
 
GFXDECODE_END
343
 
 
344
 
/*******************************************************************************
345
 
 Interrupt Function
346
 
*******************************************************************************/
347
 
 
348
 
static TIMER_DEVICE_CALLBACK( wwfwfest_scanline )
349
 
{
350
 
        int scanline = param;
351
 
 
352
 
        /* An interrupt is generated every 16 scanlines */
353
 
        if (scanline % 16 == 0)
354
 
        {
355
 
                if (scanline > 0)
356
 
                        timer.machine().primary_screen->update_partial(scanline - 1);
357
 
                cputag_set_input_line(timer.machine(), "maincpu", 2, ASSERT_LINE);
358
 
        }
359
 
 
360
 
        /* Vblank is raised on scanline 248 */
361
 
        if (scanline == 248)
362
 
        {
363
 
                timer.machine().primary_screen->update_partial(scanline - 1);
364
 
                cputag_set_input_line(timer.machine(), "maincpu", 3, ASSERT_LINE);
365
 
        }
366
 
}
367
 
 
368
 
/*******************************************************************************
369
 
 Sound Stuff..
370
 
********************************************************************************
371
 
 Straight from Ddragon 3 with some adjusted volumes
372
 
*******************************************************************************/
373
 
 
374
 
static void dd3_ymirq_handler(device_t *device, int irq)
375
 
{
376
 
        cputag_set_input_line(device->machine(), "audiocpu", 0 , irq ? ASSERT_LINE : CLEAR_LINE );
377
 
}
378
 
 
379
 
static const ym2151_interface ym2151_config =
380
 
{
381
 
        dd3_ymirq_handler
382
 
};
383
 
 
384
 
static SCREEN_EOF( wwfwfest )
385
 
{
386
 
        address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
387
 
 
388
 
        buffer_spriteram16_w(space,0,0,0xffff);
389
 
}
390
 
 
391
 
/*******************************************************************************
392
 
 Machine Driver(s)
393
 
*******************************************************************************/
394
 
 
395
 
static MACHINE_CONFIG_START( wwfwfest, wwfwfest_state )
396
 
 
397
 
        /* basic machine hardware */
398
 
        MCFG_CPU_ADD("maincpu", M68000, CPU_CLOCK)      /* 24 crystal, 12 rated chip */
399
 
        MCFG_CPU_PROGRAM_MAP(main_map)
400
 
        MCFG_TIMER_ADD_SCANLINE("scantimer", wwfwfest_scanline, "screen", 0, 1)
401
 
 
402
 
        MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
403
 
        MCFG_CPU_PROGRAM_MAP(sound_map)
404
 
 
405
 
        /* video hardware */
406
 
        MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
407
 
 
408
 
        MCFG_SCREEN_ADD("screen", RASTER)
409
 
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
410
 
        MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 320, 272, 8, 248)   /* HTOTAL and VTOTAL are guessed */
411
 
        MCFG_SCREEN_UPDATE(wwfwfest)
412
 
        MCFG_SCREEN_EOF(wwfwfest)
413
 
 
414
 
        MCFG_GFXDECODE(wwfwfest)
415
 
        MCFG_PALETTE_LENGTH(8192)
416
 
 
417
 
        MCFG_VIDEO_START(wwfwfest)
418
 
 
419
 
        /* sound hardware */
420
 
        MCFG_SPEAKER_STANDARD_MONO("mono")
421
 
 
422
 
        MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_3_579545MHz)
423
 
        MCFG_SOUND_CONFIG(ym2151_config)
424
 
        MCFG_SOUND_ROUTE(0, "mono", 0.45)
425
 
        MCFG_SOUND_ROUTE(1, "mono", 0.45)
426
 
 
427
 
        MCFG_OKIM6295_ADD("oki", 1024188, OKIM6295_PIN7_HIGH) /* Verified - Pin 7 tied to +5VDC */
428
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
429
 
MACHINE_CONFIG_END
430
 
 
431
 
static MACHINE_CONFIG_DERIVED( wwfwfstb, wwfwfest )
432
 
        MCFG_VIDEO_START(wwfwfstb)
433
 
MACHINE_CONFIG_END
434
 
 
435
 
/*******************************************************************************
436
 
 Rom Loaders / Game Drivers
437
 
********************************************************************************
438
 
 2 sets supported,
439
 
 wwfwfest - US? Set (Tecmo License / Distribution?)
440
 
 wwfwfstj - Japan? Set
441
 
 
442
 
 readme / info files below
443
 
 
444
 
--------------------------------------------------------------------------------
445
 
 wwfwfstj: README.TXT
446
 
--------------------------------------------------------------------------------
447
 
 Wrestlefest
448
 
 Technos 1991
449
 
 
450
 
 TA-0031
451
 
                                                         68000-12
452
 
  31J0_IC1  6264 6264 31A14-2 31A13-2 6264 6264 31A12-0  24MHz
453
 
  31J1_IC2
454
 
                   TJ-002          TJ-004
455
 
                                   6264                   SW1
456
 
                   28MHz                                  SW2
457
 
                                                          SW3
458
 
                                             61C16-35
459
 
                        61C16-35             61C16-35
460
 
  31J2_IC8
461
 
  31J3_IC9
462
 
  31J4_IC10
463
 
  31J5_IC11
464
 
  31J6_IC12
465
 
  31J7_IC13
466
 
  31J8_IC14    TJ-003                31A11-2  M6295   31J10_IC73
467
 
  31J9_IC15    61C16-35 61C16-35     Z80      YM2151
468
 
 
469
 
 
470
 
  Clock Crystals:
471
 
 
472
 
  X1 - 28.000 MHz
473
 
  X2 - 3.579545 MHz (for Z80)
474
 
  X3 - 24.000 MHz (for 68000)
475
 
  X4 - 1.056 MHz (not used, initially intended for OKI6295?)
476
 
 
477
 
 
478
 
  The mask roms at IC1 and IC2 have the same pinouts as a MX27C4100 or M27C400
479
 
  except pin 1 is not A17 but instead not used (not connected).
480
 
 
481
 
*******************************************************************************/
482
 
 
483
 
ROM_START( wwfwfest )
484
 
        ROM_REGION( 0x80000, "maincpu", 0 ) /* Main CPU  (68000) */
485
 
        ROM_LOAD16_BYTE( "31a13-2.ic19", 0x00001, 0x40000, CRC(7175bca7) SHA1(992b47a787b5bc2a5a381ec78b8dfaf7d42c614b) )
486
 
        ROM_LOAD16_BYTE( "31a14-2.ic18", 0x00000, 0x40000, CRC(5d06bfd1) SHA1(39a93da662158aa5a9953dcabfcb47c2fc196dc7) )
487
 
 
488
 
        ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU (Z80)  */
489
 
        ROM_LOAD( "31a11-2.ic42", 0x00000, 0x10000, CRC(5ddebfea) SHA1(30073963e965250d94f0dc3bd261a054850adf95) )
490
 
 
491
 
        ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM samples */
492
 
        ROM_LOAD( "31j10.ic73",   0x00000, 0x80000, CRC(6c522edb) SHA1(8005d59c94160638ba2ea7caf4e991fff03003d5) )
493
 
 
494
 
        ROM_REGION( 0x20000, "gfx1", 0 ) /* FG0 Tiles (8x8) */
495
 
        ROM_LOAD( "31a12-0.ic33", 0x00000, 0x20000, CRC(d0803e20) SHA1(b68758e9a5522396f831a3972571f8aed54c64de) )
496
 
 
497
 
        ROM_REGION( 0x800000, "gfx2", 0 ) /* SPR Tiles (16x16), 27080 Mask ROM's */
498
 
        ROM_LOAD( "31j3.ic9",     0x000000, 0x100000, CRC(e395cf1d) SHA1(241f98145e295993c9b6a44dc087a9b61fbc9a6f) ) /* Tiles 0 */
499
 
        ROM_LOAD( "31j2.ic8",     0x100000, 0x100000, CRC(b5a97465) SHA1(08d82c29a5c02b83fdbd0bad649b74eb35ab7e54) ) /* Tiles 1 */
500
 
        ROM_LOAD( "31j5.ic11",    0x200000, 0x100000, CRC(2ce545e8) SHA1(82173e58a8476a6fe9d2c990fce1f71af117a0ea) ) /* Tiles 0 */
501
 
        ROM_LOAD( "31j4.ic10",    0x300000, 0x100000, CRC(00edb66a) SHA1(926606d1923936b6e75391b1ab03b369d9822d13) ) /* Tiles 1 */
502
 
        ROM_LOAD( "31j6.ic12",    0x400000, 0x100000, CRC(79956cf8) SHA1(52207263620a6b6dde66d3f8749b772577899ea5) ) /* Tiles 0 */
503
 
        ROM_LOAD( "31j7.ic13",    0x500000, 0x100000, CRC(74d774c3) SHA1(a723ac5d481bf91b12e17652fbb2d869c886dec0) ) /* Tiles 1 */
504
 
        ROM_LOAD( "31j9.ic15",    0x600000, 0x100000, CRC(dd387289) SHA1(2cad42d4e7cd1a49346f844058ae18c38bc686a8) ) /* Tiles 0 */
505
 
        ROM_LOAD( "31j8.ic14",    0x700000, 0x100000, CRC(44abe127) SHA1(c723e1dea117534e976d2d383e634faf073cd57b) ) /* Tiles 1 */
506
 
 
507
 
        ROM_REGION( 0x80000, "gfx3", 0 ) /* BG0 / BG1 Tiles (16x16) */
508
 
        ROM_LOAD( "31j0.ic1",     0x40000, 0x40000, CRC(8a12b450) SHA1(2e15c949efcda8bb6f11afe3ff07ba1dee9c771c) ) /* 0,1 */
509
 
        ROM_LOAD( "31j1.ic2",     0x00000, 0x40000, CRC(82ed7155) SHA1(b338e1150ffe3277c11d4d6e801a7d3bd7c58492) ) /* 2,3 */
510
 
ROM_END
511
 
 
512
 
ROM_START( wwfwfesta )
513
 
        ROM_REGION( 0x80000, "maincpu", 0 ) /* Main CPU  (68000) */
514
 
        ROM_LOAD16_BYTE( "wf_18.rom", 0x00000, 0x40000, CRC(933ea1a0) SHA1(61da142cfa7abd3b77ab21979c061a078c0d0c63) )
515
 
        ROM_LOAD16_BYTE( "wf_19.rom", 0x00001, 0x40000, CRC(bd02e3c4) SHA1(7ae63e48caf9919ce7b63b4c5aa9474ba8c336da) )
516
 
 
517
 
        ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU (Z80)  */
518
 
        ROM_LOAD( "31a11-2.ic42", 0x00000, 0x10000, CRC(5ddebfea) SHA1(30073963e965250d94f0dc3bd261a054850adf95) )
519
 
 
520
 
        ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM samples */
521
 
        ROM_LOAD( "31j10.ic73",   0x00000, 0x80000, CRC(6c522edb) SHA1(8005d59c94160638ba2ea7caf4e991fff03003d5) )
522
 
 
523
 
        ROM_REGION( 0x20000, "gfx1", 0 ) /* FG0 Tiles (8x8) */
524
 
        ROM_LOAD( "wf_33.rom",    0x00000, 0x20000, CRC(06f22615) SHA1(2e9418e372da85ea597977d912d8b35753655f4e) )
525
 
 
526
 
        ROM_REGION( 0x800000, "gfx2", 0 ) /* SPR Tiles (16x16), 27080 Mask ROM's */
527
 
        ROM_LOAD( "31j3.ic9",     0x000000, 0x100000, CRC(e395cf1d) SHA1(241f98145e295993c9b6a44dc087a9b61fbc9a6f) ) /* Tiles 0 */
528
 
        ROM_LOAD( "31j2.ic8",     0x100000, 0x100000, CRC(b5a97465) SHA1(08d82c29a5c02b83fdbd0bad649b74eb35ab7e54) ) /* Tiles 1 */
529
 
        ROM_LOAD( "31j5.ic11",    0x200000, 0x100000, CRC(2ce545e8) SHA1(82173e58a8476a6fe9d2c990fce1f71af117a0ea) ) /* Tiles 0 */
530
 
        ROM_LOAD( "31j4.ic10",    0x300000, 0x100000, CRC(00edb66a) SHA1(926606d1923936b6e75391b1ab03b369d9822d13) ) /* Tiles 1 */
531
 
        ROM_LOAD( "31j6.ic12",    0x400000, 0x100000, CRC(79956cf8) SHA1(52207263620a6b6dde66d3f8749b772577899ea5) ) /* Tiles 0 */
532
 
        ROM_LOAD( "31j7.ic13",    0x500000, 0x100000, CRC(74d774c3) SHA1(a723ac5d481bf91b12e17652fbb2d869c886dec0) ) /* Tiles 1 */
533
 
        ROM_LOAD( "31j9.ic15",    0x600000, 0x100000, CRC(dd387289) SHA1(2cad42d4e7cd1a49346f844058ae18c38bc686a8) ) /* Tiles 0 */
534
 
        ROM_LOAD( "31j8.ic14",    0x700000, 0x100000, CRC(44abe127) SHA1(c723e1dea117534e976d2d383e634faf073cd57b) ) /* Tiles 1 */
535
 
 
536
 
        ROM_REGION( 0x80000, "gfx3", 0 ) /* BG0 / BG1 Tiles (16x16) */
537
 
        ROM_LOAD( "31j0.ic1",     0x40000, 0x40000, CRC(8a12b450) SHA1(2e15c949efcda8bb6f11afe3ff07ba1dee9c771c) ) /* 0,1 */
538
 
        ROM_LOAD( "31j1.ic2",     0x00000, 0x40000, CRC(82ed7155) SHA1(b338e1150ffe3277c11d4d6e801a7d3bd7c58492) ) /* 2,3 */
539
 
ROM_END
540
 
 
541
 
ROM_START( wwfwfestb )
542
 
        ROM_REGION( 0x80000, "maincpu", 0 ) /* Main CPU  (68000) */
543
 
        ROM_LOAD16_BYTE( "3",      0x00000, 0x40000, CRC(ea73369c) SHA1(be614a342f9014251810fa30ec56fec03f7c8ef3) )
544
 
        ROM_LOAD16_BYTE( "2",      0x00001, 0x40000, CRC(632bb3a4) SHA1(9c04fed5aeefc683810cfbd9b3318e155ed9813f) )
545
 
 
546
 
        ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU (Z80)  */
547
 
        ROM_LOAD( "1",             0x00000, 0x10000, CRC(d9e8cda2) SHA1(754c73cd341d51ffd35cdb62155a3f061416c9ba) )
548
 
 
549
 
        ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM samples */
550
 
        ROM_LOAD( "wf_73a.rom",    0x00000, 0x80000, CRC(6c522edb) SHA1(8005d59c94160638ba2ea7caf4e991fff03003d5) )
551
 
 
552
 
        ROM_REGION( 0x20000, "gfx1", 0 ) /* FG0 Tiles (8x8) */
553
 
        ROM_LOAD( "4",             0x00000, 0x20000, CRC(520ef575) SHA1(99a5e9b94e9234851c6b504d58939ad84e0d6589) )
554
 
 
555
 
        ROM_REGION( 0x800000, "gfx2", 0 ) /* SPR Tiles (16x16) */
556
 
        ROM_LOAD( "wf_09.rom",    0x000000, 0x100000, CRC(e395cf1d) SHA1(241f98145e295993c9b6a44dc087a9b61fbc9a6f) ) /* Tiles 0 */
557
 
        ROM_LOAD( "wf_08.rom",    0x100000, 0x100000, CRC(b5a97465) SHA1(08d82c29a5c02b83fdbd0bad649b74eb35ab7e54) ) /* Tiles 1 */
558
 
        ROM_LOAD( "wf_11.rom",    0x200000, 0x100000, CRC(2ce545e8) SHA1(82173e58a8476a6fe9d2c990fce1f71af117a0ea) ) /* Tiles 0 */
559
 
        ROM_LOAD( "wf_10.rom",    0x300000, 0x100000, CRC(00edb66a) SHA1(926606d1923936b6e75391b1ab03b369d9822d13) ) /* Tiles 1 */
560
 
        ROM_LOAD( "wf_12.rom",    0x400000, 0x100000, CRC(79956cf8) SHA1(52207263620a6b6dde66d3f8749b772577899ea5) ) /* Tiles 0 */
561
 
        ROM_LOAD( "wf_13.rom",    0x500000, 0x100000, CRC(74d774c3) SHA1(a723ac5d481bf91b12e17652fbb2d869c886dec0) ) /* Tiles 1 */
562
 
        ROM_LOAD( "wf_15.rom",    0x600000, 0x100000, CRC(dd387289) SHA1(2cad42d4e7cd1a49346f844058ae18c38bc686a8) ) /* Tiles 0 */
563
 
        ROM_LOAD( "wf_14.rom",    0x700000, 0x100000, CRC(44abe127) SHA1(c723e1dea117534e976d2d383e634faf073cd57b) ) /* Tiles 1 */
564
 
 
565
 
        ROM_REGION( 0x80000, "gfx3", 0 ) /* BG0 / BG1 Tiles (16x16) */
566
 
        ROM_LOAD16_BYTE( "5",     0x40000, 0x20000, CRC(35e4d6eb) SHA1(d2a12bde268bc0734e6806ff5302b8c3dcc17280) ) /* 0 */
567
 
        ROM_LOAD16_BYTE( "6",     0x40001, 0x20000, CRC(a054a5b2) SHA1(d6ed5d5a20acb7cdbaee8e3f520873650529c0ae) ) /* 1 */
568
 
        ROM_LOAD16_BYTE( "7",     0x00000, 0x20000, CRC(101f0136) SHA1(2ccd641e49cdd3f5243ebe8c52c492842d62f5b8) ) /* 2 */
569
 
        ROM_LOAD16_BYTE( "8",     0x00001, 0x20000, CRC(7b2ecba7) SHA1(1ed2451132448930ac4afcdc67ca14e3e922863e) ) /* 3 */
570
 
ROM_END
571
 
 
572
 
ROM_START( wwfwfestj )
573
 
        ROM_REGION( 0x80000, "maincpu", 0 ) /* Main CPU  (68000) */
574
 
        ROM_LOAD16_BYTE( "31j13-0.ic19", 0x00001, 0x40000, CRC(2147780d) SHA1(9a7a5db06117f3780e084d3f0c7b642ff8a9db55) )
575
 
        ROM_LOAD16_BYTE( "31j14-0.ic18", 0x00000, 0x40000, CRC(d76fc747) SHA1(5f6819bc61756d1df4ac0776ac420a59c438cf8a) )
576
 
 
577
 
        ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU (Z80)  */
578
 
        ROM_LOAD( "31a11-2.ic42", 0x00000, 0x10000, CRC(5ddebfea) SHA1(30073963e965250d94f0dc3bd261a054850adf95) )
579
 
 
580
 
        ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM samples */
581
 
        ROM_LOAD( "31j10.ic73",   0x00000, 0x80000, CRC(6c522edb) SHA1(8005d59c94160638ba2ea7caf4e991fff03003d5) )
582
 
 
583
 
        ROM_REGION( 0x20000, "gfx1", 0 ) /* FG0 Tiles (8x8) */
584
 
        ROM_LOAD( "31j12-0.ic33", 0x00000, 0x20000, CRC(f4821fe0) SHA1(e5faa9860e9d4e75393b64ca85a8bfc4852fd4fd) )
585
 
 
586
 
        ROM_REGION( 0x800000, "gfx2", 0 ) /* SPR Tiles (16x16), 27080 Mask ROM's */
587
 
        ROM_LOAD( "31j3.ic9",     0x000000, 0x100000, CRC(e395cf1d) SHA1(241f98145e295993c9b6a44dc087a9b61fbc9a6f) ) /* Tiles 0 */
588
 
        ROM_LOAD( "31j2.ic8",     0x100000, 0x100000, CRC(b5a97465) SHA1(08d82c29a5c02b83fdbd0bad649b74eb35ab7e54) ) /* Tiles 1 */
589
 
        ROM_LOAD( "31j5.ic11",    0x200000, 0x100000, CRC(2ce545e8) SHA1(82173e58a8476a6fe9d2c990fce1f71af117a0ea) ) /* Tiles 0 */
590
 
        ROM_LOAD( "31j4.ic10",    0x300000, 0x100000, CRC(00edb66a) SHA1(926606d1923936b6e75391b1ab03b369d9822d13) ) /* Tiles 1 */
591
 
        ROM_LOAD( "31j6.ic12",    0x400000, 0x100000, CRC(79956cf8) SHA1(52207263620a6b6dde66d3f8749b772577899ea5) ) /* Tiles 0 */
592
 
        ROM_LOAD( "31j7.ic13",    0x500000, 0x100000, CRC(74d774c3) SHA1(a723ac5d481bf91b12e17652fbb2d869c886dec0) ) /* Tiles 1 */
593
 
        ROM_LOAD( "31j9.ic15",    0x600000, 0x100000, CRC(dd387289) SHA1(2cad42d4e7cd1a49346f844058ae18c38bc686a8) ) /* Tiles 0 */
594
 
        ROM_LOAD( "31j8.ic14",    0x700000, 0x100000, CRC(44abe127) SHA1(c723e1dea117534e976d2d383e634faf073cd57b) ) /* Tiles 1 */
595
 
 
596
 
        ROM_REGION( 0x80000, "gfx3", 0 ) /* BG0 / BG1 Tiles (16x16) */
597
 
        ROM_LOAD( "31j0.ic1",     0x40000, 0x40000, CRC(8a12b450) SHA1(2e15c949efcda8bb6f11afe3ff07ba1dee9c771c) ) /* 0,1 */
598
 
        ROM_LOAD( "31j1.ic2",     0x00000, 0x40000, CRC(82ed7155) SHA1(b338e1150ffe3277c11d4d6e801a7d3bd7c58492) ) /* 2,3 */
599
 
ROM_END
600
 
 
601
 
GAME( 1991, wwfwfest,  0,        wwfwfest, wwfwfest, 0, ROT0, "Technos Japan",                 "WWF WrestleFest (US set 1)",   GAME_SUPPORTS_SAVE )
602
 
GAME( 1991, wwfwfesta, wwfwfest, wwfwfest, wwfwfest, 0, ROT0, "Technos Japan (Tecmo license)", "WWF WrestleFest (US Tecmo)",   GAME_SUPPORTS_SAVE )
603
 
GAME( 1991, wwfwfestb, wwfwfest, wwfwfstb, wwfwfest, 0, ROT0, "bootleg",                       "WWF WrestleFest (US bootleg)", GAME_SUPPORTS_SAVE )
604
 
GAME( 1991, wwfwfestj, wwfwfest, wwfwfest, wwfwfest, 0, ROT0, "Technos Japan",                 "WWF WrestleFest (Japan)",      GAME_SUPPORTS_SAVE )