More fixes.
This commit is contained in:
parent
8e0382d2f0
commit
13c8e7208e
|
@ -332,7 +332,7 @@ const char *elfGetAddressSymbol(u32 addr)
|
|||
return "";
|
||||
}
|
||||
|
||||
bool elfFindLineInModule(u32 *addr, char *name, int line)
|
||||
bool elfFindLineInModule(u32 *addr, const char *name, int line)
|
||||
{
|
||||
CompileUnit *unit = elfCompileUnits;
|
||||
|
||||
|
@ -366,7 +366,7 @@ bool elfFindLineInModule(u32 *addr, char *name, int line)
|
|||
return false;
|
||||
}
|
||||
|
||||
int elfFindLine(CompileUnit *unit, Function * /* func */, u32 addr, char **f)
|
||||
int elfFindLine(CompileUnit *unit, Function * /* func */, u32 addr, const char **f)
|
||||
{
|
||||
int currentLine = -1;
|
||||
if(unit->hasLineInfo) {
|
||||
|
@ -480,7 +480,7 @@ const char *elfGetSymbol(int i, u32 *value, u32 *size, int *type)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
bool elfGetSymbolAddress(char *sym, u32 *addr, u32 *size, int *type)
|
||||
bool elfGetSymbolAddress(const char *sym, u32 *addr, u32 *size, int *type)
|
||||
{
|
||||
if(elfSymbolsCount) {
|
||||
for(int i = 0; i < elfSymbolsCount; i++) {
|
||||
|
|
12
src/elf.h
12
src/elf.h
|
@ -164,7 +164,7 @@ struct Enum {
|
|||
struct Type {
|
||||
u32 offset;
|
||||
TypeEnum type;
|
||||
char *name;
|
||||
const char *name;
|
||||
int encoding;
|
||||
int size;
|
||||
int bitSize;
|
||||
|
@ -258,7 +258,7 @@ struct DebugInfo {
|
|||
};
|
||||
|
||||
struct Symbol {
|
||||
char *name;
|
||||
const char *name;
|
||||
int type;
|
||||
int binding;
|
||||
u32 address;
|
||||
|
@ -269,15 +269,15 @@ struct Symbol {
|
|||
extern u32 elfReadLEB128(u8 *, int *);
|
||||
extern s32 elfReadSignedLEB128(u8 *, int *);
|
||||
extern bool elfRead(const char *, int &, FILE *f);
|
||||
extern bool elfGetSymbolAddress(char *,u32 *, u32 *, int *);
|
||||
extern bool elfGetSymbolAddress(const char *,u32 *, u32 *, int *);
|
||||
extern const char *elfGetAddressSymbol(u32);
|
||||
extern const char *elfGetSymbol(int, u32 *, u32 *, int *);
|
||||
extern void elfCleanUp();
|
||||
extern bool elfGetCurrentFunction(u32, Function **, CompileUnit **c);
|
||||
extern bool elfGetObject(char *, Function *, CompileUnit *, Object **);
|
||||
extern bool elfGetObject(const char *, Function *, CompileUnit *, Object **);
|
||||
extern bool elfFindLineInUnit(u32 *, CompileUnit *, int);
|
||||
extern bool elfFindLineInModule(u32 *, char *, int);
|
||||
extern bool elfFindLineInModule(u32 *, const char *, int);
|
||||
u32 elfDecodeLocation(Function *, ELFBlock *, LocationType *);
|
||||
u32 elfDecodeLocation(Function *, ELFBlock *, LocationType *, u32);
|
||||
int elfFindLine(CompileUnit *unit, Function *func, u32 addr, char **);
|
||||
int elfFindLine(CompileUnit *unit, Function *func, u32 addr, const char **);
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "../System.h"
|
||||
#include "../NLS.h"
|
||||
#include "GB.h"
|
||||
#include "gb.h"
|
||||
#include "gbCheats.h"
|
||||
#include "gbGlobals.h"
|
||||
#include "gbMemory.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "gbCheats.h"
|
||||
#include "gbGlobals.h"
|
||||
#include "GB.h"
|
||||
#include "gb.h"
|
||||
|
||||
gbCheat gbCheatList[100];
|
||||
int gbCheatNumber = 0;
|
||||
|
@ -515,4 +515,4 @@ void gbCheatWrite(bool reboot)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,19 +25,19 @@
|
|||
typedef struct {
|
||||
u8 mask;
|
||||
u8 value;
|
||||
char *mnen;
|
||||
const char *mnen;
|
||||
} GBOPCODE;
|
||||
|
||||
#define GB_READ(x) gbMemoryMap[(x)>>12][(x)&0xfff]
|
||||
|
||||
static char *registers[] =
|
||||
static const char *registers[] =
|
||||
{ "B", "C", "D", "E", "H", "L", "(HL)", "A" };
|
||||
|
||||
static char *registers16[] =
|
||||
static const char *registers16[] =
|
||||
{ "BC", "DE", "HL", "SP", // for some operations
|
||||
"BC", "DE", "HL", "AF" }; // for push/pop
|
||||
|
||||
static char *cond[] =
|
||||
static const char *cond[] =
|
||||
{ "NZ", "Z", "NC", "C" };
|
||||
|
||||
static char hexDigits[16] = {
|
||||
|
@ -145,7 +145,7 @@ static char *addHex16(char *p, u16 value)
|
|||
return addHex(p, value & 255);
|
||||
}
|
||||
|
||||
static char *addStr(char *p, char *s)
|
||||
static char *addStr(char *p, const char *s)
|
||||
{
|
||||
while(*s) {
|
||||
*p++ = *s++;
|
||||
|
@ -163,7 +163,7 @@ int gbDis(char *buffer, u16 address)
|
|||
|
||||
u8 opcode = GB_READ(address);
|
||||
address++;
|
||||
char *mnen;
|
||||
const char *mnen;
|
||||
GBOPCODE *op;
|
||||
if(opcode == 0xcb) {
|
||||
opcode = GB_READ(address);
|
||||
|
|
|
@ -598,4 +598,4 @@ void gbDrawSprites(bool draw)
|
|||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "../Port.h"
|
||||
#include "gbGlobals.h"
|
||||
#include "gbMemory.h"
|
||||
#include "GB.h"
|
||||
#include "gb.h"
|
||||
u8 gbDaysinMonth [12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||
const u8 gbDisabledRam [8] = {0x80, 0xff, 0xf0, 0x00, 0x30, 0xbf, 0xbf, 0xbf};
|
||||
extern int gbHardware;
|
||||
|
@ -1714,4 +1714,4 @@ void memoryUpdateMapGS3()
|
|||
// GS can only change a half ROM bank
|
||||
gbMemoryMap[0x04] = &gbRom[tmpAddress];
|
||||
gbMemoryMap[0x05] = &gbRom[tmpAddress + 0x1000];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "../System.h"
|
||||
#include "../Port.h"
|
||||
#include "../Util.h"
|
||||
#include "GB.h"
|
||||
#include "gb.h"
|
||||
#include "gbGlobals.h"
|
||||
|
||||
extern u8 *pix;
|
||||
|
|
|
@ -14,9 +14,28 @@
|
|||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "memgzio.h"
|
||||
|
||||
#ifndef local
|
||||
#define local static
|
||||
#endif
|
||||
|
||||
#ifndef DEF_MEM_LEVEL
|
||||
# define DEF_MEM_LEVEL 8
|
||||
#endif
|
||||
|
||||
#ifndef OS_CODE
|
||||
#define OS_CODE 3
|
||||
#endif
|
||||
|
||||
#ifndef zmemcpy
|
||||
#define zmemcpy memcpy
|
||||
#endif
|
||||
|
||||
|
||||
/*struct internal_state {int dummy;};*/ /* for buggy compilers */
|
||||
|
||||
#ifndef Z_BUFSIZE
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
#if defined(HAVE_ZUTIL_H) || defined(_WIN32)
|
||||
# include <zutil.h>
|
||||
#else
|
||||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
gzFile ZEXPORT memgzopen(char *memory, int, const char *);
|
||||
|
|
Loading…
Reference in New Issue