cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

noi_file.h (968B)


      1// This is free and unencumbered software released into the public domain.
      2// For more information, please refer to <https://unlicense.org>
      3// bbbbbr 2020
      4
      5#ifndef _NOI_FILE_H
      6#define _NOI_FILE_H
      7
      8#include "list.h"
      9
     10#define MAX_STR_LEN     4096
     11#define MAX_SPLIT_WORDS 4
     12
     13#define NOI_REC_COUNT_MATCH 3 // "DEF ...symbol_name... ...symbol_value...
     14
     15#define ERR_NO_SYMBOLS_LEFT -1
     16#define SYM_VAL_UNSET   0xFFFFFFFF
     17
     18#define NOI_REC_START_LEN 4 // length of "DEF "
     19#define NOI_REC_S_L_CHK   2 // length of "s_" or "l_"
     20#define NOI_REC_START   's'
     21#define NOI_REC_LENGTH  'l'
     22
     23typedef struct symbol_item {
     24    char     name[SYM_MAX_STR_LEN];
     25    uint32_t addr_start;
     26    uint32_t length;
     27    uint16_t bank_num;
     28    uint32_t src_rom_addr;
     29} symbol_item;
     30
     31extern list_type symbol_list;
     32extern uint32_t overlay_count_addr;
     33extern uint32_t overlay_name_addr;
     34
     35
     36int noi_file_load_symbols(char * filename_in);
     37void noi_init(void);
     38void noi_cleanup(void);
     39
     40#endif // _NOI_FILE_H