Commit 650c9474 authored by negativeExponent's avatar negativeExponent
Browse files

mednafen.h: Git rid of these macros

parent 88c91e09
......@@ -206,7 +206,7 @@ static bool MDFNI_LoadGame(const uint8_t *data, size_t size)
MDFN_indent(1);
MDFN_printf(_("Using module: lynx\n\n"));
MDFN_printf("Using module: lynx\n\n");
MDFN_indent(1);
//
......
......@@ -222,10 +222,10 @@ CCart::CCart(MDFNFILE *fp)
if(fp)
{
gamesize = GET_FSIZE_PTR(fp);
gamesize = fp->size;
// Calculate file's CRC32
mCRC32 = crc32(0, GET_FDATA_PTR(fp), gamesize);
mCRC32 = crc32(0, fp->data, gamesize);
MDFN_printf("File CRC32: 0x%08X.\n", mCRC32);
// Checkout the header bytes
......@@ -268,7 +268,7 @@ CCart::CCart(MDFNFILE *fp)
if (fp)
{
// re-calculate file crc32 minus header if any
mCRC32 = crc32(0, GET_FDATA_PTR(fp) + header_size, gamesize);
mCRC32 = crc32(0, fp->data + header_size, gamesize);
LYNX_DB db = CheckHash(mCRC32);
if (found)
{
......
......@@ -82,7 +82,7 @@ CSystem::CSystem(MDFNFILE *fp)
mFileType=HANDY_FILETYPE_HOMEBREW;
else if(!strcmp(&clip[0],"LYNX"))
mFileType=HANDY_FILETYPE_LNX;
else if(GET_FSIZE_PTR(fp)==128*1024 || GET_FSIZE_PTR(fp)==256*1024 || GET_FSIZE_PTR(fp)==512*1024)
else if(fp->size==128*1024 || fp->size==256*1024 || fp->size==512*1024)
/* Invalid Cart (type). but 128/256/512k size -> set to RAW and try to load raw rom image */
mFileType=HANDY_FILETYPE_RAW;
else
......
......@@ -6,26 +6,12 @@
#include <stdlib.h>
#include <string.h>
#define _(String) (String)
#include "git.h"
#ifdef _WIN32
#define strcasecmp _stricmp
#endif
#define GET_FDATA(fp) (fp.f_data)
#define GET_FSIZE(fp) (fp.f_size)
#define GET_FEXTS(fp) (fp.f_ext)
#define GET_FDATA_PTR(fp) (fp->data)
#define GET_FSIZE_PTR(fp) (fp->size)
#define GET_FEXTS_PTR(fp) (fp->ext)
#define gzopen(a, b) fopen(a, b)
#define gzread(a, b, c) fread(b, c, 1, a)
#define gzclose(a) fclose(a)
#define gzgetc(a) fgetc(a)
#define gzseek(a,b,c) fseek(a,b,c)
extern MDFNGI *MDFNGameInfo;
#include "settings.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