Compare commits
2 commits
d9fe32e8f3
...
bbf12a7ba2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bbf12a7ba2 | ||
![]() |
147ceb73f2 |
4 changed files with 12 additions and 13 deletions
|
@ -43,9 +43,6 @@
|
||||||
Add_16 >D, <D, #$ff, #$01, !
|
Add_16 >D, <D, #$ff, #$01, !
|
||||||
Sub_16 >D, <D, dx, #$00
|
Sub_16 >D, <D, dx, #$00
|
||||||
|
|
||||||
jsr pixel_draw ;;only used first pixel. after this relative position is abused
|
|
||||||
LDX X_pos
|
|
||||||
|
|
||||||
selfmod:
|
selfmod:
|
||||||
;; Self modifying code. Makes LDA and SBC instructions each take 1 cycle less.
|
;; Self modifying code. Makes LDA and SBC instructions each take 1 cycle less.
|
||||||
;; You can remove this if you run the loop without # at dy_2 and V.
|
;; You can remove this if you run the loop without # at dy_2 and V.
|
||||||
|
@ -66,7 +63,9 @@ selfmod:
|
||||||
LDA <V
|
LDA <V
|
||||||
STA case_1 +7
|
STA case_1 +7
|
||||||
end_selfmod:
|
end_selfmod:
|
||||||
|
LDY #$01
|
||||||
|
JSR pixel_draw ;;only used first pixel. after this relative position is abused
|
||||||
|
LDX X_pos
|
||||||
for_x:
|
for_x:
|
||||||
;; Paints A to address in |btp_mem_pos* + Y|
|
;; Paints A to address in |btp_mem_pos* + Y|
|
||||||
;; Y is pixel position in the chunk. Therefor it may be that Y = 0, 1, 2, 3, 4, ,5 ,6 ,7.
|
;; Y is pixel position in the chunk. Therefor it may be that Y = 0, 1, 2, 3, 4, ,5 ,6 ,7.
|
||||||
|
|
|
@ -39,7 +39,7 @@ selfmod:
|
||||||
LDA <V
|
LDA <V
|
||||||
STA case_1 +7
|
STA case_1 +7
|
||||||
end_selfmod:
|
end_selfmod:
|
||||||
|
LDY #$01
|
||||||
jsr pixel_draw
|
jsr pixel_draw
|
||||||
LDX Y_pos
|
LDX Y_pos
|
||||||
for_y:
|
for_y:
|
||||||
|
|
|
@ -36,12 +36,13 @@ selfmod:
|
||||||
LDA <dy_2
|
LDA <dy_2
|
||||||
STA case_2 +7
|
STA case_2 +7
|
||||||
LDA >V
|
LDA >V
|
||||||
STA case_1 +1
|
STA case_1 +3
|
||||||
LDA <V
|
LDA <V
|
||||||
STA case_1 +7
|
STA case_1 +9
|
||||||
end_selfmod:
|
end_selfmod:
|
||||||
|
|
||||||
jsr pixel_draw
|
jsr pixel_draw
|
||||||
|
LDY #$01
|
||||||
|
Sub_16 >btp_mem_pos, <btp_mem_pos, #$01, #$00 ;; Y has always a offset of at least 1
|
||||||
LDX X_pos
|
LDX X_pos
|
||||||
for_x:
|
for_x:
|
||||||
LDA byte_to_paint
|
LDA byte_to_paint
|
||||||
|
@ -60,18 +61,17 @@ increment_pixel_x_end:
|
||||||
BEQ end
|
BEQ end
|
||||||
Lag_16 >D, <D, #$00, #$02, case_2
|
Lag_16 >D, <D, #$00, #$02, case_2
|
||||||
case_1:
|
case_1:
|
||||||
Sub_16_A >D, <D, #>V, #<V, !
|
Sub_16 >D, <D, #>V, #<V,!
|
||||||
decrement_y_pos:
|
decrement_y_pos:
|
||||||
DEY
|
DEY
|
||||||
CPY #$ff
|
|
||||||
BNE for_x
|
BNE for_x
|
||||||
move_8px_up:
|
move_8px_up:
|
||||||
LDY #$07
|
LDY #$08
|
||||||
Sub_16 >btp_mem_pos, <btp_mem_pos, #$40, #$01, !
|
Sub_16 >btp_mem_pos, <btp_mem_pos, #$40, #$01, !
|
||||||
jmp for_x
|
jmp for_x
|
||||||
decrement_y_pos_end:
|
decrement_y_pos_end:
|
||||||
case_2:
|
case_2:
|
||||||
Add_16 >D, <D, #>dy_2, #<dy_2, !
|
Add_16 >D, <D, #>dy_2, #<dy_2,!
|
||||||
JMP for_x
|
JMP for_x
|
||||||
end:
|
end:
|
||||||
RTS
|
RTS
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
LDA <V
|
LDA <V
|
||||||
STA case_1 +7
|
STA case_1 +7
|
||||||
end_selfmod:
|
end_selfmod:
|
||||||
|
LDY #$01
|
||||||
jsr pixel_draw
|
jsr pixel_draw
|
||||||
LDX Y_pos
|
LDX Y_pos
|
||||||
for_y:
|
for_y:
|
||||||
|
|
Loading…
Add table
Reference in a new issue