Browse Source

Disallow SMS ROMs for now.

master
Ben Kurtovic 9 years ago
parent
commit
9f1c30e586
3 changed files with 9 additions and 1 deletions
  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 View File

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

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


+ 6
- 0
src/rom.c View File

@@ -213,6 +213,12 @@ const char* rom_open(ROM **rom_ptr, const char *path)
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;
return NULL;
}


+ 1
- 0
src/rom.h View File

@@ -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_badread = "Couldn't read the entire file";
static const char* rom_err_badheader = "Invalid header";
static const char* rom_err_sms = "Master System ROMs are not supported";

/* Structs */



Loading…
Cancel
Save