~ubuntu-branches/ubuntu/precise/mame/precise-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Cesare Falco
  • Date: 2011-11-30 18:50:10 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111130185010-02hcxybht1mn082w
Tags: 0.144-0ubuntu1
* New upstream release (LP: #913550)
* mame.install:
  - Added artwork/ images to be used with -effect switch
  - Be more selective with hash/ contents
* contrib/mame.ini: added /usr/share/games/mame/artwork/ to artpath

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
Sprite/tile priority bad.
167
167
 
168
168
After demo game in attract, palette seems too dark for a while.
169
 
Palette corruption has occured with areas not restored after a fade.
 
169
Palette corruption has occurred with areas not restored after a fade.
170
170
Don't know why. (Perhaps 68000 relies on feedback from co-processor
171
171
in determining what parts of palette ram to write... but this would
172
172
then be fixed by hookup of 32025 core, which it isn't.)
256
256
 
257
257
        if (ACCESSING_BITS_8_15 && ACCESSING_BITS_0_7)
258
258
                state->m_line_ram[offset] = data;
 
259
 
 
260
        //if(offset == 0x3fff)
 
261
        //  printf("LineRAM go %d\n",(int)space->machine().primary_screen->frame_number());
259
262
}
260
263
 
261
264
static READ16_HANDLER( dspram_r )
300
303
        palette_set_color_rgb(space->machine(), offset, pal4bit(a >> 0), pal4bit(a >> 5), pal4bit(a >> 10));
301
304
}
302
305
 
 
306
static WRITE16_HANDLER( airsys_gradram_w )
 
307
{
 
308
        taitoair_state *state = space->machine().driver_data<taitoair_state>();
 
309
        UINT32 pen;
 
310
        int r,g,b;
 
311
        //int pal_r,pal_g,pal_b;
 
312
 
 
313
        COMBINE_DATA(&state->m_gradram[offset]);
 
314
        offset &= 0x1fff;
 
315
 
 
316
        pen = (state->m_gradram[offset])|(state->m_gradram[(offset+0x2000)]<<16);
 
317
        /* TODO: correct? */
 
318
        r = (pen & 0x00007f) >> 0;
 
319
        g = (pen & 0x007f00) >> (8);
 
320
        b = (pen & 0x7f0000) >> (16);
 
321
 
 
322
        r = (r << 1) | (r & 1);
 
323
        g = (g << 1) | (g & 1);
 
324
        b = (b << 1) | (b & 1);
 
325
 
 
326
        /* TODO: I'm sure that normal paletteram and gradiation ram mixes in some way ... */
 
327
        //pal_r = ((state->m_paletteram[(offset >> 7) + 0x300] & 0x000f) >> 0) * 0x11;
 
328
        //pal_g = ((state->m_paletteram[(offset >> 7) + 0x300] & 0x01e0) >> 5) * 0x11;
 
329
        //pal_b = ((state->m_paletteram[(offset >> 7) + 0x300] & 0x7c00) >> 10) * 0x11;
 
330
 
 
331
        //if(r == 0) { r = (pal_r); }
 
332
        //if(g == 0) { g = (pal_g); }
 
333
        //if(b == 0) { b = (pal_b); }
 
334
 
 
335
        palette_set_color_rgb(space->machine(), offset+0x2000, r, g, b);
 
336
}
 
337
 
303
338
 
304
339
/***********************************************************
305
340
                INPUTS
320
355
                        return input_port_read(space->machine(), STICK2_PORT_TAG);
321
356
 
322
357
                case 0x02:      /* "counter 1" hi */
323
 
                        return (input_port_read(space->machine(), STICK1_PORT_TAG) & 0xff00) >> 8;
 
358
                        if(input_port_read(space->machine(), STICK1_PORT_TAG) & 0x80)
 
359
                                return 0xff;
 
360
 
 
361
                        return 0;
324
362
 
325
363
                case 0x03:      /* "counter 2" hi */
326
364
                        return (input_port_read(space->machine(), STICK2_PORT_TAG) & 0xff00) >> 8;
368
406
        AM_RANGE(0x000000, 0x0bffff) AM_ROM
369
407
        AM_RANGE(0x0c0000, 0x0cffff) AM_RAM AM_BASE_MEMBER(taitoair_state, m_m68000_mainram)
370
408
        AM_RANGE(0x140000, 0x140001) AM_WRITE(system_control_w) /* Pause the TMS32025 */
371
 
        AM_RANGE(0x180000, 0x183fff) AM_RAM                             /* "gradiation ram (0)" */
372
 
        AM_RANGE(0x184000, 0x187fff) AM_RAM                             /* "gradiation ram (1)" */
373
 
        AM_RANGE(0x188000, 0x18bfff) AM_RAM_WRITE(airsys_paletteram16_w) AM_BASE_MEMBER(taitoair_state, m_paletteram)
 
409
        AM_RANGE(0x180000, 0x187fff) AM_RAM_WRITE(airsys_gradram_w) AM_BASE_MEMBER(taitoair_state, m_gradram)                           /* "gradiation ram (0/1)" */
 
410
        AM_RANGE(0x188000, 0x189fff) AM_MIRROR(0x2000) AM_RAM_WRITE(airsys_paletteram16_w) AM_BASE_MEMBER(taitoair_state, m_paletteram)
374
411
        AM_RANGE(0x800000, 0x820fff) AM_DEVREADWRITE("tc0080vco", tc0080vco_word_r, tc0080vco_word_w)   /* tilemaps, sprites */
 
412
        AM_RANGE(0x906000, 0x906007) AM_RAM // DMA?
375
413
        AM_RANGE(0x908000, 0x90ffff) AM_RAM AM_BASE_MEMBER(taitoair_state, m_line_ram)  /* "line ram" */
376
414
        AM_RANGE(0x910000, 0x91ffff) AM_RAM     AM_BASE_MEMBER(taitoair_state, m_dsp_ram)       /* "dsp common ram" (TMS320C25) */
 
415
        AM_RANGE(0x980000, 0x98000f) AM_RAM AM_BASE_MEMBER(taitoair_state, m_backregs)
377
416
        AM_RANGE(0xa00000, 0xa00007) AM_READ(stick_input_r)
378
417
        AM_RANGE(0xa00100, 0xa00107) AM_READ(stick2_input_r)
379
418
        AM_RANGE(0xa00200, 0xa0020f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)    /* other I/O */
399
438
ADDRESS_MAP_END
400
439
 
401
440
/********************************** TMS32025 ********************************/
 
441
 
 
442
/*
 
443
Air Inferno:
 
444
 
 
445
write to 0x3404 - almost always 0x00fd / 0xff38  (253, -200)
 
446
write to 0x3408 /
 
447
 
 
448
write to 0x341b - May not be numeric - it's weird.  stays stable,
 
449
                  then freaks out just before "quad: unknown value 0066"
 
450
                  This function seems to break things up into different polygon
 
451
                  'classes'
 
452
 
 
453
write to 0x3418 - X value
 
454
write to 0x3419 - Y value
 
455
write to 0x341a - Z value
 
456
read to 0x341b, puts data to internal RAM 0x380 - 0x384 - 0x388 - 0x38c
 
457
 
 
458
checks 0x341c - if != to 0 then skip ... ?
 
459
checks 0x341d - if == to 0 then skip ... ?
 
460
 
 
461
write to 0x3405 ; X value
 
462
write to 0x3409 ; Y value
 
463
write to 0x3406 ; Z value
 
464
write to 0x340a ; Z value
 
465
read to 0x340b, puts to line RAM (y) with offset + 0x160
 
466
read to 0x3407, puts to line RAM (x) with offset + 0x5d
 
467
 
 
468
*/
 
469
 
402
470
static ADDRESS_MAP_START( DSP_map_program, AS_PROGRAM, 16 )
403
471
        AM_RANGE(0x0000, 0x1fff) AM_ROM
404
472
ADDRESS_MAP_END
405
473
 
406
474
static ADDRESS_MAP_START( DSP_map_data, AS_DATA, 16 )
 
475
        AM_RANGE(0x2003, 0x2003) AM_READNOP //bit 0 DMA status flag or vblank
 
476
        AM_RANGE(0x3000, 0x3002) AM_WRITE(dsp_flags_w)
 
477
        AM_RANGE(0x3404, 0x3404) AM_WRITE(dsp_frustum_left_w)
 
478
        AM_RANGE(0x3405, 0x3405) AM_WRITE(dsp_x_eyecoord_w)
 
479
        AM_RANGE(0x3406, 0x3406) AM_WRITE(dsp_z_eyecoord_w)
 
480
        AM_RANGE(0x3407, 0x3407) AM_READ(dsp_x_return_r)
 
481
        AM_RANGE(0x3408, 0x3408) AM_WRITE(dsp_frustum_bottom_w)
 
482
        AM_RANGE(0x3409, 0x3409) AM_WRITE(dsp_y_eyecoord_w)
 
483
        AM_RANGE(0x340a, 0x340a) AM_WRITE(dsp_rasterize_w)      /* Just a (lame) guess */
 
484
        AM_RANGE(0x340b, 0x340b) AM_READ(dsp_y_return_r)
 
485
//  AM_RANGE(0x3418, 0x341a) AM_WRITE(dsp_sqrt_w)
 
486
//  AM_RANGE(0x341b, 0x341b) AM_WRITE(dsp_sqrt_r)
 
487
//  AM_RANGE(0x341c, 0x341c) AM_READ(dsp_sqrt_flags1_r)
 
488
//  AM_RANGE(0x341d, 0x341d) AM_READ(dsp_sqrt_flags2_r)
407
489
        AM_RANGE(0x4000, 0x7fff) AM_READWRITE(lineram_r, lineram_w)
408
490
        AM_RANGE(0x8000, 0xffff) AM_READWRITE(dspram_r, dspram_w)
409
491
ADDRESS_MAP_END
453
535
        PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
454
536
        PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
455
537
        PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
456
 
        PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F1)
 
538
        PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) // DMA status flag
457
539
        PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
458
540
 
459
541
        PORT_START("IN2")
460
542
        PORT_BIT( 0xff, IP_ACTIVE_LOW,  IPT_UNUSED )
461
543
 
462
 
        /* The range of these sticks reflects the range test mode displays.
463
 
       Eventually we want standard 0-0xff input range and a scale-up later
464
 
       in the stick_r routines.  And fake DSW with self-centering option
465
 
       to make keyboard control feasible! */
466
 
 
467
544
        PORT_START(STICK1_PORT_TAG)
468
 
        PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0xf800,0x7ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1)
 
545
        PORT_BIT( 0x00ff, 0x0000, IPT_AD_STICK_Z ) PORT_MINMAX(0x0080,0x007f) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1) PORT_REVERSE
469
546
 
470
547
        PORT_START(STICK2_PORT_TAG)
471
 
        PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0xf800,0x7ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1)
 
548
        PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0xf800,0x07ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1)
472
549
 
473
550
        PORT_START(STICK3_PORT_TAG)
474
 
        PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0xf800,0x7ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(2)
 
551
        PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0xf800,0x07ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1)
475
552
INPUT_PORTS_END
476
553
 
477
554
static INPUT_PORTS_START( ainferno )
518
595
        PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_BUTTON4 ) PORT_PLAYER(1)    /* fire */
519
596
        PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_BUTTON6 ) PORT_PLAYER(1)    /* pedal r */
520
597
        PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_BUTTON5 ) PORT_PLAYER(1)    /* pedal l */
521
 
        PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F1)
 
598
        PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) // DMA status flag
522
599
        PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
523
600
 
524
601
        PORT_START("IN2")
525
602
        PORT_BIT( 0xff, IP_ACTIVE_LOW,  IPT_UNUSED )
526
603
 
527
 
        /* The range of these sticks reflects the range test mode displays.
528
 
       Eventually we want standard 0-0xff input range and a scale-up later
529
 
       in the stick_r routines. And fake DSW with self-centering option
530
 
       to make keyboard control feasible! */
531
 
 
532
604
        PORT_START(STICK1_PORT_TAG)
 
605
        PORT_BIT( 0x00ff, 0x0000, IPT_AD_STICK_Z ) PORT_MINMAX(0x0080,0x007f) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1) PORT_REVERSE
 
606
 
 
607
        PORT_START(STICK2_PORT_TAG)
533
608
        PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0xf800,0x7ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1)
534
609
 
535
 
        PORT_START(STICK2_PORT_TAG)
 
610
        PORT_START(STICK3_PORT_TAG)
536
611
        PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0xf800,0x7ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1)
537
 
 
538
 
        PORT_START(STICK3_PORT_TAG)
539
 
        PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0xf800,0x7ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(2)
540
612
INPUT_PORTS_END
541
613
 
542
614
 
658
730
        MCFG_CPU_DATA_MAP(DSP_map_data)
659
731
        MCFG_CPU_IO_MAP(DSP_map_io)
660
732
 
661
 
        MCFG_QUANTUM_TIME(attotime::from_hz(600))
 
733
        MCFG_QUANTUM_PERFECT_CPU("maincpu")
662
734
 
663
735
        MCFG_MACHINE_START(taitoair)
664
736
        MCFG_MACHINE_RESET(taitoair)
673
745
        MCFG_SCREEN_SIZE(64*16, 64*16)
674
746
        MCFG_SCREEN_VISIBLE_AREA(0*16, 32*16-1, 3*16, 28*16-1)
675
747
        MCFG_SCREEN_UPDATE(taitoair)
 
748
        MCFG_VIDEO_START(taitoair);
676
749
 
677
750
        MCFG_GFXDECODE(airsys)
678
 
        MCFG_PALETTE_LENGTH(512*16)
 
751
        MCFG_PALETTE_LENGTH(512*16+512*16)
 
752
        MCFG_PALETTE_INIT(all_black)
679
753
 
680
754
        MCFG_TC0080VCO_ADD("tc0080vco", airsys_tc0080vco_intf)
681
755