summaryrefslogtreecommitdiffstats
path: root/from_pkg/hello.zsm
diff options
context:
space:
mode:
authorfishsoupisgood <github@madingley.org>2019-05-27 10:13:10 +0100
committerfishsoupisgood <github@madingley.org>2019-05-27 10:13:10 +0100
commit8110dec1577d9a9002119c15467d71d8a1f51bc8 (patch)
tree80cb75576c1aad9b30af6a8ac97fcc0bb2034cca /from_pkg/hello.zsm
parente070d1885626a365099fac3caf0b537d04f4900e (diff)
downloadwristapps-8110dec1577d9a9002119c15467d71d8a1f51bc8.tar.gz
wristapps-8110dec1577d9a9002119c15467d71d8a1f51bc8.tar.bz2
wristapps-8110dec1577d9a9002119c15467d71d8a1f51bc8.zip
find original wristapp.i, and unmodify code back to it
Diffstat (limited to 'from_pkg/hello.zsm')
-rw-r--r--from_pkg/hello.zsm77
1 files changed, 77 insertions, 0 deletions
diff --git a/from_pkg/hello.zsm b/from_pkg/hello.zsm
new file mode 100644
index 0000000..ad6f4c8
--- /dev/null
+++ b/from_pkg/hello.zsm
@@ -0,0 +1,77 @@
+;Name: Hello World
+;Version: HELLO
+;Description: This is a simple Hello Program
+;by John A. Toebes, VIII
+;
+;TIP: Download your watch faster: Download a WristApp once, then do not send it again. It stays in the watch!
+;HelpFile: watchapp.hlp
+;HelpTopic: 106
+ INCLUDE "WRISTAPP.I"
+;
+; Program specific constants
+;
+FLAGBYTE EQU $61
+; Bit 0 indicates that we want to show the segments instead of the message
+;
+START EQU *
+L0110: jmp MAIN
+L0113: rts
+ nop
+ nop
+L0116: rts
+ nop
+ nop
+L0119: rts
+ nop
+ nop
+L011c: rts
+ nop
+ nop
+
+L011f: lda STATETAB,X
+ rts
+
+L0123: jmp HANDLE_STATE0
+ db STATETAB-STATETAB
+
+S6_HELLO: timex6 "HELLO "
+S6_WORLD: timex6 "WORLD "
+
+;
+;
+STATETAB:
+ db 0
+ db EVT_ENTER,TIM_ONCE,0 ; Initial state
+ db EVT_RESUME,TIM_ONCE,0 ; Resume from a nested app
+ db EVT_DNNEXT,TIM_ONCE,0 ; Next button
+ db EVT_MODE,TIM_ONCE,$FF ; Mode button
+ db EVT_END
+;
+; This
+HANDLE_STATE0:
+ bset 1,$8f ; Indicate that we can be suspended
+ lda BTNSTATE ; Get the event
+ cmp #EVT_DNNEXT ; Did they press the next button?
+ beq DOTOGGLE ; Yes, toggle what we are displaying
+CLEARIT bclr 0,FLAGBYTE ; Start us in the show display state
+REFRESH brclr 0,FLAGBYTE,SHOWDISP ; Do we want to see the main display?
+ jmp SETALL ; No, just turn on all segments
+SHOWDISP jsr CLEARALL ; Clear the display
+ lda #S6_HELLO-START
+ jsr PUT6TOP
+ lda #S6_WORLD-START
+ jsr PUT6MID
+ lda #SYS8_MODE
+ jmp PUTMSGBOT
+
+DOTOGGLE brset 0,FLAGBYTE,CLEARIT
+ bset 0,FLAGBYTE
+ bra REFRESH
+;
+; This is the main initialization routine which is called when we first get the app into memory
+;
+MAIN:
+ lda #$c0 ; We want button beeps and to indicate that we have been loaded
+ sta $96
+ clr FLAGBYTE ; start with a clean slate
+ rts