diff options
Diffstat (limited to 'ines2.c')
| -rw-r--r-- | ines2.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -27,7 +27,7 @@ #define MIRROR_FOUR_SCREEN 2 -static int load_ines2(struct nes_state *state, const char *path) { +static int ines2_load(struct nes_state *state, char *path) { FILE *f = fopen(path, "rb"); if(!f) { return -1; @@ -55,8 +55,8 @@ static int load_ines2(struct nes_state *state, const char *path) { // Extract mapper uint8_t mapper_low = (header[INES_FLAGS6] >> 4); uint8_t mapper_high = (header[INES_FLAGS7] & 0xf0); - uint8_t mapper_ext = (header[INES_PRG_CHR_MSB] & 0x0f) << 8; - state->ines.mapper = mapper_low | mapper_high | mapper_ext; + uint8_t mapper_ext = (header[INES_PRG_CHR_MSB] & 0x0f); + state->ines.mapper = mapper_low | mapper_high | (mapper_ext << 8); // Extract mirroring if(header[INES_FLAGS6] & FLAG6_FOUR_SCREEN) { @@ -76,11 +76,11 @@ static int load_ines2(struct nes_state *state, const char *path) { } // Read PRG - fread(state->rom, 1, prg_size, f); + printf("prgsize_read: %ld\n", fread(state->rom, 1, prg_size, f)); // Read CHR if present if(chr_size > 0) { - fread(state->chrrom, 1, chr_size, f); + printf("chrsize_read: %ld\n", fread(state->chrrom, 1, chr_size, f)); } fclose(f); |
