Compare commits

...

2 commits

5 changed files with 21 additions and 17 deletions

View file

@ -80,6 +80,7 @@
;;Larger then operation, uses the A register
;;IF a < b then: jump to label
; C =0 if jump to LABEL
.macro Lag_16 a_low, a_hi, b_low, b_hi, label ; [low, hi] = [low, hi]*2
LDA a_hi
CMP b_hi

View file

@ -51,7 +51,7 @@
Sub_16 >D, <D, dx, #$00
jsr pixel_draw ;;only used first pixel. after this relative position is abused
LDY #$00
;LDY #$00
LDX X_pos
for_x:
;; Paints A to address i btp_mem_pos* + Y
@ -82,10 +82,9 @@ increment_y_pos:
CPY #$08 ;
BNE for_x
move_8px_down: ; Z=1 --> C=1
;; +320-8 bytes
LDY #$00
Add_16 >btp_mem_pos, <btp_mem_pos, #$40, #$01
jmp for_x
Add_16 >btp_mem_pos, <btp_mem_pos, #$40, #$01; +320
JMP for_x
increment_y_pos_end:
case_2: ;; C =0 because LAG_16 so we can use !
Add_16 >D, <D, >dy_2, <dy_2, ! ;D = D + 2*dy

View file

@ -65,8 +65,8 @@ increment_y_pos_end:
;;If D < %00000010 00000000: case_2
;;else case 1.
Lag_16 >D, <D, #$00, #$02, case_2
case_1:
Sub_16 >D, <D, >V, <V; D = D - V
case_1:; C = 1 because LAG
Sub_16 >D, <D, >V, <V, !; D = D - V
increment_pixel_x:
LDA byte_to_paint
LSR byte_to_paint

View file

@ -6,9 +6,9 @@
X_pos_ = $0E
Y_end_ = $10
X_end_ = $11
LDA #$d0
LDA #$d2
STA X_pos_
LDA #$60
LDA #$62
STA Y_pos_
LDA #$ff
STA X_end

View file

@ -47,14 +47,18 @@ end__:
LDA #%00000111 ; A = y (mod 8)
AND Y_pos ;; offset to add
;;ading offset, same as psudocode bellow
;;Add_16 >btp_mem_pos, <btp_mem_pos, A, #$00
CLC ; Y = b_low
ADC >btp_mem_pos
STA >btp_mem_pos
LDA #$00
ADC <btp_mem_pos ; C =0
STA <btp_mem_pos
;CLC ; Y = b_low
;ADC >btp_mem_pos
;STA >btp_mem_pos
;LDA #$00
;ADC <btp_mem_pos ; C =0
;STA <btp_mem_pos
TAY
CLC
LDA #$00
STA $4B
@ -87,9 +91,9 @@ end__:
Add_16 >btp_mem_pos, <btp_mem_pos, #<Bitmap, #>Bitmap, !
;;Let draw some stuff
LDX #$00
;LDY #$00
LDA byte_to_paint ;; note that both bytes are used!
ORA (>btp_mem_pos, X)
STA (>btp_mem_pos, X)
ORA (>btp_mem_pos), Y
STA (>btp_mem_pos), Y
RTS
.endproc