From 6659e2bd0390be6c73fefedaabdfbaf830b39978 Mon Sep 17 00:00:00 2001 From: dborth Date: Tue, 10 Nov 2009 22:13:41 +0000 Subject: [PATCH] sync with official --- source/fceultra/boards/253.cpp | 175 +++++++++++++++++ source/fceultra/boards/__dummy_mapper.cpp | 4 +- source/fceultra/boards/bandai.cpp | 2 +- source/fceultra/boards/bmc42in1r.cpp | 80 ++------ source/fceultra/fceu.cpp | 38 ++-- source/fceultra/fceu.h | 13 +- source/fceultra/ines.cpp | 170 ++++++++--------- source/fceultra/input.h | 1 + source/fceultra/mappers/253.cpp | 223 ---------------------- source/fceultra/movie.cpp | 34 ++-- source/fceultra/movie.h | 3 +- source/fceultra/unif.cpp | 1 - source/fceultra/unif.h | 1 - source/fceultra/version.h | 2 +- 14 files changed, 330 insertions(+), 417 deletions(-) create mode 100644 source/fceultra/boards/253.cpp delete mode 100644 source/fceultra/mappers/253.cpp diff --git a/source/fceultra/boards/253.cpp b/source/fceultra/boards/253.cpp new file mode 100644 index 0000000..22bceec --- /dev/null +++ b/source/fceultra/boards/253.cpp @@ -0,0 +1,175 @@ +/* FCE Ultra - NES/Famicom Emulator + * + * Copyright notice for this file: + * Copyright (C) 2009 CaH4e3 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "mapinc.h" + +static uint8 chrlo[8], chrhi[8], prg[2], mirr, vlock; +static int32 IRQa, IRQCount, IRQLatch, IRQClock; +static uint8 *WRAM=NULL; +static uint32 WRAMSIZE; +static uint8 *CHRRAM=NULL; +static uint32 CHRRAMSIZE; + +static SFORMAT StateRegs[]= +{ + {chrlo, 8, "CHRLO"}, + {chrhi, 8, "CHRHI"}, + {prg, 2, "PRGR"}, + {&mirr, 1, "MIRR"}, + {&vlock, 1, "VLOCK"}, + {&IRQa, 4, "IRQA"}, + {&IRQCount, 4, "IRQC"}, + {&IRQLatch, 4, "IRQL"}, + {&IRQClock, 4, "IRQCL"}, + {0} +}; + +static void Sync(void) +{ + uint8 i; + setprg8r(0x10,0x6000,0); + setprg8(0x8000,prg[0]); + setprg8(0xa000,prg[1]); + setprg8(0xc000,~1); + setprg8(0xe000,~0); + for(i=0; i<8; i++) + { + uint32 chr = chrlo[i]|(chrhi[i]<<8); + if(chrlo[i]==0xc8) + { + vlock = 0; + continue; + } + else if(chrlo[i]==0x88) + { + vlock = 1; + continue; + } + if(((chrlo[i]==4)||(chrlo[i]==5))&&!vlock) + setchr1r(0x10,i<<10,chr&1); + else + setchr1(i<<10,chr); + } + switch(mirr) + { + case 0: setmirror(MI_V); break; + case 1: setmirror(MI_H); break; + case 2: setmirror(MI_0); break; + case 3: setmirror(MI_1); break; + } +} + +static DECLFW(M253Write) +{ + if((A>=0xB000)&&(A<=0xE00C)) + { + uint8 ind=((((A&8)|(A>>8))>>3)+2)&7; + uint8 sar=A&4; + chrlo[ind]=(chrlo[ind]&(0xF0>>sar))|((V&0x0F)<>4; + Sync(); + } + else + switch(A) + { + case 0x8010: prg[0]=V; Sync(); break; + case 0xA010: prg[1]=V; Sync(); break; + case 0x9400: mirr=V&3; Sync(); break; + case 0xF000: IRQLatch = (IRQLatch & 0xF0) | (V & 0x0F); break; + case 0xF004: IRQLatch = (IRQLatch & 0x0F) | (V << 4); break; + case 0xF008: + IRQa = V&3; + if(IRQa&2) + { + IRQCount = IRQLatch; + IRQClock = 0; + } + X6502_IRQEnd(FCEU_IQEXT); + break; + } +} + +static void M253Power(void) +{ + Sync(); + SetReadHandler(0x6000,0x7FFF,CartBR); + SetWriteHandler(0x6000,0x7FFF,CartBW); + SetReadHandler(0x8000,0xFFFF,CartBR); + SetWriteHandler(0x8000,0xFFFF,M253Write); +} + +static void M253Close(void) +{ + if(WRAM) + FCEU_gfree(WRAM); + if(CHRRAM) + FCEU_gfree(CHRRAM); + WRAM=CHRRAM=NULL; +} + +static void M253IRQ(int cycles) +{ + if(IRQa&2) + { + if((IRQClock+=cycles)>=0x72) + { + IRQClock -= 0x72; + if(IRQCount==0xFF) + { + IRQCount = IRQLatch; + IRQa = IRQa|((IRQa&1)<<1); + X6502_IRQBegin(FCEU_IQEXT); + } + else + IRQCount++; + } + } +} + +static void StateRestore(int version) +{ + Sync(); +} + +void Mapper253_Init(CartInfo *info) +{ + info->Power=M253Power; + info->Close=M253Close; + MapIRQHook=M253IRQ; + GameStateRestore=StateRestore; + + CHRRAMSIZE=4096; + CHRRAM=(uint8*)FCEU_gmalloc(CHRRAMSIZE); + SetupCartCHRMapping(0x10,CHRRAM,CHRRAMSIZE,1); + AddExState(CHRRAM, CHRRAMSIZE, 0, "CRAM"); + + WRAMSIZE=8192; + WRAM=(uint8*)FCEU_gmalloc(WRAMSIZE); + SetupCartPRGMapping(0x10,WRAM,WRAMSIZE,1); + AddExState(WRAM, WRAMSIZE, 0, "WRAM"); + if(info->battery) + { + info->SaveGame[0]=WRAM; + info->SaveGameLen[0]=WRAMSIZE; + } + + AddExState(&StateRegs, ~0, 0, 0); +} diff --git a/source/fceultra/boards/__dummy_mapper.cpp b/source/fceultra/boards/__dummy_mapper.cpp index ac40c54..5c090b5 100644 --- a/source/fceultra/boards/__dummy_mapper.cpp +++ b/source/fceultra/boards/__dummy_mapper.cpp @@ -85,8 +85,8 @@ void MapperNNN_Init(CartInfo *info) /* CHRRAMSIZE=8192; CHRRAM=(uint8*)FCEU_gmalloc(CHRRAMSIZE); - SetupCartPRGMapping(0x10,CHRRAM,CHRRAMSIZE,1); - AddExState(CHRRAM, CHRRAMSIZE, 0, "WRAM"); + SetupCartCHRMapping(0x10,CHRRAM,CHRRAMSIZE,1); + AddExState(CHRRAM, CHRRAMSIZE, 0, "CRAM"); */ /* WRAMSIZE=8192; diff --git a/source/fceultra/boards/bandai.cpp b/source/fceultra/boards/bandai.cpp index 7844341..7e76727 100644 --- a/source/fceultra/boards/bandai.cpp +++ b/source/fceultra/boards/bandai.cpp @@ -48,7 +48,7 @@ static void BandaiIRQHook(int a) { X6502_IRQBegin(FCEU_IQEXT); IRQa = 0; - IRQCount = 0xFFFF; + IRQCount = -1; } } } diff --git a/source/fceultra/boards/bmc42in1r.cpp b/source/fceultra/boards/bmc42in1r.cpp index 15afeaf..bbd77eb 100644 --- a/source/fceultra/boards/bmc42in1r.cpp +++ b/source/fceultra/boards/bmc42in1r.cpp @@ -2,6 +2,7 @@ * * Copyright notice for this file: * Copyright (C) 2005 CaH4e3 + * Copyright (C) 2009 qeed * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,77 +18,47 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * BMC 42-in-1 reset switch + * BMC 42-in-1 + * it seems now, mapper not reset-based, + * tested on real hardware and it does menus switch by pressing just Select, not Reset + * new registers behaviour proven this too + * */ #include "mapinc.h" -extern uint32 ROM_size; -static uint8 hrd_sw; static uint8 latche[2]; static SFORMAT StateRegs[]= { - {&hrd_sw, 1, "DIPSW"}, {&latche, sizeof(latche), "LATCHE"}, - {&hrd_sw, 1, "HRDSW"}, {0} }; static void Sync(void) { - int bank = (latche[0] >> 1 & 0x0F) | - (latche[0] >> 3 & 0x10) | - (latche[1] << 5 & 0x20); - -/* if(!(latche&0x02)) - setprg32r(0,0x8000,(latche&0x3F)>>1); - else - { - setprg16r(0,0x8000,latche&0x3f); - setprg16r(0,0xC000,latche&0x3f); - } -*/ - /* the old one, doesnt work with 76 in 1 game - * since it doesn't account for all the PRG-ROM - if(!(latche&0x20)) - setprg32r(hrd_sw,0x8000,(latche>>1)&0x0f); - else - { - setprg16r(hrd_sw,0x8000,latche&0x1f); - setprg16r(hrd_sw,0xC000,latche&0x1f); - } - setmirror((latche>>6)&1);*/ + uint8 bank = (latche[0]&0x1f)|((latche[0]&0x80)>>2)|((latche[1]&1))<<6; if(!(latche[0] & 0x20)) - setprg32r(hrd_sw,0x8000,bank); + setprg32(0x8000,bank >> 1); else { - bank = (bank << 1) | (latche[0] & 1); - setprg16r(hrd_sw,0x8000,bank); - setprg16r(hrd_sw,0xC000,bank); + setprg16(0x8000,bank); + setprg16(0xC000,bank); } - setmirror((latche[0] & 0x40) ? MI_V : MI_H); + setmirror((latche[0]>>6)&1); + setchr8(0); } -static DECLFW(BMC42in1rWrite) +static DECLFW(M226Write) { latche[A & 1] = V; - //latche = V; Sync(); } -static void BMC42in1rReset(void) -{ - hrd_sw^=1; - Sync(); -} - -static void BMC42in1rPower(void) +static void M226Power(void) { latche[0] = latche[1] = 0; - hrd_sw=0; - setchr8(0); Sync(); - SetWriteHandler(0x8000,0xFFFF,BMC42in1rWrite); + SetWriteHandler(0x8000,0xFFFF,M226Write); SetReadHandler(0x8000,0xFFFF,CartBR); } @@ -96,30 +67,9 @@ static void StateRestore(int version) Sync(); } -void BMC42in1r_Init(CartInfo *info) -{ - info->Power=BMC42in1rPower; - info->Reset=BMC42in1rReset; - AddExState(&StateRegs, ~0, 0, 0); - GameStateRestore=StateRestore; -} - -static void M226Power(void) -{ - if(ROM_size==64) - SetupCartPRGMapping(1,PRGptr[0]+512*1024,512,0); - latche[0] = 0; - hrd_sw=0; - setchr8(0); - Sync(); - SetWriteHandler(0x8000,0xFFFF,BMC42in1rWrite); - SetReadHandler(0x8000,0xFFFF,CartBR); -} - void Mapper226_Init(CartInfo *info) { info->Power=M226Power; - info->Reset=BMC42in1rReset; AddExState(&StateRegs, ~0, 0, 0); GameStateRestore=StateRestore; } diff --git a/source/fceultra/fceu.cpp b/source/fceultra/fceu.cpp index 0c3ea46..eeb5820 100644 --- a/source/fceultra/fceu.cpp +++ b/source/fceultra/fceu.cpp @@ -308,9 +308,9 @@ static void AllocBuffers() void win_AllocBuffers(uint8 **GameMemBlock, uint8 **RAM); win_AllocBuffers(&GameMemBlock, &RAM); -#else +#else - GameMemBlock = (uint8*)FCEU_gmalloc(131072); + GameMemBlock = (uint8*)FCEU_gmalloc(GAME_MEM_BLOCK_SIZE); RAM = (uint8*)FCEU_gmalloc(0x800); #endif @@ -320,7 +320,7 @@ static void FreeBuffers() { #ifdef _USE_SHARED_MEMORY_ void win_FreeBuffers(uint8 *GameMemBlock, uint8 *RAM); win_FreeBuffers(GameMemBlock, RAM); -#else +#else FCEU_free(GameMemBlock); FCEU_free(RAM); #endif @@ -330,7 +330,7 @@ static void FreeBuffers() { uint8 PAL=0; static DECLFW(BRAML) -{ +{ RAM[A]=V; #ifdef _S9XLUA_H CallRegisteredLuaMemHook(A, 1, V, LUAMEMHOOK_WRITE); @@ -674,12 +674,12 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski *SoundBuf=0; *SoundBufSize=0; } - else + else { *SoundBuf=WaveFinal; *SoundBufSize=ssize; } - + if (EmulationPaused&2 && ( !frameAdvanceLagSkip || !lagFlag) ) //Lots of conditions here. EmulationPaused&2 must be true. In addition frameAdvanceLagSkip or lagFlag must be false { @@ -689,12 +689,12 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski if(soundoptions&SO_MUTEFA) //mute the frame advance if the user requested it *SoundBufSize=0; //keep sound muted #endif - + } - + currMovieData.TryDumpIncremental(); - - if (lagFlag) + + if (lagFlag) { lagCounter++; justLagged = true; @@ -706,8 +706,8 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski } void FCEUI_CloseGame(void) -{ - if(!FCEU_IsValidUI(FCEUI_CLOSEGAME)) +{ + if(!FCEU_IsValidUI(FCEUI_CLOSEGAME)) return; CloseGame(); @@ -745,7 +745,7 @@ void hand(X6502 *X, int type, unsigned int A) } int suppressAddPowerCommand=0; // hack... yeah, I know... -void PowerNES(void) +void PowerNES(void) { //void MapperInit(); //MapperInit(); @@ -784,7 +784,7 @@ void PowerNES(void) extern int disableBatteryLoading; if(disableBatteryLoading) GameInterface(GI_RESETSAVE); - + timestampbase=0; LagCounterReset(); @@ -801,9 +801,9 @@ void FCEU_ResetVidSys(void) int w; if(GameInfo->vidsys==GIV_NTSC) - w=0; + w=0; else if(GameInfo->vidsys==GIV_PAL) - w=1; + w=1; else w=FSettings.PAL; @@ -943,7 +943,7 @@ void UpdateAutosave(void) { if(!EnableAutosave) return; - + char * f; AutosaveCounter = (AutosaveCounter + 1) % 256; if(AutosaveCounter == 0) @@ -1127,7 +1127,7 @@ bool FCEUXLoad(const char *name, FCEUFILE *fp) cart->chrPages = head.VROM_size; - cart->mirroring = (head.ROM_type&1); + cart->mirroring = (head.ROM_type&1); if(head.ROM_type&8) cart->mirroring=2; //skip trainer @@ -1149,7 +1149,7 @@ bool FCEUXLoad(const char *name, FCEUFILE *fp) ResetCartMapping(); SetupCartPRGMapping(0,(uint8*)cart->PRG,cart->prgSize,0); SetupCartCHRMapping(0,(uint8*)cart->CHR,cart->chrSize,0); - + return true; } diff --git a/source/fceultra/fceu.h b/source/fceultra/fceu.h index 83e2fdf..da9becf 100644 --- a/source/fceultra/fceu.h +++ b/source/fceultra/fceu.h @@ -42,6 +42,9 @@ extern uint8 MMC50x5130; extern uint8 MMC5HackSPScroll; extern uint8 MMC5HackSPPage; + +#define GAME_MEM_BLOCK_SIZE 131072 + extern uint8 *RAM; //shared memory modifications extern uint8 *GameMemBlock; //shared memory modifications extern int EmulationPaused; @@ -74,8 +77,8 @@ typedef struct { int PAL; int NetworkPlay; int SoundVolume; //Master volume - int TriangleVolume; - int Square1Volume; + int TriangleVolume; + int Square1Volume; int Square2Volume; int NoiseVolume; int PCMVolume; @@ -88,11 +91,11 @@ typedef struct { //the number of scanlines in the currently selected configuration int TotalScanlines() { return LastSLine - FirstSLine + 1; } - //Driver-supplied user-selected first and last rendered scanlines. + //Driver-supplied user-selected first and last rendered scanlines. //Usr*SLine[0] is for NTSC, Usr*SLine[1] is for PAL. int UsrFirstSLine[2]; int UsrLastSLine[2]; - + //this variable isn't used at all, snap is always name-based //bool SnapName; uint32 SndRate; @@ -121,7 +124,7 @@ extern uint8 Exit; extern uint8 pale; extern uint8 vsdip; -//#define FCEUDEF_DEBUGGER //mbg merge 7/17/06 - cleaning out conditional compiles +//#define FCEUDEF_DEBUGGER //mbg merge 7/17/06 - cleaning out conditional compiles #define JOY_A 1 #define JOY_B 2 diff --git a/source/fceultra/ines.cpp b/source/fceultra/ines.cpp index 2375e8c..c312bd9 100644 --- a/source/fceultra/ines.cpp +++ b/source/fceultra/ines.cpp @@ -1,7 +1,7 @@ /* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: -* Copyright (C) 1998 BERO +* Copyright (C) 1998 BERO * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify @@ -78,7 +78,7 @@ void (*MapperReset)(void); static int MapperNo=0; -/* MapperReset() is called when the NES is reset(with the reset button). +/* MapperReset() is called when the NES is reset(with the reset button). Mapperxxx_init is called when the NES has been powered on. */ @@ -132,8 +132,8 @@ void iNESGI(GI h) //bbit edited: removed static keyword { if(mapROM) { - UnmapViewOfFile(mapROM); - CloseHandle(mapROM); + UnmapViewOfFile(mapROM); + CloseHandle(mapROM); ROM=0; } else @@ -185,79 +185,79 @@ static void SetInput(void) { static struct INPSEL moo[]= { - {0x3a1694f9,SI_GAMEPAD,SI_GAMEPAD,SIFC_4PLAYER}, // Nekketsu Kakutou Densetsu + {0x3a1694f9,SI_GAMEPAD,SI_GAMEPAD,SIFC_4PLAYER}, // Nekketsu Kakutou Densetsu - {0xc3c0811d,SI_GAMEPAD,SI_GAMEPAD,SIFC_OEKAKIDS}, // The two "Oeka Kids" games - {0x9d048ea4,SI_GAMEPAD,SI_GAMEPAD,SIFC_OEKAKIDS}, // + {0xc3c0811d,SI_GAMEPAD,SI_GAMEPAD,SIFC_OEKAKIDS}, // The two "Oeka Kids" games + {0x9d048ea4,SI_GAMEPAD,SI_GAMEPAD,SIFC_OEKAKIDS}, // - {0xaf4010ea,SI_GAMEPAD,SI_POWERPADB,SIFC_UNSET}, // World Class Track Meet - {0xd74b2719,SI_GAMEPAD,SI_POWERPADB,SIFC_UNSET}, // Super Team Games - {0x61d86167,SI_GAMEPAD,SI_POWERPADB,SIFC_UNSET}, // Street Cop - {0x6435c095,SI_GAMEPAD,SI_POWERPADB,SIFC_UNSET}, // Short Order/Eggsplode + {0xaf4010ea,SI_GAMEPAD,SI_POWERPADB,SIFC_UNSET}, // World Class Track Meet + {0xd74b2719,SI_GAMEPAD,SI_POWERPADB,SIFC_UNSET}, // Super Team Games + {0x61d86167,SI_GAMEPAD,SI_POWERPADB,SIFC_UNSET}, // Street Cop + {0x6435c095,SI_GAMEPAD,SI_POWERPADB,SIFC_UNSET}, // Short Order/Eggsplode - {0x47232739,SI_GAMEPAD,SI_GAMEPAD,SIFC_TOPRIDER}, // Top Rider + {0x47232739,SI_GAMEPAD,SI_GAMEPAD,SIFC_TOPRIDER}, // Top Rider - {0x48ca0ee1,SI_GAMEPAD,SI_GAMEPAD,SIFC_BWORLD}, // Barcode World - {0x9f8f200a,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERA}, // Super Mogura Tataki!! - Pokkun Moguraa - {0x9044550e,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERA}, // Rairai Kyonshizu - {0x2f128512,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERA}, // Jogging Race - {0x60ad090a,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERA}, // Athletic World + {0x48ca0ee1,SI_GAMEPAD,SI_GAMEPAD,SIFC_BWORLD}, // Barcode World + {0x9f8f200a,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERA}, // Super Mogura Tataki!! - Pokkun Moguraa + {0x9044550e,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERA}, // Rairai Kyonshizu + {0x2f128512,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERA}, // Jogging Race + {0x60ad090a,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERA}, // Athletic World - {0x8a12a7d9,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Totsugeki Fuuun Takeshi Jou - {0xea90f3e2,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Running Stadium - {0x370ceb65,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Meiro Dai Sakusen - // Bad dump? {0x69ffb014,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Fuun Takeshi Jou 2 - {0x6cca1c1f,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Dai Undoukai - {0x29de87af,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Aerobics Studio - {0xbba58be5,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Family Trainer: Manhattan Police - {0xea90f3e2,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Family Trainer: Running Stadium + {0x8a12a7d9,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Totsugeki Fuuun Takeshi Jou + {0xea90f3e2,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Running Stadium + {0x370ceb65,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Meiro Dai Sakusen + // Bad dump? {0x69ffb014,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Fuun Takeshi Jou 2 + {0x6cca1c1f,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Dai Undoukai + {0x29de87af,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Aerobics Studio + {0xbba58be5,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Family Trainer: Manhattan Police + {0xea90f3e2,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, // Family Trainer: Running Stadium - {0xd9f45be9,SI_GAMEPAD,SI_GAMEPAD,SIFC_QUIZKING}, // Gimme a Break ... - {0x1545bd13,SI_GAMEPAD,SI_GAMEPAD,SIFC_QUIZKING}, // Gimme a Break ... 2 + {0xd9f45be9,SI_GAMEPAD,SI_GAMEPAD,SIFC_QUIZKING}, // Gimme a Break ... + {0x1545bd13,SI_GAMEPAD,SI_GAMEPAD,SIFC_QUIZKING}, // Gimme a Break ... 2 - {0x7b44fb2a,SI_GAMEPAD,SI_GAMEPAD,SIFC_MAHJONG}, // Ide Yousuke Meijin no Jissen Mahjong 2 - {0x9fae4d46,SI_GAMEPAD,SI_GAMEPAD,SIFC_MAHJONG}, // Ide Yousuke Meijin no Jissen Mahjong + {0x7b44fb2a,SI_GAMEPAD,SI_GAMEPAD,SIFC_MAHJONG}, // Ide Yousuke Meijin no Jissen Mahjong 2 + {0x9fae4d46,SI_GAMEPAD,SI_GAMEPAD,SIFC_MAHJONG}, // Ide Yousuke Meijin no Jissen Mahjong - {0x980be936,SI_GAMEPAD,SI_GAMEPAD,SIFC_HYPERSHOT}, // Hyper Olympic - {0x21f85681,SI_GAMEPAD,SI_GAMEPAD,SIFC_HYPERSHOT}, // Hyper Olympic (Gentei Ban) - {0x915a53a7,SI_GAMEPAD,SI_GAMEPAD,SIFC_HYPERSHOT}, // Hyper Sports - {0xad9c63e2,SI_GAMEPAD,SI_UNSET,SIFC_SHADOW}, // Space Shadow + {0x980be936,SI_GAMEPAD,SI_GAMEPAD,SIFC_HYPERSHOT}, // Hyper Olympic + {0x21f85681,SI_GAMEPAD,SI_GAMEPAD,SIFC_HYPERSHOT}, // Hyper Olympic (Gentei Ban) + {0x915a53a7,SI_GAMEPAD,SI_GAMEPAD,SIFC_HYPERSHOT}, // Hyper Sports + {0xad9c63e2,SI_GAMEPAD,SI_UNSET,SIFC_SHADOW}, // Space Shadow - {0x24598791,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Duck Hunt - {0xff24d794,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Hogan's Alley - {0xbeb8ab01,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Gumshoe - {0xde8fd935,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // To the Earth - {0xedc3662b,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Operation Wolf - {0x2a6559a1,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Operation Wolf (J) + {0x24598791,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Duck Hunt + {0xff24d794,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Hogan's Alley + {0xbeb8ab01,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Gumshoe + {0xde8fd935,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // To the Earth + {0xedc3662b,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Operation Wolf + {0x2a6559a1,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Operation Wolf (J) - {0x23d17f5e,SI_GAMEPAD,SI_ZAPPER,SIFC_NONE}, // The Lone Ranger - {0xb8b9aca3,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Wild Gunman - {0x5112dc21,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Wild Gunman - {0x4318a2f8,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Barker Bill's Trick Shooting - {0x5ee6008e,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Mechanized Attack - {0x3e58a87e,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Freedom Force + {0x23d17f5e,SI_GAMEPAD,SI_ZAPPER,SIFC_NONE}, // The Lone Ranger + {0xb8b9aca3,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Wild Gunman + {0x5112dc21,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Wild Gunman + {0x4318a2f8,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Barker Bill's Trick Shooting + {0x5ee6008e,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Mechanized Attack + {0x3e58a87e,SI_UNSET,SI_ZAPPER,SIFC_NONE}, // Freedom Force {0xe9a7fe9e,SI_UNSET,SI_MOUSE,SIFC_NONE}, // Educational Computer 2000 //mbg merge 7/17/06 added -- appears to be from newer MM build - {0x851eb9be,SI_GAMEPAD,SI_ZAPPER,SIFC_NONE}, // Shooting Range - {0x74bea652,SI_GAMEPAD,SI_ZAPPER,SIFC_NONE}, // Supergun 3-in-1 - {0x32fb0583,SI_UNSET,SI_ARKANOID,SIFC_NONE}, // Arkanoid(NES) - {0xd89e5a67,SI_UNSET,SI_UNSET,SIFC_ARKANOID}, // Arkanoid (J) - {0x0f141525,SI_UNSET,SI_UNSET,SIFC_ARKANOID}, // Arkanoid 2(J) + {0x851eb9be,SI_GAMEPAD,SI_ZAPPER,SIFC_NONE}, // Shooting Range + {0x74bea652,SI_GAMEPAD,SI_ZAPPER,SIFC_NONE}, // Supergun 3-in-1 + {0x32fb0583,SI_UNSET,SI_ARKANOID,SIFC_NONE}, // Arkanoid(NES) + {0xd89e5a67,SI_UNSET,SI_UNSET,SIFC_ARKANOID}, // Arkanoid (J) + {0x0f141525,SI_UNSET,SI_UNSET,SIFC_ARKANOID}, // Arkanoid 2(J) - {0x912989dc,SI_UNSET,SI_UNSET,SIFC_FKB}, // Playbox BASIC - {0xf7606810,SI_UNSET,SI_UNSET,SIFC_FKB}, // Family BASIC 2.0A - {0x895037bc,SI_UNSET,SI_UNSET,SIFC_FKB}, // Family BASIC 2.1a - {0xb2530afc,SI_UNSET,SI_UNSET,SIFC_FKB}, // Family BASIC 3.0 - {0x82f1fb96,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // Subor 1.0 Russian - {0xabb2f974,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // Study and Game 32-in-1 - {0xd5d6eac4,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // Edu (As) - {0x589b6b0d,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // SuporV20 - {0x5e073a1b,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // Supor English (Chinese) + {0x912989dc,SI_UNSET,SI_UNSET,SIFC_FKB}, // Playbox BASIC + {0xf7606810,SI_UNSET,SI_UNSET,SIFC_FKB}, // Family BASIC 2.0A + {0x895037bc,SI_UNSET,SI_UNSET,SIFC_FKB}, // Family BASIC 2.1a + {0xb2530afc,SI_UNSET,SI_UNSET,SIFC_FKB}, // Family BASIC 3.0 + {0x82f1fb96,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // Subor 1.0 Russian + {0xabb2f974,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // Study and Game 32-in-1 + {0xd5d6eac4,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // Edu (As) + {0x589b6b0d,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // SuporV20 + {0x5e073a1b,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // Supor English (Chinese) {0x8b265862,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, - {0x41401c6d,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // SuporV40 + {0x41401c6d,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // SuporV40 {0x41ef9ac4,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, - {0x368c19a8,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // LIKO Study Cartridge - {0x543ab532,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // LIKO Color Lines + {0x368c19a8,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // LIKO Study Cartridge + {0x543ab532,SI_UNSET,SI_UNSET,SIFC_SUBORKB}, // LIKO Color Lines {0,SI_UNSET,SI_UNSET,SIFC_UNSET} }; int x=0; @@ -311,7 +311,7 @@ void CheckBad(uint64 md5partial) struct CHINF { - uint32 crc32; + uint32 crc32; int32 mapper; int32 mirror; }; @@ -493,7 +493,7 @@ static void CheckHInfo(void) /* Four-screen mirroring implicitly set. */ if(MapperNo==99) - Mirroring=2; + Mirroring=2; if(tofix) { @@ -507,7 +507,7 @@ static void CheckHInfo(void) sprintf(gigastr+strlen(gigastr),"Mirroring should be set to \"%s\". ",mstr[Mirroring&3]); } if(tofix&4) - strcat(gigastr,"The battery-backed bit should be set. "); + strcat(gigastr,"The battery-backed bit should be set. "); if(tofix&8) strcat(gigastr,"This game should not have any CHR ROM. "); strcat(gigastr,"\n"); @@ -521,14 +521,14 @@ typedef struct { } NewMI; //this is for games that is not the a power of 2 -//mapper based for now... +//mapper based for now... //not really accurate but this works since games -//that are not in the power of 2 tends to come +//that are not in the power of 2 tends to come //in obscure mappers themselves which supports such //size static int not_power2[] = { - 228 + 228 }; int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode) @@ -563,11 +563,11 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode) // ROM_size = head.ROM_size; VROM_size = head.VROM_size; - + int round = true; for (int i = 0; i != sizeof(not_power2)/sizeof(not_power2[0]); ++i) { - //for games not to the power of 2, so we just read enough + //for games not to the power of 2, so we just read enough //prg rom from it, but we have to keep ROM_size to the power of 2 //since PRGCartMapping wants ROM_size to be to the power of 2 //so instead if not to power of 2, we just use head.ROM_size when @@ -614,7 +614,7 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode) { mapVROM = CreateFileMapping((HANDLE)0xFFFFFFFF,NULL,PAGE_READWRITE, 0, VROM_size<<13,"fceu.VROM"); VROM = (uint8 *)MapViewOfFile(mapVROM, FILE_MAP_WRITE, 0, 0, 0); - if( !VROM ) + if( !VROM ) { UnmapViewOfFile(mapROM); CloseHandle(mapROM); @@ -654,7 +654,7 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode) if(VROM_size) FCEU_fread(VROM,0x2000,head.VROM_size,fp); - md5_starts(&md5); + md5_starts(&md5); md5_update(&md5,ROM,ROM_size<<14); iNESGameCRC32=CalcCRC32(0,ROM,ROM_size<<14); @@ -675,7 +675,7 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode) { int x; FCEU_printf(" ROM MD5: 0x"); - for(x=0;x<16;x++) + for(x=0;x<16;x++) FCEU_printf("%02x",iNESCart.MD5[x]); FCEU_printf("\n"); } @@ -692,7 +692,7 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode) for(x=0;x<8;x++) { partialmd5 |= (uint64)iNESCart.MD5[7-x] << (x*8); - } + } FCEU_VSUniCheck(partialmd5, &MapperNo, &Mirroring); } @@ -781,7 +781,7 @@ int iNesSaveAs(char* name) { //adelikat: TODO: iNesSave() and this have pretty much the same code, outsource the common code to a single function FILE *fp; - + if(GameInfo->type != GIT_CART)return 0; if(GameInterface!=iNESGI)return 0; @@ -877,12 +877,12 @@ void ROM_BANK8(uint32 A, uint32 V) void ROM_BANK16(uint32 A, uint32 V) { setprg16(A,V); - if(A>=0x8000) + if(A>=0x8000) { PRGBankList[((A-0x8000)>>13)]=V<<1; PRGBankList[((A-0x8000)>>13)+1]=(V<<1)+1; } -} +} void ROM_BANK32(uint32 V) { @@ -922,7 +922,7 @@ static void NONE_init(void) ROM_BANK16(0x8000,0); ROM_BANK16(0xC000,~0); - if(VROM_size) + if(VROM_size) VROM_BANK8(0); else setvram8(CHRRAM); @@ -941,7 +941,7 @@ void (*MapInitTab[256])(void)= Mapper9_init, Mapper10_init, 0, //Mapper11_init, - 0, + 0, 0, //Mapper13_init, 0, 0, //Mapper15_init, @@ -1209,7 +1209,7 @@ void iNESStateRestore(int version) setprg8(0x8000+x*8192,PRGBankList[x]); if(VROM_size) - for(x=0;x<8;x++) + for(x=0;x<8;x++) setchr1(0x400*x,CHRBankList[x]); if(0) switch(Mirroring) @@ -1247,7 +1247,7 @@ static void iNESPower(void) if(head.ROM_type&2) memset(GameMemBlock+8192,0,sizeof(GameMemBlock)-8192); else - memset(GameMemBlock,0,sizeof(GameMemBlock)); + memset(GameMemBlock,0,GAME_MEM_BLOCK_SIZE); NONE_init(); ResetExState(0,0); @@ -1263,7 +1263,7 @@ static void iNESPower(void) if(head.ROM_type&8) AddExState(ExtraNTARAM, 2048, 0, "EXNR"); - /* Exclude some mappers whose emulation code handle save state stuff + /* Exclude some mappers whose emulation code handle save state stuff themselves. */ if(type && type!=13 && type!=96) { @@ -1276,7 +1276,7 @@ static void iNESPower(void) for(x=0;x<8;x++) { char tak[8]; - sprintf(tak,"CBL%d",x); + sprintf(tak,"CBL%d",x); AddExState(&CHRBankList[x], 2, 1,tak); } } @@ -1290,7 +1290,7 @@ static void iNESPower(void) typedef struct { - int number; + int number; void (*init)(CartInfo *); } BMAPPING; @@ -1422,7 +1422,7 @@ static BMAPPING bmap[] = { // {220, UNLCN22M_Init}, // {220, BMCT2271_Init}, // {220, UNLDANCE_Init}, - + {221, UNLN625092_Init}, {222, Mapper222_Init}, {226, Mapper226_Init}, diff --git a/source/fceultra/input.h b/source/fceultra/input.h index 2d9373d..9a432e7 100644 --- a/source/fceultra/input.h +++ b/source/fceultra/input.h @@ -265,6 +265,7 @@ extern struct EMUCMDTABLE FCEUI_CommandTable[]; extern unsigned int lagCounter; extern bool lagCounterDisplay; extern char lagFlag; +extern bool turbo; void LagCounterReset(); #endif //_INPUT_H_ diff --git a/source/fceultra/mappers/253.cpp b/source/fceultra/mappers/253.cpp deleted file mode 100644 index 54ad388..0000000 --- a/source/fceultra/mappers/253.cpp +++ /dev/null @@ -1,223 +0,0 @@ -//Thanks to VirtualNES developer for reverse engineering this mapper -//first screen add 32 to chr -//second screen at 0x42000 -#include "mapinc.h" - -static uint8 reg[9], VRAM_switch; -static int32 irq_enable, irq_counter, irq_latch, irq_clock; - -static SFORMAT StateRegs[]= -{ - { reg, sizeof(reg), "MAPPER_REGS" }, - { &VRAM_switch, sizeof(VRAM_switch), "MAPPER_VRAMSWITCH" }, - { &irq_enable, sizeof(irq_enable), "MAPPER_IRQ_ENABLE" }, - { &irq_counter, sizeof(irq_counter), "MAPPER_IRQ_COUNTER" }, - { &irq_latch, sizeof(irq_latch), "MAPPER_IRQ_LATCH" }, - { &irq_clock, sizeof(irq_clock), "MAPPER_IRQ_CLOCK" }, - { 0 } -}; - -static void Mapper253_IRQHook(int cycles) -{ - //basically, this happens at every frame - //0x72 is 114 cycles, so like one scanline - //happens for 0xff scanlines so 256 scanlines (frame) - if( irq_enable & 0x02 ) - { - if( (irq_clock+=cycles) >= 0x72 ) - { - irq_clock -= 0x72; - - if( irq_counter == 0xFF) - { - irq_counter = irq_latch; - irq_enable = (irq_enable & 0x01) * 3; - X6502_IRQBegin(FCEU_IQEXT); - } else - { - irq_counter++; - } - } - } -} - -static void SetBank_PPUSUB(int bank, int page) -{ - if(page == 0x88) - { - VRAM_switch = 0; - return; - } - else if(page == 0xC8) - { - VRAM_switch = 1; - return; - } - if ((page == 4) || (page == 5)) - { - // [ES-1064] Qi Long Zhu (C).NES game uses CHR-RAM for these pages - //and doesn't seem to set VRAM switch so use - //CHR-RAM as default for now - /*if (VRAM_switch == 0) - setchr1(bank << 10, page); //CHR-ROM - else*/ - setvramb1(&CHRRAM[page << 10], page << 10, 0); //CHR-RAM - } - else - setchr1(bank << 10, page); -} - -static DECLFW(Mapper253_Write) -{ - if (A == 0x8010) //8kb select at 0x8000 - { - setprg8(0x8000, V); - return; - } - - if (A == 0xA010) //8kb select at 0xA000 - { - setprg8(0xA000, V); - return; - } - - if (A == 0x9400) //Mirroring - { - V &= 0x03; - switch (V) - { - case 0: - setmirror(MI_V); - break; - case 1: - setmirror(MI_H); - break; - case 2: - setmirror(MI_0); - break; - case 3: - setmirror(MI_1); - break; - } - return; - } - - switch (A & 0xF00C) - { - case 0xB000: - reg[0] = (reg[0] & 0xF0) | (V & 0x0F); - SetBank_PPUSUB( 0, reg[0] ); - break; - case 0xB004: - reg[0] = (reg[0] & 0x0F) | ((V & 0x0F) << 4); - SetBank_PPUSUB( 0, reg[0] + ((V>>4)*0x100) ); - break; - case 0xB008: - reg[1] = (reg[1] & 0xF0) | (V & 0x0F); - SetBank_PPUSUB( 1, reg[1] ); - break; - case 0xB00C: - reg[1] = (reg[1] & 0x0F) | ((V & 0x0F) << 4); - SetBank_PPUSUB( 1, reg[1] + ((V>>4)*0x100) ); - break; - case 0xC000: - reg[2] = (reg[2] & 0xF0) | (V & 0x0F); - SetBank_PPUSUB( 2, reg[2] ); - break; - case 0xC004: - reg[2] = (reg[2] & 0x0F) | ((V & 0x0F) << 4); - SetBank_PPUSUB( 2, reg[2] + ((V>>4)*0x100) ); - break; - case 0xC008: - reg[3] = (reg[3] & 0xF0) | (V & 0x0F); - SetBank_PPUSUB( 3, reg[3] ); - break; - case 0xC00C: - reg[3] = (reg[3] & 0x0F) | ((V & 0x0F) << 4); - SetBank_PPUSUB( 3, reg[3] + ((V>>4)*0x100) ); - break; - case 0xD000: - reg[4] = (reg[4] & 0xF0) | (V & 0x0F); - SetBank_PPUSUB( 4, reg[4] ); - break; - case 0xD004: - reg[4] = (reg[4] & 0x0F) | ((V & 0x0F) << 4); - SetBank_PPUSUB( 4, reg[4] + ((V>>4)*0x100) ); - break; - case 0xD008: - reg[5] = (reg[5] & 0xF0) | (V & 0x0F); - SetBank_PPUSUB( 5, reg[5] ); - break; - case 0xD00C: - reg[5] = (reg[5] & 0x0F) | ((V & 0x0F) << 4); - SetBank_PPUSUB( 5, reg[5] + ((V>>4)*0x100) ); - break; - case 0xE000: - reg[6] = (reg[6] & 0xF0) | (V & 0x0F); - SetBank_PPUSUB( 6, reg[6] ); - break; - case 0xE004: - reg[6] = (reg[6] & 0x0F) | ((V & 0x0F) << 4); - SetBank_PPUSUB( 6, reg[6] + ((V>>4)*0x100) ); - break; - case 0xE008: - reg[7] = (reg[7] & 0xF0) | (V & 0x0F); - SetBank_PPUSUB( 7, reg[7] ); - break; - case 0xE00C: - reg[7] = (reg[7] & 0x0F) | ((V & 0x0F) << 4); - SetBank_PPUSUB( 7, reg[7] + ((V>>4)*0x100) ); - break; - case 0xF000: - irq_latch = (irq_latch & 0xF0) | (V & 0x0F); - break; - case 0xF004: - irq_latch = (irq_latch & 0x0F) | ((V & 0x0F) << 4); - break; - case 0xF008: - irq_enable = V & 0x03; - if (irq_enable & 0x02) - { - irq_counter = irq_latch; - irq_clock = 0; - } - X6502_IRQEnd(FCEU_IQEXT); - break; - } -} - -static void Mapper253_Power(void) -{ - int i; - for (i = 0; i != 8; ++i) - reg[i] = i; - - reg[8] = 0; - irq_enable = 0; - irq_counter = 0; - irq_latch = 0; - irq_clock = 0; - VRAM_switch = 0; - - setprg16(0x8000, 0); //first bank - setprg16(0xC000, head.ROM_size - 1); //last bank - setchr8(0); - - SetWriteHandler(0x8000, 0xFFFF, Mapper253_Write); - SetReadHandler(0x8000, 0xFFFF, CartBR); -} - -static void Mapper253_Close(void) -{ -} - -void Mapper253_Init(CartInfo *info) -{ - info->Power = Mapper253_Power; - MapIRQHook = Mapper253_IRQHook; - info->Close = Mapper253_Close; - SetWriteHandler(0x8000, 0xFFFF, Mapper253_Write); - SetReadHandler(0x8000, 0xFFFF, CartBR); - AddExState(StateRegs, ~0, 0, 0); -} - diff --git a/source/fceultra/movie.cpp b/source/fceultra/movie.cpp index f3d49f6..68c08fb 100644 --- a/source/fceultra/movie.cpp +++ b/source/fceultra/movie.cpp @@ -8,6 +8,7 @@ #include #include + #include "version.h" #include "types.h" #include "utils/endian.h" @@ -344,7 +345,7 @@ MovieData::MovieData() : version(MOVIE_VERSION) , emuVersion(FCEU_VERSION_NUMERIC) , palFlag(false) - , rerecordCount(1) + , rerecordCount(0) , binaryFlag(false) , greenZoneCount(0) { @@ -723,19 +724,26 @@ static void poweron(bool shouldDisableBatteryLoading) void FCEUMOV_EnterTasEdit() { #ifndef GEKKO - //stop any current movie activity - FCEUI_StopMovie(); + if (movieMode == MOVIEMODE_INACTIVE) + { + //stop any current movie activity + FCEUI_StopMovie(); - //clear the current movie - currFrameCounter = 0; - currMovieData = MovieData(); - currMovieData.guid.newGuid(); - currMovieData.palFlag = FCEUI_GetCurrentVidSystem(0,0)!=0; - currMovieData.romChecksum = GameInfo->MD5; - currMovieData.romFilename = FileBase; + //clear the current movie + currFrameCounter = 0; + currMovieData = MovieData(); + currMovieData.guid.newGuid(); + currMovieData.palFlag = FCEUI_GetCurrentVidSystem(0,0)!=0; + currMovieData.romChecksum = GameInfo->MD5; + currMovieData.romFilename = FileBase; - //reset the rom - poweron(false); + //reset the rom + poweron(false); + } else { + FCEUI_StopMovie(); + + currMovieData.greenZoneCount=currFrameCounter; + } //todo - think about this //ResetInputTypes(); @@ -747,7 +755,7 @@ void FCEUMOV_EnterTasEdit() //and enter tasedit mode movieMode = MOVIEMODE_TASEDIT; - + currMovieData.TryDumpIncremental(); FCEU_DispMessage("Tasedit engaged"); diff --git a/source/fceultra/movie.h b/source/fceultra/movie.h index 6296b2b..c233866 100644 --- a/source/fceultra/movie.h +++ b/source/fceultra/movie.h @@ -246,6 +246,7 @@ extern bool subtitlesOnAVI; extern bool freshMovie; extern bool movie_readonly; extern bool autoMovieBackup; +extern int pauseframe; //-------------------------------------------------- bool CheckFileExists(const char* filename); //Receives a filename (fullpath) and checks to see if that file exists void FCEUI_MakeBackupMovie(bool dispMessage); @@ -271,4 +272,4 @@ void LoadSubtitles(MovieData); void ProcessSubtitles(void); void FCEU_DisplaySubtitles(char *format, ...); -#endif //__MOVIE_H_ \ No newline at end of file +#endif //__MOVIE_H_ diff --git a/source/fceultra/unif.cpp b/source/fceultra/unif.cpp index 173df78..1e9eec1 100644 --- a/source/fceultra/unif.cpp +++ b/source/fceultra/unif.cpp @@ -409,7 +409,6 @@ static BMAPPING bmap[] = { { "Supervision16in1", Supervision16_Init,0}, { "NovelDiamond9999999in1", Novel_Init,0}, { "Super24in1SC03", Super24_Init,0}, - { "42in1ResetSwitch", BMC42in1r_Init, 0}, { "64in1NoRepeat", BMC64in1nr_Init, 0}, { "13in1JY110", BMC13in1JY110_Init, 0}, { "70in1", BMC70in1_Init, 0}, diff --git a/source/fceultra/unif.h b/source/fceultra/unif.h index a3ed1a5..9e5f309 100644 --- a/source/fceultra/unif.h +++ b/source/fceultra/unif.h @@ -83,7 +83,6 @@ void Supervision16_Init(CartInfo *info); void Super24_Init(CartInfo *info); void Novel_Init(CartInfo *info); -void BMC42in1r_Init(CartInfo *info); void BMC64in1nr_Init(CartInfo *info); void BMC70in1_Init(CartInfo *info); void BMC70in1B_Init(CartInfo *info); diff --git a/source/fceultra/version.h b/source/fceultra/version.h index b831f14..ebc2362 100644 --- a/source/fceultra/version.h +++ b/source/fceultra/version.h @@ -59,7 +59,7 @@ #endif #define FCEU_VERSION_NUMERIC 21020 -#define FCEU_VERSION_STRING "2.1.2" FCEU_SUBVERSION_STRING FCEU_FEATURE_STRING FCEU_COMPILER +#define FCEU_VERSION_STRING "2.1.3" FCEU_SUBVERSION_STRING FCEU_FEATURE_STRING FCEU_COMPILER #define FCEU_NAME_AND_VERSION FCEU_NAME " " FCEU_VERSION_STRING #endif