2021-08-02 23:40:31 +00:00
|
|
|
(local Ssc (require :ssc))
|
|
|
|
(import-macros {:sss ! : compile} :ssc.macros)
|
|
|
|
|
2021-08-16 02:40:47 +00:00
|
|
|
(local ssc (Ssc {:boot [(! (require ssc.iigs.bootstub))]}))
|
2021-08-02 23:40:31 +00:00
|
|
|
(compile ssc
|
2021-08-06 01:30:08 +00:00
|
|
|
(require :ssc.iigs.toolbox)
|
|
|
|
|
2021-08-16 02:40:47 +00:00
|
|
|
(tooltable toolsets
|
|
|
|
ToolsetIntegerMath 0x0100
|
|
|
|
ToolsetText 0x0100
|
|
|
|
ToolsetQuickDraw 0x0100
|
|
|
|
ToolsetEventManager 0x0100
|
|
|
|
5 0x0100 ; desk manager
|
|
|
|
9 0x0100) ; ADB
|
|
|
|
|
2021-08-09 01:58:49 +00:00
|
|
|
(asm pascalhex (db 5) hexbuf (bytes " "))
|
2021-08-10 04:33:54 +00:00
|
|
|
|
2021-08-06 01:30:08 +00:00
|
|
|
(fn printnum (num)
|
2021-08-09 18:43:24 +00:00
|
|
|
(long! (ref hexbuf) (HexIt num))
|
|
|
|
(WriteString (far-ref pascalhex)))
|
2021-08-06 01:30:08 +00:00
|
|
|
|
2021-08-02 23:40:31 +00:00
|
|
|
(fn add (lhs rhs) (+ lhs rhs))
|
2021-08-10 17:23:09 +00:00
|
|
|
|
2021-08-16 02:40:47 +00:00
|
|
|
(asm event-buffer)
|
|
|
|
(global word event-what)
|
|
|
|
(global long event-msg)
|
|
|
|
(global long event-when)
|
|
|
|
(global word event-y)
|
|
|
|
(global word event-x)
|
|
|
|
(global word event-mod)
|
|
|
|
|
|
|
|
(fn wait-for-key ()
|
|
|
|
(FlushEvents keyDownMask 0)
|
2021-08-17 02:14:48 +00:00
|
|
|
(while (not (GetNextEvent keyDownMask (far-ref event-buffer)))))
|
2021-08-16 02:40:47 +00:00
|
|
|
|
|
|
|
(const screen-addr 0xe12000)
|
2021-08-15 00:52:43 +00:00
|
|
|
(const screen-size 0x9d00)
|
|
|
|
|
|
|
|
(global word screen-offset 0)
|
2021-08-16 02:40:47 +00:00
|
|
|
(getter screen-cursor (+ screen-addr screen-offset))
|
2021-08-15 00:52:43 +00:00
|
|
|
(setter screen-cursor (pixels)
|
|
|
|
(word! screen-cursor pixels)
|
|
|
|
(set! screen-offset (+ screen-offset 2)))
|
|
|
|
|
2021-08-16 02:40:47 +00:00
|
|
|
(global word userID)
|
2021-08-02 23:40:31 +00:00
|
|
|
(fn main ()
|
2021-08-16 02:40:47 +00:00
|
|
|
(LoadTools (far-ref toolsets))
|
|
|
|
(set! userID (MMStartUp))
|
2021-08-10 17:23:09 +00:00
|
|
|
(IMStartUp)
|
|
|
|
(TextStartUp)
|
2021-08-16 02:40:47 +00:00
|
|
|
(QDStartUp 0x2100 0 0 userID)
|
|
|
|
(EMStartUp 0x2000 0 0 320 0 200 userID)
|
2021-08-13 02:06:31 +00:00
|
|
|
(GrafOn)
|
|
|
|
|
2021-08-16 02:40:47 +00:00
|
|
|
(set! screen-offset 0)
|
|
|
|
(let (i 0)
|
|
|
|
(while (< screen-offset screen-size)
|
|
|
|
(set! screen-cursor (+ screen-offset i))
|
|
|
|
(set! i (+ i 1))))
|
|
|
|
(wait-for-key)
|
2021-08-13 02:06:31 +00:00
|
|
|
(GrafOff)
|
|
|
|
|
2021-08-16 02:40:47 +00:00
|
|
|
(EMShutDown)
|
|
|
|
(QDShutDown)
|
2021-08-10 17:23:09 +00:00
|
|
|
(TextShutDown)
|
|
|
|
(IMShutDown)
|
2021-08-16 02:40:47 +00:00
|
|
|
(MMShutDown userID)))
|
2021-08-02 23:40:31 +00:00
|
|
|
|
|
|
|
(ssc:assemble)
|