mirror of
https://github.com/libretro/FreeIntv.git
synced 2025-02-17 15:27:29 +00:00
Compiler warning cleanup
This commit is contained in:
parent
5b04216bf0
commit
c8e37dd359
30
src/cart.c
30
src/cart.c
@ -19,19 +19,19 @@
|
||||
#include "memory.h"
|
||||
#include "cart.h"
|
||||
|
||||
int isROM();
|
||||
int loadROM();
|
||||
int getLoadMethod();
|
||||
void load0();
|
||||
void load1();
|
||||
void load2();
|
||||
void load3();
|
||||
void load4();
|
||||
void load5();
|
||||
void load6();
|
||||
void load7();
|
||||
void load8();
|
||||
void load9();
|
||||
int isROM(void);
|
||||
int loadROM(void);
|
||||
int getLoadMethod(void);
|
||||
void load0(void);
|
||||
void load1(void);
|
||||
void load2(void);
|
||||
void load3(void);
|
||||
void load4(void);
|
||||
void load5(void);
|
||||
void load6(void);
|
||||
void load7(void);
|
||||
void load8(void);
|
||||
void load9(void);
|
||||
|
||||
const char *title[0x40];
|
||||
|
||||
@ -41,7 +41,7 @@ int size = 0; // size of file read
|
||||
|
||||
int pos = 0; // current position in data
|
||||
|
||||
int LoadCart(char *path)
|
||||
int LoadCart(const char *path)
|
||||
{
|
||||
printf("[INFO] [FREEINTV] Attempting to load cartridge ROM from: %s\n", path);
|
||||
unsigned char word[1];
|
||||
@ -99,7 +99,7 @@ int LoadCart(char *path)
|
||||
}
|
||||
}
|
||||
|
||||
int readWord()
|
||||
int readWord(void)
|
||||
{
|
||||
pos = pos * (pos<size);
|
||||
int val = (data[pos]<<8) | data[pos+1];
|
||||
|
@ -17,6 +17,6 @@
|
||||
along with FreeIntv. If not, see http://www.gnu.org/licenses/
|
||||
*/
|
||||
|
||||
int LoadCart(char *path);
|
||||
int LoadCart(const char *path);
|
||||
|
||||
#endif
|
@ -84,7 +84,7 @@ int getControllerState(int joypad[], int player)
|
||||
theta = atan2((double)Ly, (double)Lx) + PI;
|
||||
// normalize
|
||||
if(theta<0.0) { theta = 0.0; }
|
||||
norm = (int)floor((theta/(2*PI))*15.0);
|
||||
norm = floor((theta/(2*PI))*15.0);
|
||||
norm -= 4;
|
||||
if(norm<0) { norm += 16; }
|
||||
state = state & discDirections[norm & 0x0F];
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
int controllerSwap;
|
||||
|
||||
void controllerInit();
|
||||
void controllerInit(void);
|
||||
|
||||
int getControllerState(int joypad[], int player);
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <string.h>
|
||||
#include "intv.h"
|
||||
#include "memory.h"
|
||||
#include "cp1610.h"
|
||||
|
||||
// http://wiki.intellivision.us/index.php?title=CP1610#Instruction_Set
|
||||
// http://spatula-city.org/~im14u2c/chips/GICP1600.pdf
|
||||
@ -91,14 +92,14 @@ void writeIndirect(int reg, int val)
|
||||
}
|
||||
}
|
||||
|
||||
int readOperand()
|
||||
int readOperand(void)
|
||||
{
|
||||
int val = readMem(R[PC]);
|
||||
R[PC]++;
|
||||
return val;
|
||||
}
|
||||
|
||||
int readOperandIndirect()
|
||||
int readOperandIndirect(void)
|
||||
{
|
||||
int adr = readMem(R[PC]);
|
||||
int val = readMem(adr);
|
||||
@ -695,7 +696,7 @@ int XORI(int v) // Xor Immediate
|
||||
// Make a big table of function pointers for opcodes
|
||||
// as well as a table of flags so that opcodes can
|
||||
// be quickly executed and determined to be interuptable
|
||||
void addInstruction(int start, int end, int caninterupt, char *name, int (*callback)())
|
||||
void addInstruction(int start, int end, int caninterupt, const char *name, int (*callback)(int))
|
||||
{
|
||||
int i;
|
||||
for(i=start; i<=end; i++)
|
||||
|
@ -17,10 +17,10 @@
|
||||
along with FreeIntv. If not, see http://www.gnu.org/licenses/
|
||||
*/
|
||||
|
||||
void CP1610Init(); // Adds opcodes to lookup tables
|
||||
void CP1610Init(void); // Adds opcodes to lookup tables
|
||||
|
||||
void CP1610Reset(); // reset cpu
|
||||
void CP1610Reset(void); // reset cpu
|
||||
|
||||
int CP1610Tick(); // execute a single instruction, return cycles used
|
||||
int CP1610Tick(int debug); // execute a single instruction, return cycles used
|
||||
|
||||
#endif
|
@ -51,10 +51,10 @@ void retro_set_input_state(retro_input_state_t fn) { InputState = fn; }
|
||||
|
||||
struct retro_game_geometry Geometry;
|
||||
|
||||
int joypad0[17]; // joypad 0 state
|
||||
int joypad1[17]; // joypad 1 state
|
||||
int joypre0[17]; // joypad 0 previous state
|
||||
int joypre1[17]; // joypad 1 previous state
|
||||
int joypad0[18]; // joypad 0 state
|
||||
int joypad1[18]; // joypad 1 state
|
||||
int joypre0[18]; // joypad 0 previous state
|
||||
int joypre1[18]; // joypad 1 previous state
|
||||
|
||||
bool paused = false;
|
||||
|
||||
@ -72,8 +72,6 @@ unsigned int frameHeight = 224;
|
||||
unsigned int frameSize = 78848;
|
||||
//unsigned int frame[78848];
|
||||
|
||||
void drawPaused();
|
||||
|
||||
void quit(int state)
|
||||
{
|
||||
Reset();
|
||||
@ -329,7 +327,7 @@ void retro_deinit(void)
|
||||
void retro_reset(void)
|
||||
{
|
||||
// Reset (from intv.c) //
|
||||
Reset(0);
|
||||
Reset();
|
||||
}
|
||||
|
||||
/* Stubs */
|
||||
|
10
src/intv.c
10
src/intv.c
@ -24,9 +24,9 @@
|
||||
#include "controller.h"
|
||||
#include "cart.h"
|
||||
|
||||
int exec();
|
||||
int exec(void);
|
||||
|
||||
void LoadGame(char* path) // load cart rom //
|
||||
void LoadGame(const char* path) // load cart rom //
|
||||
{
|
||||
if(LoadCart(path))
|
||||
{
|
||||
@ -38,7 +38,7 @@ void LoadGame(char* path) // load cart rom //
|
||||
}
|
||||
}
|
||||
|
||||
void loadExec(char* path)
|
||||
void loadExec(const char* path)
|
||||
{
|
||||
// EXEC lives at 0x1000-0x1FFF
|
||||
int i;
|
||||
@ -63,7 +63,7 @@ void loadExec(char* path)
|
||||
}
|
||||
}
|
||||
|
||||
void loadGrom(char* path)
|
||||
void loadGrom(const char* path)
|
||||
{
|
||||
// GROM lives at 0x3000-0x37FF
|
||||
int i;
|
||||
@ -105,7 +105,7 @@ void Run()
|
||||
while(exec()) { }
|
||||
}
|
||||
|
||||
int exec() // Run one instruction
|
||||
int exec(void) // Run one instruction
|
||||
{
|
||||
int ticks = CP1610Tick(0); // Tick CP-1610 CPU, runs one instruction, returns used cycles
|
||||
Cycles = Cycles + ticks;
|
||||
|
10
src/intv.h
10
src/intv.h
@ -19,14 +19,14 @@
|
||||
|
||||
int SR1; // SR1 line for interupt
|
||||
|
||||
void LoadGame();
|
||||
void LoadGame(const char *path);
|
||||
|
||||
void loadExec(char *path);
|
||||
void loadExec(const char *path);
|
||||
|
||||
void loadGrom(char *path);
|
||||
void loadGrom(const char *path);
|
||||
|
||||
void Run();
|
||||
void Run(void);
|
||||
|
||||
void Reset();
|
||||
void Reset(void);
|
||||
|
||||
#endif
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
unsigned int Memory[0x10000];
|
||||
|
||||
void MemoryInit();
|
||||
void MemoryInit(void);
|
||||
|
||||
int readMem(int adr);
|
||||
|
||||
|
@ -213,7 +213,7 @@ void drawLetter(int x, int y, int c)
|
||||
}
|
||||
}
|
||||
|
||||
void drawText(int x, int y, char *text)
|
||||
void drawText(int x, int y, const char *text)
|
||||
{
|
||||
int i = 0;
|
||||
int c = 32;
|
||||
|
@ -19,12 +19,12 @@
|
||||
|
||||
// On-Screen Display //
|
||||
|
||||
void drawText(int x, int y, char *text);
|
||||
void drawText(int x, int y, const char *text);
|
||||
|
||||
void drawPaused();
|
||||
void drawPaused(void);
|
||||
|
||||
void drawLeftRight();
|
||||
void drawLeftRight(void);
|
||||
|
||||
void drawRightLeft();
|
||||
void drawRightLeft(void);
|
||||
|
||||
#endif
|
@ -70,7 +70,7 @@ int EnvAttack;
|
||||
int EnvAlternate;
|
||||
int EnvHold;
|
||||
|
||||
void readRegisters()
|
||||
void readRegisters(void)
|
||||
{
|
||||
ChA = (Memory[0x01F0] & 0xFF) | ((Memory[0x1F4] & 0x0F)<<8);
|
||||
ChB = (Memory[0x01F1] & 0xFF) | ((Memory[0x1F5] & 0x0F)<<8);
|
||||
|
@ -23,8 +23,8 @@ int16_t PSGBuffer[7467]; // 14934 cpu cycles/frame ; 3733.5 psg cycles/frame
|
||||
int PSGBufferPos; // points to next location in output buffer
|
||||
int PSGBufferSize;
|
||||
|
||||
void PSGInit();
|
||||
void PSGFrame(); // Notify New Frame
|
||||
void PSGInit(void);
|
||||
void PSGFrame(void); // Notify New Frame
|
||||
void PSGTick(int ticks); // ticks PSG some number of cpu cycles
|
||||
void PSGNotify(int adr, int val); // updates PSG on register change
|
||||
|
||||
|
@ -21,9 +21,9 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void drawBackground();
|
||||
void drawSprites();
|
||||
void drawBorder();
|
||||
void drawBackground(void);
|
||||
void drawSprites(void);
|
||||
void drawBorder(void);
|
||||
|
||||
// http://spatula-city.org/~im14u2c/intv/jzintv-1.0-beta3/doc/programming/stic.txt
|
||||
|
||||
|
@ -26,7 +26,7 @@ int DisplayEnabled; // determines if frame should be updated or not
|
||||
|
||||
unsigned int frame[352*224]; // frame buffer
|
||||
|
||||
void STICDrawFrame();
|
||||
void STICReset();
|
||||
void STICDrawFrame(void);
|
||||
void STICReset(void);
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user