Skip to content

Commit

Permalink
sync with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
dborth committed Oct 3, 2010
1 parent 0b73a65 commit 796df89
Show file tree
Hide file tree
Showing 7 changed files with 539 additions and 512 deletions.
2 changes: 1 addition & 1 deletion source/snes9x/apu/SPC_DSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static BOOST::uint8_t const initial_regs [SPC_DSP::register_count] =
0xF4,0xFD,0x57,0x32,0x37,0xD9,0x42,0x22,0x00,0x00,0x5B,0x3C,0x9F,0x1B,0x87,0x9A,
0x6F,0x27,0xAF,0x7B,0xE5,0x68,0x0A,0xD9,0x00,0x00,0x9A,0xC5,0x9C,0x4E,0x7B,0xFF,
0xEA,0x21,0x78,0x4F,0xDD,0xED,0x24,0x14,0x00,0x00,0x77,0xB1,0xD1,0x36,0xC1,0x67,
0x52,0x57,0x46,0x3D,0x59,0xF4,0x87,0xA4,0x00,0x00,0x7E,0x44,0x9C,0x4E,0x7B,0xFF,
0x52,0x57,0x46,0x3D,0x59,0xF4,0x87,0xA4,0x00,0x00,0x7E,0x44,0x00,0x4E,0x7B,0xFF,
0x75,0xF5,0x06,0x97,0x10,0xC3,0x24,0xBB,0x00,0x00,0x7B,0x7A,0xE0,0x60,0x12,0x0F,
0xF7,0x74,0x1C,0xE5,0x39,0x3D,0x73,0xC1,0x00,0x00,0x7A,0xB3,0xFF,0x4E,0x7B,0xFF
};
Expand Down
1,008 changes: 504 additions & 504 deletions source/snes9x/apu/license.txt

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions source/snes9x/c4emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1013,9 +1013,16 @@ void S9xSetC4 (uint8 byte, uint16 Address)
printf("$7f4d=%02x, expected 02 for command 10 %02x\n", Memory.C4RAM[0x1f4d], Memory.C4RAM[0x1f4d]);
#endif
int32 tmp;
tmp = SAR((int32) READ_WORD(Memory.C4RAM + 0x1f83) * C4CosTable[READ_WORD(Memory.C4RAM + 0x1f80) & 0x1ff] * 2, 16);
int32 r1;
r1 = READ_WORD(Memory.C4RAM + 0x1f83);
if (r1 & 0x8000)
r1 |= ~0x7fff;
else
r1 &= 0x7fff;

tmp = SAR(r1 * C4CosTable[READ_WORD(Memory.C4RAM + 0x1f80) & 0x1ff] * 2, 16);
WRITE_3WORD(Memory.C4RAM + 0x1f86, tmp);
tmp = SAR((int32) READ_WORD(Memory.C4RAM + 0x1f83) * C4SinTable[READ_WORD(Memory.C4RAM + 0x1f80) & 0x1ff] * 2, 16);
tmp = SAR(r1 * C4SinTable[READ_WORD(Memory.C4RAM + 0x1f80) & 0x1ff] * 2, 16);
WRITE_3WORD(Memory.C4RAM + 0x1f89, (tmp - SAR(tmp, 6)));
break;
}
Expand Down
1 change: 0 additions & 1 deletion source/snes9x/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ void S9xSoftReset (void)
{
S9xResetSaveTimer(FALSE);

memset(Memory.VRAM, 0x00, 0x10000);
ZeroMemory(Memory.FillRAM, 0x8000);

if (Settings.BS)
Expand Down
2 changes: 1 addition & 1 deletion source/snes9x/fxinst.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ struct FxRegs_s
uint32 vCounter;
uint32 vInstCount;
uint32 vSCBRDirty; // If SCBR is written, our cached screen pointers need updating

uint8 *avRegAddr; // To reference avReg in snapshot.cpp
};

Expand Down
14 changes: 14 additions & 0 deletions source/snes9x/gfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2013,6 +2013,20 @@ static void DisplayStringFromBottom (const char *string, int linesFromBottom, in
static void DisplayFrameRate (void)
{
char string[10];
static uint32 lastFrameCount = 0, calcFps = 0;
static time_t lastTime = time(NULL);

time_t currTime = time(NULL);
if (lastTime != currTime) {
if (lastFrameCount < IPPU.TotalEmulatedFrames) {
calcFps = (IPPU.TotalEmulatedFrames - lastFrameCount) / (uint32)(currTime - lastTime);
}
lastTime = currTime;
lastFrameCount = IPPU.TotalEmulatedFrames;
}
sprintf(string, "%u fps", calcFps);
S9xDisplayString(string, 2, IPPU.RenderedScreenWidth - (font_width - 1) * strlen(string) - 1, false);

#ifdef DEBUGGER
const int len = 8;
sprintf(string, "%02d/%02d %02d", (int) IPPU.DisplayedRenderedFrameCount, (int) Memory.ROMFramesPerSecond, (int) IPPU.FrameCount);
Expand Down
13 changes: 10 additions & 3 deletions source/snes9x/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
//#include <memory.h>
#include <string.h>
#ifndef GEKKO
#include <memory.h>
#endif
#include <time.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
Expand Down Expand Up @@ -225,11 +226,15 @@ typedef uint32_t uint32;
typedef int64_t int64;
typedef uint64_t uint64;
#else // HAVE_STDINT_H
#ifdef __WIN32__
typedef intptr_t pint;
#else // __WIN32__
#ifdef PTR_NOT_INT
typedef long pint;
#else
typedef int pint;
#endif
#endif // __WIN32__
#ifdef __WIN32__
#ifdef __BORLANDC__
#include <systypes.h>
Expand Down Expand Up @@ -301,6 +306,8 @@ void _makepath (char *, const char *, const char *, const char *, const char *);
#define strncasecmp strnicmp
void WinDisplayStringFromBottom(const char *string, int linesFromBottom, int pixelsFromLeft, bool allowWrap);
#define S9xDisplayString WinDisplayStringFromBottom
void SetInfoDlgColor(unsigned char, unsigned char, unsigned char);
#define SET_UI_COLOR(r,g,b) SetInfoDlgColor(r,g,b)
#endif

#ifdef __DJGPP
Expand All @@ -324,7 +331,7 @@ void WinDisplayStringFromBottom(const char *string, int linesFromBottom, int pix
#define TITLE "Snes9x"
#endif

#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__x86_64__) || defined(__alpha__) || defined(__MIPSEL__) || defined(_M_IX86)
#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__x86_64__) || defined(__alpha__) || defined(__MIPSEL__) || defined(_M_IX86) || defined(_M_X64)
#define LSB_FIRST
#define FAST_LSB_WORD_ACCESS
#else
Expand Down

0 comments on commit 796df89

Please sign in to comment.