Jac! had inspired me to write some code that does almost transparent bankswitching that works using jmp and even jsr/rts.
First, here's the code for F4 bankswitching, which - of cause - needs to be present at the same location of each bank:
.define HOTSPOTS $FFF4 .macro bankjsr _addr lda #>(_addr-1) ldy #<(_addr-1) jsr bankjmpcode .endmacro .macro bankjmp _addr lda #>(_addr-1) ldy #<(_addr-1) jmp bankjmpcode .endmacro .macro bankrts jmp bankrtscode .endmacro bankjmpcode: pha asl rol rol rol and #%00000111 tax tya pha lda HOTSPOTS,x rts bankrtscode: tsx lda $02,x asl rol rol rol and #%00000111 tax lda HOTSPOTS,x rtsDisadvantages: jmp/jsr destroy all registers, rts just leave Y intact.
Advantages: very flexible, bankrts als works when not called via bankjsr, does not need a fixed ram address for the jmp destination.
For F6/F8 bankswitching, just reduce the number of "rol"s and the number of bits in the "and"s.