I have been quite busy with my engine these days to the point that my code and data combined is starting to spill from the fixed banks and even from the selected ones. I need to trim some fat, somehow
Because of the current issue, I'm starting to investigate where I can switch bank(s) and how useful in that scenario it could be but I found one possible issue: one case where I may need to call the code from another bank and come back after since I may need to change more than 1 bank to do the operation. I guess this is all trampolines are about.
I understand the concept and why it would be useful but my only concern is if there are place where you have to be careful to use trampoline or not. For example, I may have to use some trampoline code to jump to the sound driver, inside the nmi, then continue once finished but is it dangerous to do so from NMI? If the sound driver is not over, the NMI won't return yet, right?
What are the "gotcha" that I have to be careful when using such techniques?
Because of the current issue, I'm starting to investigate where I can switch bank(s) and how useful in that scenario it could be but I found one possible issue: one case where I may need to call the code from another bank and come back after since I may need to change more than 1 bank to do the operation. I guess this is all trampolines are about.
I understand the concept and why it would be useful but my only concern is if there are place where you have to be careful to use trampoline or not. For example, I may have to use some trampoline code to jump to the sound driver, inside the nmi, then continue once finished but is it dangerous to do so from NMI? If the sound driver is not over, the NMI won't return yet, right?
What are the "gotcha" that I have to be careful when using such techniques?