From 5a9514df3be3dc350532a6967c208fa95b59bbca Mon Sep 17 00:00:00 2001 From: nihilazo Date: Tue, 1 Mar 2022 15:33:35 +0000 Subject: [PATCH] start breaking out draw-pattern routine --- testmodule.tal | 20 ++++++++++---------- tracker.tal | 9 ++++++++- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/testmodule.tal b/testmodule.tal index 2dee2c9..a04106f 100644 --- a/testmodule.tal +++ b/testmodule.tal @@ -24,7 +24,7 @@ ff 06 0f ff 00 00 ( pattern 01 ) 54 06 04 -56 00 00 +56 01 00 57 00 00 56 00 00 57 00 00 @@ -42,16 +42,16 @@ ff 00 00 ( pattern 02 ) 3c 02 01 00 00 00 -3f 08 01 +3f 01 01 +00 02 00 +3c 03 00 +00 04 00 +3f 05 00 +00 06 00 +3c 07 00 00 00 00 -3c 00 00 -00 00 00 -3f 08 00 -00 00 00 -3c 00 00 -00 00 00 -3f 08 01 -00 08 00 +3f 05 01 +00 05 00 3c 00 00 00 00 00 3c 00 00 diff --git a/tracker.tal b/tracker.tal index 6258441..5104017 100644 --- a/tracker.tal +++ b/tracker.tal @@ -75,10 +75,17 @@ BRK ;draw-song JSR2 #0008 .Screen/y DEO2 #0080 .Screen/x DEO2 - ;get-selected-song-line-address JSR2 DUP2 LDA ;draw-pattern JSR2 + ;get-selected-song-line-address JSR2 ;draw-patterns JSR2 BRK +( draws all currently selected patterns ) +@draw-patterns ( addr* ) +.Screen/x DEI2 ,&pos STR2 +DUP2 ADD2 LDA ;draw-pattern JSR2 +BRK +&pos $2 + @get-selected-song-line-address ( -- addr* ) .tracker/selected-pattern LDZ #00 SWP #0004 MUL2 .kalama/module LDZ2 #0005 ADD2 ADD2