modify linedraw to not draw outside screen aria.

This commit is contained in:
hugova 2025-07-24 21:48:26 +02:00
parent 25e65d8197
commit f7d4a4e83f
2 changed files with 18 additions and 1 deletions

View file

@ -11,3 +11,4 @@
V = $E4 ; 16-bit value (uses E5) V = $E4 ; 16-bit value (uses E5)
D = $E6 ; 16-bit value (uses E7) D = $E6 ; 16-bit value (uses E7)
byte_to_paint = $E8 byte_to_paint = $E8
;; E9 in use of pixel_calc

View file

@ -1,8 +1,24 @@
;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- ;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*-
.proc line; user-procedure :clobbers (A X Y) :clobbers-arguments 4 .proc line; user-procedure :clobbers (A X Y) :clobbers-arguments 4
;X_pos =< X_end skall alltid gälla
.include "line.inc" .include "line.inc"
;; Fix line that is too long
LDA Y_pos
CMP #$C8 ;;y_max = $C8
BCC do_not_fix_y_pos
LDA #$C8
STA Y_pos
do_not_fix_y_pos:
LDA Y_end
CMP #$C8 ;;y_max = $C8
BCC do_not_fix_y_end
LDA #$C8
STA Y_end
do_not_fix_y_end:
;;dx ;;dx
SEC SEC
LDA X_end LDA X_end