├── bin └── bankswitch.plw ├── bugs ├── credits ├── history ├── license ├── readme └── src ├── bswitch.cpp ├── mappers.h └── nes.h /bin/bankswitch.plw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patois/bankswitch/6dd0fa1608870c8c7dc6b1a1d733ba64dcad14d2/bin/bankswitch.plw -------------------------------------------------------------------------------- /bugs: -------------------------------------------------------------------------------- 1 | known bugs: 2 | ----------- 3 | 4 | - the file offset of banks loaded into the database isn't 5 | updated by IDA Pro. I don't know if this is a bug related 6 | to this plugin 7 | 8 | - 8k PRG ROM pages are not yet supported 9 | 10 | Please send me an e-mail if you find any bugs or have 11 | suggestions for improvements! 12 | 13 | (c) 2006, Dennis Elser (dennis@backtrace.de) -------------------------------------------------------------------------------- /credits: -------------------------------------------------------------------------------- 1 | credits: 2 | -------- 3 | - Sebastian Porst for his valuable hints 4 | - \Firebug\ for his "Comprehensive NES Mapper Document v0.80 5 | by \Firebug\" 6 | - the I/O register information is taken from the 7 | "Nintendo Entertainment System Documentation Version 2.0" 8 | (nestech.txt) - I don't know who wrote it - thank you 9 | for the great information! 10 | - this plugin is based on a lot of excellent reading 11 | material, actually too much to name it here. Most of 12 | the material can be found at http://nesdev.parodius.com 13 | 14 | (c) 2006, Dennis Elser (dennis@backtrace.de) -------------------------------------------------------------------------------- /history: -------------------------------------------------------------------------------- 1 | history: 2 | -------- 3 | 4 | 2006-Oct-04 version 0.1 5 | ----------------------- 6 | - initial version 7 | 8 | 9 | 10 | (c) 2006, Dennis Elser (dennis@backtrace.de) -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | license: 2 | -------- 3 | 4 | freeware, copyright messages have to stay intact. 5 | 6 | 7 | (c) 2006, Dennis Elser (dennis@backtrace.de) -------------------------------------------------------------------------------- /readme: -------------------------------------------------------------------------------- 1 | 2 | Nintendo Entertainment System (NES) bank switcher 3 | ------------------------------------------------------ 4 | Copyright 2006, Dennis Elser 5 | 6 | 7 | IDA Pro plugin module for Nintendo Enternainment System 8 | (NES) ROM images in iNES file format. 9 | 10 | This plugin simulates the bank switching (paging) 11 | mechanism of the NES. 12 | 13 | 14 | 15 | Copy compiled plugin to idadir%/plugins/bankswitch.plw 16 | -------------------------------------------------------------------------------- /src/bswitch.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Nintendo Entertainment System (NES) bank switcher 4 | ------------------------------------------------------ 5 | Copyright 2006, Dennis Elser (dennis@backtrace.de) 6 | 7 | 8 | IDA Pro plugin module for Nintendo Enternainment System 9 | (NES) ROM images in iNES file format. 10 | 11 | 12 | license: 13 | -------- 14 | 15 | - freeware, copyright messages have to stay intact. 16 | 17 | 18 | 19 | Copy compiled plugin to idadir%/plugins/bankswitch.plw 20 | 21 | 22 | Please send me an e-mail if you find any bugs! 23 | 24 | (c) 2006, Dennis Elser (dennis@backtrace.de) 25 | 26 | */ 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include "nes.h" 37 | #include "mappers.h" 38 | 39 | extern plugin_t PLUGIN; 40 | 41 | 42 | static ines_hdr hdr; 43 | 44 | 45 | //---------------------------------------------------------------------- 46 | // 47 | // load iNES header into global ines_hdr structure 48 | // 49 | static bool load_ines_hdr(void) 50 | { 51 | netnode node(INES_HDR_NODE); 52 | ines_hdr *temphdr = NULL; 53 | 54 | if(!netnode_exist(node)) 55 | return false; 56 | temphdr = (ines_hdr *)node.getblob(NULL, NULL, 0, 'I'); 57 | if(temphdr == NULL) 58 | return false; 59 | memcpy(&hdr, temphdr, INES_HDR_SIZE); 60 | qfree(temphdr); 61 | return true; 62 | } 63 | 64 | //---------------------------------------------------------------------- 65 | // 66 | // return number of PRG ROM pages contained in ROM image 67 | // 68 | static uchar get_prg_rom_page_count() 69 | { 70 | return hdr.prg_page_count_16k; 71 | } 72 | 73 | 74 | //---------------------------------------------------------------------- 75 | // 76 | // calculates original file offset of "page" 77 | // 78 | // this function is needed to load_prg_rom_page_from_blob() 79 | // 80 | static long calc_prg_rom_file_offset( uchar page ) 81 | { 82 | return INES_HDR_SIZE 83 | + (INES_MASK_TRAINER( hdr.rom_control_byte_0) ? TRAINER_SIZE : 0) 84 | + page * PRG_ROM_BANK_SIZE; 85 | } 86 | 87 | 88 | //---------------------------------------------------------------------- 89 | // 90 | // load PRG ROM page from blob 91 | // 92 | static bool load_prg_rom_page_from_blob( uchar page, ea_t loading_address ) 93 | { 94 | netnode node; 95 | char prg_node_name[MAXNAMESIZE]; 96 | uchar *buffer; 97 | 98 | qsnprintf( prg_node_name, sizeof(prg_node_name), "$ PRG-ROM page %d", --page ); 99 | if( node.create( prg_node_name ) ) return false; 100 | buffer = (uchar *)node.getblob(NULL, NULL, 0, 'I'); 101 | if(buffer == 0) 102 | return false; 103 | show_wait_box("Loading page.."); 104 | mem2base((uchar *)buffer, loading_address, loading_address + PRG_ROM_BANK_SIZE, calc_prg_rom_file_offset( page )); 105 | qfree(buffer); 106 | do_unknown_range(loading_address, PRG_ROM_BANK_SIZE, true); 107 | analyze_area(inf.minEA, inf.maxEA); 108 | autoWait(); 109 | hide_wait_box(); 110 | 111 | return true; 112 | } 113 | 114 | //---------------------------------------------------------------------- 115 | // 116 | // checks for 8k PRG ROM page mappers, which are not supported yet 117 | // 118 | static bool is_8k_prg_mapper(void) 119 | { 120 | uchar mapper; 121 | bool badmapper = false; 122 | 123 | mapper = INES_MASK_MAPPER_VERSION(hdr.rom_control_byte_0, hdr.rom_control_byte_1); 124 | switch( mapper ) 125 | { 126 | case MAPPER_MMC2: 127 | case MAPPER_TENGEN_RAMBO_1: 128 | badmapper = true; 129 | break; 130 | } 131 | return badmapper; 132 | } 133 | 134 | 135 | //---------------------------------------------------------------------- 136 | // 137 | // check loader name 138 | // 139 | int idaapi init(void) 140 | { 141 | char loadername[MAXSTR]; 142 | 143 | get_loader_name(loadername, sizeof(loadername)); 144 | if(strcmp("nes",loadername) != 0) 145 | return PLUGIN_SKIP; 146 | return PLUGIN_OK; 147 | } 148 | 149 | 150 | void idaapi term(void) 151 | { 152 | 153 | } 154 | 155 | 156 | //---------------------------------------------------------------------- 157 | // 158 | // all the action is happening here 159 | // 160 | void idaapi run(int arg) 161 | { 162 | int res; 163 | sval_t maxpage; 164 | sval_t page; 165 | 166 | if(!load_ines_hdr()) 167 | { 168 | warning("iNES header could not be loaded from database!\nThe database is damaged!"); 169 | return; 170 | } 171 | 172 | if(is_8k_prg_mapper()) 173 | { 174 | warning("The mapper used in this ROM image allows swapping of 8k PRG pages.\n" 175 | "This is not supported by the loader, yet!"); 176 | return; 177 | } 178 | 179 | page = maxpage = get_prg_rom_page_count(); 180 | 181 | if(page<=1) 182 | { 183 | warning("PRG-ROMs can't be switched for this file!\n"); 184 | return; 185 | } 186 | 187 | warning("Warning! Previous banks are not saved automatically!\n" 188 | "It is advised that you save the database under a\n" 189 | "different filename after banks have been switched.\n" 190 | "Otherwise you will lose all previous results!\n"); 191 | 192 | do 193 | { 194 | res = asklong(&page, "This file contains %d 16k-PRG-ROM pages.\n" 195 | "Which page do you want to load at 0x%X ?\n\n", 196 | maxpage, 197 | (get_screen_ea() < PRG_ROM_BANK_C000) ? PRG_ROM_BANK_8000 : PRG_ROM_BANK_C000); 198 | if(res != 1) 199 | return; 200 | } while(page<=0 || page>maxpage); 201 | 202 | msg("Loading page %d..\n",page); 203 | bool ok = load_prg_rom_page_from_blob( page, (get_screen_ea() < PRG_ROM_BANK_C000) ? PRG_ROM_BANK_8000 : PRG_ROM_BANK_C000); 204 | msg("%s loading page %d\n", ok ? "Done" : "Failed", page); 205 | 206 | } 207 | 208 | //-------------------------------------------------------------------------- 209 | char comment[] = "Bankswitch"; 210 | 211 | char help[] = 212 | "This plugin loads PRG-ROM pages into the database.\n" 213 | "\n" 214 | "It requires the NES loader module.\n"; 215 | 216 | 217 | //-------------------------------------------------------------------------- 218 | // This is the preferred name of the plugin module in the menu system 219 | // The preferred name may be overriden in plugins.cfg file 220 | 221 | char wanted_name[] = "Bankswitch"; 222 | 223 | 224 | // This is the preferred hotkey for the plugin module 225 | // The preferred hotkey may be overriden in plugins.cfg file 226 | // Note: IDA won't tell you if the hotkey is not correct 227 | // It will just disable the hotkey. 228 | 229 | char wanted_hotkey[] = "Ctrl-Space"; 230 | 231 | 232 | //-------------------------------------------------------------------------- 233 | // 234 | // PLUGIN DESCRIPTION BLOCK 235 | // 236 | //-------------------------------------------------------------------------- 237 | plugin_t PLUGIN = 238 | { 239 | IDP_INTERFACE_VERSION, 240 | PLUGIN_UNL, // plugin flags 241 | init, // initialize 242 | 243 | term, // terminate. this pointer may be NULL. 244 | 245 | run, // invoke plugin 246 | 247 | comment, // long comment about the plugin 248 | // it could appear in the status line 249 | // or as a hint 250 | 251 | help, // multiline help about the plugin 252 | 253 | wanted_name, // the preferred short name of the plugin 254 | wanted_hotkey // the preferred hotkey to run the plugin 255 | }; 256 | -------------------------------------------------------------------------------- /src/mappers.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Nintendo Entertainment System (NES) loader module 4 | ------------------------------------------------------ 5 | Copyright 2006, Dennis Elser (dennis@backtrace.de) 6 | 7 | */ 8 | 9 | 10 | #ifndef _MAPPERS_H 11 | #define _MAPPERS_H 12 | 13 | 14 | 15 | 16 | #define MAPPER_NOT_SUPPORTED "mapper unknown/not supported" 17 | 18 | char *mapper_names[] = { 19 | "no mapper used", 20 | "MMC 1", 21 | "UNROM", 22 | "CNROM", 23 | "MMC 3", 24 | "MMC 5", 25 | "FFE F4xxx", 26 | "AOROM", 27 | "FFE F3xxx", 28 | "MMC 2", 29 | "MMC 4", 30 | "Color Dreams", 31 | MAPPER_NOT_SUPPORTED, 32 | MAPPER_NOT_SUPPORTED, 33 | MAPPER_NOT_SUPPORTED, 34 | "100 in 1", 35 | "Bandai", 36 | "FFE F8xxx", 37 | "Jaleco SS8806", 38 | "Namcot 106", 39 | MAPPER_NOT_SUPPORTED, 40 | "Konami VRC4", 41 | "Konami VRC2 Type A", 42 | "Konami VRC2 Type B", 43 | "Konami VRC6", 44 | MAPPER_NOT_SUPPORTED, 45 | MAPPER_NOT_SUPPORTED, 46 | MAPPER_NOT_SUPPORTED, 47 | MAPPER_NOT_SUPPORTED, 48 | MAPPER_NOT_SUPPORTED, 49 | MAPPER_NOT_SUPPORTED, 50 | MAPPER_NOT_SUPPORTED, 51 | "Irem G 101", 52 | "Taito TC0190", 53 | "Nina 1", 54 | MAPPER_NOT_SUPPORTED, 55 | MAPPER_NOT_SUPPORTED, 56 | MAPPER_NOT_SUPPORTED, 57 | MAPPER_NOT_SUPPORTED, 58 | MAPPER_NOT_SUPPORTED, 59 | MAPPER_NOT_SUPPORTED, 60 | MAPPER_NOT_SUPPORTED, 61 | MAPPER_NOT_SUPPORTED, 62 | MAPPER_NOT_SUPPORTED, 63 | MAPPER_NOT_SUPPORTED, 64 | MAPPER_NOT_SUPPORTED, 65 | MAPPER_NOT_SUPPORTED, 66 | MAPPER_NOT_SUPPORTED, 67 | MAPPER_NOT_SUPPORTED, 68 | MAPPER_NOT_SUPPORTED, 69 | MAPPER_NOT_SUPPORTED, 70 | MAPPER_NOT_SUPPORTED, 71 | MAPPER_NOT_SUPPORTED, 72 | MAPPER_NOT_SUPPORTED, 73 | MAPPER_NOT_SUPPORTED, 74 | MAPPER_NOT_SUPPORTED, 75 | MAPPER_NOT_SUPPORTED, 76 | MAPPER_NOT_SUPPORTED, 77 | MAPPER_NOT_SUPPORTED, 78 | MAPPER_NOT_SUPPORTED, 79 | MAPPER_NOT_SUPPORTED, 80 | MAPPER_NOT_SUPPORTED, 81 | MAPPER_NOT_SUPPORTED, 82 | MAPPER_NOT_SUPPORTED, 83 | "Tengen Rambo 1", 84 | "Irem H 3001", 85 | "GNROM", 86 | MAPPER_NOT_SUPPORTED, 87 | "Sunsoft Mapper 4", 88 | "Sunsoft FME7", 89 | MAPPER_NOT_SUPPORTED, 90 | "Camerica", 91 | MAPPER_NOT_SUPPORTED, 92 | MAPPER_NOT_SUPPORTED, 93 | MAPPER_NOT_SUPPORTED, 94 | MAPPER_NOT_SUPPORTED, 95 | MAPPER_NOT_SUPPORTED, 96 | MAPPER_NOT_SUPPORTED, 97 | "Irem 74HC161 32", 98 | MAPPER_NOT_SUPPORTED, 99 | MAPPER_NOT_SUPPORTED, 100 | MAPPER_NOT_SUPPORTED, 101 | MAPPER_NOT_SUPPORTED, 102 | MAPPER_NOT_SUPPORTED, 103 | MAPPER_NOT_SUPPORTED, 104 | MAPPER_NOT_SUPPORTED, 105 | MAPPER_NOT_SUPPORTED, 106 | MAPPER_NOT_SUPPORTED, 107 | MAPPER_NOT_SUPPORTED, 108 | MAPPER_NOT_SUPPORTED, 109 | MAPPER_NOT_SUPPORTED, 110 | "HK SF3" 111 | }; 112 | 113 | 114 | enum 115 | { 116 | MAPPER_NONE = 0, 117 | MAPPER_MMC1, 118 | MAPPER_UNROM, 119 | MAPPER_CNROM, 120 | MAPPER_MMC3, 121 | MAPPER_MMC5, 122 | MAPPER_FFE_F4XXX, 123 | MAPPER_AOROM, 124 | MAPPER_FFE_F3XXX, 125 | MAPPER_MMC2, 126 | MAPPER_MMC4, 127 | MAPPER_COLOR_DREAMS, 128 | 129 | MAPPER_100_IN_1 = 15, 130 | MAPPER_BANDAI, 131 | MAPPER_FFE_F8XXX, 132 | MAPPER_JALECO_SS8806, 133 | MAPPER_NAMCOT_106, 134 | 135 | MAPPER_KONAMI_VRC4 = 21, 136 | MAPPER_KONAMI_VRC2_TYPE_A, 137 | MAPPER_KONAMI_VRC2_TYPE_B, 138 | MAPPER_KONAMI_VRC6, 139 | 140 | MAPPER_IREM_G_101 = 32, 141 | MAPPER_TAITO_TC0190, 142 | MAPPER_NINA_1, 143 | 144 | MAPPER_TENGEN_RAMBO_1 = 64, 145 | MAPPER_IREM_H_3001, 146 | MAPPER_GNROM, 147 | 148 | MAPPER_SUNSOFT_MAPPER_4 = 68, 149 | MAPPER_SUNSOFT_FME7, 150 | 151 | MAPPER_CAMERICA = 71, 152 | 153 | MAPPER_IREM_74HC161_32 = 78, 154 | 155 | MAPPER_HK_SF3 = 91, 156 | 157 | 158 | }; 159 | 160 | #define MAPPER_LAST 91 161 | 162 | #endif // _MAPPERS_H -------------------------------------------------------------------------------- /src/nes.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Nintendo Entertainment System (NES) loader module 4 | ------------------------------------------------------ 5 | Copyright 2006, Dennis Elser (dennis@backtrace.de) 6 | 7 | */ 8 | 9 | 10 | #ifndef _NES_H 11 | #define _NES_H 12 | 13 | 14 | 15 | 16 | //---------------------------------------------------------------------- 17 | // 18 | // general NES info: 19 | // 20 | 21 | 22 | #define RAM_START_ADDRESS 0x0 23 | #define RAM_SIZE 0x2000 24 | 25 | #define IOREGS_START_ADDRESS 0x2000 26 | #define IOREGS_SIZE 0x2020 27 | 28 | #define EXPROM_START_ADDRESS 0x4020 29 | #define EXPROM_SIZE 0x1FE0 30 | 31 | #define SRAM_START_ADDRESS 0x6000 32 | #define SRAM_SIZE 0x2000 33 | 34 | // start address and size of a trainer, if present 35 | #define TRAINER_START_ADDRESS 0x7000 36 | #define TRAINER_SIZE 0x0200 37 | 38 | #define ROM_START_ADDRESS 0x8000 39 | #define ROM_SIZE 0x8000 40 | 41 | #define PRG_PAGE_SIZE 0x4000 42 | #define CHR_PAGE_SIZE 0x2000 43 | 44 | 45 | #define PRG_ROM_BANK_SIZE PRG_PAGE_SIZE 46 | #define PRG_ROM_8K_BANK_SIZE 0x2000 47 | #define PRG_ROM_BANK_LOW_ADDRESS ROM_START_ADDRESS 48 | #define PRG_ROM_BANK_HIGH_ADDRESS PRG_ROM_BANK_LOW_ADDRESS + PRG_ROM_BANK_SIZE 49 | #define PRG_ROM_BANK_8000 0x8000 50 | #define PRG_ROM_BANK_A000 0xA000 51 | #define PRG_ROM_BANK_C000 0xC000 52 | #define PRG_ROM_BANK_E000 0xE000 53 | 54 | 55 | #define CHR_ROM_BANK_SIZE CHR_PAGE_SIZE 56 | #define CHR_ROM_BANK_ADDRESS RAM_START_ADDRESS 57 | 58 | 59 | 60 | // start address of vectors 61 | #define NMI_VECTOR_START_ADDRESS 0xFFFA 62 | #define RESET_VECTOR_START_ADDRESS 0xFFFC 63 | #define IRQ_VECTOR_START_ADDRESS 0xFFFE 64 | 65 | 66 | 67 | // PPU RAM layout bottom-up 68 | 69 | #define PATTERN_TABLE_SIZE 0x1000 70 | #define ATTRIBUTE_TABLE_SIZE 0x40 71 | #define NAME_TABLE_SIZE 0x3C0 72 | #define MIRRORS_0_SIZE 0xF00 73 | #define MIRRORS_1_SIZE 0xE0 74 | #define MIRRORS_2_SIZE 0xC000 75 | 76 | #ifdef PALETTE_SIZE // defined in lines.hpp 77 | #undef PALETTE_SIZE 78 | #define PALETTE_SIZE 0x10 79 | #endif 80 | 81 | 82 | #define PATTERN_TABLE_0_ADDRESS 0x0 83 | #define PATTERN_TABLE_1_ADDRESS 0x1000 84 | 85 | #define NAME_TABLE_0_ADDRESS 0x2000 86 | #define ATTRIBUTE_TABLE_0_ADDRESS 0x23C0 87 | 88 | #define NAME_TABLE_1_ADDRESS 0x2400 89 | #define ATTRIBUTE_TABLE_1_ADDRESS 0x27C0 90 | 91 | #define NAME_TABLE_2_ADDRESS 0x2800 92 | #define ATTRIBUTE_TABLE_2_ADDRESS 0x2BC0 93 | 94 | #define NAME_TABLE_3_ADDRESS 0x2C00 95 | #define ATTRIBUTE_TABLE_3_ADDRESS 0x2CF0 96 | 97 | #define MIRRORS_0_ADDRESS 0x3000 98 | 99 | #define IMAGE_PALETTE_ADDRESS 0x3F00 100 | 101 | #define SPRITE_PALETTE_ADDRESS 0x3F10 102 | 103 | #define MIRRORS_1_ADDRESS 0x3F20 104 | 105 | #define MIRRORS_2_ADDRESS 0x4000 106 | 107 | 108 | 109 | //---------------------------------------------------------------------- 110 | // 111 | // iNES file format specific information 112 | // 113 | 114 | // structure of iNES header 115 | typedef struct _ines_hdr_t { 116 | 117 | uchar id[0x3]; // NES 118 | uchar term; // 0x1A 119 | uchar prg_page_count_16k; // number of PRG-ROM pages 120 | uchar chr_page_count_8k; // number of CHR-ROM pages 121 | uchar rom_control_byte_0; // flags describing ROM image 122 | uchar rom_control_byte_1; // flags describing ROM image 123 | uchar ram_bank_count_8k; // not used by this loader currently 124 | uchar reserved[7]; // should all be zero (not checked by loader) 125 | 126 | } ines_hdr; 127 | 128 | 129 | // size of iNES header 130 | #define INES_HDR_SIZE sizeof( ines_hdr ) 131 | 132 | 133 | // node name for iNES header 134 | #define INES_HDR_NODE "$ iNES ROM header" 135 | 136 | #define BANK_NUM_8000 "$ Bank 8000" 137 | #define BANK_NUM_C000 "$ Bank C000" 138 | 139 | // macros for masking control byte (cb) flags of the header 140 | #define INES_MASK_V_MIRRORING( cb ) ( cb & 0x1 ) 141 | #define INES_MASK_H_MIRRORING( cb ) !INES_MASK_V_MIRRORING( cb ) 142 | #define INES_MASK_SRAM( cb ) ( (cb & 0x2) >> 1 ) 143 | #define INES_MASK_TRAINER( cb ) ( (cb & 0x4) >> 2 ) 144 | #define INES_MASK_VRAM_LAYOUT( cb ) ( (cb & 0x8) >> 3 ) 145 | 146 | 147 | // macro for getting the version of the mapper used by ROM image 148 | #define INES_MASK_MAPPER_VERSION(cb0, cb1) ( ((cb0 & 0xF0) >> 4) | (cb1 & 0xF0) ) 149 | 150 | 151 | 152 | 153 | //---------------------------------------------------------------------- 154 | // 155 | // function prototypes for nes.cpp 156 | // 157 | 158 | static void load_ines_file( linput_t *li ); // convenience function for all below 159 | 160 | static bool is_corrupt_ines_hdr( void ); 161 | static void fix_ines_hdr( void ); 162 | 163 | static void create_segments( linput_t *li ); // convenience function for the following few 164 | static void create_sram_segment( void ); 165 | static void create_ram_segment( void ); 166 | static void create_ioreg_segment( void ); 167 | static void create_rom_segment( void ); 168 | static void create_exprom_segment( void ); 169 | 170 | static void load_trainer( linput_t *li ); 171 | static void load_chr_rom_bank( linput_t *li, uchar banknr, ea_t address ); 172 | static void load_prg_rom_bank( linput_t *li, uchar banknr, ea_t address ); 173 | static void load_8k_prg_rom_bank( linput_t *li, uchar banknr, ea_t address ); 174 | static void load_rom_banks( linput_t *li ); 175 | 176 | static void save_image_as_blobs( linput_t *li ); // convenience function for the following few 177 | static bool save_ines_hdr_as_blob( void ); 178 | static bool save_trainer_as_blob( linput_t *li ); 179 | static bool save_prg_rom_pages_as_blobs( linput_t *li, uchar count ); 180 | static bool save_chr_rom_pages_as_blobs( linput_t *li, uchar count ); 181 | 182 | 183 | static char *get_mapper_name( uchar mapper ); 184 | static void define_item( ushort address, asize_t size, char *shortdesc, char *comment ); 185 | static ea_t get_vector( ea_t vec ); 186 | static void name_vector( ushort address, const char *name ); 187 | static bool add_entry_points( linput_t *li ); 188 | static void set_ida_export_data( void ); 189 | static void describe_rom_image( void ); 190 | 191 | #endif // _NES_H --------------------------------------------------------------------------------