~ubuntu-branches/ubuntu/raring/mame/raring-proposed

« back to all changes in this revision

Viewing changes to mess/src/mame/drivers/pinkiri8.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
 
Pinkiri 8 skeleton driver
4
 
 
5
 
- current blocker is the video emulation i/o ports, it looks somewhat exotic.
6
 
 
7
 
============================================================================
8
 
Janshi
9
 
(c)1992 Eagle
10
 
 
11
 
CPU: HD647180X0P6 (16K EPROM internal rom)
12
 
Sound: AY-3-8910, M6295
13
 
Others: Battery
14
 
OSC: 32MHz, 21MHz & 12.2880MHz
15
 
 
16
 
ROMs:
17
 
1.1A         [92b140a5]
18
 
2.1B         [6de7e086]
19
 
3.1D         [4e94d8f2]
20
 
4.1F         [a5f6e3ef]
21
 
5.1H         [ff2cc769]
22
 
6.1K         [8197034d]
23
 
11.1L        [a7692ddf]
24
 
 
25
 
 
26
 
 
27
 
--- Team Japump!!! ---
28
 
Dumped by Chackn
29
 
04/May/2007
30
 
 
31
 
***************************************************************************/
32
 
 
33
 
#include "emu.h"
34
 
#include "cpu/z180/z180.h"
35
 
#include "sound/okim6295.h"
36
 
#include "video/generic.h"
37
 
 
38
 
 
39
 
class pinkiri8_state : public driver_device
40
 
{
41
 
public:
42
 
        pinkiri8_state(const machine_config &mconfig, device_type type, const char *tag)
43
 
                : driver_device(mconfig, type, tag) { }
44
 
 
45
 
        UINT8* m_janshi_vram1;
46
 
        UINT8* m_janshi_vram2;
47
 
        UINT8* m_janshi_back_vram;
48
 
        UINT8* m_janshi_crtc_regs;
49
 
        UINT8* m_janshi_unk1;
50
 
        UINT8* m_janshi_widthflags;
51
 
        UINT8* m_janshi_unk2;
52
 
        UINT32 m_vram_addr;
53
 
        int m_prev_writes;
54
 
        UINT8 m_mux_data;
55
 
        UINT8 m_prot_read_index;
56
 
        UINT8 m_prot_char[6];
57
 
        UINT8 m_prot_index;
58
 
};
59
 
 
60
 
 
61
 
static ADDRESS_MAP_START( janshi_vdp_map8, AS_0, 8 )
62
 
 
63
 
        AM_RANGE(0xfc0000, 0xfc1fff) AM_RAM AM_BASE_MEMBER(pinkiri8_state, m_janshi_back_vram) // bg tilemap?
64
 
        AM_RANGE(0xfc2000, 0xfc2fff) AM_RAM AM_BASE_MEMBER(pinkiri8_state, m_janshi_vram1) // xpos, colour, tile number etc.
65
 
 
66
 
        AM_RANGE(0xfc3700, 0xfc377f) AM_RAM AM_BASE_MEMBER(pinkiri8_state, m_janshi_unk1) // ?? height related?
67
 
        AM_RANGE(0xfc3780, 0xfc37bf) AM_RAM AM_BASE_MEMBER(pinkiri8_state, m_janshi_widthflags)
68
 
        AM_RANGE(0xfc37c0, 0xfc37ff) AM_RAM AM_BASE_MEMBER(pinkiri8_state, m_janshi_unk2) // 2x increasing tables 00 10 20 30 etc.
69
 
 
70
 
        AM_RANGE(0xfc3800, 0xfc3fff) AM_RAM AM_BASE_MEMBER(pinkiri8_state, m_janshi_vram2) // y pos + unknown
71
 
 
72
 
        AM_RANGE(0xff0000, 0xff07ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_BASE_GENERIC(paletteram)
73
 
        AM_RANGE(0xff2000, 0xff27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_BASE_GENERIC(paletteram2)
74
 
 
75
 
        AM_RANGE(0xff6000, 0xff601f) AM_RAM AM_BASE_MEMBER(pinkiri8_state, m_janshi_crtc_regs)
76
 
ADDRESS_MAP_END
77
 
 
78
 
 
79
 
 
80
 
/* VDP device to give us our own memory map */
81
 
 
82
 
class janshi_vdp_device : public device_t,
83
 
                                                  public device_memory_interface
84
 
{
85
 
public:
86
 
        janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
87
 
protected:
88
 
        virtual void device_config_complete();
89
 
        virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
90
 
        virtual void device_start();
91
 
        virtual void device_reset();
92
 
        virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
93
 
        address_space_config            m_space_config;
94
 
};
95
 
 
96
 
const device_type JANSHIVDP = &device_creator<janshi_vdp_device>;
97
 
 
98
 
janshi_vdp_device::janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
99
 
        : device_t(mconfig, JANSHIVDP, "JANSHIVDP", tag, owner, clock),
100
 
          device_memory_interface(mconfig, *this),
101
 
          m_space_config("janshi_vdp", ENDIANNESS_LITTLE, 8,24, 0, NULL, *ADDRESS_MAP_NAME(janshi_vdp_map8))
102
 
{
103
 
}
104
 
 
105
 
void janshi_vdp_device::device_config_complete()
106
 
{
107
 
//  int address_bits = 24;
108
 
 
109
 
//  m_space_config = address_space_config("janshi_vdp", ENDIANNESS_BIG, 8,  address_bits, 0, *ADDRESS_MAP_NAME(janshi_vdp_map8));
110
 
}
111
 
 
112
 
bool janshi_vdp_device::device_validity_check(emu_options &options, const game_driver &driver) const
113
 
{
114
 
        bool error = false;
115
 
        return error;
116
 
}
117
 
 
118
 
void janshi_vdp_device::device_start()
119
 
{
120
 
}
121
 
 
122
 
void janshi_vdp_device::device_reset()
123
 
{
124
 
}
125
 
 
126
 
const address_space_config *janshi_vdp_device::memory_space_config(address_spacenum spacenum) const
127
 
{
128
 
        return (spacenum == 0) ? &m_space_config : NULL;
129
 
}
130
 
 
131
 
 
132
 
/* end VDP device to give us our own memory map */
133
 
 
134
 
 
135
 
 
136
 
 
137
 
 
138
 
static VIDEO_START( pinkiri8 )
139
 
{
140
 
 
141
 
}
142
 
 
143
 
/*
144
 
 
145
 
ronjan
146
 
00, 7d, 00, 40, 00, 42, 00, 44, 00, 46, 00, 48, 00, 4a, 00, 0c, 00, 4e, 00, 10, 00, 12, 00, 14, 00, 16, 00, 18, 00, 1a, 00, 1c,
147
 
00, 7d, 00, 40, 00, 42, 00, 44, 00, 46, 00, 48, 00, 4a, 00, 4c, 00, 4e, 00, 50, 00, 52, 00, 54, 00, 56, 00, 58, 00, 5a, 00, 5c,
148
 
00, 7d, 00, 40, 00, 42, 00, 44, 00, 46, 00, 48, 00, 4a, 00, 4c, 00, 4e, 00, 50, 00, 52, 00, 54, 00, 56, 00, 58, 00, 5a, 00, 5c,
149
 
 
150
 
00, 1e, 00, 20, 00, 22, 00, 24, 00, 26, 00, 68, 00, 6a, 00, 6c, 00, 6e, 00, 70, 00, 72, 00, 74, 00, 76, 00, 38, 00, 3a, 00, c0,
151
 
00, 5e, 00, 60, 00, 62, 00, 64, 00, 66, 00, 68, 00, 6a, 00, 6c, 00, 6e, 00, 70, 00, 72, 00, 74, 00, 76, 00, 78, 00, 7a, 00, c0,
152
 
00, 5e, 00, 60, 00, 62, 00, 64, 00, 66, 00, 68, 00, 6a, 00, 6c, 00, 6e, 00, 70, 00, 72, 00, 74, 00, 76, 00, 78, 00, 7a, 00, c0,
153
 
 
154
 
 
155
 
00, c2, 00, c4, 00, c6, 00, c8, 00, ca, 00, cc, 00, ce, 00, d0, 00, d2, 00, d4, 00, d6, 00, d8, 00, da, 00, dc, 00, de, 00, e0,
156
 
00, c2, 00, c4, 00, c6, 00, c8, 00, ca, 00, cc, 00, ce, 00, d0, 00, d2, 00, d4, 00, d6, 00, d8, 00, da, 00, dc, 00, de, 00, e0,
157
 
00, c2, 00, c4, 00, c6, 00, c8, 00, ca, 00, cc, 00, ce, 00, d0, 00, d2, 00, d4, 00, d6, 00, d8, 00, da, 00, dc, 00, de, 00, e0,
158
 
 
159
 
00, e3, 00, e5, 00, e7, 00, e9, 00, eb, 00, ed, 00, ef, 00, f1, 00, f3, 00, f5, 00, f7, 00, f9, 00, fb, 00, fd, 00, ff, 00, 7e,
160
 
00, e3, 00, e5, 00, e7, 00, e9, 00, eb, 00, ed, 00, ef, 00, f1, 00, f3, 00, f5, 00, f7, 00, f9, 00, fb, 00, fd, 00, ff, 00, 7e,
161
 
00, e3, 00, e5, 00, e7, 00, e9, 00, eb, 00, ed, 00, ef, 00, f1, 00, f3, 00, f5, 00, f7, 00, f9, 00, fb, 00, fd, 00, ff, 00, 7e,
162
 
 
163
 
00, 00, 00, 01, 00, 01, 00, 01, 00, 01, 00, 00, 00, 01, 00, 00, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01,
164
 
00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01,
165
 
00, 00, 00, 01, 00, 01, 00, 01, 00, 01, 00, 00, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01,
166
 
 
167
 
 
168
 
00, 01, 00, 01, 00, 01, 00, 01, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 01, 00, 01, 00, 00, 00, 00,
169
 
00, 01, 00, 01, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
170
 
00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 01, 00, 00, 00, 00, 00, 00,
171
 
 
172
 
 
173
 
 
174
 
*/
175
 
 
176
 
static SCREEN_UPDATE( pinkiri8 )
177
 
{
178
 
        pinkiri8_state *state = screen->machine().driver_data<pinkiri8_state>();
179
 
        int col_bank;
180
 
        const gfx_element *gfx = screen->machine().gfx[0];
181
 
 
182
 
        int game_type_hack = 0;
183
 
 
184
 
        if (!strcmp(screen->machine().system().name,"janshi")) game_type_hack = 1;
185
 
 
186
 
        if ( screen->machine().input().code_pressed_once(KEYCODE_W) )
187
 
        {
188
 
                int i;
189
 
                int count2;
190
 
                printf("-------------------------------\n");
191
 
                count2=0;
192
 
                for (i=0x00;i<0x40;i+=2)
193
 
                {
194
 
 
195
 
                        printf("%02x, ", state->m_janshi_widthflags[i+1]);
196
 
 
197
 
                        count2++;
198
 
 
199
 
                        if (count2==0x10)
200
 
                        {
201
 
                                printf("\n");
202
 
                                count2 = 0;
203
 
                        }
204
 
 
205
 
 
206
 
                }
207
 
 
208
 
 
209
 
        }
210
 
 
211
 
 
212
 
 
213
 
        //popmessage("%02x",state->m_janshi_crtc_regs[0x0a]);
214
 
        col_bank = (state->m_janshi_crtc_regs[0x0a] & 0x40) >> 6;
215
 
 
216
 
        bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
217
 
 
218
 
        /* FIXME: color is a bit of a mystery */
219
 
        {
220
 
                int x,y,col,tile,count,attr;
221
 
 
222
 
                count = 0;
223
 
 
224
 
                for(y=0;y<64;y++)
225
 
                {
226
 
                        for(x=0;x<32;x++)
227
 
                        {
228
 
                                tile = state->m_janshi_back_vram[count+1]<<8 | state->m_janshi_back_vram[count+0];
229
 
                                attr = state->m_janshi_back_vram[count+2] ^ 0xf0;
230
 
                                col = (attr >> 4) | 0x10;
231
 
 
232
 
                                drawgfx_transpen(bitmap,cliprect,gfx,tile,col,0,0,x*16,y*8,0);
233
 
 
234
 
                                count+=4;
235
 
                        }
236
 
                }
237
 
        }
238
 
 
239
 
        {
240
 
                int x,y; //,unk2;
241
 
                int col;
242
 
 
243
 
                int spr_offs,i;
244
 
 
245
 
                int width, height;
246
 
 
247
 
 
248
 
 
249
 
                for(i=(0x1000/4)-4;i>=0;i--)
250
 
                {
251
 
 
252
 
                /* vram 1 (video map 0xfc2000)
253
 
 
254
 
          tttt tttt | 00tt tttt | cccc c000 | xxxx xxxx |
255
 
 
256
 
          vram 2 (video map 0xfc3800)
257
 
 
258
 
          yyyy yyyy | ???? ???? |
259
 
 
260
 
        there is also some data at 13000 - 137ff
261
 
        and a table at 20000..
262
 
 
263
 
          */
264
 
 
265
 
                        spr_offs = ((state->m_janshi_vram1[(i*4)+0] & 0xff) | (state->m_janshi_vram1[(i*4)+1]<<8)) & 0xffff;
266
 
                        col = (state->m_janshi_vram1[(i*4)+2] & 0xf8) >> 3;
267
 
                        x =   state->m_janshi_vram1[(i*4)+3];
268
 
 
269
 
                        x &= 0xff;
270
 
                        x *= 2;
271
 
 
272
 
//          unk2 = state->m_janshi_vram2[(i*2)+1];
273
 
                        y = (state->m_janshi_vram2[(i*2)+0]);
274
 
 
275
 
                        y = 0x100-y;
276
 
 
277
 
                        col|= col_bank<<5;
278
 
 
279
 
                //  width = 0; height = 0;
280
 
 
281
 
                        width = 2;
282
 
                        height = 2;
283
 
 
284
 
 
285
 
                        // these bits seem to somehow determine the sprite height / widths for the sprite ram region?
286
 
                        int bit = state->m_janshi_widthflags[(i/0x20)*2 + 1];
287
 
 
288
 
                        if (bit)
289
 
                        {
290
 
                                //col = screen->machine().rand();
291
 
                                width = 2;
292
 
                        }
293
 
                        else
294
 
                        {
295
 
                                width = 1;
296
 
                                height = 2;
297
 
                        }
298
 
 
299
 
                        // hacks!
300
 
                        if (game_type_hack==1) // janshi
301
 
                        {
302
 
                                if (spr_offs<0x400)
303
 
                                {
304
 
                                        height = 4;
305
 
                                }
306
 
                                else if (spr_offs<0x580)
307
 
                                {
308
 
                                //  height = 2;
309
 
                                }
310
 
                                else if (spr_offs<0x880)
311
 
                                {
312
 
                                        height = 4;
313
 
                                }
314
 
                                else if (spr_offs<0x1000)
315
 
                                {
316
 
                                //  height = 2;
317
 
                                }
318
 
                                else if (spr_offs<0x1080)
319
 
                                {
320
 
                                //  height = 2;
321
 
                                }
322
 
                                else if (spr_offs<0x1700)
323
 
                                {
324
 
                                        height = 4;
325
 
                                }
326
 
                                else if (spr_offs<0x1730)
327
 
                                {
328
 
                                //  height = 2;
329
 
                                }
330
 
                                else if (spr_offs<0x1930)
331
 
                                {
332
 
                                        height = 4;
333
 
                                }
334
 
                                else if (spr_offs<0x19c0)
335
 
                                {
336
 
                                        height = 1;
337
 
                                }
338
 
                                else
339
 
                                {
340
 
                                        height = 4;
341
 
                                }
342
 
 
343
 
 
344
 
                        }
345
 
 
346
 
 
347
 
 
348
 
 
349
 
 
350
 
 
351
 
                        if (height==1)
352
 
                                y+=16;
353
 
 
354
 
 
355
 
                        // hmm...
356
 
                        if (height==2)
357
 
                                y+=16;
358
 
 
359
 
 
360
 
 
361
 
                        {
362
 
                                int count = 0;
363
 
 
364
 
 
365
 
                                for (int yy=0;yy<height;yy++)
366
 
                                {
367
 
                                        for (int xx=0;xx<width;xx++)
368
 
                                        {
369
 
                                                drawgfx_transpen(bitmap,cliprect,gfx,spr_offs+count,col,0,0,x+xx*16,y+yy*8,0);
370
 
                                                count++;
371
 
                                        }
372
 
                                }
373
 
                        }
374
 
                }
375
 
        }
376
 
 
377
 
        return 0;
378
 
}
379
 
 
380
 
static ADDRESS_MAP_START( pinkiri8_map, AS_PROGRAM, 8 )
381
 
        AM_RANGE(0x00000, 0x0bfff) AM_ROM
382
 
        AM_RANGE(0x0c000, 0x0dfff) AM_RAM
383
 
        AM_RANGE(0x0e000, 0x0ffff) AM_ROM
384
 
        AM_RANGE(0x10000, 0x1ffff) AM_ROM
385
 
ADDRESS_MAP_END
386
 
 
387
 
static WRITE8_HANDLER( output_regs_w )
388
 
{
389
 
        if(data & 0x40)
390
 
                cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
391
 
        //data & 0x80 is probably NMI mask
392
 
}
393
 
 
394
 
 
395
 
#define LOG_VRAM 0
396
 
 
397
 
static WRITE8_HANDLER( pinkiri8_vram_w )
398
 
{
399
 
        pinkiri8_state *state = space->machine().driver_data<pinkiri8_state>();
400
 
        switch(offset)
401
 
        {
402
 
                case 0:
403
 
                        state->m_vram_addr = (data << 0)  | (state->m_vram_addr&0xffff00);
404
 
                        if (LOG_VRAM) printf("\n prev writes was %04x\n\naddress set to %04x -\n", state->m_prev_writes, state->m_vram_addr );
405
 
                        state->m_prev_writes = 0;
406
 
                        break;
407
 
 
408
 
                case 1:
409
 
                        state->m_vram_addr = (data << 8)  | (state->m_vram_addr & 0xff00ff);
410
 
                        if (LOG_VRAM)printf("\naddress set to %04x\n", state->m_vram_addr);
411
 
                        break;
412
 
 
413
 
                case 2:
414
 
                        state->m_vram_addr = (data << 16) | (state->m_vram_addr & 0x00ffff);
415
 
                        if (LOG_VRAM)printf("\naddress set to %04x\n", state->m_vram_addr);
416
 
                        break;
417
 
 
418
 
                case 3:
419
 
 
420
 
                        address_space *vdp_space = space->machine().device<janshi_vdp_device>("janshivdp")->space();
421
 
 
422
 
                        if (LOG_VRAM) printf("%02x ", data);
423
 
                        state->m_prev_writes++;
424
 
                        state->m_vram_addr++;
425
 
 
426
 
                        vdp_space->write_byte(state->m_vram_addr, data);
427
 
                        break;
428
 
        }
429
 
}
430
 
 
431
 
 
432
 
static WRITE8_HANDLER( mux_w )
433
 
{
434
 
        pinkiri8_state *state = space->machine().driver_data<pinkiri8_state>();
435
 
        state->m_mux_data = data;
436
 
}
437
 
 
438
 
static READ8_HANDLER( mux_p2_r )
439
 
{
440
 
        pinkiri8_state *state = space->machine().driver_data<pinkiri8_state>();
441
 
        switch(state->m_mux_data)
442
 
        {
443
 
                case 0x01: return input_port_read(space->machine(), "PL2_01");
444
 
                case 0x02: return input_port_read(space->machine(), "PL2_02");
445
 
                case 0x04: return input_port_read(space->machine(), "PL2_03");
446
 
                case 0x08: return input_port_read(space->machine(), "PL2_04");
447
 
                case 0x10: return input_port_read(space->machine(), "PL2_05");
448
 
        }
449
 
 
450
 
        return 0xff;
451
 
}
452
 
 
453
 
static READ8_HANDLER( mux_p1_r )
454
 
{
455
 
        pinkiri8_state *state = space->machine().driver_data<pinkiri8_state>();
456
 
        switch(state->m_mux_data)
457
 
        {
458
 
                case 0x01: return input_port_read(space->machine(), "PL1_01");
459
 
                case 0x02: return input_port_read(space->machine(), "PL1_02");
460
 
                case 0x04: return input_port_read(space->machine(), "PL1_03");
461
 
                case 0x08: return input_port_read(space->machine(), "PL1_04");
462
 
                case 0x10: return input_port_read(space->machine(), "PL1_05");
463
 
        }
464
 
 
465
 
        return 0xff;
466
 
}
467
 
 
468
 
static ADDRESS_MAP_START( pinkiri8_io, AS_IO, 8 )
469
 
        ADDRESS_MAP_GLOBAL_MASK(0xff)
470
 
        AM_RANGE(0x00, 0x3f) AM_RAM //Z180 internal I/O
471
 
        AM_RANGE(0x60, 0x60) AM_WRITE(output_regs_w)
472
 
        AM_RANGE(0x80, 0x83) AM_WRITE(pinkiri8_vram_w)
473
 
 
474
 
        AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE_MODERN("oki", okim6295_device, read, write) //correct?
475
 
        AM_RANGE(0xb0, 0xb0) AM_WRITE(mux_w) //mux
476
 
        AM_RANGE(0xb0, 0xb0) AM_READ(mux_p2_r) // mux inputs
477
 
        AM_RANGE(0xb1, 0xb1) AM_READ(mux_p1_r) // mux inputs
478
 
        AM_RANGE(0xb2, 0xb2) AM_READ_PORT("SYSTEM")
479
 
        AM_RANGE(0xf8, 0xf8) AM_READ_PORT("DSW1")
480
 
        AM_RANGE(0xf9, 0xf9) AM_READ_PORT("DSW2")
481
 
        AM_RANGE(0xfa, 0xfa) AM_READ_PORT("DSW3")
482
 
        AM_RANGE(0xfb, 0xfb) AM_READ_PORT("DSW4")
483
 
 
484
 
        /* Wing custom sound chip, same as Lucky Girl Z180 */
485
 
        AM_RANGE(0xc3, 0xc3) AM_WRITENOP
486
 
        AM_RANGE(0xc7, 0xc7) AM_WRITENOP
487
 
        AM_RANGE(0xcb, 0xcb) AM_WRITENOP
488
 
        AM_RANGE(0xcf, 0xcf) AM_WRITENOP
489
 
 
490
 
        AM_RANGE(0xd3, 0xd3) AM_WRITENOP
491
 
        AM_RANGE(0xd7, 0xd7) AM_WRITENOP
492
 
        AM_RANGE(0xdb, 0xdb) AM_WRITENOP
493
 
        AM_RANGE(0xdf, 0xdf) AM_WRITENOP
494
 
 
495
 
        AM_RANGE(0xe3, 0xe3) AM_WRITENOP
496
 
        AM_RANGE(0xe7, 0xe7) AM_WRITENOP
497
 
        AM_RANGE(0xeb, 0xeb) AM_WRITENOP
498
 
        AM_RANGE(0xef, 0xef) AM_WRITENOP
499
 
 
500
 
        AM_RANGE(0xf3, 0xf3) AM_WRITENOP
501
 
        AM_RANGE(0xf7, 0xf7) AM_WRITENOP
502
 
 
503
 
ADDRESS_MAP_END
504
 
 
505
 
static INPUT_PORTS_START( base_inputs )
506
 
        PORT_START("SYSTEM")
507
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Reset SW")
508
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Books SW")
509
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE )
510
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )
511
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) //ron jan needs this
512
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN )
513
 
        PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
514
 
 
515
 
        PORT_START("PL1_01")
516
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
517
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
518
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )
519
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )
520
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
521
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
522
 
 
523
 
        PORT_START("PL1_02")
524
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
525
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
526
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )
527
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )
528
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
529
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
530
 
 
531
 
        PORT_START("PL1_03")
532
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )
533
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )
534
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
535
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
536
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
537
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
538
 
 
539
 
        PORT_START("PL1_04")
540
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )
541
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
542
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )
543
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
544
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
545
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
546
 
 
547
 
        PORT_START("PL1_05")
548
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )
549
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )
550
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )
551
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
552
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )
553
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )
554
 
 
555
 
        PORT_START("PL2_01")
556
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2)
557
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2)
558
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2)
559
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2)
560
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2)
561
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
562
 
 
563
 
        PORT_START("PL2_02")
564
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2)
565
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2)
566
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2)
567
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2)
568
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2)
569
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2)
570
 
 
571
 
        PORT_START("PL2_03")
572
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2)
573
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2)
574
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2)
575
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2)
576
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2)
577
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
578
 
 
579
 
        PORT_START("PL2_04")
580
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2)
581
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2)
582
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2)
583
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2)
584
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
585
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
586
 
 
587
 
        PORT_START("PL2_05")
588
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2)
589
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2)
590
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2)
591
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)
592
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(2)
593
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2)
594
 
 
595
 
        PORT_START("DSW1")
596
 
        PORT_DIPNAME( 0x01, 0x01, "DSW1" )
597
 
        PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
598
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
599
 
        PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
600
 
        PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
601
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
602
 
        PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
603
 
        PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
604
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
605
 
        PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
606
 
        PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
607
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
608
 
        PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
609
 
        PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
610
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
611
 
        PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
612
 
        PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
613
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
614
 
        PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
615
 
        PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
616
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
617
 
        PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
618
 
        PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
619
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
620
 
 
621
 
        PORT_START("DSW2")
622
 
        PORT_DIPNAME( 0x01, 0x01, "DSW2" )
623
 
        PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
624
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
625
 
        PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
626
 
        PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
627
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
628
 
        PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
629
 
        PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
630
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
631
 
        PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
632
 
        PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
633
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
634
 
        PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
635
 
        PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
636
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
637
 
        PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
638
 
        PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
639
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
640
 
        PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
641
 
        PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
642
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
643
 
        PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
644
 
        PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
645
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
646
 
 
647
 
        PORT_START("DSW3")
648
 
        PORT_DIPNAME( 0x01, 0x01, "DSW3" )
649
 
        PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
650
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
651
 
        PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
652
 
        PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
653
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
654
 
        PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
655
 
        PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
656
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
657
 
        PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
658
 
        PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
659
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
660
 
        PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
661
 
        PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
662
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
663
 
        PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
664
 
        PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
665
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
666
 
        PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
667
 
        PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
668
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
669
 
        PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
670
 
        PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
671
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
672
 
 
673
 
        PORT_START("DSW4")
674
 
        PORT_DIPNAME( 0x01, 0x01, "DSW4" )
675
 
        PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
676
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
677
 
        PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
678
 
        PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
679
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
680
 
        PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
681
 
        PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
682
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
683
 
        PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
684
 
        PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
685
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
686
 
        PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
687
 
        PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
688
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
689
 
        PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
690
 
        PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
691
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
692
 
        PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
693
 
        PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
694
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
695
 
        PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
696
 
        PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
697
 
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
698
 
INPUT_PORTS_END
699
 
 
700
 
static INPUT_PORTS_START( janshi )
701
 
        PORT_INCLUDE( base_inputs )
702
 
 
703
 
        PORT_MODIFY("DSW1")
704
 
        PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3")
705
 
        PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
706
 
        PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
707
 
        PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
708
 
        PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
709
 
        PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
710
 
        PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
711
 
        PORT_DIPSETTING(    0x05, DEF_STR( 1C_5C ) )
712
 
        PORT_DIPSETTING(    0x04, "1 Coin/10 Credits")
713
 
        PORT_DIPNAME( 0x08, 0x08, "Round Up Bonus" ) PORT_DIPLOCATION("SW1:4")
714
 
        PORT_DIPSETTING(    0x08, "500" )
715
 
        PORT_DIPSETTING(    0x00, "1000" )
716
 
        PORT_DIPNAME( 0x30, 0x00, "Base Score" ) PORT_DIPLOCATION("SW1:5,6")
717
 
        PORT_DIPSETTING(    0x00, "5000 / 8000" )
718
 
        PORT_DIPSETTING(    0x10, "4000 / 8000" )
719
 
        PORT_DIPSETTING(    0x20, "3000 / 8000" )
720
 
        PORT_DIPSETTING(    0x30, "2000 / 8000" )
721
 
        PORT_DIPNAME( 0xc0, 0x80, "Win Rate" ) PORT_DIPLOCATION("SW1:7,8")
722
 
        PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
723
 
        PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
724
 
        PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
725
 
        PORT_DIPSETTING(    0xc0, DEF_STR( Very_Easy ) )
726
 
 
727
 
        PORT_MODIFY("DSW2")
728
 
        PORT_DIPNAME( 0x03, 0x01, "Play Time" ) PORT_DIPLOCATION("SW2:1,2")
729
 
        PORT_DIPSETTING(    0x00, "12 Seconds" )
730
 
        PORT_DIPSETTING(    0x01, "10 Seconds" )
731
 
        PORT_DIPSETTING(    0x02, "8 Seconds" )
732
 
        PORT_DIPSETTING(    0x03, "6 Seconds" )
733
 
        PORT_DIPNAME( 0x04, 0x04, "Yakuman Bonus" ) PORT_DIPLOCATION("SW2:3")
734
 
        PORT_DIPSETTING(        0x00, DEF_STR( No ) )
735
 
        PORT_DIPSETTING(        0x04, DEF_STR( Yes ) )
736
 
        PORT_DIPNAME( 0x08, 0x08, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:4")
737
 
        PORT_DIPSETTING(        0x00, DEF_STR( No ) )
738
 
        PORT_DIPSETTING(        0x08, DEF_STR( Yes ) )
739
 
        PORT_DIPNAME( 0x10, 0x10, "BGM" ) PORT_DIPLOCATION("SW2:5")
740
 
        PORT_DIPSETTING(        0x00, DEF_STR( No ) )
741
 
        PORT_DIPSETTING(        0x10, DEF_STR( Yes ) )
742
 
        PORT_DIPNAME( 0x20, 0x20, "Voice" ) PORT_DIPLOCATION("SW2:6")
743
 
        PORT_DIPSETTING(        0x00, DEF_STR( No ) )
744
 
        PORT_DIPSETTING(        0x20, DEF_STR( Yes ) )
745
 
        PORT_DIPNAME( 0x40, 0x40, "Nudity" ) PORT_DIPLOCATION("SW2:7")
746
 
        PORT_DIPSETTING(        0x00, DEF_STR( No ) )
747
 
        PORT_DIPSETTING(        0x40, DEF_STR( Yes ) )
748
 
        PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:8")
749
 
        PORT_DIPSETTING(        0x00, DEF_STR( Upright ) )
750
 
        PORT_DIPSETTING(        0x80, DEF_STR( Cocktail ) )
751
 
 
752
 
        PORT_MODIFY("DSW3")
753
 
        PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW3:1" )
754
 
        PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" )
755
 
        PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW3:3" )
756
 
        PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" )
757
 
        PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW3:5" )
758
 
        PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:6" )
759
 
        PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:7" )
760
 
        PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:8" )
761
 
 
762
 
        PORT_MODIFY("DSW4")
763
 
        PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW4:1" )
764
 
        PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW4:2" )
765
 
        PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW4:3" )
766
 
        PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW4:4" )
767
 
        PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW4:5" )
768
 
        PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW4:6" )
769
 
        PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW4:7" )
770
 
        PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW4:8" )
771
 
INPUT_PORTS_END
772
 
 
773
 
static INPUT_PORTS_START( ronjan )
774
 
        PORT_INCLUDE( base_inputs )
775
 
 
776
 
        PORT_MODIFY("DSW1")
777
 
        PORT_DIPNAME( 0x03, 0x00, "Play Time Limit" ) PORT_DIPLOCATION("SW1:1,2")
778
 
        PORT_DIPSETTING(    0x00, "16 Seconds" )
779
 
        PORT_DIPSETTING(    0x01, "13 Seconds" )
780
 
        PORT_DIPSETTING(    0x02, "10 Seconds" )
781
 
        PORT_DIPSETTING(    0x03, "7 Seconds" )
782
 
        PORT_DIPNAME( 0x04, 0x04, "Coin Payment" ) PORT_DIPLOCATION("SW1:3")
783
 
        PORT_DIPSETTING(    0x04, DEF_STR( Normal ) )
784
 
        PORT_DIPSETTING(    0x00, "Auto" )
785
 
        //FIXME: Bet Min can't be higher than Bet Max, needs a conditional dip here (or maybe, unified dips)
786
 
        PORT_DIPNAME( 0x38, 0x38, "Bet Min" ) PORT_DIPLOCATION("SW1:4,5,6")
787
 
        PORT_DIPSETTING(    0x38, "1" )
788
 
        PORT_DIPSETTING(    0x30, "2" )
789
 
        PORT_DIPSETTING(    0x28, "3" )
790
 
        PORT_DIPSETTING(    0x20, "4" )
791
 
        PORT_DIPSETTING(    0x18, "5" )
792
 
        PORT_DIPSETTING(    0x10, "6" )
793
 
        PORT_DIPSETTING(    0x08, "8" )
794
 
        PORT_DIPSETTING(    0x00, "10" )
795
 
        PORT_DIPNAME( 0xc0, 0x00, "Bet Max" ) PORT_DIPLOCATION("SW1:7,8")
796
 
        PORT_DIPSETTING(    0xc0, "5" )
797
 
        PORT_DIPSETTING(    0x80, "10" )
798
 
        PORT_DIPSETTING(    0x40, "15" )
799
 
        PORT_DIPSETTING(    0x00, "20" )
800
 
 
801
 
        PORT_MODIFY("DSW2")
802
 
        PORT_DIPNAME( 0x0f, 0x00, "Rate of Win" ) PORT_DIPLOCATION("SW2:1,2,3,4")
803
 
        PORT_DIPSETTING(    0x00, "98%" )
804
 
        PORT_DIPSETTING(    0x01, "95%" )
805
 
        PORT_DIPSETTING(    0x02, "92%" )
806
 
        PORT_DIPSETTING(    0x03, "89%" )
807
 
        PORT_DIPSETTING(    0x04, "86%" )
808
 
        PORT_DIPSETTING(    0x05, "83%" )
809
 
        PORT_DIPSETTING(    0x06, "80%" )
810
 
        PORT_DIPSETTING(    0x07, "77%" )
811
 
        PORT_DIPSETTING(    0x08, "74%" )
812
 
        PORT_DIPSETTING(    0x09, "71%" )
813
 
        PORT_DIPSETTING(    0x0a, "68%" )
814
 
        PORT_DIPSETTING(    0x0b, "65%" )
815
 
        PORT_DIPSETTING(    0x0c, "62%" )
816
 
        PORT_DIPSETTING(    0x0d, "59%" )
817
 
        PORT_DIPSETTING(    0x0e, "56%" )
818
 
        PORT_DIPSETTING(    0x0f, "53%" )
819
 
        PORT_DIPNAME( 0x10, 0x10, "Limit Display" ) PORT_DIPLOCATION("SW2:5")
820
 
        PORT_DIPSETTING(    0x00, DEF_STR( No ) )
821
 
        PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
822
 
        PORT_DIPNAME( 0xe0, 0xe0, "Credit Limit" )  PORT_DIPLOCATION("SW2:6,7,8")
823
 
        PORT_DIPSETTING(    0x00, "50000" )
824
 
        PORT_DIPSETTING(    0x20, "40000" )
825
 
        PORT_DIPSETTING(    0x40, "30000" )
826
 
        PORT_DIPSETTING(    0x60, "20000" )
827
 
        PORT_DIPSETTING(    0x80, "15000" )
828
 
        PORT_DIPSETTING(    0xa0, "10000" )
829
 
        PORT_DIPSETTING(    0xc0, "5000" )
830
 
        PORT_DIPSETTING(    0xe0, "No Limit" )
831
 
 
832
 
        PORT_MODIFY("DSW3")
833
 
        PORT_DIPNAME( 0x07, 0x07, "Key In Coinage" ) PORT_DIPLOCATION("SW3:1,2,3")
834
 
        PORT_DIPSETTING(    0x00, "1 Coin/500 Credits" )
835
 
        PORT_DIPSETTING(    0x01, "1 Coin/200 Credits" )
836
 
        PORT_DIPSETTING(    0x02, "1 Coin/100 Credits" )
837
 
        PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )
838
 
        PORT_DIPSETTING(    0x04, "1 Coin/25 Credits" )
839
 
        PORT_DIPSETTING(    0x05, "1 Coin/20 Credits" )
840
 
        PORT_DIPSETTING(    0x06, "1 Coin/10 Credits" )
841
 
        PORT_DIPSETTING(    0x07, DEF_STR( 1C_5C ) )
842
 
        PORT_DIPNAME( 0x78, 0x40, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW3:4,5,6,7")
843
 
        PORT_DIPSETTING(    0x78, "10 Coins/1 Credit" )
844
 
        PORT_DIPSETTING(    0x70, DEF_STR( 5C_1C ) )
845
 
        PORT_DIPSETTING(    0x68, "5 Coins/2 Credits" )
846
 
        PORT_DIPSETTING(    0x60, DEF_STR( 4C_1C ) )
847
 
        PORT_DIPSETTING(    0x58, DEF_STR( 3C_1C ) )
848
 
        PORT_DIPSETTING(    0x50, DEF_STR( 2C_1C ) )
849
 
        PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
850
 
        PORT_DIPSETTING(    0x48, DEF_STR( 2C_3C ) )
851
 
        PORT_DIPSETTING(    0x38, DEF_STR( 1C_2C ) )
852
 
        PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
853
 
        PORT_DIPSETTING(    0x28, DEF_STR( 1C_5C ) )
854
 
        PORT_DIPSETTING(    0x20, "1 Coin/10 Credits" )
855
 
        PORT_DIPSETTING(    0x18, "1 Coin/20 Credits" )
856
 
        PORT_DIPSETTING(    0x10, "1 Coin/25 Credits" )
857
 
        PORT_DIPSETTING(    0x08, "1 Coin/50 Credits" )
858
 
        PORT_DIPSETTING(    0x00, "1 Coin/100 Credits" )
859
 
        PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:8" )
860
 
 
861
 
        PORT_MODIFY("DSW4")
862
 
        PORT_DIPNAME( 0x01, 0x01, "Odds Type" ) PORT_DIPLOCATION("SW4:1")
863
 
        PORT_DIPSETTING(    0x01, "A" )
864
 
        PORT_DIPSETTING(    0x00, "B" )
865
 
        PORT_DIPNAME( 0x02, 0x02, "Special Bonus Odds" ) PORT_DIPLOCATION("SW4:2")
866
 
        PORT_DIPSETTING(    0x02, "A" )
867
 
        PORT_DIPSETTING(    0x00, "B" )
868
 
        PORT_DIPNAME( 0x04, 0x00, "Kind Mark of Back" ) PORT_DIPLOCATION("SW4:3")
869
 
        PORT_DIPSETTING(    0x00, DEF_STR( No ) )
870
 
        PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
871
 
        PORT_DIPNAME( 0x08, 0x08, "Nudity" ) PORT_DIPLOCATION("SW4:4")
872
 
        PORT_DIPSETTING(    0x00, DEF_STR( No ) )
873
 
        PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
874
 
        PORT_DIPNAME( 0x10, 0x10, "BGM" ) PORT_DIPLOCATION("SW4:5")
875
 
        PORT_DIPSETTING(    0x00, DEF_STR( No ) )
876
 
        PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
877
 
        PORT_DIPNAME( 0x20, 0x20, "Voice" ) PORT_DIPLOCATION("SW4:6")
878
 
        PORT_DIPSETTING(    0x00, DEF_STR( No ) )
879
 
        PORT_DIPSETTING(    0x20, DEF_STR( Yes ) )
880
 
        PORT_DIPNAME( 0x40, 0x40, "Double Up Game" ) PORT_DIPLOCATION("SW4:7")
881
 
        PORT_DIPSETTING(    0x00, DEF_STR( No ) )
882
 
        PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
883
 
        PORT_DIPNAME( 0x80, 0x80, "Double Up Limit" ) PORT_DIPLOCATION("SW4:8")
884
 
        PORT_DIPSETTING(    0x80, "6" )
885
 
        PORT_DIPSETTING(    0x00, "No Limit" )
886
 
INPUT_PORTS_END
887
 
 
888
 
static INPUT_PORTS_START( pinkiri8 )
889
 
        PORT_INCLUDE( base_inputs )
890
 
 
891
 
        /* standard mahjong panel converted to a hanafuda one */
892
 
        PORT_MODIFY("PL1_01")
893
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_A )
894
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_E )
895
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
896
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_YES )
897
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
898
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
899
 
 
900
 
        PORT_MODIFY("PL1_02")
901
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_B )
902
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_F )
903
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
904
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_NO )
905
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
906
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
907
 
 
908
 
        PORT_MODIFY("PL1_03")
909
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_C )
910
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_G )
911
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
912
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
913
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
914
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
915
 
 
916
 
        PORT_MODIFY("PL1_04")
917
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_D )
918
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_H )
919
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
920
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
921
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
922
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
923
 
 
924
 
        PORT_MODIFY("PL1_05")
925
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
926
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
927
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
928
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
929
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
930
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
931
 
 
932
 
        PORT_MODIFY("PL2_01")
933
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_PLAYER(2)
934
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_PLAYER(2)
935
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
936
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_PLAYER(2)
937
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
938
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
939
 
 
940
 
        PORT_MODIFY("PL2_02")
941
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_PLAYER(2)
942
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_PLAYER(2)
943
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
944
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_PLAYER(2)
945
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
946
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2)
947
 
 
948
 
        PORT_MODIFY("PL2_03")
949
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_PLAYER(2)
950
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_G ) PORT_PLAYER(2)
951
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
952
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
953
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
954
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
955
 
 
956
 
        PORT_MODIFY("PL2_04")
957
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_PLAYER(2)
958
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_H ) PORT_PLAYER(2)
959
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
960
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
961
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
962
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
963
 
 
964
 
        PORT_MODIFY("PL2_05")
965
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
966
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
967
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
968
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)
969
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
970
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
971
 
 
972
 
        PORT_MODIFY("DSW1")
973
 
        PORT_DIPNAME( 0x01, 0x01, "Game Style" ) PORT_DIPLOCATION("SW1:1")
974
 
        PORT_DIPSETTING(    0x01, "Win / Bet" )
975
 
        PORT_DIPSETTING(    0x00, "Out / In" )
976
 
        PORT_DIPNAME( 0x02, 0x02, "Premium Hand" ) PORT_DIPLOCATION("SW1:2")
977
 
        PORT_DIPSETTING(    0x00, DEF_STR( No ) )
978
 
        PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
979
 
        PORT_DIPNAME( 0x04, 0x04, "Coin Payment" ) PORT_DIPLOCATION("SW1:3")
980
 
        PORT_DIPSETTING(    0x04, DEF_STR( Normal ) )
981
 
        PORT_DIPSETTING(    0x00, "Auto" )
982
 
        //FIXME: Bet Min can't be higher than Bet Max, needs a conditional dip here (or maybe, unified dips)
983
 
        PORT_DIPNAME( 0x38, 0x38, "Bet Min" ) PORT_DIPLOCATION("SW1:4,5,6")
984
 
        PORT_DIPSETTING(    0x38, "1" )
985
 
        PORT_DIPSETTING(    0x30, "2" )
986
 
        PORT_DIPSETTING(    0x28, "3" )
987
 
        PORT_DIPSETTING(    0x20, "4" )
988
 
        PORT_DIPSETTING(    0x18, "5" )
989
 
        PORT_DIPSETTING(    0x10, "6" )
990
 
        PORT_DIPSETTING(    0x08, "8" )
991
 
        PORT_DIPSETTING(    0x00, "10" )
992
 
        PORT_DIPNAME( 0xc0, 0x00, "Bet Max" ) PORT_DIPLOCATION("SW1:7,8")
993
 
        PORT_DIPSETTING(    0xc0, "5" )
994
 
        PORT_DIPSETTING(    0x80, "10" )
995
 
        PORT_DIPSETTING(    0x40, "15" )
996
 
        PORT_DIPSETTING(    0x00, "20" )
997
 
 
998
 
        PORT_MODIFY("DSW2")
999
 
        PORT_DIPNAME( 0x0f, 0x00, "Rate of Win" ) PORT_DIPLOCATION("SW2:1,2,3,4")
1000
 
        PORT_DIPSETTING(    0x00, "90%" )
1001
 
        PORT_DIPSETTING(    0x01, "86%" )
1002
 
        PORT_DIPSETTING(    0x02, "82%" )
1003
 
        PORT_DIPSETTING(    0x03, "78%" )
1004
 
        PORT_DIPSETTING(    0x04, "74%" )
1005
 
        PORT_DIPSETTING(    0x05, "70%" )
1006
 
        PORT_DIPSETTING(    0x06, "66%" )
1007
 
        PORT_DIPSETTING(    0x07, "62%" )
1008
 
        PORT_DIPSETTING(    0x08, "58%" )
1009
 
        PORT_DIPSETTING(    0x09, "54%" )
1010
 
        PORT_DIPSETTING(    0x0a, "50%" )
1011
 
        PORT_DIPSETTING(    0x0b, "46%" )
1012
 
        PORT_DIPSETTING(    0x0c, "42%" )
1013
 
        PORT_DIPSETTING(    0x0d, "38%" )
1014
 
        PORT_DIPSETTING(    0x0e, "34%" )
1015
 
        PORT_DIPSETTING(    0x0f, "30%" )
1016
 
        PORT_DIPNAME( 0x10, 0x10, "Odds Type" ) PORT_DIPLOCATION("SW2:5")
1017
 
        PORT_DIPSETTING(    0x10, "A" )
1018
 
        PORT_DIPSETTING(    0x00, "B" )
1019
 
        PORT_DIPNAME( 0x20, 0x20, "BGM" ) PORT_DIPLOCATION("SW2:6")
1020
 
        PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1021
 
        PORT_DIPSETTING(    0x20, DEF_STR( Yes ) )
1022
 
        PORT_DIPNAME( 0x40, 0x00, "Oya (Owner)" ) PORT_DIPLOCATION("SW2:7")
1023
 
        PORT_DIPSETTING(    0x40, "CPU Only" )
1024
 
        PORT_DIPSETTING(    0x00, "Winner" )
1025
 
        PORT_DIPNAME( 0x80, 0x00, "Koi Time Limit" ) PORT_DIPLOCATION("SW2:8")
1026
 
        PORT_DIPSETTING(    0x80, "15 Seconds" )
1027
 
        PORT_DIPSETTING(    0x00, "30 Seconds" )
1028
 
 
1029
 
        PORT_MODIFY("DSW3")
1030
 
        PORT_DIPNAME( 0x07, 0x07, "Key In Coinage" ) PORT_DIPLOCATION("SW3:1,2,3")
1031
 
        PORT_DIPSETTING(    0x00, "1 Coin/500 Credits" )
1032
 
        PORT_DIPSETTING(    0x01, "1 Coin/200 Credits" )
1033
 
        PORT_DIPSETTING(    0x02, "1 Coin/100 Credits" )
1034
 
        PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )
1035
 
        PORT_DIPSETTING(    0x04, "1 Coin/25 Credits" )
1036
 
        PORT_DIPSETTING(    0x05, "1 Coin/20 Credits" )
1037
 
        PORT_DIPSETTING(    0x06, "1 Coin/10 Credits" )
1038
 
        PORT_DIPSETTING(    0x07, DEF_STR( 1C_5C ) )
1039
 
        PORT_DIPNAME( 0x78, 0x40, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW3:4,5,6,7")
1040
 
        PORT_DIPSETTING(    0x78, "10 Coins/1 Credit" )
1041
 
        PORT_DIPSETTING(    0x70, DEF_STR( 5C_1C ) )
1042
 
        PORT_DIPSETTING(    0x68, "5 Coins/2 Credits" )
1043
 
        PORT_DIPSETTING(    0x60, DEF_STR( 4C_1C ) )
1044
 
        PORT_DIPSETTING(    0x58, DEF_STR( 3C_1C ) )
1045
 
        PORT_DIPSETTING(    0x50, DEF_STR( 2C_1C ) )
1046
 
        PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
1047
 
        PORT_DIPSETTING(    0x48, DEF_STR( 2C_3C ) )
1048
 
        PORT_DIPSETTING(    0x38, DEF_STR( 1C_2C ) )
1049
 
        PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
1050
 
        PORT_DIPSETTING(    0x28, DEF_STR( 1C_5C ) )
1051
 
        PORT_DIPSETTING(    0x20, "1 Coin/10 Credits" )
1052
 
        PORT_DIPSETTING(    0x18, "1 Coin/20 Credits" )
1053
 
        PORT_DIPSETTING(    0x10, "1 Coin/25 Credits" )
1054
 
        PORT_DIPSETTING(    0x08, "1 Coin/50 Credits" )
1055
 
        PORT_DIPSETTING(    0x00, "1 Coin/100 Credits" )
1056
 
        PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:8" )
1057
 
 
1058
 
        PORT_MODIFY("DSW4")
1059
 
        PORT_DIPNAME( 0x01, 0x01, "Pinkiri Bonus" ) PORT_DIPLOCATION("SW4:1")
1060
 
        PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1061
 
        PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
1062
 
        PORT_DIPNAME( 0x02, 0x02, "Same Month Bonus" ) PORT_DIPLOCATION("SW4:2")
1063
 
        PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1064
 
        PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
1065
 
        PORT_DIPNAME( 0x04, 0x00, "Play Time Limit" ) PORT_DIPLOCATION("SW4:3")
1066
 
        PORT_DIPSETTING(    0x04, "7 Seconds" )
1067
 
        PORT_DIPSETTING(    0x00, "12 Seconds" )
1068
 
        PORT_DIPNAME( 0x18, 0x00, "Credit Clear" ) PORT_DIPLOCATION("SW4:4,5")
1069
 
        PORT_DIPSETTING(    0x00, "300 Seconds" )
1070
 
        PORT_DIPSETTING(    0x08, "180 Seconds" )
1071
 
        PORT_DIPSETTING(    0x10, "120 Seconds" )
1072
 
        PORT_DIPSETTING(    0x18, "60 Seconds" )
1073
 
        PORT_DIPNAME( 0x20, 0x20, "Panel Type" ) PORT_DIPLOCATION("SW4:6") // no real difference?
1074
 
        PORT_DIPSETTING(    0x20, "Mahjong" )
1075
 
        PORT_DIPSETTING(    0x00, "Hanafuda" )
1076
 
        PORT_DIPNAME( 0x40, 0x40, "Flip Flop Button" ) PORT_DIPLOCATION("SW4:7")
1077
 
        PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1078
 
        PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
1079
 
        PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW4:8" )
1080
 
INPUT_PORTS_END
1081
 
 
1082
 
static const gfx_layout charlayout =
1083
 
{
1084
 
        16,8,
1085
 
        RGN_FRAC(1,5),
1086
 
        5,
1087
 
        { RGN_FRAC(4,5),RGN_FRAC(3,5),RGN_FRAC(2,5),RGN_FRAC(1,5),RGN_FRAC(0,5) },
1088
 
        { 0, 1, 2, 3, 4, 5, 6, 7, 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
1089
 
        { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
1090
 
        8*16
1091
 
};
1092
 
 
1093
 
static GFXDECODE_START( pinkiri8 )
1094
 
        GFXDECODE_ENTRY( "gfx1", 0, charlayout,     0, 0x100 )
1095
 
GFXDECODE_END
1096
 
 
1097
 
static MACHINE_CONFIG_START( pinkiri8, pinkiri8_state )
1098
 
        MCFG_CPU_ADD("maincpu",Z180,16000000)
1099
 
        MCFG_CPU_PROGRAM_MAP(pinkiri8_map)
1100
 
        MCFG_CPU_IO_MAP(pinkiri8_io)
1101
 
        MCFG_CPU_VBLANK_INT("screen",nmi_line_assert)
1102
 
 
1103
 
        MCFG_SCREEN_ADD("screen", RASTER)
1104
 
        MCFG_SCREEN_REFRESH_RATE(60)
1105
 
        MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1106
 
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1107
 
        MCFG_SCREEN_SIZE(64*8, 64*8)
1108
 
        MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 64*8-1)
1109
 
        MCFG_SCREEN_UPDATE(pinkiri8)
1110
 
 
1111
 
        MCFG_GFXDECODE(pinkiri8)
1112
 
        MCFG_PALETTE_LENGTH(0x2000)
1113
 
 
1114
 
        MCFG_VIDEO_START(pinkiri8)
1115
 
 
1116
 
        MCFG_DEVICE_ADD("janshivdp", JANSHIVDP, 0)
1117
 
 
1118
 
        /* sound hardware */
1119
 
        MCFG_SPEAKER_STANDARD_MONO("mono")
1120
 
 
1121
 
        MCFG_OKIM6295_ADD("oki", 1056000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
1122
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
1123
 
MACHINE_CONFIG_END
1124
 
 
1125
 
/***************************************************************************
1126
 
 
1127
 
  Game driver(s)
1128
 
 
1129
 
***************************************************************************/
1130
 
 
1131
 
ROM_START( pinkiri8 )
1132
 
        ROM_REGION( 0x20000, "maincpu", 0 )
1133
 
        ROM_LOAD( "pinkiri8-ver.1.02.l1",   0x0000, 0x20000, CRC(f2df5b12) SHA1(e374e184a6a1e932550516011ec09a5accec9b03) )
1134
 
        ROM_LOAD( "bios.rom", 0x0000, 0x4000, CRC(399df1ee) SHA1(8251f3aa7da4c7899c8e739c10b61260f4471311) ) //overlapped internal ROM
1135
 
 
1136
 
        ROM_REGION( 0x20000*5, "gfx1", 0 )
1137
 
        ROM_LOAD( "pinkiri8-chr-01.a1",  0x00000, 0x20000, CRC(8ec73662) SHA1(9098348e519ce753dd7f38f0d855181bfc65aa42) )
1138
 
        ROM_LOAD( "pinkiri8-chr-02.bc1", 0x20000, 0x20000, CRC(8dc20a65) SHA1(4062510fe06e8844a732754b7915a3b67ba2a3c5) )
1139
 
        ROM_LOAD( "pinkiri8-chr-03.d1",  0x40000, 0x20000, CRC(bd5f269a) SHA1(7dfd039227551f0f0ed4afaafc76ca64a39a9b83) )
1140
 
        ROM_LOAD( "pinkiri8-chr-04.ef1", 0x60000, 0x20000, CRC(4d0e5005) SHA1(4b90119c359c4de576131fd0e28d2fe1482ce74f) )
1141
 
        ROM_LOAD( "pinkiri8-chr-05.h1",  0x80000, 0x20000, CRC(036ca165) SHA1(c4a2d6e394bbabcae1413d8a2916a19c90687edf) )
1142
 
 
1143
 
        ROM_REGION( 0x40000, "oki", ROMREGION_ERASE00 )
1144
 
ROM_END
1145
 
 
1146
 
 
1147
 
ROM_START( janshi )
1148
 
        ROM_REGION( 0x24000, "maincpu", 0 )
1149
 
        ROM_LOAD( "11.1l",    0x00000, 0x20000, CRC(a7692ddf) SHA1(5e7f43d8337583977baf22a28bbcd9b2182c0cde) )
1150
 
        ROM_LOAD( "[3] 9009 1992.1 new jansh.bin", 0x0000, 0x4000, CRC(63cd3f12) SHA1(aebac739bffaf043e6acffa978e935f73ee1385f) ) //overlapped internal ROM
1151
 
 
1152
 
        ROM_REGION( 0x140000, "gfx1", 0 )
1153
 
        ROM_LOAD( "1.1a", 0x000000, 0x40000, CRC(92b140a5) SHA1(f3b38563f74650604ed0faaf84460e0b04b386b7) )
1154
 
        ROM_LOAD( "2.1b", 0x040000, 0x40000, CRC(6de7e086) SHA1(e87426264f0181c17383ffe0f7ec7ff5fce3d809) )
1155
 
        ROM_LOAD( "3.1d", 0x080000, 0x40000, CRC(4e94d8f2) SHA1(a25f542943d74915fc82910baafb9ff9db1ffd70) )
1156
 
        ROM_LOAD( "4.1f", 0x0c0000, 0x40000, CRC(a5f6e3ef) SHA1(f1f3d28b27eea682aa71855a311fb3abdf9af2cd) )
1157
 
        ROM_LOAD( "5.1h", 0x100000, 0x40000, CRC(ff2cc769) SHA1(ba4cf2923cf3d4d815a9327595f8e1801c3c8a2b) )
1158
 
 
1159
 
        ROM_REGION( 0x40000, "oki", 0 )
1160
 
        ROM_LOAD( "6.1k", 0x00000, 0x40000, CRC(8197034d) SHA1(b501dc7a27b1faad1361c309afd726da14b8b5f5) )
1161
 
ROM_END
1162
 
 
1163
 
ROM_START( ronjan )
1164
 
        ROM_REGION( 0x24000, "maincpu", 0 )
1165
 
        ROM_LOAD( "ver201.bin",    0x00000, 0x20000, CRC(caa98c79) SHA1(e18f52fc910e3a77142ad2a3167805cfd664f0f4) )
1166
 
        ROM_LOAD( "9009 1996.08 ron jan.bin", 0x00000, 0x4000, CRC(4eb74322) SHA1(84f864c0da3fb69948f6eb7ffecf0e722a882efc) ) //overlapped internal ROM
1167
 
 
1168
 
        ROM_REGION( 0x140000, "gfx1", 0 )
1169
 
        ROM_LOAD( "eagle.1", 0x000000, 0x40000, CRC(11cef2c4) SHA1(fcd46bfa123cd91053f8d49892778e02a275ffdd) )
1170
 
        ROM_LOAD( "eagle.2", 0x040000, 0x40000, CRC(177c444c) SHA1(5af0f6040ba121c90b3480ce636885cce535d3ea) )
1171
 
        ROM_LOAD( "eagle.3", 0x080000, 0x40000, CRC(5b15b99f) SHA1(b99e2fa4cde7c8661d1a81ce5045f5df4f1de9f2) )
1172
 
        ROM_LOAD( "eagle.4", 0x0c0000, 0x40000, CRC(d6797340) SHA1(0394ba570f2008f5a16e7c0a4dc67b1182be8899) )
1173
 
        ROM_LOAD( "eagle.5", 0x100000, 0x40000, CRC(1aa42eaf) SHA1(edae2d1b58429e09ecfcaa5bcf4a9bfd5fb7cbea) )
1174
 
 
1175
 
        ROM_REGION( 0x40000, "oki", 0 )
1176
 
        ROM_LOAD( "eagle.6", 0x00000, 0x40000, CRC(8197034d) SHA1(b501dc7a27b1faad1361c309afd726da14b8b5f5) )
1177
 
ROM_END
1178
 
 
1179
 
 
1180
 
static READ8_HANDLER( ronjan_prot_r )
1181
 
{
1182
 
        pinkiri8_state *state = space->machine().driver_data<pinkiri8_state>();
1183
 
        static const char wing_str[6] = { 'W', 'I', 'N', 'G', '8', '9' };
1184
 
 
1185
 
        state->m_prot_read_index++;
1186
 
 
1187
 
        if(state->m_prot_read_index & 1)
1188
 
                return 0xff; //value is discarded
1189
 
 
1190
 
        return wing_str[(state->m_prot_read_index >> 1)-1];
1191
 
}
1192
 
 
1193
 
static WRITE8_HANDLER( ronjan_prot_w )
1194
 
{
1195
 
        pinkiri8_state *state = space->machine().driver_data<pinkiri8_state>();
1196
 
 
1197
 
        if(data == 0)
1198
 
        {
1199
 
                state->m_prot_index = 0;
1200
 
        }
1201
 
        else
1202
 
        {
1203
 
                state->m_prot_char[state->m_prot_index] = data;
1204
 
                state->m_prot_index++;
1205
 
 
1206
 
                if(state->m_prot_char[0] == 'E' && state->m_prot_char[1] == 'R' && state->m_prot_char[2] == 'R' && state->m_prot_char[3] == 'O' && state->m_prot_char[4] == 'R')
1207
 
                        state->m_prot_read_index = 0;
1208
 
        }
1209
 
}
1210
 
 
1211
 
static READ8_HANDLER( ronjan_prot_status_r )
1212
 
{
1213
 
        return 0; //bit 0 seems a protection status bit
1214
 
}
1215
 
 
1216
 
static READ8_HANDLER( ronjan_patched_prot_r )
1217
 
{
1218
 
        return 0; //value is read then discarded
1219
 
}
1220
 
 
1221
 
static DRIVER_INIT( ronjan )
1222
 
{
1223
 
        machine.device("maincpu")->memory().space(AS_IO)->install_legacy_readwrite_handler(0x90, 0x90, FUNC(ronjan_prot_r), FUNC(ronjan_prot_w));
1224
 
        machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x66, 0x66, FUNC(ronjan_prot_status_r));
1225
 
        machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x9f, 0x9f, FUNC(ronjan_patched_prot_r));
1226
 
}
1227
 
 
1228
 
GAME( 1992,  janshi,    0,   pinkiri8, janshi,    0,      ROT0, "Eagle",         "Janshi",          GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
1229
 
GAME( 1994,  ronjan,    0,   pinkiri8, ronjan,    ronjan, ROT0, "Wing Co., Ltd", "Ron Jan (Super)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING ) // 'SUPER' flashes in the middle of the screen
1230
 
GAME( 1994,  pinkiri8,  0,   pinkiri8, pinkiri8,  0,      ROT0, "Alta",          "Pinkiri 8",       GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )