Pārlūkot izejas kodu

Disallow SMS ROMs for now.

master
Ben Kurtovic pirms 9 gadiem
vecāks
revīzija
9f1c30e586
3 mainītis faili ar 9 papildinājumiem un 1 dzēšanām
  1. +2
    -1
      src/assembler/tokenizer.c
  2. +6
    -0
      src/rom.c
  3. +1
    -0
      src/rom.h

+ 2
- 1
src/assembler/tokenizer.c Parādīt failu

@@ -154,8 +154,9 @@ static ErrorInfo* handle_block_directive(
static ErrorInfo* parse_data( static ErrorInfo* parse_data(
const ASMLine *line, ASMData **data_ptr, size_t offset) const ASMLine *line, ASMData **data_ptr, size_t offset)
{ {
parser_func parser = (parser_func) parse_string;
const char *directive; const char *directive;
parser_func parser = (parser_func) parse_string;

if (IS_DIRECTIVE(line, DIR_BYTE)) { if (IS_DIRECTIVE(line, DIR_BYTE)) {
directive = DIR_BYTE; directive = DIR_BYTE;
parser = parse_bytes; parser = parse_bytes;


+ 6
- 0
src/rom.c Parādīt failu

@@ -213,6 +213,12 @@ const char* rom_open(ROM **rom_ptr, const char *path)
return rom_err_badheader; return rom_err_badheader;
} }


if (rom->region_code == 3 || rom->region_code == 4) {
// TODO: support SMS ROMs eventually?
rom_close(rom);
return rom_err_sms;
}

*rom_ptr = rom; *rom_ptr = rom;
return NULL; return NULL;
} }


+ 1
- 0
src/rom.h Parādīt failu

@@ -23,6 +23,7 @@ static const char* rom_err_notfile = "Is not a regular file";
static const char* rom_err_badsize = "Invalid size"; static const char* rom_err_badsize = "Invalid size";
static const char* rom_err_badread = "Couldn't read the entire file"; static const char* rom_err_badread = "Couldn't read the entire file";
static const char* rom_err_badheader = "Invalid header"; static const char* rom_err_badheader = "Invalid header";
static const char* rom_err_sms = "Master System ROMs are not supported";


/* Structs */ /* Structs */




Notiek ielāde…
Atcelt
Saglabāt