| Previous | 15994 Revisions | Next |
| r4185 Friday 23rd January, 2009 at 03:20:23 UTC by Nathan Woods |
|---|
| Updated to MAME 0.129u2 core |
| [docs] | messnew.txt |
| [src/emu] | cpuexec.c devintrf.c devintrf.h mamecore.h memory.c memory.h romload.c romload.h sndintrf.c sndintrf.h sound.c state.c timer.c video.c |
| [src/emu/cpu] | drcfe.c drcfe.h |
| [src/emu/cpu/i860] | i860dec.c |
| [src/emu/cpu/mips] | mips3drc.c mips3fe.c |
| [src/emu/cpu/powerpc] | ppcdrc.c ppcfe.c |
| [src/emu/cpu/sh2] | sh2comn.h sh2drc.c sh2fe.c |
| [src/emu/cpu/z8000] | z8000cpu.h |
| [src/emu/debug] | debugvw.c express.c |
| [src/emu/drivers] | xtal.h |
| [src/emu/machine] | 6522via.c 6526cia.c 6532riot.c 6821new.c 6850acia.c 68681.c 74123.c 8237dma.c 8255ppi.c 8257dma.c at28c16.c cdp1852.c f3853.c i8243.c idectrl.c latch8.c ldcore.c msm6242.c pci.c pic8259.c pit8253.c smc91c9x.c timekpr.c x2212.c z80ctc.c z80dma.c z80pio.c z80sio.c |
| [src/emu/sound] | 2151intf.c 2203intf.c 2413intf.c 2608intf.c 2610intf.c 2612intf.c 262intf.c 3812intf.c 5110intf.c 5220intf.c aica.c astrocde.c ay8910.c ay8910.h beep.c bsmt2000.c c140.c c352.c c6280.c cdda.c cdp1869.c cem3394.c custom.c dac.c digitalk.c discrete.c dmadac.c es5503.c es5506.c es8712.c flt_rc.c flt_vol.c gaelco.c hc55516.c ics2115.c iremga20.c k005289.c k007232.c k051649.c k053260.c k054539.c msm5205.c msm5232.c multipcm.c n63701x.c namco.c namco52.c nes_apu.c nile.c okim6258.c okim6295.c okim6376.c pokey.c psx.c qsound.c rf5c400.c rf5c68.c s14001a.c saa1099.c samples.c scsp.c segapcm.c sid6581.c sn76477.c sn76496.c snkwave.c sp0250.c sp0256.c speaker.c st0016.c tiaintf.c tms3615.c tms36xx.c upd7759.c vlm5030.c votrax.c vrender0.c wave.c wavwrite.c x1_010.c ymf271.c ymf278b.c ymz280b.c |
| [src/emu/video] | cdp1869.c mc6845.c voodoo.c |
| [src/mame] | mame.mak mamedriv.c |
| [src/mame/drivers] | adp.c cb2001.c cloak.c cps3.c cvs.c dbz.c drw80pkr.c esripsys.c genesis.c goodejan.c gstream.c gticlub.c guab.c hanaroku.c himesiki.c* igspoker.c* jackie.c* jantotsu.c konamigx.c m92.c micro3d.c model2.c model3.c mystwarr.c nemesis.c progolf.c rungun.c segaybd.c seibuspi.c sengokmj.c sothello.c* srmp5.c stepstag.c ultrsprt.c vcombat.c yunsung8.c zr107.c |
| [src/mame/includes] | cvs.h sei_crtc.h* |
| [src/mame/layout] | igspoker.lay* stepstag.lay* |
| [src/mame/machine] | decocass.c decocrpt.c n64.c naomibd.c |
| [src/mame/video] | atari.c cloak.c genesis.c harddriv.c himesiki.c* midzeus.c namcona1.c namcos22.c psx.c segas32.c sei_crtc.c* taito_f3.c |
| [src/mess] | device.c mess.mak |
| [src/mess/audio] | cdp1863.c lmc1992.c mea8000.c |
| [src/mess/devices] | appldriv.c basicdsk.c bitbngr.c cartslot.c cassette.c chd_cd.c coco_vhd.c dsk.c harddriv.c kermit.c mflopimg.c microdrv.c printer.c snapquik.c xmodem.c |
| [src/mess/drivers] | a2600.c apexc.c einstein.c gamepock.c newbrain.c |
| [src/mess/formats] | thom_dsk.c |
| [src/mess/machine] | 6525tpi.c 6530miot.c 6551.c 6883sam.c 68901mfp.c 74145.c 8530scc.c 990_tap.c a7800.c abc77.c abc99.c adc080x.c amigafdc.c ap2_lang.c ap2_slot.c applefdc.c at45dbxx.c ay31015.c c64.c cbmdrive.c cdp1871.c conkort.c d88.c ds1315.c e0516.c gamecom.c gb.c hd63450.c hp48.c i8271.c ins8154.c ins8250.c intv.c mc68328.c mc6843.c mc6846.c mc6854.c mm58274c.c mockngbd.c msm8251.c nc.c ncr5380.c nec765.c nes.c oric.c osborne1.c pcf8593.c pdp1.c pokemini.c rp5c15.c serial.c smartmed.c sms.c sst39vfx.c svi318.c tc8521.c thomson.c ti85.c ti99_4x.c tms5501.c tms9901.c tms9902.c tx0.c upd7002.c vc20.c wd17xx.c wswan.c x68k_hdc.c z80dart.c zx8302.c |
| [src/mess/video] | cdp1861.c cdp1862.c cdp1864.c crtc_ega.c dl1416.c i8275.c msm6255.c zx8301.c |
| r4184 | r4185 | |
|---|---|---|
| 2128 | 2128 | /* fetch the data pointer */ |
| 2129 | 2129 | tape->timer = timer_alloc(device->machine, tape_clock_callback, (void *)device); |
| 2130 | 2130 | if (device->region == NULL) |
| 2131 | return | |
| 2131 | return | |
| 2132 | 2132 | |
| 2133 | 2133 | /* scan for the first non-empty block in the image */ |
| 2134 | 2134 | for (offs = device->regionbytes - 1; offs >= 0; offs--) |
| r4184 | r4185 | |
| 2161 | 2161 | state_save_register_device_item(device, 0, tape->speed); |
| 2162 | 2162 | state_save_register_device_item(device, 0, tape->bitnum); |
| 2163 | 2163 | state_save_register_device_item(device, 0, tape->clockpos); |
| 2164 | ||
| 2165 | return DEVICE_START_OK; | |
| 2166 | 2164 | } |
| 2167 | 2165 | |
| 2168 | 2166 |
| r4184 | r4185 | |
|---|---|---|
| 7 | 7 | #include "includes/n64.h" |
| 8 | 8 | #include "sound/dmadac.h" |
| 9 | 9 | |
| 10 | #ifdef LSB_FIRST | |
| 11 | #define BYTE_ADDR_XOR 3 | |
| 12 | #define WORD_ADDR_XOR 1 | |
| 13 | #else | |
| 14 | #define BYTE_ADDR_XOR 0 | |
| 15 | #define WORD_ADDR_XOR 0 | |
| 16 | #endif | |
| 17 | ||
| 18 | 10 | UINT32 *rdram; |
| 19 | 11 | UINT32 *rsp_imem; |
| 20 | 12 | UINT32 *rsp_dmem; |
| r4184 | r4185 | |
|---|---|---|
| 538 | 538 | |
| 539 | 539 | /* register for save states */ |
| 540 | 540 | init_save_state(device); |
| 541 | ||
| 542 | return DEVICE_START_OK; | |
| 543 | 541 | } |
| 544 | 542 | |
| 545 | 543 |
| r4184 | r4185 | |
|---|---|---|
| 605 | 605 | UINT16 *buffer = malloc_or_die(len*2); |
| 606 | 606 | int i; |
| 607 | 607 | |
| 608 | #ifdef LSB_FIRST | |
| 609 | 608 | /* we work on 16-bit words but data is loaded as 8-bit, so swap bytes on LSB machines */ |
| 610 | for (i = 0;i < len;i++) | |
| 611 | { | |
| 612 | rom[i] = (rom[i] >> 8) | (rom[i] << 8); | |
| 613 | } | |
| 614 | #endif | |
| 609 | if (ENDIANNESS_NATIVE == ENDIANNESS_LITTLE) | |
| 610 | for (i = 0;i < len;i++) | |
| 611 | rom[i] = BIG_ENDIANIZE_INT16(rom[i]); | |
| 615 | 612 | |
| 616 | 613 | memcpy(buffer,rom,len*2); |
| 617 | 614 | |
| r4184 | r4185 | |
| 644 | 641 | |
| 645 | 642 | free(buffer); |
| 646 | 643 | |
| 647 | #ifdef LSB_FIRST | |
| 648 | 644 | /* we work on 16-bit words but data is loaded as 8-bit, so swap bytes on LSB machines */ |
| 649 | for (i = 0;i < len;i++) | |
| 650 | { | |
| 651 | rom[i] = (rom[i] >> 8) | (rom[i] << 8); | |
| 652 | } | |
| 653 | #endif | |
| 645 | if (ENDIANNESS_NATIVE == ENDIANNESS_LITTLE) | |
| 646 | for (i = 0;i < len;i++) | |
| 647 | rom[i] = BIG_ENDIANIZE_INT16(rom[i]); | |
| 654 | 648 | } |
| 655 | 649 | |
| 656 | 650 | void deco56_decrypt_gfx(running_machine *machine, const char *tag) |
| r4184 | r4185 | |
|---|---|---|
| 3937 | 3937 | DRIVER( waverunr ) /* 1996 */ |
| 3938 | 3938 | DRIVER( hotd ) /* 1997 */ |
| 3939 | 3939 | DRIVER( overrev ) /* 1997 */ |
| 3940 | DRIVER( segawski ) /* 1997 */ | |
| 3940 | 3941 | DRIVER( topskatr ) /* 1997 */ |
| 3941 | 3942 | DRIVER( topskatu ) /* 1997 */ |
| 3942 | 3943 | DRIVER( bel ) /* 1998 */ |
| r4184 | r4185 | |
| 6500 | 6501 | DRIVER( rdft2a2 ) /* (c) 1997 Seibu Kaihatsu (Dream Island license) */ |
| 6501 | 6502 | DRIVER( rdft2j ) /* (c) 1997 Seibu Kaihatsu */ |
| 6502 | 6503 | DRIVER( rdft2t ) /* (c) 1997 Seibu Kaihatsu */ |
| 6504 | DRIVER( rdft2u ) /* (c) 1997 Seibu Kaihatsu (Fabtek license) */ | |
| 6503 | 6505 | DRIVER( rdft2us ) /* (c) 1997 Seibu Kaihatsu (Fabtek license) */ |
| 6504 | 6506 | DRIVER( rdft22kc ) /* (c) 2000 Seibu Kaihatsu */ |
| 6505 | 6507 | |
| r4184 | r4185 | |
| 6579 | 6581 | DRIVER( teplus2j ) /* (c) 1997 Jaleco */ |
| 6580 | 6582 | DRIVER( nndmseal ) /* (c) 1997 I'Max/Jaleco */ |
| 6581 | 6583 | DRIVER( stepstag ) /* (c) 1999 Jaleco */ |
| 6584 | DRIVER( step3 ) /* (c) 1999 Jaleco */ | |
| 6582 | 6585 | DRIVER( rockn ) /* (c) 1999 Jaleco */ |
| 6583 | 6586 | DRIVER( rockna ) /* (c) 1999 Jaleco */ |
| 6584 | 6587 | DRIVER( rockn2 ) /* (c) 1999 Jaleco */ |
| r4184 | r4185 | |
| 7269 | 7272 | DRIVER( madball ) /* (c) 1998 Yun Sung */ |
| 7270 | 7273 | DRIVER( madballn ) /* (c) 1998 Yun Sung */ |
| 7271 | 7274 | DRIVER( cannball ) /* (c) 1995 Yun Sung / Soft Visio */ |
| 7275 | DRIVER( cannbalv ) /* (c) 1995 Yun Sung / T&K */ | |
| 7272 | 7276 | DRIVER( magix ) /* (c) 1995 Yun Sung */ |
| 7273 | 7277 | DRIVER( rocktris ) /* (c) 1994? Yun Sung */ |
| 7274 | 7278 | DRIVER( magicbub ) /* (c) Yun Sung */ |
| r4184 | r4185 | |
| 7455 | 7459 | DRIVER( cpokert ) /* (c) 1993? Tuning */ |
| 7456 | 7460 | DRIVER( csk227it ) /* (c) 198? IGS */ |
| 7457 | 7461 | DRIVER( csk234it ) /* (c) 198? IGS */ |
| 7462 | DRIVER( igs_ncs ) /* (c) 198? IGS */ | |
| 7463 | DRIVER( igs_ncs2 ) /* (c) 2000 IGS */ | |
| 7458 | 7464 | DRIVER( jackie ) /* (c) 199? IGS */ |
| 7459 | 7465 | DRIVER( stellecu ) /* (c) 1998 */ |
| 7460 | 7466 | DRIVER( iqblock ) /* (c) 1993 */ |
| r4184 | r4185 | |
| 7493 | 7499 | DRIVER( slqz2 ) /* (c) 1998 */ |
| 7494 | 7500 | DRIVER( sdmg2 ) /* (c) 1997 */ |
| 7495 | 7501 | |
| 7496 | DRIVER( igs_ncs ) /* (c) 2000 */ | |
| 7497 | ||
| 7498 | 7502 | DRIVER( bigd2 ) /* (c) 2000 */ |
| 7499 | 7503 | DRIVER( sdwx ) /* (c) 2002 */ |
| 7500 | 7504 | DRIVER( sddz ) /* (c) 200? */ |
| r4184 | r4185 | |
| 8052 | 8056 | DRIVER( fredmemc ) /* (c) 1994 Coastal Amusements */ |
| 8053 | 8057 | DRIVER( fredmesp ) /* (c) 1994 Coastal Amusements */ |
| 8054 | 8058 | DRIVER( cecmatch ) /* (c) 1993 Coastal Amusements */ |
| 8055 | DRIVER( f15se ) /* (c) 1991 Microprose */ | |
| 8056 | DRIVER( f15se21 ) /* (c) 1991 Microprose */ | |
| 8057 | DRIVER( botss ) /* (c) 1992 Microprose */ | |
| 8058 | DRIVER( stankatk ) /* (c) 1992 Microprose */ | |
| 8059 | DRIVER( f15se ) /* (c) 1991 Microprose Games Inc. */ | |
| 8060 | DRIVER( f15se21 ) /* (c) 1991 Microprose Games Inc. */ | |
| 8061 | DRIVER( botss ) /* (c) 1992 Microprose Games Inc. */ | |
| 8062 | DRIVER( stankatk ) /* (c) 1992 Microprose Games Inc. */ | |
| 8059 | 8063 | DRIVER( dynadice ) /* ? */ |
| 8060 | 8064 | DRIVER( ssingles ) /* Yachiyo? */ |
| 8061 | 8065 | DRIVER( tcl ) /* (c) 1995 Uniwang */ |
| 8066 | DRIVER( sothello ) /* (c) 1986 Success / Fujiwara */ | |
| 8062 | 8067 | |
| 8063 | 8068 | /* Multi Amenity Cassette System */ |
| 8064 | 8069 | DRIVER( macsbios ) |
| r4184 | r4185 | |
| 8436 | 8441 | DRIVER( blazlaz ) /* (c) 1989 Hudson Soft */ |
| 8437 | 8442 | DRIVER( paranoia ) /* (c) 1990 Naxat Soft */ |
| 8438 | 8443 | DRIVER( vcombat ) /* (c) 1993 VR8 Inc. */ |
| 8439 | DRIVER( shadfgtr ) /* (c) 19 | |
| 8444 | DRIVER( shadfgtr ) /* (c) 19 | |
| 8440 | 8445 | DRIVER( blackt96 ) /* (c) 1996 D.G.R.M. of Korea */ |
| 8441 | 8446 | DRIVER( magictg ) /* (c) 199? Acclaim */ |
| 8442 | 8447 | DRIVER( magictga ) /* (c) 199? Acclaim */ |
| r4184 | r4185 | |
| 8548 | 8553 | DRIVER( buster ) /* (c) 1987 Marian Electronics Ltd. */ |
| 8549 | 8554 | DRIVER( spielbud ) /* (c) 1985 ADP */ |
| 8550 | 8555 | |
| 8556 | /* Hi-Soft */ | |
| 8557 | DRIVER( himesiki ) /* (c) 1989 Hi-Soft */ | |
| 8558 | ||
| 8551 | 8559 | #endif /* DRIVER_RECURSIVE */ |
| r4184 | r4185 | |
|---|---|---|
| 15 | 15 | extern UINT8 *cvs_video_ram; |
| 16 | 16 | extern UINT8 *cvs_bullet_ram; |
| 17 | 17 | extern UINT8 *cvs_palette_ram; |
| 18 | extern UINT8 *cvs_character_ram; | |
| 19 | 18 | extern UINT8 *cvs_s2636_0_ram; |
| 20 | 19 | extern UINT8 *cvs_s2636_1_ram; |
| 21 | 20 | extern UINT8 *cvs_s2636_2_ram; |
| r0 | r4185 | |
|---|---|---|
| 1 | /*----------- defined in video -----------*/ | |
| 2 | ||
| 3 | extern UINT16 *seibucrtc_sc0vram,*seibucrtc_sc1vram,*seibucrtc_sc2vram,*seibucrtc_sc3vram; | |
| 4 | extern UINT16 *seibucrtc_vregs; | |
| 5 | extern UINT16 seibucrtc_sc0bank; | |
| 6 | ||
| 7 | /*----------- defined in drivers -----------*/ | |
| 8 | ||
| 9 | WRITE16_HANDLER( seibucrtc_sc0vram_w ); | |
| 10 | WRITE16_HANDLER( seibucrtc_sc1vram_w ); | |
| 11 | WRITE16_HANDLER( seibucrtc_sc2vram_w ); | |
| 12 | WRITE16_HANDLER( seibucrtc_sc3vram_w ); | |
| 13 | WRITE16_HANDLER( seibucrtc_vregs_w ); | |
| 14 | void seibucrtc_sc0bank_w(UINT16 data); | |
| 15 | VIDEO_START( seibu_crtc ); | |
| 16 | VIDEO_UPDATE( seibu_crtc ); |
| r4184 | r4185 | |
|---|---|---|
| 750 | 750 | $(DRIVERS)/getrivia.o \ |
| 751 | 751 | |
| 752 | 752 | $(MAMEOBJ)/igs.a: \ |
| 753 | $(DRIVERS)/csk.o $(VIDEO)/csk.o \ | |
| 754 | 753 | $(DRIVERS)/ddz.o \ |
| 755 | 754 | $(DRIVERS)/dunhuang.o \ |
| 756 | 755 | $(DRIVERS)/goldstar.o $(VIDEO)/goldstar.o \ |
| 756 | $(DRIVERS)/jackie.o \ | |
| 757 | $(DRIVERS)/igspoker.o \ | |
| 757 | 758 | $(DRIVERS)/igs009.o \ |
| 758 | 759 | $(DRIVERS)/igs_blit.o \ |
| 759 | 760 | $(DRIVERS)/igs017.o \ |
| 760 | 761 | $(DRIVERS)/igs_m027.o \ |
| 761 | 762 | $(DRIVERS)/igs_m68.o \ |
| 762 | $(DRIVERS)/igs_ncs.o \ | |
| 763 | 763 | $(DRIVERS)/iqblock.o $(VIDEO)/iqblock.o \ |
| 764 | 764 | $(DRIVERS)/lordgun.o $(VIDEO)/lordgun.o \ |
| 765 | 765 | $(DRIVERS)/pgm.o $(VIDEO)/pgm.o \ |
| r4184 | r4185 | |
| 1222 | 1222 | $(DRIVERS)/dcon.o $(VIDEO)/dcon.o \ |
| 1223 | 1223 | $(DRIVERS)/deadang.o $(VIDEO)/deadang.o \ |
| 1224 | 1224 | $(DRIVERS)/dynduke.o $(VIDEO)/dynduke.o \ |
| 1225 | $(DRIVERS)/goodejan.o $(VIDEO)/goodejan.o \ | |
| 1226 | 1225 | $(DRIVERS)/kncljoe.o $(VIDEO)/kncljoe.o \ |
| 1227 | 1226 | $(DRIVERS)/mustache.o $(VIDEO)/mustache.o \ |
| 1228 | 1227 | $(DRIVERS)/panicr.o \ |
| 1229 | 1228 | $(DRIVERS)/raiden.o $(VIDEO)/raiden.o \ |
| 1230 | 1229 | $(DRIVERS)/raiden2.o $(MACHINE)/r2crypt.o \ |
| 1231 | 1230 | $(DRIVERS)/seibuspi.o $(MACHINE)/seibuspi.o $(VIDEO)/seibuspi.o \ |
| 1232 | $(DRIVERS)/sengokmj.o $(VIDEO)/sengokmj.o \ | |
| 1231 | $(VIDEO)/sei_crtc.o \ | |
| 1232 | $(DRIVERS)/sengokmj.o \ | |
| 1233 | $(DRIVERS)/goodejan.o \ | |
| 1233 | 1234 | $(DRIVERS)/stfight.o $(MACHINE)/stfight.o $(VIDEO)/stfight.o \ |
| 1234 | 1235 | $(DRIVERS)/wiz.o $(VIDEO)/wiz.o \ |
| 1235 | 1236 | $(MACHINE)/spisprit.o \ |
| r4184 | r4185 | |
| 1578 | 1579 | $(DRIVERS)/gunpey.o \ |
| 1579 | 1580 | $(DRIVERS)/hexa.o $(VIDEO)/hexa.o \ |
| 1580 | 1581 | $(DRIVERS)/highvdeo.o \ |
| 1582 | $(DRIVERS)/himesiki.o $(VIDEO)/himesiki.o \ | |
| 1581 | 1583 | $(DRIVERS)/homedata.o $(VIDEO)/homedata.o \ |
| 1582 | 1584 | $(DRIVERS)/hotblock.o \ |
| 1583 | 1585 | $(DRIVERS)/ilpag.o \ |
| r4184 | r4185 | |
| 1644 | 1646 | $(DRIVERS)/slotcarn.o \ |
| 1645 | 1647 | $(DRIVERS)/sms.o \ |
| 1646 | 1648 | $(DRIVERS)/snookr10.o $(VIDEO)/snookr10.o \ |
| 1649 | $(DRIVERS)/sothello.o \ | |
| 1647 | 1650 | $(DRIVERS)/spool99.o \ |
| 1648 | 1651 | $(DRIVERS)/sprcros2.o $(VIDEO)/sprcros2.o \ |
| 1649 | 1652 | $(DRIVERS)/ssfindo.o \ |
| r4184 | r4185 | |
| 1738 | 1741 | $(DRIVERS)/goldnpkr.o: $(LAYOUT)/goldnpkr.lh \ |
| 1739 | 1742 | $(LAYOUT)/pmpoker.lh \ |
| 1740 | 1743 | |
| 1744 | $(DRIVERS)/igspoker.o: $(LAYOUT)/igspoker.lh | |
| 1745 | ||
| 1741 | 1746 | $(DRIVERS)/lazercmd.o: $(LAYOUT)/lazercmd.lh |
| 1742 | 1747 | |
| 1743 | 1748 | $(DRIVERS)/lucky74.o: $(LAYOUT)/lucky74.lh |
| r4184 | r4185 | |
| 1795 | 1800 | |
| 1796 | 1801 | $(DRIVERS)/tetrisp2.o: $(LAYOUT)/rocknms.lh |
| 1797 | 1802 | |
| 1803 | $(DRIVERS)/stepstag.o: $(LAYOUT)/stepstag.lh | |
| 1804 | ||
| 1798 | 1805 | $(DRIVERS)/thayers.o: $(LAYOUT)/dlair.lh |
| 1799 | 1806 | |
| 1800 | 1807 | $(DRIVERS)/turbo.o: $(LAYOUT)/turbo.lh \ |
| r4184 | r4185 | |
|---|---|---|
| 322 | 322 | { |
| 323 | 323 | UINT16 *dest = (UINT16 *)bitmap->base + y * bitmap->rowpixels; |
| 324 | 324 | for (x = cliprect->min_x; x <= cliprect->max_x; x++) |
| 325 | dest[x] = WAVERAM_READPIX(base, y, x - xoffs); | |
| 325 | dest[x] = WAVERAM_READPIX(base, y, x - xoffs) & 0x7fff; | |
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 |
| r4184 | r4185 | |
|---|---|---|
| 140 | 140 | case 0x03: bitmap_videoram_address_x = data; break; |
| 141 | 141 | case 0x07: bitmap_videoram_address_y = data; break; |
| 142 | 142 | default: |
| 143 | current_bitmap_videoram_accessed[(bitmap_videoram_address_y << 8) | bitmap_videoram_address_x] = data & 0x0 | |
| 143 | current_bitmap_videoram_accessed[(bitmap_videoram_address_y << 8) | bitmap_videoram_address_x] = data & 0x0f; | |
| 144 | 144 | |
| 145 | 145 | adjust_xy(offset); |
| 146 | 146 | break; |
| r4184 | r4185 | |
| 196 | 196 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| 197 | 197 | for (x = cliprect->min_x; x <= cliprect->max_x; x++) |
| 198 | 198 | { |
| 199 | pen_t pen = current_bitmap_videoram_displayed[(y << 8) | x]; | |
| 199 | pen_t pen = current_bitmap_videoram_displayed[(y << 8) | x] & 0x07; | |
| 200 | 200 | |
| 201 | 201 | if (pen) |
| 202 | 202 | *BITMAP_ADDR16(bitmap, y, (x - 6) & 0xff) = 0x10 | ((x & 0x80) >> 4) | pen; |
| r4184 | r4185 | |
|---|---|---|
| 35 | 35 | int tilemap_color, |
| 36 | 36 | int use_4bpp_gfx ) |
| 37 | 37 | { |
| 38 | #ifdef LSB_FIRST | |
| 39 | 38 | UINT16 *source; |
| 40 | 39 | static UINT8 mask_data[8]; |
| 41 | #endif | |
| 42 | 40 | |
| 43 | 41 | int data = tilemap_videoram[tile_index]; |
| 44 | 42 | int tile = data&0xfff; |
| r4184 | r4185 | |
| 62 | 60 | else |
| 63 | 61 | { |
| 64 | 62 | SET_TILE_INFO( gfx,tile,tilemap_color,0 ); |
| 65 | #ifdef LSB_FIRST | |
| 66 | source = shaperam+4*tile; | |
| 67 | mask_data[0] = source[0]>>8; | |
| 68 | mask_data[1] = source[0]&0xff; | |
| 69 | mask_data[2] = source[1]>>8; | |
| 70 | mask_data[3] = source[1]&0xff; | |
| 71 | mask_data[4] = source[2]>>8; | |
| 72 | mask_data[5] = source[2]&0xff; | |
| 73 | mask_data[6] = source[3]>>8; | |
| 74 | mask_data[7] = source[3]&0xff; | |
| 75 | tileinfo->mask_data = mask_data; | |
| 76 | #else | |
| 77 | tileinfo->mask_data = (UINT8 *)(shaperam+4*tile); | |
| 78 | #endif | |
| 63 | if (ENDIANNESS_NATIVE == ENDIANNESS_BIG) | |
| 64 | tileinfo->mask_data = (UINT8 *)(shaperam+4*tile); | |
| 65 | else | |
| 66 | { | |
| 67 | source = shaperam+4*tile; | |
| 68 | mask_data[0] = source[0]>>8; | |
| 69 | mask_data[1] = source[0]&0xff; | |
| 70 | mask_data[2] = source[1]>>8; | |
| 71 | mask_data[3] = source[1]&0xff; | |
| 72 | mask_data[4] = source[2]>>8; | |
| 73 | mask_data[5] = source[2]&0xff; | |
| 74 | mask_data[6] = source[3]>>8; | |
| 75 | mask_data[7] = source[3]&0xff; | |
| 76 | tileinfo->mask_data = mask_data; | |
| 77 | } | |
| 79 | 78 | } |
| 80 | 79 | } /* tilemap_get_info */ |
| 81 | 80 | |
| r4184 | r4185 | |
| 105 | 104 | } |
| 106 | 105 | else |
| 107 | 106 | { |
| 108 | #ifdef LSB_FIRST | |
| 109 | UINT16 *source; | |
| 110 | static UINT8 mask_data[8]; | |
| 111 | source = shaperam+4*tile; | |
| 112 | mask_data[0] = source[0]>>8; | |
| 113 | mask_data[1] = source[0]&0xff; | |
| 114 | mask_data[2] = source[1]>>8; | |
| 115 | mask_data[3] = source[1]&0xff; | |
| 116 | mask_data[4] = source[2]>>8; | |
| 117 | mask_data[5] = source[2]&0xff; | |
| 118 | mask_data[6] = source[3]>>8; | |
| 119 | mask_data[7] = source[3]&0xff; | |
| 120 | #else | |
| 121 | 107 | UINT8 *mask_data = (UINT8 *)(shaperam+4*tile); |
| 122 | #endif | |
| 108 | ||
| 109 | if (ENDIANNESS_NATIVE == ENDIANNESS_LITTLE) | |
| 110 | { | |
| 111 | UINT16 *source = (UINT16 *)mask_data; | |
| 112 | static UINT8 conv_data[9]; | |
| 113 | conv_data[0] = source[0]>>8; | |
| 114 | conv_data[1] = source[0]&0xff; | |
| 115 | conv_data[2] = source[1]>>8; | |
| 116 | conv_data[3] = source[1]&0xff; | |
| 117 | conv_data[4] = source[2]>>8; | |
| 118 | conv_data[5] = source[2]&0xff; | |
| 119 | conv_data[6] = source[3]>>8; | |
| 120 | conv_data[7] = source[3]&0xff; | |
| 121 | mask_data = conv_data; | |
| 122 | } | |
| 123 | 123 | SET_TILE_INFO( gfx,tile,tilemap_color,0 ); |
| 124 | 124 | tileinfo->mask_data = mask_data; |
| 125 | 125 | } |
| r4184 | r4185 | |
|---|---|---|
| 3379 | 3379 | } |
| 3380 | 3380 | break; |
| 3381 | 3381 | case 0x58: |
| 3382 | case 0x5a: | |
| 3382 | 3383 | case 0x5c: |
| 3383 | 3384 | case 0x5e: |
| 3384 | 3385 | if( m_n_gpu_buffer_offset < 5 && |
| r0 | r4185 | |
|---|---|---|
| 1 | /****************************************************************************** | |
| 2 | ||
| 3 | Himeshikibu (C) 1989 Hi-Soft | |
| 4 | ||
| 5 | Video hardware | |
| 6 | driver by Uki | |
| 7 | ||
| 8 | ******************************************************************************/ | |
| 9 | ||
| 10 | #include "driver.h" | |
| 11 | #include "video/generic.h" | |
| 12 | ||
| 13 | UINT8 *himesiki_bg_ram; | |
| 14 | static tilemap *himesiki_bg_tilemap; | |
| 15 | ||
| 16 | static int himesiki_scrollx[1]; | |
| 17 | static int himesiki_flip; | |
| 18 | ||
| 19 | ||
| 20 | static TILE_GET_INFO( get_bg_tile_info ) | |
| 21 | { | |
| 22 | int code = himesiki_bg_ram[tile_index*2] + himesiki_bg_ram[tile_index*2+1]*0x100 ; | |
| 23 | int col = code >> 12; | |
| 24 | ||
| 25 | code &= 0xfff; | |
| 26 | ||
| 27 | SET_TILE_INFO(0, code, col, 0); | |
| 28 | } | |
| 29 | ||
| 30 | VIDEO_START( himesiki ) | |
| 31 | { | |
| 32 | himesiki_bg_ram = auto_malloc(0x1000); | |
| 33 | himesiki_bg_tilemap = tilemap_create( machine, get_bg_tile_info,tilemap_scan_rows,8,8,64,32 ); | |
| 34 | } | |
| 35 | ||
| 36 | WRITE8_HANDLER( himesiki_bg_ram_w ) | |
| 37 | { | |
| 38 | himesiki_bg_ram[offset] = data; | |
| 39 | tilemap_mark_tile_dirty( himesiki_bg_tilemap, offset / 2 ); | |
| 40 | } | |
| 41 | ||
| 42 | WRITE8_HANDLER( himesiki_scrollx_w ) | |
| 43 | { | |
| 44 | himesiki_scrollx[offset] = data; | |
| 45 | } | |
| 46 | ||
| 47 | WRITE8_HANDLER( himesiki_flip_w ) | |
| 48 | { | |
| 49 | himesiki_flip = data & 0xc0; | |
| 50 | flip_screen_set(space->machine, himesiki_flip); | |
| 51 | ||
| 52 | if (data & 0x3f) | |
| 53 | logerror("p08_w %02x\n",data); | |
| 54 | } | |
| 55 | ||
| 56 | static void himesiki_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 57 | { | |
| 58 | int offs; | |
| 59 | ||
| 60 | for (offs = 0x100; offs<0x160; offs+=4) | |
| 61 | { | |
| 62 | int attr = spriteram[offs + 1]; | |
| 63 | int code = spriteram[offs + 0] | (attr & 3) << 8; | |
| 64 | int x = spriteram[offs + 3] | (attr & 8) << 5; | |
| 65 | int y = spriteram[offs + 2]; | |
| 66 | ||
| 67 | int col = (attr & 0xf0) >> 4; | |
| 68 | int fx = attr & 4; | |
| 69 | int fy = 0; | |
| 70 | ||
| 71 | if (x > 0x1e0) | |
| 72 | x -= 0x200; | |
| 73 | ||
| 74 | if (himesiki_flip) | |
| 75 | { | |
| 76 | y = (y + 33) & 0xff; | |
| 77 | x = 224-x; | |
| 78 | fx ^= 4; | |
| 79 | fy = 1; | |
| 80 | } | |
| 81 | else | |
| 82 | { | |
| 83 | y = 257-y; | |
| 84 | if (y > 0xc0) | |
| 85 | y -= 0x100; | |
| 86 | } | |
| 87 | ||
| 88 | drawgfx(bitmap,machine->gfx[1],code,col,fx,fy,x,y,cliprect,TRANSPARENCY_PEN,15); | |
| 89 | } | |
| 90 | ||
| 91 | for (offs = 0; offs<0x100; offs+=4) | |
| 92 | { | |
| 93 | int attr = spriteram[offs + 1]; | |
| 94 | int code = spriteram[offs + 0] | (attr & 7) << 8; | |
| 95 | int x = spriteram[offs + 3] | (attr & 8) << 5; | |
| 96 | int y = spriteram[offs + 2]; | |
| 97 | ||
| 98 | int col = (attr & 0xf0) >> 4; | |
| 99 | int f = 0; | |
| 100 | ||
| 101 | if (x > 0x1e0) | |
| 102 | x -= 0x200; | |
| 103 | ||
| 104 | if (himesiki_flip) | |
| 105 | { | |
| 106 | y += 49; | |
| 107 | x = 240-x; | |
| 108 | f = 1; | |
| 109 | } | |
| 110 | else | |
| 111 | y = 257-y; | |
| 112 | ||
| 113 | y &= 0xff; | |
| 114 | if (y > 0xf0) | |
| 115 | y -= 0x100; | |
| 116 | ||
| 117 | drawgfx(bitmap,machine->gfx[2],code,col,f,f,x,y,cliprect,TRANSPARENCY_PEN,15); | |
| 118 | } | |
| 119 | } | |
| 120 | ||
| 121 | VIDEO_UPDATE( himesiki ) | |
| 122 | { | |
| 123 | int x = -(himesiki_scrollx[0] << 8 | himesiki_scrollx[1]) & 0x1ff; | |
| 124 | tilemap_set_scrolldx( himesiki_bg_tilemap, x, x); | |
| 125 | ||
| 126 | tilemap_draw(bitmap, cliprect, himesiki_bg_tilemap, TILEMAP_DRAW_OPAQUE, 0); | |
| 127 | himesiki_draw_sprites(screen->machine, bitmap, cliprect); | |
| 128 | ||
| 129 | return 0; | |
| 130 | } |
| r4184 | r4185 | |
|---|---|---|
| 612 | 612 | int x,y; |
| 613 | 613 | if( mbSuperSystem22 ) |
| 614 | 614 | { /* super system 22 */ |
| 615 | #ifdef LSB_FIRST | |
| 616 | #define XORPAT 0x3 | |
| 617 | #else | |
| 618 | #define XORPAT 0x0 | |
| 619 | #endif | |
| 615 | #define XORPAT NATIVE_ENDIAN_VALUE_LE_BE(3,0) | |
| 620 | 616 | const UINT8 *rlut = (const UINT8 *)&namcos22_gamma[0x100/4]; |
| 621 | 617 | const UINT8 *glut = (const UINT8 *)&namcos22_gamma[0x200/4]; |
| 622 | 618 | const UINT8 *blut = (const UINT8 *)&namcos22_gamma[0x300/4]; |
| r0 | r4185 | |
|---|---|---|
| 1 | /****************************************************************************************** | |
| 2 | ||
| 3 | Seibu Custom "CRT Controller" emulation | |
| 4 | ||
| 5 | by Angelo Salese,based off the old D-Con video HW part by Bryan McPhail | |
| 6 | ||
| 7 | The (likely) custom Seibu CRTC is used at least in the following games: | |
| 8 | Raiden (probably the first game to use it) | |
| 9 | *Sengoku Mahjong | |
| 10 | *Good e Jong | |
| 11 | *Tottemo de Jong | |
| 12 | Blood Bros. | |
| 13 | Sky Smasher | |
| 14 | D-Con | |
| 15 | SD Gundam Psycho Salamander no Kyoui | |
| 16 | (all games in legionna.c) | |
| 17 | (all games in raiden2.c) | |
| 18 | ||
| 19 | The name "Seibu CRTC" is actually an agglomerate of all the Seibu Customs that are on the | |
| 20 | single boards, most if not all of them are shared video chips in the aforementioned games. | |
| 21 | ||
| 22 | TODO: | |
| 23 | - Dynamic Resolution Change (xx10 register?) | |
| 24 | - Dynamic Paging register probably incorrect,needs further investigation; | |
| 25 | - Merge the aforementioned games and clean-up the code in these drivers; | |
| 26 | - Merge the gfxdecode too? | |
| 27 | - Fully understand remaining video registers; | |
| 28 | - Are the xx80/xxc0 in some games (D-Con/Sengoku Mahjong) another bunch of registers? | |
| 29 | - Investigate about the real name(s) of this Seibu "CRT Controller",and if it is really | |
| 30 | custom. | |
| 31 | ||
| 32 | =========================================================================================== | |
| 33 | ||
| 34 | List of default vregs (title screen): | |
| 35 | ||
| 36 | *Sengoku Mahjong: | |
| 37 | 8000: 000F 0013 009F 00BF 00FA 000F 00FA 00FF | |
| 38 | 8010: 007D 0006 0000 0002 0000 0000 0000 0000 | |
| 39 | 8020: 0000 0000 0004 0000 0000 0000 0040 01FF | |
| 40 | 8030: 003E 01FF 003F 01FF 0040 0001 0034 0035 | |
| 41 | 8040: 0000 A8A8 0003 1C37 0001 0000 0000 0000 | |
| 42 | ||
| 43 | *Tottemo de Jong | |
| 44 | 8000: 000F 000F 009F 00BF 00FA 000F 00FA 00FF | |
| 45 | 8010: 0076 0006 0000 0002 0000 0002 0006 0000 | |
| 46 | 8020: 0000 0000 0000 0000 0000 0000 01C0 01FF | |
| 47 | 8030: 003E 01FF 003F 01FF 00C0 01FF 0034 003F | |
| 48 | 8040: 0000 A8A8 0003 1830 0001 0000 0000 0000 | |
| 49 | ||
| 50 | *Good e Jong | |
| 51 | 8040: 000F 000F 009F 00BF 00FA 000F 00FA 00FF | |
| 52 | 8050: 0076 0006 0000 0002 0000 0002 0006 0000 | |
| 53 | 8060: 0000 00FA 0000 0000 0000 0000 01C0 01FF | |
| 54 | 8070: 003E 01FF 003F 01FF 00C0 01FF 0034 003F | |
| 55 | 8080: 0000 0000 0000 0000 0000 0000 0000 0000 | |
| 56 | ||
| 57 | *******************************************************************************************/ | |
| 58 | ||
| 59 | #include "driver.h" | |
| 60 | #include "includes/sei_crtc.h" | |
| 61 | ||
| 62 | static tilemap *sc0_tilemap,*sc2_tilemap,*sc1_tilemap,*sc3_tilemap_0,*sc3_tilemap_1; | |
| 63 | UINT16 *seibucrtc_sc0vram,*seibucrtc_sc1vram,*seibucrtc_sc2vram,*seibucrtc_sc3vram; | |
| 64 | UINT16 *seibucrtc_vregs; | |
| 65 | UINT16 seibucrtc_sc0bank; | |
| 66 | ||
| 67 | /******************************* | |
| 68 | * | |
| 69 | * Macros for the video registers | |
| 70 | * | |
| 71 | *******************************/ | |
| 72 | ||
| 73 | /******************************* | |
| 74 | * 0x1a - Layer Dynamic Paging? | |
| 75 | *******************************/ | |
| 76 | #define SEIBU_CRTC_DYN_PAGING (seibucrtc_vregs[0x001a/2]) | |
| 77 | #define SEIBU_CRTC_SC3_PAGE_SEL (SEIBU_CRTC_DYN_PAGING & 0x0002) | |
| 78 | ||
| 79 | /******************************* | |
| 80 | * 0x1c - Layer Enable | |
| 81 | *******************************/ | |
| 82 | #define SEIBU_CRTC_LAYER_EN (seibucrtc_vregs[0x001c/2]) | |
| 83 | #define SEIBU_CRTC_ENABLE_SC0 (!(SEIBU_CRTC_LAYER_EN & 0x0001)) | |
| 84 | #define SEIBU_CRTC_ENABLE_SC2 (!(SEIBU_CRTC_LAYER_EN & 0x0002)) | |
| 85 | #define SEIBU_CRTC_ENABLE_SC1 (!(SEIBU_CRTC_LAYER_EN & 0x0004)) | |
| 86 | #define SEIBU_CRTC_ENABLE_SC3 (!(SEIBU_CRTC_LAYER_EN & 0x0008)) | |
| 87 | #define SEIBU_CRTC_ENABLE_SPR (!(SEIBU_CRTC_LAYER_EN & 0x0010)) | |
| 88 | ||
| 89 | /************************************ | |
| 90 | * 0x20 - Screen 0 (BG) scroll x | |
| 91 | ************************************/ | |
| 92 | #define SEIBU_CRTC_SC0_SX (seibucrtc_vregs[0x0020/2]) | |
| 93 | ||
| 94 | /************************************ | |
| 95 | * 0x22 - Screen 0 (BG) scroll y | |
| 96 | ************************************/ | |
| 97 | #define SEIBU_CRTC_SC0_SY (seibucrtc_vregs[0x0022/2]) | |
| 98 | ||
| 99 | /************************************ | |
| 100 | * 0x24 - Screen 1 (FG) scroll x | |
| 101 | ************************************/ | |
| 102 | #define SEIBU_CRTC_SC1_SX (seibucrtc_vregs[0x0024/2]) | |
| 103 | ||
| 104 | /************************************ | |
| 105 | * 0x26 - Screen 1 (FG) scroll y | |
| 106 | ************************************/ | |
| 107 | #define SEIBU_CRTC_SC1_SY (seibucrtc_vregs[0x0026/2]) | |
| 108 | ||
| 109 | /************************************ | |
| 110 | * 0x28 - Screen 2 (MD) scroll x | |
| 111 | ************************************/ | |
| 112 | #define SEIBU_CRTC_SC2_SX (seibucrtc_vregs[0x0028/2]) | |
| 113 | ||
| 114 | /************************************ | |
| 115 | * 0x2a - Screen 2 (MD) scroll y | |
| 116 | ************************************/ | |
| 117 | #define SEIBU_CRTC_SC2_SY (seibucrtc_vregs[0x002a/2]) | |
| 118 | ||
| 119 | /************************************ | |
| 120 | * 0x2c - Fix screen scroll x (global) | |
| 121 | ************************************/ | |
| 122 | #define SEIBU_CRTC_FIX_SX (seibucrtc_vregs[0x002c/2]) | |
| 123 | ||
| 124 | /************************************ | |
| 125 | * 0x2e - Fix screen scroll y (global) | |
| 126 | ************************************/ | |
| 127 | #define SEIBU_CRTC_FIX_SY (seibucrtc_vregs[0x002e/2]) | |
| 128 | ||
| 129 | ||
| 130 | /******************************* | |
| 131 | * | |
| 132 | * Write RAM accesses | |
| 133 | * | |
| 134 | *******************************/ | |
| 135 | ||
| 136 | WRITE16_HANDLER( seibucrtc_sc0vram_w ) | |
| 137 | { | |
| 138 | COMBINE_DATA(&seibucrtc_sc0vram[offset]); | |
| 139 | tilemap_mark_tile_dirty(sc0_tilemap,offset); | |
| 140 | } | |
| 141 | ||
| 142 | WRITE16_HANDLER( seibucrtc_sc2vram_w ) | |
| 143 | { | |
| 144 | COMBINE_DATA(&seibucrtc_sc2vram[offset]); | |
| 145 | tilemap_mark_tile_dirty(sc2_tilemap,offset); | |
| 146 | } | |
| 147 | ||
| 148 | WRITE16_HANDLER( seibucrtc_sc1vram_w ) | |
| 149 | { | |
| 150 | COMBINE_DATA(&seibucrtc_sc1vram[offset]); | |
| 151 | tilemap_mark_tile_dirty(sc1_tilemap,offset); | |
| 152 | } | |
| 153 | ||
| 154 | WRITE16_HANDLER( seibucrtc_sc3vram_w ) | |
| 155 | { | |
| 156 | COMBINE_DATA(&seibucrtc_sc3vram[offset]); | |
| 157 | tilemap_mark_tile_dirty(sc3_tilemap_0,offset); | |
| 158 | tilemap_mark_tile_dirty(sc3_tilemap_1,offset); | |
| 159 | } | |
| 160 | ||
| 161 | WRITE16_HANDLER( seibucrtc_vregs_w ) | |
| 162 | { | |
| 163 | COMBINE_DATA(&seibucrtc_vregs[offset]); | |
| 164 | } | |
| 165 | ||
| 166 | /* Actually external from the CRTC */ | |
| 167 | void seibucrtc_sc0bank_w(UINT16 data) | |
| 168 | { | |
| 169 | seibucrtc_sc0bank = data & 1; | |
| 170 | tilemap_mark_all_tiles_dirty(sc0_tilemap); | |
| 171 | } | |
| 172 | ||
| 173 | ||
| 174 | /******************************* | |
| 175 | * | |
| 176 | * Tilemap info accesses | |
| 177 | * | |
| 178 | *******************************/ | |
| 179 | ||
| 180 | static TILE_GET_INFO( seibucrtc_sc0_tile_info ) | |
| 181 | { | |
| 182 | int tile = seibucrtc_sc0vram[tile_index] & 0xfff; | |
| 183 | int color = (seibucrtc_sc0vram[tile_index] >> 12) & 0x0f; | |
| 184 | tile+=(seibucrtc_sc0bank<<12); | |
| 185 | SET_TILE_INFO(1, tile, color, 0); | |
| 186 | } | |
| 187 | ||
| 188 | static TILE_GET_INFO( seibucrtc_sc2_tile_info ) | |
| 189 | { | |
| 190 | int tile = seibucrtc_sc2vram[tile_index] & 0xfff; | |
| 191 | int color = (seibucrtc_sc2vram[tile_index] >> 12) & 0x0f; | |
| 192 | SET_TILE_INFO(2, tile, color, 0); | |
| 193 | } | |
| 194 | ||
| 195 | static TILE_GET_INFO( seibucrtc_sc1_tile_info ) | |
| 196 | { | |
| 197 | int tile = seibucrtc_sc1vram[tile_index] & 0xfff; | |
| 198 | int color = (seibucrtc_sc1vram[tile_index] >> 12) & 0x0f; | |
| 199 | SET_TILE_INFO(3, tile, color, 0); | |
| 200 | } | |
| 201 | ||
| 202 | static TILE_GET_INFO( seibucrtc_sc3_tile_info ) | |
| 203 | { | |
| 204 | int tile = seibucrtc_sc3vram[tile_index] & 0xfff; | |
| 205 | int color = (seibucrtc_sc3vram[tile_index] >> 12) & 0x0f; | |
| 206 | SET_TILE_INFO(4, tile, color, 0); | |
| 207 | } | |
| 208 | ||
| 209 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int pri) | |
| 210 | { | |
| 211 | int offs,fx,fy,x,y,color,sprite; | |
| 212 | int dx,dy,ax,ay; | |
| 213 | ||
| 214 | for (offs = 0x400-4;offs >= 0;offs -= 4) | |
| 215 | { | |
| 216 | if ((spriteram16[offs+0]&0x8000)!=0x8000) continue; | |
| 217 | sprite = spriteram16[offs+1]; | |
| 218 | if ((sprite>>14)!=pri) continue; | |
| 219 | sprite &= 0x1fff; | |
| 220 | ||
| 221 | y = spriteram16[offs+3]; | |
| 222 | x = spriteram16[offs+2]; | |
| 223 | ||
| 224 | if (x&0x8000) x=0-(0x200-(x&0x1ff)); | |
| 225 | else x&=0x1ff; | |
| 226 | if (y&0x8000) y=0-(0x200-(y&0x1ff)); | |
| 227 | else y&=0x1ff; | |
| 228 | ||
| 229 | color = spriteram16[offs+0]&0x3f; | |
| 230 | fx = spriteram16[offs+0]&0x4000; | |
| 231 | fy = spriteram16[offs+0]&0x2000; | |
| 232 | dy=((spriteram16[offs+0]&0x0380)>>7)+1; | |
| 233 | dx=((spriteram16[offs+0]&0x1c00)>>10)+1; | |
| 234 | ||
| 235 | for (ax=0; ax<dx; ax++) | |
| 236 | for (ay=0; ay<dy; ay++) { | |
| 237 | if (!fx) | |
| 238 | drawgfx(bitmap,machine->gfx[0], | |
| 239 | sprite++, | |
| 240 | color,fx,fy,x+ax*16,y+ay*16, | |
| 241 | cliprect,TRANSPARENCY_PEN,15); | |
| 242 | else | |
| 243 | drawgfx(bitmap,machine->gfx[0], | |
| 244 | sprite++, | |
| 245 | color,fx,fy,x+(dx-1-ax)*16,y+ay*16, | |
| 246 | cliprect,TRANSPARENCY_PEN,15); | |
| 247 | } | |
| 248 | } | |
| 249 | } | |
| 250 | ||
| 251 | /*********************************** | |
| 252 | * | |
| 253 | * VIDEO_START/VIDEO_UPDATE functions | |
| 254 | * | |
| 255 | ***********************************/ | |
| 256 | ||
| 257 | VIDEO_START( seibu_crtc ) | |
| 258 | { | |
| 259 | sc0_tilemap = tilemap_create(machine, seibucrtc_sc0_tile_info,tilemap_scan_rows,16,16,32,32); | |
| 260 | sc2_tilemap = tilemap_create(machine, seibucrtc_sc2_tile_info,tilemap_scan_rows,16,16,32,32); | |
| 261 | sc1_tilemap = tilemap_create(machine, seibucrtc_sc1_tile_info,tilemap_scan_rows,16,16,32,32); | |
| 262 | sc3_tilemap_0 = tilemap_create(machine, seibucrtc_sc3_tile_info,tilemap_scan_rows, 8, 8,32,32); | |
| 263 | sc3_tilemap_1 = tilemap_create(machine, seibucrtc_sc3_tile_info,tilemap_scan_rows, 8, 8,64,32); | |
| 264 | ||
| 265 | tilemap_set_transparent_pen(sc2_tilemap,15); | |
| 266 | tilemap_set_transparent_pen(sc1_tilemap,15); | |
| 267 | tilemap_set_transparent_pen(sc3_tilemap_0,15); | |
| 268 | tilemap_set_transparent_pen(sc3_tilemap_1,15); | |
| 269 | ||
| 270 | seibucrtc_sc0bank = 0; | |
| 271 | } | |
| 272 | ||
| 273 | VIDEO_UPDATE( seibu_crtc ) | |
| 274 | { | |
| 275 | bitmap_fill(bitmap, cliprect, screen->machine->pens[0x7ff]); //black pen | |
| 276 | ||
| 277 | tilemap_set_scrollx( sc0_tilemap,0, (SEIBU_CRTC_SC0_SX + SEIBU_CRTC_FIX_SX+64) & 0x1ff ); | |
| 278 | tilemap_set_scrolly( sc0_tilemap,0, (SEIBU_CRTC_SC0_SY + SEIBU_CRTC_FIX_SY+1) & 0x1ff ); | |
| 279 | tilemap_set_scrollx( sc2_tilemap,0, (SEIBU_CRTC_SC2_SX + SEIBU_CRTC_FIX_SX+64) & 0x1ff ); | |
| 280 | tilemap_set_scrolly( sc2_tilemap,0, (SEIBU_CRTC_SC2_SY + SEIBU_CRTC_FIX_SY+1) & 0x1ff ); | |
| 281 | tilemap_set_scrollx( sc1_tilemap,0, (SEIBU_CRTC_SC1_SX + SEIBU_CRTC_FIX_SX+64) & 0x1ff ); | |
| 282 | tilemap_set_scrolly( sc1_tilemap,0, (SEIBU_CRTC_SC1_SY + SEIBU_CRTC_FIX_SY+1) & 0x1ff ); | |
| 283 | tilemap_set_scrollx( SEIBU_CRTC_SC3_PAGE_SEL ? sc3_tilemap_0 : sc3_tilemap_1,0, (SEIBU_CRTC_FIX_SX+64) & 0x1ff ); | |
| 284 | tilemap_set_scrolly( SEIBU_CRTC_SC3_PAGE_SEL ? sc3_tilemap_0 : sc3_tilemap_1,0, (SEIBU_CRTC_FIX_SY+1) & 0x1ff ); | |
| 285 | ||
| 286 | if(SEIBU_CRTC_ENABLE_SC0) { tilemap_draw(bitmap,cliprect,sc0_tilemap,0,0); } | |
| 287 | if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine, bitmap,cliprect, 2); } | |
| 288 | if(SEIBU_CRTC_ENABLE_SC2) { tilemap_draw(bitmap,cliprect,sc2_tilemap,0,0); } | |
| 289 | if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine, bitmap,cliprect, 1); } | |
| 290 | if(SEIBU_CRTC_ENABLE_SC1) { tilemap_draw(bitmap,cliprect,sc1_tilemap,0,0); } | |
| 291 | if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine, bitmap,cliprect, 0); } | |
| 292 | if(SEIBU_CRTC_ENABLE_SC3) { tilemap_draw(bitmap,cliprect,SEIBU_CRTC_SC3_PAGE_SEL ? sc3_tilemap_0 : sc3_tilemap_1,0,0); } | |
| 293 | if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine, bitmap,cliprect, 3); } | |
| 294 | ||
| 295 | return 0; | |
| 296 | } |
| r4184 | r4185 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | #define DISPLAY_SPEEDUPS 0 |
| 20 | 20 | |
| 21 | #ifdef LSB_FIRST | |
| 22 | #define MASK(n) (0x000000ffUL << ((n) * 8)) | |
| 23 | #else | |
| 24 | #define MASK(n) (0xff000000UL >> (((n) ^ 1) * 8)) | |
| 25 | #endif | |
| 21 | #define MASK(n) NATIVE_ENDIAN_VALUE_LE_BE(0x000000ffUL << ((n) * 8), 0xff000000UL >> (((n) ^ 1) * 8)) | |
| 26 | 22 | |
| 27 | 23 | |
| 24 | ||
| 28 | 25 | /************************************* |
| 29 | 26 | * |
| 30 | 27 | * External definitions |
| r4184 | r4185 | |
|---|---|---|
| 10 | 10 | #include "includes/atari.h" |
| 11 | 11 | #include "video/gtia.h" |
| 12 | 12 | |
| 13 | #ifdef LSB_FIRST | |
| 14 | #define BYTE_XOR(n) (n) | |
| 15 | #else | |
| 16 | #define BYTE_XOR(n) ((n)^1) | |
| 17 | #endif | |
| 18 | ||
| 19 | 13 | #define VERBOSE 0 |
| 20 | 14 | |
| 21 | 15 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| r4184 | r4185 | |
| 990 | 984 | if ( (antic.cmd & ANTIC_HSCR) == 0 || (antic.pfwidth == 48) || (antic.pfwidth == 32)) |
| 991 | 985 | { |
| 992 | 986 | /* no hscroll */ |
| 993 | dst[3] = antic.color_lookup[src[BYTE_XOR(0)]] | antic.color_lookup[src[BYTE_XOR(1)]] << 16; | |
| 987 | dst[3] = antic.color_lookup[src[BYTE_XOR_LE(0)]] | antic.color_lookup[src[BYTE_XOR_LE(1)]] << 16; | |
| 994 | 988 | src += 2; |
| 995 | 989 | dst += 4; |
| 996 | 990 | for( x = 1; x < HCHARS-1; x++ ) |
| 997 | 991 | { |
| 998 | *dst++ = antic.color_lookup[src[BYTE_XOR(0)]] | antic.color_lookup[src[BYTE_XOR(1)]] << 16; | |
| 999 | *dst++ = antic.color_lookup[src[BYTE_XOR(2)]] | antic.color_lookup[src[BYTE_XOR(3)]] << 16; | |
| 992 | *dst++ = antic.color_lookup[src[BYTE_XOR_LE(0)]] | antic.color_lookup[src[BYTE_XOR_LE(1)]] << 16; | |
| 993 | *dst++ = antic.color_lookup[src[BYTE_XOR_LE(2)]] | antic.color_lookup[src[BYTE_XOR_LE(3)]] << 16; | |
| 1000 | 994 | src += 4; |
| 1001 | 995 | } |
| 1002 | dst[0] = antic.color_lookup[src[BYTE_XOR(0)]] | antic.color_lookup[src[BYTE_XOR(1)]] << 16; | |
| 996 | dst[0] = antic.color_lookup[src[BYTE_XOR_LE(0)]] | antic.color_lookup[src[BYTE_XOR_LE(1)]] << 16; | |
| 1003 | 997 | } |
| 1004 | 998 | else |
| 1005 | 999 | { |
| r4184 | r4185 | |
| 1032 | 1026 | } |
| 1033 | 1027 | else |
| 1034 | 1028 | { |
| 1035 | *dst++ = antic.color_lookup[src[BYTE_XOR(0)]] | antic.color_lookup[src[BYTE_XOR(1)]] << 16; | |
| 1029 | *dst++ = antic.color_lookup[src[BYTE_XOR_LE(0)]] | antic.color_lookup[src[BYTE_XOR_LE(1)]] << 16; | |
| 1036 | 1030 | } |
| 1037 | *dst++ = antic.color_lookup[src[BYTE_XOR(2)]] | antic.color_lookup[src[BYTE_XOR(3)]] << 16; | |
| 1031 | *dst++ = antic.color_lookup[src[BYTE_XOR_LE(2)]] | antic.color_lookup[src[BYTE_XOR_LE(3)]] << 16; | |
| 1038 | 1032 | src += 4; |
| 1039 | 1033 | } |
| 1040 | 1034 | for ( ; x < HCHARS-1; x++ ) |
| r4184 | r4185 | |
|---|---|---|
| 189 | 189 | * |
| 190 | 190 | *************************************/ |
| 191 | 191 | |
| 192 | #ifdef LSB_FIRST | |
| 193 | #define SWAP_HALVES(x) (x) | |
| 194 | #else | |
| 195 | #define SWAP_HALVES(x) (((x) >> 16) | ((x) << 16)) | |
| 196 | #endif | |
| 192 | #define SWAP_HALVES(x) NATIVE_ENDIAN_VALUE_LE_BE(x, ((x) >> 16) | ((x) << 16)) | |
| 197 | 193 | |
| 198 | 194 | |
| 199 | 195 |
| r4184 | r4185 | |
|---|---|---|
| 937 | 937 | |
| 938 | 938 | /*============================================================================*/ |
| 939 | 939 | |
| 940 | #ifdef LSB_FIRST | |
| 941 | #define COLOR1 0 | |
| 942 | #define COLOR2 1 | |
| 943 | #define COLOR3 2 | |
| 944 | #else | |
| 945 | #define COLOR1 3 | |
| 946 | #define COLOR2 2 | |
| 947 | #define COLOR3 1 | |
| 948 | #endif | |
| 940 | #define COLOR1 BYTE4_XOR_LE(0) | |
| 941 | #define COLOR2 BYTE4_XOR_LE(1) | |
| 942 | #define COLOR3 BYTE4_XOR_LE(2) | |
| 949 | 943 | |
| 950 | 944 | |
| 951 | 945 |
| r4184 | r4185 | |
|---|---|---|
| 36 | 36 | #define VDP_VRAM_WORD(x) ((VDP_VRAM_BYTE(x) << 8) | VDP_VRAM_BYTE((x) + 1)) |
| 37 | 37 | #define VDP_VSRAM_WORD(x) ((VDP_VSRAM_BYTE(x) << 8) | VDP_VSRAM_BYTE((x) + 1)) |
| 38 | 38 | |
| 39 | #ifdef LSB_FIRST | |
| 40 | #define EXTRACT_PIXEL(x,i) (((x) >> (((i) ^ 1) * 4)) & 0x0f) | |
| 41 | #else | |
| 42 | #define EXTRACT_PIXEL(x,i) (((x) >> (((i) ^ 7) * 4)) & 0x0f) | |
| 43 | #endif | |
| 39 | #define EXTRACT_PIXEL(x,i) (((x) >> (((i) ^ NATIVE_ENDIAN_VALUE_LE_BE(1,7)) * 4)) & 0x0f) | |
| 44 | 40 | |
| 45 | 41 | |
| 46 | 42 |
| r0 | r4185 | |
|---|---|---|
| 1 | <?xml version="1.0"?> | |
| 2 | <mamelayout version="2"> | |
| 3 | <element name="L1" defstate="1"> | |
| 4 | <rect state="1"> | |
| 5 | <color red="0.0" green="1.0" blue="0.0" /> | |
| 6 | </rect> | |
| 7 | <rect state="0"> | |
| 8 | <color red="0.0" green="0.2" blue="0.0" /> | |
| 9 | </rect> | |
| 10 | <text string="HOLD1"> | |
| 11 | <color red="0.0" green="0.0" blue="0.0" /> | |
| 12 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 13 | </text> | |
| 14 | </element> | |
| 15 | ||
| 16 | <element name="L2" defstate="1"> | |
| 17 | <rect state="1"> | |
| 18 | <color red="0.0" green="1.0" blue="0.0" /> | |
| 19 | </rect> | |
| 20 | <rect state="0"> | |
| 21 | <color red="0.0" green="0.2" blue="0.0" /> | |
| 22 | </rect> | |
| 23 | <text string="HOLD2"> | |
| 24 | <color red="0.0" green="0.0" blue="0.0" /> | |
| 25 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 26 | </text> | |
| 27 | </element> | |
| 28 | ||
| 29 | <element name="L3" defstate="1"> | |
| 30 | <rect state="1"> | |
| 31 | <color red="0.0" green="1.0" blue="0.0" /> | |
| 32 | </rect> | |
| 33 | <rect state="0"> | |
| 34 | <color red="0.0" green="0.2" blue="0.0" /> | |
| 35 | </rect> | |
| 36 | <text string="HOLD3"> | |
| 37 | <color red="0.0" green="0.0" blue="0.0" /> | |
| 38 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 39 | </text> | |
| 40 | </element> | |
| 41 | ||
| 42 | <element name="L4" defstate="1"> | |
| 43 | <rect state="1"> | |
| 44 | <color red="0.0" green="1.0" blue="0.0" /> | |
| 45 | </rect> | |
| 46 | <rect state="0"> | |
| 47 | <color red="0.0" green="0.2" blue="0.0" /> | |
| 48 | </rect> | |
| 49 | <text string="HOLD4"> | |
| 50 | <color red="0.0" green="0.0" blue="0.0" /> | |
| 51 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 52 | </text> | |
| 53 | </element> | |
| 54 | ||
| 55 | <element name="L5" defstate="1"> | |
| 56 | <rect state="1"> | |
| 57 | <color red="0.0" green="1.0" blue="0.0" /> | |
| 58 | </rect> | |
| 59 | <rect state="0"> | |
| 60 | <color red="0.0" green="0.2" blue="0.0" /> | |
| 61 | </rect> | |
| 62 | <text string="HOLD5"> | |
| 63 | <color red="0.0" green="0.0" blue="0.0" /> | |
| 64 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 65 | </text> | |
| 66 | </element> | |
| 67 | ||
| 68 | <element name="L6" defstate="1"> | |
| 69 | <rect state="1"> | |
| 70 | <color red="1.0" green="0.0" blue="0.0" /> | |
| 71 | </rect> | |
| 72 | <rect state="0"> | |
| 73 | <color red="0.3" green="0.0" blue="0.0" /> | |
| 74 | </rect> | |
| 75 | <text string="START"> | |
| 76 | <color red="0.0" green="0.0" blue="0.0" /> | |
| 77 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 78 | </text> | |
| 79 | </element> | |
| 80 | ||
| 81 | ||
| 82 | <view name="Button Lamps"> | |
| 83 | <screen index="0"> | |
| 84 | <bounds left="0" top="0" right="4" bottom="3" /> | |
| 85 | </screen> | |
| 86 | <bezel name="lamp1" element="L1"> | |
| 87 | <bounds x="0.5" y="3.13" width="0.40" height="0.24" /> | |
| 88 | </bezel> | |
| 89 | <bezel name="lamp2" element="L2"> | |
| 90 | <bounds x="1.0" y="3.13" width="0.40" height="0.24" /> | |
| 91 | </bezel> | |
| 92 | <bezel name="lamp3" element="L3"> | |
| 93 | <bounds x="1.5" y="3.13" width="0.40" height="0.24" /> | |
| 94 | </bezel> | |
| 95 | <bezel name="lamp4" element="L4"> | |
| 96 | <bounds x="2.0" y="3.13" width="0.40" height="0.24" /> | |
| 97 | </bezel> | |
| 98 | <bezel name="lamp5" element="L5"> | |
| 99 | <bounds x="2.5" y="3.13" width="0.40" height="0.24" /> | |
| 100 | </bezel> | |
| 101 | <bezel name="lamp6" element="L6"> | |
| 102 | <bounds x="3.0" y="3.13" width="0.40" height="0.24" /> | |
| 103 | </bezel> | |
| 104 | </view> | |
| 105 | </mamelayout> |
| r0 | r4185 | |
|---|---|---|
| 1 | <?xml version="1.0"?> | |
| 2 | <mamelayout version="2"> | |
| 3 | <view name="Screen 0 Standard (3:4)"> | |
| 4 | <screen index="0"> | |
| 5 | <bounds left="0" top="0" right="3" bottom="4" /> | |
| 6 | <orientation rotate="270" /> | |
| 7 | </screen> | |
| 8 | </view> | |
| 9 | ||
| 10 | <view name="Screen 1 Standard (4:3)"> | |
| 11 | <screen index="1"> | |
| 12 | <bounds left="0" top="0" right="4" bottom="3" /> | |
| 13 | </screen> | |
| 14 | </view> | |
| 15 | ||
| 16 | <view name="Screen 2 Standard (3:4)"> | |
| 17 | <screen index="2"> | |
| 18 | <bounds left="0" top="0" right="3" bottom="4" /> | |
| 19 | <orientation rotate="270" /> | |
| 20 | </screen> | |
| 21 | </view> | |
| 22 | ||
| 23 | <view name="Screen 0 Pixel Aspect (~scr0nativeyaspect~:~scr0nativexaspect~)"> | |
| 24 | <screen index="0"> | |
| 25 | <bounds left="0" top="0" right="~scr0height~" bottom="~scr0width~" /> | |
| 26 | <orientation rotate="270" /> | |
| 27 | </screen> | |
| 28 | </view> | |
| 29 | ||
| 30 | <view name="Screen 1 Pixel Aspect (~scr1nativexaspect~:~scr1nativeyaspect~)"> | |
| 31 | <screen index="1"> | |
| 32 | <bounds left="0" top="0" right="~scr1width~" bottom="~scr1height~" /> | |
| 33 | </screen> | |
| 34 | </view> | |
| 35 | ||
| 36 | <view name="Screen 2 Pixel Aspect (~scr2nativeyaspect~:~scr2nativexaspect~)"> | |
| 37 | <screen index="2"> | |
| 38 | <bounds left="0" top="0" right="~scr2height~" bottom="~scr2width~" /> | |
| 39 | <orientation rotate="270" /> | |
| 40 | </screen> | |
| 41 | </view> | |
| 42 | ||
| 43 | <view name="Stepping Stage Custom"> | |
| 44 | <screen index="0"> | |
| 45 | <bounds x="0" y="0" width="9" height="12" /> | |
| 46 | <orientation rotate="270" /> | |
| 47 | </screen> | |
| 48 | <screen index="1"> | |
| 49 | <bounds x="9" y="0" width="16" height="12" /> | |
| 50 | </screen> | |
| 51 | <screen index="2"> | |
| 52 | <bounds x="28.36" y="0" width="9" height="12" /> | |
| 53 | <orientation rotate="270" /> | |
| 54 | </screen> | |
| 55 | </view> | |
| 56 | ||
| 57 | </mamelayout> |
| r4184 | r4185 | |
|---|---|---|
| 446 | 446 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 ) |
| 447 | 447 | INPUT_PORTS_END |
| 448 | 448 | |
| 449 | #define ROM_LOAD64_WORD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(6)) | |
| 450 | 449 | |
| 451 | 450 | ROM_START( rungun ) |
| 452 | 451 | /* main program Europe Version AA 1993, 10.8 */ |
| r4184 | r4185 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | /* configure fast RAM regions for DRC */ |
| 88 | 88 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); |
| 89 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); | |
| 90 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x0007ffff); | |
| 89 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x80000000); | |
| 90 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x8007ffff); | |
| 91 | 91 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, vram); |
| 92 | 92 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); |
| 93 | 93 | |
| 94 | 94 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 1); |
| 95 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x7f000000); | |
| 96 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x7f01ffff); | |
| 95 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0xff000000); | |
| 96 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0xff01ffff); | |
| 97 | 97 | device_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, workram); |
| 98 | 98 | device_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); |
| 99 | 99 | } |
| r4184 | r4185 | |
| 110 | 110 | AM_RANGE(0x700000e0, 0x700000e3) AM_WRITE(int_ack_w) |
| 111 | 111 | AM_RANGE(0x7f000000, 0x7f01ffff) AM_RAM AM_BASE(&workram) |
| 112 | 112 | AM_RANGE(0x7f700000, 0x7f703fff) AM_RAM_WRITE(palette_w) AM_BASE(&paletteram32) |
| 113 | AM_RANGE(0x7fa00000, 0x7fbfffff) AM_ROM AM_SHARE(1) | |
| 114 | AM_RANGE(0x7fc00000, 0x7fdfffff) AM_ROM AM_SHARE(1) | |
| 115 | AM_RANGE(0x7fe00000, 0x7fffffff) AM_ROM AM_REGION("user1", 0) AM_SHARE(1) | |
| 113 | AM_RANGE(0x7f800000, 0x7f9fffff) AM_MIRROR(0x00600000) AM_ROM AM_REGION("user1", 0) | |
| 116 | 114 | ADDRESS_MAP_END |
| 117 | 115 | |
| 118 | 116 | |
| r4184 | r4185 | |
| 167 | 165 | } |
| 168 | 166 | |
| 169 | 167 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 170 | AM_RANGE(0x00000000, 0x0001ffff) AM_R | |
| 168 | AM_RANGE(0x00000000, 0x0001ffff) AM_R | |
| 171 | 169 | AM_RANGE(0x00100000, 0x00101fff) AM_RAM |
| 172 | 170 | AM_RANGE(0x00200000, 0x00200007) AM_WRITE(K056800_68k_w) |
| 173 | 171 | AM_RANGE(0x00200008, 0x0020000f) AM_READ(K056800_68k_r) |
| r4184 | r4185 | |
|---|---|---|
| 2720 | 2720 | ROM_LOAD("sound1.u0222", 0x200000, 0x080000, CRC(b7bd3703) SHA1(6427a7e6de10d6743d6e64b984a1d1c647f5643a) ) |
| 2721 | 2721 | ROM_END |
| 2722 | 2722 | |
| 2723 | ROM_START(rdft2u) /* SPI Cart, USA */ | |
| 2724 | ROM_REGION32_LE(0x200000, "user1", 0) /* i386 program */ | |
| 2725 | ROM_LOAD32_BYTE("1.bin", 0x000000, 0x80000, CRC(b7d6c866) SHA1(eefe63dfc641c3904dd150a10ffeb68137068725) ) | |
| 2726 | ROM_LOAD32_BYTE("2.bin", 0x000001, 0x80000, CRC(ff7747c5) SHA1(7481d0484001ff7367af56e8ea99f985cce405f2) ) | |
| 2727 | ROM_LOAD32_BYTE("3.bin", 0x000002, 0x80000, CRC(86e3d1a8) SHA1(2757cfda57c82dd0f66427caf54eb1f40e85740d) ) | |
| 2728 | ROM_LOAD32_BYTE("4.bin", 0x000003, 0x80000, CRC(2e409a76) SHA1(cf90aa14a07b5aa861f6f7cc9b1968171e532557) ) | |
| 2729 | ||
| 2730 | ROM_REGION( 0x30000, "gfx1", 0) | |
| 2731 | ROM_LOAD24_BYTE("fix0.u0524", 0x000001, 0x10000, CRC(6fdf4cf6) SHA1(7e9d4a49e829dfdc373c0f5acfbe8c7a91ac115b) ) | |
| 2732 | ROM_LOAD24_BYTE("fix1.u0518", 0x000000, 0x10000, CRC(69b7899b) SHA1(d3cacd4ef4d2c95d803403101beb9d4be75fae61) ) | |
| 2733 | ROM_LOAD24_BYTE("fixp.u0514", 0x000002, 0x10000, CRC(99a5fece) SHA1(44ae95d650ed6e00202d3438f5f91a5e52e319cb) ) | |
| 2734 | ||
| 2735 | ROM_REGION( 0xc00000, "gfx2", 0) /* background layer roms */ | |
| 2736 | ROM_LOAD24_WORD("bg-1d.u0535", 0x000000, 0x400000, CRC(6143f576) SHA1(c034923d0663d9ef24357a03098b8cb81dbab9f8) ) | |
| 2737 | ROM_LOAD24_BYTE("bg-1p.u0537", 0x000002, 0x200000, CRC(55e64ef7) SHA1(aae991268948d07342ee8ba1b3761bd180aab8ec) ) | |
| 2738 | ROM_LOAD24_WORD("bg-2d.u0536", 0x600000, 0x400000, CRC(c607a444) SHA1(dc1aa96a42e9394ca6036359670a4ec6f830c96d) ) | |
| 2739 | ROM_LOAD24_BYTE("bg-2p.u0538", 0x600002, 0x200000, CRC(f0830248) SHA1(6075df96b49e70d2243fef691e096119e7a4d044) ) | |
| 2740 | ||
| 2741 | ROM_REGION( 0x1200000, "gfx3", 0) /* sprites */ | |
| 2742 | ROM_LOAD("obj3.u0434", 0x0000000, 0x400000, CRC(e08f42dc) SHA1(5188d71d4355eaf43ea8893b4cfc4fe80cc24f41) ) | |
| 2743 | ROM_LOAD("obj3b.u0433", 0x0400000, 0x200000, CRC(1b6a523c) SHA1(99a420dbc8e22e7832ccda7cec9fa661a2a2687a) ) | |
| 2744 | ROM_LOAD("obj2.u0431", 0x0600000, 0x400000, CRC(7aeadd8e) SHA1(47103c0579240c5b1add4d0b164eaf76f5fa97f0) ) | |
| 2745 | ROM_LOAD("obj2b.u0432", 0x0a00000, 0x200000, CRC(5d790a5d) SHA1(1ed5d4ad4c9a7e505ce35dcc90d184c26ce891dc) ) | |
| 2746 | ROM_LOAD("obj1.u0429", 0x0c00000, 0x400000, CRC(c2c50f02) SHA1(b81397b5800c6d49f58b7ac7ff6eac56da3c5257) ) | |
| 2747 | ROM_LOAD("obj1b.u0430", 0x1000000, 0x200000, CRC(5259321f) SHA1(3c70c1147e49f81371d0f60f7108d9718d56faf4) ) | |
| 2748 | ||
| 2749 | ROM_REGION(0x200000, "ymf", ROMREGION_ERASE00) | |
| 2750 | ||
| 2751 | ROM_REGION(0x280000, "user2", ROMREGION_ERASE00) /* sound roms */ | |
| 2752 | ROM_LOAD("pcm.u0217", 0x000000, 0x200000, CRC(2edc30b5) SHA1(c25d690d633657fc3687636b9070f36bd305ae06) ) | |
| 2753 | ROM_LOAD("sound1.u0222", 0x200000, 0x080000, CRC(b7bd3703) SHA1(6427a7e6de10d6743d6e64b984a1d1c647f5643a) ) | |
| 2754 | ROM_END | |
| 2755 | ||
| 2723 | 2756 | ROM_START(rdft2j) /* SPI Cart, Japan */ |
| 2724 | 2757 | ROM_REGION32_LE(0x200000, "user1", 0) /* i386 program */ |
| 2725 | 2758 | ROM_LOAD32_BYTE("prg0.sei", 0x000000, 0x80000, CRC(a60c4e7c) SHA1(7789b029d0ac084c7e5e662a7168edaed8f11633) ) |
| r4184 | r4185 | |
| 3156 | 3189 | GAME( 1997, rdft2a, rdft2, spi, spi_2button, rdft2, ROT270, "Seibu Kaihatsu (Metrotainment license)", "Raiden Fighters 2 (Asia, Metrotainment license, SPI)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) |
| 3157 | 3190 | GAME( 1997, rdft2j, rdft2, spi, spi_2button, rdft2, ROT270, "Seibu Kaihatsu", "Raiden Fighters 2 (Japan, SPI)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) |
| 3158 | 3191 | GAME( 1997, rdft2t, rdft2, spi, spi_2button, rdft2, ROT270, "Seibu Kaihatsu", "Raiden Fighters 2 (Taiwan, SPI)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) |
| 3192 | GAME( 1997, rdft2u, rdft2, spi, spi_2button, rdft2, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden Fighters 2 (USA, SPI)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) | |
| 3159 | 3193 | |
| 3160 | 3194 | GAME( 1998, rfjet, 0, spi, spi_2button, rfjet, ROT270, "Seibu Kaihatsu (Tuning license)", "Raiden Fighters Jet", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) |
| 3161 | 3195 | GAME( 1998, rfjetu, rfjet, spi, spi_2button, rfjet, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden Fighters Jet (US)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) |
| r4184 | r4185 | |
|---|---|---|
| 30 | 30 | #include "sound/ay8910.h" |
| 31 | 31 | #include "cpu/mcs48/mcs48.h" |
| 32 | 32 | |
| 33 | #define CPU_CLOCK XTAL_7_8643MHz | |
| 34 | ||
| 33 | 35 | static tilemap *bg_tilemap; |
| 34 | 36 | |
| 35 | 37 | static UINT8 p1, p2, prog, bus; |
| 36 | 38 | |
| 37 | static UINT8 *pkr_cmos_ram; | |
| 39 | static UINT8 *pkr_io_ram; | |
| 40 | static UINT8 active_bank = 0; | |
| 38 | 41 | |
| 42 | static UINT16 video_ram[0x0400]; | |
| 43 | static UINT8 color_ram[0x0400]; | |
| 39 | 44 | |
| 45 | ||
| 40 | 46 | /***************** |
| 41 | 47 | * Write Handlers * |
| 42 | 48 | ******************/ |
| r4184 | r4185 | |
| 53 | 59 | |
| 54 | 60 | static WRITE8_HANDLER( prog_w ) |
| 55 | 61 | { |
| 56 | /* this is written via an out to port 4, but unless there is an 8243 port expander, | |
| 57 | it is more likely that the port 4 output is used to toggle the PROG line; see | |
| 58 | videopkr */ | |
| 59 | 62 | prog = data; |
| 63 | ||
| 64 | // Bankswitch Program Memory | |
| 65 | if (prog == 0x01) | |
| 66 | { | |
| 67 | active_bank++; | |
| 68 | if (active_bank == 2) | |
| 69 | active_bank = 0; | |
| 70 | ||
| 71 | memory_set_bank(space->machine, 1, active_bank); | |
| 72 | } | |
| 60 | 73 | } |
| 61 | 74 | |
| 62 | 75 | static WRITE8_HANDLER( bus_w ) |
| r4184 | r4185 | |
| 64 | 77 | bus = data; |
| 65 | 78 | } |
| 66 | 79 | |
| 67 | static WRITE8_HANDLER( drw80pkr_ | |
| 80 | static WRITE8_HANDLER( drw80pkr_i | |
| 68 | 81 | { |
| 69 | //if (p2 == 0xc7) CRTC Register | |
| 70 | //if (p2 == 0xd7) CRTC Address | |
| 71 | pkr_cmos_ram[offset] = data; | |
| 82 | static UINT16 n_offs; | |
| 83 | static UINT16 n_data; | |
| 84 | static UINT16 add; | |
| 85 | ||
| 86 | ||
| 87 | if (p2 == 0x3f) // write cg address | |
| 88 | { | |
| 89 | if (p1 == 0xbf || p1 == 0x3f) | |
| 90 | { | |
| 91 | n_data = data; | |
| 92 | } | |
| 93 | if (p1 == 0x7f && data != 0x0f) | |
| 94 | { | |
| 95 | n_data = data + 0x100; | |
| 96 | } | |
| 97 | ||
| 98 | add = ((p1 & 0xc0) << 2); | |
| 99 | if (p1 == 0x3f && offset >= 0xf0) | |
| 100 | { | |
| 101 | add = 0x200; | |
| 102 | } | |
| 103 | n_offs = (add) + (0xff-offset); | |
| 104 | ||
| 105 | video_ram[n_offs] = n_data; | |
| 106 | ||
| 107 | tilemap_mark_tile_dirty(bg_tilemap, n_offs); | |
| 108 | } | |
| 109 | ||
| 110 | if (p2 == 0x7f) // write palette | |
| 111 | { | |
| 112 | n_offs = ((p1 & 0xc0) << 2 ) + (0xff-offset); | |
| 113 | ||
| 114 | color_ram[n_offs] = 0;//data & 0x0f; | |
| 115 | ||
| 116 | if (data < 0x10) | |
| 117 | video_ram[n_offs] = video_ram[n_offs] + 0x100; | |
| 118 | ||
| 119 | tilemap_mark_tile_dirty(bg_tilemap, n_offs); | |
| 120 | } | |
| 121 | ||
| 122 | // ay8910_control_port_0_w | |
| 123 | if (p1 == 0xfc && p2 == 0xff && offset == 0x00) | |
| 124 | ay8910_control_port_0_w(space, 0, data); | |
| 125 | ||
| 126 | // ay8910_write_port_0_w | |
| 127 | if (p1 == 0xfe && p2 == 0xff && offset == 0x00) | |
| 128 | ay8910_write_port_0_w(space, 1, data); | |
| 129 | ||
| 130 | // CRTC Register | |
| 131 | // R0 = 0x1f(31) Horizontal Total | |
| 132 | // R1 = 0x18(24) Horizontal Displayed | |
| 133 | // R2 = 0x1a(26) Horizontal Sync Position | |
| 134 | // R3 = 0x34(52) HSYNC/VSYNC Widths | |
| 135 | // R4 = 0x1f(31) Vertical Total | |
| 136 | // R5 = 0x01(01) Vertical Total Adjust | |
| 137 | // R6 = 0x1b(27) Vertical Displayed | |
| 138 | // R7 = 0x1c(28) Vertical Sync Position | |
| 139 | // R8 = 0x10 Mode Control | |
| 140 | // Non-interlace | |
| 141 | // Straight Binary - Ram Addressing | |
| 142 | // Shared Memory - Ram Access | |
| 143 | // Delay Display Enable one character time | |
| 144 | // No Delay Cursor Skew | |
| 145 | // R9 = 0x07(07) Scan Line | |
| 146 | // R10 = 0x00 Cursor Start | |
| 147 | // R11 = 0x00 Cursor End | |
| 148 | // R12 = 0x00 Display Start Address (High) | |
| 149 | // R13 = 0x00 Display Start Address (Low) | |
| 150 | //if (p1 == 0xff && p2 == 0xc7) | |
| 151 | ||
| 152 | // CRTC Address | |
| 153 | //if (p1 == 0xff && p2 == 0xd7) | |
| 154 | ||
| 155 | pkr_io_ram[offset] = data; | |
| 72 | 156 | } |
| 73 | 157 | |
| 74 | 158 | /**************** |
| r4184 | r4185 | |
| 90 | 174 | return bus; |
| 91 | 175 | } |
| 92 | 176 | |
| 93 | static READ8_HANDLER( drw80pkr_ | |
| 177 | static READ8_HANDLER( drw80pkr_i | |
| 94 | 178 | { |
| 95 | return pkr_ | |
| 179 | return pkr_i | |
| 96 | 180 | } |
| 97 | 181 | |
| 182 | ||
| 98 | 183 | /**************************** |
| 99 | 184 | * Video/Character functions * |
| 100 | 185 | ****************************/ |
| 101 | 186 | |
| 102 | 187 | static TILE_GET_INFO( get_bg_tile_info ) |
| 103 | 188 | { |
| 104 | int vr = 0; | |
| 105 | int code = vr; | |
| 106 | int color = 0; | |
| 189 | int color = color_ram[tile_index]; | |
| 190 | int code = video_ram[tile_index]; | |
| 107 | 191 | |
| 108 | 192 | SET_TILE_INFO(0, code, color, 0); |
| 109 | 193 | } |
| 110 | 194 | |
| 111 | 195 | static VIDEO_START( drw80pkr ) |
| 112 | 196 | { |
| 113 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 4 | |
| 197 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 24 | |
| 114 | 198 | } |
| 115 | 199 | |
| 116 | 200 | static VIDEO_UPDATE( drw80pkr ) |
| r4184 | r4185 | |
| 164 | 248 | static const gfx_layout charlayout = |
| 165 | 249 | { |
| 166 | 250 | 8,8, /* 8x8 characters */ |
| 167 | | |
| 251 | RGN_FRAC(1,2) | |
| 168 | 252 | 2, /* 2 bitplanes */ |
| 169 | { 0x200*8*8*1, 0x200*8*8*0 }, /* bitplane offsets */ | |
| 170 | { 0, 1, 2, 3, 4, 5, 6, 7 }, | |
| 171 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, | |
| 253 | { RGN_FRAC(1,2), 0 }, | |
| 254 | { STEP8(0,1) }, | |
| 255 | { STEP8(0,8) }, | |
| 172 | 256 | 8*8 |
| 173 | 257 | }; |
| 174 | 258 | |
| r4184 | r4185 | |
| 188 | 272 | |
| 189 | 273 | static DRIVER_INIT( drw80pkr ) |
| 190 | 274 | { |
| 191 | ||
| 275 | memory_configure_bank(machine, 1, 0, 2, memory_region(machine, "main"), 0x1000); | |
| 192 | 276 | } |
| 193 | 277 | |
| 194 | 278 | |
| r4184 | r4185 | |
| 197 | 281 | *************************/ |
| 198 | 282 | |
| 199 | 283 | static ADDRESS_MAP_START( drw80pkr_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 200 | AM_RANGE(0x0000, 0x1fff) AM_R | |
| 284 | AM_RANGE(0x0000, 0x1fff) AM_R | |
| 201 | 285 | ADDRESS_MAP_END |
| 202 | 286 | |
| 203 | 287 | static ADDRESS_MAP_START( drw80pkr_io_map, ADDRESS_SPACE_IO, 8 ) |
| 204 | AM_RANGE(0x00, 0xff) AM_READWRITE(drw80pkr_ | |
| 288 | AM_RANGE(0x00, 0xff) AM_READWRITE(drw80pkr_i | |
| 205 | 289 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_RAM |
| 206 | 290 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(p1_r, p1_w) |
| 207 | 291 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(p2_r, p2_w) |
| r4184 | r4185 | |
| 223 | 307 | |
| 224 | 308 | static MACHINE_DRIVER_START( drw80pkr ) |
| 225 | 309 | // basic machine hardware |
| 226 | MDRV_CPU_ADD("main", I8039, | |
| 310 | MDRV_CPU_ADD("main", I8039, CPU_CLOCK) | |
| 227 | 311 | MDRV_CPU_PROGRAM_MAP(drw80pkr_map, 0) |
| 228 | 312 | MDRV_CPU_IO_MAP(drw80pkr_io_map, 0) |
| 229 | 313 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) |
| r4184 | r4185 | |
| 257 | 341 | ROM_START( drw80pkr ) |
| 258 | 342 | ROM_REGION( 0x2000, "main", 0 ) |
| 259 | 343 | ROM_LOAD( "pm0.u81", 0x0000, 0x1000, CRC(0f3e97d2) SHA1(aa9e4015246284f32435d7320de667e075412e5b) ) |
| 260 | ||
| 344 | | |
| 261 | 345 | |
| 262 | ROM_REGION( 0x100000, "gfx1", ROMREGION_DISPOSE ) | |
| 346 | ||
| 347 | ROM_REGION( 0x002000, "gfx1", ROMREGION_DISPOSE ) | |
| 263 | 348 | ROM_LOAD( "cg0-a.u74", 0x0000, 0x1000, CRC(97f5eb92) SHA1(f6c7bb42ccef8a78e8d56104ad942ae5b8e5b0df) ) |
| 264 | 349 | ROM_LOAD( "cg1-a.u76", 0x1000, 0x1000, CRC(2a3a750d) SHA1(db6183d11b2865b011c3748dc472cf5858dde78f) ) |
| 265 | 350 |
| r4184 | r4185 | |
|---|---|---|
| 52 | 52 | |
| 53 | 53 | #include "driver.h" |
| 54 | 54 | #include "cpu/nec/nec.h" |
| 55 | #include "deprecat.h" | |
| 56 | 55 | #include "audio/seibu.h" |
| 57 | 56 | #include "sound/3812intf.h" |
| 57 | #include "includes/sei_crtc.h" | |
| 58 | 58 | |
| 59 | 59 | #define GOODEJAN_MHZ1 7159090 |
| 60 | 60 | #define GOODEJAN_MHZ2 16000000 |
| 61 | 61 | #define GOODEJAN_MHZ3 12000000 |
| 62 | 62 | |
| 63 | extern UINT16 *goodejan_bgvram, *goodejan_txvram; | |
| 63 | extern UINT16 *seibucrtc_sc0vram,*seibucrtc_sc1vram,*seibucrtc_sc2vram,*seibucrtc_sc3vram; | |
| 64 | extern UINT16 *seibucrtc_vregs; | |
| 65 | extern UINT16 seibucrtc_sc0bank; | |
| 64 | 66 | static UINT16 goodejan_mux_data; |
| 65 | 67 | |
| 66 | WRITE16_HANDLER( goodejan_bgvram_w ); | |
| 67 | WRITE16_HANDLER( goodejan_txvram_w ); | |
| 68 | WRITE16_HANDLER( goodejan_bg_scrollx_w ); | |
| 69 | WRITE16_HANDLER( goodejan_bg_scrolly_w ); | |
| 70 | WRITE16_HANDLER( goodejan_layer_en_w ); | |
| 71 | WRITE16_HANDLER( goodejan_gfxbank_w ); | |
| 68 | WRITE16_HANDLER( goodejan_gfxbank_w ) | |
| 69 | { | |
| 70 | seibucrtc_sc0bank_w((data & 0x100)>>8);// = (data & 0x100)>>8; | |
| 71 | } | |
| 72 | 72 | |
| 73 | VIDEO_START( goodejan ); | |
| 74 | VIDEO_UPDATE( goodejan ); | |
| 75 | ||
| 76 | 73 | /* Multiplexer device for the mahjong panel */ |
| 77 | 74 | static READ16_HANDLER( mahjong_panel_r ) |
| 78 | 75 | { |
| r4184 | r4185 | |
| 98 | 95 | |
| 99 | 96 | static ADDRESS_MAP_START( goodejan_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 100 | 97 | AM_RANGE(0x00000, 0x0afff) AM_RAM |
| 101 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM_WRITE(goodejan_bgvram_w) AM_BASE(&goodejan_bgvram) | |
| 98 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM_WRITE(seibucrtc_sc0vram_w) AM_BASE(&seibucrtc_sc0vram) | |
| 99 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM_WRITE(seibucrtc_sc3vram_w) AM_BASE(&seibucrtc_sc3vram) | |
| 102 | 100 | AM_RANGE(0x0d000, 0x0dfff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) |
| 103 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM_WRITE(goodejan_txvram_w) AM_BASE(&goodejan_txvram) | |
| 101 | /*Guess: these two aren't used/initialized at all.*/ | |
| 102 | AM_RANGE(0x0e000, 0x0e7ff) AM_RAM_WRITE(seibucrtc_sc1vram_w) AM_BASE(&seibucrtc_sc1vram) | |
| 103 | AM_RANGE(0x0e800, 0x0efff) AM_RAM_WRITE(seibucrtc_sc2vram_w) AM_BASE(&seibucrtc_sc2vram) | |
| 104 | 104 | AM_RANGE(0x0f800, 0x0ffff) AM_RAM AM_BASE(&spriteram16) |
| 105 | 105 | AM_RANGE(0xc0000, 0xfffff) AM_ROM |
| 106 | 106 | ADDRESS_MAP_END |
| r4184 | r4185 | |
| 108 | 108 | /*totmejan CRT is at 8000-804f,goodejan is at 8040-807f(808f but not tested)*/ |
| 109 | 109 | static ADDRESS_MAP_START( common_io_map, ADDRESS_SPACE_IO, 16 ) |
| 110 | 110 | AM_RANGE(0x9000, 0x9001) AM_WRITE(goodejan_gfxbank_w) |
| 111 | AM_RANGE(0x8020, 0x8023) AM_WRITENOP | |
| 112 | 111 | AM_RANGE(0xb000, 0xb003) AM_WRITENOP |
| 113 | 112 | AM_RANGE(0xb004, 0xb005) AM_WRITE(mahjong_panel_w) |
| 114 | 113 | |
| 115 | 114 | AM_RANGE(0xc000, 0xc001) AM_READ_PORT("DSW1") |
| 116 | 115 | AM_RANGE(0xc002, 0xc003) AM_READ(mahjong_panel_r) |
| 117 | AM_RANGE(0xc004, 0xc005) AM_READ_PORT("DSW2") // | |
| 116 | AM_RANGE(0xc004, 0xc005) AM_READ_PORT("DSW2") // | |
| 118 | 117 | AM_RANGE(0xd000, 0xd00f) AM_READWRITE(seibu_main_word_r, seibu_main_word_w) |
| 119 | 118 | ADDRESS_MAP_END |
| 120 | 119 | |
| 121 | 120 | static ADDRESS_MAP_START( totmejan_io_map, ADDRESS_SPACE_IO, 16 ) |
| 122 | AM_RANGE(0x80 | |
| 121 | AM_RANGE(0x8000, 0x804f) AM_RAM_WRITE(s | |
| 123 | 122 | ADDRESS_MAP_END |
| 124 | 123 | |
| 125 | 124 | static ADDRESS_MAP_START( goodejan_io_map, ADDRESS_SPACE_IO, 16 ) |
| 126 | AM_RANGE(0x805c, 0x805d) AM_WRITE(goodejan_layer_en_w ) | |
| 127 | AM_RANGE(0x8060, 0x8061) AM_WRITE(goodejan_bg_scrollx_w ) | |
| 128 | AM_RANGE(0x8062, 0x8063) AM_WRITE(goodejan_bg_scrolly_w ) | |
| 125 | AM_RANGE(0x8040, 0x807f) AM_RAM_WRITE(seibucrtc_vregs_w) AM_BASE(&seibucrtc_vregs) | |
| 129 | 126 | ADDRESS_MAP_END |
| 130 | 127 | |
| 131 | 128 | static INPUT_PORTS_START( goodejan ) |
| r4184 | r4185 | |
| 313 | 310 | }; |
| 314 | 311 | |
| 315 | 312 | static GFXDECODE_START( goodejan ) |
| 316 | GFXDECODE_ENTRY( "gfx3", 0, tilelayout, 0x200, 0x40 ) /* Sprites */ | |
| 317 | GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0x000, 0x30 ) /* Tiles */ | |
| 318 | GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x100, 0x10 ) /* Text */ | |
| 313 | GFXDECODE_ENTRY( "spr_gfx", 0,tilelayout, 0x200, 0x40 ) /* Sprites */ | |
| 314 | GFXDECODE_ENTRY( "bg_gfx", 0, tilelayout, 0x000, 0x30 ) /* Tiles */ | |
| 315 | GFXDECODE_ENTRY( "md_gfx", 0, tilelayout, 0x300, 0x10 ) /* Text */ | |
| 316 | GFXDECODE_ENTRY( "fg_gfx", 0, tilelayout, 0x600, 0x10 ) /* Tiles */ | |
| 317 | GFXDECODE_ENTRY( "tx_gfx", 0, charlayout, 0x100, 0x10 ) /* Text */ | |
| 319 | 318 | GFXDECODE_END |
| 320 | 319 | |
| 321 | static INTERRUPT_GEN( goodejan_i | |
| 320 | static INTERRUPT_GEN( goodejan_i | |
| 322 | 321 | { |
| 323 | if (cpu_getiloops(device)) | |
| 324 | cpu_set_input_line_and_vector(device,0,HOLD_LINE,0x208/4); | |
| 325 | else | |
| 326 | cpu_set_input_line_and_vector(device,0,HOLD_LINE,0x00c/4); | |
| 322 | cpu_set_input_line_and_vector(device,0,HOLD_LINE,0x208/4); | |
| 323 | /* vector 0x00c is just a reti */ | |
| 327 | 324 | } |
| 328 | 325 | |
| 329 | 326 | static MACHINE_DRIVER_START( goodejan ) |
| r4184 | r4185 | |
| 332 | 329 | MDRV_CPU_ADD("main", V30, GOODEJAN_MHZ2/2) |
| 333 | 330 | MDRV_CPU_PROGRAM_MAP(goodejan_map,0) |
| 334 | 331 | MDRV_CPU_IO_MAP(common_io_map,goodejan_io_map) |
| 335 | MDRV_CPU_VBLANK_INT | |
| 332 | MDRV_CPU_VBLANK_INT | |
| 336 | 333 | |
| 337 | 334 | SEIBU_SOUND_SYSTEM_CPU(GOODEJAN_MHZ1/2) |
| 338 | 335 | |
| r4184 | r4185 | |
| 344 | 341 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 345 | 342 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 346 | 343 | MDRV_SCREEN_SIZE(32*8, 32*8) |
| 347 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
| 344 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) //TODO: dynamic resolution | |
| 348 | 345 | |
| 349 | 346 | MDRV_GFXDECODE(goodejan) |
| 350 | 347 | MDRV_PALETTE_LENGTH(0x1000) |
| 351 | 348 | |
| 352 | MDRV_VIDEO_START(goodejan) | |
| 353 | MDRV_VIDEO_UPDATE(goodejan) | |
| 349 | MDRV_VIDEO_START(seibu_crtc) | |
| 350 | MDRV_VIDEO_UPDATE(seibu_crtc) | |
| 354 | 351 | |
| 355 | 352 | /* sound hardware */ |
| 356 | 353 | SEIBU_SOUND_SYSTEM_YM3812_INTERFACE(GOODEJAN_MHZ1/2,GOODEJAN_MHZ2/16) |
| r4184 | r4185 | |
| 372 | 369 | ROM_CONTINUE( 0x010000, 0x08000 ) |
| 373 | 370 | ROM_COPY( "audio", 0, 0x018000, 0x08000 ) |
| 374 | 371 | |
| 375 | ROM_REGION( 0x20000, "gfx1", ROMREGION_ERASEFF | ROMREGION_DISPOSE ) | |
| 376 | ROM_LOAD16_BYTE( "3.063", 0x00000, 0x10000, CRC(61b5ae88) SHA1(16105a4e97765454079deda8eaa456d60d44e906) ) | |
| 377 | ROM_LOAD16_BYTE( "4.061", 0x00001, 0x10000, CRC(29fb6ad2) SHA1(8a9c4625472daefca7fb73a9ef3717e86c3d632f) ) | |
| 372 | ROM_REGION( 0x080000, "spr_gfx", ROMREGION_DISPOSE ) | |
| 373 | ROM_LOAD( "e-jan.078", 0x000000, 0x080000, CRC(ff9ee9d8) SHA1(5e49e9a666630ca9867ee96b9d2b8d6f503b25df) ) | |
| 378 | 374 | |
| 379 | ROM_REGION( 0x100000, "gfx | |
| 375 | ROM_REGION( 0x100000, "bg_gfx | |
| 380 | 376 | ROM_LOAD( "e-jan.064", 0x000000, 0x100000, CRC(5f6185ee) SHA1(599e4a574672cd1571032e879b3032d06b70e4e2) ) |
| 381 | 377 | |
| 382 | ROM_REGION( 0x080000, "gfx3", ROMREGION_DISPOSE ) | |
| 383 | ROM_LOAD( "e-jan.078", 0x000000, 0x080000, CRC(ff9ee9d8) SHA1(5e49e9a666630ca9867ee96b9d2b8d6f503b25df) ) | |
| 378 | ROM_REGION( 0x20000, "md_gfx", ROMREGION_DISPOSE ) | |
| 379 | /*Empty*/ | |
| 380 | ROM_REGION( 0x20000, "fg_gfx", ROMREGION_DISPOSE ) | |
| 381 | /*Empty*/ | |
| 384 | 382 | |
| 383 | ROM_REGION( 0x20000, "tx_gfx", ROMREGION_ERASEFF | ROMREGION_DISPOSE ) | |
| 384 | ROM_LOAD16_BYTE( "3.063", 0x00000, 0x10000, CRC(61b5ae88) SHA1(16105a4e97765454079deda8eaa456d60d44e906) ) | |
| 385 | ROM_LOAD16_BYTE( "4.061", 0x00001, 0x10000, CRC(29fb6ad2) SHA1(8a9c4625472daefca7fb73a9ef3717e86c3d632f) ) | |
| 386 | ||
| 385 | 387 | ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM samples */ |
| 386 | 388 | ROM_LOAD( "e-jan.0911", 0x00000, 0x80000, CRC(a7fb93c2) SHA1(c2e1300f142032c087c96e1a785af28a6d678947) ) |
| 387 | 389 | |
| r4184 | r4185 | |
| 399 | 401 | ROM_CONTINUE( 0x010000, 0x08000 ) |
| 400 | 402 | ROM_COPY( "audio", 0, 0x018000, 0x08000 ) |
| 401 | 403 | |
| 402 | ROM_REGION( 0x20000, "gfx1", ROMREGION_ERASEFF | ROMREGION_DISPOSE ) | |
| 403 | ROM_LOAD16_BYTE( "3.063", 0x00000, 0x10000, CRC(f355564a) SHA1(35140cc86504d6fdaba00b520d226724bac9f546) ) | |
| 404 | ROM_LOAD16_BYTE( "4.061", 0x00001, 0x10000, CRC(5bdf7225) SHA1(a8eded9dc5be1db20cddbed1ae8c22de1674de2a) ) | |
| 404 | ROM_REGION( 0x080000, "spr_gfx", ROMREGION_DISPOSE ) | |
| 405 | ROM_LOAD( "e_jan2obj.078", 0x000000, 0x080000, CRC(0f892ef2) SHA1(188ae43db1c48fb6870aa45c64718e901831499b) ) | |
| 405 | 406 | |
| 406 | ROM_REGION( 0x100000, "gfx | |
| 407 | ROM_REGION( 0x100000, "bg_gfx | |
| 407 | 408 | ROM_LOAD( "e_jan2scr.064", 0x000000, 0x100000, CRC(71654822) SHA1(fe2a128413999085e321e455aeebda0360d38cb8) ) |
| 408 | 409 | |
| 409 | ROM_REGION( 0x080000, "gfx3", ROMREGION_DISPOSE ) | |
| 410 | ROM_LOAD( "e_jan2obj.078", 0x000000, 0x080000, CRC(0f892ef2) SHA1(188ae43db1c48fb6870aa45c64718e901831499b) ) | |
| 410 | ROM_REGION( 0x20000, "md_gfx", ROMREGION_DISPOSE ) | |
| 411 | /*Empty*/ | |
| 412 | ROM_REGION( 0x20000, "fg_gfx", ROMREGION_DISPOSE ) | |
| 413 | /*Empty*/ | |
| 411 | 414 | |
| 415 | ROM_REGION( 0x20000, "tx_gfx", ROMREGION_ERASEFF | ROMREGION_DISPOSE ) | |
| 416 | ROM_LOAD16_BYTE( "3.063", 0x00000, 0x10000, CRC(f355564a) SHA1(35140cc86504d6fdaba00b520d226724bac9f546) ) | |
| 417 | ROM_LOAD16_BYTE( "4.061", 0x00001, 0x10000, CRC(5bdf7225) SHA1(a8eded9dc5be1db20cddbed1ae8c22de1674de2a) ) | |
| 418 | ||
| 412 | 419 | ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM samples */ |
| 413 | 420 | ROM_LOAD( "e-jan.911", 0x00000, 0x80000, CRC(6d2cbc35) SHA1(61f47e2a94b8877906224f46d8301a26a0b9e55f) ) |
| 414 | 421 | |
| r4184 | r4185 | |
| 426 | 433 | ROM_CONTINUE( 0x010000, 0x08000 ) |
| 427 | 434 | ROM_COPY( "audio", 0, 0x018000, 0x08000 ) |
| 428 | 435 | |
| 429 | ROM_REGION( 0x20000, "gfx1", ROMREGION_ERASEFF | ROMREGION_DISPOSE ) | |
| 430 | ROM_LOAD16_BYTE( "3.063", 0x00000, 0x10000, CRC(f355564a) SHA1(35140cc86504d6fdaba00b520d226724bac9f546) ) | |
| 431 | ROM_LOAD16_BYTE( "4.061", 0x00001, 0x10000, CRC(5bdf7225) SHA1(a8eded9dc5be1db20cddbed1ae8c22de1674de2a) ) | |
| 436 | ROM_REGION( 0x080000, "spr_gfx", ROMREGION_DISPOSE ) | |
| 437 | ROM_LOAD( "e_jan2obj.078", 0x000000, 0x080000, CRC(0f892ef2) SHA1(188ae43db1c48fb6870aa45c64718e901831499b) ) | |
| 432 | 438 | |
| 433 | ROM_REGION( 0x100000, "gfx | |
| 439 | ROM_REGION( 0x100000, "bg_gfx | |
| 434 | 440 | ROM_LOAD( "e_jan2scr.064", 0x000000, 0x100000, CRC(71654822) SHA1(fe2a128413999085e321e455aeebda0360d38cb8) ) |
| 435 | 441 | |
| 436 | ROM_REGION( 0x080000, "gfx3", ROMREGION_DISPOSE ) | |
| 437 | ROM_LOAD( "e_jan2obj.078", 0x000000, 0x080000, CRC(0f892ef2) SHA1(188ae43db1c48fb6870aa45c64718e901831499b) ) | |
| 442 | ROM_REGION( 0x20000, "md_gfx", ROMREGION_DISPOSE ) | |
| 443 | /*Empty*/ | |
| 444 | ROM_REGION( 0x20000, "fg_gfx", ROMREGION_DISPOSE ) | |
| 445 | /*Empty*/ | |
| 438 | 446 | |
| 447 | ROM_REGION( 0x20000, "tx_gfx", ROMREGION_ERASEFF | ROMREGION_DISPOSE ) | |
| 448 | ROM_LOAD16_BYTE( "3.063", 0x00000, 0x10000, CRC(f355564a) SHA1(35140cc86504d6fdaba00b520d226724bac9f546) ) | |
| 449 | ROM_LOAD16_BYTE( "4.061", 0x00001, 0x10000, CRC(5bdf7225) SHA1(a8eded9dc5be1db20cddbed1ae8c22de1674de2a) ) | |
| 450 | ||
| 439 | 451 | ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM samples */ |
| 440 | 452 | ROM_LOAD( "e-jan.911", 0x00000, 0x80000, CRC(6d2cbc35) SHA1(61f47e2a94b8877906224f46d8301a26a0b9e55f) ) |
| 441 | 453 |
| r4184 | r4185 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | Sega Y-board hardware |
| 4 | 4 | |
| 5 | Games supported: | |
| 6 | ||
| 7 | G-LOC Air Battle | |
| 8 | G-LOC R360 | |
| 9 | Galaxy Force 2 | |
| 10 | Power Drift | |
| 11 | Rail Chase | |
| 12 | Strike Fighter | |
| 13 | ||
| 14 | Known games currently not dumped: | |
| 15 | ||
| 16 | Galaxy Force | |
| 17 | ||
| 5 | 18 | **************************************************************************** |
| 6 | 19 | |
| 7 | 20 | Known bugs: |
| r4184 | r4185 | |
| 1007 | 1020 | /************************************************************************************************************************** |
| 1008 | 1021 | ************************************************************************************************************************** |
| 1009 | 1022 | ************************************************************************************************************************** |
| 1023 | Galaxy Force, Sega Y-board | |
| 1024 | Sega Game ID: 831-6614 (two PCB board stack) | |
| 1025 | ||
| 1026 | NOTE: An original PCB is very hard to locate intact. Most of these boards were upgraded to Galaxy Force 2 through a | |
| 1027 | chip swap upgrade. | |
| 1028 | ||
| 1029 | */ | |
| 1030 | ||
| 1031 | /************************************************************************************************************************** | |
| 1032 | ************************************************************************************************************************** | |
| 1033 | ************************************************************************************************************************** | |
| 1010 | 1034 | Galaxy Force 2, Sega Y-board |
| 1011 | 1035 | CPU: 68000 (317-????) |
| 1012 | 1036 | */ |
| r0 | r4185 | |
|---|---|---|
| 1 | /***************************************************************************** | |
| 2 | ||
| 3 | Champion Poker by IGS (documented by Mirko Buffoni) | |
| 4 | --- | |
| 5 | ||
| 6 | Memory Layout (refers to CSK227IT. Others may have different addresses) | |
| 7 | ||
| 8 | ROM: 0000-efff | |
| 9 | RAM: f000-ffff | |
| 10 | ||
| 11 | --- | |
| 12 | ||
| 13 | I/O Ports | |
| 14 | ||
| 15 | Palette: 2000-27ff (low byte) | |
| 16 | 2800-2fff (high byte) | |
| 17 | VideoRAM: 7000-77ff | |
| 18 | ColorRAM: 7800-7fff | |
| 19 | DSW1-5: 4000-4004 (see input ports section below) | |
| 20 | InputPorts: 50a0 (unused in this game) | |
| 21 | 5081-5082 (Coins and Keyboard) | |
| 22 | 5091 (Keyboard) | |
| 23 | Expansion: 8000-ffff (R) Used to read from an expansion rom | |
| 24 | ||
| 25 | Unknown: 5080 (RW) (possibly related to ticket/hopper) | |
| 26 | 5090-5091 (RW) (possibly related to eprom counters) | |
| 27 | 50b0-50b1 (W) (OPL2 compatible chip) | |
| 28 | 5083 (W) (used only at reset, maybe) | |
| 29 | 1000-10ff (W) ??? | |
| 30 | 6000-67ff (W) ??? | |
| 31 | 6800-6fff (W) Expansion video layer (used with ability) | |
| 32 | ||
| 33 | --- | |
| 34 | ||
| 35 | Timing: | |
| 36 | ||
| 37 | Game is synchronized with VBLANK. It uses IRQ & NMI interrupts. | |
| 38 | During a frame, there must be 4 IRQs and 4 NMIs in order to play | |
| 39 | to the correct speed. | |
| 40 | ||
| 41 | --- | |
| 42 | ||
| 43 | Notes about palette: | |
| 44 | Charset is 6 bit depth (thus 64 colors of granularity) | |
| 45 | Colortable is made up of 2 entries of 64 bytes for each palette, | |
| 46 | splitted, and colorinfo is stored to form the following word: | |
| 47 | ||
| 48 | xBBBBBGGGGGRRRRR (Bit 15 is never used) | |
| 49 | ||
| 50 | --- | |
| 51 | ||
| 52 | FIX: csk227it has video issues, as after Ability game, bg_tilemap is not reset | |
| 53 | so there must be some bg_enable command which I couldn't find, or rom is | |
| 54 | from a beta version which has transparency issues. This doesn't happen with | |
| 55 | csk234it or New Champion Skill. | |
| 56 | Insert credits with Key-In and press Pay-out to play ability game, and wait | |
| 57 | for attract-mode to show cubes (not cards), which are transparent and reveal | |
| 58 | background tilemap. | |
| 59 | ||
| 60 | *****************************************************************************/ | |
| 61 | ||
| 62 | ||
| 63 | #include "driver.h" | |
| 64 | #include "deprecat.h" | |
| 65 | #include "cpu/z80/z80.h" | |
| 66 | #include "sound/2413intf.h" | |
| 67 | #include "igspoker.lh" | |
| 68 | ||
| 69 | ||
| 70 | ||
| 71 | ||
| 72 | ||
| 73 | static int nmi_enable, bg_enable, hopper; | |
| 74 | ||
| 75 | static MACHINE_RESET( igs ) | |
| 76 | { | |
| 77 | nmi_enable = 0; | |
| 78 | hopper = 0; | |
| 79 | bg_enable = 1; | |
| 80 | } | |
| 81 | ||
| 82 | static INTERRUPT_GEN( igs_interrupt ) | |
| 83 | { | |
| 84 | if (cpu_getiloops(device) % 2) { | |
| 85 | cpu_set_input_line(device, 0, HOLD_LINE); | |
| 86 | } else { | |
| 87 | if (nmi_enable) | |
| 88 | cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); | |
| 89 | } | |
| 90 | } | |
| 91 | ||
| 92 | static READ8_HANDLER( igs_irqack_r ) | |
| 93 | { | |
| 94 | return 0; | |
| 95 | } | |
| 96 | ||
| 97 | static WRITE8_HANDLER( igs_irqack_w ) | |
| 98 | { | |
| 99 | // cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); | |
| 100 | } | |
| 101 | ||
| 102 | ||
| 103 | ||
| 104 | static UINT8 *fg_tile_ram, *fg_color_ram, *bg_tile_ram; | |
| 105 | static tilemap *fg_tilemap, *bg_tilemap; | |
| 106 | ||
| 107 | static TILE_GET_INFO( get_bg_tile_info ) | |
| 108 | { | |
| 109 | int code = bg_tile_ram[tile_index]; | |
| 110 | SET_TILE_INFO(1 + (tile_index & 3), code, 0, 0); | |
| 111 | } | |
| 112 | ||
| 113 | static TILE_GET_INFO( get_fg_tile_info ) | |
| 114 | { | |
| 115 | int code = fg_tile_ram[tile_index] | (fg_color_ram[tile_index] << 8); | |
| 116 | int tile = code & 0x1fff; | |
| 117 | SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0); | |
| 118 | } | |
| 119 | ||
| 120 | static WRITE8_HANDLER( bg_tile_w ) | |
| 121 | { | |
| 122 | bg_tile_ram[offset] = data; | |
| 123 | tilemap_mark_tile_dirty(bg_tilemap,offset); | |
| 124 | } | |
| 125 | ||
| 126 | static WRITE8_HANDLER( fg_tile_w ) | |
| 127 | { | |
| 128 | fg_tile_ram[offset] = data; | |
| 129 | tilemap_mark_tile_dirty(fg_tilemap,offset); | |
| 130 | } | |
| 131 | ||
| 132 | static WRITE8_HANDLER( fg_color_w ) | |
| 133 | { | |
| 134 | fg_color_ram[offset] = data; | |
| 135 | tilemap_mark_tile_dirty(fg_tilemap,offset); | |
| 136 | } | |
| 137 | ||
| 138 | static VIDEO_START(igs_video) | |
| 139 | { | |
| 140 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 32, 64, 8); | |
| 141 | fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 142 | tilemap_set_transparent_pen(fg_tilemap, 0); | |
| 143 | } | |
| 144 | ||
| 145 | static VIDEO_UPDATE(igs_video) | |
| 146 | { | |
| 147 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); | |
| 148 | ||
| 149 | // FIX: CSK227IT must have some way to disable background, or wrong gfx? | |
| 150 | if (bg_enable) tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 151 | ||
| 152 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); | |
| 153 | ||
| 154 | return 0; | |
| 155 | } | |
| 156 | ||
| 157 | static UINT8 out[3]; | |
| 158 | ||
| 159 | static void show_out(void) | |
| 160 | { | |
| 161 | #ifdef MAME_DEBUG | |
| 162 | popmessage("%02x %02x", out[0], out[1]); | |
| 163 | #endif | |
| 164 | } | |
| 165 | ||
| 166 | static WRITE8_HANDLER( igs_nmi_and_coins_w ) | |
| 167 | { | |
| 168 | coin_counter_w(0, data & 0x01); // coin_a | |
| 169 | coin_counter_w(1, data & 0x04); // coin_c | |
| 170 | coin_counter_w(2, data & 0x08); // key in | |
| 171 | coin_counter_w(3, data & 0x10); // coin out mech | |
| 172 | ||
| 173 | set_led_status(6, data & 0x20); // led for coin out / hopper active | |
| 174 | ||
| 175 | nmi_enable = data & 0x80; // nmi enable? | |
| 176 | ||
| 177 | out[0] = data; | |
| 178 | show_out(); | |
| 179 | } | |
| 180 | ||
| 181 | static WRITE8_HANDLER( igs_lamps_w ) | |
| 182 | { | |
| 183 | /* | |
| 184 | - Lbits - | |
| 185 | 7654 3210 | |
| 186 | ========= | |
| 187 | ---- --x- Hold1 lamp. | |
| 188 | --x- ---- Hold2 lamp. | |
| 189 | ---x ---- Hold3 lamp. | |
| 190 | ---- x--- Hold4 lamp. | |
| 191 | ---- -x-- Hold5 lamp. | |
| 192 | ---- ---x Start lamp. | |
| 193 | */ | |
| 194 | output_set_lamp_value(1, (data >> 1) & 1); /* Lamp 1 - HOLD 1 */ | |
| 195 | output_set_lamp_value(2, (data >> 5) & 1); /* Lamp 2 - HOLD 2 */ | |
| 196 | output_set_lamp_value(3, (data >> 4) & 1); /* Lamp 3 - HOLD 3 */ | |
| 197 | output_set_lamp_value(4, (data >> 3) & 1); /* Lamp 4 - HOLD 4 */ | |
| 198 | output_set_lamp_value(5, (data >> 2) & 1); /* Lamp 5 - HOLD 5 */ | |
| 199 | output_set_lamp_value(6, (data & 1)); /* Lamp 6 - START */ | |
| 200 | ||
| 201 | hopper = (~data)& 0x80; | |
| 202 | ||
| 203 | out[1] = data; | |
| 204 | show_out(); | |
| 205 | } | |
| 206 | ||
| 207 | ||
| 208 | static size_t protection_res = 0; | |
| 209 | ||
| 210 | static READ8_HANDLER( custom_io_r ) | |
| 211 | { | |
| 212 | return protection_res; | |
| 213 | } | |
| 214 | ||
| 215 | static WRITE8_HANDLER( custom_io_w ) | |
| 216 | { | |
| 217 | switch (data) | |
| 218 | { | |
| 219 | case 0x00: protection_res = input_port_read(space->machine, "BUTTONS1"); break; | |
| 220 | case 0x20: protection_res = 0x49; break; | |
| 221 | case 0x21: protection_res = 0x47; break; | |
| 222 | case 0x22: protection_res = 0x53; break; | |
| 223 | case 0x24: protection_res = 0x41; break; | |
| 224 | case 0x25: protection_res = 0x41; break; | |
| 225 | case 0x26: protection_res = 0x7f; break; | |
| 226 | case 0x27: protection_res = 0x41; break; | |
| 227 | case 0x28: protection_res = 0x41; break; | |
| 228 | case 0x2a: protection_res = 0x3e; break; | |
| 229 | case 0x2b: protection_res = 0x41; break; | |
| 230 | case 0x2c: protection_res = 0x49; break; | |
| 231 | case 0x2d: protection_res = 0xf9; break; | |
| 232 | case 0x2e: protection_res = 0x0a; break; | |
| 233 | case 0x30: protection_res = 0x26; break; | |
| 234 | case 0x31: protection_res = 0x49; break; | |
| 235 | case 0x32: protection_res = 0x49; break; | |
| 236 | case 0x33: protection_res = 0x49; break; | |
| 237 | case 0x34: protection_res = 0x32; break; | |
| 238 | default: | |
| 239 | protection_res = data; | |
| 240 | } | |
| 241 | } | |
| 242 | ||
| 243 | static CUSTOM_INPUT( hopper_r ) | |
| 244 | { | |
| 245 | if (hopper) return !(video_screen_get_frame_number(field->port->machine->primary_screen)%10); | |
| 246 | return input_code_pressed(KEYCODE_H); | |
| 247 | } | |
| 248 | ||
| 249 | static ADDRESS_MAP_START( igspoker_prg_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 250 | AM_RANGE(0x0000, 0xefff) AM_ROM | |
| 251 | AM_RANGE(0xf000, 0xffff) AM_RAM AM_REGION("main", 0xf000) | |
| 252 | ADDRESS_MAP_END | |
| 253 | ||
| 254 | static ADDRESS_MAP_START( igspoker_io_map, ADDRESS_SPACE_IO, 8 ) | |
| 255 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE( paletteram_xBBBBBGGGGGRRRRR_split1_w ) AM_BASE( &paletteram ) | |
| 256 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE( paletteram_xBBBBBGGGGGRRRRR_split2_w ) AM_BASE( &paletteram_2 ) | |
| 257 | AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW1") /* DSW1 */ | |
| 258 | AM_RANGE(0x4001, 0x4001) AM_READ_PORT("DSW2") /* DSW2 */ | |
| 259 | AM_RANGE(0x4002, 0x4002) AM_READ_PORT("DSW3") /* DSW3 */ | |
| 260 | AM_RANGE(0x4003, 0x4003) AM_READ_PORT("DSW4") /* DSW4 */ | |
| 261 | AM_RANGE(0x4004, 0x4004) AM_READ_PORT("DSW5") /* DSW5 */ | |
| 262 | AM_RANGE(0x5080, 0x5080) AM_WRITE(igs_nmi_and_coins_w) | |
| 263 | AM_RANGE(0x5081, 0x5081) AM_READ_PORT("SERVICE") /* Services */ | |
| 264 | AM_RANGE(0x5082, 0x5082) AM_READ_PORT("COINS") /* Coing & Kbd */ | |
| 265 | AM_RANGE(0x5090, 0x5090) AM_WRITE(custom_io_w) | |
| 266 | AM_RANGE(0x5091, 0x5091) AM_READ(custom_io_r) AM_WRITE( igs_lamps_w ) /* Keyboard */ | |
| 267 | AM_RANGE(0x50a0, 0x50a0) AM_READ_PORT("BUTTONS2") /* Not connected */ | |
| 268 | AM_RANGE(0x50b0, 0x50b0) AM_WRITE(ym2413_register_port_0_w) | |
| 269 | AM_RANGE(0x50b1, 0x50b1) AM_WRITE(ym2413_data_port_0_w) | |
| 270 | AM_RANGE(0x50c0, 0x50c0) AM_READ(igs_irqack_r) AM_WRITE(igs_irqack_w) | |
| 271 | AM_RANGE(0x6800, 0x6fff) AM_RAM_WRITE( bg_tile_w ) AM_BASE( &bg_tile_ram ) | |
| 272 | AM_RANGE(0x7000, 0x77ff) AM_RAM_WRITE( fg_tile_w ) AM_BASE( &fg_tile_ram ) | |
| 273 | AM_RANGE(0x7800, 0x7fff) AM_RAM_WRITE( fg_color_w ) AM_BASE( &fg_color_ram ) | |
| 274 | AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("gfx3", 0) | |
| 275 | ADDRESS_MAP_END | |
| 276 | ||
| 277 | ||
| 278 | /* MB: 05 Jun 99 Input ports and Dip switches are all verified! */ | |
| 279 | ||
| 280 | static INPUT_PORTS_START( cpoker ) | |
| 281 | ||
| 282 | PORT_START("DSW1") | |
| 283 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:8") | |
| 284 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 285 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 286 | PORT_DIPNAME( 0x06, 0x06, "Min Bet to Start" ) PORT_DIPLOCATION("SWA:7,6") | |
| 287 | PORT_DIPSETTING( 0x06, "1" ) | |
| 288 | PORT_DIPSETTING( 0x04, "3" ) | |
| 289 | PORT_DIPSETTING( 0x02, "5" ) | |
| 290 | PORT_DIPSETTING( 0x00, "10" ) | |
| 291 | PORT_DIPNAME( 0x18, 0x10, "Max Bet" ) PORT_DIPLOCATION("SWA:5,4") | |
| 292 | PORT_DIPSETTING( 0x18, "3" ) | |
| 293 | PORT_DIPSETTING( 0x10, "5" ) | |
| 294 | PORT_DIPSETTING( 0x08, "20" ) | |
| 295 | PORT_DIPSETTING( 0x00, "40" ) | |
| 296 | PORT_DIPNAME( 0x60, 0x60, "Min Bet to play Fever" ) PORT_DIPLOCATION("SWA:3,2") | |
| 297 | PORT_DIPSETTING( 0x60, "1" ) | |
| 298 | PORT_DIPSETTING( 0x40, "5" ) | |
| 299 | PORT_DIPSETTING( 0x20, "10" ) | |
| 300 | PORT_DIPSETTING( 0x00, "20" ) | |
| 301 | PORT_DIPNAME( 0x80, 0x00, "Credit Limit" ) PORT_DIPLOCATION("SWA:1") | |
| 302 | PORT_DIPSETTING( 0x80, "5000" ) | |
| 303 | PORT_DIPSETTING( 0x00, "10000" ) | |
| 304 | ||
| 305 | PORT_START("DSW2") | |
| 306 | PORT_DIPNAME( 0x07, 0x07, "Coin In Rate" ) PORT_DIPLOCATION("SWB:8,7,6") | |
| 307 | PORT_DIPSETTING( 0x07, "1" ) | |
| 308 | PORT_DIPSETTING( 0x06, "2" ) | |
| 309 | PORT_DIPSETTING( 0x05, "5" ) | |
| 310 | PORT_DIPSETTING( 0x04, "10" ) | |
| 311 | PORT_DIPSETTING( 0x03, "20" ) | |
| 312 | PORT_DIPSETTING( 0x02, "40" ) | |
| 313 | PORT_DIPSETTING( 0x01, "50" ) | |
| 314 | PORT_DIPSETTING( 0x00, "100" ) | |
| 315 | PORT_DIPNAME( 0x18, 0x18, "Key In Rate" ) PORT_DIPLOCATION("SWB:5,4") | |
| 316 | PORT_DIPSETTING( 0x18, "10" ) | |
| 317 | PORT_DIPSETTING( 0x10, "20" ) | |
| 318 | PORT_DIPSETTING( 0x08, "50" ) | |
| 319 | PORT_DIPSETTING( 0x00, "100" ) | |
| 320 | PORT_DIPNAME( 0x60, 0x60, "Key Out Rate" ) PORT_DIPLOCATION("SWB:3,2") | |
| 321 | PORT_DIPSETTING( 0x60, "1:1" ) | |
| 322 | PORT_DIPSETTING( 0x40, "10:1" ) | |
| 323 | PORT_DIPSETTING( 0x20, "100:1" ) | |
| 324 | PORT_DIPSETTING( 0x00, "100:1" ) | |
| 325 | PORT_DIPNAME( 0x80, 0x80, "Payout" ) PORT_DIPLOCATION("SWB:1") | |
| 326 | PORT_DIPSETTING( 0x80, "Manual" ) | |
| 327 | PORT_DIPSETTING( 0x00, "Auto" ) | |
| 328 | ||
| 329 | PORT_START("DSW3") | |
| 330 | PORT_DIPNAME( 0x01, 0x01, "W-UP Bonus Target" ) PORT_DIPLOCATION("SWC:8") | |
| 331 | PORT_DIPSETTING( 0x01, "3000" ) | |
| 332 | PORT_DIPSETTING( 0x00, "5000" ) | |
| 333 | PORT_DIPNAME( 0x02, 0x02, "W-UP Bonus Rate" ) PORT_DIPLOCATION("SWC:7") | |
| 334 | PORT_DIPSETTING( 0x02, "300" ) | |
| 335 | PORT_DIPSETTING( 0x00, "500" ) | |
| 336 | PORT_DIPNAME( 0x0c, 0x0c, "W-UP Chance" ) PORT_DIPLOCATION("SWC:6,5") | |
| 337 | PORT_DIPSETTING( 0x0c, "94%" ) | |
| 338 | PORT_DIPSETTING( 0x08, "96%" ) | |
| 339 | PORT_DIPSETTING( 0x04, "98%" ) | |
| 340 | PORT_DIPSETTING( 0x00, "100%" ) | |
| 341 | PORT_DIPNAME( 0x30, 0x20, "W-UP Type" ) PORT_DIPLOCATION("SWC:4,3") | |
| 342 | PORT_DIPSETTING( 0x30, DEF_STR( None ) ) | |
| 343 | PORT_DIPSETTING( 0x20, "High-Low" ) | |
| 344 | PORT_DIPSETTING( 0x10, "Red-Black" ) /* Bit 4 is equal for ON/OFF */ | |
| 345 | PORT_DIPNAME( 0x40, 0x00, "Strip Girl" ) PORT_DIPLOCATION("SWC:2") | |
| 346 | PORT_DIPSETTING( 0x40, DEF_STR( No ) ) | |
| 347 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 348 | PORT_DIPNAME( 0x80, 0x00, "Anytime Key-in" ) PORT_DIPLOCATION("SWC:1") | |
| 349 | PORT_DIPSETTING( 0x80, DEF_STR( No ) ) | |
| 350 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 351 | ||
| 352 | PORT_START("DSW4") | |
| 353 | PORT_DIPNAME( 0x0f, 0x07, "Main Game Chance" ) PORT_DIPLOCATION("SWD:8,7,6,5") | |
| 354 | PORT_DIPSETTING( 0x0f, "69%" ) | |
| 355 | PORT_DIPSETTING( 0x0e, "72%" ) | |
| 356 | PORT_DIPSETTING( 0x0d, "75%" ) | |
| 357 | PORT_DIPSETTING( 0x0c, "78%" ) | |
| 358 | PORT_DIPSETTING( 0x0b, "81%" ) | |
| 359 | PORT_DIPSETTING( 0x0a, "83%" ) | |
| 360 | PORT_DIPSETTING( 0x09, "85%" ) | |
| 361 | PORT_DIPSETTING( 0x08, "87%" ) | |
| 362 | PORT_DIPSETTING( 0x07, "89%" ) | |
| 363 | PORT_DIPSETTING( 0x06, "91%" ) | |
| 364 | PORT_DIPSETTING( 0x05, "93%" ) | |
| 365 | PORT_DIPSETTING( 0x04, "95%" ) | |
| 366 | PORT_DIPSETTING( 0x03, "97%" ) | |
| 367 | PORT_DIPSETTING( 0x02, "99%" ) | |
| 368 | PORT_DIPSETTING( 0x01, "101%" ) | |
| 369 | PORT_DIPSETTING( 0x00, "103%" ) | |
| 370 | PORT_DIPNAME( 0x10, 0x00, "Five Jokers" ) PORT_DIPLOCATION("SWD:4") | |
| 371 | PORT_DIPSETTING( 0x10, DEF_STR( No ) ) | |
| 372 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 373 | PORT_DIPNAME( 0x20, 0x00, "Royal Flush" ) PORT_DIPLOCATION("SWD:3") | |
| 374 | PORT_DIPSETTING( 0x20, DEF_STR( No ) ) | |
| 375 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 376 | PORT_DIPNAME( 0x40, 0x00, "Auto Hold" ) PORT_DIPLOCATION("SWD:2") | |
| 377 | PORT_DIPSETTING( 0x40, DEF_STR( No ) ) | |
| 378 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 379 | PORT_DIPNAME( 0x80, 0x00, "Hopper" ) PORT_DIPLOCATION("SWD:1") | |
| 380 | PORT_DIPSETTING( 0x80, DEF_STR( No ) ) | |
| 381 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 382 | ||
| 383 | PORT_START("DSW5") | |
| 384 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 385 | ||
| 386 | PORT_START("SERVICE") | |
| 387 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor | |
| 388 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4) PORT_NAME("Payout") | |
| 389 | PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) | |
| 390 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F1) PORT_NAME("Statistics") | |
| 391 | ||
| 392 | PORT_START("COINS") | |
| 393 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 394 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 395 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 396 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_Q) PORT_NAME("Key In") | |
| 397 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_W) PORT_NAME("Key Down") | |
| 398 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 399 | ||
| 400 | PORT_START("BUTTONS1") | |
| 401 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 402 | ||
| 403 | PORT_START("BUTTONS2") | |
| 404 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 405 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hold1/High/Low") | |
| 406 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold5/Bet") | |
| 407 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold4/Take") | |
| 408 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hold3/W-Up") | |
| 409 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hold2/Red/Black") | |
| 410 | PORT_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 411 | ||
| 412 | INPUT_PORTS_END | |
| 413 | ||
| 414 | static INPUT_PORTS_START( csk227 ) | |
| 415 | ||
| 416 | PORT_START("DSW1") | |
| 417 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:8") | |
| 418 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 419 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 420 | PORT_DIPNAME( 0x06, 0x06, "Min Bet to Start" ) PORT_DIPLOCATION("SWA:6,7") | |
| 421 | PORT_DIPSETTING( 0x06, "1" ) | |
| 422 | PORT_DIPSETTING( 0x04, "3" ) | |
| 423 | PORT_DIPSETTING( 0x02, "5" ) | |
| 424 | PORT_DIPSETTING( 0x00, "10" ) | |
| 425 | PORT_DIPNAME( 0x18, 0x18, "Max Bet" ) PORT_DIPLOCATION("SWA:4,5") | |
| 426 | PORT_DIPSETTING( 0x18, "10" ) | |
| 427 | PORT_DIPSETTING( 0x10, "20" ) | |
| 428 | PORT_DIPSETTING( 0x08, "50" ) | |
| 429 | PORT_DIPSETTING( 0x00, "100" ) | |
| 430 | PORT_DIPNAME( 0x60, 0x60, "Min Bet to play Fever" ) PORT_DIPLOCATION("SWA:2,3") | |
| 431 | PORT_DIPSETTING( 0x60, "1" ) | |
| 432 | PORT_DIPSETTING( 0x40, "5" ) | |
| 433 | PORT_DIPSETTING( 0x20, "10" ) | |
| 434 | PORT_DIPSETTING( 0x00, "20" ) | |
| 435 | PORT_DIPNAME( 0x80, 0x00, "Credit Limit" ) PORT_DIPLOCATION("SWA:1") | |
| 436 | PORT_DIPSETTING( 0x80, "100000" ) | |
| 437 | PORT_DIPSETTING( 0x00, "Unlimited" ) | |
| 438 | ||
| 439 | PORT_START("DSW2") | |
| 440 | PORT_DIPNAME( 0x07, 0x07, "Coin In Rate" ) PORT_DIPLOCATION("SWB:8,7,6") | |
| 441 | PORT_DIPSETTING( 0x07, "1" ) | |
| 442 | PORT_DIPSETTING( 0x06, "2" ) | |
| 443 | PORT_DIPSETTING( 0x05, "5" ) | |
| 444 | PORT_DIPSETTING( 0x04, "10" ) | |
| 445 | PORT_DIPSETTING( 0x03, "20" ) | |
| 446 | PORT_DIPSETTING( 0x02, "40" ) | |
| 447 | PORT_DIPSETTING( 0x01, "50" ) | |
| 448 | PORT_DIPSETTING( 0x00, "100" ) | |
| 449 | PORT_DIPNAME( 0x18, 0x18, "Key In Rate" ) PORT_DIPLOCATION("SWB:5,4") | |
| 450 | PORT_DIPSETTING( 0x18, "10" ) | |
| 451 | PORT_DIPSETTING( 0x10, "20" ) | |
| 452 | PORT_DIPSETTING( 0x08, "50" ) | |
| 453 | PORT_DIPSETTING( 0x00, "100" ) | |
| 454 | PORT_DIPNAME( 0x60, 0x60, "W-UP Bonus Target" ) PORT_DIPLOCATION("SWB:3,2") | |
| 455 | PORT_DIPSETTING( 0x60, "1500" ) | |
| 456 | PORT_DIPSETTING( 0x40, "3000" ) | |
| 457 | PORT_DIPSETTING( 0x20, "5000" ) | |
| 458 | PORT_DIPSETTING( 0x00, "7500" ) | |
| 459 | PORT_DIPNAME( 0x80, 0x80, "Payout" ) PORT_DIPLOCATION("SWB:1") | |
| 460 | PORT_DIPSETTING( 0x80, "Manual" ) | |
| 461 | PORT_DIPSETTING( 0x00, "Auto" ) | |
| 462 | ||
| 463 | PORT_START("DSW3") | |
| 464 | PORT_DIPNAME( 0x03, 0x03, "W-UP Bonus Rate" ) PORT_DIPLOCATION("SWC:8,7") | |
| 465 | PORT_DIPSETTING( 0x03, "200" ) | |
| 466 | PORT_DIPSETTING( 0x02, "300" ) | |
| 467 | PORT_DIPSETTING( 0x01, "500" ) | |
| 468 | PORT_DIPSETTING( 0x00, "800" ) | |
| 469 | PORT_DIPNAME( 0x0c, 0x0c, "W-UP Chance" ) PORT_DIPLOCATION("SWC:6,5") | |
| 470 | PORT_DIPSETTING( 0x0c, "94%" ) | |
| 471 | PORT_DIPSETTING( 0x08, "96%" ) | |
| 472 | PORT_DIPSETTING( 0x04, "98%" ) | |
| 473 | PORT_DIPSETTING( 0x00, "100%" ) | |
| 474 | PORT_DIPNAME( 0x30, 0x20, "W-UP Type" ) PORT_DIPLOCATION("SWC:4,3") | |
| 475 | PORT_DIPSETTING( 0x30, DEF_STR( None ) ) | |
| 476 | PORT_DIPSETTING( 0x20, "High-Low" ) | |
| 477 | PORT_DIPSETTING( 0x10, "Red-Black" ) /* Bit 4 is equal for ON/OFF */ | |
| 478 | PORT_DIPNAME( 0x40, 0x00, "Strip Girl" ) PORT_DIPLOCATION("SWC:2") | |
| 479 | PORT_DIPSETTING( 0x40, DEF_STR( No ) ) | |
| 480 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 481 | PORT_DIPNAME( 0x80, 0x00, "Ability" ) PORT_DIPLOCATION("SWC:1") | |
| 482 | PORT_DIPSETTING( 0x80, DEF_STR( No ) ) | |
| 483 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 484 | ||
| 485 | PORT_START("DSW4") | |
| 486 | PORT_DIPNAME( 0x0f, 0x07, "Main Game Chance" ) PORT_DIPLOCATION("SWD:8,7,6,5") | |
| 487 | PORT_DIPSETTING( 0x0f, "69%" ) | |
| 488 | PORT_DIPSETTING( 0x0e, "72%" ) | |
| 489 | PORT_DIPSETTING( 0x0d, "75%" ) | |
| 490 | PORT_DIPSETTING( 0x0c, "78%" ) | |
| 491 | PORT_DIPSETTING( 0x0b, "81%" ) | |
| 492 | PORT_DIPSETTING( 0x0a, "83%" ) | |
| 493 | PORT_DIPSETTING( 0x09, "85%" ) | |
| 494 | PORT_DIPSETTING( 0x08, "87%" ) | |
| 495 | PORT_DIPSETTING( 0x07, "89%" ) | |
| 496 | PORT_DIPSETTING( 0x06, "91%" ) | |
| 497 | PORT_DIPSETTING( 0x05, "93%" ) | |
| 498 | PORT_DIPSETTING( 0x04, "95%" ) | |
| 499 | PORT_DIPSETTING( 0x03, "97%" ) | |
| 500 | PORT_DIPSETTING( 0x02, "99%" ) | |
| 501 | PORT_DIPSETTING( 0x01, "101%" ) | |
| 502 | PORT_DIPSETTING( 0x00, "103%" ) | |
| 503 | PORT_DIPNAME( 0x10, 0x00, "Five Jokers" ) PORT_DIPLOCATION("SWD:4") | |
| 504 | PORT_DIPSETTING( 0x10, DEF_STR( No ) ) | |
| 505 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 506 | PORT_DIPNAME( 0x20, 0x00, "Royal Flush" ) PORT_DIPLOCATION("SWD:3") | |
| 507 | PORT_DIPSETTING( 0x20, DEF_STR( No ) ) | |
| 508 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 509 | PORT_DIPNAME( 0x40, 0x00, "Auto Hold" ) PORT_DIPLOCATION("SWD:2") | |
| 510 | PORT_DIPSETTING( 0x40, DEF_STR( No ) ) | |
| 511 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 512 | PORT_DIPNAME( 0x80, 0x80, "Payout Select" ) PORT_DIPLOCATION("SWD:1") | |
| 513 | PORT_DIPSETTING( 0x80, "Ticket" ) | |
| 514 | PORT_DIPSETTING( 0x00, "Hopper" ) | |
| 515 | ||
| 516 | PORT_START("DSW5") | |
| 517 | PORT_DIPNAME( 0x07, 0x07, "Key Out Rate" ) PORT_DIPLOCATION("SWE:8,7,6") | |
| 518 | PORT_DIPSETTING( 0x07, "1:1" ) | |
| 519 | PORT_DIPSETTING( 0x06, "10:1" ) | |
| 520 | PORT_DIPSETTING( 0x05, "20:1" ) | |
| 521 | PORT_DIPSETTING( 0x04, "50:1" ) | |
| 522 | PORT_DIPSETTING( 0x03, "100:1" ) /* Bits 1-0 are all equivalents */ | |
| 523 | PORT_DIPNAME( 0x08, 0x00, "Card Select" ) PORT_DIPLOCATION("SWE:5") | |
| 524 | PORT_DIPSETTING( 0x08, "Poker" ) | |
| 525 | PORT_DIPSETTING( 0x00, "Tetris" ) | |
| 526 | PORT_DIPNAME( 0x70, 0x70, "Ticket Rate" ) PORT_DIPLOCATION("SWE:4,3,2") | |
| 527 | PORT_DIPSETTING( 0x70, "1:1" ) | |
| 528 | PORT_DIPSETTING( 0x60, "5:1" ) | |
| 529 | PORT_DIPSETTING( 0x50, "10:1" ) | |
| 530 | PORT_DIPSETTING( 0x40, "20:1" ) | |
| 531 | PORT_DIPSETTING( 0x30, "25:1" ) | |
| 532 | PORT_DIPSETTING( 0x20, "50:1" ) | |
| 533 | PORT_DIPSETTING( 0x10, "100:1" ) | |
| 534 | PORT_DIPSETTING( 0x00, "200:1" ) | |
| 535 | PORT_DIPNAME( 0x80, 0x80, "Win Table" ) PORT_DIPLOCATION("SWE:1") | |
| 536 | PORT_DIPSETTING( 0x80, "Change" ) | |
| 537 | PORT_DIPSETTING( 0x00, "Fixed" ) | |
| 538 | ||
| 539 | PORT_START("SERVICE") | |
| 540 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 541 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 542 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor | |
| 543 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 544 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4) PORT_NAME("Payout") | |
| 545 | PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) | |
| 546 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F1) PORT_NAME("Statistics") | |
| 547 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold5/Bet") | |
| 548 | ||
| 549 | PORT_START("COINS") | |
| 550 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 551 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 552 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 553 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_Q) PORT_NAME("Key In") | |
| 554 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_W) PORT_NAME("Key Down") | |
| 555 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 556 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold4/Take") | |
| 557 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hold3/W-Up") | |
| 558 | ||
| 559 | PORT_START("BUTTONS1") | |
| 560 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 561 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 562 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 563 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 564 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 565 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_START1) | |
| 566 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hold1/High/Low") | |
| 567 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hold2/Red/Black") | |
| 568 | ||
| 569 | PORT_START("BUTTONS2") | |
| 570 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 571 | ||
| 572 | INPUT_PORTS_END | |
| 573 | ||
| 574 | ||
| 575 | static INPUT_PORTS_START( csk234 ) | |
| 576 | ||
| 577 | PORT_START("DSW1") | |
| 578 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:8") | |
| 579 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 580 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 581 | PORT_DIPNAME( 0x06, 0x06, "Min Bet to Start" ) PORT_DIPLOCATION("SWA:7,6") | |
| 582 | PORT_DIPSETTING( 0x06, "1" ) | |
| 583 | PORT_DIPSETTING( 0x04, "3" ) | |
| 584 | PORT_DIPSETTING( 0x02, "5" ) | |
| 585 | PORT_DIPSETTING( 0x00, "10" ) | |
| 586 | PORT_DIPNAME( 0x18, 0x10, "Max Bet" ) PORT_DIPLOCATION("SWA:5,4") | |
| 587 | PORT_DIPSETTING( 0x18, "3" ) | |
| 588 | PORT_DIPSETTING( 0x10, "5" ) | |
| 589 | PORT_DIPSETTING( 0x08, "20" ) | |
| 590 | PORT_DIPSETTING( 0x00, "40" ) | |
| 591 | PORT_DIPNAME( 0x60, 0x60, "Min Bet to play Fever" ) PORT_DIPLOCATION("SWA:3,2") | |
| 592 | PORT_DIPSETTING( 0x60, "1" ) | |
| 593 | PORT_DIPSETTING( 0x40, "5" ) | |
| 594 | PORT_DIPSETTING( 0x20, "10" ) | |
| 595 | PORT_DIPSETTING( 0x00, "20" ) | |
| 596 | PORT_DIPNAME( 0x80, 0x00, "Credit Limit" ) PORT_DIPLOCATION("SWA:1") | |
| 597 | PORT_DIPSETTING( 0x80, "5000" ) | |
| 598 | PORT_DIPSETTING( 0x00, "10000" ) | |
| 599 | ||
| 600 | PORT_START("DSW2") | |
| 601 | PORT_DIPNAME( 0x07, 0x07, "Coin In Rate" ) PORT_DIPLOCATION("SWB:8,7,6") | |
| 602 | PORT_DIPSETTING( 0x07, "1" ) | |
| 603 | PORT_DIPSETTING( 0x06, "2" ) | |
| 604 | PORT_DIPSETTING( 0x05, "5" ) | |
| 605 | PORT_DIPSETTING( 0x04, "10" ) | |
| 606 | PORT_DIPSETTING( 0x03, "20" ) | |
| 607 | PORT_DIPSETTING( 0x02, "40" ) | |
| 608 | PORT_DIPSETTING( 0x01, "50" ) | |
| 609 | PORT_DIPSETTING( 0x00, "100" ) | |
| 610 | PORT_DIPNAME( 0x18, 0x18, "Key In Rate" ) PORT_DIPLOCATION("SWB:5,4") | |
| 611 | PORT_DIPSETTING( 0x18, "10" ) | |
| 612 | PORT_DIPSETTING( 0x10, "20" ) | |
| 613 | PORT_DIPSETTING( 0x08, "50" ) | |
| 614 | PORT_DIPSETTING( 0x00, "100" ) | |
| 615 | PORT_DIPNAME( 0x60, 0x60, "Key Out Rate" ) PORT_DIPLOCATION("SWB:3,2") | |
| 616 | PORT_DIPSETTING( 0x60, "1:1" ) | |
| 617 | PORT_DIPSETTING( 0x40, "10:1" ) | |
| 618 | PORT_DIPSETTING( 0x20, "100:1" ) | |
| 619 | PORT_DIPSETTING( 0x00, "100:1" ) | |
| 620 | PORT_DIPNAME( 0x80, 0x80, "Payout" ) PORT_DIPLOCATION("SWB:1") | |
| 621 | PORT_DIPSETTING( 0x80, "Manual" ) | |
| 622 | PORT_DIPSETTING( 0x00, "Auto" ) | |
| 623 | ||
| 624 | PORT_START("DSW3") | |
| 625 | PORT_DIPNAME( 0x01, 0x01, "W-UP Bonus Target" ) PORT_DIPLOCATION("SWC:8") | |
| 626 | PORT_DIPSETTING( 0x01, "3000" ) | |
| 627 | PORT_DIPSETTING( 0x00, "5000" ) | |
| 628 | PORT_DIPNAME( 0x02, 0x02, "W-UP Bonus Rate" ) PORT_DIPLOCATION("SWC:7") | |
| 629 | PORT_DIPSETTING( 0x02, "300" ) | |
| 630 | PORT_DIPSETTING( 0x00, "500" ) | |
| 631 | PORT_DIPNAME( 0x0c, 0x0c, "W-UP Chance" ) PORT_DIPLOCATION("SWC:6,5") | |
| 632 | PORT_DIPSETTING( 0x0c, "94%" ) | |
| 633 | PORT_DIPSETTING( 0x08, "96%" ) | |
| 634 | PORT_DIPSETTING( 0x04, "98%" ) | |
| 635 | PORT_DIPSETTING( 0x00, "100%" ) | |
| 636 | PORT_DIPNAME( 0x30, 0x20, "W-UP Type" ) PORT_DIPLOCATION("SWC:4,3") | |
| 637 | PORT_DIPSETTING( 0x30, DEF_STR( None ) ) | |
| 638 | PORT_DIPSETTING( 0x20, "High-Low" ) | |
| 639 | PORT_DIPSETTING( 0x10, "Red-Black" ) /* Bit 4 is equal for ON/OFF */ | |
| 640 | PORT_DIPNAME( 0x40, 0x40, "Card Select" ) PORT_DIPLOCATION("SWC:2") | |
| 641 | PORT_DIPSETTING( 0x40, "Poker" ) | |
| 642 | PORT_DIPSETTING( 0x00, "Symbols" ) | |
| 643 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 644 | ||
| 645 | PORT_START("DSW4") | |
| 646 | PORT_DIPNAME( 0x0f, 0x07, "Main Game Chance" ) PORT_DIPLOCATION("SWD:8,7,6,5") | |
| 647 | PORT_DIPSETTING( 0x0f, "69%" ) | |
| 648 | PORT_DIPSETTING( 0x0e, "72%" ) | |
| 649 | PORT_DIPSETTING( 0x0d, "75%" ) | |
| 650 | PORT_DIPSETTING( 0x0c, "78%" ) | |
| 651 | PORT_DIPSETTING( 0x0b, "81%" ) | |
| 652 | PORT_DIPSETTING( 0x0a, "83%" ) | |
| 653 | PORT_DIPSETTING( 0x09, "85%" ) | |
| 654 | PORT_DIPSETTING( 0x08, "87%" ) | |
| 655 | PORT_DIPSETTING( 0x07, "89%" ) | |
| 656 | PORT_DIPSETTING( 0x06, "91%" ) | |
| 657 | PORT_DIPSETTING( 0x05, "93%" ) | |
| 658 | PORT_DIPSETTING( 0x04, "95%" ) | |
| 659 | PORT_DIPSETTING( 0x03, "97%" ) | |
| 660 | PORT_DIPSETTING( 0x02, "99%" ) | |
| 661 | PORT_DIPSETTING( 0x01, "101%" ) | |
| 662 | PORT_DIPSETTING( 0x00, "103%" ) | |
| 663 | PORT_DIPNAME( 0x10, 0x00, "Auto Hold" ) PORT_DIPLOCATION("SWD:4") | |
| 664 | PORT_DIPSETTING( 0x10, DEF_STR( No ) ) | |
| 665 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 666 | PORT_DIPNAME( 0x20, 0x00, "Anytime Key-in" ) PORT_DIPLOCATION("SWD:3") | |
| 667 | PORT_DIPSETTING( 0x20, DEF_STR( No ) ) | |
| 668 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 669 | PORT_BIT( 0xC0, IP_ACTIVE_LOW, IPT_UNUSED ) /* Joker and Royal Flush are always enabled */ | |
| 670 | ||
| 671 | PORT_START("DSW5") | |
| 672 | PORT_DIPNAME( 0x01, 0x00, "Hopper" ) PORT_DIPLOCATION("SWE:8") | |
| 673 | PORT_DIPSETTING( 0x01, DEF_STR( No ) ) | |
| 674 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 675 | PORT_DIPNAME( 0x02, 0x00, "Payout Select" ) PORT_DIPLOCATION("SWE:7") | |
| 676 | PORT_DIPSETTING( 0x02, "Hopper" ) | |
| 677 | PORT_DIPSETTING( 0x00, "Ticket" ) | |
| 678 | PORT_DIPNAME( 0x0c, 0x0c, "Ticket Rate" ) PORT_DIPLOCATION("SWE:6,5") | |
| 679 | PORT_DIPSETTING( 0x0c, "10:1" ) | |
| 680 | PORT_DIPSETTING( 0x08, "20:1" ) | |
| 681 | PORT_DIPSETTING( 0x04, "50:1" ) | |
| 682 | PORT_DIPSETTING( 0x00, "100:1" ) | |
| 683 | PORT_DIPNAME( 0x10, 0x00, "Ability" ) PORT_DIPLOCATION("SWE:4") | |
| 684 | PORT_DIPSETTING( 0x10, DEF_STR( No ) ) | |
| 685 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 686 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 687 | ||
| 688 | PORT_START("SERVICE") | |
| 689 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor | |
| 690 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4) PORT_NAME("Payout") | |
| 691 | PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) | |
| 692 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F1) PORT_NAME("Statistics") | |
| 693 | ||
| 694 | PORT_START("COINS") | |
| 695 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 696 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 697 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 698 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_Q) PORT_NAME("Key In") | |
| 699 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_W) PORT_NAME("Key Down") | |
| 700 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 701 | ||
| 702 | PORT_START("BUTTONS1") | |
| 703 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 704 | ||
| 705 | PORT_START("BUTTONS2") | |
| 706 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 707 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hold1/High/Low") | |
| 708 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold5/Bet") | |
| 709 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold4/Take") | |
| 710 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hold3/W-Up") | |
| 711 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hold2/Red/Black") | |
| 712 | PORT_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 713 | ||
| 714 | INPUT_PORTS_END | |
| 715 | ||
| 716 | ||
| 717 | static INPUT_PORTS_START( igs_ncs ) | |
| 718 | ||
| 719 | PORT_START("DSW1") | |
| 720 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:8") | |
| 721 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 722 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 723 | PORT_DIPNAME( 0x06, 0x06, "Min Bet to Start" ) PORT_DIPLOCATION("SWA:7,6") | |
| 724 | PORT_DIPSETTING( 0x06, "1" ) | |
| 725 | PORT_DIPSETTING( 0x04, "3" ) | |
| 726 | PORT_DIPSETTING( 0x02, "5" ) | |
| 727 | PORT_DIPSETTING( 0x00, "10" ) | |
| 728 | PORT_DIPNAME( 0x18, 0x10, "Max Bet" ) PORT_DIPLOCATION("SWA:5,4") | |
| 729 | PORT_DIPSETTING( 0x18, "10" ) | |
| 730 | PORT_DIPSETTING( 0x10, "20" ) | |
| 731 | PORT_DIPSETTING( 0x08, "40" ) | |
| 732 | PORT_DIPSETTING( 0x00, "200" ) | |
| 733 | PORT_DIPNAME( 0x60, 0x60, "Min Bet to play Fever" ) PORT_DIPLOCATION("SWA:3,2") | |
| 734 | PORT_DIPSETTING( 0x60, "1" ) | |
| 735 | PORT_DIPSETTING( 0x40, "5" ) | |
| 736 | PORT_DIPSETTING( 0x20, "10" ) | |
| 737 | PORT_DIPSETTING( 0x00, "20" ) | |
| 738 | PORT_DIPNAME( 0x80, 0x00, "Credit Limit" ) PORT_DIPLOCATION("SWA:1") | |
| 739 | PORT_DIPSETTING( 0x80, "100000" ) | |
| 740 | PORT_DIPSETTING( 0x00, "Unlimited" ) | |
| 741 | ||
| 742 | PORT_START("DSW2") | |
| 743 | PORT_DIPNAME( 0x07, 0x07, "Coin In Rate" ) PORT_DIPLOCATION("SWB:8,7,6") | |
| 744 | PORT_DIPSETTING( 0x07, "1" ) | |
| 745 | PORT_DIPSETTING( 0x06, "2" ) | |
| 746 | PORT_DIPSETTING( 0x05, "5" ) | |
| 747 | PORT_DIPSETTING( 0x04, "10" ) | |
| 748 | PORT_DIPSETTING( 0x03, "20" ) | |
| 749 | PORT_DIPSETTING( 0x02, "40" ) | |
| 750 | PORT_DIPSETTING( 0x01, "50" ) | |
| 751 | PORT_DIPSETTING( 0x00, "100" ) | |
| 752 | PORT_DIPNAME( 0x18, 0x18, "Key In Rate" ) PORT_DIPLOCATION("SWB:5,4") | |
| 753 | PORT_DIPSETTING( 0x18, "10" ) | |
| 754 | PORT_DIPSETTING( 0x10, "20" ) | |
| 755 | PORT_DIPSETTING( 0x08, "50" ) | |
| 756 | PORT_DIPSETTING( 0x00, "100" ) | |
| 757 | PORT_DIPNAME( 0x60, 0x60, "W-UP Limit" ) PORT_DIPLOCATION("SWB:3,2") | |
| 758 | PORT_DIPSETTING( 0x60, "1500" ) | |
| 759 | PORT_DIPSETTING( 0x40, "3000" ) | |
| 760 | PORT_DIPSETTING( 0x20, "5000" ) | |
| 761 | PORT_DIPSETTING( 0x00, "7500" ) | |
| 762 | PORT_DIPNAME( 0x80, 0x80, "Payout" ) PORT_DIPLOCATION("SWB:1") | |
| 763 | PORT_DIPSETTING( 0x80, "Manual" ) | |
| 764 | PORT_DIPSETTING( 0x00, "Auto" ) | |
| 765 | ||
| 766 | PORT_START("DSW3") | |
| 767 | PORT_DIPNAME( 0x03, 0x03, "W-UP Pool" ) PORT_DIPLOCATION("SWC:8,7") | |
| 768 | PORT_DIPSETTING( 0x03, "200" ) | |
| 769 | PORT_DIPSETTING( 0x02, "300" ) | |
| 770 | PORT_DIPSETTING( 0x01, "500" ) | |
| 771 | PORT_DIPSETTING( 0x00, "800" ) | |
| 772 | PORT_DIPNAME( 0x0c, 0x0c, "W-UP Chance" ) PORT_DIPLOCATION("SWC:6,5") | |
| 773 | PORT_DIPSETTING( 0x0c, "94%" ) | |
| 774 | PORT_DIPSETTING( 0x08, "96%" ) | |
| 775 | PORT_DIPSETTING( 0x04, "98%" ) | |
| 776 | PORT_DIPSETTING( 0x00, "100%" ) | |
| 777 | PORT_DIPNAME( 0x30, 0x20, "W-UP Type" ) PORT_DIPLOCATION("SWC:4,3") | |
| 778 | PORT_DIPSETTING( 0x30, DEF_STR( None ) ) | |
| 779 | PORT_DIPSETTING( 0x20, "High-Low" ) | |
| 780 | PORT_DIPSETTING( 0x10, "Red-Black" ) /* Bit 4 is equal for ON/OFF */ | |
| 781 | PORT_DIPNAME( 0x40, 0x40, "Ability Pay" ) PORT_DIPLOCATION("SWC:2") | |
| 782 | PORT_DIPSETTING( 0x40, "All" ) | |
| 783 | PORT_DIPSETTING( 0x00, "1/Time" ) | |
| 784 | PORT_DIPNAME( 0x80, 0x80, "Ability" ) PORT_DIPLOCATION("SWC:1") | |
| 785 | PORT_DIPSETTING( 0x80, DEF_STR( No ) ) | |
| 786 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 787 | ||
| 788 | PORT_START("DSW4") | |
| 789 | PORT_DIPNAME( 0x0f, 0x07, "Main Game Chance" ) PORT_DIPLOCATION("SWD:8,7,6,5") | |
| 790 | PORT_DIPSETTING( 0x0f, "69%" ) | |
| 791 | PORT_DIPSETTING( 0x0e, "72%" ) | |
| 792 | PORT_DIPSETTING( 0x0d, "75%" ) | |
| 793 | PORT_DIPSETTING( 0x0c, "78%" ) | |
| 794 | PORT_DIPSETTING( 0x0b, "81%" ) | |
| 795 | PORT_DIPSETTING( 0x0a, "83%" ) | |
| 796 | PORT_DIPSETTING( 0x09, "85%" ) | |
| 797 | PORT_DIPSETTING( 0x08, "87%" ) | |
| 798 | PORT_DIPSETTING( 0x07, "89%" ) | |
| 799 | PORT_DIPSETTING( 0x06, "91%" ) | |
| 800 | PORT_DIPSETTING( 0x05, "93%" ) | |
| 801 | PORT_DIPSETTING( 0x04, "95%" ) | |
| 802 | PORT_DIPSETTING( 0x03, "97%" ) | |
| 803 | PORT_DIPSETTING( 0x02, "99%" ) | |
| 804 | PORT_DIPSETTING( 0x01, "101%" ) | |
| 805 | PORT_DIPSETTING( 0x00, "103%" ) | |
| 806 | PORT_DIPNAME( 0x10, 0x00, "Five Jokers" ) PORT_DIPLOCATION("SWD:4") | |
| 807 | PORT_DIPSETTING( 0x10, DEF_STR( No ) ) | |
| 808 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 809 | PORT_DIPNAME( 0x20, 0x00, "Royal Flush" ) PORT_DIPLOCATION("SWD:3") | |
| 810 | PORT_DIPSETTING( 0x20, DEF_STR( No ) ) | |
| 811 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 812 | PORT_DIPNAME( 0x40, 0x00, "Auto Hold" ) PORT_DIPLOCATION("SWD:2") | |
| 813 | PORT_DIPSETTING( 0x40, DEF_STR( No ) ) | |
| 814 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 815 | PORT_DIPNAME( 0x80, 0x00, "Hopper" ) PORT_DIPLOCATION("SWD:1") | |
| 816 | PORT_DIPSETTING( 0x80, DEF_STR( No ) ) | |
| 817 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 818 | ||
| 819 | PORT_START("DSW5") | |
| 820 | PORT_DIPNAME( 0x07, 0x07, "Key Out Rate" ) PORT_DIPLOCATION("SWE:8,7,6") | |
| 821 | PORT_DIPSETTING( 0x07, "1:1" ) | |
| 822 | PORT_DIPSETTING( 0x06, "10:1" ) | |
| 823 | PORT_DIPSETTING( 0x05, "20:1" ) | |
| 824 | PORT_DIPSETTING( 0x04, "50:1" ) | |
| 825 | PORT_DIPSETTING( 0x03, "100:1" ) /* latest 4 is 100 for ON/OFF */ | |
| 826 | PORT_DIPNAME( 0x08, 0x08, "Card Select" ) PORT_DIPLOCATION("SWE:5") | |
| 827 | PORT_DIPSETTING( 0x08, "Poker" ) | |
| 828 | PORT_DIPSETTING( 0x00, "Symbols" ) | |
| 829 | PORT_DIPNAME( 0x70, 0x70, "Ticket Rate" ) PORT_DIPLOCATION("SWE:4,3,2") | |
| 830 | PORT_DIPSETTING( 0x70, "1:1" ) | |
| 831 | PORT_DIPSETTING( 0x60, "5:1" ) | |
| 832 | PORT_DIPSETTING( 0x50, "10:1" ) | |
| 833 | PORT_DIPSETTING( 0x40, "20:1" ) | |
| 834 | PORT_DIPSETTING( 0x30, "25:1" ) | |
| 835 | PORT_DIPSETTING( 0x20, "50:1" ) | |
| 836 | PORT_DIPSETTING( 0x10, "100:1" ) | |
| 837 | PORT_DIPSETTING( 0x00, "200:1" ) | |
| 838 | PORT_DIPNAME( 0x80, 0x00, "Oddstab Fixed" ) PORT_DIPLOCATION("SWE:1") | |
| 839 | PORT_DIPSETTING( 0x80, DEF_STR( No ) ) | |
| 840 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 841 | ||
| 842 | PORT_START("SERVICE") | |
| 843 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor | |
| 844 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4) PORT_NAME("Payout") | |
| 845 | PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) | |
| 846 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F1) PORT_NAME("Statistics") | |
| 847 | ||
| 848 | PORT_START("COINS") | |
| 849 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 850 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 851 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 852 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_Q) PORT_NAME("Key In") | |
| 853 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_W) PORT_NAME("Key Down") | |
| 854 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 855 | ||
| 856 | PORT_START("BUTTONS1") | |
| 857 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 858 | ||
| 859 | PORT_START("BUTTONS2") | |
| 860 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 861 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hold1/High/Low") | |
| 862 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold5/Bet") | |
| 863 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold4/Take") | |
| 864 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hold3/W-Up") | |
| 865 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hold2/Red/Black") | |
| 866 | PORT_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 867 | ||
| 868 | INPUT_PORTS_END | |
| 869 | ||
| 870 | ||
| 871 | ||
| 872 | ||
| 873 | static const gfx_layout charlayout = | |
| 874 | { | |
| 875 | 8, 8, /* 8*8 characters */ | |
| 876 | RGN_FRAC(1, 3), | |
| 877 | 6, /* 6 bits per pixel */ | |
| 878 | { RGN_FRAC(0,3)+8,RGN_FRAC(0,3)+0, | |
| 879 | RGN_FRAC(1,3)+8,RGN_FRAC(1,3)+0, | |
| 880 | RGN_FRAC(2,3)+8,RGN_FRAC(2,3)+0 }, | |
| 881 | { STEP8(0,1) }, | |
| 882 | { STEP8(0,2*8) }, | |
| 883 | 8*8*2 /* every char takes 32 consecutive bytes */ | |
| 884 | }; | |
| 885 | ||
| 886 | static const gfx_layout charlayout2 = | |
| 887 | { | |
| 888 | 8, 32, /* 8*32 characters */ | |
| 889 | RGN_FRAC(1, 3), | |
| 890 | 6, /* 6 bits per pixel */ | |
| 891 | { RGN_FRAC(0,3)+8,RGN_FRAC(0,3)+0, | |
| 892 | RGN_FRAC(1,3)+8,RGN_FRAC(1,3)+0, | |
| 893 | RGN_FRAC(2,3)+8,RGN_FRAC(2,3)+0 }, | |
| 894 | { STEP8(0,1) }, | |
| 895 | { STEP32(0,2*8) }, | |
| 896 | 8*32*2 | |
| 897 | }; | |
| 898 | ||
| 899 | static GFXDECODE_START( igspoker ) | |
| 900 | GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 0, 16 ) | |
| 901 | GFXDECODE_ENTRY( "gfx2", 0x04000, charlayout2, 0, 16 ) | |
| 902 | GFXDECODE_ENTRY( "gfx2", 0x08000, charlayout2, 0, 16 ) | |
| 903 | GFXDECODE_ENTRY( "gfx2", 0x0c000, charlayout2, 0, 16 ) | |
| 904 | GFXDECODE_ENTRY( "gfx2", 0x00000, charlayout2, 0, 16 ) | |
| 905 | GFXDECODE_END | |
| 906 | ||
| 907 | static MACHINE_DRIVER_START( igspoker ) | |
| 908 | ||
| 909 | /* basic machine hardware */ | |
| 910 | MDRV_CPU_ADD("main",Z80, 3579545) | |
| 911 | MDRV_CPU_PROGRAM_MAP(igspoker_prg_map,0) | |
| 912 | MDRV_CPU_IO_MAP(igspoker_io_map,0) | |
| 913 | MDRV_CPU_VBLANK_INT_HACK(igs_interrupt,8) | |
| 914 | ||
| 915 | MDRV_MACHINE_RESET(igs) | |
| 916 | ||
| 917 | /* video hardware */ | |
| 918 | MDRV_SCREEN_ADD("main", RASTER) | |
| 919 | MDRV_SCREEN_REFRESH_RATE(57) | |
| 920 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 921 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 922 | MDRV_SCREEN_SIZE(64*8, 32*8) | |
| 923 | MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0, 32*8-1) | |
| 924 | ||
| 925 | MDRV_GFXDECODE(igspoker) | |
| 926 | MDRV_PALETTE_LENGTH(2048) | |
| 927 | ||
| 928 | MDRV_VIDEO_START(igs_video) | |
| 929 | MDRV_VIDEO_UPDATE(igs_video) | |
| 930 | ||
| 931 | /* sound hardware */ | |
| 932 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 933 | MDRV_SOUND_ADD("ym", YM2413, 3579545) | |
| 934 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 935 | ||
| 936 | MACHINE_DRIVER_END | |
| 937 | ||
| 938 | static MACHINE_DRIVER_START( csk227it ) | |
| 939 | ||
| 940 | MDRV_IMPORT_FROM(igspoker) | |
| 941 | ||
| 942 | MACHINE_DRIVER_END | |
| 943 | ||
| 944 | static MACHINE_DRIVER_START( csk234it ) | |
| 945 | ||
| 946 | MDRV_IMPORT_FROM(igspoker) | |
| 947 | ||
| 948 | MACHINE_DRIVER_END | |
| 949 | ||
| 950 | static MACHINE_DRIVER_START( igs_ncs ) | |
| 951 | ||
| 952 | MDRV_IMPORT_FROM(igspoker) | |
| 953 | ||
| 954 | MACHINE_DRIVER_END | |
| 955 | ||
| 956 | ||
| 957 | ||
| 958 | /* ROM Regions definition | |
| 959 | */ | |
| 960 | ||
| 961 | ROM_START( cpoker ) | |
| 962 | ROM_REGION( 0x10000, "main", 0 ) | |
| 963 | ROM_LOAD( "v220i1.bin", 0x0000, 0x8000, CRC(b7cae556) SHA1(bb43ee48634879029ed1a7cd4133d7f12413e2ac) ) | |
| 964 | ROM_LOAD( "v220i2.bin", 0x8000, 0x8000, CRC(8245e42c) SHA1(b7e7b9f643e6dc2f4d5aaf7d50d0a9154ed9a4e7) ) | |
| 965 | ||
| 966 | ROM_REGION( 0x60000, "gfx1", ROMREGION_DISPOSE ) | |
| 967 | ROM_LOAD( "220i1.bin", 0x40000, 0x20000, CRC(9c4c0af1) SHA1(7a9808b3093b23bde7ecc7405689b2a28ae34e61) ) | |
| 968 | ROM_LOAD( "220i2.bin", 0x20000, 0x20000, CRC(331fa4b8) SHA1(ddac57251fa5dfecc0988a2ca01eec016ef47f20) ) | |
| 969 | ROM_LOAD( "220i3.bin", 0x00000, 0x20000, CRC(bd2f797c) SHA1(5ca5adae44490dd109f630213a09a68c12f9bd1a) ) | |
| 970 | ||
| 971 | ROM_REGION( 0x30000, "gfx2", ROMREGION_ERASE00 | ROMREGION_DISPOSE ) | |
| 972 | ||
| 973 | ROM_REGION( 0x10000, "gfx3", 0 ) /* expansion rom - contains backgrounds and pictures charmaps */ | |
| 974 | ROM_LOAD( "220i7.bin", 0x0000, 0x8000, CRC(8a2ff310) SHA1(a415a99dbb1448b4b2b94e17a3973e6347e3be18) ) | |
| 975 | ROM_END | |
| 976 | ||
| 977 | ROM_START( csk227it ) | |
| 978 | ROM_REGION( 0x10000, "main", 0 ) | |
| 979 | ROM_LOAD( "v227i.bin", 0x0000, 0x10000, CRC(df1ebf49) SHA1(829c7575d3d3780557405b3a61859901df6dbe4f) ) | |
| 980 | ||
| 981 | ROM_REGION( 0x60000, "gfx1", ROMREGION_DISPOSE ) | |
| 982 | ROM_LOAD( "6.227", 0x00000, 0x20000, CRC(e9aad93b) SHA1(72116759cd8ddd9828f534e8f8a3f9f96ad2e002) ) | |
| 983 | ROM_LOAD( "5.227", 0x20000, 0x20000, CRC(e4c4c8da) SHA1(0442b0de68f3b69e613506348e00c3cf9139edcf) ) | |
| 984 | ROM_LOAD( "4.227", 0x40000, 0x20000, CRC(afb365dd) SHA1(930a4cd516258e703a75afc25ef6b2655b8b696a) ) | |
| 985 | ||
| 986 | ROM_REGION( 0x30000, "gfx2", ROMREGION_DISPOSE ) | |
| 987 | ROM_LOAD( "3.bin", 0x00000, 0x10000, CRC(fcb115ac) SHA1(a9f2b9762413840669cd44f8e54b47a7c4350d11) ) | |
| 988 | ROM_LOAD( "2.bin", 0x10000, 0x10000, CRC(848343a3) SHA1(b12f9bc2feb470d2fa8b085621fa60c0895109d4) ) | |
| 989 | ROM_LOAD( "1.bin", 0x20000, 0x10000, CRC(921ad5de) SHA1(b06ab2e63b31361dcb0367110f47bf2453ecdca6) ) | |
| 990 | ||
| 991 | ROM_REGION( 0x10000, "gfx3", 0 ) /* expansion rom - contains backgrounds and pictures charmaps */ | |
| 992 | ROM_LOAD( "7.227", 0x0000, 0x10000, CRC(a10786ad) SHA1(82f5f81808ca70d67a2710cc66fbbf78588b33b5) ) | |
| 993 | ROM_END | |
| 994 | ||
| 995 | ROM_START( csk234it ) | |
| 996 | ROM_REGION( 0x10000, "main", 0 ) | |
| 997 | ROM_LOAD( "v234it.bin", 0x0000, 0x10000, CRC(344b7059) SHA1(990cb84e35c0c50d3be9fbb76a11395114dc6c9b) ) | |
| 998 | ||
| 999 | ROM_REGION( 0x60000, "gfx1", ROMREGION_DISPOSE ) | |
| 1000 | ROM_LOAD( "6.234", 0x00000, 0x20000, CRC(23b855a4) SHA1(8217bac61ad09483d8789113cf394d0e525ab28a) ) | |
| 1001 | ROM_LOAD( "5.234", 0x20000, 0x20000, CRC(189039d7) SHA1(146fd1ddb23ceaa4192e0382b0ab82f5cfbdabfe) ) | |
| 1002 | ROM_LOAD( "4.234", 0x40000, 0x20000, CRC(c82b0ffc) SHA1(5ebd7da76d402b7111cbe9012cfa3b8a8ff1a86e) ) | |
| 1003 | ||
| 1004 | ROM_REGION( 0x30000, "gfx2", ROMREGION_DISPOSE ) | |
| 1005 | ROM_LOAD( "3.bin", 0x00000, 0x10000, CRC(fcb115ac) SHA1(a9f2b9762413840669cd44f8e54b47a7c4350d11) ) | |
| 1006 | ROM_LOAD( "2.bin", 0x10000, 0x10000, CRC(848343a3) SHA1(b12f9bc2feb470d2fa8b085621fa60c0895109d4) ) | |
| 1007 | ROM_LOAD( "1.bin", 0x20000, 0x10000, CRC(921ad5de) SHA1(b06ab2e63b31361dcb0367110f47bf2453ecdca6) ) | |
| 1008 | ||
| 1009 | ROM_REGION( 0x10000, "gfx3", 0 ) /* expansion rom - contains backgrounds and pictures charmaps */ | |
| 1010 | ROM_LOAD( "7.234", 0x0000, 0x10000, CRC(ae6dd4ad) SHA1(4772d5c150d64d1ef3b68e16214f594eea0b3c1b) ) | |
| 1011 | ROM_END | |
| 1012 | ||
| 1013 | ||
| 1014 | /* | |
| 1015 | ||
| 1016 | Stelle e Cubi | |
| 1017 | ||
| 1018 | -- most of the roms on this seem to be the wrong size / missing data | |
| 1019 | but its appears to be a hack based on Champion Skill | |
| 1020 | ||
| 1021 | 1x Z84c0006 | |
| 1022 | 1x 12mhz OSC | |
| 1023 | 1x U6295 sound chip | |
| 1024 | 1x Actel FPGA (gfx chip) | |
| 1025 | ||
| 1026 | ROMs | |
| 1027 | Note 1x Battery | |
| 1028 | 5x banks of dipswitch | |
| 1029 | ||
| 1030 | ||
| 1031 | -- | |
| 1032 | ||
| 1033 | This doesn't attempt to decode the gfx. | |
| 1034 | ||
| 1035 | */ | |
| 1036 | ROM_START( stellecu ) | |
| 1037 | ROM_REGION( 0x20000, "main", 0 ) | |
| 1038 | /* there is data at 0x18000 which is probably mapped somewhere */ | |
| 1039 | ROM_LOAD( "u35.bin", 0x0000, 0x20000, CRC(914b7c59) SHA1(3275b5016524467199f32d653c757bfe4f9cfc60) ) | |
| 1040 | ||
| 1041 | ROM_REGION( 0x60000, "gfx1", ROMREGION_DISPOSE ) | |
| 1042 | /* seems to be missing half the gfx */ | |
| 1043 | ROM_LOAD( "u23.bin", 0x0000, 0x40000, BAD_DUMP CRC(9d95757d) SHA1(f7f44d684f1f3a5b1e9c0a82f4377c6d79eb4214) ) | |
| 1044 | ||
| 1045 | ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) | |
| 1046 | /* seems to be missing half the gfx */ | |
| 1047 | ROM_LOAD( "u25.bin", 0x0000, 0x40000, BAD_DUMP CRC(63094010) SHA1(a781f1c529167dd0ab411c66b72105fc19e32f02) ) | |
| 1048 | ||
| 1049 | ROM_REGION( 0x10000, "gfx3", ROMREGION_ERASE00 ) | |
| 1050 | ||
| 1051 | ROM_REGION( 0x40000, "oki", 0 ) /* Oki Samples */ | |
| 1052 | /* missing sample tables at start of rom */ | |
| 1053 | ROM_LOAD( "u15.bin", 0x0000, 0x40000, BAD_DUMP CRC(72e3e9c1) SHA1(6a8fb93059bee5a4e4b4deb9fee4b5869e53983b) ) | |
| 1054 | ROM_END | |
| 1055 | ||
| 1056 | /* Decode a simple PAL encryption | |
| 1057 | */ | |
| 1058 | ||
| 1059 | static DRIVER_INIT( cpoker ) | |
| 1060 | { | |
| 1061 | int A; | |
| 1062 | UINT8 *rom = memory_region(machine, "main"); | |
| 1063 | ||
| 1064 | ||
| 1065 | for (A = 0;A < 0x10000;A++) | |
| 1066 | { | |
| 1067 | rom[A] ^= 0x21; | |
| 1068 | if ((A & 0x0030) == 0x0010) rom[A] ^= 0x20; | |
| 1069 | if ((A & 0x0282) == 0x0282) rom[A] ^= 0x01; | |
| 1070 | if ((A & 0x0940) == 0x0940) rom[A] ^= 0x02; | |
| 1071 | } | |
| 1072 | } | |
| 1073 | ||
| 1074 | static DRIVER_INIT( cpokert ) | |
| 1075 | { | |
| 1076 | UINT8 *rom = memory_region(machine, "main"); | |
| 1077 | int i; | |
| 1078 | ||
| 1079 | /* decrypt the program ROM */ | |
| 1080 | for (i = 0;i < 0x10000;i++) | |
| 1081 | { | |
| 1082 | if((i & 0x200) && (i & 0x80)) | |
| 1083 | { | |
| 1084 | rom[i] ^= ((~i & 2) >> 1); | |
| 1085 | } | |
| 1086 | else | |
| 1087 | { | |
| 1088 | rom[i] ^= 0x01; | |
| 1089 | } | |
| 1090 | ||
| 1091 | if((i & 0x30) != 0x10) | |
| 1092 | { | |
| 1093 | rom[i] ^= 0x20; | |
| 1094 | } | |
| 1095 | ||
| 1096 | if((i & 0x900) == 0x900 && ((i & 0xc0) == 0x40 || (i & 0xc0) == 0xc0)) | |
| 1097 | { | |
| 1098 | rom[i] ^= 0x02; | |
| 1099 | } | |
| 1100 | } | |
| 1101 | } | |
| 1102 | ||
| 1103 | static DRIVER_INIT( cska ) | |
| 1104 | { | |
| 1105 | int A; | |
| 1106 | UINT8 *rom = memory_region(machine, "main"); | |
| 1107 | ||
| 1108 | ||
| 1109 | for (A = 0;A < 0x10000;A++) | |
| 1110 | { | |
| 1111 | if ((A & 0x0020) == 0x0000) rom[A] ^= 0x01; | |
| 1112 | if ((A & 0x0020) == 0x0020) rom[A] ^= 0x21; | |
| 1113 | if ((A & 0x0282) == 0x0282) rom[A] ^= 0x01; | |
| 1114 | if ((A & 0x0028) == 0x0028) rom[A] ^= 0x20; | |
| 1115 | if ((A & 0x0940) == 0x0940) rom[A] ^= 0x02; | |
| 1116 | } | |
| 1117 | } | |
| 1118 | ||
| 1119 | ||
| 1120 | static DRIVER_INIT( igs_ncs ) | |
| 1121 | { | |
| 1122 | int A; | |
| 1123 | UINT8 *rom = memory_region(machine, "main"); | |
| 1124 | ||
| 1125 | ||
| 1126 | for (A = 0;A < 0x10000;A++) | |
| 1127 | { | |
| 1128 | rom[A] ^= 0x21; | |
| 1129 | if ((A & 0x0282) == 0x0282) rom[A] ^= 0x01; | |
| 1130 | if ((A & 0x0140) == 0x0100) rom[A] ^= 0x20; | |
| 1131 | if ((A & 0x0940) == 0x0940) rom[A] ^= 0x02; | |
| 1132 | } | |
| 1133 | } | |
| 1134 | ||
| 1135 | ||
| 1136 | /* | |
| 1137 | ||
| 1138 | 1x ZILOG Z0840006PSC-Z80CPU (main) | |
| 1139 | 1x YM2413 (sound) | |
| 1140 | 1x NEC D8255AC (label: ORIGINAL BY IGS 102986) | |
| 1141 | 1x oscillator 12.000MHz (main) | |
| 1142 | 1x oscillator 3.579545MHz (sound) | |
| 1143 | ||
| 1144 | 1x custom QFP80 label AMT001 | |
| 1145 | 1x custom QFP80 label IGS002 | |
| 1146 | 1x custom DIP40 label IGS003 (under chip label 8255) | |
| 1147 | ||
| 1148 | ROMs | |
| 1149 | ||
| 1150 | 3x MX27C1000DC (4,5,6) | |
| 1151 | 1x NM27C256Q (7) | |
| 1152 | 1x 27C512 (200) | |
| 1153 | 2x PEEL18CV8P (8,9) | |
| 1154 | 1x PAL16L8ACN (31) | |
| 1155 | 2x PEEL18CV8P (12,14) <-> UNREADABLE, protected! | |
| 1156 | ||
| 1157 | Note | |
| 1158 | ||
| 1159 | 1x 10x2 edge connector (con1) (looks like a coin payout) | |
| 1160 | 1x 36x2 edge connector (con2) | |
| 1161 | 1x pushbutton (sw6) | |
| 1162 | 5x 8 switches dips (sw1-5) | |
| 1163 | 1x trimmer (volume) | |
| 1164 | ---------------------- | |
| 1165 | IGS PCB NO-T0039-8 | |
| 1166 | ||
| 1167 | */ | |
| 1168 | ||
| 1169 | ROM_START( cpokert ) | |
| 1170 | ROM_REGION( 0x10000, "main", 0 ) | |
| 1171 | ROM_LOAD( "champingv-200g.u23", 0x00000, 0x10000, CRC(696cb684) SHA1(ce9e5bed83d0bd3b115f556cc89e3293ac6b69c3) ) | |
| 1172 | ||
| 1173 | ROM_REGION( 0x60000, "gfx1", ROMREGION_DISPOSE ) | |
| 1174 | ROM_LOAD( "cpoker6.u6", 0x00000, 0x20000, CRC(f3e61b24) SHA1(b18998defb6e51daef4ac5a5865674565ffb9029) ) | |
| 1175 | ROM_LOAD( "cpoker5.u5", 0x20000, 0x20000, CRC(a68b305f) SHA1(f872d2bf7ab194145dffe6b254ae0ad66aa6a497) ) | |
| 1176 | ROM_LOAD( "cpoker4.u4", 0x40000, 0x20000, CRC(860be7c9) SHA1(41bc58713076276aeefc44c7ea903549692b0224) ) | |
| 1177 | ||
| 1178 | //copy? | |
| 1179 | ROM_REGION( 0x60000, "gfx2", ROMREGION_DISPOSE ) | |
| 1180 | ROM_COPY( "gfx1", 0, 0, 0x60000 ) | |
| 1181 | ||
| 1182 | ROM_REGION( 0x10000, "gfx3", 0 ) /* expansion rom - contains backgrounds and pictures charmaps */ | |
| 1183 | ROM_LOAD( "cpoker7.u22", 0x0000, 0x8000, CRC(dae3ecda) SHA1(c881e143ec600c5a931f26cd097da6353e1da7c3) ) | |
| 1184 | ||
| 1185 | // convert them to the pld format | |
| 1186 | ROM_REGION( 0x2000, "plds", ROMREGION_DISPOSE ) | |
| 1187 | ROM_LOAD( "ag-u31.u31", 0x00000, 0x000b60, CRC(fd36baf2) SHA1(caac8bf47bc958395f97b6191569196efe3b3eaa) ) | |
| 1188 | ROM_LOAD( "ag-u8.u8", 0x00000, 0x0015e2, CRC(c0308c63) SHA1(16819a5c147fef38a235675fa4442da9fa8a6618) ) | |
| 1189 | ROM_LOAD( "ag-u9.u9", 0x00000, 0x0015e2, CRC(2e8039a3) SHA1(e39635ee9485a5ccd28526f1af7ec2e3294b0aec) ) | |
| 1190 | ROM_END | |
| 1191 | ||
| 1192 | ||
| 1193 | ROM_START( igs_ncs ) | |
| 1194 | ROM_REGION( 0x10000, "main", 0 ) | |
| 1195 | ROM_LOAD( "v.bin", 0x0000, 0x10000, CRC(8077724b) SHA1(1f6e01d5838e6ec4f91b07637c281a3f59631a51) ) | |
| 1196 | ||
| 1197 | ROM_REGION( 0x60000, "gfx1", ROMREGION_DISPOSE ) | |
| 1198 | ROM_LOAD( "6.bin", 0x00000, 0x20000, CRC(d8e88148) SHA1(5f5c06d947027ef76026e8834f2090b96652006c) ) | |
| 1199 | ROM_LOAD( "5.bin", 0x20000, 0x20000, CRC(96c8a71c) SHA1(202d04850df9dfbd405c4b5372ef1b39850ac7f7) ) | |
| 1200 | ROM_LOAD( "4.bin", 0x40000, 0x20000, CRC(5480eae8) SHA1(93e35e8ba7d282cb93d51498420341a4e95acf78) ) | |
| 1201 | ||
| 1202 | ROM_REGION( 0x30000, "gfx2", ROMREGION_DISPOSE ) | |
| 1203 | ROM_LOAD( "3.bin", 0x00000, 0x10000, CRC(fcb115ac) SHA1(a9f2b9762413840669cd44f8e54b47a7c4350d11) ) | |
| 1204 | ROM_LOAD( "2.bin", 0x10000, 0x10000, CRC(848343a3) SHA1(b12f9bc2feb470d2fa8b085621fa60c0895109d4) ) | |
| 1205 | ROM_LOAD( "1.bin", 0x20000, 0x10000, CRC(921ad5de) SHA1(b06ab2e63b31361dcb0367110f47bf2453ecdca6) ) | |
| 1206 | ||
| 1207 | ROM_REGION( 0x10000, "gfx3", 0 ) /* expansion rom - contains backgrounds and pictures charmaps */ | |
| 1208 | ROM_LOAD( "7.bin", 0x0000, 0x10000, CRC(678e412c) SHA1(dba031d3576d098d314d6589dd1aeda44d17c650) ) | |
| 1209 | ROM_END | |
| 1210 | ||
| 1211 | ||
| 1212 | /* New Champion Skill by IGS | |
| 1213 | -- the dump MAY be incomplete, there were 3 empty positions on the PCB near | |
| 1214 | the gfx roms | |
| 1215 | ||
| 1216 | Chips of Note | |
| 1217 | ||
| 1218 | IGS 003C (near chip with TEST OK E0069281 label) | |
| 1219 | IGS 002 | |
| 1220 | IGA 001A | |
| 1221 | ||
| 1222 | ||
| 1223 | 'file' | |
| 1224 | KC8255A | |
| 1225 | 9941 | |
| 1226 | (near CPU roms) | |
| 1227 | ||
| 1228 | UM3567 9946 | |
| 1229 | ||
| 1230 | 5x 8 switch dips | |
| 1231 | ||
| 1232 | Clocks | |
| 1233 | 3.579545Mhz (near sound) | |
| 1234 | 12Mhz | |
| 1235 | ||
| 1236 | ||
| 1237 | --- what is the CPU, it looks like either Z80 or Z180 based | |
| 1238 | -- CPU rom is lightly encrypted (usual IGS style, some xors) | |
| 1239 | ||
| 1240 | */ | |
| 1241 | ||
| 1242 | DRIVER_INIT( igs_ncs2 ) | |
| 1243 | { | |
| 1244 | UINT8 *src = (UINT8 *) (memory_region(machine, "main")); | |
| 1245 | int i; | |
| 1246 | ||
| 1247 | for(i = 0; i < 0x10000; i++) | |
| 1248 | { | |
| 1249 | /* bit 0 xor layer */ | |
| 1250 | if(i & 0x200) | |
| 1251 | { | |
| 1252 | if(i & 0x80) | |
| 1253 | { | |
| 1254 | if(~i & 0x02) | |
| 1255 | { | |
| 1256 | src[i] ^= 0x01; | |
| 1257 | } | |
| 1258 | } | |
| 1259 | else | |
| 1260 | { | |
| 1261 | src[i] ^= 0x01; | |
| 1262 | } | |
| 1263 | } | |
| 1264 | else | |
| 1265 | { | |
| 1266 | src[i] ^= 0x01; | |
| 1267 | } | |
| 1268 | ||
| 1269 | /* bit 1 xor layer */ | |
| 1270 | if(i & 0x800) | |
| 1271 | { | |
| 1272 | if(i & 0x100) | |
| 1273 | { | |
| 1274 | if(i & 0x40) | |
| 1275 | { | |
| 1276 | src[i] ^= 0x02; | |
| 1277 | } | |
| 1278 | } | |
| 1279 | } | |
| 1280 | ||
| 1281 | /* bit 5 xor layer */ | |
| 1282 | if(i & 0x100) | |
| 1283 | { | |
| 1284 | if(i & 0x40) | |
| 1285 | { | |
| 1286 | src[i] ^= 0x20; | |
| 1287 | } | |
| 1288 | } | |
| 1289 | else | |
| 1290 | { | |
| 1291 | src[i] ^= 0x20; | |
| 1292 | } | |
| 1293 | } | |
| 1294 | ||
| 1295 | } | |
| 1296 | ||
| 1297 | ROM_START( igs_ncs2 ) | |
| 1298 | ROM_REGION( 0x10000, "main", 0 ) | |
| 1299 | ROM_LOAD( "ncs_v100n.u20", 0x00000, 0x10000, CRC(2bb91de5) SHA1(b0b7b3b9cee1ce4da10cf78ef1c8079f3d9cafbf) ) | |
| 1300 | ||
| 1301 | ROM_REGION( 0xc0000, "gfx1", ROMREGION_DISPOSE ) | |
| 1302 | ROM_LOAD( "ncs_v100n.u50", 0x00000, 0x40000, CRC(ff2bb3dc) SHA1(364c948504003b4230fbdac74227842c802d4c12) ) | |
| 1303 | ROM_LOAD( "ncs_v100n.u51", 0x40000, 0x40000, CRC(f8530313) SHA1(b21d6de7d5d4b902008ceea7e1227545e0d1701b) ) | |
| 1304 | ROM_LOAD( "ncs_v100n.u52", 0x80000, 0x40000, CRC(2fa5b6df) SHA1(5bfc651297440f73692079f1806b1e40b457b7b8) ) | |
| 1305 | ||
| 1306 | ROM_REGION( 0x30000, "gfx2", ROMREGION_ERASEFF | ROMREGION_DISPOSE ) | |
| 1307 | // looks like these are needed for pre-game screens, sockets were empty | |
| 1308 | ROM_LOAD( "ncs_v100n.u55", 0x00000, 0x10000, NO_DUMP ) | |
| 1309 | ROM_LOAD( "ncs_v100n.u56", 0x10000, 0x10000, NO_DUMP ) | |
| 1310 | ROM_LOAD( "ncs_v100n.u57", 0x20000, 0x10000, NO_DUMP ) | |
| 1311 | ||
| 1312 | ROM_REGION( 0x10000, "gfx3", 0 ) | |
| 1313 | ROM_LOAD( "ncs_v100n.u21", 0x00000, 0x10000, CRC(678e412c) SHA1(dba031d3576d098d314d6589dd1aeda44d17c650) ) | |
| 1314 | ROM_END | |
| 1315 | ||
| 1316 | ||
| 1317 | ||
| 1318 | GAMEL( 1993?, cpoker, 0, igspoker, cpoker, cpoker, ROT0, "IGS", "Champion Poker (v220I)", 0, layout_igspoker ) | |
| 1319 | GAMEL( 1993?, cpokert, cpoker, igspoker, cpoker, cpokert, ROT0, "Tuning", "Champion Poker (v200G)", 0, layout_igspoker ) | |
| 1320 | GAMEL( 198?, csk227it, 0, csk227it, csk227, cska, ROT0, "IGS", "Champion Skill (with Ability)", 0, layout_igspoker ) /* SU 062 */ | |
| 1321 | GAMEL( 198?, csk234it, csk227it, csk234it, csk234, cska, ROT0, "IGS", "Champion Skill (Ability, Poker & Symbols)", 0, layout_igspoker ) /* SU 062 */ | |
| 1322 | GAMEL( 198?, igs_ncs, 0, igs_ncs, igs_ncs, igs_ncs, ROT0, "IGS", "New Champion Skill (v100n)", 0, layout_igspoker ) /* SU 062 */ | |
| 1323 | ||
| 1324 | GAMEL( 2000, igs_ncs2, 0, igs_ncs, igs_ncs, igs_ncs2, ROT0, "IGS", "New Champion Skill (v100n 2000)", GAME_IMPERFECT_GRAPHICS, layout_igspoker ) | |
| 1325 | ||
| 1326 | GAMEL( 1998, stellecu, 0, csk234it, csk234, 0, ROT0, "Sure", "Stelle e Cubi (Italy)", GAME_NOT_WORKING, layout_igspoker ) | |
| 1327 | ||
| 1328 | ||
| 1329 | ||
| 1330 |
| r4184 | r4185 | |
|---|---|---|
| 1014 | 1014 | |
| 1015 | 1015 | /*************************************************************************/ |
| 1016 | 1016 | |
| 1017 | #define ROM_LOAD64_WORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(6)) | |
| 1018 | ||
| 1019 | 1017 | ROM_START(gticlub) |
| 1020 | 1018 | ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */ |
| 1021 | 1019 | ROM_LOAD32_BYTE("688aaa01.21u", 0x000003, 0x80000, CRC(06a56474) SHA1(3a457b885a35e3ee030fd51d847bcf75fce46208)) |
| r4184 | r4185 | |
|---|---|---|
| 98 | 98 | 2008-07 |
| 99 | 99 | Dip locations and suggested settings verified with manual. |
| 100 | 100 | |
| 101 | Note: The master CPU prints a 'SLAVE COM BAD' message on startup | |
| 102 | before it actually tests the slave CPU. The message only remains | |
| 103 | visible if the slave CPU fails to respond. | |
| 104 | ||
| 101 | 105 | ****************************************************************************/ |
| 102 | 106 | |
| 103 | 107 | /* |
| 104 | 108 | |
| 105 | 109 | TODO: |
| 106 | 110 | |
| 107 | - slave com bad at startup | |
| 108 | 111 | - is bitmap drawing in service mode correct? |
| 109 | 112 | - real cpu speeds |
| 110 | 113 | - custom write |
| r4184 | r4185 | |
| 330 | 333 | static MACHINE_DRIVER_START( cloak ) |
| 331 | 334 | |
| 332 | 335 | /* basic machine hardware */ |
| 333 | MDRV_CPU_ADD("main", M6502,1000000) /* 1 MHz ???? */ | |
| 334 | MDRV_CPU_PROGRAM_MAP(master_map,0) | |
| 335 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 336 | MDRV_CPU_ADD("main", M6502, 1000000) /* 1 MHz ???? */ | |
| 337 | MDRV_CPU_PROGRAM_MAP(master_map, 0) | |
| 338 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 4) | |
| 336 | 339 | |
| 337 | MDRV_CPU_ADD("slave", M6502,1250000) /* 1.25 MHz ???? */ | |
| 338 | MDRV_CPU_PROGRAM_MAP(slave_map,0) | |
| 339 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 340 | MDRV_CPU_ADD("slave", M6502, 1250000) /* 1.25 MHz ???? */ | |
| 341 | MDRV_CPU_PROGRAM_MAP(slave_map, 0) | |
| 342 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 2) | |
| 340 | 343 | |
| 341 | MDRV_QUANTUM_TIME(HZ( | |
| 344 | MDRV_QUANTUM_TIME(HZ(1000)) | |
| 342 | 345 | |
| 343 | 346 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 344 | 347 |
| r4184 | r4185 | |
|---|---|---|
| 162 | 162 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start") |
| 163 | 163 | |
| 164 | 164 | PORT_START("IN1") /* 0xe001 */ |
| 165 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Card 1") | |
| 166 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Card 2") | |
| 167 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Card 3") | |
| 168 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Card 4") | |
| 169 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Card 5") | |
| 170 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Card 6") | |
| 165 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Card 1") PORT_CODE(KEYCODE_1_PAD) | |
| 166 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Card 2") PORT_CODE(KEYCODE_2_PAD) | |
| 167 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Card 3") PORT_CODE(KEYCODE_3_PAD) | |
| 168 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Card 4") PORT_CODE(KEYCODE_4_PAD) | |
| 169 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Card 5") PORT_CODE(KEYCODE_5_PAD) | |
| 170 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Card 6") PORT_CODE(KEYCODE_6_PAD) | |
| 171 | 171 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME(DEF_STR( Yes )) PORT_CODE(KEYCODE_Y) |
| 172 | 172 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME(DEF_STR( No )) PORT_CODE(KEYCODE_N) |
| 173 | 173 |
| r4184 | r4185 | |
|---|---|---|
| 380 | 380 | |
| 381 | 381 | /**********************************************************************************/ |
| 382 | 382 | |
| 383 | #define ROM_LOAD64_WORD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(6)) | |
| 384 | ||
| 385 | 383 | ROM_START( dbz ) |
| 386 | 384 | /* main program */ |
| 387 | 385 | ROM_REGION( 0x400000, "main", 0) |
| r4184 | r4185 | |
|---|---|---|
| 5 | 5 | driver by David Haywood and Angelo Salese |
| 6 | 6 | |
| 7 | 7 | Notes: |
| 8 | -The 1-2 Player tiles on hand are actually shown on different screen sides.The Service Mode | |
| 9 | is for adjusting these screens (to not let the human opponent to read your tiles). | |
| 8 | -The 1st/2nd Player tiles on hand are actually shown on different screen sides.The Service | |
| 9 | Mode is for adjusting these screens (to not let the human opponent to read your tiles). | |
| 10 | 10 | |
| 11 | 11 | TODO: |
| 12 | -MSM5205 samples are wrongly played i.e. plays chi when it's clearly a pon.ADPCM index issue; | |
| 13 | -MSM5205 sample stop is wrong; | |
| 12 | 14 | -Video buffering? If you coin up,you can see the "credit 1" msg that gets build into the |
| 13 | 15 | video bitmaps... |
| 14 | 16 | -According to the flyer,color bitplanes might be wrong on the A-N mahjong charset,might be a |
| 15 | 17 | BTANB however... |
| 16 | 18 | -I need schematics / pcb photos (component + solder sides) to understand if the background |
| 17 | 19 | color is hard-wired to the DIP-Switches or there's something else wrong. |
| 18 | -Missing MSM5205 samples; | |
| 19 | 20 | |
| 20 | 21 | ============================================================================================ |
| 21 | 22 | Debug cheats: |
| 22 | 23 | |
| 23 | 24 | c01b-c028 player-1 tiles |
| 24 | c02b-c038 right computer tiles | |
| 25 | c03b-c048 up computer tiles / player-2 tiles | |
| 26 | c04b-c058 left computer tiles | |
| 25 | c02b-c038 "right" computer tiles | |
| 26 | c03b-c048 "up" computer tiles / player-2 tiles | |
| 27 | c04b-c058 "left" computer tiles | |
| 27 | 28 | |
| 28 | 29 | ============================================================================================ |
| 29 | 30 | |
| r4184 | r4185 | |
| 64 | 65 | #include "driver.h" |
| 65 | 66 | #include "cpu/z80/z80.h" |
| 66 | 67 | #include "sound/sn76496.h" |
| 68 | #include "sound/msm5205.h" | |
| 67 | 69 | |
| 68 | 70 | static UINT8 *jan_bitmap_1,*jan_bitmap_2,*jan_bitmap_3,*jan_bitmap_4; |
| 69 | 71 | static UINT8 vram_bank,col_bank; |
| r4184 | r4185 | |
| 210 | 212 | return (input_port_read(space->machine, "DSW2") & 0x3f) | 0x80; |
| 211 | 213 | } |
| 212 | 214 | |
| 215 | static UINT32 adpcm_pos; | |
| 216 | static UINT8 adpcm_idle; | |
| 217 | static int adpcm_data; | |
| 218 | ||
| 219 | static WRITE8_HANDLER( jan_adpcm_w ) | |
| 220 | { | |
| 221 | switch (offset) | |
| 222 | { | |
| 223 | case 0: | |
| 224 | adpcm_pos = (data & 0xff) * 0x80; | |
| 225 | adpcm_idle = 0; | |
| 226 | msm5205_reset_w(0,0); | |
| 227 | // printf("%02x 0\n",data); | |
| 228 | break; | |
| 229 | /*same write as port 2?*/ | |
| 230 | case 1: | |
| 231 | // adpcm_idle = 1; | |
| 232 | // msm5205_reset_w(0,1); | |
| 233 | // printf("%02x 1\n",data); | |
| 234 | break; | |
| 235 | } | |
| 236 | } | |
| 237 | ||
| 238 | static void jan_adpcm_int(const device_config *device) | |
| 239 | { | |
| 240 | static UINT8 trigger; | |
| 241 | ||
| 242 | if (adpcm_pos >= 0x8000 || adpcm_idle) | |
| 243 | { | |
| 244 | //adpcm_idle = 1; | |
| 245 | msm5205_reset_w(0,1); | |
| 246 | trigger = 0; | |
| 247 | } | |
| 248 | else | |
| 249 | { | |
| 250 | UINT8 *ROM = memory_region(device->machine, "adpcm"); | |
| 251 | ||
| 252 | adpcm_data = ((trigger ? (ROM[adpcm_pos] & 0x0f) : (ROM[adpcm_pos] & 0xf0)>>4) ); | |
| 253 | msm5205_data_w(0,adpcm_data & 0xf); | |
| 254 | trigger^=1; | |
| 255 | if(trigger == 0) | |
| 256 | { | |
| 257 | adpcm_pos++; | |
| 258 | if((ROM[adpcm_pos] & 0xff) == 0xff) | |
| 259 | adpcm_idle = 1; | |
| 260 | } | |
| 261 | } | |
| 262 | } | |
| 263 | ||
| 264 | ||
| 213 | 265 | static ADDRESS_MAP_START( jantotsu_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 214 | 266 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 215 | 267 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| r4184 | r4185 | |
| 220 | 272 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 221 | 273 | AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW1") AM_WRITE(sn76496_0_w) |
| 222 | 274 | AM_RANGE(0x01, 0x01) AM_READ(jantotsu_dsw2_r) AM_WRITE(sn76496_1_w) |
| 223 | | |
| 275 | AM_RANGE(0x02, 0x03) AM_WRITE(jan_adpcm_w) | |
| 224 | 276 | AM_RANGE(0x04, 0x04) AM_READWRITE(jantotsu_mux_r,jantotsu_mux_w) |
| 225 | 277 | AM_RANGE(0x07, 0x07) AM_WRITE(bankaddr_w) |
| 226 | 278 | ADDRESS_MAP_END |
| r4184 | r4185 | |
| 336 | 388 | mux_data = 0; |
| 337 | 389 | /*Load hard-wired background color.*/ |
| 338 | 390 | col_bank = (input_port_read(machine, "DSW2") & 0xc0)>>3; |
| 391 | adpcm_pos = 0; | |
| 392 | adpcm_idle = 1; | |
| 339 | 393 | } |
| 340 | 394 | |
| 395 | static const msm5205_interface msm5205_config = | |
| 396 | { | |
| 397 | jan_adpcm_int, /* interrupt function */ | |
| 398 | MSM5205_S48_4B /* 8kHz */ | |
| 399 | }; | |
| 400 | ||
| 341 | 401 | static MACHINE_DRIVER_START( jantotsu ) |
| 342 | 402 | /* basic machine hardware */ |
| 343 | 403 | MDRV_CPU_ADD("main", Z80,18432000/4) |
| r4184 | r4185 | |
| 368 | 428 | |
| 369 | 429 | MDRV_SOUND_ADD("sn2", SN76489A, 18432000/4) |
| 370 | 430 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 431 | ||
| 432 | MDRV_SOUND_ADD("adpcm", MSM5205, 288000) | |
| 433 | MDRV_SOUND_CONFIG(msm5205_config) | |
| 434 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) | |
| 371 | 435 | MACHINE_DRIVER_END |
| 372 | 436 | |
| 373 | 437 | |
| r4184 | r4185 | |
| 381 | 445 | ROM_LOAD( "jat-04.3e", 0x08000, 0x02000, CRC(734e029f) SHA1(75aa13397847b4db32c41aaa6ff2ac82f16bd7a2) ) |
| 382 | 446 | ROM_LOAD( "jat-05.4e", 0x0a000, 0x02000, CRC(1a725e1a) SHA1(1d39d607850f47b9389f41147d4570da8814f639) ) |
| 383 | 447 | |
| 384 | ROM_REGION( 0x8000, " | |
| 448 | ROM_REGION( 0x8000, "adpcm", 0 ) | |
| 385 | 449 | ROM_LOAD( "jat-40.6b", 0x00000, 0x02000, CRC(2275253e) SHA1(64e9415faf2775c6b9ab497dce7fda8c4775192e) ) |
| 386 | 450 | ROM_LOAD( "jat-41.7b", 0x02000, 0x02000, CRC(ce08ed71) SHA1(8554e5e7ec178f57bed5fbdd5937e3a35f72c454) ) |
| 387 | 451 | ROM_LOAD( "jat-42.8b", 0x04000, 0x02000, CRC(3ac3efbf) SHA1(846faea7c7c01fb7500aa33a70d4b54e878c0e41) ) |
| r4184 | r4185 | |
|---|---|---|
| 2944 | 2944 | ROM_LOAD( "mpr-19505.34", 0x400000, 0x400000, CRC(eba7f41d) SHA1(f6e521bedf298808a768f6fdcb0b60b320a66d04) ) |
| 2945 | 2945 | ROM_END |
| 2946 | 2946 | |
| 2947 | ROM_START( segawski ) /* Sega Water Ski Revision A, Model 2C */ | |
| 2948 | ROM_REGION( 0x200000, "main", 0 ) // i960 program | |
| 2949 | ROM_LOAD32_WORD("epr-19963a.15", 0x000000, 0x080000, CRC(89c9cb0d) SHA1(7f1f600222447effb28cf2d56193ea9f45fd0646) ) | |
| 2950 | ROM_LOAD32_WORD("epr-19964a.16", 0x000002, 0x080000, CRC(c382cefe) SHA1(c0ccee4eb19d9626dee0f77f08060f1d9708b39d) ) | |
| 2951 | ||
| 2952 | ROM_REGION32_LE( 0x2000000, "user1", 0 ) // Data | |
| 2953 | ROM_LOAD32_WORD("mpr-19980.11", 0x0000000, 0x400000, CRC(709804f2) SHA1(6633eeb2bc0ddd5eb5994cb7cc39ed4ab2094a7e) ) | |
| 2954 | ROM_LOAD32_WORD("mpr-19981.12", 0x0000002, 0x400000, CRC(a1e8ec09) SHA1(53abaf71e85f874d28a79c8775b1f0ac919fbe22) ) | |
| 2955 | ROM_LOAD32_WORD("mpr-19982.9", 0x0800000, 0x400000, CRC(41c398bb) SHA1(e6652111a494165c93d5e9dc7d1c3df46f1a8961) ) | |
| 2956 | ROM_LOAD32_WORD("mpr-19983.10", 0x0800002, 0x400000, CRC(e210dea2) SHA1(a32010648046738f64cbc7e1a074b9443bbde865) ) | |
| 2957 | ROM_LOAD32_WORD("mpr-19984.7", 0x1000000, 0x400000, CRC(14b967d1) SHA1(8e0fd13f5838218224ce162a55558b75dcda4cbf) ) | |
| 2958 | ROM_LOAD32_WORD("mpr-19985.8", 0x1000002, 0x400000, CRC(57827677) SHA1(0d764ec9e136e4d027aefb10e9f025aa2e081573) ) | |
| 2959 | ROM_LOAD32_WORD("epr-19961.5", 0x1800000, 0x080000, CRC(cc34ecaf) SHA1(8e540a429826d40acef5a34a0b6b1b89e059961b) ) | |
| 2960 | ROM_LOAD32_WORD("epr-19962.6", 0x1800002, 0x080000, CRC(e8a30e5e) SHA1(2d7290186aaca28f3aaf6656b090e1cbe509aa48) ) | |
| 2961 | ||
| 2962 | ROM_REGION( 0x800000, "cpu2", 0 ) // TGPx4 program | |
| 2963 | ROM_LOAD32_WORD("mpr-19986.29", 0x0000000, 0x400000, CRC(4b8e26f8) SHA1(859e3788c75599295a8b57ed7852f2cbb6a2a738) ) | |
| 2964 | ROM_LOAD32_WORD("mpr-19987.30", 0x0000002, 0x400000, CRC(8d5b9d38) SHA1(35f41c474af3754152aecefe81e912120823e0ff) ) | |
| 2965 | ||
| 2966 | ROM_REGION( 0x2000000, "user2", 0 ) // Models | |
| 2967 | ROM_LOAD32_WORD("mpr-19972.17", 0x0000000, 0x400000, CRC(493c0f8f) SHA1(c68f662d53fbcec3d2dbd9ebdfd37cbf1ff46408) ) | |
| 2968 | ROM_LOAD32_WORD("mpr-19497.21", 0x0000002, 0x400000, CRC(01b6f8e1) SHA1(be1f1017ff5f43218de2d99090e4e7db64f7a483) ) | |
| 2969 | ROM_LOAD32_WORD("mpr-19974.18", 0x0800000, 0x400000, CRC(2bd947d3) SHA1(7f16e668db5a4673cd909bdfa1b9dc665827b392) ) | |
| 2970 | ROM_LOAD32_WORD("mpr-19499.22", 0x0800002, 0x400000, CRC(07e6b699) SHA1(35bbea4cd42ab39f976cd2ec964c32d5d3982c4a) ) | |
| 2971 | ROM_LOAD32_WORD("mpr-19976.19", 0x1000000, 0x400000, CRC(f9496566) SHA1(e6dee764301c0ed34e5134a5232898bb42563c20) ) | |
| 2972 | ROM_LOAD32_WORD("mpr-19977.23", 0x1000002, 0x400000, CRC(b3dbf54b) SHA1(d61448394b7b2036e27bdbf7a062d63f076db9da) ) | |
| 2973 | ROM_LOAD32_WORD("mpr-19978.20", 0x1800000, 0x400000, CRC(c80f4ed7) SHA1(e7ea6dfb57ab1fe924a80c244b8acfe4aad2b76d) ) | |
| 2974 | ROM_LOAD32_WORD("mpr-19979.24", 0x1800002, 0x400000, CRC(1c0db4d2) SHA1(65a81f4503c6b9c26650befd183db821545c53e2) ) | |
| 2975 | ||
| 2976 | ROM_REGION( 0x1000000, "user3", 0 ) // Textures | |
| 2977 | ROM_LOAD32_WORD("mpr-19969.27", 0x0000000, 0x400000, CRC(c0c33d39) SHA1(f61a6266556d5687cd03031065baa2dd73112666) ) | |
| 2978 | ROM_LOAD32_WORD("mpr-19968.25", 0x0000002, 0x400000, CRC(b8d2f04f) SHA1(f0f4d2dd06cdf745ed07fe428eaa3e3ad030bff6) ) | |
| 2979 | ROM_LOAD32_WORD("mpr-19971.28", 0x0800000, 0x400000, CRC(c8708096) SHA1(c27e0a90dc1183b0cf7f32e324afa6c126f61d37) ) | |
| 2980 | ROM_LOAD32_WORD("mpr-19970.26", 0x0800002, 0x400000, CRC(c59d8d36) SHA1(24232390f0cac5ffbb17a0093a602363c686fbf8) ) | |
| 2981 | ||
| 2982 | ROM_REGION( 0x100000, "audio", 0 ) // Sound program | |
| 2983 | ROM_LOAD16_WORD_SWAP("epr-19967.31", 0x000000, 0x080000, BAD_DUMP CRC(99c7817f) SHA1(a1c76f0e9da32b49e8d15cc31542c9619b9a265b) ) | |
| 2984 | ||
| 2985 | ROM_REGION( 0x800000, "scsp", 0 ) // Samples | |
| 2986 | ROM_LOAD("mpr-19988.32", 0x000000, 0x400000, CRC(303732fb) SHA1(63efbd9f67b38fddeeed25de660514867e03486a) ) | |
| 2987 | ROM_LOAD("mpr-19989.34", 0x400000, 0x400000, CRC(8074a4b3) SHA1(98dc1d122ffb9b5c52994dea2b5d8c4f004a5f8e) ) | |
| 2988 | ROM_END | |
| 2989 | ||
| 2947 | 2990 | ROM_START( hotd ) /* House of the Dead, Model 2C */ |
| 2948 | 2991 | ROM_REGION( 0x200000, "main", 0 ) // i960 program |
| 2949 | 2992 | ROM_LOAD32_WORD("epr-19696.15", 0x000000, 0x080000, CRC(03da5623) SHA1(be0bd34a9216375c7204445f084f6c74c4d3b0c8) ) |
| r4184 | r4185 | |
| 4445 | 4488 | GAME( 1996, waverunr, 0, model2c, model2, 0, ROT0, "Sega", "Wave Runner (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 4446 | 4489 | GAME( 1997, hotd, 0, model2c, model2, 0, ROT0, "Sega", "House of the Dead", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 4447 | 4490 | GAME( 1997, overrev, 0, model2c, model2, 0, ROT0, "Jaleco", "Over Rev (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 4491 | GAME( 1997, segawski, 0, model2c, model2, 0, ROT0, "Sega", "Sega Water Ski (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 4448 | 4492 | GAME( 1997, topskatr, 0, model2c, model2, 0, ROT0, "Sega", "Top Skater (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 4449 | 4493 | GAME( 1997, topskatu, topskatr, model2c, model2, 0, ROT0, "Sega", "Top Skater (USA)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 4450 | 4494 | GAME( 1998, bel, 0, model2c, bel, 0, ROT0, "Sega/EPL Productions", "Behind Enemy Lines", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| r4184 | r4185 | |
|---|---|---|
| 516 | 516 | { |
| 517 | 517 | if (cpu_get_pc(space->cpu)==0xc0001592) |
| 518 | 518 | { |
| 519 | cpu_ | |
| 519 | cpu_ea | |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | return gstream_workram[0xd1ee0/4]; |
| r4184 | r4185 | |
|---|---|---|
| 1806 | 1806 | INPUT_PORTS_END |
| 1807 | 1807 | |
| 1808 | 1808 | |
| 1809 | #define ROM_LOAD64_WORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(6)) | |
| 1810 | #define ROM_LOAD64_WORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE| ROM_SKIP(6)) | |
| 1811 | 1809 | #define ROM_LOAD_VROM(name, offset, length, hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(14) ) |
| 1812 | //#define ROM_REGION64_BE(length,rclass,rtag,flags) ROM_REGION(length, rclass, rtype, (flags) | ROMREGION_64BIT | ROMREGION_BE) | |
| 1813 | 1810 | |
| 1814 | 1811 | ROM_START( lemans24 ) /* step 1.5 */ |
| 1815 | 1812 | ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */ |
| r4184 | r4185 | |
|---|---|---|
| 46 | 46 | const UINT8 cb2001_decryption_table[256] = { |
| 47 | 47 | 0xe8,xxxx,xxxx,xxxx,xxxx,0x61,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 00 */ |
| 48 | 48 | // pppp ???? |
| 49 | xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, 0x32,xxxx,xxxx,xxxx,0x3a,xxxx,xxxx,0x1f, /* 10 */ | |
| 50 | // pppp pppp ???? | |
| 49 | xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, 0x32,xxxx,0xa0,xxxx,0x3a,xxxx,xxxx,0x1f, /* 10 */ | |
| 50 | // pppp ???? pppp ???? | |
| 51 | 51 | xxxx,0x8e,xxxx,0x0f,xxxx,0x49,0xbc,xxxx, xxxx,xxxx,xxxx,0x75,xxxx,xxxx,xxxx,xxxx, /* 20 */ |
| 52 | 52 | // !!!! ???? ???? ???? pppp |
| 53 | 53 | 0x9d,xxxx,xxxx,xxxx,xxxx,xxxx,0xbe,xxxx, xxxx,xxxx,0x74,xxxx,xxxx,0xa6,0xbf,xxxx, /* 30 */ |
| 54 | 54 | // ???? pppp ???? ???? ???? |
| 55 | xxxx,0xea,xxxx,xxxx,xxxx,0xb0,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 40 */ | |
| 56 | // !!!! gggg | |
| 55 | xxxx,0xea,xxxx,xxxx,xxxx,0xb0,xxxx,xxxx, xxxx,0xa2,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 40 */ | |
| 56 | // !!!! gggg ???? | |
| 57 | 57 | xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x42,xxxx, xxxx,xxxx,xxxx,xxxx,0xeb,xxxx,xxxx,xxxx, /* 50 */ |
| 58 | 58 | // ???? ???? |
| 59 | 59 | xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,0xa5,xxxx,xxxx,xxxx,xxxx,0xba,xxxx, /* 60 */ |
| r0 | r4185 | |
|---|---|---|
| 1 | /***************************************************************************** | |
| 2 | ||
| 3 | Himeshikibu (C) 1989 Hi-Soft | |
| 4 | ||
| 5 | Driver by Uki | |
| 6 | ||
| 7 | *****************************************************************************/ | |
| 8 | ||
| 9 | #include "driver.h" | |
| 10 | #include "deprecat.h" | |
| 11 | #include "cpu/z80/z80.h" | |
| 12 | #include "sound/2203intf.h" | |
| 13 | ||
| 14 | #define MCLK XTAL_12MHz | |
| 15 | ||
| 16 | VIDEO_START( himesiki ); | |
| 17 | VIDEO_UPDATE( himesiki ); | |
| 18 | ||
| 19 | WRITE8_HANDLER( himesiki_bg_ram_w ); | |
| 20 | WRITE8_HANDLER( himesiki_scrollx_w ); | |
| 21 | WRITE8_HANDLER( himesiki_flip_w ); | |
| 22 | ||
| 23 | extern UINT8 *himesiki_bg_ram; | |
| 24 | ||
| 25 | static WRITE8_HANDLER( himesiki_rombank_w ) | |
| 26 | { | |
| 27 | UINT8 *ROM = memory_region(space->machine, "main"); | |
| 28 | memory_set_bankptr(space->machine, 1, &ROM[0x10000+0x800*(data & 8)]); | |
| 29 | ||
| 30 | if (data & 0xf7) | |
| 31 | logerror("p06_w %02x\n",data); | |
| 32 | } | |
| 33 | ||
| 34 | static WRITE8_HANDLER( himesiki_sound_w ) | |
| 35 | { | |
| 36 | soundlatch_w(space, offset, data); | |
| 37 | cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE); | |
| 38 | } | |
| 39 | ||
| 40 | /****************************************************************************/ | |
| 41 | ||
| 42 | static ADDRESS_MAP_START( himesiki_prm0, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 43 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 44 | AM_RANGE(0x8000, 0x9fff) AM_RAM | |
| 45 | AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 46 | AM_RANGE(0xa800, 0xafff) AM_RAM AM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_BASE(&paletteram) | |
| 47 | AM_RANGE(0xb000, 0xbfff) AM_RAM AM_WRITE(himesiki_bg_ram_w) AM_BASE(&himesiki_bg_ram) | |
| 48 | AM_RANGE(0xc000, 0xffff) AM_ROMBANK(1) | |
| 49 | ADDRESS_MAP_END | |
| 50 | ||
| 51 | static ADDRESS_MAP_START( himesiki_iom0, ADDRESS_SPACE_IO, 8 ) | |
| 52 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 53 | AM_RANGE(0x00, 0x00) AM_READ(input_port_2_r) | |
| 54 | AM_RANGE(0x01, 0x01) AM_READ(input_port_3_r) | |
| 55 | AM_RANGE(0x02, 0x02) AM_READ(input_port_4_r) | |
| 56 | AM_RANGE(0x03, 0x03) AM_WRITENOP // 8255 cw | |
| 57 | AM_RANGE(0x04, 0x04) AM_READ(input_port_0_r) | |
| 58 | AM_RANGE(0x05, 0x05) AM_READ(input_port_1_r) | |
| 59 | AM_RANGE(0x06, 0x06) AM_WRITE(himesiki_rombank_w) | |
| 60 | AM_RANGE(0x07, 0x07) AM_WRITENOP // 8255 cw | |
| 61 | AM_RANGE(0x08, 0x08) AM_WRITE(himesiki_flip_w) | |
| 62 | AM_RANGE(0x09, 0x0a) AM_WRITE(himesiki_scrollx_w) | |
| 63 | AM_RANGE(0x0b, 0x0b) AM_WRITE(himesiki_sound_w) | |
| 64 | ADDRESS_MAP_END | |
| 65 | ||
| 66 | static ADDRESS_MAP_START( himesiki_prm1, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 67 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 68 | AM_RANGE(0xf800, 0xffff) AM_RAM | |
| 69 | ADDRESS_MAP_END | |
| 70 | ||
| 71 | static ADDRESS_MAP_START( himesiki_iom1, ADDRESS_SPACE_IO, 8 ) | |
| 72 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 73 | AM_RANGE(0x00, 0x00) AM_READWRITE(ym2203_status_port_0_r,ym2203_control_port_0_w) | |
| 74 | AM_RANGE(0x01, 0x01) AM_READWRITE(ym2203_read_port_0_r,ym2203_write_port_0_w) | |
| 75 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r) | |
| 76 | ADDRESS_MAP_END | |
| 77 | ||
| 78 | /****************************************************************************/ | |
| 79 | ||
| 80 | INPUT_PORTS_START( himesiki ) | |
| 81 | PORT_START("DSW1") /* DSW1 (0) */ | |
| 82 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") | |
| 83 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 84 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 85 | PORT_DIPNAME( 0x02, 0x02, "1-2" ) PORT_DIPLOCATION("SW1:2") | |
| 86 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 87 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 88 | PORT_DIPNAME( 0x04, 0x04, "1-3" ) PORT_DIPLOCATION("SW1:3") | |
| 89 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 90 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 91 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:4") | |
| 92 | PORT_DIPSETTING( 0x08, DEF_STR( Upright ) ) | |
| 93 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 94 | PORT_DIPNAME( 0x10, 0x10, "1-5" ) PORT_DIPLOCATION("SW1:5") | |
| 95 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 96 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 97 | PORT_DIPNAME( 0x20, 0x20, "1-6" ) PORT_DIPLOCATION("SW1:6") | |
| 98 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 99 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 100 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") | |
| 101 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 102 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 103 | PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "SW1:8" ) | |
| 104 | ||
| 105 | PORT_START("DSW2") /* DSW2 (1) */ | |
| 106 | PORT_DIPNAME( 0x01, 0x01, "2-1" ) PORT_DIPLOCATION("SW2:1") | |
| 107 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 108 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 109 | PORT_DIPNAME( 0x02, 0x02, "2-2" ) PORT_DIPLOCATION("SW2:2") | |
| 110 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 111 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 112 | PORT_DIPNAME( 0x04, 0x04, "2-3" ) PORT_DIPLOCATION("SW2:3") | |
| 113 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 114 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 115 | PORT_DIPNAME( 0x08, 0x08, "2-4" ) PORT_DIPLOCATION("SW2:4") | |
| 116 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 117 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 118 | PORT_DIPNAME( 0x10, 0x10, "2-5" ) PORT_DIPLOCATION("SW2:5") | |
| 119 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 120 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 121 | PORT_DIPNAME( 0x20, 0x20, "2-6" ) PORT_DIPLOCATION("SW2:6") | |
| 122 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 123 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 124 | PORT_DIPNAME( 0x40, 0x40, "2-7" ) PORT_DIPLOCATION("SW2:7") | |
| 125 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 126 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 127 | PORT_DIPNAME( 0x80, 0x80, "2-8" ) PORT_DIPLOCATION("SW2:8") | |
| 128 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 129 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 130 | ||
| 131 | PORT_START("1P") /* 1P (2) */ | |
| 132 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) | |
| 133 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) | |
| 134 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) | |
| 135 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) | |
| 136 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 137 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 138 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) | |
| 139 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 140 | ||
| 141 | PORT_START("2P") /* 2P (3) */ | |
| 142 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) | |
| 143 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) | |
| 144 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) | |
| 145 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) | |
| 146 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) | |
| 147 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) | |
| 148 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) | |
| 149 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 150 | ||
| 151 | PORT_START("OTHERS") /* OTHERS (4) */ | |
| 152 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 153 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 154 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 155 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // coin? | |
| 156 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_COIN2 ) // service? | |
| 157 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_START1 ) | |
| 158 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_START2 ) | |
| 159 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 160 | INPUT_PORTS_END | |
| 161 | ||
| 162 | /****************************************************************************/ | |
| 163 | ||
| 164 | static const gfx_layout layout1 = | |
| 165 | { | |
| 166 | 8,8, | |
| 167 | RGN_FRAC(1,1), | |
| 168 | 4, | |
| 169 | { 0,1,2,3 }, | |
| 170 | { 4,0,12,8,20,16,28,24 }, | |
| 171 | { STEP8(0,32) }, | |
| 172 | 8*8*4 | |
| 173 | }; | |
| 174 | ||
| 175 | static const gfx_layout layout2 = | |
| 176 | { | |
| 177 | 32,32, | |
| 178 | RGN_FRAC(1,1), | |
| 179 | 4, | |
| 180 | { 0,1,2,3 }, | |
| 181 | { 4,0,12,8,20,16,28,24,36,32,44,40,52,48,60,56, 68,64,76,72,84,80,92,88,100,96,108,104,116,112,124,120 }, | |
| 182 | { STEP32(0,128) }, | |
| 183 | 32*32*4 | |
| 184 | }; | |
| 185 | ||
| 186 | static const gfx_layout layout3 = | |
| 187 | { | |
| 188 | 16,16, | |
| 189 | RGN_FRAC(1,1), | |
| 190 | 4, | |
| 191 | { 0,1,2,3 }, | |
| 192 | { 4,0,12,8,20,16,28,24,36,32,44,40,52,48,60,56 }, | |
| 193 | { STEP16(0,64) }, | |
| 194 | 16*16*4 | |
| 195 | }; | |
| 196 | ||
| 197 | static GFXDECODE_START( himesiki ) | |
| 198 | GFXDECODE_ENTRY( "bg", 0, layout1, 0x000, 16 ) | |
| 199 | GFXDECODE_ENTRY( "sprites_1", 0, layout2, 0x200, 16 ) | |
| 200 | GFXDECODE_ENTRY( "sprites_2", 0, layout3, 0x200, 16 ) | |
| 201 | GFXDECODE_END | |
| 202 | ||
| 203 | ||
| 204 | static MACHINE_DRIVER_START( himesiki ) | |
| 205 | ||
| 206 | /* basic machine hardware */ | |
| 207 | MDRV_CPU_ADD("main", Z80, MCLK/2) /* 6.000 MHz */ | |
| 208 | MDRV_CPU_PROGRAM_MAP(himesiki_prm0,0) | |
| 209 | MDRV_CPU_IO_MAP(himesiki_iom0,0) | |
| 210 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 211 | ||
| 212 | MDRV_CPU_ADD("sub", Z80, MCLK/3) /* 4.000 MHz */ | |
| 213 | MDRV_CPU_PROGRAM_MAP(himesiki_prm1,0) | |
| 214 | MDRV_CPU_IO_MAP(himesiki_iom1,0) | |
| 215 | ||
| 216 | /* video hardware */ | |
| 217 | MDRV_SCREEN_ADD("main", RASTER) | |
| 218 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 219 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) | |
| 220 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 221 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 222 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 24*8-1) | |
| 223 | MDRV_GFXDECODE(himesiki) | |
| 224 | MDRV_PALETTE_LENGTH(1024) | |
| 225 | ||
| 226 | MDRV_VIDEO_START(himesiki) | |
| 227 | MDRV_VIDEO_UPDATE(himesiki) | |
| 228 | ||
| 229 | /* sound hardware */ | |
| 230 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 231 | MDRV_SOUND_ADD("ym2203", YM2203, MCLK/4) | |
| 232 | MDRV_SOUND_ROUTE(0, "mono", 0.10) | |
| 233 | MDRV_SOUND_ROUTE(1, "mono", 0.10) | |
| 234 | MDRV_SOUND_ROUTE(2, "mono", 0.10) | |
| 235 | MDRV_SOUND_ROUTE(3, "mono", 0.50) | |
| 236 | ||
| 237 | MACHINE_DRIVER_END | |
| 238 | ||
| 239 | /****************************************************************************/ | |
| 240 | ||
| 241 | ROM_START( himesiki ) | |
| 242 | ROM_REGION( 0x018000, "main", 0 ) /* z80 */ | |
| 243 | ROM_LOAD( "1.1k", 0x00000, 0x08000, CRC(fb4604b3) SHA1(e8155bbafb881125e1bf9a04808d6a6546887e90) ) | |
| 244 | ROM_LOAD( "2.1g", 0x10000, 0x08000, CRC(0c30ded1) SHA1(0ad67115fa15d0b6261a278a946a6d46c06430ef) ) | |
| 245 | ||
| 246 | ROM_REGION( 0x010000, "sub", 0 ) /* z80 */ | |
| 247 | ROM_LOAD( "5.6n", 0x00000, 0x08000, CRC(b1214ac7) SHA1(ee5459c28d9c3c2eb3467261716b1259ec486534) ) | |
| 248 | ||
| 249 | ROM_REGION( 0x020000, "bg", ROMREGION_DISPOSE ) /* bg */ | |
| 250 | ROM_LOAD( "3.5f", 0x000000, 0x010000, CRC(73843e60) SHA1(0d8a397d8798e15f3fa7bf7a83e4c2ee44f6fa86) ) | |
| 251 | ROM_LOAD( "4.5d", 0x010000, 0x010000, CRC(443a3164) SHA1(08aa002214251a870581a01d775f497dd390957c) ) | |
| 252 | ||
| 253 | ROM_REGION( 0x060000, "sprites_1", ROMREGION_DISPOSE ) /* sprites */ | |
| 254 | ROM_LOAD16_BYTE( "6.1a", 0x000000, 0x010000, CRC(14989c22) SHA1(fe0c31df10237294ea8ef0ab8965ba5bb25113a2) ) | |
| 255 | ROM_LOAD16_BYTE( "7.1c", 0x000001, 0x010000, CRC(cec56e16) SHA1(836ff413301044313fdf7af5d304c145137b898a) ) | |
| 256 | ROM_LOAD16_BYTE( "8.2a", 0x020000, 0x010000, CRC(44ba127e) SHA1(d756b6c3075d75287f9c8be662c1eab02f4245a3) ) | |
| 257 | ROM_LOAD16_BYTE( "9.2c", 0x020001, 0x010000, CRC(0dda724a) SHA1(2b064b1d657f896e8385f17def9e4ffc0802bf97) ) | |
| 258 | ROM_LOAD16_BYTE( "10.4a", 0x040000, 0x010000, CRC(0adda8d1) SHA1(dfee2c7921fdc972b4e95fdf89520f74a4e8b4ee) ) | |
| 259 | ROM_LOAD16_BYTE( "11.4c", 0x040001, 0x010000, CRC(aa032946) SHA1(bd8900e4a22580e3bfe33b8164909db19bb07a8f) ) | |
| 260 | ||
| 261 | ROM_REGION( 0x040000, "sprites_2", ROMREGION_DISPOSE ) /* sprites */ | |
| 262 | ROM_LOAD16_BYTE( "13.9e", 0x000000, 0x010000, CRC(43102682) SHA1(0d4bde8bece0cbc6c06071aa8ad210a0636d862f) ) | |
| 263 | ROM_LOAD16_BYTE( "12.9c", 0x000001, 0x010000, CRC(19c8f9f4) SHA1(b14c8a6b94fd474be375e7a6a03d7f4517da2247) ) | |
| 264 | ROM_LOAD16_BYTE( "15.8e", 0x020000, 0x010000, CRC(2630d394) SHA1(b2e9e836b1f053fce3212912c53d3cdca3372439) ) | |
| 265 | ROM_LOAD16_BYTE( "14.8c", 0x020001, 0x010000, CRC(8103a207) SHA1(0dde8a0aaf2618d9c1589f35841db210439d0388) ) | |
| 266 | ROM_END | |
| 267 | ||
| 268 | GAME( 1989, himesiki, 0, himesiki, himesiki, 0, ROT90, "Hi-Soft", "Himeshikibu (Japan)", 0 ) |
| r4184 | r4185 | |
|---|---|---|
| 151 | 151 | #include "machine/68681.h" |
| 152 | 152 | |
| 153 | 153 | static UINT8 register_active; |
| 154 | static UINT8 mux_data; | |
| 155 | ||
| 154 | 156 | static struct |
| 155 | 157 | { |
| 156 | 158 | const device_config *duart68681; |
| r4184 | r4185 | |
| 193 | 195 | static MACHINE_RESET( skattv ) |
| 194 | 196 | { |
| 195 | 197 | skattv_devices.duart68681 = device_list_find_by_tag( machine->config->devicelist, DUART68681, "duart68681" ); |
| 198 | mux_data = 0; | |
| 196 | 199 | } |
| 197 | 200 | |
| 198 | 201 | static const duart68681_config skattv_duart68681_config = |
| r4184 | r4185 | |
| 250 | 253 | int x,y,b; |
| 251 | 254 | |
| 252 | 255 | b = ((HD63484_reg[0xcc/2] & 0x000f) << 16) + HD63484_reg[0xce/2]; |
| 253 | ||
| 254 | if (input_code_pressed(KEYCODE_M)) b = 0; | |
| 255 | if (input_code_pressed(KEYCODE_Q)) b += 0x060 * 280 * 1; | |
| 256 | if (input_code_pressed(KEYCODE_W)) b += 0x060 * 280 * 2; | |
| 257 | if (input_code_pressed(KEYCODE_E)) b += 0x060 * 280 * 3; | |
| 258 | if (input_code_pressed(KEYCODE_R)) b += 0x060 * 280 * 4; | |
| 259 | if (input_code_pressed(KEYCODE_T)) b += 0x060 * 280 * 5; | |
| 260 | if (input_code_pressed(KEYCODE_Y)) b += 0x060 * 280 * 6; | |
| 261 | if (input_code_pressed(KEYCODE_U)) b += 0x060 * 280 * 7; | |
| 262 | if (input_code_pressed(KEYCODE_I)) b += 0x060 * 280 * 8; | |
| 263 | if (input_code_pressed(KEYCODE_A)) b += 0x060 * 280 * 9; | |
| 264 | if (input_code_pressed(KEYCODE_S)) b += 0x060 * 280 * 10; | |
| 265 | if (input_code_pressed(KEYCODE_D)) b += 0x060 * 280 * 11; | |
| 266 | if (input_code_pressed(KEYCODE_F)) b += 0x060 * 280 * 12; | |
| 267 | if (input_code_pressed(KEYCODE_G)) b += 0x060 * 280 * 13; | |
| 268 | if (input_code_pressed(KEYCODE_H)) b += 0x060 * 280 * 14; | |
| 269 | if (input_code_pressed(KEYCODE_J)) b += 0x060 * 280 * 15; | |
| 270 | if (input_code_pressed(KEYCODE_K)) b += 0x060 * 280 * 16; | |
| 271 | if (input_code_pressed(KEYCODE_Z)) b += 0x060 * 280 * 17; | |
| 272 | if (input_code_pressed(KEYCODE_X)) b += 0x060 * 280 * 18; | |
| 273 | if (input_code_pressed(KEYCODE_C)) b += 0x060 * 280 * 19; | |
| 274 | if (input_code_pressed(KEYCODE_V)) b += 0x060 * 280 * 20; | |
| 275 | if (input_code_pressed(KEYCODE_B)) b += 0x060 * 280 * 21; | |
| 276 | if (input_code_pressed(KEYCODE_N)) b += 0x060 * 280 * 22; | |
| 277 | ||
| 256 | /* | |
| 257 | if (input_code_pressed(KEYCODE_M)) b = 0; | |
| 258 | if (input_code_pressed(KEYCODE_Q)) b += 0x060 * 280 * 1; | |
| 259 | if (input_code_pressed(KEYCODE_W)) b += 0x060 * 280 * 2; | |
| 260 | if (input_code_pressed(KEYCODE_E)) b += 0x060 * 280 * 3; | |
| 261 | if (input_code_pressed(KEYCODE_R)) b += 0x060 * 280 * 4; | |
| 262 | if (input_code_pressed(KEYCODE_T)) b += 0x060 * 280 * 5; | |
| 263 | if (input_code_pressed(KEYCODE_Y)) b += 0x060 * 280 * 6; | |
| 264 | if (input_code_pressed(KEYCODE_U)) b += 0x060 * 280 * 7; | |
| 265 | if (input_code_pressed(KEYCODE_I)) b += 0x060 * 280 * 8; | |
| 266 | if (input_code_pressed(KEYCODE_A)) b += 0x060 * 280 * 9; | |
| 267 | if (input_code_pressed(KEYCODE_S)) b += 0x060 * 280 * 10; | |
| 268 | if (input_code_pressed(KEYCODE_D)) b += 0x060 * 280 * 11; | |
| 269 | if (input_code_pressed(KEYCODE_F)) b += 0x060 * 280 * 12; | |
| 270 | if (input_code_pressed(KEYCODE_G)) b += 0x060 * 280 * 13; | |
| 271 | if (input_code_pressed(KEYCODE_H)) b += 0x060 * 280 * 14; | |
| 272 | if (input_code_pressed(KEYCODE_J)) b += 0x060 * 280 * 15; | |
| 273 | if (input_code_pressed(KEYCODE_K)) b += 0x060 * 280 * 16; | |
| 274 | if (input_code_pressed(KEYCODE_Z)) b += 0x060 * 280 * 17; | |
| 275 | if (input_code_pressed(KEYCODE_X)) b += 0x060 * 280 * 18; | |
| 276 | if (input_code_pressed(KEYCODE_C)) b += 0x060 * 280 * 19; | |
| 277 | if (input_code_pressed(KEYCODE_V)) b += 0x060 * 280 * 20; | |
| 278 | if (input_code_pressed(KEYCODE_B)) b += 0x060 * 280 * 21; | |
| 279 | if (input_code_pressed(KEYCODE_N)) b += 0x060 * 280 * 22; | |
| 280 | */ | |
| 278 | 281 | for (y = 0;y < 280;y++) |
| 279 | 282 | { |
| 280 | 283 | for (x = 0 ; x < (HD63484_reg[0xca/2] & 0x0fff) * 4 ; x += 4) |
| r4184 | r4185 | |
| 320 | 323 | |
| 321 | 324 | static READ16_HANDLER(test_r) |
| 322 | 325 | { |
| 323 | // printf("ra=%04x ",register_active); | |
| 324 | if (register_active == 0x0000) { | |
| 325 | if (input_code_pressed(KEYCODE_1)) return 0x0001 ^ 0xffff; | |
| 326 | if (input_code_pressed(KEYCODE_2)) return 0x0002 ^ 0xffff; | |
| 327 | if (input_code_pressed(KEYCODE_3)) return 0x0004 ^ 0xffff; | |
| 328 | if (input_code_pressed(KEYCODE_4)) return 0x0008 ^ 0xffff; | |
| 329 | if (input_code_pressed(KEYCODE_5)) return 0x0010 ^ 0xffff; | |
| 330 | if (input_code_pressed(KEYCODE_6)) return 0x0020 ^ 0xffff; | |
| 331 | if (input_code_pressed(KEYCODE_7)) return 0x0040 ^ 0xffff; | |
| 332 | if (input_code_pressed(KEYCODE_8)) return 0x0080 ^ 0xffff; | |
| 333 | if (input_code_pressed(KEYCODE_A)) return 0x0100 ^ 0xffff; | |
| 334 | if (input_code_pressed(KEYCODE_S)) return 0x0200 ^ 0xffff; | |
| 335 | if (input_code_pressed(KEYCODE_D)) return 0x0400 ^ 0xffff; | |
| 336 | if (input_code_pressed(KEYCODE_F)) return 0x0800 ^ 0xffff; | |
| 337 | if (input_code_pressed(KEYCODE_G)) return 0x1000 ^ 0xffff; | |
| 338 | if (input_code_pressed(KEYCODE_H)) return 0x2000 ^ 0xffff; | |
| 339 | if (input_code_pressed(KEYCODE_J)) return 0x4000 ^ 0xffff; | |
| 340 | if (input_code_pressed(KEYCODE_K)) return 0x8000 ^ 0xffff; | |
| 341 | return 0x4; | |
| 342 | } | |
| 343 | if (input_code_pressed(KEYCODE_1)) return 0x0001 ^ 0xffff; | |
| 344 | if (input_code_pressed(KEYCODE_2)) return 0x0002 ^ 0xffff; | |
| 345 | if (input_code_pressed(KEYCODE_3)) return 0x0004 ^ 0xffff; | |
| 346 | if (input_code_pressed(KEYCODE_4)) return 0x0008 ^ 0xffff; | |
| 347 | if (input_code_pressed(KEYCODE_5)) return 0x0010 ^ 0xffff; | |
| 348 | if (input_code_pressed(KEYCODE_6)) return 0x0020 ^ 0xffff; | |
| 349 | if (input_code_pressed(KEYCODE_7)) return 0x0040 ^ 0xffff; | |
| 350 | if (input_code_pressed(KEYCODE_8)) return 0x0080 ^ 0xffff; | |
| 326 | int value = 0xffff; | |
| 351 | 327 | |
| 352 | return 0x0004 ^ 0xffff; // 0x0004 | |
| 353 | ||
| 354 | // FIXME: this code is never executed | |
| 355 | switch (mame_rand(space->machine) & 3) | |
| 328 | switch(mux_data) | |
| 356 | 329 | { |
| 357 | case 0: | |
| 358 | return 0; | |
| 359 | case 1: | |
| 360 | return 0xffff; | |
| 361 | default: | |
| 362 | return mame_rand(space->machine) & 0xffff; | |
| 330 | case 0x00: value = input_port_read(space->machine, "x0"); break; | |
| 331 | case 0x01: value = input_port_read(space->machine, "x1"); break; | |
| 332 | case 0x02: value = input_port_read(space->machine, "x2"); break; | |
| 333 | case 0x03: value = input_port_read(space->machine, "1P_UP"); break; | |
| 334 | case 0x04: value = input_port_read(space->machine, "1P_B1"); break; | |
| 335 | case 0x05: value = input_port_read(space->machine, "x5"); break; | |
| 336 | case 0x06: value = input_port_read(space->machine, "1P_RIGHT"); break; | |
| 337 | case 0x07: value = input_port_read(space->machine, "1P_DOWN"); break; | |
| 338 | case 0x08: value = input_port_read(space->machine, "1P_LEFT"); break; | |
| 339 | case 0x09: value = input_port_read(space->machine, "x9"); break; | |
| 340 | case 0x0a: value = input_port_read(space->machine, "x10"); break; | |
| 341 | case 0x0b: value = input_port_read(space->machine, "x11"); break; | |
| 342 | case 0x0c: value = input_port_read(space->machine, "x12"); break; | |
| 343 | case 0x0d: value = input_port_read(space->machine, "x13"); break; | |
| 344 | case 0x0e: value = input_port_read(space->machine, "x14"); break; | |
| 345 | case 0x0f: value = input_port_read(space->machine, "x15"); break; | |
| 363 | 346 | } |
| 364 | } | |
| 347 | mux_data++; | |
| 348 | mux_data&=0xf; | |
| 365 | 349 | |
| 366 | /* | |
| 367 | static READ16_HANDLER(test1_r) | |
| 368 | { | |
| 369 | if (input_code_pressed(KEYCODE_Q)) return 0x0001; | |
| 370 | if (input_code_pressed(KEYCODE_W)) return 0x0002; | |
| 371 | if (input_code_pressed(KEYCODE_E)) return 0x0004; | |
| 372 | if (input_code_pressed(KEYCODE_R)) return 0x0008; | |
| 373 | if (input_code_pressed(KEYCODE_T)) return 0x0010; | |
| 374 | if (input_code_pressed(KEYCODE_Y)) return 0x0020; | |
| 375 | if (input_code_pressed(KEYCODE_U)) return 0x0040; | |
| 376 | if (input_code_pressed(KEYCODE_I)) return 0x0080; | |
| 377 | if (input_code_pressed(KEYCODE_A)) return 0x0100; | |
| 378 | if (input_code_pressed(KEYCODE_S)) return 0x0200; | |
| 379 | if (input_code_pressed(KEYCODE_D)) return 0x0400; | |
| 380 | if (input_code_pressed(KEYCODE_F)) return 0x0800; | |
| 381 | if (input_code_pressed(KEYCODE_G)) return 0x1000; | |
| 382 | if (input_code_pressed(KEYCODE_H)) return 0x2000; | |
| 383 | if (input_code_pressed(KEYCODE_J)) return 0x4000; | |
| 384 | if (input_code_pressed(KEYCODE_K)) return 0x8000; | |
| 385 | ||
| 386 | switch (mame_rand(space->machine) & 3) | |
| 387 | { | |
| 388 | case 0: | |
| 389 | return 0; | |
| 390 | case 1: | |
| 391 | return 0xffff; | |
| 392 | default: | |
| 393 | return mame_rand(space->machine) % 0xffff; | |
| 394 | } | |
| 350 | return value; | |
| 395 | 351 | } |
| 396 | */ | |
| 397 | /* | |
| 398 | static READ16_HANDLER(rh1_r) | |
| 399 | { | |
| 400 | // printf("ra=%04x ",register_active); | |
| 401 | 352 | |
| 402 | if ((register_active == 0x0e) || (register_active == 0x0e) || (register_active == 0x0e)) | |
| 403 | { | |
| 404 | if (input_code_pressed(KEYCODE_1)) return 0x0001 ^ 0xffff; | |
| 405 | if (input_code_pressed(KEYCODE_2)) return 0x0002 ^ 0xffff; | |
| 406 | if (input_code_pressed(KEYCODE_3)) return 0x0004 ^ 0xffff; | |
| 407 | if (input_code_pressed(KEYCODE_4)) return 0x0008 ^ 0xffff; | |
| 408 | if (input_code_pressed(KEYCODE_5)) return 0x0010 ^ 0xffff; | |
| 409 | if (input_code_pressed(KEYCODE_6)) return 0x0020 ^ 0xffff; | |
| 410 | if (input_code_pressed(KEYCODE_7)) return 0x0040 ^ 0xffff; | |
| 411 | if (input_code_pressed(KEYCODE_8)) return 0x0080 ^ 0xffff; | |
| 412 | if (input_code_pressed(KEYCODE_A)) return 0x0100 ^ 0xffff; | |
| 413 | if (input_code_pressed(KEYCODE_S)) return 0x0200 ^ 0xffff; | |
| 414 | if (input_code_pressed(KEYCODE_D)) return 0x0400 ^ 0xffff; | |
| 415 | if (input_code_pressed(KEYCODE_F)) return 0x0800 ^ 0xffff; | |
| 416 | if (input_code_pressed(KEYCODE_G)) return 0x1000 ^ 0xffff; | |
| 417 | if (input_code_pressed(KEYCODE_H)) return 0x2000 ^ 0xffff; | |
| 418 | if (input_code_pressed(KEYCODE_J)) return 0x4000 ^ 0xffff; | |
| 419 | if (input_code_pressed(KEYCODE_K)) return 0x8000 ^ 0xffff; | |
| 420 | ||
| 421 | } | |
| 422 | ||
| 423 | switch (mame_rand(space->machine) & 3) | |
| 424 | { | |
| 425 | case 0: | |
| 426 | return 0; | |
| 427 | case 1: | |
| 428 | return 0xffff; | |
| 429 | default: | |
| 430 | return mame_rand(space->machine) % 0xffff; | |
| 431 | } | |
| 432 | } | |
| 433 | */ | |
| 434 | /* | |
| 435 | static WRITE16_HANDLER(wh1_w) | |
| 436 | { | |
| 437 | // register_active = data; | |
| 438 | } | |
| 439 | */ | |
| 440 | ||
| 353 | /*???*/ | |
| 441 | 354 | static WRITE16_HANDLER(wh2_w) |
| 442 | 355 | { |
| 443 | 356 | register_active = data; |
| r4184 | r4185 | |
| 450 | 363 | vblank ^=0x40; |
| 451 | 364 | hblank ^=0x20; |
| 452 | 365 | |
| 453 | if (input_code_pressed(KEYCODE_1)) return 0x0001 ^ 0xffff; | |
| 454 | if (input_code_pressed(KEYCODE_2)) return 0x0002 ^ 0xffff; | |
| 455 | if (input_code_pressed(KEYCODE_3)) return 0x0004 ^ 0xffff; | |
| 456 | if (input_code_pressed(KEYCODE_4)) return 0x0008 ^ 0xffff; | |
| 457 | if (input_code_pressed(KEYCODE_5)) return 0x0010 ^ 0xffff; | |
| 458 | if (input_code_pressed(KEYCODE_6)) return 0x0020 ^ 0xffff; | |
| 459 | if (input_code_pressed(KEYCODE_7)) return 0x0040 ^ 0xffff; | |
| 460 | if (input_code_pressed(KEYCODE_8)) return 0x0080 ^ 0xffff; | |
| 461 | if (input_code_pressed(KEYCODE_A)) return 0x0100 ^ 0xffff; | |
| 462 | if (input_code_pressed(KEYCODE_S)) return 0x0200 ^ 0xffff; | |
| 463 | if (input_code_pressed(KEYCODE_D)) return 0x0400 ^ 0xffff; | |
| 464 | if (input_code_pressed(KEYCODE_F)) return 0x0800 ^ 0xffff; | |
| 465 | if (input_code_pressed(KEYCODE_G)) return 0x1000 ^ 0xffff; | |
| 466 | if (input_code_pressed(KEYCODE_H)) return 0x2000 ^ 0xffff; | |
| 467 | if (input_code_pressed(KEYCODE_J)) return 0x4000 ^ 0xffff; | |
| 468 | if (input_code_pressed(KEYCODE_K)) return 0x8000 ^ 0xffff; | |
| 469 | // return mame_rand(space->machine) & 0x00f0; | |
| 366 | return mame_rand(space->machine) & 0x00f0; | |
| 470 | 367 | |
| 471 | popmessage("%08x",cpu_get_pc(space->cpu)); | |
| 368 | // popmessage("%08x",cpu_get_pc(space->cpu)); | |
| 472 | 369 | // return 0x0000; |
| 473 | 370 | return 0xff9f | vblank | hblank; |
| 474 | 371 | } |
| r4184 | r4185 | |
| 504 | 401 | AM_RANGE(0x800084, 0xffbfff) AM_RAM // used? |
| 505 | 402 | ADDRESS_MAP_END |
| 506 | 403 | |
| 404 | static ADDRESS_MAP_START( funland_mem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 405 | AM_RANGE(0x000000, 0x0fffff) AM_ROM | |
| 406 | //400000-40001f? | |
| 407 | AM_RANGE(0x800080, 0x800081) AM_READWRITE(HD63484_status_r, HD63484_address_w) | |
| 408 | AM_RANGE(0x800082, 0x800083) AM_READWRITE(HD63484_data_r, HD63484_data_w) | |
| 409 | // AM_RANGE(0x800100, 0x8001ff) AM_READ(test_r) //18b too | |
| 410 | AM_RANGE(0x800140, 0x800141) AM_READWRITE(t2_r,ay8910_control_port_0_lsb_w) //18b too | |
| 411 | AM_RANGE(0x800142, 0x800143) AM_READWRITE(ay8910_read_port_0_lsb_r,ay8910_write_port_0_lsb_w) //18b too | |
| 412 | AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8( DUART68681, "duart68681", duart68681_r, duart68681_w, 0xff ) | |
| 413 | AM_RANGE(0xfc0000, 0xffffff) AM_RAM | |
| 414 | ADDRESS_MAP_END | |
| 415 | ||
| 416 | ||
| 507 | 417 | static INPUT_PORTS_START( adp ) |
| 508 | 418 | |
| 509 | 419 | INPUT_PORTS_END |
| r4184 | r4185 | |
| 516 | 426 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN6 ) |
| 517 | 427 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BILL1 ) |
| 518 | 428 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 519 | PORT_SERVICE | |
| 429 | PORT_SERVICE | |
| 520 | 430 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 521 | 431 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 522 | 432 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 433 | ||
| 434 | PORT_START("x0") //vblank status? | |
| 435 | PORT_DIPNAME( 0x0004,0x0004, "SW0" ) | |
| 436 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 437 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 438 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 439 | ||
| 440 | PORT_START("x1") | |
| 441 | PORT_DIPNAME( 0x0004,0x0004, "SW1" ) //another up button | |
| 442 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 443 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 444 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 445 | ||
| 446 | PORT_START("x2") | |
| 447 | PORT_DIPNAME( 0x0004,0x0004, "SW2" ) | |
| 448 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 449 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 450 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 451 | PORT_START("1P_UP") | |
| 452 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) | |
| 453 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 454 | PORT_START("1P_B1") | |
| 455 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 456 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 457 | PORT_START("x5") | |
| 458 | PORT_DIPNAME( 0x0004,0x0004, "SW5" ) | |
| 459 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 460 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 461 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 462 | PORT_START("1P_RIGHT") | |
| 463 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) | |
| 464 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 465 | PORT_START("1P_DOWN") | |
| 466 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) | |
| 467 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 468 | PORT_START("1P_LEFT") | |
| 469 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) | |
| 470 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 471 | PORT_START("x9") | |
| 472 | PORT_DIPNAME( 0x0004,0x0004, "SW9" ) | |
| 473 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 474 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 475 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 476 | PORT_START("x10") //button 2 | |
| 477 | PORT_DIPNAME( 0x0004,0x0004, "SW10" ) | |
| 478 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 479 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 480 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 481 | PORT_START("x11") | |
| 482 | PORT_DIPNAME( 0x0004,0x0004, "SW11" ) | |
| 483 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 484 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 485 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 486 | PORT_START("x12") //button 3 | |
| 487 | PORT_DIPNAME( 0x0004,0x0004, "SW12" ) | |
| 488 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 489 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 490 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 491 | PORT_START("x13") | |
| 492 | PORT_DIPNAME( 0x0004,0x0004, "SW13" ) | |
| 493 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 494 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 495 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 496 | PORT_START("x14") //button 4 | |
| 497 | PORT_DIPNAME( 0x0004,0x0004, "SW14" ) | |
| 498 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 499 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 500 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 501 | PORT_START("x15") | |
| 502 | PORT_DIPNAME( 0x0004,0x0004, "SW15" ) | |
| 503 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 504 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 505 | PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 523 | 506 | INPUT_PORTS_END |
| 524 | 507 | |
| 525 | 508 | /* |
| r4184 | r4185 | |
| 607 | 590 | |
| 608 | 591 | MACHINE_DRIVER_END |
| 609 | 592 | |
| 593 | static MACHINE_DRIVER_START( funland ) | |
| 594 | MDRV_IMPORT_FROM( skattv ) | |
| 595 | MDRV_CPU_MODIFY("main") | |
| 596 | MDRV_CPU_PROGRAM_MAP(funland_mem, 0) | |
| 597 | MACHINE_DRIVER_END | |
| 598 | ||
| 610 | 599 | ROM_START( quickjac ) |
| 611 | 600 | ROM_REGION( 0x100000, "main", 0 ) |
| 612 | 601 | ROM_LOAD16_BYTE( "quick_jack_index_a.1.u2.bin", 0x00000, 0x10000, CRC(c2fba6fe) SHA1(f79e5913f9ded1e370cc54dd55860263b9c51d61) ) |
| r4184 | r4185 | |
| 677 | 666 | GAME( 1994, skattv, 0, skattv, skattv, 0, ROT0, "ADP", "Skat TV", GAME_NOT_WORKING ) |
| 678 | 667 | GAME( 1995, skattva, skattv, skattv, skattv, 0, ROT0, "ADP", "Skat TV (version TS3)", GAME_NOT_WORKING ) |
| 679 | 668 | GAME( 1997, fashiong, 0, skattv, skattv, 0, ROT0, "ADP", "Fashion Gambler", GAME_NOT_WORKING ) |
| 680 | GAME( 1999, funlddlx, 0, skattv, skattv, 0, ROT0, "Stella", "Funny Land de Luxe", GAME_NOT_WORKING ) | |
| 669 | GAME( 1999, funlddlx, 0, funland, skattv, 0, ROT0, "Stella", "Funny Land de Luxe", GAME_NOT_WORKING ) | |
| 670 |
| r4184 | r4185 | |
|---|---|---|
| 330 | 330 | #define LOAD_CD_CONTENT 1 |
| 331 | 331 | #define DEBUG_PRINTF 0 |
| 332 | 332 | |
| 333 | #ifdef LSB_FIRST | |
| 334 | #define DMA_XOR(a) ((a) ^ 1) | |
| 335 | #else | |
| 336 | #define DMA_XOR(a) ((a) ^ 2) | |
| 337 | #endif | |
| 333 | #define DMA_XOR(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(1,2)) | |
| 338 | 334 | |
| 339 | 335 | |
| 340 | 336 | static UINT32* decrypted_bios; |
| r4184 | r4185 | |
| 665 | 661 | { "jojobane", { 0x23323ee3, 0x03021972 },0 }, |
| 666 | 662 | { "sfiii", { 0xb5fe053e, 0xfc03925a },0 }, |
| 667 | 663 | { "sfiiiu", { 0xb5fe053e, 0xfc03925a },0 }, |
| 664 | { "sfiiij", { 0xb5fe053e, 0xfc03925a },0 }, | |
| 668 | 665 | { "sfiiin", { 0xb5fe053e, 0xfc03925a },0 }, |
| 669 | 666 | { "sfiii2", { 0x00000000, 0x00000000 },1 }, |
| 670 | 667 | { "sfiii2u", { 0x00000000, 0x00000000 },1 }, |
| 668 | { "sfiii2j", { 0x00000000, 0x00000000 },1 }, | |
| 671 | 669 | { "sfiii2n", { 0x00000000, 0x00000000 },1 }, |
| 672 | 670 | { "sfiii3", { 0xa55432b4, 0x0c129981 },0 }, |
| 673 | 671 | { "sfiii3n", { 0xa55432b4, 0x0c129981 },0 }, |
| r4184 | r4185 | |
|---|---|---|
| 56 | 56 | static MACHINE_RESET( yunsung8 ) |
| 57 | 57 | { |
| 58 | 58 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 59 | UINT8 | |
| 59 | UINT8 | |
| 60 | 60 | |
| 61 | yunsung8_videoram_0 = RAM + 0x0000; // Ram is banked | |
| 62 | yunsung8_videoram_1 = RAM + 0x2000; | |
| 61 | yunsung8_videoram_0 = yunsung8_videoram + 0x0000; // Ram is banked | |
| 62 | yunsung8_videoram_1 = yunsung8_videoram + 0x2000; | |
| 63 | 63 | yunsung8_videobank_w(space,0,0); |
| 64 | 64 | } |
| 65 | 65 | |
| r4184 | r4185 | |
| 345 | 345 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 346 | 346 | INPUT_PORTS_END |
| 347 | 347 | |
| 348 | static INPUT_PORTS_START( cannbalv ) | |
| 349 | PORT_INCLUDE(cannball) | |
| 350 | PORT_MODIFY("SYSTEM") | |
| 351 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) // always activated, otherwise the game resets. a simple check for horizontal / vertical version of the game? | |
| 352 | INPUT_PORTS_END | |
| 353 | ||
| 348 | 354 | /*************************************************************************** |
| 349 | 355 | Rock Tris |
| 350 | 356 | ***************************************************************************/ |
| r4184 | r4185 | |
| 533 | 539 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0) |
| 534 | 540 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0) |
| 535 | 541 | |
| 536 | MDRV_SOUND_ADD("msm", MSM5205, | |
| 542 | MDRV_SOUND_ADD("msm", MSM5205, XTAL_400kHz) /* verified on pcb */ | |
| 537 | 543 | MDRV_SOUND_CONFIG(yunsung8_msm5205_interface) |
| 538 | 544 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.80) |
| 539 | 545 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.80) |
| r4184 | r4185 | |
| 561 | 567 | |
| 562 | 568 | ROM_START( magix ) |
| 563 | 569 | |
| 564 | ROM_REGION( 0x24000 | |
| 570 | ROM_REGION( 0x24000 | |
| 565 | 571 | ROM_LOAD( "yunsung8.07", 0x00000, 0x0c000, CRC(d4d0b68b) SHA1(d7e1fb57a14f8b822791b98cecc6d5a053a89e0f) ) |
| 566 | 572 | ROM_CONTINUE( 0x10000, 0x14000 ) |
| 567 | /* $2000 bytes for bank 0 of video ram (text) */ | |
| 568 | /* $2000 bytes for bank 1 of video ram (background) */ | |
| 569 | 573 | |
| 570 | 574 | ROM_REGION( 0x24000, "audio", 0 ) /* Sound Z80 Code */ |
| 571 | 575 | ROM_LOAD( "yunsung8.08", 0x00000, 0x0c000, CRC(6fd60be9) SHA1(87622dc2967842629e90a02b415bec86cc26cbc7) ) |
| r4184 | r4185 | |
| 601 | 605 | |
| 602 | 606 | ROM_START( cannball ) |
| 603 | 607 | |
| 604 | ROM_REGION( 0x24000 | |
| 608 | ROM_REGION( 0x24000 | |
| 605 | 609 | ROM_LOAD( "cannball.07", 0x00000, 0x0c000, CRC(17db56b4) SHA1(032e3dbde0b0e315dcb5f2b31f57e75e78818f2d) ) |
| 606 | 610 | ROM_CONTINUE( 0x10000, 0x14000 ) |
| 607 | /* $2000 bytes for bank 0 of video ram (text) */ | |
| 608 | /* $2000 bytes for bank 1 of video ram (background) */ | |
| 609 | 611 | |
| 610 | 612 | ROM_REGION( 0x24000, "audio", 0 ) /* Sound Z80 Code */ |
| 611 | 613 | ROM_LOAD( "cannball.08", 0x00000, 0x0c000, CRC(11403875) SHA1(9f583bc4f08e7aef3fd0f3fe3f31cce1d226641a) ) |
| r4184 | r4185 | |
| 623 | 625 | |
| 624 | 626 | ROM_END |
| 625 | 627 | |
| 628 | ||
| 629 | ROM_START( cannbalv ) | |
| 630 | ||
| 631 | ROM_REGION( 0x24000, "main", 0 ) /* Main Z80 Code */ | |
| 632 | ROM_LOAD( "yunsung1", 0x00000, 0x0c000, CRC(f7398b0d) SHA1(f2cdb9c4662cd325376d25ae9611f689605042db) ) | |
| 633 | ROM_CONTINUE( 0x10000, 0x14000 ) | |
| 634 | ||
| 635 | ROM_REGION( 0x24000, "audio", 0 ) /* Sound Z80 Code */ | |
| 636 | ROM_LOAD( "yunsung8", 0x00000, 0x0c000, CRC(11403875) SHA1(9f583bc4f08e7aef3fd0f3fe3f31cce1d226641a) ) | |
| 637 | ROM_CONTINUE( 0x10000, 0x14000 ) | |
| 638 | ||
| 639 | ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE ) /* Background */ | |
| 640 | ROM_LOAD( "yunsung7", 0x000000, 0x80000, CRC(a5f1a648) SHA1(7a5bf5bc0ad257ccb12104512e98dfb3525babfc) ) | |
| 641 | ROM_LOAD( "yunsung6", 0x080000, 0x80000, CRC(8baa686e) SHA1(831c3e2864d262bf5429dca6653c83dc976e610e) ) | |
| 642 | ROM_LOAD( "yunsung5", 0x100000, 0x80000, CRC(a7f2ce51) SHA1(81632aca067f2c8c45488266c4489d9af24fb552) ) | |
| 643 | ROM_LOAD( "yunsung4", 0x180000, 0x80000, CRC(74bef793) SHA1(6208580ce747cec3d410ce3c71e07aa570b9121d) ) | |
| 644 | ||
| 645 | ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) /* Text */ | |
| 646 | ROM_LOAD( "yunsung3", 0x00000, 0x20000, CRC(8217abbe) SHA1(1a459a816a1aa5b68858e39c4a21bd78ee78dcab) ) | |
| 647 | ROM_LOAD( "yunsung2", 0x20000, 0x20000, CRC(76de1045) SHA1(a3845ee1874e6ec0ce26e6e73e4643243779e70d) ) | |
| 648 | ||
| 649 | ROM_END | |
| 650 | ||
| 651 | ||
| 626 | 652 | /*************************************************************************** |
| 627 | 653 | |
| 628 | 654 | Rock Tris by Yunsung |
| r4184 | r4185 | |
| 645 | 671 | |
| 646 | 672 | ROM_START( rocktris ) |
| 647 | 673 | |
| 648 | ROM_REGION( 0x24000 | |
| 674 | ROM_REGION( 0x24000 | |
| 649 | 675 | ROM_LOAD( "cpu.bin", 0x00000, 0x0c000, CRC(46e3b79c) SHA1(81a587b9f986c4e39b1888ec6ed6b86d1469b9a0) ) |
| 650 | 676 | ROM_CONTINUE( 0x10000, 0x14000 ) |
| 651 | /* $2000 bytes for bank 0 of video ram (text) */ | |
| 652 | /* $2000 bytes for bank 1 of video ram (background) */ | |
| 653 | 677 | |
| 654 | 678 | ROM_REGION( 0x24000, "audio", 0 ) /* Sound Z80 Code */ |
| 655 | 679 | ROM_LOAD( "cpu2.bin", 0x00000, 0x0c000, CRC(3a78a4cf) SHA1(f643c7a217cbb71f3a03f1f4a16545c546332819) ) |
| r4184 | r4185 | |
| 679 | 703 | |
| 680 | 704 | ***************************************************************************/ |
| 681 | 705 | |
| 682 | GAME( 1995, cannball, 0, yunsung8, cannball, 0, ROT0, "Yun Sung / Soft Vision", "Cannon Ball (Yun Sung)", GAME_IMPERFECT_SOUND ) | |
| 683 | GAME( 1995, magix, 0, yunsung8, magix, 0, ROT0, "Yun Sung", "Magix / Rock", GAME_IMPERFECT_SOUND ) // Title: DSW | |
| 684 | GAME( 1994?, rocktris, 0, yunsung8, rocktris, 0, ROT0, "Yun Sung", "Rock Tris", GAME_IMPERFECT_SOUND ) | |
| 706 | GAME( 1995, cannball, 0, yunsung8, cannball, 0, ROT0, "Yun Sung / Soft Vision", "Cannon Ball (Yun Sung) (horizontal)", GAME_IMPERFECT_SOUND ) | |
| 707 | GAME( 1995, cannbalv, cannball, yunsung8, cannbalv, 0, ROT270, "Yun Sung / T&K", "Cannon Ball (Yun Sung) (vertical)", GAME_IMPERFECT_SOUND ) | |
| 708 | GAME( 1995, magix, 0, yunsung8, magix, 0, ROT0, "Yun Sung", "Magix / Rock", GAME_IMPERFECT_SOUND ) // Title: DSW | |
| 709 | GAME( 1994?, rocktris, 0, yunsung8, rocktris, 0, ROT0, "Yun Sung", "Rock Tris", GAME_IMPERFECT_SOUND ) |
| r4184 | r4185 | |
|---|---|---|
| 121 | 121 | UINT8 *cvs_video_ram; |
| 122 | 122 | UINT8 *cvs_bullet_ram; |
| 123 | 123 | UINT8 *cvs_palette_ram; |
| 124 | UINT8 *cvs_character_ram; | |
| 124 | static UINT8 *cvs_character_ram; | |
| 125 | 125 | UINT8 *cvs_s2636_0_ram; |
| 126 | 126 | UINT8 *cvs_s2636_1_ram; |
| 127 | 127 | UINT8 *cvs_s2636_2_ram; |
| r4184 | r4185 | |
| 198 | 198 | { |
| 199 | 199 | offset |= (0 * 0x800) | 0x400 | character_ram_page_start; |
| 200 | 200 | cvs_character_ram[offset] = data; |
| 201 | gfx_element_mark_dirty(space->machine->gfx[1], offset/8); | |
| 201 | gfx_element_mark_dirty(space->machine->gfx[1], (offset/8) % 256); | |
| 202 | 202 | } |
| 203 | 203 | else |
| 204 | 204 | cvs_s2636_0_ram[offset] = data; |
| r4184 | r4185 | |
| 219 | 219 | { |
| 220 | 220 | offset |= (1 * 0x800) | 0x400 | character_ram_page_start; |
| 221 | 221 | cvs_character_ram[offset] = data; |
| 222 | gfx_element_mark_dirty(space->machine->gfx[1], offset/8); | |
| 222 | gfx_element_mark_dirty(space->machine->gfx[1], (offset/8) % 256); | |
| 223 | 223 | } |
| 224 | 224 | else |
| 225 | 225 | cvs_s2636_1_ram[offset] = data; |
| r4184 | r4185 | |
| 240 | 240 | { |
| 241 | 241 | offset |= (2 * 0x800) | 0x400 | character_ram_page_start; |
| 242 | 242 | cvs_character_ram[offset] = data; |
| 243 | gfx_element_mark_dirty(space->machine->gfx[1], offset/8); | |
| 243 | gfx_element_mark_dirty(space->machine->gfx[1], (offset/8) % 256); | |
| 244 | 244 | } |
| 245 | 245 | else |
| 246 | 246 | cvs_s2636_2_ram[offset] = data; |
| r4184 | r4185 | |
|---|---|---|
| 1909 | 1909 | |
| 1910 | 1910 | /******************************************************************************/ |
| 1911 | 1911 | |
| 1912 | #ifdef LSB_FIRST | |
| 1913 | #define XOR(x) ((x)^8) | |
| 1914 | #else | |
| 1915 | #define XOR(x) (x) | |
| 1916 | #endif | |
| 1912 | #define XOR(x) ((x)^NATIVE_ENDIAN_VALUE_LE_BE(8,0)) | |
| 1917 | 1913 | |
| 1918 | 1914 | static const gfx_layout charlayout = |
| 1919 | 1915 | { |
| r4184 | r4185 | |
|---|---|---|
| 48 | 48 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 49 | 49 | AM_RANGE(0x1000, 0x1fff) AM_RAM //AM_WRITE(deco_charram_w) AM_BASE(&deco_charram) |
| 50 | 50 | AM_RANGE(0x2000, 0x7fff) AM_RAM AM_BASE(&deco_charram) //AM_WRITE(deco_charram_w) |
| 51 | AM_RANGE(0x9000, 0x9000) AM_WRITENOP | |
| 51 | AM_RANGE(0x9000, 0x9000) AM_WRITENOP //video control? | |
| 52 | 52 | AM_RANGE(0x9000, 0x9000) AM_READNOP |
| 53 | 53 | AM_RANGE(0x9200, 0x9200) AM_WRITENOP |
| 54 | 54 | AM_RANGE(0x9400, 0x9400) AM_WRITENOP |
| 55 | 55 | AM_RANGE(0x9600, 0x9600) AM_WRITENOP |
| 56 | 56 | AM_RANGE(0x9600, 0x9600) AM_READ_PORT("IN0") /* VBLANK */ |
| 57 | 57 | AM_RANGE(0x9800, 0x9800) AM_READNOP |
| 58 | AM_RANGE(0x9800, 0x9801) AM_WRITENOP | |
| 58 | AM_RANGE(0x9800, 0x9801) AM_WRITENOP // mc6845 regs | |
| 59 | 59 | AM_RANGE(0x9a00, 0x9a00) AM_WRITENOP |
| 60 | 60 | AM_RANGE(0x9a00, 0x9a00) AM_READNOP |
| 61 | 61 | AM_RANGE(0x9e00, 0x9e00) AM_WRITENOP |
| 62 | AM_RANGE(0x8000, 0x83ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 63 | AM_RANGE(0x8400, 0x87ff) AM_RAM AM_BASE(&colorram) | |
| 62 | AM_RANGE(0x8000, 0x83ff) AM_RAM AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 63 | AM_RANGE(0x8400, 0x87ff) AM_RAM AM_BASE(&btime_colorram) | |
| 64 | 64 | AM_RANGE(0x8800, 0x881f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 65 | 65 | AM_RANGE(0x8820, 0x8fff) AM_RAM |
| 66 | 66 | AM_RANGE(0xb000, 0xffff) AM_ROM |
| 67 | 67 | ADDRESS_MAP_END |
| 68 | 68 | |
| 69 | #if 0 | |
| 70 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 71 | AM_RANGE(0x0000, 0x03ff) AM_READ(SMH_RAM) | |
| 72 | AM_RANGE(0xa000, 0xafff) AM_READ(soundlatch_r) | |
| 73 | AM_RANGE(0xf000, 0xffff) AM_READ(SMH_ROM) | |
| 69 | static ADDRESS_MAP_START( sound_cpu, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 70 | AM_RANGE(0x0000, 0x0fff) AM_RAM | |
| 71 | AM_RANGE(0x4000, 0x4fff) AM_READWRITE(ay8910_read_port_0_r,ay8910_write_port_0_w) | |
| 72 | AM_RANGE(0x5000, 0x5fff) AM_WRITE(ay8910_control_port_0_w) | |
| 73 | AM_RANGE(0x6000, 0x6fff) AM_READWRITE(ay8910_read_port_1_r,ay8910_write_port_1_w) | |
| 74 | AM_RANGE(0x7000, 0x7fff) AM_WRITE(ay8910_control_port_1_w) | |
| 75 | // AM_RANGE(0x8000, 0x8fff) AM_WRITE(interrupt_enable_w) //??? | |
| 76 | AM_RANGE(0x9000, 0xafff) AM_READ(soundlatch_r) | |
| 77 | AM_RANGE(0xf000, 0xffff) AM_ROM | |
| 74 | 78 | ADDRESS_MAP_END |
| 75 | 79 | |
| 76 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 77 | AM_RANGE(0x0000, 0x03ff) AM_WRITE(SMH_RAM) | |
| 78 | AM_RANGE(0x2000, 0x2fff) AM_WRITE(ay8910_write_port_0_w) | |
| 79 | AM_RANGE(0x4000, 0x4fff) AM_WRITE(ay8910_control_port_0_w) | |
| 80 | AM_RANGE(0x6000, 0x6fff) AM_WRITE(ay8910_write_port_1_w) | |
| 81 | AM_RANGE(0x8000, 0x8fff) AM_WRITE(ay8910_control_port_1_w) | |
| 82 | AM_RANGE(0xc000, 0xcfff) AM_WRITE(interrupt_enable_w) | |
| 83 | AM_RANGE(0xf000, 0xffff) AM_WRITE(SMH_ROM) | |
| 84 | ADDRESS_MAP_END | |
| 85 | #endif | |
| 86 | ||
| 87 | 80 | static INPUT_PORTS_START( progolf ) |
| 88 | 81 | PORT_START("IN0") |
| 89 | 82 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r4184 | r4185 | |
| 193 | 186 | MDRV_CPU_PROGRAM_MAP(main_cpu,0) |
| 194 | 187 | // MDRV_CPU_VBLANK_INT("main", progolf_interrupt) |
| 195 | 188 | |
| 196 | // MDRV_CPU_ADD("audio", M6502, 500000) | |
| 197 | // MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) | |
| 198 | // MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16) | |
| 189 | MDRV_CPU_ADD("audio", M6502, 500000) | |
| 190 | MDRV_CPU_PROGRAM_MAP(sound_cpu,0) | |
| 191 | // MDRV_CPU_VBLANK_INT("main",nmi_line_pulse) | |
| 199 | 192 | |
| 200 | 193 | /* video hardware */ |
| 201 | 194 | MDRV_SCREEN_ADD("main", RASTER) |
| r4184 | r4185 | |
| 232 | 225 | ROM_LOAD( "g1-m.8a", 0xe000, 0x1000, CRC(749032eb) SHA1(daa356b2c70bcd8cdd0c4df4268b6158bc8aae8e) ) |
| 233 | 226 | ROM_LOAD( "g0-m.9a", 0xf000, 0x1000, CRC(8f8b1e8e) SHA1(fc877a8f2b26ea48c5ba2324678d6077f3432a79) ) |
| 234 | 227 | |
| 235 | ROM_REGION( 0x10000, " | |
| 228 | ROM_REGION( 0x10000, "a | |
| 236 | 229 | ROM_LOAD( "g6-m.1b", 0xf000, 0x1000, CRC(0c6fadf5) SHA1(9af2c2152b339cadab7aff0b0164d4431d2558bd) ) |
| 237 | 230 | |
| 238 | 231 | ROM_REGION( 0x3000, "gfx1", ROMREGION_DISPOSE ) |
| r4184 | r4185 | |
| 254 | 247 | ROM_LOAD( "g1-m.a8", 0xe000, 0x1000, CRC(749032eb) SHA1(daa356b2c70bcd8cdd0c4df4268b6158bc8aae8e) ) |
| 255 | 248 | ROM_LOAD( "g0-m.a9", 0xf000, 0x1000, CRC(a03c533f) SHA1(2e0006be40e32b64b1490bd339d9fc9302eee7c4) ) |
| 256 | 249 | |
| 257 | ROM_REGION( 0x10000, " | |
| 250 | ROM_REGION( 0x10000, "a | |
| 258 | 251 | ROM_LOAD( "g5-m.b1", 0xf000, 0x1000, CRC(0c6fadf5) SHA1(9af2c2152b339cadab7aff0b0164d4431d2558bd) ) |
| 259 | 252 | |
| 260 | 253 | ROM_REGION( 0x3000, "gfx1", ROMREGION_DISPOSE ) |
| r4184 | r4185 | |
| 283 | 276 | decrypted[A] = BITSWAP8(rom[A],7,5,6,4,3,2,1,0); |
| 284 | 277 | } |
| 285 | 278 | |
| 286 | GAME( 1981, progolf, 0, progolf, progolf, progolf, ROT270, "Data East Corporation", "Pro Golf (set 1)", GAME_NOT_WORKING ) | |
| 287 | GAME( 1981, progolfa, progolf, progolf, progolf, progolf, ROT270, "Data East Corporation", "Pro Golf (set 2)", GAME_NOT_WORKING ) // doesn't display anything | |
| 279 | /*Maybe progolf is a bootleg and progolfa is the original (with Deco C10707 as CPU)?*/ | |
| 280 | GAME( 1981, progolf, 0, progolf, progolf, progolf, ROT270, "Data East Corporation", "18 Holes Pro Golf (set 1)", GAME_NOT_WORKING ) | |
| 281 | GAME( 1981, progolfa, progolf, progolf, progolf, progolf, ROT270, "Data East Corporation", "18 Holes Pro Golf (set 2)", GAME_NOT_WORKING ) // doesn't display anything |
| r0 | r4185 | |
|---|---|---|
| 1 | #include "driver.h" | |
| 2 | #include "deprecat.h" | |
| 3 | #include "cpu/z80/z80.h" | |
| 4 | #include "sound/2413intf.h" | |
| 5 | ||
| 6 | ||
| 7 | ||
| 8 | static UINT8 *fg_tile_ram, *fg_color_ram; | |
| 9 | static tilemap *fg_tilemap; | |
| 10 | ||
| 11 | static TILE_GET_INFO( get_fg_tile_info ) | |
| 12 | { | |
| 13 | int code = fg_tile_ram[tile_index] | (fg_color_ram[tile_index] << 8); | |
| 14 | int tile = code & 0x1fff; | |
| 15 | SET_TILE_INFO(1, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0); | |
| 16 | } | |
| 17 | ||
| 18 | static WRITE8_HANDLER( fg_tile_w ) | |
| 19 | { | |
| 20 | fg_tile_ram[offset] = data; | |
| 21 | tilemap_mark_tile_dirty(fg_tilemap,offset); | |
| 22 | } | |
| 23 | ||
| 24 | static WRITE8_HANDLER( fg_color_w ) | |
| 25 | { | |
| 26 | fg_color_ram[offset] = data; | |
| 27 | tilemap_mark_tile_dirty(fg_tilemap,offset); | |
| 28 | } | |
| 29 | ||
| 30 | static VIDEO_START(jackie) | |
| 31 | { | |
| 32 | fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); | |
| 33 | tilemap_set_transparent_pen(fg_tilemap, 0); | |
| 34 | } | |
| 35 | ||
| 36 | static VIDEO_UPDATE(jackie) | |
| 37 | { | |
| 38 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); | |
| 39 | ||
| 40 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); | |
| 41 | ||
| 42 | return 0; | |
| 43 | } | |
| 44 | ||
| 45 | ||
| 46 | static int irq_enable, nmi_enable, bg_enable, hopper; | |
| 47 | ||
| 48 | static MACHINE_RESET( jackie ) | |
| 49 | { | |
| 50 | irq_enable = 1; | |
| 51 | nmi_enable = 0; | |
| 52 | hopper = 0; | |
| 53 | bg_enable = 1; | |
| 54 | } | |
| 55 | ||
| 56 | static INTERRUPT_GEN( jackie_interrupt ) | |
| 57 | { | |
| 58 | if (cpu_getiloops(device) % 2) { | |
| 59 | if (irq_enable) | |
| 60 | cpu_set_input_line(device, 0, HOLD_LINE); | |
| 61 | } else { | |
| 62 | if (nmi_enable) | |
| 63 | cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); | |
| 64 | } | |
| 65 | } | |
| 66 | ||
| 67 | static UINT8 out[3]; | |
| 68 | ||
| 69 | static void show_out(void) | |
| 70 | { | |
| 71 | #ifdef MAME_DEBUG | |
| 72 | popmessage("%02x %02x %02x", out[0], out[1], out[2]); | |
| 73 | #endif | |
| 74 | } | |
| 75 | ||
| 76 | static WRITE8_HANDLER( jackie_nmi_and_coins_w ) | |
| 77 | { | |
| 78 | coin_counter_w(0, data & 0x01); // coin_a | |
| 79 | coin_counter_w(1, data & 0x04); // coin_c | |
| 80 | coin_counter_w(2, data & 0x08); // key in | |
| 81 | coin_counter_w(3, data & 0x10); // coin out mech | |
| 82 | ||
| 83 | set_led_status(6, data & 0x20); // led for coin out / hopper active | |
| 84 | ||
| 85 | nmi_enable = data & 0x80; // nmi enable? | |
| 86 | ||
| 87 | out[0] = data; | |
| 88 | show_out(); | |
| 89 | } | |
| 90 | ||
| 91 | static WRITE8_HANDLER( jackie_lamps_w ) | |
| 92 | { | |
| 93 | /* | |
| 94 | - Lbits - | |
| 95 | 7654 3210 | |
| 96 | ========= | |
| 97 | ---- --x- Hold1 lamp. | |
| 98 | --x- ---- Hold2 lamp. | |
| 99 | ---x ---- Hold3 lamp. | |
| 100 | ---- x--- Hold4 lamp. | |
| 101 | ---- -x-- Hold5 lamp. | |
| 102 | ---- ---x Start lamp. | |
| 103 | */ | |
| 104 | output_set_lamp_value(1, (data >> 1) & 1); /* Lamp 1 - HOLD 1 */ | |
| 105 | output_set_lamp_value(2, (data >> 5) & 1); /* Lamp 2 - HOLD 2 */ | |
| 106 | output_set_lamp_value(3, (data >> 4) & 1); /* Lamp 3 - HOLD 3 */ | |
| 107 | output_set_lamp_value(4, (data >> 3) & 1); /* Lamp 4 - HOLD 4 */ | |
| 108 | output_set_lamp_value(5, (data >> 2) & 1); /* Lamp 5 - HOLD 5 */ | |
| 109 | output_set_lamp_value(6, (data & 1)); /* Lamp 6 - START */ | |
| 110 | ||
| 111 | hopper = (~data)& 0x80; | |
| 112 | ||
| 113 | out[1] = data; | |
| 114 | show_out(); | |
| 115 | } | |
| 116 | ||
| 117 | static READ8_HANDLER( igs_irqack_r ) | |
| 118 | { | |
| 119 | irq_enable = 1; | |
| 120 | return 0; | |
| 121 | } | |
| 122 | ||
| 123 | static WRITE8_HANDLER( igs_irqack_w ) | |
| 124 | { | |
| 125 | // cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); | |
| 126 | out[2] = data; | |
| 127 | show_out(); | |
| 128 | } | |
| 129 | ||
| 130 | UINT8 *main_ram; | |
| 131 | ||
| 132 | static WRITE8_HANDLER( ram_w ) | |
| 133 | { | |
| 134 | main_ram[offset] = data; | |
| 135 | // logerror("PC %06X: %04x = %02x\n",cpu_get_pc(space->cpu),offset+0xf000,data); | |
| 136 | } | |
| 137 | ||
| 138 | ||
| 139 | static ADDRESS_MAP_START( jackie_prg_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 140 | AM_RANGE(0x0000, 0xefff) AM_ROM | |
| 141 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE( ram_w ) AM_BASE( &main_ram ) | |
| 142 | ADDRESS_MAP_END | |
| 143 | ||
| 144 | static ADDRESS_MAP_START( jackie_io_map, ADDRESS_SPACE_IO, 8 ) | |
| 145 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE( paletteram_xBBBBBGGGGGRRRRR_split1_w ) AM_BASE( &paletteram ) | |
| 146 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE( paletteram_xBBBBBGGGGGRRRRR_split2_w ) AM_BASE( &paletteram_2 ) | |
| 147 | AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW1") /* DSW1 */ | |
| 148 | AM_RANGE(0x4001, 0x4001) AM_READ_PORT("DSW2") /* DSW2 */ | |
| 149 | AM_RANGE(0x4002, 0x4002) AM_READ_PORT("DSW3") /* DSW3 */ | |
| 150 | AM_RANGE(0x4003, 0x4003) AM_READ_PORT("DSW4") /* DSW4 */ | |
| 151 | AM_RANGE(0x4004, 0x4004) AM_READ_PORT("DSW5") /* DSW5 */ | |
| 152 | AM_RANGE(0x5080, 0x5080) AM_WRITE(jackie_nmi_and_coins_w) | |
| 153 | AM_RANGE(0x5081, 0x5081) AM_READ_PORT("SERVICE") | |
| 154 | AM_RANGE(0x5082, 0x5082) AM_READ_PORT("COINS") | |
| 155 | AM_RANGE(0x5090, 0x5090) AM_READ_PORT("BUTTONS1") | |
| 156 | AM_RANGE(0x5091, 0x5091) AM_WRITE( jackie_lamps_w ) | |
| 157 | AM_RANGE(0x50a0, 0x50a0) AM_READ_PORT("BUTTONS2") | |
| 158 | AM_RANGE(0x50b0, 0x50b0) AM_WRITE(ym2413_register_port_0_w) | |
| 159 | AM_RANGE(0x50b1, 0x50b1) AM_WRITE(ym2413_data_port_0_w) | |
| 160 | AM_RANGE(0x50c0, 0x50c0) AM_READ(igs_irqack_r) AM_WRITE(igs_irqack_w) | |
| 161 | AM_RANGE(0x7000, 0x77ff) AM_RAM_WRITE( fg_tile_w ) AM_BASE( &fg_tile_ram ) | |
| 162 | AM_RANGE(0x7800, 0x7fff) AM_RAM_WRITE( fg_color_w ) AM_BASE( &fg_color_ram ) | |
| 163 | AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("gfx3", 0) | |
| 164 | ADDRESS_MAP_END | |
| 165 | ||
| 166 | static CUSTOM_INPUT( hopper_r ) | |
| 167 | { | |
| 168 | if (hopper) return !(video_screen_get_frame_number(field->port->machine->primary_screen)%10); | |
| 169 | return input_code_pressed(KEYCODE_H); | |
| 170 | } | |
| 171 | ||
| 172 | static INPUT_PORTS_START( jackie ) | |
| 173 | ||
| 174 | PORT_START("DSW1") | |
| 175 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:8") | |
| 176 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 177 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 178 | PORT_DIPUNKNOWN( 0x02, 0x02 ) | |
| 179 | PORT_DIPUNKNOWN( 0x04, 0x04 ) | |
| 180 | PORT_DIPUNKNOWN( 0x08, 0x08 ) | |
| 181 | PORT_DIPUNKNOWN( 0x10, 0x10 ) | |
| 182 | PORT_DIPUNKNOWN( 0x20, 0x20 ) | |
| 183 | PORT_DIPUNKNOWN( 0x40, 0x40 ) | |
| 184 | PORT_DIPUNKNOWN( 0x80, 0x80 ) | |
| 185 | ||
| 186 | PORT_START("DSW2") | |
| 187 | PORT_DIPNAME( 0x0f, 0x07, "Main Game Chance" ) PORT_DIPLOCATION("SWB:8,7,6,5") | |
| 188 | PORT_DIPSETTING( 0x0f, "45%" ) | |
| 189 | PORT_DIPSETTING( 0x0e, "50%" ) | |
| 190 | PORT_DIPSETTING( 0x0d, "55%" ) | |
| 191 | PORT_DIPSETTING( 0x0c, "60%" ) | |
| 192 | PORT_DIPSETTING( 0x0b, "65%" ) | |
| 193 | PORT_DIPSETTING( 0x0a, "70%" ) | |
| 194 | PORT_DIPSETTING( 0x09, "75%" ) | |
| 195 | PORT_DIPSETTING( 0x08, "80%" ) | |
| 196 | PORT_DIPSETTING( 0x07, "83%" ) | |
| 197 | PORT_DIPSETTING( 0x06, "85%" ) | |
| 198 | PORT_DIPSETTING( 0x05, "88%" ) | |
| 199 | PORT_DIPSETTING( 0x04, "90%" ) | |
| 200 | PORT_DIPSETTING( 0x03, "92%" ) | |
| 201 | PORT_DIPSETTING( 0x02, "94%" ) | |
| 202 | PORT_DIPSETTING( 0x01, "96%" ) | |
| 203 | PORT_DIPSETTING( 0x00, "98%" ) | |
| 204 | PORT_DIPUNKNOWN( 0x10, 0x10 ) | |
| 205 | PORT_DIPNAME( 0x20, 0x00, "Double Up Rate" ) PORT_DIPLOCATION("SWB:3") | |
| 206 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) | |
| 207 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) | |
| 208 | PORT_DIPUNKNOWN( 0x40, 0x40 ) | |
| 209 | PORT_DIPUNKNOWN( 0x80, 0x80 ) | |
| 210 | ||
| 211 | PORT_START("DSW3") | |
| 212 | PORT_DIPUNKNOWN( 0x01, 0x01 ) | |
| 213 | PORT_DIPUNKNOWN( 0x02, 0x02 ) | |
| 214 | PORT_DIPUNKNOWN( 0x04, 0x04 ) | |
| 215 | PORT_DIPUNKNOWN( 0x08, 0x08 ) | |
| 216 | PORT_DIPUNKNOWN( 0x10, 0x10 ) | |
| 217 | PORT_DIPUNKNOWN( 0x20, 0x20 ) | |
| 218 | PORT_DIPNAME( 0xC0, 0x00, "Max Bet" ) PORT_DIPLOCATION("SWC:2,1") | |
| 219 | PORT_DIPSETTING( 0xC0, "1" ) | |
| 220 | PORT_DIPSETTING( 0x80, "8" ) | |
| 221 | PORT_DIPSETTING( 0x40, "16" ) | |
| 222 | PORT_DIPSETTING( 0x00, "32" ) | |
| 223 | ||
| 224 | PORT_START("DSW4") | |
| 225 | PORT_DIPUNKNOWN( 0x01, 0x01 ) | |
| 226 | PORT_DIPUNKNOWN( 0x02, 0x02 ) | |
| 227 | PORT_DIPUNKNOWN( 0x04, 0x04 ) | |
| 228 | PORT_DIPUNKNOWN( 0x08, 0x08 ) | |
| 229 | PORT_DIPUNKNOWN( 0x10, 0x10 ) | |
| 230 | PORT_DIPUNKNOWN( 0x20, 0x20 ) | |
| 231 | PORT_DIPUNKNOWN( 0x40, 0x40 ) | |
| 232 | PORT_DIPUNKNOWN( 0x80, 0x80 ) | |
| 233 | ||
| 234 | PORT_START("DSW5") | |
| 235 | PORT_DIPUNKNOWN( 0x01, 0x01 ) | |
| 236 | PORT_DIPUNKNOWN( 0x02, 0x02 ) | |
| 237 | PORT_DIPUNKNOWN( 0x04, 0x04 ) | |
| 238 | PORT_DIPUNKNOWN( 0x08, 0x08 ) | |
| 239 | PORT_DIPUNKNOWN( 0x10, 0x10 ) | |
| 240 | PORT_DIPUNKNOWN( 0x20, 0x20 ) | |
| 241 | PORT_DIPUNKNOWN( 0x40, 0x40 ) | |
| 242 | PORT_DIPUNKNOWN( 0x80, 0x80 ) | |
| 243 | ||
| 244 | ||
| 245 | PORT_START("SERVICE") | |
| 246 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_0) PORT_NAME("Attendent") | |
| 247 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor | |
| 248 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4) PORT_NAME("Payout") | |
| 249 | PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) // test (press during boot) | |
| 250 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F1) PORT_NAME("Statistics") | |
| 251 | ||
| 252 | PORT_START("COINS") | |
| 253 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 254 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 255 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 256 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Key In") | |
| 257 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("Clear") // pays out | |
| 258 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_T) PORT_NAME("Togglemode") // Used | |
| 259 | PORT_BIT( 0xC0, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 260 | ||
| 261 | PORT_START("BUTTONS1") | |
| 262 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_A) PORT_NAME("Stop 1") | |
| 263 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_S) PORT_NAME("Stop 2") | |
| 264 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_D) PORT_NAME("Stop 3") | |
| 265 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_F) PORT_NAME("Stop") | |
| 266 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 267 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 268 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 269 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 270 | ||
| 271 | PORT_START("BUTTONS2") // OK | |
| 272 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 273 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_C) PORT_NAME("Small/Right Hammer") | |
| 274 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_B) PORT_NAME("Bet") | |
| 275 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_Z) PORT_NAME("Take/Left Hammer") | |
| 276 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_V) PORT_NAME("W-Up") | |
| 277 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_X) PORT_NAME("Big/Center Hammer") | |
| 278 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 279 | ||
| 280 | INPUT_PORTS_END | |
| 281 | ||
| 282 | ||
| 283 | static const gfx_layout layout_8x8x6 = | |
| 284 | { | |
| 285 | 8, 8, | |
| 286 | RGN_FRAC(1, 3), | |
| 287 | 6, | |
| 288 | { RGN_FRAC(0,3)+8,RGN_FRAC(0,3)+0, | |
| 289 | RGN_FRAC(1,3)+8,RGN_FRAC(1,3)+0, | |
| 290 | RGN_FRAC(2,3)+8,RGN_FRAC(2,3)+0 }, | |
| 291 | { STEP8(0,1) }, | |
| 292 | { STEP8(0,2*8) }, | |
| 293 | 8*8*2 | |
| 294 | }; | |
| 295 | ||
| 296 | static const gfx_layout layout_8x32x6 = | |
| 297 | { | |
| 298 | 8, 32, | |
| 299 | RGN_FRAC(1, 3), | |
| 300 | 6, | |
| 301 | { RGN_FRAC(0,3)+8,RGN_FRAC(0,3)+0, | |
| 302 | RGN_FRAC(1,3)+8,RGN_FRAC(1,3)+0, | |
| 303 | RGN_FRAC(2,3)+8,RGN_FRAC(2,3)+0 }, | |
| 304 | { STEP8(0,1) }, | |
| 305 | { STEP32(0,2*8) }, | |
| 306 | 8*32*2 | |
| 307 | }; | |
| 308 | ||
| 309 | static GFXDECODE_START( jackie ) | |
| 310 | GFXDECODE_ENTRY( "gfx2", 0, layout_8x32x6, 0, 16 ) | |
| 311 | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x6, 0, 16 ) | |
| 312 | GFXDECODE_END | |
| 313 | ||
| 314 | ||
| 315 | ||
| 316 | static MACHINE_DRIVER_START( jackie ) | |
| 317 | ||
| 318 | /* basic machine hardware */ | |
| 319 | MDRV_CPU_ADD("main", Z80, 12000000/2/2) | |
| 320 | MDRV_CPU_PROGRAM_MAP(jackie_prg_map,0) | |
| 321 | MDRV_CPU_IO_MAP(jackie_io_map,0) | |
| 322 | MDRV_CPU_VBLANK_INT_HACK(jackie_interrupt,8) | |
| 323 | ||
| 324 | MDRV_MACHINE_RESET(jackie) | |
| 325 | ||
| 326 | /* video hardware */ | |
| 327 | MDRV_SCREEN_ADD("main", RASTER) | |
| 328 | MDRV_SCREEN_REFRESH_RATE(57) | |
| 329 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 330 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 331 | MDRV_SCREEN_SIZE(64*8, 32*8) | |
| 332 | MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0, 32*8-1) | |
| 333 | ||
| 334 | MDRV_GFXDECODE(jackie) | |
| 335 | MDRV_PALETTE_LENGTH(2048) | |
| 336 | ||
| 337 | MDRV_VIDEO_START(jackie) | |
| 338 | MDRV_VIDEO_UPDATE(jackie) | |
| 339 | ||
| 340 | /* sound hardware */ | |
| 341 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 342 | MDRV_SOUND_ADD("ym", YM2413, 3579545) | |
| 343 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 344 | ||
| 345 | MACHINE_DRIVER_END | |
| 346 | ||
| 347 | ||
| 348 | /* | |
| 349 | ||
| 350 | Anno 199x | |
| 351 | Produttore IGS | |
| 352 | N.revisione | |
| 353 | ||
| 354 | CPU | |
| 355 | ||
| 356 | 1x Z0840006PSC (main) | |
| 357 | 2x D8255AC | |
| 358 | 1x unknown AMT001 | |
| 359 | 1x unknown IGS002 | |
| 360 | 1x UM3567 (sound) | |
| 361 | 1x oscillator 12.000MHz | |
| 362 | 1x oscillator 3.579645 | |
| 363 | ||
| 364 | ROMs | |
| 365 | ||
| 366 | 2x D27128A (1,3) | |
| 367 | 1x MBM27128 (2) | |
| 368 | 3x 27C010 (4,5,6) | |
| 369 | 1x D27512 (7sv) | |
| 370 | 1x MBM27C512 (v110) | |
| 371 | 1x unknown (DIP20 mil300)(jack3) | |
| 372 | 3x PEEL18CV8PC (read protected) | |
| 373 | 1x TIBPAL16L8 (read protected) | |
| 374 | ||
| 375 | Note | |
| 376 | ||
| 377 | 1x 36x2 edge connector | |
| 378 | 1x 10x2 edge connector (payout system) | |
| 379 | 1x trimmer (volume) | |
| 380 | 1x pushbutton | |
| 381 | 1x battery | |
| 382 | 5x 8x2 switches dip | |
| 383 | ||
| 384 | */ | |
| 385 | ROM_START( jackie ) | |
| 386 | ROM_REGION( 0x10000, "main", 0 ) | |
| 387 | ROM_LOAD( "jackiev110.u23", 0x0000, 0x10000, CRC(1b78a619) SHA1(a6eb6b6e544efa55225f2e947483614afb6ece3b) ) | |
| 388 | ||
| 389 | ROM_REGION( 0x60000, "gfx1", ROMREGION_DISPOSE ) | |
| 390 | ROM_LOAD( "6.u6", 0x00000, 0x20000, CRC(d2ed60a9) SHA1(40e2280384aa5c9e72e87a3b9e673172ff695676) ) | |
| 391 | ROM_LOAD( "5.u5", 0x20000, 0x20000, CRC(dc01fe7c) SHA1(683834ce2f13a923c0467209b93fef693d9c3e38) ) | |
| 392 | ROM_LOAD( "4.u4", 0x40000, 0x20000, CRC(38a42dcd) SHA1(8cc08ff4143281d9022210d6577146d725df9044) ) | |
| 393 | ||
| 394 | ROM_REGION( 0x30000, "gfx2", ROMREGION_DISPOSE ) | |
| 395 | ROM_LOAD( "3.u3", 0x00000, 0x4000, CRC(c69e962b) SHA1(492427ad1ac959cdf22d23439e0eb5932b60ec88) ) | |
| 396 | ROM_LOAD( "2.u2", 0x10000, 0x4000, CRC(8900ffba) SHA1(065cf1810ec9738718e4c94613f726e85ba4314d) ) | |
| 397 | ROM_LOAD( "1.u1", 0x20000, 0x4000, CRC(071d20f0) SHA1(77c87486803dccaa63732ff959c223b1313820e3) ) | |
| 398 | ||
| 399 | ROM_REGION( 0x10000, "gfx3", 0 ) | |
| 400 | ROM_LOAD( "jackie7sv.u22", 0x0000, 0x10000, CRC(8b4eb6da) SHA1(480784917dfaf9a0343c1d56eb590b32bf5e94fd) ) | |
| 401 | ||
| 402 | ROM_REGION( 0x10000, "misc", 0 ) | |
| 403 | ROM_LOAD( "16l8.u31", 0x0000, 0x104, BAD_DUMP CRC(e9cd78fb) SHA1(557d3e7ef3b25c1338b24722cac91bca788c02b8) ) | |
| 404 | ROM_LOAD( "18cv8.u14", 0x0000, 0x155, BAD_DUMP CRC(996e8f59) SHA1(630d9b91f6e8eda781061e2a8ff6fb0fecaf034c) ) | |
| 405 | ROM_LOAD( "18cv8.u8", 0x0000, 0x155, BAD_DUMP CRC(996e8f59) SHA1(630d9b91f6e8eda781061e2a8ff6fb0fecaf034c) ) | |
| 406 | ROM_LOAD( "18cv8.u9", 0x0000, 0x155, BAD_DUMP CRC(996e8f59) SHA1(630d9b91f6e8eda781061e2a8ff6fb0fecaf034c) ) | |
| 407 | ROM_END | |
| 408 | ||
| 409 | static DRIVER_INIT( jackie ) | |
| 410 | { | |
| 411 | ||
| 412 | int A; | |
| 413 | UINT8 *rom = memory_region(machine, "main"); | |
| 414 | ||
| 415 | for (A = 0;A < 0xf000;A++) | |
| 416 | { | |
| 417 | rom[A] = rom[A] ^ 0x21; | |
| 418 | ||
| 419 | if (((A & 0x0080) == 0x0000) && ((A & 0x0008) == 0x0000)) rom[A] = rom[A] ^ 0x20; | |
| 420 | if ((A & 0x0282) == 0x0282) rom[A] ^= 0x01; | |
| 421 | if ((A & 0x0940) == 0x0940) rom[A] ^= 0x02; | |
| 422 | } | |
| 423 | memset( &rom[0xf000], 0, 0x1000); | |
| 424 | } | |
| 425 | ||
| 426 | GAME( 199?, jackie, 0, jackie, jackie, jackie, ROT0, "IGS", "Happy Jackie (v110U)", GAME_NOT_WORKING ) |
| r4184 | r4185 | |
|---|---|---|
| 17 | 17 | * Hold '*' during the game to access the operator menu. |
| 18 | 18 | |
| 19 | 19 | To do: |
| 20 | * TMS5220 speech. The game is sending speech play commands to | |
| 21 | the sound CPU but any speech code greater than 2 is ignored (see $EC26). | |
| 22 | I think most of the speech data is stored in the upper half of the | |
| 23 | banked sound data ROMs but I don't know how or when the ROM | |
| 24 | bank is switched :/ | |
| 25 | ||
| 26 | 20 | * Confirm that occasional line drop outs do occur on real hardware. |
| 27 | 21 | 14 sprites seems to be the maximum number that the RIP CPU can safely |
| 28 | 22 | process per line. |
| r4184 | r4185 | |
| 145 | 139 | static WRITE8_HANDLER( g_status_w ) |
| 146 | 140 | { |
| 147 | 141 | int bankaddress; |
| 148 | UINT8 | |
| 142 | UINT8 | |
| 149 | 143 | |
| 150 | 144 | g_status = data; |
| 151 | 145 | |
| 152 | 146 | bankaddress = 0x10000 + (data & 0x03) * 0x10000; |
| 153 | memory_set_bankptr(space->machine, 1, & | |
| 147 | memory_set_bankptr(space->machine, 1, &rom[bankaddress]); | |
| 154 | 148 | |
| 155 | 149 | cpu_set_input_line(space->machine->cpu[ESRIPSYS_FRAME_CPU], M6809_FIRQ_LINE, data & 0x10 ? CLEAR_LINE : ASSERT_LINE); |
| 156 | 150 | cpu_set_input_line(space->machine->cpu[ESRIPSYS_FRAME_CPU], INPUT_LINE_NMI, data & 0x80 ? CLEAR_LINE : ASSERT_LINE); |
| r4184 | r4185 | |
| 528 | 522 | |
| 529 | 523 | static WRITE8_HANDLER( s_200f_w ) |
| 530 | 524 | { |
| 525 | UINT8 *rom = memory_region(space->machine, "sound_data"); | |
| 526 | int rombank = data & 0x20 ? 0x2000 : 0; | |
| 527 | ||
| 531 | 528 | /* Bit 6 -> Reset latch U56A */ |
| 532 | 529 | /* Bit 7 -> Clock latch U56B */ |
| 533 | 530 | if (s_to_g_latch2 & 0x40) |
| r4184 | r4185 | |
| 539 | 536 | if (!(s_to_g_latch2 & 0x80) && (data & 0x80)) |
| 540 | 537 | u56b = 1; |
| 541 | 538 | |
| 539 | /* Speech data resides in the upper 8kB of the ROMs */ | |
| 540 | memory_set_bankptr(space->machine, 2, &rom[0x0000 + rombank]); | |
| 541 | memory_set_bankptr(space->machine, 3, &rom[0x4000 + rombank]); | |
| 542 | memory_set_bankptr(space->machine, 4, &rom[0x8000 + rombank]); | |
| 543 | ||
| 542 | 544 | s_to_g_latch2 = data; |
| 543 | 545 | } |
| 544 | 546 | |
| r4184 | r4185 | |
| 554 | 556 | /* TMS5220 core returns status bits in D7-D6 */ |
| 555 | 557 | UINT8 status = tms5220_status_r(space, 0); |
| 556 | 558 | |
| 557 | status = (status & 0x80 >> 5) | (status & 0x40 >> 5) | (status & 0x20 >> 5); | |
| 559 | status = ((status & 0x80) >> 5) | ((status & 0x40) >> 5) | ((status & 0x20) >> 5); | |
| 558 | 560 | return (!tms5220_ready_r() << 7) | (!tms5220_int_r() << 6) | status; |
| 559 | 561 | } |
| 560 | 562 | |
| r4184 | r4185 | |
| 566 | 568 | { |
| 567 | 569 | if (offset == 0) |
| 568 | 570 | { |
| 569 | if (tms5220_ready_r()) | |
| 570 | tms5220_status_r(space, 0); | |
| 571 | ||
| 572 | 571 | tms_data = data; |
| 572 | tms5220_data_w(0, 0, tms_data); | |
| 573 | 573 | } |
| 574 | #if 0 | |
| 574 | 575 | if (offset == 1) |
| 575 | 576 | { |
| 576 | if (tms5220_ready_r()) | |
| 577 | tms5220_data_w(0, 0, tms_data); | |
| 577 | tms5220_data_w(0, 0, tms_data); | |
| 578 | 578 | } |
| 579 | #endif | |
| 579 | 580 | } |
| 580 | 581 | |
| 581 | 582 | /* Not used in later revisions */ |
| r4184 | r4185 | |
| 671 | 672 | |
| 672 | 673 | static DRIVER_INIT( esripsys ) |
| 673 | 674 | { |
| 674 | UINT8 | |
| 675 | UINT8 | |
| 675 | 676 | |
| 676 | 677 | fdt_a = auto_malloc(FDT_RAM_SIZE); |
| 677 | 678 | fdt_b = auto_malloc(FDT_RAM_SIZE); |
| r4184 | r4185 | |
| 679 | 680 | |
| 680 | 681 | ptm6840_config(machine, 0, &ptm_intf); |
| 681 | 682 | |
| 682 | memory_set_bankptr(machine, 2, &ROM[0x0000]); | |
| 683 | memory_set_bankptr(machine, 3, &ROM[0x4000]); | |
| 684 | memory_set_bankptr(machine, 4, &ROM[0x8000]); | |
| 683 | memory_set_bankptr(machine, 2, &rom[0x0000]); | |
| 684 | memory_set_bankptr(machine, 3, &rom[0x4000]); | |
| 685 | memory_set_bankptr(machine, 4, &rom[0x8000]); | |
| 685 | 686 | |
| 686 | 687 | /* Register stuff for state saving */ |
| 687 | 688 | state_save_register_global_pointer(machine, fdt_a, FDT_RAM_SIZE); |
| r4184 | r4185 | |
| 760 | 761 | /* Sound hardware */ |
| 761 | 762 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 762 | 763 | |
| 763 | MDRV_SOUND_ADD(" | |
| 764 | MDRV_SOUND_ADD("dac | |
| 764 | 765 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 765 | 766 | |
| 766 | MDRV_SOUND_ADD("dac", DAC, 0) | |
| 767 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) | |
| 767 | MDRV_SOUND_ADD("tms5220nl", TMS5220, 640000) | |
| 768 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) | |
| 768 | 769 | MACHINE_DRIVER_END |
| 769 | 770 | |
| 770 | 771 | |
| r4184 | r4185 | |
| 1013 | 1014 | * |
| 1014 | 1015 | *************************************/ |
| 1015 | 1016 | |
| 1016 | GAME( 1985, turbosub, 0, esripsys, turbosub, esripsys, ROT0, "Entertainment Sciences", "Turbo Sub (prototype rev. TSCA)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) | |
| 1017 | GAME( 1985, turbosba, turbosub, esripsys, turbosub, esripsys, ROT0, "Entertainment Sciences", "Turbo Sub (prototype rev. TSC6)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) | |
| 1017 | GAME( 1985, turbosub, 0, esripsys, turbosub, esripsys, ROT0, "Entertainment Sciences", "Turbo Sub (prototype rev. TSCA)", GAME_SUPPORTS_SAVE ) | |
| 1018 | GAME( 1985, turbosba, turbosub, esripsys, turbosub, esripsys, ROT0, "Entertainment Sciences", "Turbo Sub (prototype rev. TSC6)", GAME_SUPPORTS_SAVE ) |
| r4184 | r4185 | |
|---|---|---|
| 858 | 858 | |
| 859 | 859 | /*****************************************************************************/ |
| 860 | 860 | |
| 861 | #define ROM_LOAD64_WORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(6)) | |
| 862 | ||
| 863 | 861 | ROM_START(midnrun) |
| 864 | 862 | ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */ |
| 865 | 863 | ROM_LOAD32_BYTE("midnight.20u", 0x000003, 0x80000, CRC(ea70edf2) SHA1(51c882383a150ba118ccd39eb869525fcf5eee3c) ) |
| r0 | r4185 | |
|---|---|---|
| 1 | /* | |
| 2 | Super Othello (c)1986 Fujiwara/Success | |
| 3 | ||
| 4 | driver by Tomasz Slanina | |
| 5 | ||
| 6 | 1 2 3 4 5 6 7 8 9 10 11 12 | |
| 7 | +---------------------------------------------------------------------------------+ | |
| 8 | | | | |
| 9 | +-+ LA460 LA6324 M5205 X3 Z80A 1 2 5816P 74374 74138 | A | |
| 10 | | | | |
| 11 | | | | |
| 12 | +-+ 74367 Y3014 74174 74174 7404 7474 74138 7404 7432 | B | |
| 13 | | | | |
| 14 | | | | |
| 15 | | 74367 DSW1 YM2203 Z80A 3 4 5 6264 | C | |
| 16 | | J | | |
| 17 | | A | | |
| 18 | | M C1663 74367 DSW2 7408 74125 7404 74138 74139 74174 7408 | D | |
| 19 | | M X2 7414 7474 | | |
| 20 | | A | | |
| 21 | | C1663 V9938 41464 41464 X1 7474 74139 7432 74157 74244 7432 | E | |
| 22 | | | | |
| 23 | | | | |
| 24 | +-+ C1663 41464 41464 6809B 6 6264 6264 6264 74244 74245 | F | |
| 25 | | | | |
| 26 | | | | |
| 27 | +-+ C1663 | H | |
| 28 | | | | |
| 29 | +---------------------------------------------------------------------------------+ | |
| 30 | ||
| 31 | CPU : Z80A(x2) 68B09 | |
| 32 | Sound: YM2203?(surface scrached) + M5205 | |
| 33 | OSC : 8.0000MHz(X1) 21.477 MHz(X2) 384kHz(X3) | |
| 34 | ||
| 35 | */ | |
| 36 | ||
| 37 | #include "driver.h" | |
| 38 | #include "cpu/z80/z80.h" | |
| 39 | #include "cpu/m6809/m6809.h" | |
| 40 | #include "sound/2203intf.h" | |
| 41 | #include "sound/msm5205.h" | |
| 42 | #include "video/v9938.h" | |
| 43 | #include "deprecat.h" | |
| 44 | ||
| 45 | #define VDP_MEM 0x40000 | |
| 46 | ||
| 47 | #define MAINCPU_CLOCK (XTAL_21_477MHz/6) | |
| 48 | #define SOUNDCPU_CLOCK (XTAL_21_477MHz/6) | |
| 49 | #define YM_CLOCK (XTAL_21_477MHz/12) | |
| 50 | #define MSM_CLOCK (XTAL_384kHz) | |
| 51 | #define SUBCPU_CLOCK (XTAL_8MHz/4) | |
| 52 | ||
| 53 | ||
| 54 | static int subcpu_status=0; | |
| 55 | static int soundcpu_busy=0; | |
| 56 | static int msm_data = 0; | |
| 57 | ||
| 58 | /* main Z80 */ | |
| 59 | ||
| 60 | static WRITE8_HANDLER(bank_w) | |
| 61 | { | |
| 62 | UINT8 *RAM = memory_region(space->machine, "main"); | |
| 63 | int bank=0; | |
| 64 | switch(data^0xff) | |
| 65 | { | |
| 66 | case 1: bank=0; break; | |
| 67 | case 2: bank=1; break; | |
| 68 | case 4: bank=2; break; | |
| 69 | case 8: bank=3; break; | |
| 70 | } | |
| 71 | memory_set_bankptr(space->machine,1,&RAM[bank*0x4000+0x10000]); | |
| 72 | } | |
| 73 | ||
| 74 | static TIMER_CALLBACK( subcpu_suspend ) | |
| 75 | { | |
| 76 | cpu_suspend(machine->cpu[2],SUSPEND_REASON_HALT,1); | |
| 77 | } | |
| 78 | ||
| 79 | static TIMER_CALLBACK( subcpu_resume ) | |
| 80 | { | |
| 81 | cpu_resume(machine->cpu[2],SUSPEND_REASON_HALT); | |
| 82 | cpu_set_input_line(machine->cpu[2], INPUT_LINE_NMI, PULSE_LINE); | |
| 83 | } | |
| 84 | ||
| 85 | static READ8_HANDLER( subcpu_halt_set ) | |
| 86 | { | |
| 87 | timer_call_after_resynch(space->machine, NULL, 0, subcpu_suspend); | |
| 88 | subcpu_status|=2; | |
| 89 | return 0; | |
| 90 | } | |
| 91 | ||
| 92 | static READ8_HANDLER( subcpu_halt_clear ) | |
| 93 | { | |
| 94 | timer_call_after_resynch(space->machine,NULL, 0, subcpu_resume); | |
| 95 | subcpu_status&=~1; | |
| 96 | subcpu_status&=~2; | |
| 97 | return 0; | |
| 98 | } | |
| 99 | ||
| 100 | static READ8_HANDLER(subcpu_comm_status ) | |
| 101 | { | |
| 102 | return subcpu_status; | |
| 103 | } | |
| 104 | ||
| 105 | static READ8_HANDLER( soundcpu_status_r ) | |
| 106 | { | |
| 107 | return soundcpu_busy; | |
| 108 | } | |
| 109 | ||
| 110 | static ADDRESS_MAP_START( maincpu_mem_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 111 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 112 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) | |
| 113 | AM_RANGE(0xc000, 0xdfff) AM_RAM AM_MIRROR(0x1800) AM_SHARE(1) | |
| 114 | AM_RANGE(0xe000, 0xffff) AM_RAM | |
| 115 | ADDRESS_MAP_END | |
| 116 | ||
| 117 | static ADDRESS_MAP_START( maincpu_io_map, ADDRESS_SPACE_IO, 8 ) | |
| 118 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 119 | AM_RANGE( 0x00, 0x0f) AM_READ_PORT("INPUT1") | |
| 120 | AM_RANGE( 0x10, 0x1f) AM_READ_PORT("INPUT2") | |
| 121 | AM_RANGE( 0x20, 0x2f) AM_READ_PORT("SYSTEM") | |
| 122 | AM_RANGE( 0x30, 0x30) AM_READ(subcpu_halt_set) | |
| 123 | AM_RANGE( 0x31, 0x31) AM_READ(subcpu_halt_clear) | |
| 124 | AM_RANGE( 0x32, 0x32) AM_READ(subcpu_comm_status) | |
| 125 | AM_RANGE( 0x33, 0x33) AM_READ(soundcpu_status_r) | |
| 126 | AM_RANGE( 0x40, 0x4f) AM_WRITE(soundlatch_w) | |
| 127 | AM_RANGE( 0x50, 0x50) AM_WRITE(bank_w) | |
| 128 | AM_RANGE( 0x60, 0x60) AM_READWRITE(ym2203_status_port_0_r, ym2203_control_port_0_w) | |
| 129 | AM_RANGE( 0x61, 0x61) AM_READWRITE(ym2203_read_port_0_r, ym2203_write_port_0_w) | |
| 130 | AM_RANGE( 0x62, 0x62) AM_READ(ym2203_status_port_0_r) /* not sure, but the A1 line is ignored, code @ $8b8 */ | |
| 131 | AM_RANGE( 0x70, 0x70) AM_WRITE( v9938_0_vram_w ) AM_READ( v9938_0_vram_r ) | |
| 132 | AM_RANGE( 0x71, 0x71) AM_WRITE( v9938_0_command_w ) AM_READ( v9938_0_status_r ) | |
| 133 | AM_RANGE( 0x72, 0x72) AM_WRITE( v9938_0_palette_w ) | |
| 134 | AM_RANGE( 0x73, 0x73) AM_WRITE( v9938_0_register_w ) | |
| 135 | ADDRESS_MAP_END | |
| 136 | ||
| 137 | /* sound Z80 */ | |
| 138 | ||
| 139 | static WRITE8_HANDLER(msm_cfg_w) | |
| 140 | { | |
| 141 | /* | |
| 142 | bit 0 = RESET | |
| 143 | bit 1 = 4B/3B 0 | |
| 144 | bit 2 = S2 1 | |
| 145 | bit 3 = S1 2 | |
| 146 | */ | |
| 147 | msm5205_playmode_w(0, BITSWAP8((data>>1), 7,6,5,4,3,0,1,2)); /* or maybe 7,6,5,4,3,0,2,1 ??? */ | |
| 148 | msm5205_reset_w(0,data&1); | |
| 149 | } | |
| 150 | ||
| 151 | static WRITE8_HANDLER( msm_data_w ) | |
| 152 | { | |
| 153 | msm_data = data; | |
| 154 | ||
| 155 | } | |
| 156 | ||
| 157 | static WRITE8_HANDLER(soundcpu_busyflag_set_w) | |
| 158 | { | |
| 159 | soundcpu_busy=1; | |
| 160 | } | |
| 161 | ||
| 162 | static WRITE8_HANDLER(soundcpu_busyflag_reset_w) | |
| 163 | { | |
| 164 | soundcpu_busy=0; | |
| 165 | } | |
| 166 | ||
| 167 | static WRITE8_HANDLER(soundcpu_int_clear_w) | |
| 168 | { | |
| 169 | cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE ); | |
| 170 | } | |
| 171 | ||
| 172 | static ADDRESS_MAP_START( soundcpu_mem_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 173 | AM_RANGE(0x0000, 0xdfff) AM_ROM | |
| 174 | AM_RANGE(0xf800, 0xffff) AM_RAM | |
| 175 | ADDRESS_MAP_END | |
| 176 | ||
| 177 | static ADDRESS_MAP_START( soundcpu_io_map, ADDRESS_SPACE_IO, 8 ) | |
| 178 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 179 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) | |
| 180 | AM_RANGE(0x01, 0x01) AM_WRITE(msm_data_w) | |
| 181 | AM_RANGE(0x02, 0x02) AM_WRITE(msm_cfg_w) | |
| 182 | AM_RANGE(0x03, 0x03) AM_WRITE(soundcpu_busyflag_set_w) | |
| 183 | AM_RANGE(0x04, 0x04) AM_WRITE(soundcpu_busyflag_reset_w) | |
| 184 | AM_RANGE(0x05, 0x05) AM_WRITE(soundcpu_int_clear_w) | |
| 185 | ADDRESS_MAP_END | |
| 186 | ||
| 187 | /* sub 6809 */ | |
| 188 | ||
| 189 | static void unlock_shared_ram(const address_space *space) | |
| 190 | { | |
| 191 | if(!cpu_is_suspended(space->machine->cpu[2], SUSPEND_REASON_HALT)) | |
| 192 | { | |
| 193 | subcpu_status|=1; | |
| 194 | } | |
| 195 | else | |
| 196 | { | |
| 197 | logerror("Sub cpu active! @%x\n",cpu_get_pc(space->cpu)); | |
| 198 | } | |
| 199 | } | |
| 200 | ||
| 201 | static WRITE8_HANDLER(subcpu_status_w) | |
| 202 | { | |
| 203 | unlock_shared_ram(space); | |
| 204 | } | |
| 205 | ||
| 206 | static READ8_HANDLER(subcpu_status_r) | |
| 207 | { | |
| 208 | unlock_shared_ram(space); | |
| 209 | return 0; | |
| 210 | } | |
| 211 | ||
| 212 | static ADDRESS_MAP_START( subcpu_mem_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 213 | AM_RANGE(0x0000, 0x1fff) AM_READWRITE(subcpu_status_r,subcpu_status_w) | |
| 214 | AM_RANGE(0x2000, 0x77ff) AM_RAM | |
| 215 | AM_RANGE(0x7800, 0x7fff) AM_RAM AM_SHARE(1) /* upper 0x800 of 6264 is shared with main cpu */ | |
| 216 | AM_RANGE(0x8000, 0xffff) AM_ROM | |
| 217 | ADDRESS_MAP_END | |
| 218 | ||
| 219 | INPUT_PORTS_START( sothello ) | |
| 220 | PORT_START("INPUT1") | |
| 221 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) | |
| 222 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) | |
| 223 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) | |
| 224 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) | |
| 225 | ||
| 226 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) | |
| 227 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) | |
| 228 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) | |
| 229 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) | |
| 230 | ||
| 231 | PORT_START("INPUT2") | |
| 232 | ||
| 233 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) | |
| 234 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) | |
| 235 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) | |
| 236 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) | |
| 237 | ||
| 238 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) | |
| 239 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) | |
| 240 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) | |
| 241 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) | |
| 242 | ||
| 243 | PORT_START("SYSTEM") | |
| 244 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 245 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) | |
| 246 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) | |
| 247 | ||
| 248 | PORT_BIT( 0xf2, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 249 | ||
| 250 | PORT_START("DSWA") | |
| 251 | PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coinage ) ) | |
| 252 | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) | |
| 253 | PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) | |
| 254 | PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) | |
| 255 | PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) | |
| 256 | PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) | |
| 257 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) | |
| 258 | PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) | |
| 259 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 260 | ||
| 261 | PORT_DIPNAME( 0x1c, 0x10, "Timer" ) | |
| 262 | PORT_DIPSETTING( 0x1c, "15" ) | |
| 263 | PORT_DIPSETTING( 0x18, "20" ) | |
| 264 | PORT_DIPSETTING( 0x14, "25" ) | |
| 265 | PORT_DIPSETTING( 0x10, "30" ) | |
| 266 | PORT_DIPSETTING( 0x0c, "35" ) | |
| 267 | PORT_DIPSETTING( 0x08, "40" ) | |
| 268 | PORT_DIPSETTING( 0x04, "45" ) | |
| 269 | PORT_DIPSETTING( 0x00, "50" ) | |
| 270 | ||
| 271 | PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 272 | ||
| 273 | PORT_START("DSWB") | |
| 274 | PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Difficulty ) ) | |
| 275 | PORT_DIPSETTING( 0xc0, DEF_STR( Easy ) ) | |
| 276 | PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) | |
| 277 | PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) | |
| 278 | PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) | |
| 279 | ||
| 280 | PORT_DIPNAME( 0x30, 0x10, "Matta" ) /* undo moves */ | |
| 281 | PORT_DIPSETTING( 0x30, "0" ) | |
| 282 | PORT_DIPSETTING( 0x20, "1" ) | |
| 283 | PORT_DIPSETTING( 0x10, "2" ) | |
| 284 | PORT_DIPSETTING( 0x00, "3" ) | |
| 285 | ||
| 286 | PORT_DIPNAME( 0x08, 0x08, "Games for 2 players" ) | |
| 287 | PORT_DIPSETTING( 0x08, "1" ) | |
| 288 | PORT_DIPSETTING( 0x00, "2" ) | |
| 289 | ||
| 290 | PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 291 | ||
| 292 | INPUT_PORTS_END | |
| 293 | ||
| 294 | static void irqhandler(running_machine *machine, int irq) | |
| 295 | { | |
| 296 | cpu_set_input_line(machine->cpu[2],0,irq ? ASSERT_LINE : CLEAR_LINE); | |
| 297 | } | |
| 298 | ||
| 299 | static void sothello_vdp_interrupt(running_machine *machine, int i) | |
| 300 | { | |
| 301 | cpu_set_input_line (machine->cpu[0], 0, (i ? HOLD_LINE : CLEAR_LINE)); | |
| 302 | } | |
| 303 | ||
| 304 | static INTERRUPT_GEN( sothello_interrupt ) | |
| 305 | { | |
| 306 | v9938_interrupt(device->machine, 0); | |
| 307 | } | |
| 308 | ||
| 309 | static void adpcm_int(const device_config *device) | |
| 310 | { | |
| 311 | /* only 4 bits are used */ | |
| 312 | msm5205_data_w( 0, msm_data & 0x0f ); | |
| 313 | cpu_set_input_line(device->machine->cpu[1], 0, ASSERT_LINE ); | |
| 314 | } | |
| 315 | ||
| 316 | ||
| 317 | static msm5205_interface msm_interface = | |
| 318 | { | |
| 319 | adpcm_int, /* interrupt function */ | |
| 320 | MSM5205_S48_4B /* changed on the fly */ | |
| 321 | }; | |
| 322 | ||
| 323 | VIDEO_START( sothello ) | |
| 324 | { | |
| 325 | VIDEO_START_CALL(generic_bitmapped); | |
| 326 | v9938_init (machine, 0, machine->primary_screen, tmpbitmap, MODEL_V9938, VDP_MEM, sothello_vdp_interrupt); | |
| 327 | v9938_reset(0); | |
| 328 | } | |
| 329 | ||
| 330 | static MACHINE_RESET(sothello) | |
| 331 | { | |
| 332 | v9938_reset(0); | |
| 333 | } | |
| 334 | ||
| 335 | static const ym2203_interface ym2203_config = | |
| 336 | { | |
| 337 | { | |
| 338 | AY8910_LEGACY_OUTPUT, | |
| 339 | AY8910_DEFAULT_LOADS, | |
| 340 | input_port_3_r, /* DSW-1 connected to port */ | |
| 341 | input_port_4_r, /* DSW-2 connected to port */ | |
| 342 | NULL, | |
| 343 | NULL, | |
| 344 | }, | |
| 345 | irqhandler | |
| 346 | }; | |
| 347 | ||
| 348 | static MACHINE_DRIVER_START( sothello ) | |
| 349 | ||
| 350 | /* basic machine hardware */ | |
| 351 | ||
| 352 | MDRV_CPU_ADD("main",Z80, MAINCPU_CLOCK) | |
| 353 | MDRV_CPU_PROGRAM_MAP(maincpu_mem_map,0) | |
| 354 | MDRV_CPU_IO_MAP(maincpu_io_map,0) | |
| 355 | MDRV_CPU_VBLANK_INT_HACK(sothello_interrupt,262) | |
| 356 | ||
| 357 | MDRV_CPU_ADD("sound",Z80, SOUNDCPU_CLOCK) | |
| 358 | MDRV_CPU_PROGRAM_MAP(soundcpu_mem_map,0) | |
| 359 | MDRV_CPU_IO_MAP(soundcpu_io_map,0) | |
| 360 | ||
| 361 | MDRV_CPU_ADD("sub",M6809, SUBCPU_CLOCK) | |
| 362 | MDRV_CPU_PROGRAM_MAP(subcpu_mem_map,0) | |
| 363 | ||
| 364 | MDRV_QUANTUM_TIME(HZ(600)) | |
| 365 | ||
| 366 | MDRV_MACHINE_RESET(sothello) | |
| 367 | ||
| 368 | MDRV_SCREEN_ADD("main", RASTER) | |
| 369 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 370 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 371 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 372 | MDRV_SCREEN_SIZE(512 + 32, (212 + 28) * 2) | |
| 373 | MDRV_SCREEN_VISIBLE_AREA(0, 512 + 32 - 1, 0, (212 + 28) * 2 - 1) | |
| 374 | MDRV_PALETTE_LENGTH(512) | |
| 375 | MDRV_PALETTE_INIT( v9938 ) | |
| 376 | MDRV_VIDEO_START(sothello) | |
| 377 | MDRV_VIDEO_UPDATE(generic_bitmapped) | |
| 378 | ||
| 379 | /* sound hardware */ | |
| 380 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 381 | MDRV_SOUND_ADD("ym1", YM2203, YM_CLOCK) | |
| 382 | MDRV_SOUND_CONFIG(ym2203_config) | |
| 383 | MDRV_SOUND_ROUTE(0, "mono", 0.25) | |
| 384 | MDRV_SOUND_ROUTE(1, "mono", 0.25) | |
| 385 | MDRV_SOUND_ROUTE(2, "mono", 0.25) | |
| 386 | MDRV_SOUND_ROUTE(3, "mono", 0.50) | |
| 387 | ||
| 388 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) | |
| 389 | ||
| 390 | MDRV_SOUND_ADD("msm",MSM5205, MSM_CLOCK) | |
| 391 | MDRV_SOUND_CONFIG(msm_interface) | |
| 392 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 393 | ||
| 394 | MACHINE_DRIVER_END | |
| 395 | ||
| 396 | /*************************************************************************** | |
| 397 | ||
| 398 | Game driver(s) | |
| 399 | ||
| 400 | ***************************************************************************/ | |
| 401 | ||
| 402 | ROM_START( sothello ) | |
| 403 | ROM_REGION( 0x20000, "main", 0 ) | |
| 404 | ROM_LOAD( "3.7c", 0x0000, 0x8000, CRC(47f97bd4) SHA1(52c9638f098fdcf66903fad7dafe3ab171758572) ) | |
| 405 | ROM_LOAD( "4.8c", 0x10000, 0x8000, CRC(a98414e9) SHA1(6d14e1f9c79b95101e0aa101034f398af09d7f32) ) | |
| 406 | ROM_LOAD( "5.9c", 0x18000, 0x8000, CRC(e5b5d61e) SHA1(2e4b3d85f41d0796a4d61eae40dd824769e1db86) ) | |
| 407 | ||
| 408 | ROM_REGION( 0x10000, "sound", 0 ) | |
| 409 | ROM_LOAD( "1.7a", 0x0000, 0x8000, CRC(6951536a) SHA1(64d07a692d6a167334c825dc173630b02584fdf6) ) | |
| 410 | ROM_LOAD( "2.8a", 0x8000, 0x8000, CRC(9c535317) SHA1(b2e69b489e111d6f8105e68fade6e5abefb825f7) ) | |
| 411 | ||
| 412 | ROM_REGION( 0x10000, "sub", 0 ) | |
| 413 | ROM_LOAD( "6.7f", 0x8000, 0x8000, CRC(ee80fc78) SHA1(9a9d7925847d7a36930f0761c70f67a9affc5e7c) ) | |
| 414 | ROM_END | |
| 415 | ||
| 416 | GAME( 1986, sothello, 0, sothello, sothello, 0, ROT0, "Success/Fujiwara", "Super Othello", 0 ) |
| r4184 | r4185 | |
|---|---|---|
| 1 | /*====================================================================*/ | |
| 2 | /* 'micro3d.c' */ | |
| 3 | /* Microprose 3D Hardware MAME driver */ | |
| 4 | /* Philip J Bennett 2005 */ | |
| 5 | /* */ | |
| 6 | /* o F-15 Strike Eagle */ | |
| 7 | /* o B.O.T.S.S - Battle of the Solar System */ | |
| 8 | /* o Super Tank Attack */ | |
| 9 | /* */ | |
| 10 | /* Current issues: */ | |
| 11 | /* o No 3D/Am29000 emulation (communications code patched out) */ | |
| 12 | /* o Analogue controls not hooked up */ | |
| 13 | /* o Incomplete/crap/incorrect 68901 and 68681 emulation (eg. timers) */ | |
| 14 | /* o Video emulation needs to be checked over */ | |
| 15 | /* o No sound. */ | |
| 16 | /* */ | |
| 17 | /* F15SE v2.2 was missing the math & sound boards, so those may need */ | |
| 18 | /* to be redumped!!! */ | |
| 19 | /* */ | |
| 20 | /* It complains about bad object ROM checksums in the MFR test? */ | |
| 21 | /* BOTSS and STANKATK crash when entering TMS monitor mode ? */ | |
| 22 | /*====================================================================*/ | |
| 1 | /*************************************************************************** | |
| 23 | 2 | |
| 3 | Microprose Games 3D hardware | |
| 4 | ||
| 5 | preliminary driver by Phil Bennett | |
| 6 | ||
| 7 | Games supported: | |
| 8 | * F-15 Strike Eagle [2 sets] | |
| 9 | * B.O.T.S.S. - Battle of the Solar System | |
| 10 | * Super Tank Attack (prototype) | |
| 11 | ||
| 12 | TODO: | |
| 13 | * Write Am29000 CPU core | |
| 14 | * Implement 3D pipeline | |
| 15 | * Borrow MC68901 implementation from MESS | |
| 16 | * Controls | |
| 17 | * Filtered noise sound sources | |
| 18 | * Volume control | |
| 19 | * NVRAM | |
| 20 | ||
| 21 | ****************************************************************************/ | |
| 22 | ||
| 24 | 23 | #include "driver.h" |
| 25 | 24 | #include "cpu/m68000/m68000.h" |
| 26 | 25 | #include "cpu/tms34010/tms34010.h" |
| 27 | 26 | #include "cpu/mcs51/mcs51.h" |
| 27 | #include "machine/68681.h" | |
| 28 | 28 | #include "sound/2151intf.h" |
| 29 | 29 | #include "sound/upd7759.h" |
| 30 | #include "sound/dac.h" | |
| 31 | 30 | |
| 32 | #define M68681_CLK 3686400 | |
| 33 | #define M68901_CLK 4000000 | |
| 34 | #define M68901_XTAL1 4000000 | |
| 31 | ||
| 32 | /************************************* | |
| 33 | * | |
| 34 | * Defines | |
| 35 | * | |
| 36 | *************************************/ | |
| 37 | ||
| 38 | #define M68901_CLK XTAL_4_MHz | |
| 39 | #define M68901_XTAL1 XTAL_4_MHz | |
| 35 | 40 | #define TIMERA 250 |
| 36 | 41 | #define TIMERB 250 |
| 37 | 42 | #define TIMERC 250 |
| 38 | 43 | #define TIMERD 250 |
| 39 | 44 | #define DEBUG 1 |
| 40 | 45 | |
| 41 | /*====================================================================*/ | |
| 42 | /* Each CPU (bar 80C31) communicates with a computer plugged into the */ | |
| 43 | /* corresponding monitor port. */ | |
| 44 | /* Status information is reported, and tests can be performed. */ | |
| 45 | /* */ | |
| 46 | /* We print this useful stuff out to the text prompt. */ | |
| 47 | /*====================================================================*/ | |
| 48 | ||
| 49 | 46 | #ifdef DEBUG |
| 50 | 47 | #define HOST_MONITOR_DISPLAY 1 |
| 51 | 48 | #define VGB_MONITOR_DISPLAY 0 |
| 52 | 49 | #define DRMATH_MONITOR_DISPLAY 0 |
| 53 | 50 | #endif |
| 54 | 51 | |
| 55 | static UINT16 *micro3d_sprite_vram; | |
| 56 | static UINT16 *m68681_base; | |
| 57 | static UINT16 *m68901_base; | |
| 58 | ||
| 59 | static struct { | |
| 60 | UINT16 MR1A; | |
| 61 | UINT16 MR2A; | |
| 62 | UINT16 SRA; | |
| 63 | UINT16 CSRA; | |
| 64 | UINT16 CRA; | |
| 65 | UINT16 RBA; | |
| 66 | UINT16 TBA; | |
| 67 | UINT16 IPCR; | |
| 68 | UINT16 ACR; | |
| 69 | UINT16 ISR; | |
| 70 | UINT16 IMR; | |
| 71 | UINT16 CUR; | |
| 72 | UINT16 CTUR; | |
| 73 | UINT16 CLR; | |
| 74 | UINT16 CTLR; | |
| 75 | UINT16 MR1B; | |
| 76 | UINT16 MR2B; | |
| 77 | UINT16 SRB; | |
| 78 | UINT16 CSRB; | |
| 79 | UINT16 CRB; | |
| 80 | UINT16 RBB; | |
| 81 | UINT16 TBB; | |
| 82 | UINT16 IVR; | |
| 83 | UINT16 IPORT; | |
| 84 | UINT16 OPCR; | |
| 85 | UINT16 OPR; | |
| 86 | ||
| 87 | int MRA_ptr; | |
| 88 | int MRB_ptr; | |
| 89 | } M68681; | |
| 90 | ||
| 91 | static UINT8 ti_uart[9]; | |
| 92 | static int ti_uart_mode_cycle=0; | |
| 93 | static int ti_uart_sync_cycle=0; | |
| 94 | ||
| 95 | static void m68901_int_gen(running_machine *machine, int source); | |
| 96 | ||
| 97 | /* 68901 */ | |
| 98 | enum{ TMRB=0,TXERR,TBE,RXERR,RBF,TMRA,GPIP6,GPIP7, // A Registers | |
| 99 | GPIP0,GPIP1,GPIP2,GPIP3,TMRD,TMRC,GPIP4,GPIP5 // B Registers | |
| 52 | /* 68901 (nuke me)*/ | |
| 53 | enum | |
| 54 | { | |
| 55 | TMRB=0, TXERR, TBE, RXERR, RBF, TMRA, GPIP6, GPIP7, // A Registers | |
| 56 | GPIP0, GPIP1, GPIP2, GPIP3, TMRD, TMRC, GPIP4, GPIP5 // B Registers | |
| 100 | 57 | }; |
| 101 | 58 | |
| 102 | 59 | /* TI UART */ |
| 103 | enum{ RX=0,TX,STATUS,SYN1,SYN2,DLE,MODE1,MODE2,COMMAND | |
| 60 | enum | |
| 61 | { | |
| 62 | RX, TX, STATUS, SYN1, SYN2, DLE, MODE1, MODE2, COMMAND | |
| 104 | 63 | }; |
| 105 | 64 | |
| 65 | /************************************* | |
| 66 | * | |
| 67 | * Statics | |
| 68 | * | |
| 69 | *************************************/ | |
| 106 | 70 | |
| 107 | /* Probably wrong and a bit crap */ | |
| 108 | static int data_to_i8031(const device_config *device) | |
| 109 | { | |
| 110 | mame_printf_debug("68k sent data: %x\n",M68681.TBB); | |
| 111 | M68681.SRB |=0x0400; // Data has been sent - TX ready for more. | |
| 112 | // Write to sound board | |
| 113 | if(M68681.IMR & 0x1000) | |
| 114 | { | |
| 115 | cpu_set_input_line_and_vector(device->machine->cpu[0],3, HOLD_LINE, M68681.IVR); // Generate an interrupt, if allowed. | |
| 116 | } | |
| 117 | return M68681.TBB; | |
| 118 | } | |
| 71 | static UINT16 creg; | |
| 72 | static UINT8 m68681_tx0; | |
| 73 | static UINT8 sound_port_latch[4]; | |
| 119 | 74 | |
| 120 | static void data_from_i8031(const device_config *device, int data) | |
| 121 | { | |
| 122 | M68681.RBB = data<<8; // Put into receive buffer. | |
| 123 | M68681.SRB |= 0x0100; // Set Receiver B ready. | |
| 124 | if(M68681.IMR & 0x1000) | |
| 125 | { | |
| 126 | cpu_set_input_line_and_vector(device->machine->cpu[0],3, HOLD_LINE, M68681.IVR); // Generate a receiver interrupt. | |
| 127 | mame_printf_debug("INTERRUPT!!!\n"); | |
| 128 | } | |
| 129 | mame_printf_debug("8031 sent data: %x\n",data); | |
| 130 | } | |
| 75 | static UINT16 *micro3d_sprite_vram; | |
| 76 | static UINT16 *m68901_base; | |
| 77 | static const device_config *duart68681; | |
| 131 | 78 | |
| 79 | static UINT8 ti_uart[9]; | |
| 80 | static int ti_uart_mode_cycle=0; | |
| 81 | static int ti_uart_sync_cycle=0; | |
| 132 | 82 | |
| 133 | static void changecolor_BBBBBRRRRRGGGGGG(running_machine *machine,pen_t color,int data) | |
| 134 | { | |
| 135 | palette_set_color_rgb(machine,color,pal5bit(data >> 6),pal5bit(data >> 1),pal5bit(data >> 11)); | |
| 136 | } | |
| 83 | static void m68901_int_gen(running_machine *machine, int source); | |
| 137 | 84 | |
| 138 | static WRITE16_HANDLER( paletteram16_BBBBBRRRRRGGGGGG_word_w ) | |
| 139 | { | |
| 140 | COMBINE_DATA(&paletteram16[offset]); | |
| 141 | changecolor_BBBBBRRRRRGGGGGG(space->machine,offset,paletteram16[offset]); | |
| 142 | } | |
| 143 | 85 | |
| 86 | /************************************* | |
| 87 | * | |
| 88 | * Video Hardware | |
| 89 | * | |
| 90 | *************************************/ | |
| 144 | 91 | |
| 145 | 92 | static void micro3d_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) |
| 146 | 93 | { |
| r4184 | r4185 | |
| 148 | 95 | UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); |
| 149 | 96 | int coladdr = params->coladdr; |
| 150 | 97 | int x; |
| 98 | int sd_11_7 = (creg & 0x1f) << 7; | |
| 151 | 99 | |
| 152 | /* | |
| 100 | /* Copy the non-blanked portions of this scanline */ | |
| 153 | 101 | for (x = params->heblnk; x < params->hsblnk; x += 2) |
| 154 | 102 | { |
| 155 | 103 | UINT16 pix = src[coladdr++ & 0x1ff]; |
| 156 | 104 | |
| 157 | 105 | if (pix & 0x80) |
| 158 | dest[x + 0] = (pix & 0x7f) | |
| 106 | dest[x + 0] = sd_11_7 | (pix & 0x7f) | |
| 159 | 107 | else |
| 160 | 108 | dest[x + 0] = 0; /* 3D data */ |
| 161 | 109 | |
| 162 | 110 | pix >>= 8; |
| 111 | ||
| 163 | 112 | if (pix & 0x80) |
| 164 | dest[x + 1] = (pix & 0x7f) | |
| 113 | dest[x + 1] = sd_11_7 | (pix & 0x7f) | |
| 165 | 114 | else |
| 166 | 115 | dest[x + 1] = 0; /* 3D data */ |
| 167 | 116 | } |
| 168 | 117 | } |
| 169 | 118 | |
| 170 | static | |
| 119 | static WR | |
| 171 | 120 | { |
| 172 | i8051_set_serial_tx_callback(machine->cpu[2], data_from_i8031); | |
| 173 | i8051_set_serial_rx_callback(machine->cpu[2], data_to_i8031); | |
| 174 | ti_uart[STATUS]=1; | |
| 175 | M68681.SRA=0x0500; | |
| 176 | M68681.SRB=0x0500; | |
| 177 | } | |
| 121 | UINT16 word; | |
| 178 | 122 | |
| 179 | static DRIVER_INIT( stankatk ) | |
| 180 | { | |
| 181 | UINT16 *rom = (UINT16 *)memory_region(machine, "main"); | |
| 182 | rom[0x1F543]=0x4E71; /* 3ea86 - nop */ | |
| 183 | rom[0x1F546]=0x4E71; /* 3ea8c - nop */ | |
| 184 | rom[0x1F596]=0x4E71; | |
| 185 | rom[0x2182B]=0x6006; /* Skip AM2k object download */ | |
| 186 | rom[0x21838]=0x4E71; | |
| 187 | rom[0x1F692]=0x4e71; | |
| 188 | rom[0x21CA8]=0x4e71; /* Lie that trig table is intact */ | |
| 189 | rom[0x21C60]=0x4e71; /* Lie that tree is intact */ | |
| 190 | rom[0x1F581]=0x4e71; | |
| 191 | rom[0x21905]=0x4E71; | |
| 123 | COMBINE_DATA(&paletteram16[offset]); | |
| 124 | word = paletteram16[offset]; | |
| 125 | palette_set_color_rgb(space->machine, offset, pal5bit(word >> 6), pal5bit(word >> 1), pal5bit(word >> 11)); | |
| 192 | 126 | } |
| 193 | 127 | |
| 194 | static | |
| 128 | static WRITE16_HANDLER( creg_w ) | |
| 195 | 129 | { |
| 196 | UINT16 *rom = (UINT16 *)memory_region(machine, "main"); | |
| 197 | rom[0x1FCC0]=0x4E71; /* Eliminate startup Am29000 timeout */ | |
| 198 | rom[0x1FBF0]=0x4E71; /* Skip AM29k code version detect */ | |
| 199 | rom[0x1FC88]=0x4E71; | |
| 200 | rom[0x23146]=0x4E71; | |
| 201 | rom[0x17F4F]=0x6006; /* Skip download objects */ | |
| 202 | rom[0x17F5B]=0x4E71; | |
| 203 | ||
| 130 | // TODO: Clear interrupt? | |
| 131 | // GSWOP? | |
| 132 | creg = data; | |
| 204 | 133 | } |
| 205 | 134 | |
| 206 | static | |
| 135 | static void tms_interrupt(const device_config *device, int state) | |
| 207 | 136 | { |
| 208 | ||
| 137 | | |
| 209 | 138 | } |
| 210 | 139 | |
| 211 | static | |
| 140 | static | |
| 212 | 141 | { |
| 213 | #if 1 | |
| 214 | UINT16 *rom = (UINT16 *)memory_region(machine, "main"); | |
| 215 | rom[0x2A8B3]=0x6006; //055166: 6606 bne 5516e -> bra | |
| 216 | rom[0x2A8BF]=0x4E71; //05517E: 6704 beq 55184 -> nop | |
| 217 | rom[0x28AD1]=0x4E71; //0515A2: 67F8 beq 5159c -> nop | |
| 218 | rom[0x28A9E]=0x4E71; | |
| 219 | rom[0x28ABD]=0x4E71; | |
| 220 | rom[0x28C3B]=0x4E71; | |
| 221 | #endif | |
| 142 | m68901_int_gen(device->machine, GPIP7); | |
| 222 | 143 | } |
| 223 | 144 | |
| 224 | static INPUT_PORTS_START( stankatk ) | |
| 225 | /* Ports A and B */ | |
| 226 | PORT_START("IN0") | |
| 227 | PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unused ) ) | |
| 228 | PORT_DIPSETTING( 0x0001, DEF_STR(Off) ) | |
| 229 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 230 | // PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unused ) ) | |
| 231 | // PORT_DIPSETTING( 0x0002, DEF_STR(Off) ) | |
| 232 | // PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 233 | 145 | |
| 234 | // PORT_BITX(0x0002, IP_ACTIVE_LOW, 0, "????ht", KEYCODE_K, IP_JOY_NONE ) | |
| 146 | /************************************* | |
| 147 | * | |
| 148 | * 68681 DUART Functions | |
| 149 | * | |
| 150 | *************************************/ | |
| 235 | 151 | |
| 236 | PORT_DIPNAME( 0x0004, 0x0000, "Shared Memory Handshake Test") | |
| 237 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 238 | PORT_DIPSETTING( 0x0004, DEF_STR(On) ) | |
| 239 | PORT_DIPNAME( 0x0008, 0x0000, "Dr. Math Monitor Mode") | |
| 240 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 241 | PORT_DIPSETTING( 0x0008, DEF_STR(On) ) | |
| 242 | PORT_DIPNAME( 0x0010, 0x0000, "Burn-in Tests") | |
| 243 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 244 | PORT_DIPSETTING( 0x0010, DEF_STR(On)) | |
| 245 | PORT_DIPNAME( 0x0020, 0x0000, "Manufacturing Tests") | |
| 246 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 247 | PORT_DIPSETTING( 0x0020, DEF_STR(On) ) | |
| 248 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unused ) ) | |
| 249 | PORT_DIPSETTING( 0x0040, DEF_STR(Off) ) | |
| 250 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 251 | PORT_DIPNAME( 0x0080, 0x0000, "Host Monitor Mode") | |
| 252 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 253 | PORT_DIPSETTING( 0x0080, DEF_STR(On) ) | |
| 152 | static void duart_irq_handler(const device_config *device, UINT8 vector) | |
| 153 | { | |
| 154 | cpu_set_input_line_and_vector(device->machine->cpu[0], 3, HOLD_LINE, vector); | |
| 155 | }; | |
| 254 | 156 | |
| 255 | // PORT_BITX(0x0100, IP_ACTIVE_LOW, 0, "Blue Lower Right", KEYCODE_A, IP_JOY_NONE ) | |
| 256 | // PORT_BITX(0x0200, IP_ACTIVE_LOW, 0, "Blue Upper Left", KEYCODE_B, IP_JOY_NONE ) | |
| 257 | // PORT_BITX(0x0800, IP_ACTIVE_LOW, 0, "Blue Lower Left", KEYCODE_C, IP_JOY_NONE ) | |
| 258 | // PORT_BITX(0x1000, IP_ACTIVE_LOW, 0, "Yellow Upper Right", KEYCODE_E, IP_JOY_NONE ) | |
| 259 | // PORT_BITX(0x2000, IP_ACTIVE_LOW, 0, "Yellow Lower Right", KEYCODE_F, IP_JOY_NONE ) | |
| 157 | static void duart_tx(const device_config *device, int channel, UINT8 data) | |
| 158 | { | |
| 159 | if (channel == 0) | |
| 160 | { | |
| 161 | mame_printf_debug("%c", data); | |
| 162 | } | |
| 163 | else | |
| 164 | { | |
| 165 | m68681_tx0 = data; | |
| 166 | cpu_set_input_line(device->machine->cpu[2], MCS51_RX_LINE, HOLD_LINE); | |
| 167 | } | |
| 168 | }; | |
| 260 | 169 | |
| 261 | // PORT_BITX(0x000f, IP_ACTIVE_HIGH, 0, "Yeft", KEYCODE_K, IP_JOY_NONE ) | |
| 262 | PORT_SERVICE(0x0400, IP_ACTIVE_LOW) | |
| 170 | static int data_to_i8031(const device_config *device) | |
| 171 | { | |
| 172 | return m68681_tx0; | |
| 173 | } | |
| 263 | 174 | |
| 175 | static void data_from_i8031(const device_config *device, int data) | |
| 176 | { | |
| 177 | duart68681_rx_data(duart68681, 1, data); | |
| 178 | } | |
| 264 | 179 | |
| 265 | /* C and D ports */ | |
| 266 | PORT_START("IN1") | |
| 267 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 268 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 269 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN3 ) | |
| 270 | // PORT_BITX( 0x0800, IP_ACTIVE_LOW, 0, "Unk2", KEYCODE_S, IP_JOY_NONE ) | |
| 180 | /* | |
| 181 | * 0: Monitor port P4 | |
| 182 | * 1: 5V | |
| 183 | * 2: /AM29000 present | |
| 184 | * 3: /TMS34010 present | |
| 185 | * 4: - | |
| 186 | * 5: - | |
| 187 | */ | |
| 188 | static UINT8 duart_input_r(const device_config *device) | |
| 189 | { | |
| 190 | return 0x2; | |
| 191 | } | |
| 271 | 192 | |
| 272 | // PORT_BITX( 0x0010, IP_ACTIVE_LOW, 0, "Yellow Upper Right", KEYCODE_Y, IP_JOY_NONE ) | |
| 273 | // PORT_BITX( 0x0020, IP_ACTIVE_LOW, 0, "Yellow Lower Right", KEYCODE_X, IP_JOY_NONE ) | |
| 274 | // PORT_BITX( 0x0040, IP_ACTIVE_LOW, 0, "Unk2", KEYCODE_R, IP_JOY_NONE ) | |
| 275 | // PORT_BITX( 0x0080, IP_ACTIVE_LOW, 0, "Unkn3", KEYCODE_T, IP_JOY_NONE ) | |
| 193 | /* | |
| 194 | * 5: /I8051 reset | |
| 195 | * 7: Status LED | |
| 196 | */ | |
| 197 | static void duart_output_w(const device_config *device, UINT8 data) | |
| 198 | { | |
| 199 | cpu_set_input_line(device->machine->cpu[2], INPUT_LINE_RESET, data & 0x20 ? CLEAR_LINE : ASSERT_LINE); | |
| 200 | } | |
| 276 | 201 | |
| 277 | // PORT_BITX( 0x0001, IP_ACTIVE_HIGH, 0, "Blue Top Right", KEYCODE_Z, IP_JOY_NONE ) // ?? | |
| 278 | // PORT_BITX( 0x0002, IP_ACTIVE_HIGH, 0, "Blue Top Right", KEYCODE_Z, IP_JOY_NONE ) | |
| 279 | // PORT_BITX( 0x0004, IP_ACTIVE_LOW, 0, "Blue Top Right", KEYCODE_D, IP_JOY_NONE ) | |
| 280 | // PORT_BITX( 0x0008, IP_ACTIVE_HIGH, 0, "Blue Top Right", KEYCODE_Z, IP_JOY_NONE ) | |
| 281 | 202 | |
| 282 | // PORT_BITX( 0x1000, IP_ACTIVE_LOW, 0, "Unk2", KEYCODE_I,Y IP_JOY_NONE ) | |
| 283 | // PORT_BITX( 0x2000, IP_ACTIVE_LOW, 0, "Blue Trigger", KEYCODE_H, IP_JOY_NONE ) | |
| 284 | // PORT_BITX( 0x4000, IP_ACTIVE_LOW, 0, "Unkn3", KEYCODE_J, IP_JOY_NONE ) | |
| 285 | // PORT_BITX( 0x8000, IP_ACTIVE_LOW, 0, "Yellow Trigger", KEYCODE_G, IP_JOY_NONE ) | |
| 203 | /************************************* | |
| 204 | * | |
| 205 | * Port Definitions | |
| 206 | * | |
| 207 | *************************************/ | |
| 286 | 208 | |
| 287 | ||
| 288 | PORT_START("VGB") | |
| 289 | PORT_DIPNAME( 0x0008, 0x0008, "VGB Monitor Mode") | |
| 290 | PORT_DIPSETTING( 0x0008, DEF_STR(Off) ) | |
| 291 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 292 | ||
| 293 | INPUT_PORTS_END | |
| 294 | ||
| 295 | static INPUT_PORTS_START( botss ) | |
| 296 | PORT_START("IN0") | |
| 209 | static INPUT_PORTS_START( f15se ) | |
| 210 | PORT_START("INPUTS_A_B") | |
| 297 | 211 | PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unused ) ) |
| 298 | PORT_DIPSETTING( 0x0001, DEF_STR(Off) ) | |
| 299 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 212 | PORT_DIPSETTING( 0x0001, DEF_STR(Off) ) | |
| 213 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 300 | 214 | PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unused ) ) |
| 301 | PORT_DIPSETTING( 0x0002, DEF_STR(Off) ) | |
| 302 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 215 | PORT_DIPSETTING( 0x0002, DEF_STR(Off) ) | |
| 216 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 303 | 217 | PORT_DIPNAME( 0x0004, 0x0000, "Shared Memory Handshake Test") |
| 304 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 305 | PORT_DIPSETTING( 0x0004, DEF_STR(On) ) | |
| 218 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 219 | PORT_DIPSETTING( 0x0004, DEF_STR(On) ) | |
| 306 | 220 | PORT_DIPNAME( 0x0008, 0x0000, "Dr. Math Monitor Mode") |
| 307 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 308 | PORT_DIPSETTING( 0x0008, DEF_STR(On) ) | |
| 221 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 222 | PORT_DIPSETTING( 0x0008, DEF_STR(On) ) | |
| 309 | 223 | PORT_DIPNAME( 0x0010, 0x0000, "Burn-in Tests") |
| 310 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 311 | PORT_DIPSETTING( 0x0010, DEF_STR(On)) | |
| 224 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 225 | PORT_DIPSETTING( 0x0010, DEF_STR(On)) | |
| 312 | 226 | PORT_DIPNAME( 0x0020, 0x0000, "Manufacturing Tests") |
| 313 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 314 | PORT_DIPSETTING( 0x0020, DEF_STR(On) ) | |
| 227 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 228 | PORT_DIPSETTING( 0x0020, DEF_STR(On) ) | |
| 315 | 229 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unused ) ) |
| 316 | PORT_DIPSETTING( 0x0040, DEF_STR(Off) ) | |
| 317 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 230 | PORT_DIPSETTING( 0x0040, DEF_STR(Off) ) | |
| 231 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 318 | 232 | PORT_DIPNAME( 0x0080, 0x0000, "Host Monitor Mode") |
| 319 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 320 | PORT_DIPSETTING( 0x0080, DEF_STR(On) ) | |
| 321 | // PORT_BITX(0x0100, IP_ACTIVE_LOW, IPT_START1, "Start", IP_KEY_DEFAULT, IP_JOY_DEFAULT ) | |
| 322 | // PORT_BITX(0x0200, IP_ACTIVE_LOW, 0, "Shield", KEYCODE_A, IP_JOY_NONE ) | |
| 323 | PORT_SERVICE(0x0400, IP_ACTIVE_LOW) | |
| 324 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) | |
| 325 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) | |
| 326 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) | |
| 327 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) | |
| 233 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 234 | PORT_DIPSETTING( 0x0080, DEF_STR(On) ) | |
| 328 | 235 | |
| 329 | /* C and D ports */ | |
| 330 | PORT_START("IN1") | |
| 331 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 332 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 333 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN3 ) | |
| 334 | // PORT_BITX(0x1000, IP_ACTIVE_LOW, 0, "Trigger", KEYCODE_B, IP_JOY_NONE ) | |
| 335 | // PORT_BITX(0x2000, IP_ACTIVE_LOW, 0, "Blaster", KEYCODE_C, IP_JOY_NONE ) | |
| 336 | // PORT_BITX(0x0002, IP_ACTIVE_LOW, 0, "Throttle Up", KEYCODE_D, IP_JOY_NONE ) | |
| 337 | // PORT_BITX(0x0008, IP_ACTIVE_LOW, 0, "Throttle Down", KEYCODE_F, IP_JOY_NONE ) | |
| 236 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) | |
| 237 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 238 | PORT_SERVICE( 0x0400, IP_ACTIVE_LOW ) | |
| 239 | PORT_BIT( 0xf800, IP_ACTIVE_LOW, IPT_UNUSED ) // TODO | |
| 338 | 240 | |
| 339 | PORT_START("VGB") | |
| 241 | PORT_START("VGB_SW") | |
| 340 | 242 | PORT_DIPNAME( 0x0008, 0x0008, "VGB Monitor Mode") |
| 341 | 243 | PORT_DIPSETTING( 0x0008, DEF_STR(Off) ) |
| 342 | 244 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) |
| 343 | 245 | |
| 344 | INPUT_PORTS_END | |
| 246 | PORT_START("SOUND_SW") | |
| 247 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Sound PCB Test SW") PORT_CODE(KEYCODE_F1) | |
| 345 | 248 | |
| 346 | ||
| 347 | static INPUT_PORTS_START( f15se ) | |
| 348 | PORT_START("IN0") | |
| 349 | PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unused ) ) | |
| 350 | PORT_DIPSETTING( 0x0001, DEF_STR(Off) ) | |
| 351 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 352 | PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unused ) ) | |
| 353 | PORT_DIPSETTING( 0x0002, DEF_STR(Off) ) | |
| 354 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 355 | PORT_DIPNAME( 0x0004, 0x0000, "Shared Memory Handshake Test") | |
| 356 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 357 | PORT_DIPSETTING( 0x0004, DEF_STR(On) ) | |
| 358 | PORT_DIPNAME( 0x0008, 0x0000, "Dr. Math Monitor Mode") | |
| 359 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 360 | PORT_DIPSETTING( 0x0008, DEF_STR(On) ) | |
| 361 | PORT_DIPNAME( 0x0010, 0x0000, "Burn-in Tests") | |
| 362 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 363 | PORT_DIPSETTING( 0x0010, DEF_STR(On)) | |
| 364 | PORT_DIPNAME( 0x0020, 0x0000, "Manufacturing Tests") | |
| 365 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 366 | PORT_DIPSETTING( 0x0020, DEF_STR(On) ) | |
| 367 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unused ) ) | |
| 368 | PORT_DIPSETTING( 0x0040, DEF_STR(Off) ) | |
| 369 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 370 | PORT_DIPNAME( 0x0080, 0x0000, "Host Monitor Mode") | |
| 371 | PORT_DIPSETTING( 0x0000, DEF_STR(Off) ) | |
| 372 | PORT_DIPSETTING( 0x0080, DEF_STR(On) ) | |
| 373 | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_START1) | |
| 374 | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 375 | PORT_SERVICE(0x0400, IP_ACTIVE_LOW) | |
| 376 | ||
| 377 | /* C and D ports */ | |
| 378 | PORT_START("IN1") | |
| 379 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 249 | PORT_START("INPUTS_C_D") | |
| 380 | 250 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 251 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 381 | 252 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN3 ) |
| 382 | 253 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 383 | 254 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 384 | 255 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 385 | 256 | |
| 386 | /* Analogue Inputs? */ | |
| 257 | /* Analog Inputs... */ | |
| 258 | INPUT_PORTS_END | |
| 387 | 259 | |
| 388 | PORT_START("VGB") | |
| 389 | PORT_DIPNAME( 0x0008, 0x0008, "VGB Monitor Mode") | |
| 390 | PORT_DIPSETTING( 0x0008, DEF_STR(Off) ) | |
| 391 | PORT_DIPSETTING( 0x0000, DEF_STR(On) ) | |
| 260 | static INPUT_PORTS_START( botss ) | |
| 261 | PORT_INCLUDE(f15se) | |
| 262 | PORT_MODIFY("INPUTS_A_B") | |
| 263 | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) | |
| 264 | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) | |
| 265 | PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) | |
| 266 | PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) | |
| 392 | 267 | |
| 393 | /* Sound PCB test button */ | |
| 394 | PORT_START("SOUND") | |
| 395 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Sound PCB Test") PORT_CODE(KEYCODE_F1) | |
| 268 | PORT_MODIFY("INPUTS_C_D") | |
| 269 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 270 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 271 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) | |
| 272 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) | |
| 396 | 273 | INPUT_PORTS_END |
| 397 | 274 | |
| 275 | static INPUT_PORTS_START( stankatk ) | |
| 276 | PORT_INCLUDE(f15se) | |
| 277 | PORT_MODIFY("INPUTS_A_B") | |
| 278 | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 279 | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 280 | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) | |
| 281 | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) | |
| 282 | PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) | |
| 398 | 283 | |
| 399 | static void tms_interrupt(const device_config *device, int state) | |
| 400 | { | |
| 401 | m68901_int_gen(device->machine, GPIP4); | |
| 402 | } | |
| 284 | PORT_MODIFY("INPUTS_C_D") | |
| 285 | PORT_BIT( 0xf8ff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 286 | // PORT_BITX( 0x0800, IP_ACTIVE_LOW, 0, "Unk2", KEYCODE_S, IP_JOY_NONE ) | |
| 403 | 287 | |
| 404 | static INTERRUPT_GEN( micro3d_vblank ) | |
| 405 | { | |
| 406 | m68901_int_gen(device->machine, GPIP7); | |
| 407 | } | |
| 288 | // PORT_BITX( 0x0010, IP_ACTIVE_LOW, 0, "Yellow Upper Right", KEYCODE_Y, IP_JOY_NONE ) | |
| 289 | // PORT_BITX( 0x0020, IP_ACTIVE_LOW, 0, "Yellow Lower Right", KEYCODE_X, IP_JOY_NONE ) | |
| 290 | // PORT_BITX( 0x0040, IP_ACTIVE_LOW, 0, "Unk2", KEYCODE_R, IP_JOY_NONE ) | |
| 291 | // PORT_BITX( 0x0080, IP_ACTIVE_LOW, 0, "Unkn3", KEYCODE_T, IP_JOY_NONE ) | |
| 408 | 292 | |
| 293 | // PORT_BITX( 0x0001, IP_ACTIVE_HIGH, 0, "Blue Top Right", KEYCODE_Z, IP_JOY_NONE ) // ?? | |
| 294 | // PORT_BITX( 0x0002, IP_ACTIVE_HIGH, 0, "Blue Top Right", KEYCODE_Z, IP_JOY_NONE ) | |
| 295 | // PORT_BITX( 0x0004, IP_ACTIVE_LOW, 0, "Blue Top Right", KEYCODE_D, IP_JOY_NONE ) | |
| 296 | // PORT_BITX( 0x0008, IP_ACTIVE_HIGH, 0, "Blue Top Right", KEYCODE_Z, IP_JOY_NONE ) | |
| 409 | 297 | |
| 410 | /* 68901 related gubbins. Re-write me please */ | |
| 298 | // PORT_BITX( 0x1000, IP_ACTIVE_LOW, 0, "Unk2", KEYCODE_I,Y IP_JOY_NONE ) | |
| 299 | // PORT_BITX( 0x2000, IP_ACTIVE_LOW, 0, "Blue Trigger", KEYCODE_H, IP_JOY_NONE ) | |
| 300 | // PORT_BITX( 0x4000, IP_ACTIVE_LOW, 0, "Unkn3", KEYCODE_J, IP_JOY_NONE ) | |
| 301 | // PORT_BITX( 0x8000, IP_ACTIVE_LOW, 0, "Yellow Trigger", KEYCODE_G, IP_JOY_NONE ) | |
| 302 | INPUT_PORTS_END | |
| 411 | 303 | |
| 412 | static TIMER_CALLBACK( timera_int ) | |
| 413 | { | |
| 414 | // timer_set(machine, attotime_mul(ATTOTIME_IN_HZ(M68901_CLK), ((m68901_base[0xf]>>8) & 0xff) * 200),0,timera_int); // Set the timer again. | |
| 415 | timer_set(machine, ATTOTIME_IN_USEC(1000), NULL,0,timera_int); // Set the timer again. | |
| 416 | m68901_int_gen(machine, TMRA); // Fire an interrupt. | |
| 417 | } | |
| 418 | 304 | |
| 419 | #ifdef UNUSED_FUNCTION | |
| 420 | static TIMER_CALLBACK( timerb_int ) | |
| 421 | { | |
| 422 | timer_set(machine, attotime_mul(ATTOTIME_IN_HZ(M68901_CLK), ((m68901_base[0x10]>>8) & 0xff) * 200),0,timera_int); | |
| 423 | m68901_int_gen(machine, TMRB); // Fire an interrupt. | |
| 424 | } | |
| 305 | /************************************* | |
| 306 | * | |
| 307 | * Worst 68901 Implementation Ever | |
| 308 | * | |
| 309 | *************************************/ | |
| 425 | 310 | |
| 426 | static TIMER_CALLBACK( timer | |
| 311 | static TIMER_CALLBACK( timera_int ) | |
| 427 | 312 | { |
| 428 | timer_set(machine, attotime_mul(ATTOTIME_IN_HZ(M68901_CLK), ((m68901_base[0x11]>>8) & 0xff) * 200),0,timera_int); | |
| 429 | m68901_int_gen(machine, TMRC); // Fire an interrupt. | |
| 313 | timer_set(machine, ATTOTIME_IN_USEC(1000), NULL,0,timera_int); | |
| 314 | m68901_int_gen(machine, TMRA); | |
| 430 | 315 | } |
| 431 | #endif | |
| 432 | 316 | |
| 433 | 317 | static TIMER_CALLBACK( timerd_int ) |
| 434 | 318 | { |
| 435 | timer_set(machine, ATTOTIME_IN_USEC(250), NULL,0,timerd_int); | |
| 436 | m68901_int_gen(machine, TMRD); // Fire an interrupt. | |
| 319 | timer_set(machine, ATTOTIME_IN_USEC(250), NULL,0,timerd_int); | |
| 320 | m68901_int_gen(machine, TMRD); // Fire an interrupt. | |
| 437 | 321 | } |
| 438 | 322 | |
| 439 | ||
| 440 | /* Called by anything that generates a MFD interrupt */ | |
| 441 | /* Requires: MFD line number */ | |
| 442 | ||
| 443 | 323 | static void m68901_int_gen(running_machine *machine, int source) |
| 444 | 324 | { |
| 445 | // logerror("M68901 interrupt %d requested.\n",source); | |
| 325 | /* WTF is all this... */ | |
| 326 | int IEN_REG=3+(int)(source / 8); | |
| 327 | int IPEND_REG=5+(int)(source / 8); // Makes things a little clearer. | |
| 328 | int IMASK_REG=9+(int)(source / 8); | |
| 329 | int bit = 1 << (source - 8*(int)(source / 8)); | |
| 446 | 330 | |
| 447 | int IEN_REG=3+(int)(source / 8); | |
| 448 | int IPEND_REG=5+(int)(source / 8); // Makes things a little clearer. | |
| 449 | int IMASK_REG=9+(int)(source / 8); | |
| 450 | int bit=1 << (source-8*(int)(source/8)); | |
| 331 | if (m68901_base[IEN_REG] & (bit << 8)) // If interrupt is enabled by MFD, set interrupt pending bit. | |
| 332 | { | |
| 333 | m68901_base[IPEND_REG] = m68901_base[IPEND_REG] | (bit<<8); | |
| 334 | // logerror("M68901 interrupt %d now pending (%d) \n",source, IPEND_REG); | |
| 335 | } | |
| 451 | 336 | |
| 452 | if(m68901_base[IEN_REG] & (bit<<8)) // If interrupt is enabled by MFD, set interrupt pending bit. | |
| 453 | { | |
| 454 | m68901_base[IPEND_REG] = m68901_base[IPEND_REG] | (bit<<8); | |
| 455 | // logerror("M68901 interrupt %d now pending (%d) \n",source, IPEND_REG); | |
| 456 | } | |
| 457 | ||
| 458 | if(m68901_base[IMASK_REG] & (bit<<8)) // If interrupt is not masked by MFD, trigger a 68k INT | |
| 459 | { | |
| 460 | cpu_set_input_line(machine->cpu[0],4, HOLD_LINE); | |
| 461 | // logerror("M68901 interrupt %d serviced.\n",source); | |
| 462 | } | |
| 337 | if (m68901_base[IMASK_REG] & (bit << 8)) // If interrupt is not masked by MFD, trigger a 68k INT | |
| 338 | { | |
| 339 | cpu_set_input_line(machine->cpu[0], 4, HOLD_LINE); | |
| 340 | // logerror("M68901 interrupt %d serviced.\n",source); | |
| 341 | } | |
| 463 | 342 | } |
| 464 | 343 | |
| 465 | 344 | static WRITE16_HANDLER( m68901_w ) |
| 466 | 345 | { |
| 346 | // UINT8 value = (data >> 8) & 0xff; | |
| 347 | m68901_base[offset] = data; | |
| 467 | 348 | |
| 468 | UINT8 value = (data>>8)& 0xff; | |
| 469 | m68901_base[offset]=data; | |
| 349 | switch (offset) | |
| 350 | { | |
| 351 | case 0x0c: | |
| 352 | case 0x0d: | |
| 353 | case 0x0e: | |
| 354 | break; | |
| 470 | 355 | |
| 471 | switch(offset) | |
| 472 | { | |
| 356 | case 0x0f: | |
| 357 | /* Very dodgy */ | |
| 358 | timer_set(space->machine, ATTOTIME_IN_USEC(1000), NULL, 0, timera_int); | |
| 359 | break; | |
| 473 | 360 | |
| 474 | case 0x0c: mame_printf_debug("Timer A Control: %x\n",value); | |
| 475 | break; | |
| 476 | case 0x0d: mame_printf_debug("Timer B Control: %x\n",value); | |
| 477 | break; | |
| 478 | case 0x0e: mame_printf_debug("Timer C/D Control: %x\n",value); | |
| 479 | break; | |
| 361 | case 0x10: | |
| 362 | case 0x11: | |
| 363 | break; | |
| 480 | 364 | |
| 481 | case 0x0f: mame_printf_debug("Timer A Data:%4x\n",value); // Timer A Data Register | |
| 482 | timer_set(space->machine, ATTOTIME_IN_USEC(1000), NULL,0,timera_int); | |
| 483 | break; | |
| 484 | ||
| 485 | case 0x10: mame_printf_debug("Timer B Data:%4x\n",value); // Timer B Data Register | |
| 486 | // timer_set(space->machine, attotime_mul(ATTOTIME_IN_HZ(M68901_CLK), value * 200),0,timerb_int); | |
| 487 | break; | |
| 488 | ||
| 489 | case 0x11: mame_printf_debug("Timer C Data:%4x\n",value); // Timer C Data Register | |
| 490 | // timer_set(space->machine, attotime_mul(ATTOTIME_IN_HZ(M68901_CLK), value * 200),0,timerc_int); | |
| 491 | break; | |
| 492 | ||
| 493 | case 0x12: mame_printf_debug("Timer D Data:%4x\n",value); | |
| 494 | timer_set(space->machine, ATTOTIME_IN_USEC(500), NULL,0,timerd_int); // Timer D Data Register | |
| 495 | break; | |
| 496 | ||
| 365 | case 0x12: | |
| 366 | /* Aargh! */ | |
| 367 | timer_set(space->machine, ATTOTIME_IN_USEC(500), NULL, 0, timerd_int); | |
| 368 | break; | |
| 369 | } | |
| 497 | 370 | } |
| 498 | 371 | |
| 499 | } | |
| 500 | 372 | |
| 501 | /* I should really re-write all this. */ | |
| 373 | /************************************* | |
| 374 | * | |
| 375 | * SCN2651 | |
| 376 | * | |
| 377 | *************************************/ | |
| 502 | 378 | |
| 503 | static WRITE16_HANDLER( m68681_w ) | |
| 504 | { | |
| 505 | ||
| 506 | UINT8 value = (data>>8)& 0xff; | |
| 507 | ||
| 508 | switch(offset) | |
| 509 | { | |
| 510 | case 0x00: break; // Mode Register A | |
| 511 | ||
| 512 | case 0x01: M68681.CSRA = value; | |
| 513 | break; | |
| 514 | // Clock-select register A | |
| 515 | case 0x02: M68681.CRA = value; | |
| 516 | break; // Command Register A | |
| 517 | ||
| 518 | case 0x03: M68681.TBA = value; // Fill transmit buffer | |
| 519 | M68681.SRA |=0x0400; // Data has been sent - TX ready for more. | |
| 520 | if(M68681.IMR & 1) cpu_set_input_line_and_vector(space->machine->cpu[0],3, HOLD_LINE, M68681.IVR); // Generate an interrupt, if allowed. | |
| 521 | ||
| 522 | #if HOST_MONITOR_DISPLAY | |
| 523 | mame_printf_debug("%c",value); // Port A - Monitor | |
| 524 | #endif | |
| 525 | break; | |
| 526 | ||
| 527 | case 0x04: break; | |
| 528 | ||
| 529 | case 0x05: //mame_printf_debug("IMR=%x\n",M68681.IMR); | |
| 530 | M68681.IMR = value; // Interrupt Mask Reg | |
| 531 | break; | |
| 532 | ||
| 533 | case 0x06: break; | |
| 534 | ||
| 535 | case 0x07: break; | |
| 536 | ||
| 537 | case 0x08: break; | |
| 538 | ||
| 539 | case 0x09: break; | |
| 540 | ||
| 541 | case 0x0a: break; | |
| 542 | ||
| 543 | case 0x0b: M68681.TBB = value; // Fill transmit buffer | |
| 544 | #if 0 | |
| 545 | M68681.SRB |=0x0400; // Data has been sent - TX ready for more. | |
| 546 | // Write to sound board | |
| 547 | if(M68681.IMR & 0x1000) | |
| 548 | { | |
| 549 | cpu_set_input_line_and_vector(space->machine->cpu[0],3, HOLD_LINE, M68681.IVR); // Generate an interrupt, if allowed. | |
| 550 | } | |
| 551 | cpu_set_input_line(space->machine->cpu[2], MCS51_RX_LINE, ASSERT_LINE); // Generate 8031 interrupt | |
| 552 | mame_printf_debug("Sound board TX: %4X at PC=%4X\n",value,cpu_get_pc(space->cpu)); | |
| 553 | #endif | |
| 554 | M68681.SRB &=~0x0400; // Data has been sent - TX ready for more. | |
| 555 | cpu_set_input_line(space->machine->cpu[2], MCS51_RX_LINE, ASSERT_LINE); // Generate 8031 interrupt | |
| 556 | mame_printf_debug("Sound board TX: %4X at PC=%4X\n",value,cpu_get_pc(space->cpu)); | |
| 557 | break; | |
| 558 | ||
| 559 | case 0x0c: //mame_printf_debug("IVR: %d",value); | |
| 560 | M68681.IVR = value; // Interrupt vector register. | |
| 561 | break; | |
| 562 | ||
| 563 | case 0x0d: break; | |
| 564 | case 0x0e: | |
| 565 | set_led_status(1, data&0x80); // Host Health LED | |
| 566 | if(value & 0x20) | |
| 567 | { | |
| 568 | // cpunum_set_reset_line(2 CLEAR_LINE); | |
| 569 | logerror("8031 running at:%x (val=%x).\n",cpu_get_pc(space->cpu),value); | |
| 570 | } | |
| 571 | break; | |
| 572 | ||
| 573 | case 0x0f: set_led_status(1, ~(data&0x80)); // Host Health LED | |
| 574 | if(value & 0x20) | |
| 575 | { | |
| 576 | // cpunum_set_reset_line(2, ASSERT_LINE); | |
| 577 | logerror("8031 reset at:%x (val=%x).\n",cpu_get_pc(space->cpu),value); | |
| 578 | } | |
| 579 | break; | |
| 580 | ||
| 581 | default: m68681_base[offset]=data; | |
| 582 | } | |
| 583 | } | |
| 584 | ||
| 585 | static READ16_HANDLER( m68681_r ) | |
| 586 | { | |
| 587 | ||
| 588 | switch(offset) | |
| 589 | { | |
| 590 | // case 0x00: | |
| 591 | case 0x01: return M68681.SRA; // Status Register A | |
| 592 | // case 0x02: return | |
| 593 | ||
| 594 | case 0x03: M68681.SRA^=0x100; | |
| 595 | return M68681.RBA; // RX A - Monitor Port | |
| 596 | ||
| 597 | case 0x09: return M68681.SRB; // Status Register B | |
| 598 | ||
| 599 | case 0x0b: mame_printf_debug("\nHost received: %x\n",M68681.RBB); | |
| 600 | M68681.SRB^=0x0100; // No longer have data. | |
| 601 | //M68681.SRB &= ~0x0100; // No longer have data. | |
| 602 | return M68681.RBB; | |
| 603 | // RX B - Monitor Port | |
| 604 | } | |
| 605 | ||
| 606 | return 0; | |
| 607 | } | |
| 608 | ||
| 609 | ||
| 610 | 379 | static WRITE16_HANDLER( ti_uart_w ) |
| 611 | 380 | { |
| 612 | // Need to initalise values to 0 on reset. | |
| 613 | switch(offset) | |
| 614 | { | |
| 615 | case 0x0: ti_uart[TX] = data; // Pointless really - nothing happens to it. | |
| 381 | // Need to initalise values to 0 on reset. | |
| 382 | switch (offset) | |
| 383 | { | |
| 384 | case 0x0: | |
| 385 | { | |
| 386 | ti_uart[TX] = data; | |
| 616 | 387 | #if VGB_MONITOR_DISPLAY |
| 617 | mame_printf_debug("%c",data); | |
| 618 | ||
| 388 | mame_printf_debug("%c",data); | |
| 619 | 389 | #endif |
| 620 | ti_uart[STATUS]|=1; // Transmit regiser empty. | |
| 621 | break; | |
| 622 | ||
| 623 | case 0x1: if(!ti_uart_mode_cycle) | |
| 624 | { | |
| 625 | ti_uart[MODE1] = data; | |
| 626 | ti_uart_mode_cycle=1; | |
| 627 | } | |
| 628 | else | |
| 629 | { | |
| 630 | ti_uart[MODE2] = data; | |
| 631 | ti_uart_mode_cycle=0; | |
| 632 | } | |
| 633 | break; | |
| 634 | ||
| 635 | case 0x2: if(ti_uart_sync_cycle==0) | |
| 636 | { | |
| 637 | ti_uart[SYN1] = data; | |
| 638 | ti_uart_mode_cycle=1; | |
| 639 | } | |
| 640 | else if(ti_uart_sync_cycle==1) | |
| 641 | { | |
| 642 | ti_uart[SYN2] = data; | |
| 643 | ti_uart_mode_cycle=2; | |
| 644 | } | |
| 645 | else | |
| 646 | { | |
| 647 | ti_uart[DLE] = data; | |
| 648 | ti_uart_mode_cycle=0; | |
| 649 | } | |
| 650 | break; | |
| 651 | ||
| 652 | case 0x3: ti_uart[COMMAND] = data; | |
| 653 | ti_uart_mode_cycle = ti_uart_sync_cycle=0; | |
| 654 | break; | |
| 390 | ti_uart[STATUS] |= 1; | |
| 391 | break; | |
| 392 | } | |
| 393 | case 0x1: | |
| 394 | { | |
| 395 | if (ti_uart_mode_cycle == 0) | |
| 396 | { | |
| 397 | ti_uart[MODE1] = data; | |
| 398 | ti_uart_mode_cycle = 1; | |
| 399 | } | |
| 400 | else | |
| 401 | { | |
| 402 | ti_uart[MODE2] = data; | |
| 403 | ti_uart_mode_cycle = 0; | |
| 404 | } | |
| 405 | break; | |
| 406 | } | |
| 407 | case 0x2: | |
| 408 | { | |
| 409 | if (ti_uart_sync_cycle == 0) | |
| 410 | { | |
| 411 | ti_uart[SYN1] = data; | |
| 412 | ti_uart_mode_cycle = 1; | |
| 413 | } | |
| 414 | else if (ti_uart_sync_cycle == 1) | |
| 415 | { | |
| 416 | ti_uart[SYN2] = data; | |
| 417 | ti_uart_mode_cycle = 2; | |
| 418 | } | |
| 419 | else | |
| 420 | { | |
| 421 | ti_uart[DLE] = data; | |
| 422 | ti_uart_mode_cycle = 0; | |
| 423 | } | |
| 424 | break; | |
| 425 | } | |
| 426 | case 0x3: | |
| 427 | { | |
| 428 | ti_uart[COMMAND] = data; | |
| 429 | ti_uart_mode_cycle = ti_uart_sync_cycle = 0; | |
| 430 | break; | |
| 431 | } | |
| 432 | } | |
| 655 | 433 | } |
| 656 | 434 | |
| 657 | } | |
| 658 | ||
| 659 | ||
| 660 | 435 | static READ16_HANDLER( ti_uart_r ) |
| 661 | 436 | { |
| 662 | ||
| 663 | switch(offset) | |
| 664 | { | |
| 665 | case 0x0: ti_uart[STATUS]^=2; | |
| 666 | return ti_uart[RX]; | |
| 667 | ||
| 668 | case 0x1: if(!ti_uart_mode_cycle) | |
| 669 | { | |
| 670 | ti_uart_mode_cycle=1; | |
| 671 | return ti_uart[MODE1]; | |
| 672 | } | |
| 673 | else | |
| 674 | { | |
| 675 | ti_uart_mode_cycle=0; | |
| 676 | return ti_uart[MODE2]; | |
| 677 | } | |
| 678 | case 0x2: return ti_uart[STATUS]; | |
| 679 | ||
| 680 | case 0x3: ti_uart_mode_cycle = ti_uart_sync_cycle=0; | |
| 681 | return ti_uart[COMMAND]; | |
| 682 | ||
| 683 | default: logerror("Unknown TI UART access.\n"); | |
| 684 | return 0; | |
| 437 | switch (offset) | |
| 438 | { | |
| 439 | case 0x0: | |
| 440 | { | |
| 441 | ti_uart[STATUS] ^= 2; | |
| 442 | return ti_uart[RX]; | |
| 443 | } | |
| 444 | case 0x1: | |
| 445 | { | |
| 446 | if (ti_uart_mode_cycle == 0) | |
| 447 | { | |
| 448 | ti_uart_mode_cycle = 1; | |
| 449 | return ti_uart[MODE1]; | |
| 450 | } | |
| 451 | else | |
| 452 | { | |
| 453 | ti_uart_mode_cycle = 0; | |
| 454 | return ti_uart[MODE2]; | |
| 455 | } | |
| 456 | } | |
| 457 | case 0x2: | |
| 458 | { | |
| 459 | return ti_uart[STATUS]; | |
| 460 | } | |
| 461 | case 0x3: | |
| 462 | { | |
| 463 | ti_uart_mode_cycle = ti_uart_sync_cycle = 0; | |
| 464 | return ti_uart[COMMAND]; | |
| 465 | } | |
| 466 | default: | |
| 467 | { | |
| 468 | logerror("Unknown TI UART access.\n"); | |
| 469 | return 0; | |
| 470 | } | |
| 471 | } | |
| 685 | 472 | } |
| 686 | 473 | |
| 687 | } | |
| 688 | 474 | |
| 689 | #ifdef UNUSED_FUNCTION | |
| 690 | static WRITE32_HANDLER( am_uart_w ) | |
| 475 | /************************************* | |
| 476 | * | |
| 477 | * TMS34010 Host Interface | |
| 478 | * | |
| 479 | *************************************/ | |
| 480 | ||
| 481 | static READ16_HANDLER( tms_host_r ) | |
| 691 | 482 | { |
| 692 | | |
| 483 | return t | |
| 693 | 484 | } |
| 694 | 485 | |
| 695 | static RE | |
| 486 | static WRITE16 | |
| 696 | 487 | { |
| 697 | ||
| 488 | | |
| 698 | 489 | } |
| 699 | 490 | |
| 700 | 491 | |
| 701 | static WRITE16_HANDLER( mystery_w ) | |
| 702 | { | |
| 703 | popmessage("Write to 900000: %x",data); | |
| 704 | } | |
| 492 | /************************************* | |
| 493 | * | |
| 494 | * Sound | |
| 495 | * | |
| 496 | *************************************/ | |
| 705 | 497 | |
| 706 | static WRITE16_HANDLER( mystery2_w ) | |
| 707 | { | |
| 708 | popmessage("TMS Write to e00000: %x",data); | |
| 709 | } | |
| 498 | /*************************************************************************** | |
| 710 | 499 | |
| 711 | static WRITE16_HANDLER( mystery3_w ) | |
| 712 | { | |
| 713 | popmessage("TMS Write to 2600000: %x",data); | |
| 714 | } | |
| 715 | #endif | |
| 500 | 8031 port mappings: | |
| 716 | 501 | |
| 502 | Port 1 Port 2 | |
| 503 | ======= ====== | |
| 504 | 0: S/H sel A (O) 0: | |
| 505 | 1: S/H sel B (O) 1: | |
| 506 | 2: S/H sel C (O) 2: uPD bank select (O) | |
| 507 | 3: S/H en (O) 3: /uPD busy (I) | |
| 508 | 4: DS1267 data (O) 4: /uPD reset (O) | |
| 509 | 5: DS1267 clock (O) 5: Watchdog reset (O) | |
| 510 | 6: /DS1267 reset (O) 6: | |
| 511 | 7: Test SW (I) 7: | |
| 717 | 512 | |
| 718 | static READ16_HANDLER( tms_host_r ) | |
| 513 | ***************************************************************************/ | |
| 514 | ||
| 515 | static WRITE8_HANDLER( sound_io_w ) | |
| 719 | 516 | { |
| 720 | return tms34010_host_r(space->machine->cpu[1], offset); | |
| 517 | sound_port_latch[offset] = data; | |
| 518 | ||
| 519 | switch (offset) | |
| 520 | { | |
| 521 | case 0x01: | |
| 522 | { | |
| 523 | break; | |
| 524 | } | |
| 525 | case 0x03: | |
| 526 | { | |
| 527 | upd7759_set_bank_base(0, (data & 0x4) ? 0x20000 : 0); | |
| 528 | upd7759_0_reset_w(space, 0, (data & 0x10) ? 0 : 1); | |
| 529 | break; | |
| 530 | } | |
| 531 | } | |
| 721 | 532 | } |
| 722 | 533 | |
| 723 | static | |
| 534 | static | |
| 724 | 535 | { |
| 725 | tms34010_host_w(space->machine->cpu[1], offset, data); | |
| 536 | switch (offset) | |
| 537 | { | |
| 538 | case 0x01: return (sound_port_latch[offset] & 0x7f) | input_port_read_safe(space->machine, "SOUND_SW", 0); | |
| 539 | case 0x03: return (sound_port_latch[offset] & 0xf7) | (upd7759_0_busy_r(space, 0) ? 0x08 : 0); | |
| 540 | default: return 0; | |
| 541 | } | |
| 726 | 542 | } |
| 727 | 543 | |
| 728 | #ifdef UNUSED_FUNCTION | |
| 729 | static WRITE16_HANDLER( reset_slave ) | |
| 544 | static WRITE8_HANDLER( upd7759_port_start_w ) | |
| 730 | 545 | { |
| 731 | if(data & 0x0020) | |
| 732 | { | |
| 733 | // cpu_set_input_line(1, CLEAR_LINE); | |
| 734 | logerror("TMS Running\n"); | |
| 735 | } | |
| 736 | else | |
| 737 | { | |
| 738 | // cpu_set_input_line(1, ASSERT_LINE); | |
| 739 | logerror("TMS Reset\n"); | |
| 740 | } | |
| 546 | upd7759_0_port_w(space, offset, data); | |
| 547 | upd7759_0_start_w(space, offset, 0); | |
| 548 | upd7759_0_start_w(space, offset, 1); | |
| 741 | 549 | } |
| 742 | #endif | |
| 743 | 550 | |
| 744 | 551 | |
| 552 | /************************************* | |
| 553 | * | |
| 554 | * Memory Maps | |
| 555 | * | |
| 556 | *************************************/ | |
| 745 | 557 | |
| 746 | /* The DS1215 phantom timer IC is mapped to the lower 32kB SRAM address space */ | |
| 747 | /* Serial Read/write operations are conducted via the 0th data bit */ | |
| 748 | ||
| 749 | /* Reset peripherals flip-flop MIGHT be 900000 */ | |
| 750 | ||
| 751 | 558 | static ADDRESS_MAP_START( hostmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 752 | AM_RANGE(0x000000, 0x13ffff) AM_ROM | |
| 559 | AM_RANGE(0x000000, 0x13ffff) AM_ROM | |
| 753 | 560 | AM_RANGE(0x200000, 0x20ffff) AM_RAM /* Battery-backed SRAM (64kB) & DS1215 */ |
| 754 | 561 | AM_RANGE(0x800000, 0x83ffff) AM_RAM /* 68000/AM29000 shared RAM (256kB) */ |
| 755 | AM_RANGE(0x900000, 0x900001) AM_NOP //WRITE(mystery_w) /* ??????? 16-bit write here. rset? */ | |
| 756 | AM_RANGE(0x920000, 0x920001) AM_READ_PORT("IN1") /* User inputs C and D */ | |
| 757 | AM_RANGE(0x940000, 0x940001) AM_READ_PORT("IN0") /* User inputs A and B */ | |
| 562 | AM_RANGE(0x900000, 0x900001) AM_NOP /* ??????? 16-bit write here. rset? */ | |
| 563 | AM_RANGE(0x920000, 0x920001) AM_READ_PORT("INPUTS_C_D") | |
| 564 | AM_RANGE(0x940000, 0x940001) AM_READ_PORT("INPUTS_A_B") | |
| 758 | 565 | AM_RANGE(0x960000, 0x960001) AM_NOP /* Lamps */ |
| 759 | 566 | AM_RANGE(0x980000, 0x980001) AM_RAM /* ADC0844 */ |
| 760 | AM_RANGE(0x9a0000, 0x9a0007) AM_READWRITE(tms_host_r, tms_host_w) /* TMS34010 Interface */ | |
| 761 | AM_RANGE(0x9c0000, 0x9c0001) AM_RAM /* ????? Write: 80, A0 and 00 (8-bit high byte) */ | |
| 762 | AM_RANGE(0x9e0000, 0x9e00cf) AM_RAM_WRITE(m68901_w) AM_BASE(&m68901_base) /* 68901 Multifunction Peripheral */ | |
| 763 | AM_RANGE(0xa00000, 0xa000cf) AM_READWRITE(m68681_r, m68681_w) AM_BASE(&m68681_base) /* 68681 UART */ | |
| 567 | AM_RANGE(0x9a0000, 0x9a0007) AM_READWRITE(tms_host_r, tms_host_w) | |
| 568 | AM_RANGE(0x9c0000, 0x9c0001) AM_NOP /* ????? Write: 80, A0 and 00 (8-bit high byte) */ | |
| 569 | AM_RANGE(0x9e0000, 0x9e00cf) AM_RAM_WRITE(m68901_w) AM_BASE(&m68901_base) | |
| 570 | AM_RANGE(0xa00000, 0xa0003f) AM_DEVREADWRITE8(DUART68681, "duart68681", duart68681_r, duart68681_w, 0xff00) | |
| 764 | 571 | AM_RANGE(0xa20000, 0xa20001) AM_RAM /* XY joystick input - sign? */ |
| 765 | 572 | AM_RANGE(0xa40002, 0xa40003) AM_RAM /* XY joystick input - actual values */ |
| 766 | 573 | ADDRESS_MAP_END |
| 767 | 574 | |
| 768 | 575 | |
| 769 | // 2600000: Write 1E and 9E? | |
| 770 | 576 | static ADDRESS_MAP_START( vgbmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 771 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_BASE(µ3d_sprite_vram) /* 2 Banks */ | |
| 772 | AM_RANGE(0x00800000, 0x00bfffff) AM_RAM /* 512kB Main DRAM */ | |
| 773 | AM_RANGE(0x00c00000, 0x00c0000f) AM_READ_PORT("VGB") /* TI Monitor Mode switch */ | |
| 774 | AM_RANGE(0x00e00000, 0x00e0000f) AM_RAM //WRITE(mystery2_w) /* CREGCLK ??? byte write here. */ | |
| 775 | AM_RANGE(0x02000000, 0x0200ffff) AM_RAM_WRITE(paletteram16_BBBBBRRRRRGGGGGG_word_w) AM_BASE(&paletteram16) // AM_RANGE(0x02010000, 0x027fffff) AM_RAM /* ??????????? Mirror of VRAM??? */ | |
| 776 | AM_RANGE(0x02600000, 0x0260000f) AM_RAM /* XFER3dk???? 16-bit write */ | |
| 777 | AM_RANGE(0x02c00000, 0x02c0003f) AM_READ(ti_uart_r) /* SCN UART */ | |
| 577 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_BASE(µ3d_sprite_vram) | |
| 578 | AM_RANGE(0x00800000, 0x00bfffff) AM_RAM | |
| 579 | AM_RANGE(0x00c00000, 0x00c0000f) AM_READ_PORT("VGB_SW") | |
| 580 | AM_RANGE(0x00e00000, 0x00e0000f) AM_NOP /* XFER3dk???? 16-bit write */ | |
| 581 | AM_RANGE(0x02000000, 0x0200ffff) AM_RAM_WRITE(paletteram_w) AM_BASE(&paletteram16) | |
| 582 | AM_RANGE(0x02600000, 0x0260000f) AM_WRITE(creg_w) | |
| 583 | AM_RANGE(0x02c00000, 0x02c0003f) AM_READ(ti_uart_r) | |
| 778 | 584 | AM_RANGE(0x02e00000, 0x02e0003f) AM_WRITE(ti_uart_w) |
| 779 | AM_RANGE(0x03800000, 0x03dfffff) AM_ROM AM_REGION("gfx1", 0) /* 2D Graphics ROMs */ | |
| 780 | AM_RANGE(0x03e00000, 0x03ffffff) AM_ROM AM_REGION("user1", 0) /* 128kB Program ROM */ | |
| 585 | AM_RANGE(0x03800000, 0x03dfffff) AM_ROM AM_REGION("tms_gfx", 0) | |
| 586 | AM_RANGE(0x03e00000, 0x03ffffff) AM_ROM AM_REGION("tms34010", 0) | |
| 781 | 587 | AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE(tms34010_io_register_r, tms34010_io_register_w) |
| 782 | AM_RANGE(0xffe00000, 0xffffffff) AM_ROM AM_REGION(" | |
| 588 | AM_RANGE(0xffe00000, 0xffffffff) AM_ROM AM_REGION("tms34010", 0) | |
| 783 | 589 | ADDRESS_MAP_END |
| 784 | 590 | |
| 785 | 591 | |
| 786 | /*====================================================================*/ | |
| 787 | /* The 8031 ports are mapped as follows: */ | |
| 788 | /* */ | |
| 789 | /* P1.0 = SHMUX-A O P3.0 */ | |
| 790 | /* P1.1 = SHMUX-B O P3.1 */ | |
| 791 | /* P1.2 = SHMUX-C O P3.2 = SPCHBANK O */ | |
| 792 | /* P1.3 = SHMUX-E O P3.3 = SP-BUSY- I */ | |
| 793 | /* P1.4 = VOLDQ O P3.4 = RESET O */ | |
| 794 | /* P1.5 = VOLCK O P3.5 = WDO O */ | |
| 795 | /* P1.6 = VOLRST O P3.6 */ | |
| 796 | /* P1.7 = SELFTEST I P3.7 */ | |
| 797 | /*====================================================================*/ | |
| 798 | ||
| 799 | static UINT8 port_latch[4]; | |
| 800 | static WRITE8_HANDLER(sound_io_w) | |
| 801 | { | |
| 802 | port_latch[offset] = data; | |
| 803 | switch(offset) | |
| 804 | { | |
| 805 | case 0x01: | |
| 806 | break; | |
| 807 | case 0x03: | |
| 808 | upd7759_set_bank_base(0, (data & 0x4) ? 0x20000 : 0); | |
| 809 | upd7759_0_reset_w(space,0,(data & 0x10) ? 0 : 1); | |
| 810 | } | |
| 811 | } | |
| 812 | ||
| 813 | static READ8_HANDLER(sound_io_r) | |
| 814 | { | |
| 815 | switch(offset) | |
| 816 | { | |
| 817 | case 0x01: return (port_latch[offset] & 0x7f) | input_port_read_safe(space->machine, "SOUND", 0); /* Test push switch */ | |
| 818 | case 0x03: return (port_latch[offset] & 0xf7) | (upd7759_0_busy_r(space,0) ? 0x08 : 0); | |
| 819 | default: return 0; | |
| 820 | } | |
| 821 | ||
| 822 | } | |
| 823 | ||
| 824 | static WRITE8_HANDLER( upd7759_port_start_w) | |
| 825 | { | |
| 826 | upd7759_0_start_w(space, offset, 0); | |
| 827 | upd7759_0_port_w(space, offset, data); | |
| 828 | upd7759_0_start_w(space, offset, 1); | |
| 829 | } | |
| 830 | ||
| 831 | 592 | static ADDRESS_MAP_START( soundmem_prg, ADDRESS_SPACE_PROGRAM, 8 ) |
| 832 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 593 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 833 | 594 | ADDRESS_MAP_END |
| 834 | 595 | |
| 835 | ||
| 836 | /* FFXX - 00XX */ | |
| 837 | ||
| 838 | 596 | static ADDRESS_MAP_START( soundmem_io, ADDRESS_SPACE_IO, 8 ) |
| 839 | AM_RANGE(0x0000, 0x07ff) AM_RAM | |
| 597 | AM_RANGE(0x0000, 0x07ff) AM_RAM | |
| 840 | 598 | AM_RANGE(0xfd00, 0xfd00) AM_WRITE(ym2151_register_port_0_w) |
| 841 | 599 | AM_RANGE(0xfd01, 0xfd01) AM_READWRITE(ym2151_status_port_0_r,ym2151_data_port_0_w) |
| 842 | 600 | AM_RANGE(0xfe00, 0xfe00) AM_WRITE(upd7759_port_start_w) |
| 843 | AM_RANGE(0xff00, 0xff00) AM_WRITE(dac_0_data_w) /* DAC A - used for S&H, special effects? */ | |
| 844 | AM_RANGE(0xff01, 0xff01) AM_WRITE(dac_1_data_w) /* DAC B - 'SPEECH' */ | |
| 845 | /* ports */ | |
| 601 | AM_RANGE(0xff00, 0xff00) AM_NOP /* DAC A */ | |
| 602 | AM_RANGE(0xff01, 0xff01) AM_NOP /* DAC B */ | |
| 846 | 603 | AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE(sound_io_r,sound_io_w) |
| 847 | 604 | ADDRESS_MAP_END |
| 848 | 605 | |
| 849 | 606 | |
| 607 | /************************************* | |
| 608 | * | |
| 609 | * Device Configuration | |
| 610 | * | |
| 611 | *************************************/ | |
| 612 | ||
| 850 | 613 | static const tms34010_config vgb_config = |
| 851 | 614 | { |
| 852 | FALSE, /* halt on reset | |
| 615 | FALSE, /* halt on reset | |
| 853 | 616 | "main", /* the screen operated on */ |
| 854 | 40 | |
| 617 | XTAL_40MHz | |
| 855 | 618 | 4, /* pixels per clock */ |
| 856 | 619 | micro3d_scanline_update, /* scanline updater */ |
| 857 | 620 | tms_interrupt, /* Generate interrupt */ |
| r4184 | r4185 | |
| 859 | 622 | NULL |
| 860 | 623 | }; |
| 861 | 624 | |
| 625 | static const duart68681_config micro3d_duart68681_config = | |
| 626 | { | |
| 627 | duart_irq_handler, | |
| 628 | duart_tx, | |
| 629 | duart_input_r, | |
| 630 | duart_output_w | |
| 631 | }; | |
| 862 | 632 | |
| 633 | ||
| 634 | /************************************* | |
| 635 | * | |
| 636 | * Machine drivers | |
| 637 | * | |
| 638 | *************************************/ | |
| 639 | ||
| 640 | static MACHINE_RESET( micro3d ) | |
| 641 | { | |
| 642 | /* TODO: Check. Also do this for the other CPUs? */ | |
| 643 | // cpu_set_input_line(machine->cpu[2], INPUT_LINE_RESET, ASSERT_LINE); | |
| 644 | ||
| 645 | creg = 0; | |
| 646 | ti_uart[STATUS] = 1; | |
| 647 | } | |
| 648 | ||
| 863 | 649 | static MACHINE_DRIVER_START( micro3d ) |
| 864 | MDRV_CPU_ADD("main", M68000, 12000000 ) | |
| 865 | MDRV_CPU_PROGRAM_MAP(hostmem,0) | |
| 650 | MDRV_CPU_ADD("main", M68000, XTAL_32MHz / 2) | |
| 651 | MDRV_CPU_PROGRAM_MAP(hostmem, 0) | |
| 866 | 652 | MDRV_CPU_VBLANK_INT("main", micro3d_vblank) |
| 867 | 653 | |
| 868 | MDRV_CPU_ADD("vgb", TMS34010, 40 | |
| 654 | MDRV_CPU_ADD("vgb", TMS34010, XTAL_40MHz | |
| 869 | 655 | MDRV_CPU_CONFIG(vgb_config) |
| 870 | MDRV_CPU_PROGRAM_MAP(vgbmem,0) | |
| 656 | MDRV_CPU_PROGRAM_MAP(vgbmem, 0) | |
| 871 | 657 | |
| 872 | MDRV_CPU_ADD("audio", I8051, 11059000) | |
| 873 | MDRV_CPU_PROGRAM_MAP(soundmem_prg,0) | |
| 874 | MDRV_CPU_IO_MAP(soundmem_io,0) | |
| 658 | MDRV_CPU_ADD("audio", I8051, XTAL_11_0592MHz) | |
| 659 | MDRV_CPU_PROGRAM_MAP(soundmem_prg, 0) | |
| 660 | MDRV_CPU_IO_MAP(soundmem_io, 0) | |
| 875 | 661 | |
| 662 | MDRV_DUART68681_ADD("duart68681", XTAL_3_6864MHz, micro3d_duart68681_config) | |
| 663 | ||
| 876 | 664 | MDRV_MACHINE_RESET(micro3d) |
| 877 | 665 | MDRV_QUANTUM_TIME(HZ(3000)) |
| 878 | 666 | |
| 879 | MDRV_PALETTE_LENGTH( | |
| 667 | MDRV_PALETTE_LENGTH(4096 | |
| 880 | 668 | |
| 881 | 669 | MDRV_SCREEN_ADD("main", RASTER) |
| 882 | 670 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 883 | MDRV_SCREEN_RAW_PARAMS(40 | |
| 671 | MDRV_SCREEN_RAW_PARAMS(XTAL_40MHz | |
| 884 | 672 | |
| 885 | 673 | MDRV_VIDEO_UPDATE(tms340x0) |
| 886 | 674 | |
| 887 | 675 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 888 | 676 | |
| 889 | MDRV_SOUND_ADD("upd | |
| 677 | MDRV_SOUND_ADD("upd | |
| 890 | 678 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50) |
| 891 | 679 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50) |
| 892 | 680 | |
| 893 | MDRV_SOUND_ADD("ym", YM2151, 3579545) | |
| 681 | MDRV_SOUND_ADD("ym2151", YM2151, XTAL_3_579545MHz) | |
| 894 | 682 | MDRV_SOUND_ROUTE(0, "left", 1.0) |
| 895 | 683 | MDRV_SOUND_ROUTE(1, "right", 1.0) |
| 684 | MACHINE_DRIVER_END | |
| 896 | 685 | |
| 897 | MDRV_SOUND_ADD("dac1", DAC, 0) | |
| 898 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.0) /* muted - I don't think it's directly used */ | |
| 899 | 686 | |
| 900 | MDRV_SOUND_ADD("dac2", DAC, 0) | |
| 901 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.15) | |
| 902 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.15) | |
| 903 | MACHINE_DRIVER_END | |
| 687 | /************************************* | |
| 688 | * | |
| 689 | * Driver Initialisation | |
| 690 | * | |
| 691 | *************************************/ | |
| 904 | 692 | |
| 693 | static DRIVER_INIT( micro3d ) | |
| 694 | { | |
| 695 | i8051_set_serial_tx_callback(machine->cpu[2], data_from_i8031); | |
| 696 | i8051_set_serial_rx_callback(machine->cpu[2], data_to_i8031); | |
| 905 | 697 | |
| 906 | ROM_START( botss ) | |
| 907 | /* HOST PCB (MPG DW-00011C-0011-02) */ | |
| 908 | ROM_REGION( 0x140000, "main", 0 ) /* 68000 Code */ | |
| 909 | ROM_LOAD16_BYTE( "300hst.67", 0x000001, 0x20000, CRC(7f74362a) SHA1(41611ba8e6eb5d6b3dfe88e1cede7d9fb5472e40) ) // rev 1.1 | |
| 910 | ROM_LOAD16_BYTE( "301hst.91", 0x000000, 0x20000, CRC(a8100d1e) SHA1(69d3cac6f67563c0796560f7b874d7660720027d) ) // rev 1.1 | |
| 911 | ROM_LOAD16_BYTE( "302hst.68", 0x040001, 0x20000, CRC(af865ee4) SHA1(f00bce49401431bc749208399329d9f92457186b) ) // rev 1.1 | |
| 912 | ROM_LOAD16_BYTE( "303hst.92", 0x040000, 0x20000, CRC(15182619) SHA1(e95dcce11c0651c8e85fc0c658029f48eea35fb8) ) // rev 1.1 | |
| 913 | ROM_LOAD16_BYTE( "104hst.69", 0x080001, 0x20000, CRC(72a607ca) SHA1(1afc85380be12c429808c48f1502736a4c8b98e5) ) | |
| 914 | ROM_LOAD16_BYTE( "105hst.93", 0x080000, 0x20000, CRC(f37680ae) SHA1(51f1ee805b7d1b2b078c612c572e12846de623b9) ) | |
| 915 | ROM_LOAD16_BYTE( "106hst.70", 0x0c0001, 0x20000, CRC(57a1c728) SHA1(2bdc831be739ada0f4f4adec7974da453878db0e) ) | |
| 916 | ROM_LOAD16_BYTE( "107hst.94", 0x0c0000, 0x20000, CRC(4c9e16af) SHA1(1f8acc9bb85fe1bf459b4358b9bf9cf9847e6a36) ) | |
| 917 | ROM_LOAD16_BYTE( "108hst.71", 0x100001, 0x20000, CRC(cfc0333e) SHA1(9f290769129a61189870faef45c3f061eb7b5c07) ) | |
| 918 | ROM_LOAD16_BYTE( "109hst.95", 0x100000, 0x20000, CRC(6c595d1e) SHA1(89fdc30166ba1e9706798547195bdf6875a02e96) ) | |
| 698 | duart68681 = device_list_find_by_tag( machine->config->devicelist, DUART68681, "duart68681" ); | |
| 699 | } | |
| 919 | 700 | |
| 920 | /* DR MATH PCB (MPG 010-00003-003) */ | |
| 921 | ROM_REGION( 0x40000, "user2", 0 ) | |
| 922 | ROM_LOAD( "014dth.153", 0x000000, 0x20000, CRC(0eee0557) SHA1(8abe52cad31e59cf814fd9f64f4e42ddb4aa8c93) ) | |
| 923 | ROM_LOAD( "015dth.154", 0x020000, 0x20000, CRC(68564122) SHA1(410d2db74e574774b2eadd7fdf891feef5d8a93f) ) | |
| 924 | ROM_LOAD( "016dth.167", 0x000000, 0x20000, CRC(60c6cb26) SHA1(0e2bf65793715e12d8fd7f87fd3336a9d00ee7e6) ) | |
| 925 | ROM_LOAD( "017dth.160", 0x020000, 0x20000, CRC(d8b89379) SHA1(aa08e111c1505a4ad55b14659f8e21fd39cfcb16) ) | |
| 926 | ROM_LOAD( "118dth.135", 0x000000, 0x08000, CRC(2903e682) SHA1(027ed6524e9d4490632f10aeb22150c2fbc4eec2) ) | |
| 927 | ROM_LOAD( "119dth.115", 0x020000, 0x08000, CRC(9c9dbac1) SHA1(4c66971884190598e128684ece2e15a1c80b94ed) ) | |
| 928 | ROM_LOAD( "120dth.108", 0x000000, 0x08000, CRC(dafa173a) SHA1(a19980b92a5e74ebe395be36313701fdb527a46a) ) | |
| 929 | ROM_LOAD( "121dth.127", 0x020000, 0x08000, CRC(198a636b) SHA1(356b8948aafb98cb5e6ee7b5ad6ea9e5998265e5) ) | |
| 930 | ROM_LOAD( "122dth.134", 0x000000, 0x08000, CRC(bf60c487) SHA1(5ce80e89d9a24b627b0e97bf36a4e71c2eff4324) ) | |
| 931 | ROM_LOAD( "123dth.114", 0x020000, 0x08000, CRC(04ba6ed1) SHA1(012be71c6b955beda2bd0ff376dcaab51b226723) ) | |
| 932 | ROM_LOAD( "124dth.107", 0x000000, 0x08000, CRC(220db5d3) SHA1(3bfbe0eb97282c4ce449fd44e8e141de74f08eb0) ) | |
| 933 | ROM_LOAD( "125dth.126", 0x020000, 0x08000, CRC(b0dccf4a) SHA1(e8bfd622c006985b724cdbd3ad14c33e9ed27c6c) ) | |
| 701 | static DRIVER_INIT( stankatk ) | |
| 702 | { | |
| 703 | UINT16 *rom = (UINT16 *)memory_region(machine, "main"); | |
| 934 | 704 | |
| 935 | ROM_REGION16_LE( 0x40000, "user1", 0 ) | |
| 936 | ROM_LOAD16_BYTE( "101vgb.101", 0x000000, 0x20000, CRC(6aada23d) SHA1(85dbf9b20e4f17cb21922637763654d6cae80dfd) ) | |
| 937 | ROM_LOAD16_BYTE( "104vgb.97", 0x000001, 0x20000, CRC(715cac9d) SHA1(2aa0c563dc1fe4d02fa1ecbaed16f720f899fdc4) ) | |
| 705 | rom[0x1f543] = 0x4e71; | |
| 706 | rom[0x1f546] = 0x4e71; | |
| 707 | rom[0x1f596] = 0x4e71; | |
| 708 | rom[0x2182b] = 0x6006; /* Skip AM2k object download */ | |
| 709 | rom[0x21838] = 0x4e71; | |
| 710 | rom[0x1f692] = 0x4e71; | |
| 711 | rom[0x21ca8] = 0x4e71; /* Lie that trig table is intact */ | |
| 712 | rom[0x21c60] = 0x4e71; /* Lie that tree is intact */ | |
| 713 | rom[0x1f581] = 0x4e71; | |
| 714 | rom[0x21905] = 0x4e71; | |
| 938 | 715 | |
| 939 | /* VGB - Video Graphics PCB (MPG DW-010-00002-002) */ | |
| 940 | ROM_REGION16_LE( 0xc0000, "gfx1", 0 ) | |
| 941 | ROM_LOAD16_BYTE( "105vgb.124", 0x000000, 0x20000, CRC(5482e0c4) SHA1(492afac1862f2899cd734d1e57ca978ed6a906d5) ) | |
| 942 | ROM_LOAD16_BYTE( "106vgb.121", 0x000001, 0x20000, CRC(a55e5d19) SHA1(86fbcb425103ae9fff381357339af349848fc3f2) ) | |
| 716 | DRIVER_INIT_CALL(micro3d); | |
| 717 | } | |
| 943 | 718 | |
| 944 | ROM_LOAD16_BYTE( "107vgb.130", 0x040000, 0x20000, CRC(006487b6) SHA1(f8bc6abad13df099da1708bd22f239703e407b21) ) | |
| 945 | ROM_LOAD16_BYTE( "108vgb.133", 0x040001, 0x20000, CRC(e4587ba1) SHA1(1323b4be5a526ae182ee38e96fccd263a4cecc37) ) | |
| 719 | static DRIVER_INIT( botss ) | |
| 720 | { | |
| 721 | UINT16 *rom = (UINT16 *)memory_region(machine, "main"); | |
| 946 | 722 | |
| 947 | ROM_LOAD16_BYTE( "103vgb.114", 0x080000, 0x20000, CRC(4e486e70) SHA1(04ee16cfadd43dbe9ed5bd8330c21a718d63a8f4) ) | |
| 948 | ROM_LOAD16_BYTE( "102vgb.108", 0x080001, 0x20000, CRC(441e8490) SHA1(6cfe30cea3fa297b71e881fbddad6d65a96e4386) ) | |
| 723 | rom[0x1fcc0] = 0x4e71; /* Eliminate startup Am29000 timeout */ | |
| 724 | rom[0x1fbf0] = 0x4e71; /* Skip AM29k code version detect */ | |
| 725 | rom[0x1fC88] = 0x4e71; | |
| 726 | rom[0x23146] = 0x4e71; | |
| 727 | rom[0x17f4f] = 0x6006; /* Skip download objects */ | |
| 728 | rom[0x17f5b] = 0x4e71; | |
| 949 | 729 | |
| 950 | /*SND - Sound PCB (MPG 010-00018-002) */ | |
| 951 | ROM_REGION( 0x10000, "audio", 0 ) | |
| 952 | ROM_LOAD( "14-001snd.2", 0x000000, 0x08000, CRC(307fcb6d) SHA1(0cf63a39ac8920be6532974311804529d7218545) ) | |
| 730 | DRIVER_INIT_CALL(micro3d); | |
| 731 | } | |
| 953 | 732 | |
| 954 | ROM_REGION( 0x40000, "upd", 0 ) | |
| 955 | ROM_LOAD( "13-001snd.17", 0x000000, 0x40000, CRC(015a0b17) SHA1(f229c9aa59f0e6b25b818f9513997a8685e33982) ) | |
| 956 | ROM_END | |
| 733 | static DRIVER_INIT( f15se ) | |
| 734 | { | |
| 735 | DRIVER_INIT_CALL(micro3d); | |
| 736 | } | |
| 957 | 737 | |
| 738 | static DRIVER_INIT( f15se21 ) | |
| 739 | { | |
| 740 | UINT16 *rom = (UINT16 *)memory_region(machine, "main"); | |
| 958 | 741 | |
| 959 | ROM_START( stankatk ) | |
| 960 | ROM_REGION( 0x140000, "main", 0 ) /* 68000 Code */ | |
| 961 | ROM_LOAD16_BYTE( "lo_u67", 0x000001, 0x20000, CRC(97aabac0) SHA1(12a0719d3332a63e912161200b0a942c27c1f5da) ) | |
| 962 | ROM_LOAD16_BYTE( "le_u91", 0x000000, 0x20000, CRC(977f90d9) SHA1(530fa5c32b1f28e2b90d20d98cc453cb290c0ad2) ) | |
| 963 | // ROM_LOAD16_BYTE( "host.u67", 0x000001, 0x20000, CRC(e79d9548) SHA1(84a4c181be81fff7d5e61faa32f6929fce8b62d0) ) // alt (bad?) rom | |
| 964 | // ROM_LOAD16_BYTE( "host.u91", 0x000000, 0x20000, CRC(ea19d0e1) SHA1(c11e8c6bff4746e3536fc19d3a40c89ab198059f) ) // alt (bad?) rom | |
| 965 | ROM_LOAD16_BYTE( "ho_u68", 0x040001, 0x20000, CRC(8f76f4ac) SHA1(f6c1d4c933a373b153eee7d9f3016c985acaa281) ) | |
| 966 | ROM_LOAD16_BYTE( "he_u92", 0x040000, 0x20000, CRC(1ea1db7c) SHA1(ecaa1bd3d70489a5ba0d96c6935c2959f57467b2) ) | |
| 967 | // ROM_LOAD16_BYTE( "host.u92", 0x040000, 0x20000, CRC(220e5a39) SHA1(d9de87bc56182c8412c11bff9616164159ced9fb) ) // alt (bad?) rom | |
| 968 | ROM_LOAD16_BYTE( "b00_o.u69", 0x080001, 0x20000, CRC(393718e5) SHA1(f956f8bd946f53a032af16011dc69f66fb3f095c) ) | |
| 969 | ROM_LOAD16_BYTE( "b00_e.u93", 0x080000, 0x20000, CRC(aedea0ef) SHA1(a81c3518c7a1e21f2fa2ad29c30346f727069257) ) | |
| 970 | ROM_LOAD16_BYTE( "b01_o.u70", 0x0c0001, 0x20000, CRC(e895167d) SHA1(677cbf1be32c1f0c76a0e1527db66eb037d7e9df) ) | |
| 971 | ROM_LOAD16_BYTE( "b01_e.u94", 0x0c0000, 0x20000, CRC(823bba4d) SHA1(6668e972b1435aac43f9b21cc40fc3adec0d285f) ) | |
| 972 | ROM_LOAD16_BYTE( "host.71", 0x100001, 0x20000, CRC(cfc0333e) SHA1(9f290769129a61189870faef45c3f061eb7b5c07) ) // same as botss | |
| 973 | ROM_LOAD16_BYTE( "host.95", 0x100000, 0x20000, CRC(6c595d1e) SHA1(89fdc30166ba1e9706798547195bdf6875a02e96) ) // same as botss | |
| 742 | rom[0x2a8b3] = 0x6006; | |
| 743 | rom[0x2a8bf] = 0x4e71; | |
| 744 | rom[0x28ad1] = 0x4e71; | |
| 745 | rom[0x28a9e] = 0x4e71; | |
| 746 | rom[0x28abd] = 0x4e71; | |
| 747 | rom[0x28c3b] = 0x4e71; | |
| 974 | 748 | |
| 975 | ROM_REGION( 0x40000, "user2", 0 ) | |
| 976 | ROM_LOAD( "pb0o_u.153", 0x000000, 0x20000, CRC(bcd7ddad) SHA1(3982756b6f0821df77918dd0d00807a90dbfb595) ) | |
| 977 | ROM_LOAD( "pb0e_u.154", 0x020000, 0x20000, CRC(d84e7c71) SHA1(2edb13c1f96f35c7934dad380e06035335ccbb48) ) | |
| 978 | ROM_LOAD( "pb1o_u.167", 0x000000, 0x20000, CRC(e4a65313) SHA1(f2df5cc87aa388d3273705562ab2d7c937a0a866) ) | |
| 979 | ROM_LOAD( "pb1e_u.160", 0x020000, 0x20000, CRC(9d9d1395) SHA1(9d937eac8d7e7bea40a69b596ba2c01753b97565) ) | |
| 749 | DRIVER_INIT_CALL(micro3d); | |
| 750 | } | |
| 980 | 751 | |
| 981 | ROM_LOAD( "s24o_u.135", 0x000000, 0x08000, CRC(f89bab5f) SHA1(e79e71d0a5e7ba933952c5d41f6afb633da06e8a) ) | |
| 982 | ROM_LOAD( "s08o_u.115", 0x020000, 0x08000, CRC(af1eae4a) SHA1(44f272b472f546ffff7d8f82e29c5d80b472b1c3) ) | |
| 983 | ROM_LOAD( "s00o_u.108", 0x000000, 0x08000, CRC(9cadc977) SHA1(e95f60d9df422511bae6a6c4a20f813d77a894a4) ) | |
| 984 | ROM_LOAD( "s16o_u.127", 0x020000, 0x08000, CRC(53ba1a3f) SHA1(333734fff41b98abfa7b2904692cb128ab1f90a3) ) | |
| 985 | ROM_LOAD( "s24e_u.134", 0x000000, 0x08000, CRC(0a41756b) SHA1(8681aaf8eeda7acdff967a773290c4b2c17cbe30) ) | |
| 986 | ROM_LOAD( "s08e_u.114", 0x020000, 0x08000, CRC(765da5d7) SHA1(d489581bd12d7fca42570ee7a12d922be2528c1e) ) | |
| 987 | ROM_LOAD( "s00e_u.107", 0x000000, 0x08000, CRC(558918cc) SHA1(7e61639ab4af88f888f4aa481dd01db7de3829da) ) | |
| 988 | ROM_LOAD( "s16e_u.126", 0x020000, 0x08000, CRC(d24654cd) SHA1(88d3624f23c669dc902136c822b1f4732104c9c1) ) | |
| 989 | 752 | |
| 990 | ROM_REGION16_LE( 0x40000, "user1", 0 ) | |
| 991 | ROM_LOAD16_BYTE( "3el_u101", 0x000000, 0x20000, CRC(130e1a18) SHA1(c31af5c5a403da588142ccbea79d3aa253ac6519) ) | |
| 992 | ROM_LOAD16_BYTE( "3eh_u97", 0x000001, 0x20000, CRC(0fdcab16) SHA1(afc21747e1624f3ab87b289b5f4a498141062445) ) | |
| 753 | /************************************* | |
| 754 | * | |
| 755 | * ROM definitions | |
| 756 | * | |
| 757 | *************************************/ | |
| 993 | 758 | |
| 994 | ROM_REGION16_LE( 0xC0000, "gfx1", 0 ) | |
| 995 | ROM_LOAD16_BYTE( "38l_u124", 0x000000, 0x20000, CRC(4e084daa) SHA1(f65f51d8d7c6b46aa844b37b212dab11c786d856) ) | |
| 996 | ROM_LOAD16_BYTE( "38h_u121", 0x000001, 0x20000, CRC(3628c8c1) SHA1(760eda076ec46af5b954548036da5230a5c86371) ) | |
| 759 | /* TODO: IC locations */ | |
| 760 | /* NOTE: Dr. Math and sound PCB ROMs are not dumped and may be different to v2.1 */ | |
| 761 | ROM_START( f15se ) | |
| 762 | /* Host PCB (MPG DW-00011C-0011-01) */ | |
| 763 | ROM_REGION( 0x140000, "main", 0 ) | |
| 764 | ROM_LOAD16_BYTE( "host.u67", 0x000001, 0x20000, CRC(8f495ceb) SHA1(90998ad67e76928ed1a6cae56038b98d1aa2e7b0) ) | |
| 765 | ROM_LOAD16_BYTE( "host.u91", 0x000000, 0x20000, CRC(dfae5ec3) SHA1(29306eed5047e39a0a2350e61ab7126a84cb710b) ) | |
| 766 | ROM_LOAD16_BYTE( "host.u68", 0x040001, 0x20000, CRC(685fc355) SHA1(5bfe015a8deccb66e3317154d715f490f00ace74) ) | |
| 767 | ROM_LOAD16_BYTE( "host.u92", 0x040000, 0x20000, CRC(8f7bb2eb) SHA1(1923d55d66da0fbc158b4f90bcc98c88955953ea) ) | |
| 768 | ROM_LOAD16_BYTE( "004.hst", 0x080001, 0x20000, CRC(81671ce1) SHA1(51ff641ccbc9dea640a62944910abe73d796b062) ) | |
| 769 | ROM_LOAD16_BYTE( "005.hst", 0x080000, 0x20000, CRC(bdaa7db5) SHA1(52cd832cdd44e609e8cd269469b806e2cd27d63d) ) | |
| 770 | ROM_LOAD16_BYTE( "host.u70", 0x0c0001, 0x20000, CRC(251e92d2) SHA1(a20279089af1f738ba912f90a4d048d4e58795fe) ) | |
| 771 | ROM_LOAD16_BYTE( "007.hst", 0x0c0000, 0x20000, CRC(36e06cba) SHA1(5ffee5da6f475978be10fa5e1a2c24f00497ea5f) ) | |
| 772 | ROM_LOAD16_BYTE( "008.hst", 0x100001, 0x20000, CRC(d96fd4e2) SHA1(001af758da437e955b4ee914eabeb9739ebc4454) ) | |
| 773 | ROM_LOAD16_BYTE( "009.hst", 0x100000, 0x20000, CRC(33e3b473) SHA1(66deda79ba94f0ed722b399b3fc6062dcdd1a6c9) ) | |
| 997 | 774 | |
| 998 | ROM_LOAD16_BYTE( "3al_u130", 0x040000, 0x20000, CRC(8a5386e3) SHA1(361f6abdb88cf51d5ec5ce6882986296dd274d3b) ) | |
| 999 | ROM_LOAD16_BYTE( "3ah_u133", 0x040001, 0x20000, CRC(7e674ac1) SHA1(81f1d87e62faf94a44aca7e41a32edf5c7c145ec) ) | |
| 775 | /* Dr Math PCB (MPG 010-00002-001) */ | |
| 776 | ROM_REGION32_LE( 0x80000, "am29000", 0 ) | |
| 777 | ROMX_LOAD( "124.dth", 0x00000, 0x08000, CRC(7be96646) SHA1(a6733f75c0404282d71e8c1a287546ef4d9d42ad), ROM_SKIP(7) ) | |
| 778 | ROMX_LOAD( "123.dth", 0x00001, 0x08000, CRC(54d5544f) SHA1(d039ee39991b947a7483111359ab245fc104e060), ROM_SKIP(7) ) | |
| 779 | ROMX_LOAD( "125.dth", 0x00002, 0x08000, CRC(7718487c) SHA1(609106f55601f84095b64ce2484107779da89149), ROM_SKIP(7) ) | |
| 780 | ROMX_LOAD( "122.dth", 0x00003, 0x08000, CRC(9d2032cf) SHA1(8430816756ea92bbe86b94eaa24a6071bf0ef879), ROM_SKIP(7) ) | |
| 781 | ROMX_LOAD( "120.dth", 0x00004, 0x08000, CRC(5fb9836d) SHA1(d511aa9f02972a7f475c82c6f57d1f3fd4f118fa), ROM_SKIP(7) ) | |
| 782 | ROMX_LOAD( "119.dth", 0x00005, 0x08000, CRC(b1c966e5) SHA1(9703bb1f9bdf6a779b59daebb39df2926727fa76), ROM_SKIP(7) ) | |
| 783 | ROMX_LOAD( "121.dth", 0x00006, 0x08000, CRC(392e5c43) SHA1(455cf3bb3c16217e58d6eea51d8f49a5bed1955e), ROM_SKIP(7) ) | |
| 784 | ROMX_LOAD( "118.dth", 0x00007, 0x08000, CRC(cc895c20) SHA1(140ef47536914fe1441778e759894c2cdd893276), ROM_SKIP(7) ) | |
| 1000 | 785 | |
| 1001 | ROM_LOAD16_BYTE( "3cl_u114", 0x080000, 0x20000, CRC(bc04b0e6) SHA1(d08fddd52f2c1a565a80f5d4ff8b07f1c5f01a01) ) | |
| 1002 | ROM_LOAD16_BYTE( "3ch_u108", 0x080001, 0x20000, CRC(7cb688af) SHA1(6be495ae0ed74739f62de65386810864c9ffaaee) ) | |
| 786 | ROM_REGION16_LE( 0x80000, "vertex", 0 ) | |
| 787 | ROM_LOAD16_BYTE( "014.dth", 0x00000, 0x20000, CRC(5ca7713f) SHA1(ac7b9629684b99ecfb1945176b06eb6be284ba93) ) | |
| 788 | ROM_LOAD16_BYTE( "015.dth", 0x00001, 0x20000, CRC(beae31bb) SHA1(1ab80a6b99eea6d5bf9b1bce58ecca13042c77a6) ) | |
| 789 | ROM_LOAD16_BYTE( "016.dth", 0x20000, 0x20000, CRC(5db4f677) SHA1(25a6fe4c562e4fa4225aa4687dd41920b614e591) ) | |
| 790 | ROM_LOAD16_BYTE( "017.dth", 0x20001, 0x20000, CRC(47f9a868) SHA1(7c8a9355893e4a3f3846fd05e0237ffd1404ffee) ) | |
| 1003 | 791 | |
| 1004 | ROM_REGION( 0x08000, "audio", 0 ) | |
| 1005 | ROM_LOAD( "sound.u2", 0x000000, 0x08000, CRC(77190a90) SHA1(a36a5a8457cc1c325e6318b083e5e271e163f7cb) ) | |
| 792 | /* Video Graphics PCB (MPG DW-010-00003-001) */ | |
| 793 | ROM_REGION16_LE( 0x40000, "tms34010", 0 ) | |
| 794 | ROM_LOAD16_BYTE( "vgb_u101.bin", 0x00000, 0x20000, CRC(e99fac71) SHA1(98d1d2134fabc1bad637cbe42cbe9cdc20b32126) ) | |
| 795 | ROM_LOAD16_BYTE( "vgb_u097.bin", 0x00001, 0x20000, CRC(78b9b7c7) SHA1(4bce993dd3aea126e3a9d42ee8c68b8ab47fdba7) ) | |
| 1006 | 796 | |
| 1007 | ROM_REGION( 0x40000, "upd", 0 ) | |
| 1008 | ROM_LOAD( "sound.u17", 0x000000, 0x40000, CRC(d033ef6c) SHA1(0404473c87b5b52e39ab3824b159a2d98159bbea) ) | |
| 797 | ROM_REGION16_LE( 0xc0000, "tms_gfx", 0 ) | |
| 798 | ROM_LOAD16_BYTE( "005.vgb", 0x00000, 0x20000, CRC(7b1852f0) SHA1(d21525e59b3112313ea9783ac3dd988a4c1d5f87) ) | |
| 799 | ROM_LOAD16_BYTE( "006.vgb", 0x00001, 0x20000, CRC(9d031636) SHA1(b7c7b57d547f2ce2eeb97126e961f3b5f35823f7) ) | |
| 800 | ROM_LOAD16_BYTE( "007.vgb", 0x40000, 0x20000, CRC(15326070) SHA1(ec4484d4515694742d3fd3b944f342f052463988) ) | |
| 801 | ROM_LOAD16_BYTE( "008.vgb", 0x40001, 0x20000, CRC(ca0e86d8) SHA1(a7b4b02d100a7875d5a184cdb76d507e926d1ca3) ) | |
| 802 | ROM_LOAD16_BYTE( "003.vgb", 0x80000, 0x20000, CRC(4d8e8f54) SHA1(d8a23b5fd00ab919dc6d63fc72824d1293073813) ) | |
| 803 | ROM_LOAD16_BYTE( "002.vgb", 0x80001, 0x20000, CRC(f6488e31) SHA1(d2f9304cc59f5523007592ae76ddd56107cc29e8) ) | |
| 1009 | 804 | |
| 805 | /* Sound PCB (MPG 010-00018-002) */ | |
| 806 | ROM_REGION( 0x08000, "audio", 0 ) | |
| 807 | ROM_LOAD( "4-001.snd", 0x000000, 0x08000, CRC(705685a9) SHA1(311f7cac126a19e8bd555ebf31ff4ec4680ddfa4) ) | |
| 808 | ||
| 809 | ROM_REGION( 0x40000, "upd7759", 0 ) | |
| 810 | ROM_LOAD( "3-001.snd", 0x000000, 0x40000, CRC(af84b635) SHA1(844e5987a66e9e3ab2d2fe05b93a4da3512776bb) ) | |
| 1010 | 811 | ROM_END |
| 1011 | 812 | |
| 1012 | ROM_START( f15se21 ) // rev 2.1 02/04/91 | |
| 1013 | /* HST - Host PCB (MPG DW-00011C-0011-01) */ | |
| 1014 | ROM_REGION( 0x140000, "main", 0 ) /* 68000 Code */ | |
| 813 | ROM_START( f15se21 ) | |
| 814 | /* Host PCB (MPG DW-00011C-0011-01) */ | |
| 815 | ROM_REGION( 0x140000, "main", 0 ) | |
| 1015 | 816 | ROM_LOAD16_BYTE( "500.hst", 0x000001, 0x20000, CRC(6c26806d) SHA1(7cfd2b3b92b0fc6627c92a2013a317ca5abc66a0) ) |
| 1016 | 817 | ROM_LOAD16_BYTE( "501.hst", 0x000000, 0x20000, CRC(81f02bf7) SHA1(09976746fe4d9c88bd8840f6e7addb09226aa54b) ) |
| 1017 | 818 | ROM_LOAD16_BYTE( "502.hst", 0x040001, 0x20000, CRC(1eb945e5) SHA1(aba3ff038f2ca0f1200be5710073825ce80e3656) ) |
| 1018 | 819 | ROM_LOAD16_BYTE( "503.hst", 0x040000, 0x20000, CRC(21fcb974) SHA1(56f78ce652e2bf432fbba8cda8c800f02dad84bb) ) |
| 1019 | ||
| 1020 | 820 | ROM_LOAD16_BYTE( "004.hst", 0x080001, 0x20000, CRC(81671ce1) SHA1(51ff641ccbc9dea640a62944910abe73d796b062) ) |
| 1021 | 821 | ROM_LOAD16_BYTE( "005.hst", 0x080000, 0x20000, CRC(bdaa7db5) SHA1(52cd832cdd44e609e8cd269469b806e2cd27d63d) ) |
| 1022 | 822 | ROM_LOAD16_BYTE( "006.hst", 0x0c0001, 0x20000, CRC(8eedef6d) SHA1(a1b5b53afc9ff092d86e7c7d4e357807fae3ad85) ) |
| r4184 | r4185 | |
| 1024 | 824 | ROM_LOAD16_BYTE( "008.hst", 0x100001, 0x20000, CRC(d96fd4e2) SHA1(001af758da437e955b4ee914eabeb9739ebc4454) ) |
| 1025 | 825 | ROM_LOAD16_BYTE( "009.hst", 0x100000, 0x20000, CRC(33e3b473) SHA1(66deda79ba94f0ed722b399b3fc6062dcdd1a6c9) ) |
| 1026 | 826 | |
| 1027 | /* Video Graphics PCB (MPG DW-010-00003-001) */ | |
| 1028 | // ROM_REGION( 0x40000, "vgb", 0 ) /* TMS34010 dummy region */ | |
| 1029 | ||
| 1030 | // TI ROM version 1.0a, 28-November-90 | |
| 1031 | ROM_REGION16_LE( 0x40000, "user1", 0 ) | |
| 827 | /* Video Graphics PCB (MPG DW-010-00003-001) */ | |
| 828 | ROM_REGION16_LE( 0x40000, "tms34010", 0 ) | |
| 1032 | 829 | ROM_LOAD16_BYTE( "001.vgb", 0x000000, 0x20000, CRC(810c142d) SHA1(d37e5ecd716dda65d43cec7bca524c59d3dc9803) ) |
| 1033 | 830 | ROM_LOAD16_BYTE( "004.vgb", 0x000001, 0x20000, CRC(b69e1260) SHA1(1a2b69ea7c96b0293b24d87ea46bd4b1d4c56a66) ) |
| 1034 | 831 | |
| 1035 | ROM_REGION16_LE( 0xC0000, "gfx | |
| 832 | ROM_REGION16_LE( 0xC0000, "tms_gfx | |
| 1036 | 833 | ROM_LOAD16_BYTE( "005.vgb", 0x000000, 0x20000, CRC(7b1852f0) SHA1(d21525e59b3112313ea9783ac3dd988a4c1d5f87) ) |
| 1037 | 834 | ROM_LOAD16_BYTE( "006.vgb", 0x000001, 0x20000, CRC(9d031636) SHA1(b7c7b57d547f2ce2eeb97126e961f3b5f35823f7) ) |
| 1038 | 835 | ROM_LOAD16_BYTE( "007.vgb", 0x040000, 0x20000, CRC(15326070) SHA1(ec4484d4515694742d3fd3b944f342f052463988) ) |
| r4184 | r4185 | |
| 1040 | 837 | ROM_LOAD16_BYTE( "003.vgb", 0x080000, 0x20000, CRC(4d8e8f54) SHA1(d8a23b5fd00ab919dc6d63fc72824d1293073813) ) |
| 1041 | 838 | ROM_LOAD16_BYTE( "002.vgb", 0x080001, 0x20000, CRC(f6488e31) SHA1(d2f9304cc59f5523007592ae76ddd56107cc29e8) ) |
| 1042 | 839 | |
| 1043 | /* DTH - Dr Math PCB (MPG 010-00002-001) */ | |
| 1044 | ROM_REGION32_BE( 0x80000, "user2", 0 ) | |
| 1045 | // ROM_LOAD("drmath.rom", 0x00000, 0x40000, CRC(28dd9107) SHA1(3d571de81109e805cc0b133eefc3ea419e6a337b) ) // Cheat | |
| 840 | /* Dr Math PCB (MPG 010-00002-001) */ | |
| 841 | ROM_REGION32_LE( 0x80000, "am29000", 0 ) | |
| 842 | ROMX_LOAD( "124.dth", 0x00000, 0x08000, CRC(7be96646) SHA1(a6733f75c0404282d71e8c1a287546ef4d9d42ad), ROM_SKIP(7) ) | |
| 843 | ROMX_LOAD( "123.dth", 0x00001, 0x08000, CRC(54d5544f) SHA1(d039ee39991b947a7483111359ab245fc104e060), ROM_SKIP(7) ) | |
| 844 | ROMX_LOAD( "125.dth", 0x00002, 0x08000, CRC(7718487c) SHA1(609106f55601f84095b64ce2484107779da89149), ROM_SKIP(7) ) | |
| 845 | ROMX_LOAD( "122.dth", 0x00003, 0x08000, CRC(9d2032cf) SHA1(8430816756ea92bbe86b94eaa24a6071bf0ef879), ROM_SKIP(7) ) | |
| 846 | ROMX_LOAD( "120.dth", 0x00004, 0x08000, CRC(5fb9836d) SHA1(d511aa9f02972a7f475c82c6f57d1f3fd4f118fa), ROM_SKIP(7) ) | |
| 847 | ROMX_LOAD( "119.dth", 0x00005, 0x08000, CRC(b1c966e5) SHA1(9703bb1f9bdf6a779b59daebb39df2926727fa76), ROM_SKIP(7) ) | |
| 848 | ROMX_LOAD( "121.dth", 0x00006, 0x08000, CRC(392e5c43) SHA1(455cf3bb3c16217e58d6eea51d8f49a5bed1955e), ROM_SKIP(7) ) | |
| 849 | ROMX_LOAD( "118.dth", 0x00007, 0x08000, CRC(cc895c20) SHA1(140ef47536914fe1441778e759894c2cdd893276), ROM_SKIP(7) ) | |
| 1046 | 850 | |
| 1047 | ROM_LOAD( "120.dth", 0x000000, 0x08000, CRC(5fb9836d) SHA1(d511aa9f02972a7f475c82c6f57d1f3fd4f118fa) ) | |
| 1048 | ROM_LOAD( "119.dth", 0x008000, 0x08000, CRC(b1c966e5) SHA1(9703bb1f9bdf6a779b59daebb39df2926727fa76) ) | |
| 1049 | ROM_LOAD( "121.dth", 0x000006, 0x08000, CRC(392e5c43) SHA1(455cf3bb3c16217e58d6eea51d8f49a5bed1955e) ) | |
| 1050 | ROM_LOAD( "118.dth", 0x000007, 0x08000, CRC(cc895c20) SHA1(140ef47536914fe1441778e759894c2cdd893276) ) | |
| 1051 | ROM_LOAD( "014.dth", 0x000000, 0x20000, CRC(5ca7713f) SHA1(ac7b9629684b99ecfb1945176b06eb6be284ba93) ) | |
| 1052 | ROM_LOAD( "015.dth", 0x000001, 0x20000, CRC(beae31bb) SHA1(1ab80a6b99eea6d5bf9b1bce58ecca13042c77a6) ) | |
| 1053 | ROM_LOAD( "016.dth", 0x000002, 0x20000, CRC(5db4f677) SHA1(25a6fe4c562e4fa4225aa4687dd41920b614e591) ) | |
| 1054 | ROM_LOAD( "017.dth", 0x000003, 0x20000, CRC(47f9a868) SHA1(7c8a9355893e4a3f3846fd05e0237ffd1404ffee) ) | |
| 1055 | ROM_LOAD( "122.dth", 0x000000, 0x08000, CRC(9d2032cf) SHA1(8430816756ea92bbe86b94eaa24a6071bf0ef879) ) | |
| 1056 | ROM_LOAD( "123.dth", 0x020000, 0x08000, CRC(54d5544f) SHA1(d039ee39991b947a7483111359ab245fc104e060) ) | |
| 1057 | ROM_LOAD( "124.dth", 0x000000, 0x08000, CRC(7be96646) SHA1(a6733f75c0404282d71e8c1a287546ef4d9d42ad) ) | |
| 1058 | ROM_LOAD( "125.dth", 0x020000, 0x08000, CRC(7718487c) SHA1(609106f55601f84095b64ce2484107779da89149) ) | |
| 851 | ROM_REGION16_LE( 0x80000, "vertex", 0 ) | |
| 852 | ROM_LOAD16_BYTE( "014.dth", 0x00000, 0x20000, CRC(5ca7713f) SHA1(ac7b9629684b99ecfb1945176b06eb6be284ba93) ) | |
| 853 | ROM_LOAD16_BYTE( "015.dth", 0x00001, 0x20000, CRC(beae31bb) SHA1(1ab80a6b99eea6d5bf9b1bce58ecca13042c77a6) ) | |
| 854 | ROM_LOAD16_BYTE( "016.dth", 0x20000, 0x20000, CRC(5db4f677) SHA1(25a6fe4c562e4fa4225aa4687dd41920b614e591) ) | |
| 855 | ROM_LOAD16_BYTE( "017.dth", 0x20001, 0x20000, CRC(47f9a868) SHA1(7c8a9355893e4a3f3846fd05e0237ffd1404ffee) ) | |
| 1059 | 856 | |
| 1060 | ||
| 1061 | /* SND - Sound PCB (MPG 010-00018-002) */ | |
| 857 | /* Sound PCB (MPG 010-00018-002) */ | |
| 1062 | 858 | ROM_REGION( 0x08000, "audio", 0 ) |
| 1063 | 859 | ROM_LOAD( "4-001.snd", 0x000000, 0x08000, CRC(705685a9) SHA1(311f7cac126a19e8bd555ebf31ff4ec4680ddfa4) ) |
| 1064 | 860 | |
| 1065 | ROM_REGION( 0x40000, "upd", 0 ) | |
| 861 | ROM_REGION( 0x40000, "upd7759", 0 ) | |
| 1066 | 862 | ROM_LOAD( "3-001.snd", 0x000000, 0x40000, CRC(af84b635) SHA1(844e5987a66e9e3ab2d2fe05b93a4da3512776bb) ) |
| 1067 | 863 | ROM_END |
| 1068 | 864 | |
| 1069 | ROM_START( f15se ) // rev 2.2 02/25/91 | |
| 1070 | /* HST - Host PCB (MPG DW-00011C-0011-01) */ | |
| 1071 | ROM_REGION( 0x140000, "main", 0 ) /* 68000 Code */ | |
| 1072 | ROM_LOAD16_BYTE( "host.u67", 0x000001, 0x20000, CRC(8f495ceb) SHA1(90998ad67e76928ed1a6cae56038b98d1aa2e7b0) ) | |
| 1073 | ROM_LOAD16_BYTE( "host.u91", 0x000000, 0x20000, CRC(dfae5ec3) SHA1(29306eed5047e39a0a2350e61ab7126a84cb710b) ) | |
| 1074 | ROM_LOAD16_BYTE( "host.u68", 0x040001, 0x20000, CRC(685fc355) SHA1(5bfe015a8deccb66e3317154d715f490f00ace74) ) | |
| 1075 | ROM_LOAD16_BYTE( "host.u92", 0x040000, 0x20000, CRC(8f7bb2eb) SHA1(1923d55d66da0fbc158b4f90bcc98c88955953ea) ) | |
| 865 | ROM_START( botss ) | |
| 866 | /* Host PCB (MPG DW-00011C-0011-02) */ | |
| 867 | ROM_REGION( 0x140000, "main", 0 ) | |
| 868 | ROM_LOAD16_BYTE( "300hst.67", 0x000001, 0x20000, CRC(7f74362a) SHA1(41611ba8e6eb5d6b3dfe88e1cede7d9fb5472e40) ) | |
| 869 | ROM_LOAD16_BYTE( "301hst.91", 0x000000, 0x20000, CRC(a8100d1e) SHA1(69d3cac6f67563c0796560f7b874d7660720027d) ) | |
| 870 | ROM_LOAD16_BYTE( "302hst.68", 0x040001, 0x20000, CRC(af865ee4) SHA1(f00bce49401431bc749208399329d9f92457186b) ) | |
| 871 | ROM_LOAD16_BYTE( "303hst.92", 0x040000, 0x20000, CRC(15182619) SHA1(e95dcce11c0651c8e85fc0c658029f48eea35fb8) ) | |
| 872 | ROM_LOAD16_BYTE( "104hst.69", 0x080001, 0x20000, CRC(72a607ca) SHA1(1afc85380be12c429808c48f1502736a4c8b98e5) ) | |
| 873 | ROM_LOAD16_BYTE( "105hst.93", 0x080000, 0x20000, CRC(f37680ae) SHA1(51f1ee805b7d1b2b078c612c572e12846de623b9) ) | |
| 874 | ROM_LOAD16_BYTE( "106hst.70", 0x0c0001, 0x20000, CRC(57a1c728) SHA1(2bdc831be739ada0f4f4adec7974da453878db0e) ) | |
| 875 | ROM_LOAD16_BYTE( "107hst.94", 0x0c0000, 0x20000, CRC(4c9e16af) SHA1(1f8acc9bb85fe1bf459b4358b9bf9cf9847e6a36) ) | |
| 876 | ROM_LOAD16_BYTE( "108hst.71", 0x100001, 0x20000, CRC(cfc0333e) SHA1(9f290769129a61189870faef45c3f061eb7b5c07) ) | |
| 877 | ROM_LOAD16_BYTE( "109hst.95", 0x100000, 0x20000, CRC(6c595d1e) SHA1(89fdc30166ba1e9706798547195bdf6875a02e96) ) | |
| 1076 | 878 | |
| 1077 | ROM_LOAD16_BYTE( "004.hst", 0x080001, 0x20000, CRC(81671ce1) SHA1(51ff641ccbc9dea640a62944910abe73d796b062) ) | |
| 1078 | ROM_LOAD16_BYTE( "005.hst", 0x080000, 0x20000, CRC(bdaa7db5) SHA1(52cd832cdd44e609e8cd269469b806e2cd27d63d) ) | |
| 1079 | ROM_LOAD16_BYTE( "host.u70",0x0c0001, 0x20000, CRC(251e92d2) SHA1(a20279089af1f738ba912f90a4d048d4e58795fe) ) | |
| 1080 | ROM_LOAD16_BYTE( "007.hst", 0x0c0000, 0x20000, CRC(36e06cba) SHA1(5ffee5da6f475978be10fa5e1a2c24f00497ea5f) ) | |
| 1081 | ROM_LOAD16_BYTE( "008.hst", 0x100001, 0x20000, CRC(d96fd4e2) SHA1(001af758da437e955b4ee914eabeb9739ebc4454) ) | |
| 1082 | ROM_LOAD16_BYTE( "009.hst", 0x100000, 0x20000, CRC(33e3b473) SHA1(66deda79ba94f0ed722b399b3fc6062dcdd1a6c9) ) | |
| 879 | /* Dr Math PCB (MPG 010-00002-001) */ | |
| 880 | ROM_REGION32_LE( 0x80000, "am29000", 0 ) | |
| 881 | ROMX_LOAD( "124dth.107", 0x000000, 0x08000, CRC(220db5d3) SHA1(3bfbe0eb97282c4ce449fd44e8e141de74f08eb0), ROM_SKIP(7) ) | |
| 882 | ROMX_LOAD( "123dth.114", 0x000001, 0x08000, CRC(04ba6ed1) SHA1(012be71c6b955beda2bd0ff376dcaab51b226723), ROM_SKIP(7) ) | |
| 883 | ROMX_LOAD( "125dth.126", 0x000002, 0x08000, CRC(b0dccf4a) SHA1(e8bfd622c006985b724cdbd3ad14c33e9ed27c6c), ROM_SKIP(7) ) | |
| 884 | ROMX_LOAD( "122dth.134", 0x000003, 0x08000, CRC(bf60c487) SHA1(5ce80e89d9a24b627b0e97bf36a4e71c2eff4324), ROM_SKIP(7) ) | |
| 885 | ROMX_LOAD( "120dth.108", 0x000004, 0x08000, CRC(dafa173a) SHA1(a19980b92a5e74ebe395be36313701fdb527a46a), ROM_SKIP(7) ) | |
| 886 | ROMX_LOAD( "119dth.115", 0x000005, 0x08000, CRC(9c9dbac1) SHA1(4c66971884190598e128684ece2e15a1c80b94ed), ROM_SKIP(7) ) | |
| 887 | ROMX_LOAD( "121dth.127", 0x000006, 0x08000, CRC(198a636b) SHA1(356b8948aafb98cb5e6ee7b5ad6ea9e5998265e5), ROM_SKIP(7) ) | |
| 888 | ROMX_LOAD( "118dth.135", 0x000007, 0x08000, CRC(2903e682) SHA1(027ed6524e9d4490632f10aeb22150c2fbc4eec2), ROM_SKIP(7) ) | |
| 1083 | 889 | |
| 1084 | /* Video Graphics PCB (MPG DW-010-00003-001) */ | |
| 1085 | // ROM_REGION( 0x40000, "vgb", 0 ) /* TMS34010 dummy region */ | |
| 890 | ROM_REGION16_LE( 0x80000, "vertex", 0 ) | |
| 891 | ROM_LOAD16_BYTE( "014dth.153", 0x00000, 0x20000, CRC(0eee0557) SHA1(8abe52cad31e59cf814fd9f64f4e42ddb4aa8c93) ) | |
| 892 | ROM_LOAD16_BYTE( "015dth.154", 0x00001, 0x20000, CRC(68564122) SHA1(410d2db74e574774b2eadd7fdf891feef5d8a93f) ) | |
| 893 | ROM_LOAD16_BYTE( "016dth.167", 0x40000, 0x20000, CRC(60c6cb26) SHA1(0e2bf65793715e12d8fd7f87fd3336a9d00ee7e6) ) | |
| 894 | ROM_LOAD16_BYTE( "017dth.160", 0x40001, 0x20000, CRC(d8b89379) SHA1(aa08e111c1505a4ad55b14659f8e21fd39cfcb16) ) | |
| 1086 | 895 | |
| 1087 | // TI ROM version 1.0c, 28-November-90 | |
| 1088 | ROM_REGION16_LE( 0x40000, "user1", 0 ) | |
| 1089 | ROM_LOAD16_BYTE( "vgb_u101.bin", 0x000000, 0x20000, CRC(e99fac71) SHA1(98d1d2134fabc1bad637cbe42cbe9cdc20b32126) ) | |
| 1090 | ROM_LOAD16_BYTE( "vgb_u097.bin", 0x000001, 0x20000, CRC(78b9b7c7) SHA1(4bce993dd3aea126e3a9d42ee8c68b8ab47fdba7) ) | |
| 896 | ROM_REGION16_LE( 0x40000, "tms34010", 0 ) | |
| 897 | ROM_LOAD16_BYTE( "101vgb.101", 0x000000, 0x20000, CRC(6aada23d) SHA1(85dbf9b20e4f17cb21922637763654d6cae80dfd) ) | |
| 898 | ROM_LOAD16_BYTE( "104vgb.97", 0x000001, 0x20000, CRC(715cac9d) SHA1(2aa0c563dc1fe4d02fa1ecbaed16f720f899fdc4) ) | |
| 1091 | 899 | |
| 1092 | ROM_REGION16_LE( 0xC0000, "gfx1", 0 ) | |
| 1093 | ROM_LOAD16_BYTE( "005.vgb", 0x000000, 0x20000, CRC(7b1852f0) SHA1(d21525e59b3112313ea9783ac3dd988a4c1d5f87) ) | |
| 1094 | ROM_LOAD16_BYTE( "006.vgb", 0x000001, 0x20000, CRC(9d031636) SHA1(b7c7b57d547f2ce2eeb97126e961f3b5f35823f7) ) | |
| 1095 | ROM_LOAD16_BYTE( "007.vgb", 0x040000, 0x20000, CRC(15326070) SHA1(ec4484d4515694742d3fd3b944f342f052463988) ) | |
| 1096 | ROM_LOAD16_BYTE( "008.vgb", 0x040001, 0x20000, CRC(ca0e86d8) SHA1(a7b4b02d100a7875d5a184cdb76d507e926d1ca3) ) | |
| 1097 | ROM_LOAD16_BYTE( "003.vgb", 0x080000, 0x20000, CRC(4d8e8f54) SHA1(d8a23b5fd00ab919dc6d63fc72824d1293073813) ) | |
| 1098 | ROM_LOAD16_BYTE( "002.vgb", 0x080001, 0x20000, CRC(f6488e31) SHA1(d2f9304cc59f5523007592ae76ddd56107cc29e8) ) | |
| 900 | /* Video Graphics PCB (MPG DW-010-00002-002) */ | |
| 901 | ROM_REGION16_LE( 0xc0000, "tms_gfx", 0 ) | |
| 902 | ROM_LOAD16_BYTE( "105vgb.124", 0x000000, 0x20000, CRC(5482e0c4) SHA1(492afac1862f2899cd734d1e57ca978ed6a906d5) ) | |
| 903 | ROM_LOAD16_BYTE( "106vgb.121", 0x000001, 0x20000, CRC(a55e5d19) SHA1(86fbcb425103ae9fff381357339af349848fc3f2) ) | |
| 904 | ROM_LOAD16_BYTE( "107vgb.130", 0x040000, 0x20000, CRC(006487b6) SHA1(f8bc6abad13df099da1708bd22f239703e407b21) ) | |
| 905 | ROM_LOAD16_BYTE( "108vgb.133", 0x040001, 0x20000, CRC(e4587ba1) SHA1(1323b4be5a526ae182ee38e96fccd263a4cecc37) ) | |
| 906 | ROM_LOAD16_BYTE( "103vgb.114", 0x080000, 0x20000, CRC(4e486e70) SHA1(04ee16cfadd43dbe9ed5bd8330c21a718d63a8f4) ) | |
| 907 | ROM_LOAD16_BYTE( "102vgb.108", 0x080001, 0x20000, CRC(441e8490) SHA1(6cfe30cea3fa297b71e881fbddad6d65a96e4386) ) | |
| 1099 | 908 | |
| 1100 | /* DTH - Dr Math PCB (MPG 010-00002-001) */ | |
| 1101 | ROM_REGION32_BE( 0x80000, "user2", 0 ) | |
| 1102 | // ROM_LOAD("drmath.rom", 0x00000, 0x40000, CRC(28dd9107) SHA1(3d571de81109e805cc0b133eefc3ea419e6a337b) ) // Cheat | |
| 909 | /* Sound PCB (MPG 010-00018-002) */ | |
| 910 | ROM_REGION( 0x10000, "audio", 0 ) | |
| 911 | ROM_LOAD( "14-001snd.2", 0x000000, 0x08000, CRC(307fcb6d) SHA1(0cf63a39ac8920be6532974311804529d7218545) ) | |
| 1103 | 912 | |
| 1104 | ROM_LOAD( "120.dth", 0x000000, 0x08000, CRC(5fb9836d) SHA1(d511aa9f02972a7f475c82c6f57d1f3fd4f118fa) ) | |
| 1105 | ROM_LOAD( "119.dth", 0x008000, 0x08000, CRC(b1c966e5) SHA1(9703bb1f9bdf6a779b59daebb39df2926727fa76) ) | |
| 1106 | ROM_LOAD( "121.dth", 0x000006, 0x08000, CRC(392e5c43) SHA1(455cf3bb3c16217e58d6eea51d8f49a5bed1955e) ) | |
| 1107 | ROM_LOAD( "118.dth", 0x000007, 0x08000, CRC(cc895c20) SHA1(140ef47536914fe1441778e759894c2cdd893276) ) | |
| 1108 | ROM_LOAD( "014.dth", 0x000000, 0x20000, CRC(5ca7713f) SHA1(ac7b9629684b99ecfb1945176b06eb6be284ba93) ) | |
| 1109 | ROM_LOAD( "015.dth", 0x000001, 0x20000, CRC(beae31bb) SHA1(1ab80a6b99eea6d5bf9b1bce58ecca13042c77a6) ) | |
| 1110 | ROM_LOAD( "016.dth", 0x000002, 0x20000, CRC(5db4f677) SHA1(25a6fe4c562e4fa4225aa4687dd41920b614e591) ) | |
| 1111 | ROM_LOAD( "017.dth", 0x000003, 0x20000, CRC(47f9a868) SHA1(7c8a9355893e4a3f3846fd05e0237ffd1404ffee) ) | |
| 1112 | ROM_LOAD( "122.dth", 0x000000, 0x08000, CRC(9d2032cf) SHA1(8430816756ea92bbe86b94eaa24a6071bf0ef879) ) | |
| 1113 | ROM_LOAD( "123.dth", 0x020000, 0x08000, CRC(54d5544f) SHA1(d039ee39991b947a7483111359ab245fc104e060) ) | |
| 1114 | ROM_LOAD( "124.dth", 0x000000, 0x08000, CRC(7be96646) SHA1(a6733f75c0404282d71e8c1a287546ef4d9d42ad) ) | |
| 1115 | ROM_LOAD( "125.dth", 0x020000, 0x08000, CRC(7718487c) SHA1(609106f55601f84095b64ce2484107779da89149) ) | |
| 913 | ROM_REGION( 0x40000, "upd7759", 0 ) | |
| 914 | ROM_LOAD( "13-001snd.17", 0x000000, 0x40000, CRC(015a0b17) SHA1(f229c9aa59f0e6b25b818f9513997a8685e33982) ) | |
| 915 | ROM_END | |
| 1116 | 916 | |
| 917 | ROM_START( stankatk ) | |
| 918 | ROM_REGION( 0x140000, "main", 0 ) | |
| 919 | ROM_LOAD16_BYTE( "lo_u67", 0x000001, 0x20000, CRC(97aabac0) SHA1(12a0719d3332a63e912161200b0a942c27c1f5da) ) | |
| 920 | ROM_LOAD16_BYTE( "le_u91", 0x000000, 0x20000, CRC(977f90d9) SHA1(530fa5c32b1f28e2b90d20d98cc453cb290c0ad2) ) | |
| 921 | // ROM_LOAD16_BYTE( "host.u67", 0x000001, 0x20000, CRC(e79d9548) SHA1(84a4c181be81fff7d5e61faa32f6929fce8b62d0) ) // alt (bad?) rom | |
| 922 | // ROM_LOAD16_BYTE( "host.u91", 0x000000, 0x20000, CRC(ea19d0e1) SHA1(c11e8c6bff4746e3536fc19d3a40c89ab198059f) ) // alt (bad?) rom | |
| 923 | ROM_LOAD16_BYTE( "ho_u68", 0x040001, 0x20000, CRC(8f76f4ac) SHA1(f6c1d4c933a373b153eee7d9f3016c985acaa281) ) | |
| 924 | ROM_LOAD16_BYTE( "he_u92", 0x040000, 0x20000, CRC(1ea1db7c) SHA1(ecaa1bd3d70489a5ba0d96c6935c2959f57467b2) ) | |
| 925 | // ROM_LOAD16_BYTE( "host.u92", 0x040000, 0x20000, CRC(220e5a39) SHA1(d9de87bc56182c8412c11bff9616164159ced9fb) ) // alt (bad?) rom | |
| 926 | ROM_LOAD16_BYTE( "b00_o.u69", 0x080001, 0x20000, CRC(393718e5) SHA1(f956f8bd946f53a032af16011dc69f66fb3f095c) ) | |
| 927 | ROM_LOAD16_BYTE( "b00_e.u93", 0x080000, 0x20000, CRC(aedea0ef) SHA1(a81c3518c7a1e21f2fa2ad29c30346f727069257) ) | |
| 928 | ROM_LOAD16_BYTE( "b01_o.u70", 0x0c0001, 0x20000, CRC(e895167d) SHA1(677cbf1be32c1f0c76a0e1527db66eb037d7e9df) ) | |
| 929 | ROM_LOAD16_BYTE( "b01_e.u94", 0x0c0000, 0x20000, CRC(823bba4d) SHA1(6668e972b1435aac43f9b21cc40fc3adec0d285f) ) | |
| 930 | ROM_LOAD16_BYTE( "host.71", 0x100001, 0x20000, CRC(cfc0333e) SHA1(9f290769129a61189870faef45c3f061eb7b5c07) ) // same as botss | |
| 931 | ROM_LOAD16_BYTE( "host.95", 0x100000, 0x20000, CRC(6c595d1e) SHA1(89fdc30166ba1e9706798547195bdf6875a02e96) ) // same as botss | |
| 1117 | 932 | |
| 1118 | /* SND - Sound PCB (MPG 010-00018-002) */ | |
| 933 | ROM_REGION32_LE( 0x80000, "am29000", 0 ) | |
| 934 | ROMX_LOAD( "s00e_u.107", 0x00000, 0x08000, CRC(558918cc) SHA1(7e61639ab4af88f888f4aa481dd01db7de3829da), ROM_SKIP(7) ) | |
| 935 | ROMX_LOAD( "s08e_u.114", 0x00001, 0x08000, CRC(765da5d7) SHA1(d489581bd12d7fca42570ee7a12d922be2528c1e), ROM_SKIP(7) ) | |
| 936 | ROMX_LOAD( "s16e_u.126", 0x00002, 0x08000, CRC(d24654cd) SHA1(88d3624f23c669dc902136c822b1f4732104c9c1), ROM_SKIP(7) ) | |
| 937 | ROMX_LOAD( "s24e_u.134", 0x00003, 0x08000, CRC(0a41756b) SHA1(8681aaf8eeda7acdff967a773290c4b2c17cbe30), ROM_SKIP(7) ) | |
| 938 | ROMX_LOAD( "s00o_u.108", 0x00004, 0x08000, CRC(9cadc977) SHA1(e95f60d9df422511bae6a6c4a20f813d77a894a4), ROM_SKIP(7) ) | |
| 939 | ROMX_LOAD( "s08o_u.115", 0x00005, 0x08000, CRC(af1eae4a) SHA1(44f272b472f546ffff7d8f82e29c5d80b472b1c3), ROM_SKIP(7) ) | |
| 940 | ROMX_LOAD( "s16o_u.127", 0x00006, 0x08000, CRC(53ba1a3f) SHA1(333734fff41b98abfa7b2904692cb128ab1f90a3), ROM_SKIP(7) ) | |
| 941 | ROMX_LOAD( "s24o_u.135", 0x00007, 0x08000, CRC(f89bab5f) SHA1(e79e71d0a5e7ba933952c5d41f6afb633da06e8a), ROM_SKIP(7) ) | |
| 942 | ||
| 943 | ROM_REGION16_LE( 0x80000, "vertex", 0 ) | |
| 944 | ROM_LOAD16_BYTE( "pb0o_u.153", 0x00000, 0x20000, CRC(bcd7ddad) SHA1(3982756b6f0821df77918dd0d00807a90dbfb595) ) | |
| 945 | ROM_LOAD16_BYTE( "pb0e_u.154", 0x00001, 0x20000, CRC(d84e7c71) SHA1(2edb13c1f96f35c7934dad380e06035335ccbb48) ) | |
| 946 | ROM_LOAD16_BYTE( "pb1o_u.167", 0x40000, 0x20000, CRC(e4a65313) SHA1(f2df5cc87aa388d3273705562ab2d7c937a0a866) ) | |
| 947 | ROM_LOAD16_BYTE( "pb1e_u.160", 0x40001, 0x20000, CRC(9d9d1395) SHA1(9d937eac8d7e7bea40a69b596ba2c01753b97565) ) | |
| 948 | ||
| 949 | ROM_REGION16_LE( 0x40000, "tms34010", 0 ) | |
| 950 | ROM_LOAD16_BYTE( "3el_u101", 0x000000, 0x20000, CRC(130e1a18) SHA1(c31af5c5a403da588142ccbea79d3aa253ac6519) ) | |
| 951 | ROM_LOAD16_BYTE( "3eh_u97", 0x000001, 0x20000, CRC(0fdcab16) SHA1(afc21747e1624f3ab87b289b5f4a498141062445) ) | |
| 952 | ||
| 953 | ROM_REGION16_LE( 0xC0000, "tms_gfx", 0 ) | |
| 954 | ROM_LOAD16_BYTE( "38l_u124", 0x000000, 0x20000, CRC(4e084daa) SHA1(f65f51d8d7c6b46aa844b37b212dab11c786d856) ) | |
| 955 | ROM_LOAD16_BYTE( "38h_u121", 0x000001, 0x20000, CRC(3628c8c1) SHA1(760eda076ec46af5b954548036da5230a5c86371) ) | |
| 956 | ROM_LOAD16_BYTE( "3al_u130", 0x040000, 0x20000, CRC(8a5386e3) SHA1(361f6abdb88cf51d5ec5ce6882986296dd274d3b) ) | |
| 957 | ROM_LOAD16_BYTE( "3ah_u133", 0x040001, 0x20000, CRC(7e674ac1) SHA1(81f1d87e62faf94a44aca7e41a32edf5c7c145ec) ) | |
| 958 | ROM_LOAD16_BYTE( "3cl_u114", 0x080000, 0x20000, CRC(bc04b0e6) SHA1(d08fddd52f2c1a565a80f5d4ff8b07f1c5f01a01) ) | |
| 959 | ROM_LOAD16_BYTE( "3ch_u108", 0x080001, 0x20000, CRC(7cb688af) SHA1(6be495ae0ed74739f62de65386810864c9ffaaee) ) | |
| 960 | ||
| 1119 | 961 | ROM_REGION( 0x08000, "audio", 0 ) |
| 1120 | ROM_LOAD( " | |
| 962 | ROM_LOAD( " | |
| 1121 | 963 | |
| 1122 | ROM_REGION( 0x40000, "upd", 0 ) | |
| 1123 | ROM_LOAD( "3-001.snd", 0x000000, 0x40000, CRC(af84b635) SHA1(844e5987a66e9e3ab2d2fe05b93a4da3512776bb) ) | |
| 964 | ROM_REGION( 0x40000, "upd7759", 0 ) | |
| 965 | ROM_LOAD( "sound.u17", 0x000000, 0x40000, CRC(d033ef6c) SHA1(0404473c87b5b52e39ab3824b159a2d98159bbea) ) | |
| 1124 | 966 | ROM_END |
| 1125 | 967 | |
| 1126 | GAME( 1991, f15se, 0, micro3d, f15se, f15se, ROT0, "Microprose", "F-15 Strike Eagle (rev. 2.2 02/25/91)", GAME_NOT_WORKING ) | |
| 1127 | GAME( 1991, f15se21 , f15se, micro3d, f15se, f15se21, ROT0, "Microprose", "F-15 Strike Eagle (rev. 2.1 02/04/91)", GAME_NOT_WORKING ) | |
| 1128 | GAME( 1992, botss, 0, micro3d, botss, botss, ROT0, "Microprose", "Battle of the Solar System (rev. 1.1)", GAME_NOT_WORKING ) | |
| 1129 | GAME( 1992, stankatk, 0, micro3d, stankatk, stankatk, ROT0, "Microprose", "Super Tank Attack (prototype rev. 4/21/92 )", GAME_NOT_WORKING ) | |
| 968 | ||
| 969 | /************************************* | |
| 970 | * | |
| 971 | * Game drivers | |
| 972 | * | |
| 973 | *************************************/ | |
| 974 | ||
| 975 | GAME( 1991, f15se, 0, micro3d, f15se, f15se, ROT0, "Microprose Games Inc.", "F-15 Strike Eagle (rev. 2.2 02/25/91)", GAME_NOT_WORKING ) | |
| 976 | GAME( 1991, f15se21 , f15se, micro3d, f15se, f15se21, ROT0, "Microprose Games Inc.", "F-15 Strike Eagle (rev. 2.1 02/04/91)", GAME_NOT_WORKING ) | |
| 977 | GAME( 1992, botss, 0, micro3d, botss, botss, ROT0, "Microprose Games Inc.", "Battle of the Solar System (rev. 1.1)", GAME_NOT_WORKING ) | |
| 978 | GAME( 1992, stankatk, 0, micro3d, stankatk, stankatk, ROT0, "Microprose Games Inc.", "Super Tank Attack (prototype rev. 4/21/92 )", GAME_NOT_WORKING ) |
| r4184 | r4185 | |
|---|---|---|
| 1431 | 1431 | |
| 1432 | 1432 | /**********************************************************************************/ |
| 1433 | 1433 | |
| 1434 | #define ROM_LOAD64_WORD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(6)) | |
| 1435 | ||
| 1436 | 1434 | #define ROM_LOADTILE_WORD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(3) | ROM_REVERSE) |
| 1437 | 1435 | #define ROM_LOADTILE_BYTE(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(4)) |
| 1438 | 1436 |
| r4184 | r4185 | |
|---|---|---|
| 1866 | 1866 | ROM_LOAD( "321b18.7g", 0x200000, 2*1024*1024, CRC(2c561ad0) SHA1(6265054072ba1c2837dd96e0259b20bc50457160) ) |
| 1867 | 1867 | ROM_END |
| 1868 | 1868 | |
| 1869 | /* Salamander 2 | |
| 1869 | /* Salamander 2 | |
| 1870 | 1870 | ROM_START( salmndr2 ) |
| 1871 | 1871 | /* main program */ |
| 1872 | 1872 | ROM_REGION( 0x800000, "main", 0 ) |
| r4184 | r4185 | |
| 1897 | 1897 | ROM_LOAD( "521-a13.7g", 0x200000, 1*1024*1024, CRC(c3322475) SHA1(1774524ff031e0c4a7f3432810e968d37f9c6331) ) |
| 1898 | 1898 | ROM_END |
| 1899 | 1899 | |
| 1900 | /* Salamander 2 | |
| 1900 | /* Salamander 2 | |
| 1901 | 1901 | ROM_START( salmnd2a ) |
| 1902 | 1902 | /* main program */ |
| 1903 | 1903 | ROM_REGION( 0x800000, "main", 0 ) |
| 1904 | 1904 | GX_BIOS |
| 1905 | ROM_LOAD32_WORD_SWAP( "521aab02.bin", 0x200002, 512*1024, CRC(ac9d151f) SHA1(aabd17a41a42cbbe9b62a9751cdb264e714cac6a) ) | |
| 1906 | ROM_LOAD32_WORD_SWAP( "521aab03.bin", 0x200000, 512*1024, CRC(feecf34d) SHA1(c37959199afedd3deee9d4c248ec83ccccf9a401) ) | |
| 1905 | ROM_LOAD32_WORD_SWAP( "521aab02.31b", 0x200002, 512*1024, CRC(ac9d151f) SHA1(aabd17a41a42cbbe9b62a9751cdb264e714cac6a) ) | |
| 1906 | ROM_LOAD32_WORD_SWAP( "521aab03.27b", 0x200000, 512*1024, CRC(feecf34d) SHA1(c37959199afedd3deee9d4c248ec83ccccf9a401) ) | |
| 1907 | 1907 | |
| 1908 | 1908 | /* sound program */ |
| 1909 | 1909 | ROM_REGION( 0x40000, "sound", 0 ) |
| r4184 | r4185 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | 11 | #include "cpu/m68000/m68000.h" |
| 12 | #include "rendlay.h" | |
| 13 | #include "stepstag.lh" | |
| 12 | 14 | |
| 13 | 15 | static READ16_HANDLER( unknown_read_0xc00000 ) |
| 14 | 16 | { |
| r4184 | r4185 | |
| 129 | 131 | MDRV_CPU_PROGRAM_MAP(stepstag_sub_readmem,stepstag_sub_writemem) |
| 130 | 132 | |
| 131 | 133 | /* video hardware */ |
| 134 | MDRV_SCREEN_ADD("left", RASTER) | |
| 135 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 136 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 137 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 138 | MDRV_SCREEN_SIZE(64*8, 32*8) | |
| 139 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1) | |
| 140 | ||
| 132 | 141 | MDRV_SCREEN_ADD("main", RASTER) |
| 133 | 142 | MDRV_SCREEN_REFRESH_RATE(60) |
| 134 | 143 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| r4184 | r4185 | |
| 136 | 145 | MDRV_SCREEN_SIZE(64*8, 32*8) |
| 137 | 146 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1) |
| 138 | 147 | |
| 148 | MDRV_SCREEN_ADD("right", RASTER) | |
| 149 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 150 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 151 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 152 | MDRV_SCREEN_SIZE(64*8, 32*8) | |
| 153 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1) | |
| 154 | ||
| 139 | 155 | MDRV_PALETTE_LENGTH(0x200) |
| 140 | 156 | MDRV_GFXDECODE(stepstag) |
| 157 | MDRV_DEFAULT_LAYOUT(layout_stepstag) | |
| 141 | 158 | |
| 142 | 159 | MDRV_VIDEO_START(stepstag) |
| 143 | 160 | MDRV_VIDEO_UPDATE(stepstag) |
| r4184 | r4185 | |
| 178 | 195 | ROM_REGION( 0x400000, "gfx8", 0 ) /* */ |
| 179 | 196 | ROM_LOAD( "s.s.s._vj-98348_26_pr99021-01", 0x00000, 0x400000, CRC(fefb3777) SHA1(df624e105ab1dea52317e318ad29caa02b900788) ) |
| 180 | 197 | ROM_LOAD( "s.s.s._vj-98348_3_pr99021-01", 0x00000, 0x400000, CRC(e0fbc6f1) SHA1(7ca4507702f3f81bb9de3f9b5d270d379e439633) ) |
| 198 | ||
| 199 | DISK_REGION( "disks" ) | |
| 200 | DISK_IMAGE("stepstag", 0, NO_DUMP) | |
| 181 | 201 | ROM_END |
| 182 | 202 | |
| 203 | ROM_START( step3 ) | |
| 204 | ROM_REGION( 0x100000, "main", 0 ) /* 68k */ | |
| 205 | ROM_LOAD16_BYTE( "vj98344ver11.1", 0x00001, 0x80000, BAD_DUMP CRC(aedcb225) SHA1(f167c390e79ffbf7c019c326384ae656ae8b7d13) ) | |
| 206 | ROM_LOAD16_BYTE( "vj98344ver11.4", 0x00000, 0x80000, BAD_DUMP CRC(391ca913) SHA1(2cc329aa6419f8a0d7e0fb8a9f4c2b8ca25197b3) ) | |
| 207 | // c'est la programme de stepstag (avoir besoin de modifications, numero de chansons par example) | |
| 183 | 208 | |
| 209 | ROM_REGION( 0x100000, "sub", 0 ) /* 68k */ | |
| 210 | ROM_LOAD16_BYTE( "vj98348_step3_11_v1.1", 0x00000, 0x80000, CRC(9c36aef5) SHA1(bbac48c2c7949a6f8a6ec83515e94a343c88d1b6) ) | |
| 211 | ROM_LOAD16_BYTE( "vj98348_step3_14_v1.1", 0x00001, 0x80000, CRC(b86be557) SHA1(49dbd6ef1c50adcf3386d5423da8ae7685649c46) ) | |
| 212 | ||
| 213 | ROM_REGION( 0x1000000, "gfx1", 0 ) /* */ | |
| 214 | ROM_LOAD( "mr9930-01.ic2", 0x000000, 0x400000, CRC(9e3e054e) SHA1(06a4fa76cb83dbe9d565d5ccd0a5ecc5067887c9) ) | |
| 215 | ||
| 216 | ROM_REGION( 0x1000000, "gfx2", 0 ) /* */ | |
| 217 | ROM_LOAD( "mr9930-02.ic3", 0x000000, 0x400000, CRC(b23c29f4) SHA1(a7b10a3a9af43db319baf8633bb3728120960923) ) | |
| 218 | ||
| 219 | ROM_REGION( 0x1000000, "gfx3", 0 ) /* */ | |
| 220 | ROM_LOAD( "mr9930-03.ic4", 0x000000, 0x400000, CRC(9a5d070f) SHA1(b4668b4f299033140a2c56499cc2712ba111cb57) ) | |
| 221 | ||
| 222 | ROM_REGION( 0x1000000, "gfx4", 0 ) /* screen centre */ | |
| 223 | ROM_LOAD( "mr99030-04.ic17", 0x000000, 0x400000, CRC(3eac3591) SHA1(3b294e94af23fd92fdf51d2c9c43f60d2ebd1688) ) | |
| 224 | ||
| 225 | ROM_REGION( 0x1000000, "gfx5", 0 ) /* */ | |
| 226 | ROM_LOAD( "mr99030-05.ic18", 0x000000, 0x400000, CRC(dea7b8d6) SHA1(d7d98675eb3998a8057929f90aa340c1e5f6a617) ) | |
| 227 | ||
| 228 | ROM_REGION( 0x1000000, "gfx6", 0 ) /* */ | |
| 229 | ROM_LOAD( "mr99030-06.ic19", 0x000000, 0x400000, CRC(71489d79) SHA1(0398a354c2588e3974cb76a331e46165db6af06d) ) | |
| 230 | ||
| 231 | ROM_REGION( 0x1000000, "gfx7", 0 ) /* */ | |
| 232 | ROM_LOAD( "mr9930-01.ic30", 0x000000, 0x400000, CRC(9e3e054e) SHA1(06a4fa76cb83dbe9d565d5ccd0a5ecc5067887c9) ) | |
| 233 | ROM_LOAD( "mr9930-02.ic29", 0x400000, 0x400000, CRC(b23c29f4) SHA1(a7b10a3a9af43db319baf8633bb3728120960923) ) | |
| 234 | ROM_LOAD( "mr9930-03.ic28", 0x800000, 0x400000, CRC(9a5d070f) SHA1(b4668b4f299033140a2c56499cc2712ba111cb57) ) | |
| 235 | ||
| 236 | ROM_REGION( 0x1000000, "gfx8", 0 ) /* */ | |
| 237 | ROM_LOAD( "vj98348_step3_4_v1.1", 0x000000, 0x400000, CRC(dec612df) SHA1(acb86bb90c1cc61c7db3e022c69a5ff0611ffbae) ) | |
| 238 | ROM_LOAD( "vj98348_step3_18_v1.1", 0x400000, 0x400000, CRC(bc92f0a0) SHA1(49c08de7a898a27972d4209709ddf447c5dca36a) ) | |
| 239 | ROM_LOAD( "vj98348_step3_25_v1.1", 0x800000, 0x400000, CRC(dec612df) SHA1(acb86bb90c1cc61c7db3e022c69a5ff0611ffbae) ) | |
| 240 | ||
| 241 | DISK_REGION( "disks" ) | |
| 242 | DISK_IMAGE("step3", 0, NO_DUMP) | |
| 243 | ROM_END | |
| 244 | ||
| 184 | 245 | GAME( 1999, stepstag, 0, stepstag, stepstag, 0, ROT0, "Jaleco", "Stepping Stage", GAME_NO_SOUND| GAME_NOT_WORKING) |
| 246 | GAME( 1999, step3, stepstag, stepstag, stepstag, 0, ROT0, "Jaleco", "Stepping 3 Superior", GAME_NO_SOUND| GAME_NOT_WORKING) |
| r4184 | r4185 | |
|---|---|---|
| 26 | 26 | SX008-13.BIN ; | |
| 27 | 27 | SX008-14.BIN ; / |
| 28 | 28 | |
| 29 | ||
| 30 | Note: | |
| 31 | ||
| 32 | attract sound ON/OFF of DIPSW doesn't work. | |
| 33 | This is not a bug (real machine behaves the same). | |
| 29 | 34 | */ |
| 30 | 35 | |
| 31 | 36 | |
| 32 | 37 | #include "driver.h" |
| 38 | #include "deprecat.h" | |
| 33 | 39 | #include "cpu/z80/z80.h" |
| 34 | 40 | #include "cpu/mips/r3000.h" |
| 35 | 41 | #include "sound/st0016.h" |
| 36 | 42 | #include "st0016.h" |
| 37 | 43 | |
| 44 | #define DEBUG_CHAR | |
| 38 | 45 | extern UINT8 *st0016_charram; |
| 39 | 46 | static UINT32 databank; |
| 40 | ||
| 41 | static UINT16 *tileram; | |
| 47 | static UINT32 srmp5_vidregs[0x120 / 4]; | |
| 48 | static UINT16 *tileram, *palram; | |
| 42 | 49 | static UINT16 *sprram; |
| 50 | static UINT8 cmd1 = 0, cmd2 = 0, cmd_stat = 0; | |
| 43 | 51 | |
| 52 | #ifdef DEBUG_CHAR | |
| 53 | static UINT8 tileduty[0x2000]; | |
| 54 | #endif | |
| 55 | ||
| 44 | 56 | #define SPRITE_GLOBAL_X 0 |
| 45 | 57 | #define SPRITE_GLOBAL_Y 1 |
| 46 | 58 | #define SUBLIST_OFFSET 2 |
| r4184 | r4185 | |
| 63 | 75 | |
| 64 | 76 | static VIDEO_UPDATE( srmp5 ) |
| 65 | 77 | { |
| 66 | // sprite/tile flipping is not implemented | |
| 67 | int x,y,address,xs,ys,height,width,xw,yw,sprite,xb,yb,sizex,sizey; | |
| 78 | int x,y,address,xs,xs2,ys,ys2,height,width,xw,yw,xb,yb,sizex,sizey; | |
| 68 | 79 | UINT16 *sprite_list=sprram; |
| 69 | UINT16 *sprite_list_end=&sprram[0x | |
| 80 | UINT16 *sprite_list_end=&sprram[0x4000]; //guess | |
| 70 | 81 | UINT8 *pixels=(UINT8 *)tileram; |
| 71 | 82 | const rectangle *visarea = video_screen_get_visible_area(screen); |
| 72 | 83 | |
| 73 | bitmap_fill(bitmap,cliprect,0); | |
| 84 | //Table surface seems to be tiles, but display corrupts when switching the scene if always ON. | |
| 85 | //Currently the tiles are OFF. | |
| 86 | #ifdef BG_ENABLE | |
| 87 | UINT8 tile_width = (srmp5_vidregs[2] >> 0) & 0xFF; | |
| 88 | UINT8 tile_height = (srmp5_vidregs[2] >> 8) & 0xFF; | |
| 89 | if(tile_width && tile_height) | |
| 90 | { | |
| 91 | // 16x16 tile | |
| 92 | UINT16 *map = &sprram[0x2000]; | |
| 93 | for(yw = 0; yw < tile_height; yw++) | |
| 94 | { | |
| 95 | for(xw = 0; xw < tile_width; xw++) | |
| 96 | { | |
| 97 | UINT16 tile = map[yw * 128 + xw * 2]; | |
| 98 | if(tile >= 0x2000) continue; | |
| 74 | 99 | |
| 100 | address = tile * SPRITE_DATA_GRANULARITY; | |
| 101 | for(y = 0; y < 16; y++) | |
| 102 | { | |
| 103 | for(x = 0; x < 16; x++) | |
| 104 | { | |
| 105 | UINT8 pen = pixels[address]; | |
| 106 | if(pen) | |
| 107 | { | |
| 108 | UINT16 pixdata=palram[pen]; | |
| 109 | *BITMAP_ADDR32(bitmap, yw * 16 + y, xw * 16 + x) = ((pixdata&0x7c00)>>7) | ((pixdata&0x3e0)<<6) | ((pixdata&0x1f)<<19); | |
| 110 | } | |
| 111 | address++; | |
| 112 | } | |
| 113 | } | |
| 114 | } | |
| 115 | } | |
| 116 | } | |
| 117 | else | |
| 118 | #endif | |
| 119 | bitmap_fill(bitmap,cliprect,0); | |
| 120 | ||
| 75 | 121 | while((sprite_list[SUBLIST_OFFSET]&SPRITE_LIST_END_MARKER)==0 && sprite_list<sprite_list_end) |
| 76 | 122 | { |
| 77 | 123 | UINT16 *sprite_sublist=&sprram[sprite_list[SUBLIST_OFFSET]<<SUBLIST_OFFSET_SHIFT]; |
| r4184 | r4185 | |
| 84 | 130 | global_y=(INT16)sprite_list[SPRITE_GLOBAL_Y]; |
| 85 | 131 | while(sublist_length) |
| 86 | 132 | { |
| 87 | sprite=sprite_sublist[SPRITE_TILE]; | |
| 88 | 133 | x=(INT16)sprite_sublist[SPRITE_LOCAL_X]+global_x; |
| 89 | 134 | y=(INT16)sprite_sublist[SPRITE_LOCAL_Y]+global_y; |
| 90 | width=(sprite_sublist[SPRITE_SIZE]>>4)&0xf; | |
| 135 | width =(sprite_sublist[SPRITE_SIZE]>> 4)&0xf; | |
| 91 | 136 | height=(sprite_sublist[SPRITE_SIZE]>>12)&0xf; |
| 92 | 137 | |
| 93 | 138 | sizex=(sprite_sublist[SPRITE_SIZE]>>0)&0xf; |
| 94 | 139 | sizey=(sprite_sublist[SPRITE_SIZE]>>8)&0xf; |
| 95 | 140 | |
| 96 | address=sprite*SPRITE_DATA_GRANULARITY; | |
| 141 | address=(sprite_sublist[SPRITE_TILE] & ~(sprite_sublist[SPRITE_SIZE] >> 11 & 7))*SPRITE_DATA_GRANULARITY; | |
| 142 | y -= (height + 1) * (sizey + 1)-1; | |
| 97 | 143 | for(xw=0;xw<=width;xw++) |
| 144 | { | |
| 145 | xb = (sprite_sublist[SPRITE_PALETTE] & 0x8000) ? (width-xw)*(sizex+1)+x: xw*(sizex+1)+x; | |
| 98 | 146 | for(yw=0;yw<=height;yw++) |
| 99 | 147 | { |
| 100 | xb=x+xw*(sizex+1); | |
| 101 | yb=y+yw*(sizey+1); | |
| 148 | yb = yw*(sizey+1)+y; | |
| 102 | 149 | for(ys=0;ys<=sizey;ys++) |
| 103 | 150 | { |
| 151 | ys2 = (sprite_sublist[SPRITE_PALETTE] & 0x4000) ? ys : (sizey - ys); | |
| 104 | 152 | for(xs=0;xs<=sizex;xs++) |
| 105 | 153 | { |
| 106 | UINT32 pen=pixels[address&(0x100000-1)]; | |
| 107 | ||
| 154 | UINT8 pen=pixels[address&(0x100000-1)]; | |
| 155 | xs2 = (sprite_sublist[SPRITE_PALETTE] & 0x8000) ? (sizex - xs) : xs; | |
| 108 | 156 | if(pen) |
| 109 | 157 | { |
| 110 | if(xb+xs<=visarea->max_x && xb+xs>=visarea->min_x && yb+ys<=visarea->max_y && yb+ys>=visarea->min_y ) | |
| 158 | if(xb+xs2<=visarea->max_x && xb+xs2>=visarea->min_x && yb+ys2<=visarea->max_y && yb+ys2>=visarea->min_y ) | |
| 111 | 159 | { |
| 112 | UINT32 pixdata=paletteram32[pen+((sprite_sublist[SPRITE_PALETTE]&0xff)<<8)]; | |
| 113 | *BITMAP_ADDR32(bitmap, yb+ys, xb+xs) = ((pixdata&0x7c00)>>7) | ((pixdata&0x3e0)<<6) | ((pixdata&0x1f)<<19); | |
| 160 | UINT16 pixdata=palram[pen+((sprite_sublist[SPRITE_PALETTE]&0xff)<<8)]; | |
| 161 | *BITMAP_ADDR32(bitmap, yb+ys2, xb+xs2) = ((pixdata&0x7c00)>>7) | ((pixdata&0x3e0)<<6) | ((pixdata&0x1f)<<19); | |
| 114 | 162 | } |
| 115 | 163 | } |
| 116 | 164 | ++address; |
| 117 | 165 | } |
| 118 | 166 | } |
| 119 | ||
| 120 | 167 | } |
| 168 | } | |
| 121 | 169 | sprite_sublist+=SPRITE_SUBLIST_ENTRY_LENGTH; |
| 122 | 170 | --sublist_length; |
| 123 | 171 | } |
| r4184 | r4185 | |
| 125 | 173 | sprite_list+=SPRITE_LIST_ENTRY_LENGTH; |
| 126 | 174 | } |
| 127 | 175 | |
| 176 | #ifdef DEBUG_CHAR | |
| 177 | { | |
| 178 | int i; | |
| 179 | for(i = 0; i < 0x2000; i++) | |
| 180 | { | |
| 181 | if(tileduty[i] == 1) | |
| 182 | { | |
| 183 | decodechar(screen->machine->gfx[0], i, (UINT8 *)tileram); | |
| 184 | tileduty[i] = 0; | |
| 185 | } | |
| 186 | } | |
| 187 | } | |
| 188 | #endif | |
| 128 | 189 | return 0; |
| 129 | 190 | } |
| 130 | 191 | |
| 192 | static READ32_HANDLER(srmp5_palette_r) | |
| 193 | { | |
| 194 | return palram[offset]; | |
| 195 | } | |
| 196 | ||
| 197 | static WRITE32_HANDLER(srmp5_palette_w) | |
| 198 | { | |
| 199 | COMBINE_DATA(&palram[offset]); | |
| 200 | palette_set_color(space->machine, offset, MAKE_RGB(data << 3 & 0xFF, data >> 2 & 0xFF, data >> 7 & 0xFF)); | |
| 201 | } | |
| 131 | 202 | static WRITE32_HANDLER(bank_w) |
| 132 | 203 | { |
| 133 | 204 | COMBINE_DATA(&databank); |
| r4184 | r4185 | |
| 135 | 206 | |
| 136 | 207 | static READ32_HANDLER(tileram_r) |
| 137 | 208 | { |
| 138 | return | |
| 209 | return tile | |
| 139 | 210 | } |
| 140 | 211 | |
| 141 | 212 | static WRITE32_HANDLER(tileram_w) |
| 142 | 213 | { |
| 143 | COMBINE_DATA(&videoram32[offset]); | |
| 144 | tileram[offset]=videoram32[offset]&0xffff; | |
| 214 | tileram[offset] = data & 0xFFFF; //lower 16bit only | |
| 215 | #ifdef DEBUG_CHAR | |
| 216 | tileduty[offset >> 6] = 1; | |
| 217 | #endif | |
| 145 | 218 | } |
| 146 | 219 | |
| 147 | 220 | static READ32_HANDLER(spr_r) |
| 148 | 221 | { |
| 149 | return spr | |
| 222 | return spr | |
| 150 | 223 | } |
| 151 | 224 | |
| 152 | 225 | static WRITE32_HANDLER(spr_w) |
| 153 | 226 | { |
| 154 | COMBINE_DATA(&spriteram32[offset]); | |
| 155 | sprram[offset]=spriteram32[offset]; | |
| 227 | sprram[offset] = data & 0xFFFF; //lower 16bit only | |
| 156 | 228 | } |
| 157 | 229 | |
| 158 | 230 | static READ32_HANDLER(data_r) |
| r4184 | r4185 | |
| 164 | 236 | return data|(data<<16); |
| 165 | 237 | } |
| 166 | 238 | |
| 239 | static UINT8 input_select = 0; | |
| 240 | ||
| 241 | static WRITE32_HANDLER(input_select_w) | |
| 242 | { | |
| 243 | input_select = data & 0x0F; | |
| 244 | } | |
| 245 | ||
| 246 | static READ32_HANDLER(srmp5_inputs_r) | |
| 247 | { | |
| 248 | UINT32 ret = 0; | |
| 249 | switch(input_select) | |
| 250 | { | |
| 251 | case 0x01: | |
| 252 | ret = input_port_read(space->machine, "IN0"); | |
| 253 | break; | |
| 254 | case 0x02: | |
| 255 | ret = input_port_read(space->machine, "IN1"); | |
| 256 | break; | |
| 257 | case 0x04: | |
| 258 | ret = input_port_read(space->machine, "IN2"); | |
| 259 | break; | |
| 260 | case 0x00: | |
| 261 | case 0x08: | |
| 262 | ret = input_port_read(space->machine, "IN3"); | |
| 263 | break; | |
| 264 | } | |
| 265 | return ret; | |
| 266 | } | |
| 267 | ||
| 268 | //almost all cmds are sound related | |
| 269 | static WRITE32_HANDLER(cmd1_w) | |
| 270 | { | |
| 271 | cmd1 = data & 0xFF; | |
| 272 | logerror("cmd1_w %08X\n", data); | |
| 273 | } | |
| 274 | ||
| 275 | static WRITE32_HANDLER(cmd2_w) | |
| 276 | { | |
| 277 | cmd2 = data & 0xFF; | |
| 278 | cmd_stat = 5; | |
| 279 | logerror("cmd2_w %08X\n", data); | |
| 280 | } | |
| 281 | ||
| 282 | static READ32_HANDLER(cmd_stat32_r) | |
| 283 | { | |
| 284 | return cmd_stat; | |
| 285 | } | |
| 286 | ||
| 287 | static READ32_HANDLER(srmp5_vidregs_r) | |
| 288 | { | |
| 289 | logerror("vidregs read %08X %08X\n", offset << 2, srmp5_vidregs[offset]); | |
| 290 | return srmp5_vidregs[offset]; | |
| 291 | } | |
| 292 | ||
| 293 | static WRITE32_HANDLER(srmp5_vidregs_w) | |
| 294 | { | |
| 295 | COMBINE_DATA(&srmp5_vidregs[offset]); | |
| 296 | if(offset != 0x10C / 4) | |
| 297 | logerror("vidregs write %08X %08X\n", offset << 2, srmp5_vidregs[offset]); | |
| 298 | } | |
| 299 | ||
| 167 | 300 | static ADDRESS_MAP_START( srmp5_mem, ADDRESS_SPACE_PROGRAM, 32 ) |
| 168 | 301 | AM_RANGE(0x00000000, 0x000fffff) AM_RAM //maybe 0 - 2fffff ? |
| 169 | 302 | AM_RANGE(0x002f0000, 0x002f7fff) AM_RAM |
| 170 | 303 | AM_RANGE(0x01000000, 0x01000003) AM_WRITE(SMH_RAM) // 0xaa .. watchdog ? |
| 171 | AM_RANGE(0x01800004, 0x01800007) AM_READ_PORT("IN0") | |
| 172 | AM_RANGE(0x01800008, 0x0180000b) AM_READ_PORT("IN1") | |
| 304 | AM_RANGE(0x01800000, 0x01800003) AM_RAM //?1 | |
| 305 | AM_RANGE(0x01800004, 0x01800007) AM_READ_PORT("DSW1") | |
| 306 | AM_RANGE(0x01800008, 0x0180000b) AM_READ_PORT("DSW2") | |
| 173 | 307 | AM_RANGE(0x0180000c, 0x0180000f) AM_WRITE(bank_w) |
| 174 | AM_RANGE(0x01800010, 0x01800013) AM_READ_PORT("IN2") //multiplexed controls (selected by writes to 1c) | |
| 175 | AM_RANGE(0x01800014, 0x01800017) AM_READ_PORT("IN3") | |
| 176 | AM_RANGE(0x0180001c, 0x0180001f) AM_WRITE(SMH_RAM)//c1 c2 c4 c8 => mahjong inputs (at $10) - bits 0-3 | |
| 177 | AM_RANGE(0x01800200, 0x0180020f) AM_RAM //sound related ? only few writes after boot | |
| 308 | AM_RANGE(0x01800010, 0x01800013) AM_READ(srmp5_inputs_r) //multiplexed controls (selected by writes to 1c) | |
| 309 | AM_RANGE(0x01800014, 0x01800017) AM_READ_PORT("TEST") | |
| 310 | AM_RANGE(0x0180001c, 0x0180001f) AM_WRITE(input_select_w)//c1 c2 c4 c8 => mahjong inputs (at $10) - bits 0-3 | |
| 311 | AM_RANGE(0x01800200, 0x01800203) AM_RAM //sound related ? only few writes after boot | |
| 312 | AM_RANGE(0x01802000, 0x01802003) AM_WRITE(cmd1_w) | |
| 313 | AM_RANGE(0x01802004, 0x01802007) AM_WRITE(cmd2_w) | |
| 314 | AM_RANGE(0x01802008, 0x0180200b) AM_READ(cmd_stat32_r) | |
| 178 | 315 | AM_RANGE(0x01a00000, 0x01bfffff) AM_READ(data_r) |
| 316 | AM_RANGE(0x01c00000, 0x01c00003) AM_READNOP // debug? 'Toru' | |
| 179 | 317 | |
| 180 | AM_RANGE(0x0a000000, 0x0a0fffff) AM_READWRITE(spr_r, spr_w) AM_BASE(&spriteram32) | |
| 181 | AM_RANGE(0x0a100000, 0x0a1fffff) AM_RAM AM_BASE(&paletteram32) | |
| 182 | AM_RANGE(0x0a200000, 0x0a3fffff) AM_READWRITE(tileram_r, tileram_w) AM_BASE(&videoram32) | |
| 318 | AM_RANGE(0x0a000000, 0x0a0fffff) AM_READWRITE(spr_r, spr_w) | |
| 319 | AM_RANGE(0x0a100000, 0x0a17ffff) AM_READWRITE(srmp5_palette_r, srmp5_palette_w) | |
| 320 | //0?N???A?????????i?????????? | |
| 321 | AM_RANGE(0x0a180000, 0x0a180003) AM_READNOP // write 0x00000400 | |
| 322 | AM_RANGE(0x0a180000, 0x0a18011f) AM_READWRITE(srmp5_vidregs_r, srmp5_vidregs_w) | |
| 323 | AM_RANGE(0x0a200000, 0x0a3fffff) AM_READWRITE(tileram_r, tileram_w) | |
| 183 | 324 | |
| 184 | 325 | AM_RANGE(0x1eff0000, 0x1eff001f) AM_WRITE(SMH_RAM) |
| 185 | 326 | AM_RANGE(0x1eff003c, 0x1eff003f) AM_READNOP |
| r4184 | r4185 | |
| 190 | 331 | static ADDRESS_MAP_START( st0016_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 191 | 332 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 192 | 333 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1) |
| 193 | AM_RANGE(0xc000, 0xcfff) AM_READ(st0016_sprite_ram_r) AM_WRITE(st0016_sprite_ram_w) | |
| 194 | AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w) | |
| 195 | AM_RANGE(0xe000, 0xe7ff) AM_RAM | |
| 196 | AM_RANGE(0xe800, 0xe87f) AM_RAM | |
| 197 | 334 | AM_RANGE(0xe900, 0xe9ff) AM_RAM_WRITE(st0016_snd_w) AM_BASE(&st0016_sound_regs) |
| 198 | AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w) | |
| 199 | 335 | AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w) |
| 200 | 336 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 201 | 337 | ADDRESS_MAP_END |
| 202 | 338 | |
| 203 | 339 | READ8_HANDLER(st0016_dma_r); |
| 204 | 340 | |
| 341 | static READ8_HANDLER(cmd1_r) | |
| 342 | { | |
| 343 | cmd_stat = 0; | |
| 344 | return cmd1; | |
| 345 | } | |
| 346 | ||
| 347 | static READ8_HANDLER(cmd2_r) | |
| 348 | { | |
| 349 | return cmd2; | |
| 350 | } | |
| 351 | ||
| 352 | static READ8_HANDLER(cmd_stat8_r) | |
| 353 | { | |
| 354 | return cmd_stat; | |
| 355 | } | |
| 356 | ||
| 205 | 357 | static ADDRESS_MAP_START( st0016_io, ADDRESS_SPACE_IO, 8 ) |
| 206 | 358 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 207 | 359 | AM_RANGE(0x00, 0xbf) AM_READ(st0016_vregs_r) AM_WRITE(st0016_vregs_w) |
| 208 | AM_RANGE(0xc0, 0xc3) AM_NOP // data from other cpu ? | |
| 209 | AM_RANGE(0xe0, 0xe0) AM_WRITENOP | |
| 360 | AM_RANGE(0xc0, 0xc0) AM_READ(cmd1_r) | |
| 361 | AM_RANGE(0xc1, 0xc1) AM_READ(cmd2_r) | |
| 362 | AM_RANGE(0xc2, 0xc2) AM_READ(cmd_stat8_r) | |
| 210 | 363 | AM_RANGE(0xe1, 0xe1) AM_WRITE(st0016_rom_bank_w) |
| 211 | AM_RANGE(0xe2, 0xe2) AM_WRITE(st0016_sprite_bank_w) | |
| 212 | AM_RANGE(0xe3, 0xe4) AM_WRITE(st0016_character_bank_w) | |
| 213 | AM_RANGE(0xe5, 0xe5) AM_WRITE(st0016_palette_bank_w) | |
| 214 | AM_RANGE(0xe6, 0xe6) AM_WRITENOP | |
| 215 | AM_RANGE(0xe7, 0xe7) AM_WRITENOP | |
| 364 | AM_RANGE(0xe7, 0xe7) AM_WRITE(st0016_rom_bank_w) | |
| 216 | 365 | AM_RANGE(0xf0, 0xf0) AM_READ(st0016_dma_r) |
| 217 | 366 | ADDRESS_MAP_END |
| 218 | 367 | |
| 219 | 368 | |
| 220 | 369 | static INPUT_PORTS_START( srmp5 ) |
| 221 | PORT_START("IN0") | |
| 222 | PORT_DIPNAME( 0x0001, 0x0001, "0-0" ) | |
| 223 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) | |
| 224 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 225 | PORT_DIPNAME( 0x0002, 0x0002, "0-1" ) | |
| 226 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) | |
| 227 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 228 | PORT_DIPNAME( 0x0004, 0x0004, "0-2" ) | |
| 229 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 230 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 231 | PORT_DIPNAME( 0x0008, 0x0008, "0-3" ) | |
| 232 | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) | |
| 233 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 234 | PORT_DIPNAME( 0x0010, 0x0010, "0-4" ) | |
| 235 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) | |
| 236 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 237 | PORT_DIPNAME( 0x0020, 0x0020, "0-5" ) | |
| 238 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) | |
| 239 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 240 | PORT_DIPNAME( 0x0040, 0x0040, "0-6" ) | |
| 241 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) | |
| 242 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 243 | PORT_DIPNAME( 0x0080, 0x0080, "0-7" ) | |
| 244 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) | |
| 245 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 246 | PORT_DIPNAME( 0x0100, 0x0100, "0-8" ) | |
| 247 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) | |
| 248 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 249 | PORT_DIPNAME( 0x0200, 0x0200, "0-9" ) | |
| 250 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) | |
| 251 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 252 | PORT_DIPNAME( 0x0400, 0x0400, "0-a" ) | |
| 253 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) | |
| 254 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 255 | PORT_DIPNAME( 0x0800, 0x0800, "0-b" ) | |
| 256 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) | |
| 257 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 258 | PORT_DIPNAME( 0x1000, 0x1000, "0-c" ) | |
| 259 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) | |
| 260 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 261 | PORT_DIPNAME( 0x2000, 0x2000, "0-d" ) | |
| 262 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) | |
| 263 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 264 | PORT_DIPNAME( 0x4000, 0x4000, "0-e" ) | |
| 265 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) | |
| 266 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 267 | PORT_DIPNAME( 0x8000, 0x8000, "0-f" ) | |
| 268 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) | |
| 269 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 270 | PORT_DIPNAME( 0x00010000, 0x00010000, "0-10" ) | |
| 271 | PORT_DIPSETTING( 0x00010000, DEF_STR( Off ) ) | |
| 272 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 273 | PORT_DIPNAME( 0x00020000, 0x00020000, "0-11" ) | |
| 274 | PORT_DIPSETTING( 0x00020000, DEF_STR( Off ) ) | |
| 275 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 276 | PORT_DIPNAME( 0x00040000, 0x00040000, "0-12" ) | |
| 277 | PORT_DIPSETTING( 0x00040000, DEF_STR( Off ) ) | |
| 278 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 279 | PORT_DIPNAME( 0x00080000, 0x00080000, "0-13" ) | |
| 280 | PORT_DIPSETTING( 0x00080000, DEF_STR( Off ) ) | |
| 281 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 282 | PORT_DIPNAME( 0x00100000, 0x00100000, "0-14" ) | |
| 283 | PORT_DIPSETTING( 0x00100000, DEF_STR( Off ) ) | |
| 284 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 285 | PORT_DIPNAME( 0x00200000, 0x00200000, "0-15" ) | |
| 286 | PORT_DIPSETTING( 0x00200000, DEF_STR( Off ) ) | |
| 287 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 288 | PORT_DIPNAME( 0x00400000, 0x00400000, "0-16" ) | |
| 289 | PORT_DIPSETTING( 0x00400000, DEF_STR( Off ) ) | |
| 290 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 291 | PORT_DIPNAME( 0x00800000, 0x00800000, "0-17" ) | |
| 292 | PORT_DIPSETTING( 0x00800000, DEF_STR( Off ) ) | |
| 293 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 294 | PORT_DIPNAME( 0x01000000, 0x01000000, "0-18" ) | |
| 295 | PORT_DIPSETTING( 0x01000000, DEF_STR( Off ) ) | |
| 296 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 297 | PORT_DIPNAME( 0x02000000, 0x02000000, "0-19" ) | |
| 298 | PORT_DIPSETTING( 0x02000000, DEF_STR( Off ) ) | |
| 299 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 300 | PORT_DIPNAME( 0x04000000, 0x04000000, "0-1a" ) | |
| 301 | PORT_DIPSETTING( 0x04000000, DEF_STR( Off ) ) | |
| 302 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 303 | PORT_DIPNAME( 0x08000000, 0x08000000, "0-1b" ) | |
| 304 | PORT_DIPSETTING( 0x08000000, DEF_STR( Off ) ) | |
| 305 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 306 | PORT_DIPNAME( 0x10000000, 0x10000000, "0-1c" ) | |
| 307 | PORT_DIPSETTING( 0x10000000, DEF_STR( Off ) ) | |
| 308 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 309 | PORT_DIPNAME( 0x20000000, 0x20000000, "0-1d" ) | |
| 310 | PORT_DIPSETTING( 0x20000000, DEF_STR( Off ) ) | |
| 311 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 312 | PORT_DIPNAME( 0x40000000, 0x40000000, "0-1e" ) | |
| 313 | PORT_DIPSETTING( 0x40000000, DEF_STR( Off ) ) | |
| 314 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 315 | PORT_DIPNAME( 0x80000000, 0x80000000, "0-1f" ) | |
| 316 | PORT_DIPSETTING( 0x80000000, DEF_STR( Off ) ) | |
| 317 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 370 | PORT_START("DSW1") | |
| 371 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) | |
| 372 | PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) | |
| 373 | PORT_DIPSETTING( 0x0001, DEF_STR( 4C_1C ) ) | |
| 374 | PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) ) | |
| 375 | PORT_DIPSETTING( 0x0003, DEF_STR( 2C_1C ) ) | |
| 376 | PORT_DIPSETTING( 0x0007, DEF_STR( 1C_1C ) ) | |
| 377 | PORT_DIPSETTING( 0x0006, DEF_STR( 1C_2C ) ) | |
| 378 | PORT_DIPSETTING( 0x0005, DEF_STR( 1C_3C ) ) | |
| 379 | PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) | |
| 380 | PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) | |
| 381 | PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) | |
| 382 | PORT_DIPSETTING( 0x0008, DEF_STR( 4C_1C ) ) | |
| 383 | PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) | |
| 384 | PORT_DIPSETTING( 0x0018, DEF_STR( 2C_1C ) ) | |
| 385 | PORT_DIPSETTING( 0x0038, DEF_STR( 1C_1C ) ) | |
| 386 | PORT_DIPSETTING( 0x0030, DEF_STR( 1C_2C ) ) | |
| 387 | PORT_DIPSETTING( 0x0028, DEF_STR( 1C_3C ) ) | |
| 388 | PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) | |
| 389 | PORT_DIPNAME( 0x0040, 0x0040, "PUT" ) | |
| 390 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 391 | PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) | |
| 392 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) | |
| 393 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 394 | PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) | |
| 395 | PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 318 | 396 | |
| 319 | PORT_START("IN1") | |
| 320 | PORT_DIPNAME( 0x0001, 0x0001, "1-0" ) | |
| 321 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) | |
| 322 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 323 | PORT_DIPNAME( 0x0002, 0x0002, "1-1" ) | |
| 324 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) | |
| 325 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 326 | PORT_DIPNAME( 0x0004, 0x0004, "1-2" ) | |
| 327 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 328 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 329 | PORT_DIPNAME( 0x0008, 0x0008, "1-3" ) | |
| 330 | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) | |
| 331 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 332 | PORT_DIPNAME( 0x0010, 0x0010, "1-4" ) | |
| 333 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) | |
| 334 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 335 | PORT_DIPNAME( 0x0020, 0x0020, "1-5" ) | |
| 336 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) | |
| 337 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 338 | PORT_DIPNAME( 0x0040, 0x0040, "1-6" ) | |
| 397 | PORT_START("DSW2") | |
| 398 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Difficulty ) ) | |
| 399 | PORT_DIPSETTING( 0x0000, "8" ) | |
| 400 | PORT_DIPSETTING( 0x0001, "7" ) | |
| 401 | PORT_DIPSETTING( 0x0002, "6" ) | |
| 402 | PORT_DIPSETTING( 0x0003, "5" ) | |
| 403 | PORT_DIPSETTING( 0x0007, "4" ) | |
| 404 | PORT_DIPSETTING( 0x0006, "1" ) | |
| 405 | PORT_DIPSETTING( 0x0005, "2" ) | |
| 406 | PORT_DIPSETTING( 0x0004, "3" ) | |
| 407 | PORT_DIPNAME( 0x0008, 0x0008, "Kuitan" ) | |
| 408 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 409 | PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) | |
| 410 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Allow_Continue ) ) | |
| 411 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 412 | PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) | |
| 413 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) | |
| 414 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 415 | PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) | |
| 416 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) | |
| 339 | 417 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 340 | 418 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 341 | PORT_DIPNAME( 0x0080, 0x0080, | |
| 419 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Test ) | |
| 342 | 420 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 343 | 421 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 344 | PORT_DIPNAME( 0x0100, 0x0100, "1-8" ) | |
| 345 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) | |
| 346 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 347 | PORT_DIPNAME( 0x0200, 0x0200, "1-9" ) | |
| 348 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) | |
| 349 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 350 | PORT_DIPNAME( 0x0400, 0x0400, "1-a" ) | |
| 351 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) | |
| 352 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 353 | PORT_DIPNAME( 0x0800, 0x0800, "1-b" ) | |
| 354 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) | |
| 355 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 356 | PORT_DIPNAME( 0x1000, 0x1000, "1-c" ) | |
| 357 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) | |
| 358 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 359 | PORT_DIPNAME( 0x2000, 0x2000, "1-d" ) | |
| 360 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) | |
| 361 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 362 | PORT_DIPNAME( 0x4000, 0x4000, "1-e" ) | |
| 363 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) | |
| 364 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 365 | PORT_DIPNAME( 0x8000, 0x8000, "1-f" ) | |
| 366 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) | |
| 367 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 422 | PORT_BIT ( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 368 | 423 | |
| 369 | PORT_DIPNAME( 0x00010000, 0x00010000, "1-10" ) | |
| 370 | PORT_DIPSETTING( 0x00010000, DEF_STR( Off ) ) | |
| 371 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 372 | PORT_DIPNAME( 0x00020000, 0x00020000, "1-11" ) | |
| 373 | PORT_DIPSETTING( 0x00020000, DEF_STR( Off ) ) | |
| 374 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 375 | PORT_DIPNAME( 0x00040000, 0x00040000, "1-12" ) | |
| 376 | PORT_DIPSETTING( 0x00040000, DEF_STR( Off ) ) | |
| 377 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 378 | PORT_DIPNAME( 0x00080000, 0x00080000, "1-13" ) | |
| 379 | PORT_DIPSETTING( 0x00080000, DEF_STR( Off ) ) | |
| 380 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 381 | PORT_DIPNAME( 0x00100000, 0x00100000, "1-14" ) | |
| 382 | PORT_DIPSETTING( 0x00100000, DEF_STR( Off ) ) | |
| 383 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 384 | PORT_DIPNAME( 0x00200000, 0x00200000, "1-15" ) | |
| 385 | PORT_DIPSETTING( 0x00200000, DEF_STR( Off ) ) | |
| 386 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 387 | PORT_DIPNAME( 0x00400000, 0x00400000, "1-16" ) | |
| 388 | PORT_DIPSETTING( 0x00400000, DEF_STR( Off ) ) | |
| 389 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 390 | PORT_DIPNAME( 0x00800000, 0x00800000, "1-17" ) | |
| 391 | PORT_DIPSETTING( 0x00800000, DEF_STR( Off ) ) | |
| 392 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 393 | PORT_DIPNAME( 0x01000000, 0x01000000, "1-18" ) | |
| 394 | PORT_DIPSETTING( 0x01000000, DEF_STR( Off ) ) | |
| 395 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 396 | PORT_DIPNAME( 0x02000000, 0x02000000, "1-19" ) | |
| 397 | PORT_DIPSETTING( 0x02000000, DEF_STR( Off ) ) | |
| 398 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 399 | PORT_DIPNAME( 0x04000000, 0x04000000, "1-1a" ) | |
| 400 | PORT_DIPSETTING( 0x04000000, DEF_STR( Off ) ) | |
| 401 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 402 | PORT_DIPNAME( 0x08000000, 0x08000000, "1-1b" ) | |
| 403 | PORT_DIPSETTING( 0x08000000, DEF_STR( Off ) ) | |
| 404 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 405 | PORT_DIPNAME( 0x10000000, 0x10000000, "1-1c" ) | |
| 406 | PORT_DIPSETTING( 0x10000000, DEF_STR( Off ) ) | |
| 407 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 408 | PORT_DIPNAME( 0x20000000, 0x20000000, "1-1d" ) | |
| 409 | PORT_DIPSETTING( 0x20000000, DEF_STR( Off ) ) | |
| 410 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 411 | PORT_DIPNAME( 0x40000000, 0x40000000, "1-1e" ) | |
| 412 | PORT_DIPSETTING( 0x40000000, DEF_STR( Off ) ) | |
| 413 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 414 | PORT_DIPNAME( 0x80000000, 0x80000000, "1-1f" ) | |
| 415 | PORT_DIPSETTING( 0x80000000, DEF_STR( Off ) ) | |
| 416 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 424 | PORT_START("IN0") | |
| 425 | PORT_BIT ( 0xfffffff0, IP_ACTIVE_LOW, IPT_UNUSED ) // explicitely discarded | |
| 426 | PORT_BIT ( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_D ) | |
| 427 | PORT_BIT ( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_H ) | |
| 428 | PORT_BIT ( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_L ) | |
| 429 | PORT_BIT ( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) | |
| 417 | 430 | |
| 431 | PORT_START("IN1") | |
| 432 | PORT_BIT ( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNUSED ) // explicitely discarded | |
| 433 | PORT_BIT ( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_A ) | |
| 434 | PORT_BIT ( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_E ) | |
| 435 | PORT_BIT ( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_I ) | |
| 436 | PORT_BIT ( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_M ) | |
| 437 | PORT_BIT ( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) | |
| 438 | PORT_BIT ( 0x00000020, IP_ACTIVE_LOW, IPT_START1 ) | |
| 439 | ||
| 418 | 440 | PORT_START("IN2") |
| 419 | PORT_DIPNAME( 0x0001, 0x0001, "2-0" ) | |
| 420 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) | |
| 421 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 422 | PORT_DIPNAME( 0x0002, 0x0002, "2-1" ) | |
| 423 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) | |
| 424 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 425 | PORT_DIPNAME( 0x0004, 0x0004, "2-2" ) | |
| 426 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 427 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 428 | PORT_DIPNAME( 0x0008, 0x0008, "2-3" ) | |
| 429 | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) | |
| 430 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 431 | PORT_DIPNAME( 0x0010, 0x0010, "2-4" ) | |
| 432 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) | |
| 433 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 441 | PORT_BIT ( 0xffffffe0, IP_ACTIVE_LOW, IPT_UNUSED ) // explicitely discarded | |
| 442 | PORT_BIT ( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_B ) | |
| 443 | PORT_BIT ( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_F ) | |
| 444 | PORT_BIT ( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_J ) | |
| 445 | PORT_BIT ( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_N ) | |
| 446 | PORT_BIT ( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) | |
| 434 | 447 | |
| 435 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) | |
| 436 | PORT_DIPNAME( 0x0040, 0x0040, "2-5" ) | |
| 437 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) | |
| 438 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 439 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 440 | PORT_DIPNAME( 0x0100, 0x0100, "2-8" ) | |
| 441 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) | |
| 442 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 443 | PORT_DIPNAME( 0x0200, 0x0200, "2-9" ) | |
| 444 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) | |
| 445 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 446 | PORT_DIPNAME( 0x0400, 0x0400, "2-a" ) | |
| 447 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) | |
| 448 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 449 | PORT_DIPNAME( 0x0800, 0x0800, "2-b" ) | |
| 450 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) | |
| 451 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 452 | PORT_DIPNAME( 0x1000, 0x1000, "2-c" ) | |
| 453 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) | |
| 454 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 455 | PORT_DIPNAME( 0x2000, 0x2000, "2-d" ) | |
| 456 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) | |
| 457 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 458 | PORT_DIPNAME( 0x4000, 0x4000, "2-e" ) | |
| 459 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) | |
| 460 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 461 | PORT_DIPNAME( 0x8000, 0x8000, "2-f" ) | |
| 462 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) | |
| 463 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 464 | ||
| 465 | PORT_DIPNAME( 0x00010000, 0x00010000, "2-10" ) | |
| 466 | PORT_DIPSETTING( 0x00010000, DEF_STR( Off ) ) | |
| 467 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 468 | PORT_DIPNAME( 0x00020000, 0x00020000, "2-11" ) | |
| 469 | PORT_DIPSETTING( 0x00020000, DEF_STR( Off ) ) | |
| 470 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 471 | PORT_DIPNAME( 0x00040000, 0x00040000, "2-12" ) | |
| 472 | PORT_DIPSETTING( 0x00040000, DEF_STR( Off ) ) | |
| 473 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 474 | PORT_DIPNAME( 0x00080000, 0x00080000, "2-13" ) | |
| 475 | PORT_DIPSETTING( 0x00080000, DEF_STR( Off ) ) | |
| 476 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 477 | PORT_DIPNAME( 0x00100000, 0x00100000, "2-14" ) | |
| 478 | PORT_DIPSETTING( 0x00100000, DEF_STR( Off ) ) | |
| 479 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 480 | PORT_DIPNAME( 0x00200000, 0x00200000, "2-15" ) | |
| 481 | PORT_DIPSETTING( 0x00200000, DEF_STR( Off ) ) | |
| 482 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 483 | PORT_DIPNAME( 0x00400000, 0x00400000, "2-16" ) | |
| 484 | PORT_DIPSETTING( 0x00400000, DEF_STR( Off ) ) | |
| 485 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 486 | PORT_DIPNAME( 0x00800000, 0x00800000, "2-17" ) | |
| 487 | PORT_DIPSETTING( 0x00800000, DEF_STR( Off ) ) | |
| 488 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 489 | PORT_DIPNAME( 0x01000000, 0x01000000, "2-18" ) | |
| 490 | PORT_DIPSETTING( 0x01000000, DEF_STR( Off ) ) | |
| 491 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 492 | PORT_DIPNAME( 0x02000000, 0x02000000, "2-19" ) | |
| 493 | PORT_DIPSETTING( 0x02000000, DEF_STR( Off ) ) | |
| 494 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 495 | PORT_DIPNAME( 0x04000000, 0x04000000, "2-1a" ) | |
| 496 | PORT_DIPSETTING( 0x04000000, DEF_STR( Off ) ) | |
| 497 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 498 | PORT_DIPNAME( 0x08000000, 0x08000000, "2-1b" ) | |
| 499 | PORT_DIPSETTING( 0x08000000, DEF_STR( Off ) ) | |
| 500 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 501 | PORT_DIPNAME( 0x10000000, 0x10000000, "2-1c" ) | |
| 502 | PORT_DIPSETTING( 0x10000000, DEF_STR( Off ) ) | |
| 503 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 504 | PORT_DIPNAME( 0x20000000, 0x20000000, "2-1d" ) | |
| 505 | PORT_DIPSETTING( 0x20000000, DEF_STR( Off ) ) | |
| 506 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 507 | PORT_DIPNAME( 0x40000000, 0x40000000, "2-1e" ) | |
| 508 | PORT_DIPSETTING( 0x40000000, DEF_STR( Off ) ) | |
| 509 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 510 | PORT_DIPNAME( 0x80000000, 0x80000000, "2-1f" ) | |
| 511 | PORT_DIPSETTING( 0x80000000, DEF_STR( Off ) ) | |
| 512 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 513 | ||
| 514 | 448 | PORT_START("IN3") |
| 515 | PORT_DIPNAME( 0x0001, 0x0001, "3-0" ) | |
| 516 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) | |
| 517 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 518 | PORT_DIPNAME( 0x0002, 0x0002, "3-1" ) | |
| 519 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) | |
| 520 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 521 | PORT_DIPNAME( 0x0004, 0x0004, "3-2" ) | |
| 522 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 523 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 524 | PORT_DIPNAME( 0x0008, 0x0008, "3-3" ) | |
| 525 | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) | |
| 526 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 527 | PORT_DIPNAME( 0x0010, 0x0010, "3-4" ) | |
| 528 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) | |
| 529 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 530 | PORT_DIPNAME( 0x0020, 0x0020, "3-5" ) | |
| 531 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) | |
| 532 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 533 | PORT_DIPNAME( 0x0040, 0x0040, "3-6" ) | |
| 534 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) | |
| 535 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 536 | PORT_DIPNAME( 0x0080, 0x0080, "3-7" ) | |
| 537 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) | |
| 538 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 539 | PORT_DIPNAME( 0x0100, 0x0100, "3-8" ) | |
| 540 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) | |
| 541 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 542 | PORT_DIPNAME( 0x0200, 0x0200, "3-9" ) | |
| 543 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) | |
| 544 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 545 | PORT_DIPNAME( 0x0400, 0x0400, "3-a" ) | |
| 546 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) | |
| 547 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 548 | PORT_DIPNAME( 0x0800, 0x0800, "3-b" ) | |
| 549 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) | |
| 550 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 551 | PORT_DIPNAME( 0x1000, 0x1000, "3-c" ) | |
| 552 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) | |
| 553 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 554 | PORT_DIPNAME( 0x2000, 0x2000, "3-d" ) | |
| 555 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) | |
| 556 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 557 | PORT_DIPNAME( 0x4000, 0x4000, "3-e" ) | |
| 558 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) | |
| 559 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 560 | PORT_DIPNAME( 0x8000, 0x8000, "3-f" ) | |
| 561 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) | |
| 562 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 449 | PORT_BIT ( 0xffffff60, IP_ACTIVE_LOW, IPT_UNUSED ) // explicitely discarded | |
| 450 | PORT_BIT ( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_C ) | |
| 451 | PORT_BIT ( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_G ) | |
| 452 | PORT_BIT ( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_K ) | |
| 453 | PORT_BIT ( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) | |
| 454 | PORT_BIT ( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) | |
| 455 | PORT_BIT ( 0x00000080, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) | |
| 563 | 456 | |
| 564 | PORT_DIPNAME( 0x00010000, 0x00010000, "3-10" ) | |
| 565 | PORT_DIPSETTING( 0x00010000, DEF_STR( Off ) ) | |
| 566 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 567 | PORT_DIPNAME( 0x00020000, 0x00020000, "3-11" ) | |
| 568 | PORT_DIPSETTING( 0x00020000, DEF_STR( Off ) ) | |
| 569 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 570 | PORT_DIPNAME( 0x00040000, 0x00040000, "3-12" ) | |
| 571 | PORT_DIPSETTING( 0x00040000, DEF_STR( Off ) ) | |
| 572 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 573 | PORT_DIPNAME( 0x00080000, 0x00080000, "3-13" ) | |
| 574 | PORT_DIPSETTING( 0x00080000, DEF_STR( Off ) ) | |
| 575 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 576 | PORT_DIPNAME( 0x00100000, 0x00100000, "3-14" ) | |
| 577 | PORT_DIPSETTING( 0x00100000, DEF_STR( Off ) ) | |
| 578 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 579 | PORT_DIPNAME( 0x00200000, 0x00200000, "3-15" ) | |
| 580 | PORT_DIPSETTING( 0x00200000, DEF_STR( Off ) ) | |
| 581 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 582 | PORT_DIPNAME( 0x00400000, 0x00400000, "3-16" ) | |
| 583 | PORT_DIPSETTING( 0x00400000, DEF_STR( Off ) ) | |
| 584 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 585 | PORT_DIPNAME( 0x00800000, 0x00800000, "3-17" ) | |
| 586 | PORT_DIPSETTING( 0x00800000, DEF_STR( Off ) ) | |
| 587 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 588 | PORT_DIPNAME( 0x01000000, 0x01000000, "3-18" ) | |
| 589 | PORT_DIPSETTING( 0x01000000, DEF_STR( Off ) ) | |
| 590 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 591 | PORT_DIPNAME( 0x02000000, 0x02000000, "3-19" ) | |
| 592 | PORT_DIPSETTING( 0x02000000, DEF_STR( Off ) ) | |
| 593 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 594 | PORT_DIPNAME( 0x04000000, 0x04000000, "3-1a" ) | |
| 595 | PORT_DIPSETTING( 0x04000000, DEF_STR( Off ) ) | |
| 596 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 597 | PORT_DIPNAME( 0x08000000, 0x08000000, "3-1b" ) | |
| 598 | PORT_DIPSETTING( 0x08000000, DEF_STR( Off ) ) | |
| 599 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 600 | PORT_DIPNAME( 0x10000000, 0x10000000, "3-1c" ) | |
| 601 | PORT_DIPSETTING( 0x10000000, DEF_STR( Off ) ) | |
| 602 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 603 | PORT_DIPNAME( 0x20000000, 0x20000000, "3-1d" ) | |
| 604 | PORT_DIPSETTING( 0x20000000, DEF_STR( Off ) ) | |
| 605 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 606 | PORT_DIPNAME( 0x40000000, 0x40000000, "3-1e" ) | |
| 607 | PORT_DIPSETTING( 0x40000000, DEF_STR( Off ) ) | |
| 608 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 609 | PORT_DIPNAME( 0x80000000, 0x80000000, "3-1f" ) | |
| 610 | PORT_DIPSETTING( 0x80000000, DEF_STR( Off ) ) | |
| 611 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) | |
| 457 | PORT_START("TEST") | |
| 458 | PORT_BIT ( 0x00000080, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2) | |
| 459 | PORT_BIT ( 0xffffff7f, IP_ACTIVE_LOW, IPT_UNUSED ) // explicitely discarded | |
| 460 | ||
| 612 | 461 | INPUT_PORTS_END |
| 613 | 462 | |
| 614 | 463 | static const st0016_interface st0016_config = |
| r4184 | r4185 | |
| 616 | 465 | &st0016_charram |
| 617 | 466 | }; |
| 618 | 467 | |
| 619 | static INTERRUPT_GEN( irq4_gen ) | |
| 468 | //It seems that interrupt flags are never cleared, so I use last line only. | |
| 469 | ||
| 470 | static INTERRUPT_GEN( irq4_gen ) | |
| 620 | 471 | { |
| 621 | cpu_set_input_line(device, R3000_IRQ4, ASSERT_LINE); | |
| 472 | if(cpu_getiloops(device) == 0) | |
| 473 | cpu_set_input_line(device, R3000_IRQ4, ASSERT_LINE); | |
| 474 | else | |
| 475 | cpu_set_input_line(device, R3000_IRQ4, CLEAR_LINE); | |
| 622 | 476 | } |
| 623 | 477 | |
| 624 | 478 | static const r3000_cpu_core config = |
| r4184 | r4185 | |
| 628 | 482 | 4096 /* data cache size */ |
| 629 | 483 | }; |
| 630 | 484 | |
| 485 | static const gfx_layout tile_16x8x8_layout = | |
| 486 | { | |
| 487 | 16,8, | |
| 488 | RGN_FRAC(1,1), | |
| 489 | 8, | |
| 490 | { STEP8(0, 1) }, | |
| 491 | { STEP16(0, 8) }, | |
| 492 | { STEP8(0, 8*16) }, | |
| 493 | 16*8*8 | |
| 494 | }; | |
| 495 | ||
| 496 | #if 0 | |
| 497 | static const gfx_layout tile_16x16x8_layout = | |
| 498 | { | |
| 499 | 16,16, | |
| 500 | RGN_FRAC(1,1), | |
| 501 | 8, | |
| 502 | { STEP8(0, 1) }, | |
| 503 | { STEP16(0, 8) }, | |
| 504 | { STEP16(0, 8*16) }, | |
| 505 | 16*16*8 | |
| 506 | }; | |
| 507 | #endif | |
| 508 | ||
| 509 | static GFXDECODE_START( srmp5 ) | |
| 510 | GFXDECODE_ENTRY( "gfx1", 0, tile_16x8x8_layout, 0x0, 0x800 ) | |
| 511 | // GFXDECODE_ENTRY( "gfx1", 0, tile_16x16x8_layout, 0x0, 0x800 ) | |
| 512 | GFXDECODE_END | |
| 513 | ||
| 631 | 514 | static MACHINE_DRIVER_START( srmp5 ) |
| 632 | 515 | /* basic machine hardware */ |
| 633 | 516 | MDRV_CPU_ADD("main",Z80,8000000) |
| r4184 | r4185 | |
| 638 | 521 | MDRV_CPU_ADD("sub", R3000LE, 25000000) |
| 639 | 522 | MDRV_CPU_CONFIG(config) |
| 640 | 523 | MDRV_CPU_PROGRAM_MAP(srmp5_mem,0) |
| 641 | MDRV_CPU_VBLANK_INT("main", irq4_gen) | |
| 524 | //256???K?? | |
| 525 | MDRV_CPU_VBLANK_INT_HACK(irq4_gen, 256) | |
| 642 | 526 | |
| 643 | 527 | MDRV_QUANTUM_TIME(HZ(6000)) |
| 644 | 528 | |
| 645 | 529 | /* video hardware */ |
| 646 | 530 | MDRV_SCREEN_ADD("main", RASTER) |
| 647 | 531 | MDRV_SCREEN_REFRESH_RATE(60) |
| 648 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 649 | 532 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 650 | MDRV_SCREEN_SIZE(512, 512) | |
| 651 | MDRV_SCREEN_VISIBLE_AREA(4, 339, 32, 271) | |
| 533 | MDRV_SCREEN_SIZE(96*8, 64*8) | |
| 534 | MDRV_SCREEN_VISIBLE_AREA(0*8, 42*8-1, 2*8, 32*8-1) | |
| 652 | 535 | |
| 653 | MDRV_PALETTE_LENGTH(16*16*4+1) | |
| 654 | ||
| 536 | MDRV_PALETTE_LENGTH(0x1800) | |
| 537 | #ifdef DEBUG_CHAR | |
| 538 | MDRV_GFXDECODE( srmp5 ) | |
| 539 | #endif | |
| 655 | 540 | MDRV_VIDEO_START(st0016) |
| 656 | 541 | MDRV_VIDEO_UPDATE(srmp5) |
| 657 | 542 | |
| r4184 | r4185 | |
| 683 | 568 | ROM_LOAD( "sx008-05.bin", 0x800000, 0x200000, CRC(0ff5e6f5) SHA1(ab7d021757f341d28db6d7d009c20ec9d7bd83c1) ) |
| 684 | 569 | ROM_LOAD( "sx008-06.bin", 0xa00000, 0x200000, CRC(ba6fd7c4) SHA1(f086195c5c647e07e77ce2a23e94d28e6ad9ff4f) ) |
| 685 | 570 | ROM_LOAD( "sx008-07.bin", 0xc00000, 0x200000, CRC(3564485d) SHA1(12464de4e2b6c4df1595183996d1987f0ecffb01) ) |
| 571 | #ifdef DEBUG_CHAR | |
| 572 | ROM_REGION( 0x100000, "gfx1", 0) | |
| 573 | ROM_FILL( 0, 0x100000, 0x00) | |
| 574 | #endif | |
| 686 | 575 | ROM_END |
| 687 | 576 | |
| 688 | 577 | static DRIVER_INIT(srmp5) |
| 689 | 578 | { |
| 690 | 579 | st0016_game=9; |
| 691 | tileram=(UINT16*)auto_malloc(0x100000); | |
| 692 | sprram=(UINT16*)auto_malloc(0x080000); | |
| 580 | tileram = (UINT16 *)auto_malloc(0x100000); | |
| 581 | sprram = (UINT16 *)auto_malloc(0x080000); | |
| 582 | palram = (UINT16 *)auto_malloc(0x040000); | |
| 583 | #ifdef DEBUG_CHAR | |
| 584 | memset(tileduty, 1, 0x2000); | |
| 585 | #endif | |
| 693 | 586 | } |
| 694 | 587 | |
| 695 | GAME( 1994, srmp5, 0, srmp5, srmp5, srmp5, ROT0, "Seta", "Super Real Mahjong P5", GAME_ | |
| 588 | GAME( 1994, srmp5, 0, srmp5, srmp5, srmp5, ROT0, "Seta", "Super Real Mahjong P5", GAME_IMPERFECT_G |
| r4184 | r4185 | |
|---|---|---|
| 765 | 765 | static INPUT_PORTS_START( psoldier ) |
| 766 | 766 | PORT_INCLUDE(m92_2player) |
| 767 | 767 | |
| 768 | PORT_MODIFY("P1_P2") | |
| 769 | IREM_GENERIC_JOYSTICKS_3_BUTTONS(1, 2) | |
| 770 | ||
| 768 | 771 | PORT_MODIFY("DSW") |
| 769 | 772 | /* Dip switch bank 1 */ |
| 770 | 773 | PORT_DIPNAME( 0x0020, 0x0000, "Any Button to Start" ) PORT_DIPLOCATION("SW1:6") |
| r4184 | r4185 | |
|---|---|---|
| 1 | 1 | /* |
| 2 | 2 | Virtual Combat hardware games. |
| 3 | 3 | |
| 4 | Driver by Jason Eckhardt | |
| 4 | Driver by Jason Eckhardt, | |
| 5 | 5 | |
| 6 | 6 | ---- |
| 7 | 7 | |
| r4184 | r4185 | |
| 11 | 11 | Virtual Combat (c) VR8 Inc. 1993 |
| 12 | 12 | http://arcade.sonzogni.com/VRCombat/ |
| 13 | 13 | |
| 14 | Shadow Fighters (German) (c) | |
| 14 | Shadow Fighters (German) (c) Dutech | |
| 15 | 15 | |
| 16 | 16 | ---- |
| 17 | 17 | |
| r4184 | r4185 | |
| 66 | 66 | - Most of the memory maps and input ports are complete now. |
| 67 | 67 | For "main", the only I/O locations that seem to be left |
| 68 | 68 | mysterious are: |
| 69 | 0x600010, | |
| 70 | 0x60000C: Only written; maybe mc6845? Often accessed | |
| 71 | together, and 16 consecutive words of data are | |
| 72 | written to 0x60000C, making me think it might be | |
| 73 | 6845-related. May or may not be important for | |
| 74 | reasonable emulation. | |
| 75 | 69 | 0x60001C: Only read; might be a latch of some sort. It is |
| 76 | 70 | read each time M0's interrupt service routine syncs |
| 77 | 71 | with the i860's to have them update the frame buffer. |
| r4184 | r4185 | |
| 82 | 76 | 0x600018: ? No info yet. |
| 83 | 77 | 0x704000: (VC only) Likely analog axis for VR headset |
| 84 | 78 | 0x703000: (VC only) Likely analog axis for VR headset |
| 85 | 0x702000: (Shadow only). I think this is another IN port. It | |
| 86 | is always read at the same time as the other two | |
| 87 | ports. | |
| 88 | 79 | |
| 89 | - Assuming a single framebuffer, as I think we are at the moment, | |
| 90 | how are all the CPUs writes to the framebuffer prioritized, | |
| 91 | if at all? The zero values written by the 68k side erase | |
| 92 | the i860-generated FB data (i.e., zero maps to black in the | |
| 93 | pallette). On the other hand, treating the zero values as | |
| 94 | transparent doesn't quite look right either. Could just the | |
| 95 | i860s each have their own framebuffers? After | |
| 96 | all, since each eye of the binocular sees a slightly different | |
| 97 | picture, the i860's might just maintain their own. Then maybe | |
| 98 | the 68k shares with each of the two, since I think it just | |
| 99 | generates a single picture (not sure about that either). | |
| 100 | 80 | ---------------------------------------------- |
| 101 | 81 | */ |
| 102 | 82 | |
| 103 | #include <stdio.h> | |
| 104 | 83 | #include "driver.h" |
| 84 | #include "rendlay.h" | |
| 105 | 85 | #include "cpu/m68000/m68000.h" |
| 106 | 86 | #include "cpu/i860/i860.h" |
| 107 | 87 | #include "video/generic.h" |
| 108 | 88 | #include "video/tlc34076.h" |
| 89 | #include "video/mc6845.h" | |
| 90 | #include "sound/dac.h" | |
| 109 | 91 | |
| 110 | static UINT16* framebuffer_main; | |
| 111 | static UINT16* framebuffer_secondary; | |
| 92 | ||
| 93 | static UINT16* m68k_framebuffer[2]; | |
| 94 | static UINT16* i860_framebuffer[2][2]; | |
| 95 | static UINT16* framebuffer_ctrl; | |
| 96 | ||
| 112 | 97 | static UINT16* vid_0_shared_RAM; |
| 113 | 98 | static UINT16* vid_1_shared_RAM; |
| 114 | 99 | |
| 100 | static int crtc_select; | |
| 115 | 101 | |
| 102 | ||
| 116 | 103 | static VIDEO_UPDATE( vcombat ) |
| 117 | 104 | { |
| 118 | int x, y; | |
| 119 | int count = 0; | |
| 120 | const rgb_t *pens = tlc34076_get_pens(); | |
| 105 | int y; | |
| 106 | const rgb_t *const pens = tlc34076_get_pens(); | |
| 107 | const device_config *aux = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "aux"); | |
| 121 | 108 | |
| 109 | UINT16 *m68k_buf = m68k_framebuffer[(*framebuffer_ctrl & 0x20) ? 1 : 0]; | |
| 110 | UINT16 *i860_buf = i860_framebuffer[(screen == aux) ? 1 : 0][0]; | |
| 111 | ||
| 122 | 112 | /* TODO: It looks like the leftmost chunk of the ground should really be on the right side? */ |
| 123 | 113 | /* But the i860 draws the background correctly, so it may be an original game issue. */ |
| 124 | 114 | /* There's also some garbage in the upper-left corner. Might be related to this 'wraparound'. */ |
| 125 | 115 | /* Or maybe it's related to the 68k's alpha? It might come from the 68k side of the house. */ |
| 126 | 116 | |
| 127 | /* Main eye */ | |
| 128 | for(y = 0; y < 256; y++) | |
| 117 | for (y = cliprect->min_y; y <= cliprect->max_y; ++y) | |
| 129 | 118 | { |
| 130 | for(x = 384; x < 640; x++) | |
| 119 | int x; | |
| 120 | int src_addr = 256/2 * y; | |
| 121 | const UINT16 *m68k_src = &m68k_buf[src_addr]; | |
| 122 | const UINT16 *i860_src = &i860_buf[src_addr]; | |
| 123 | UINT32 *dst = BITMAP_ADDR32(bitmap, y, cliprect->min_x); | |
| 124 | ||
| 125 | for (x = cliprect->min_x; x <= cliprect->max_x; x += 2) | |
| 131 | 126 | { |
| 132 | UINT32 color; | |
| 133 | if (x % 2) color = (framebuffer_main[count] & 0xff00) >> 8; | |
| 134 | else color = framebuffer_main[count] & 0x00ff; | |
| 127 | int i; | |
| 128 | UINT16 m68k_pix = *m68k_src++; | |
| 129 | UINT16 i860_pix = *i860_src++; | |
| 135 | 130 | |
| 136 | /* Vcombat's screen renders 'flopped' - very likely because VR headset displays may reflect off mirrors. | |
| 137 | Shadfgtr isn't flopped, so it's not a constant feature of the hardware. */ | |
| 138 | if(x < video_screen_get_visible_area(screen)->max_x && y < video_screen_get_visible_area(screen)->max_y) | |
| 139 | *BITMAP_ADDR32(bitmap, y, x) = pens[color]; | |
| 131 | /* Draw two pixels */ | |
| 132 | for (i = 0; i < 2; ++i) | |
| 133 | { | |
| 134 | /* Vcombat's screen renders 'flopped' - very likely because VR headset displays may reflect off mirrors. | |
| 135 | Shadfgtr isn't flopped, so it's not a constant feature of the hardware. */ | |
| 140 | 136 | |
| 141 | if (x % 2) count++; | |
| 142 | } | |
| 143 | } | |
| 137 | /* Combine the two layers */ | |
| 138 | if ((m68k_pix & 0xff) == 0) | |
| 139 | *dst++ = pens[i860_pix & 0xff]; | |
| 140 | else | |
| 141 | *dst++ = pens[m68k_pix & 0xff]; | |
| 144 | 142 | |
| 145 | /* Early out for shadow fighters */ | |
| 146 | if (!framebuffer_secondary) | |
| 147 | return 0; | |
| 148 | ||
| 149 | /* Secondary eye */ | |
| 150 | count = 0; | |
| 151 | for(y = 0; y < 256; y++) | |
| 152 | { | |
| 153 | for(x = 0; x < 256; x++) | |
| 154 | { | |
| 155 | UINT32 color; | |
| 156 | if (x % 2) color = (framebuffer_secondary[count] & 0xff00) >> 8; | |
| 157 | else color = framebuffer_secondary[count] & 0x00ff; | |
| 158 | ||
| 159 | /* Vcombat's screen renders 'flopped' - very likely because VR headset displays may reflect off mirrors. | |
| 160 | Shadfgtr isn't flopped, so it's not a constant feature of the hardware. */ | |
| 161 | if(x < video_screen_get_visible_area(screen)->max_x && y < video_screen_get_visible_area(screen)->max_y) | |
| 162 | *BITMAP_ADDR32(bitmap, y, x) = pens[color]; | |
| 163 | ||
| 164 | if (x % 2) count++; | |
| 143 | m68k_pix >>= 8; | |
| 144 | i860_pix >>= 8; | |
| 145 | } | |
| 165 | 146 | } |
| 166 | 147 | } |
| 167 | 148 | |
| r4184 | r4185 | |
| 169 | 150 | } |
| 170 | 151 | |
| 171 | 152 | |
| 172 | /* Maybe there's a blend chip between the 68k and the framebuffer? */ | |
| 173 | 153 | static WRITE16_HANDLER( main_video_write ) |
| 174 | 154 | { |
| 175 | /* Doesn't seem to make sense for shadow fighters. Maybe some of that factory rework disables this? */ | |
| 176 | /* Doesn't always seem to work for vcombat either. More testing needed. */ | |
| 177 | if (data != 0x00000000) { | |
| 178 | framebuffer_main[offset] = data; | |
| 155 | int fb = (*framebuffer_ctrl & 0x20) ? 0 : 1; | |
| 156 | UINT16 old_data = m68k_framebuffer[fb][offset]; | |
| 157 | ||
| 158 | /* Transparency mode? */ | |
| 159 | if (*framebuffer_ctrl & 0x40) | |
| 160 | { | |
| 161 | if (data == 0x0000) | |
| 162 | return; | |
| 163 | ||
| 164 | if ((data & 0x00ff) == 0) | |
| 165 | data = (data & 0xff00) | (old_data & 0x00ff); | |
| 166 | if ((data & 0xff00) == 0) | |
| 167 | data = (data & 0x00ff) | (old_data & 0xff00); | |
| 168 | ||
| 169 | COMBINE_DATA(&m68k_framebuffer[fb][offset]); | |
| 179 | 170 | } |
| 171 | else | |
| 172 | { | |
| 173 | COMBINE_DATA(&m68k_framebuffer[fb][offset]); | |
| 174 | } | |
| 180 | 175 | } |
| 181 | 176 | |
| 182 | 177 | static READ16_HANDLER( control_1_r ) |
| r4184 | r4185 | |
| 189 | 184 | return (input_port_read(space->machine, "IN1") << 8); |
| 190 | 185 | } |
| 191 | 186 | |
| 187 | static READ16_HANDLER( control_3_r ) | |
| 188 | { | |
| 189 | return (input_port_read(space->machine, "IN2") << 8); | |
| 190 | } | |
| 191 | ||
| 192 | 192 | static void wiggle_i860_common(int n, UINT16 data, const device_config *device) |
| 193 | 193 | { |
| 194 | 194 | int bus_hold = (data & 0x03) == 0x03; |
| r4184 | r4185 | |
| 245 | 245 | { |
| 246 | 246 | /* The frame buffer seems to sit on a 32-bit data bus, while the |
| 247 | 247 | i860 uses a 64-bit data bus. Adjust accordingly. */ |
| 248 | char *p = (char *)framebuffer | |
| 248 | char *p = (char *)(i860_framebuffer[0][0]); | |
| 249 | 249 | int m = mem_mask; |
| 250 | 250 | int o = (offset << 2); |
| 251 | 251 | if (m & 0xff000000) { |
| r4184 | r4185 | |
| 268 | 268 | { |
| 269 | 269 | /* The frame buffer seems to sit on a 32-bit data bus, while the |
| 270 | 270 | i860 uses a 64-bit data bus. Adjust accordingly. */ |
| 271 | char *p = (char *)framebuffer | |
| 271 | char *p = (char *)(i860_framebuffer[1][0]) | |
| 272 | 272 | int m = mem_mask; |
| 273 | 273 | int o = (offset << 2); |
| 274 | 274 | if (m & 0xff000000) { |
| r4184 | r4185 | |
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | static WRITE16_HANDLER( crtc_w ) | |
| 289 | { | |
| 290 | const device_config *crtc = device_list_find_by_tag(space->machine->config->devicelist, MC6845, "crtc"); | |
| 288 | 291 | |
| 292 | if (crtc == NULL) | |
| 293 | return; | |
| 294 | ||
| 295 | if (crtc_select == 0) | |
| 296 | mc6845_address_w(crtc, 0, data >> 8); | |
| 297 | else | |
| 298 | mc6845_register_w(crtc, 0, data >> 8); | |
| 299 | ||
| 300 | crtc_select ^= 1; | |
| 301 | } | |
| 302 | ||
| 303 | static WRITE16_HANDLER( dac_w ) | |
| 304 | { | |
| 305 | INT16 newval = ((INT16)data - 0x6000) << 2; | |
| 306 | dac_signed_data_16_w(0, newval + 0x8000); | |
| 307 | } | |
| 308 | ||
| 289 | 309 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 290 | 310 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 291 | AM_RANGE(0x200000, 0x2fffff) AM_RAM | |
| 292 | AM_RANGE(0x300000, 0x30ffff) AM_RAM_WRITE(main_video_write) | |
| 311 | AM_RANGE(0x200000, 0x20ffff) AM_RAM | |
| 312 | AM_RANGE(0x300000, 0x30ffff) AM_WRITE(main_video_write) | |
| 293 | 313 | |
| 294 | 314 | AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_BASE(&vid_0_shared_RAM) AM_SHARE(2) /* First i860 shared RAM */ |
| 295 | 315 | AM_RANGE(0x440000, 0x440003) AM_RAM AM_SHARE(6) /* M0->P0 i860 #1 com 1 */ |
| r4184 | r4185 | |
| 304 | 324 | AM_RANGE(0x600000, 0x600001) AM_READ(control_1_r) /* IN0 port */ |
| 305 | 325 | AM_RANGE(0x600004, 0x600005) AM_RAM AM_SHARE(5) /* M0<-M1 */ |
| 306 | 326 | AM_RANGE(0x600008, 0x600009) AM_READ(control_2_r) /* IN1 port */ |
| 307 | /* AM_RANGE(0x60000c, 0x60000d) See notes at top of driver. */ | |
| 308 | /* AM_RANGE(0x600010, 0x600011) See notes at top of driver. */ | |
| 309 | AM_RANGE(0x700000, 0x7007ff) AM_RAM /* TODO: Non-volatile RAM */ | |
| 327 | AM_RANGE(0x60001c, 0x60001d) AM_NOP | |
| 328 | ||
| 329 | AM_RANGE(0x60000c, 0x60000d) AM_WRITE(crtc_w) | |
| 330 | AM_RANGE(0x600010, 0x600011) AM_RAM AM_BASE(&framebuffer_ctrl) | |
| 331 | AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) | |
| 310 | 332 | AM_RANGE(0x701000, 0x701001) AM_READ(main_irqiack_r) |
| 333 | AM_RANGE(0x702000, 0x702001) AM_READ(control_3_r) | |
| 311 | 334 | AM_RANGE(0x705000, 0x705001) AM_RAM AM_SHARE(4) /* M1->M0 */ |
| 312 | 335 | |
| 313 | 336 | //AM_RANGE(0x703000, 0x703001) /* Headset rotation axis? */ |
| r4184 | r4185 | |
| 342 | 365 | /* Sound CPU */ |
| 343 | 366 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 344 | 367 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 345 | AM_RANGE(0x081000, 0x081fff) AM_RAM | |
| 368 | AM_RANGE(0x080000, 0x08ffff) AM_RAM | |
| 369 | AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(dac_w) | |
| 346 | 370 | AM_RANGE(0x140000, 0x140001) AM_READ(sound_resetmain_r) /* Ping M0's reset line */ |
| 347 | 371 | AM_RANGE(0x180000, 0x180001) AM_RAM AM_SHARE(4) /* M1<-M0 */ |
| 348 | AM_RANGE(0x1C0000, 0x1C0001) AM_RAM AM_SHARE(5) /* M1->M0 */ | |
| 372 | AM_RANGE(0x1c0000, 0x1c0001) AM_RAM AM_SHARE(5) /* M1->M0 */ | |
| 373 | AM_RANGE(0x200000, 0x37ffff) AM_ROM AM_REGION("samples", 0) | |
| 349 | 374 | ADDRESS_MAP_END |
| 350 | 375 | |
| 351 | 376 | |
| r4184 | r4185 | |
| 356 | 381 | |
| 357 | 382 | i860_set_pin(cputag_get_cpu(machine, "vid_0")->token, DEC_PIN_BUS_HOLD, 1); |
| 358 | 383 | i860_set_pin(cputag_get_cpu(machine, "vid_1")->token, DEC_PIN_BUS_HOLD, 1); |
| 384 | ||
| 385 | crtc_select = 0; | |
| 359 | 386 | } |
| 360 | 387 | |
| 361 | 388 | static MACHINE_RESET( shadfgtr ) |
| r4184 | r4185 | |
| 364 | 391 | tlc34076_reset(6); |
| 365 | 392 | |
| 366 | 393 | i860_set_pin(cputag_get_cpu(machine, "vid_0")->token, DEC_PIN_BUS_HOLD, 1); |
| 394 | ||
| 395 | crtc_select = 0; | |
| 367 | 396 | } |
| 368 | 397 | |
| 369 | 398 | |
| r4184 | r4185 | |
| 396 | 425 | memory_set_direct_update_handler(cputag_get_address_space(machine, "vid_0", ADDRESS_SPACE_PROGRAM), vid_0_direct_handler); |
| 397 | 426 | memory_set_direct_update_handler(cputag_get_address_space(machine, "vid_1", ADDRESS_SPACE_PROGRAM), vid_1_direct_handler); |
| 398 | 427 | |
| 399 | /* Allocate the two framebuffers */ | |
| 400 | framebuffer_main = auto_malloc(0x10000 * sizeof(UINT16)); | |
| 401 | framebuffer_secondary = auto_malloc(0x10000 * sizeof(UINT16)); | |
| 428 | /* Allocate the 68000 framebuffers */ | |
| 429 | m68k_framebuffer[0] = auto_malloc(0x8000 * sizeof(UINT16)); | |
| 430 | m68k_framebuffer[1] = auto_malloc(0x8000 * sizeof(UINT16)); | |
| 402 | 431 | |
| 432 | /* First i860 */ | |
| 433 | i860_framebuffer[0][0] = auto_malloc(0x8000 * sizeof(UINT16)); | |
| 434 | i860_framebuffer[0][1] = auto_malloc(0x8000 * sizeof(UINT16)); | |
| 435 | ||
| 436 | /* Second i860 */ | |
| 437 | i860_framebuffer[1][0] = auto_malloc(0x8000 * sizeof(UINT16)); | |
| 438 | i860_framebuffer[1][1] = auto_malloc(0x8000 * sizeof(UINT16)); | |
| 439 | ||
| 403 | 440 | /* pc==4016 : jump 4038 ... There's something strange about how it waits at 402e (interrupts all masked out) |
| 404 | 441 | I think what is happening here is that M0 snags the first time |
| 405 | 442 | it hits this point based on a counter test just above this |
| r4184 | r4185 | |
| 418 | 455 | |
| 419 | 456 | static DRIVER_INIT( shadfgtr ) |
| 420 | 457 | { |
| 421 | /* Allocate just one framebuffer */ | |
| 422 | framebuffer_main = auto_malloc(0x10000 * sizeof(UINT16)); | |
| 423 | framebuffer_secondary = NULL; | |
| 458 | /* Allocate th 68000 frame buffers */ | |
| 459 | m68k_framebuffer[0] = auto_malloc(0x8000 * sizeof(UINT16)); | |
| 460 | m68k_framebuffer[1] = auto_malloc(0x8000 * sizeof(UINT16)); | |
| 424 | 461 | |
| 462 | /* Only one i860 */ | |
| 463 | i860_framebuffer[0][0] = auto_malloc(0x8000 * sizeof(UINT16)); | |
| 464 | i860_framebuffer[0][1] = auto_malloc(0x8000 * sizeof(UINT16)); | |
| 465 | i860_framebuffer[1][0] = NULL; | |
| 466 | i860_framebuffer[1][1] = NULL; | |
| 467 | ||
| 425 | 468 | /* The i860 executes out of RAM */ |
| 426 | 469 | memory_set_direct_update_handler(cputag_get_address_space(machine, "vid_0", ADDRESS_SPACE_PROGRAM), vid_0_direct_handler); |
| 427 | 470 | } |
| r4184 | r4185 | |
| 451 | 494 | |
| 452 | 495 | |
| 453 | 496 | static INPUT_PORTS_START( shadfgtr ) |
| 497 | /* Check me */ | |
| 454 | 498 | PORT_START("IN0") |
| 455 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 456 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 457 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 458 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY | |
| 459 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY /* ? */ | |
| 460 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY /* ? */ | |
| 461 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY | |
| 462 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 499 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) | |
| 500 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) | |
| 501 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) | |
| 502 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) | |
| 503 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2) | |
| 504 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2) | |
| 505 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2) | |
| 506 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2) | |
| 463 | 507 | |
| 464 | 508 | PORT_START("IN1") |
| 465 | 509 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r4184 | r4185 | |
| 470 | 514 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) |
| 471 | 515 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 472 | 516 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 517 | ||
| 518 | /* Check me */ | |
| 519 | PORT_START("IN2") | |
| 520 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY | |
| 521 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY | |
| 522 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY | |
| 523 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY | |
| 524 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 525 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 526 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) | |
| 527 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) | |
| 473 | 528 | INPUT_PORTS_END |
| 474 | 529 | |
| 475 | 530 | |
| 531 | static MC6845_ON_HSYNC_CHANGED(sound_update) | |
| 532 | { | |
| 533 | /* Seems reasonable */ | |
| 534 | cpu_set_input_line(cputag_get_cpu(device->machine, "sound"), M68K_IRQ_1, hsync ? ASSERT_LINE : CLEAR_LINE); | |
| 535 | } | |
| 536 | ||
| 537 | static const mc6845_interface mc6845_intf = | |
| 538 | { | |
| 539 | "main", /* screen we are acting on */ | |
| 540 | 16, /* number of pixels per video memory address */ | |
| 541 | NULL, /* before pixel update callback */ | |
| 542 | NULL, /* row update callback */ | |
| 543 | NULL, /* after pixel update callback */ | |
| 544 | NULL, /* callback for display state changes */ | |
| 545 | sound_update, /* HSYNC callback */ | |
| 546 | NULL /* VSYNC callback */ | |
| 547 | }; | |
| 548 | ||
| 549 | ||
| 476 | 550 | static MACHINE_DRIVER_START( vcombat ) |
| 477 | 551 | MDRV_CPU_ADD("main", M68000, XTAL_12MHz) |
| 478 | 552 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| r4184 | r4185 | |
| 489 | 563 | /* Sound CPU */ |
| 490 | 564 | MDRV_CPU_ADD("sound", M68000, XTAL_12MHz) |
| 491 | 565 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 566 | MDRV_CPU_PERIODIC_INT(irq1_line_hold, 15000) /* Remove this if MC6845 is enabled */ | |
| 492 | 567 | |
| 568 | MDRV_NVRAM_HANDLER(generic_0fill) | |
| 493 | 569 | MDRV_MACHINE_RESET(vcombat) |
| 494 | 570 | |
| 495 | 571 | /* Temporary hack for experimenting with timing. */ |
| r4184 | r4185 | |
| 498 | 574 | MDRV_QUANTUM_PERFECT_CPU("main") |
| 499 | 575 | #endif |
| 500 | 576 | |
| 577 | /* Disabled for now as it can't handle multiple screens */ | |
| 578 | // MDRV_MC6845_ADD("crtc", MC6845, 6000000 / 16, mc6845_intf) | |
| 579 | MDRV_DEFAULT_LAYOUT(layout_dualhsxs) | |
| 580 | ||
| 501 | 581 | MDRV_SCREEN_ADD("main", RASTER) |
| 502 | MDRV_SCREEN_REFRESH_RATE(50) | |
| 503 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 504 | 582 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 505 | MDRV_SCREEN_SIZE(640, 480) | |
| 506 | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) | |
| 583 | MDRV_SCREEN_RAW_PARAMS(XTAL_12MHz / 2, 400, 0, 256, 291, 0, 208) | |
| 507 | 584 | |
| 585 | MDRV_SCREEN_ADD("aux", RASTER) | |
| 586 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) | |
| 587 | MDRV_SCREEN_RAW_PARAMS(XTAL_12MHz / 2, 400, 0, 256, 291, 0, 208) | |
| 588 | ||
| 508 | 589 | MDRV_VIDEO_UPDATE(vcombat) |
| 590 | ||
| 591 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 592 | ||
| 593 | MDRV_SOUND_ADD("dac", DAC, 0) | |
| 594 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) | |
| 509 | 595 | MACHINE_DRIVER_END |
| 510 | 596 | |
| 511 | 597 | |
| r4184 | r4185 | |
| 522 | 608 | MDRV_CPU_ADD("sound", M68000, XTAL_12MHz) |
| 523 | 609 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 524 | 610 | |
| 611 | MDRV_NVRAM_HANDLER(generic_0fill) | |
| 525 | 612 | MDRV_MACHINE_RESET(shadfgtr) |
| 526 | 613 | |
| 614 | MDRV_MC6845_ADD("crtc", MC6845, XTAL_20MHz / 4 / 16, mc6845_intf) | |
| 615 | ||
| 527 | 616 | MDRV_SCREEN_ADD("main", RASTER) |
| 528 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 529 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 530 | 617 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 531 | MDRV_SCREEN_SIZE(640, 480) | |
| 532 | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) | |
| 618 | MDRV_SCREEN_RAW_PARAMS(XTAL_20MHz / 4, 320, 0, 256, 277, 0, 224) | |
| 533 | 619 | |
| 534 | 620 | MDRV_VIDEO_UPDATE(vcombat) |
| 621 | ||
| 622 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 623 | ||
| 624 | MDRV_SOUND_ADD("dac", DAC, 0) | |
| 625 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) | |
| 535 | 626 | MACHINE_DRIVER_END |
| 536 | 627 | |
| 537 | 628 | |
| 538 | /* Perhaps add this to the core romload.h file? */ | |
| 539 | #define ROM_LOAD64_WORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(6)) | |
| 540 | ||
| 541 | 629 | ROM_START( vcombat ) |
| 542 | 630 | ROM_REGION( 0x100000, "main", 0 ) |
| 543 | 631 | ROM_LOAD16_BYTE( "ep8v2.b49", 0x00000, 0x80000, CRC(98d5a45d) SHA1(099e314f11c93ad6e642ceaa311e2a5b6fd7193c) ) |
| r4184 | r4185 | |
| 577 | 665 | ROM_LOAD16_BYTE( "shadfgtr.b42", 0x00000, 0x20000, CRC(f8605dcd) SHA1(1b29f47856ccc757bc96674682ae48f87e6b0e54) ) |
| 578 | 666 | ROM_LOAD16_BYTE( "shadfgtr.b33", 0x00001, 0x20000, CRC(291d59ac) SHA1(cc4904c2ac8ef6a12033c10893246a438ac44014) ) |
| 579 | 667 | |
| 580 | ROM_REGION( 0x1 | |
| 668 | ROM_REGION( 0x180000, "samples", 0 ) | |
| 581 | 669 | ROM_LOAD16_BYTE( "shadfgtr.b41", 0x00000, 0x80000, CRC(9e4b4df3) SHA1(8101197275e9f728acdeef85737eecbdec132b27) ) |
| 582 | 670 | ROM_LOAD16_BYTE( "shadfgtr.b37", 0x00001, 0x80000, CRC(98446ba2) SHA1(1c8cc0d9c5de54d9e53699a5ab281579d15edc96) ) |
| 583 | 671 | |
| r4184 | r4185 | |
| 596 | 684 | ROM_END |
| 597 | 685 | |
| 598 | 686 | /* YEAR NAME PARENT MACHINE INPUT INIT MONITOR COMPANY FULLNAME FLAGS */ |
| 599 | GAME( 1993, vcombat, 0, vcombat, vcombat, vcombat, ORIENTATION_FLIP_X, "VR8 Inc.", "Virtual Combat", GAME_NOT_WORKING | GAME_NO_SOUND ) | |
| 600 | GAME( 1989, shadfgtr, 0, shadfgtr, shadfgtr, shadfgtr, ROT0, "DUTECH Inc.", "Shadow Fighters", GAME_NOT_WORKING | GAME_NO_SOUND ) | |
| 687 | GAME( 1993, vcombat, 0, vcombat, vcombat, vcombat, ORIENTATION_FLIP_X, "VR8 Inc.", "Virtual Combat", GAME_NOT_WORKING ) | |
| 688 | GAME( 1993, shadfgtr, 0, shadfgtr, shadfgtr, shadfgtr, ROT0, "DUTECH Inc.", "Shadow Fighters", GAME_NOT_WORKING ) |
| r4184 | r4185 | |
|---|---|---|
| 14 | 14 | * Suit Pursuit |
| 15 | 15 | * Treasure Trail? |
| 16 | 16 | |
| 17 | Known bugs: | |
| 18 | * Neither game registers coins. Protection maybe? | |
| 17 | Known issues: | |
| 18 | * Neither game registers coins and I can't find where the credit | |
| 19 | count gets updated in the code. Each game requires a unique | |
| 20 | security PAL - maybe this is related? I'm poking the coin values | |
| 21 | directly into RAM for now. | |
| 19 | 22 | |
| 20 | 23 | ***************************************************************************/ |
| 21 | 24 | |
| r4184 | r4185 | |
| 558 | 561 | } |
| 559 | 562 | default: |
| 560 | 563 | { |
| 564 | mame_printf_debug("Unknown IO R:0x%x\n", 0xc0000 + (offset * 2)); | |
| 561 | 565 | return 0; |
| 562 | 566 | } |
| 563 | 567 | } |
| 564 | 568 | } |
| 565 | 569 | |
| 570 | static INPUT_CHANGED( coin_inserted ) | |
| 571 | { | |
| 572 | if (newval == 0) | |
| 573 | { | |
| 574 | UINT32 credit; | |
| 575 | const address_space *space = cpu_get_address_space(field->port->machine->cpu[0], ADDRESS_SPACE_PROGRAM); | |
| 566 | 576 | |
| 577 | /* Get the current credit value and add the new coin value */ | |
| 578 | credit = memory_read_dword(space, 0x8002c) + (UINT32)(FPTR)param; | |
| 579 | memory_write_dword(space, 0x8002c, credit); | |
| 580 | } | |
| 581 | } | |
| 582 | ||
| 567 | 583 | /**************************************** |
| 568 | 584 | * |
| 569 | 585 | * Hardware outputs (lamps, meters etc) |
| r4184 | r4185 | |
| 664 | 680 | |
| 665 | 681 | static INPUT_PORTS_START( guab ) |
| 666 | 682 | PORT_START("IN0") |
| 667 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("50p") | |
| 668 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("100p") | |
| 669 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door") PORT_CODE(KEYCODE_R) PORT_TOGGLE | |
| 670 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door") PORT_CODE(KEYCODE_T) PORT_TOGGLE | |
| 683 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("50p") PORT_CHANGED(coin_inserted, (void *)50) | |
| 684 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("100p") PORT_CHANGED(coin_inserted, (void *)100) | |
| 685 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door") PORT_CODE(KEYCODE_R) PORT_TOGGLE | |
| 686 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door") PORT_CODE(KEYCODE_T) PORT_TOGGLE | |
| 671 | 687 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key switch") PORT_CODE(KEYCODE_Y) PORT_TOGGLE |
| 672 | 688 | PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_UNUSED ) PORT_NAME("50p level") |
| 673 | 689 | PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_UNUSED ) PORT_NAME("100p level") |
| r4184 | r4185 | |
| 690 | 706 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 691 | 707 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("C") |
| 692 | 708 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("D") |
| 693 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("10p") | |
| 694 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("20p") | |
| 709 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("10p") PORT_CHANGED(coin_inserted, (void *)10) | |
| 710 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("20p") PORT_CHANGED(coin_inserted, (void *)20) | |
| 695 | 711 | INPUT_PORTS_END |
| 696 | 712 | |
| 697 | 713 | static INPUT_PORTS_START( tenup ) |
| 698 | 714 | PORT_START("IN0") |
| 699 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("50p") | |
| 700 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("100p") | |
| 701 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door") PORT_CODE(KEYCODE_R) PORT_TOGGLE | |
| 702 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door") PORT_CODE(KEYCODE_T) PORT_TOGGLE | |
| 715 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("50p") PORT_CHANGED(coin_inserted, (void *)50) | |
| 716 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("100p") PORT_CHANGED(coin_inserted, (void *)100) | |
| 717 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door") PORT_CODE(KEYCODE_R) PORT_TOGGLE | |
| 718 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door") PORT_CODE(KEYCODE_T) PORT_TOGGLE | |
| 703 | 719 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key switch") PORT_CODE(KEYCODE_Y) PORT_TOGGLE |
| 704 | 720 | PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_UNUSED ) PORT_NAME("10p level") |
| 705 | 721 | PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_UNUSED ) PORT_NAME("100p level") |
| r4184 | r4185 | |
| 722 | 738 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("A") |
| 723 | 739 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("B") |
| 724 | 740 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("C") |
| 725 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("10p") | |
| 726 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("20p") | |
| 741 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("10p") PORT_CHANGED(coin_inserted, (void *)10) | |
| 742 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("20p") PORT_CHANGED(coin_inserted, (void *)20) | |
| 727 | 743 | INPUT_PORTS_END |
| 728 | 744 | |
| 729 | 745 | |
| r4184 | r4185 | |
| 830 | 846 | * |
| 831 | 847 | *************************************/ |
| 832 | 848 | |
| 833 | GAME( 1986, guab, 0, guab, guab, 0, ROT0, "JPM", "Give us a Break (6th edition)", GAME_NOT_WORKING ) | |
| 834 | GAME( 1986, guab3, guab, guab, guab, 0, ROT0, "JPM", "Give us a Break (3rd edition)", GAME_NOT_WORKING ) | |
| 835 | ||
| 836 | GAME( 1988, tenup, 0, guab, tenup, 0, ROT0, "JPM", "Ten Up (compendium 17)", GAME_NOT_WORKING ) | |
| 837 | GAME( 1988, tenup3, tenup, guab, tenup, 0, ROT0, "JPM", "Ten Up (compendium 3)", GAME_NOT_WORKING ) | |
| 849 | GAME( 1986, guab, 0, guab, guab, 0, ROT0, "JPM", "Give us a Break (6th edition)", 0 ) | |
| 850 | GAME( 1986, guab3, guab, guab, guab, 0, ROT0, "JPM", "Give us a Break (3rd edition)", 0 ) | |
| 851 | GAME( 1988, tenup, 0, guab, tenup, 0, ROT0, "JPM", "Ten Up (compendium 17)", 0 ) | |
| 852 | GAME( 1988, tenup3, tenup, guab, tenup, 0, ROT0, "JPM", "Ten Up (compendium 3)", 0 ) |
| r4184 | r4185 | |
|---|---|---|
| 56 | 56 | #include "cpu/nec/nec.h" |
| 57 | 57 | #include "audio/seibu.h" |
| 58 | 58 | #include "sound/3812intf.h" |
| 59 | #include "includes/sei_crtc.h" | |
| 59 | 60 | |
| 60 | extern UINT16 *sengokmj_bgvram,*sengokmj_mdvram,*sengokmj_fgvram,*sengokmj_txvram; | |
| 61 | extern UINT16 *seibucrtc_sc0vram,*seibucrtc_sc1vram,*seibucrtc_sc2vram,*seibucrtc_sc3vram; | |
| 62 | extern UINT16 *seibucrtc_vregs; | |
| 63 | ||
| 61 | 64 | static UINT16 sengokumj_mux_data; |
| 65 | static UINT8 hopper_io; | |
| 62 | 66 | |
| 63 | WRITE16_HANDLER( sengokmj_bgvram_w ); | |
| 64 | WRITE16_HANDLER( sengokmj_fgvram_w ); | |
| 65 | WRITE16_HANDLER( sengokmj_mdvram_w ); | |
| 66 | WRITE16_HANDLER( sengokmj_txvram_w ); | |
| 67 | WRITE16_HANDLER( sengokmj_layer_enable_w ); | |
| 68 | WRITE16_HANDLER( sengokmj_bg_scrolly_w ); | |
| 69 | VIDEO_START( sengokmj ); | |
| 70 | VIDEO_UPDATE( sengokmj ); | |
| 71 | ||
| 72 | 67 | /* Multiplexer device for the mahjong panel */ |
| 73 | 68 | static READ16_HANDLER( mahjong_panel_r ) |
| 74 | 69 | { |
| r4184 | r4185 | |
| 99 | 94 | coin_lockout_w(0,~data & 2); |
| 100 | 95 | coin_lockout_w(1,~data & 2); |
| 101 | 96 | coin_counter_w(0,data & 4); |
| 97 | hopper_io = ((data & 1)<<6); | |
| 98 | // popmessage("%02x",hopper_io); | |
| 102 | 99 | } |
| 103 | 100 | |
| 104 | 101 | static WRITE16_HANDLER( seibu_z80_com_6_mirror_w ) |
| r4184 | r4185 | |
| 106 | 103 | seibu_main_word_w(space,6,data,0xffff); |
| 107 | 104 | } |
| 108 | 105 | |
| 106 | static READ16_HANDLER( sengokmj_system_r ) | |
| 107 | { | |
| 108 | return (input_port_read(space->machine, "SYSTEM") & 0xffbf) | hopper_io; | |
| 109 | } | |
| 110 | ||
| 109 | 111 | static ADDRESS_MAP_START( sengokmj_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 110 | 112 | AM_RANGE(0x00000, 0x07fff) AM_RAM |
| 111 | 113 | AM_RANGE(0x08000, 0x09fff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) |
| 112 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM_WRITE(sengokmj_bgvram_w) AM_BASE(&sengokmj_bgvram) | |
| 113 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM_WRITE(sengokmj_fgvram_w) AM_BASE(&sengokmj_fgvram) | |
| 114 | AM_RANGE(0x0d000, 0x0d7ff) AM_RAM_WRITE(sengokmj_mdvram_w) AM_BASE(&sengokmj_mdvram) | |
| 115 | AM_RANGE(0x0d800, 0x0e7ff) AM_RAM_WRITE(sengokmj_txvram_w) AM_BASE(&sengokmj_txvram) | |
| 114 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM_WRITE(seibucrtc_sc0vram_w) AM_BASE(&seibucrtc_sc0vram) | |
| 115 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM_WRITE(seibucrtc_sc1vram_w) AM_BASE(&seibucrtc_sc1vram) | |
| 116 | AM_RANGE(0x0d000, 0x0d7ff) AM_RAM_WRITE(seibucrtc_sc2vram_w) AM_BASE(&seibucrtc_sc2vram) | |
| 117 | AM_RANGE(0x0d800, 0x0e7ff) AM_RAM_WRITE(seibucrtc_sc3vram_w) AM_BASE(&seibucrtc_sc3vram) | |
| 116 | 118 | AM_RANGE(0x0e800, 0x0f7ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) |
| 117 | 119 | AM_RANGE(0x0f800, 0x0ffff) AM_RAM AM_BASE(&spriteram16) |
| 118 | 120 | AM_RANGE(0xc0000, 0xfffff) AM_ROM |
| r4184 | r4185 | |
| 121 | 123 | static ADDRESS_MAP_START( sengokmj_io_map, ADDRESS_SPACE_IO, 16 ) |
| 122 | 124 | AM_RANGE(0x4000, 0x400f) AM_READWRITE(seibu_main_word_r, seibu_main_word_w) |
| 123 | 125 | /*Areas from 8000-804f are for the custom Seibu CRTC.*/ |
| 124 | // AM_RANGE(0x8000, 0x800f) AM_WRITE(seibu_main_word_w) | |
| 125 | // AM_RANGE(0x8010, 0x801b) AM_WRITENOP | |
| 126 | AM_RANGE(0x801c, 0x801d) AM_WRITE(sengokmj_layer_enable_w) | |
| 127 | // AM_RANGE(0x801e, 0x801f) AM_WRITENOP | |
| 128 | // AM_RANGE(0x8020, 0x802f) AM_WRITENOP | |
| 129 | AM_RANGE(0x8022, 0x8023) AM_WRITE(sengokmj_bg_scrolly_w) | |
| 130 | // AM_RANGE(0x8030, 0x803f) AM_WRITENOP | |
| 131 | // AM_RANGE(0x8040, 0x804f) AM_WRITENOP | |
| 126 | AM_RANGE(0x8000, 0x804f) AM_RAM_WRITE(seibucrtc_vregs_w) AM_BASE(&seibucrtc_vregs) | |
| 132 | 127 | |
| 133 | 128 | AM_RANGE(0x8080, 0x8081) AM_WRITE(seibu_z80_com_6_mirror_w) |
| 134 | 129 | // AM_RANGE(0x80c0, 0x80c1) AM_WRITE(seibu_z80_com_unk_mirror_w) |
| r4184 | r4185 | |
| 137 | 132 | AM_RANGE(0x8140, 0x8141) AM_WRITE(mahjong_panel_w) |
| 138 | 133 | AM_RANGE(0xc000, 0xc001) AM_READ_PORT("DSW1") |
| 139 | 134 | AM_RANGE(0xc002, 0xc003) AM_READ(mahjong_panel_r) |
| 140 | AM_RANGE(0xc004, 0xc005) AM_READ | |
| 135 | AM_RANGE(0xc004, 0xc005) AM_READ | |
| 141 | 136 | ADDRESS_MAP_END |
| 142 | 137 | |
| 143 | 138 | |
| r4184 | r4185 | |
| 145 | 140 | SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */ |
| 146 | 141 | |
| 147 | 142 | PORT_START("DSW1") |
| 148 | PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) ) | |
| 143 | PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") | |
| 149 | 144 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) |
| 150 | 145 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 151 | PORT_DIPNAME( 0x0002, 0x0002, "Re-start" ) | |
| 146 | PORT_DIPNAME( 0x0002, 0x0002, "Re-start" ) PORT_DIPLOCATION("SW1:2") | |
| 152 | 147 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) |
| 153 | 148 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 154 | PORT_DIPNAME( 0x0004, 0x0004, "Double G" ) | |
| 149 | PORT_DIPNAME( 0x0004, 0x0004, "Double G" ) PORT_DIPLOCATION("SW1:3") | |
| 155 | 150 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) |
| 156 | 151 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 157 | PORT_DIPNAME( 0x0008, 0x0008, "Double L" ) | |
| 152 | PORT_DIPNAME( 0x0008, 0x0008, "Double L" ) PORT_DIPLOCATION("SW1:4") | |
| 158 | 153 | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) |
| 159 | 154 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 160 | PORT_DIPNAME( 0x0010, 0x0010, "Kamon" ) | |
| 155 | PORT_DIPNAME( 0x0010, 0x0010, "Kamon" ) PORT_DIPLOCATION("SW1:5") | |
| 161 | 156 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 162 | 157 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 163 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) | |
| 164 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) | |
| 165 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 166 | PORT_DIPNAME( 0x0040, 0x0040, "Out Sw" ) | |
| 158 | PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW1:6" ) | |
| 159 | PORT_DIPNAME( 0x0040, 0x0040, "Out Sw" ) PORT_DIPLOCATION("SW1:7") | |
| 167 | 160 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 168 | 161 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 169 | PORT_DIPNAME( 0x0080, 0x00 | |
| 162 | PORT_DIPNAME( 0x0080, 0x00 | |
| 170 | 163 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 171 | 164 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 172 | 165 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r4184 | r4185 | |
| 182 | 175 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 183 | 176 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 184 | 177 | |
| 185 | ||
| 186 | 178 | PORT_START("KEY1") |
| 187 | 179 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B ) |
| 188 | 180 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F ) |
| r4184 | r4185 | |
| 230 | 222 | PORT_START("UNUSED") |
| 231 | 223 | PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 232 | 224 | |
| 233 | PORT_START(" | |
| 225 | PORT_START(" | |
| 234 | 226 | PORT_DIPNAME( 0x0001, 0x0001, "Door" ) |
| 235 | 227 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) |
| 236 | 228 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| r4184 | r4185 | |
| 247 | 239 | PORT_DIPNAME( 0x0020, 0x0020, "Cash" ) |
| 248 | 240 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) |
| 249 | 241 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 250 | /* Used, causes "Hopper RunAway" message if you toggle it */ | |
| 251 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) | |
| 252 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) | |
| 253 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 242 | // 0x40 Hopper | |
| 254 | 243 | PORT_DIPNAME( 0x0080, 0x0080, "Meter" ) |
| 255 | 244 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 256 | 245 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| r4184 | r4185 | |
| 314 | 303 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 315 | 304 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 316 | 305 | MDRV_SCREEN_SIZE(64*8, 32*8) |
| 317 | MDRV_SCREEN_VISIBLE_AREA( | |
| 306 | MDRV_SCREEN_VISIBLE_AREA(0 | |
| 318 | 307 | |
| 319 | 308 | MDRV_GFXDECODE(sengokmj) |
| 320 | 309 | MDRV_PALETTE_LENGTH(0x800) |
| 321 | 310 | |
| 322 | MDRV_VIDEO_START(sengokmj) | |
| 323 | MDRV_VIDEO_UPDATE(sengokmj) | |
| 311 | MDRV_VIDEO_START(seibu_crtc) | |
| 312 | MDRV_VIDEO_UPDATE(seibu_crtc) | |
| 324 | 313 | |
| 325 | 314 | /* sound hardware */ |
| 326 | 315 | SEIBU_SOUND_SYSTEM_YM3812_INTERFACE(14318180/4,1320000) |
| r4184 | r4185 | |
|---|---|---|
| 501 | 501 | |
| 502 | 502 | /* Z80 Sound Hardware - based on MESS code, to be improved, it can do some strange things */ |
| 503 | 503 | |
| 504 | #ifdef LSB_FIRST | |
| 505 | #define BYTE_XOR(a) ((a) ^ 1) | |
| 506 | #else | |
| 507 | #define BYTE_XOR(a) (a) | |
| 508 | #endif | |
| 509 | 504 | |
| 510 | ||
| 511 | ||
| 512 | 505 | static WRITE8_HANDLER ( genesis_bank_select_w ) /* note value will be meaningless unless all bits are correctly set in */ |
| 513 | 506 | { |
| 514 | 507 | if (offset !=0 ) return; |
| r4184 | r4185 | |
| 613 | 606 | logerror("z80 read from address %x\n", address); |
| 614 | 607 | |
| 615 | 608 | /* Read the data out of the 68k ROM */ |
| 616 | if (base != NULL && address < 0x400000) return base[BYTE_XOR(address)]; | |
| 609 | if (base != NULL && address < 0x400000) return base[BYTE_XOR_BE(address)]; | |
| 617 | 610 | /* else read the data out of the 68k RAM */ |
| 618 | // else if (address > 0xff0000) return genesis_68k_ram[BYTE_XOR(offset)]; | |
| 611 | // else if (address > 0xff0000) return genesis_68k_ram[BYTE_XOR_BE(offset)]; | |
| 619 | 612 | |
| 620 | 613 | return -1; |
| 621 | 614 | } |
| r4184 | r4185 | |
|---|---|---|
| 234 | 234 | #define ROM_LOAD32_WORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(2)) |
| 235 | 235 | #define ROM_LOAD32_WORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(2)) |
| 236 | 236 | #define ROM_LOAD32_DWORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPDWORD) |
| 237 | #define ROM_LOAD64_WORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(6)) | |
| 238 | #define ROM_LOAD64_WORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(6)) | |
| 237 | 239 | |
| 240 | ||
| 238 | 241 | /* ----- ROM_RELOAD related macros ----- */ |
| 239 | 242 | #define ROM_RELOAD(offset,length) { NULL, NULL, offset, length, ROMENTRYTYPE_RELOAD | ROM_INHERITFLAGS }, |
| 240 | 243 | #define ROM_RELOAD_PLAIN(offset,length) { NULL, NULL, offset, length, ROMENTRYTYPE_RELOAD }, |
| r4184 | r4185 | |
|---|---|---|
| 2467 | 2467 | subview->index = curindex++; |
| 2468 | 2468 | subview->base = memory_region(machine, rgntag); |
| 2469 | 2469 | subview->length = memory_region_length(machine, rgntag); |
| 2470 | #ifdef LSB_FIRST | |
| 2471 | subview->offsetxor = width - 1; | |
| 2472 | #else | |
| 2473 | subview->offsetxor = 0; | |
| 2474 | #endif | |
| 2470 | subview->offsetxor = NATIVE_ENDIAN_VALUE_LE_BE(width - 1, 0); | |
| 2475 | 2471 | subview->endianness = little_endian ? ENDIANNESS_LITTLE : ENDIANNESS_BIG; |
| 2476 | 2472 | subview->prefsize = MIN(width, 8); |
| 2477 | 2473 | strcpy(subview->name, astring_c(tempstring)); |
| r4184 | r4185 | |
| 2510 | 2506 | subview->base = base; |
| 2511 | 2507 | subview->length = valcount * valsize; |
| 2512 | 2508 | subview->offsetxor = 0; |
| 2513 | #ifdef LSB_FIRST | |
| 2514 | subview->endianness = ENDIANNESS_LITTLE; | |
| 2515 | #else | |
| 2516 | subview->endianness = ENDIANNESS_BIG; | |
| 2517 | #endif | |
| 2509 | subview->endianness = ENDIANNESS_NATIVE; | |
| 2518 | 2510 | subview->prefsize = MIN(valsize, 8); |
| 2519 | 2511 | strcpy(subview->name, astring_c(tempstring)); |
| 2520 | 2512 | |
| r4184 | r4185 | |
| 3336 | 3328 | debug_view_memory *memdata = view->extra_data; |
| 3337 | 3329 | |
| 3338 | 3330 | assert(view->type == DVT_MEMORY); |
| 3339 | assert(rowchunks > 0); | |
| 3340 | 3331 | |
| 3332 | if (rowchunks < 1) | |
| 3333 | return; | |
| 3334 | ||
| 3341 | 3335 | if (rowchunks != memdata->chunks_per_row) |
| 3342 | 3336 | { |
| 3343 | 3337 | offs_t address; |
| r4184 | r4185 | |
|---|---|---|
| 1077 | 1077 | int tokindex = 0; |
| 1078 | 1078 | EXPRERR exprerr; |
| 1079 | 1079 | |
| 1080 | memset(&dummy, 0, sizeof(dummy)); | |
| 1081 | ||
| 1080 | 1082 | /* start with an empty stack */ |
| 1081 | 1083 | init_token_stack(expr); |
| 1082 | 1084 | |
| r4184 | r4185 | |
| 1199 | 1201 | parse_token t1; |
| 1200 | 1202 | EXPRERR exprerr; |
| 1201 | 1203 | |
| 1204 | memset(&t1, 0, sizeof(t1)); | |
| 1205 | ||
| 1202 | 1206 | /* pop off all pushed parameters */ |
| 1203 | 1207 | while (paramcount < MAX_FUNCTION_PARAMS) |
| 1204 | 1208 | { |
| r4184 | r4185 | |
|---|---|---|
| 148 | 148 | drcfe->program = memory_find_address_space(cpu, ADDRESS_SPACE_PROGRAM); |
| 149 | 149 | drcfe->pageshift = cpu_get_page_shift(cpu, ADDRESS_SPACE_PROGRAM); |
| 150 | 150 | drcfe->translate = (cpu_translate_func)device_get_info_fct(cpu, CPUINFO_FCT_TRANSLATE); |
| 151 | #ifdef LSB_FIRST | |
| 152 | if (cpu_get_endianness(cpu) == ENDIANNESS_BIG) | |
| 153 | #else | |
| 154 | if (cpu_get_endianness(cpu) == ENDIANNESS_LITTLE) | |
| 155 | #endif | |
| 151 | if (cpu_get_endianness(cpu) != ENDIANNESS_NATIVE) | |
| 156 | 152 | drcfe->codexor = (cpu_get_databus_width(cpu, ADDRESS_SPACE_PROGRAM) / 8 / cpu_get_min_opcode_bytes(cpu) - 1) * cpu_get_min_opcode_bytes(cpu); |
| 157 | 153 | |
| 158 | 154 | return drcfe; |
| r4184 | r4185 | |
| 291 | 287 | desc->physpc = curpc; |
| 292 | 288 | desc->targetpc = BRANCH_TARGET_DYNAMIC; |
| 293 | 289 | |
| 294 | /* compute the physical PC */ | |
| 295 | if (drcfe->translate != NULL && !(*drcfe->translate)(drcfe->device, ADDRESS_SPACE_PROGRAM, TRANSLATE_FETCH, &desc->physpc)) | |
| 296 | { | |
| 297 | /* uh-oh: a page fault; leave the description empty and just if this is the first instruction, leave it empty and */ | |
| 298 | /* mark as needing to validate; otherwise, just end the sequence here */ | |
| 299 | desc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_COMPILER_PAGE_FAULT | OPFLAG_VIRTUAL_NOOP | OPFLAG_END_SEQUENCE; | |
| 300 | return desc; | |
| 301 | } | |
| 302 | ||
| 303 | /* get a pointer to the physical address */ | |
| 304 | desc->opptr.v = memory_decrypted_read_ptr(drcfe->program, desc->physpc ^ drcfe->codexor); | |
| 305 | assert(desc->opptr.v != NULL); | |
| 306 | if (desc->opptr.v == NULL) | |
| 307 | { | |
| 308 | /* address is unmapped; report it as such */ | |
| 309 | desc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_COMPILER_UNMAPPED | OPFLAG_VIRTUAL_NOOP | OPFLAG_END_SEQUENCE; | |
| 310 | return desc; | |
| 311 | } | |
| 312 | ||
| 313 | 290 | /* call the callback to describe an instruction */ |
| 314 | 291 | if (!(*drcfe->describe)(drcfe->param, desc, prevdesc)) |
| 315 | 292 | { |
| r4184 | r4185 | |
|---|---|---|
| 105 | 105 | offs_t physpc; /* physical PC of this opcode */ |
| 106 | 106 | offs_t targetpc; /* target PC if we are a branch, or BRANCH_TARGET_DYNAMIC */ |
| 107 | 107 | |
| 108 | /* po | |
| 108 | /* copy of | |
| 109 | 109 | union |
| 110 | 110 | { |
| 111 | void * v; | |
| 112 | UINT8 * b; | |
| 113 | UINT16 * w; | |
| 114 | UINT32 * l; | |
| 115 | UINT64 * q; | |
| 111 | UINT8 b[16]; | |
| 112 | UINT16 w[8]; | |
| 113 | UINT32 l[4]; | |
| 114 | UINT64 q[2]; | |
| 116 | 115 | } opptr; /* pointer to opcode memory */ |
| 117 | 116 | |
| 118 | 117 | /* information about this instruction's execution */ |
| r4184 | r4185 | |
|---|---|---|
| 42 | 42 | #include <math.h> |
| 43 | 43 | |
| 44 | 44 | |
| 45 | #ifdef LSB_FIRST | |
| 46 | 45 | #undef HOST_MSB |
| 47 | #else | |
| 48 | #define HOST_MSB | |
| 49 | #endif | |
| 50 | 46 | |
| 51 | ||
| 52 | 47 | #undef TRACE_RDWR_MEM |
| 53 | 48 | #undef TRACE_ADDR_TRANSLATION |
| 54 | 49 | #undef TRACE_PAGE_FAULT |
| r4184 | r4185 | |
|---|---|---|
| 2060 | 2060 | { |
| 2061 | 2061 | if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP)) |
| 2062 | 2062 | { |
| 2063 | UML_LOAD(block, IREG(0), seqhead->opptr.l, IMM(0), DWORD); // load i0,*opptr,dword | |
| 2064 | UML_CMP(block, IREG(0), IMM(*seqhead->opptr.l)); // cmp i0,*opptr | |
| 2063 | void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc); | |
| 2064 | UML_LOAD(block, IREG(0), base, IMM(0), DWORD); // load i0,base,dword | |
| 2065 | UML_CMP(block, IREG(0), IMM(seqhead->opptr.l[0])); // cmp i0,*opptr | |
| 2065 | 2066 | UML_EXHc(block, IF_NE, ppc->impstate->nocode, IMM(seqhead->pc)); // exne nocode,seqhead->pc |
| 2066 | 2067 | } |
| 2067 | 2068 | } |
| r4184 | r4185 | |
| 2073 | 2074 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) |
| 2074 | 2075 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 2075 | 2076 | { |
| 2076 | UML_LOAD(block, IREG(0), curdesc->opptr.l, IMM(0), DWORD); // load i0,*opptr,dword | |
| 2077 | UML_CMP(block, IREG(0), IMM(*curdesc->opptr.l)); // cmp i0,*opptr | |
| 2077 | void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc); | |
| 2078 | UML_LOAD(block, IREG(0), base, IMM(0), DWORD); // load i0,base,dword | |
| 2079 | UML_CMP(block, IREG(0), IMM(curdesc->opptr.l[0])); // cmp i0,*opptr | |
| 2078 | 2080 | UML_EXHc(block, IF_NE, ppc->impstate->nocode, IMM(seqhead->pc)); // exne nocode,seqhead->pc |
| 2079 | 2081 | } |
| 2080 | 2082 | #else |
| 2081 | 2083 | UINT32 sum = 0; |
| 2082 | UML_LOAD(block, IREG(0), seqhead->opptr.l, IMM(0), DWORD); // load i0,*opptr,dword | |
| 2083 | sum += *seqhead->opptr.l; | |
| 2084 | void *base = memory_decrypted_read_ptr(ppc->program, seqhead->physpc); | |
| 2085 | UML_LOAD(block, IREG(0), base, IMM(0), DWORD); // load i0,base,dword | |
| 2086 | sum += seqhead->opptr.l[0]; | |
| 2084 | 2087 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) |
| 2085 | 2088 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 2086 | 2089 | { |
| 2087 | UML_LOAD(block, IREG(1), curdesc->opptr.l, IMM(0), DWORD); // load i1,*opptr,dword | |
| 2090 | base = memory_decrypted_read_ptr(ppc->program, curdesc->physpc); | |
| 2091 | UML_LOAD(block, IREG(1), base, IMM(0), DWORD); // load i1,base,dword | |
| 2088 | 2092 | UML_ADD(block, IREG(0), IREG(0), IREG(1)); // add i0,i0,i1 |
| 2089 | sum += | |
| 2093 | sum += | |
| 2090 | 2094 | } |
| 2091 | 2095 | UML_CMP(block, IREG(0), IMM(sum)); // cmp i0,sum |
| 2092 | 2096 | UML_EXHc(block, IF_NE, ppc->impstate->nocode, IMM(seqhead->pc)); // exne nocode,seqhead->pc |
| r4184 | r4185 | |
| 2106 | 2110 | |
| 2107 | 2111 | /* add an entry for the log */ |
| 2108 | 2112 | if (LOG_UML && !(desc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 2109 | log_add_disasm_comment(block, desc->pc, | |
| 2113 | log_add_disasm_comment(block, desc->pc, | |
| 2110 | 2114 | |
| 2111 | 2115 | /* set the PC map variable */ |
| 2112 | 2116 | UML_MAPVAR(block, MAPVAR_PC, desc->pc); // mapvar PC,desc->pc |
| r4184 | r4185 | |
| 2116 | 2120 | |
| 2117 | 2121 | /* is this a hotspot? */ |
| 2118 | 2122 | for (hotnum = 0; hotnum < PPC_MAX_HOTSPOTS; hotnum++) |
| 2119 | if (ppc->impstate->hotspot[hotnum].pc != 0 && desc->pc == ppc->impstate->hotspot[hotnum].pc && | |
| 2123 | if (ppc->impstate->hotspot[hotnum].pc != 0 && desc->pc == ppc->impstate->hotspot[hotnum].pc && | |
| 2120 | 2124 | { |
| 2121 | 2125 | compiler->cycles += ppc->impstate->hotspot[hotnum].cycles; |
| 2122 | 2126 | break; |
| r4184 | r4185 | |
| 2210 | 2214 | if (!generate_opcode(ppc, block, compiler, desc)) |
| 2211 | 2215 | { |
| 2212 | 2216 | UML_MOV(block, MEM(&ppc->pc), IMM(desc->pc)); // mov [pc],desc->pc |
| 2213 | UML_MOV(block, MEM(&ppc->impstate->arg0), IMM( | |
| 2217 | UML_MOV(block, MEM(&ppc->impstate->arg0), IMM( | |
| 2214 | 2218 | UML_CALLC(block, cfunc_unimplemented, ppc); // callc cfunc_unimplemented,ppc |
| 2215 | 2219 | } |
| 2216 | 2220 | } |
| r4184 | r4185 | |
| 2361 | 2365 | |
| 2362 | 2366 | static int generate_opcode(powerpc_state *ppc, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| 2363 | 2367 | { |
| 2364 | UINT32 op = | |
| 2368 | UINT32 op = | |
| 2365 | 2369 | UINT32 opswitch = op >> 26; |
| 2366 | 2370 | int regnum; |
| 2367 | 2371 | |
| r4184 | r4185 | |
| 2745 | 2749 | |
| 2746 | 2750 | static int generate_instruction_13(powerpc_state *ppc, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| 2747 | 2751 | { |
| 2748 | UINT32 op = | |
| 2752 | UINT32 op = | |
| 2749 | 2753 | UINT32 opswitch = (op >> 1) & 0x3ff; |
| 2750 | 2754 | |
| 2751 | 2755 | switch (opswitch) |
| r4184 | r4185 | |
| 2882 | 2886 | |
| 2883 | 2887 | static int generate_instruction_1f(powerpc_state *ppc, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| 2884 | 2888 | { |
| 2885 | UINT32 op = | |
| 2889 | UINT32 op = | |
| 2886 | 2890 | UINT32 opswitch = (op >> 1) & 0x3ff; |
| 2887 | 2891 | int item; |
| 2888 | 2892 | |
| r4184 | r4185 | |
| 3730 | 3734 | |
| 3731 | 3735 | static int generate_instruction_3b(powerpc_state *ppc, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| 3732 | 3736 | { |
| 3733 | UINT32 op = | |
| 3737 | UINT32 op = | |
| 3734 | 3738 | UINT32 opswitch = (op >> 1) & 0x1f; |
| 3735 | 3739 | |
| 3736 | 3740 | switch (opswitch) |
| r4184 | r4185 | |
| 3822 | 3826 | |
| 3823 | 3827 | static int generate_instruction_3f(powerpc_state *ppc, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| 3824 | 3828 | { |
| 3825 | UINT32 op = | |
| 3829 | UINT32 op = | |
| 3826 | 3830 | UINT32 opswitch = (op >> 1) & 0x3ff; |
| 3827 | 3831 | |
| 3828 | 3832 | if (opswitch & 0x10) |
| r4184 | r4185 | |
| 4169 | 4173 | if (desclist->flags & OPFLAG_VIRTUAL_NOOP) |
| 4170 | 4174 | strcpy(buffer, "<virtual nop>"); |
| 4171 | 4175 | else |
| 4172 | ppc_dasm_one(buffer, desclist->pc, | |
| 4176 | ppc_dasm_one(buffer, desclist->pc, | |
| 4173 | 4177 | } |
| 4174 | 4178 | else |
| 4175 | 4179 | strcpy(buffer, "???"); |
| r4184 | r4185 | |
|---|---|---|
| 130 | 130 | int ppcfe_describe(void *param, opcode_desc *desc, const opcode_desc *prev) |
| 131 | 131 | { |
| 132 | 132 | powerpc_state *ppc = param; |
| 133 | UINT32 op = *desc->opptr.l; | |
| 134 | UINT32 opswitch = op >> 26; | |
| 133 | UINT32 op, opswitch; | |
| 135 | 134 | int regnum; |
| 136 | 135 | |
| 136 | /* compute the physical PC */ | |
| 137 | if (!ppccom_translate_address(ppc, ADDRESS_SPACE_PROGRAM, TRANSLATE_FETCH, &desc->physpc)) | |
| 138 | { | |
| 139 | /* uh-oh: a page fault; leave the description empty and just if this is the first instruction, leave it empty and */ | |
| 140 | /* mark as needing to validate; otherwise, just end the sequence here */ | |
| 141 | desc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_COMPILER_PAGE_FAULT | OPFLAG_VIRTUAL_NOOP | OPFLAG_END_SEQUENCE; | |
| 142 | return TRUE; | |
| 143 | } | |
| 144 | ||
| 145 | /* fetch the opcode */ | |
| 146 | op = desc->opptr.l[0] = memory_decrypted_read_dword(ppc->program, desc->physpc); | |
| 147 | ||
| 137 | 148 | /* all instructions are 4 bytes and default to a single cycle each */ |
| 138 | 149 | desc->length = 4; |
| 139 | 150 | desc->cycles = 1; |
| 140 | 151 | |
| 141 | 152 | /* parse the instruction */ |
| 153 | opswitch = op >> 26; | |
| 142 | 154 | switch (opswitch) |
| 143 | 155 | { |
| 144 | 156 | case 0x02: /* TDI - 64-bit only */ |
| r4184 | r4185 | |
|---|---|---|
| 49 | 49 | * higher bit positions. |
| 50 | 50 | * That's the reason for the ordering in the following pointer table. |
| 51 | 51 | **************************************************************************/ |
| 52 | #ifdef LSB_FIRST | |
| 53 | #define RB(n) regs.B[((((n) & 7) << 1) | (((n) & 8) >> 3)) ^ 7] | |
| 54 | #define RW(n) regs.W[(n) ^ 3] | |
| 55 | #define RL(n) regs.L[((n) >> 1) ^ 1] | |
| 56 | #define RQ(n) regs.Q[((n) >> 2)] | |
| 57 | #else | |
| 58 | #define RB(n) regs.B[(((n) & 7) << 1) | (((n) & 8) >> 3)] | |
| 59 | #define RW(n) regs.W[(n)] | |
| 60 | #define RL(n) regs.L[((n) >> 1)] | |
| 61 | #define RQ(n) regs.Q[((n) >> 2)] | |
| 62 | #endif | |
| 52 | #define RB(n) regs.B[BYTE8_XOR_BE((((n) & 7) << 1) | (((n) & 8) >> 3))] | |
| 53 | #define RW(n) regs.W[BYTE4_XOR_BE(n)] | |
| 54 | #define RL(n) regs.L[BYTE_XOR_BE((n) >> 1)] | |
| 55 | #define RQ(n) regs.Q[(n) >> 2] | |
| 63 | 56 | |
| 64 | 57 | /* the register used as stack pointer */ |
| 65 | 58 | #define SP 15 |
| r4184 | r4185 | |
|---|---|---|
| 21 | 21 | #include "cpu/drcumlsh.h" |
| 22 | 22 | #endif |
| 23 | 23 | |
| 24 | #define SH2_CODE_XOR(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(2,0)) | |
| 25 | ||
| 24 | 26 | typedef struct _irq_entry irq_entry; |
| 25 | 27 | struct _irq_entry |
| 26 | 28 | { |
| r4184 | r4185 | |
|---|---|---|
| 1376 | 1376 | if (desclist->flags & OPFLAG_VIRTUAL_NOOP) |
| 1377 | 1377 | strcpy(buffer, "<virtual nop>"); |
| 1378 | 1378 | else |
| 1379 | DasmSH2(buffer, desclist->pc, | |
| 1379 | DasmSH2(buffer, desclist->pc, | |
| 1380 | 1380 | #else |
| 1381 | 1381 | strcpy(buffer, "???"); |
| 1382 | 1382 | #endif |
| r4184 | r4185 | |
| 1505 | 1505 | { |
| 1506 | 1506 | if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1507 | 1507 | { |
| 1508 | UML_LOAD(block, IREG(0), seqhead->opptr.l, IMM(0), DWORD); // load i0,*opptr,0,dword | |
| 1509 | UML_CMP(block, IREG(0), IMM(*seqhead->opptr.l)); // cmp i0,*opptr | |
| 1508 | void *base = memory_decrypted_read_ptr(sh2->program, SH2_CODE_XOR(seqhead->physpc)); | |
| 1509 | UML_LOAD(block, IREG(0), base, IMM(0), WORD); // load i0,base,word | |
| 1510 | UML_CMP(block, IREG(0), IMM(seqhead->opptr.w[0])); // cmp i0,*opptr | |
| 1510 | 1511 | UML_EXHc(block, IF_NE, sh2->nocode, IMM(epc(seqhead))); // exne nocode,seqhead->pc |
| 1511 | 1512 | } |
| 1512 | 1513 | } |
| r4184 | r4185 | |
| 1518 | 1519 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) |
| 1519 | 1520 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1520 | 1521 | { |
| 1522 | base = memory_decrypted_read_ptr(sh2->program, SH2_CODE_XOR(curdesc->physpc)); | |
| 1521 | 1523 | UML_LOAD(block, IREG(0), curdesc->opptr.w, IMM(0), WORD); // load i0,*opptr,0,word |
| 1522 | UML_CMP(block, IREG(0), IMM( | |
| 1524 | UML_CMP(block, IREG(0), IMM( | |
| 1523 | 1525 | UML_EXHc(block, IF_NE, sh2->nocode, IMM(epc(seqhead))); // exne nocode,seqhead->pc |
| 1524 | 1526 | } |
| 1525 | 1527 | #else |
| 1526 | 1528 | UINT32 sum = 0; |
| 1527 | UML_LOAD(block, IREG(0), seqhead->opptr.l, IMM(0), DWORD); // load i0,*opptr,0,dword | |
| 1528 | sum += *seqhead->opptr.l; | |
| 1529 | void *base = memory_decrypted_read_ptr(sh2->program, SH2_CODE_XOR(seqhead->physpc)); | |
| 1530 | UML_LOAD(block, IREG(0), base, IMM(0), WORD); // load i0,base,word | |
| 1531 | sum += seqhead->opptr.w[0]; | |
| 1529 | 1532 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) |
| 1530 | 1533 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1531 | 1534 | { |
| 1532 | UML_LOAD(block, IREG(1), curdesc->opptr.l, IMM(0), DWORD); // load i1,*opptr,dword | |
| 1535 | base = memory_decrypted_read_ptr(sh2->program, SH2_CODE_XOR(curdesc->physpc)); | |
| 1536 | UML_LOAD(block, IREG(1), base, IMM(0), WORD); // load i1,*opptr,word | |
| 1533 | 1537 | UML_ADD(block, IREG(0), IREG(0), IREG(1)); // add i0,i0,i1 |
| 1534 | sum += | |
| 1538 | sum += | |
| 1535 | 1539 | } |
| 1536 | 1540 | UML_CMP(block, IREG(0), IMM(sum)); // cmp i0,sum |
| 1537 | 1541 | UML_EXHc(block, IF_NE, sh2->nocode, IMM(epc(seqhead))); // exne nocode,seqhead->pc |
| r4184 | r4185 | |
| 1551 | 1555 | |
| 1552 | 1556 | /* add an entry for the log */ |
| 1553 | 1557 | if (LOG_UML && !(desc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1554 | log_add_disasm_comment(block, desc->pc, | |
| 1558 | log_add_disasm_comment(block, desc->pc, | |
| 1555 | 1559 | |
| 1556 | 1560 | /* set the PC map variable */ |
| 1557 | 1561 | expc = (desc->flags & OPFLAG_IN_DELAY_SLOT) ? desc->pc - 1 : desc->pc; |
| r4184 | r4185 | |
| 1622 | 1626 | if (!generate_opcode(sh2, block, compiler, desc)) |
| 1623 | 1627 | { |
| 1624 | 1628 | UML_MOV(block, MEM(&sh2->pc), IMM(desc->pc)); // mov [pc],desc->pc |
| 1625 | UML_MOV(block, MEM(&sh2->arg0), IMM( | |
| 1629 | UML_MOV(block, MEM(&sh2->arg0), IMM( | |
| 1626 | 1630 | UML_CALLC(block, cfunc_unimplemented, sh2); // callc cfunc_unimplemented |
| 1627 | 1631 | } |
| 1628 | 1632 | } |
| r4184 | r4185 | |
| 1653 | 1657 | { |
| 1654 | 1658 | UINT32 scratch, scratch2; |
| 1655 | 1659 | INT32 disp; |
| 1656 | UINT16 opcode = | |
| 1660 | UINT16 opcode = | |
| 1657 | 1661 | UINT8 opswitch = opcode >> 12; |
| 1658 | 1662 | int in_delay_slot = ((desc->flags & OPFLAG_IN_DELAY_SLOT) != 0); |
| 1659 | 1663 | |
| r4184 | r4185 | |
| 1830 | 1834 | case 0x24: // MOVBS0(Rm, Rn); |
| 1831 | 1835 | case 0x34: // MOVBS0(Rm, Rn); |
| 1832 | 1836 | UML_ADD(block, IREG(0), R32(0), R32(Rn)); // add r0, R0, Rn |
| 1833 | UML_MOV(block, IREG(1), R32(Rm)); // mov r1, Rm | |
| 1834 | UML_AND(block, IREG(1), IREG(1), IMM(0x000000ff)); // and r1, r1, 0xff | |
| 1837 | UML_AND(block, IREG(1), R32(Rm), IMM(0x000000ff)); // and r1, Rm, 0xff | |
| 1835 | 1838 | UML_CALLH(block, sh2->write8); // call write8 |
| 1836 | 1839 | |
| 1837 | 1840 | if (!in_delay_slot) |
| r4184 | r4185 | |
| 1843 | 1846 | case 0x25: // MOVWS0(Rm, Rn); |
| 1844 | 1847 | case 0x35: // MOVWS0(Rm, Rn); |
| 1845 | 1848 | UML_ADD(block, IREG(0), R32(0), R32(Rn)); // add r0, R0, Rn |
| 1846 | UML_MOV(block, IREG(1), R32(Rm)); // mov r1, Rm | |
| 1847 | UML_AND(block, IREG(1), IREG(1), IMM(0x0000ffff)); // and r1, r1, 0xffff | |
| 1849 | UML_AND(block, IREG(1), R32(Rm), IMM(0x0000ffff)); // and r1, Rm, 0xffff | |
| 1848 | 1850 | UML_CALLH(block, sh2->write16); // call write16 |
| 1849 | 1851 | |
| 1850 | 1852 | if (!in_delay_slot) |
| r4184 | r4185 | |
| 1934 | 1936 | if (sh2->cpu_type > CPU_TYPE_SH1) |
| 1935 | 1937 | { |
| 1936 | 1938 | save_fast_iregs(sh2, block); |
| 1937 | UML_MOV(block, MEM(&sh2->arg0), IMM( | |
| 1939 | UML_MOV(block, MEM(&sh2->arg0), IMM( | |
| 1938 | 1940 | UML_CALLC(block, cfunc_MAC_L, sh2); |
| 1939 | 1941 | load_fast_iregs(sh2, block); |
| 1940 | 1942 | return TRUE; |
| r4184 | r4185 | |
| 2054 | 2056 | { |
| 2055 | 2057 | case 0: // MOVBS(Rm, Rn); |
| 2056 | 2058 | UML_MOV(block, IREG(0), R32(Rn)); // mov r0, Rn |
| 2057 | UML_MOV(block, IREG(1), R32(Rm)); // mov r1, Rm | |
| 2058 | UML_AND(block, IREG(1), IREG(1), IMM(0xff)); // and r1, r1, 0xff | |
| 2059 | UML_AND(block, IREG(1), R32(Rm), IMM(0xff)); // and r1, Rm, 0xff | |
| 2059 | 2060 | UML_CALLH(block, sh2->write8); |
| 2060 | 2061 | |
| 2061 | 2062 | if (!in_delay_slot) |
| r4184 | r4185 | |
| 2064 | 2065 | |
| 2065 | 2066 | case 1: // MOVWS(Rm, Rn); |
| 2066 | 2067 | UML_MOV(block, IREG(0), R32(Rn)); // mov r0, Rn |
| 2067 | UML_MOV(block, IREG(1), R32(Rm)); // mov r1, Rm | |
| 2068 | UML_AND(block, IREG(1), IREG(1), IMM(0xffff)); // and r1, r1, 0xffff | |
| 2068 | UML_AND(block, IREG(1), R32(Rm), IMM(0xffff)); // and r1, Rm, 0xffff | |
| 2069 | 2069 | UML_CALLH(block, sh2->write16); |
| 2070 | 2070 | |
| 2071 | 2071 | if (!in_delay_slot) |
| r4184 | r4185 | |
| 2259 | 2259 | |
| 2260 | 2260 | case 4: // DIV1(Rm, Rn); |
| 2261 | 2261 | save_fast_iregs(sh2, block); |
| 2262 | UML_MOV(block, MEM(&sh2->arg0), IMM( | |
| 2262 | UML_MOV(block, MEM(&sh2->arg0), IMM( | |
| 2263 | 2263 | UML_CALLC(block, cfunc_DIV1, sh2); |
| 2264 | 2264 | load_fast_iregs(sh2, block); |
| 2265 | 2265 | return TRUE; |
| r4184 | r4185 | |
| 2302 | 2302 | UML_ROLINS(block, MEM(&sh2->sr), IREG(0), IMM(0), IMM(T)); // rolins [sr],i0,0,T |
| 2303 | 2303 | #else |
| 2304 | 2304 | save_fast_iregs(sh2, block); |
| 2305 | UML_MOV(block, MEM(&sh2->arg0), IMM( | |
| 2305 | UML_MOV(block, MEM(&sh2->arg0), IMM( | |
| 2306 | 2306 | UML_CALLC(block, cfunc_SUBV, sh2); |
| 2307 | 2307 | load_fast_iregs(sh2, block); |
| 2308 | 2308 | #endif |
| r4184 | r4185 | |
| 2322 | 2322 | UML_ROLINS(block, MEM(&sh2->sr), IREG(0), IMM(0), IMM(T)); // rolins [sr],i0,0,T |
| 2323 | 2323 | #else |
| 2324 | 2324 | save_fast_iregs(sh2, block); |
| 2325 | UML_MOV(block, MEM(&sh2->arg0), IMM( | |
| 2325 | UML_MOV(block, MEM(&sh2->arg0), IMM( | |
| 2326 | 2326 | UML_CALLC(block, cfunc_ADDV, sh2); |
| 2327 | 2327 | load_fast_iregs(sh2, block); |
| 2328 | 2328 | #endif |
| r4184 | r4185 | |
| 2457 | 2457 | case 0x2f: // MAC_W(Rm, Rn); |
| 2458 | 2458 | case 0x3f: // MAC_W(Rm, Rn); |
| 2459 | 2459 | save_fast_iregs(sh2, block); |
| 2460 | UML_MOV(block, MEM(&sh2->arg0), IMM( | |
| 2460 | UML_MOV(block, MEM(&sh2->arg0), IMM( | |
| 2461 | 2461 | UML_CALLC(block, cfunc_MAC_W, sh2); |
| 2462 | 2462 | load_fast_iregs(sh2, block); |
| 2463 | 2463 | return TRUE; |
| r4184 | r4185 | |
| 2767 | 2767 | UML_CALLH(block, sh2->read8); // call read8 |
| 2768 | 2768 | UML_SEXT(block, R32(Rn), IREG(0), BYTE); // sext Rn, r0, BYTE |
| 2769 | 2769 | |
| 2770 | UML_CMP(block, IMM(Rn), IMM(Rm)); // cmp N, M | |
| 2771 | UML_JMPc(block, IF_Z, compiler->labelnum); // jz compiler->labelnum | |
| 2770 | if (Rm != Rn) | |
| 2771 | UML_ADD(block, R32(Rm), R32(Rm), IMM(1)); // add Rm, Rm, #1 | |
| 2772 | 2772 | |
| 2773 | UML_ADD(block, R32(Rm), R32(Rm), IMM(1)); // add Rm, Rm, #1 | |
| 2774 | ||
| 2775 | UML_LABEL(block, compiler->labelnum++); // labelnum: | |
| 2776 | ||
| 2777 | 2773 | if (!in_delay_slot) |
| 2778 | 2774 | generate_update_cycles(sh2, block, compiler, IMM(desc->pc + 2), TRUE); |
| 2779 | 2775 | return TRUE; |
| r4184 | r4185 | |
| 2783 | 2779 | UML_CALLH(block, sh2->read16); // call read16 |
| 2784 | 2780 | UML_SEXT(block, R32(Rn), IREG(0), WORD); // sext Rn, r0, WORD |
| 2785 | 2781 | |
| 2786 | UML_CMP(block, IMM(Rn), IMM(Rm)); // cmp N, M | |
| 2787 | UML_JMPc(block, IF_Z, compiler->labelnum); // jz compiler->labelnum | |
| 2782 | if (Rm != Rn) | |
| 2783 | UML_ADD(block, R32(Rm), R32(Rm), IMM(2)); // add Rm, Rm, #2 | |
| 2788 | 2784 | |
| 2789 | UML_ADD(block, R32(Rm), R32(Rm), IMM(2)); // add Rm, Rm, #2 | |
| 2790 | ||
| 2791 | UML_LABEL(block, compiler->labelnum++); // labelnum: | |
| 2792 | ||
| 2793 | 2785 | if (!in_delay_slot) |
| 2794 | 2786 | generate_update_cycles(sh2, block, compiler, IMM(desc->pc + 2), TRUE); |
| 2795 | 2787 | return TRUE; |
| r4184 | r4185 | |
| 2799 | 2791 | UML_CALLH(block, sh2->read32); // call read32 |
| 2800 | 2792 | UML_MOV(block, R32(Rn), IREG(0)); // mov Rn, r0 |
| 2801 | 2793 | |
| 2802 | UML_CMP(block, IMM(Rn), IMM(Rm)); // cmp N, M | |
| 2803 | UML_JMPc(block, IF_Z, compiler->labelnum); // jz compiler->labelnum | |
| 2794 | if (Rm != Rn) | |
| 2795 | UML_ADD(block, R32(Rm), R32(Rm), IMM(4)); // add Rm, Rm, #4 | |
| 2804 | 2796 | |
| 2805 | UML_ADD(block, R32(Rm), R32(Rm), IMM(4)); // add Rm, Rm, #4 | |
| 2806 | ||
| 2807 | UML_LABEL(block, compiler->labelnum++); // labelnum: | |
| 2808 | ||
| 2809 | 2797 | if (!in_delay_slot) |
| 2810 | 2798 | generate_update_cycles(sh2, block, compiler, IMM(desc->pc + 2), TRUE); |
| 2811 | 2799 | return TRUE; |
| r4184 | r4185 | |
|---|---|---|
| 26 | 26 | static int describe_group_8(SH2 *context, opcode_desc *desc, const opcode_desc *prev, UINT16 opcode); |
| 27 | 27 | static int describe_group_12(SH2 *context, opcode_desc *desc, const opcode_desc *prev, UINT16 opcode); |
| 28 | 28 | |
| 29 | ||
| 30 | ||
| 29 | 31 | /*************************************************************************** |
| 30 | 32 | INSTRUCTION PARSERS |
| 31 | 33 | ***************************************************************************/ |
| r4184 | r4185 | |
| 37 | 39 | |
| 38 | 40 | int sh2_describe(void *param, opcode_desc *desc, const opcode_desc *prev) |
| 39 | 41 | { |
| 40 | UINT16 opcode = *desc->opptr.w; | |
| 41 | 42 | SH2 *context = (SH2 *)param; |
| 43 | UINT16 opcode; | |
| 42 | 44 | |
| 45 | /* fetch the opcode */ | |
| 46 | opcode = desc->opptr.w[0] = memory_decrypted_read_word(context->program, SH2_CODE_XOR(desc->physpc)); | |
| 47 | ||
| 43 | 48 | /* all instructions are 2 bytes and most are a single cycle */ |
| 44 | 49 | desc->length = 2; |
| 45 | 50 | desc->cycles = 1; |
| r4184 | r4185 | |
|---|---|---|
| 42 | 42 | int mips3fe_describe(void *param, opcode_desc *desc, const opcode_desc *prev) |
| 43 | 43 | { |
| 44 | 44 | mips3_state *mips = param; |
| 45 | UINT32 op = *desc->opptr.l; | |
| 46 | UINT8 opswitch = op >> 26; | |
| 45 | UINT32 op, opswitch; | |
| 47 | 46 | |
| 47 | /* compute the physical PC */ | |
| 48 | if (!mips3com_translate_address(mips, ADDRESS_SPACE_PROGRAM, TRANSLATE_FETCH, &desc->physpc)) | |
| 49 | { | |
| 50 | /* uh-oh: a page fault; leave the description empty and just if this is the first instruction, leave it empty and */ | |
| 51 | /* mark as needing to validate; otherwise, just end the sequence here */ | |
| 52 | desc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_COMPILER_PAGE_FAULT | OPFLAG_VIRTUAL_NOOP | OPFLAG_END_SEQUENCE; | |
| 53 | return TRUE; | |
| 54 | } | |
| 55 | ||
| 56 | /* fetch the opcode */ | |
| 57 | op = desc->opptr.l[0] = memory_decrypted_read_dword(mips->program, desc->physpc); | |
| 58 | ||
| 48 | 59 | /* all instructions are 4 bytes and default to a single cycle each */ |
| 49 | 60 | desc->length = 4; |
| 50 | 61 | desc->cycles = 1; |
| 51 | 62 | |
| 52 | 63 | /* parse the instruction */ |
| 64 | opswitch = op >> 26; | |
| 53 | 65 | switch (opswitch) |
| 54 | 66 | { |
| 55 | 67 | case 0x00: /* SPECIAL */ |
| r4184 | r4185 | |
|---|---|---|
| 91 | 91 | MACROS |
| 92 | 92 | ***************************************************************************/ |
| 93 | 93 | |
| 94 | #ifdef LSB_FIRST | |
| 95 | #define LOPTR(x) ((UINT32 *)(x)) | |
| 96 | #else | |
| 97 | #define LOPTR(x) ((UINT32 *)(x) + 1) | |
| 98 | #endif | |
| 94 | #define LOPTR(x) ((UINT32 *)(x) + NATIVE_ENDIAN_VALUE_LE_BE(0,1)) | |
| 99 | 95 | |
| 100 | 96 | #define R32(reg) mips3->impstate->regmaplo[reg].type, mips3->impstate->regmaplo[reg].value |
| 101 | 97 | #define LO32 R32(REG_LO) |
| r4184 | r4185 | |
| 1475 | 1471 | { |
| 1476 | 1472 | if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1477 | 1473 | { |
| 1478 | UML_LOAD(block, IREG(0), seqhead->opptr.l, IMM(0), DWORD); // load i0,*opptr,0,dword | |
| 1479 | UML_CMP(block, IREG(0), IMM(*seqhead->opptr.l)); // cmp i0,*opptr | |
| 1474 | void *base = memory_decrypted_read_ptr(mips3->program, seqhead->physpc); | |
| 1475 | UML_LOAD(block, IREG(0), base, IMM(0), DWORD); // load i0,base,0,dword | |
| 1476 | UML_CMP(block, IREG(0), IMM(seqhead->opptr.l[0])); // cmp i0,opptr[0] | |
| 1480 | 1477 | UML_EXHc(block, IF_NE, mips3->impstate->nocode, IMM(epc(seqhead))); // exne nocode,seqhead->pc |
| 1481 | 1478 | } |
| 1482 | 1479 | } |
| r4184 | r4185 | |
| 1488 | 1485 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) |
| 1489 | 1486 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1490 | 1487 | { |
| 1491 | UML_LOAD(block, IREG(0), curdesc->opptr.l, IMM(0), DWORD); // load i0,*opptr,0,dword | |
| 1492 | UML_CMP(block, IREG(0), IMM(*curdesc->opptr.l)); // cmp i0,*opptr | |
| 1488 | void *base = memory_decrypted_read_ptr(mips3->program, seqhead->physpc); | |
| 1489 | UML_LOAD(block, IREG(0), base, IMM(0), DWORD); // load i0,base,0,dword | |
| 1490 | UML_CMP(block, IREG(0), IMM(curdesc->opptr.l[0])); // cmp i0,opptr[0] | |
| 1493 | 1491 | UML_EXHc(block, IF_NE, mips3->impstate->nocode, IMM(epc(seqhead))); // exne nocode,seqhead->pc |
| 1494 | 1492 | } |
| 1495 | 1493 | #else |
| 1496 | 1494 | UINT32 sum = 0; |
| 1497 | UML_LOAD(block, IREG(0), seqhead->opptr.l, IMM(0), DWORD); // load i0,*opptr,0,dword | |
| 1498 | sum += *seqhead->opptr.l; | |
| 1495 | void *base = memory_decrypted_read_ptr(mips3->program, seqhead->physpc); | |
| 1496 | UML_LOAD(block, IREG(0), base, IMM(0), DWORD); // load i0,base,0,dword | |
| 1497 | sum += seqhead->opptr.l[0]; | |
| 1499 | 1498 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) |
| 1500 | 1499 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1501 | 1500 | { |
| 1502 | UML_LOAD(block, IREG(1), curdesc->opptr.l, IMM(0), DWORD); // load i1,*opptr,dword | |
| 1501 | base = memory_decrypted_read_ptr(mips3->program, curdesc->physpc); | |
| 1502 | UML_LOAD(block, IREG(1), base, IMM(0), DWORD); // load i1,base,dword | |
| 1503 | 1503 | UML_ADD(block, IREG(0), IREG(0), IREG(1)); // add i0,i0,i1 |
| 1504 | sum += | |
| 1504 | sum += | |
| 1505 | 1505 | } |
| 1506 | 1506 | UML_CMP(block, IREG(0), IMM(sum)); // cmp i0,sum |
| 1507 | 1507 | UML_EXHc(block, IF_NE, mips3->impstate->nocode, IMM(epc(seqhead))); // exne nocode,seqhead->pc |
| r4184 | r4185 | |
| 1522 | 1522 | |
| 1523 | 1523 | /* add an entry for the log */ |
| 1524 | 1524 | if (LOG_UML && !(desc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1525 | log_add_disasm_comment(mips3, block, desc->pc, | |
| 1525 | log_add_disasm_comment(mips3, block, desc->pc, | |
| 1526 | 1526 | |
| 1527 | 1527 | /* set the PC map variable */ |
| 1528 | 1528 | expc = (desc->flags & OPFLAG_IN_DELAY_SLOT) ? desc->pc - 3 : desc->pc; |
| r4184 | r4185 | |
| 1533 | 1533 | |
| 1534 | 1534 | /* is this a hotspot? */ |
| 1535 | 1535 | for (hotnum = 0; hotnum < MIPS3_MAX_HOTSPOTS; hotnum++) |
| 1536 | if (mips3->impstate->hotspot[hotnum].pc != 0 && desc->pc == mips3->impstate->hotspot[hotnum].pc && | |
| 1536 | if (mips3->impstate->hotspot[hotnum].pc != 0 && desc->pc == mips3->impstate->hotspot[hotnum].pc && | |
| 1537 | 1537 | { |
| 1538 | 1538 | compiler->cycles += mips3->impstate->hotspot[hotnum].cycles; |
| 1539 | 1539 | break; |
| r4184 | r4185 | |
| 1623 | 1623 | if (!generate_opcode(mips3, block, compiler, desc)) |
| 1624 | 1624 | { |
| 1625 | 1625 | UML_MOV(block, MEM(&mips3->pc), IMM(desc->pc)); // mov [pc],desc->pc |
| 1626 | UML_MOV(block, MEM(&mips3->impstate->arg0), IMM( | |
| 1626 | UML_MOV(block, MEM(&mips3->impstate->arg0), IMM( | |
| 1627 | 1627 | UML_CALLC(block, cfunc_unimplemented, mips3); // callc cfunc_unimplemented |
| 1628 | 1628 | } |
| 1629 | 1629 | } |
| r4184 | r4185 | |
| 1637 | 1637 | static void generate_delay_slot_and_branch(mips3_state *mips3, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT8 linkreg) |
| 1638 | 1638 | { |
| 1639 | 1639 | compiler_state compiler_temp = *compiler; |
| 1640 | UINT32 op = | |
| 1640 | UINT32 op = | |
| 1641 | 1641 | |
| 1642 | 1642 | /* fetch the target register if dynamic, in case it is modified by the delay slot */ |
| 1643 | 1643 | if (desc->targetpc == BRANCH_TARGET_DYNAMIC) |
| r4184 | r4185 | |
| 1686 | 1686 | static int generate_opcode(mips3_state *mips3, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| 1687 | 1687 | { |
| 1688 | 1688 | int in_delay_slot = ((desc->flags & OPFLAG_IN_DELAY_SLOT) != 0); |
| 1689 | UINT32 op = | |
| 1689 | UINT32 op = | |
| 1690 | 1690 | UINT8 opswitch = op >> 26; |
| 1691 | 1691 | drcuml_codelabel skip; |
| 1692 | 1692 | |
| r4184 | r4185 | |
| 2208 | 2208 | |
| 2209 | 2209 | static int generate_special(mips3_state *mips3, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| 2210 | 2210 | { |
| 2211 | UINT32 op = | |
| 2211 | UINT32 op = | |
| 2212 | 2212 | UINT8 opswitch = op & 63; |
| 2213 | 2213 | |
| 2214 | 2214 | switch (opswitch) |
| r4184 | r4185 | |
| 2601 | 2601 | |
| 2602 | 2602 | static int generate_regimm(mips3_state *mips3, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| 2603 | 2603 | { |
| 2604 | UINT32 op = | |
| 2604 | UINT32 op = | |
| 2605 | 2605 | UINT8 opswitch = RTREG; |
| 2606 | 2606 | drcuml_codelabel skip; |
| 2607 | 2607 | |
| r4184 | r4185 | |
| 2679 | 2679 | |
| 2680 | 2680 | static int generate_idt(mips3_state *mips3, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| 2681 | 2681 | { |
| 2682 | UINT32 op = | |
| 2682 | UINT32 op = | |
| 2683 | 2683 | UINT8 opswitch = op & 0x1f; |
| 2684 | 2684 | |
| 2685 | 2685 | /* only enabled on IDT processors */ |
| r4184 | r4185 | |
| 2847 | 2847 | |
| 2848 | 2848 | static int generate_cop0(mips3_state *mips3, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| 2849 | 2849 | { |
| 2850 | UINT32 op = | |
| 2850 | UINT32 op = | |
| 2851 | 2851 | UINT8 opswitch = RSREG; |
| 2852 | 2852 | int skip; |
| 2853 | 2853 | |
| r4184 | r4185 | |
| 2973 | 2973 | |
| 2974 | 2974 | static int generate_cop1(mips3_state *mips3, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| 2975 | 2975 | { |
| 2976 | UINT32 op = | |
| 2976 | UINT32 op = | |
| 2977 | 2977 | drcuml_codelabel skip; |
| 2978 | 2978 | int condition; |
| 2979 | 2979 | |
| r4184 | r4185 | |
| 3350 | 3350 | static int generate_cop1x(mips3_state *mips3, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) |
| 3351 | 3351 | { |
| 3352 | 3352 | int in_delay_slot = ((desc->flags & OPFLAG_IN_DELAY_SLOT) != 0); |
| 3353 | UINT32 op = | |
| 3353 | UINT32 op = | |
| 3354 | 3354 | |
| 3355 | 3355 | if (mips3->impstate->drcoptions & MIPS3DRC_STRICT_COP1) |
| 3356 | 3356 | { |
| r4184 | r4185 | |
| 3595 | 3595 | if (desclist->flags & OPFLAG_VIRTUAL_NOOP) |
| 3596 | 3596 | strcpy(buffer, "<virtual nop>"); |
| 3597 | 3597 | else |
| 3598 | dasmmips3(buffer, desclist->pc, | |
| 3598 | dasmmips3(buffer, desclist->pc, | |
| 3599 | 3599 | #else |
| 3600 | 3600 | strcpy(buffer, "???"); |
| 3601 | 3601 | #endif |
| r4184 | r4185 | |
|---|---|---|
| 844 | 844 | state_save_register_device_item(device, 0, cdp1869->toneamp); |
| 845 | 845 | state_save_register_device_item(device, 0, cdp1869->wnfreq); |
| 846 | 846 | state_save_register_device_item(device, 0, cdp1869->wnamp); |
| 847 | ||
| 848 | return DEVICE_START_OK; | |
| 849 | 847 | } |
| 850 | 848 | |
| 851 | 849 | static DEVICE_SET_INFO( cdp1869 ) |
| r4184 | r4185 | |
|---|---|---|
| 4614 | 4614 | |
| 4615 | 4615 | /* register for save states */ |
| 4616 | 4616 | init_save_state(device); |
| 4617 | ||
| 4618 | return DEVICE_START_OK; | |
| 4619 | 4617 | } |
| 4620 | 4618 | |
| 4621 | 4619 |
| r4184 | r4185 | |
|---|---|---|
| 738 | 738 | |
| 739 | 739 | |
| 740 | 740 | /* device interface */ |
| 741 | static | |
| 741 | static | |
| 742 | 742 | { |
| 743 | 743 | mc6845_t *mc6845 = get_safe_token(device); |
| 744 | 744 | |
| r4184 | r4185 | |
| 806 | 806 | state_save_register_device_item(device, 0, mc6845->cursor_state); |
| 807 | 807 | state_save_register_device_item(device, 0, mc6845->cursor_blink_count); |
| 808 | 808 | state_save_register_device_item(device, 0, mc6845->update_addr); |
| 809 | ||
| 810 | return DEVICE_START_OK; | |
| 811 | 809 | } |
| 812 | 810 | |
| 813 | 811 | static DEVICE_START( mc6845 ) |
| 814 | 812 | { |
| 815 | | |
| 813 | | |
| 816 | 814 | } |
| 817 | 815 | |
| 818 | 816 | static DEVICE_START( mc6845_1 ) |
| 819 | 817 | { |
| 820 | | |
| 818 | | |
| 821 | 819 | } |
| 822 | 820 | |
| 823 | 821 | static DEVICE_START( c6545_1 ) |
| 824 | 822 | { |
| 825 | | |
| 823 | | |
| 826 | 824 | } |
| 827 | 825 | |
| 828 | 826 | static DEVICE_START( r6545_1 ) |
| 829 | 827 | { |
| 830 | | |
| 828 | | |
| 831 | 829 | } |
| 832 | 830 | |
| 833 | 831 | static DEVICE_START( h46505 ) |
| 834 | 832 | { |
| 835 | | |
| 833 | | |
| 836 | 834 | } |
| 837 | 835 | |
| 838 | 836 | static DEVICE_START( hd6845 ) |
| 839 | 837 | { |
| 840 | | |
| 838 | | |
| 841 | 839 | } |
| 842 | 840 | |
| 843 | 841 | static DEVICE_START( sy6545_1 ) |
| 844 | 842 | { |
| 845 | | |
| 843 | | |
| 846 | 844 | } |
| 847 | 845 | |
| 848 | 846 |
| r4184 | r4185 | |
|---|---|---|
| 1264 | 1264 | state_save_register_device_item(screen, 0, state->vblank_end_time.attoseconds); |
| 1265 | 1265 | state_save_register_device_item(screen, 0, state->frame_number); |
| 1266 | 1266 | state_save_register_postload(device->machine, video_screen_postload, (void *)device); |
| 1267 | ||
| 1268 | return DEVICE_START_OK; | |
| 1269 | 1267 | } |
| 1270 | 1268 | |
| 1271 | 1269 |
| r4184 | r4185 | |
|---|---|---|
| 178 | 178 | #define HANDLER_TO_BANK(h) ((UINT32)(FPTR)(h)) |
| 179 | 179 | #define BANK_TO_HANDLER(b) ((genf *)(FPTR)(b)) |
| 180 | 180 | |
| 181 | #undef ADDR2BYTE | |
| 182 | #undef BYTE2ADDR | |
| 183 | #define ADDR2BYTE(s,a) (((s)->ashift < 0) ? ((a) << -(s)->ashift) : ((a) >> (s)->ashift)) | |
| 184 | #define ADDR2BYTE_END(s,a) (((s)->ashift < 0) ? (((a) << -(s)->ashift) | ((1 << -(s)->ashift) - 1)) : ((a) >> (s)->ashift)) | |
| 185 | #define BYTE2ADDR(s,a) (((s)->ashift < 0) ? ((a) >> -(s)->ashift) : ((a) << (s)->ashift)) | |
| 186 | ||
| 187 | 181 | #define SUBTABLE_PTR(tabledata, entry) (&(tabledata)->table[(1 << LEVEL1_BITS) + (((entry) - SUBTABLE_BASE) << LEVEL2_BITS)]) |
| 188 | 182 | |
| 189 | 183 | |
| r4184 | r4185 | |
| 402 | 396 | *end &= ~*mirror & space->addrmask; |
| 403 | 397 | |
| 404 | 398 | /* adjust to byte values */ |
| 405 | *start = ADDR2BYTE(space, *start); | |
| 406 | *end = ADDR2BYTE_END(space, *end); | |
| 407 | *mask = ADDR2BYTE(space, *mask); | |
| 408 | *mirror = ADDR2BYTE(space, *mirror); | |
| 399 | *start = memory_address_to_byte(space, *start); | |
| 400 | *end = memory_address_to_byte_end(space, *end); | |
| 401 | *mask = memory_address_to_byte(space, *mask); | |
| 402 | *mirror = memory_address_to_byte(space, *mirror); | |
| 409 | 403 | } |
| 410 | 404 | |
| 411 | 405 | |
| r4184 | r4185 | |
| 826 | 820 | |
| 827 | 821 | void memory_set_decrypted_region(const address_space *space, offs_t addrstart, offs_t addrend, void *base) |
| 828 | 822 | { |
| 829 | offs_t bytestart = ADDR2BYTE(space, addrstart); | |
| 830 | offs_t byteend = ADDR2BYTE_END(space, addrend); | |
| 823 | offs_t bytestart = memory_address_to_byte(space, addrstart); | |
| 824 | offs_t byteend = memory_address_to_byte_end(space, addrend); | |
| 831 | 825 | int banknum, found = FALSE; |
| 832 | 826 | |
| 833 | 827 | /* loop over banks looking for a match */ |
| r4184 | r4185 | |
| 1160 | 1154 | if (whandler != 0) |
| 1161 | 1155 | space_map_range(spacerw, ROW_WRITE, spacerw->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, spacerw, whandler_name); |
| 1162 | 1156 | mem_dump(space->machine); |
| 1163 | return space_find_backing_memory(spacerw, | |
| 1157 | return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); | |
| 1164 | 1158 | } |
| 1165 | 1159 | |
| 1166 | 1160 | |
| r4184 | r4185 | |
| 1177 | 1171 | if (whandler != NULL) |
| 1178 | 1172 | space_map_range(spacerw, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name); |
| 1179 | 1173 | mem_dump(space->machine); |
| 1180 | return space_find_backing_memory(spacerw, | |
| 1174 | return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); | |
| 1181 | 1175 | } |
| 1182 | 1176 | |
| 1183 | 1177 | |
| r4184 | r4185 | |
| 1194 | 1188 | if (whandler != NULL) |
| 1195 | 1189 | space_map_range(spacerw, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name); |
| 1196 | 1190 | mem_dump(space->machine); |
| 1197 | return space_find_backing_memory(spacerw, | |
| 1191 | return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); | |
| 1198 | 1192 | } |
| 1199 | 1193 | |
| 1200 | 1194 | |
| r4184 | r4185 | |
| 1211 | 1205 | if (whandler != NULL) |
| 1212 | 1206 | space_map_range(spacerw, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name); |
| 1213 | 1207 | mem_dump(space->machine); |
| 1214 | return space_find_backing_memory(spacerw, | |
| 1208 | return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); | |
| 1215 | 1209 | } |
| 1216 | 1210 | |
| 1217 | 1211 | |
| r4184 | r4185 | |
| 1228 | 1222 | if (whandler != NULL) |
| 1229 | 1223 | space_map_range(spacerw, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name); |
| 1230 | 1224 | mem_dump(space->machine); |
| 1231 | return space_find_backing_memory(spacerw, | |
| 1225 | return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); | |
| 1232 | 1226 | } |
| 1233 | 1227 | |
| 1234 | 1228 | |
| r4184 | r4185 | |
| 1249 | 1243 | if (whandler != 0) |
| 1250 | 1244 | space_map_range(spacerw, ROW_WRITE, spacerw->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, (void *)device, whandler_name); |
| 1251 | 1245 | mem_dump(space->machine); |
| 1252 | return space_find_backing_memory(spacerw, | |
| 1246 | return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); | |
| 1253 | 1247 | } |
| 1254 | 1248 | |
| 1255 | 1249 | |
| r4184 | r4185 | |
| 1266 | 1260 | if (whandler != NULL) |
| 1267 | 1261 | space_map_range(spacerw, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name); |
| 1268 | 1262 | mem_dump(space->machine); |
| 1269 | return space_find_backing_memory(spacerw, | |
| 1263 | return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); | |
| 1270 | 1264 | } |
| 1271 | 1265 | |
| 1272 | 1266 | |
| r4184 | r4185 | |
| 1283 | 1277 | if (whandler != NULL) |
| 1284 | 1278 | space_map_range(spacerw, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name); |
| 1285 | 1279 | mem_dump(space->machine); |
| 1286 | return space_find_backing_memory(spacerw, | |
| 1280 | return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); | |
| 1287 | 1281 | } |
| 1288 | 1282 | |
| 1289 | 1283 | |
| r4184 | r4185 | |
| 1300 | 1294 | if (whandler != NULL) |
| 1301 | 1295 | space_map_range(spacerw, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name); |
| 1302 | 1296 | mem_dump(space->machine); |
| 1303 | return space_find_backing_memory(spacerw, | |
| 1297 | return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); | |
| 1304 | 1298 | } |
| 1305 | 1299 | |
| 1306 | 1300 | |
| r4184 | r4185 | |
| 1317 | 1311 | if (whandler != NULL) |
| 1318 | 1312 | space_map_range(spacerw, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name); |
| 1319 | 1313 | mem_dump(space->machine); |
| 1320 | return space_find_backing_memory(spacerw, | |
| 1314 | return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); | |
| 1321 | 1315 | } |
| 1322 | 1316 | |
| 1323 | 1317 | |
| r4184 | r4185 | |
| 1593 | 1587 | if (space->map->globalmask != 0) |
| 1594 | 1588 | { |
| 1595 | 1589 | space->addrmask = space->map->globalmask; |
| 1596 | space->bytemask = | |
| 1590 | space->bytemask = memory | |
| 1597 | 1591 | } |
| 1598 | 1592 | |
| 1599 | 1593 | /* make a pass over the address map, adjusting for the CPU and getting memory pointers */ |
| r4184 | r4185 | |
|---|---|---|
| 582 | 582 | |
| 583 | 583 | |
| 584 | 584 | /* macros for accessing bytes and words within larger chunks */ |
| 585 | #ifdef LSB_FIRST | |
| 586 | 585 | |
| 587 | #define BYTE_XOR_BE(a) ((a) ^ 1) /* read/write a byte to a 16-bit space */ | |
| 588 | #define BYTE_XOR_LE(a) (a) | |
| 589 | #define BYTE4_XOR_BE(a) ((a) ^ 3) /* read/write a byte to a 32-bit space */ | |
| 590 | #define BYTE4_XOR_LE(a) (a) | |
| 591 | #define WORD_XOR_BE(a) ((a) ^ 2) /* read/write a word to a 32-bit space */ | |
| 592 | #define WORD_XOR_LE(a) (a) | |
| 593 | #define BYTE8_XOR_BE(a) ((a) ^ 7) /* read/write a byte to a 64-bit space */ | |
| 594 | #define BYTE8_XOR_LE(a) (a) | |
| 595 | #define WORD2_XOR_BE(a) ((a) ^ 6) /* read/write a word to a 64-bit space */ | |
| 596 | #define WORD2_XOR_LE(a) (a) | |
| 597 | #define DWORD_XOR_BE(a) ((a) ^ 4) /* read/write a dword to a 64-bit space */ | |
| 598 | #define DWORD_XOR_LE(a) (a) | |
| 586 | /* read/write a byte to a 16-bit space */ | |
| 587 | #define BYTE_XOR_BE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)) | |
| 588 | #define BYTE_XOR_LE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(0,1)) | |
| 599 | 589 | |
| 600 | #else | |
| 590 | /* read/write a byte to a 32-bit space */ | |
| 591 | #define BYTE4_XOR_BE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(3,0)) | |
| 592 | #define BYTE4_XOR_LE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(0,3)) | |
| 601 | 593 | |
| 602 | #define BYTE_XOR_BE(a) (a) | |
| 603 | #define BYTE_XOR_LE(a) ((a) ^ 1) /* read/write a byte to a 16-bit space */ | |
| 604 | #define BYTE4_XOR_BE(a) (a) | |
| 605 | #define BYTE4_XOR_LE(a) ((a) ^ 3) /* read/write a byte to a 32-bit space */ | |
| 606 | #define WORD_XOR_BE(a) (a) | |
| 607 | #define WORD_XOR_LE(a) ((a) ^ 2) /* read/write a word to a 32-bit space */ | |
| 608 | #define BYTE8_XOR_BE(a) (a) | |
| 609 | #define BYTE8_XOR_LE(a) ((a) ^ 7) /* read/write a byte to a 64-bit space */ | |
| 610 | #define WORD2_XOR_BE(a) (a) | |
| 611 | #define WORD2_XOR_LE(a) ((a) ^ 6) /* read/write a word to a 64-bit space */ | |
| 612 | #define DWORD_XOR_BE(a) (a) | |
| 613 | #define DWORD_XOR_LE(a) ((a) ^ 4) /* read/write a dword to a 64-bit space */ | |
| 594 | /* read/write a word to a 32-bit space */ | |
| 595 | #define WORD_XOR_BE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(2,0)) | |
| 596 | #define WORD_XOR_LE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(0,2)) | |
| 614 | 597 | |
| 615 | #endif | |
| 598 | /* read/write a byte to a 64-bit space */ | |
| 599 | #define BYTE8_XOR_BE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(7,0)) | |
| 600 | #define BYTE8_XOR_LE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(0,7)) | |
| 616 | 601 | |
| 602 | /* read/write a word to a 64-bit space */ | |
| 603 | #define WORD2_XOR_BE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(6,0)) | |
| 604 | #define WORD2_XOR_LE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(0,6)) | |
| 617 | 605 | |
| 606 | /* read/write a dword to a 64-bit space */ | |
| 607 | #define DWORD_XOR_BE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(4,0)) | |
| 608 | #define DWORD_XOR_LE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(0,4)) | |
| 618 | 609 | |
| 610 | ||
| 611 | ||
| 619 | 612 | /*************************************************************************** |
| 620 | 613 | ADDRESS MAP MACROS |
| 621 | 614 | ***************************************************************************/ |
| r4184 | r4185 | |
|---|---|---|
| 21 | 21 | #define TEMP_STRING_POOL_ENTRIES 16 |
| 22 | 22 | #define MAX_STRING_LENGTH 256 |
| 23 | 23 | |
| 24 | // ->started states | |
| 25 | // | |
| 26 | // Only 0 and 1 are externally visible in practice, making it a | |
| 27 | // boolean //for external users | |
| 24 | 28 | |
| 29 | enum { | |
| 30 | DEVICE_STOPPED = 0, | |
| 31 | DEVICE_STARTED = 1, | |
| 32 | DEVICE_STARTING = 2, | |
| 33 | DEVICE_DELAYED = 3 | |
| 34 | }; | |
| 25 | 35 | |
| 36 | ||
| 26 | 37 | /*************************************************************************** |
| 27 | 38 | GLOBAL VARIABLES |
| 28 | 39 | ***************************************************************************/ |
| r4184 | r4185 | |
| 120 | 131 | |
| 121 | 132 | /* ensure live fields are all cleared */ |
| 122 | 133 | device->machine = NULL; |
| 123 | device->started = | |
| 134 | device->started = DEVICE_STOPPED; | |
| 124 | 135 | device->token = NULL; |
| 125 | 136 | device->tokenbytes = 0; |
| 126 | 137 | device->region = NULL; |
| r4184 | r4185 | |
| 600 | 611 | device_start_func start = (device_start_func)device_get_info_fct(device, DEVINFO_FCT_START); |
| 601 | 612 | |
| 602 | 613 | assert(start != NULL); |
| 603 | if (!device->started && (*start)(device) == DEVICE_START_OK) | |
| 604 | device->started = TRUE; | |
| 605 | numstarted += device->started; | |
| 614 | if (!device->started) | |
| 615 | { | |
| 616 | device->started = DEVICE_STARTING; | |
| 617 | (*start)(device); | |
| 618 | if (device->started == DEVICE_DELAYED) | |
| 619 | device->started = DEVICE_STOPPED; | |
| 620 | else | |
| 621 | { | |
| 622 | device->started = DEVICE_STARTED; | |
| 623 | numstarted ++; | |
| 624 | } | |
| 625 | } | |
| 606 | 626 | } |
| 607 | 627 | |
| 608 | 628 | /* if we didn't start anything new, we're in trouble */ |
| r4184 | r4185 | |
| 613 | 633 | |
| 614 | 634 | |
| 615 | 635 | /*------------------------------------------------- |
| 636 | device_delay_init - delay the startup of a given | |
| 637 | device for dependency reasons | |
| 638 | -------------------------------------------------*/ | |
| 639 | void device_delay_init(const device_config *device) | |
| 640 | { | |
| 641 | if (device->started != DEVICE_STARTING && device->started != DEVICE_DELAYED) | |
| 642 | fatalerror("Error: Calling device_delay_init on a device not in the process of starting."); | |
| 643 | ((device_config *)device)->started = DEVICE_DELAYED; | |
| 644 | } | |
| 645 | ||
| 646 | /*------------------------------------------------- | |
| 616 | 647 | device_list_stop - stop the configured list |
| 617 | 648 | of devices for a machine |
| 618 | 649 | -------------------------------------------------*/ |
| r4184 | r4185 | |
|---|---|---|
| 330 | 330 | timer = timer_alloc( device->machine, timekeeper_tick, c ); |
| 331 | 331 | duration = ATTOTIME_IN_SEC(1); |
| 332 | 332 | timer_adjust_periodic( timer, duration, 0, duration ); |
| 333 | ||
| 334 | return DEVICE_START_OK; | |
| 335 | 333 | } |
| 336 | 334 | |
| 337 | 335 | static DEVICE_START(m48t02) |
| r4184 | r4185 | |
|---|---|---|
| 196 | 196 | state_save_register_device_item(device, 0, cia->cnt); |
| 197 | 197 | state_save_register_device_item(device, 0, cia->shift); |
| 198 | 198 | state_save_register_device_item(device, 0, cia->serial); |
| 199 | return DEVICE_START_OK; | |
| 200 | 199 | } |
| 201 | 200 | |
| 202 | 201 |
| r4184 | r4185 | |
|---|---|---|
| 208 | 208 | state_save_register_device_item(device, 0, chip->a); |
| 209 | 209 | state_save_register_device_item(device, 0, chip->b); |
| 210 | 210 | state_save_register_device_item(device, 0, chip->clear); |
| 211 | ||
| 212 | return DEVICE_START_OK; | |
| 213 | 211 | } |
| 214 | 212 | |
| 215 | 213 |
| r4184 | r4185 | |
|---|---|---|
| 1752 | 1752 | |
| 1753 | 1753 | state_save_register_device_item(device, 0, ide->master_password_enable); |
| 1754 | 1754 | state_save_register_device_item(device, 0, ide->user_password_enable); |
| 1755 | ||
| 1756 | return DEVICE_START_OK; | |
| 1757 | 1755 | } |
| 1758 | 1756 | |
| 1759 | 1757 |
| r4184 | r4185 | |
|---|---|---|
| 581 | 581 | state_save_register_device_item(device, 0, duart68681->channel[1].tx_enabled); |
| 582 | 582 | state_save_register_device_item(device, 0, duart68681->channel[1].tx_data); |
| 583 | 583 | state_save_register_device_item(device, 0, duart68681->channel[1].tx_ready); |
| 584 | ||
| 585 | return DEVICE_START_OK; | |
| 586 | 584 | } |
| 587 | 585 | |
| 588 | 586 | /*------------------------------------------------- |
| r4184 | r4185 | |
|---|---|---|
| 462 | 462 | |
| 463 | 463 | state_save_register_device_item(device, 0, riot->timershift); |
| 464 | 464 | state_save_register_device_item(device, 0, riot->timerstate); |
| 465 | ||
| 466 | return DEVICE_START_OK; | |
| 467 | 465 | } |
| 468 | 466 | |
| 469 | 467 |
| r4184 | r4185 | |
|---|---|---|
| 233 | 233 | /* Default clock is from CPU1 */ |
| 234 | 234 | if (device->clock == 0) |
| 235 | 235 | device_set_clock(device, device->machine->cpu[0]->clock); |
| 236 | ||
| 237 | return DEVICE_START_OK; | |
| 238 | 236 | } |
| 239 | 237 | |
| 240 | 238 |
| r4184 | r4185 | |
|---|---|---|
| 154 | 154 | state_save_register_device_item(device, 0, p->in_cb1_pushed); |
| 155 | 155 | state_save_register_device_item(device, 0, p->in_cb2_pushed); |
| 156 | 156 | state_save_register_device_item(device, 0, p->out_cb2_needs_pulled); |
| 157 | ||
| 158 | return DEVICE_START_OK; | |
| 159 | 157 | } |
| 160 | 158 | |
| 161 | 159 |
| r4184 | r4185 | |
|---|---|---|
| 466 | 466 | state_save_register_device_item(device, 0, z80dma->is_read); |
| 467 | 467 | state_save_register_device_item(device, 0, z80dma->cur_cycle); |
| 468 | 468 | state_save_register_device_item(device, 0, z80dma->latch); |
| 469 | ||
| 470 | return DEVICE_START_OK; | |
| 471 | 469 | } |
| 472 | 470 | |
| 473 | 471 |
| r4184 | r4185 | |
|---|---|---|
| 534 | 534 | state_save_register_device_item_array(device, 0, ppi8255->out_mask); |
| 535 | 535 | state_save_register_device_item_array(device, 0, ppi8255->read); |
| 536 | 536 | state_save_register_device_item_array(device, 0, ppi8255->latch); |
| 537 | ||
| 538 | return DEVICE_START_OK; | |
| 539 | 537 | } |
| 540 | 538 | |
| 541 | 539 |
| r4184 | r4185 | |
|---|---|---|
| 534 | 534 | state_save_register_device_item_array(device, 0, smc->tx); |
| 535 | 535 | state_save_register_device_item(device, 0, smc->sent); |
| 536 | 536 | state_save_register_device_item(device, 0, smc->recd); |
| 537 | ||
| 538 | return DEVICE_START_OK; | |
| 539 | 537 | } |
| 540 | 538 | |
| 541 | 539 |
| r4184 | r4185 | |
|---|---|---|
| 384 | 384 | state_save_register_device_item(device, 0, dma8257->msb); |
| 385 | 385 | state_save_register_device_item(device, 0, dma8257->drq); |
| 386 | 386 | state_save_register_device_item(device, 0, dma8257->status); |
| 387 | ||
| 388 | return DEVICE_START_OK; | |
| 389 | 387 | } |
| 390 | 388 | |
| 391 | 389 |
| r4184 | r4185 | |
|---|---|---|
| 557 | 557 | state_save_register_device_item_array(device, 0, z80pio->out); |
| 558 | 558 | state_save_register_device_item_array(device, 0, z80pio->strobe); |
| 559 | 559 | state_save_register_device_item_array(device, 0, z80pio->int_state); |
| 560 | ||
| 561 | return DEVICE_START_OK; | |
| 562 | 560 | } |
| 563 | 561 | |
| 564 | 562 |
| r4184 | r4185 | |
|---|---|---|
| 189 | 189 | state_save_register_device_item( device, 0, f3853->request_flipflop ); |
| 190 | 190 | state_save_register_device_item( device, 0, f3853->priority_line ); |
| 191 | 191 | state_save_register_device_item( device, 0, f3853->external_interrupt_line ); |
| 192 | ||
| 193 | return DEVICE_START_OK; | |
| 194 | 192 | } |
| 195 | 193 | |
| 196 | 194 |
| r4184 | r4185 | |
|---|---|---|
| 142 | 142 | |
| 143 | 143 | static DEVICE_START( i8243 ) |
| 144 | 144 | { |
| 145 | return DEVICE_START_OK; | |
| 146 | 145 | } |
| 147 | 146 | |
| 148 | 147 |
| r4184 | r4185 | |
|---|---|---|
| 153 | 153 | msm6242->reg[1] = 0; |
| 154 | 154 | msm6242->reg[2] = 0; |
| 155 | 155 | memset(&msm6242->hold_time, 0, sizeof(mame_system_time)); |
| 156 | ||
| 157 | return DEVICE_START_OK; | |
| 158 | 156 | } |
| 159 | 157 | |
| 160 | 158 |
| r4184 | r4185 | |
|---|---|---|
| 257 | 257 | state_save_register_device_item(device, 0, acia_p->rts); |
| 258 | 258 | state_save_register_device_item(device, 0, acia_p->brk); |
| 259 | 259 | state_save_register_device_item(device, 0, acia_p->status_read); |
| 260 | return DEVICE_START_OK; | |
| 261 | 260 | } |
| 262 | 261 | |
| 263 | 262 |
| r4184 | r4185 | |
|---|---|---|
| 397 | 397 | pic8259->intf = device->static_config; |
| 398 | 398 | |
| 399 | 399 | pic8259->timer = timer_alloc( device->machine, pic8259_timerproc, (void *)device ); |
| 400 | ||
| 401 | return DEVICE_START_OK; | |
| 402 | 400 | } |
| 403 | 401 | |
| 404 | 402 |
| r4184 | r4185 | |
|---|---|---|
| 1455 | 1455 | ld->screen = devtag_get_device(device->machine, VIDEO_SCREEN, config->screen); |
| 1456 | 1456 | assert(ld->screen != NULL); |
| 1457 | 1457 | if (!ld->screen->started) |
| 1458 | return DEVICE_START_MISSING_DEPENDENCY; | |
| 1458 | { | |
| 1459 | device_delay_init(device); | |
| 1460 | return; | |
| 1461 | } | |
| 1459 | 1462 | |
| 1460 | 1463 | /* save a copy of the device pointer */ |
| 1461 | 1464 | ld->device = device; |
| r4184 | r4185 | |
| 1492 | 1495 | |
| 1493 | 1496 | /* register callbacks */ |
| 1494 | 1497 | config_register(device->machine, "laserdisc", configuration_load, configuration_save); |
| 1495 | ||
| 1496 | return DEVICE_START_OK; | |
| 1497 | 1498 | } |
| 1498 | 1499 | |
| 1499 | 1500 |
| r4184 | r4185 | |
|---|---|---|
| 103 | 103 | state_save_register_device_item_pointer( device, 0, c->e2prom, SIZE_DATA ); |
| 104 | 104 | state_save_register_device_item( device, 0, c->store ); |
| 105 | 105 | state_save_register_device_item( device, 0, c->array_recall ); |
| 106 | ||
| 107 | return DEVICE_START_OK; | |
| 108 | 106 | } |
| 109 | 107 | |
| 110 | 108 | /*------------------------------------------------- |
| r4184 | r4185 | |
|---|---|---|
| 155 | 155 | state_save_register_device_item( device, 0, c->a9_12v ); |
| 156 | 156 | state_save_register_device_item( device, 0, c->oe_12v ); |
| 157 | 157 | state_save_register_device_item( device, 0, c->last_write ); |
| 158 | ||
| 159 | return DEVICE_START_OK; | |
| 160 | 158 | } |
| 161 | 159 | |
| 162 | 160 | /*------------------------------------------------- |
| r4184 | r4185 | |
|---|---|---|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | state_save_register_device_item(device, 0, latch8->value); |
| 225 | ||
| 226 | return DEVICE_START_OK; | |
| 227 | 225 | } |
| 228 | 226 | |
| 229 | 227 |
| r4184 | r4185 | |
|---|---|---|
| 395 | 395 | dma8237_t *dma8237 = get_safe_token(device); |
| 396 | 396 | |
| 397 | 397 | dma8237->intf = device->static_config; |
| 398 | ||
| 399 | return DEVICE_START_OK; | |
| 400 | 398 | } |
| 401 | 399 | |
| 402 | 400 |
| r4184 | r4185 | |
|---|---|---|
| 152 | 152 | state_save_register_device_item(device, 0, cdp1852->next_data); |
| 153 | 153 | state_save_register_device_item(device, 0, cdp1852->sr); |
| 154 | 154 | state_save_register_device_item(device, 0, cdp1852->next_sr); |
| 155 | ||
| 156 | return DEVICE_START_OK; | |
| 157 | 155 | } |
| 158 | 156 | |
| 159 | 157 | static DEVICE_RESET( cdp1852 ) |
| r4184 | r4185 | |
|---|---|---|
| 798 | 798 | sio->receive_poll_cb = intf->receive_poll_cb; |
| 799 | 799 | |
| 800 | 800 | astring_free(tempstring); |
| 801 | return DEVICE_START_OK; | |
| 802 | 801 | } |
| 803 | 802 | |
| 804 | 803 |
| r4184 | r4185 | |
|---|---|---|
| 223 | 223 | /* register pci states */ |
| 224 | 224 | state_save_register_device_item(device, 0, pcibus->address); |
| 225 | 225 | state_save_register_device_item(device, 0, pcibus->devicenum); |
| 226 | ||
| 227 | return DEVICE_START_OK; | |
| 228 | 226 | } |
| 229 | 227 | |
| 230 | 228 |
| r4184 | r4185 | |
|---|---|---|
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | astring_free(tempstring); |
| 497 | return DEVICE_START_OK; | |
| 498 | 497 | } |
| 499 | 498 | |
| 500 | 499 |
| r4184 | r4185 | |
|---|---|---|
| 1038 | 1038 | } |
| 1039 | 1039 | |
| 1040 | 1040 | |
| 1041 | static | |
| 1041 | static | |
| 1042 | 1042 | pit8253_t *pit8253 = get_safe_token(device); |
| 1043 | 1043 | int timerno; |
| 1044 | 1044 | |
| r4184 | r4185 | |
| 1077 | 1077 | state_save_register_device_item(device, timerno, timer->last_updated.attoseconds); |
| 1078 | 1078 | state_save_register_device_item(device, timerno, timer->clock); |
| 1079 | 1079 | } |
| 1080 | ||
| 1081 | return DEVICE_START_OK; | |
| 1082 | 1080 | } |
| 1083 | 1081 | |
| 1084 | 1082 | |
| 1085 | 1083 | static DEVICE_START( pit8253 ) { |
| 1086 | | |
| 1084 | | |
| 1087 | 1085 | } |
| 1088 | 1086 | |
| 1089 | 1087 | |
| 1090 | 1088 | static DEVICE_START( pit8254 ) { |
| 1091 | | |
| 1089 | | |
| 1092 | 1090 | } |
| 1093 | 1091 | |
| 1094 | 1092 |
| r4184 | r4185 | |
|---|---|---|
| 37 | 37 | typedef enum _device_class device_class; |
| 38 | 38 | |
| 39 | 39 | |
| 40 | /* device start results */ | |
| 41 | enum _device_start_err | |
| 42 | { | |
| 43 | DEVICE_START_OK = 0, /* everything is fine */ | |
| 44 | DEVICE_START_MISSING_DEPENDENCY /* at least one device we depend on is not yet started */ | |
| 45 | }; | |
| 46 | typedef enum _device_start_err device_start_err; | |
| 47 | ||
| 48 | ||
| 49 | 40 | /* useful in device_list functions for scanning through all devices */ |
| 50 | 41 | #define DEVICE_TYPE_WILDCARD NULL |
| 51 | 42 | |
| r4184 | r4185 | |
| 118 | 109 | #define DEVICE_SET_INFO_CALL(name) DEVICE_SET_INFO_NAME(name)(device, state, info) |
| 119 | 110 | |
| 120 | 111 | #define DEVICE_START_NAME(name) device_start_##name |
| 121 | #define DEVICE_START(name) | |
| 112 | #define DEVICE_START(name) | |
| 122 | 113 | #define DEVICE_START_CALL(name) DEVICE_START_NAME(name)(device) |
| 123 | 114 | |
| 124 | 115 | #define DEVICE_STOP_NAME(name) device_stop_##name |
| r4184 | r4185 | |
| 194 | 185 | /* device interface function types */ |
| 195 | 186 | typedef void (*device_get_info_func)(const device_config *device, UINT32 state, deviceinfo *info); |
| 196 | 187 | typedef void (*device_set_info_func)(const device_config *device, UINT32 state, const deviceinfo *info); |
| 197 | typedef | |
| 188 | typedef | |
| 198 | 189 | typedef void (*device_stop_func)(const device_config *device); |
| 199 | 190 | typedef INT32 (*device_execute_func)(const device_config *device, INT32 clocks); |
| 200 | 191 | typedef void (*device_reset_func)(const device_config *device); |
| r4184 | r4185 | |
| 341 | 332 | /* change the clock on a device */ |
| 342 | 333 | void device_set_clock(const device_config *device, UINT32 clock); |
| 343 | 334 | |
| 335 | /* allow a device to ask for its initialization to be delayed */ | |
| 336 | void device_delay_init(const device_config *device); | |
| 344 | 337 | |
| 345 | 338 | |
| 346 | 339 | /* ----- device information getters ----- */ |
| r4184 | r4185 | |
|---|---|---|
| 543 | 543 | |
| 544 | 544 | /* register some internal states as well */ |
| 545 | 545 | register_save_states(device); |
| 546 | ||
| 547 | return DEVICE_START_OK; | |
| 548 | 546 | } |
| 549 | 547 | |
| 550 | 548 |
| r4184 | r4185 | |
|---|---|---|
| 138 | 138 | #endif |
| 139 | 139 | |
| 140 | 140 | |
| 141 | ||
| 142 | 141 | /* Endianness constants */ |
| 143 | 142 | enum |
| 144 | 143 | { |
| 145 | ENDIANNESS_LITTLE = 0, /* emulated CPU is little endian */ | |
| 146 | ENDIANNESS_BIG /* emulated CPU is big endian */ | |
| 144 | ENDIANNESS_LITTLE = 0, | |
| 145 | ENDIANNESS_BIG | |
| 147 | 146 | }; |
| 148 | 147 | |
| 149 | 148 | |
| 149 | /* Native endianness */ | |
| 150 | #ifdef LSB_FIRST | |
| 151 | #define ENDIANNESS_NATIVE ENDIANNESS_LITTLE | |
| 152 | #else | |
| 153 | #define ENDIANNESS_NATIVE ENDIANNESS_BIG | |
| 154 | #endif | |
| 155 | ||
| 156 | ||
| 150 | 157 | /* orientation of bitmaps */ |
| 151 | 158 | #define ORIENTATION_FLIP_X 0x0001 /* mirror everything in the X direction */ |
| 152 | 159 | #define ORIENTATION_FLIP_Y 0x0002 /* mirror everything in the Y direction */ |
| r4184 | r4185 | |
| 196 | 203 | #define DEGREE_TO_RADIAN(x) ((M_PI / 180.0) * (x)) |
| 197 | 204 | |
| 198 | 205 | |
| 206 | /* endian-based value: first value is if 'endian' is little-endian, second is if 'endian' is big-endian */ | |
| 207 | #define ENDIAN_VALUE_LE_BE(endian,leval,beval) (((endian) == ENDIANNESS_LITTLE) ? (leval) : (beval)) | |
| 199 | 208 | |
| 209 | /* endian-based value: first value is if native endianness is little-endian, second is if native is big-endian */ | |
| 210 | #define NATIVE_ENDIAN_VALUE_LE_BE(leval,beval) ((ENDIANNESS_NATIVE == ENDIANNESS_LITTLE) ? (leval) : (beval)) | |
| 211 | ||
| 212 | /* endian-based value: first value is if 'endian' matches native, second is if 'endian' doesn't match native */ | |
| 213 | #define ENDIAN_VALUE_NE_NNE(endian,leval,beval) (((endian) == ENDIANNESS_NATIVE) ? (neval) : (nneval)) | |
| 214 | ||
| 215 | ||
| 200 | 216 | /* Useful macros to deal with bit shuffling encryptions */ |
| 201 | 217 | #define BIT(x,n) (((x)>>(n))&1) |
| 202 | 218 |
| r4184 | r4185 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | static SND_START( cdp1869 ) |
| 107 | 107 | { |
| 108 | struct CDP1869 *info; | |
| 108 | struct CDP1869 *info = device->token; | |
| 109 | 109 | |
| 110 | info = auto_malloc(sizeof(*info)); | |
| 111 | memset(info, 0, sizeof(*info)); | |
| 112 | ||
| 113 | 110 | info->device = device; |
| 114 | 111 | info->stream = stream_create(device, 0, 1, device->machine->sample_rate, info, cdp1869_update ); |
| 115 | 112 | info->incr = 0; |
| r4184 | r4185 | |
| 123 | 120 | info->toneamp = 0; |
| 124 | 121 | info->wnfreq = 0; |
| 125 | 122 | info->wnamp = 0; |
| 126 | ||
| 127 | return info; | |
| 128 | 123 | } |
| 129 | 124 | |
| 130 | 125 | void cdp1869_set_toneamp(int which, int value) |
| r4184 | r4185 | |
| 186 | 181 | switch (state) |
| 187 | 182 | { |
| 188 | 183 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 184 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct CDP1869); break; | |
| 189 | 185 | |
| 190 | 186 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 191 | 187 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( cdp1869 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 1171 | 1171 | |
| 1172 | 1172 | static SND_START( sp0256 ) |
| 1173 | 1173 | { |
| 1174 | const sp0256_interface *intf = config; | |
| 1175 | struct sp0256 *sp; | |
| 1174 | const sp0256_interface *intf = device->static_config; | |
| 1175 | struct sp0256 *sp = device->token; | |
| 1176 | 1176 | |
| 1177 | sp = auto_malloc(sizeof(*sp)); | |
| 1178 | memset(sp, 0, sizeof(*sp)); | |
| 1179 | 1177 | sp->device = device; |
| 1180 | 1178 | sp->drq = intf->lrq_callback; |
| 1181 | 1179 | sp->sby = intf->sby_callback; |
| r4184 | r4185 | |
| 1209 | 1207 | /* -------------------------------------------------------------------- */ |
| 1210 | 1208 | sp->rom = device->region; |
| 1211 | 1209 | sp0256_bitrevbuff(sp->rom, 0, 0xffff); |
| 1212 | ||
| 1213 | return sp; | |
| 1214 | 1210 | } |
| 1215 | 1211 | |
| 1216 | 1212 | static SND_STOP( sp0256 ) |
| r4184 | r4185 | |
| 1362 | 1358 | switch (state) |
| 1363 | 1359 | { |
| 1364 | 1360 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1361 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct sp0256); break; | |
| 1365 | 1362 | |
| 1366 | 1363 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1367 | 1364 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( sp0256 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | |
| 55 | static void | |
| 55 | static void | |
| 56 | 56 | UINT8 _shiftreg_mask, int _active_clock_hi) |
| 57 | 57 | { |
| 58 | struct hc55516_data *chip; | |
| 58 | struct hc55516_data *chip = device->token; | |
| 59 | 59 | |
| 60 | /* allocate the chip */ | |
| 61 | chip = auto_malloc(sizeof(*chip)); | |
| 62 | memset(chip, 0, sizeof(*chip)); | |
| 63 | ||
| 64 | 60 | /* compute the fixed charge, decay, and leak time constants */ |
| 65 | 61 | charge = pow(exp(-1), 1.0 / (FILTER_CHARGE_TC * 16000.0)); |
| 66 | 62 | decay = pow(exp(-1), 1.0 / (FILTER_DECAY_TC * 16000.0)); |
| r4184 | r4185 | |
| 83 | 79 | state_save_register_device_item(device, 0, chip->update_count); |
| 84 | 80 | state_save_register_device_item(device, 0, chip->filter); |
| 85 | 81 | state_save_register_device_item(device, 0, chip->integrator); |
| 86 | ||
| 87 | /* success */ | |
| 88 | return chip; | |
| 89 | 82 | } |
| 90 | 83 | |
| 91 | 84 | |
| 92 | 85 | static SND_START( hc55516 ) |
| 93 | 86 | { |
| 94 | | |
| 87 | | |
| 95 | 88 | } |
| 96 | 89 | |
| 97 | 90 | |
| 98 | 91 | static SND_START( mc3417 ) |
| 99 | 92 | { |
| 100 | | |
| 93 | | |
| 101 | 94 | } |
| 102 | 95 | |
| 103 | 96 | |
| 104 | 97 | static SND_START( mc3418 ) |
| 105 | 98 | { |
| 106 | | |
| 99 | | |
| 107 | 100 | } |
| 108 | 101 | |
| 109 | 102 | |
| r4184 | r4185 | |
| 339 | 332 | switch (state) |
| 340 | 333 | { |
| 341 | 334 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 335 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct hc55516_data); break; | |
| 342 | 336 | case SNDINFO_FCT_ALIAS: info->type = SOUND_HC55516; break; |
| 343 | 337 | |
| 344 | 338 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| r4184 | r4185 | |
|---|---|---|
| 230 | 230 | |
| 231 | 231 | static SND_START( iremga20 ) |
| 232 | 232 | { |
| 233 | struct IremGA20_chip_def *chip; | |
| 233 | struct IremGA20_chip_def *chip = device->token; | |
| 234 | 234 | int i; |
| 235 | 235 | |
| 236 | chip = auto_malloc(sizeof(*chip)); | |
| 237 | memset(chip, 0, sizeof(*chip)); | |
| 238 | ||
| 239 | 236 | /* Initialize our chip structure */ |
| 240 | 237 | chip->rom = device->region; |
| 241 | 238 | chip->rom_size = device->regionbytes; |
| r4184 | r4185 | |
| 260 | 257 | state_save_register_device_item(device, i, chip->channel[i].effect); |
| 261 | 258 | state_save_register_device_item(device, i, chip->channel[i].play); |
| 262 | 259 | } |
| 263 | ||
| 264 | return chip; | |
| 265 | 260 | } |
| 266 | 261 | |
| 267 | 262 | |
| r4184 | r4185 | |
| 285 | 280 | switch (state) |
| 286 | 281 | { |
| 287 | 282 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 283 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct IremGA20_chip_def); break; | |
| 288 | 284 | |
| 289 | 285 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 290 | 286 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( iremga20 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | static SND_START( custom ) |
| 14 | 14 | { |
| 15 | struct custom_info *info; | |
| 15 | struct custom_info *info = device->token; | |
| 16 | 16 | |
| 17 | info = auto_malloc(sizeof(*info)); | |
| 18 | memset(info, 0, sizeof(*info)); | |
| 19 | ||
| 20 | 17 | /* stash a pointer and call the start routine */ |
| 21 | info->intf = config; | |
| 18 | info->intf = device->static_config; | |
| 22 | 19 | if (info->intf->start) |
| 23 | 20 | { |
| 24 | info->token = (*info->intf->start)(device, clock, config); | |
| 25 | if (!info->token) | |
| 26 | return NULL; | |
| 21 | info->token = (*info->intf->start)(device, clock, device->static_config); | |
| 22 | assert_always(info->token != NULL, "Error starting custom sound"); | |
| 27 | 23 | } |
| 28 | ||
| 29 | return info; | |
| 30 | 24 | } |
| 31 | 25 | |
| 32 | 26 | |
| r4184 | r4185 | |
| 72 | 66 | switch (state) |
| 73 | 67 | { |
| 74 | 68 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 69 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct custom_info); break; | |
| 75 | 70 | |
| 76 | 71 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 77 | 72 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( custom ); break; |
| r4184 | r4185 | |
|---|---|---|
| 90 | 90 | static SND_START( ym2612 ) |
| 91 | 91 | { |
| 92 | 92 | static const ym2612_interface dummy = { 0 }; |
| 93 | struct ym2612_info *info; | |
| 93 | struct ym2612_info *info = device->token; | |
| 94 | 94 | int rate = clock/72; |
| 95 | 95 | |
| 96 | info = auto_malloc(sizeof(*info)); | |
| 97 | memset(info, 0, sizeof(*info)); | |
| 98 | ||
| 99 | info->intf = config ? config : &dummy; | |
| 96 | info->intf = device->static_config ? device->static_config : &dummy; | |
| 100 | 97 | info->device = device; |
| 101 | 98 | |
| 102 | 99 | /* FM init */ |
| r4184 | r4185 | |
| 109 | 106 | |
| 110 | 107 | /**** initialize YM2612 ****/ |
| 111 | 108 | info->chip = ym2612_init(info,device,clock,rate,timer_handler,IRQHandler); |
| 109 | assert_always(info->chip != NULL, "Error creating YM2612 chip"); | |
| 112 | 110 | |
| 113 | 111 | state_save_register_postload(device->machine, ym2612_intf_postload, info); |
| 114 | ||
| 115 | if (info->chip) | |
| 116 | return info; | |
| 117 | /* error */ | |
| 118 | return NULL; | |
| 119 | 112 | } |
| 120 | 113 | |
| 121 | 114 | |
| r4184 | r4185 | |
| 362 | 355 | switch (state) |
| 363 | 356 | { |
| 364 | 357 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 358 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym2612_info); break; | |
| 365 | 359 | |
| 366 | 360 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 367 | 361 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ym2612 ); break; |
| r4184 | r4185 | |
| 398 | 392 | switch (state) |
| 399 | 393 | { |
| 400 | 394 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 395 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym2612_info); break; | |
| 401 | 396 | |
| 402 | 397 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 403 | 398 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ym3438 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 532 | 532 | |
| 533 | 533 | static SND_START( c352 ) |
| 534 | 534 | { |
| 535 | struct c352_info *info; | |
| 535 | struct c352_info *info = device->token; | |
| 536 | 536 | |
| 537 | info = auto_malloc(sizeof(*info)); | |
| 538 | memset(info, 0, sizeof(*info)); | |
| 539 | ||
| 540 | 537 | info->c352_rom_samples = device->region; |
| 541 | 538 | info->c352_rom_length = device->regionbytes; |
| 542 | 539 | |
| r4184 | r4185 | |
| 545 | 542 | info->stream = stream_create(device, 0, 4, info->sample_rate_base, info, c352_update); |
| 546 | 543 | |
| 547 | 544 | c352_init(info, device); |
| 548 | ||
| 549 | return info; | |
| 550 | 545 | } |
| 551 | 546 | |
| 552 | 547 | |
| r4184 | r4185 | |
| 591 | 586 | switch (state) |
| 592 | 587 | { |
| 593 | 588 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 589 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct c352_info); break; | |
| 594 | 590 | |
| 595 | 591 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 596 | 592 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( c352 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 55 | 55 | }; |
| 56 | 56 | |
| 57 | 57 | /* build a table to divide by the number of voices */ |
| 58 | static i | |
| 58 | static void | |
| 59 | 59 | { |
| 60 | 60 | int count = voices * 256; |
| 61 | 61 | int i; |
| r4184 | r4185 | |
| 75 | 75 | info->mixer_lookup[ i] = val; |
| 76 | 76 | info->mixer_lookup[-i] = -val; |
| 77 | 77 | } |
| 78 | ||
| 79 | return 0; | |
| 80 | 78 | } |
| 81 | 79 | |
| 82 | 80 | |
| r4184 | r4185 | |
| 129 | 127 | |
| 130 | 128 | static SND_START( k051649 ) |
| 131 | 129 | { |
| 132 | struct k051649_info *info; | |
| 130 | struct k051649_info *info = device->token; | |
| 133 | 131 | |
| 134 | info = auto_malloc(sizeof(*info)); | |
| 135 | memset(info, 0, sizeof(*info)); | |
| 136 | ||
| 137 | 132 | /* get stream channels */ |
| 138 | 133 | info->rate = clock/16; |
| 139 | 134 | info->stream = stream_create(device, 0, 1, info->rate, info, k051649_update); |
| r4184 | r4185 | |
| 143 | 138 | info->mixer_buffer = auto_malloc(2 * sizeof(short) * info->rate); |
| 144 | 139 | |
| 145 | 140 | /* build the mixer table */ |
| 146 | if (make_mixer_table(info, 5)) | |
| 147 | return NULL; | |
| 148 | ||
| 149 | return info; | |
| 141 | make_mixer_table(info, 5); | |
| 150 | 142 | } |
| 151 | 143 | |
| 152 | 144 | static SND_RESET( k051649 ) |
| r4184 | r4185 | |
| 237 | 229 | switch (state) |
| 238 | 230 | { |
| 239 | 231 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 232 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct k051649_info); break; | |
| 240 | 233 | |
| 241 | 234 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 242 | 235 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k051649 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 633 | 633 | { |
| 634 | 634 | static const k054539_interface defintrf = { 0 }; |
| 635 | 635 | int i; |
| 636 | struct k054539_info *info; | |
| 636 | struct k054539_info *info = device->token; | |
| 637 | 637 | |
| 638 | info = auto_malloc(sizeof(*info)); | |
| 639 | memset(info, 0, sizeof(*info)); | |
| 640 | ||
| 641 | 638 | for (i = 0; i < 8; i++) |
| 642 | 639 | info->k054539_gain[i] = 1.0; |
| 643 | 640 | info->k054539_flags = K054539_RESET_FLAGS; |
| 644 | 641 | |
| 645 | info->intf = (config != NULL) ? config : &defintrf; | |
| 642 | info->intf = (device->static_config != NULL) ? device->static_config : &defintrf; | |
| 646 | 643 | |
| 647 | 644 | /* |
| 648 | 645 | I've tried various equations on volume control but none worked consistently. |
| r4184 | r4185 | |
| 669 | 666 | k054539_init_chip(device, info, clock); |
| 670 | 667 | |
| 671 | 668 | state_save_register_postload(device->machine, reset_zones, info); |
| 672 | return info; | |
| 673 | 669 | } |
| 674 | 670 | |
| 675 | 671 | WRITE8_HANDLER( k054539_0_w ) |
| r4184 | r4185 | |
| 713 | 709 | switch (state) |
| 714 | 710 | { |
| 715 | 711 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 712 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct k054539_info); break; | |
| 716 | 713 | |
| 717 | 714 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 718 | 715 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k054539 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 134 | 134 | |
| 135 | 135 | static SND_START( namco_52xx ) |
| 136 | 136 | { |
| 137 | struct namco_52xx *chip; | |
| 137 | struct namco_52xx *chip = device->token; | |
| 138 | 138 | int rate = clock/32; |
| 139 | 139 | |
| 140 | chip = auto_malloc(sizeof(*chip)); | |
| 141 | memset(chip, 0, sizeof(*chip)); | |
| 142 | ||
| 143 | chip->intf = config; | |
| 140 | chip->intf = device->static_config; | |
| 144 | 141 | chip->rom = device->region; |
| 145 | 142 | chip->rom_len = device->regionbytes; |
| 146 | 143 | |
| r4184 | r4185 | |
| 167 | 164 | state_save_register_device_item(device, 0, chip->n52_end); |
| 168 | 165 | state_save_register_device_item(device, 0, chip->n52_length); |
| 169 | 166 | state_save_register_device_item(device, 0, chip->n52_pos); |
| 170 | ||
| 171 | return chip; | |
| 172 | 167 | } |
| 173 | 168 | |
| 174 | 169 | |
| r4184 | r4185 | |
| 213 | 208 | switch (state) |
| 214 | 209 | { |
| 215 | 210 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 211 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct namco_52xx); break; | |
| 216 | 212 | |
| 217 | 213 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 218 | 214 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( namco_52xx ); break; |
| r4184 | r4185 | |
|---|---|---|
| 456 | 456 | |
| 457 | 457 | static SND_START( c140 ) |
| 458 | 458 | { |
| 459 | const c140_interface *intf = config; | |
| 460 | struct c140_info *info; | |
| 459 | const c140_interface *intf = device->static_config; | |
| 460 | struct c140_info *info = device->token; | |
| 461 | 461 | |
| 462 | info = auto_malloc(sizeof(*info)); | |
| 463 | memset(info, 0, sizeof(*info)); | |
| 464 | ||
| 465 | 462 | info->sample_rate=info->baserate=clock; |
| 466 | 463 | |
| 467 | 464 | info->banking_type = intf->banking_type; |
| r4184 | r4185 | |
| 490 | 487 | /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ |
| 491 | 488 | info->mixer_buffer_left = auto_malloc(2 * sizeof(INT16)*info->sample_rate ); |
| 492 | 489 | info->mixer_buffer_right = info->mixer_buffer_left + info->sample_rate; |
| 493 | return info; | |
| 494 | 490 | } |
| 495 | 491 | |
| 496 | 492 | |
| r4184 | r4185 | |
| 514 | 510 | switch (state) |
| 515 | 511 | { |
| 516 | 512 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 513 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct c140_info); break; | |
| 517 | 514 | |
| 518 | 515 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 519 | 516 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( c140 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 172 | 172 | |
| 173 | 173 | static SND_START( msm5205 ) |
| 174 | 174 | { |
| 175 | struct MSM5205Voice *voice; | |
| 175 | struct MSM5205Voice *voice = device->token; | |
| 176 | 176 | |
| 177 | voice = auto_malloc(sizeof(*voice)); | |
| 178 | memset(voice, 0, sizeof(*voice)); | |
| 179 | sndintrf_register_token(voice); | |
| 180 | ||
| 181 | 177 | /* save a global pointer to our interface */ |
| 182 | voice->intf = config; | |
| 178 | voice->intf = device->static_config; | |
| 183 | 179 | voice->device = device; |
| 184 | 180 | voice->clock = clock; |
| 185 | 181 | |
| r4184 | r4185 | |
| 202 | 198 | state_save_register_device_item(device, 0, voice->bitwidth); |
| 203 | 199 | state_save_register_device_item(device, 0, voice->signal); |
| 204 | 200 | state_save_register_device_item(device, 0, voice->step); |
| 205 | ||
| 206 | /* success */ | |
| 207 | return voice; | |
| 208 | 201 | } |
| 209 | 202 | |
| 210 | 203 | /* |
| r4184 | r4185 | |
| 321 | 314 | switch (state) |
| 322 | 315 | { |
| 323 | 316 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 317 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct MSM5205Voice); break; | |
| 324 | 318 | |
| 325 | 319 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 326 | 320 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( msm5205 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | static SND_START( qsound ) |
| 96 | 96 | { |
| 97 | struct qsound_info *chip; | |
| 97 | struct qsound_info *chip = device->token; | |
| 98 | 98 | int i; |
| 99 | 99 | |
| 100 | chip = auto_malloc(sizeof(*chip)); | |
| 101 | memset(chip, 0, sizeof(*chip)); | |
| 102 | ||
| 103 | 100 | chip->sample_rom = (QSOUND_SRC_SAMPLE *)device->region; |
| 104 | 101 | chip->sample_rom_length = device->regionbytes; |
| 105 | 102 | |
| r4184 | r4185 | |
| 148 | 145 | state_save_register_device_item(device, i, chip->channel[i].lastdt); |
| 149 | 146 | state_save_register_device_item(device, i, chip->channel[i].offset); |
| 150 | 147 | } |
| 151 | ||
| 152 | return chip; | |
| 153 | 148 | } |
| 154 | 149 | |
| 155 | 150 | static SND_STOP( qsound ) |
| r4184 | r4185 | |
| 383 | 378 | switch (state) |
| 384 | 379 | { |
| 385 | 380 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 381 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct qsound_info); break; | |
| 386 | 382 | |
| 387 | 383 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 388 | 384 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( qsound ); break; |
| r4184 | r4185 | |
|---|---|---|
| 82 | 82 | static SND_START( ym3812 ) |
| 83 | 83 | { |
| 84 | 84 | static const ym3812_interface dummy = { 0 }; |
| 85 | struct ym3812_info *info; | |
| 85 | struct ym3812_info *info = device->token; | |
| 86 | 86 | int rate = clock/72; |
| 87 | 87 | |
| 88 | info = auto_malloc(sizeof(*info)); | |
| 89 | memset(info, 0, sizeof(*info)); | |
| 90 | ||
| 91 | info->intf = config ? config : &dummy; | |
| 88 | info->intf = device->static_config ? device->static_config : &dummy; | |
| 92 | 89 | info->device = device; |
| 93 | 90 | |
| 94 | 91 | /* stream system initialize */ |
| 95 | 92 | info->chip = ym3812_init(device,clock,rate); |
| 96 | if (!info->chip) | |
| 97 | return NULL; | |
| 93 | assert_always(info->chip != NULL, "Error creating YM3812 chip"); | |
| 98 | 94 | |
| 99 | 95 | info->stream = stream_create(device,0,1,rate,info,ym3812_stream_update); |
| 100 | 96 | |
| r4184 | r4185 | |
| 105 | 101 | |
| 106 | 102 | info->timer[0] = timer_alloc(device->machine, timer_callback_3812_0, info); |
| 107 | 103 | info->timer[1] = timer_alloc(device->machine, timer_callback_3812_1, info); |
| 108 | ||
| 109 | return info; | |
| 110 | 104 | } |
| 111 | 105 | |
| 112 | 106 | static SND_STOP( ym3812 ) |
| r4184 | r4185 | |
| 174 | 168 | switch (state) |
| 175 | 169 | { |
| 176 | 170 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 171 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym3812_info); break; | |
| 177 | 172 | |
| 178 | 173 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 179 | 174 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ym3812 ); break; |
| r4184 | r4185 | |
| 253 | 248 | static SND_START( ym3526 ) |
| 254 | 249 | { |
| 255 | 250 | static const ym3526_interface dummy = { 0 }; |
| 256 | struct ym3526_info *info; | |
| 251 | struct ym3526_info *info = device->token; | |
| 257 | 252 | int rate = clock/72; |
| 258 | 253 | |
| 259 | info = auto_malloc(sizeof(*info)); | |
| 260 | memset(info, 0, sizeof(*info)); | |
| 261 | ||
| 262 | info->intf = config ? config : &dummy; | |
| 254 | info->intf = device->static_config ? device->static_config : &dummy; | |
| 263 | 255 | info->device = device; |
| 264 | 256 | |
| 265 | 257 | /* stream system initialize */ |
| 266 | 258 | info->chip = ym3526_init(device,clock,rate); |
| 267 | if (!info->chip) | |
| 268 | return NULL; | |
| 259 | assert_always(info->chip != NULL, "Error creating YM3526 chip"); | |
| 269 | 260 | |
| 270 | 261 | info->stream = stream_create(device,0,1,rate,info,ym3526_stream_update); |
| 271 | 262 | /* YM3526 setup */ |
| r4184 | r4185 | |
| 275 | 266 | |
| 276 | 267 | info->timer[0] = timer_alloc(device->machine, timer_callback_3526_0, info); |
| 277 | 268 | info->timer[1] = timer_alloc(device->machine, timer_callback_3526_1, info); |
| 278 | ||
| 279 | return info; | |
| 280 | 269 | } |
| 281 | 270 | |
| 282 | 271 | static SND_STOP( ym3526 ) |
| r4184 | r4185 | |
| 344 | 333 | switch (state) |
| 345 | 334 | { |
| 346 | 335 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 336 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym3526_info); break; | |
| 347 | 337 | |
| 348 | 338 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 349 | 339 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ym3526 ); break; |
| r4184 | r4185 | |
| 449 | 439 | static SND_START( y8950 ) |
| 450 | 440 | { |
| 451 | 441 | static const y8950_interface dummy = { 0 }; |
| 452 | struct y8950_info *info; | |
| 442 | struct y8950_info *info = device->token; | |
| 453 | 443 | int rate = clock/72; |
| 454 | 444 | |
| 455 | info = auto_malloc(sizeof(*info)); | |
| 456 | memset(info, 0, sizeof(*info)); | |
| 457 | ||
| 458 | info->intf = config ? config : &dummy; | |
| 445 | info->intf = device->static_config ? device->static_config : &dummy; | |
| 459 | 446 | info->device = device; |
| 460 | 447 | |
| 461 | 448 | /* stream system initialize */ |
| 462 | 449 | info->chip = y8950_init(device,clock,rate); |
| 463 | if (!info->chip) | |
| 464 | return NULL; | |
| 450 | assert_always(info->chip != NULL, "Error creating Y8950 chip"); | |
| 465 | 451 | |
| 466 | 452 | /* ADPCM ROM data */ |
| 467 | 453 | y8950_set_delta_t_memory(info->chip, device->region, device->regionbytes); |
| r4184 | r4185 | |
| 479 | 465 | |
| 480 | 466 | info->timer[0] = timer_alloc(device->machine, timer_callback_8950_0, info); |
| 481 | 467 | info->timer[1] = timer_alloc(device->machine, timer_callback_8950_1, info); |
| 482 | ||
| 483 | return info; | |
| 484 | 468 | } |
| 485 | 469 | |
| 486 | 470 | static SND_STOP( y8950 ) |
| r4184 | r4185 | |
| 548 | 532 | switch (state) |
| 549 | 533 | { |
| 550 | 534 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 535 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct y8950_info); break; | |
| 551 | 536 | |
| 552 | 537 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 553 | 538 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( y8950 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 101 | 101 | |
| 102 | 102 | static SND_START( snkwave ) |
| 103 | 103 | { |
| 104 | struct snkwave_sound *chip; | |
| 104 | struct snkwave_sound *chip = device->token; | |
| 105 | 105 | |
| 106 | assert(config == 0); | |
| 106 | assert(device->static_config == 0); | |
| 107 | 107 | |
| 108 | chip = auto_malloc(sizeof(*chip)); | |
| 109 | memset(chip, 0, sizeof(*chip)); | |
| 110 | ||
| 111 | 108 | /* adjust internal clock */ |
| 112 | 109 | chip->external_clock = clock; |
| 113 | 110 | |
| r4184 | r4185 | |
| 127 | 124 | state_save_register_device_item(device, 0, chip->counter); |
| 128 | 125 | state_save_register_device_item(device, 0, chip->waveform_position); |
| 129 | 126 | state_save_register_device_item_pointer(device, 0, chip->waveform, WAVEFORM_LENGTH); |
| 130 | ||
| 131 | return chip; | |
| 132 | 127 | } |
| 133 | 128 | |
| 134 | 129 | |
| r4184 | r4185 | |
| 177 | 172 | switch (state) |
| 178 | 173 | { |
| 179 | 174 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 175 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct snkwave_sound); break; | |
| 180 | 176 | |
| 181 | 177 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 182 | 178 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( snkwave ); break; |
| r4184 | r4185 | |
|---|---|---|
| 340 | 340 | |
| 341 | 341 | static SND_START( rf5c400 ) |
| 342 | 342 | { |
| 343 | struct rf5c400_info *info; | |
| 343 | struct rf5c400_info *info = device->token; | |
| 344 | 344 | |
| 345 | info = auto_malloc(sizeof(*info)); | |
| 346 | memset(info, 0, sizeof(*info)); | |
| 347 | ||
| 348 | 345 | rf5c400_init_chip(device, info, clock); |
| 349 | ||
| 350 | return info; | |
| 351 | 346 | } |
| 352 | 347 | |
| 353 | 348 | /*****************************************************************************/ |
| r4184 | r4185 | |
| 580 | 575 | switch (state) |
| 581 | 576 | { |
| 582 | 577 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 578 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct rf5c400_info); break; | |
| 583 | 579 | |
| 584 | 580 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 585 | 581 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( rf5c400 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 317 | 317 | |
| 318 | 318 | static SND_START( cem3394 ) |
| 319 | 319 | { |
| 320 | const cem3394_interface *intf = config; | |
| 321 | sound_chip *chip; | |
| 320 | const cem3394_interface *intf = device->static_config; | |
| 321 | sound_chip *chip = device->token; | |
| 322 | 322 | |
| 323 | chip = auto_malloc(sizeof(*chip)); | |
| 324 | memset(chip, 0, sizeof(*chip)); | |
| 325 | 323 | chip->device = device; |
| 326 | 324 | |
| 327 | 325 | /* copy global parameters */ |
| r4184 | r4185 | |
| 350 | 348 | state_save_register_device_item(device, 0, chip->modulation_depth); |
| 351 | 349 | state_save_register_device_item(device, 0, chip->last_ext); |
| 352 | 350 | state_save_register_device_item(device, 0, chip->pulse_width); |
| 353 | ||
| 354 | return chip; | |
| 355 | 351 | } |
| 356 | 352 | |
| 357 | 353 | |
| r4184 | r4185 | |
| 575 | 571 | switch (state) |
| 576 | 572 | { |
| 577 | 573 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 574 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(sound_chip); break; | |
| 578 | 575 | |
| 579 | 576 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 580 | 577 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( cem3394 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 314 | 314 | |
| 315 | 315 | static SND_START( saa1099 ) |
| 316 | 316 | { |
| 317 | struct SAA1099 *saa; | |
| 317 | struct SAA1099 *saa = device->token; | |
| 318 | 318 | |
| 319 | saa = auto_malloc(sizeof(*saa)); | |
| 320 | memset(saa, 0, sizeof(*saa)); | |
| 321 | ||
| 322 | 319 | /* copy global parameters */ |
| 323 | 320 | saa->device = device; |
| 324 | 321 | saa->sample_rate = clock / 256; |
| 325 | 322 | |
| 326 | 323 | /* for each chip allocate one stream */ |
| 327 | 324 | saa->stream = stream_create(device, 0, 2, saa->sample_rate, saa, saa1099_update); |
| 328 | ||
| 329 | return saa; | |
| 330 | 325 | } |
| 331 | 326 | |
| 332 | 327 | static void saa1099_control_port_w( int chip, int reg, int data ) |
| r4184 | r4185 | |
| 504 | 499 | switch (state) |
| 505 | 500 | { |
| 506 | 501 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 502 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct SAA1099); break; | |
| 507 | 503 | |
| 508 | 504 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 509 | 505 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( saa1099 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 641 | 641 | |
| 642 | 642 | static SND_START(digitalker) |
| 643 | 643 | { |
| 644 | digitalker *dg = auto_malloc(sizeof(*dg)); | |
| 645 | memset(dg, 0, sizeof(*dg)); | |
| 644 | digitalker *dg = device->token; | |
| 646 | 645 | dg->device = device; |
| 647 | 646 | dg->rom = memory_region(device->machine, device->tag); |
| 648 | 647 | dg->stream = stream_create(device, 0, 1, clock/4, dg, digitalker_update); |
| r4184 | r4185 | |
| 653 | 652 | digitalker_set_intr(dg, 1); |
| 654 | 653 | |
| 655 | 654 | digitalker_register_for_save(dg); |
| 656 | ||
| 657 | return dg; | |
| 658 | 655 | } |
| 659 | 656 | |
| 660 | 657 | static SND_SET_INFO(digitalker) |
| r4184 | r4185 | |
| 665 | 662 | SND_GET_INFO(digitalker) |
| 666 | 663 | { |
| 667 | 664 | switch(state) { |
| 665 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(digitalker); break; | |
| 668 | 666 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME(digitalker); break; |
| 669 | 667 | case SNDINFO_PTR_START: info->start = SND_START_NAME(digitalker); break; |
| 670 | 668 | case SNDINFO_PTR_STOP: break; |
| r4184 | r4185 | |
|---|---|---|
| 630 | 630 | static SND_START( ymz280b ) |
| 631 | 631 | { |
| 632 | 632 | static const ymz280b_interface defintrf = { 0 }; |
| 633 | const ymz280b_interface *intf = (config != NULL) ? config : &defintrf; | |
| 634 | struct YMZ280BChip *chip; | |
| 633 | const ymz280b_interface *intf = (device->static_config != NULL) ? device->static_config : &defintrf; | |
| 634 | struct YMZ280BChip *chip = device->token; | |
| 635 | 635 | |
| 636 | chip = auto_malloc(sizeof(*chip)); | |
| 637 | memset(chip, 0, sizeof(*chip)); | |
| 638 | ||
| 639 | 636 | chip->device = device; |
| 640 | 637 | chip->ext_ram_read = intf->ext_read; |
| 641 | 638 | chip->ext_ram_write = intf->ext_write; |
| r4184 | r4185 | |
| 697 | 694 | #if MAKE_WAVS |
| 698 | 695 | chip->wavresample = wav_open("resamp.wav", INTERNAL_SAMPLE_RATE, 2); |
| 699 | 696 | #endif |
| 700 | ||
| 701 | /* success */ | |
| 702 | return chip; | |
| 703 | 697 | } |
| 704 | 698 | |
| 705 | 699 | |
| r4184 | r4185 | |
| 1114 | 1108 | switch (state) |
| 1115 | 1109 | { |
| 1116 | 1110 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1111 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct YMZ280BChip); break; | |
| 1117 | 1112 | |
| 1118 | 1113 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1119 | 1114 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ymz280b ); break; |
| r4184 | r4185 | |
|---|---|---|
| 124 | 124 | static SND_START( rf5c68 ) |
| 125 | 125 | { |
| 126 | 126 | /* allocate memory for the chip */ |
| 127 | struct rf5c68pcm *chip = auto_malloc(sizeof(*chip)); | |
| 128 | memset(chip, 0, sizeof(*chip)); | |
| 127 | struct rf5c68pcm *chip = device->token; | |
| 129 | 128 | |
| 130 | 129 | /* allocate the stream */ |
| 131 | 130 | chip->stream = stream_create(device, 0, 2, clock / 384, chip, rf5c68_update); |
| 132 | return chip; | |
| 133 | 131 | } |
| 134 | 132 | |
| 135 | 133 | |
| r4184 | r4185 | |
| 240 | 238 | switch (state) |
| 241 | 239 | { |
| 242 | 240 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 241 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct rf5c68pcm); break; | |
| 243 | 242 | |
| 244 | 243 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 245 | 244 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( rf5c68 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 61 | 61 | }; |
| 62 | 62 | |
| 63 | 63 | /* build a table to divide by the number of voices */ |
| 64 | static i | |
| 64 | static void | |
| 65 | 65 | { |
| 66 | 66 | int count = voices * 128; |
| 67 | 67 | int i; |
| r4184 | r4185 | |
| 81 | 81 | info->mixer_lookup[ i] = val; |
| 82 | 82 | info->mixer_lookup[-i] = -val; |
| 83 | 83 | } |
| 84 | ||
| 85 | return 0; | |
| 86 | 84 | } |
| 87 | 85 | |
| 88 | 86 | |
| r4184 | r4185 | |
| 153 | 151 | static SND_START( k005289 ) |
| 154 | 152 | { |
| 155 | 153 | k005289_sound_channel *voice; |
| 156 | struct k005289_info *info; | |
| 154 | struct k005289_info *info = device->token; | |
| 157 | 155 | |
| 158 | info = auto_malloc(sizeof(*info)); | |
| 159 | memset(info, 0, sizeof(*info)); | |
| 160 | 156 | voice = info->channel_list; |
| 161 | 157 | |
| 162 | 158 | /* get stream channels */ |
| r4184 | r4185 | |
| 168 | 164 | info->mixer_buffer = auto_malloc(2 * sizeof(short) * info->rate); |
| 169 | 165 | |
| 170 | 166 | /* build the mixer table */ |
| 171 | if (make_mixer_table(info, 2)) | |
| 172 | return NULL; | |
| 167 | make_mixer_table(info, 2); | |
| 173 | 168 | |
| 174 | 169 | info->sound_prom = device->region; |
| 175 | 170 | |
| r4184 | r4185 | |
| 182 | 177 | voice[1].volume = 0; |
| 183 | 178 | voice[1].wave = &info->sound_prom[0x100]; |
| 184 | 179 | voice[1].counter = 0; |
| 185 | ||
| 186 | return info; | |
| 187 | 180 | } |
| 188 | 181 | |
| 189 | 182 | |
| r4184 | r4185 | |
| 266 | 259 | switch (state) |
| 267 | 260 | { |
| 268 | 261 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 262 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct k005289_info); break; | |
| 269 | 263 | |
| 270 | 264 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 271 | 265 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k005289 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | static SND_START( votrax ) |
| 105 | 105 | { |
| 106 | struct votrax_info *votrax; | |
| 106 | struct votrax_info *votrax = device->token; | |
| 107 | 107 | |
| 108 | votrax = auto_malloc(sizeof(*votrax)); | |
| 109 | memset(votrax, 0, sizeof(*votrax)); | |
| 110 | ||
| 111 | 108 | votrax->device = device; |
| 112 | 109 | votrax->samples = readsamples(VotraxTable,"votrax"); |
| 113 | 110 | votrax->frequency = 8000; |
| r4184 | r4185 | |
| 117 | 114 | |
| 118 | 115 | votrax->sample = NULL; |
| 119 | 116 | votrax->step = 0; |
| 120 | ||
| 121 | return votrax; | |
| 122 | 117 | } |
| 123 | 118 | |
| 124 | 119 | |
| r4184 | r4185 | |
| 174 | 169 | switch (state) |
| 175 | 170 | { |
| 176 | 171 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 172 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct votrax_info); break; | |
| 177 | 173 | |
| 178 | 174 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 179 | 175 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( votrax ); break; |
| r4184 | r4185 | |
|---|---|---|
| 1280 | 1280 | { |
| 1281 | 1281 | const aica_interface *intf; |
| 1282 | 1282 | |
| 1283 | struct _AICA *AICA; | |
| 1283 | struct _AICA *AICA = device->token; | |
| 1284 | 1284 | |
| 1285 | AICA = auto_malloc(sizeof(*AICA)); | |
| 1286 | memset(AICA, 0, sizeof(*AICA)); | |
| 1285 | intf = device->static_config; | |
| 1287 | 1286 | |
| 1288 | intf = config; | |
| 1289 | ||
| 1290 | 1287 | // init the emulation |
| 1291 | 1288 | AICA_Init(device, AICA, intf); |
| 1292 | 1289 | |
| r4184 | r4185 | |
| 1296 | 1293 | |
| 1297 | 1294 | AICA->stream = stream_create(device, 0, 2, 44100, AICA, AICA_Update); |
| 1298 | 1295 | } |
| 1299 | ||
| 1300 | return AICA; | |
| 1301 | 1296 | } |
| 1302 | 1297 | |
| 1303 | 1298 | #ifdef UNUSED_FUNCTION |
| r4184 | r4185 | |
| 1373 | 1368 | switch (state) |
| 1374 | 1369 | { |
| 1375 | 1370 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1371 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct _AICA); break; | |
| 1376 | 1372 | |
| 1377 | 1373 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1378 | 1374 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( aica ); break; |
| r4184 | r4185 | |
|---|---|---|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | |
| 317 | static void | |
| 317 | static void | |
| 318 | 318 | { |
| 319 | struct SN76496 *chip; | |
| 319 | struct SN76496 *chip = device->token; | |
| 320 | 320 | |
| 321 | chip = auto_malloc(sizeof(*chip)); | |
| 322 | memset(chip, 0, sizeof(*chip)); | |
| 323 | ||
| 324 | 321 | if (SN76496_init(device,clock,chip) != 0) |
| 325 | ret | |
| 322 | fatalerror("Error creati | |
| 326 | 323 | SN76496_set_gain(chip, 0); |
| 327 | 324 | |
| 328 | 325 | chip->FeedbackMask = feedbackmask; |
| r4184 | r4185 | |
| 337 | 334 | state_save_register_device_item_array(device, 0, chip->Period); |
| 338 | 335 | state_save_register_device_item_array(device, 0, chip->Count); |
| 339 | 336 | state_save_register_device_item_array(device, 0, chip->Output); |
| 340 | ||
| 341 | return chip; | |
| 342 | ||
| 343 | 337 | } |
| 344 | 338 | |
| 345 | 339 | |
| 346 | 340 | static SND_START( sn76489 ) |
| 347 | 341 | { |
| 348 | | |
| 342 | | |
| 349 | 343 | } |
| 350 | 344 | |
| 351 | 345 | static SND_START( sn76489a ) |
| 352 | 346 | { |
| 353 | | |
| 347 | | |
| 354 | 348 | } |
| 355 | 349 | |
| 356 | 350 | static SND_START( sn76494 ) |
| 357 | 351 | { |
| 358 | | |
| 352 | | |
| 359 | 353 | } |
| 360 | 354 | |
| 361 | 355 | static SND_START( sn76496 ) |
| 362 | 356 | { |
| 363 | | |
| 357 | | |
| 364 | 358 | } |
| 365 | 359 | |
| 366 | 360 | static SND_START( gamegear ) |
| 367 | 361 | { |
| 368 | | |
| 362 | | |
| 369 | 363 | } |
| 370 | 364 | |
| 371 | 365 | static SND_START( smsiii ) |
| 372 | 366 | { |
| 373 | | |
| 367 | | |
| 374 | 368 | } |
| 375 | 369 | |
| 376 | 370 | |
| r4184 | r4185 | |
| 392 | 386 | switch (state) |
| 393 | 387 | { |
| 394 | 388 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 389 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct SN76496); break; | |
| 395 | 390 | case SNDINFO_FCT_ALIAS: info->type = SOUND_SN76496; break; |
| 396 | 391 | |
| 397 | 392 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| r4184 | r4185 | |
|---|---|---|
| 18 | 18 | #include "wave.h" |
| 19 | 19 | |
| 20 | 20 | #define ALWAYS_PLAY_SOUND 0 |
| 21 | #define WAVE_TOKEN_MASK 0xFFFF0000 | |
| 22 | 21 | |
| 23 | 22 | |
| 24 | 23 | |
| r4184 | r4185 | |
| 64 | 63 | image = device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, device->tag ); |
| 65 | 64 | #endif |
| 66 | 65 | stream_create(device, 0, 1, device->machine->sample_rate, (void *)image, wave_sound_update); |
| 67 | return (void *) (FPTR)(WAVE_TOKEN_MASK); | |
| 68 | 66 | } |
| 69 | 67 | |
| 70 | 68 | |
| r4184 | r4185 | |
| 87 | 85 | switch (state) |
| 88 | 86 | { |
| 89 | 87 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 88 | case SNDINFO_INT_TOKEN_BYTES: info->i = 1; break; | |
| 90 | 89 | |
| 91 | 90 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 92 | 91 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( wave ); break; |
| r4184 | r4185 | |
|---|---|---|
| 258 | 258 | |
| 259 | 259 | static SND_START( astrocade ) |
| 260 | 260 | { |
| 261 | struct astrocade_info *chip; | |
| 261 | struct astrocade_info *chip = device->token; | |
| 262 | 262 | int i; |
| 263 | 263 | |
| 264 | /* allocate the chip memory */ | |
| 265 | chip = auto_malloc(sizeof(*chip)); | |
| 266 | memset(chip, 0, sizeof(*chip)); | |
| 267 | ||
| 268 | 264 | /* generate a bitswap table for the noise */ |
| 269 | 265 | for (i = 0; i < 256; i++) |
| 270 | 266 | chip->bitswap[i] = BITSWAP8(i, 0,1,2,3,4,5,6,7); |
| r4184 | r4185 | |
| 275 | 271 | /* reset state */ |
| 276 | 272 | astrocade_reset(chip); |
| 277 | 273 | astrocade_state_save_register(chip, device); |
| 278 | ||
| 279 | return chip; | |
| 280 | 274 | } |
| 281 | 275 | |
| 282 | 276 | |
| r4184 | r4185 | |
| 338 | 332 | switch (state) |
| 339 | 333 | { |
| 340 | 334 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 335 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct astrocade_info); break; | |
| 341 | 336 | |
| 342 | 337 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 343 | 338 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( astrocade ); break; |
| r4184 | r4185 | |
|---|---|---|
| 194 | 194 | static SND_START( x1_010 ) |
| 195 | 195 | { |
| 196 | 196 | int i; |
| 197 | const x1_010_interface *intf = config; | |
| 198 | struct x1_010_info *info; | |
| 197 | const x1_010_interface *intf = device->static_config; | |
| 198 | struct x1_010_info *info = device->token; | |
| 199 | 199 | |
| 200 | info = auto_malloc(sizeof(*info)); | |
| 201 | memset(info, 0, sizeof(*info)); | |
| 202 | ||
| 203 | 200 | info->region = device->region; |
| 204 | 201 | info->base_clock = clock; |
| 205 | 202 | info->rate = clock / 1024; |
| r4184 | r4185 | |
| 214 | 211 | |
| 215 | 212 | /* get stream channels */ |
| 216 | 213 | info->stream = stream_create(device,0,2,info->rate,info,seta_update); |
| 217 | ||
| 218 | return info; | |
| 219 | 214 | } |
| 220 | 215 | |
| 221 | 216 | |
| r4184 | r4185 | |
| 302 | 297 | switch (state) |
| 303 | 298 | { |
| 304 | 299 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 300 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct x1_010_info); break; | |
| 305 | 301 | |
| 306 | 302 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 307 | 303 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( x1_010 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 629 | 629 | static SND_START( upd7759 ) |
| 630 | 630 | { |
| 631 | 631 | static const upd7759_interface defintrf = { 0 }; |
| 632 | const upd7759_interface *intf = (config != NULL) ? config : &defintrf; | |
| 633 | struct upd7759_chip *chip; | |
| 632 | const upd7759_interface *intf = (device->static_config != NULL) ? device->static_config : &defintrf; | |
| 633 | struct upd7759_chip *chip = device->token; | |
| 634 | 634 | |
| 635 | chip = auto_malloc(sizeof(*chip)); | |
| 636 | memset(chip, 0, sizeof(*chip)); | |
| 637 | ||
| 638 | 635 | chip->device = device; |
| 639 | 636 | |
| 640 | 637 | /* allocate a stream channel */ |
| r4184 | r4185 | |
| 665 | 662 | upd7759_reset(chip); |
| 666 | 663 | |
| 667 | 664 | register_for_save(chip, device); |
| 668 | ||
| 669 | return chip; | |
| 670 | 665 | } |
| 671 | 666 | |
| 672 | 667 | |
| r4184 | r4185 | |
| 792 | 787 | switch (state) |
| 793 | 788 | { |
| 794 | 789 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 790 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct upd7759_chip); break; | |
| 795 | 791 | |
| 796 | 792 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 797 | 793 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( upd7759 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 1743 | 1743 | static const ymf271_interface defintrf = { 0 }; |
| 1744 | 1744 | const ymf271_interface *intf; |
| 1745 | 1745 | int i; |
| 1746 | YMF271Chip *chip; | |
| 1746 | YMF271Chip *chip = device->token; | |
| 1747 | 1747 | |
| 1748 | chip = auto_malloc(sizeof(*chip)); | |
| 1749 | memset(chip, 0, sizeof(*chip)); | |
| 1750 | 1748 | chip->device = device; |
| 1751 | 1749 | chip->clock = clock; |
| 1752 | 1750 | |
| 1753 | intf = (config != NULL) ? config : &defintrf; | |
| 1751 | intf = (device->static_config != NULL) ? device->static_config : &defintrf; | |
| 1754 | 1752 | |
| 1755 | 1753 | ymf271_init(device, chip, device->region, intf->irq_callback, intf->ext_read, intf->ext_write); |
| 1756 | 1754 | chip->stream = stream_create(device, 0, 2, clock/384, chip, ymf271_update); |
| r4184 | r4185 | |
| 1769 | 1767 | double db = 0.75 * (double)i; |
| 1770 | 1768 | total_level[i] = (int)(65536.0 / pow(10.0, db / 20.0)); |
| 1771 | 1769 | } |
| 1772 | ||
| 1773 | return chip; | |
| 1774 | 1770 | } |
| 1775 | 1771 | |
| 1776 | 1772 | READ8_HANDLER( ymf271_0_r ) |
| r4184 | r4185 | |
| 1823 | 1819 | switch (state) |
| 1824 | 1820 | { |
| 1825 | 1821 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1822 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(YMF271Chip); break; | |
| 1826 | 1823 | |
| 1827 | 1824 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1828 | 1825 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ymf271 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 101 | 101 | |
| 102 | 102 | static SND_START( namco_63701x ) |
| 103 | 103 | { |
| 104 | struct namco_63701x *chip; | |
| 104 | struct namco_63701x *chip = device->token; | |
| 105 | 105 | |
| 106 | chip = auto_malloc(sizeof(*chip)); | |
| 107 | memset(chip, 0, sizeof(*chip)); | |
| 108 | ||
| 109 | 106 | chip->rom = device->region; |
| 110 | 107 | |
| 111 | 108 | chip->stream = stream_create(device, 0, 2, clock/1000, chip, namco_63701x_update); |
| 112 | ||
| 113 | return chip; | |
| 114 | 109 | } |
| 115 | 110 | |
| 116 | 111 | |
| r4184 | r4185 | |
| 173 | 168 | switch (state) |
| 174 | 169 | { |
| 175 | 170 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 171 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct namco_63701x); break; | |
| 176 | 172 | |
| 177 | 173 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 178 | 174 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( namco_63701x ); break; |
| r4184 | r4185 | |
|---|---|---|
| 608 | 608 | |
| 609 | 609 | static SND_START( pokey ) |
| 610 | 610 | { |
| 611 | struct POKEYregisters *chip; | |
| 611 | struct POKEYregisters *chip = device->token; | |
| 612 | 612 | int sample_rate = clock; |
| 613 | 613 | int i; |
| 614 | 614 | |
| 615 | chip = auto_malloc(sizeof(*chip)); | |
| 616 | memset(chip, 0, sizeof(*chip)); | |
| 617 | ||
| 618 | if (config) | |
| 619 | memcpy(&chip->intf, config, sizeof(pokey_interface)); | |
| 615 | if (device->static_config) | |
| 616 | memcpy(&chip->intf, device->static_config, sizeof(pokey_interface)); | |
| 620 | 617 | chip->device = device; |
| 621 | 618 | chip->clock_period = ATTOTIME_IN_HZ(clock); |
| 622 | 619 | |
| r4184 | r4185 | |
| 667 | 664 | chip->channel = stream_create(device, 0, 1, sample_rate, chip, pokey_update); |
| 668 | 665 | |
| 669 | 666 | register_for_save(chip, device); |
| 670 | ||
| 671 | return chip; | |
| 672 | 667 | } |
| 673 | 668 | |
| 674 | 669 | static TIMER_CALLBACK( pokey_timer_expire ) |
| r4184 | r4185 | |
| 1525 | 1520 | switch (state) |
| 1526 | 1521 | { |
| 1527 | 1522 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1523 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct POKEYregisters); break; | |
| 1528 | 1524 | |
| 1529 | 1525 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1530 | 1526 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( pokey ); break; |
| r4184 | r4185 | |
|---|---|---|
| 194 | 194 | |
| 195 | 195 | static SND_START( sp0250 ) |
| 196 | 196 | { |
| 197 | const struct sp0250_interface *intf = config; | |
| 198 | struct sp0250 *sp; | |
| 197 | const struct sp0250_interface *intf = device->static_config; | |
| 198 | struct sp0250 *sp = device->token; | |
| 199 | 199 | |
| 200 | sp = auto_malloc(sizeof(*sp)); | |
| 201 | memset(sp, 0, sizeof(*sp)); | |
| 202 | 200 | sp->RNG = 1; |
| 203 | 201 | sp->drq = (intf != NULL) ? intf->drq_callback : NULL; |
| 204 | 202 | if (sp->drq != NULL) |
| r4184 | r4185 | |
| 208 | 206 | } |
| 209 | 207 | |
| 210 | 208 | sp->stream = stream_create(device, 0, 1, clock / CLOCK_DIVIDER, sp, sp0250_update); |
| 211 | ||
| 212 | return sp; | |
| 213 | 209 | } |
| 214 | 210 | |
| 215 | 211 | |
| r4184 | r4185 | |
| 255 | 251 | switch (state) |
| 256 | 252 | { |
| 257 | 253 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 254 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct sp0250); break; | |
| 258 | 255 | |
| 259 | 256 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 260 | 257 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( sp0250 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | static SND_START( speaker ) |
| 39 | 39 | { |
| 40 | struct speaker *sp = | |
| 40 | struct speaker *sp = dev | |
| 41 | 41 | |
| 42 | 42 | sp->channel = stream_create(device, 0, 1, device->machine->sample_rate, sp, speaker_sound_update); |
| 43 | 43 | sp->num_levels = 2; |
| 44 | 44 | sp->levels = default_levels; |
| 45 | 45 | sp->level = 0; |
| 46 | return sp; | |
| 47 | 46 | } |
| 48 | 47 | |
| 49 | 48 | |
| r4184 | r4185 | |
| 87 | 86 | switch (state) |
| 88 | 87 | { |
| 89 | 88 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 89 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct speaker); break; | |
| 90 | 90 | |
| 91 | 91 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 92 | 92 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( speaker ); break; |
| r4184 | r4185 | |
|---|---|---|
| 659 | 659 | * |
| 660 | 660 | *************************************/ |
| 661 | 661 | |
| 662 | void *ay8910_start_ym(sound_type chip_type, const device_config *device, int clock, const ay8910_interface *intf) | |
| 662 | void *ay8910_start_ym(void *infoptr, sound_type chip_type, const device_config *device, int clock, const ay8910_interface *intf) | |
| 663 | 663 | { |
| 664 | ay8910_context *info; | |
| 664 | ay8910_context *info = infoptr; | |
| 665 | 665 | |
| 666 | info = auto_malloc(sizeof(*info)); | |
| 667 | memset(info, 0, sizeof(*info)); | |
| 666 | if (info == NULL) | |
| 667 | { | |
| 668 | info = auto_malloc(sizeof(*info)); | |
| 669 | memset(info, 0, sizeof(*info)); | |
| 670 | } | |
| 668 | 671 | info->device = device; |
| 669 | 672 | info->intf = intf; |
| 670 | 673 | if ((info->intf->flags & AY8910_SINGLE_OUTPUT) != 0) |
| r4184 | r4185 | |
| 818 | 821 | AY8910_DEFAULT_LOADS, |
| 819 | 822 | NULL, NULL, NULL, NULL |
| 820 | 823 | }; |
| 821 | const ay8910_interface *intf = (config ? config : &generic_ay8910); | |
| 822 | return ay8910_start_ym(SOUND_AY8910, device, clock, intf); | |
| 824 | const ay8910_interface *intf = (device->static_config ? device->static_config : &generic_ay8910); | |
| 825 | ay8910_start_ym(device->token, SOUND_AY8910, device, clock, intf); | |
| 823 | 826 | } |
| 824 | 827 | |
| 825 | 828 | static SND_START( ym2149 ) |
| r4184 | r4185 | |
| 830 | 833 | AY8910_DEFAULT_LOADS, |
| 831 | 834 | NULL, NULL, NULL, NULL |
| 832 | 835 | }; |
| 833 | const ay8910_interface *intf = (config ? config : &generic_ay8910); | |
| 834 | return ay8910_start_ym(SOUND_YM2149, device, clock, intf); | |
| 836 | const ay8910_interface *intf = (device->static_config ? device->static_config : &generic_ay8910); | |
| 837 | ay8910_start_ym(device->token, SOUND_YM2149, device, clock, intf); | |
| 835 | 838 | } |
| 836 | 839 | |
| 837 | 840 | static SND_STOP( ay8910 ) |
| r4184 | r4185 | |
| 857 | 860 | switch (state) |
| 858 | 861 | { |
| 859 | 862 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 860 | case SNDINFO_FCT_ALIAS: info->type = SOUND_AY8910; break; | |
| 863 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(ay8910_context); break; | |
| 864 | case SNDINFO_FCT_ALIAS: info->type = SOUND_AY8910; break; | |
| 861 | 865 | |
| 862 | 866 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 863 | 867 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ay8910 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 46 | 46 | static SND_START( cdda ) |
| 47 | 47 | { |
| 48 | 48 | const struct CDDAinterface *intf; |
| 49 | cdda_info *info; | |
| 49 | cdda_info *info = device->token; | |
| 50 | 50 | |
| 51 | info = auto_malloc(sizeof(*info)); | |
| 52 | memset(info, 0, sizeof(*info)); | |
| 53 | ||
| 54 | 51 | /* allocate an audio cache */ |
| 55 | 52 | info->audio_cache = auto_malloc( CD_MAX_SECTOR_DATA * MAX_SECTORS ); |
| 56 | 53 | |
| 57 | intf = config; | |
| 54 | intf = device->static_config; | |
| 58 | 55 | |
| 59 | 56 | info->stream = stream_create(device, 0, 2, 44100, info, cdda_update); |
| 60 | 57 | |
| r4184 | r4185 | |
| 66 | 63 | state_save_register_device_item_pointer( device, 0, info->audio_cache, CD_MAX_SECTOR_DATA * MAX_SECTORS ); |
| 67 | 64 | state_save_register_device_item( device, 0, info->audio_samples ); |
| 68 | 65 | state_save_register_device_item( device, 0, info->audio_bptr ); |
| 69 | ||
| 70 | return info; | |
| 71 | 66 | } |
| 72 | 67 | |
| 73 | 68 | |
| r4184 | r4185 | |
| 280 | 275 | info->audio_length -= sectoread; |
| 281 | 276 | |
| 282 | 277 | /* CD-DA data on the disc is big-endian, flip if we're not */ |
| 283 | #ifdef LSB_FIRST | |
| 284 | for( i = 0; i < info->audio_samples * 2; i++ ) | |
| 278 | if (ENDIANNESS_NATIVE == ENDIANNESS_LITTLE) | |
| 285 | 279 | { |
| 286 | audio_cache[ i ] = BIG_ENDIANIZE_INT16( audio_cache[ i ] ); | |
| 280 | for( i = 0; i < info->audio_samples * 2; i++ ) | |
| 281 | { | |
| 282 | audio_cache[ i ] = BIG_ENDIANIZE_INT16( audio_cache[ i ] ); | |
| 283 | } | |
| 287 | 284 | } |
| 288 | #endif | |
| 289 | 285 | |
| 290 | 286 | /* reset feedout ptr */ |
| 291 | 287 | info->audio_bptr = 0; |
| r4184 | r4185 | |
| 314 | 310 | switch (state) |
| 315 | 311 | { |
| 316 | 312 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 313 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(cdda_info); break; | |
| 317 | 314 | |
| 318 | 315 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 319 | 316 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( cdda ); break; |
| r4184 | r4185 | |
|---|---|---|
| 488 | 488 | static SND_START( tms36xx ) |
| 489 | 489 | { |
| 490 | 490 | int j; |
| 491 | struct TMS36XX *tms; | |
| 491 | struct TMS36XX *tms = device->token; | |
| 492 | 492 | int enable; |
| 493 | 493 | |
| 494 | tms = auto_malloc(sizeof(*tms)); | |
| 495 | memset(tms, 0, sizeof(*tms)); | |
| 494 | tms->intf = device->static_config; | |
| 496 | 495 | |
| 497 | tms->intf = config; | |
| 498 | ||
| 499 | 496 | tms->channel = stream_create(device, 0, 1, clock * 64, tms, tms36xx_sound_update); |
| 500 | 497 | tms->samplerate = clock * 64; |
| 501 | 498 | tms->basefreq = clock; |
| r4184 | r4185 | |
| 517 | 514 | tms->decay[0], tms->decay[1], tms->decay[2], |
| 518 | 515 | tms->decay[3], tms->decay[4], tms->decay[5])); |
| 519 | 516 | LOG(("TMS36xx speed %d\n", tms->speed)); |
| 520 | ||
| 521 | return tms; | |
| 522 | 517 | } |
| 523 | 518 | |
| 524 | 519 | |
| r4184 | r4185 | |
| 542 | 537 | switch (state) |
| 543 | 538 | { |
| 544 | 539 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 540 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct TMS36XX); break; | |
| 545 | 541 | |
| 546 | 542 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 547 | 543 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tms36xx ); break; |
| r4184 | r4185 | |
|---|---|---|
| 126 | 126 | |
| 127 | 127 | static SND_START( st0016 ) |
| 128 | 128 | { |
| 129 | const st0016_interface *intf = config; | |
| 130 | struct st0016_info *info; | |
| 129 | const st0016_interface *intf = device->static_config; | |
| 130 | struct st0016_info *info = device->token; | |
| 131 | 131 | |
| 132 | info = auto_malloc(sizeof(*info)); | |
| 133 | memset(info, 0, sizeof(*info)); | |
| 134 | ||
| 135 | 132 | info->sound_ram = intf->p_soundram; |
| 136 | 133 | |
| 137 | 134 | info->stream = stream_create(device, 0, 2, 44100, info, st0016_update); |
| 138 | ||
| 139 | return info; | |
| 140 | 135 | } |
| 141 | 136 | |
| 142 | 137 | |
| r4184 | r4185 | |
| 159 | 154 | switch (state) |
| 160 | 155 | { |
| 161 | 156 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 157 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct st0016_info); break; | |
| 162 | 158 | |
| 163 | 159 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 164 | 160 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( st0016 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | static SND_START( tia ) |
| 21 | 21 | { |
| 22 | struct tia_info *info; | |
| 22 | struct tia_info *info = device->token; | |
| 23 | 23 | |
| 24 | info = auto_malloc(sizeof(*info)); | |
| 25 | memset(info, 0, sizeof(*info)); | |
| 26 | ||
| 27 | 24 | info->channel = stream_create(device, 0, 1, clock, info, tia_update); |
| 28 | 25 | |
| 29 | 26 | info->chip = tia_sound_init(clock, clock, 16); |
| 30 | if (!info->chip) | |
| 31 | return NULL; | |
| 32 | ||
| 33 | return info; | |
| 27 | assert_always(info->chip != NULL, "Error creating TIA chip"); | |
| 34 | 28 | } |
| 35 | 29 | |
| 36 | 30 | static SND_STOP( tia ) |
| r4184 | r4185 | |
| 67 | 61 | switch (state) |
| 68 | 62 | { |
| 69 | 63 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 64 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct tia_info); break; | |
| 70 | 65 | |
| 71 | 66 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 72 | 67 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tia ); break; |
| r4184 | r4185 | |
|---|---|---|
| 126 | 126 | |
| 127 | 127 | /*********** An interface for SSG of YM2203 ***********/ |
| 128 | 128 | |
| 129 | void *ay8910_start_ym(sound_type chip_type, const device_config *device, int clock, const ay8910_interface *intf); | |
| 129 | void *ay8910_start_ym(void *infoptr, sound_type chip_type, const device_config *device, int clock, const ay8910_interface *intf); | |
| 130 | 130 | |
| 131 | 131 | void ay8910_stop_ym(void *chip); |
| 132 | 132 | void ay8910_reset_ym(void *chip); |
| r4184 | r4185 | |
|---|---|---|
| 310 | 310 | static SND_START( c6280 ) |
| 311 | 311 | { |
| 312 | 312 | int rate = clock/16; |
| 313 | c6280_t *info; | |
| 313 | c6280_t *info = device->token; | |
| 314 | 314 | |
| 315 | info = auto_malloc(sizeof(*info)); | |
| 316 | memset(info, 0, sizeof(*info)); | |
| 317 | ||
| 318 | 315 | /* Initialize PSG emulator */ |
| 319 | 316 | c6280_init(device, info, clock, rate); |
| 320 | 317 | |
| 321 | 318 | /* Create stereo stream */ |
| 322 | 319 | info->stream = stream_create(device, 0, 2, rate, info, c6280_update); |
| 323 | ||
| 324 | return info; | |
| 325 | 320 | } |
| 326 | 321 | |
| 327 | 322 | READ8_HANDLER( c6280_r ) { return h6280io_get_buffer((device_config*)space->cpu); } |
| r4184 | r4185 | |
| 348 | 343 | switch (state) |
| 349 | 344 | { |
| 350 | 345 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 346 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(c6280_t); break; | |
| 351 | 347 | |
| 352 | 348 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 353 | 349 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( c6280 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 247 | 247 | |
| 248 | 248 | static SND_START( discrete ) |
| 249 | 249 | { |
| 250 | discrete_sound_block *intf = (discrete_sound_block *)config; | |
| 251 | discrete_info *info; | |
| 250 | discrete_sound_block *intf = (discrete_sound_block *)device->static_config; | |
| 251 | discrete_info *info = device->token; | |
| 252 | 252 | char name[32]; |
| 253 | 253 | |
| 254 | info = auto_malloc(sizeof(*info)); | |
| 255 | memset(info, 0, sizeof(*info)); | |
| 256 | ||
| 257 | 254 | info->device = device; |
| 258 | 255 | |
| 259 | 256 | /* If a clock is specified we will use it, otherwise run at the audio sample rate. */ |
| r4184 | r4185 | |
| 318 | 315 | setup_disc_logs(info); |
| 319 | 316 | |
| 320 | 317 | discrete_current_context = NULL; |
| 321 | return info; | |
| 322 | 318 | } |
| 323 | 319 | |
| 324 | 320 | |
| r4184 | r4185 | |
| 755 | 751 | switch (state) |
| 756 | 752 | { |
| 757 | 753 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 754 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(discrete_info); break; | |
| 758 | 755 | |
| 759 | 756 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 760 | 757 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( discrete ); break; |
| r4184 | r4185 | |
|---|---|---|
| 37 | 37 | read_wav_sample - read a WAV file as a sample |
| 38 | 38 | -------------------------------------------------*/ |
| 39 | 39 | |
| 40 | #ifdef LSB_FIRST | |
| 41 | #define intelLong(x) (x) | |
| 42 | #else | |
| 43 | #define intelLong(x) (((x << 24) | (((unsigned long) x) >> 24) | (( x & 0x0000ff00) << 8) | (( x & 0x00ff0000) >> 8))) | |
| 44 | #endif | |
| 45 | ||
| 46 | 40 | static int read_wav_sample(mame_file *f, struct loaded_sample *sample) |
| 47 | 41 | { |
| 48 | 42 | unsigned long offset = 0; |
| 49 | 43 | UINT32 length, rate, filesize; |
| 50 | 44 | UINT16 bits, temp16; |
| 51 | 45 | char buf[32]; |
| 52 | #ifndef LSB_FIRST | |
| 53 | 46 | UINT32 sindex; |
| 54 | #endif | |
| 55 | 47 | |
| 56 | 48 | /* read the core header and make sure it's a WAVE file */ |
| 57 | 49 | offset += mame_fread(f, buf, 4); |
| r4184 | r4185 | |
| 64 | 56 | offset += mame_fread(f, &filesize, 4); |
| 65 | 57 | if (offset < 8) |
| 66 | 58 | return 0; |
| 67 | filesize = | |
| 59 | filesize = | |
| 68 | 60 | |
| 69 | 61 | /* read the RIFF file type and make sure it's a WAVE file */ |
| 70 | 62 | offset += mame_fread(f, buf, 4); |
| r4184 | r4185 | |
| 78 | 70 | { |
| 79 | 71 | offset += mame_fread(f, buf, 4); |
| 80 | 72 | offset += mame_fread(f, &length, 4); |
| 81 | length = | |
| 73 | length = | |
| 82 | 74 | if (memcmp(&buf[0], "fmt ", 4) == 0) |
| 83 | 75 | break; |
| 84 | 76 | |
| r4184 | r4185 | |
| 103 | 95 | |
| 104 | 96 | /* sample rate */ |
| 105 | 97 | offset += mame_fread(f, &rate, 4); |
| 106 | rate = | |
| 98 | rate = | |
| 107 | 99 | |
| 108 | 100 | /* bytes/second and block alignment are ignored */ |
| 109 | 101 | offset += mame_fread(f, buf, 6); |
| r4184 | r4185 | |
| 123 | 115 | { |
| 124 | 116 | offset += mame_fread(f, buf, 4); |
| 125 | 117 | offset += mame_fread(f, &length, 4); |
| 126 | length = | |
| 118 | length = | |
| 127 | 119 | if (memcmp(&buf[0], "data", 4) == 0) |
| 128 | 120 | break; |
| 129 | 121 | |
| r4184 | r4185 | |
| 162 | 154 | sample->data = auto_malloc(sizeof(*sample->data) * (length/2)); |
| 163 | 155 | mame_fread(f, sample->data, length); |
| 164 | 156 | sample->length /= 2; |
| 165 | #ifndef LSB_FIRST | |
| 166 | for (sindex = 0; sindex < sample->length; sindex++) | |
| 167 | sample->data[sindex] = LITTLE_ENDIANIZE_INT16(sample->data[sindex]); | |
| 168 | #endif | |
| 157 | if (ENDIANNESS_NATIVE != ENDIANNESS_LITTLE) | |
| 158 | for (sindex = 0; sindex < sample->length; sindex++) | |
| 159 | sample->data[sindex] = LITTLE_ENDIANIZE_INT16(sample->data[sindex]); | |
| 169 | 160 | } |
| 170 | 161 | return 1; |
| 171 | 162 | } |
| r4184 | r4185 | |
| 532 | 523 | static SND_START( samples ) |
| 533 | 524 | { |
| 534 | 525 | int i; |
| 535 | const samples_interface *intf = config; | |
| 536 | struct samples_info *info; | |
| 526 | const samples_interface *intf = device->static_config; | |
| 527 | struct samples_info *info = device->token; | |
| 537 | 528 | |
| 538 | info = auto_malloc(sizeof(*info)); | |
| 539 | memset(info, 0, sizeof(*info)); | |
| 540 | 529 | info->device = device; |
| 541 | sndintrf_register_token(info); | |
| 542 | 530 | |
| 543 | 531 | /* read audio samples */ |
| 544 | 532 | if (intf->samplenames) |
| r4184 | r4185 | |
| 572 | 560 | /* initialize any custom handlers */ |
| 573 | 561 | if (intf->start) |
| 574 | 562 | (*intf->start)(device); |
| 575 | ||
| 576 | return info; | |
| 577 | 563 | } |
| 578 | 564 | |
| 579 | 565 | |
| r4184 | r4185 | |
| 596 | 582 | switch (state) |
| 597 | 583 | { |
| 598 | 584 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 585 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct samples_info); break; | |
| 599 | 586 | |
| 600 | 587 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 601 | 588 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( samples ); break; |
| r4184 | r4185 | |
|---|---|---|
| 780 | 780 | |
| 781 | 781 | static SND_START( msm5232 ) |
| 782 | 782 | { |
| 783 | const msm5232_interface *intf = config; | |
| 783 | const msm5232_interface *intf = device->static_config; | |
| 784 | 784 | int rate = clock/CLOCK_RATE_DIVIDER; |
| 785 | MSM5232 *chip; | |
| 785 | MSM5232 *chip = device->token; | |
| 786 | 786 | |
| 787 | chip = auto_malloc(sizeof(*chip)); | |
| 788 | memset(chip, 0, sizeof(*chip)); | |
| 789 | ||
| 790 | 787 | msm5232_init(chip, intf, clock, rate); |
| 791 | 788 | |
| 792 | 789 | chip->stream = stream_create(device,0,11,rate,chip,MSM5232_update_one); |
| 793 | return chip; | |
| 794 | 790 | } |
| 795 | 791 | |
| 796 | 792 | static SND_STOP( msm5232 ) |
| r4184 | r4185 | |
| 846 | 842 | switch (state) |
| 847 | 843 | { |
| 848 | 844 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 845 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(MSM5232); break; | |
| 849 | 846 | |
| 850 | 847 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 851 | 848 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( msm5232 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 1225 | 1225 | { |
| 1226 | 1226 | const scsp_interface *intf; |
| 1227 | 1227 | |
| 1228 | struct _SCSP *SCSP; | |
| 1228 | struct _SCSP *SCSP = device->token; | |
| 1229 | 1229 | |
| 1230 | SCSP = auto_malloc(sizeof(*SCSP)); | |
| 1231 | memset(SCSP, 0, sizeof(*SCSP)); | |
| 1230 | intf = device->static_config; | |
| 1232 | 1231 | |
| 1233 | intf = config; | |
| 1234 | ||
| 1235 | 1232 | // init the emulation |
| 1236 | 1233 | SCSP_Init(device, SCSP, intf); |
| 1237 | 1234 | |
| r4184 | r4185 | |
| 1241 | 1238 | |
| 1242 | 1239 | SCSP->stream = stream_create(device, 0, 2, 44100, SCSP, SCSP_Update); |
| 1243 | 1240 | } |
| 1244 | ||
| 1245 | return SCSP; | |
| 1246 | 1241 | } |
| 1247 | 1242 | |
| 1248 | 1243 | |
| r4184 | r4185 | |
| 1385 | 1380 | switch (state) |
| 1386 | 1381 | { |
| 1387 | 1382 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1383 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct _SCSP); break; | |
| 1388 | 1384 | |
| 1389 | 1385 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1390 | 1386 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( scsp ); break; |
| r4184 | r4185 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | static SND_START( filter_rc ) |
| 84 | 84 | { |
| 85 | struct filter_rc_info *info; | |
| 86 | const flt_rc_config *conf = config; | |
| 85 | struct filter_rc_info *info = device->token; | |
| 86 | const flt_rc_config *conf = device->static_config; | |
| 87 | 87 | |
| 88 | info = auto_malloc(sizeof(*info)); | |
| 89 | memset(info, 0, sizeof(*info)); | |
| 90 | ||
| 91 | 88 | info->device = device; |
| 92 | 89 | info->stream = stream_create(device, 1, 1, device->machine->sample_rate, info, filter_rc_update); |
| 93 | 90 | if (conf) |
| 94 | 91 | set_RC_info(info, conf->type, conf->R1, conf->R2, conf->R3, conf->C); |
| 95 | 92 | else |
| 96 | 93 | set_RC_info(info, FLT_RC_LOWPASS, 1, 1, 1, 0); |
| 97 | ||
| 98 | return info; | |
| 99 | 94 | } |
| 100 | 95 | |
| 101 | 96 | |
| r4184 | r4185 | |
| 130 | 125 | switch (state) |
| 131 | 126 | { |
| 132 | 127 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 128 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct filter_rc_info); break; | |
| 133 | 129 | |
| 134 | 130 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 135 | 131 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( filter_rc ); break; |
| r4184 | r4185 | |
|---|---|---|
| 129 | 129 | AY8910_DEFAULT_LOADS, |
| 130 | 130 | NULL, NULL, NULL, NULL |
| 131 | 131 | }; |
| 132 | const ym2610_interface *intf = config ? config : &generic_2610; | |
| 132 | const ym2610_interface *intf = device->static_config ? device->static_config : &generic_2610; | |
| 133 | 133 | int rate = clock/72; |
| 134 | 134 | void *pcmbufa,*pcmbufb; |
| 135 | 135 | int pcmsizea,pcmsizeb; |
| 136 | struct ym2610_info *info; | |
| 136 | struct ym2610_info *info = device->token; | |
| 137 | 137 | astring *name = astring_alloc(); |
| 138 | 138 | |
| 139 | 139 | chip_type = SOUND_YM2610; |
| 140 | 140 | |
| 141 | info = auto_malloc(sizeof(*info)); | |
| 142 | memset(info, 0, sizeof(*info)); | |
| 143 | ||
| 144 | 141 | info->intf = intf; |
| 145 | 142 | info->device = device; |
| 146 | info->psg = ay8910_start_ym(SOUND_YM2610, device, clock, &generic_ay8910); | |
| 147 | if (!info->psg) return NULL; | |
| 143 | info->psg = ay8910_start_ym(NULL, SOUND_YM2610, device, clock, &generic_ay8910); | |
| 144 | assert_always(info->psg != NULL, "Error creating YM2610/AY8910 chip"); | |
| 148 | 145 | |
| 149 | 146 | /* Timer Handler set */ |
| 150 | 147 | info->timer[0] = timer_alloc(device->machine, timer_callback_0, info); |
| r4184 | r4185 | |
| 169 | 166 | info->chip = ym2610_init(info,device,clock,rate, |
| 170 | 167 | pcmbufa,pcmsizea,pcmbufb,pcmsizeb, |
| 171 | 168 | timer_handler,IRQHandler,&psgintf); |
| 169 | assert_always(info->chip != NULL, "Error creating YM2610 chip"); | |
| 172 | 170 | |
| 173 | 171 | state_save_register_postload(device->machine, ym2610_intf_postload, info); |
| 174 | ||
| 175 | if (info->chip) | |
| 176 | return info; | |
| 177 | ||
| 178 | /* error */ | |
| 179 | return NULL; | |
| 180 | 172 | } |
| 181 | 173 | #endif |
| 182 | 174 | |
| r4184 | r4185 | |
| 196 | 188 | AY8910_DEFAULT_LOADS, |
| 197 | 189 | NULL, NULL, NULL, NULL |
| 198 | 190 | }; |
| 199 | const ym2610_interface *intf = config ? config : &generic_2610; | |
| 191 | const ym2610_interface *intf = device->static_config ? device->static_config : &generic_2610; | |
| 200 | 192 | int rate = clock/72; |
| 201 | 193 | void *pcmbufa,*pcmbufb; |
| 202 | 194 | int pcmsizea,pcmsizeb; |
| 203 | struct ym2610_info *info; | |
| 195 | struct ym2610_info *info = device->token; | |
| 204 | 196 | astring *name = astring_alloc(); |
| 205 | 197 | |
| 206 | 198 | chip_type = SOUND_YM2610B; |
| 207 | 199 | |
| 208 | info = auto_malloc(sizeof(*info)); | |
| 209 | memset(info, 0, sizeof(*info)); | |
| 210 | ||
| 211 | 200 | info->intf = intf; |
| 212 | 201 | info->device = device; |
| 213 | info->psg = ay8910_start_ym(SOUND_YM2610B, device, clock, &generic_ay8910); | |
| 214 | if (!info->psg) return NULL; | |
| 202 | info->psg = ay8910_start_ym(NULL, SOUND_YM2610B, device, clock, &generic_ay8910); | |
| 203 | assert_always(info->psg != NULL, "Error creating YM2610B/AY8910 chip"); | |
| 215 | 204 | |
| 216 | 205 | /* Timer Handler set */ |
| 217 | 206 | info->timer[0] =timer_alloc(device->machine, timer_callback_0, info); |
| r4184 | r4185 | |
| 236 | 225 | info->chip = ym2610_init(info,device,clock,rate, |
| 237 | 226 | pcmbufa,pcmsizea,pcmbufb,pcmsizeb, |
| 238 | 227 | timer_handler,IRQHandler,&psgintf); |
| 239 | if (info->chip) | |
| 240 | return info; | |
| 241 | ||
| 242 | /* error */ | |
| 243 | return NULL; | |
| 228 | assert_always(info->chip != NULL, "Error creating YM2610B chip"); | |
| 244 | 229 | } |
| 245 | 230 | #endif |
| 246 | 231 | |
| r4184 | r4185 | |
| 495 | 480 | switch (state) |
| 496 | 481 | { |
| 497 | 482 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 483 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym2610_info); break; | |
| 498 | 484 | |
| 499 | 485 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 500 | 486 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ym2610 ); break; |
| r4184 | r4185 | |
| 532 | 518 | switch (state) |
| 533 | 519 | { |
| 534 | 520 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 521 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym2610_info); break; | |
| 535 | 522 | |
| 536 | 523 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 537 | 524 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ym2610b ); break; |
| r4184 | r4185 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | static SND_START( beep ) |
| 85 | 85 | { |
| 86 | struct beep_sound *pBeep; | |
| 86 | struct beep_sound *pBeep = device->token; | |
| 87 | 87 | |
| 88 | pBeep = auto_malloc(sizeof(*pBeep)); | |
| 89 | memset(pBeep, 0, sizeof(*pBeep)); | |
| 90 | ||
| 91 | 88 | pBeep->stream = stream_create(device, 0, 1, BEEP_RATE, pBeep, beep_sound_update ); |
| 92 | 89 | pBeep->enable = 0; |
| 93 | 90 | pBeep->frequency = 3250; |
| 94 | 91 | pBeep->incr = 0; |
| 95 | 92 | pBeep->signal = 0x07fff; |
| 96 | return pBeep; | |
| 97 | 93 | } |
| 98 | 94 | |
| 99 | 95 | |
| r4184 | r4185 | |
| 180 | 176 | switch (state) |
| 181 | 177 | { |
| 182 | 178 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 179 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct beep_sound); break; | |
| 183 | 180 | |
| 184 | 181 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 185 | 182 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( beep ); break; |
| r4184 | r4185 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | static SND_START( tms3615 ) |
| 81 | 81 | { |
| 82 | struct TMS3615 *tms; | |
| 82 | struct TMS3615 *tms = device->token; | |
| 83 | 83 | |
| 84 | tms = auto_malloc(sizeof(*tms)); | |
| 85 | memset(tms, 0, sizeof(*tms)); | |
| 86 | ||
| 87 | 84 | tms->channel = stream_create(device, 0, 2, clock/8, tms, tms3615_sound_update); |
| 88 | 85 | tms->samplerate = clock/8; |
| 89 | 86 | tms->basefreq = clock; |
| 90 | ||
| 91 | return tms; | |
| 92 | 87 | } |
| 93 | 88 | |
| 94 | 89 | /************************************************************************** |
| r4184 | r4185 | |
| 108 | 103 | switch (state) |
| 109 | 104 | { |
| 110 | 105 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 106 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct TMS3615); break; | |
| 111 | 107 | |
| 112 | 108 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 113 | 109 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( tms3615 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 441 | 441 | |
| 442 | 442 | static SND_START( ics2115 ) |
| 443 | 443 | { |
| 444 | struct ics2115 *chip; | |
| 444 | struct ics2115 *chip = device->token; | |
| 445 | 445 | int i; |
| 446 | 446 | |
| 447 | chip = auto_malloc(sizeof(*chip)); | |
| 448 | memset(chip, 0, sizeof(*chip)); | |
| 449 | ||
| 450 | 447 | chip->device = device; |
| 451 | chip->intf = config; | |
| 448 | chip->intf = device->static_config; | |
| 452 | 449 | chip->rom = device->region; |
| 453 | 450 | chip->timer[0].timer = timer_alloc(device->machine, timer_cb_0, chip); |
| 454 | 451 | chip->timer[1].timer = timer_alloc(device->machine, timer_cb_1, chip); |
| r4184 | r4185 | |
| 466 | 463 | v = v-33; |
| 467 | 464 | chip->ulaw[i] = v; |
| 468 | 465 | } |
| 469 | ||
| 470 | return chip; | |
| 471 | 466 | } |
| 472 | 467 | |
| 473 | 468 | READ8_HANDLER( ics2115_r ) |
| r4184 | r4185 | |
| 552 | 547 | switch (state) |
| 553 | 548 | { |
| 554 | 549 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 550 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ics2115); break; | |
| 555 | 551 | |
| 556 | 552 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 557 | 553 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ics2115 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 101 | 101 | |
| 102 | 102 | static SND_START( dac ) |
| 103 | 103 | { |
| 104 | struct dac_info *info; | |
| 104 | struct dac_info *info = device->token; | |
| 105 | 105 | |
| 106 | info = auto_malloc(sizeof(*info)); | |
| 107 | memset(info, 0, sizeof(*info)); | |
| 108 | ||
| 109 | 106 | DAC_build_voltable(info); |
| 110 | 107 | |
| 111 | 108 | info->channel = stream_create(device,0,1,clock ? clock : DEFAULT_SAMPLE_RATE,info,DAC_update); |
| 112 | 109 | info->output = 0; |
| 113 | 110 | |
| 114 | 111 | state_save_register_device_item(device, 0, info->output); |
| 115 | ||
| 116 | return info; | |
| 117 | 112 | } |
| 118 | 113 | |
| 119 | 114 | |
| r4184 | r4185 | |
| 169 | 164 | switch (state) |
| 170 | 165 | { |
| 171 | 166 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 167 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct dac_info); break; | |
| 172 | 168 | |
| 173 | 169 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 174 | 170 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( dac ); break; |
| r4184 | r4185 | |
|---|---|---|
| 559 | 559 | |
| 560 | 560 | static SND_START( s14001a ) |
| 561 | 561 | { |
| 562 | S14001AChip *chip; | |
| 562 | S14001AChip *chip = device->token; | |
| 563 | 563 | int i; |
| 564 | 564 | |
| 565 | chip = auto_malloc(sizeof(*chip)); | |
| 566 | memset(chip, 0, sizeof(*chip)); | |
| 567 | ||
| 568 | 565 | chip->GlobalSilenceState = 1; |
| 569 | 566 | chip->OldDelta = 0x02; |
| 570 | 567 | chip->DACOutput = SILENCE; |
| r4184 | r4185 | |
| 577 | 574 | chip->SpeechRom = device->region; |
| 578 | 575 | |
| 579 | 576 | chip->stream = stream_create(device, 0, 1, clock ? clock : device->machine->sample_rate, chip, s14001a_pcm_update); |
| 580 | ||
| 581 | return chip; | |
| 582 | 577 | } |
| 583 | 578 | |
| 584 | 579 | static SND_SET_INFO( s14001a ) |
| r4184 | r4185 | |
| 632 | 627 | { |
| 633 | 628 | switch (state) |
| 634 | 629 | { |
| 630 | /* --- the following bits of info are returned as 64-bit signed integers --- */ | |
| 631 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(S14001AChip); break; | |
| 632 | ||
| 635 | 633 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 636 | 634 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( s14001a ); break; |
| 637 | 635 | case SNDINFO_PTR_START: info->start = SND_START_NAME( s14001a ); break; |
| r4184 | r4185 | |
|---|---|---|
| 242 | 242 | CG-1V/GAE1 Init |
| 243 | 243 | ============================================================================*/ |
| 244 | 244 | |
| 245 | static void | |
| 245 | static void | |
| 246 | 246 | { |
| 247 | 247 | int j, vol; |
| 248 | const gaelcosnd_interface *intf = config; | |
| 248 | const gaelcosnd_interface *intf = device->static_config; | |
| 249 | 249 | |
| 250 | struct GAELCOSND *info; | |
| 251 | info = auto_malloc(sizeof(*info)); | |
| 252 | memset(info, 0, sizeof(*info)); | |
| 250 | struct GAELCOSND *info = device->token; | |
| 253 | 251 | |
| 254 | 252 | chip_type = sndtype; |
| 255 | 253 | |
| r4184 | r4185 | |
| 271 | 269 | |
| 272 | 270 | if (LOG_WAVE) |
| 273 | 271 | wavraw = wav_open("gae1_snd.wav", 8000, 2); |
| 274 | ||
| 275 | return info; | |
| 276 | 272 | } |
| 277 | 273 | |
| 278 | 274 | static SND_START( gaelco_gae1 ) |
| 279 | 275 | { |
| 280 | | |
| 276 | | |
| 281 | 277 | } |
| 282 | 278 | |
| 283 | 279 | static SND_START( gaelco_cg1v ) |
| 284 | 280 | { |
| 285 | | |
| 281 | | |
| 286 | 282 | } |
| 287 | 283 | |
| 288 | 284 | |
| r4184 | r4185 | |
| 314 | 310 | switch (state) |
| 315 | 311 | { |
| 316 | 312 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 313 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct GAELCOSND); break; | |
| 317 | 314 | |
| 318 | 315 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 319 | 316 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( gaelco_gae1 ); break; |
| r4184 | r4185 | |
| 350 | 347 | switch (state) |
| 351 | 348 | { |
| 352 | 349 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 350 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct GAELCOSND); break; | |
| 353 | 351 | |
| 354 | 352 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 355 | 353 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( gaelco_cg1v ); break; |
| r4184 | r4185 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | static SND_START( bsmt2000 ) |
| 109 | 109 | { |
| 110 | bsmt2000_chip *chip; | |
| 110 | bsmt2000_chip *chip = device->token; | |
| 111 | 111 | int voicenum; |
| 112 | 112 | |
| 113 | /* allocate the chip */ | |
| 114 | chip = auto_malloc(sizeof(*chip)); | |
| 115 | memset(chip, 0, sizeof(*chip)); | |
| 116 | ||
| 117 | 113 | /* create a stream at a nominal sample rate (real one specified later) */ |
| 118 | 114 | chip->stream = stream_create(device, 0, 2, clock / 1000, chip, bsmt2000_update); |
| 119 | 115 | chip->clock = clock; |
| r4184 | r4185 | |
| 147 | 143 | |
| 148 | 144 | /* reset the chip -- this also configures the default mode */ |
| 149 | 145 | bsmt2000_reset(chip); |
| 150 | return chip; | |
| 151 | 146 | } |
| 152 | 147 | |
| 153 | 148 | |
| r4184 | r4185 | |
| 500 | 495 | switch (state) |
| 501 | 496 | { |
| 502 | 497 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 498 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(bsmt2000_chip); break; | |
| 503 | 499 | |
| 504 | 500 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 505 | 501 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( bsmt2000 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 8 | 8 | UINT32 data_offs; |
| 9 | 9 | }; |
| 10 | 10 | |
| 11 | #ifdef LSB_FIRST | |
| 12 | #define intel_long(x) (x) | |
| 13 | #define intel_short(x) (x) | |
| 14 | #else | |
| 15 | #define intel_long(x) (((x << 24) | (((unsigned long) x) >> 24) | (( x & 0x0000ff00) << 8) | (( x & 0x00ff0000) >> 8))) | |
| 16 | #define intel_short(x) (((x) << 8) | ((x) >> 8)) | |
| 17 | #endif | |
| 18 | 11 | |
| 19 | 12 | wav_file *wav_open(const char *filename, int sample_rate, int channels) |
| 20 | 13 | { |
| r4184 | r4185 | |
| 50 | 43 | fwrite("fmt ", 1, 4, wav->file); |
| 51 | 44 | |
| 52 | 45 | /* write the format length */ |
| 53 | temp32 = | |
| 46 | temp32 = LITTLE_ENDIANIZE_INT32(16); | |
| 54 | 47 | fwrite(&temp32, 1, 4, wav->file); |
| 55 | 48 | |
| 56 | 49 | /* write the format (PCM) */ |
| 57 | temp16 = | |
| 50 | temp16 = LITTLE_ENDIANIZE_INT16(1); | |
| 58 | 51 | fwrite(&temp16, 1, 2, wav->file); |
| 59 | 52 | |
| 60 | 53 | /* write the channels */ |
| 61 | temp16 = | |
| 54 | temp16 = LITTLE_ENDIANIZE_INT16(channels); | |
| 62 | 55 | fwrite(&temp16, 1, 2, wav->file); |
| 63 | 56 | |
| 64 | 57 | /* write the sample rate */ |
| 65 | temp32 = | |
| 58 | temp32 = LITTLE_ENDIANIZE_INT32(sample_rate); | |
| 66 | 59 | fwrite(&temp32, 1, 4, wav->file); |
| 67 | 60 | |
| 68 | 61 | /* write the bytes/second */ |
| 69 | 62 | bps = sample_rate * 2 * channels; |
| 70 | temp32 = | |
| 63 | temp32 = LITTLE_ENDIANIZE_INT32(bps); | |
| 71 | 64 | fwrite(&temp32, 1, 4, wav->file); |
| 72 | 65 | |
| 73 | 66 | /* write the block align */ |
| 74 | 67 | align = 2 * channels; |
| 75 | temp16 = | |
| 68 | temp16 = LITTLE_ENDIANIZE_INT16(align); | |
| 76 | 69 | fwrite(&temp16, 1, 2, wav->file); |
| 77 | 70 | |
| 78 | 71 | /* write the bits/sample */ |
| 79 | temp16 = | |
| 72 | temp16 = LITTLE_ENDIANIZE_INT16(16); | |
| 80 | 73 | fwrite(&temp16, 1, 2, wav->file); |
| 81 | 74 | |
| 82 | 75 | /* write the 'data' tag */ |
| r4184 | r4185 | |
| 101 | 94 | /* update the total file size */ |
| 102 | 95 | fseek(wav->file, wav->total_offs, SEEK_SET); |
| 103 | 96 | temp32 = total - (wav->total_offs + 4); |
| 104 | temp32 = | |
| 97 | temp32 = LITTLE_ENDIANIZE_INT32(temp32); | |
| 105 | 98 | fwrite(&temp32, 1, 4, wav->file); |
| 106 | 99 | |
| 107 | 100 | /* update the data size */ |
| 108 | 101 | fseek(wav->file, wav->data_offs, SEEK_SET); |
| 109 | 102 | temp32 = total - (wav->data_offs + 4); |
| 110 | temp32 = | |
| 103 | temp32 = LITTLE_ENDIANIZE_INT32(temp32); | |
| 111 | 104 | fwrite(&temp32, 1, 4, wav->file); |
| 112 | 105 | |
| 113 | 106 | fclose(wav->file); |
| r4184 | r4185 | |
|---|---|---|
| 93 | 93 | |
| 94 | 94 | static SND_START( dmadac ) |
| 95 | 95 | { |
| 96 | struct dmadac_channel_data *info; | |
| 96 | struct dmadac_channel_data *info = device->token; | |
| 97 | 97 | |
| 98 | info = auto_malloc(sizeof(*info)); | |
| 99 | memset(info, 0, sizeof(*info)); | |
| 100 | ||
| 101 | 98 | /* allocate a clear a buffer */ |
| 102 | 99 | info->buffer = auto_malloc(sizeof(info->buffer[0]) * BUFFER_SIZE); |
| 103 | 100 | memset(info->buffer, 0, sizeof(info->buffer[0]) * BUFFER_SIZE); |
| r4184 | r4185 | |
| 115 | 112 | state_save_register_device_item(device, 0, info->enabled); |
| 116 | 113 | state_save_register_device_item(device, 0, info->frequency); |
| 117 | 114 | state_save_register_device_item_pointer(device, 0, info->buffer, BUFFER_SIZE); |
| 118 | ||
| 119 | return info; | |
| 120 | 115 | } |
| 121 | 116 | |
| 122 | 117 | |
| r4184 | r4185 | |
| 249 | 244 | switch (state) |
| 250 | 245 | { |
| 251 | 246 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 247 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct dmadac_channel_data); break; | |
| 252 | 248 | |
| 253 | 249 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 254 | 250 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( dmadac ); break; |
| r4184 | r4185 | |
|---|---|---|
| 129 | 129 | }, |
| 130 | 130 | NULL |
| 131 | 131 | }; |
| 132 | const ym2608_interface *intf = config ? config : &generic_2608; | |
| 132 | const ym2608_interface *intf = device->static_config ? device->static_config : &generic_2608; | |
| 133 | 133 | int rate = clock/72; |
| 134 | 134 | void *pcmbufa; |
| 135 | 135 | int pcmsizea; |
| 136 | 136 | |
| 137 | struct ym2608_info *info; | |
| 137 | struct ym2608_info *info = device->token; | |
| 138 | 138 | |
| 139 | info = auto_malloc(sizeof(*info)); | |
| 140 | memset(info, 0, sizeof(*info)); | |
| 141 | ||
| 142 | 139 | info->intf = intf; |
| 143 | 140 | info->device = device; |
| 144 | 141 | |
| 145 | 142 | /* FIXME: Force to use simgle output */ |
| 146 | info->psg = ay8910_start_ym(SOUND_YM2608, device, clock, &intf->ay8910_intf); | |
| 147 | if (!info->psg) return NULL; | |
| 143 | info->psg = ay8910_start_ym(NULL, SOUND_YM2608, device, clock, &intf->ay8910_intf); | |
| 144 | assert_always(info->psg != NULL, "Error creating YM2608/AY8910 chip"); | |
| 148 | 145 | |
| 149 | 146 | /* Timer Handler set */ |
| 150 | 147 | info->timer[0] = timer_alloc(device->machine, timer_callback_2608_0, info); |
| r4184 | r4185 | |
| 160 | 157 | info->chip = ym2608_init(info,device,clock,rate, |
| 161 | 158 | pcmbufa,pcmsizea, |
| 162 | 159 | timer_handler,IRQHandler,&psgintf); |
| 160 | assert_always(info->chip != NULL, "Error creating YM2608 chip"); | |
| 163 | 161 | |
| 164 | 162 | state_save_register_postload(device->machine, ym2608_intf_postload, info); |
| 165 | ||
| 166 | if (info->chip) | |
| 167 | return info; | |
| 168 | ||
| 169 | /* error */ | |
| 170 | return NULL; | |
| 171 | 163 | } |
| 172 | 164 | |
| 173 | 165 | static SND_STOP( ym2608 ) |
| r4184 | r4185 | |
| 309 | 301 | switch (state) |
| 310 | 302 | { |
| 311 | 303 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 304 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym2608_info); break; | |
| 312 | 305 | |
| 313 | 306 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 314 | 307 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ym2608 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 54 | 54 | attenuation to apply to the sound signal. */ |
| 55 | 55 | static int volume_table[4] = |
| 56 | 56 | { |
| 57 | 0x10, // 0 dB | |
| 58 | 0x08, // -6.0 dB | |
| 59 | 0x04, // -12.0 dB | |
| 60 | 0x02, // -24.0 dB | |
| 57 | 0x20, // 0 dB | |
| 58 | 0x10, // -6.0 dB | |
| 59 | 0x08, // -12.0 dB | |
| 60 | 0x04, // -24.0 dB | |
| 61 | 61 | }; |
| 62 | 62 | |
| 63 | 63 | /* tables computed? */ |
| r4184 | r4185 | |
| 136 | 136 | voice->signal += diff_lookup[voice->step * 16 + (nibble & 15)]; |
| 137 | 137 | |
| 138 | 138 | /* clamp to the maximum 12bit */ |
| 139 | if (voice->signal > 4095) | |
| 140 | voice->signal = 4095; | |
| 141 | else if (voice->signal < -4096) | |
| 142 | voice->signal = -4096; | |
| 139 | if (voice->signal > 2047) | |
| 140 | voice->signal = 2047; | |
| 141 | else if (voice->signal < -2048) | |
| 142 | voice->signal = -2048; | |
| 143 | 143 | |
| 144 | 144 | /* adjust the step size and clamp */ |
| 145 | 145 | voice->step += index_shift[nibble & 7]; |
| r4184 | r4185 | |
| 289 | 289 | |
| 290 | 290 | static SND_START( okim6376 ) |
| 291 | 291 | { |
| 292 | struct okim6376 *info; | |
| 292 | struct okim6376 *info = device->token; | |
| 293 | 293 | int voice; |
| 294 | 294 | int divisor = 165; |
| 295 | 295 | |
| 296 | info = auto_malloc(sizeof(*info)); | |
| 297 | memset(info, 0, sizeof(*info)); | |
| 298 | ||
| 299 | 296 | compute_tables(); |
| 300 | 297 | |
| 301 | 298 | info->command = -1; |
| r4184 | r4185 | |
| 314 | 311 | } |
| 315 | 312 | |
| 316 | 313 | okim6376_state_save_register(info, device); |
| 317 | ||
| 318 | /* success */ | |
| 319 | return info; | |
| 320 | 314 | } |
| 321 | 315 | |
| 322 | 316 | |
| r4184 | r4185 | |
| 599 | 593 | switch (state) |
| 600 | 594 | { |
| 601 | 595 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 596 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct okim6376); break; | |
| 602 | 597 | |
| 603 | 598 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 604 | 599 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( okim6376 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 319 | 319 | |
| 320 | 320 | static SND_START( okim6295 ) |
| 321 | 321 | { |
| 322 | const okim6295_interface *intf = config; | |
| 323 | struct okim6295 *info; | |
| 322 | const okim6295_interface *intf = device->static_config; | |
| 323 | struct okim6295 *info = device->token; | |
| 324 | 324 | int voice; |
| 325 | 325 | int divisor = intf->pin7 ? 132 : 165; |
| 326 | 326 | |
| 327 | info = auto_malloc(sizeof(*info)); | |
| 328 | memset(info, 0, sizeof(*info)); | |
| 329 | ||
| 330 | 327 | compute_tables(); |
| 331 | 328 | |
| 332 | 329 | info->command = -1; |
| r4184 | r4185 | |
| 349 | 346 | } |
| 350 | 347 | |
| 351 | 348 | okim6295_state_save_register(info, device); |
| 352 | ||
| 353 | /* success */ | |
| 354 | return info; | |
| 355 | 349 | } |
| 356 | 350 | |
| 357 | 351 | |
| r4184 | r4185 | |
| 662 | 656 | switch (state) |
| 663 | 657 | { |
| 664 | 658 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 659 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct okim6295); break; | |
| 665 | 660 | |
| 666 | 661 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 667 | 662 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( okim6295 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | ***********************************************************************************************/ |
| 179 | 179 | |
| 180 | static i | |
| 180 | static void | |
| 181 | 181 | { |
| 182 | 182 | int i; |
| 183 | 183 | |
| r4184 | r4185 | |
| 211 | 211 | |
| 212 | 212 | chip->volume_lookup[i] = (mantissa << 11) >> (20 - exponent); |
| 213 | 213 | } |
| 214 | ||
| 215 | return 1; | |
| 216 | 214 | } |
| 217 | 215 | |
| 218 | 216 | |
| r4184 | r4185 | |
| 821 | 819 | |
| 822 | 820 | ***********************************************************************************************/ |
| 823 | 821 | |
| 824 | static void | |
| 822 | static void | |
| 825 | 823 | { |
| 826 | 824 | const es5506_interface *intf = config; |
| 827 | struct ES5506Chip *chip; | |
| 825 | struct ES5506Chip *chip = device->token; | |
| 828 | 826 | int j; |
| 829 | 827 | UINT32 accum_mask; |
| 830 | 828 | |
| 831 | chip = auto_malloc(sizeof(*chip)); | |
| 832 | memset(chip, 0, sizeof(*chip)); | |
| 833 | ||
| 834 | 829 | /* debugging */ |
| 835 | 830 | if (LOG_COMMANDS && !eslog) |
| 836 | 831 | eslog = fopen("es.log", "w"); |
| 837 | 832 | |
| 838 | 833 | /* compute the tables */ |
| 839 | if (!compute_tables(chip)) | |
| 840 | return NULL; | |
| 834 | compute_tables(chip); | |
| 841 | 835 | |
| 842 | 836 | /* create the stream */ |
| 843 | 837 | chip->stream = stream_create(device, 0, 2, clock / (16*32), chip, es5506_update); |
| r4184 | r4185 | |
| 870 | 864 | chip->scratch = auto_malloc(sizeof(chip->scratch[0]) * 2 * MAX_SAMPLE_CHUNK); |
| 871 | 865 | |
| 872 | 866 | /* success */ |
| 873 | return chip; | |
| 874 | 867 | } |
| 875 | 868 | |
| 876 | 869 | |
| 877 | 870 | static SND_START( es5506 ) |
| 878 | 871 | { |
| 879 | | |
| 872 | | |
| 880 | 873 | } |
| 881 | 874 | |
| 882 | 875 | |
| r4184 | r4185 | |
| 1503 | 1496 | |
| 1504 | 1497 | static SND_START( es5505 ) |
| 1505 | 1498 | { |
| 1506 | const es5505_interface *intf = config; | |
| 1499 | const es5505_interface *intf = device->static_config; | |
| 1507 | 1500 | es5506_interface es5506intf; |
| 1508 | 1501 | |
| 1509 | 1502 | memset(&es5506intf, 0, sizeof(es5506intf)); |
| r4184 | r4185 | |
| 1513 | 1506 | es5506intf.irq_callback = intf->irq_callback; |
| 1514 | 1507 | es5506intf.read_port = intf->read_port; |
| 1515 | 1508 | |
| 1516 | | |
| 1509 | | |
| 1517 | 1510 | } |
| 1518 | 1511 | |
| 1519 | 1512 | |
| r4184 | r4185 | |
| 2159 | 2152 | switch (state) |
| 2160 | 2153 | { |
| 2161 | 2154 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2155 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ES5506Chip); break; | |
| 2162 | 2156 | |
| 2163 | 2157 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2164 | 2158 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( es5505 ); break; |
| r4184 | r4185 | |
| 2194 | 2188 | switch (state) |
| 2195 | 2189 | { |
| 2196 | 2190 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2191 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ES5506Chip); break; | |
| 2197 | 2192 | |
| 2198 | 2193 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2199 | 2194 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( es5506 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 670 | 670 | static const ymf278b_interface defintrf = { 0 }; |
| 671 | 671 | const ymf278b_interface *intf; |
| 672 | 672 | int i; |
| 673 | YMF278BChip *chip; | |
| 673 | YMF278BChip *chip = device->token; | |
| 674 | 674 | |
| 675 | chip = auto_malloc(sizeof(*chip)); | |
| 676 | memset(chip, 0, sizeof(*chip)); | |
| 675 | intf = (device->static_config != NULL) ? device->static_config : &defintrf; | |
| 677 | 676 | |
| 678 | intf = (config != NULL) ? config : &defintrf; | |
| 679 | ||
| 680 | 677 | ymf278b_init(device->machine, chip, device->region, intf->irq_callback, clock); |
| 681 | 678 | chip->stream = stream_create(device, 0, 2, clock/768, chip, ymf278b_pcm_update); |
| 682 | 679 | |
| r4184 | r4185 | |
| 697 | 694 | for(i=0; i<7; i++) |
| 698 | 695 | chip->mix_level[i] = chip->volume[8*i+8]; |
| 699 | 696 | chip->mix_level[7] = 0; |
| 700 | ||
| 701 | return chip; | |
| 702 | 697 | } |
| 703 | 698 | |
| 704 | 699 | |
| r4184 | r4185 | |
| 804 | 799 | switch (state) |
| 805 | 800 | { |
| 806 | 801 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 802 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(YMF278BChip); break; | |
| 807 | 803 | |
| 808 | 804 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 809 | 805 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ymf278b ); break; |
| r4184 | r4185 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | |
| 32 | static void | |
| 32 | static void | |
| 33 | 33 | { |
| 34 | SID6581 *sid; | |
| 34 | SID6581 *sid = device->token; | |
| 35 | 35 | const sid6581_interface *iface = (const sid6581_interface*) device->static_config; |
| 36 | 36 | |
| 37 | sid = (SID6581 *) auto_malloc(sizeof(*sid)); | |
| 38 | memset(sid, 0, sizeof(*sid)); | |
| 39 | ||
| 40 | 37 | sid->device = device; |
| 41 | 38 | sid->mixer_channel = stream_create (device, 0, 1, device->machine->sample_rate, (void *) sid, sid_update); |
| 42 | 39 | sid->PCMfreq = device->machine->sample_rate; |
| r4184 | r4185 | |
| 46 | 43 | |
| 47 | 44 | sid6581_init(sid); |
| 48 | 45 | sidInitWaveformTables(sidtype); |
| 49 | return sid; | |
| 50 | 46 | } |
| 51 | 47 | |
| 52 | 48 | |
| r4184 | r4185 | |
| 113 | 109 | switch (state) |
| 114 | 110 | { |
| 115 | 111 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 112 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(SID6581); break; | |
| 116 | 113 | |
| 117 | 114 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 118 | 115 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( sid6581 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | static SND_START( filter_volume ) |
| 26 | 26 | { |
| 27 | struct filter_volume_info *info; | |
| 27 | struct filter_volume_info *info = device->token; | |
| 28 | 28 | |
| 29 | info = auto_malloc(sizeof(*info)); | |
| 30 | memset(info, 0, sizeof(*info)); | |
| 31 | ||
| 32 | 29 | info->gain = 0x100; |
| 33 | 30 | info->stream = stream_create(device, 1, 1, device->machine->sample_rate, info, filter_volume_update); |
| 34 | ||
| 35 | return info; | |
| 36 | 31 | } |
| 37 | 32 | |
| 38 | 33 | |
| r4184 | r4185 | |
| 62 | 57 | switch (state) |
| 63 | 58 | { |
| 64 | 59 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 60 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct filter_volume_info); break; | |
| 65 | 61 | |
| 66 | 62 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 67 | 63 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( filter_volume ); break; |
| r4184 | r4185 | |
|---|---|---|
| 44 | 44 | static SND_START( tms5220 ) |
| 45 | 45 | { |
| 46 | 46 | static const tms5220_interface dummy = { 0 }; |
| 47 | struct tms5220_info *info; | |
| 47 | struct tms5220_info *info = device->token; | |
| 48 | 48 | |
| 49 | info = auto_malloc(sizeof(*info)); | |
| 50 | memset(info, 0, sizeof(*info)); | |
| 51 | info->intf = config ? config : &dummy; | |
| 49 | info->intf = device->static_config ? device->static_config : &dummy; | |
| 52 | 50 | |
| 53 | 51 | info->chip = tms5220_create(device); |
| 54 | if (!info->chip) | |
| 55 | return NULL; | |
| 56 | sndintrf_register_token(info); | |
| 52 | assert_always(info->chip != NULL, "Error creating TMS5220 chip"); | |
| 57 | 53 | |
| 58 | 54 | /* initialize a info->stream */ |
| 59 | 55 | info->stream = stream_create(device, 0, 1, clock / 80, info, tms5220_update); |
| r4184 | r4185 | |
| 67 | 63 | tms5220_set_read(info->chip, info->intf->read); |
| 68 | 64 | tms5220_set_load_address(info->chip, info->intf->load_address); |
| 69 | 65 | tms5220_set_read_and_branch(info->chip, info->intf->read_and_branch); |
| 70 | ||
| 71 | /* request a sound channel */ | |
| 72 | return info; | |
| 73 | 66 | } |
| 74 | 67 | |
| 75 | 68 | |
| 76 | 69 | #if (HAS_TMC0285 || HAS_TMS5200) |
| 77 | 70 | static SND_START( tms5200 ) |
| 78 | 71 | { |
| 79 | struct tms5220_info *info = SND_START_CALL( tms5220 ); | |
| 72 | struct tms5220_info *info = device->token; | |
| 73 | SND_START_CALL( tms5220 ); | |
| 80 | 74 | tms5220_set_variant(info->chip, variant_tmc0285); |
| 81 | return info; | |
| 82 | 75 | } |
| 83 | 76 | #endif /* (HAS_TMC0285) && (HAS_TMS5200) */ |
| 84 | 77 | |
| r4184 | r4185 | |
| 254 | 247 | switch (state) |
| 255 | 248 | { |
| 256 | 249 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 250 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct tms5220_info); break; | |
| 257 | 251 | case SNDINFO_FCT_ALIAS: info->type = SOUND_TMS5220; break; |
| 258 | 252 | |
| 259 | 253 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| r4184 | r4185 | |
|---|---|---|
| 39 | 39 | static SND_START( ym2151 ) |
| 40 | 40 | { |
| 41 | 41 | static const ym2151_interface dummy = { 0 }; |
| 42 | struct ym2151_info *info; | |
| 42 | struct ym2151_info *info = device->token; | |
| 43 | 43 | int rate; |
| 44 | 44 | |
| 45 | info = auto_malloc(sizeof(*info)); | |
| 46 | memset(info, 0, sizeof(*info)); | |
| 45 | info->intf = device->static_config ? device->static_config : &dummy; | |
| 47 | 46 | |
| 48 | info->intf = config ? config : &dummy; | |
| 49 | ||
| 50 | 47 | rate = clock/64; |
| 51 | 48 | |
| 52 | 49 | /* stream setup */ |
| 53 | 50 | info->stream = stream_create(device,0,2,rate,info,ym2151_update); |
| 54 | 51 | |
| 55 | 52 | info->chip = ym2151_init(device,clock,rate); |
| 53 | assert_always(info->chip != NULL, "Error creating YM2151 chip"); | |
| 56 | 54 | |
| 57 | 55 | state_save_register_postload(device->machine, ym2151intf_postload, info); |
| 58 | 56 | |
| 59 | if (info->chip != 0) | |
| 60 | { | |
| 61 | ym2151_set_irq_handler(info->chip,info->intf->irqhandler); | |
| 62 | ym2151_set_port_write_handler(info->chip,info->intf->portwritehandler); | |
| 63 | return info; | |
| 64 | } | |
| 65 | return NULL; | |
| 57 | ym2151_set_irq_handler(info->chip,info->intf->irqhandler); | |
| 58 | ym2151_set_port_write_handler(info->chip,info->intf->portwritehandler); | |
| 66 | 59 | } |
| 67 | 60 | |
| 68 | 61 | |
| r4184 | r4185 | |
| 222 | 215 | switch (state) |
| 223 | 216 | { |
| 224 | 217 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 218 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym2151_info); break; | |
| 225 | 219 | |
| 226 | 220 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 227 | 221 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ym2151 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 252 | 252 | |
| 253 | 253 | static SND_START( psxspu ) |
| 254 | 254 | { |
| 255 | struct psxinfo *chip; | |
| 255 | struct psxinfo *chip = device->token; | |
| 256 | 256 | int n_effect; |
| 257 | 257 | int n_channel; |
| 258 | 258 | |
| 259 | chip = auto_malloc(sizeof(*chip)); | |
| 260 | memset(chip, 0, sizeof(*chip)); | |
| 261 | ||
| 262 | chip->intf = config; | |
| 259 | chip->intf = device->static_config; | |
| 263 | 260 | chip->device = device; |
| 264 | 261 | chip->g_p_n_psxram = *(chip->intf->p_psxram); |
| 265 | 262 | |
| r4184 | r4185 | |
| 352 | 349 | chip->intf->spu_install_write_handler( 4, spu_write ); |
| 353 | 350 | |
| 354 | 351 | chip->stream = stream_create( device, 0, 2, 44100, chip, PSXSPU_update ); |
| 355 | return chip; | |
| 356 | 352 | } |
| 357 | 353 | |
| 358 | 354 | |
| r4184 | r4185 | |
| 682 | 678 | switch (state) |
| 683 | 679 | { |
| 684 | 680 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 681 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct psxinfo); break; | |
| 685 | 682 | |
| 686 | 683 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 687 | 684 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( psxspu ); break; |
| r4184 | r4185 | |
|---|---|---|
| 202 | 202 | static SND_START( k053260 ) |
| 203 | 203 | { |
| 204 | 204 | static const k053260_interface defintrf = { 0 }; |
| 205 | struct k053260_chip_def *ic; | |
| 205 | struct k053260_chip_def *ic = device->token; | |
| 206 | 206 | int rate = clock / 32; |
| 207 | 207 | int i; |
| 208 | 208 | |
| 209 | ic = auto_malloc(sizeof(*ic)); | |
| 210 | memset(ic, 0, sizeof(*ic)); | |
| 211 | ||
| 212 | 209 | /* Initialize our chip structure */ |
| 213 | 210 | ic->device = device; |
| 214 | ic->intf = (config != NULL) ? config : &defintrf; | |
| 211 | ic->intf = (device->static_config != NULL) ? device->static_config : &defintrf; | |
| 215 | 212 | |
| 216 | 213 | ic->mode = 0; |
| 217 | 214 | ic->rom = device->region; |
| r4184 | r4185 | |
| 236 | 233 | /* setup SH1 timer if necessary */ |
| 237 | 234 | if ( ic->intf->irq ) |
| 238 | 235 | timer_pulse( device->machine, attotime_mul(ATTOTIME_IN_HZ(clock), 32), NULL, 0, ic->intf->irq ); |
| 239 | ||
| 240 | return ic; | |
| 241 | 236 | } |
| 242 | 237 | |
| 243 | 238 | INLINE void check_bounds( struct k053260_chip_def *ic, int channel ) { |
| r4184 | r4185 | |
| 481 | 476 | switch (state) |
| 482 | 477 | { |
| 483 | 478 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 479 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct k053260_chip_def); break; | |
| 484 | 480 | |
| 485 | 481 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 486 | 482 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k053260 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 51 | 51 | static SND_START( ym2413 ) |
| 52 | 52 | { |
| 53 | 53 | int rate = clock/72; |
| 54 | struct ym2413_info *info; | |
| 54 | struct ym2413_info *info = device->token; | |
| 55 | 55 | |
| 56 | info = auto_malloc(sizeof(*info)); | |
| 57 | memset(info, 0, sizeof(*info)); | |
| 58 | ||
| 59 | 56 | /* emulator create */ |
| 60 | 57 | info->chip = ym2413_init(device, clock, rate); |
| 61 | if (!info->chip) | |
| 62 | return NULL; | |
| 58 | assert_always(info->chip != NULL, "Error creating YM2413 chip"); | |
| 63 | 59 | |
| 64 | 60 | /* stream system initialize */ |
| 65 | 61 | info->stream = stream_create(device,0,2,rate,info,ym2413_stream_update); |
| 66 | 62 | |
| 67 | 63 | ym2413_set_update_handler(info->chip, _stream_update, info); |
| 68 | 64 | |
| 69 | return info; | |
| 70 | 65 | |
| 71 | 66 | |
| 72 | 67 | |
| 73 | ||
| 74 | 68 | #if 0 |
| 75 | 69 | int i, tst; |
| 76 | 70 | char name[40]; |
| r4184 | r4185 | |
| 169 | 163 | switch (state) |
| 170 | 164 | { |
| 171 | 165 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 166 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym2413_info); break; | |
| 172 | 167 | |
| 173 | 168 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 174 | 169 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ym2413 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | static SND_START( segapcm ) |
| 80 | 80 | { |
| 81 | const sega_pcm_interface *intf = config; | |
| 81 | const sega_pcm_interface *intf = device->static_config; | |
| 82 | 82 | int mask, rom_mask, len; |
| 83 | struct segapcm *spcm; | |
| 83 | struct segapcm *spcm = device->token; | |
| 84 | 84 | |
| 85 | spcm = auto_malloc(sizeof(*spcm)); | |
| 86 | memset(spcm, 0, sizeof(*spcm)); | |
| 87 | ||
| 88 | 85 | spcm->rom = (const UINT8 *)device->region; |
| 89 | 86 | spcm->ram = auto_malloc(0x800); |
| 90 | 87 | |
| r4184 | r4185 | |
| 105 | 102 | |
| 106 | 103 | state_save_register_device_item_array(device, 0, spcm->low); |
| 107 | 104 | state_save_register_device_item_pointer(device, 0, spcm->ram, 0x800); |
| 108 | ||
| 109 | return spcm; | |
| 110 | 105 | } |
| 111 | 106 | |
| 112 | 107 | |
| r4184 | r4185 | |
| 144 | 139 | switch (state) |
| 145 | 140 | { |
| 146 | 141 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 142 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct segapcm); break; | |
| 147 | 143 | |
| 148 | 144 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 149 | 145 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( segapcm ); break; |
| r4184 | r4185 | |
|---|---|---|
| 97 | 97 | static SND_START( vrender0 ) |
| 98 | 98 | { |
| 99 | 99 | const vr0_interface *intf; |
| 100 | struct _VR0Chip *VR0; | |
| 100 | struct _VR0Chip *VR0 = device->token; | |
| 101 | 101 | |
| 102 | VR0 = auto_malloc(sizeof(*VR0)); | |
| 103 | memset(VR0, 0, sizeof(*VR0)); | |
| 102 | intf=device->static_config; | |
| 104 | 103 | |
| 105 | intf=config; | |
| 106 | ||
| 107 | 104 | memcpy(&(VR0->Intf),intf,sizeof(vr0_interface)); |
| 108 | 105 | memset(VR0->SOUNDREGS,0,sizeof(VR0->SOUNDREGS)); |
| 109 | 106 | |
| 110 | 107 | VR0->stream = stream_create(device, 0, 2, 44100, VR0, VR0_Update); |
| 111 | ||
| 112 | return VR0; | |
| 113 | 108 | } |
| 114 | 109 | |
| 115 | 110 | WRITE32_HANDLER(vr0_snd_write) |
| r4184 | r4185 | |
| 256 | 251 | switch (state) |
| 257 | 252 | { |
| 258 | 253 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 254 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct _VR0Chip); break; | |
| 259 | 255 | |
| 260 | 256 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 261 | 257 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( vrender0 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 488 | 488 | |
| 489 | 489 | static SND_START( multipcm ) |
| 490 | 490 | { |
| 491 | struct _MultiPCM *ptChip; | |
| 491 | struct _MultiPCM *ptChip = device->token; | |
| 492 | 492 | int i; |
| 493 | 493 | |
| 494 | ptChip=(struct _MultiPCM *)auto_malloc(sizeof(struct _MultiPCM)); | |
| 495 | ||
| 496 | 494 | ptChip->ROM=(INT8 *)device->region; |
| 497 | 495 | ptChip->Rate=(float) clock / MULTIPCM_CLOCKDIV; |
| 498 | 496 | |
| r4184 | r4185 | |
| 635 | 633 | } |
| 636 | 634 | |
| 637 | 635 | LFO_Init(); |
| 638 | ||
| 639 | return ptChip; | |
| 640 | 636 | } |
| 641 | 637 | |
| 642 | 638 | |
| r4184 | r4185 | |
| 707 | 703 | switch (state) |
| 708 | 704 | { |
| 709 | 705 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 706 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct _MultiPCM); break; | |
| 710 | 707 | |
| 711 | 708 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 712 | 709 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( multipcm ); break; |
| r4184 | r4185 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | /* build the decoded waveform table */ |
| 108 | static i | |
| 108 | static void | |
| 109 | 109 | { |
| 110 | 110 | INT16 *p; |
| 111 | 111 | int size; |
| r4184 | r4185 | |
| 141 | 141 | for (offset = 0; offset < 256; offset++) |
| 142 | 142 | update_namco_waveform(chip, offset, namco_wavedata[offset]); |
| 143 | 143 | } |
| 144 | ||
| 145 | return 0; | |
| 146 | 144 | } |
| 147 | 145 | |
| 148 | 146 | |
| r4184 | r4185 | |
| 356 | 354 | static SND_START( namco ) |
| 357 | 355 | { |
| 358 | 356 | sound_channel *voice; |
| 359 | const namco_interface *intf = config; | |
| 357 | const namco_interface *intf = device->static_config; | |
| 360 | 358 | int clock_multiple; |
| 361 | struct namco_sound *chip; | |
| 359 | struct namco_sound *chip = device->token; | |
| 362 | 360 | |
| 363 | chip = auto_malloc(sizeof(*chip)); | |
| 364 | memset(chip, 0, sizeof(*chip)); | |
| 365 | ||
| 366 | 361 | /* extract globals from the interface */ |
| 367 | 362 | chip->num_voices = intf->voices; |
| 368 | 363 | chip->last_channel = chip->channel_list + chip->num_voices; |
| r4184 | r4185 | |
| 381 | 376 | logerror("Namco: freq fractional bits = %d: internal freq = %d, output freq = %d\n", chip->f_fracbits, chip->namco_clock, chip->sample_rate); |
| 382 | 377 | |
| 383 | 378 | /* build the waveform table */ |
| 384 | if (build_decoded_waveform(chip, device->region)) | |
| 385 | return NULL; | |
| 379 | build_decoded_waveform(chip, device->region); | |
| 386 | 380 | |
| 387 | 381 | /* get stream channels */ |
| 388 | 382 | if (intf->stereo) |
| r4184 | r4185 | |
| 425 | 419 | state_save_register_device_item(device, voicenum, voice->noise_counter); |
| 426 | 420 | state_save_register_device_item(device, voicenum, voice->waveform_select); |
| 427 | 421 | } |
| 428 | ||
| 429 | return chip; | |
| 430 | 422 | } |
| 431 | 423 | |
| 432 | 424 | |
| r4184 | r4185 | |
| 818 | 810 | switch (state) |
| 819 | 811 | { |
| 820 | 812 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 813 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct namco_sound); break; | |
| 821 | 814 | |
| 822 | 815 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 823 | 816 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( namco ); break; |
| r4184 | r4185 | |
| 852 | 845 | switch (state) |
| 853 | 846 | { |
| 854 | 847 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 848 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct namco_sound); break; | |
| 855 | 849 | |
| 856 | 850 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 857 | 851 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( namco_15xx ); break; |
| r4184 | r4185 | |
| 886 | 880 | switch (state) |
| 887 | 881 | { |
| 888 | 882 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 883 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct namco_sound); break; | |
| 889 | 884 | |
| 890 | 885 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 891 | 886 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( namco_cus30 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 2388 | 2388 | |
| 2389 | 2389 | static SND_START( sn76477 ) |
| 2390 | 2390 | { |
| 2391 | struct SN76477 *sn; | |
| 2391 | struct SN76477 *sn = device->token; | |
| 2392 | 2392 | sn76477_interface *intf; |
| 2393 | 2393 | |
| 2394 | 2394 | |
| 2395 | 2395 | #if TEST_MODE == 0 |
| 2396 | intf = (sn76477_interface *)config; | |
| 2396 | intf = (sn76477_interface *)device->static_config; | |
| 2397 | 2397 | #else |
| 2398 | 2398 | intf = &test_interface; |
| 2399 | 2399 | #endif |
| 2400 | 2400 | |
| 2401 | 2401 | |
| 2402 | sn = auto_malloc(sizeof(*sn)); | |
| 2403 | memset(sn, 0, sizeof(*sn)); | |
| 2404 | ||
| 2405 | 2402 | sn->device = device; |
| 2406 | 2403 | |
| 2407 | 2404 | sn->channel = stream_create(device, 0, 1, device->machine->sample_rate, sn, SN76477_update); |
| r4184 | r4185 | |
| 2417 | 2414 | |
| 2418 | 2415 | intialize_noise(sn); |
| 2419 | 2416 | |
| 2420 | sndintrf_register_token(sn); | |
| 2421 | ||
| 2422 | 2417 | /* set up interface values */ |
| 2423 | 2418 | _SN76477_enable_w(sn, intf->enable); |
| 2424 | 2419 | _SN76477_vco_w(sn, intf->vco); |
| r4184 | r4185 | |
| 2456 | 2451 | |
| 2457 | 2452 | if (LOG_WAV) |
| 2458 | 2453 | open_wav_file(sn); |
| 2459 | ||
| 2460 | return sn; | |
| 2461 | 2454 | } |
| 2462 | 2455 | |
| 2463 | 2456 | |
| r4184 | r4185 | |
| 2474 | 2467 | { |
| 2475 | 2468 | switch (state) |
| 2476 | 2469 | { |
| 2470 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct SN76477); break; | |
| 2477 | 2471 | case SNDINFO_PTR_START: info->start = SND_START_NAME( sn76477 ); break; |
| 2478 | 2472 | case SNDINFO_PTR_STOP: info->stop = SND_STOP_NAME( sn76477 ); break; |
| 2479 | 2473 | case SNDINFO_STR_NAME: strcpy(info->s, "SN76477"); break; |
| r4184 | r4185 | |
|---|---|---|
| 641 | 641 | { |
| 642 | 642 | const vlm5030_interface defintrf = { 0 }; |
| 643 | 643 | int emulation_rate; |
| 644 | struct vlm5030_info *chip; | |
| 644 | struct vlm5030_info *chip = device->token; | |
| 645 | 645 | |
| 646 | chip = auto_malloc(sizeof(*chip)); | |
| 647 | memset(chip, 0, sizeof(*chip)); | |
| 648 | ||
| 649 | 646 | chip->device = device; |
| 650 | chip->intf = (config != NULL) ? config : &defintrf; | |
| 647 | chip->intf = (device->static_config != NULL) ? device->static_config : &defintrf; | |
| 651 | 648 | |
| 652 | 649 | emulation_rate = clock / 440; |
| 653 | 650 | |
| r4184 | r4185 | |
| 689 | 686 | state_save_register_device_item_array(device,0,chip->target_k); |
| 690 | 687 | state_save_register_device_item_array(device,0,chip->x); |
| 691 | 688 | state_save_register_postload(device->machine, vlm5030_restore_state, chip); |
| 692 | ||
| 693 | return chip; | |
| 694 | 689 | } |
| 695 | 690 | |
| 696 | 691 | |
| r4184 | r4185 | |
| 712 | 707 | switch (state) |
| 713 | 708 | { |
| 714 | 709 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 710 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct vlm5030_info); break; | |
| 715 | 711 | |
| 716 | 712 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 717 | 713 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( vlm5030 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 67 | 67 | static SND_START( tms5110 ) |
| 68 | 68 | { |
| 69 | 69 | static const tms5110_interface dummy = { 0 }; |
| 70 | struct tms5110_info *info; | |
| 70 | struct tms5110_info *info = device->token; | |
| 71 | 71 | |
| 72 | info = auto_malloc(sizeof(*info)); | |
| 73 | memset(info, 0, sizeof(*info)); | |
| 74 | info->intf = config ? config : &dummy; | |
| 72 | info->intf = device->static_config ? device->static_config : &dummy; | |
| 75 | 73 | info->table = device->region; |
| 76 | 74 | |
| 77 | 75 | info->chip = tms5110_create(device, TMS5110_IS_5110A); |
| 78 | if (!info->chip) | |
| 79 | return NULL; | |
| 80 | sndintrf_register_token(info); | |
| 76 | assert_always(info->chip != NULL, "Error creating TMS5110 chip"); | |
| 81 | 77 | |
| 82 | 78 | /* initialize a stream */ |
| 83 | 79 | info->stream = stream_create(device, 0, 1, clock / 80, info, tms5110_update); |
| 84 | 80 | |
| 85 | 81 | if (info->table == NULL) |
| 86 | 82 | { |
| 87 | if (info->intf->M0_callback==NULL) | |
| 88 | { | |
| 89 | logerror("\n file: 5110intf.c, SND_START( tms5110 ):\n Missing _mandatory_ 'M0_callback' function pointer in the TMS5110 interface\n This function is used by TMS5110 to call for a single bits\n needed to generate the speech\n Aborting startup...\n"); | |
| 90 | return NULL; | |
| 91 | } | |
| 83 | assert_always(info->intf->M0_callback != NULL, "Missing _mandatory_ 'M0_callback' function pointer in the TMS5110 interface\n This function is used by TMS5110 to call for a single bits\n needed to generate the speech\n Aborting startup...\n"); | |
| 92 | 84 | tms5110_set_M0_callback(info->chip, info->intf->M0_callback ); |
| 93 | 85 | tms5110_set_load_address(info->chip, info->intf->load_address ); |
| 94 | 86 | } |
| r4184 | r4185 | |
| 100 | 92 | |
| 101 | 93 | /* reset the 5110 */ |
| 102 | 94 | tms5110_reset_chip(info->chip); |
| 103 | ||
| 104 | /* request a sound channel */ | |
| 105 | return info; | |
| 106 | 95 | } |
| 107 | 96 | |
| 108 | 97 | static SND_START( tms5100 ) |
| 109 | 98 | { |
| 110 | struct tms5110_info *info = SND_START_CALL( tms5110 ); | |
| 99 | struct tms5110_info *info = device->token; | |
| 100 | SND_START_CALL( tms5110 ); | |
| 111 | 101 | tms5110_set_variant(info->chip, TMS5110_IS_5100); |
| 112 | return info; | |
| 113 | 102 | } |
| 114 | 103 | |
| 115 | 104 | static SND_START( tms5110a ) |
| 116 | 105 | { |
| 117 | struct tms5110_info *info = SND_START_CALL( tms5110 ); | |
| 106 | struct tms5110_info *info = device->token; | |
| 107 | SND_START_CALL( tms5110 ); | |
| 118 | 108 | tms5110_set_variant(info->chip, TMS5110_IS_5110A); |
| 119 | return info; | |
| 120 | 109 | } |
| 121 | 110 | |
| 122 | 111 | static SND_START( cd2801 ) |
| 123 | 112 | { |
| 124 | struct tms5110_info *info = SND_START_CALL( tms5110 ); | |
| 113 | struct tms5110_info *info = device->token; | |
| 114 | SND_START_CALL( tms5110 ); | |
| 125 | 115 | tms5110_set_variant(info->chip, TMS5110_IS_CD2801); |
| 126 | return info; | |
| 127 | 116 | } |
| 128 | 117 | |
| 129 | 118 | static SND_START( tmc0281 ) |
| 130 | 119 | { |
| 131 | struct tms5110_info *info = SND_START_CALL( tms5110 ); | |
| 120 | struct tms5110_info *info = device->token; | |
| 121 | SND_START_CALL( tms5110 ); | |
| 132 | 122 | tms5110_set_variant(info->chip, TMS5110_IS_TMC0281); |
| 133 | return info; | |
| 134 | 123 | } |
| 135 | 124 | |
| 136 | 125 | static SND_START( cd2802 ) |
| 137 | 126 | { |
| 138 | struct tms5110_info *info = SND_START_CALL( tms5110 ); | |
| 127 | struct tms5110_info *info = device->token; | |
| 128 | SND_START_CALL( tms5110 ); | |
| 139 | 129 | tms5110_set_variant(info->chip, TMS5110_IS_CD2802); |
| 140 | return info; | |
| 141 | 130 | } |
| 142 | 131 | |
| 143 | 132 | static SND_START( m58817 ) |
| 144 | 133 | { |
| 145 | struct tms5110_info *info = SND_START_CALL( tms5110 ); | |
| 134 | struct tms5110_info *info = device->token; | |
| 135 | SND_START_CALL( tms5110 ); | |
| 146 | 136 | tms5110_set_variant(info->chip, TMS5110_IS_M58817); |
| 147 | return info; | |
| 148 | 137 | } |
| 149 | 138 | |
| 150 | 139 | |
| r4184 | r4185 | |
| 298 | 287 | switch (state) |
| 299 | 288 | { |
| 300 | 289 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 290 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct tms5110_info); break; | |
| 301 | 291 | case SNDINFO_FCT_ALIAS: info->type = SOUND_TMS5110; break; |
| 302 | 292 | |
| 303 | 293 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| r4184 | r4185 | |
|---|---|---|
| 116 | 116 | }, |
| 117 | 117 | NULL |
| 118 | 118 | }; |
| 119 | const ym2203_interface *intf = config ? config : &generic_2203; | |
| 120 | struct ym2203_info *info; | |
| 119 | const ym2203_interface *intf = device->static_config ? device->static_config : &generic_2203; | |
| 120 | struct ym2203_info *info = device->token; | |
| 121 | 121 | int rate = clock/72; /* ??? */ |
| 122 | 122 | |
| 123 | info = auto_malloc(sizeof(*info)); | |
| 124 | memset(info, 0, sizeof(*info)); | |
| 125 | ||
| 126 | 123 | info->intf = intf; |
| 127 | 124 | info->device = device; |
| 128 | info->psg = ay8910_start_ym(SOUND_YM2203, device, clock, &intf->ay8910_intf); | |
| 129 | if (!info->psg) return NULL; | |
| 125 | info->psg = ay8910_start_ym(NULL, SOUND_YM2203, device, clock, &intf->ay8910_intf); | |
| 126 | assert_always(info->psg != NULL, "Error creating YM2203/AY8910 chip"); | |
| 130 | 127 | |
| 131 | 128 | /* Timer Handler set */ |
| 132 | 129 | info->timer[0] = timer_alloc(device->machine, timer_callback_2203_0, info); |
| r4184 | r4185 | |
| 137 | 134 | |
| 138 | 135 | /* Initialize FM emurator */ |
| 139 | 136 | info->chip = ym2203_init(info,device,clock,rate,timer_handler,IRQHandler,&psgintf); |
| 137 | assert_always(info->chip != NULL, "Error creating YM2203 chip"); | |
| 140 | 138 | |
| 141 | 139 | state_save_register_postload(device->machine, ym2203_intf_postload, info); |
| 142 | ||
| 143 | if (info->chip) | |
| 144 | return info; | |
| 145 | ||
| 146 | /* error */ | |
| 147 | /* stream close */ | |
| 148 | return NULL; | |
| 149 | 140 | } |
| 150 | 141 | |
| 151 | 142 | static SND_STOP( ym2203 ) |
| r4184 | r4185 | |
| 341 | 332 | switch (state) |
| 342 | 333 | { |
| 343 | 334 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 335 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym2203_info); break; | |
| 344 | 336 | |
| 345 | 337 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 346 | 338 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ym2203 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 297 | 297 | { |
| 298 | 298 | static const k007232_interface defintrf = { 0 }; |
| 299 | 299 | int i; |
| 300 | struct kdacApcm *info; | |
| 300 | struct kdacApcm *info = device->token; | |
| 301 | 301 | |
| 302 | info = auto_malloc(sizeof(*info)); | |
| 303 | memset(info, 0, sizeof(*info)); | |
| 302 | info->intf = (device->static_config != NULL) ? device->static_config : &defintrf; | |
| 304 | 303 | |
| 305 | info->intf = (config != NULL) ? config : &defintrf; | |
| 306 | ||
| 307 | 304 | /* Set up the chips */ |
| 308 | 305 | |
| 309 | 306 | info->pcmbuf[0] = device->region; |
| r4184 | r4185 | |
| 329 | 326 | info->stream = stream_create(device,0,2,clock/128,info,KDAC_A_update); |
| 330 | 327 | |
| 331 | 328 | KDAC_A_make_fncode(info); |
| 332 | ||
| 333 | return info; | |
| 334 | 329 | } |
| 335 | 330 | |
| 336 | 331 | /************************************************/ |
| r4184 | r4185 | |
| 492 | 487 | switch (state) |
| 493 | 488 | { |
| 494 | 489 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 490 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct kdacApcm); break; | |
| 495 | 491 | |
| 496 | 492 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 497 | 493 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( k007232 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 184 | 184 | |
| 185 | 185 | static SND_START( okim6258 ) |
| 186 | 186 | { |
| 187 | const okim6258_interface *intf = config; | |
| 188 | struct okim6258 *info; | |
| 187 | const okim6258_interface *intf = device->static_config; | |
| 188 | struct okim6258 *info = device->token; | |
| 189 | 189 | |
| 190 | info = auto_malloc(sizeof(*info)); | |
| 191 | memset(info, 0, sizeof(*info)); | |
| 192 | ||
| 193 | 190 | compute_tables(); |
| 194 | 191 | |
| 195 | 192 | info->master_clock = clock; |
| r4184 | r4185 | |
| 205 | 202 | info->step = 0; |
| 206 | 203 | |
| 207 | 204 | okim6258_state_save_register(info, device); |
| 208 | ||
| 209 | return info; | |
| 210 | 205 | } |
| 211 | 206 | |
| 212 | 207 | |
| r4184 | r4185 | |
| 475 | 470 | switch (state) |
| 476 | 471 | { |
| 477 | 472 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 473 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct okim6258); break; | |
| 478 | 474 | |
| 479 | 475 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 480 | 476 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME(okim6258); break; |
| r4184 | r4185 | |
|---|---|---|
| 227 | 227 | { |
| 228 | 228 | const es5503_interface *intf; |
| 229 | 229 | int osc; |
| 230 | ES5503Chip *chip; | |
| 230 | ES5503Chip *chip = device->token; | |
| 231 | 231 | |
| 232 | chip = auto_malloc(sizeof(*chip)); | |
| 233 | memset(chip, 0, sizeof(*chip)); | |
| 232 | intf = device->static_config; | |
| 234 | 233 | |
| 235 | intf = config; | |
| 236 | ||
| 237 | 234 | chip->irq_callback = intf->irq_callback; |
| 238 | 235 | chip->adc_read = intf->adc_read; |
| 239 | 236 | chip->docram = intf->wave_memory; |
| r4184 | r4185 | |
| 267 | 264 | |
| 268 | 265 | chip->output_rate = (clock/8)/34; // (input clock / 8) / # of oscs. enabled + 2 |
| 269 | 266 | chip->stream = stream_create(device, 0, 2, chip->output_rate, chip, es5503_pcm_update); |
| 270 | ||
| 271 | return chip; | |
| 272 | 267 | } |
| 273 | 268 | |
| 274 | 269 | READ8_HANDLER(es5503_reg_0_r) |
| r4184 | r4185 | |
| 521 | 516 | switch (state) |
| 522 | 517 | { |
| 523 | 518 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 519 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(ES5503Chip); break; | |
| 524 | 520 | |
| 525 | 521 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 526 | 522 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( es5503 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 218 | 218 | |
| 219 | 219 | static SND_START( nile ) |
| 220 | 220 | { |
| 221 | struct nile_info *info; | |
| 221 | struct nile_info *info = device->token; | |
| 222 | 222 | |
| 223 | info = auto_malloc(sizeof(*info)); | |
| 224 | memset(info, 0, sizeof(*info)); | |
| 225 | ||
| 226 | 223 | info->sound_ram = device->region; |
| 227 | 224 | |
| 228 | 225 | info->stream = stream_create(device, 0, 2, 44100, info, nile_update); |
| 229 | ||
| 230 | return info; | |
| 231 | 226 | } |
| 232 | 227 | |
| 233 | 228 | |
| r4184 | r4185 | |
| 250 | 245 | switch (state) |
| 251 | 246 | { |
| 252 | 247 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 248 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct nile_info); break; | |
| 253 | 249 | |
| 254 | 250 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 255 | 251 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( nile ); break; |
| r4184 | r4185 | |
|---|---|---|
| 209 | 209 | |
| 210 | 210 | static SND_START( es8712 ) |
| 211 | 211 | { |
| 212 | struct es8712 *chip; | |
| 212 | struct es8712 *chip = device->token; | |
| 213 | 213 | |
| 214 | chip = auto_malloc(sizeof(*chip)); | |
| 215 | memset(chip, 0, sizeof(*chip)); | |
| 216 | ||
| 217 | 214 | compute_tables(); |
| 218 | 215 | |
| 219 | 216 | chip->start = 0; |
| r4184 | r4185 | |
| 230 | 227 | chip->signal = -2; |
| 231 | 228 | |
| 232 | 229 | es8712_state_save_register(chip, device); |
| 233 | ||
| 234 | /* success */ | |
| 235 | return chip; | |
| 236 | 230 | } |
| 237 | 231 | |
| 238 | 232 | |
| r4184 | r4185 | |
| 450 | 444 | switch (state) |
| 451 | 445 | { |
| 452 | 446 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 447 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct es8712); break; | |
| 453 | 448 | |
| 454 | 449 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 455 | 450 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( es8712 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 670 | 670 | /* INITIALIZE APU SYSTEM */ |
| 671 | 671 | static SND_START( nesapu ) |
| 672 | 672 | { |
| 673 | const nes_interface *intf = config; | |
| 674 | struct nesapu_info *info; | |
| 673 | const nes_interface *intf = device->static_config; | |
| 674 | struct nesapu_info *info = device->token; | |
| 675 | 675 | int rate = clock / 4; |
| 676 | 676 | int i; |
| 677 | 677 | |
| 678 | info = auto_malloc(sizeof(*info)); | |
| 679 | memset(info, 0, sizeof(*info)); | |
| 680 | ||
| 681 | 678 | /* Initialize global variables */ |
| 682 | 679 | info->samps_per_sync = rate / ATTOSECONDS_TO_HZ(video_screen_get_frame_period(device->machine->primary_screen).attoseconds); |
| 683 | 680 | info->buffer_size = info->samps_per_sync; |
| r4184 | r4185 | |
| 751 | 748 | #else |
| 752 | 749 | state_save_register_device_item(device, 0, info->APU.buf_pos); |
| 753 | 750 | #endif |
| 754 | ||
| 755 | return info; | |
| 756 | 751 | } |
| 757 | 752 | |
| 758 | 753 | |
| r4184 | r4185 | |
| 774 | 769 | switch (state) |
| 775 | 770 | { |
| 776 | 771 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 772 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct nesapu_info); break; | |
| 777 | 773 | |
| 778 | 774 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 779 | 775 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( nesapu ); break; |
| r4184 | r4185 | |
|---|---|---|
| 70 | 70 | static SND_START( ymf262 ) |
| 71 | 71 | { |
| 72 | 72 | static const ymf262_interface dummy = { 0 }; |
| 73 | struct ymf262_info *info; | |
| 73 | struct ymf262_info *info = device->token; | |
| 74 | 74 | int rate = clock/288; |
| 75 | 75 | |
| 76 | info = auto_malloc(sizeof(*info)); | |
| 77 | memset(info, 0, sizeof(*info)); | |
| 78 | ||
| 79 | info->intf = config ? config : &dummy; | |
| 76 | info->intf = device->static_config ? device->static_config : &dummy; | |
| 80 | 77 | info->device = device; |
| 81 | 78 | |
| 82 | 79 | /* stream system initialize */ |
| 83 | 80 | info->chip = ymf262_init(device,clock,rate); |
| 84 | if (info->chip == NULL) | |
| 85 | return NULL; | |
| 81 | assert_always(info->chip != NULL, "Error creating YMF262 chip"); | |
| 86 | 82 | |
| 87 | 83 | info->stream = stream_create(device,0,4,rate,info,ymf262_stream_update); |
| 88 | 84 | |
| r4184 | r4185 | |
| 93 | 89 | |
| 94 | 90 | info->timer[0] = timer_alloc(device->machine, timer_callback_262_0, info); |
| 95 | 91 | info->timer[1] = timer_alloc(device->machine, timer_callback_262_1, info); |
| 96 | ||
| 97 | return info; | |
| 98 | 92 | } |
| 99 | 93 | |
| 100 | 94 | static SND_STOP( ymf262 ) |
| r4184 | r4185 | |
| 173 | 167 | switch (state) |
| 174 | 168 | { |
| 175 | 169 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 170 | case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ymf262_info); break; | |
| 176 | 171 | |
| 177 | 172 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 178 | 173 | case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( ymf262 ); break; |
| r4184 | r4185 | |
|---|---|---|
| 37 | 37 | typedef struct _sndintrf_data sndintrf_data; |
| 38 | 38 | struct _sndintrf_data |
| 39 | 39 | { |
| 40 | snd_class_header intf; /* copy of the interface data */ | |
| 41 | 40 | sound_type sndtype; /* type index of this sound chip */ |
| 42 | 41 | sound_type aliastype; /* aliased type index of this sound chip */ |
| 43 | 42 | device_config * device; /* dummy device for now */ |
| r4184 | r4185 | |
| 66 | 65 | ***************************************************************************/ |
| 67 | 66 | |
| 68 | 67 | static sndintrf_data sound[MAX_SOUND]; |
| 69 | static sndintrf_data *current_sound_start; | |
| 70 | 68 | static int totalsnd; |
| 71 | 69 | |
| 72 | 70 | |
| r4184 | r4185 | |
| 97 | 95 | static DEVICE_GET_INFO( sndclass ) |
| 98 | 96 | { |
| 99 | 97 | sndintrf_data *snddata = device->inline_config; |
| 100 | (*snddata-> | |
| 98 | (*snddata->sndtyp | |
| 101 | 99 | } |
| 102 | 100 | |
| 103 | 101 | int sndintrf_init_sound(running_machine *machine, int sndnum, const char *tag, sound_type sndtype, int clock, const void *config) |
| 104 | 102 | { |
| 105 | 103 | snd_start_func start; |
| 106 | 104 | sndintrf_data *info = &sound[sndnum]; |
| 105 | int tokenbytes; | |
| 107 | 106 | int index; |
| 108 | 107 | int sndidx; |
| 109 | 108 | |
| r4184 | r4185 | |
| 120 | 119 | info->device->inline_config = info; |
| 121 | 120 | |
| 122 | 121 | /* fill in the type and interface */ |
| 123 | info->intf.get_info = sndtype; | |
| 124 | info->intf.set_info = (snd_set_info_func)sndtype_get_info_fct(sndtype, SNDINFO_PTR_SET_INFO); | |
| 125 | 122 | info->sndtype = sndtype; |
| 126 | 123 | info->aliastype = (sound_type)sndtype_get_info_fct(sndtype, SNDINFO_FCT_ALIAS); |
| 127 | 124 | if (info->aliastype == 0) |
| r4184 | r4185 | |
| 135 | 132 | info->index = index; |
| 136 | 133 | totalsnd++; |
| 137 | 134 | |
| 135 | /* allocate the token */ | |
| 136 | tokenbytes = sndtype_get_info_int(sndtype, DEVINFO_INT_TOKEN_BYTES); | |
| 137 | assert(tokenbytes != 0); | |
| 138 | info->device->token = auto_malloc(tokenbytes); | |
| 139 | memset(info->device->token, 0, tokenbytes); | |
| 140 | ||
| 138 | 141 | /* start the chip, tagging all its streams */ |
| 139 | current_sound_start = &sound[sndnum]; | |
| 140 | 142 | start = (snd_start_func)sndtype_get_info_fct(sndtype, SNDINFO_PTR_START); |
| 141 | info->device->token = (*start)(info->device, clock, config); | |
| 142 | current_sound_start = NULL; | |
| 143 | (*start)(info->device, clock); | |
| 143 | 144 | VPRINTF((" token = %p\n", info->device->token)); |
| 144 | 145 | |
| 145 | /* if that failed, die */ | |
| 146 | if (info->device->token == NULL) | |
| 147 | return 1; | |
| 148 | ||
| 149 | 146 | return 0; |
| 150 | 147 | } |
| 151 | 148 | |
| r4184 | r4185 | |
| 160 | 157 | sndinfo info; |
| 161 | 158 | |
| 162 | 159 | info.stop = NULL; |
| 163 | (*sound[sndnum]. | |
| 160 | (*sound[sndnum].sndtyp | |
| 164 | 161 | |
| 165 | 162 | /* stop the chip */ |
| 166 | 163 | if (info.stop) |
| r4184 | r4185 | |
| 174 | 171 | ***************************************************************************/ |
| 175 | 172 | |
| 176 | 173 | /*------------------------------------------------- |
| 177 | sndintrf_register_token - register a token | |
| 178 | from within the sound_start routine | |
| 179 | -------------------------------------------------*/ | |
| 180 | ||
| 181 | void sndintrf_register_token(void *token) | |
| 182 | { | |
| 183 | if (current_sound_start) | |
| 184 | current_sound_start->device->token = token; | |
| 185 | } | |
| 186 | ||
| 187 | ||
| 188 | /*------------------------------------------------- | |
| 189 | 174 | sndti_exists - return TRUE if a (type,index) |
| 190 | 175 | pair describes an existing chip |
| 191 | 176 | -------------------------------------------------*/ |
| r4184 | r4185 | |
| 258 | 243 | |
| 259 | 244 | VERIFY_SNDNUM(sndnum_get_info_int); |
| 260 | 245 | info.i = 0; |
| 261 | (*sound[sndnum]. | |
| 246 | (*sound[sndnum].sndtyp | |
| 262 | 247 | return info.i; |
| 263 | 248 | } |
| 264 | 249 | |
| r4184 | r4185 | |
| 268 | 253 | |
| 269 | 254 | VERIFY_SNDNUM(sndnum_get_info_ptr); |
| 270 | 255 | info.p = NULL; |
| 271 | (*sound[sndnum]. | |
| 256 | (*sound[sndnum].sndtyp | |
| 272 | 257 | return info.p; |
| 273 | 258 | } |
| 274 | 259 | |
| r4184 | r4185 | |
| 278 | 263 | |
| 279 | 264 | VERIFY_SNDNUM(sndnum_get_info_fct); |
| 280 | 265 | info.f = NULL; |
| 281 | (*sound[sndnum]. | |
| 266 | (*sound[sndnum].sndtyp | |
| 282 | 267 | return info.f; |
| 283 | 268 | } |
| 284 | 269 | |
| r4184 | r4185 | |
| 289 | 274 | |
| 290 | 275 | VERIFY_SNDNUM(sndnum_get_info_string); |
| 291 | 276 | info.s = get_temp_string_buffer(); |
| 292 | (*sound[sndnum]. | |
| 277 | (*sound[sndnum].sndtyp | |
| 293 | 278 | return info.s; |
| 294 | 279 | } |
| 295 | 280 | |
| 296 | 281 | |
| 297 | 282 | /*------------------------------------------------- |
| 298 | Set info accessors | |
| 299 | -------------------------------------------------*/ | |
| 300 | ||
| 301 | void sndnum_set_info_int(int sndnum, UINT32 state, INT64 data) | |
| 302 | { | |
| 303 | sndinfo info; | |
| 304 | VERIFY_SNDNUM(sndnum_set_info_int); | |
| 305 | info.i = data; | |
| 306 | (*sound[sndnum].intf.set_info)(sound[sndnum].device, state, &info); | |
| 307 | } | |
| 308 | ||
| 309 | void sndnum_set_info_ptr(int sndnum, UINT32 state, void *data) | |
| 310 | { | |
| 311 | sndinfo info; | |
| 312 | VERIFY_SNDNUM(sndnum_set_info_ptr); | |
| 313 | info.p = data; | |
| 314 | (*sound[sndnum].intf.set_info)(sound[sndnum].device, state, &info); | |
| 315 | } | |
| 316 | ||
| 317 | void sndnum_set_info_fct(int sndnum, UINT32 state, genf *data) | |
| 318 | { | |
| 319 | sndinfo info; | |
| 320 | VERIFY_SNDNUM(sndnum_set_info_ptr); | |
| 321 | info.f = data; | |
| 322 | (*sound[sndnum].intf.set_info)(sound[sndnum].device, state, &info); | |
| 323 | } | |
| 324 | ||
| 325 | ||
| 326 | /*------------------------------------------------- | |
| 327 | 283 | Misc accessors |
| 328 | 284 | -------------------------------------------------*/ |
| 329 | 285 | |
| r4184 | r4185 | |
| 333 | 289 | |
| 334 | 290 | VERIFY_SNDNUM(sndnum_reset); |
| 335 | 291 | info.reset = NULL; |
| 336 | (*sound[sndnum]. | |
| 292 | (*sound[sndnum].sndtyp | |
| 337 | 293 | if (info.reset) |
| 338 | 294 | (info.reset)(sound[sndnum].device); |
| 339 | 295 | } |
| r4184 | r4185 | |
| 366 | 322 | |
| 367 | 323 | VERIFY_SNDTI(sndti_get_info_int); |
| 368 | 324 | info.i = 0; |
| 369 | (*sound[sndnum]. | |
| 325 | (*sound[sndnum].sndtyp | |
| 370 | 326 | return info.i; |
| 371 | 327 | } |
| 372 | 328 | |
| r4184 | r4185 | |
| 376 | 332 | |
| 377 | 333 | VERIFY_SNDTI(sndti_get_info_ptr); |
| 378 | 334 | info.p = NULL; |
| 379 | (*sound[sndnum]. | |
| 335 | (*sound[sndnum].sndtyp | |
| 380 | 336 | return info.p; |
| 381 | 337 | } |
| 382 | 338 | |
| r4184 | r4185 | |
| 386 | 342 | |
| 387 | 343 | VERIFY_SNDTI(sndti_get_info_fct); |
| 388 | 344 | info.f = NULL; |
| 389 | (*sound[sndnum]. | |
| 345 | (*sound[sndnum].sndtyp | |
| 390 | 346 | return info.f; |
| 391 | 347 | } |
| 392 | 348 | |
| r4184 | r4185 | |
| 397 | 353 | |
| 398 | 354 | VERIFY_SNDTI(sndti_get_info_string); |
| 399 | 355 | info.s = get_temp_string_buffer(); |
| 400 | (*sound[sndnum]. | |
| 356 | (*sound[sndnum].sndtyp | |
| 401 | 357 | return info.s; |
| 402 | 358 | } |
| 403 | 359 | |
| 404 | 360 | |
| 405 | 361 | /*------------------------------------------------- |
| 406 | Set info accessors | |
| 407 | -------------------------------------------------*/ | |
| 408 | ||
| 409 | void sndti_set_info_int(sound_type sndtype, int sndindex, UINT32 state, INT64 data) | |
| 410 | { | |
| 411 | sndinfo info; | |
| 412 | ||
| 413 | VERIFY_SNDTI(sndti_set_info_int); | |
| 414 | info.i = data; | |
| 415 | (*sound[sndnum].intf.set_info)(sound[sndnum].device, state, &info); | |
| 416 | } | |
| 417 | ||
| 418 | void sndti_set_info_ptr(sound_type sndtype, int sndindex, UINT32 state, void *data) | |
| 419 | { | |
| 420 | sndinfo info; | |
| 421 | ||
| 422 | VERIFY_SNDTI(sndti_set_info_ptr); | |
| 423 | info.p = data; | |
| 424 | (*sound[sndnum].intf.set_info)(sound[sndnum].device, state, &info); | |
| 425 | } | |
| 426 | ||
| 427 | void sndti_set_info_fct(sound_type sndtype, int sndindex, UINT32 state, genf *data) | |
| 428 | { | |
| 429 | sndinfo info; | |
| 430 | ||
| 431 | VERIFY_SNDTI(sndti_set_info_ptr); | |
| 432 | info.f = data; | |
| 433 | (*sound[sndnum].intf.set_info)(sound[sndnum].device, state, &info); | |
| 434 | } | |
| 435 | ||
| 436 | ||
| 437 | /*------------------------------------------------- | |
| 438 | 362 | Misc accessors |
| 439 | 363 | -------------------------------------------------*/ |
| 440 | 364 | |
| r4184 | r4185 | |
| 444 | 368 | |
| 445 | 369 | VERIFY_SNDTI(sndti_reset); |
| 446 | 370 | info.reset = NULL; |
| 447 | (*sound[sndnum]. | |
| 371 | (*sound[sndnum].sndtyp | |
| 448 | 372 | |
| 449 | 373 | if (info.reset) |
| 450 | 374 | (*info.reset)(sound[sndnum].device); |
| r4184 | r4185 | |
|---|---|---|
| 821 | 821 | /* copy in all the relevant info */ |
| 822 | 822 | info->speaker = device->inline_config; |
| 823 | 823 | info->tag = device->tag; |
| 824 | ||
| 825 | return DEVICE_START_OK; | |
| 826 | 824 | } |
| 827 | 825 | |
| 828 | 826 |
| r4184 | r4185 | |
|---|---|---|
| 32 | 32 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 33 | 33 | SNDINFO_INT_FIRST = DEVINFO_INT_FIRST, |
| 34 | 34 | |
| 35 | SNDINFO_INT_TOKEN_BYTES = DEVINFO_INT_TOKEN_BYTES, /* R/O: bytes to allocate for the token */ | |
| 36 | ||
| 35 | 37 | SNDINFO_INT_CORE_SPECIFIC = DEVINFO_INT_DEVICE_SPECIFIC, /* R/W: core-specific values start here */ |
| 36 | 38 | |
| 37 | 39 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| r4184 | r4185 | |
| 42 | 44 | /* --- the following bits of info are returned as pointers to functions --- */ |
| 43 | 45 | SNDINFO_FCT_FIRST = DEVINFO_FCT_FIRST, |
| 44 | 46 | |
| 47 | SNDINFO_PTR_START = DEVINFO_FCT_START, /* R/O: void *(*start)(const device_config *device, int clock) */ | |
| 45 | 48 | SNDINFO_PTR_STOP = DEVINFO_FCT_STOP, /* R/O: void (*stop)(const device_config *device) */ |
| 46 | 49 | SNDINFO_PTR_RESET = DEVINFO_FCT_RESET, /* R/O: void (*reset)(const device_config *device) */ |
| 47 | 50 | |
| 48 | 51 | SNDINFO_PTR_SET_INFO = DEVINFO_FCT_CLASS_SPECIFIC, /* R/O: void (*set_info)(const device_config *device, UINT32 state, sndinfo *info) */ |
| 49 | SNDINFO_PTR_START, /* R/O: void *(*start)(const device_config *device, int clock, const void *config) */ | |
| 50 | 52 | SNDINFO_FCT_ALIAS, /* R/O: alias to sound type for (type,index) identification */ |
| 51 | 53 | |
| 52 | 54 | SNDINFO_FCT_CORE_SPECIFIC = DEVINFO_FCT_DEVICE_SPECIFIC, /* R/W: core-specific values start here */ |
| r4184 | r4185 | |
| 78 | 80 | #define SND_SET_INFO_CALL(name) SND_SET_INFO_NAME(name)(device, state, info) |
| 79 | 81 | |
| 80 | 82 | #define SND_START_NAME(name) snd_start_##name |
| 81 | #define SND_START(name) void *SND_START_NAME(name)(const device_config *device, int clock, const void *config) | |
| 82 | #define SND_START_CALL(name) SND_START_NAME(name)(device, clock, config) | |
| 83 | #define SND_START(name) void SND_START_NAME(name)(const device_config *device, int clock) | |
| 84 | #define SND_START_CALL(name) SND_START_NAME(name)(device, clock) | |
| 83 | 85 | |
| 84 | 86 | #define SND_STOP_NAME(name) snd_stop_##name |
| 85 | 87 | #define SND_STOP(name) void SND_STOP_NAME(name)(const device_config *device) |
| r4184 | r4185 | |
| 101 | 103 | /* define the various callback functions */ |
| 102 | 104 | typedef void (*snd_get_info_func)(const device_config *device, UINT32 state, sndinfo *info); |
| 103 | 105 | typedef void (*snd_set_info_func)(const device_config *device, UINT32 state, sndinfo *info); |
| 104 | typedef void | |
| 106 | typedef void | |
| 105 | 107 | typedef void (*snd_stop_func)(const device_config *device); |
| 106 | 108 | typedef void (*snd_reset_func)(const device_config *device); |
| 107 | 109 | |
| r4184 | r4185 | |
| 123 | 125 | snd_reset_func reset; /* SNDINFO_PTR_RESET */ |
| 124 | 126 | }; |
| 125 | 127 | |
| 126 | typedef struct _snd_class_header snd_class_header; | |
| 127 | struct _snd_class_header | |
| 128 | { | |
| 129 | /* table of core functions */ | |
| 130 | snd_get_info_func get_info; | |
| 131 | snd_set_info_func set_info; | |
| 132 | }; | |
| 133 | 128 | |
| 134 | 129 | |
| 135 | 130 | /*************************************************************************** |
| r4184 | r4185 | |
| 170 | 165 | genf *sndti_get_info_fct(sound_type sndtype, int sndindex, UINT32 state); |
| 171 | 166 | const char *sndti_get_info_string(sound_type sndtype, int sndindex, UINT32 state); |
| 172 | 167 | |
| 173 | /* set info accessors */ | |
| 174 | void sndti_set_info_int(sound_type sndtype, int sndindex, UINT32 state, INT64 data); | |
| 175 | void sndti_set_info_ptr(sound_type sndtype, int sndindex, UINT32 state, void *data); | |
| 176 | void sndti_set_info_fct(sound_type sndtype, int sndindex, UINT32 state, genf *data); | |
| 177 | ||
| 178 | 168 | #define sndti_get_name(sndtype, sndindex) sndti_get_info_string(sndtype, sndindex, SNDINFO_STR_NAME) |
| 179 | 169 | #define sndti_get_core_family(sndtype, sndindex) sndti_get_info_string(sndtype, sndindex, SNDINFO_STR_CORE_FAMILY) |
| 180 | 170 | #define sndti_get_core_version(sndtype, sndindex) sndti_get_info_string(sndtype, sndindex, SNDINFO_STR_CORE_VERSION) |
| r4184 | r4185 | |
| 217 | 207 | void sndintrf_init(running_machine *machine); |
| 218 | 208 | int sndintrf_init_sound(running_machine *machine, int sndnum, const char *tag, sound_type sndtype, int clock, const void *config); |
| 219 | 209 | void sndintrf_exit_sound(int sndnum); |
| 220 | void sndintrf_register_token(void *token); | |
| 221 | 210 | |
| 222 | 211 | /* Misc helpers */ |
| 223 | 212 | int sndti_exists(sound_type sndtype, int sndindex); |
| r4184 | r4185 | |
|---|---|---|
| 569 | 569 | /* generate the header */ |
| 570 | 570 | memcpy(&header[0], ss_magic_num, 8); |
| 571 | 571 | header[8] = SAVE_VERSION; |
| 572 | #ifdef LSB_FIRST | |
| 573 | header[9] = 0; | |
| 574 | #else | |
| 575 | header[9] = SS_MSB_FIRST; | |
| 576 | #endif | |
| 572 | header[9] = NATIVE_ENDIAN_VALUE_LE_BE(0, SS_MSB_FIRST); | |
| 577 | 573 | strncpy((char *)&header[0x0a], machine->gamedrv->name, 0x1c - 0x0a); |
| 578 | 574 | *(UINT32 *)&header[0x1c] = LITTLE_ENDIANIZE_INT32(signature); |
| 579 | 575 | |
| r4184 | r4185 | |
| 629 | 625 | return STATERR_INVALID_HEADER; |
| 630 | 626 | |
| 631 | 627 | /* determine whether or not to flip the data when done */ |
| 632 | #ifdef LSB_FIRST | |
| 633 | flip = ((header[9] & SS_MSB_FIRST) != 0); | |
| 634 | #else | |
| 635 | flip = ((header[9] & SS_MSB_FIRST) == 0); | |
| 636 | #endif | |
| 628 | flip = NATIVE_ENDIAN_VALUE_LE_BE((header[9] & SS_MSB_FIRST) != 0, (header[9] & SS_MSB_FIRST) == 0); | |
| 637 | 629 | |
| 638 | 630 | /* read all the data, flipping if necessary */ |
| 639 | 631 | for (entry = global->entrylist; entry != NULL; entry = entry->next) |
| r4184 | r4185 | |
|---|---|---|
| 1269 | 1269 | fatalerror("Unknown timer device type"); |
| 1270 | 1270 | break; |
| 1271 | 1271 | } |
| 1272 | ||
| 1273 | return DEVICE_START_OK; | |
| 1274 | 1272 | } |
| 1275 | 1273 | |
| 1276 | 1274 |
| r4184 | r4185 | |
|---|---|---|
| 111 | 111 | XTAL_20_079MHz = 20790000, /* Blockade-hardware Gremlin games */ |
| 112 | 112 | XTAL_21MHz = 21000000, /* Lock-On pixel clock */ |
| 113 | 113 | XTAL_21_3MHz = 21300000, |
| 114 | XTAL_21_477MHz = 21477000, /* Super Othello */ | |
| 114 | 115 | XTAL_21_4772MHz = 21477200, /* BMC bowling, some Data East 90's games */ |
| 115 | 116 | XTAL_22MHz = 22000000, |
| 116 | 117 | XTAL_22_1184MHz = 22118400, |
| r4184 | r4185 | |
|---|---|---|
| 613 | 613 | UINT32 regionlength = memory_region_length(romdata->machine, rgntag); |
| 614 | 614 | UINT32 regionflags = memory_region_flags(romdata->machine, rgntag); |
| 615 | 615 | UINT8 *regionbase = memory_region(romdata->machine, rgntag); |
| 616 | int | |
| 616 | int | |
| 617 | 617 | int datawidth = 1 << ((regionflags & ROMREGION_WIDTHMASK) >> 8); |
| 618 | 618 | UINT8 *base; |
| 619 | 619 | int i, j; |
| 620 | 620 | |
| 621 | LOG(("+ datawidth=%d little=%d\n", datawidth, | |
| 621 | LOG(("+ datawidth=%d little=%d\n", datawidth, | |
| 622 | 622 | |
| 623 | 623 | /* if the region is inverted, do that now */ |
| 624 | 624 | if (regionflags & ROMREGION_INVERTMASK) |
| r4184 | r4185 | |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | /* swap the endianness if we need to */ |
| 632 | #ifdef LSB_FIRST | |
| 633 | if (datawidth > 1 && !littleendian) | |
| 634 | #else | |
| 635 | if (datawidth > 1 && littleendian) | |
| 636 | #endif | |
| 632 | if (datawidth > 1 && endianness != ENDIANNESS_NATIVE) | |
| 637 | 633 | { |
| 638 | 634 | LOG(("+ Byte swapping region\n")); |
| 639 | 635 | for (i = 0, base = regionbase; i < regionlength; i += datawidth) |
| r4184 | r4185 | |
|---|---|---|
| 159 | 159 | state_save_register_device_item(device, 0, lmc1992->fader_lf); |
| 160 | 160 | state_save_register_device_item(device, 0, lmc1992->fader_rr); |
| 161 | 161 | state_save_register_device_item(device, 0, lmc1992->fader_lr); |
| 162 | return DEVICE_START_OK; | |
| 163 | 162 | } |
| 164 | 163 | |
| 165 | 164 | static DEVICE_SET_INFO( lmc1992 ) |
| r4184 | r4185 | |
|---|---|---|
| 698 | 698 | state_save_register_item( device->machine, "mea8000", device->tag, 0, mea8000->last_pitch ); |
| 699 | 699 | state_save_register_item( device->machine, "mea8000", device->tag, 0, mea8000->pitch ); |
| 700 | 700 | state_save_register_item( device->machine, "mea8000", device->tag, 0, mea8000->noise ); |
| 701 | return DEVICE_START_OK; | |
| 702 | 701 | } |
| 703 | 702 | |
| 704 | 703 |
| r4184 | r4185 | |
|---|---|---|
| 149 | 149 | state_save_register_device_item(device, 0, cdp1863->latch); |
| 150 | 150 | state_save_register_device_item(device, 0, cdp1863->signal); |
| 151 | 151 | state_save_register_device_item(device, 0, cdp1863->incr); |
| 152 | ||
| 153 | return DEVICE_START_OK; | |
| 154 | 152 | } |
| 155 | 153 | |
| 156 | 154 | static DEVICE_RESET( cdp1863 ) |
| r4184 | r4185 | |
|---|---|---|
| 531 | 531 | |
| 532 | 532 | state_save_register_item(device->machine, "I8275", device->tag, 0, i8275->burst_space_code); |
| 533 | 533 | state_save_register_item(device->machine, "I8275", device->tag, 0, i8275->burst_count_code); |
| 534 | return DEVICE_START_OK; | |
| 535 | 534 | } |
| 536 | 535 | |
| 537 | 536 | static DEVICE_RESET( i8275 ) |
| r4184 | r4185 | |
|---|---|---|
| 151 | 151 | state_save_register_device_item(device, 0, cdp1862->bgcolor); |
| 152 | 152 | state_save_register_device_item(device, 0, cdp1862->con); |
| 153 | 153 | state_save_register_device_item_bitmap(device, 0, cdp1862->bitmap); |
| 154 | ||
| 155 | return DEVICE_START_OK; | |
| 156 | 154 | } |
| 157 | 155 | |
| 158 | 156 | static DEVICE_RESET( cdp1862 ) |
| r4184 | r4185 | |
|---|---|---|
| 813 | 813 | static DEVICE_START( crtc_ega ) |
| 814 | 814 | { |
| 815 | 815 | common_start(device, TYPE_CRTC_EGA); |
| 816 | return DEVICE_START_OK; | |
| 817 | 816 | } |
| 818 | 817 | |
| 819 | 818 |
| r4184 | r4185 | |
|---|---|---|
| 265 | 265 | state_save_register_item(device->machine, "zx8301", device->tag, 0, zx8301->flash); |
| 266 | 266 | state_save_register_item(device->machine, "zx8301", device->tag, 0, zx8301->vsync); |
| 267 | 267 | state_save_register_item(device->machine, "zx8301", device->tag, 0, zx8301->vda); |
| 268 | ||
| 269 | return DEVICE_START_OK; | |
| 270 | 268 | } |
| 271 | 269 | |
| 272 | 270 | static DEVICE_RESET( zx8301 ) |
| r4184 | r4185 | |
|---|---|---|
| 374 | 374 | |
| 375 | 375 | state_save_register_device_item(device, 0, msm6255->cursor); |
| 376 | 376 | state_save_register_device_item(device, 0, msm6255->frame); |
| 377 | return DEVICE_START_OK; | |
| 378 | 377 | } |
| 379 | 378 | |
| 380 | 379 | static DEVICE_RESET( msm6255 ) |
| r4184 | r4185 | |
|---|---|---|
| 395 | 395 | state_save_register_device_item(device, 0, cdp1864->incr); |
| 396 | 396 | |
| 397 | 397 | state_save_register_bitmap(device->machine, "cdp1864", device->tag, 0, "cdp1864->bitmap", cdp1864->bitmap); |
| 398 | return DEVICE_START_OK; | |
| 399 | 398 | } |
| 400 | 399 | |
| 401 | 400 | static DEVICE_RESET( cdp1864 ) |
| r4184 | r4185 | |
|---|---|---|
| 133 | 133 | state_save_register_item(device->machine, "dl1416", device->tag, 0, dl1416->cursor_enable); |
| 134 | 134 | state_save_register_item(device->machine, "dl1416", device->tag, 0, dl1416->write_enable); |
| 135 | 135 | state_save_register_item_array(device->machine, "dl1416", device->tag, 0, dl1416->cursor_ram); |
| 136 | ||
| 137 | return DEVICE_START_OK; | |
| 138 | 136 | } |
| 139 | 137 | |
| 140 | 138 |
| r4184 | r4185 | |
|---|---|---|
| 216 | 216 | state_save_register_device_item(device, 0, cdp1861->disp); |
| 217 | 217 | state_save_register_device_item(device, 0, cdp1861->dmaout); |
| 218 | 218 | state_save_register_device_item_bitmap(device, 0, cdp1861->bitmap); |
| 219 | ||
| 220 | return DEVICE_START_OK; | |
| 221 | 219 | } |
| 222 | 220 | |
| 223 | 221 | static DEVICE_RESET( cdp1861 ) |
| r4184 | r4185 | |
|---|---|---|
| 181 | 181 | |
| 182 | 182 | static DEVICE_START(mess_device) |
| 183 | 183 | { |
| 184 | device_start_err err = DEVICE_START_OK; | |
| 185 | ||
| 186 | 184 | mess_device_config *mess_device = (mess_device_config *) device->inline_config; |
| 187 | 185 | mess_device_token *token = (mess_device_token *) device->token; |
| 188 | 186 | device_start_func inner_start; |
| r4184 | r4185 | |
| 193 | 191 | /* if present, invoke the start handler */ |
| 194 | 192 | inner_start = (device_start_func) mess_device_get_info_fct(&mess_device->io_device.devclass, MESS_DEVINFO_PTR_START); |
| 195 | 193 | if (inner_start != NULL) |
| 196 | err = (*inner_start)(device); | |
| 197 | ||
| 198 | return err; | |
| 194 | (*inner_start)(device); | |
| 199 | 195 | } |
| 200 | 196 | |
| 201 | 197 |
| r4184 | r4185 | |
|---|---|---|
| 372 | 372 | |
| 373 | 373 | DEVICE_START( pdp1_tape ) |
| 374 | 374 | { |
| 375 | return DEVICE_START_OK; | |
| 376 | 375 | } |
| 377 | 376 | |
| 378 | 377 |
| r4184 | r4185 | |
|---|---|---|
| 643 | 643 | static DEVICE_START(oldfdc) |
| 644 | 644 | { |
| 645 | 645 | applefdc_start(device, APPLEFDC_APPLE2); |
| 646 | return DEVICE_START_OK; | |
| 647 | 646 | } |
| 648 | 647 | |
| 649 | 648 | |
| r4184 | r4185 | |
| 677 | 676 | static DEVICE_START(iwm) |
| 678 | 677 | { |
| 679 | 678 | applefdc_start(device, APPLEFDC_IWM); |
| 680 | return DEVICE_START_OK; | |
| 681 | 679 | } |
| 682 | 680 | |
| 683 | 681 | |
| r4184 | r4185 | |
| 711 | 709 | static DEVICE_START(swim) |
| 712 | 710 | { |
| 713 | 711 | applefdc_start(device, APPLEFDC_SWIM); |
| 714 | return DEVICE_START_OK; | |
| 715 | 712 | } |
| 716 | 713 | |
| 717 | 714 |
| r4184 | r4185 | |
|---|---|---|
| 835 | 835 | state_save_register_device_item(device, 0, conkort->fdc_irq); |
| 836 | 836 | |
| 837 | 837 | astring_free(tempstring); |
| 838 | ||
| 839 | return DEVICE_START_OK; | |
| 840 | 838 | } |
| 841 | 839 | |
| 842 | 840 | static DEVICE_RESET( luxor_55_10828 ) |
| r4184 | r4185 | |
| 903 | 901 | state_save_register_device_item(device, 0, conkort->fdc_irq); |
| 904 | 902 | |
| 905 | 903 | astring_free(tempstring); |
| 906 | ||
| 907 | return DEVICE_START_OK; | |
| 908 | 904 | } |
| 909 | 905 | |
| 910 | 906 | static DEVICE_RESET( luxor_55_21046 ) |
| r4184 | r4185 | |
|---|---|---|
| 1078 | 1078 | static DEVICE_START( hp48_port ) |
| 1079 | 1079 | { |
| 1080 | 1080 | hp48_unfill_port( device ); |
| 1081 | return DEVICE_START_OK; | |
| 1082 | 1081 | } |
| 1083 | 1082 | |
| 1084 | 1083 | DEVICE_GET_INFO( hp48_port ) |
| r4184 | r4185 | |
|---|---|---|
| 96 | 96 | { |
| 97 | 97 | token->slot_device = NULL; |
| 98 | 98 | } |
| 99 | return DEVICE_START_OK; | |
| 100 | 99 | } |
| 101 | 100 | |
| 102 | 101 |
| r4184 | r4185 | |
|---|---|---|
| 76 | 76 | |
| 77 | 77 | static DEVICE_START(mockingboard) |
| 78 | 78 | { |
| 79 | return DEVICE_START_OK; | |
| 80 | 79 | } |
| 81 | 80 | |
| 82 | 81 |
| r4184 | r4185 | |
|---|---|---|
| 440 | 440 | #if NCR5380_DEVICE_CONVERSION |
| 441 | 441 | static DEVICE_START( ncr5380 ) |
| 442 | 442 | { |
| 443 | return DEVICE_START_OK; | |
| 444 | 443 | } |
| 445 | 444 | |
| 446 | 445 |
| r4184 | r4185 | |
|---|---|---|
| 87 | 87 | IMPLEMENTATION |
| 88 | 88 | ***************************************************************************/ |
| 89 | 89 | |
| 90 | static | |
| 90 | static | |
| 91 | 91 | { |
| 92 | 92 | at45dbxx_t *flash = get_token(device); |
| 93 | 93 | |
| r4184 | r4185 | |
| 114 | 114 | state_save_register_item(device->machine, "at45dbxx", device->tag, 0, flash->pin.wp); |
| 115 | 115 | state_save_register_item(device->machine, "at45dbxx", device->tag, 0, flash->pin.reset); |
| 116 | 116 | state_save_register_item(device->machine, "at45dbxx", device->tag, 0, flash->pin.busy); |
| 117 | return DEVICE_START_OK; | |
| 118 | 117 | } |
| 119 | 118 | |
| 120 | 119 | static DEVICE_START( at45db041 ) |
| 121 | 120 | { |
| 122 | | |
| 121 | | |
| 123 | 122 | } |
| 124 | 123 | |
| 125 | 124 | static DEVICE_START( at45db081 ) |
| 126 | 125 | { |
| 127 | | |
| 126 | | |
| 128 | 127 | } |
| 129 | 128 | |
| 130 | 129 | static DEVICE_START( at45db161 ) |
| 131 | 130 | { |
| 132 | | |
| 131 | | |
| 133 | 132 | } |
| 134 | 133 | |
| 135 | 134 | static DEVICE_RESET( at45dbxx ) |
| r4184 | r4185 | |
|---|---|---|
| 35 | 35 | DEVICE_START(d88image_floppy) |
| 36 | 36 | { |
| 37 | 37 | floppy_drive_init(device, &d88image_floppy_interface); |
| 38 | return DEVICE_START_OK; | |
| 39 | 38 | } |
| 40 | 39 | |
| 41 | 40 | /* attempt to insert a disk into the drive specified with id */ |
| r4184 | r4185 | |
|---|---|---|
| 1400 | 1400 | |
| 1401 | 1401 | DEVICE_START( pokemini_cart ) |
| 1402 | 1402 | { |
| 1403 | return DEVICE_START_OK; | |
| 1404 | 1403 | } |
| 1405 | 1404 | |
| 1406 | 1405 | DEVICE_IMAGE_LOAD( pokemini_cart ) |
| r4184 | r4185 | |
|---|---|---|
| 185 | 185 | |
| 186 | 186 | rtc_timer = timer_alloc(device->machine, rtc_alarm_pulse, (void*)device); |
| 187 | 187 | timer_adjust_periodic(rtc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(32)); |
| 188 | ||
| 189 | return DEVICE_START_OK; | |
| 190 | 188 | } |
| 191 | 189 | |
| 192 | 190 | static int rp5c15_read(const device_config* device, int offset, UINT16 mem_mask) |
| r4184 | r4185 | |
|---|---|---|
| 388 | 388 | tc8521_t *rtc = get_token(device); |
| 389 | 389 | memset(rtc, 0, sizeof(*rtc)); |
| 390 | 390 | timer_pulse(device->machine, ATTOTIME_IN_HZ(32), (void *) device, 0, tc8521_timer_callback); |
| 391 | return DEVICE_START_OK; | |
| 392 | 391 | } |
| 393 | 392 | |
| 394 | 393 |
| r4184 | r4185 | |
|---|---|---|
| 1018 | 1018 | state_save_register_item_array( device->machine, "mc6854", device->tag, 0, mc6854->frame ); |
| 1019 | 1019 | state_save_register_item( device->machine, "mc6854", device->tag, 0, mc6854->flen ); |
| 1020 | 1020 | state_save_register_item( device->machine, "mc6854", device->tag, 0, mc6854->fpos ); |
| 1021 | ||
| 1022 | return DEVICE_START_OK; | |
| 1023 | 1021 | } |
| 1024 | 1022 | |
| 1025 | 1023 |
| r4184 | r4185 | |
|---|---|---|
| 1418 | 1418 | CartType = 0; |
| 1419 | 1419 | ROMMask = 0; |
| 1420 | 1420 | RAMMask = 0; |
| 1421 | return DEVICE_START_OK; | |
| 1422 | 1421 | } |
| 1423 | 1422 | |
| 1424 | 1423 | DEVICE_IMAGE_LOAD(gb_cart) |
| r4184 | r4185 | |
|---|---|---|
| 652 | 652 | DEVICE_START( gamecom_cart ) |
| 653 | 653 | { |
| 654 | 654 | internal_ram = device_get_info_ptr(device->machine->cpu[0], CPUINFO_PTR_SM8500_INTERNAL_RAM); |
| 655 | return DEVICE_START_OK; | |
| 656 | 655 | } |
| 657 | 656 | |
| 658 | 657 | DEVICE_IMAGE_LOAD( gamecom_cart ) |
| r4184 | r4185 | |
|---|---|---|
| 60 | 60 | state_save_register_item(device->machine, "ins8154", device->tag, 0, ins8154->mdr); |
| 61 | 61 | state_save_register_item(device->machine, "ins8154", device->tag, 0, ins8154->odra); |
| 62 | 62 | state_save_register_item(device->machine, "ins8154", device->tag, 0, ins8154->odrb); |
| 63 | return DEVICE_START_OK; | |
| 64 | 63 | } |
| 65 | 64 | |
| 66 | 65 |
| r4184 | r4185 | |
|---|---|---|
| 120 | 120 | smartmedia[id].pagereg = NULL; |
| 121 | 121 | smartmedia[id].id[0] = smartmedia[id].id[1] = 0; |
| 122 | 122 | smartmedia[id].mp_opcode = 0; |
| 123 | return DEVICE_START_OK; | |
| 124 | 123 | } |
| 125 | 124 | |
| 126 | 125 | /* |
| r4184 | r4185 | |
|---|---|---|
| 639 | 639 | { |
| 640 | 640 | int id = image_index_in_device(device); |
| 641 | 641 | memset(&serial_devices[id], 0, sizeof(serial_devices[id])); |
| 642 | return DEVICE_START_OK; | |
| 643 | 642 | } |
| 644 | 643 | |
| 645 | 644 | DEVICE_IMAGE_LOAD(serial_device) |
| r4184 | r4185 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | /* register for state saving */ |
| 130 | 130 | state_save_register_item(device->machine, "ttl74145", device->tag, 0, ttl74145->number); |
| 131 | ||
| 132 | return DEVICE_START_OK; | |
| 133 | 131 | } |
| 134 | 132 | |
| 135 | 133 |
| r4184 | r4185 | |
|---|---|---|
| 407 | 407 | serial_device_setup( device, 2400, 7, 2, SERIAL_PARITY_NONE ); /* default */ |
| 408 | 408 | serial_device_set_protocol( device, SERIAL_PROTOCOL_NONE ); |
| 409 | 409 | serial_device_set_transmit_state( device, 1 ); |
| 410 | return DEVICE_START_OK; | |
| 411 | 410 | } |
| 412 | 411 | |
| 413 | 412 |
| r4184 | r4185 | |
|---|---|---|
| 606 | 606 | state_save_register_item( device->machine, "mc6846", device->tag, 0, mc6846->latch ); |
| 607 | 607 | state_save_register_item( device->machine, "mc6846", device->tag, 0, mc6846->preset ); |
| 608 | 608 | state_save_register_item( device->machine, "mc6846", device->tag, 0, mc6846->timer_started ); |
| 609 | ||
| 610 | return DEVICE_START_OK; | |
| 611 | 609 | } |
| 612 | 610 | |
| 613 | 611 |
| r4184 | r4185 | |
|---|---|---|
| 320 | 320 | state_save_register_device_item(device, 0, cdp1871->next_da); |
| 321 | 321 | state_save_register_device_item(device, 0, cdp1871->rpt); |
| 322 | 322 | state_save_register_device_item(device, 0, cdp1871->next_rpt); |
| 323 | return DEVICE_START_OK; | |
| 324 | 323 | } |
| 325 | 324 | |
| 326 | 325 | static DEVICE_SET_INFO( cdp1871 ) |
| r4184 | r4185 | |
|---|---|---|
| 66 | 66 | { |
| 67 | 67 | scc8530_t *scc = get_token(device); |
| 68 | 68 | memset(scc, 0, sizeof(*scc)); |
| 69 | return DEVICE_START_OK; | |
| 70 | 69 | } |
| 71 | 70 | |
| 72 | 71 |
| r4184 | r4185 | |
|---|---|---|
| 53 | 53 | IMPLEMENTATION |
| 54 | 54 | ***************************************************************************/ |
| 55 | 55 | |
| 56 | static | |
| 56 | static | |
| 57 | 57 | { |
| 58 | 58 | sst39vfx_t *flash = get_token(device); |
| 59 | 59 | const sst39vfx_config *config = get_config(device); |
| r4184 | r4185 | |
| 74 | 74 | |
| 75 | 75 | state_save_register_item_pointer(device->machine, "sst39vfx", device->tag, 0, flash->data, flash->size); |
| 76 | 76 | state_save_register_item(device->machine, "sst39vfx", device->tag, 0, flash->swap); |
| 77 | ||
| 78 | return DEVICE_START_OK; | |
| 79 | 77 | } |
| 80 | 78 | |
| 81 | 79 | |
| 82 | 80 | static DEVICE_START( sst39vf020 ) |
| 83 | 81 | { |
| 84 | | |
| 82 | | |
| 85 | 83 | } |
| 86 | 84 | |
| 87 | 85 | static DEVICE_START( sst39vf400a ) |
| 88 | 86 | { |
| 89 | | |
| 87 | | |
| 90 | 88 | } |
| 91 | 89 | |
| 92 | 90 | UINT8* sst39vfx_get_base( const device_config *device) |
| r4184 | r4185 | |
|---|---|---|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /* Device Interface */ |
| 237 | static | |
| 237 | static | |
| 238 | 238 | { |
| 239 | 239 | sam6883_t *sam = get_safe_token(device); |
| 240 | 240 | // validate arguments |
| r4184 | r4185 | |
| 253 | 253 | state_save_register_item(device->machine, "6883sam", NULL, 0, sam->state); |
| 254 | 254 | state_save_register_item(device->machine, "6883sam", NULL, 0, sam->video_position); |
| 255 | 255 | state_save_register_postload(device->machine, update_sam_postload, (void*)device); |
| 256 | return DEVICE_START_OK; | |
| 257 | 256 | } |
| 258 | 257 | |
| 259 | 258 | static DEVICE_START( sam6883 ) |
| 260 | 259 | { |
| 261 | | |
| 260 | | |
| 262 | 261 | } |
| 263 | 262 | |
| 264 | 263 | static DEVICE_START( sam6883_gime ) |
| 265 | 264 | { |
| 266 | | |
| 265 | | |
| 267 | 266 | } |
| 268 | 267 | |
| 269 | 268 | static DEVICE_RESET( sam6883 ) |
| r4184 | r4185 | |
|---|---|---|
| 189 | 189 | |
| 190 | 190 | DEVICE_START( tx0_tape ) |
| 191 | 191 | { |
| 192 | return DEVICE_START_OK; | |
| 193 | 192 | } |
| 194 | 193 | |
| 195 | 194 | |
| r4184 | r4185 | |
| 547 | 546 | DEVICE_START( tx0_magtape ) |
| 548 | 547 | { |
| 549 | 548 | magtape.img = device; |
| 550 | return DEVICE_START_OK; | |
| 551 | 549 | } |
| 552 | 550 | |
| 553 | 551 | /* |
| r4184 | r4185 | |
|---|---|---|
| 89 | 89 | static DEVICE_START(apple2_langcard) |
| 90 | 90 | { |
| 91 | 91 | /* nothing to do */ |
| 92 | return DEVICE_START_OK; | |
| 93 | 92 | } |
| 94 | 93 | |
| 95 | 94 |
| r4184 | r4185 | |
|---|---|---|
| 409 | 409 | |
| 410 | 410 | state_save_register_device_item(device, 0, miot->timershift); |
| 411 | 411 | state_save_register_device_item(device, 0, miot->timerstate); |
| 412 | ||
| 413 | return DEVICE_START_OK; | |
| 414 | 412 | } |
| 415 | 413 | |
| 416 | 414 |
| r4184 | r4185 | |
|---|---|---|
| 596 | 596 | tms->clock_rate = tms->intf->clock_rate; |
| 597 | 597 | |
| 598 | 598 | tms->int_state = 0; |
| 599 | return DEVICE_START_OK; | |
| 600 | 599 | } |
| 601 | 600 | |
| 602 | 601 |
| r4184 | r4185 | |
|---|---|---|
| 1112 | 1112 | { |
| 1113 | 1113 | /* TODO - THIS DOES NOT MULTITASK BETWEEN ORIC BASICDSKs AND MFM DISKS */ |
| 1114 | 1114 | floppy_drive_init(device, NULL); |
| 1115 | return DEVICE_START_OK; | |
| 1116 | 1115 | } |
| 1117 | 1116 | |
| 1118 | 1117 |
| r4184 | r4185 | |
|---|---|---|
| 1444 | 1444 | state_save_register_device_item(device, 0, mc68901->rxtx_stop); |
| 1445 | 1445 | state_save_register_device_item(device, 0, mc68901->rsr_read); |
| 1446 | 1446 | state_save_register_device_item(device, 0, mc68901->next_rsr); |
| 1447 | return DEVICE_START_OK; | |
| 1448 | 1447 | } |
| 1449 | 1448 | |
| 1450 | 1449 | static DEVICE_RESET( mc68901 ) |
| r4184 | r4185 | |
|---|---|---|
| 95 | 95 | fdc_side = 1; |
| 96 | 96 | fdc_step = 1; |
| 97 | 97 | fdc_rdy = 0; |
| 98 | return DEVICE_START_OK; | |
| 99 | 98 | } |
| 100 | 99 | |
| 101 | 100 | static void check_extended_image( int id ) |
| r4184 | r4185 | |
|---|---|---|
| 1721 | 1721 | int id = image_index_in_device(device); |
| 1722 | 1722 | if (id == 0) |
| 1723 | 1723 | cbm_drive_open(); /* boy these C64 drivers are butt ugly */ |
| 1724 | return DEVICE_START_OK; | |
| 1725 | 1724 | } |
| 1726 | 1725 | |
| 1727 | 1726 | static DEVICE_STOP( cbm_drive ) |
| r4184 | r4185 | |
|---|---|---|
| 1349 | 1349 | |
| 1350 | 1350 | /* register for state saving */ |
| 1351 | 1351 | //state_save_register_item_array(machine, "z80dart", device->tag, 0, z80dart->); |
| 1352 | ||
| 1353 | return DEVICE_START_OK; | |
| 1354 | 1352 | } |
| 1355 | 1353 | |
| 1356 | 1354 | static DEVICE_RESET( z80dart ) |
| r4184 | r4185 | |
|---|---|---|
| 218 | 218 | /* defaults for PAL bios without cart */ |
| 219 | 219 | a7800_cart_type = 0; |
| 220 | 220 | a7800_stick_type = 1; |
| 221 | return DEVICE_START_OK; | |
| 222 | 221 | } |
| 223 | 222 | |
| 224 | 223 | DEVICE_IMAGE_LOAD( a7800_cart ) |
| r4184 | r4185 | |
|---|---|---|
| 641 | 641 | tms9902->clock_rate = tms9902->intf->clock_rate; |
| 642 | 642 | |
| 643 | 643 | tms9902->timer = timer_alloc(device->machine, decrementer_callback, (void *) device); |
| 644 | ||
| 645 | return DEVICE_START_OK; | |
| 646 | 644 | } |
| 647 | 645 | |
| 648 | 646 |
| r4184 | r4185 | |
|---|---|---|
| 547 | 547 | |
| 548 | 548 | static DEVICE_START( osborne1_daisy ) |
| 549 | 549 | { |
| 550 | return DEVICE_START_OK; | |
| 551 | 550 | } |
| 552 | 551 | |
| 553 | 552 |
| r4184 | r4185 | |
|---|---|---|
| 763 | 763 | |
| 764 | 764 | /* Initially set the vdp to not use sms compatibility mode for GG */ |
| 765 | 765 | sms_set_ggsmsmode( 0 ); |
| 766 | return DEVICE_START_OK; | |
| 767 | 766 | } |
| 768 | 767 | |
| 769 | 768 | DEVICE_IMAGE_LOAD( sms_cart ) |
| r4184 | r4185 | |
|---|---|---|
| 1634 | 1634 | const wd17xx_interface default_wd17xx_interface = { NULL, NULL }; |
| 1635 | 1635 | |
| 1636 | 1636 | /* device interface */ |
| 1637 | static | |
| 1637 | static | |
| 1638 | 1638 | { |
| 1639 | 1639 | wd17xx_t *w = get_safe_token(device); |
| 1640 | 1640 | |
| r4184 | r4185 | |
| 1652 | 1652 | w->timer_rs = timer_alloc(device->machine, wd17xx_read_sector_callback, (void*)device); |
| 1653 | 1653 | w->timer_ws = timer_alloc(device->machine, wd17xx_write_sector_callback, (void*)device); |
| 1654 | 1654 | w->pause_time = 40; |
| 1655 | ||
| 1656 | return DEVICE_START_OK; | |
| 1657 | ||
| 1658 | 1655 | } |
| 1659 | 1656 | |
| 1660 | 1657 | static DEVICE_RESET( wd17xx ) |
| r4184 | r4185 | |
|---|---|---|
| 674 | 674 | { |
| 675 | 675 | ti85_free_serial_data_memory(device->machine); |
| 676 | 676 | ti85_receive_serial (NULL,0); |
| 677 | return DEVICE_START_OK; | |
| 678 | 677 | } |
| 679 | 678 | |
| 680 | 679 | DEVICE_IMAGE_LOAD( ti85_serial ) |
| r4184 | r4185 | |
|---|---|---|
| 109 | 109 | { |
| 110 | 110 | pcart = NULL; |
| 111 | 111 | pcart_rom_size = 0; |
| 112 | return DEVICE_START_OK; | |
| 113 | 112 | } |
| 114 | 113 | |
| 115 | 114 | DEVICE_IMAGE_LOAD( svi318_cart ) |
| r4184 | r4185 | |
|---|---|---|
| 1291 | 1291 | rtc.minute = 0; |
| 1292 | 1292 | rtc.second = 0; |
| 1293 | 1293 | rtc.setting = 0xFF; |
| 1294 | return DEVICE_START_OK; | |
| 1295 | 1294 | } |
| 1296 | 1295 | |
| 1297 | 1296 | DEVICE_IMAGE_LOAD(wswan_cart) |
| r4184 | r4185 | |
|---|---|---|
| 2246 | 2246 | |
| 2247 | 2247 | /* Device Interface */ |
| 2248 | 2248 | |
| 2249 | static | |
| 2249 | static | |
| 2250 | 2250 | { |
| 2251 | 2251 | nec765_t *fdc = get_safe_token(device); |
| 2252 | 2252 | // validate arguments |
| r4184 | r4185 | |
| 2268 | 2268 | |
| 2269 | 2269 | // register for state saving |
| 2270 | 2270 | //state_save_register_item(device->machine, "nec765", device->tag, 0, nec765->number); |
| 2271 | return DEVICE_START_OK; | |
| 2272 | 2271 | } |
| 2273 | 2272 | |
| 2274 | 2273 | static DEVICE_START( nec765a ) |
| 2275 | 2274 | { |
| 2276 | | |
| 2275 | | |
| 2277 | 2276 | } |
| 2278 | 2277 | |
| 2279 | 2278 | static DEVICE_START( nec765b ) |
| 2280 | 2279 | { |
| 2281 | | |
| 2280 | | |
| 2282 | 2281 | } |
| 2283 | 2282 | |
| 2284 | 2283 | static DEVICE_START( smc37c78 ) |
| 2285 | 2284 | { |
| 2286 | | |
| 2285 | | |
| 2287 | 2286 | } |
| 2288 | 2287 | |
| 2289 | 2288 | static DEVICE_START( nec72065 ) |
| 2290 | 2289 | { |
| 2291 | | |
| 2290 | | |
| 2292 | 2291 | } |
| 2293 | 2292 | |
| 2294 | 2293 | static DEVICE_RESET( nec765 ) |
| r4184 | r4185 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | static DEVICE_START( abc99 ) |
| 15 | 15 | { |
| 16 | return DEVICE_START_OK; | |
| 17 | 16 | } |
| 18 | 17 | |
| 19 | 18 | static DEVICE_SET_INFO( abc99 ) |
| r4184 | r4185 | |
|---|---|---|
| 51 | 51 | sasi->status_port = 0x00; |
| 52 | 52 | sasi->phase = SASI_PHASE_BUSFREE; |
| 53 | 53 | hd.current_block = 0; |
| 54 | return DEVICE_START_OK; | |
| 55 | 54 | } |
| 56 | 55 | |
| 57 | 56 | DEVICE_IMAGE_CREATE( sasihd ) |
| r4184 | r4185 | |
|---|---|---|
| 97 | 97 | /* card ram NULL */ |
| 98 | 98 | nc_card_ram = NULL; |
| 99 | 99 | nc_card_size = 0; |
| 100 | return DEVICE_START_OK; | |
| 101 | 100 | } |
| 102 | 101 | |
| 103 | 102 | /* load pcmcia card */ |
| r4184 | r4185 | |
|---|---|---|
| 90 | 90 | memset( rtc, 0, sizeof(*rtc)); |
| 91 | 91 | rtc->timer = timer_alloc(device->machine, pcf8593_timer_callback , (void *) device); |
| 92 | 92 | timer_adjust_periodic(rtc->timer, ATTOTIME_IN_SEC(1), 0, ATTOTIME_IN_SEC(1)); |
| 93 | return DEVICE_START_OK; | |
| 94 | 93 | } |
| 95 | 94 | |
| 96 | 95 |
| r4184 | r4185 | |
|---|---|---|
| 1565 | 1565 | |
| 1566 | 1566 | // register for state saving |
| 1567 | 1567 | //state_save_register_item(device->machine, "i8271", device->tag, 0, i8271->number); |
| 1568 | return DEVICE_START_OK; | |
| 1569 | 1568 | } |
| 1570 | 1569 | |
| 1571 | 1570 | static DEVICE_RESET( i8271 ) |
| r4184 | r4185 | |
|---|---|---|
| 600 | 600 | |
| 601 | 601 | nes_fds.sides = 0; |
| 602 | 602 | nes_fds.data = NULL; |
| 603 | return DEVICE_START_OK; | |
| 604 | 603 | } |
| 605 | 604 | |
| 606 | 605 |
| r4184 | r4185 | |
|---|---|---|
| 120 | 120 | t->wp = 1; |
| 121 | 121 | t->bot = 0; |
| 122 | 122 | t->eot = 0; |
| 123 | return DEVICE_START_OK; | |
| 124 | 123 | } |
| 125 | 124 | |
| 126 | 125 | /*DEVICE_STOP( ti990_tape ) |
| r4184 | r4185 | |
|---|---|---|
| 197 | 197 | state_save_register_item(device->machine, "uPD7002", device->tag, 0, uPD7002->data0); |
| 198 | 198 | state_save_register_item(device->machine, "uPD7002", device->tag, 0, uPD7002->digitalvalue); |
| 199 | 199 | state_save_register_item(device->machine, "uPD7002", device->tag, 0, uPD7002->conversion_counter); |
| 200 | return DEVICE_START_OK; | |
| 201 | 200 | } |
| 202 | 201 | |
| 203 | 202 | static DEVICE_RESET( uPD7002 ) |
| r4184 | r4185 | |
|---|---|---|
| 161 | 161 | state_save_register_item(device->machine, "adc080x", device->tag, 0, adc080x->sar); |
| 162 | 162 | state_save_register_item(device->machine, "adc080x", device->tag, 0, adc080x->cycle); |
| 163 | 163 | state_save_register_item(device->machine, "adc080x", device->tag, 0, adc080x->bit); |
| 164 | return DEVICE_START_OK; | |
| 165 | 164 | } |
| 166 | 165 | |
| 167 | 166 | static DEVICE_SET_INFO( adc080x ) |
| r4184 | r4185 | |
|---|---|---|
| 84 | 84 | memset(ds1315, 0, sizeof(*ds1315)); |
| 85 | 85 | ds1315->count = 0; |
| 86 | 86 | ds1315->mode = DS_SEEK_MATCHING; |
| 87 | ||
| 88 | return DEVICE_START_OK; | |
| 89 | 87 | } |
| 90 | 88 | |
| 91 | 89 |
| r4184 | r4185 | |
|---|---|---|
| 154 | 154 | serial_connection_set_in_callback(device->machine, &acia->connection, acia_6551_in_callback); |
| 155 | 155 | transmit_register_reset(&acia->transmit_reg); |
| 156 | 156 | receive_register_reset(&acia->receive_reg); |
| 157 | return DEVICE_START_OK; | |
| 158 | 157 | } |
| 159 | 158 | |
| 160 | 159 |
| r4184 | r4185 | |
|---|---|---|
| 721 | 721 | |
| 722 | 722 | ay31015_update_rx_timer( device ); |
| 723 | 723 | ay31015_update_tx_timer( device ); |
| 724 | ||
| 725 | return DEVICE_START_OK; | |
| 726 | 724 | } |
| 727 | 725 | |
| 728 | 726 |
| r4184 | r4185 | |
|---|---|---|
| 2805 | 2805 | mc68328->pwm = timer_alloc(device->machine, mc68328_pwm_transition, 0); |
| 2806 | 2806 | |
| 2807 | 2807 | mc68328_register_state_save(device); |
| 2808 | ||
| 2809 | return DEVICE_START_OK; | |
| 2810 | 2808 | } |
| 2811 | 2809 | |
| 2812 | 2810 | static DEVICE_SET_INFO( mc68328 ) |
| r4184 | r4185 | |
|---|---|---|
| 695 | 695 | vc20_rom_4000 = NULL; |
| 696 | 696 | vc20_rom_6000 = NULL; |
| 697 | 697 | vc20_rom_a000 = NULL; |
| 698 | return DEVICE_START_OK; | |
| 699 | 698 | } |
| 700 | 699 | |
| 701 | 700 | static DEVICE_IMAGE_LOAD(vic20_cart) |
| r4184 | r4185 | |
|---|---|---|
| 830 | 830 | state_save_register_item( device->machine,"mc6843", device->tag, 0, mc6843->data_size ); |
| 831 | 831 | state_save_register_item( device->machine,"mc6843", device->tag, 0, mc6843->data_idx ); |
| 832 | 832 | state_save_register_item( device->machine,"mc6843", device->tag, 0, mc6843->data_id ); |
| 833 | ||
| 834 | return DEVICE_START_OK; | |
| 835 | 833 | } |
| 836 | 834 | |
| 837 | 835 |
| r4184 | r4185 | |
|---|---|---|
| 474 | 474 | mm58274c->increment_rtc = timer_alloc(device->machine, increment_rtc, ((void*)device)); |
| 475 | 475 | timer_adjust_periodic(mm58274c->increment_rtc, attotime_zero, 0, ATTOTIME_IN_MSEC(100)); |
| 476 | 476 | mm58274c->interrupt_timer = timer_alloc(device->machine, rtc_interrupt_callback, ((void*)device)); |
| 477 | ||
| 478 | return DEVICE_START_OK; | |
| 479 | 477 | } |
| 480 | 478 | |
| 481 | 479 |
| r4184 | r4185 | |
|---|---|---|
| 212 | 212 | state_save_register_item(device->machine, "e0516", device->tag, 0, e0516->dio); |
| 213 | 213 | |
| 214 | 214 | state_save_register_item_array(device->machine, "e0516", device->tag, 0, e0516->reg); |
| 215 | return DEVICE_START_OK; | |
| 216 | 215 | } |
| 217 | 216 | |
| 218 | 217 | static DEVICE_SET_INFO( e0516 ) |
| r4184 | r4185 | |
|---|---|---|
| 165 | 165 | state_save_register_device_item(device, 0, tpi6525->cr); |
| 166 | 166 | state_save_register_device_item(device, 0, tpi6525->air); |
| 167 | 167 | state_save_register_device_item_array(device, 0, tpi6525->irq_level); |
| 168 | ||
| 169 | return DEVICE_START_OK; | |
| 170 | 168 | } |
| 171 | 169 | |
| 172 | 170 |
| r4184 | r4185 | |
|---|---|---|
| 477 | 477 | /* assume keyboard is absent */ |
| 478 | 478 | memory[0x7000 << 1] = 0xff; |
| 479 | 479 | memory[(0x7000 << 1) + 1] = 0xff; |
| 480 | ||
| 481 | return DEVICE_START_OK; | |
| 482 | 480 | } |
| 483 | 481 | |
| 484 | 482 | DEVICE_IMAGE_LOAD( intv_cart ) |
| r4184 | r4185 | |
|---|---|---|
| 345 | 345 | state_save_register_item(device->machine, "abc77", device->tag, 0, abc77->clock); |
| 346 | 346 | state_save_register_item(device->machine, "abc77", device->tag, 0, abc77->hys); |
| 347 | 347 | state_save_register_item(device->machine, "abc77", device->tag, 0, abc77->reset); |
| 348 | ||
| 349 | return DEVICE_START_OK; | |
| 350 | 348 | } |
| 351 | 349 | |
| 352 | 350 | static DEVICE_SET_INFO( abc77 ) |
| r4184 | r4185 | |
|---|---|---|
| 551 | 551 | static DEVICE_START( ins8250 ) |
| 552 | 552 | { |
| 553 | 553 | common_start( device, TYPE_INS8250 ); |
| 554 | return DEVICE_START_OK; | |
| 555 | 554 | } |
| 556 | 555 | |
| 557 | 556 | |
| 558 | 557 | static DEVICE_START( ins8250a ) |
| 559 | 558 | { |
| 560 | 559 | common_start( device, TYPE_INS8250A ); |
| 561 | return DEVICE_START_OK; | |
| 562 | 560 | } |
| 563 | 561 | |
| 564 | 562 | |
| 565 | 563 | static DEVICE_START( ns16450 ) |
| 566 | 564 | { |
| 567 | 565 | common_start( device, TYPE_NS16450 ); |
| 568 | return DEVICE_START_OK; | |
| 569 | 566 | } |
| 570 | 567 | |
| 571 | 568 | |
| 572 | 569 | static DEVICE_START( ns16550 ) |
| 573 | 570 | { |
| 574 | 571 | common_start( device, TYPE_NS16550 ); |
| 575 | return DEVICE_START_OK; | |
| 576 | 572 | } |
| 577 | 573 | |
| 578 | 574 | |
| 579 | 575 | static DEVICE_START( ns16550a ) |
| 580 | 576 | { |
| 581 | 577 | common_start( device, TYPE_NS16550A ); |
| 582 | return DEVICE_START_OK; | |
| 583 | 578 | } |
| 584 | 579 | |
| 585 | 580 | |
| 586 | 581 | static DEVICE_START( pc16550d ) |
| 587 | 582 | { |
| 588 | 583 | common_start( device, TYPE_PC16550D ); |
| 589 | return DEVICE_START_OK; | |
| 590 | 584 | } |
| 591 | 585 | |
| 592 | 586 |
| r4184 | r4185 | |
|---|---|---|
| 634 | 634 | |
| 635 | 635 | state_save_register_item(device->machine, "zx8302", device->tag, 0, zx8302->mdv_motor); |
| 636 | 636 | state_save_register_item_array(device->machine, "zx8302", device->tag, 0, zx8302->mdv_offset); |
| 637 | return DEVICE_START_OK; | |
| 638 | 637 | } |
| 639 | 638 | |
| 640 | 639 | static DEVICE_RESET( zx8302 ) |
| r4184 | r4185 | |
|---|---|---|
| 1403 | 1403 | cbm_c64_game = -1; |
| 1404 | 1404 | cbm_c64_exrom = -1; |
| 1405 | 1405 | } |
| 1406 | return DEVICE_START_OK; | |
| 1407 | 1406 | } |
| 1408 | 1407 | |
| 1409 | 1408 | /* Hardware Types for C64 carts */ |
| r4184 | r4185 | |
|---|---|---|
| 63 | 63 | dmac->clock[x] = dmac->intf->clock[x]; |
| 64 | 64 | dmac->burst_clock[x] = dmac->intf->burst_clock[x]; |
| 65 | 65 | } |
| 66 | return DEVICE_START_OK; | |
| 67 | 66 | } |
| 68 | 67 | |
| 69 | 68 | int hd63450_read(const device_config* device, int offset, UINT16 mem_mask) |
| r4184 | r4185 | |
|---|---|---|
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | cartridge_pages[id] = (UINT16 *) (memory_region(device->machine, "main") + offset_cart + (id * 0x2000)); |
| 390 | return DEVICE_START_OK; | |
| 391 | 390 | } |
| 392 | 391 | |
| 393 | 392 | /* |
| r4184 | r4185 | |
| 786 | 785 | { |
| 787 | 786 | memory_install_read16_handler(space, 0x9000, 0x93ff, 0, 0, ti99_rspeech_r); |
| 788 | 787 | memory_install_write16_handler(space, 0x9400, 0x97ff, 0, 0, ti99_wspeech_w); |
| 789 | ||
| 790 | sndti_set_info_int(SOUND_TMS5220, 0, SNDINFO_INT_TMS5220_VARIANT, variant_tmc0285); | |
| 791 | 788 | } |
| 792 | 789 | } |
| 793 | 790 | else |
| r4184 | r4185 | |
|---|---|---|
| 141 | 141 | serial_connection_init(device->machine,&uart->connection); |
| 142 | 142 | serial_connection_set_in_callback(device->machine,&uart->connection, msm8251_in_callback); |
| 143 | 143 | uart->connection.input_state = 0; |
| 144 | return DEVICE_START_OK; | |
| 145 | 144 | } |
| 146 | 145 | |
| 147 | 146 |
| r4184 | r4185 | |
|---|---|---|
| 301 | 301 | |
| 302 | 302 | tms->command = 0; |
| 303 | 303 | LOG_TMS5501(device, "Init", 0); |
| 304 | return DEVICE_START_OK; | |
| 305 | 304 | } |
| 306 | 305 | |
| 307 | 306 |
| r4184 | r4185 | |
|---|---|---|
| 450 | 450 | $(MESSOBJ)/osborne.a \ |
| 451 | 451 | $(MESSOBJ)/osi.a \ |
| 452 | 452 | $(MESSOBJ)/p2000.a \ |
| 453 | $(MESSOBJ)/palm.a \ | |
| 453 | 454 | $(MESSOBJ)/pasogo.a \ |
| 454 | 455 | $(MESSOBJ)/pc.a \ |
| 455 | 456 | $(MESSOBJ)/pcshare.a \ |
| r4184 | r4185 | |
| 463 | 464 | $(MESSOBJ)/rca.a \ |
| 464 | 465 | $(MESSOBJ)/rockwell.a \ |
| 465 | 466 | $(MESSOBJ)/rt1715.a \ |
| 466 | $(MESSOBJ)/palm.a \ | |
| 467 | 467 | $(MESSOBJ)/samcoupe.a \ |
| 468 | 468 | $(MESSOBJ)/sapi1.a \ |
| 469 | 469 | $(MESSOBJ)/sega.a \ |
| r4184 | r4185 | |
|---|---|---|
| 273 | 273 | harddisk->config = device->static_config; |
| 274 | 274 | harddisk->chd = NULL; |
| 275 | 275 | harddisk->hard_disk_handle = NULL; |
| 276 | return DEVICE_START_OK; | |
| 277 | 276 | } |
| 278 | 277 | |
| 279 | 278 |
| r4184 | r4185 | |
|---|---|---|
| 238 | 238 | cassette->config = device->static_config; |
| 239 | 239 | cassette->cassette = NULL; |
| 240 | 240 | cassette->state = cassette->config->default_state; |
| 241 | return DEVICE_START_OK; | |
| 242 | 241 | } |
| 243 | 242 | |
| 244 | 243 |
| r4184 | r4185 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | static DEVICE_START(microdrv) |
| 13 | 13 | { |
| 14 | return DEVICE_START_OK; | |
| 15 | 14 | } |
| 16 | 15 | |
| 17 | 16 | DEVICE_GET_INFO(microdrv) |
| r4184 | r4185 | |
|---|---|---|
| 300 | 300 | state->conf = (xmodem_config*) device->static_config; |
| 301 | 301 | state->machine = device->machine; |
| 302 | 302 | state->timer = timer_alloc(device->machine, xmodem_nak_cb, state ); |
| 303 | return DEVICE_START_OK; | |
| 304 | 303 | } |
| 305 | 304 | |
| 306 | 305 | static DEVICE_RESET( xmodem ) |
| r4184 | r4185 | |
|---|---|---|
| 640 | 640 | state->machine = device->machine; |
| 641 | 641 | state->resend = timer_alloc(device->machine, kermit_resend_cb, state ); |
| 642 | 642 | kermit_reset( state ); |
| 643 | return DEVICE_START_OK; | |
| 644 | 643 | } |
| 645 | 644 | |
| 646 | 645 | static DEVICE_RESET( kermit ) |
| r4184 | r4185 | |
|---|---|---|
| 178 | 178 | return (*config->device_start)(device); |
| 179 | 179 | |
| 180 | 180 | process_cartridge(device, NULL); |
| 181 | return DEVICE_START_OK; | |
| 182 | 181 | } |
| 183 | 182 | |
| 184 | 183 |
| r4184 | r4185 | |
|---|---|---|
| 129 | 129 | dev_cdrom_t *cdrom = get_safe_token( device ); |
| 130 | 130 | |
| 131 | 131 | cdrom->cdrom_handle = NULL; |
| 132 | return DEVICE_START_OK; | |
| 133 | 132 | } |
| 134 | 133 | |
| 135 | 134 |
| r4184 | r4185 | |
|---|---|---|
| 261 | 261 | { |
| 262 | 262 | image_alloctag(device, FLOPPY_TAG, sizeof(mess_flopimg)); |
| 263 | 263 | floppy_drive_init(device, &mess_floppy_interface); |
| 264 | return DEVICE_START_OK; | |
| 265 | 264 | } |
| 266 | 265 | |
| 267 | 266 |
| r4184 | r4185 | |
|---|---|---|
| 74 | 74 | static DEVICE_START( dsk_floppy ) |
| 75 | 75 | { |
| 76 | 76 | floppy_drive_init(device, NULL); |
| 77 | return DEVICE_START_OK; | |
| 78 | 77 | } |
| 79 | 78 | |
| 80 | 79 |
| r4184 | r4185 | |
|---|---|---|
| 283 | 283 | |
| 284 | 284 | parent_init = (device_start_func) mess_device_get_info_fct(&parent_devclass, MESS_DEVINFO_PTR_START); |
| 285 | 285 | parent_init(device); |
| 286 | return DEVICE_START_OK; | |
| 287 | 286 | } |
| 288 | 287 | |
| 289 | 288 |
| r4184 | r4185 | |
|---|---|---|
| 87 | 87 | DEVICE_START( basicdsk_floppy ) |
| 88 | 88 | { |
| 89 | 89 | floppy_drive_init(device, &basicdsk_floppy_interface); |
| 90 | return DEVICE_START_OK; | |
| 91 | 90 | } |
| 92 | 91 | |
| 93 | 92 | /* attempt to insert a disk into the drive specified with id */ |
| r4184 | r4185 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | static DEVICE_START(printer) |
| 50 | 50 | { |
| 51 | return DEVICE_START_OK; | |
| 52 | 51 | } |
| 53 | 52 | |
| 54 | 53 |
| r4184 | r4185 | |
|---|---|---|
| 96 | 96 | { |
| 97 | 97 | vhd_info *vhd = get_safe_token(device); |
| 98 | 98 | vhd->status = VHDSTATUS_NO_VHD_ATTACHED; |
| 99 | return DEVICE_START_OK; | |
| 100 | 99 | } |
| 101 | 100 | |
| 102 | 101 |
| r4184 | r4185 | |
|---|---|---|
| 93 | 93 | bi->value = config->initial_value; |
| 94 | 94 | bi->timeout_timer = timer_alloc(device->machine, bitbanger_overthreshhold, (void *) device); |
| 95 | 95 | bi->over_threshhold = 1; |
| 96 | return DEVICE_START_OK; | |
| 97 | 96 | } |
| 98 | 97 | |
| 99 | 98 |
| r4184 | r4185 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | /* locate the load function */ |
| 107 | 107 | token->load = (snapquick_load_func) device_get_info_fct(device, DEVINFO_FCT_SNAPSHOT_QUICKLOAD_LOAD); |
| 108 | return DEVICE_START_OK; | |
| 109 | 108 | } |
| 110 | 109 | |
| 111 | 110 |
| r4184 | r4185 | |
|---|---|---|
| 787 | 787 | thom_qdd_compute_map(); |
| 788 | 788 | thom_floppy_reset( thom_floppy_drive_of_image( device ) ); |
| 789 | 789 | floppy_drive_init( device, &thom_floppy_interface ); |
| 790 | return DEVICE_START_OK; | |
| 791 | 790 | } |
| 792 | 791 | |
| 793 | 792 |
| r4184 | r4185 | |
|---|---|---|
| 172 | 172 | |
| 173 | 173 | static DEVICE_START( apexc_tape ) |
| 174 | 174 | { |
| 175 | return DEVICE_START_OK; | |
| 176 | 175 | } |
| 177 | 176 | |
| 178 | 177 |
| r4184 | r4185 | |
|---|---|---|
| 543 | 543 | static DEVICE_START( a2600_cart ) |
| 544 | 544 | { |
| 545 | 545 | banking_mode = 0xFF; |
| 546 | return DEVICE_START_OK; | |
| 547 | 546 | } |
| 548 | 547 | |
| 549 | 548 |
| r4184 | r4185 | |
|---|---|---|
| 618 | 618 | |
| 619 | 619 | static READ8_HANDLER( cop_r ) |
| 620 | 620 | { |
| 621 | newbrain_state *state = space->machine->driver_data; | |
| 621 | /* newbrain_state *state = space->machine->driver_data; */ | |
| 622 | 622 | UINT8 data = 0; // REGINT |
| 623 | 623 | |
| 624 | 624 | /* state->cop_rd = 0; |
| r4184 | r4185 | |
|---|---|---|
| 488 | 488 | |
| 489 | 489 | static DEVICE_START( einstein_daisy ) |
| 490 | 490 | { |
| 491 | return DEVICE_START_OK; | |
| 492 | 491 | } |
| 493 | 492 | |
| 494 | 493 |
| r4184 | r4185 | |
|---|---|---|
| 38 | 38 | |
| 39 | 39 | static const UPD7810_CONFIG gamepock_cpu_config = { TYPE_78C06, gamepock_io_callback }; |
| 40 | 40 | |
| 41 | static DEVICE_START(gamepock_cart) { | |
| 41 | static DEVICE_START(gamepock_cart) | |
| 42 | { | |
| 42 | 43 | memory_set_bankptr( device->machine, 1, memory_region(device->machine, "user1" ) ); |
| 43 | return DEVICE_START_OK; | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static DEVICE_IMAGE_LOAD(gamepock_cart) { |
| r4184 | r4185 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | Source Changes: |
| 48 | 48 | ---------------- |
| 49 | - The core is based on MAME 0.129u | |
| 49 | - The core is based on MAME 0.129u2. This incorporates all features of the | |
| 50 | 50 | update to this core. [MAME team] |
| 51 | 51 | |
| 52 | 52 | - Changed the DS1315 implementation to be a device. [Nathan Woods] |
| Previous | 15994 Revisions | Next |