Quoted constants in C++ are const, lets use them as so. Fixing a couple of issues and stupidity. If your compiler lacks the standard header <stdint.h> please get yourself a copy here: http://svn.bountysource.com/zsnes/trunk/src/win/vc_head/stdint.h

This commit is contained in:
Nach 2007-11-14 08:55:05 +00:00
parent f60d88a54c
commit 87e8bfd730
8 changed files with 27 additions and 39 deletions

View File

@ -1082,7 +1082,7 @@ gzFile utilGzOpen(const char *file, const char *mode)
return gzopen(file, mode);
}
gzFile utilMemGzOpen(char *memory, int available, char *mode)
gzFile utilMemGzOpen(char *memory, int available, const char *mode)
{
utilGzWriteFunc = memgzwrite;
utilGzReadFunc = memgzread;

View File

@ -19,6 +19,9 @@
#ifndef VBA_UTIL_H
#define VBA_UTIL_H
#include "System.h"
enum IMAGE_TYPE {
IMAGE_UNKNOWN = -1,
IMAGE_GBA = 0,
@ -55,7 +58,7 @@ extern void utilReadData(gzFile, variable_desc *);
extern int utilReadInt(gzFile);
extern void utilWriteInt(gzFile, int);
extern gzFile utilGzOpen(const char *file, const char *mode);
extern gzFile utilMemGzOpen(char *memory, int available, char *mode);
extern gzFile utilMemGzOpen(char *memory, int available, const char *mode);
extern int utilGzWrite(gzFile file, const voidp buffer, unsigned int len);
extern int utilGzRead(gzFile file, voidp buffer, unsigned int len);
extern int utilGzClose(gzFile file);

View File

@ -67,7 +67,7 @@ bool agbPrintIsEnabled()
return agbPrintEnabled;
}
extern void (*dbgOutput)(char *, u32);
extern void (*dbgOutput)(const char *, u32);
void agbPrintFlush()
{

View File

@ -30,7 +30,7 @@
struct Opcodes {
u32 mask;
u32 cval;
char *mnemonic;
const char *mnemonic;
};
#define debuggerReadMemory(addr) \
@ -246,7 +246,7 @@ int disArm(u32 offset, char *dest, int flags){
*dest++ = ' ';
}
char *src = sp->mnemonic;
const char *src = sp->mnemonic;
while (*src){
if (*src!='%')
*dest++ = *src++;
@ -561,7 +561,7 @@ int disThumb(u32 offset, char *dest, int flags){
*dest++ = ' ';
}
char *src = sp->mnemonic;
const char *src = sp->mnemonic;
while (*src){
if (*src!='%')
*dest++ = *src++;
@ -620,7 +620,7 @@ int disThumb(u32 offset, char *dest, int flags){
((opcode & 0xff)<<2));
*dest++ = '$';
dest = addHex(dest, 32, value);
char *s = elfGetAddressSymbol(value);
const char *s = elfGetAddressSymbol(value);
if(*s) {
*dest++ = ' ';
dest = addStr(dest, s);
@ -632,7 +632,7 @@ int disThumb(u32 offset, char *dest, int flags){
u32 value = (offset&0xfffffffc)+4+((opcode & 0xff)<<2);
*dest++ = '$';
dest = addHex(dest, 32, value);
char *s = elfGetAddressSymbol(value);
const char *s = elfGetAddressSymbol(value);
if(*s) {
*dest++ = ' ';
dest = addStr(dest, s);
@ -723,7 +723,7 @@ int disThumb(u32 offset, char *dest, int flags){
add = (add<<12)|((nopcode&0x7ff)<<1);
*dest++ = '$';
dest = addHex(dest,32, offset+4+add);
char *s = elfGetAddressSymbol(offset+4+add);
const char *s = elfGetAddressSymbol(offset+4+add);
if(*s) {
*dest++ = ' ';
*dest++ = '(';

View File

@ -282,7 +282,7 @@ CompileUnit *elfGetCompileUnit(u32 addr)
return NULL;
}
char *elfGetAddressSymbol(u32 addr)
const char *elfGetAddressSymbol(u32 addr)
{
static char buffer[256];
@ -293,7 +293,7 @@ char *elfGetAddressSymbol(u32 addr)
while(func) {
if(addr >= func->lowPC && addr < func->highPC) {
int offset = addr - func->lowPC;
char *name = func->name;
const char *name = func->name;
if(!name)
name = "";
if(offset)
@ -311,7 +311,7 @@ char *elfGetAddressSymbol(u32 addr)
Symbol *s = &elfSymbols[i];
if((addr >= s->value) && addr < (s->value+s->size)) {
int offset = addr-s->value;
char *name = s->name;
const char *name = s->name;
if(name == NULL)
name = "";
if(offset)
@ -468,7 +468,7 @@ bool elfGetObject(char *name, Function *f, CompileUnit *u, Object **o)
return false;
}
char *elfGetSymbol(int i, u32 *value, u32 *size, int *type)
const char *elfGetSymbol(int i, u32 *value, u32 *size, int *type)
{
if(i < elfSymbolsCount) {
Symbol *s = &elfSymbols[i];
@ -649,7 +649,7 @@ void elfPrintCallChain(u32 address)
memcpy(&regs[0], &reg[0], sizeof(reg_pair) * 15);
while(count < 20) {
char *addr = elfGetAddressSymbol(address);
const char *addr = elfGetAddressSymbol(address);
if(*addr == 0)
addr = "???";
@ -864,7 +864,7 @@ u8 *elfReadSection(u8 *data, ELFSectionHeader *sh)
return data + READ32LE(&sh->offset);
}
ELFSectionHeader *elfGetSectionByName(char *name)
ELFSectionHeader *elfGetSectionByName(const char *name)
{
for(int i = 0; i < elfSectionHeadersCount; i++) {
if(strcmp(name,

View File

@ -270,8 +270,8 @@ 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 char *elfGetAddressSymbol(u32);
extern char *elfGetSymbol(int, 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 **);

View File

@ -224,4 +224,4 @@ void UpdateSystemColorMaps(int lcd)
break;
}
}
*/
*/

View File

@ -15,24 +15,21 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "win32/stdafx.h"
#include "win32/VBA.h"
#include "Util.h"
#include <windows.h>
#include <stdint.h>
extern "C"
{
void hq3x_16(unsigned char*, unsigned char*, DWORD, DWORD, DWORD, DWORD);
void hq3x_32(unsigned char*, unsigned char*, DWORD, DWORD, DWORD, DWORD);
void hq4x_16(unsigned char*, unsigned char*, DWORD, DWORD, DWORD, DWORD);
void hq4x_32(unsigned char*, unsigned char*, DWORD, DWORD, DWORD, DWORD);
void hq3x_16(unsigned char*, unsigned char*, uint32_t, uint32_t, uint32_t, uint32_t);
void hq3x_32(unsigned char*, unsigned char*, uint32_t, uint32_t, uint32_t, uint32_t);
void hq4x_16(unsigned char*, unsigned char*, uint32_t, uint32_t, uint32_t, uint32_t);
void hq4x_32(unsigned char*, unsigned char*, uint32_t, uint32_t, uint32_t, uint32_t);
unsigned int LUT16to32[65536];
unsigned int RGBtoYUV[65536];
}
int InitLUTs(void)
void InitLUTs(void)
{
int i, j, k, r, g, b, Y, u, v;
@ -51,18 +48,6 @@ int InitLUTs(void)
v = 128 + ((-r + 2*g -b)>>3);
RGBtoYUV[ (i << 11) + (j << 5) + k ] = (Y<<16) + (u<<8) + v;
}
int nMMXsupport = 0;
__asm
{
mov eax, 1
cpuid
and edx, 0x00800000
mov nMMXsupport, edx
}
return nMMXsupport;
}
int hq3xinited=0;