From 774e2759653f2f7ee654ab2987344abaa748e4e6 Mon Sep 17 00:00:00 2001
From: "Stefan A. Haubenthal" <polluks@sdf.org>
Date: Mon, 24 Mar 2025 20:52:55 +0100
Subject: [PATCH] Fixed many comments

---
 libsrc/apple2/cputc.s             |  2 +-
 libsrc/atari/getdevice.s          |  2 +-
 libsrc/atari/graphics.s           |  2 +-
 libsrc/atari/mou/atrtt.s          |  6 +++---
 libsrc/atari/read.s               |  2 +-
 libsrc/atari/siocall.s            |  2 +-
 libsrc/atari/write.s              |  2 +-
 libsrc/atari5200/joy/atr5200std.s | 10 +++++-----
 libsrc/c128/break.s               |  5 ++---
 libsrc/c128/ser/c128-swlink.s     |  4 ++--
 libsrc/c128/tgi/c128-vdc.s        |  2 +-
 libsrc/c128/tgi/c128-vdc2.s       |  2 +-
 libsrc/c64/emd/c64-rrr.s          | 14 +++++++-------
 libsrc/c64/joy/c64-hitjoy.s       |  4 ++--
 libsrc/c64/ser/c64-swlink.s       |  2 +-
 libsrc/cbm/cbm_read.s             |  2 +-
 libsrc/cbm/exec.c                 |  2 +-
 libsrc/cbm/getdevice.s            |  2 +-
 libsrc/cbm/loadaddr.s             |  2 +-
 libsrc/cbm510/joy/cbm510-std.s    |  2 +-
 libsrc/common/ctype.s             |  2 +-
 libsrc/common/mktime.s            |  4 ++--
 libsrc/common/realloc.s           |  2 +-
 libsrc/common/strlen.s            |  2 +-
 libsrc/common/vsprintf.s          |  2 +-
 libsrc/cx16/getdevice.s           |  2 +-
 libsrc/cx16/tgi/cx320p1.s         |  4 ++--
 libsrc/cx16/tgi/cx640p1.s         |  4 ++--
 libsrc/cx16/waitvsync.s           |  2 +-
 libsrc/dbg/dbgdump.s              |  2 +-
 libsrc/geos-common/const.inc      |  2 +-
 libsrc/geos-common/symbols.txt    | 18 +++++++++---------
 libsrc/kim1/tapeio.s              |  4 ++--
 libsrc/lynx/bootldr.s             |  2 +-
 libsrc/lynx/eeprom66.s            |  2 +-
 libsrc/lynx/eeprom86.s            |  2 +-
 libsrc/lynx/tgi/lynx-160-102-16.s |  4 ++--
 libsrc/nes/ppubuf.s               |  2 +-
 libsrc/pce/vga.s                  |  6 +++---
 libsrc/pet/cbm_load.c             |  4 ++--
 libsrc/runtime/callirq.s          |  2 +-
 libsrc/runtime/lshelp.s           |  2 +-
 libsrc/runtime/ludiv.s            |  2 +-
 libsrc/runtime/lumod.s            |  2 +-
 libsrc/sim6502/exehdr.s           |  2 +-
 libsrc/sym1/tapeio.s              |  4 ++--
 libsrc/telestrat/write.s          |  2 +-
 libsrc/tgi/tgi_clippedline.s      |  6 +++---
 libsrc/tgi/tgi_init.s             |  2 +-
 libsrc/vic20/joy/vic20-stdjoy.s   |  2 +-
 50 files changed, 84 insertions(+), 85 deletions(-)

diff --git a/libsrc/apple2/cputc.s b/libsrc/apple2/cputc.s
index f60965f44..fdf799357 100644
--- a/libsrc/apple2/cputc.s
+++ b/libsrc/apple2/cputc.s
@@ -39,7 +39,7 @@ _cputcxy:
         pla                     ; Restore C and run into _cputc
 
 _cputc:
-        cmp     #$0D            ; Test for \r = carrage return
+        cmp     #$0D            ; Test for \r = carriage return
         beq     left
         cmp     #$0A            ; Test for \n = line feed
         beq     newline
diff --git a/libsrc/atari/getdevice.s b/libsrc/atari/getdevice.s
index e0e700436..b98d3ad5f 100644
--- a/libsrc/atari/getdevice.s
+++ b/libsrc/atari/getdevice.s
@@ -50,7 +50,7 @@ check_device:
         lda     #SIO_STAT
         sta     DCOMND          ; set command into DCB
         lda     #%01000000      ; direction value, "receive data"
-        sta     DSTATS          ; set data flow directon
+        sta     DSTATS          ; set data flow direction
         lda     #15
         sta     DTIMLO          ; value got from DOS source
         lda     #4
diff --git a/libsrc/atari/graphics.s b/libsrc/atari/graphics.s
index 1f7844c39..8b4e8034d 100644
--- a/libsrc/atari/graphics.s
+++ b/libsrc/atari/graphics.s
@@ -23,7 +23,7 @@
 
         .code
 
-; set new grapics mode
+; set new graphics mode
 ; gets new mode in A
 ; returns handle or -1 on error
 ; uses tmp1, tmp2, tmp3, tmp4 (in subroutines)
diff --git a/libsrc/atari/mou/atrtt.s b/libsrc/atari/mou/atrtt.s
index b1e53935e..f7c56e9f2 100644
--- a/libsrc/atari/mou/atrtt.s
+++ b/libsrc/atari/mou/atrtt.s
@@ -374,7 +374,7 @@ IRQ:
 ; The touch pad is read thru the paddle potentiometers. The possible
 ; values are 1..228. Since the maximum value is less than the X
 ; dimension we have to "stretch" this value. In order to use only
-; divisions by powers of two, we use the following appoximation:
+; divisions by powers of two, we use the following approximation:
 ; 320/227 = 1.4096
 ; 1+1/2-1/8+1/32 = 1.4062
 ; For Y we subtract 1/8 of it to get in the YMax ballpark.
@@ -385,7 +385,7 @@ IRQ:
 
 ; X
 
-        ldx     PADDL0                  ; get X postion
+        ldx     PADDL0                  ; get X position
         dex                             ; decrement, since it's 1-based
         stx     XPos
         txa
@@ -445,7 +445,7 @@ IRQ:
 
 ; Y
 
-        ldx     PADDL1                  ; get Y postion
+        ldx     PADDL1                  ; get Y position
         dex                             ; decrement, since it's 1-based
         stx     YPos
         lda     #228
diff --git a/libsrc/atari/read.s b/libsrc/atari/read.s
index 5078b321d..228ca9ee2 100644
--- a/libsrc/atari/read.s
+++ b/libsrc/atari/read.s
@@ -33,7 +33,7 @@ done:   lda     ICBLL,x         ; buf len lo
         lda     ICBLH,x         ; get buf len hi
         tax                     ; to X
 okdone: lda     #0
-        sta     ___oserror      ; clear system dependend error code
+        sta     ___oserror      ; clear system dependent error code
         pla                     ; get buf len lo
         rts
 
diff --git a/libsrc/atari/siocall.s b/libsrc/atari/siocall.s
index 38cbb35d5..b1c19a2d0 100644
--- a/libsrc/atari/siocall.s
+++ b/libsrc/atari/siocall.s
@@ -23,7 +23,7 @@
 .proc   __sio_call
 
         sta     DCOMND          ; set command into DCB
-        stx     DSTATS          ; set data flow directon
+        stx     DSTATS          ; set data flow direction
         jsr     popax           ; get buffer address
         sta     DBUFLO          ; set buffer address into DCB
         stx     DBUFHI
diff --git a/libsrc/atari/write.s b/libsrc/atari/write.s
index 2ddb88ee3..b745e5211 100644
--- a/libsrc/atari/write.s
+++ b/libsrc/atari/write.s
@@ -21,7 +21,7 @@ write9:
         lda     ICBLH,x         ; buf len high
         tax
         lda     #0
-        sta     ___oserror      ; clear system dependend error code
+        sta     ___oserror      ; clear system dependent error code
         pla
         rts
 
diff --git a/libsrc/atari5200/joy/atr5200std.s b/libsrc/atari5200/joy/atr5200std.s
index 980428d13..a717455f2 100644
--- a/libsrc/atari5200/joy/atr5200std.s
+++ b/libsrc/atari5200/joy/atr5200std.s
@@ -79,7 +79,7 @@ COUNT:
 ;
 
 CENTER  =       228 / 2
-SENSIVITY       = 16
+SENSITIVITY   = 16
 
 READJOY:
         and     #3              ; put joystick number in range, just in case
@@ -96,27 +96,27 @@ READJOY:
 ; Read joystick
 
 @notrg: ldy     PADDL0,x        ; get horizontal position
-        cpy     #CENTER-SENSIVITY
+        cpy     #CENTER-SENSITIVITY
         bcs     @chkleft
 
         ora     #4              ; JOY_LEFT
         bne     @updown
 
 @chkleft:
-        cpy     #CENTER+SENSIVITY
+        cpy     #CENTER+SENSITIVITY
         bcc     @updown
 
         ora     #8              ; JOY_RIGHT
 
 @updown:ldy     PADDL0+1,x      ; get vertical position
-        cpy     #CENTER-SENSIVITY
+        cpy     #CENTER-SENSITIVITY
         bcs     @chkdown
 
         ora     #1              ; JOY_UP
         bne     @done
 
 @chkdown:
-        cpy     #CENTER+SENSIVITY
+        cpy     #CENTER+SENSITIVITY
         bcc     @done
 
         ora     #2              ; JOY_DOWN
diff --git a/libsrc/c128/break.s b/libsrc/c128/break.s
index 092ca3469..450183dc3 100644
--- a/libsrc/c128/break.s
+++ b/libsrc/c128/break.s
@@ -125,11 +125,10 @@ uservec:        jmp     $FFFF           ; Patched at runtime
 
 .data
 
-; Old break vector preceeded by a jump opcode
+; Old break vector preceded by a jump opcode
 brk_old:
         jmp     $0000
 
-; Indirect vectors preceeded by a jump opcode
+; Indirect vectors preceded by a jump opcode
 brk_ind:
         jmp     $0000
-
diff --git a/libsrc/c128/ser/c128-swlink.s b/libsrc/c128/ser/c128-swlink.s
index b8f08159b..796dc3b3b 100644
--- a/libsrc/c128/ser/c128-swlink.s
+++ b/libsrc/c128/ser/c128-swlink.s
@@ -134,7 +134,7 @@ ParityTable:
 ; Interrupt stub that is copied into low RAM. The startup code uses a special
 ; memory configuration with just kernal and I/O enabled (anything else is RAM).
 ; The NMI handler in ROM will switch back to a configuration where just the
-; low 16K RAM are accessible. So we have to copy a smal piece of code into
+; low 16K RAM are accessible. So we have to copy a small piece of code into
 ; low RAM that enables the cc65 configuration and then jumps to the real NMI
 ; handler.
 
@@ -296,7 +296,7 @@ SER_CLOSE:
         lda     #%00001010
         sta     ACIA_CMD
 
-; Initalize buffers. Returns zero in a
+; Initialize buffers. Returns zero in a
 
         jsr     InitBuffers
 
diff --git a/libsrc/c128/tgi/c128-vdc.s b/libsrc/c128/tgi/c128-vdc.s
index f48b530f6..edbdd6cd8 100644
--- a/libsrc/c128/tgi/c128-vdc.s
+++ b/libsrc/c128/tgi/c128-vdc.s
@@ -268,7 +268,7 @@ INIT:
 @L1:    ldx     #$FF
         stx     BITMASK
 
-; Remeber current color value
+; Remember current color value
         ldx     #VDC_COLORS
         jsr     VDCReadReg
         sta     OLDCOLOR
diff --git a/libsrc/c128/tgi/c128-vdc2.s b/libsrc/c128/tgi/c128-vdc2.s
index 4b7b17c57..6b75ee712 100644
--- a/libsrc/c128/tgi/c128-vdc2.s
+++ b/libsrc/c128/tgi/c128-vdc2.s
@@ -277,7 +277,7 @@ INIT:
 @L1:    ldx     #$FF
         stx     BITMASK
 
-; Remeber current color value
+; Remember current color value
         ldx     #VDC_COLORS
         jsr     VDCReadReg
         sta     OLDCOLOR
diff --git a/libsrc/c64/emd/c64-rrr.s b/libsrc/c64/emd/c64-rrr.s
index 4d175cd32..8632e5e64 100644
--- a/libsrc/c64/emd/c64-rrr.s
+++ b/libsrc/c64/emd/c64-rrr.s
@@ -212,8 +212,8 @@ MAP:
         cmp pagecount
         bcs return_null
         sta curpage
-        lda #<dummy        ; load .A/.X with adress of data for COPYFROM-call (which expects the
-        ldx #>dummy        ; adress in .A/.X)
+        lda #<dummy        ; load .A/.X with address of data for COPYFROM-call (which expects the
+        ldx #>dummy        ; address in .A/.X)
         jsr COPYFROM
         bcs return_win     ; function returns pointer to window (returns always with carry set!)
 
@@ -224,8 +224,8 @@ COMMIT:
         lda curpage
         cmp pagecount
         bcs return
-        lda #<dummy        ; load .A/.X with adress of data for COPYTO-call (which expects the
-        ldx #>dummy        ; adress in .A/.X)
+        lda #<dummy        ; load .A/.X with address of data for COPYTO-call (which expects the
+        ldx #>dummy        ; address in .A/.X)
 
 ;----------------------------------------------------------------------------------------
 ;void __fastcall__ em_copyto (struct em_copy *copy_data);
@@ -324,7 +324,7 @@ get_struct_data:
         ;read and process the values from the em_copy struct passed to as parameters rameter to the
         ;functions em_copyto and em_copyfrom
 
-        sta aux         ;store adress of struct (passed in .A/.X) into a zp pointer
+        sta aux         ;store address of struct (passed in .A/.X) into a zp pointer
         stx aux+1
         ldy #0          ;index 0
 
@@ -347,7 +347,7 @@ get_struct_data:
         lsr
         lsr             ;shift into bits 3 and 4
         ora #$23        ;set bit 5 (select ram) and 1+2 (game/exrom setting for ULTIMAX-mode)
-        tax             ;.X has now the value to write into $de00 to acess rr-ram at desired 16k-bank
+        tax             ;.X has now the value to write into $de00 to access rr-ram at desired 16k-bank
         iny
         iny             ;skip unused byte
         lda (aux),y     ;read length lo-byte
@@ -357,7 +357,7 @@ get_struct_data:
         iny
         lda (aux),y     ;length hi-byte
         adc c64_ram+1
-        sta len+1       ;tmp2: length, tmp3 contains end adress of transfer in c64-ram.
+        sta len+1       ;tmp2: length, tmp3 contains end address of transfer in c64-ram.
         rts
                         ;55 bytes
 
diff --git a/libsrc/c64/joy/c64-hitjoy.s b/libsrc/c64/joy/c64-hitjoy.s
index a9d454fd0..c57f45780 100644
--- a/libsrc/c64/joy/c64-hitjoy.s
+++ b/libsrc/c64/joy/c64-hitjoy.s
@@ -102,7 +102,7 @@ readadapter:
         lda     #%00010001
         sta     $dd0e           ; control register a
                                 ; timer: start
-                                ;        continous
+                                ;        continuous
                                 ;        forced load
                                 ; serial port: input
 
@@ -110,7 +110,7 @@ readadapter:
         lda     #%01010001
         sta     $dc0e           ; control register a
                                 ; timer: start
-                                ;        continous
+                                ;        continuous
                                 ;        forced load
                                 ; serial port: output
 
diff --git a/libsrc/c64/ser/c64-swlink.s b/libsrc/c64/ser/c64-swlink.s
index 067a7ca92..2c06bb39b 100644
--- a/libsrc/c64/ser/c64-swlink.s
+++ b/libsrc/c64/ser/c64-swlink.s
@@ -270,7 +270,7 @@ SER_CLOSE:
         lda     #%00001010
         sta     ACIA_CMD
 
-; Initalize buffers. Returns zero in a
+; Initialize buffers. Returns zero in a
 
         jsr     InitBuffers
 
diff --git a/libsrc/cbm/cbm_read.s b/libsrc/cbm/cbm_read.s
index 98e3c25c9..c449567b1 100644
--- a/libsrc/cbm/cbm_read.s
+++ b/libsrc/cbm/cbm_read.s
@@ -24,7 +24,7 @@
 ;         /* the kernal routine BASIN sets ST to EOF if the end of file
 ;         ** is reached the first time, then we have store tmp.
 ;         ** every subsequent call returns EOF and READ ERROR in ST, then
-;         ** we have to exit the loop here immediatly.
+;         ** we have to exit the loop here immediately.
 ;         */
 ;         if (cbm_k_readst() & 0xBF) break;
 ;
diff --git a/libsrc/cbm/exec.c b/libsrc/cbm/exec.c
index b9c1bdc96..49ab53553 100644
--- a/libsrc/cbm/exec.c
+++ b/libsrc/cbm/exec.c
@@ -89,7 +89,7 @@ int __fastcall__ exec (const char* progname, const char* cmdline)
     }
     utoa (dv, basic.unit, 10);
 
-    /* Tape files can be openned only once; skip this test for the Datasette. */
+    /* Tape files can be opened only once; skip this test for the Datasette. */
     if (dv != 1) {
         /* Don't try to run a program that can't be found. */
         fd = open (progname, O_RDONLY);
diff --git a/libsrc/cbm/getdevice.s b/libsrc/cbm/getdevice.s
index 08ba6d5f8..b68e716b4 100644
--- a/libsrc/cbm/getdevice.s
+++ b/libsrc/cbm/getdevice.s
@@ -54,7 +54,7 @@ next:   inx
 
         lda     ST
 
-; Either the Kernal calls above were successfull or there was
+; Either the Kernal calls above were successful or there was
 ; already a cmdchannel to the device open - which is a pretty
 ; good indication of its existence ;-)
 
diff --git a/libsrc/cbm/loadaddr.s b/libsrc/cbm/loadaddr.s
index 0675dd67d..4329f201f 100644
--- a/libsrc/cbm/loadaddr.s
+++ b/libsrc/cbm/loadaddr.s
@@ -2,7 +2,7 @@
 ; Ullrich von Bassewitz, 2010-11-13
 ;
 ; This module supplies the load address that is expected by Commodore
-; machines in the first two bytes of an excutable disk file.
+; machines in the first two bytes of an executable disk file.
 ;
 
 
diff --git a/libsrc/cbm510/joy/cbm510-std.s b/libsrc/cbm510/joy/cbm510-std.s
index f7cbb2cdc..640b0d2a8 100644
--- a/libsrc/cbm510/joy/cbm510-std.s
+++ b/libsrc/cbm510/joy/cbm510-std.s
@@ -117,7 +117,7 @@ READ:   ldx     #$0F            ; Switch to the system bank
         lsr     tmp1
         lsr     tmp1
 
-; Mask the relavant bits, get the push button bit
+; Mask the relevant bits, get the push button bit
 
 @L2:    asl     a               ; push button bit into carry
         lda     tmp1
diff --git a/libsrc/common/ctype.s b/libsrc/common/ctype.s
index 220ad79c1..d51b1bf2b 100644
--- a/libsrc/common/ctype.s
+++ b/libsrc/common/ctype.s
@@ -7,7 +7,7 @@
 ;
 ; See "LICENSE" file for legal information.
 ;
-; Character specification table, matching serveral consoles.
+; Character specification table, matching several consoles.
 ;
 
         .include        "ctypetable.inc"
diff --git a/libsrc/common/mktime.s b/libsrc/common/mktime.s
index ac5755a45..e84cee040 100644
--- a/libsrc/common/mktime.s
+++ b/libsrc/common/mktime.s
@@ -423,10 +423,10 @@ finish_calc:
         jsr     tosaddeax       ; Simple addition there
 
         ; No need to store/load/push the counter here, simply to push it
-        ; for the last substraction
+        ; for the last subtraction
         jsr     pusheax
 
-        ; Substract timezone
+        ; Subtract timezone
         lda     __tz+1+3
         sta     sreg+1
         lda     __tz+1+2
diff --git a/libsrc/common/realloc.s b/libsrc/common/realloc.s
index 925ac3d19..176871dd5 100644
--- a/libsrc/common/realloc.s
+++ b/libsrc/common/realloc.s
@@ -110,7 +110,7 @@ _realloc:
 
         tya                     ; Put ___heapptr back in A
         sec                     ; Check if we have enough memory at heap top
-        sbc     oldsize         ; Substract oldsize
+        sbc     oldsize         ; Subtract oldsize
         sta     newblock
         lda     ___heapptr+1
         sbc     oldsize+1
diff --git a/libsrc/common/strlen.s b/libsrc/common/strlen.s
index c20ab78f9..b28bffe7a 100644
--- a/libsrc/common/strlen.s
+++ b/libsrc/common/strlen.s
@@ -2,7 +2,7 @@
 ; Ullrich von Bassewitz, 31.05.1998
 ;
 ; Note: strspn & strcspn call internally this function and rely on
-; the usage of only ptr4 here! Keep in mind when appling changes
+; the usage of only ptr4 here! Keep in mind when applying changes
 ; and check the other implementations too!
 ;
 ; size_t __fastcall__ strlen (const char* s);
diff --git a/libsrc/common/vsprintf.s b/libsrc/common/vsprintf.s
index b4cb9c419..65a961955 100644
--- a/libsrc/common/vsprintf.s
+++ b/libsrc/common/vsprintf.s
@@ -30,7 +30,7 @@ _vsprintf:
         ldy     #2
         jsr     staxysp
 
-; Contine by jumping to vsnprintf, which expects ap on the CPU stack and will
+; Continue by jumping to vsnprintf, which expects ap on the CPU stack and will
 ; cleanup the C stack
 
         jmp     vsnprintf
diff --git a/libsrc/cx16/getdevice.s b/libsrc/cx16/getdevice.s
index 5f2e74af4..70f883db0 100644
--- a/libsrc/cx16/getdevice.s
+++ b/libsrc/cx16/getdevice.s
@@ -56,7 +56,7 @@ next:   inx
 
         lda     STATUS
 
-; Either the Kernal calls above were successfull, or there was
+; Either the Kernal calls above were successful, or there was
 ; already a cmdchannel to the device open -- which is a pretty
 ; good indication of its existence. ;-)
 
diff --git a/libsrc/cx16/tgi/cx320p1.s b/libsrc/cx16/tgi/cx320p1.s
index 2fcd9adf3..f42d91c33 100644
--- a/libsrc/cx16/tgi/cx320p1.s
+++ b/libsrc/cx16/tgi/cx320p1.s
@@ -91,7 +91,7 @@ Y2              := ptr4
 
 .bss
 
-; The colors are indicies into a TGI palette.  The TGI palette is indicies into
+; The colors are indices into a TGI palette.  The TGI palette is indices into
 ; VERA's palette.  Vera's palette is a table of Red, Green, and Blue levels.
 ; The first 16 RGB elements mimic the Commodore 64's colors.
 
@@ -267,7 +267,7 @@ GETPALETTE:
 ; GETDEFPALETTE: Return the default palette for the driver in .XA. All
 ; drivers should return something reasonable here, even drivers that don't
 ; support palettes, otherwise the caller has no way to determine the colors
-; of the (not changable) palette.
+; of the (not changeable) palette.
 ;
 ; Must set an error code: NO (all drivers must have a default palette)
 
diff --git a/libsrc/cx16/tgi/cx640p1.s b/libsrc/cx16/tgi/cx640p1.s
index 287160f6b..815c4ab67 100644
--- a/libsrc/cx16/tgi/cx640p1.s
+++ b/libsrc/cx16/tgi/cx640p1.s
@@ -89,7 +89,7 @@ TEMP3           = sreg          ; HORLINE
 
 .bss
 
-; The colors are indicies into a TGI palette.  The TGI palette is indicies into
+; The colors are indices into a TGI palette.  The TGI palette is indices into
 ; VERA's palette.  Vera's palette is a table of Red, Green, and Blue levels.
 ; The first 16 RGB elements mimic the Commodore 64's colors.
 
@@ -404,7 +404,7 @@ GETPALETTE:
 ; GETDEFPALETTE: Return the default palette for the driver in .XA. All
 ; drivers should return something reasonable here, even drivers that don't
 ; support palettes, otherwise the caller has no way to determine the colors
-; of the (not changable) palette.
+; of the (not changeable) palette.
 ;
 ; Must set an error code: NO (all drivers must have a default palette)
 
diff --git a/libsrc/cx16/waitvsync.s b/libsrc/cx16/waitvsync.s
index d75a7a735..e0d9f9768 100644
--- a/libsrc/cx16/waitvsync.s
+++ b/libsrc/cx16/waitvsync.s
@@ -6,7 +6,7 @@
 ;
 ; VERA's vertical sync causes IRQs which increment the jiffy timer.
 ;
-; Updated by ZeroByteOrg to use Kernal API RDTIM to retreive the TIMER variable
+; Updated by ZeroByteOrg to use Kernal API RDTIM to retrieve the TIMER variable
 ;
 
         .export         _waitvsync
diff --git a/libsrc/dbg/dbgdump.s b/libsrc/dbg/dbgdump.s
index 8ab646d21..bc6a4bd40 100644
--- a/libsrc/dbg/dbgdump.s
+++ b/libsrc/dbg/dbgdump.s
@@ -1,7 +1,7 @@
 ;
 ; Ullrich von Bassewitz, 11.08.1998
 ;
-; char* __cdecl__ DbgMemDump (unsigend Addr, char* Buf, unsigned char Length);
+; char* __cdecl__ DbgMemDump (unsigned Addr, char* Buf, unsigned char Length);
 ;
 
         .export         _DbgMemDump
diff --git a/libsrc/geos-common/const.inc b/libsrc/geos-common/const.inc
index c0294e01d..ab45a19a2 100644
--- a/libsrc/geos-common/const.inc
+++ b/libsrc/geos-common/const.inc
@@ -1,5 +1,5 @@
 ;
-;GeosConst - various system constans sorted by function
+;GeosConst - various system constants sorted by function
 ;reassembled by Maciej 'YTM/Elysium' Witkowiak
 ;4-2-99, 18-3-99
 
diff --git a/libsrc/geos-common/symbols.txt b/libsrc/geos-common/symbols.txt
index d1893e376..b82954ec6 100644
--- a/libsrc/geos-common/symbols.txt
+++ b/libsrc/geos-common/symbols.txt
@@ -26,7 +26,7 @@ cardDataPntr	$2c	$2c	$60	Word		This is a pointer to the actual card graphics dat
 CPU_DATA	$01	n/a	n/a	Word		Address of 6510 data register that controls the hardware memory ...
 CPU_DDR		$00	n/a	n/a	Byte		Address of 6510 data direction register.
 curDevice	$ba	$ba	n/a	Byte		This holds the current serial device number.
-curDirHead	$8200	$8200	$fa80	256 | 39 Bytes	For CBM, it is the buffer containing header infomation ...
+curDirHead	$8200	$8200	$fa80	256 | 39 Bytes	For CBM, it is the buffer containing header information ...
 curDrive	$8489	$8489	$f60d	Byte		Holds the device number of the currently active disk drive.
 curEnable	n/a	$1300	$0951	Byte		This is an image of the C64 mobenble register.
 curHeight	$29	$29	$021b	Byte		Used to hold the card height in pixels of the current font in ...
@@ -48,7 +48,7 @@ dblClickCount	$8515	$8515	$0258	Byte		Used to determine when an icon is double c
 devTabHi	n/a	n/a	$fae7	4 Bytes		For the Apple, these are the high and low bytes of the four ...
 devTabLo	n/a	n/a	$faeb	4 Bytes		For the Apple, these are the high and low bytes of the four ...
 devUnitTab	n/a	n/a	$faef	4 Bytes		The ProDos unit numbers of the four possible devices are kept ...
-dir2Head	$8900	$8900	n/a	256 Bytes	This is the 2nd directory header block used for larger cpacity ...
+dir2Head	$8900	$8900	n/a	256 Bytes	This is the 2nd directory header block used for larger capacity ...
 dirBlkno	n/a	n/a	$f620	Word		Block number of the key block of the directory containing ...
 dirEntryBuf	$8400	$8400	$fa59	256 | 39 Bytes	Buffer used to build a file's directory entry.
 dirPtr		n/a	n/a	$f622	Word		Pointer into diskBlkBuf for this file's entry.
@@ -74,7 +74,7 @@ fileWritten	$8498	$8498	$f61a	Byte		Flag indicating if a if the currently open f
 firstBoot	$88c5	$88c5	$0281	Byte		This flag is changed from 0 to $FF when the deskTop comes up ...
 fontData	$850c	$850c	n/a(?)	9 Bytes		Buffer for saving the user active font table when going into ...
 fontTable	$26	$26	n/a(?)	8 Bytes		fontTable is a label for the beginning of variables for the ...
-grcntr12	$d016	$d016	n/a	Byte		Graphics control reqister #2.
+grcntr12	$d016	$d016	n/a	Byte		Graphics control register #2.
 grcntrl1	$d011	$d011	n/a	Byte		Graphics control register #1.
 grirq		$d019	$d019	n/a	Byte		Graphics chip interrupt register.
 grirqen		$d01a	$d01a	n/a	Byte		Graphics chip interrupt enable register.
@@ -89,7 +89,7 @@ intBotVector	$849f	$849f	$0204	Word		Vector to routine to call after the operati
 interleave	$848c	$848c	n/a	Byte		Variable used by BlkAlloc routine as the desired interleave when ...
 intSource	n/a	n/a	$02c6	Byte		Byte to indicate where interrupts are coming from on the Apple.
 intTopVector	$849d	$849d	$0202	Word		Vector to routine to call before the operating system interrupt ...
-invertBuffer	n/a	$1ced	n/a	80 Bytes	Buffer area used to speed up the 80 colunn InvertLine routine.
+invertBuffer	n/a	$1ced	n/a	80 Bytes	Buffer area used to speed up the 80 column InvertLine routine.
 irqvec		$0314	$0314	n/a	Word		IRQ vector.
 isGEOS		$848b	$848b	n/a	Byte		Flag to indicate whether the current disk is a GEOS disk.
 keyData		$8504	$8504	$0245	Byte		Holds the ASCII value of the current last key that was pressed.
@@ -152,7 +152,7 @@ msbxpos		$d010	$d010	n/a	Byte		Most significant bits for x positions of sprites.
 msePicPtr	$31	$31	n/a	Word		Pointer to the mouse graphics data.
 nationality	$c010	$c010	$e00d	Byte		Byte to hold nationality of Kernal.
 nmivec		$0318	$0318	n/a	Word		NMI vector.
-noEraseSprites	n/a	n/a	$0240	Byte		Flag to stop routine TempHideMouse fron erasing sprites #2 ...
+noEraseSprites	n/a	n/a	$0240	Byte		Flag to stop routine TempHideMouse from erasing sprites #2 ...
 numDrives	$848d	$848d	$f60e	Byte		Set to number of drives on the system.
 obj0Pointer	$8ff8	$8ff8	n/a	Byte		Pointer to the picture data for sprite 0.
 obj1Pointer	$8ff9	$8ff9	n/a	Byte		Pointer to the picture data for sprite 1.
@@ -169,7 +169,7 @@ PrntDiskName	$8476	$8476	n/a	18 Bytes	Disk name that current printer driver is o
 PrntFileName	$8465	$8465	$08ac	17 | 16 Bytes	Name of the current printer driver.
 ramBase		$88c7	$88c7	n/a	4 Bytes		RAM bank for each disk drive to use if the drive type is either ...
 ramExpSize	$88c3	$88c3	n/a	Byte		Byte for number or RAM banks available in RAM expansion unit.
-random		$850a	$850a	$024c	Word		Variable incremented each interrupt to generate a randon nunber.
+random		$850a	$850a	$024c	Word		Variable incremented each interrupt to generate a randon number.
 rasreg		$d012	$d012	n/a	Byte		Raster register.
 RecoverVector	$84b1	$84b1	$0216	Word		Pointer to routine that is called to recover the background ...
 reqXpos0	n/a	n/a	$0800	Word		This variable corresponds to the Commodore VIC chip register ...
@@ -193,7 +193,7 @@ shiftBuf	n/a	$1b45	$70	7 Bytes		Buffer for shifting/doubling sprites. Located in
 shiftOutBuf	n/a	$1b4c	$78	7 Bytes		Buffer for shifting/doubling/oring sprites. Located in back ...
 sizeFlags	n/a	$1b53	$db1c	Byte		Height of sprite.
 softOnes	n/a	$1c2d	$d000	192 Bytes	Buffer used for putting sprite bitmaps up on screen without ...
-softZeros	n/a	$1b6d	$d0e0	192 Bytes	Buffer used for putting sprite bitnaps up on screen without ...
+softZeros	n/a	$1b6d	$d0e0	192 Bytes	Buffer used for putting sprite bitmaps up on screen without ...
 spr0pic		$8a00	$8a00	n/a	64 Bytes	This is where the graphics data for sprite 0 is kept on ...
 spr1pic		$8a40	$8a40	n/a	64 Bytes	This is where the graphics data for sprite 1 is kept on ...
 spr2pic		$8a80	$8a80	n/a	64 Bytes	This is where the graphics data for sprite 2 is kept on ...
@@ -353,8 +353,8 @@ i_Rectangle		$c19f	$c19f	$fe3c	Inline Rectangle.
 ImprintLine		n/a	n/a	$ff8f	Imprint horizontal line to background buffer.
 ImprintRectangle	$c250	$c250	$fe4e	Imprint rectangular area to background buffer.
 InfoCard		n/a	n/a	$670f	Get I/O card attributes.
-InitCard		n/a	n/a	$6700	Intialize I/O card.
-InitForDialog		n/a	n/a	$ff4a	Internal pre-dialog box intialization.
+InitCard		n/a	n/a	$6700	Initialize I/O card.
+InitForDialog		n/a	n/a	$ff4a	Internal pre-dialog box initialization.
 InitForIO		$c25c	$c25c	n/a	Prepare CBM system for I/O across serial bus.
 InitForPrint		$7900	$7900	$6000	Initialize printer (once per document).
 InitMouse		$fe80	$fe80	$f000	Initialize input device.
diff --git a/libsrc/kim1/tapeio.s b/libsrc/kim1/tapeio.s
index 4a16d6b9c..4af2b3aa2 100644
--- a/libsrc/kim1/tapeio.s
+++ b/libsrc/kim1/tapeio.s
@@ -16,7 +16,7 @@
         sta     ID               ; Tape record ID to P1L
         jsr     LOADT            ; Read data from tape
         bcs     error
-        jmp     return0          ; Return 0 if sucessful
+        jmp     return0          ; Return 0 if successful
 error:  jmp     return1          ; or 1 if not
 
 .endproc
@@ -33,7 +33,7 @@ error:  jmp     return1          ; or 1 if not
         ldx     #$00
         jsr     DUMPT            ; Write data to tape
         bcs     error
-        jmp     return0          ; Return 0 if sucessful
+        jmp     return0          ; Return 0 if successful
 error:  jmp     return1          ; or 1 if not
 
 .endproc
diff --git a/libsrc/lynx/bootldr.s b/libsrc/lynx/bootldr.s
index ddc24faed..a0320886f 100644
--- a/libsrc/lynx/bootldr.s
+++ b/libsrc/lynx/bootldr.s
@@ -15,7 +15,7 @@
         .segment "BOOTLDR"
 ;**********************************
 ; Here is the bootloader in plaintext
-; The idea is to make the smalles possible encrypted loader as decryption
+; The idea is to make the smallest possible encrypted loader as decryption
 ; is very slow. The minimum size is 49 bytes plus a zero byte.
 ;**********************************
 ;                  EXE = $fb68
diff --git a/libsrc/lynx/eeprom66.s b/libsrc/lynx/eeprom66.s
index 6511cf8af..44b365f03 100644
--- a/libsrc/lynx/eeprom66.s
+++ b/libsrc/lynx/eeprom66.s
@@ -40,7 +40,7 @@ EE_C_WRITE      =    $14
 EE_C_READ       =    $18
 EE_C_ERASE      =    $1C
 EE_C_EWEN       =    $13
-EE_C_EWEN2      =    $FF   ;; C0 schould be enough
+EE_C_EWEN2      =    $FF   ;; C0 should be enough
 EE_C_EWDS       =    $10
 EE_C_EWDS2      =    $00
 
diff --git a/libsrc/lynx/eeprom86.s b/libsrc/lynx/eeprom86.s
index 73b342fae..8b829c5e8 100644
--- a/libsrc/lynx/eeprom86.s
+++ b/libsrc/lynx/eeprom86.s
@@ -41,7 +41,7 @@ EE_C_WRITE      =    $14
 EE_C_READ       =    $18
 EE_C_ERASE      =    $1C
 EE_C_EWEN       =    $13
-EE_C_EWEN2      =    $FF   ;; C0 schould be enough
+EE_C_EWEN2      =    $FF   ;; C0 should be enough
 EE_C_EWDS       =    $10
 EE_C_EWDS2      =    $00
 
diff --git a/libsrc/lynx/tgi/lynx-160-102-16.s b/libsrc/lynx/tgi/lynx-160-102-16.s
index c35b6a5aa..00a2059aa 100644
--- a/libsrc/lynx/tgi/lynx-160-102-16.s
+++ b/libsrc/lynx/tgi/lynx-160-102-16.s
@@ -43,7 +43,7 @@ libref: .addr   $0000                   ; Library reference
 ; to an RTS for test versions (function not implemented). A future version may
 ; allow for emulation: In this case the vector will be zero. Emulation means
 ; that the graphics kernel will emulate the function by using lower level
-; primitives - for example ploting a line by using calls to SETPIXEL.
+; primitives - for example plotting a line by using calls to SETPIXEL.
 
         .addr   INSTALL
         .addr   UNINSTALL
@@ -258,7 +258,7 @@ GETERROR:
 ;
 ; The TGI lacks a way to draw sprites. As that functionality is vital to
 ; Lynx games we borrow this CONTROL function to implement the still
-; missing tgi_draw_sprite funtion. To use this in your C-program
+; missing tgi_draw_sprite function. To use this in your C-program
 ; do a #define tgi_draw_sprite(spr) tgi_ioctl(0, spr)
 ;
 ; To do a flip-screen call tgi_ioctl(1, 0)
diff --git a/libsrc/nes/ppubuf.s b/libsrc/nes/ppubuf.s
index f08fc1a71..0de6d1980 100644
--- a/libsrc/nes/ppubuf.s
+++ b/libsrc/nes/ppubuf.s
@@ -68,7 +68,7 @@
 
 ; ------------------------------------------------------------------------
 ; Flush PPU-Memory write buffer
-; called from vblank interupt
+; called from vblank interrupt
 
 .proc   ppubuf_flush
 
diff --git a/libsrc/pce/vga.s b/libsrc/pce/vga.s
index 630fbe8db..067647cb8 100644
--- a/libsrc/pce/vga.s
+++ b/libsrc/pce/vga.s
@@ -3,9 +3,9 @@
 
         .export _pce_font
 
-; The character tiles use only two colors from each pallette.  Color zero
-; comes from pallette zero; color one is different in each pallette.  The
-; color of a character is set by choosing one of the 16 pallettes.
+; The character tiles use only two colors from each palette.  Color zero
+; comes from palette zero; color one is different in each palette.  The
+; color of a character is set by choosing one of the 16 palettes.
 
 .rodata
 
diff --git a/libsrc/pet/cbm_load.c b/libsrc/pet/cbm_load.c
index 1823f6537..2c98d9581 100644
--- a/libsrc/pet/cbm_load.c
+++ b/libsrc/pet/cbm_load.c
@@ -22,14 +22,14 @@ unsigned int __fastcall__ cbm_load (const char* name, unsigned char device, void
     unsigned int size = 0;
 
     if (cbm_open (1, device, CBM_READ, name) != 0) {
-        /* Can't load from a file that can't be openned. */
+        /* Can't load from a file that can't be opened. */
         return 0;
     }
 
     /* Get the file's load address. */
     if (cbm_read (1, &load, sizeof load) != sizeof load) {
         /* Either the file wasn't found, or it was too short.  (Note:
-        ** the computer openned a file even if the drive couldn't open one.)
+        ** the computer opened a file even if the drive couldn't open one.)
         */
         cbm_close (1);
         return 0;
diff --git a/libsrc/runtime/callirq.s b/libsrc/runtime/callirq.s
index 74a12c4db..2096e5c3b 100644
--- a/libsrc/runtime/callirq.s
+++ b/libsrc/runtime/callirq.s
@@ -12,7 +12,7 @@
 ;
 ;   2. Reentrancy. The condes routines must use self modyfiying code, which
 ;      means it is not reentrant. An IRQ using condes, that interrupts
-;      another use of condes will cause unpredicatble behaviour. The current
+;      another use of condes will cause unpredictable behaviour. The current
 ;      code avoids this by using locking mechanisms, but it's complex and
 ;      has a size and performance penalty.
 ;
diff --git a/libsrc/runtime/lshelp.s b/libsrc/runtime/lshelp.s
index 8a2fca139..ce1648d28 100644
--- a/libsrc/runtime/lshelp.s
+++ b/libsrc/runtime/lshelp.s
@@ -39,7 +39,7 @@ poplsargs:
         adc     #$00
         sta     sreg+1
 
-L1:     lda     ptr4+1          ; Is the right operand nagative?
+L1:     lda     ptr4+1          ; Is the right operand negative?
         sta     tmp2            ; Remember the sign for later
         bpl     L2              ; Jump if not
 
diff --git a/libsrc/runtime/ludiv.s b/libsrc/runtime/ludiv.s
index e2e27371e..77335d8f5 100644
--- a/libsrc/runtime/ludiv.s
+++ b/libsrc/runtime/ludiv.s
@@ -22,7 +22,7 @@ tosudiv0ax:
 .endif
 
 tosudiveax:
-        jsr     getlop          ; Get the paramameters
+        jsr     getlop          ; Get the parameters
         jsr     udiv32          ; Do the division
         lda     ptr1            ; Result is in ptr1:sreg
         ldx     ptr1+1
diff --git a/libsrc/runtime/lumod.s b/libsrc/runtime/lumod.s
index 09909c0c9..eb6176b35 100644
--- a/libsrc/runtime/lumod.s
+++ b/libsrc/runtime/lumod.s
@@ -22,7 +22,7 @@ tosumod0ax:
 .endif
 
 tosumodeax:
-        jsr     getlop          ; Get the paramameters
+        jsr     getlop          ; Get the parameters
         jsr     udiv32          ; Do the division
         lda     tmp3            ; Remainder is in ptr2:tmp3:tmp4
         sta     sreg
diff --git a/libsrc/sim6502/exehdr.s b/libsrc/sim6502/exehdr.s
index 529ad9b94..6487e5b0c 100644
--- a/libsrc/sim6502/exehdr.s
+++ b/libsrc/sim6502/exehdr.s
@@ -22,7 +22,7 @@
 .elseif (.cpu .bitand ::CPU_ISET_6502)
         .byte   0
 .else
-        .error Unknow CPU type.
+        .error Unknown CPU type.
 .endif
         .byte   sp                             ; sp address
         .addr   __MAIN_START__                 ; load address
diff --git a/libsrc/sym1/tapeio.s b/libsrc/sym1/tapeio.s
index 078ea7abd..f94e1336c 100644
--- a/libsrc/sym1/tapeio.s
+++ b/libsrc/sym1/tapeio.s
@@ -21,7 +21,7 @@
         ldy     #$80
         jsr     LOADT            ; Read data from tape
         bcs     error
-        jmp     return0          ; Return 0 if sucessful
+        jmp     return0          ; Return 0 if successful
 error:  jmp     return1          ; or 1 if not
 
 .endproc
@@ -40,7 +40,7 @@ error:  jmp     return1          ; or 1 if not
         ldy     #$80
         jsr     DUMPT            ; Write data to tape
         bcs     error
-        jmp     return0          ; Return 0 if sucessful
+        jmp     return0          ; Return 0 if successful
 error:  jmp     return1          ; or 1 if not
 
 .endproc
diff --git a/libsrc/telestrat/write.s b/libsrc/telestrat/write.s
index 37a896696..8509aa159 100644
--- a/libsrc/telestrat/write.s
+++ b/libsrc/telestrat/write.s
@@ -65,7 +65,7 @@ L2:     ldy     #0
         cpx     #$0A            ; check for \n
         bne     L3
         BRK_TELEMON  XWR0       ; macro send char to screen (channel 0 in telemon terms)
-        lda     #$0D            ; return to the beggining of the line
+        lda     #$0D            ; return to the beginning of the line
         BRK_TELEMON  XWR0       ; macro
 
 
diff --git a/libsrc/tgi/tgi_clippedline.s b/libsrc/tgi/tgi_clippedline.s
index b0f1dd456..319bb7152 100644
--- a/libsrc/tgi/tgi_clippedline.s
+++ b/libsrc/tgi/tgi_clippedline.s
@@ -188,7 +188,7 @@ tgi_clip_sign:  .res    1
         ldx     tgi_clip_dx+1
         jsr     udiv32by16r16
 
-; Check the sign of the final result and negate it if nessary
+; Check the sign of the final result and negate it if necessary
 
 done:   bit     tmp1
         jmi     negax
@@ -228,7 +228,7 @@ done:   bit     tmp1
         ldx     tgi_clip_dy+1
         jsr     udiv32by16r16
 
-; Check the sign of the final result and negate it if nessary
+; Check the sign of the final result and negate it if necessary
 
         jmp     muldiv_dydx::done
 
@@ -279,7 +279,7 @@ L1:     lda     tgi_clip_o1
 
 ; We must clip. If we haven't already done so, calculate dx/dy.
 
-L2:     lda     tgi_clip_d              ; Deltas alreay calculated?
+L2:     lda     tgi_clip_d              ; Deltas already calculated?
         bne     HaveDeltas              ; Jump if yes
         inc     tgi_clip_d
         jsr     calcdeltas
diff --git a/libsrc/tgi/tgi_init.s b/libsrc/tgi/tgi_init.s
index c8fd355d5..79651cbba 100644
--- a/libsrc/tgi/tgi_init.s
+++ b/libsrc/tgi/tgi_init.s
@@ -63,7 +63,7 @@
         lda     #<$100
         ldx     #>$100
         jsr     pushax                  ; Width scale = 1.0
-        jsr     pushax                  ; Heigh scale = 1.0
+        jsr     pushax                  ; Height scale = 1.0
         jsr     pusha                   ; Text direction = TGI_TEXT_HORIZONTAL
         jmp     _tgi_settextstyle       ; A = Font = TGI_FONT_BITMAP
 
diff --git a/libsrc/vic20/joy/vic20-stdjoy.s b/libsrc/vic20/joy/vic20-stdjoy.s
index b3de8766c..22ec0b638 100644
--- a/libsrc/vic20/joy/vic20-stdjoy.s
+++ b/libsrc/vic20/joy/vic20-stdjoy.s
@@ -82,7 +82,7 @@ COUNT:
 
 ; ------------------------------------------------------------------------
 ; READ: Read a particular joystick passed in A.
-; The current implemenation will ignore the joystick number because we do only
+; The current implementation will ignore the joystick number because we do only
 ; have one joystick
 
 READ:   lda     #$7F            ; mask for VIA2 JOYBIT: sw3