08-15-2012, 08:44 AM
na_th_an Wrote:I do: the ISR saves all the register pairs. Check the code and seeAfter thinking it twice I've just realized print uses ROM Font, as pointed in PEEK(Uinteger, 23606) + 256. This default value should be 15360 + 256, which is the default FONT Charset which lays in ROM. Put this font in another location and update this variable accordingly, and the print routine will work OK ;-)
But that's not the problem. The problem occurs with bank switching. Just with bank switching, even if I don't enable my ISR or even don't enable IM2, any bank switching messes subsequent PRINT calls. Minimal case scenario:
Compile and run this in either 128 BASIC or USR 0 mode. You won't see "HOLA" on screen, but a bunch of trash.Code:' Test
Asm
; Permorm some dummy paging
di
ld a, 5
ld bc, $7ffd
out (c), a
; now RAM 5 is in.
xor a
ld bc, $7ffd
out (c), a
ld ($5b5c), a
ei
; back to normal
End Asm
Print "HOLA";