Bunch of silly errors & debugging stuff.
[uccvend-snackrom.git] / ROM2 / start.s
index c370263..7611f1b 100644 (file)
@@ -2,6 +2,18 @@
 .globl _start
 
 _start:
+       ;; set port a to output
+       ldab #0xfc  ; 11111000
+       stab 0x1001
+
+       ;; turn display on
+       ldx #0x1000
+       bset 00,x #0x80
+
+       ;; start chiming
+       ldx #0x1000
+       bset 00,x #0x10
+
        ;; enable the RTI
        ldaa #0x40
        staa 0x1024
@@ -12,14 +24,22 @@ _start:
 
        ;; set RTI intervals, and PA3/7 DDRs
        ldaa #0x81
-       staa 0x1026
+       staa 0x1026  ;; RTI interval becomes E/2^14 = 6.6ms (or 150 Hz)
+
+       ;; stop chiming
+       ldx #0x1000
+       bclr 00,x #0x10
 
        ;; clear ADC register
        clra
        staa 0x1030
 
        ;; set the stack pointer
-       lds _stack
+       lds #_stack
+
+       ;; start chiming
+       ldx #0x1000
+       bset 00,x #0x10
 
        ;; blank initialised variables - should match memory.x's page0
        ldx #0x0000
@@ -31,6 +51,20 @@ loop1:
        bra loop1
 out1:
 
+       ;; wait a while
+       ldx #0x0000
+loop2:
+       cpx #0x00ff
+       bcc out2
+       clr 00,x
+       inx
+       bra loop2
+out2:
+
+       ;; stop chiming
+       ldx #0x1000
+       bclr 00,x #0x10
+
        jsr main
 
 infinity:

UCC git Repository :: git.ucc.asn.au