LDRIVER += -ggdb
NOSTRIP = 1
else
LDRIVER += -ggdb
NOSTRIP = 1
else
-TFLAGS += -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math
+TFLAGS += -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math # -funroll-loops
TFLAGS += -O3 #-pg -fno-omit-frame-pointer
LDRIVER += -O3 #-pg -fno-omit-frame-pointer
endif
TFLAGS += -O3 #-pg -fno-omit-frame-pointer
LDRIVER += -O3 #-pg -fno-omit-frame-pointer
endif
if ((keys & (1 << u)) && (Settings.KeyBinds[u] & acts))
{
keys &= ~(1 << u);
if ((keys & (1 << u)) && (Settings.KeyBinds[u] & acts))
{
keys &= ~(1 << u);
+ acts &= Settings.KeyBinds[u];
static void PrepareOtherInput(void)
{
static void PrepareOtherInput(void)
{
- uint32 act, key, seen_acts;
- combo_acts = combo_keys = prev_emu_acts = seen_acts = 0;
+ combo_acts = combo_keys = prev_emu_acts = 0;
- // find combo_acts
- for (act = 1; act; act <<= 1)
+ for (act = 0; act < 32; act++)
- for (key = 1; key < 32; key++)
+ int u, keyc = 0, keyc2 = 0;
+ if (act == 16 || act == 17) continue; // player2 flag
+ if (act > 17)
- if (Settings.KeyBinds[key] & act)
- {
- if (seen_acts & act) combo_acts |= act;
- else seen_acts |= act;
- }
+ for (u = 0; u < 32; u++)
+ if (Settings.KeyBinds[u] & (1 << act)) keyc++;
- }
-
- combo_acts &= ~0x00030000; // don't take player_id bits
-
- // find combo_keys
- for (act = 1; act; act <<= 1)
- {
- for (key = 0; key < 32; key++)
- if (Settings.KeyBinds[key] & combo_acts)
+ for (u = 0; u < 32; u++)
+ if ((Settings.KeyBinds[u] & 0x30000) == 0 && // pl. 1
+ (Settings.KeyBinds[u] & (1 << act))) keyc++;
+ for (u = 0; u < 32; u++)
+ if ((Settings.KeyBinds[u] & 0x30000) == 1 && // pl. 2
+ (Settings.KeyBinds[u] & (1 << act))) keyc2++;
+ if (keyc2 > keyc) keyc = keyc2;
+ }
+ if (keyc > 1)
+ {
+ // loop again and mark those keys and actions as combo
+ for (u = 0; u < 32; u++)
- combo_keys |= 1 << key;
+ if (Settings.KeyBinds[u] & (1 << act)) {
+ combo_keys |= 1 << u;
+ combo_acts |= 1 << act;
+ }
}\r
\r
static char *filter_exts[] = {\r
}\r
\r
static char *filter_exts[] = {\r
- ".gpe", ".png", "ck.o", ".txt"\r
+ ".gpe", ".png", "ck.o", ".txt", ".srm"\r
};\r
\r
static int scandir_filter(const struct dirent *ent)\r
};\r
\r
static int scandir_filter(const struct dirent *ent)\r
static int skip_count = 0;
static struct timeval tv_prev;
static int skip_count = 0;
static struct timeval tv_prev;
-void RefreshThrottleFPS(void)
-{
- skip_count = 0;
- if (Settings.perfect_vsync)
- {
- gp2x_video_wait_vsync();
- }
- gettimeofday(&tv_prev, 0);
-}
-
#define tvdiff(tv1, tv2) \
((tv1.tv_sec - tv2.tv_sec) * 1000000 + tv1.tv_usec - tv2.tv_usec)
#define tvdiff(tv1, tv2) \
((tv1.tv_sec - tv2.tv_sec) * 1000000 + tv1.tv_usec - tv2.tv_usec)
+void RefreshThrottleFPS(void)
+{
+ skip_count = 0;
+ if (Settings.perfect_vsync)
+ {
+ gp2x_video_wait_vsync();
+ }
+ gettimeofday(&tv_prev, 0);
+ tvsub(tv_prev, PAL ? 19997 : 16639);
+}
+
static void wait_to(struct timeval *tv_aim)
{
struct timeval tv_now;
static void wait_to(struct timeval *tv_aim)
{
struct timeval tv_now;
void SpeedThrottle(void)
{
struct timeval tv_now, tv_aim;
void SpeedThrottle(void)
{
struct timeval tv_now, tv_aim;
+ int frame_time = PAL ? 19997 : 16639; // ~50.007, 19.997 ms/frame : ~60.1, 16.639 ms/frame
int tdiff;
tv_aim = tv_prev;
int tdiff;
tv_aim = tv_prev;
- tvadd(tv_aim, PAL ? 19997 : 16639); // ~50.007, 19.997 ms/frame : ~60.1, 16.639 ms/frame
+ tvadd(tv_aim, frame_time);
gettimeofday(&tv_now, 0);
tdiff = tvdiff(tv_now, tv_aim);
gettimeofday(&tv_now, 0);
tdiff = tvdiff(tv_now, tv_aim);
+ else if (tdiff >= frame_time)
- tv_prev = tv_now;
- if (tdiff < 1024*16) // limit frameskip
- {
+ if (/*tdiff < 36*1024 &&*/ skip_count < 6) { // limit frameskip
- tvsub(tv_prev, tdiff);
- }
+ skip_count++;
+ } else
+ skip_count = 0;
+
+ if (tdiff < 92*1024)
+ tv_prev = tv_aim;
+ else
+ tv_prev = tv_now; // something went wrong, try to recover
static int RWWrap=0;
#ifdef ASM_6502
static int RWWrap=0;
#ifdef ASM_6502
+#ifdef DEBUG_ASM_6502
+extern uint8 nes_internal_ram[0x800];
+#else
static void asmcpu_update(int32 cycles)
{
// some code from x6502.c
static void asmcpu_update(int32 cycles)
{
// some code from x6502.c
nes_registers[4]|= X.P & 0x5d;
nes_registers[5] = X.P << 24; // N
if (!(X.P&0x02)) nes_registers[5] |= 1; // Z
nes_registers[4]|= X.P & 0x5d;
nes_registers[5] = X.P << 24; // N
if (!(X.P&0x02)) nes_registers[5] |= 1; // Z
+
+#ifdef DEBUG_ASM_6502
+ memcpy(nes_internal_ram, RAM, 0x800);
+#endif
+ //printf("open [%04x] %02x @ %04x (%04x)\n", A, X.DB, X.PC, X.PC&0x7ff);
FCEU_MemoryRand(RAM,0x800);
#else
memset(RAM,0x00,0x800);
FCEU_MemoryRand(RAM,0x800);
#else
memset(RAM,0x00,0x800);
+ memset(nes_internal_ram,0x00,0x800);
#endif
ResetMapping();
PowerSound();
#endif
ResetMapping();
PowerSound();
@@@
@@@ ¥¢¥É¥ì¥¹¤òÆɤà
@@@
@@@
@@@ ¥¢¥É¥ì¥¹¤òÆɤà
@@@
+.macro ZP_READ_ADDR update_db=0
ZP_READ
ldrb REG_ADDR, [REG_ADDR, #1]
orr REG_ADDR, r0, REG_ADDR, lsl #8
ZP_READ
ldrb REG_ADDR, [REG_ADDR, #1]
orr REG_ADDR, r0, REG_ADDR, lsl #8
+.if \update_db
+ strb r0, [REG_OP_TABLE, #(OTOFFS_X + 0x10)] @ X.DB
+.endif
.endm
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.endm
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@ ($nn), Y
.macro INDY_ADDR
ZERO_ADDR
@@@ ($nn), Y
.macro INDY_ADDR
ZERO_ADDR
+ ZP_READ_ADDR 1 @ SMB3 relies on open bus here
add REG_ADDR, REG_ADDR, REG_Y
bic REG_ADDR, REG_ADDR, #0x10000
and r0,REG_ADDR,#0xff
add REG_ADDR, REG_ADDR, REG_Y
bic REG_ADDR, REG_ADDR, #0x10000
and r0,REG_ADDR,#0xff
static void compare_ram(void)
{
static void compare_ram(void)
{
int i, fail = 0;
for (i = 0; i < 0x800/4; i++)
{
int i, fail = 0;
for (i = 0; i < 0x800/4; i++)
{
void TriggerIRQ_d(void)
{
void TriggerIRQ_d(void)
{
It's size should be 8192 bytes and it must be named "disksys.rom".\r
gpfce will not load FDS games without this file.\r
\r
It's size should be 8192 bytes and it must be named "disksys.rom".\r
gpfce will not load FDS games without this file.\r
\r
-You will also probably need configure keys for swapping the virtual FDS disks,\r
+You will also probably need to configure keys for swapping the virtual FDS disks,\r
they are configurable in Controls menu.\r
\r
Two types of FDS disk images are supported: disk images with the FWNES-style header,\r
they are configurable in Controls menu.\r
\r
Two types of FDS disk images are supported: disk images with the FWNES-style header,\r
\r
\r
ver 0.4 (by notaz)\r
\r
\r
ver 0.4 (by notaz)\r
+ ret 311\r
+ - Improved open bus emulation, fixes missing ground in some SMB3 levels.\r
+ - Improved auto frameskip behavior in cases when emu is not fast\r
+ enough to maintain 50/60 fps.\r
+ - Fixed a bug which prevented some key combo configurations from working.\r
rev 171\r
- Added optional "Accurate renderer", which is the original FCE Ultra\r
0.98.x renderer + PPU emulation code. It's much slower, but it can\r
rev 171\r
- Added optional "Accurate renderer", which is the original FCE Ultra\r
0.98.x renderer + PPU emulation code. It's much slower, but it can\r