Commit c35bf93f authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Remove some unused variables

parent c58c0dc4
......@@ -104,8 +104,6 @@ const int tx_table[16] =
#define M8 19
void ComputeClipWindows();
static void S9xDisplayFrameRate();
static void S9xDisplayString(const char* string);
extern uint8 BitShifts[8][4];
extern uint8 TileShifts[8][4];
......@@ -1589,19 +1587,10 @@ void DrawBackgroundMode5(uint32 BGMODE, uint32 bg, uint8 Z1, uint8 Z2)
if (((uint8*)SC3 - Memory.VRAM) >= 0x10000)
SC3 -= 0x08000;
int Lines;
int VOffsetMask;
int VOffsetShift;
int VOffsetShift = 3;
if (BG.TileSize == 16)
{
VOffsetMask = 0x3ff;
VOffsetShift = 4;
}
else
{
VOffsetMask = 0x1ff;
VOffsetShift = 3;
}
int endy = GFX.EndY;
int Y;
......@@ -2538,52 +2527,6 @@ void DisplayChar(uint8* Screen, uint8 c)
}
}
static void S9xDisplayFrameRate()
{
uint8* Screen = GFX.Screen + 2 +
(IPPU.RenderedScreenHeight - font_height - 1) * GFX_PITCH;
char string [10];
int len = 5;
sprintf(string, "%02d/%02d", IPPU.DisplayedRenderedFrameCount,
(int) Memory.ROMFramesPerSecond);
int i;
for (i = 0; i < len; i++)
{
DisplayChar(Screen, string [i]);
Screen += (font_width - 1) * sizeof(uint16);
}
}
static void S9xDisplayString(const char* string)
{
uint8* Screen = GFX.Screen + 2 +
(IPPU.RenderedScreenHeight - font_height * 5) * GFX_PITCH;
int len = strlen(string);
int max_chars = IPPU.RenderedScreenWidth / (font_width - 1);
int char_count = 0;
int i;
for (i = 0; i < len; i++, char_count++)
{
if (char_count >= max_chars || string [i] < 32)
{
Screen -= (font_width - 1) * sizeof(uint16) * max_chars;
Screen += font_height * GFX_PITCH;
if (Screen >= GFX.Screen + GFX_PITCH * IPPU.RenderedScreenHeight)
break;
char_count -= max_chars;
}
if (string [i] < 32)
continue;
DisplayChar(Screen, string [i]);
Screen += (font_width - 1) * sizeof(uint16);
}
}
// -x-
static void S9xUpdateScreenTransparency() // ~30-50ms! (called from FLUSH_REDRAW())
{
uint32 starty = GFX.StartY;
......
......@@ -418,12 +418,8 @@ again:
"Found multiple ROM file headers (and ignored them).");
}
CheckForIPSPatch (filename, Memory.HeaderCount != 0, &TotalFileSize);
int orig_hi_score, orig_lo_score;
int hi_score, lo_score;
orig_hi_score = hi_score = ScoreHiROM (FALSE);
orig_lo_score = lo_score = ScoreLoROM (FALSE);
int hi_score = ScoreHiROM (FALSE);
int lo_score = ScoreLoROM (FALSE);
if (Memory.HeaderCount == 0 && !Settings.ForceNoHeader &&
((hi_score > lo_score && ScoreHiROM (TRUE) > hi_score) ||
......@@ -2601,115 +2597,6 @@ if (ROM [adr] == ov) \
}
// Read variable size MSB int from a file
static long ReadInt (FILE *f, unsigned nbytes)
{
long v = 0;
while (nbytes--)
{
int c = fgetc(f);
if (c == EOF)
return -1;
v = (v << 8) | (c & 0xFF);
}
return (v);
}
#define IPS_EOF 0x00454F46l
void CheckForIPSPatch (const char *rom_filename, bool8_32 header,
int32* rom_size)
{
char dir [_MAX_DIR + 1];
char drive [_MAX_DRIVE + 1];
char name [_MAX_FNAME + 1];
char ext [_MAX_EXT + 1];
char fname [_MAX_PATH + 1];
FILE *patch_file = NULL;
long offset = header ? 512 : 0;
if (!(patch_file = fopen(S9xGetFilename (".ips"), "rb"))) return;
if (fread (fname, 1, 5, patch_file) != 5 || strncmp (fname, "PATCH", 5) != 0)
{
fclose (patch_file);
return;
}
int32 ofs;
for (;;)
{
long len;
long rlen;
int rchar;
ofs = ReadInt (patch_file, 3);
if (ofs == -1)
goto err_eof;
if (ofs == IPS_EOF)
break;
ofs -= offset;
len = ReadInt (patch_file, 2);
if (len == -1)
goto err_eof;
/* Apply patch block */
if (len)
{
if (ofs + len > MAX_ROM_SIZE)
goto err_eof;
while (len--)
{
rchar = fgetc (patch_file);
if (rchar == EOF)
goto err_eof;
Memory.ROM [ofs++] = (uint8) rchar;
}
if (ofs > *rom_size)
*rom_size = ofs;
}
else
{
rlen = ReadInt (patch_file, 2);
if (rlen == -1)
goto err_eof;
rchar = fgetc (patch_file);
if (rchar == EOF)
goto err_eof;
if (ofs + rlen > MAX_ROM_SIZE)
goto err_eof;
while (rlen--)
Memory.ROM [ofs++] = (uint8) rchar;
if (ofs > *rom_size)
*rom_size = ofs;
}
}
// Check if ROM image needs to be truncated
ofs = ReadInt (patch_file, 3);
if (ofs != -1 && ofs - offset < *rom_size)
{
// Need to truncate ROM image
*rom_size = ofs - offset;
}
fclose (patch_file);
return;
err_eof:
if (patch_file)
fclose (patch_file);
}
const uint32 crc32Table[256] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
......
......@@ -60,8 +60,6 @@ void DrawBGMode7Background16(uint8* Screen, int bg, int depth)
void DrawBGMode7Background16R3(uint8* Screen, int bg, int depth)
{
uint8* VRAM1 = Memory.VRAM + 1;
int aa, cc;
int startx;
uint32 Left = 0;
......@@ -83,7 +81,6 @@ void DrawBGMode7Background16R3(uint8* Screen, int bg, int depth)
int DD;
uint32 Line;
uint32 clip;
uint8 b;
uint8* Depth;
if (!ClipCount) ClipCount = 1;
......@@ -324,7 +321,6 @@ void DrawBGMode7Background16R1R2(uint8* Screen, int bg, int depth)
int DD;
uint32 Line;
uint32 clip;
uint8 b;
uint32 AndByY;
uint32 AndByX = 0xffffffff;
if (Settings.Dezaemon && PPU.Mode7Repeat == 2) AndByX = 0x7ff;
......@@ -448,7 +444,6 @@ void DrawBGMode7Background16R1R2(uint8* Screen, int bg, int depth)
void DrawBGMode7Background16R0(uint8* Screen, int bg, int depth)
{
uint8* VRAM1 = Memory.VRAM + 1;
int aa, cc;
int startx;
uint32 Left;
......
......@@ -230,7 +230,6 @@ static void DrawBGMode7Background16R1R2(uint8* Screen, int bg, int depth)
int DD;
uint32 Line;
uint32 clip;
uint8 b;
uint32 AndByY;
uint32 AndByX = 0xffffffff;
if (Settings.Dezaemon && PPU.Mode7Repeat == 2) AndByX = 0x7ff;
......
......@@ -53,7 +53,6 @@ void DrawBGMode7Background16New(uint8* Screen)
void DrawBGMode7Background16NewR3(uint8* Screen)
{
uint8* VRAM1 = Memory.VRAM + 1;
int aa, cc;
int startx;
uint32 Left = 0;
......@@ -287,7 +286,6 @@ void DrawBGMode7Background16NewR1R2(uint8* Screen)
int DD;
uint32 Line;
uint32 clip;
uint8 b;
uint32 AndByY;
uint32 AndByX = 0xffffffff;
if (Settings.Dezaemon && PPU.Mode7Repeat == 2) AndByX = 0x7ff;
......@@ -397,7 +395,6 @@ void DrawBGMode7Background16NewR1R2(uint8* Screen)
void DrawBGMode7Background16NewR0(uint8* Screen)
{
uint8* VRAM1 = Memory.VRAM + 1;
int aa, cc;
int startx;
uint32 Left;
......@@ -409,7 +406,6 @@ void DrawBGMode7Background16NewR0(uint8* Screen)
int32 CentreX;
int32 CentreY;
uint16* p;
uint8* z;
int yy;
int xx;
int BB;
......
......@@ -61,8 +61,6 @@ void DrawBGMode7Background16Prio(uint8* Screen, int bg)
void DrawBGMode7Background16PrioR3(uint8* Screen, int bg)
{
uint8* VRAM1 = Memory.VRAM + 1;
int aa, cc;
int startx;
uint32 Left = 0;
......@@ -82,7 +80,6 @@ void DrawBGMode7Background16PrioR3(uint8* Screen, int bg)
int DD;
uint32 Line;
uint32 clip;
uint8 b;
uint8* Depth;
uint32 depth = Mode7Depths[0] | (Mode7Depths[1] << 8);
......@@ -351,7 +348,6 @@ void DrawBGMode7Background16PrioR1R2(uint8* Screen, int bg)
int DD;
uint32 Line;
uint32 clip;
uint8 b;
uint32 AndByY;
uint32 AndByX = 0xffffffff;
if (Settings.Dezaemon && PPU.Mode7Repeat == 2) AndByX = 0x7ff;
......@@ -480,7 +476,6 @@ void DrawBGMode7Background16PrioR1R2(uint8* Screen, int bg)
void DrawBGMode7Background16PrioR0(uint8* Screen, int bg)
{
uint8* VRAM1 = Memory.VRAM + 1;
int aa, cc;
int startx;
uint32 Left;
......
......@@ -39,11 +39,6 @@
* Nintendo Co., Limited and its subsidiary companies.
*/
#ifndef __GP32__
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#endif
#if defined(__unix) || defined(__linux) || defined(__sun) || defined(__DJGPP)
#include <unistd.h>
#include <sys/types.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment