From d5dec7a6604a0d36668a449b5dccc57243e02f3b Mon Sep 17 00:00:00 2001 From: 4am Date: Sun, 15 Apr 2018 12:29:24 -0400 Subject: [PATCH] comments --- src/glue.onbeyond.a | 2 +- src/macros.a | 6 ++++++ src/parse.common.a | 8 ++++++++ src/parse.gamelist.a | 2 +- src/parse.prefs.a | 2 +- src/pitchdark.a | 2 ++ src/prodos.mli.a | 5 ++++- src/prodos.path.a | 37 +------------------------------------ src/prodos.ramdisk.a | 2 +- src/ui.common.a | 36 ++++++++++++++++++++++++++++++++++++ src/ui.sound.a | 3 +-- src/ui.versions.a | 4 ++-- 12 files changed, 64 insertions(+), 45 deletions(-) diff --git a/src/glue.onbeyond.a b/src/glue.onbeyond.a index 972530f..aa0349b 100644 --- a/src/glue.onbeyond.a +++ b/src/glue.onbeyond.a @@ -1,7 +1,7 @@ ;license:MIT ;(c) 2018 by 4am ; -; load and launch the On Beyond Z-Machine! interpreter +; glue code to load, set up, and launch the On Beyond Z-Machine! interpreter ; ; Public functions ; - ClearInterpreterOptions diff --git a/src/macros.a b/src/macros.a index f386429..654481a 100644 --- a/src/macros.a +++ b/src/macros.a @@ -1,3 +1,9 @@ +;license:MIT +;(c) 2018 by 4am +; +; common assembler macros +; + PARAM = $00 !macro PARAMS_ON_STACK .bytes { diff --git a/src/parse.common.a b/src/parse.common.a index f94b592..59850e4 100644 --- a/src/parse.common.a +++ b/src/parse.common.a @@ -1,3 +1,11 @@ +;license:MIT +;(c) 2018 by 4am +; +; Common functions across parsers +; +; Public functions: +; - ParseKeyValueText +; ;------------------------------------------------------------------------------ ; ParseKeyValueText ; parse buffer with KEY=VALUE lines of text into an okvs diff --git a/src/parse.gamelist.a b/src/parse.gamelist.a index 42376ec..c42778f 100644 --- a/src/parse.gamelist.a +++ b/src/parse.gamelist.a @@ -1,7 +1,7 @@ ;license:MIT ;(c) 2018 by 4am ; -; Parser for game list +; Parser for game list file ; ; Public functions ; - LoadGameList diff --git a/src/parse.prefs.a b/src/parse.prefs.a index 37f0df8..21f63ea 100644 --- a/src/parse.prefs.a +++ b/src/parse.prefs.a @@ -1,7 +1,7 @@ ;license:MIT ;(c) 2018 by 4am ; -; Global preferences +; Parser for global preferences file ; ; Public functions ; - LoadGlobalPreferences diff --git a/src/pitchdark.a b/src/pitchdark.a index c76481f..667ab69 100644 --- a/src/pitchdark.a +++ b/src/pitchdark.a @@ -1,6 +1,8 @@ ;license:MIT ;(c) 2018 by 4am ; +; It is Pitch Dark. You are likely to be eaten by a GUI. +; ; Public entry points ; - MainScreen diff --git a/src/prodos.mli.a b/src/prodos.mli.a index c394634..d29d270 100644 --- a/src/prodos.mli.a +++ b/src/prodos.mli.a @@ -1,13 +1,14 @@ ;license:MIT ;(c) 2017-8 by 4am ; -; ProDOS and file routines +; ProDOS - file and other MLI routines ; ; Public functions ; - LoadFile ; - LoadDHRFile ; - SaveFile ; - SetPrefix +; - GetFileInfo ; - QuitToProDOS ; @@ -248,6 +249,8 @@ GetFileInfo jmp _getfileinfo } +;------------------------------------------------------------------------------ + ;------------------------------- ; open file via ProDOS MLI ; diff --git a/src/prodos.path.a b/src/prodos.path.a index 1d00e05..27564b4 100644 --- a/src/prodos.path.a +++ b/src/prodos.path.a @@ -1,7 +1,7 @@ ;license:MIT ;(c) 2018 by 4am ; -; Functions to build a ProDOS pathname from length-prefixed strings +; ProDOS - functions for constructing and passing around ProDOS pathnames ; ; Public functions ; - ResetPath @@ -77,38 +77,3 @@ SetStartupPath bpl - rts } - -;------------------------------------------------------------------------------ -; CreateNullTerminatedString -; Copy a length-prefixed string to kNullTerminatedBuffer and null-terminate it. -; Destination string is left-padded with a single space because reasons. -; Maximum length is 127 bytes. -; -; in: A/Y contains address of length-prefixed string to copy -; X contains length of null-terminated string -- if > length of source, -; remaining buffer will be padded with spaces (#$A0) -; out: X preserved -; all other registers and flags clobbered -; $00/$01 clobbered -;------------------------------------------------------------------------------ -!zone { -CreateNullTerminatedString - +STAY $00 - - phx - lda #$A0 -- dex - sta kNullTerminatedBuffer,x - bpl - - plx - lda #$00 - sta kNullTerminatedBuffer,x - - lda ($00) - tay -- lda ($00),y - sta kNullTerminatedBuffer,y - dey - bne - - rts -} diff --git a/src/prodos.ramdisk.a b/src/prodos.ramdisk.a index 82bb75e..d1a2b2c 100644 --- a/src/prodos.ramdisk.a +++ b/src/prodos.ramdisk.a @@ -8,7 +8,7 @@ ; Public functions ; - DisconnectRAM32 ; -; TODO reconnect on exit +; does not reconnect /RAM on exit, which is rude ; MLI = $BF00 ; ProDOS MLI entry point NODEV = $BF10 ; means 'no device connected' diff --git a/src/ui.common.a b/src/ui.common.a index 59d93e7..3de6a0c 100644 --- a/src/ui.common.a +++ b/src/ui.common.a @@ -11,6 +11,7 @@ ; - PrintAt ; - SimulateClick ; - GetCheckedRadioButton +; - CreateNullTerminatedString ; ; Public constants ; - kStringOK @@ -197,3 +198,38 @@ GetCheckedRadioButton clc rts } + +;------------------------------------------------------------------------------ +; CreateNullTerminatedString +; Copy a length-prefixed string to kNullTerminatedBuffer and null-terminate it. +; Destination string is left-padded with a single space because reasons. +; Maximum length is 127 bytes. +; +; in: A/Y contains address of length-prefixed string to copy +; X contains length of null-terminated string -- if > length of source, +; remaining buffer will be padded with spaces (#$A0) +; out: X preserved +; all other registers and flags clobbered +; $00/$01 clobbered +;------------------------------------------------------------------------------ +!zone { +CreateNullTerminatedString + +STAY $00 + + phx + lda #$A0 +- dex + sta kNullTerminatedBuffer,x + bpl - + plx + lda #$00 + sta kNullTerminatedBuffer,x + + lda ($00) + tay +- lda ($00),y + sta kNullTerminatedBuffer,y + dey + bne - + rts +} diff --git a/src/ui.sound.a b/src/ui.sound.a index 390cb6c..91011e1 100644 --- a/src/ui.sound.a +++ b/src/ui.sound.a @@ -14,8 +14,7 @@ SPEAKER = $C030 ; SoftBell ; ; in: none -; out: all registers preserved -; all flags clobbered +; out: all registers and flags preserved ;------------------------------------------------------------------------------ SoftBell php diff --git a/src/ui.versions.a b/src/ui.versions.a index 24f43f9..544712b 100644 --- a/src/ui.versions.a +++ b/src/ui.versions.a @@ -157,8 +157,8 @@ VersionsDialog lda #ID_VERSIONS_FRAME jsr WeeGUI - lda #1 ; WeeGUI radio button labels are limited to 15 characters, so we have - sta .vtab ; just the hotkeys (1-9) in the radio button label then print the + lda #1 ; WeeGUI radio buttons are limited to 15 characters, so we have just the + sta .vtab ; hotkeys (1-9) 'in' the radio button then print the labels separately jsr okvs_iter_values !word gVersionsStore !word PrintVersionLabelCallback