mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Replace 8 and 16 bit custom types by stdint.h types
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
#ifndef RGBDS_ASM_CHARMAP_H
|
#ifndef RGBDS_ASM_CHARMAP_H
|
||||||
#define RGBDS_ASM_CHARMAP_H
|
#define RGBDS_ASM_CHARMAP_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#define MAXCHARMAPS 512
|
#define MAXCHARMAPS 512
|
||||||
#define CHARMAPLENGTH 16
|
#define CHARMAPLENGTH 16
|
||||||
|
|
||||||
@@ -12,7 +14,7 @@ struct Charmap {
|
|||||||
|
|
||||||
int readUTF8Char(char *destination, char *source);
|
int readUTF8Char(char *destination, char *source);
|
||||||
void charmap_Sort();
|
void charmap_Sort();
|
||||||
int charmap_Add(char *input, UBYTE output);
|
int charmap_Add(char *input, uint8_t output);
|
||||||
int charmap_Convert(char **input);
|
int charmap_Convert(char **input);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#ifndef RGBDS_ASM_LEXER_H
|
#ifndef RGBDS_ASM_LEXER_H
|
||||||
#define RGBDS_ASM_LEXER_H
|
#define RGBDS_ASM_LEXER_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
@@ -42,12 +43,12 @@ extern YY_BUFFER_STATE yy_scan_bytes(char *mem, ULONG size);
|
|||||||
extern void yy_delete_buffer(YY_BUFFER_STATE);
|
extern void yy_delete_buffer(YY_BUFFER_STATE);
|
||||||
extern void yy_switch_to_buffer(YY_BUFFER_STATE);
|
extern void yy_switch_to_buffer(YY_BUFFER_STATE);
|
||||||
extern ULONG lex_FloatAlloc(struct sLexFloat * tok);
|
extern ULONG lex_FloatAlloc(struct sLexFloat * tok);
|
||||||
extern void lex_FloatAddRange(ULONG id, UWORD start, UWORD end);
|
extern void lex_FloatAddRange(ULONG id, uint16_t start, uint16_t end);
|
||||||
extern void lex_FloatDeleteRange(ULONG id, UWORD start, UWORD end);
|
extern void lex_FloatDeleteRange(ULONG id, uint16_t start, uint16_t end);
|
||||||
extern void lex_FloatAddFirstRange(ULONG id, UWORD start, UWORD end);
|
extern void lex_FloatAddFirstRange(ULONG id, uint16_t start, uint16_t end);
|
||||||
extern void lex_FloatDeleteFirstRange(ULONG id, UWORD start, UWORD end);
|
extern void lex_FloatDeleteFirstRange(ULONG id, uint16_t start, uint16_t end);
|
||||||
extern void lex_FloatAddSecondRange(ULONG id, UWORD start, UWORD end);
|
extern void lex_FloatAddSecondRange(ULONG id, uint16_t start, uint16_t end);
|
||||||
extern void lex_FloatDeleteSecondRange(ULONG id, UWORD start, UWORD end);
|
extern void lex_FloatDeleteSecondRange(ULONG id, uint16_t start, uint16_t end);
|
||||||
extern void lex_Init(void);
|
extern void lex_Init(void);
|
||||||
extern void lex_AddStrings(struct sLexInitString * lex);
|
extern void lex_AddStrings(struct sLexInitString * lex);
|
||||||
extern void lex_SetBuffer(char *buffer, ULONG len);
|
extern void lex_SetBuffer(char *buffer, ULONG len);
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
#ifndef RGBDS_ASM_OUTPUT_H
|
#ifndef RGBDS_ASM_OUTPUT_H
|
||||||
#define RGBDS_ASM_OUTPUT_H
|
#define RGBDS_ASM_OUTPUT_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "asm/rpn.h"
|
#include "asm/rpn.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
struct Section {
|
struct Section {
|
||||||
char *pzName;
|
char *pzName;
|
||||||
UBYTE nType;
|
uint8_t nType;
|
||||||
ULONG nPC;
|
ULONG nPC;
|
||||||
ULONG nOrg;
|
ULONG nOrg;
|
||||||
ULONG nBank;
|
ULONG nBank;
|
||||||
@@ -14,7 +16,7 @@ struct Section {
|
|||||||
struct Section *pNext;
|
struct Section *pNext;
|
||||||
struct Patch *pPatches;
|
struct Patch *pPatches;
|
||||||
struct Charmap *charmap;
|
struct Charmap *charmap;
|
||||||
UBYTE *tData;
|
uint8_t *tData;
|
||||||
};
|
};
|
||||||
|
|
||||||
void out_PrepPass2(void);
|
void out_PrepPass2(void);
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
#ifndef RGBDS_ASM_RPN_H
|
#ifndef RGBDS_ASM_RPN_H
|
||||||
#define RGBDS_ASM_RPN_H
|
#define RGBDS_ASM_RPN_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
struct Expression {
|
struct Expression {
|
||||||
SLONG nVal;
|
SLONG nVal;
|
||||||
UBYTE tRPN[256];
|
uint8_t tRPN[256];
|
||||||
ULONG nRPNLength;
|
ULONG nRPNLength;
|
||||||
ULONG nRPNOut;
|
ULONG nRPNOut;
|
||||||
ULONG isReloc;
|
ULONG isReloc;
|
||||||
@@ -73,7 +75,7 @@ void rpn_HIGH(struct Expression * expr, struct Expression * src);
|
|||||||
void rpn_LOW(struct Expression * expr, struct Expression * src);
|
void rpn_LOW(struct Expression * expr, struct Expression * src);
|
||||||
void rpn_UNNEG(struct Expression * expr, struct Expression * src);
|
void rpn_UNNEG(struct Expression * expr, struct Expression * src);
|
||||||
void rpn_UNNOT(struct Expression * expr, struct Expression * src);
|
void rpn_UNNOT(struct Expression * expr, struct Expression * src);
|
||||||
UWORD rpn_PopByte(struct Expression * expr);
|
uint16_t rpn_PopByte(struct Expression * expr);
|
||||||
void rpn_Bank(struct Expression * expr, char *tzSym);
|
void rpn_Bank(struct Expression * expr, char *tzSym);
|
||||||
void rpn_Reset(struct Expression * expr);
|
void rpn_Reset(struct Expression * expr);
|
||||||
void rpn_CheckHRAM(struct Expression * expr, struct Expression * src1);
|
void rpn_CheckHRAM(struct Expression * expr, struct Expression * src1);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#ifndef RGBDS_SYMBOL_H
|
#ifndef RGBDS_SYMBOL_H
|
||||||
#define RGBDS_SYMBOL_H
|
#define RGBDS_SYMBOL_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#define HASHSIZE (1 << 16)
|
#define HASHSIZE (1 << 16)
|
||||||
@@ -38,7 +40,7 @@ struct sSymbol {
|
|||||||
* not be changed during linking */
|
* not be changed during linking */
|
||||||
|
|
||||||
ULONG calchash(char *s);
|
ULONG calchash(char *s);
|
||||||
void sym_SetExportAll(BBOOL set);
|
void sym_SetExportAll(uint8_t set);
|
||||||
void sym_PrepPass1(void);
|
void sym_PrepPass1(void);
|
||||||
void sym_PrepPass2(void);
|
void sym_PrepPass2(void);
|
||||||
void sym_AddLocalReloc(char *tzSym);
|
void sym_AddLocalReloc(char *tzSym);
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
#define _MAX_PATH 512
|
#define _MAX_PATH 512
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
extern SLONG options;
|
extern SLONG options;
|
||||||
@@ -64,12 +66,12 @@ struct sSection {
|
|||||||
SLONG nBank;
|
SLONG nBank;
|
||||||
SLONG nOrg;
|
SLONG nOrg;
|
||||||
SLONG nAlign;
|
SLONG nAlign;
|
||||||
BBOOL oAssigned;
|
uint8_t oAssigned;
|
||||||
|
|
||||||
char *pzName;
|
char *pzName;
|
||||||
SLONG nByteSize;
|
SLONG nByteSize;
|
||||||
enum eSectionType Type;
|
enum eSectionType Type;
|
||||||
UBYTE *pData;
|
uint8_t *pData;
|
||||||
SLONG nNumberOfSymbols;
|
SLONG nNumberOfSymbols;
|
||||||
struct sSymbol **tSymbols;
|
struct sSymbol **tSymbols;
|
||||||
struct sPatch *pPatches;
|
struct sPatch *pPatches;
|
||||||
@@ -106,9 +108,9 @@ struct sPatch {
|
|||||||
SLONG nOffset;
|
SLONG nOffset;
|
||||||
enum ePatchType Type;
|
enum ePatchType Type;
|
||||||
SLONG nRPNSize;
|
SLONG nRPNSize;
|
||||||
UBYTE *pRPN;
|
uint8_t *pRPN;
|
||||||
struct sPatch *pNext;
|
struct sPatch *pNext;
|
||||||
BBOOL oRelocPatch;
|
uint8_t oRelocPatch;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct sSection *pSections;
|
extern struct sSection *pSections;
|
||||||
|
|||||||
@@ -5,12 +5,7 @@
|
|||||||
#define _MAX_PATH 512
|
#define _MAX_PATH 512
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef unsigned char UBYTE;
|
|
||||||
typedef signed char SBYTE;
|
|
||||||
typedef unsigned short UWORD;
|
|
||||||
typedef signed short SWORD;
|
|
||||||
typedef unsigned long ULONG;
|
typedef unsigned long ULONG;
|
||||||
typedef signed long SLONG;
|
typedef signed long SLONG;
|
||||||
typedef signed char BBOOL;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
%{
|
%{
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -103,7 +104,7 @@ ULONG str2int( char *s )
|
|||||||
while( *s )
|
while( *s )
|
||||||
{
|
{
|
||||||
r<<=8;
|
r<<=8;
|
||||||
r|=(UBYTE)(*s++);
|
r|=(uint8_t)(*s++);
|
||||||
}
|
}
|
||||||
return( r );
|
return( r );
|
||||||
}
|
}
|
||||||
@@ -116,7 +117,7 @@ ULONG str2int2( char *s, int length )
|
|||||||
while(i < length)
|
while(i < length)
|
||||||
{
|
{
|
||||||
r<<=8;
|
r<<=8;
|
||||||
r|=(UBYTE)(s[i]);
|
r|=(uint8_t)(s[i]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
return( r );
|
return( r );
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ readUTF8Char(char *dest, char *src)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
charmap_Add(char *input, UBYTE output)
|
charmap_Add(char *input, uint8_t output)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
size_t input_length;
|
size_t input_length;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -331,7 +332,7 @@ fstk_RunMacroArg(SLONG s)
|
|||||||
if ((sym = sym_FindMacroArg(s)) != NULL) {
|
if ((sym = sym_FindMacroArg(s)) != NULL) {
|
||||||
pushcontext();
|
pushcontext();
|
||||||
nCurrentStatus = STAT_isMacroArg;
|
nCurrentStatus = STAT_isMacroArg;
|
||||||
sprintf(tzCurrentFileName, "%c", (UBYTE) s);
|
sprintf(tzCurrentFileName, "%c", (uint8_t) s);
|
||||||
CurrentFlexHandle = yy_scan_bytes(sym, strlen(sym));
|
CurrentFlexHandle = yy_scan_bytes(sym, strlen(sym));
|
||||||
yy_switch_to_buffer(CurrentFlexHandle);
|
yy_switch_to_buffer(CurrentFlexHandle);
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
@@ -152,7 +153,7 @@ yy_create_buffer(FILE * f)
|
|||||||
pBuffer->pBufferStart = pBuffer->pBufferRealStart + SAFETYMARGIN;
|
pBuffer->pBufferStart = pBuffer->pBufferRealStart + SAFETYMARGIN;
|
||||||
pBuffer->pBuffer = pBuffer->pBufferRealStart + SAFETYMARGIN;
|
pBuffer->pBuffer = pBuffer->pBufferRealStart + SAFETYMARGIN;
|
||||||
|
|
||||||
size = fread(pBuffer->pBuffer, sizeof(UBYTE), size, f);
|
size = fread(pBuffer->pBuffer, sizeof(uint8_t), size, f);
|
||||||
|
|
||||||
pBuffer->pBuffer[size] = '\n';
|
pBuffer->pBuffer[size] = '\n';
|
||||||
pBuffer->pBuffer[size + 1] = 0;
|
pBuffer->pBuffer[size + 1] = 0;
|
||||||
@@ -211,7 +212,7 @@ lex_FloatAlloc(struct sLexFloat *token)
|
|||||||
* start is greater than the end of the range.
|
* start is greater than the end of the range.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
lex_CheckCharacterRange(UWORD start, UWORD end)
|
lex_CheckCharacterRange(uint16_t start, uint16_t end)
|
||||||
{
|
{
|
||||||
if (start > end || start < 1 || end > 127) {
|
if (start > end || start < 1 || end > 127) {
|
||||||
errx(1, "Invalid character range (start: %u, end: %u)",
|
errx(1, "Invalid character range (start: %u, end: %u)",
|
||||||
@@ -220,7 +221,7 @@ lex_CheckCharacterRange(UWORD start, UWORD end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lex_FloatDeleteRange(ULONG id, UWORD start, UWORD end)
|
lex_FloatDeleteRange(ULONG id, uint16_t start, uint16_t end)
|
||||||
{
|
{
|
||||||
lex_CheckCharacterRange(start, end);
|
lex_CheckCharacterRange(start, end);
|
||||||
|
|
||||||
@@ -231,7 +232,7 @@ lex_FloatDeleteRange(ULONG id, UWORD start, UWORD end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lex_FloatAddRange(ULONG id, UWORD start, UWORD end)
|
lex_FloatAddRange(ULONG id, uint16_t start, uint16_t end)
|
||||||
{
|
{
|
||||||
lex_CheckCharacterRange(start, end);
|
lex_CheckCharacterRange(start, end);
|
||||||
|
|
||||||
@@ -242,7 +243,7 @@ lex_FloatAddRange(ULONG id, UWORD start, UWORD end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lex_FloatDeleteFirstRange(ULONG id, UWORD start, UWORD end)
|
lex_FloatDeleteFirstRange(ULONG id, uint16_t start, uint16_t end)
|
||||||
{
|
{
|
||||||
lex_CheckCharacterRange(start, end);
|
lex_CheckCharacterRange(start, end);
|
||||||
|
|
||||||
@@ -253,7 +254,7 @@ lex_FloatDeleteFirstRange(ULONG id, UWORD start, UWORD end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lex_FloatAddFirstRange(ULONG id, UWORD start, UWORD end)
|
lex_FloatAddFirstRange(ULONG id, uint16_t start, uint16_t end)
|
||||||
{
|
{
|
||||||
lex_CheckCharacterRange(start, end);
|
lex_CheckCharacterRange(start, end);
|
||||||
|
|
||||||
@@ -264,7 +265,7 @@ lex_FloatAddFirstRange(ULONG id, UWORD start, UWORD end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lex_FloatDeleteSecondRange(ULONG id, UWORD start, UWORD end)
|
lex_FloatDeleteSecondRange(ULONG id, uint16_t start, uint16_t end)
|
||||||
{
|
{
|
||||||
lex_CheckCharacterRange(start, end);
|
lex_CheckCharacterRange(start, end);
|
||||||
|
|
||||||
@@ -275,7 +276,7 @@ lex_FloatDeleteSecondRange(ULONG id, UWORD start, UWORD end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lex_FloatAddSecondRange(ULONG id, UWORD start, UWORD end)
|
lex_FloatAddSecondRange(ULONG id, uint16_t start, uint16_t end)
|
||||||
{
|
{
|
||||||
lex_CheckCharacterRange(start, end);
|
lex_CheckCharacterRange(start, end);
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -24,9 +25,9 @@ struct Patch {
|
|||||||
char tzFilename[_MAX_PATH + 1];
|
char tzFilename[_MAX_PATH + 1];
|
||||||
ULONG nLine;
|
ULONG nLine;
|
||||||
ULONG nOffset;
|
ULONG nOffset;
|
||||||
UBYTE nType;
|
uint8_t nType;
|
||||||
ULONG nRPNSize;
|
ULONG nRPNSize;
|
||||||
UBYTE *pRPN;
|
uint8_t *pRPN;
|
||||||
struct Patch *pNext;
|
struct Patch *pNext;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -371,8 +372,8 @@ void
|
|||||||
createpatch(ULONG type, struct Expression * expr)
|
createpatch(ULONG type, struct Expression * expr)
|
||||||
{
|
{
|
||||||
struct Patch *pPatch;
|
struct Patch *pPatch;
|
||||||
UWORD rpndata;
|
uint16_t rpndata;
|
||||||
UBYTE rpnexpr[2048];
|
uint8_t rpnexpr[2048];
|
||||||
char tzSym[512];
|
char tzSym[512];
|
||||||
ULONG rpnptr = 0, symptr;
|
ULONG rpnptr = 0, symptr;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
* Controls RPN expressions for objectfiles
|
* Controls RPN expressions for objectfiles
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -46,7 +47,7 @@ rpn_Reset(struct Expression * expr)
|
|||||||
/*
|
/*
|
||||||
* Returns the next rpn byte in expression
|
* Returns the next rpn byte in expression
|
||||||
*/
|
*/
|
||||||
UWORD
|
uint16_t
|
||||||
rpn_PopByte(struct Expression * expr)
|
rpn_PopByte(struct Expression * expr)
|
||||||
{
|
{
|
||||||
if (expr->nRPNOut == expr->nRPNLength) {
|
if (expr->nRPNOut == expr->nRPNLength) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -814,7 +815,7 @@ sym_AddMacro(char *tzSym)
|
|||||||
/*
|
/*
|
||||||
* Set whether to export all relocable symbols by default
|
* Set whether to export all relocable symbols by default
|
||||||
*/
|
*/
|
||||||
void sym_SetExportAll(BBOOL set) {
|
void sym_SetExportAll(uint8_t set) {
|
||||||
exportall = set;
|
exportall = set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -7,7 +8,7 @@
|
|||||||
#include "link/mylink.h"
|
#include "link/mylink.h"
|
||||||
#include "link/main.h"
|
#include "link/main.h"
|
||||||
|
|
||||||
static BBOOL
|
static uint8_t
|
||||||
symboldefined(char *name)
|
symboldefined(char *name)
|
||||||
{
|
{
|
||||||
struct sSection *pSect;
|
struct sSection *pSect;
|
||||||
@@ -31,7 +32,7 @@ symboldefined(char *name)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static BBOOL
|
static uint8_t
|
||||||
addmodulecontaining(char *name)
|
addmodulecontaining(char *name)
|
||||||
{
|
{
|
||||||
struct sSection **ppLSect;
|
struct sSection **ppLSect;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -18,8 +19,8 @@
|
|||||||
struct sSymbol **tSymbols;
|
struct sSymbol **tSymbols;
|
||||||
struct sSection *pSections = NULL;
|
struct sSection *pSections = NULL;
|
||||||
struct sSection *pLibSections = NULL;
|
struct sSection *pLibSections = NULL;
|
||||||
UBYTE dummymem;
|
uint8_t dummymem;
|
||||||
BBOOL oReadLib = 0;
|
uint8_t oReadLib = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The usual byte order stuff
|
* The usual byte order stuff
|
||||||
@@ -39,10 +40,10 @@ readlong(FILE * f)
|
|||||||
return (r);
|
return (r);
|
||||||
}
|
}
|
||||||
|
|
||||||
UWORD
|
uint16_t
|
||||||
readword(FILE * f)
|
readword(FILE * f)
|
||||||
{
|
{
|
||||||
UWORD r;
|
uint16_t r;
|
||||||
|
|
||||||
r = fgetc(f);
|
r = fgetc(f);
|
||||||
r |= fgetc(f) << 8;
|
r |= fgetc(f) << 8;
|
||||||
@@ -228,7 +229,7 @@ obj_ReadRGBSection(FILE * f)
|
|||||||
SLONG nNumberOfPatches;
|
SLONG nNumberOfPatches;
|
||||||
struct sPatch **ppPatch, *pPatch;
|
struct sPatch **ppPatch, *pPatch;
|
||||||
|
|
||||||
if (fread(pSection->pData, sizeof(UBYTE),
|
if (fread(pSection->pData, sizeof(uint8_t),
|
||||||
pSection->nByteSize, f) != pSection->nByteSize) {
|
pSection->nByteSize, f) != pSection->nByteSize) {
|
||||||
err(1, "Read error.");
|
err(1, "Read error.");
|
||||||
}
|
}
|
||||||
@@ -257,7 +258,7 @@ obj_ReadRGBSection(FILE * f)
|
|||||||
err(1, NULL);
|
err(1, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fread(pPatch->pRPN, sizeof(UBYTE),
|
if (fread(pPatch->pRPN, sizeof(uint8_t),
|
||||||
pPatch->nRPNSize, f) != pPatch->nRPNSize) {
|
pPatch->nRPNSize, f) != pPatch->nRPNSize) {
|
||||||
errx(1, "Read error.");
|
errx(1, "Read error.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -11,13 +12,13 @@
|
|||||||
char *tzOutname;
|
char *tzOutname;
|
||||||
char *tzOverlayname = NULL;
|
char *tzOverlayname = NULL;
|
||||||
|
|
||||||
SLONG MaxOverlayBank;
|
int32_t MaxOverlayBank;
|
||||||
|
|
||||||
void
|
void
|
||||||
writehome(FILE * f, FILE * f_overlay)
|
writehome(FILE * f, FILE * f_overlay)
|
||||||
{
|
{
|
||||||
struct sSection *pSect;
|
struct sSection *pSect;
|
||||||
UBYTE *mem;
|
uint8_t *mem;
|
||||||
|
|
||||||
mem = malloc(MaxAvail[BANK_ROM0]);
|
mem = malloc(MaxAvail[BANK_ROM0]);
|
||||||
if (!mem)
|
if (!mem)
|
||||||
@@ -51,10 +52,10 @@ writehome(FILE * f, FILE * f_overlay)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
writebank(FILE * f, FILE * f_overlay, SLONG bank)
|
writebank(FILE * f, FILE * f_overlay, int32_t bank)
|
||||||
{
|
{
|
||||||
struct sSection *pSect;
|
struct sSection *pSect;
|
||||||
UBYTE *mem;
|
uint8_t *mem;
|
||||||
|
|
||||||
mem = malloc(MaxAvail[bank]);
|
mem = malloc(MaxAvail[bank]);
|
||||||
if (!mem)
|
if (!mem)
|
||||||
@@ -103,7 +104,7 @@ out_SetOverlayname(char *tzOverlayfile)
|
|||||||
void
|
void
|
||||||
Output(void)
|
Output(void)
|
||||||
{
|
{
|
||||||
SLONG i;
|
int32_t i;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
FILE *f_overlay = NULL;
|
FILE *f_overlay = NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -86,7 +87,7 @@ SLONG
|
|||||||
calcrpn(struct sPatch * pPatch)
|
calcrpn(struct sPatch * pPatch)
|
||||||
{
|
{
|
||||||
SLONG t, size;
|
SLONG t, size;
|
||||||
UBYTE *rpn;
|
uint8_t *rpn;
|
||||||
|
|
||||||
rpnp = 0;
|
rpnp = 0;
|
||||||
|
|
||||||
@@ -232,7 +233,7 @@ Patch(void)
|
|||||||
if (t >= -128 && t <= 255) {
|
if (t >= -128 && t <= 255) {
|
||||||
t &= 0xFF;
|
t &= 0xFF;
|
||||||
pSect->pData[pPatch->nOffset] =
|
pSect->pData[pPatch->nOffset] =
|
||||||
(UBYTE) t;
|
(uint8_t) t;
|
||||||
} else {
|
} else {
|
||||||
errx(1,
|
errx(1,
|
||||||
"%s(%ld) : Value must be 8-bit",
|
"%s(%ld) : Value must be 8-bit",
|
||||||
|
|||||||
Reference in New Issue
Block a user