diff --git a/UdpDebug.dsk b/UdpDebug.dsk index aa496e0..ed231ed 100644 Binary files a/UdpDebug.dsk and b/UdpDebug.dsk differ diff --git a/neutgs/init.fnl b/neutgs/init.fnl index 851e545..be8bdf1 100644 --- a/neutgs/init.fnl +++ b/neutgs/init.fnl @@ -17,11 +17,11 @@ 5 0x0100 ; desk manager 9 0x0100) ; ADB - (asm pascalhex (db 5) hexbuf (bytes " ")) + (buffer hexbuf (cstr " ")) (fn printnum (num) (long! (ref hexbuf) (HexIt num)) - (WriteString (far-ref pascalhex))) + (WriteCString (far-ref hexbuf))) (asm event-buffer) (global word event-what) diff --git a/ssc/iigs/u2-debug.fnl b/ssc/iigs/u2-debug.fnl index 0ecc33c..07813a3 100644 --- a/ssc/iigs/u2-debug.fnl +++ b/ssc/iigs/u2-debug.fnl @@ -22,15 +22,24 @@ (sec) (xce))) ; re-enter emulation mode (require ssc.stdlib) + (require ssc.iigs.toolbox) (require ssc.iigs.uthernet2) + (macro out [#(! (WriteLine (far-ref (pstr [$2]))))]) + + (buffer hexbuf (cstr " ")) + (fn printnum (num) + (long! (ref hexbuf) (HexIt num)) + (WriteCString (far-ref hexbuf))) + (global word u2-debug-server-connected 0) (fn u2-init-debug-server () + (out "Starting server") (u2-reset) (u2-udp-server-start 6502) (set! u2-debug-server-connected 0)) - (asm u2-debug-buffer (bytes [(string.rep "\x00" 1500)])) + (buffer u2-debug-buffer 1500) (predef-fn u2-debug-server-poll () void far) @@ -83,6 +92,7 @@ (when (> size 0) (let (msgid (u2-read) cmd (u2-read)) + (printnum msgid) (out "Got message!") (u2-read-buf (ref u2-debug-buffer) (- size 2)) (u2-rx-complete) (when (not u2-debug-server-connected) @@ -91,6 +101,8 @@ (u2-debug-server-cmd msgid cmd))))) (fn debug-server-loop () + (TextStartUp) + (IMStartUp) (u2-init-debug-server) (while true (u2-debug-server-poll))) )