1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-16 18:08:04 +00:00

fixed some text alignment

This commit is contained in:
xlar54 2024-06-12 16:40:23 -05:00
parent 3ea0ded65d
commit 2c4aca43df

View File

@ -472,105 +472,104 @@ GETPIXEL:
; Must set an error code: NO ; Must set an error code: NO
BAR: BAR:
; Initialize tempY with Y1 ; Initialize tempY with Y1
LDA Y1 lda Y1
STA tempY sta tempY
LDA Y1+1 lda Y1+1
STA tempY+1 sta tempY+1
@outer_loop: @outer_loop:
; Compare tempY with Y2 ; Compare tempY with Y2
LDA tempY+1 lda tempY+1
CMP Y2+1 cmp Y2+1
BCC @outer_continue ; If tempY high byte < Y2 high byte, continue bcc @outer_continue ; If tempY high byte < Y2 high byte, continue
BNE @outer_end ; If tempY high byte > Y2 high byte, end bne @outer_end ; If tempY high byte > Y2 high byte, end
LDA tempY lda tempY
CMP Y2 cmp Y2
BCC @outer_continue ; If tempY low byte < Y2 low byte, continue bcc @outer_continue ; If tempY low byte < Y2 low byte, continue
BEQ @outer_end ; If tempY low byte = Y2 low byte, end beq @outer_end ; If tempY low byte = Y2 low byte, end
@outer_continue: @outer_continue:
; Initialize tempX with X1 ; Initialize tempX with X1
LDA X1 lda X1
STA tempX sta tempX
LDA X1+1 lda X1+1
STA tempX+1 sta tempX+1
@inner_loop: @inner_loop:
; Compare tempX with X2 ; Compare tempX with X2
LDA tempX+1 lda tempX+1
CMP X2+1 cmp X2+1
BCC @inner_continue ; If tempX high byte < X2 high byte, continue bcc @inner_continue ; If tempX high byte < X2 high byte, continue
BNE @inner_end ; If tempX high byte > X2 high byte, end bne @inner_end ; If tempX high byte > X2 high byte, end
LDA tempX lda tempX
CMP X2 cmp X2
BCC @inner_continue ; If tempX low byte < X2 low byte, continue bcc @inner_continue ; If tempX low byte < X2 low byte, continue
@inner_end: @inner_end:
; Increment tempY ; Increment tempY
INC tempY inc tempY
BNE @outer_loop ; If no overflow, continue outer loop bne @outer_loop ; If no overflow, continue outer loop
INC tempY+1 ; If overflow, increment high byte inc tempY+1 ; If overflow, increment high byte
@inner_continue: @inner_continue:
; Call setpixel(tempX, tempY) ; Call setpixel(tempX, tempY)
LDA X1 lda X1
PHA pha
LDA X1+1 lda X1+1
PHA pha
LDA Y1 lda Y1
PHA pha
LDA Y1+1 lda Y1+1
PHA pha
LDA tempX lda tempX
LDX tempX+1 ldx tempX+1
STA X1 sta X1
STX X1+1 stx X1+1
LDA tempY lda tempY
LDX tempY+1 ldx tempY+1
STA Y1 sta Y1
STX Y1+1 stx Y1+1
JSR SETPIXEL jsr SETPIXEL
PLA pla
STA Y1+1 sta Y1+1
PLA pla
STA Y1 sta Y1
PLA pla
STA X1+1 sta X1+1
PLA pla
STA X1 sta X1
; Increment tempX ; Increment tempX
INC tempX inc tempX
BNE @inner_loop_check ; If no overflow, continue bne @inner_loop_check ; If no overflow, continue
INC tempX+1 ; If overflow, increment high byte inc tempX+1 ; If overflow, increment high byte
@inner_loop_check: @inner_loop_check:
; Compare tempX with X2 again after increment ; Compare tempX with X2 again after increment
LDA tempX+1 lda tempX+1
CMP X2+1 cmp X2+1
BCC @inner_continue ; If tempX high byte < X2 high byte, continue bcc @inner_continue ; If tempX high byte < X2 high byte, continue
BNE @outer_increment ; If tempX high byte > X2 high byte, increment tempY bne @outer_increment ; If tempX high byte > X2 high byte, increment tempY
LDA tempX lda tempX
CMP X2 cmp X2
BCC @inner_continue ; If tempX low byte < X2 low byte, continue bcc @inner_continue ; If tempX low byte < X2 low byte, continue
@outer_increment: @outer_increment:
; Increment tempY ; Increment tempY
INC tempY inc tempY
BNE @outer_loop ; If no overflow, continue outer loop bne @outer_loop ; If no overflow, continue outer loop
INC tempY+1 ; If overflow, increment high byte inc tempY+1 ; If overflow, increment high byte
@outer_end: @outer_end:
; End of outer loop, continue with program jmp @done
JMP @done
@done: @done:
; Continue with your program rts
; ------------------------------------------------------------------------ ; ------------------------------------------------------------------------
; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in X and Y ; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in X and Y