#pragma code-name ("BNK05")
typedef struct {
u16 map_org;
u8 map_alt;
u8 prg_mode;
u8 chr_mode;
u8 wram_en;
u8 xram_en;
u8 prg_bank_a;
u8 map_sub;
} MapDB;
#pragma rodata-name ("BNK05")
static const MapDB map_db[] = {
#include "map_database.h"
};
2. I replaced the compilation control statement with:
#pragma rodata-name (push, "BNK05")
Still invalid
3. Based on 2, I added a line at the end of the global variable:
#pragma rodata-name (pop)
An error was reported and the message "segment name stack is empty" was prompted(how could it be? )
4. I wrote this before the global variable
#pragma code-name ("BNK05")
#pragma rodata-name ("BNK05")
These above two sentences are continuous without any other code before defining global variables.
Wonderfully, the compilation passed, but the generated RODATA may overwrite the RODATA of other subsequent files.
My fault, a simple syntax error. I inserted a compilation control macro, but # pragma was blocked