mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-28 05:47:48 +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,18 +1,20 @@
|
||||
#ifndef RGBDS_ASM_CHARMAP_H
|
||||
#define RGBDS_ASM_CHARMAP_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define MAXCHARMAPS 512
|
||||
#define CHARMAPLENGTH 16
|
||||
|
||||
struct Charmap {
|
||||
int count;
|
||||
int count;
|
||||
char input[MAXCHARMAPS][CHARMAPLENGTH + 1];
|
||||
char output[MAXCHARMAPS];
|
||||
};
|
||||
|
||||
int readUTF8Char(char *destination, char *source);
|
||||
void charmap_Sort();
|
||||
int charmap_Add(char *input, UBYTE output);
|
||||
int charmap_Add(char *input, uint8_t output);
|
||||
int charmap_Convert(char **input);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef RGBDS_ASM_LEXER_H
|
||||
#define RGBDS_ASM_LEXER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.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_switch_to_buffer(YY_BUFFER_STATE);
|
||||
extern ULONG lex_FloatAlloc(struct sLexFloat * tok);
|
||||
extern void lex_FloatAddRange(ULONG id, UWORD start, UWORD end);
|
||||
extern void lex_FloatDeleteRange(ULONG id, UWORD start, UWORD end);
|
||||
extern void lex_FloatAddFirstRange(ULONG id, UWORD start, UWORD end);
|
||||
extern void lex_FloatDeleteFirstRange(ULONG id, UWORD start, UWORD end);
|
||||
extern void lex_FloatAddSecondRange(ULONG id, UWORD start, UWORD end);
|
||||
extern void lex_FloatDeleteSecondRange(ULONG id, UWORD start, UWORD end);
|
||||
extern void lex_FloatAddRange(ULONG id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatDeleteRange(ULONG id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatAddFirstRange(ULONG id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatDeleteFirstRange(ULONG id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatAddSecondRange(ULONG id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatDeleteSecondRange(ULONG id, uint16_t start, uint16_t end);
|
||||
extern void lex_Init(void);
|
||||
extern void lex_AddStrings(struct sLexInitString * lex);
|
||||
extern void lex_SetBuffer(char *buffer, ULONG len);
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
#ifndef RGBDS_ASM_OUTPUT_H
|
||||
#define RGBDS_ASM_OUTPUT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "asm/rpn.h"
|
||||
#include "types.h"
|
||||
|
||||
struct Section {
|
||||
char *pzName;
|
||||
UBYTE nType;
|
||||
uint8_t nType;
|
||||
ULONG nPC;
|
||||
ULONG nOrg;
|
||||
ULONG nBank;
|
||||
@@ -14,7 +16,7 @@ struct Section {
|
||||
struct Section *pNext;
|
||||
struct Patch *pPatches;
|
||||
struct Charmap *charmap;
|
||||
UBYTE *tData;
|
||||
uint8_t *tData;
|
||||
};
|
||||
|
||||
void out_PrepPass2(void);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#ifndef RGBDS_ASM_RPN_H
|
||||
#define RGBDS_ASM_RPN_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct Expression {
|
||||
SLONG nVal;
|
||||
UBYTE tRPN[256];
|
||||
uint8_t tRPN[256];
|
||||
ULONG nRPNLength;
|
||||
ULONG nRPNOut;
|
||||
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_UNNEG(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_Reset(struct Expression * expr);
|
||||
void rpn_CheckHRAM(struct Expression * expr, struct Expression * src1);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef RGBDS_SYMBOL_H
|
||||
#define RGBDS_SYMBOL_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#define HASHSIZE (1 << 16)
|
||||
@@ -38,7 +40,7 @@ struct sSymbol {
|
||||
* not be changed during linking */
|
||||
|
||||
ULONG calchash(char *s);
|
||||
void sym_SetExportAll(BBOOL set);
|
||||
void sym_SetExportAll(uint8_t set);
|
||||
void sym_PrepPass1(void);
|
||||
void sym_PrepPass2(void);
|
||||
void sym_AddLocalReloc(char *tzSym);
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#define _MAX_PATH 512
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
extern SLONG options;
|
||||
@@ -64,12 +66,12 @@ struct sSection {
|
||||
SLONG nBank;
|
||||
SLONG nOrg;
|
||||
SLONG nAlign;
|
||||
BBOOL oAssigned;
|
||||
uint8_t oAssigned;
|
||||
|
||||
char *pzName;
|
||||
SLONG nByteSize;
|
||||
enum eSectionType Type;
|
||||
UBYTE *pData;
|
||||
uint8_t *pData;
|
||||
SLONG nNumberOfSymbols;
|
||||
struct sSymbol **tSymbols;
|
||||
struct sPatch *pPatches;
|
||||
@@ -106,9 +108,9 @@ struct sPatch {
|
||||
SLONG nOffset;
|
||||
enum ePatchType Type;
|
||||
SLONG nRPNSize;
|
||||
UBYTE *pRPN;
|
||||
uint8_t *pRPN;
|
||||
struct sPatch *pNext;
|
||||
BBOOL oRelocPatch;
|
||||
uint8_t oRelocPatch;
|
||||
};
|
||||
|
||||
extern struct sSection *pSections;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef RGBDS_LINK_OBJECT_H
|
||||
#define RGBDS_LINK_OBJECT_H
|
||||
#ifndef RGBDS_LINK_OBJECT_H
|
||||
#define RGBDS_LINK_OBJECT_H
|
||||
|
||||
extern void obj_Readfile(char *tzObjectfile);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef RGBDS_LINK_OUTPUT_H
|
||||
#define RGBDS_LINK_OUTPUT_H
|
||||
#ifndef RGBDS_LINK_OUTPUT_H
|
||||
#define RGBDS_LINK_OUTPUT_H
|
||||
|
||||
void out_Setname(char *tzOutputfile);
|
||||
void out_SetOverlayname(char *tzOverlayfile);
|
||||
|
||||
@@ -5,12 +5,7 @@
|
||||
#define _MAX_PATH 512
|
||||
#endif
|
||||
|
||||
typedef unsigned char UBYTE;
|
||||
typedef signed char SBYTE;
|
||||
typedef unsigned short UWORD;
|
||||
typedef signed short SWORD;
|
||||
typedef unsigned long ULONG;
|
||||
typedef signed long SLONG;
|
||||
typedef signed char BBOOL;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user