Compare commits

..

No commits in common. "bbf12a7ba26fff74bfa470ed7fd114af65a3ff85" and "d9fe32e8f3b81af6a18873cb811bff4ce8177b69" have entirely different histories.

4 changed files with 13 additions and 12 deletions

View file

@ -43,6 +43,9 @@
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.
@ -63,9 +66,7 @@ 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.

View file

@ -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:

View file

@ -36,13 +36,12 @@ selfmod:
LDA <dy_2 LDA <dy_2
STA case_2 +7 STA case_2 +7
LDA >V LDA >V
STA case_1 +3 STA case_1 +1
LDA <V LDA <V
STA case_1 +9 STA case_1 +7
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
@ -61,12 +60,13 @@ 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 >D, <D, #>V, #<V,! Sub_16_A >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 #$08 LDY #$07
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:

View file

@ -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: