From 982b6c7ea6f0cc7d5d691679745b7536fc23ce69 Mon Sep 17 00:00:00 2001 From: hugova Date: Wed, 5 Mar 2025 01:27:37 +0100 Subject: [PATCH] A fix for the timer to work by making it start with value 1. It do not increment from 0! --- wip-hugo/macros/timer.s | 6 ++++++ wip-hugo/routines/line/line_test_time.s | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/wip-hugo/macros/timer.s b/wip-hugo/macros/timer.s index 51e5589..6cbd415 100644 --- a/wip-hugo/macros/timer.s +++ b/wip-hugo/macros/timer.s @@ -2,6 +2,12 @@ .macro time_start PHA LDA $DC08 ; Bit 0..3: Tenth seconds in BCD-format, others may be 0 or 1 + ;;;;Clear all time data and set time =1. + AND #%11110000 + STA $DC08 + INC $DC08 + LDA $DC08 + ;;Time is only at bit 0 ..3 AND #%00001111 STA $f1 PLA diff --git a/wip-hugo/routines/line/line_test_time.s b/wip-hugo/routines/line/line_test_time.s index d45d553..26f926a 100644 --- a/wip-hugo/routines/line/line_test_time.s +++ b/wip-hugo/routines/line/line_test_time.s @@ -19,7 +19,7 @@ ;; Short test for timing time_start -@loop: +@loop:;; mem f1 LDA Y_pos_ STA Y_pos LDA X_pos_ @@ -28,7 +28,7 @@ time_start jsr line INC Y_end LDA Y_end - CMP #$30 + CMP #$90 BEQ end__ jmp @loop end__: