Merge pull request #95 from retro-wertz/updates

updates
This commit is contained in:
meepingsnesroms
2017-04-01 13:18:37 -07:00
committed by GitHub
2 changed files with 16 additions and 11 deletions

View File

@@ -1144,6 +1144,7 @@ static void FCEUD_UpdateInput(void)
if (turbo_p0_toggle[i-8] > turbo_delay) { if (turbo_p0_toggle[i-8] > turbo_delay) {
// Reset the toggle if // Reset the toggle if
// delay value is reached // delay value is reached
pad[0] |= bindmap[i].nes;
turbo_p0_toggle[i-8] = 0; turbo_p0_toggle[i-8] = 0;
} }
} else { } else {
@@ -1164,6 +1165,7 @@ static void FCEUD_UpdateInput(void)
if (turbo_p1_toggle[i-8] > turbo_delay) { if (turbo_p1_toggle[i-8] > turbo_delay) {
// Reset the toggle if // Reset the toggle if
// delay value is reached // delay value is reached
pad[1] |= bindmap[i].nes;
turbo_p1_toggle[i-8] = 0; turbo_p1_toggle[i-8] = 0;
} }
} else { } else {

View File

@@ -63,7 +63,7 @@ doret:
return tmp; return tmp;
} }
static MEMWRAP *MakeMemWrapBuffer(void *tz, int type, uint8 *buffer, size_t bufsize) static MEMWRAP *MakeMemWrapBuffer(const char *tz, int type, uint8 *buffer, size_t bufsize)
{ {
MEMWRAP *tmp = (MEMWRAP*)FCEU_malloc(sizeof(MEMWRAP)); MEMWRAP *tmp = (MEMWRAP*)FCEU_malloc(sizeof(MEMWRAP));
@@ -81,6 +81,12 @@ FCEUFILE * FCEU_fopen(const char *path, const char *ipsfn,
char *mode, char *ext, uint8 *buffer, size_t bufsize) char *mode, char *ext, uint8 *buffer, size_t bufsize)
{ {
FCEUFILE *fceufp = (FCEUFILE*)malloc(sizeof(FCEUFILE)); FCEUFILE *fceufp = (FCEUFILE*)malloc(sizeof(FCEUFILE));
fceufp->type = 0;
if (buffer)
fceufp->fp = MakeMemWrapBuffer(path, 0, buffer, bufsize);
else
{
void *t = fopen(path, mode); void *t = fopen(path, mode);
if (!t) if (!t)
@@ -90,11 +96,8 @@ FCEUFILE * FCEU_fopen(const char *path, const char *ipsfn,
} }
fseek((FILE*)t, 0, SEEK_SET); fseek((FILE*)t, 0, SEEK_SET);
fceufp->type = 0;
if (buffer)
fceufp->fp = MakeMemWrapBuffer(t, 0, buffer, bufsize);
else
fceufp->fp = MakeMemWrap(t, 0); fceufp->fp = MakeMemWrap(t, 0);
}
return fceufp; return fceufp;
} }