Skip to content

Commit

Permalink
Update to FCEUX 2.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
clobber committed Jul 30, 2016
1 parent 386ca28 commit cf62e44
Show file tree
Hide file tree
Showing 171 changed files with 10,081 additions and 6,661 deletions.
70 changes: 70 additions & 0 deletions FCEU.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions FCEUGameCore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ void FCEUD_GetPalette(unsigned char i, unsigned char *r, unsigned char *g, unsig
uint64 FCEUD_GetTimeFreq(void) {return 0;}
const char *GetKeyboard(void) {return "";}
bool turbo = false;
bool swapDuty = 0; // some Famicom and NES clones had duty cycle bits swapped
int dendy = 0;
int closeFinishedMovie = 0;
int FCEUD_ShowStatusIcon(void) {return 0;}
int FCEUD_SendData(void *data, uint32 len) {return 1;}
Expand Down Expand Up @@ -500,6 +502,7 @@ void FCEUI_AviVideoUpdate(const unsigned char* buffer) {}
FCEUFILE *FCEUD_OpenArchiveIndex(ArchiveScanRecord &asr, std::string &fname, int innerIndex) {return 0;}
FCEUFILE *FCEUD_OpenArchive(ArchiveScanRecord &asr, std::string &fname, std::string *innerFilename) {return 0;}
ArchiveScanRecord FCEUD_ScanArchive(std::string fname) { return ArchiveScanRecord(); }
void GetMouseData(uint32 (&md)[3]) {}
void FCEUD_PrintError(const char *s)
{
NSLog(@"FCEUX error: %s", s);
Expand Down
2 changes: 1 addition & 1 deletion Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.2.2.1</string>
<string>2.2.3</string>
<key>NSPrincipalClass</key>
<string>OEGameCoreController</string>
<key>OEGameCoreClass</key>
Expand Down
13 changes: 10 additions & 3 deletions src/asm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,23 @@ char *Disassemble(int addr, uint8 *opcode) {
}
#define indirectX(a) { \
(a) = (opcode[1]+RX)&0xFF; \
(a) = GetMem((a)) | (GetMem((a)+1))<<8; \
(a) = GetMem((a)) | (GetMem(((a)+1)&0xff))<<8; \
}
#define indirectY(a) { \
(a) = GetMem(opcode[1]) | (GetMem(opcode[1]+1))<<8; \
(a) = GetMem(opcode[1]) | (GetMem((opcode[1]+1)&0xff))<<8; \
(a) += RY; \
}


#ifdef BRK_3BYTE_HACK
case 0x00:
sprintf(str,"BRK %02X %02X", opcode[1], opcode[2]);
break;
#else
case 0x00: strcpy(str,"BRK"); break;
#endif

//odd, 1-byte opcodes
case 0x00: strcpy(str,"BRK"); break;
case 0x08: strcpy(str,"PHP"); break;
case 0x0A: strcpy(str,"ASL"); break;
case 0x18: strcpy(str,"CLC"); break;
Expand Down
1 change: 1 addition & 0 deletions src/boards/112.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ static void M112Power(void) {
SetWriteHandler(0x4020, 0x5FFF, M112Write);
SetReadHandler(0x6000, 0x7FFF, CartBR);
SetWriteHandler(0x6000, 0x7FFF, CartBW);
FCEU_CheatAddRAM(8, 0x6000, WRAM);
}

static void StateRestore(int version) {
Expand Down
39 changes: 21 additions & 18 deletions src/boards/12in1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,45 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* 7-in-1 Darkwing Duck, Snake, MagicBlock (PCB marked as "12 in 1")
* 7-in-1 Darkwing Duck, Snake, MagicBlock (PCB marked as "12 in 1")
* 12-in-1 1991 New Star Co. Ltd.
*
*/

#include "mapinc.h"

static uint8 reg[4];
static uint8 prgchr[2], ctrl;
static SFORMAT StateRegs[] =
{
{ reg, 4, "REGS" },
{ prgchr, 2, "REGS" },
{ &ctrl, 1, "CTRL" },
{ 0 }
};

static void Sync(void) {
uint8 bank = (reg[3] & 3) << 3;
setchr4(0x0000, (reg[1] >> 3) | (bank << 2));
setchr4(0x1000, (reg[2] >> 3) | (bank << 2));
if (reg[3] & 8) {
setprg32(0x8000, ((reg[2] & 7) >> 1) | bank);
uint8 bank = (ctrl & 3) << 3;
setchr4(0x0000, (prgchr[0] >> 3) | (bank << 2));
setchr4(0x1000, (prgchr[1] >> 3) | (bank << 2));
if (ctrl & 8) {
setprg16(0x8000, bank | (prgchr[0] & 6) | 0); // actually, both 0 and 1 registers used, but they will switch each PA12 transition
setprg16(0xc000, bank | (prgchr[0] & 6) | 1); // if bits are different for both registers, so they must be programmed strongly the same!
} else {
setprg16(0x8000, (reg[1] & 7) | bank);
setprg16(0xc000, 7 | bank);
setprg16(0x8000, bank | (prgchr[0] & 7));
setprg16(0xc000, bank | 7 );
}
setmirror(((reg[3] & 4) >> 2) ^ 1);
setmirror(((ctrl & 4) >> 2) ^ 1);
}

static DECLFW(BMC12IN1Write) {
switch (A) {
case 0xafff: reg[0] = V; break;
case 0xbfff: reg[1] = V; break;
case 0xdfff: reg[2] = V; break;
case 0xefff: reg[3] = V; break;
switch (A & 0xE000) {
case 0xA000: prgchr[0] = V; Sync(); break;
case 0xC000: prgchr[1] = V; Sync(); break;
case 0xE000: ctrl = V & 0x0F; Sync(); break;
}
Sync();
}

static void BMC12IN1Power(void) {
reg[0] = reg[1] = reg[2] = reg[3] = 0;
prgchr[0] = prgchr[1] = ctrl = 0;
Sync();
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0xFFFF, BMC12IN1Write);
Expand All @@ -68,3 +70,4 @@ void BMC12IN1_Init(CartInfo *info) {
GameStateRestore = StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}

1 change: 1 addition & 0 deletions src/boards/15.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ static void M15Power(void) {
SetWriteHandler(0x6000, 0x7FFF, CartBW);
SetWriteHandler(0x8000, 0xFFFF, M15Write);
SetReadHandler(0x8000, 0xFFFF, CartBR);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
Sync();
}

Expand Down
1 change: 1 addition & 0 deletions src/boards/156.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ static void M156Power(void) {
SetReadHandler(0x6000, 0xFFFF, CartBR);
SetWriteHandler(0x6000, 0x7FFF, CartBW);
SetWriteHandler(0xC000, 0xCFFF, M156Write);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
}

static void M156Close(void) {
Expand Down
71 changes: 71 additions & 0 deletions src/boards/158B.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2015 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* "Blood Of Jurassic" protected MMC3 based board (GD-98 Cart ID, 158B PCB ID)
*
*/

#include "mapinc.h"
#include "mmc3.h"

static uint8 lut[8] = { 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0F, 0x00 };

static void UNL158BPW(uint32 A, uint8 V) {
if (EXPREGS[0] & 0x80) {
uint32 bank = EXPREGS[0] & 7;
if(EXPREGS[0] & 0x20) { // 32Kb mode
setprg32(0x8000, bank >> 1);
} else { // 16Kb mode
setprg16(0x8000, bank);
setprg16(0xC000, bank);
}
} else {
setprg8(A, V & 0xF);
}
}

static DECLFW(UNL158BProtWrite) {
EXPREGS[A & 7] = V;
switch(A & 7) {
case 0:
FixMMC3PRG(MMC3_cmd);
break;
case 7:
FCEU_printf("UNK PROT WRITE\n");
break;
}

}

static DECLFR(UNL158BProtRead) {
return X.DB | lut[A & 7];
}

static void UNL158BPower(void) {
GenMMC3Power();
SetWriteHandler(0x5000, 0x5FFF, UNL158BProtWrite);
SetReadHandler(0x5000, 0x5FFF, UNL158BProtRead);
}

void UNL158B_Init(CartInfo *info) {
GenMMC3_Init(info, 128, 128, 0, 0);
pwrap = UNL158BPW;
info->Power = UNL158BPower;
AddExState(EXPREGS, 8, 0, "EXPR");
}
3 changes: 3 additions & 0 deletions src/boards/164.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ static void Power(void) {
SetWriteHandler(0x5000, 0x5FFF, Write);
SetReadHandler(0x6000, 0xFFFF, CartBR);
SetWriteHandler(0x6000, 0x7FFF, CartBW);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
WSync();
}

Expand Down Expand Up @@ -155,6 +156,7 @@ static void Power2(void) {
SetWriteHandler(0x5000, 0x5FFF, Write2);
SetReadHandler(0x6000, 0xFFFF, CartBR);
SetWriteHandler(0x6000, 0x7FFF, CartBW);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
WSync();
}

Expand Down Expand Up @@ -206,6 +208,7 @@ static void Power3(void) {
SetWriteHandler(0x5000, 0x5FFF, Write3);
SetReadHandler(0x6000, 0xFFFF, CartBR);
SetWriteHandler(0x6000, 0x7FFF, CartBW);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
WSync();
}

Expand Down
4 changes: 2 additions & 2 deletions src/boards/168.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void M168Power(void) {
SetReadHandler(0x8000, 0xFFFF, CartBR);
}

static void MNNNClose(void) {
static void M168Close(void) {
if (CHRRAM)
FCEU_gfree(CHRRAM);
CHRRAM = NULL;
Expand All @@ -67,7 +67,7 @@ static void StateRestore(int version) {

void Mapper168_Init(CartInfo *info) {
info->Power = M168Power;
info->Close = MNNNClose;
info->Close = M168Close;
GameStateRestore = StateRestore;
AddExState(&StateRegs, ~0, 0, 0);

Expand Down
11 changes: 6 additions & 5 deletions src/boards/176.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,16 @@ static DECLFW(M176Write_WriteSRAM)

static void M176Power(void)
{
SetReadHandler(0x6000,0x7fff,CartBR);
SetWriteHandler(0x6000,0x7fff,M176Write_WriteSRAM);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetReadHandler(0x6000,0x7fff,CartBR);
SetWriteHandler(0x6000,0x7fff,M176Write_WriteSRAM);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0xA001,0xA001,M176Write_A001);
SetWriteHandler(0x5001,0x5001,M176Write_5001);
SetWriteHandler(0x5010,0x5010,M176Write_5010);
SetWriteHandler(0x5011,0x5011,M176Write_5011);
SetWriteHandler(0x5ff1,0x5ff1,M176Write_5FF1);
SetWriteHandler(0x5ff2,0x5ff2,M176Write_5FF2);
SetWriteHandler(0x5ff1,0x5ff1,M176Write_5FF1);
SetWriteHandler(0x5ff2,0x5ff2,M176Write_5FF2);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);

we_sram = 0;
sbw = 0;
Expand Down
1 change: 1 addition & 0 deletions src/boards/177.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ static void M177Power(void) {
SetWriteHandler(0x6000, 0x7fff, CartBW);
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0xFFFF, M177Write);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
}

static void M177Close(void) {
Expand Down
Loading

0 comments on commit cf62e44

Please sign in to comment.