Rizin
unix-like reverse engineering framework and cli tools
sfc_specs.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2015 maijin <maijin21@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 // CPU_memory_map: http://wiki.nesdev.com/w/index.php/CPU_memory_map
5 
6 #ifndef _SFC_SPECS_H
7 #define _SFC_SPECS_H
8 
9 #define LOROM_PAGE_SIZE 0x8000
10 #define HIROM_PAGE_SIZE 0x10000
11 #define BANK_SIZE 0x10000
12 
13 #define SFC_HDR_SIZE sizeof(sfc_int_hdr)
14 #define LOROM_HDR_LOC 0x7FC0
15 #define HIROM_HDR_LOC 0xFFC0
16 
17 #define ADDMEM_START_ADDRESS 0x6000
18 #define ADDMEM_SIZE 0x2000
19 
20 // identical for both LoROM and HiROM
21 
22 #define PPU1_REG_ADDRESS 0x2100
23 #define PPU1_REG_SIZE 0x0100
24 
25 #define DSP_REG_ADDRESS 0x3000
26 #define DSP_REG_SIZE 0x1000
27 
28 #define OLDJOY_REG_ADDRESS 0x4000
29 #define OLDJOY_REG_SIZE 0x0100
30 
31 #define PPU2_REG_ADDRESS 0x4200
32 #define PPU2_REG_SIZE 0x0300
33 
34 #define LOWRAM_START_ADDRESS 0x7E0000
35 #define LOWRAM_SIZE 0x2000
36 
37 #define LOWRAM_MIRROR_START_ADDRESS 0x0000
38 #define LOWRAM_MIRROR_SIZE 0x2000
39 
40 #define HIRAM_START_ADDRESS 0x7E2000
41 #define HIRAM_SIZE 0x6000
42 
43 #define EXTRAM_START_ADDRESS 0x7E8000
44 #define EXTRAM_SIZE 0x18000
45 
47  typedef struct {
48  char name[0x15]; // game title.
49  ut8 rom_setup; // ROM setup (LoROM/HiROM, etc.)
50  ut8 rom_type;
51  ut8 rom_size; // in 1kb chunks
52  ut8 sram_size; // in 1kb chunks
53  ut8 dest_code;
54  ut8 fixed_0x33; // should be equal to 0x33
55  ut8 rom_version;
56  ut16 comp_check; // should be equal to ~checksum
57  ut16 checksum;
58  })
59 sfc_int_hdr;
60 
61 #endif // _SFC_SPECS_H
uint16_t ut16
uint8_t ut8
Definition: lh5801.h:11
RZ_PACKED(typedef struct { char name[0x15];ut8 rom_setup;ut8 rom_type;ut8 rom_size;ut8 sram_size;ut8 dest_code;ut8 fixed_0x33;ut8 rom_version;ut16 comp_check;ut16 checksum;}) sfc_int_hdr
Definition: z80asm.h:102