~ubuntu-branches/ubuntu/lucid/sdlmame/lucid

« back to all changes in this revision

Viewing changes to src/mame/machine/playch10.c

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Falco
  • Date: 2009-11-03 17:10:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091103171015-6hop4ory5lxnumpn
Tags: 0.135-0ubuntu1
* New upstream release - Closes (LP: #403212)
* debian/watch: unstable releases are no longer detected
* mame.ini: added the cheat subdirectories to cheatpath so zipped
  cheatfiles will be searched too
* renamed crsshair subdirectory to crosshair to reflect upstream change
* mame.ini: renamed references to crosshair subdirectory (see above)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#include "machine/rp5h01.h"
4
4
#include "includes/playch10.h"
5
5
 
 
6
/* prototypes */
 
7
static void pc10_set_mirroring( int mirroring );
 
8
static WRITE8_HANDLER( pc10_nt_w );
 
9
static READ8_HANDLER( pc10_nt_r );
 
10
static WRITE8_HANDLER( pc10_chr_w );
 
11
static READ8_HANDLER( pc10_chr_r );
 
12
static void pc10_set_videorom_bank( running_machine *machine, int first, int count, int bank, int size );
 
13
static void set_videoram_bank( running_machine *machine, int first, int count, int bank, int size );
 
14
 
 
15
typedef struct
 
16
{
 
17
        int writable;   // 1 for RAM, 0 for ROM
 
18
        UINT8* chr;             // direct access to the memory
 
19
} chr_bank;
 
20
 
 
21
 
6
22
/* Globals */
7
23
int pc10_sdcs;                  /* ShareD Chip Select */
8
24
int pc10_dispmask;              /* Display Mask */
21
37
 
22
38
static int MMC2_bank[4], MMC2_bank_latch[2];
23
39
 
 
40
static UINT8* vrom;                             // used for games with cart gfx loaded (a,c,e,f,g,h)
 
41
static UINT8* vram = NULL;              // used for boards h, b, d, i, k (Presumably, 8K. 16K didn't work in MESS)
 
42
static UINT8* nametable[4];             // For non-mirroring boards, this can be moved to a direct mapping
 
43
static UINT8* nt_ram = NULL;    // Per-board size! Some boards clearly need 4K. Some MAY use 2K. Research needed.
 
44
static chr_bank chr_page[8];    // Simple wrapper for ROM/RAM, since we could be banking either (Hboard)
 
45
 
24
46
/*************************************
25
47
 *
26
48
 *  Init machine
27
49
 *
28
50
 *************************************/
 
51
 
29
52
MACHINE_RESET( pc10 )
30
53
{
31
 
        const device_config *ppu = devtag_get_device(machine, "ppu");
32
54
        const device_config *rp5h01 = devtag_get_device(machine, "rp5h01");
33
55
 
34
56
        /* initialize latches and flip-flops */
51
73
        rp5h01_reset_w(rp5h01, 0, 1);
52
74
        rp5h01_enable_w(rp5h01, 0, 1);
53
75
 
54
 
        ppu2c0x_set_mirroring( ppu, mirroring );
 
76
        pc10_set_mirroring(mirroring);
 
77
}
 
78
 
 
79
MACHINE_START( pc10 )
 
80
{
 
81
        vrom = memory_region(machine, "gfx2");
 
82
 
 
83
        /* allocate 4K of nametable ram here */
 
84
        /* move to individual boards as documentation of actual boards allows */
 
85
        nt_ram = auto_alloc_array(machine, UINT8, 0x1000);
 
86
 
 
87
        memory_install_readwrite8_handler(cpu_get_address_space(cputag_get_cpu(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, pc10_chr_r, pc10_chr_w);
 
88
        memory_install_readwrite8_handler(cpu_get_address_space(cputag_get_cpu(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, pc10_nt_r, pc10_nt_w);
 
89
 
 
90
        if (NULL != vram)
 
91
                set_videoram_bank(machine, 0, 8, 0, 8);
 
92
        else pc10_set_videorom_bank(machine, 0, 8, 0, 8);
 
93
 
 
94
}
 
95
 
 
96
MACHINE_START( playch10_hboard )
 
97
{
 
98
        vrom = memory_region(machine, "gfx2");
 
99
 
 
100
        /* allocate 4K of nametable ram here */
 
101
        /* move to individual boards as documentation of actual boards allows */
 
102
        nt_ram = auto_alloc_array(machine, UINT8, 0x1000);
 
103
        /* allocate vram */
 
104
 
 
105
        vram = auto_alloc_array(machine, UINT8, 0x2000);
 
106
 
 
107
        memory_install_readwrite8_handler(cpu_get_address_space(cputag_get_cpu(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, pc10_chr_r, pc10_chr_w);
 
108
        memory_install_readwrite8_handler(cpu_get_address_space(cputag_get_cpu(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, pc10_nt_r, pc10_nt_w);
55
109
}
56
110
 
57
111
/*************************************
103
157
 
104
158
WRITE8_HANDLER( pc10_GAMERES_w )
105
159
{
106
 
        cputag_set_input_line(space->machine, "cart", INPUT_LINE_RESET, ( data & 1 ) ? CLEAR_LINE : ASSERT_LINE );
 
160
        cputag_set_input_line(space->machine, "cart", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE );
107
161
}
108
162
 
109
163
WRITE8_HANDLER( pc10_GAMESTOP_w )
110
164
{
111
 
        cputag_set_input_line(space->machine, "cart", INPUT_LINE_HALT, ( data & 1 ) ? CLEAR_LINE : ASSERT_LINE );
 
165
        cputag_set_input_line(space->machine, "cart", INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE );
112
166
}
113
167
 
114
168
WRITE8_HANDLER( pc10_PPURES_w )
115
169
{
116
 
        if ( data & 1 )
 
170
        if (data & 1)
117
171
                devtag_reset(space->machine, "ppu");
118
172
}
119
173
 
126
180
 
127
181
WRITE8_HANDLER( pc10_CARTSEL_w )
128
182
{
129
 
        cart_sel &= ~( 1 << offset );
130
 
        cart_sel |= ( data & 1 ) << offset;
 
183
        cart_sel &= ~(1 << offset);
 
184
        cart_sel |= (data & 1) << offset;
131
185
}
132
186
 
133
187
 
136
190
 *  RP5H01 handling
137
191
 *
138
192
 *************************************/
 
193
 
139
194
READ8_HANDLER( pc10_prot_r )
140
195
{
141
196
        const device_config *rp5h01 = devtag_get_device(space->machine, "rp5h01");
179
234
 *  Input Ports
180
235
 *
181
236
 *************************************/
 
237
 
182
238
WRITE8_HANDLER( pc10_in0_w )
183
239
{
184
240
        /* Toggling bit 0 high then low resets both controllers */
185
 
        if ( data & 1 )
 
241
        if (data & 1)
186
242
                return;
187
243
 
188
244
        /* load up the latches */
190
246
        input_latch[1] = input_port_read(space->machine, "P2");
191
247
 
192
248
        /* apply any masking from the BIOS */
193
 
        if ( cntrl_mask )
 
249
        if (cntrl_mask)
194
250
        {
195
251
                /* mask out select and start */
196
252
                input_latch[0] &= ~0x0c;
199
255
 
200
256
READ8_HANDLER( pc10_in0_r )
201
257
{
202
 
        int ret = ( input_latch[0] ) & 1;
 
258
        int ret = (input_latch[0]) & 1;
203
259
 
204
260
        /* shift */
205
261
        input_latch[0] >>= 1;
213
269
 
214
270
READ8_HANDLER( pc10_in1_r )
215
271
{
216
 
        int ret = ( input_latch[1] ) & 1;
 
272
        int ret = (input_latch[1]) & 1;
217
273
 
218
274
        /* shift */
219
275
        input_latch[1] >>= 1;
220
276
 
221
277
        /* do the gun thing */
222
 
        if ( pc10_gun_controller )
 
278
        if (pc10_gun_controller)
223
279
        {
224
280
                const device_config *ppu = devtag_get_device(space->machine, "ppu");
225
281
                int trigger = input_port_read(space->machine, "P1");
231
287
                ret |= 0x08;
232
288
 
233
289
                /* get the pixel at the gun position */
234
 
                pix = ppu2c0x_get_pixel( ppu, x, y );
 
290
                pix = ppu2c0x_get_pixel(ppu, x, y);
235
291
 
236
292
                /* get the color base from the ppu */
237
 
                color_base = ppu2c0x_get_colorbase( ppu );
 
293
                color_base = ppu2c0x_get_colorbase(ppu);
238
294
 
239
295
                /* look at the screen and see if the cursor is over a bright pixel */
240
 
                if ( ( pix == color_base+0x20 ) || ( pix == color_base+0x30 ) ||
241
 
                         ( pix == color_base+0x33 ) || ( pix == color_base+0x34 ) )
 
296
                if ((pix == color_base + 0x20) || (pix == color_base + 0x30) ||
 
297
                        (pix == color_base + 0x33) || (pix == color_base + 0x34))
242
298
                {
243
299
                        ret &= ~0x08; /* sprite hit */
244
300
                }
245
301
 
246
302
                /* now, add the trigger if not masked */
247
 
                if ( !cntrl_mask )
 
303
                if (!cntrl_mask)
248
304
                {
249
 
                        ret |= ( trigger & 2 ) << 3;
 
305
                        ret |= (trigger & 2) << 3;
250
306
                }
251
307
        }
252
308
 
256
312
 
257
313
        return ret;
258
314
}
259
 
 
 
315
/*************************************
 
316
 *
 
317
 *  PPU External bus handlers
 
318
 *
 
319
 *************************************/
 
320
 
 
321
static WRITE8_HANDLER( pc10_nt_w )
 
322
{
 
323
        int page = ((offset & 0xc00) >> 10);
 
324
        nametable[page][offset & 0x3ff] = data;
 
325
}
 
326
 
 
327
static READ8_HANDLER( pc10_nt_r )
 
328
{
 
329
        int page = ((offset & 0xc00) >> 10);
 
330
        return nametable[page][offset & 0x3ff];
 
331
}
 
332
 
 
333
static WRITE8_HANDLER( pc10_chr_w )
 
334
{
 
335
        int bank = offset >> 10;
 
336
        if (chr_page[bank].writable)
 
337
        {
 
338
                chr_page[bank].chr[offset & 0x3ff] = data;
 
339
        }
 
340
}
 
341
 
 
342
static READ8_HANDLER( pc10_chr_r )
 
343
{
 
344
        int bank = offset >> 10;
 
345
        return chr_page[bank].chr[offset & 0x3ff];
 
346
}
 
347
 
 
348
static void pc10_set_mirroring( int mirroring )
 
349
{
 
350
        switch (mirroring)
 
351
        {
 
352
        case PPU_MIRROR_LOW:
 
353
                nametable[0] = nametable[1] = nametable[2] = nametable[3] = nt_ram;
 
354
                break;
 
355
        case PPU_MIRROR_HIGH:
 
356
                nametable[0] = nametable[1] = nametable[2] = nametable[3] = nt_ram + 0x400;
 
357
                break;
 
358
        case PPU_MIRROR_HORZ:
 
359
                nametable[0] = nt_ram;
 
360
                nametable[1] = nt_ram;
 
361
                nametable[2] = nt_ram + 0x400;
 
362
                nametable[3] = nt_ram + 0x400;
 
363
                break;
 
364
        case PPU_MIRROR_VERT:
 
365
                nametable[0] = nt_ram;
 
366
                nametable[1] = nt_ram + 0x400;
 
367
                nametable[2] = nt_ram;
 
368
                nametable[3] = nt_ram + 0x400;
 
369
                break;
 
370
        case PPU_MIRROR_NONE:
 
371
        default:
 
372
                nametable[0] = nt_ram;
 
373
                nametable[1] = nt_ram + 0x400;
 
374
                nametable[2] = nt_ram + 0x800;
 
375
                nametable[3] = nt_ram + 0xc00;
 
376
                break;
 
377
        }
 
378
}
 
379
 
 
380
/* SIZE MAPPINGS *\
 
381
 * old       new *
 
382
 * 512         8 *
 
383
 * 256         4 *
 
384
 * 128         2 *
 
385
 *  64         1 *
 
386
\*****************/
 
387
 
 
388
static void pc10_set_videorom_bank( running_machine *machine, int first, int count, int bank, int size )
 
389
{
 
390
        int i, len;
 
391
        /* first = first bank to map */
 
392
        /* count = number of 1K banks to map */
 
393
        /* bank = index of the bank */
 
394
        /* size = size of indexed banks (in KB) */
 
395
        /* note that this follows the original PPU banking and might be overly complex */
 
396
 
 
397
        /* yeah, this is probably a horrible assumption to make.*/
 
398
        /* but the driver is 100% consistant */
 
399
 
 
400
        len = memory_region_length(machine, "gfx2");
 
401
        len /= 0x400;   // convert to KB
 
402
        len /= size;    // convert to bank resolution
 
403
        len--;                  // convert to mask
 
404
        bank &= len;    // should be the right mask
 
405
 
 
406
        for (i = 0; i < count; i++)
 
407
        {
 
408
                chr_page[i + first].writable = 0;
 
409
                chr_page[i + first].chr=vrom + (i * 0x400) + (bank * size * 0x400);
 
410
        }
 
411
}
 
412
 
 
413
static void set_videoram_bank( running_machine *machine, int first, int count, int bank, int size )
 
414
{
 
415
        int i;
 
416
        /* first = first bank to map */
 
417
        /* count = number of 1K banks to map */
 
418
        /* bank = index of the bank */
 
419
        /* size = size of indexed banks (in KB) */
 
420
        /* note that this follows the original PPU banking and might be overly complex */
 
421
 
 
422
        /* assumes 8K of vram */
 
423
        /* need 8K to fill address space */
 
424
        /* only pinbot (8k) banks at all */
 
425
 
 
426
        for (i = 0; i < count; i++)
 
427
        {
 
428
                chr_page[i + first].writable = 1;
 
429
                chr_page[i + first].chr = vram + (((i * 0x400) + (bank * size * 0x400)) & 0x1fff);
 
430
        }
 
431
}
260
432
 
261
433
/*************************************
262
434
 *
263
435
 *  Common init for all games
264
436
 *
265
437
 *************************************/
 
438
 
266
439
DRIVER_INIT( playch10 )
267
440
{
 
441
        vram = NULL;
 
442
 
268
443
        /* set the controller to default */
269
444
        pc10_gun_controller = 0;
270
445
 
285
460
        /* common init */
286
461
        DRIVER_INIT_CALL(playch10);
287
462
 
 
463
        /* we have no vram, make sure switching games doesn't point to an old allocation */
 
464
        vram = NULL;
 
465
 
288
466
        /* set the control type */
289
467
        pc10_gun_controller = 1;
290
468
}
312
490
        /* basically, a MMC1 mapper from the nes */
313
491
        static int size16k, switchlow, vrom4k;
314
492
 
315
 
        int reg = ( offset >> 13 );
 
493
        int reg = (offset >> 13);
316
494
 
317
495
        /* reset mapper */
318
 
        if ( data & 0x80 )
 
496
        if (data & 0x80)
319
497
        {
320
498
                mmc1_shiftreg = mmc1_shiftcount = 0;
321
499
 
327
505
        }
328
506
 
329
507
        /* see if we need to clock in data */
330
 
        if ( mmc1_shiftcount < 5 )
 
508
        if (mmc1_shiftcount < 5)
331
509
        {
332
510
                mmc1_shiftreg >>= 1;
333
 
                mmc1_shiftreg |= ( data & 1 ) << 4;
 
511
                mmc1_shiftreg |= (data & 1) << 4;
334
512
                mmc1_shiftcount++;
335
513
        }
336
514
 
337
515
        /* are we done shifting? */
338
 
        if ( mmc1_shiftcount == 5 )
 
516
        if (mmc1_shiftcount == 5)
339
517
        {
340
 
                const device_config *ppu = devtag_get_device(space->machine, "ppu");
341
 
 
342
518
                /* reset count */
343
519
                mmc1_shiftcount = 0;
344
520
 
345
521
                /* apply data to registers */
346
 
                switch( reg )
 
522
                switch (reg)
347
523
                {
348
524
                        case 0:         /* mirroring and options */
349
525
                                {
353
529
                                        size16k = mmc1_shiftreg & 0x08;
354
530
                                        switchlow = mmc1_shiftreg & 0x04;
355
531
 
356
 
                                        switch( mmc1_shiftreg & 3 )
 
532
                                        switch (mmc1_shiftreg & 3)
357
533
                                        {
358
534
                                                case 0:
359
535
                                                        _mirroring = PPU_MIRROR_LOW;
374
550
                                        }
375
551
 
376
552
                                        /* apply mirroring */
377
 
                                        ppu2c0x_set_mirroring( ppu, _mirroring );
 
553
                                        pc10_set_mirroring(_mirroring);
378
554
                                }
379
555
                        break;
380
556
 
381
557
                        case 1: /* video rom banking - bank 0 - 4k or 8k */
382
 
                                ppu2c0x_set_videorom_bank( ppu, 0, ( vrom4k ) ? 4 : 8, ( mmc1_shiftreg & 0x1f ), 256 );
 
558
                                if (vram)
 
559
                                        set_videoram_bank(space->machine, 0, (vrom4k) ? 4 : 8, (mmc1_shiftreg & 0x1f), 4);
 
560
                                else
 
561
                                        pc10_set_videorom_bank(space->machine, 0, (vrom4k) ? 4 : 8, (mmc1_shiftreg & 0x1f), 4);
383
562
                        break;
384
563
 
385
564
                        case 2: /* video rom banking - bank 1 - 4k only */
386
 
                                if ( vrom4k )
387
 
                                        ppu2c0x_set_videorom_bank( ppu, 4, 4, ( mmc1_shiftreg & 0x1f ), 256 );
 
565
                                if (vrom4k)
 
566
                                {
 
567
                                        if (vram)
 
568
                                                set_videoram_bank(space->machine, 0, (vrom4k) ? 4 : 8, (mmc1_shiftreg & 0x1f), 4);
 
569
                                        else
 
570
                                                pc10_set_videorom_bank(space->machine, 4, 4, (mmc1_shiftreg & 0x1f), 4);
 
571
                                }
388
572
                        break;
389
573
 
390
574
                        case 3: /* program banking */
391
575
                                {
392
 
                                        int bank = ( mmc1_shiftreg & mmc1_rom_mask ) * 0x4000;
393
 
                                        UINT8 *prg = memory_region( space->machine, "cart" );
 
576
                                        int bank = (mmc1_shiftreg & mmc1_rom_mask) * 0x4000;
 
577
                                        UINT8 *prg = memory_region(space->machine, "cart");
394
578
 
395
 
                                        if ( !size16k )
 
579
                                        if (!size16k)
396
580
                                        {
397
581
                                                /* switch 32k */
398
 
                                                memcpy( &prg[0x08000], &prg[0x010000+bank], 0x8000 );
 
582
                                                memcpy(&prg[0x08000], &prg[0x010000 + bank], 0x8000);
399
583
                                        }
400
584
                                        else
401
585
                                        {
402
586
                                                /* switch 16k */
403
 
                                                if ( switchlow )
 
587
                                                if (switchlow)
404
588
                                                {
405
589
                                                        /* low */
406
 
                                                        memcpy( &prg[0x08000], &prg[0x010000+bank], 0x4000 );
 
590
                                                        memcpy(&prg[0x08000], &prg[0x010000 + bank], 0x4000);
407
591
                                                }
408
592
                                                else
409
593
                                                {
410
594
                                                        /* high */
411
 
                                                        memcpy( &prg[0x0c000], &prg[0x010000+bank], 0x4000 );
 
595
                                                        memcpy(&prg[0x0c000], &prg[0x010000 + bank], 0x4000);
412
596
                                                }
413
597
                                        }
414
598
                                }
418
602
}
419
603
 
420
604
/**********************************************************************************/
421
 
 
422
605
/* A Board games (Track & Field, Gradius) */
423
606
 
424
607
static WRITE8_HANDLER( aboard_vrom_switch_w )
425
608
{
426
 
        const device_config *ppu = devtag_get_device(space->machine, "ppu");
427
 
        ppu2c0x_set_videorom_bank( ppu, 0, 8, ( data & 3 ), 512 );
 
609
        pc10_set_videorom_bank(space->machine, 0, 8, (data & 3), 8);
428
610
}
429
611
 
430
612
DRIVER_INIT( pcaboard )
437
619
 
438
620
        /* set the mirroring here */
439
621
        mirroring = PPU_MIRROR_VERT;
 
622
 
 
623
        /* we have no vram, make sure switching games doesn't point to an old allocation */
 
624
        vram = NULL;
440
625
}
441
626
 
442
627
/**********************************************************************************/
443
 
 
444
628
/* B Board games (Contra, Rush N' Attach, Pro Wrestling) */
445
629
 
446
630
static WRITE8_HANDLER( bboard_rom_switch_w )
447
631
{
448
 
        int bankoffset = 0x10000 + ( ( data & 7 ) * 0x4000 );
449
 
        UINT8 *prg = memory_region( space->machine, "cart" );
 
632
        int bankoffset = 0x10000 + ((data & 7) * 0x4000);
 
633
        UINT8 *prg = memory_region(space->machine, "cart");
450
634
 
451
 
        memcpy( &prg[0x08000], &prg[bankoffset], 0x4000 );
 
635
        memcpy(&prg[0x08000], &prg[bankoffset], 0x4000);
452
636
}
453
637
 
454
638
DRIVER_INIT( pcbboard )
455
639
{
456
 
        UINT8 *prg = memory_region( machine, "cart" );
 
640
        UINT8 *prg = memory_region(machine, "cart");
457
641
 
458
642
        /* We do manual banking, in case the code falls through */
459
643
        /* Copy the initial banks */
460
 
        memcpy( &prg[0x08000], &prg[0x28000], 0x8000 );
 
644
        memcpy(&prg[0x08000], &prg[0x28000], 0x8000);
461
645
 
462
646
        /* Roms are banked at $8000 to $bfff */
463
647
        memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, bboard_rom_switch_w );
465
649
        /* common init */
466
650
        DRIVER_INIT_CALL(playch10);
467
651
 
 
652
        /* allocate vram */
 
653
        vram = auto_alloc_array(machine, UINT8, 0x2000);
 
654
 
468
655
        /* set the mirroring here */
469
656
        mirroring = PPU_MIRROR_VERT;
 
657
        /* special init */
 
658
        set_videoram_bank(machine, 0, 8, 0, 8);
470
659
}
471
660
 
472
661
/**********************************************************************************/
473
 
 
474
662
/* C Board games (The Goonies) */
475
663
 
476
664
static WRITE8_HANDLER( cboard_vrom_switch_w )
477
665
{
478
 
        const device_config *ppu = devtag_get_device(space->machine, "ppu");
479
 
        ppu2c0x_set_videorom_bank( ppu, 0, 8, ( ( data >> 1 ) & 1 ), 512 );
 
666
        pc10_set_videorom_bank(space->machine, 0, 8, ((data >> 1) & 1), 8);
480
667
}
481
668
 
482
669
DRIVER_INIT( pccboard )
484
671
        /* switches vrom with writes to $6000 */
485
672
        memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x6000, 0, 0, cboard_vrom_switch_w );
486
673
 
 
674
        /* we have no vram, make sure switching games doesn't point to an old allocation */
 
675
        vram = NULL;
 
676
 
487
677
        /* common init */
488
678
        DRIVER_INIT_CALL(playch10);
489
679
}
490
680
 
491
681
/**********************************************************************************/
492
 
 
493
682
/* D Board games (Rad Racer) */
494
683
 
495
684
DRIVER_INIT( pcdboard )
496
685
{
497
 
        UINT8 *prg = memory_region( machine, "cart" );
 
686
        UINT8 *prg = memory_region(machine, "cart");
498
687
 
499
688
        /* We do manual banking, in case the code falls through */
500
689
        /* Copy the initial banks */
501
 
        memcpy( &prg[0x08000], &prg[0x28000], 0x8000 );
 
690
        memcpy(&prg[0x08000], &prg[0x28000], 0x8000);
502
691
 
503
692
        mmc1_rom_mask = 0x07;
504
693
 
505
694
        /* MMC mapper at writes to $8000-$ffff */
506
695
        memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w );
507
696
 
 
697
 
508
698
        /* common init */
509
699
        DRIVER_INIT_CALL(playch10);
 
700
        /* allocate vram */
 
701
        vram = auto_alloc_array(machine, UINT8, 0x2000);
 
702
        /* special init */
 
703
        set_videoram_bank(machine, 0, 8, 0, 8);
510
704
}
511
705
 
512
706
/* D Board games with extra ram (Metroid) */
519
713
 
520
714
        /* common init */
521
715
        DRIVER_INIT_CALL(pcdboard);
 
716
 
 
717
        /* allocate vram */
 
718
        vram = auto_alloc_array(machine, UINT8, 0x2000);
 
719
        /* special init */
 
720
        set_videoram_bank(machine, 0, 8, 0, 8);
522
721
}
523
722
 
524
723
/**********************************************************************************/
525
 
 
526
724
/* E Board games (Mike Tyson's Punchout) - BROKEN - FIX ME */
527
725
 
528
726
/* callback for the ppu_latch */
529
727
static void mapper9_latch( const device_config *ppu, offs_t offset )
530
728
{
531
729
 
532
 
        if( (offset & 0x1ff0) == 0x0fd0 && MMC2_bank_latch[0] != 0xfd )
 
730
        if((offset & 0x1ff0) == 0x0fd0 && MMC2_bank_latch[0] != 0xfd)
533
731
        {
534
732
                MMC2_bank_latch[0] = 0xfd;
535
 
                ppu2c0x_set_videorom_bank( ppu, 0, 4, MMC2_bank[0], 256 );
 
733
                pc10_set_videorom_bank(ppu->space[0]->machine, 0, 4, MMC2_bank[0], 4);
536
734
        }
537
 
        else if( (offset & 0x1ff0) == 0x0fe0 && MMC2_bank_latch[0] != 0xfe )
 
735
        else if((offset & 0x1ff0) == 0x0fe0 && MMC2_bank_latch[0] != 0xfe)
538
736
        {
539
737
                MMC2_bank_latch[0] = 0xfe;
540
 
                ppu2c0x_set_videorom_bank( ppu, 0, 4, MMC2_bank[1], 256 );
 
738
                pc10_set_videorom_bank(ppu->space[0]->machine, 0, 4, MMC2_bank[1], 4);
541
739
        }
542
 
        else if( (offset & 0x1ff0) == 0x1fd0 && MMC2_bank_latch[1] != 0xfd )
 
740
        else if((offset & 0x1ff0) == 0x1fd0 && MMC2_bank_latch[1] != 0xfd)
543
741
        {
544
742
                MMC2_bank_latch[1] = 0xfd;
545
 
                ppu2c0x_set_videorom_bank( ppu, 4, 4, MMC2_bank[2], 256 );
 
743
                pc10_set_videorom_bank(ppu->space[0]->machine, 4, 4, MMC2_bank[2], 4);
546
744
        }
547
 
        else if( (offset & 0x1ff0) == 0x1fe0 && MMC2_bank_latch[1] != 0xfe )
 
745
        else if((offset & 0x1ff0) == 0x1fe0 && MMC2_bank_latch[1] != 0xfe)
548
746
        {
549
747
                MMC2_bank_latch[1] = 0xfe;
550
 
                ppu2c0x_set_videorom_bank( ppu, 4, 4, MMC2_bank[3], 256 );
 
748
                pc10_set_videorom_bank(ppu->space[0]->machine, 4, 4, MMC2_bank[3], 4);
551
749
        }
552
750
}
553
751
 
554
752
static WRITE8_HANDLER( eboard_rom_switch_w )
555
753
{
556
 
        const device_config *ppu = devtag_get_device(space->machine, "ppu");
557
 
 
558
754
        /* a variation of mapper 9 on a nes */
559
 
        switch( offset & 0x7000 )
 
755
        switch (offset & 0x7000)
560
756
        {
561
757
                case 0x2000: /* code bank switching */
562
758
                        {
563
 
                                int bankoffset = 0x10000 + ( data & 0x0f ) * 0x2000;
564
 
                                UINT8 *prg = memory_region( space->machine, "cart" );
565
 
                                memcpy( &prg[0x08000], &prg[bankoffset], 0x2000 );
 
759
                                int bankoffset = 0x10000 + (data & 0x0f) * 0x2000;
 
760
                                UINT8 *prg = memory_region(space->machine, "cart");
 
761
                                memcpy(&prg[0x08000], &prg[bankoffset], 0x2000);
566
762
                        }
567
763
                break;
568
764
 
569
765
                case 0x3000: /* gfx bank 0 - 4k */
570
766
                        MMC2_bank[0] = data;
571
 
                        if( MMC2_bank_latch[0] == 0xfd )
572
 
                                ppu2c0x_set_videorom_bank( ppu, 0, 4, data, 256 );
 
767
                        if (MMC2_bank_latch[0] == 0xfd)
 
768
                                pc10_set_videorom_bank(space->machine, 0, 4, data, 4);
573
769
                break;
574
770
 
575
771
                case 0x4000: /* gfx bank 0 - 4k */
576
772
                        MMC2_bank[1] = data;
577
 
                        if( MMC2_bank_latch[0] == 0xfe )
578
 
                                ppu2c0x_set_videorom_bank( ppu, 0, 4, data, 256 );
 
773
                        if (MMC2_bank_latch[0] == 0xfe)
 
774
                                pc10_set_videorom_bank(space->machine, 0, 4, data, 4);
579
775
                break;
580
776
 
581
777
                case 0x5000: /* gfx bank 1 - 4k */
582
778
                        MMC2_bank[2] = data;
583
 
                        if( MMC2_bank_latch[1] == 0xfd )
584
 
                                ppu2c0x_set_videorom_bank( ppu, 4, 4, data, 256 );
 
779
                        if (MMC2_bank_latch[1] == 0xfd)
 
780
                                pc10_set_videorom_bank(space->machine, 4, 4, data, 4);
585
781
                break;
586
782
 
587
783
                case 0x6000: /* gfx bank 1 - 4k */
588
784
                        MMC2_bank[3] = data;
589
 
                        if( MMC2_bank_latch[1] == 0xfe )
590
 
                                ppu2c0x_set_videorom_bank( ppu, 4, 4, data, 256 );
 
785
                        if (MMC2_bank_latch[1] == 0xfe)
 
786
                                pc10_set_videorom_bank(space->machine, 4, 4, data, 4);
591
787
                break;
592
788
 
593
789
                case 0x7000: /* mirroring */
594
 
                        ppu2c0x_set_mirroring( ppu, data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
 
790
                        pc10_set_mirroring(data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
595
791
 
596
792
                break;
597
793
        }
599
795
 
600
796
DRIVER_INIT( pceboard )
601
797
{
602
 
        UINT8 *prg = memory_region( machine, "cart" );
 
798
        UINT8 *prg = memory_region(machine, "cart");
 
799
 
 
800
        /* we have no vram, make sure switching games doesn't point to an old allocation */
 
801
        vram = NULL;
603
802
 
604
803
        /* We do manual banking, in case the code falls through */
605
804
        /* Copy the initial banks */
606
 
        memcpy( &prg[0x08000], &prg[0x28000], 0x8000 );
 
805
        memcpy(&prg[0x08000], &prg[0x28000], 0x8000);
607
806
 
608
807
        /* basically a mapper 9 on a nes */
609
808
        memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, eboard_rom_switch_w );
620
819
}
621
820
 
622
821
/**********************************************************************************/
623
 
 
624
822
/* F Board games (Ninja Gaiden, Double Dragon) */
625
823
 
626
824
DRIVER_INIT( pcfboard )
627
825
{
628
 
        UINT8 *prg = memory_region( machine, "cart" );
 
826
        UINT8 *prg = memory_region(machine, "cart");
 
827
 
 
828
        /* we have no vram, make sure switching games doesn't point to an old allocation */
 
829
        vram = NULL;
629
830
 
630
831
        /* We do manual banking, in case the code falls through */
631
832
        /* Copy the initial banks */
632
 
        memcpy( &prg[0x08000], &prg[0x28000], 0x8000 );
 
833
        memcpy(&prg[0x08000], &prg[0x28000], 0x8000);
633
834
 
634
835
        mmc1_rom_mask = 0x07;
635
836
 
648
849
        memory_install_readwrite8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x6fff, 0, 0, (read8_space_func)SMH_BANK(1), (write8_space_func)SMH_BANK(1) );
649
850
        memory_set_bankptr(machine, 1, auto_alloc_array(machine, UINT8, 0x1000));
650
851
 
 
852
        vram = NULL;
 
853
 
651
854
        /* common init */
652
855
        DRIVER_INIT_CALL(pcfboard);
653
856
}
654
857
 
655
858
/**********************************************************************************/
656
 
 
657
859
/* G Board games (Super Mario Bros. 3) */
658
860
 
659
861
static int gboard_scanline_counter;
665
867
 
666
868
static void gboard_scanline_cb( const device_config *device, int scanline, int vblank, int blanked )
667
869
{
668
 
        if ( !vblank && !blanked )
 
870
        if (!vblank && !blanked)
669
871
        {
670
 
                if ( --gboard_scanline_counter == -1 )
 
872
                if (--gboard_scanline_counter == -1)
671
873
                {
672
874
                        gboard_scanline_counter = gboard_scanline_latch;
673
875
                        generic_pulse_irq_line(cputag_get_cpu(device->machine, "cart"), 0);
681
883
 
682
884
        /* basically, a MMC3 mapper from the nes */
683
885
 
684
 
        switch( offset & 0x7001 )
 
886
        switch (offset & 0x7001)
685
887
        {
686
888
                case 0x0000:
687
889
                        gboard_command = data;
688
890
 
689
 
                        if ( gboard_last_bank != ( data & 0xc0 ) )
 
891
                        if (gboard_last_bank != (data & 0xc0))
690
892
                        {
691
893
                                int bank;
692
 
                                UINT8 *prg = memory_region( space->machine, "cart" );
 
894
                                UINT8 *prg = memory_region(space->machine, "cart");
693
895
 
694
896
                                /* reset the banks */
695
 
                                if ( gboard_command & 0x40 )
 
897
                                if (gboard_command & 0x40)
696
898
                                {
697
899
                                        /* high bank */
698
900
                                        bank = gboard_banks[0] * 0x2000 + 0x10000;
699
901
 
700
 
                                        memcpy( &prg[0x0c000], &prg[bank], 0x2000 );
701
 
                                        memcpy( &prg[0x08000], &prg[0x4c000], 0x2000 );
 
902
                                        memcpy(&prg[0x0c000], &prg[bank], 0x2000);
 
903
                                        memcpy(&prg[0x08000], &prg[0x4c000], 0x2000);
702
904
                                }
703
905
                                else
704
906
                                {
705
907
                                        /* low bank */
706
908
                                        bank = gboard_banks[0] * 0x2000 + 0x10000;
707
909
 
708
 
                                        memcpy( &prg[0x08000], &prg[bank], 0x2000 );
709
 
                                        memcpy( &prg[0x0c000], &prg[0x4c000], 0x2000 );
 
910
                                        memcpy(&prg[0x08000], &prg[bank], 0x2000);
 
911
                                        memcpy(&prg[0x0c000], &prg[0x4c000], 0x2000);
710
912
                                }
711
913
 
712
914
                                /* mid bank */
713
915
                                bank = gboard_banks[1] * 0x2000 + 0x10000;
714
 
                                memcpy( &prg[0x0a000], &prg[bank], 0x2000 );
 
916
                                memcpy(&prg[0x0a000], &prg[bank], 0x2000);
715
917
 
716
918
                                gboard_last_bank = data & 0xc0;
717
919
                        }
720
922
                case 0x0001:
721
923
                        {
722
924
                                UINT8 cmd = gboard_command & 0x07;
723
 
                                int page = ( gboard_command & 0x80 ) >> 5;
 
925
                                int page = (gboard_command & 0x80) >> 5;
724
926
                                int bank;
725
927
 
726
 
                                switch( cmd )
 
928
                                switch (cmd)
727
929
                                {
728
930
                                        case 0: /* char banking */
729
931
                                        case 1: /* char banking */
730
932
                                                data &= 0xfe;
731
 
                                                page ^= ( cmd << 1 );
732
 
                                                ppu2c0x_set_videorom_bank( ppu, page, 2, data, 64 );
 
933
                                                page ^= (cmd << 1);
 
934
                                                pc10_set_videorom_bank(space->machine, page, 2, data, 1);
733
935
                                        break;
734
936
 
735
937
                                        case 2: /* char banking */
737
939
                                        case 4: /* char banking */
738
940
                                        case 5: /* char banking */
739
941
                                                page ^= cmd + 2;
740
 
                                                ppu2c0x_set_videorom_bank( ppu, page, 1, data, 64 );
 
942
                                                pc10_set_videorom_bank(space->machine, page, 1, data, 1);
741
943
                                        break;
742
944
 
743
945
                                        case 6: /* program banking */
744
946
                                        {
745
 
                                                UINT8 *prg = memory_region( space->machine, "cart" );
746
 
                                                if ( gboard_command & 0x40 )
 
947
                                                UINT8 *prg = memory_region(space->machine, "cart");
 
948
                                                if (gboard_command & 0x40)
747
949
                                                {
748
950
                                                        /* high bank */
749
951
                                                        gboard_banks[0] = data & 0x1f;
750
 
                                                        bank = ( gboard_banks[0] ) * 0x2000 + 0x10000;
 
952
                                                        bank = (gboard_banks[0]) * 0x2000 + 0x10000;
751
953
 
752
 
                                                        memcpy( &prg[0x0c000], &prg[bank], 0x2000 );
753
 
                                                        memcpy( &prg[0x08000], &prg[0x4c000], 0x2000 );
 
954
                                                        memcpy(&prg[0x0c000], &prg[bank], 0x2000);
 
955
                                                        memcpy(&prg[0x08000], &prg[0x4c000], 0x2000);
754
956
                                                }
755
957
                                                else
756
958
                                                {
757
959
                                                        /* low bank */
758
960
                                                        gboard_banks[0] = data & 0x1f;
759
 
                                                        bank = ( gboard_banks[0] ) * 0x2000 + 0x10000;
 
961
                                                        bank = (gboard_banks[0]) * 0x2000 + 0x10000;
760
962
 
761
 
                                                        memcpy( &prg[0x08000], &prg[bank], 0x2000 );
762
 
                                                        memcpy( &prg[0x0c000], &prg[0x4c000], 0x2000 );
 
963
                                                        memcpy(&prg[0x08000], &prg[bank], 0x2000);
 
964
                                                        memcpy(&prg[0x0c000], &prg[0x4c000], 0x2000);
763
965
                                                }
764
966
                                        }
765
967
                                        break;
767
969
                                        case 7: /* program banking */
768
970
                                                {
769
971
                                                        /* mid bank */
770
 
                                                        UINT8 *prg = memory_region( space->machine, "cart" );
 
972
                                                        UINT8 *prg = memory_region(space->machine, "cart");
771
973
                                                        gboard_banks[1] = data & 0x1f;
772
974
                                                        bank = gboard_banks[1] * 0x2000 + 0x10000;
773
975
 
774
 
                                                        memcpy( &prg[0x0a000], &prg[bank], 0x2000 );
 
976
                                                        memcpy(&prg[0x0a000], &prg[bank], 0x2000);
775
977
                                                }
776
978
                                        break;
777
979
                                }
779
981
                break;
780
982
 
781
983
                case 0x2000: /* mirroring */
782
 
                        if( !gboard_4screen )
 
984
                        if (!gboard_4screen)
783
985
                        {
784
 
                                if ( data & 0x40 )
785
 
                                        ppu2c0x_set_mirroring( ppu, PPU_MIRROR_HIGH );
 
986
                                if (data & 0x40)
 
987
                                        pc10_set_mirroring(PPU_MIRROR_HIGH);
786
988
                                else
787
 
                                        ppu2c0x_set_mirroring( ppu, ( data & 1 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
 
989
                                        pc10_set_mirroring((data & 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
788
990
                        }
789
991
                break;
790
992
 
801
1003
                break;
802
1004
 
803
1005
                case 0x6000: /* disable irqs */
804
 
                        ppu2c0x_set_scanline_callback( ppu, 0 );
 
1006
                        ppu2c0x_set_scanline_callback(ppu, 0);
805
1007
                break;
806
1008
 
807
1009
                case 0x6001: /* enable irqs */
808
 
                        ppu2c0x_set_scanline_callback( ppu, gboard_scanline_cb );
 
1010
                        ppu2c0x_set_scanline_callback(ppu, gboard_scanline_cb);
809
1011
                break;
810
1012
        }
811
1013
}
812
1014
 
813
1015
DRIVER_INIT( pcgboard )
814
1016
{
815
 
        UINT8 *prg = memory_region( machine, "cart" );
 
1017
        UINT8 *prg = memory_region(machine, "cart");
 
1018
        vram = NULL;
816
1019
 
817
1020
        /* We do manual banking, in case the code falls through */
818
1021
        /* Copy the initial banks */
819
 
        memcpy( &prg[0x08000], &prg[0x4c000], 0x4000 );
820
 
        memcpy( &prg[0x0c000], &prg[0x4c000], 0x4000 );
 
1022
        memcpy(&prg[0x08000], &prg[0x4c000], 0x4000);
 
1023
        memcpy(&prg[0x0c000], &prg[0x4c000], 0x4000);
821
1024
 
822
1025
        /* MMC3 mapper at writes to $8000-$ffff */
823
1026
        memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, gboard_rom_switch_w );
838
1041
 
839
1042
DRIVER_INIT( pcgboard_type2 )
840
1043
{
 
1044
        vram = NULL;
841
1045
        /* common init */
842
1046
        DRIVER_INIT_CALL(pcgboard);
843
1047
 
846
1050
}
847
1051
 
848
1052
/**********************************************************************************/
849
 
 
850
1053
/* i Board games (Captain Sky Hawk, Solar Jetman) */
851
1054
 
852
1055
static WRITE8_HANDLER( iboard_rom_switch_w )
853
1056
{
854
1057
        int bank = data & 7;
855
 
        const device_config *ppu = devtag_get_device(space->machine, "ppu");
856
 
        UINT8 *prg = memory_region( space->machine, "cart" );
 
1058
        UINT8 *prg = memory_region(space->machine, "cart");
857
1059
 
858
 
        if ( data & 0x10 )
859
 
                ppu2c0x_set_mirroring( ppu, PPU_MIRROR_HIGH );
 
1060
        if (data & 0x10)
 
1061
                pc10_set_mirroring(PPU_MIRROR_HIGH);
860
1062
        else
861
 
                ppu2c0x_set_mirroring( ppu, PPU_MIRROR_LOW );
 
1063
                pc10_set_mirroring(PPU_MIRROR_LOW);
862
1064
 
863
 
        memcpy( &prg[0x08000], &prg[bank * 0x8000 + 0x10000], 0x8000 );
 
1065
        memcpy(&prg[0x08000], &prg[bank * 0x8000 + 0x10000], 0x8000);
864
1066
}
865
1067
 
866
1068
DRIVER_INIT( pciboard )
867
1069
{
868
 
        UINT8 *prg = memory_region( machine, "cart" );
 
1070
        UINT8 *prg = memory_region(machine, "cart");
869
1071
 
870
1072
        /* We do manual banking, in case the code falls through */
871
1073
        /* Copy the initial banks */
872
 
        memcpy( &prg[0x08000], &prg[0x10000], 0x8000 );
 
1074
        memcpy(&prg[0x08000], &prg[0x10000], 0x8000);
873
1075
 
874
1076
        /* Roms are banked at $8000 to $bfff */
875
1077
        memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, iboard_rom_switch_w );
876
1078
 
877
1079
        /* common init */
878
1080
        DRIVER_INIT_CALL(playch10);
 
1081
 
 
1082
        /* allocate vram */
 
1083
        vram = auto_alloc_array(machine, UINT8, 0x2000);
 
1084
        /* special init */
 
1085
        set_videoram_bank(machine, 0, 8, 0, 8);
879
1086
}
880
1087
 
881
1088
/**********************************************************************************/
882
 
 
883
1089
/* H Board games (PinBot) */
884
1090
 
885
1091
static WRITE8_HANDLER( hboard_rom_switch_w )
886
1092
{
887
 
        const device_config *ppu = devtag_get_device(space->machine, "ppu");
888
 
 
889
 
        switch( offset & 0x7001 )
 
1093
        switch (offset & 0x7001)
890
1094
        {
891
1095
                case 0x0001:
892
1096
                        {
893
1097
                                UINT8 cmd = gboard_command & 0x07;
894
 
                                int page = ( gboard_command & 0x80 ) >> 5;
 
1098
                                int page = (gboard_command & 0x80) >> 5;
895
1099
 
896
 
                                switch( cmd )
 
1100
                                switch (cmd)
897
1101
                                {
898
1102
                                        case 0: /* char banking */
899
1103
                                        case 1: /* char banking */
900
1104
                                                data &= 0xfe;
901
 
                                                page ^= ( cmd << 1 );
902
 
                                                if ( data & 0x20 )
 
1105
                                                page ^= (cmd << 1);
 
1106
                                                if (data & 0x40)
903
1107
                                                {
904
 
                                                        ppu2c0x_set_videoram_bank( ppu, page, 2, data, 64 );
 
1108
                                                        set_videoram_bank(space->machine, page, 2, data, 1);
905
1109
                                                }
906
1110
                                                else
907
1111
                                                {
908
 
                                                        ppu2c0x_set_videorom_bank( ppu, page, 2, data, 64 );
 
1112
                                                        pc10_set_videorom_bank(space->machine, page, 2, data, 1);
909
1113
                                                }
910
1114
                                        return;
911
1115
 
914
1118
                                        case 4: /* char banking */
915
1119
                                        case 5: /* char banking */
916
1120
                                                page ^= cmd + 2;
917
 
                                                if ( data & 0x40 )
 
1121
                                                if (data & 0x40)
918
1122
                                                {
919
 
                                                        ppu2c0x_set_videoram_bank( ppu, page, 1, data, 64 );
 
1123
                                                        set_videoram_bank(space->machine, page, 1, data, 1);
920
1124
                                                }
921
1125
                                                else
922
1126
                                                {
923
 
                                                        ppu2c0x_set_videorom_bank( ppu, page, 1, data, 64 );
 
1127
                                                        pc10_set_videorom_bank(space->machine, page, 1, data, 1);
924
1128
                                                }
925
1129
                                        return;
926
1130
                                }
932
1136
 
933
1137
DRIVER_INIT( pchboard )
934
1138
{
935
 
        UINT8 *prg = memory_region( machine, "cart" );
936
 
        memcpy( &prg[0x08000], &prg[0x4c000], 0x4000 );
937
 
        memcpy( &prg[0x0c000], &prg[0x4c000], 0x4000 );
 
1139
        UINT8 *prg = memory_region(machine, "cart");
 
1140
        memcpy(&prg[0x08000], &prg[0x4c000], 0x4000);
 
1141
        memcpy(&prg[0x0c000], &prg[0x4c000], 0x4000);
938
1142
 
939
1143
        /* Roms are banked at $8000 to $bfff */
940
1144
        memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, hboard_rom_switch_w );
955
1159
}
956
1160
 
957
1161
/**********************************************************************************/
958
 
 
959
1162
/* K Board games (Mario Open Golf) */
960
1163
 
961
1164
DRIVER_INIT( pckboard )
962
1165
{
963
 
        UINT8 *prg = memory_region( machine, "cart" );
 
1166
        UINT8 *prg = memory_region(machine, "cart");
964
1167
 
965
1168
        /* We do manual banking, in case the code falls through */
966
1169
        /* Copy the initial banks */
967
 
        memcpy( &prg[0x08000], &prg[0x48000], 0x8000 );
 
1170
        memcpy(&prg[0x08000], &prg[0x48000], 0x8000);
968
1171
 
969
1172
        mmc1_rom_mask = 0x0f;
970
1173
 
977
1180
 
978
1181
        /* common init */
979
1182
        DRIVER_INIT_CALL(playch10);
 
1183
 
 
1184
        /* allocate vram */
 
1185
        vram = auto_alloc_array(machine, UINT8, 0x2000);
 
1186
        /* special init */
 
1187
        set_videoram_bank(machine, 0, 8, 0, 8);
980
1188
}