static INT32 GalDoReset() { if (GalS2650Rom1Size) { s2650Open(0); s2650Reset(); s2650Close(); } if (GalZ80Rom1Size) { ZetOpen(0); if (!strcmp(BurnDrvGetTextA(DRV_NAME), "4in1")) { ZetMapArea(0x0000, 0x3fff, 0, GalZ80Rom1); ZetMapArea(0x0000, 0x3fff, 2, GalZ80Rom1); } ZetReset(); ZetClose(); } if (GalZ80Rom2Size) { ZetOpen(1); ZetReset(); ZetClose(); } if (GalZ80Rom3Size) { ZetOpen(2); ZetReset(); ZetClose(); } GalSoundReset(); HiscoreReset(); GalIrqFire = 0; GalFlipScreenX = 0; GalFlipScreenY = 0; ZigzagAYLatch = 0; GalSoundLatch = 0; GalSoundLatch2 = 0; KingballSpeechDip = 0; KingballSound = 0; GalStarsEnable = 0; GalStarsScrollPos = 0; GalBackgroundRed = 0; GalBackgroundGreen = 0; GalBackgroundBlue = 0; GalBackgroundEnable = 0; ScrambleProtectionState = 0; ScrambleProtectionResult = 0; MoonwarPortSelect = 0; MshuttleAY8910CS = 0; Fourin1Bank = 0; CavelonBankSwitch = 0; GalVBlank = 0; return 0; }
INT32 __fastcall CPSResetCallback() { // Reset instruction on 68000 if (((Cps & 1) && !Cps1DisablePSnd) || ((Cps == 2) && !Cps2DisableQSnd)) ZetReset(); // Reset Z80 (CPU #1) return 0; }
static INT32 drvDoReset() { // Insert region code into 68K ROM, code by BisonSAS UINT8 nRegion = drvRegion & 0x1F; if (nRegion<=25) { Rom01[0x00000^1]=(UINT8)(nRegion<<13) | (drvRegion & 0x1F); } SekOpen(0); nIRQPending = 0; SekSetIRQLine(0, SEK_IRQSTATUS_NONE); Map68KTextROM(true); SekReset(); SekClose(); ZetOpen(0); ZetReset(); ZetClose(); MSM6295Reset(0); MSM6295Reset(1); BurnYM2151Reset(); return 0; }
static INT32 __fastcall DrvResetCallback() { // Reset instruction on 68000 ZetReset(); // Reset Z80 (CPU #1) BurnYM3812Reset(); return 0; }
INT32 __fastcall CPSResetCallback() { // Reset instruction on 68000 if (!Cps2DisableQSnd) ZetReset(); // Reset Z80 (CPU #1) return 0; }
static INT32 DrvDoReset() { memset (AllRam, 0, RamEnd - AllRam); ZetOpen(0); ZetReset(); bankswitch(0); vidram_bankswitch(0); ZetClose(); ZetOpen(1); ZetReset(); ZetClose(); oki_bankswitch(1); MSM6295Reset(0); return 0; }
void __fastcall rallybikWriteWord(UINT32 a, UINT16 d) { switch (a) { case 0x100000: // rallybik_bcu_flipscreen_w return; case 0x100002: ToaBCU2SetRAMPointer(d); return; case 0x100004: case 0x100006: ToaBCU2WriteRAM(d); return; case 0x100010: case 0x100012: case 0x100014: case 0x100016: case 0x100018: case 0x10001a: case 0x10001c: case 0x10001e: BCU2Reg[(a & 0x0f) >> 1] = d; return; case 0x140002: bEnableInterrupts = d & 0xff; return; case 0x140008: case 0x14000a: case 0x14000c: case 0x14000e: // toaplan1_bcu_control_w return; case 0x1c0000: nBCU2TileXOffset = d; return; case 0x1c0002: nBCU2TileYOffset = d; return; case 0x1c8000: if (d == 0) { ZetReset(); } return; } }
static int DrvDoReset() { DrvReset = 0; memset (Mem + 0x4000, 0, 0x0800); ZetOpen(0); ZetReset(); ZetClose(); return 0; }
void sms_reset(void) { ZetOpen(0); /* Clear SMS context */ memset(&dummy_write, 0, sizeof(dummy_write)); memset(&sms.wram, 0, sizeof(sms.wram)); memset(cart.sram, 0, sizeof(cart.sram)); sms.paused = 0x00; sms.save = 0x00; sms.fm_detect = 0x00; sms.memctrl = 0xAB; sms.ioctrl = 0xFF; ZetMapMemory(cart.rom + 0x0000, 0x0000, 0x03ff, MAP_ROM); ZetMapMemory(cart.rom + 0x0400, 0x0400, 0x3fff, MAP_ROM); ZetMapMemory(cart.rom + 0x4000, 0x4000, 0x7fff, MAP_ROM); ZetMapMemory(cart.rom + 0x8000, 0x8000, 0xbfff, MAP_ROM); if(cart.mapper == MAPPER_CODIES) { ZetMapMemory((UINT8 *)&sms.wram + 0x0000, 0xc000, 0xdfff, MAP_RAM); ZetMapMemory((UINT8 *)&sms.wram + 0x0000, 0xe000, 0xffff, MAP_RAM); } else if(cart.mapper == MAPPER_SEGA) { ZetMapMemory((UINT8 *)&sms.wram + 0x0000, 0xc000, 0xdfff, MAP_RAM); ZetMapMemory((UINT8 *)&dummy_write, 0x0000, 0xbfff, MAP_WRITE); ZetMapMemory((UINT8 *)&sms.wram + 0x0000, 0xe000, 0xffff, MAP_READ); } else { // MSX Mapper ZetMapMemory((UINT8 *)&sms.wram + 0x0000, 0xc000, 0xdfff, MAP_RAM); ZetMapMemory((UINT8 *)&sms.wram + 0x0000, 0xe000, 0xffff, MAP_RAM); } ZetReset(); ZetClose(); cart.fcr[0] = 0x00; cart.fcr[1] = 0x00; cart.fcr[2] = 0x01; cart.fcr[3] = 0x00; switch (cart.mapper) { case MAPPER_MSX_NEMESIS: { // WIP!! / won't boot // bprintf(0, _T("(nemesis)\n")); cart.fcr[2] = 0x00; UINT32 poffset = (0x0f) << 13; ZetOpen(0); ZetMapMemory(cart.rom + poffset, 0x0000, 0x1fff, MAP_READ); ZetClose(); } } }
static int drvDoReset() { SekOpen(0); SekReset(); SekClose(); ZetOpen(0); ZetReset(); ZetClose(); ZetRun(4000000/60); BurnYM2151Reset(); return 0; }
void __fastcall PgmWriteWord(unsigned int sekAddress, unsigned short wordValue) { static int coin_counter_previous; switch (sekAddress) { case 0x700006: // Watchdog? break; case 0xC00002: ics2115_soundlatch_w(0, wordValue); if (nPgmZ80Work) ZetNmi(); break; case 0xC00004: ics2115_soundlatch_w(1, wordValue); break; case 0xC00006: pgm_calendar_w(wordValue); break; case 0xC00008: if (wordValue == 0x5050) { ics2115_reset(); nPgmZ80Work = 1; ZetReset(); } else { nPgmZ80Work = 0; } break; case 0xC0000A: // z80_ctrl_w break; case 0xC0000C: ics2115_soundlatch_w(2, wordValue); break; case 0xC08006: // coin counter if (coin_counter_previous == 0xf && wordValue == 0) { // bprintf (0, _T("increment coin counter!\n")); } coin_counter_previous = wordValue & 0x0f; break; // default: // bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x (PC: %5.5x)\n"), wordValue, sekAddress, SekGetPC(-1)); } }
static INT32 DrvDoReset() { SekOpen(0); SekReset(); SekClose(); ZetOpen(0); ZetReset(); ZetClose(); BurnYM3812Reset(); return 0; }
static INT32 DrvDoReset() { memset (AllRam, 0, RamEnd - AllRam); ZetOpen(0); ZetReset(); ZetClose(); t5182Reset(); DrvRecalc = 1; return 0; }
static INT32 DrvReset() { // Reset machine if (Cps == 2 || PangEEP || Cps1Qs == 1 || CpsBootlegEEPROM) EEPROMReset(); //HACK if (glob_ffingeron&&virtual_stick_on) { wait_control=60; glob_framecpt=0; glob_replay_last_dx16=glob_replay_last_dy16=0; glob_delta_dy16=0; glob_replay_last_fingerOn=0; } // SekOpen(0); SekReset(); SekClose(); if (((Cps & 1) && !Cps1DisablePSnd) || ((Cps == 2) && !Cps2DisableQSnd)) { ZetOpen(0); ZetReset(); ZetClose(); } if (Cps == 2) { // Disable beam-synchronized interrupts *((UINT16*)(CpsReg + 0x4E)) = BURN_ENDIAN_SWAP_INT16(0x0200); *((UINT16*)(CpsReg + 0x50)) = BURN_ENDIAN_SWAP_INT16(nCpsNumScanlines); *((UINT16*)(CpsReg + 0x52)) = BURN_ENDIAN_SWAP_INT16(nCpsNumScanlines); } SekOpen(0); CpsMapObjectBanks(0); SekClose(); nCpsCyclesExtra = 0; if (((Cps == 2) && !Cps2DisableQSnd) || Cps1Qs == 1) { // Sound init (QSound) QsndReset(); } if (CpsRunResetCallbackFunction) { CpsRunResetCallbackFunction(); } HiscoreReset(); return 0; }
static INT32 DrvDoReset() { SekOpen(0); SekReset(); SekClose(); ZetOpen(0); ZetReset(); ZetClose(); BurnYM3812Reset(); bEnableInterrupts = false; return 0; }
static int DrvDoReset() { SekOpen(0); nIRQPending = 0; SekSetIRQLine(0, SEK_IRQSTATUS_NONE); SekReset(); SekClose(); ZetReset(); MSM6295Reset(0); BurnYM2151Reset(); return 0; }
void TmntReset() { SekOpen(0); SekReset(); SekClose(); ZetOpen(0); ZetReset(); ZetClose(); bInt5=0; tmnt_soundlatch = 0; BurnYM2151Reset(); UPD7759Reset(); }
static int DrvDoReset() { SekOpen(0); SekReset(); SekClose(); ZetOpen(0); ZetReset(); ZetClose(); BurnYM3812Reset(); bEnableInterrupts = false; demonwld_hack = 0; return 0; }
static int DrvDoReset() { DrvReset = 0; memset (AllRam, 0, RamEnd - AllRam); M6809Open(0); M6809Reset(); M6809Close(); ZetOpen(0); ZetReset(); ZetClose(); BurnYM2203Reset(); return 0; }
static int SupermanDoReset() { SekOpen(0); SekReset(); SekClose(); ZetOpen(0); ZetReset(); Z80Bank = 0; nCurrentBank = 0; SupermanBankSwitch(0); ZetClose(); BurnYM2610Reset(); nCyclesDone[0] = nCyclesDone[1] = 0; return 0; }
static INT32 DrvDoReset() { SekOpen(0); nIRQPending = 0; SekSetIRQLine(0, CPU_IRQSTATUS_NONE); SekReset(); SekClose(); ZetOpen(0); ZetReset(); ZetClose(); MSM6295Reset(0); BurnYM2151Reset(); HiscoreReset(); return 0; }
INT32 Sf2mdtSoundReset() { ZetOpen(0); ZetReset(); BurnYM2151Reset(); MSM5205Reset(); Sf2mdtZ80BankAddress = 0x8000; ZetMapArea(0x8000, 0xbfff, 0, CpsZRom + Sf2mdtZ80BankAddress); ZetMapArea(0x8000, 0xbfff, 2, CpsZRom + Sf2mdtZ80BankAddress); ZetClose(); Sf2mdtSoundLatch = 0; Sf2mdtSampleBuffer1 = 0; Sf2mdtSampleBuffer2 = 0; Sf2mdtSampleSelect1 = 0; Sf2mdtSampleSelect2 = 0; return 0; }
static INT32 DrvReset() { // Reset machine if (Cps == 2 || PangEEP || Cps1Qs == 1 || CpsBootlegEEPROM) EEPROMReset(); SekOpen(0); SekReset(); SekClose(); if (((Cps & 1) && !Cps1DisablePSnd) || ((Cps == 2) && !Cps2DisableQSnd)) { ZetOpen(0); ZetReset(); ZetClose(); } if (Cps == 2) { // Disable beam-synchronized interrupts *((UINT16*)(CpsReg + 0x4E)) = BURN_ENDIAN_SWAP_INT16(0x0200); *((UINT16*)(CpsReg + 0x50)) = BURN_ENDIAN_SWAP_INT16(nCpsNumScanlines); *((UINT16*)(CpsReg + 0x52)) = BURN_ENDIAN_SWAP_INT16(nCpsNumScanlines); } SekOpen(0); CpsMapObjectBanks(0); SekClose(); nCpsCyclesExtra = 0; if (((Cps == 2) && !Cps2DisableQSnd) || Cps1Qs == 1) { // Sound init (QSound) QsndReset(); } if (CpsRunResetCallbackFunction) { CpsRunResetCallbackFunction(); } HiscoreReset(); return 0; }
void TC0140SYTCommWrite(UINT8 Data) { Data &= 0x0f; switch (tc0140syt.MainMode) { case 0x00: { tc0140syt.SlaveData[tc0140syt.MainMode++] = Data; return; } case 0x01: { tc0140syt.SlaveData[tc0140syt.MainMode++] = Data; tc0140syt.Status |= TC0140SYT_PORT01_FULL; tc0140syt.NmiReq = 1; return; } case 0x02: { tc0140syt.SlaveData[tc0140syt.MainMode++] = Data; return; } case 0x03: { tc0140syt.SlaveData[tc0140syt.MainMode++] = Data; tc0140syt.Status |= TC0140SYT_PORT23_FULL; tc0140syt.NmiReq = 1; return; } case 0x04: { if (Data) { ZetOpen(0); ZetReset(); ZetClose(); } return; } } }
static INT32 Wc90b1DoReset() { Wc90b1Scroll0X = Wc90b1Scroll0Y = 0; Wc90b1Scroll1X = Wc90b1Scroll1Y = 0; Wc90b1ScrollXLo = 0; Wc90b1SoundLatch = 0; Wc90b1MSM5205Next = 0; for (INT32 i = 0; i < 3; i++) { ZetOpen(i); ZetReset(); ZetClose(); } BurnYM2203Reset(); MSM5205Reset(); // HiscoreReset(); return 0; }
INT32 TaitoDoReset() { INT32 i; for (i = 0; i < TaitoNum68Ks; i++) { SekOpen(i); SekReset(); SekClose(); } for (i = 0; i < TaitoNumZ80s; i++) { ZetOpen(i); ZetReset(); ZetClose(); } if (TaitoNumYM2610) BurnYM2610Reset(); if (TaitoNumYM2151) BurnYM2151Reset(); if (TaitoNumYM2203) BurnYM2203Reset(); if (TaitoNumMSM5205) MSM5205Reset(); for (i = 0; i < TaitoNumMSM6295; i++) { MSM6295Reset(i); } if (TaitoNumEEPROM) EEPROMReset(); TaitoICReset(); TaitoZ80Bank = 0; TaitoSoundLatch = 0; TaitoRoadPalBank = 0; TaitoCpuACtrl = 0xff; memset (TaitoCoinLockout, 0, 4); return 0; }
void tc0140_comm_w(unsigned char d) { #ifdef logstuff bprintf(PRINT_NORMAL, "tc0140_comm_w %x\n",d); #endif switch (main_mode) { case 0x00: slave_data[main_mode++]=d; return; case 0x01: slave_data[main_mode++]=d; status |= TC0140SYT_PORT01_FULL; nmi_req=true; return; case 0x02: slave_data[main_mode++]=d; return; case 0x03: slave_data[main_mode++]=d; status |= TC0140SYT_PORT23_FULL; nmi_req=true; return; case 0x04: if (!d) { ZetReset(); } return; default: return; } }
int rastanInit() { int nRet=0; int nLen=0; //--------------Allocate Memory----------------- Mem=NULL; MemIndex(); nLen=MemEnd-(unsigned char *)0; Mem=(unsigned char *)malloc(nLen); if (Mem==NULL) return 1; memset(Mem,0,nLen); // blank all memory MemIndex(); // Index the allocated memory //--------------- Load Roms ------------------- nRet=LoadRoms(); if (nRet!=0) return 1; // Load the roms into memory taito_pal=rastan_pal; init_taito_gfx(); // Map in memory: // ----------------- Cpu 1 ------------------------ SekInit(0, 0x68000); // Allocate 1 68000 SekOpen(0); SekMapMemory( Rom ,0x000000,0x05ffff,SM_ROM); // 68000 Rom SekMapMemory(rastan_ram,0x10c000,0x10ffff,SM_RAM); //0x4000 SekMapMemory(rastan_src_pal,0x200000,0x200fff,SM_RAM); SekMapMemory(rastan_ram+0x4000,0x350008,0x350010,SM_RAM); SekMapMemory(PC090OJ_spritectrl,0x380000,0x380003,SM_RAM); SekMapMemory(rastan_ram+0x4012,0x3c0000,0x3c0003,SM_WRITE); SekMapMemory(PC080SN_word_0,0xc00000,0xc0ffff,SM_RAM); SekMapMemory(PC080SN_ctrl_word_0,0xc50000,0xc50003,SM_WRITE); SekMapMemory(PC090OJ_word_0,0xd00000,0xd03fff,SM_RAM); SekSetReadWordHandler(0, rastanReadWord); SekSetWriteWordHandler(0, rastanWriteWord); SekSetReadByteHandler(0, rastanReadByte); SekSetWriteByteHandler(0, rastanWriteByte); // ------------------------------------------------ SekClose(); ZetInit(1); ZetOpen(0); ZetSetReadHandler(RastanZ80Read); ZetSetWriteHandler(RastanZ80Write); ZetMapArea (0x0000,0x3FFF,0,z80_rom); ZetMapArea (0x0000,0x3FFF,2,z80_rom); ZetMapArea (0x4000,0x7FFF,0,z80_rom+0x4000); ZetMapArea (0x4000,0x7FFF,2,z80_rom+0x4000); ZetMapArea (0x8000,0x8FFF,0,z80_ram); ZetMapArea (0x8000,0x8FFF,1,z80_ram); ZetMemEnd(); ZetMemCallback(0x9000, 0xa001, 0); // Read ZetMemCallback(0x9000, 0xa001, 1); // Write ZetReset(); ZetClose(); //------------------------------------------------- BurnYM2151Init(4000000, 50.0); BurnYM2151SetIrqHandler(&RastanYM2151IRQHandler); BurnYM2151SetPortHandler(&rastanBankSwitch); nCurrentBank=0; // bank number 0 or 1 MSM5205Init(0,8000, 60,1); drvDoReset(); return 0; }
int twinhawkInit() { int nRet=0; int nLen=0; //--------------Allocate Memory----------------- Mem=NULL; MemIndex(); nLen=MemEnd-(unsigned char *)0; Mem=(unsigned char *)malloc(nLen); if (Mem==NULL) return 1; memset(Mem,0,nLen); // blank all memory MemIndex(); // Index the allocated memory //--------------- Load Roms ------------------- nRet=LoadRoms(); if (nRet!=0) return 1; // Load the roms into memory // Map in memory: // ----------------- Cpu 1 68k ------------------------ SekInit(0, 0x68000); // Allocate 1 68000 SekOpen(0); SekMapMemory( Rom ,0x000000,0x3ffff,SM_ROM); // 68000 Rom SekMapMemory(twinhawk_src_pal,0xb00000,0xb00FFF,SM_RAM); SekMapMemory(sysbvidattr,0xd00000,0xd00fff,SM_RAM); SekMapMemory(sysbvidram,0xe00000,0xe03fff,SM_RAM); SekMapMemory(twinhawk_ram,0xf00000,0xf03fff,SM_RAM); SekSetReadWordHandler(0, twinhawkReadWord); SekSetWriteWordHandler(0, twinhawkWriteWord); SekSetReadByteHandler(0, twinhawkReadByte); SekSetWriteByteHandler(0, twinhawkWriteByte); SekClose(); // ------------------------------------------------ // ----------------- Cpu 2 Z80 ------------------------ ZetInit(1); ZetOpen(0); ZetSetReadHandler(twinhawkZ80Read); ZetSetWriteHandler(twinhawkZ80Write); ZetMapArea (0x0000,0x3FFF,0,z80_rom); ZetMapArea (0x0000,0x3FFF,2,z80_rom); // ZetMapArea (0x4000,0x7FFF,0,z80_rom+0x4000); // ZetMapArea (0x4000,0x7FFF,2,z80_rom+0x4000); ZetMapArea (0xc000,0xdfff,0,z80_ram); ZetMapArea (0xc000,0xdfff,2,z80_ram); ZetMapArea (0xc000,0xdfff,1,z80_ram); ZetMemEnd(); ZetMemCallback(0xe000, 0xFFFF, 0); // Read ZetMemCallback(0xe000, 0xFFFF, 1); // Write ZetReset(); ZetClose(); //------------------------------------------------- //-------- sound stuff ---------------------------- //---------- YM2151 Setup ---------------------- BurnYM2151Init(4000000, 50.0); BurnYM2151SetIrqHandler(&twinhawkYM2151IRQHandler); nCurrentBank=-1; //-------------------------------------------------- // ------- GFX Init ------------------- taito_pal=twinhawk_pal; SysXInit(0); drvDoReset(); return 0; }
void __fastcall demonwldWriteWord(UINT32 a, UINT16 d) { switch (a) { case 0x400000: return; // nop case 0x400002: bEnableInterrupts = d & 0xff; return; case 0x400008: case 0x40000a: case 0x40000c: case 0x40000e: // toaplan1_bcu_control_w return; case 0x800000: // toaplan1_bcu_flipscreen_w return; case 0x800002: ToaBCU2SetRAMPointer(d); return; case 0x800004: case 0x800006: ToaBCU2WriteRAM(d); return; case 0x800010: case 0x800012: case 0x800014: case 0x800016: case 0x800018: case 0x80001a: case 0x80001c: case 0x80001e: BCU2Reg[(a & 0x0f) >> 1] = d; return; case 0xa00000: return; // nop case 0xa00002: ToaFCU2SetRAMPointer(d); return; case 0xa00004: ToaFCU2WriteRAM(d); return; case 0xa00006: ToaFCU2WriteRAMSize(d); return; case 0xe00000: nBCU2TileXOffset = d; return; case 0xe00002: nBCU2TileYOffset = d; return; case 0xe00006: // toaplan1_fcu_flipscreen_w return; case 0xe00008: if (d == 0) { ZetReset(); } return; case 0xe0000a: // dsp_ctrl_w return; } }