mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +00:00
Add support for multiple charmaps
This adds two new directives: newcharmap and setcharmap. newcharmap creates a new charmap and switches to it. setcharmap switches to an existing charmap.
This commit is contained in:
@@ -25,13 +25,16 @@ struct Charnode {
|
||||
};
|
||||
|
||||
struct Charmap {
|
||||
char name[MAXSYMLEN + 1];
|
||||
int32_t charCount; /* user-side count. */
|
||||
int32_t nodeCount; /* node-side count. */
|
||||
struct Charnode nodes[MAXCHARNODES]; /* first node is reserved for the root node in charmap. */
|
||||
struct Charmap *next; /* next charmap in hash table bucket */
|
||||
};
|
||||
|
||||
int32_t readUTF8Char(char *destination, char *source);
|
||||
|
||||
void charmap_InitMain(void);
|
||||
struct Charmap *charmap_New(const char *name, const char *baseName);
|
||||
void charmap_Set(const char *name);
|
||||
int32_t charmap_Add(char *input, uint8_t output);
|
||||
int32_t charmap_Convert(char **input);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "helpers.h"
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ struct sSymbol {
|
||||
/* Symbol has a constant value, will not be changed during linking */
|
||||
#define SYMF_CONST 0x200
|
||||
|
||||
uint32_t calchash(char *s);
|
||||
uint32_t sym_CalcHash(const char *s);
|
||||
void sym_SetExportAll(uint8_t set);
|
||||
void sym_AddLocalReloc(char *tzSym);
|
||||
void sym_AddReloc(char *tzSym);
|
||||
|
||||
17
include/asm/util.h
Normal file
17
include/asm/util.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* This file is part of RGBDS.
|
||||
*
|
||||
* Copyright (c) 1997-2019, Carsten Sorensen and RGBDS contributors.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#ifndef RGBDS_UTIL_H
|
||||
#define RGBDS_UTIL_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
uint32_t calchash(const char *s);
|
||||
int32_t readUTF8Char(char *dest, char *src);
|
||||
|
||||
#endif /* RGBDS_UTIL_H */
|
||||
Reference in New Issue
Block a user