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

« back to all changes in this revision

Viewing changes to mess/src/mame/drivers/nova2001.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
 
 
3
 
UPL "orthogonal palette" hardware
4
 
 
5
 
driver by Howie Cohen, Frank Palazzolo, Alex Pasadyn, David Haywood, Steph, Phil Stroffolino, Uki
6
 
 
7
 
The peculiar feature of this hardware is the palette layout. 16 colors are
8
 
arranged in a 16x16 matrix, with all columns containing a single color, except
9
 
for column 1, which is a copy of row 1. Essentially, the 4bpp graphics are
10
 
drawn using a fixed palette except for one color that changes.
11
 
Nova 2001 and Penguin Kun Wars have palette PROMs and the effect applies to both
12
 
tilemaps and sprites. Ninjakun and Raiders5 have palette RAM and the effect
13
 
applies only to sprites while tilemaps use a normal palette.
14
 
 
15
 
 
16
 
Another peculiar characteristic is that in the later scrolling games (that is
17
 
Ninjakun and Raiders5, but not Nova 2001) the bg scroll registers are added to
18
 
the videoram address not only when the video circuitry is accessing it, as
19
 
usually happens, but also when the CPU is accessing it.
20
 
 
21
 
 
22
 
Game                      Board
23
 
------------------------  ---------
24
 
Nova 2001                 UPL-83005
25
 
Ninjakun Majou no Bouken  UPL-84003
26
 
Penguin Kun Wars          UPL-?????
27
 
Raiders5                  UPL-85004
28
 
 
29
 
Hardware Overview:
30
 
------------------
31
 
1xZ80 @ 3MHz (2x in Ninjakun and Raiders5)
32
 
2xAY8910 @ various frequencies
33
 
 
34
 
Resolution: 256x192
35
 
64 sprites
36
 
Tilemaps: fg 256x256 (8x8) + bg 256x256 (8x8) (Penguin Kun Wars has only one)
37
 
 
38
 
 
39
 
Designers:
40
 
----------
41
 
Nova 2001:
42
 
* Staff : Ryuichi Nishizawa (Bucha), HAL, Fukushi, Hiromi
43
 
 
44
 
Penguin Kun Wars:
45
 
* Tsutomu Fuzisawa, Ogata, Nobuyuki Narita, Kosikawa
46
 
 
47
 
Ninjakun Majou no Bouken:
48
 
* Staff : Ryuichi Nishizawa (Bucha), Todo, Fukushi, Tsutomu Fuzisawa, Tateno
49
 
 
50
 
Raiders5:
51
 
* Staff : Tsutomu Fuzisawa, Suzuko, Naotsugu
52
 
* Game, software and character design by : Ryuichi Nishizawa
53
 
* Hardware and effect design by : Nobuyuki Narita
54
 
 
55
 
 
56
 
Notes:
57
 
------
58
 
- nova2001 is VERY sensitive to coin inputs, if the coin isn't held down long
59
 
  enough, or is held down too long the game will reset, likewise if coins are
60
 
  inserted too quickly. This only happens in nova2001 and not in nova2001u.
61
 
 
62
 
- Nova 2001 draws black bars on the sides of the screen so the visible area becomes
63
 
  240x192, however the physical resolution is still 256x192, the game probably does
64
 
  that to avoid wraparound glitches in the background without having to care about
65
 
  the sprite X MSB.
66
 
 
67
 
- In Ninjakun, hold P1 Start after a reset to skip the startup memory tests.
68
 
 
69
 
- The production year of Penguin Kun Wars is uncertain since it's not shown on
70
 
  screen. The console/home computer ports were made by ASCII in 1985, and the
71
 
  Ninjakun character appears in the audience (just on the left of the timer) so
72
 
  this game must have been produced after Ninjakun. This restricts the possibilities
73
 
  to 1985 or 1984.
74
 
 
75
 
- Penguin Kun Wars has some tile/sprite priority issues that have been verified
76
 
  to happen on the real board (e.g. the blob thing that moves in the middle of
77
 
  the table is not obscured by the text box at the end of a set).
78
 
 
79
 
TODO:
80
 
-----
81
 
- The Nova 2001 schematics show a FG priority bit, which should control priority
82
 
  over sprites. However that bit is set by the game only during the screen fade
83
 
  effect at the end of a level, so it would make the score area appear below
84
 
  the sprites, which definitely doesn't look right. For this reason, the priority
85
 
  bit is implemented in the video driver but it is ignored and the FG is always
86
 
  drawn above sprites.
87
 
 
88
 
- In Ninjakun, some garbage is drawn behind the GAME OVER text at the end of a
89
 
  game. Correct behaviour?
90
 
 
91
 
- The IRQ source of Ninjakun and Raiders5 CPU 2 is unknown.
92
 
 
93
 
- Several unknown memory read accesses in Raiders5.
94
 
 
95
 
*******************************************************************************
96
 
 
97
 
Nova 2001 Memory Map:
98
 
 
99
 
Address Range:     R/W:     Function:
100
 
--------------------------------------------------------------------------
101
 
0000 - 7fff        R        Program ROM (7000-7fff mirror of 6000-6fff)
102
 
a000 - a3ff        R/W      Foreground Playfield character RAM
103
 
a400 - a7ff        R/W      Foreground Playfield color modifier RAM
104
 
a800 - abff        R/W      Scrolling Playfield character RAM
105
 
ac00 - a7ff        R/W      Scrolling Playfield color modifier RAM
106
 
b000 - b7ff        R/W      Sprite RAM
107
 
bfff               W        flip screen
108
 
c000               R/W      AY8910 #1 Data R/W
109
 
c001               R/W      AY8910 #2 Data R/W
110
 
c002               W        AY8910 #1 Control W
111
 
c003               W        AY8910 #2 Control W
112
 
c004               R        Interrupt acknowledge / Watchdog reset
113
 
c006               R        Player 1 Controls
114
 
c007               R        Player 2 Controls
115
 
c00e               R        Coin Inputs, etc.
116
 
e000 - e7ff        R/W      Work RAM
117
 
 
118
 
******************************************************************************/
119
 
 
120
 
#include "emu.h"
121
 
#include "cpu/z80/z80.h"
122
 
#include "sound/ay8910.h"
123
 
#include "includes/nova2001.h"
124
 
 
125
 
#define MAIN_CLOCK XTAL_12MHz
126
 
 
127
 
 
128
 
/*************************************
129
 
 *
130
 
 *  Ninjakun 0xA000 Read / Write Handlers
131
 
 *
132
 
 *************************************/
133
 
 
134
 
 
135
 
static CUSTOM_INPUT( ninjakun_io_A002_ctrl_r )
136
 
{
137
 
        nova2001_state *state = field.machine().driver_data<nova2001_state>();
138
 
        return state->m_ninjakun_io_a002_ctrl;
139
 
}
140
 
 
141
 
static WRITE8_HANDLER( ninjakun_cpu1_io_A002_w )
142
 
{
143
 
        nova2001_state *state = space->machine().driver_data<nova2001_state>();
144
 
        if( data == 0x80 ) state->m_ninjakun_io_a002_ctrl |= 0x01;
145
 
        if( data == 0x40 ) state->m_ninjakun_io_a002_ctrl &= ~0x02;
146
 
}
147
 
 
148
 
static WRITE8_HANDLER( ninjakun_cpu2_io_A002_w )
149
 
{
150
 
        nova2001_state *state = space->machine().driver_data<nova2001_state>();
151
 
        if( data == 0x40 ) state->m_ninjakun_io_a002_ctrl |= 0x02;
152
 
        if( data == 0x80 ) state->m_ninjakun_io_a002_ctrl &= ~0x01;
153
 
}
154
 
 
155
 
 
156
 
 
157
 
/*************************************
158
 
 *
159
 
 *  Init
160
 
 *
161
 
 *************************************/
162
 
 
163
 
static MACHINE_START( ninjakun )
164
 
{
165
 
        nova2001_state *state = machine.driver_data<nova2001_state>();
166
 
        /* Save State Stuff */
167
 
        state_save_register_global(machine, state->m_ninjakun_io_a002_ctrl);
168
 
}
169
 
 
170
 
 
171
 
 
172
 
/*************************************
173
 
 *
174
 
 *  Memory maps
175
 
 *
176
 
 *************************************/
177
 
 
178
 
static ADDRESS_MAP_START( nova2001_map, AS_PROGRAM, 8 )
179
 
        AM_RANGE(0x0000, 0x7fff) AM_ROM
180
 
        AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(nova2001_fg_videoram_w) AM_BASE_MEMBER(nova2001_state, m_fg_videoram)
181
 
        AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(nova2001_bg_videoram_w) AM_BASE_MEMBER(nova2001_state, m_bg_videoram)
182
 
        AM_RANGE(0xb000, 0xb7ff) AM_RAM AM_BASE_MEMBER(nova2001_state, m_spriteram)
183
 
        AM_RANGE(0xb800, 0xbfff) AM_WRITE(nova2001_flipscreen_w)
184
 
        AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE("ay1", ay8910_r, ay8910_data_w)
185
 
        AM_RANGE(0xc001, 0xc001) AM_DEVREADWRITE("ay2", ay8910_r, ay8910_data_w)
186
 
        AM_RANGE(0xc002, 0xc002) AM_DEVWRITE("ay1", ay8910_address_w)
187
 
        AM_RANGE(0xc003, 0xc003) AM_DEVWRITE("ay2", ay8910_address_w)
188
 
        AM_RANGE(0xc004, 0xc004) AM_READ(watchdog_reset_r)
189
 
        AM_RANGE(0xc006, 0xc006) AM_READ_PORT("IN0")
190
 
        AM_RANGE(0xc007, 0xc007) AM_READ_PORT("IN1")
191
 
        AM_RANGE(0xc00e, 0xc00e) AM_READ_PORT("IN2")
192
 
        AM_RANGE(0xe000, 0xe7ff) AM_RAM
193
 
ADDRESS_MAP_END
194
 
 
195
 
 
196
 
static ADDRESS_MAP_START( ninjakun_cpu1_map, AS_PROGRAM, 8 )
197
 
        AM_RANGE(0x0000, 0x1fff) AM_ROM
198
 
        AM_RANGE(0x2000, 0x7fff) AM_ROM
199
 
        AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_address_data_w)
200
 
        AM_RANGE(0x8001, 0x8001) AM_DEVREAD("ay1", ay8910_r)
201
 
        AM_RANGE(0x8002, 0x8003) AM_DEVWRITE("ay2", ay8910_address_data_w)
202
 
        AM_RANGE(0x8003, 0x8003) AM_DEVREAD("ay2", ay8910_r)
203
 
        AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
204
 
        AM_RANGE(0xa001, 0xa001) AM_READ_PORT("IN1")
205
 
        AM_RANGE(0xa002, 0xa002) AM_READ_PORT("IN2") AM_WRITE(ninjakun_cpu1_io_A002_w)
206
 
        AM_RANGE(0xa003, 0xa003) AM_WRITE(pkunwar_flipscreen_w)
207
 
        AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(nova2001_fg_videoram_w) AM_BASE_MEMBER(nova2001_state, m_fg_videoram) AM_SHARE("share1")
208
 
        AM_RANGE(0xc800, 0xcfff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_BASE_MEMBER(nova2001_state, m_bg_videoram) AM_SHARE("share2")
209
 
        AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE_MEMBER(nova2001_state, m_spriteram) AM_SHARE("share3")
210
 
        AM_RANGE(0xd800, 0xd9ff) AM_RAM_WRITE(ninjakun_paletteram_w) AM_BASE_GENERIC(paletteram) AM_SHARE("share4")
211
 
        AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE("share5")
212
 
        AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE("share6")
213
 
ADDRESS_MAP_END
214
 
 
215
 
static ADDRESS_MAP_START( ninjakun_cpu2_map, AS_PROGRAM, 8 )
216
 
        AM_RANGE(0x0000, 0x1fff) AM_ROM
217
 
        AM_RANGE(0x2000, 0x7fff) AM_ROM AM_REGION("maincpu", 0x2000)
218
 
        AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_address_data_w)
219
 
        AM_RANGE(0x8001, 0x8001) AM_DEVREAD("ay1", ay8910_r)
220
 
        AM_RANGE(0x8002, 0x8003) AM_DEVWRITE("ay2", ay8910_address_data_w)
221
 
        AM_RANGE(0x8003, 0x8003) AM_DEVREAD("ay2", ay8910_r)
222
 
        AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
223
 
        AM_RANGE(0xa001, 0xa001) AM_READ_PORT("IN1")
224
 
        AM_RANGE(0xa002, 0xa002) AM_READ_PORT("IN2") AM_WRITE(ninjakun_cpu2_io_A002_w)
225
 
        AM_RANGE(0xa003, 0xa003) AM_WRITE(nova2001_flipscreen_w)
226
 
        AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(nova2001_fg_videoram_w) AM_SHARE("share1")
227
 
        AM_RANGE(0xc800, 0xcfff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_SHARE("share2")
228
 
        AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE("share3")
229
 
        AM_RANGE(0xd800, 0xd9ff) AM_RAM_WRITE(ninjakun_paletteram_w) AM_SHARE("share4")
230
 
        AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE("share6") /* swapped wrt CPU1 */
231
 
        AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE("share5") /* swapped wrt CPU1 */
232
 
ADDRESS_MAP_END
233
 
 
234
 
 
235
 
static ADDRESS_MAP_START( pkunwar_map, AS_PROGRAM, 8 )
236
 
        AM_RANGE(0x0000, 0x7fff) AM_ROM
237
 
        AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE_MEMBER(nova2001_state, m_spriteram)
238
 
        AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(nova2001_bg_videoram_w) AM_BASE_MEMBER(nova2001_state, m_bg_videoram)
239
 
        AM_RANGE(0xa000, 0xa001) AM_DEVWRITE("ay1", ay8910_address_data_w)
240
 
        AM_RANGE(0xa001, 0xa001) AM_DEVREAD("ay1", ay8910_r)
241
 
        AM_RANGE(0xa002, 0xa003) AM_DEVWRITE("ay2", ay8910_address_data_w)
242
 
        AM_RANGE(0xa003, 0xa003) AM_DEVREAD("ay2", ay8910_r)
243
 
        AM_RANGE(0xc000, 0xc7ff) AM_RAM
244
 
        AM_RANGE(0xe000, 0xffff) AM_ROM
245
 
ADDRESS_MAP_END
246
 
 
247
 
static ADDRESS_MAP_START( pkunwar_io, AS_IO, 8 )
248
 
        ADDRESS_MAP_GLOBAL_MASK(0xff)
249
 
        AM_RANGE(0x00, 0x00) AM_WRITE(pkunwar_flipscreen_w)
250
 
ADDRESS_MAP_END
251
 
 
252
 
 
253
 
static ADDRESS_MAP_START( raiders5_cpu1_map, AS_PROGRAM, 8 )
254
 
        AM_RANGE(0x0000, 0x7fff) AM_ROM
255
 
        AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE_MEMBER(nova2001_state, m_spriteram)
256
 
        AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(nova2001_fg_videoram_w) AM_BASE_MEMBER(nova2001_state, m_fg_videoram)
257
 
        AM_RANGE(0x9000, 0x97ff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_BASE_MEMBER(nova2001_state, m_bg_videoram)
258
 
        AM_RANGE(0xa000, 0xa000) AM_WRITE(nova2001_scroll_x_w)
259
 
        AM_RANGE(0xa001, 0xa001) AM_WRITE(nova2001_scroll_y_w)
260
 
        AM_RANGE(0xa002, 0xa002) AM_WRITE(pkunwar_flipscreen_w)
261
 
        AM_RANGE(0xc000, 0xc001) AM_DEVWRITE("ay1", ay8910_address_data_w)
262
 
        AM_RANGE(0xc001, 0xc001) AM_DEVREAD("ay1", ay8910_r)
263
 
        AM_RANGE(0xc002, 0xc003) AM_DEVWRITE("ay2", ay8910_address_data_w)
264
 
        AM_RANGE(0xc003, 0xc003) AM_DEVREAD("ay2", ay8910_r)
265
 
        AM_RANGE(0xd000, 0xd1ff) AM_RAM_WRITE(ninjakun_paletteram_w) AM_BASE_GENERIC(paletteram)
266
 
        AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("share1")
267
 
ADDRESS_MAP_END
268
 
 
269
 
static ADDRESS_MAP_START( raiders5_cpu2_map, AS_PROGRAM, 8 )
270
 
        AM_RANGE(0x0000, 0x3fff) AM_ROM
271
 
        AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_address_data_w)
272
 
        AM_RANGE(0x8001, 0x8001) AM_DEVREAD("ay1", ay8910_r)
273
 
        AM_RANGE(0x8002, 0x8003) AM_DEVWRITE("ay2", ay8910_address_data_w)
274
 
        AM_RANGE(0x8003, 0x8003) AM_DEVREAD("ay2", ay8910_r)
275
 
        AM_RANGE(0x9000, 0x9000) AM_READNOP /* unknown */
276
 
        AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_SHARE("share1")
277
 
        AM_RANGE(0xc000, 0xc000) AM_READNOP /* unknown */
278
 
        AM_RANGE(0xc800, 0xc800) AM_READNOP /* unknown */
279
 
        AM_RANGE(0xd000, 0xd000) AM_READNOP /* unknown */
280
 
        AM_RANGE(0xe000, 0xe000) AM_WRITE(nova2001_scroll_x_w)
281
 
        AM_RANGE(0xe001, 0xe001) AM_WRITE(nova2001_scroll_y_w)
282
 
        AM_RANGE(0xe002, 0xe002) AM_WRITE(pkunwar_flipscreen_w)
283
 
ADDRESS_MAP_END
284
 
 
285
 
static ADDRESS_MAP_START( raiders5_io, AS_IO, 8 )
286
 
        AM_RANGE(0x00, 0x00) AM_READNOP /* unknown */
287
 
ADDRESS_MAP_END
288
 
 
289
 
 
290
 
 
291
 
/*************************************
292
 
 *
293
 
 *  Port definitions
294
 
 *
295
 
 *************************************/
296
 
 
297
 
static INPUT_PORTS_START( nova2001 )
298
 
        PORT_START("IN0")
299
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
300
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
301
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
302
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
303
 
        PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
304
 
        PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )    // pause
305
 
        PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )    // fire
306
 
 
307
 
        PORT_START("IN1")
308
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
309
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
310
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
311
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
312
 
        PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
313
 
        PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
314
 
        PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
315
 
 
316
 
        PORT_START("IN2")
317
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(4)
318
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
319
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
320
 
        PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNUSED )
321
 
        PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
322
 
 
323
 
        PORT_START("DSW1")
324
 
        PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1")
325
 
        PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
326
 
        PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
327
 
        PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2")
328
 
        PORT_DIPSETTING(    0x02, "3" )
329
 
        PORT_DIPSETTING(    0x00, "4" )
330
 
        PORT_DIPNAME( 0x04, 0x04, "1st Bonus Life" ) PORT_DIPLOCATION("SW1:3")
331
 
        PORT_DIPSETTING(    0x04, "20K" )
332
 
        PORT_DIPSETTING(    0x00, "30K" )
333
 
        PORT_DIPNAME( 0x18, 0x18, "Extra Bonus Life" ) PORT_DIPLOCATION("SW1:4,5")
334
 
        PORT_DIPSETTING(    0x18, "60K" )
335
 
        PORT_DIPSETTING(    0x10, "70K" )
336
 
        PORT_DIPSETTING(    0x08, "90K" )
337
 
        PORT_DIPSETTING(    0x00, DEF_STR( None ) )
338
 
        PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:6,7")
339
 
        PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
340
 
        PORT_DIPSETTING(    0x00, DEF_STR( 2C_2C ) )
341
 
        PORT_DIPSETTING(    0x60, DEF_STR( 1C_1C ) )
342
 
        PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
343
 
        PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:8")
344
 
        PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
345
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
346
 
 
347
 
        PORT_START("DSW2")
348
 
        PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
349
 
        PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
350
 
        PORT_DIPSETTING(    0x03, DEF_STR( Medium ) )
351
 
        PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
352
 
        PORT_DIPSETTING(    0x01, DEF_STR( Hardest ) )
353
 
        PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3")
354
 
        PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
355
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
356
 
        PORT_DIPNAME( 0x08, 0x08, "High Score Names" ) PORT_DIPLOCATION("SW2:4")
357
 
        PORT_DIPSETTING(    0x00, "3 Letters" )
358
 
        PORT_DIPSETTING(    0x08, "8 Letters" )
359
 
        PORT_DIPUNUSED_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW2:5" )
360
 
        PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW2:6" )
361
 
        PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW2:7" )
362
 
        PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:8" )
363
 
INPUT_PORTS_END
364
 
 
365
 
static INPUT_PORTS_START( ninjakun )
366
 
        PORT_START("IN0")       /* 0xa000 */
367
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_JOYSTICK_LEFT ) PORT_2WAY /* "XPOS1" */
368
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICK_RIGHT ) PORT_2WAY
369
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_BUTTON2 )
370
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_BUTTON1 )
371
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_UNKNOWN )
372
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_START1  )
373
 
        PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
374
 
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
375
 
 
376
 
        PORT_START("IN1")       /* 0xa001 */
377
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_JOYSTICK_LEFT) PORT_2WAY PORT_COCKTAIL /* "YPOS1" */
378
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICK_RIGHT) PORT_2WAY PORT_COCKTAIL
379
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_COCKTAIL
380
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_COCKTAIL
381
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_UNKNOWN )
382
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_START2  )
383
 
        PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
384
 
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
385
 
 
386
 
        PORT_START("IN2")       /* 0xa002 */
387
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
388
 
        PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ninjakun_io_A002_ctrl_r, NULL)
389
 
 
390
 
        PORT_START("DSW1")
391
 
        PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )  PORT_DIPLOCATION("SW1:1")
392
 
        PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
393
 
        PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
394
 
        PORT_DIPNAME( 0x06, 0x04, DEF_STR( Lives ) )  PORT_DIPLOCATION("SW1:2,3")
395
 
        PORT_DIPSETTING(    0x02, "2" )
396
 
        PORT_DIPSETTING(    0x04, "3" )
397
 
        PORT_DIPSETTING(    0x06, "4" )
398
 
        PORT_DIPSETTING(    0x00, "5" )
399
 
        PORT_DIPNAME( 0x08, 0x08, "First Bonus" )  PORT_DIPLOCATION("SW1:4")
400
 
        PORT_DIPSETTING(    0x08, "30000" )
401
 
        PORT_DIPSETTING(    0x00, "40000" )
402
 
        PORT_DIPNAME( 0x30, 0x30, "Second Bonus" )  PORT_DIPLOCATION("SW1:5,6")
403
 
        PORT_DIPSETTING(    0x00, "No Bonus" )
404
 
        PORT_DIPSETTING(    0x10, "Every 30000" )
405
 
        PORT_DIPSETTING(    0x30, "Every 50000" )
406
 
        PORT_DIPSETTING(    0x20, "Every 70000" )
407
 
        PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )  PORT_DIPLOCATION("SW1:7")
408
 
        PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
409
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
410
 
        PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) )  PORT_DIPLOCATION("SW1:8")
411
 
        PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
412
 
        PORT_DIPSETTING(    0x00, DEF_STR( Hard )   )
413
 
 
414
 
        PORT_START("DSW2")
415
 
        PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )  PORT_DIPLOCATION("SW2:1,2,3")
416
 
        PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
417
 
        PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
418
 
        PORT_DIPSETTING(    0x00, DEF_STR( 4C_2C ) )
419
 
        PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
420
 
        PORT_DIPSETTING(    0x01, DEF_STR( 3C_2C ) )
421
 
        PORT_DIPSETTING(    0x02, DEF_STR( 2C_2C ) )
422
 
        PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
423
 
        PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) )
424
 
        PORT_DIPNAME( 0x08, 0x08, "High Score Names" )  PORT_DIPLOCATION("SW2:4")
425
 
        PORT_DIPSETTING(    0x00, "3 Letters" )
426
 
        PORT_DIPSETTING(    0x08, "8 Letters" )
427
 
        PORT_DIPNAME( 0x10, 0x00, DEF_STR( Allow_Continue ) )  PORT_DIPLOCATION("SW2:5")
428
 
        PORT_DIPSETTING(    0x10, DEF_STR( No ) )
429
 
        PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
430
 
        PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW2:6" )
431
 
        PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )  PORT_DIPLOCATION("SW2:7")
432
 
        PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
433
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
434
 
        PORT_DIPNAME( 0x80, 0x80, "Infinite Lives (If Free Play)" )  PORT_DIPLOCATION("SW2:8")
435
 
        PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
436
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
437
 
INPUT_PORTS_END
438
 
 
439
 
static INPUT_PORTS_START( pkunwar )
440
 
        PORT_START("IN0")
441
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
442
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
443
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
444
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
445
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
446
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
447
 
        PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
448
 
        PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
449
 
 
450
 
        PORT_START("IN1")
451
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
452
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
453
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
454
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
455
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
456
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
457
 
        PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
458
 
        PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
459
 
 
460
 
        PORT_START("IN2")
461
 
        PORT_DIPUNKNOWN_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:1" )
462
 
        PORT_DIPUNKNOWN_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW1:2" )
463
 
        PORT_DIPUNKNOWN_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW1:3" )
464
 
        PORT_DIPUNKNOWN_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW1:4" )
465
 
        PORT_DIPUNKNOWN_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW1:5" )
466
 
        PORT_DIPUNKNOWN_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:6" )
467
 
        PORT_DIPUNKNOWN_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW1:7" )
468
 
        PORT_DIPUNKNOWN_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:8" )
469
 
 
470
 
        PORT_START("DSW1")
471
 
        PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )  PORT_DIPLOCATION("SW2:1,2")
472
 
        PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
473
 
        PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
474
 
        PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
475
 
        PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
476
 
        PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )  PORT_DIPLOCATION("SW2:3")
477
 
        PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
478
 
        PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
479
 
        PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )  PORT_DIPLOCATION("SW2:4")
480
 
        PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
481
 
        PORT_DIPSETTING(    0x08, DEF_STR( On ) )
482
 
        PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )  PORT_DIPLOCATION("SW2:5,6")
483
 
        PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
484
 
        PORT_DIPSETTING(    0x30, DEF_STR( Medium ) )
485
 
        PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
486
 
        PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
487
 
        PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )  PORT_DIPLOCATION("SW2:7")
488
 
        PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
489
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
490
 
        PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) )  PORT_DIPLOCATION("SW2:8")
491
 
        PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
492
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
493
 
INPUT_PORTS_END
494
 
 
495
 
static INPUT_PORTS_START( raiders5 )
496
 
        PORT_START("IN0")
497
 
        PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
498
 
        PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
499
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
500
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
501
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
502
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
503
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
504
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
505
 
 
506
 
        PORT_START("IN1")
507
 
        PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
508
 
        PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
509
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
510
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
511
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
512
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
513
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
514
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
515
 
 
516
 
        PORT_START("IN2")
517
 
        PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )  PORT_DIPLOCATION("SW1:1")
518
 
        PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
519
 
        PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
520
 
        PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )  PORT_DIPLOCATION("SW1:2,3")
521
 
        PORT_DIPSETTING(    0x00, "2" )
522
 
        PORT_DIPSETTING(    0x06, "3" )
523
 
        PORT_DIPSETTING(    0x04, "4" )
524
 
        PORT_DIPSETTING(    0x02, "5" )
525
 
        PORT_DIPNAME( 0x08, 0x08, "1st Bonus" )  PORT_DIPLOCATION("SW1:4")
526
 
        PORT_DIPSETTING(    0x08, "30000" )
527
 
        PORT_DIPSETTING(    0x00, "40000" )
528
 
        PORT_DIPNAME( 0x30, 0x30, "2nd Bonus" )  PORT_DIPLOCATION("SW1:5,6")
529
 
        PORT_DIPSETTING(    0x30, "Every 50000" )
530
 
        PORT_DIPSETTING(    0x20, "Every 70000" )
531
 
        PORT_DIPSETTING(    0x10, "Every 90000" )
532
 
        PORT_DIPSETTING(    0x00, DEF_STR( None ) )
533
 
        PORT_DIPNAME( 0x40, 0x40, "Exercise" )  PORT_DIPLOCATION("SW1:7")  // Unused in manual
534
 
        PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
535
 
        PORT_DIPSETTING(    0x40, DEF_STR( On ) )
536
 
        PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) )  PORT_DIPLOCATION("SW1:8")
537
 
        PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
538
 
        PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
539
 
 
540
 
        PORT_START("DSW1")
541
 
        PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )  PORT_DIPLOCATION("SW2:1,2,3")
542
 
        PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
543
 
        PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
544
 
        PORT_DIPSETTING(    0x00, DEF_STR( 4C_2C ) )
545
 
        PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
546
 
        PORT_DIPSETTING(    0x01, DEF_STR( 3C_2C ) )
547
 
        PORT_DIPSETTING(    0x02, DEF_STR( 2C_2C ) )
548
 
        PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
549
 
        PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) )
550
 
        PORT_DIPNAME( 0x08, 0x08, "High Score Names" )  PORT_DIPLOCATION("SW2:4")
551
 
        PORT_DIPSETTING(    0x00, "3 Letters" )
552
 
        PORT_DIPSETTING(    0x08, "8 Letters" )
553
 
        PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )  PORT_DIPLOCATION("SW2:5")
554
 
        PORT_DIPSETTING(    0x00, DEF_STR( No ) )
555
 
        PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
556
 
        PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW2:6" )
557
 
        PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )  PORT_DIPLOCATION("SW2:7") // Unused in manual
558
 
        PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
559
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
560
 
        PORT_DIPNAME( 0x80, 0x80, "Unlimited Lives (If Free Play)" )  PORT_DIPLOCATION("SW2:8")  // Unused in manual
561
 
        PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
562
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
563
 
INPUT_PORTS_END
564
 
 
565
 
 
566
 
 
567
 
/*************************************
568
 
 *
569
 
 *  Graphics layouts
570
 
 *
571
 
 *************************************/
572
 
 
573
 
static const gfx_layout layout8x8 =
574
 
{
575
 
        8,8,
576
 
        RGN_FRAC(1,1),
577
 
        4,
578
 
        { STEP4(0,1) },
579
 
        { STEP8(0,4) },
580
 
        { STEP8(0,32) },
581
 
        32*8
582
 
};
583
 
 
584
 
static const gfx_layout layout8x8_part =
585
 
{
586
 
        8,8,
587
 
        RGN_FRAC(1,4),
588
 
        4,
589
 
        { STEP4(0,1) },
590
 
        { STEP8(0,4) },
591
 
        { STEP8(0,32) },
592
 
        32*8
593
 
};
594
 
 
595
 
static const gfx_layout layout16x16 =
596
 
{
597
 
        16,16,
598
 
        RGN_FRAC(1,1),
599
 
        4,
600
 
        { STEP4(0,1) },
601
 
        { STEP8(0,4), STEP8(32*8,4) },
602
 
        { STEP8(0,32), STEP8(64*8,32) },
603
 
        128*8
604
 
};
605
 
 
606
 
static GFXDECODE_START( nova2001 )
607
 
        GFXDECODE_ENTRY( "gfx1", 0x0000, layout16x16,    0x000, 16 )    // sprites
608
 
        GFXDECODE_ENTRY( "gfx1", 0x0000, layout8x8_part, 0x000, 16 )    // fg tiles (using only 1/4th of the ROM space)
609
 
        GFXDECODE_ENTRY( "gfx1", 0x4000, layout8x8_part, 0x100, 16 )    // bg tiles (using only 1/4th of the ROM space)
610
 
GFXDECODE_END
611
 
 
612
 
static GFXDECODE_START( ninjakun )
613
 
        GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0x200, 16 )    // sprites
614
 
        GFXDECODE_ENTRY( "gfx1", 0, layout8x8,   0x000, 16 )    // fg tiles
615
 
        GFXDECODE_ENTRY( "gfx2", 0, layout8x8,   0x100, 16 )    // bg tiles
616
 
GFXDECODE_END
617
 
 
618
 
static GFXDECODE_START( pkunwar )
619
 
        GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0x000, 16 )    // sprites
620
 
        GFXDECODE_ENTRY( "gfx1", 0, layout8x8,   0x100, 16 )    // bg tiles
621
 
GFXDECODE_END
622
 
 
623
 
static GFXDECODE_START( raiders5 )
624
 
        GFXDECODE_ENTRY( "gfx1", 0, layout16x16,    0x200, 16 ) // sprites
625
 
        GFXDECODE_ENTRY( "gfx1", 0, layout8x8_part, 0x000, 16 ) // fg tiles (using only 1/4th of the ROM space)
626
 
        GFXDECODE_ENTRY( "gfx2", 0, layout8x8,      0x100, 16 ) // bg tiles
627
 
GFXDECODE_END
628
 
 
629
 
 
630
 
 
631
 
/*************************************
632
 
 *
633
 
 *  Sound definitions
634
 
 *
635
 
 *************************************/
636
 
 
637
 
static const ay8910_interface nova2001_ay8910_interface_1 =
638
 
{
639
 
        AY8910_LEGACY_OUTPUT,
640
 
        AY8910_DEFAULT_LOADS,
641
 
        DEVCB_NULL,
642
 
        DEVCB_NULL,
643
 
        DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, nova2001_scroll_x_w),
644
 
        DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, nova2001_scroll_y_w)
645
 
};
646
 
 
647
 
static const ay8910_interface nova2001_ay8910_interface_2 =
648
 
{
649
 
        AY8910_LEGACY_OUTPUT,
650
 
        AY8910_DEFAULT_LOADS,
651
 
        DEVCB_INPUT_PORT("DSW1"),
652
 
        DEVCB_INPUT_PORT("DSW2"),
653
 
        DEVCB_NULL,
654
 
        DEVCB_NULL
655
 
};
656
 
 
657
 
static const ay8910_interface pkunwar_ay8910_interface_1 =
658
 
{
659
 
        AY8910_LEGACY_OUTPUT,
660
 
        AY8910_DEFAULT_LOADS,
661
 
        DEVCB_INPUT_PORT("IN0"),
662
 
        DEVCB_INPUT_PORT("IN1"),
663
 
        DEVCB_NULL,
664
 
        DEVCB_NULL
665
 
};
666
 
 
667
 
static const ay8910_interface pkunwar_ay8910_interface_2 =
668
 
{
669
 
        AY8910_LEGACY_OUTPUT,
670
 
        AY8910_DEFAULT_LOADS,
671
 
        DEVCB_INPUT_PORT("IN2"),
672
 
        DEVCB_INPUT_PORT("DSW1"),
673
 
        DEVCB_NULL,
674
 
        DEVCB_NULL
675
 
};
676
 
 
677
 
 
678
 
 
679
 
/*************************************
680
 
 *
681
 
 *  Machine drivers
682
 
 *
683
 
 *************************************/
684
 
 
685
 
static MACHINE_CONFIG_START( nova2001, nova2001_state )
686
 
 
687
 
        /* basic machine hardware */
688
 
        MCFG_CPU_ADD("maincpu", Z80, MAIN_CLOCK/4)      // 3 MHz verified on schematics
689
 
        MCFG_CPU_PROGRAM_MAP(nova2001_map)
690
 
        MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
691
 
 
692
 
        /* video hardware */
693
 
        MCFG_SCREEN_ADD("screen", RASTER)
694
 
        MCFG_SCREEN_REFRESH_RATE(60)
695
 
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
696
 
        MCFG_SCREEN_SIZE(32*8, 32*8)
697
 
        MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
698
 
        MCFG_SCREEN_UPDATE(nova2001)
699
 
 
700
 
        MCFG_GFXDECODE(nova2001)
701
 
        MCFG_PALETTE_LENGTH(0x200)
702
 
 
703
 
        MCFG_PALETTE_INIT(nova2001)
704
 
        MCFG_VIDEO_START(nova2001)
705
 
 
706
 
        /* sound hardware */
707
 
        MCFG_SPEAKER_STANDARD_MONO("mono")
708
 
 
709
 
        MCFG_SOUND_ADD("ay1", AY8910, MAIN_CLOCK/6)     // 2 MHz verified on schematics
710
 
        MCFG_SOUND_CONFIG(nova2001_ay8910_interface_1)
711
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
712
 
 
713
 
        MCFG_SOUND_ADD("ay2", AY8910, MAIN_CLOCK/6)
714
 
        MCFG_SOUND_CONFIG(nova2001_ay8910_interface_2)
715
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
716
 
MACHINE_CONFIG_END
717
 
 
718
 
static MACHINE_CONFIG_START( ninjakun, nova2001_state )
719
 
 
720
 
        /* basic machine hardware */
721
 
        MCFG_CPU_ADD("maincpu", Z80, MAIN_CLOCK/4)      // 3 MHz
722
 
        MCFG_CPU_PROGRAM_MAP(ninjakun_cpu1_map)
723
 
        MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
724
 
 
725
 
        MCFG_CPU_ADD("sub", Z80, MAIN_CLOCK/4)  // 3 MHz
726
 
        MCFG_CPU_PROGRAM_MAP(ninjakun_cpu2_map)
727
 
        MCFG_CPU_PERIODIC_INT(irq0_line_hold,4*60) /* ? */
728
 
 
729
 
        MCFG_QUANTUM_TIME(attotime::from_hz(6000))      /* 100 CPU slices per frame */
730
 
 
731
 
        MCFG_MACHINE_START(ninjakun)
732
 
 
733
 
    /* video hardware */
734
 
 
735
 
        MCFG_SCREEN_ADD("screen", RASTER)
736
 
        MCFG_SCREEN_REFRESH_RATE(60)
737
 
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
738
 
        MCFG_SCREEN_SIZE(32*8, 32*8)
739
 
        MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1 )
740
 
        MCFG_SCREEN_UPDATE(ninjakun)
741
 
 
742
 
        MCFG_GFXDECODE(ninjakun)
743
 
        MCFG_PALETTE_LENGTH(0x300)
744
 
 
745
 
        MCFG_VIDEO_START(ninjakun)
746
 
 
747
 
        /* sound hardware */
748
 
        MCFG_SPEAKER_STANDARD_MONO("mono")
749
 
 
750
 
        MCFG_SOUND_ADD("ay1", AY8910, MAIN_CLOCK/4)     // 3 MHz
751
 
        MCFG_SOUND_CONFIG(nova2001_ay8910_interface_2)  // note swapped order wrt nova2001
752
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
753
 
 
754
 
        MCFG_SOUND_ADD("ay2", AY8910, MAIN_CLOCK/4)     // 3 MHz
755
 
        MCFG_SOUND_CONFIG(nova2001_ay8910_interface_1)
756
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
757
 
MACHINE_CONFIG_END
758
 
 
759
 
static MACHINE_CONFIG_START( pkunwar, nova2001_state )
760
 
 
761
 
        /* basic machine hardware */
762
 
        MCFG_CPU_ADD("maincpu", Z80, MAIN_CLOCK/4)      // 3 MHz
763
 
        MCFG_CPU_PROGRAM_MAP(pkunwar_map)
764
 
        MCFG_CPU_IO_MAP(pkunwar_io)
765
 
        MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
766
 
 
767
 
        /* video hardware */
768
 
        MCFG_SCREEN_ADD("screen", RASTER)
769
 
        MCFG_SCREEN_REFRESH_RATE(60)
770
 
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
771
 
        MCFG_SCREEN_SIZE(32*8, 32*8)
772
 
        MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
773
 
        MCFG_SCREEN_UPDATE(pkunwar)
774
 
 
775
 
        MCFG_GFXDECODE(pkunwar)
776
 
        MCFG_PALETTE_LENGTH(0x200)
777
 
 
778
 
        MCFG_PALETTE_INIT(nova2001)
779
 
        MCFG_VIDEO_START(pkunwar)
780
 
 
781
 
        /* sound hardware */
782
 
        MCFG_SPEAKER_STANDARD_MONO("mono")
783
 
 
784
 
        MCFG_SOUND_ADD("ay1", AY8910, MAIN_CLOCK/8)     // 1.5MHz (correct?)
785
 
        MCFG_SOUND_CONFIG(pkunwar_ay8910_interface_1)
786
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
787
 
 
788
 
        MCFG_SOUND_ADD("ay2", AY8910, MAIN_CLOCK/8)
789
 
        MCFG_SOUND_CONFIG(pkunwar_ay8910_interface_2)
790
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
791
 
MACHINE_CONFIG_END
792
 
 
793
 
static MACHINE_CONFIG_START( raiders5, nova2001_state )
794
 
 
795
 
        /* basic machine hardware */
796
 
        MCFG_CPU_ADD("maincpu", Z80, MAIN_CLOCK/4)      // 3 MHz
797
 
        MCFG_CPU_PROGRAM_MAP(raiders5_cpu1_map)
798
 
        MCFG_CPU_IO_MAP(raiders5_io)
799
 
        MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
800
 
 
801
 
        MCFG_CPU_ADD("sub", Z80, MAIN_CLOCK/4)  // 3 MHz
802
 
        MCFG_CPU_PROGRAM_MAP(raiders5_cpu2_map)
803
 
        MCFG_CPU_PERIODIC_INT(irq0_line_hold,4*60)      /* ? */
804
 
 
805
 
        MCFG_QUANTUM_TIME(attotime::from_hz(24000))
806
 
 
807
 
        /* video hardware */
808
 
        MCFG_SCREEN_ADD("screen", RASTER)
809
 
        MCFG_SCREEN_REFRESH_RATE(60)
810
 
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
811
 
        MCFG_SCREEN_SIZE(32*8, 32*8)
812
 
        MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
813
 
        MCFG_SCREEN_UPDATE(raiders5)
814
 
 
815
 
        MCFG_GFXDECODE(raiders5)
816
 
        MCFG_PALETTE_LENGTH(0x300)
817
 
 
818
 
        MCFG_VIDEO_START(raiders5)
819
 
 
820
 
        /* sound hardware */
821
 
        MCFG_SPEAKER_STANDARD_MONO("mono")
822
 
 
823
 
        MCFG_SOUND_ADD("ay1", AY8910, MAIN_CLOCK/8)     // 1.5MHz
824
 
        MCFG_SOUND_CONFIG(pkunwar_ay8910_interface_1)
825
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
826
 
 
827
 
        MCFG_SOUND_ADD("ay2", AY8910, MAIN_CLOCK/8)
828
 
        MCFG_SOUND_CONFIG(pkunwar_ay8910_interface_2)
829
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
830
 
MACHINE_CONFIG_END
831
 
 
832
 
 
833
 
 
834
 
/*************************************
835
 
 *
836
 
 *  ROM definitions
837
 
 *
838
 
 *************************************/
839
 
 
840
 
ROM_START( nova2001 )
841
 
        ROM_REGION( 0x10000, "maincpu", 0 )
842
 
        ROM_LOAD( "1.6c",         0x0000, 0x2000, CRC(368cffc0) SHA1(b756c0542d5b86640af62639bdd0d32f6e364dd3) )
843
 
        ROM_LOAD( "2.6d",         0x2000, 0x2000, CRC(bc4e442b) SHA1(6e1dca5dde442db95403377bf49aaad2a337813e) )
844
 
        ROM_LOAD( "3.6f",         0x4000, 0x2000, CRC(b2849038) SHA1(b56c7c03ef7c677cc6df0280a485f9cda3435b23) )
845
 
        ROM_LOAD( "4.6g",         0x6000, 0x1000, CRC(6b5bb12d) SHA1(74aee3d08a7ee1f98eaec4a4b3062aa9d17948ec) )
846
 
        ROM_RELOAD(               0x7000, 0x1000 )      // half size ROM, mirrored
847
 
 
848
 
        ROM_REGION( 0x8000, "gfx1", 0 )
849
 
        ROM_LOAD16_BYTE( "5.12s",        0x0000, 0x2000, CRC(54198941) SHA1(fe762a0bbcf10b13ece87ded2ea730257cfbe7d3) )
850
 
        ROM_LOAD16_BYTE( "6.12p",        0x0001, 0x2000, CRC(cbd90dca) SHA1(7eacde832f5783f4389fb98d6bf6b26dd494665d) )
851
 
        ROM_LOAD16_BYTE( "7.12n",        0x4000, 0x2000, CRC(9ebd8806) SHA1(26b6caa0d0a7ae52a182070ecc7bc696c12038b3) )
852
 
        ROM_LOAD16_BYTE( "8.12l",        0x4001, 0x2000, CRC(d1b18389) SHA1(2d808fee774f1bb4cec42e23cfef36b54eee0efa) )
853
 
 
854
 
        ROM_REGION( 0x0020, "proms", 0 )
855
 
        ROM_LOAD( "nova2001.clr", 0x0000, 0x0020, CRC(a2fac5cd) SHA1(ad14aa2be57722d1f48b47171fe72f96091423b6) )
856
 
ROM_END
857
 
 
858
 
ROM_START( nova2001u )
859
 
        ROM_REGION( 0x10000, "maincpu", 0 )
860
 
        ROM_LOAD( "nova2001.1",   0x0000, 0x2000, CRC(b79461bd) SHA1(7fac3313bc76612f66a6518450d0fed32fe70c45) )
861
 
        ROM_LOAD( "nova2001.2",   0x2000, 0x2000, CRC(fab87144) SHA1(506703f9d96443839f864ef5bde1a71120f54384) )
862
 
        ROM_LOAD( "3.6f",         0x4000, 0x2000, CRC(b2849038) SHA1(b56c7c03ef7c677cc6df0280a485f9cda3435b23) )
863
 
        ROM_LOAD( "4.6g",         0x6000, 0x1000, CRC(6b5bb12d) SHA1(74aee3d08a7ee1f98eaec4a4b3062aa9d17948ec) )
864
 
        ROM_RELOAD(               0x7000, 0x1000 )      // half size ROM, mirrored
865
 
 
866
 
        ROM_REGION( 0x8000, "gfx1", 0 )
867
 
        ROM_LOAD16_BYTE( "nova2001.5",   0x0000, 0x2000, CRC(8ea576e8) SHA1(d8dbcfd43aafe25afad7f947a80737cdc55b23d7) )
868
 
        ROM_LOAD16_BYTE( "nova2001.6",   0x0001, 0x2000, CRC(0c61656c) SHA1(41c480799798c95543b5a805694e68282b9f563a) )
869
 
        ROM_LOAD16_BYTE( "7.12n",        0x4000, 0x2000, CRC(9ebd8806) SHA1(26b6caa0d0a7ae52a182070ecc7bc696c12038b3) )
870
 
        ROM_LOAD16_BYTE( "8.12l",        0x4001, 0x2000, CRC(d1b18389) SHA1(2d808fee774f1bb4cec42e23cfef36b54eee0efa) )
871
 
 
872
 
        ROM_REGION( 0x0020, "proms", 0 )
873
 
        ROM_LOAD( "nova2001.clr", 0x0000, 0x0020, CRC(a2fac5cd) SHA1(ad14aa2be57722d1f48b47171fe72f96091423b6) )
874
 
ROM_END
875
 
 
876
 
ROM_START( ninjakun ) /* Original Board? */
877
 
        ROM_REGION( 0x10000, "maincpu", 0 )
878
 
        ROM_LOAD( "ninja-1.7a",  0x0000, 0x02000, CRC(1c1dc141) SHA1(423d3ed35e73a8d5bfce075a889b0322b207bd0d) )
879
 
        ROM_LOAD( "ninja-2.7b",  0x2000, 0x02000, CRC(39cc7d37) SHA1(7f0d0e1e92cb6a57f15eb7fc51a67112f1c5fc8e) )
880
 
        ROM_LOAD( "ninja-3.7d",  0x4000, 0x02000, CRC(d542bfe3) SHA1(3814d8f5b1acda21438fff4f71670fa653dc7b30) )
881
 
        ROM_LOAD( "ninja-4.7e",  0x6000, 0x02000, CRC(a57385c6) SHA1(77925a281e64889bfe967c3d42a388529aaf7eb6) )
882
 
 
883
 
        ROM_REGION( 0x10000, "sub", 0 )
884
 
        ROM_LOAD( "ninja-5.7h",  0x0000, 0x02000, CRC(164a42c4) SHA1(16b434b33b76b878514f67c23315d4c6da7bfc9e) )
885
 
 
886
 
        ROM_REGION( 0x08000, "gfx1", 0 )
887
 
        ROM_LOAD16_BYTE( "ninja-6.7n",  0x0000, 0x02000, CRC(a74c4297) SHA1(87184d14c67331f2c8a2412e28f31427eddae799) )
888
 
        ROM_LOAD16_BYTE( "ninja-7.7p",  0x0001, 0x02000, CRC(53a72039) SHA1(d77d608ce9388a8956831369badd88a8eda8e102) )
889
 
        ROM_LOAD16_BYTE( "ninja-8.7s",  0x4000, 0x02000, CRC(4a99d857) SHA1(6aadb6a5c721a161a5c1bef5569c1e323e380cff) )
890
 
        ROM_LOAD16_BYTE( "ninja-9.7t",  0x4001, 0x02000, CRC(dede49e4) SHA1(8ce4bc02ec583b3885ca63fb5e2d5dad185fe192) )
891
 
 
892
 
        ROM_REGION( 0x08000, "gfx2", 0 )
893
 
        ROM_LOAD16_BYTE( "ninja-10.2c", 0x0000, 0x02000, CRC(0d55664a) SHA1(955a607b4401ce9f3f807d53833a766152b0ef9b) )
894
 
        ROM_LOAD16_BYTE( "ninja-11.2d", 0x0001, 0x02000, CRC(12ff9597) SHA1(10b572844ab32e3ae54abe3600fecc1a811ac713) )
895
 
        ROM_LOAD16_BYTE( "ninja-12.4c", 0x4000, 0x02000, CRC(e9b75807) SHA1(cf4c8ac962f785e9de5502df58eab9b3725aaa28) )
896
 
        ROM_LOAD16_BYTE( "ninja-13.4d", 0x4001, 0x02000, CRC(1760ed2c) SHA1(ee4c8efcce483c8051873714856824a1a1e14b61) )
897
 
ROM_END
898
 
 
899
 
ROM_START( pkunwar )
900
 
        ROM_REGION( 0x10000, "maincpu", 0 )
901
 
        ROM_LOAD( "pkwar.01r",    0x0000, 0x4000, CRC(ce2d2c7b) SHA1(2ffe2eb339fd668ec4fe90eff66124a334db0693) )
902
 
        ROM_LOAD( "pkwar.02r",    0x4000, 0x4000, CRC(abc1f661) SHA1(c4bf4a345efd4271617de9f334303d81c6885aa5) )
903
 
        ROM_LOAD( "pkwar.03r",    0xe000, 0x2000, CRC(56faebea) SHA1(dd0406c723a08f5d1120655857a115ab8c2d2a11) )
904
 
 
905
 
        ROM_REGION( 0x10000, "gfx1", 0 )        // (need lineswapping)
906
 
        ROM_LOAD( "pkwar.01y",    0x0000, 0x4000, CRC(428d3b92) SHA1(7fe11e8d785fe829d34e512f233bb9ccc70cd431) )
907
 
        ROM_LOAD( "pkwar.02y",    0x4000, 0x4000, CRC(ce1da7bc) SHA1(a2357b61703a689ce63aec7dd44702b119894f8e) )
908
 
        ROM_LOAD( "pkwar.03y",    0x8000, 0x4000, CRC(63204400) SHA1(1ba87ad3425c51150cb65408f04ee0147ef332d3) )
909
 
        ROM_LOAD( "pkwar.04y",    0xc000, 0x4000, CRC(061dfca8) SHA1(0a2dd8fc790d607195ca18dfc55575c2b9ddc58a) )
910
 
 
911
 
        ROM_REGION( 0x0020, "proms", 0 )
912
 
        ROM_LOAD( "pkwar.col",    0x0000, 0x0020, CRC(af0fc5e2) SHA1(480908bf893211b580ae19cfb40dc35ad1bbc343) )
913
 
ROM_END
914
 
 
915
 
ROM_START( pkunwarj )
916
 
        ROM_REGION( 0x10000, "maincpu", 0 )
917
 
        ROM_LOAD( "pgunwar.6",    0x0000, 0x4000, CRC(357f3ef3) SHA1(bc651fb7701b395ae8cda1888814af5c5aa325a6) )
918
 
        ROM_LOAD( "pgunwar.5",    0x4000, 0x4000, CRC(0092e49e) SHA1(7945361036f7679e4f4bb6b94f60f3ca09c077dc) )
919
 
        ROM_LOAD( "pkwar.03r",    0xe000, 0x2000, CRC(56faebea) SHA1(dd0406c723a08f5d1120655857a115ab8c2d2a11) )
920
 
 
921
 
        ROM_REGION( 0x10000, "gfx1", 0 )        // (need lineswapping)
922
 
        ROM_LOAD( "pkwar.01y",    0x0000, 0x4000, CRC(428d3b92) SHA1(7fe11e8d785fe829d34e512f233bb9ccc70cd431) )
923
 
        ROM_LOAD( "pkwar.02y",    0x4000, 0x4000, CRC(ce1da7bc) SHA1(a2357b61703a689ce63aec7dd44702b119894f8e) )
924
 
        ROM_LOAD( "pgunwar.2",    0x8000, 0x4000, CRC(a2a43443) SHA1(4e10569886d364eb2539928ea81dc1565b60b590) )
925
 
        ROM_LOAD( "pkwar.04y",    0xc000, 0x4000, CRC(061dfca8) SHA1(0a2dd8fc790d607195ca18dfc55575c2b9ddc58a) )
926
 
 
927
 
        ROM_REGION( 0x0020, "proms", 0 )
928
 
        ROM_LOAD( "pkwar.col",    0x0000, 0x0020, CRC(af0fc5e2) SHA1(480908bf893211b580ae19cfb40dc35ad1bbc343) )
929
 
ROM_END
930
 
 
931
 
ROM_START( raiders5 )
932
 
        ROM_REGION( 0x10000, "maincpu", 0 )
933
 
        ROM_LOAD( "raiders5.1", 0x0000,  0x4000, CRC(47cea11f) SHA1(0499e6627ad9c16775fdc59f2ff56dfdfc23490a) )
934
 
        ROM_LOAD( "raiders5.2", 0x4000,  0x4000, CRC(eb2ff410) SHA1(5c995b66b6301cd3cd58efd173481deaa036f842) )
935
 
 
936
 
        ROM_REGION( 0x10000, "sub", 0 )
937
 
        ROM_LOAD( "raiders5.2", 0x0000,  0x4000, CRC(eb2ff410) SHA1(5c995b66b6301cd3cd58efd173481deaa036f842) )
938
 
 
939
 
        ROM_REGION( 0x8000, "gfx1", 0 ) // (need lineswapping)
940
 
        ROM_LOAD( "raiders3.11f", 0x0000,  0x4000, CRC(30041d58) SHA1(a33087de7afb276925879898a96f418128a5a38c) )
941
 
        ROM_LOAD( "raiders4.11g", 0x4000,  0x4000, CRC(e441931c) SHA1(f39b4c25de779c671a6e2b02df64e7fed726f4da) )
942
 
 
943
 
        ROM_REGION( 0x4000, "gfx2", 0 ) // (need lineswapping)
944
 
        ROM_LOAD( "raiders5.11n", 0x0000,  0x4000, CRC(c0895090) SHA1(a3a1ae57ed66bc095ea9bfb26470290f67aab1fe) )
945
 
ROM_END
946
 
 
947
 
ROM_START( raiders5t )
948
 
        ROM_REGION( 0x10000, "maincpu", 0 )
949
 
        ROM_LOAD( "raiders1.4c", 0x0000,  0x4000, CRC(4e2d5679) SHA1(a1c1603ba98814a83b92ad024ca4422aea872111) )
950
 
        ROM_LOAD( "raiders2.4d", 0x4000,  0x4000, CRC(c8604be1) SHA1(6d23f26174bb9b2f7db3a5fa6b39674fe237135b) )
951
 
 
952
 
        ROM_REGION( 0x10000, "sub", 0 )
953
 
        ROM_LOAD( "raiders2.4d", 0x0000,  0x4000, CRC(c8604be1) SHA1(6d23f26174bb9b2f7db3a5fa6b39674fe237135b) )
954
 
 
955
 
        ROM_REGION( 0x8000, "gfx1", 0 ) // (need lineswapping)
956
 
        ROM_LOAD( "raiders3.11f", 0x0000,  0x4000, CRC(30041d58) SHA1(a33087de7afb276925879898a96f418128a5a38c) )
957
 
        ROM_LOAD( "raiders4.11g", 0x4000,  0x4000, CRC(e441931c) SHA1(f39b4c25de779c671a6e2b02df64e7fed726f4da) )
958
 
 
959
 
        ROM_REGION( 0x4000, "gfx2", 0 ) // (need lineswapping)
960
 
        ROM_LOAD( "raiders5.11n", 0x0000,  0x4000, CRC(c0895090) SHA1(a3a1ae57ed66bc095ea9bfb26470290f67aab1fe) )
961
 
ROM_END
962
 
 
963
 
 
964
 
 
965
 
/*************************************
966
 
 *
967
 
 *  Gfx ROM swizzling
968
 
 *
969
 
 *************************************/
970
 
 
971
 
/******************************************************************************
972
 
 
973
 
Gfx ROMs in pkunwar have an unusual layout, where a high address bit
974
 
(which is no the top bit) separates parts of the same tile.
975
 
 
976
 
This all originates from Nova2001 apparently, which uses 0x2000 bytes ROMs for
977
 
the graphics. When the number of tiles was increased, the same 0x2000 blocks
978
 
were maintained even if the ROMs got larger.
979
 
 
980
 
To make it possible to decode graphics without resorting to ROM_CONTINUE
981
 
trickery, this function makes an address line rotation, bringing bit "bit" to
982
 
bit 0 and shifting left by one place all the intervening bits.
983
 
 
984
 
This code is overly generic because it is used for several games in ninjakd2.c
985
 
 
986
 
******************************************************************************/
987
 
 
988
 
static void lineswap_gfx_roms(running_machine &machine, const char *region, const int bit)
989
 
{
990
 
        const int length = machine.region(region)->bytes();
991
 
 
992
 
        UINT8* const src = machine.region(region)->base();
993
 
 
994
 
        UINT8* const temp = auto_alloc_array(machine, UINT8, length);
995
 
 
996
 
        const int mask = (1 << (bit + 1)) - 1;
997
 
 
998
 
        int sa;
999
 
 
1000
 
        for (sa = 0; sa < length; sa++)
1001
 
        {
1002
 
                const int da = (sa & ~mask) | ((sa << 1) & mask) | ((sa >> bit) & 1);
1003
 
 
1004
 
                temp[da] = src[sa];
1005
 
        }
1006
 
 
1007
 
        memcpy(src, temp, length);
1008
 
 
1009
 
        auto_free(machine, temp);
1010
 
}
1011
 
 
1012
 
 
1013
 
 
1014
 
/*************************************
1015
 
 *
1016
 
 *  Driver initialization
1017
 
 *
1018
 
 *************************************/
1019
 
 
1020
 
static DRIVER_INIT( pkunwar )
1021
 
{
1022
 
        lineswap_gfx_roms(machine, "gfx1", 13);
1023
 
}
1024
 
 
1025
 
static DRIVER_INIT( raiders5 )
1026
 
{
1027
 
        lineswap_gfx_roms(machine, "gfx1", 13);
1028
 
        lineswap_gfx_roms(machine, "gfx2", 13);
1029
 
}
1030
 
 
1031
 
 
1032
 
 
1033
 
/*************************************
1034
 
 *
1035
 
 *  Game drivers
1036
 
 *
1037
 
 *************************************/
1038
 
 
1039
 
GAME( 1983, nova2001, 0,        nova2001, nova2001, 0,        ROT0, "UPL", "Nova 2001 (Japan)", 0 )
1040
 
GAME( 1983, nova2001u,nova2001, nova2001, nova2001, 0,        ROT0, "UPL (Universal license)", "Nova 2001 (US)", 0 )
1041
 
GAME( 1984, ninjakun, 0,        ninjakun, ninjakun, 0,        ROT0, "UPL (Taito license)", "Ninjakun Majou no Bouken", 0 )
1042
 
GAME( 1985, pkunwar,  0,        pkunwar,  pkunwar,  pkunwar,  ROT0, "UPL", "Penguin-Kun Wars (US)", 0 )
1043
 
GAME( 1985, pkunwarj, pkunwar,  pkunwar,  pkunwar,  pkunwar,  ROT0, "UPL", "Penguin-Kun Wars (Japan)", 0 )
1044
 
GAME( 1985, raiders5, 0,        raiders5, raiders5, raiders5, ROT0, "UPL", "Raiders5", 0 )
1045
 
GAME( 1985, raiders5t,raiders5, raiders5, raiders5, raiders5, ROT0, "UPL (Taito license)", "Raiders5 (Japan)", 0 )