I'm making a game using mapper 11. I only have two 32k PRG banks, one for the main game engine and the other is used to store a bunch of arrays containing 96 bytes of level data. Everything is basically working like I want it to, except I can't use memcpy to copy the array. Here is the code I have at the same address in PRG0 and PRG1
Code: Select all
void Load_Array(void) {
do_Switch = 1;
while (do_Switch) {
new_bank = PRG_bank + CHR_bank;
change_reg(new_bank); // Call to bank switching routine
do_Switch = 0; // Break the loop so we can return
}
}
// At the same address in PRG1
void Load_Array1(void) {
do_Switch = 1;
while(do_Switch) {
new_bank = PRG_bank + CHR_bank;
change_reg(new_bank);
memcpy(L_MAP, All_Levels[level], 96);
PRG_bank = 0x00; // Send us back to PRG0
}
}
Code: Select all
// I tried a for loop, but it also doesn't work.
for (A = 0; A < 96; ++A) {
L_MAP[A] = All_Levels[level][A];
}
// Even this doesn't work.
L_MAP[A] = All_Levels[level][A];
// This works, but is disgusting.
L_MAP[0] = All_Levels[level][0];
...
L_MAP[95] = All_Levels[level][95];