fix bank arg error in gfx2.position

This commit is contained in:
Irmen de Jong 2021-02-06 16:58:17 +01:00
parent cefef3d1be
commit eb2d5bb1f8
2 changed files with 11 additions and 2 deletions

View File

@ -653,6 +653,7 @@ _done
} }
sub position(uword @zp x, uword y) { sub position(uword @zp x, uword y) {
ubyte bank
when active_mode { when active_mode {
1 -> { 1 -> {
; lores monochrome ; lores monochrome
@ -663,7 +664,8 @@ _done
4 -> { 4 -> {
; lores 256c ; lores 256c
void addr_mul_24_for_lores_256c(y, x) ; 24 bits result is in r0 and r1L (highest byte) void addr_mul_24_for_lores_256c(y, x) ; 24 bits result is in r0 and r1L (highest byte)
cx16.vaddr(lsb(cx16.r1), cx16.r0, 0, 1) bank = lsb(cx16.r1)
cx16.vaddr(bank, cx16.r0, 0, 1)
} }
5 -> { 5 -> {
; highres monochrome ; highres monochrome
@ -673,7 +675,8 @@ _done
6 -> { 6 -> {
; highres 4c ; highres 4c
void addr_mul_24_for_highres_4c(y, x) ; 24 bits result is in r0 and r1L (highest byte) void addr_mul_24_for_highres_4c(y, x) ; 24 bits result is in r0 and r1L (highest byte)
cx16.vaddr(lsb(cx16.r1), cx16.r0, 0, 1) bank = lsb(cx16.r1)
cx16.vaddr(bank, cx16.r0, 0, 1)
} }
} }
} }

View File

@ -4,6 +4,12 @@
main { main {
sub start() { sub start() {
ubyte bank
; TODO give error that a register is used as an argument value and at the same time is a register parameter taking a new value.
; (note: this is OK if the register is used as an argument for a register param that is the same register)
cx16.vaddr(lsb(cx16.r1), cx16.r0, 0, 1)
txt.print("hello") txt.print("hello")
} }
} }