Programowanie: Rysowanie punktu
From Atariki
(Różnice między wersjami)
Wersja z dnia 00:35, 11 gru 2016 Mono (Dyskusja | wkład) (sdp) ← Previous diff |
Aktualna wersja Mono (Dyskusja | wkład) (ciut szybciej dla gr8) |
||
Linia 3: | Linia 3: | ||
Plot dla trybu lowres (Graphics 15) 160x192: | Plot dla trybu lowres (Graphics 15) 160x192: | ||
<pre> | <pre> | ||
- | org $80 | ||
COLOR = 1 ;kolor z zakresu 0,1,2,3 | COLOR = 1 ;kolor z zakresu 0,1,2,3 | ||
+ | org $80 | ||
adr .ds 2 | adr .ds 2 | ||
Linia 49: | Linia 49: | ||
sta adr+1 | sta adr+1 | ||
+ | bcs ?1xx | ||
+ | |||
+ | ?0xx: | ||
ldy byteoff,x | ldy byteoff,x | ||
- | scc | + | lda (adr),y |
- | ldy byteoff+$100,x | + | and bytemask,x |
+ | ora bytepxl,x | ||
+ | sta (adr),y | ||
+ | rts | ||
+ | ?1xx: | ||
+ | ldy byteoff+$100,x | ||
lda (adr),y | lda (adr),y | ||
and bytemask,x | and bytemask,x |
Aktualna wersja
Plot dla trybu lowres (Graphics 15) 160x192:
COLOR = 1 ;kolor z zakresu 0,1,2,3 org $80 adr .ds 2 ;Y = y, X = x plot: lda lnadl,y sta adr lda lnadh,y sta adr+1 ldy byteoff,x lda (adr),y and bytemask,x ora bytepxl,x sta (adr),y rts lnadl: :192 .byte <(screen+40*#) lnadh: :192 .byte >(screen+40*#) byteoff: :160 .byte #/4 bytemask: :160 .byte ~(%11 << (6 - ((# & %11) * 2))) bytepxl: :160 .byte COLOR << (6 - ((# & %11) * 2))
Plot dla trybu hires (Graphics 8) 320x192:
COLOR = 1 ;kolor z zakresu 0,1 org $80 adr .ds 2 ;Y = y, X = <x, C = >x plot: lda lnadl,y sta adr lda lnadh,y sta adr+1 bcs ?1xx ?0xx: ldy byteoff,x lda (adr),y and bytemask,x ora bytepxl,x sta (adr),y rts ?1xx: ldy byteoff+$100,x lda (adr),y and bytemask,x ora bytepxl,x sta (adr),y rts lnadl: :192 .byte <(screen+40*#) lnadh: :192 .byte >(screen+40*#) byteoff: :320 .byte #/8 bytemask: :256 .byte ~(1 << (7 - (# & %111))) bytepxl: :256 .byte COLOR << (7 - (# & %111))