瀏覽代碼

Disallow SMS ROMs for now.

master
Ben Kurtovic 9 年之前
父節點
當前提交
9f1c30e586
共有 3 個文件被更改,包括 9 次插入1 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存