From f7d4a4e83fe5b103e4c3dd5ed4cdc835bf70430d Mon Sep 17 00:00:00 2001 From: hugova Date: Thu, 24 Jul 2025 21:48:26 +0200 Subject: [PATCH] modify linedraw to not draw outside screen aria. --- wip-hugo/routines/line/line.inc | 1 + wip-hugo/routines/line/line.s | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/wip-hugo/routines/line/line.inc b/wip-hugo/routines/line/line.inc index fb6e999..31a4b58 100644 --- a/wip-hugo/routines/line/line.inc +++ b/wip-hugo/routines/line/line.inc @@ -11,3 +11,4 @@ V = $E4 ; 16-bit value (uses E5) D = $E6 ; 16-bit value (uses E7) byte_to_paint = $E8 + ;; E9 in use of pixel_calc diff --git a/wip-hugo/routines/line/line.s b/wip-hugo/routines/line/line.s index 796214e..320a1a9 100644 --- a/wip-hugo/routines/line/line.s +++ b/wip-hugo/routines/line/line.s @@ -1,8 +1,24 @@ ;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- .proc line; user-procedure :clobbers (A X Y) :clobbers-arguments 4 -;X_pos =< X_end skall alltid gälla + .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 SEC LDA X_end