If something is long or short - mostly the assemblers job. Working out an address based upon data bank, also the assemblers job.
Yes you will need to think, do I want this function to RTS or RTL, you could use a trampoline to do a conversion for you, but that is more a VECTOR table rather than a trampoline.
Bank 03
Code: Select all
jLMyFunc
jsr myFunc
rtl
myFunc
stuff
rts
So if you are in Bank 02 you would do
jsl jLMyFunc and if you are in Bank 03 you would do
jsr myFunc not really a trampoline as you don't jump out and then bank in.
JSL takes 1 clock more than JSR
RTL takes the same number of cycles as RTS
The trampoline method eats 12 extra clocks. So if you rarely use the function out of bank, sure JUMP Vector it. If you use it 50/50 then always JSL and take the 1 clock hit.
However most of the time you can just JSR/RTS and let the assembler handle the JSL/R RTS/L conversion for you, I would think. On a SNES 32K banks are large, that is a whole C64 or NES game in one shot, In days of yore each bank would have been a "system" and had a VECTOR entry table so you could just assemble each ROM 1 by 1 and not have to sit through the whole lot each time. These days you can one shot the whole ROM and let the assembler handle it.