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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
        segas1x_state *state = machine.driver_data<segas1x_state>();
143
143
        address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
144
144
 
145
 
        soundlatch_w(space, 0, data & 0xff);
 
145
        state->soundlatch_byte_w(*space, 0, data & 0xff);
146
146
        device_set_input_line(state->m_soundcpu, INPUT_LINE_NMI, PULSE_LINE);
147
147
}
148
148
 
252
252
                                return state->m_misc_io_data[offset];
253
253
 
254
254
                        /* otherwise, return an input port */
255
 
                        return input_port_read(space->machine(), portnames[offset]);
 
255
                        return space->machine().root_device().ioport(portnames[offset])->read();
256
256
 
257
257
                /* 'SEGA' protection */
258
258
                case 0x10/2:
359
359
 
360
360
                /* video control latch */
361
361
                case 0x2000/2:
362
 
                        return input_port_read(space->machine(), portnames[offset & 1]);
 
362
                        return space->machine().root_device().ioport(portnames[offset & 1])->read();
363
363
        }
364
364
        if (state->m_custom_io_r)
365
365
                return state->m_custom_io_r(space, offset, mem_mask);
429
429
        /* sprite banking */
430
430
        else
431
431
        {
432
 
                int maxbanks = space->machine().region("gfx2")->bytes() / 0x40000;
 
432
                int maxbanks = space->machine().root_device().memregion("gfx2")->bytes() / 0x40000;
433
433
                if (data >= maxbanks)
434
434
                        data = 255;
435
435
                segaic16_sprites_set_bank(space->machine(), 0, (offset - 8) * 2 + 0, data * 2 + 0);
450
450
        switch (offset)
451
451
        {
452
452
                case 0x3020/2:
453
 
                        return input_port_read(space->machine(), "P3");
 
453
                        return space->machine().root_device().ioport("P3")->read();
454
454
 
455
455
                case 0x3022/2:
456
 
                        return input_port_read(space->machine(), "P4");
 
456
                        return space->machine().root_device().ioport("P4")->read();
457
457
 
458
458
                case 0x3024/2:
459
 
                        return input_port_read(space->machine(), "P34START");
 
459
                        return space->machine().root_device().ioport("P34START")->read();
460
460
        }
461
461
        return segaic16_open_bus_r(space, 0, mem_mask);
462
462
}
494
494
        switch (offset)
495
495
        {
496
496
                case 0x3010/2:
497
 
                        state->m_lghost_value = 255 - input_port_read(space->machine(), "GUNY1");
 
497
                        state->m_lghost_value = 255 - state->ioport("GUNY1")->read();
498
498
                        break;
499
499
 
500
500
                case 0x3012/2:
501
 
                        state->m_lghost_value = input_port_read(space->machine(), "GUNX1");
 
501
                        state->m_lghost_value = state->ioport("GUNX1")->read();
502
502
                        break;
503
503
 
504
504
                case 0x3014/2:
505
 
                        state->m_lghost_value = 255 - input_port_read(space->machine(), state->m_lghost_select ? "GUNY3" : "GUNY2");
 
505
                        state->m_lghost_value = 255 - state->ioport(state->m_lghost_select ? "GUNY3" : "GUNY2")->read();
506
506
                        break;
507
507
 
508
508
                case 0x3016/2:
509
 
                        state->m_lghost_value = input_port_read(space->machine(), state->m_lghost_select ? "GUNX3" : "GUNX2");
 
509
                        state->m_lghost_value = state->ioport(state->m_lghost_select ? "GUNX3" : "GUNX2")->read();
510
510
                        break;
511
511
 
512
512
                case 0x3020/2:
530
530
        switch (offset)
531
531
        {
532
532
                case 0x3000/2:
533
 
                        return (input_port_read(space->machine(), "TRACKX1") - state->m_wwally_last_x[0]) & 0xff;
 
533
                        return (state->ioport("TRACKX1")->read() - state->m_wwally_last_x[0]) & 0xff;
534
534
 
535
535
                case 0x3004/2:
536
 
                        return (input_port_read(space->machine(), "TRACKY1") - state->m_wwally_last_y[0]) & 0xff;
 
536
                        return (state->ioport("TRACKY1")->read() - state->m_wwally_last_y[0]) & 0xff;
537
537
 
538
538
                case 0x3008/2:
539
 
                        return (input_port_read(space->machine(), "TRACKX2") - state->m_wwally_last_x[1]) & 0xff;
 
539
                        return (state->ioport("TRACKX2")->read() - state->m_wwally_last_x[1]) & 0xff;
540
540
 
541
541
                case 0x300c/2:
542
 
                        return (input_port_read(space->machine(), "TRACKY2") - state->m_wwally_last_y[1]) & 0xff;
 
542
                        return (state->ioport("TRACKY2")->read() - state->m_wwally_last_y[1]) & 0xff;
543
543
 
544
544
                case 0x3010/2:
545
 
                        return (input_port_read(space->machine(), "TRACKX3") - state->m_wwally_last_x[2]) & 0xff;
 
545
                        return (state->ioport("TRACKX3")->read() - state->m_wwally_last_x[2]) & 0xff;
546
546
 
547
547
                case 0x3014/2:
548
 
                        return (input_port_read(space->machine(), "TRACKY3") - state->m_wwally_last_y[2]) & 0xff;
 
548
                        return (state->ioport("TRACKY3")->read() - state->m_wwally_last_y[2]) & 0xff;
549
549
        }
550
550
        return segaic16_open_bus_r(space, 0, mem_mask);
551
551
}
559
559
        {
560
560
                case 0x3000/2:
561
561
                case 0x3004/2:
562
 
                        state->m_wwally_last_x[0] = input_port_read(space->machine(), "TRACKX1");
563
 
                        state->m_wwally_last_y[0] = input_port_read(space->machine(), "TRACKY1");
 
562
                        state->m_wwally_last_x[0] = state->ioport("TRACKX1")->read();
 
563
                        state->m_wwally_last_y[0] = state->ioport("TRACKY1")->read();
564
564
                        break;
565
565
 
566
566
                case 0x3008/2:
567
567
                case 0x300c/2:
568
 
                        state->m_wwally_last_x[1] = input_port_read(space->machine(), "TRACKX2");
569
 
                        state->m_wwally_last_y[1] = input_port_read(space->machine(), "TRACKY2");
 
568
                        state->m_wwally_last_x[1] = state->ioport("TRACKX2")->read();
 
569
                        state->m_wwally_last_y[1] = state->ioport("TRACKY2")->read();
570
570
                        break;
571
571
 
572
572
                case 0x3010/2:
573
573
                case 0x3014/2:
574
 
                        state->m_wwally_last_x[2] = input_port_read(space->machine(), "TRACKX3");
575
 
                        state->m_wwally_last_y[2] = input_port_read(space->machine(), "TRACKY3");
 
574
                        state->m_wwally_last_x[2] = state->ioport("TRACKX3")->read();
 
575
                        state->m_wwally_last_y[2] = state->ioport("TRACKY3")->read();
576
576
                        break;
577
577
        }
578
578
}
587
587
 
588
588
static WRITE8_HANDLER( soundbank_w )
589
589
{
590
 
        memory_set_bankptr(space->machine(), "bank1", space->machine().region("soundcpu")->base() + 0x10000 + 0x2000 * data);
 
590
        space->machine().root_device().membank("bank1")->set_base(space->machine().root_device().memregion("soundcpu")->base() + 0x10000 + 0x2000 * data);
591
591
}
592
592
 
593
593
 
606
606
 *
607
607
 *************************************/
608
608
 
609
 
static ADDRESS_MAP_START( system18_map, AS_PROGRAM, 16 )
 
609
static ADDRESS_MAP_START( system18_map, AS_PROGRAM, 16, segas1x_state )
610
610
        ADDRESS_MAP_UNMAP_HIGH
611
 
        AM_RANGE(0x000000, 0xffffff) AM_READWRITE(segaic16_memory_mapper_lsb_r, segaic16_memory_mapper_lsb_w)
 
611
        AM_RANGE(0x000000, 0xffffff) AM_READWRITE_LEGACY(segaic16_memory_mapper_lsb_r, segaic16_memory_mapper_lsb_w)
612
612
ADDRESS_MAP_END
613
613
 
614
614
 
619
619
 *
620
620
 *************************************/
621
621
 
622
 
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
 
622
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segas1x_state )
623
623
        ADDRESS_MAP_UNMAP_HIGH
624
624
        AM_RANGE(0x0000, 0x9fff) AM_ROM AM_REGION("soundcpu", 0x10000)
625
625
        AM_RANGE(0xa000, 0xbfff) AM_ROMBANK("bank1")
626
 
        AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x0ff0) AM_DEVWRITE("rfsnd", rf5c68_w)
627
 
        AM_RANGE(0xd000, 0xdfff) AM_DEVREADWRITE("rfsnd", rf5c68_mem_r, rf5c68_mem_w)
 
626
        AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x0ff0) AM_DEVWRITE_LEGACY("rfsnd", rf5c68_w)
 
627
        AM_RANGE(0xd000, 0xdfff) AM_DEVREADWRITE_LEGACY("rfsnd", rf5c68_mem_r, rf5c68_mem_w)
628
628
        AM_RANGE(0xe000, 0xffff) AM_RAM
629
629
ADDRESS_MAP_END
630
630
 
631
 
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8 )
 
631
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, segas1x_state )
632
632
        ADDRESS_MAP_UNMAP_HIGH
633
633
        ADDRESS_MAP_GLOBAL_MASK(0xff)
634
 
        AM_RANGE(0x80, 0x83) AM_MIRROR(0x0c) AM_DEVREADWRITE("ym1", ym3438_r, ym3438_w)
635
 
        AM_RANGE(0x90, 0x93) AM_MIRROR(0x0c) AM_DEVREADWRITE("ym2", ym3438_r, ym3438_w)
636
 
        AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x1f) AM_WRITE(soundbank_w)
637
 
        AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x1f) AM_READWRITE(soundlatch_r, mcu_data_w)
 
634
        AM_RANGE(0x80, 0x83) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY("ym1", ym3438_r, ym3438_w)
 
635
        AM_RANGE(0x90, 0x93) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY("ym2", ym3438_r, ym3438_w)
 
636
        AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x1f) AM_WRITE_LEGACY(soundbank_w)
 
637
        AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x1f) AM_READ(soundlatch_byte_r) AM_WRITE_LEGACY(mcu_data_w)
638
638
ADDRESS_MAP_END
639
639
 
640
640
 
645
645
 *
646
646
 *************************************/
647
647
 
648
 
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8 )
 
648
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, segas1x_state )
649
649
        ADDRESS_MAP_UNMAP_HIGH
650
650
        /* port 2 not used for high order address byte */
651
 
        AM_RANGE(0x0000, 0x001f) AM_MIRROR(0xff00) AM_READWRITE(segaic16_memory_mapper_r, segaic16_memory_mapper_w)
 
651
        AM_RANGE(0x0000, 0x001f) AM_MIRROR(0xff00) AM_READWRITE_LEGACY(segaic16_memory_mapper_r, segaic16_memory_mapper_w)
652
652
ADDRESS_MAP_END
653
653
 
654
654
 
1461
1461
    Clutch Hitter, Sega System 18
1462
1462
    CPU: FD1094 (317-0176)
1463
1463
    ROM Board: 171-5873B
 
1464
 
 
1465
    game No. 833-7916-01 CLUTCH HITTER
 
1466
    rom  No. 834-7917-01
1464
1467
*/
1465
1468
ROM_START( cltchitr )
1466
1469
        ROM_REGION( 0x300000, "maincpu", 0 ) /* 68000 code */
2095
2098
    Shadow Dancer, Sega System 18
2096
2099
    CPU: 68000
2097
2100
    ROM Board: 171-5873B
 
2101
 
 
2102
    game No. 833-7246-01
 
2103
    pcb  No. 837-7248
 
2104
    rom  No. 834-7247-01
2098
2105
*/
2099
2106
ROM_START( shdancer1 )
2100
2107
        ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */