mirror of
https://github.com/irmen/prog8.git
synced 2025-02-16 22:30:46 +00:00
fix and optimize gfx2.position2(), added cx16.vaddr_clone()
This commit is contained in:
parent
4c6a2f5df9
commit
65a7a8caf8
@ -881,7 +881,6 @@ skip:
|
|||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
@ -892,8 +891,8 @@ skip:
|
|||||||
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)
|
||||||
bank = lsb(cx16.r1)
|
cx16.r2L = cx16.r1L
|
||||||
cx16.vaddr(bank, cx16.r0, 0, 1)
|
cx16.vaddr(cx16.r2L, cx16.r0, 0, 1)
|
||||||
}
|
}
|
||||||
5 -> {
|
5 -> {
|
||||||
; highres monochrome
|
; highres monochrome
|
||||||
@ -903,24 +902,16 @@ skip:
|
|||||||
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)
|
||||||
bank = lsb(cx16.r1)
|
cx16.r2L = cx16.r1L
|
||||||
cx16.vaddr(bank, cx16.r0, 0, 1)
|
cx16.vaddr(cx16.r2L, cx16.r0, 0, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub position2(uword @zp x, uword y, bool also_port_1) {
|
sub position2(uword @zp x, uword y, bool also_port_1) {
|
||||||
position(x, y)
|
position(x, y)
|
||||||
if also_port_1 {
|
if also_port_1
|
||||||
when active_mode {
|
cx16.vaddr_clone(0)
|
||||||
1, 5 -> cx16.vaddr(0, cx16.r0, 1, 1)
|
|
||||||
; TODO modes 2, 3
|
|
||||||
4, 6 -> {
|
|
||||||
ubyte bank = lsb(cx16.r1)
|
|
||||||
cx16.vaddr(bank, cx16.r0, 1, 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline asmsub next_pixel(ubyte color @A) {
|
inline asmsub next_pixel(ubyte color @A) {
|
||||||
|
@ -564,6 +564,25 @@ asmsub vaddr(ubyte bank @A, uword address @R0, ubyte addrsel @R1, byte autoIncrO
|
|||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
asmsub vaddr_clone(ubyte port @A) clobbers (A,X,Y) {
|
||||||
|
; -- clones Vera addresses from the given source port to the other one.
|
||||||
|
; leaves CTRL on the destination port.
|
||||||
|
%asm {{
|
||||||
|
sta VERA_CTRL
|
||||||
|
ldx VERA_ADDR_L
|
||||||
|
ldy VERA_ADDR_H
|
||||||
|
phy
|
||||||
|
ldy VERA_ADDR_M
|
||||||
|
eor #1
|
||||||
|
sta VERA_CTRL
|
||||||
|
stx VERA_ADDR_L
|
||||||
|
sty VERA_ADDR_M
|
||||||
|
ply
|
||||||
|
sty VERA_ADDR_H
|
||||||
|
rts
|
||||||
|
}}
|
||||||
|
}
|
||||||
|
|
||||||
asmsub vaddr_autoincr(ubyte bank @A, uword address @R0, ubyte addrsel @R1, uword autoIncrAmount @R2) clobbers(A,Y) {
|
asmsub vaddr_autoincr(ubyte bank @A, uword address @R0, ubyte addrsel @R1, uword autoIncrAmount @R2) clobbers(A,Y) {
|
||||||
; -- setup the VERA's data address register 0 or 1
|
; -- setup the VERA's data address register 0 or 1
|
||||||
; including setting up optional auto increment amount.
|
; including setting up optional auto increment amount.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user