From 1d877494bf8fa096057271196527ed3ddb3a6fbd Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sun, 28 Feb 2016 23:37:04 +0100 Subject: [PATCH 001/361] initial commit from c64-rrr-1.0 --- libsrc/c64/emd/c64-rrr.s | 285 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 285 insertions(+) create mode 100644 libsrc/c64/emd/c64-rrr.s diff --git a/libsrc/c64/emd/c64-rrr.s b/libsrc/c64/emd/c64-rrr.s new file mode 100644 index 000000000..3de0ec0f4 --- /dev/null +++ b/libsrc/c64/emd/c64-rrr.s @@ -0,0 +1,285 @@ +; +;Extended Memory Driver for the Retro Replay RAM (32k) +;should work for ActionReplay as well... +; +; +;Version 1.0 +; +;Johannes Braun 2006-08-22 +;hannenz@freenet.de +; +;use the functions described in "usr/lib/cc65/include/em.h" to make use of this driver. +;------------------------------------------------------------------------------------------------------------------------- + +;NOTE: If called from ROM the Lo_Code routines must exit with LDA #$00 / STA $DE00!!! just change and recompile! + + .include "em-kernel.inc" + .importzp ptr1,ptr2,ptr3,ptr4,tmp1 + .macpack generic + +c64_ram = ptr1 ;use some more expressive identifiers... +rr_ram = ptr2 +len = ptr3 +aux = ptr4 +temp = tmp1 + +Lo_Mem = $0100 ;location of Lo_Code (must be below $1000 or above $e000) + +.segment "JUMPTABLE" + + .byte $65,$6d,$64 ;Driver signature + .byte EMD_API_VERSION + + .addr INSTALL ;Jump Table + .addr UNINSTALL + .addr PAGECOUNT + .addr MAP + .addr USE + .addr COMMIT + .addr COPYFROM + .addr COPYTO + +.bss +window: .res 256 ;the memory window (256 bytes) + +.rodata +dummy: .word window ;a "pseudo"-em_copy_struct, used by em_map/ em_commit + .byte 0 ;to pass over to COPYTO/COPYFROM +curpage: .byte $ff ;just this byte is changed according to the desired page + .byte 0 + .word 256 + +.code + +;---------------------------------------------------------------------------------------- +;unsigned char __fastcall__ em_install(void *driver); +;returns an error code +;---------------------------------------------------------------------------------------- +INSTALL: + ldx #c2-c1 +: lda c1,x + sta Lo_Mem,x + dex + bpl :- + stx curpage ;invalidate current page ($ff) + + ldx #$23 ;$de00 value for rr-ram + ldy #$02 ;$de00 value for c64-ram, CHANGE TO LDA #$00 if driver is called from ROM! + bne COMMON + +c1: stx $de00 ;try accessing rr-ram + lda $8888 + pha + lda $9999 ;remember old content of $8888 and $9999 + pha + + lda #$55 + sta $8888 ;write test values + asl + sta $9999 + + sty $de00 ;switch to c64 ram + stx $8888 + stx $9999 + + stx $de00 ;switch to rr-ram again (if present) + ldx $8888 ;read the values + ldy $9999 + pla + sta $9999 ;and write the old values back + pla + sta $8888 + + lda #2 + sta $de00 ;c64 ram again + + cli + cpx #$55 + bne no + cpy #$aa + bne no + lda #0 + rts +no: asl ;.A still has #2, so return #4: error code for "device not present" + rts +c2: +;---------------------------------------------------------------------------------------- +;void em_uninstall(void); +;---------------------------------------------------------------------------------------- +UNINSTALL: +return_null: + lda #$00 ;always return 32kb (128 pages) + .byte $2c + +;---------------------------------------------------------------------------------------- +;unsigned __fastcall__ em_pagecount(void); +;---------------------------------------------------------------------------------------- +PAGECOUNT: + lda #$80 + ldx #$00 + rts + +;---------------------------------------------------------------------------------------- +;void* __fastcall__ em_use(unsigned page); +;---------------------------------------------------------------------------------------- +USE: + cmp #$80 ;valid page? + bcs return_null ;no, return NULL pointer + sta curpage ;set to current page +return_win: lda #window +return: rts + +;---------------------------------------------------------------------------------------- +;void* __fastcall__ em_map(unsigned page); +;---------------------------------------------------------------------------------------- +MAP: + cmp #$80 + bcs return_null + sta curpage + lda #dummy ;adress in .A/.X) + jsr COPYFROM + bcs return_win ;function returns pointer to window (returns always with carry set!) + +;---------------------------------------------------------------------------------------- +;void __fastcall__ em_commit(void); +;---------------------------------------------------------------------------------------- +COMMIT: + lda curpage + cmp #$80 + bcs return + lda #dummy ;adress in .A/.X) + +;---------------------------------------------------------------------------------------- +;void __fastcall__ em_copyto (struct em_copy *copy_data); +;---------------------------------------------------------------------------------------- +COPYTO: + jsr get_struct_data ;read the parameters passed in the em_struct pointed to by .A/.X upon call + + ;copy the main copyto routine into Lo_Mem + + ldy #Lo_Code1_End - Lo_Code1 +: lda Lo_Code1-1,y + sta Lo_Mem-1,y + dey + bne :- +COMMON: + sei + jmp Lo_Mem + + ;this part will be executed in Lo_Mem (!) by COPYFROM + +Lo_Code2: + stx $de00 ;map in rr-ram + lda (rr_ram),y ;get byte from rr-ram + sty $de00 ;RR-ROM will be mapped to $8000-$a000 but write access will go to c64-ram anyway!! + sta (c64_ram),y ;and write to c64-ram + nop ;pad to same size as Lo_Code1 + nop +Lo_Code2_End: + + + ;this part will be executed in Lo_Mem (!) by COPYTO + +Lo_Code1: + lda (c64_ram),y ;read 1 byte from c64-ram + stx $de00 ;map in rr-ram + sta (rr_ram),y ;write byte to rr-ram + lda #$02 ;map in c64-ram again + sta $de00 + ;12 bytes + + ;this part is common for both COPYFROM/COPYTO and executed in Lo_Mem, too + +Lo_Code_Common: + inc c64_ram ;increase pointers + bne :+ + inc c64_ram+1 +: inc rr_ram + bne @skip + inc rr_ram+1 + lda rr_ram+1 + cmp #$a0 ;wrap around 16k boundary in rr-ram window ($8000-$a000) + bne @skip + + lda #$80 ;reset pointer to $8000 + sta rr_ram+1 + txa ;adjust value in .X to map in next 16k-bank in rr-ram + adc #7 ;carry is set because of former CMP, so it adds 8 + tax + ;27 bytes +@skip: lda c64_ram + cmp len + lda c64_ram+1 + sbc len+1 + bcc Lo_Code1 + lda #2 ;CHANGE to LDA #0 if driver is called from ROM + sta $de00 + cli + rts ;17 bytes = 56 bytes Lo_Code ($38) +Lo_Code1_End: +;---------------------------------------------------------------------------------------- +;void __fastcall__ em_copyfrom(struct em_copy *copy_data); +;copy from extended memory into linear memory +;---------------------------------------------------------------------------------------- +COPYFROM: + jsr get_struct_data + + ldy #Lo_Code2_End - Lo_Code2 ;copy routine into Lo_Mem +: lda Lo_Code2-1,y + sta Lo_Mem-1,y + dey + bne :- + ldy #Lo_Code1_End-Lo_Code_Common +: lda Lo_Code_Common-1,y + sta Lo_Mem+11,y + dey + bne :- + beq COMMON ;and execute... +;---------------------------------------------------------------------------------------- +;read the struct data located at (.A/.X) +;and setup parameters for stash/ fetch operation +;---------------------------------------------------------------------------------------- +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 + stx aux+1 + ldy #0 ;index 0 + + lda (aux),y ;read c64-adress lo + sta c64_ram + iny + lda (aux),y ;read c64-adress hi + sta c64_ram+1 ;(c64_ram) --> points to c64-adress space + iny + lda (aux),y ;read rr-adress lo + sta rr_ram + iny + lda (aux),y ;rr-adress hi + pha ;remember + and #$1f + ora #$80 ;adjust into 16k-window ($8000-$a000) + sta rr_ram+1 + pla ;re-get hi byte of rr-adress + and #$60 ;isolate bits 5 and 6 + 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 + iny + iny ;skip unused byte + lda (aux),y ;read length lo-byte + clc + adc c64_ram ;add to c64-addres + sta len + 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. + rts ;55 bytes + From 27bfc8e35fa02be1f8cb347e2f6830c825fb1d3c Mon Sep 17 00:00:00 2001 From: polluks2 <74630735+polluks2@users.noreply.github.com> Date: Sun, 4 Apr 2021 03:13:45 +0200 Subject: [PATCH 002/361] Update README.md Commander X16 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 33c7d2830..b4d098dd3 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,10 @@ including - the Lynx console. - the Ohio Scientific Challenger 1P. - the Commander X16. +<<<<<<< HEAD - the Synertek Systems Sym-1. +======= +>>>>>>> 2583dfb71 (Update README.md) The libraries are fairly portable, so creating a version for other 6502s shouldn't be too much work. From 6c1c260e7b04a7d4388abf9002285af000a3ee91 Mon Sep 17 00:00:00 2001 From: polluks2 <74630735+polluks2@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:05:39 +0200 Subject: [PATCH 003/361] Create c-cpp.yml --- .github/workflows/c-cpp.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/c-cpp.yml diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 000000000..e3233268f --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,23 @@ +name: C/C++ CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: configure + run: ./configure + - name: make + run: make + - name: make check + run: make check + - name: make distcheck + run: make distcheck From 687c8052aea79dae81cc0a7d90e0a7e2c0fddf53 Mon Sep 17 00:00:00 2001 From: polluks Date: Thu, 30 Dec 2021 00:04:57 +0100 Subject: [PATCH 004/361] Save a few bytes --- libsrc/cbm/read.s | 2 +- libsrc/cbm/write.s | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/cbm/read.s b/libsrc/cbm/read.s index fb0bb3171..71ba5d713 100644 --- a/libsrc/cbm/read.s +++ b/libsrc/cbm/read.s @@ -135,7 +135,7 @@ eof: lda #0 devnotpresent: lda #ENODEV - jmp __directerrno ; Sets _errno, clears _oserror, returns -1 + .byte $2C ; Skip next opcode ; Error entry: The given file descriptor is not valid or not open diff --git a/libsrc/cbm/write.s b/libsrc/cbm/write.s index ebc44a0ac..04010f2e4 100644 --- a/libsrc/cbm/write.s +++ b/libsrc/cbm/write.s @@ -106,7 +106,7 @@ devnotpresent2: pla devnotpresent: lda #ENODEV - jmp __directerrno ; Sets _errno, clears _oserror, returns -1 + .byte $2C ; Skip next opcode ; Error entry: The given file descriptor is not valid or not open From 919645f2832ef9e3875f91584fabf54ded746d18 Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Sun, 12 Dec 2021 23:41:19 +0100 Subject: [PATCH 005/361] Updated URL and improved consistency. --- doc/apple2.sgml | 4 ++-- doc/apple2enh.sgml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/apple2.sgml b/doc/apple2.sgml index bd01b68dc..cf83dacc9 100644 --- a/doc/apple2.sgml +++ b/doc/apple2.sgml @@ -33,7 +33,7 @@ more information. The standard binary file format generated by the linker for the Apple ][ target is an file. +url="https://nulib.com/library/AppleSingle_AppleDouble.pdf"> file. The default load address is $803. , but uses the heap either explicitly or implicitly (i.e. by loading a driver) then -the memory from $800 to $2000 can be added to the heap by calling +the memory from $800 to $1FFF can be added to the heap by calling file. +url="https://nulib.com/library/AppleSingle_AppleDouble.pdf"> file. The default load address is $803. , but uses the heap either explicitly or implicitly (i.e. by loading a driver) then -the memory from $800 to $2000 can be added to the heap by calling +the memory from $800 to $1FFF can be added to the heap by calling Date: Sun, 12 Dec 2021 12:27:55 -0500 Subject: [PATCH 006/361] Changed a big script into separate named steps. It makes the job log easier to navigate. Also, Pull Requests don't need a Zip file. --- .github/workflows/build-on-pull-request.yml | 37 ++++++++------ .github/workflows/snapshot-on-push-master.yml | 48 ++++++++++++------- 2 files changed, 52 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-on-pull-request.yml b/.github/workflows/build-on-pull-request.yml index 53f79fef4..da9216a3d 100644 --- a/.github/workflows/build-on-pull-request.yml +++ b/.github/workflows/build-on-pull-request.yml @@ -1,6 +1,6 @@ name: Build Pull Request on: [pull_request] -concurrency: +concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -8,11 +8,11 @@ jobs: build_linux: name: Build and Test (Linux) runs-on: ubuntu-latest - + steps: - shell: bash run: git config --global core.autocrlf input - + - name: Checkout Source uses: actions/checkout@v2 @@ -21,28 +21,35 @@ jobs: run: | sudo apt-get update sudo apt-get install linuxdoc-tools linuxdoc-tools-info binutils-mingw-w64-i686 gcc-mingw-w64-i686 sshpass - - - name: Build - id: build + + - name: Build the tools. shell: bash + run: make -j2 bin USER_CFLAGS=-Werror + - name: Build the platform libraries. + shell: bash + run: make -j2 lib QUIET=1 + - name: Run the regression tests. + shell: bash + run: make test QUIET=1 + - name: Test that the samples can be built. + shell: bash + run: make -j2 samples + - name: Build the document files. + shell: bash + run: make -j2 doc + - name: Build 32-bit Windows versions of the tools. run: | - make -j2 bin USER_CFLAGS=-Werror - make -j2 lib QUIET=1 - make test QUIET=1 - make -j2 samples make -C src clean make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=i686-w64-mingw32- - make -C samples clean - make -j2 doc zip build_windows: name: Build (Windows) runs-on: windows-latest - + steps: - shell: bash run: git config --global core.autocrlf input - + - name: Checkout Source uses: actions/checkout@v2 @@ -51,6 +58,6 @@ jobs: - name: Build app (debug) run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug - + - name: Build app (release) run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release diff --git a/.github/workflows/snapshot-on-push-master.yml b/.github/workflows/snapshot-on-push-master.yml index aefc7f2f5..e10904357 100644 --- a/.github/workflows/snapshot-on-push-master.yml +++ b/.github/workflows/snapshot-on-push-master.yml @@ -1,9 +1,9 @@ -name: Snapshot Build +name: Snapshot Build on: push: branches: master -concurrency: +concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -11,11 +11,11 @@ jobs: build_windows: name: Build (Windows) runs-on: windows-latest - + steps: - shell: bash run: git config --global core.autocrlf input - + - name: Checkout Source uses: actions/checkout@v2 @@ -24,7 +24,7 @@ jobs: - name: Build app (debug) run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug - + - name: Build app (release) run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release @@ -32,11 +32,11 @@ jobs: name: Build, Test and Snaphot (Linux) runs-on: ubuntu-latest needs: build_windows - + steps: - shell: bash run: git config --global core.autocrlf input - + - name: Checkout Source uses: actions/checkout@v2 @@ -45,25 +45,37 @@ jobs: run: | sudo apt-get update sudo apt-get install linuxdoc-tools linuxdoc-tools-info binutils-mingw-w64-i686 gcc-mingw-w64-i686 sshpass - - - name: Build - id: build + + - name: Build the tools. shell: bash + run: make -j2 bin USER_CFLAGS=-Werror + - name: Build the platform libraries. + shell: bash + run: make -j2 lib QUIET=1 + - name: Run the regression tests. + shell: bash + run: make test QUIET=1 + - name: Test that the samples can be built. + shell: bash + run: make -j2 samples + - name: Remove the output from the samples tests. + shell: bash + run: make -C samples clean + - name: Build the document files. + shell: bash + run: make -j2 doc + - name: Build and package 32-bit Windows versions of the tools. run: | - make -j2 bin USER_CFLAGS=-Werror - make -j2 lib QUIET=1 - make test QUIET=1 - make -j2 samples make -C src clean make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=i686-w64-mingw32- - make -C samples clean - make -j2 doc zip - + make zip + mv cc65.zip cc65-win32.zip + - name: Upload Snapshot Zip uses: actions/upload-artifact@v2 with: name: cc65-snapshot-win32.zip - path: cc65.zip + path: cc65-win32.zip # TODO: Update docs at https://github.com/cc65/doc # TODO: Publish snapshot zip at https://github.com/cc65/cc65.github.io From 32253a4e519de76bf068e465878f4b091a302538 Mon Sep 17 00:00:00 2001 From: Greg King Date: Sun, 12 Dec 2021 12:35:27 -0500 Subject: [PATCH 007/361] Removed unneeded package names. sshpass isn't needed because the Windows packages are put on Github. linuxdoc-tools is a dependency of linuxdoc-tools-info. The binutils package is a dependency of the gcc package. --- .github/workflows/build-on-pull-request.yml | 2 +- .github/workflows/snapshot-on-push-master.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-on-pull-request.yml b/.github/workflows/build-on-pull-request.yml index da9216a3d..c3214c308 100644 --- a/.github/workflows/build-on-pull-request.yml +++ b/.github/workflows/build-on-pull-request.yml @@ -20,7 +20,7 @@ jobs: shell: bash run: | sudo apt-get update - sudo apt-get install linuxdoc-tools linuxdoc-tools-info binutils-mingw-w64-i686 gcc-mingw-w64-i686 sshpass + sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-i686 - name: Build the tools. shell: bash diff --git a/.github/workflows/snapshot-on-push-master.yml b/.github/workflows/snapshot-on-push-master.yml index e10904357..3f138e492 100644 --- a/.github/workflows/snapshot-on-push-master.yml +++ b/.github/workflows/snapshot-on-push-master.yml @@ -44,7 +44,7 @@ jobs: shell: bash run: | sudo apt-get update - sudo apt-get install linuxdoc-tools linuxdoc-tools-info binutils-mingw-w64-i686 gcc-mingw-w64-i686 sshpass + sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-i686 - name: Build the tools. shell: bash From c143dd1f414e0c62c73a70f0183d366c5f98bbba Mon Sep 17 00:00:00 2001 From: Greg King Date: Sun, 12 Dec 2021 13:42:25 -0500 Subject: [PATCH 008/361] Added a 64-bit Windows cross-compile. That compiler catches pointer-integer width mismatches that other compilers ignore. --- .github/workflows/build-on-pull-request.yml | 6 +++--- .github/workflows/snapshot-on-push-master.yml | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-on-pull-request.yml b/.github/workflows/build-on-pull-request.yml index c3214c308..fe99c4673 100644 --- a/.github/workflows/build-on-pull-request.yml +++ b/.github/workflows/build-on-pull-request.yml @@ -20,7 +20,7 @@ jobs: shell: bash run: | sudo apt-get update - sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-i686 + sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-x86-64 - name: Build the tools. shell: bash @@ -37,10 +37,10 @@ jobs: - name: Build the document files. shell: bash run: make -j2 doc - - name: Build 32-bit Windows versions of the tools. + - name: Build 64-bit Windows versions of the tools. run: | make -C src clean - make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=i686-w64-mingw32- + make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=x86_64-w64-mingw32- build_windows: name: Build (Windows) diff --git a/.github/workflows/snapshot-on-push-master.yml b/.github/workflows/snapshot-on-push-master.yml index 3f138e492..c8d36488d 100644 --- a/.github/workflows/snapshot-on-push-master.yml +++ b/.github/workflows/snapshot-on-push-master.yml @@ -44,7 +44,7 @@ jobs: shell: bash run: | sudo apt-get update - sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-i686 + sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 - name: Build the tools. shell: bash @@ -64,6 +64,12 @@ jobs: - name: Build the document files. shell: bash run: make -j2 doc + - name: Build and package 64-bit Windows versions of the tools. + run: | + make -C src clean + make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=x86_64-w64-mingw32- + make zip + mv cc65.zip cc65-win64.zip - name: Build and package 32-bit Windows versions of the tools. run: | make -C src clean @@ -71,11 +77,16 @@ jobs: make zip mv cc65.zip cc65-win32.zip - - name: Upload Snapshot Zip + - name: Upload a 32-bit Snapshot Zip uses: actions/upload-artifact@v2 with: name: cc65-snapshot-win32.zip path: cc65-win32.zip + - name: Upload a 64-bit Snapshot Zip + uses: actions/upload-artifact@v2 + with: + name: cc65-snapshot-win64.zip + path: cc65-win64.zip # TODO: Update docs at https://github.com/cc65/doc # TODO: Publish snapshot zip at https://github.com/cc65/cc65.github.io From 81930053dd2e4aaee3f832597a03088b0acef1d4 Mon Sep 17 00:00:00 2001 From: Greg King Date: Sun, 12 Dec 2021 17:36:03 -0500 Subject: [PATCH 009/361] Used (size_t), instead of (long) where converting between pointers and integers. (long) still is 32 bits on 64-bit Windows! --- src/cc65/locals.c | 2 +- src/cc65/symentry.h | 2 +- src/cc65/symtab.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cc65/locals.c b/src/cc65/locals.c index c2e314485..d3902f329 100644 --- a/src/cc65/locals.c +++ b/src/cc65/locals.c @@ -286,7 +286,7 @@ static void ParseAutoDecl (Declaration* Decl) ** We abuse the Collection somewhat by using it to store line ** numbers. */ - CollReplace (&CurrentFunc->LocalsBlockStack, (void *)(long)GetCurrentLine (), + CollReplace (&CurrentFunc->LocalsBlockStack, (void *)(size_t)GetCurrentLine (), CollCount (&CurrentFunc->LocalsBlockStack) - 1); } else { diff --git a/src/cc65/symentry.h b/src/cc65/symentry.h index bb87c7472..bcf586510 100644 --- a/src/cc65/symentry.h +++ b/src/cc65/symentry.h @@ -115,7 +115,7 @@ struct CodeEntry; typedef struct DefOrRef DefOrRef; struct DefOrRef { unsigned Line; - long LocalsBlockId; + size_t LocalsBlockId; unsigned Flags; int StackPtr; unsigned Depth; diff --git a/src/cc65/symtab.c b/src/cc65/symtab.c index 5d7bd1436..3de0bb460 100644 --- a/src/cc65/symtab.c +++ b/src/cc65/symtab.c @@ -951,7 +951,7 @@ DefOrRef* AddDefOrRef (SymEntry* E, unsigned Flags) DOR = xmalloc (sizeof (DefOrRef)); CollAppend (E->V.L.DefsOrRefs, DOR); DOR->Line = GetCurrentLine (); - DOR->LocalsBlockId = (long)CollLast (&CurrentFunc->LocalsBlockStack); + DOR->LocalsBlockId = (size_t)CollLast (&CurrentFunc->LocalsBlockStack); DOR->Flags = Flags; DOR->StackPtr = StackPtr; DOR->Depth = CollCount (&CurrentFunc->LocalsBlockStack); @@ -1013,9 +1013,9 @@ SymEntry* AddLabelSym (const char* Name, unsigned Flags) /* Are we jumping into a block with initalization of an object that ** has automatic storage duration? Let's emit a warning. */ - if ((long)CollLast (AIC) != DOR->LocalsBlockId && + if ((size_t)CollLast (AIC) != DOR->LocalsBlockId && (CollCount (AIC) < DOR->Depth || - (long)CollAt (AIC, DOR->Depth - 1) != DOR->LocalsBlockId)) { + (size_t)CollAt (AIC, DOR->Depth - 1) != DOR->LocalsBlockId)) { Warning ("Goto at line %d to label %s jumps into a block with " "initialization of an object that has automatic storage duration", GetCurrentLine (), Name); @@ -1044,9 +1044,9 @@ SymEntry* AddLabelSym (const char* Name, unsigned Flags) /* Are we jumping into a block with initalization of an object that ** has automatic storage duration? Let's emit a warning. */ - if ((long)CollLast (AIC) != DOR->LocalsBlockId && + if ((size_t)CollLast (AIC) != DOR->LocalsBlockId && (CollCount (AIC) >= DOR->Depth || - (long)CollLast (AIC) >= (long)DOR->Line)) + (size_t)CollLast (AIC) >= (size_t)DOR->Line)) Warning ("Goto at line %d to label %s jumps into a block with " "initialization of an object that has automatic storage duration", DOR->Line, Name); From dd27a66a7bb0abd0111fec92d7b859e9dd69b024 Mon Sep 17 00:00:00 2001 From: Greg King Date: Sun, 12 Dec 2021 23:54:17 -0500 Subject: [PATCH 010/361] Install system packages before checking out the repo. --- .github/workflows/build-on-pull-request.yml | 11 +++++------ .github/workflows/snapshot-on-push-master.yml | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-on-pull-request.yml b/.github/workflows/build-on-pull-request.yml index fe99c4673..f5477d191 100644 --- a/.github/workflows/build-on-pull-request.yml +++ b/.github/workflows/build-on-pull-request.yml @@ -10,18 +10,17 @@ jobs: runs-on: ubuntu-latest steps: - - shell: bash - run: git config --global core.autocrlf input - - - name: Checkout Source - uses: actions/checkout@v2 - - name: Install Dependencies shell: bash run: | sudo apt-get update sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-x86-64 + - shell: bash + run: git config --global core.autocrlf input + - name: Checkout Source + uses: actions/checkout@v2 + - name: Build the tools. shell: bash run: make -j2 bin USER_CFLAGS=-Werror diff --git a/.github/workflows/snapshot-on-push-master.yml b/.github/workflows/snapshot-on-push-master.yml index c8d36488d..110edbbf0 100644 --- a/.github/workflows/snapshot-on-push-master.yml +++ b/.github/workflows/snapshot-on-push-master.yml @@ -34,18 +34,17 @@ jobs: needs: build_windows steps: - - shell: bash - run: git config --global core.autocrlf input - - - name: Checkout Source - uses: actions/checkout@v2 - - name: Install Dependencies shell: bash run: | sudo apt-get update sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 + - shell: bash + run: git config --global core.autocrlf input + - name: Checkout Source + uses: actions/checkout@v2 + - name: Build the tools. shell: bash run: make -j2 bin USER_CFLAGS=-Werror From 5afc349199f6175af63a6e1b0468cd6438c11a4b Mon Sep 17 00:00:00 2001 From: polluks2 <74630735+polluks2@users.noreply.github.com> Date: Mon, 13 Dec 2021 17:14:57 +0100 Subject: [PATCH 011/361] Fixed typo --- src/ld65/scanner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ld65/scanner.c b/src/ld65/scanner.c index 256d47f07..718951aa5 100644 --- a/src/ld65/scanner.c +++ b/src/ld65/scanner.c @@ -196,7 +196,7 @@ static void StrVal (void) default: CfgWarning (&CfgErrorPos, - "Unkown escape sequence '%%%c'", C); + "Unknown escape sequence '%%%c'", C); SB_AppendChar (&CfgSVal, '%'); SB_AppendChar (&CfgSVal, C); NextChar (); From 7a0a0edb89ea7396304a1036dffee6b931bcbfee Mon Sep 17 00:00:00 2001 From: polluks2 <74630735+polluks2@users.noreply.github.com> Date: Mon, 13 Dec 2021 17:20:56 +0100 Subject: [PATCH 012/361] Fixed many typos --- src/dbginfo/dbginfo.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/dbginfo/dbginfo.c b/src/dbginfo/dbginfo.c index 42001ed07..fdebe6910 100644 --- a/src/dbginfo/dbginfo.c +++ b/src/dbginfo/dbginfo.c @@ -183,7 +183,7 @@ typedef struct DbgInfo DbgInfo; struct DbgInfo { /* First we have all items in collections sorted by id. The ids are - ** continous, so an access by id is almost as cheap as an array access. + ** continuous, so an access by id is almost as cheap as an array access. ** The collections are also used when the objects are deleted, so they're ** actually the ones that "own" the items. */ @@ -680,7 +680,7 @@ static char* SB_StrDup (const StrBuf* B) static Collection* CollInit (Collection* C) /* Initialize a collection and return it. */ { - /* Intialize the fields. */ + /* Initialize the fields. */ C->Count = 0; C->Size = 0; C->Items = 0; @@ -1349,7 +1349,7 @@ static int CompareFileInfoByName (const void* L, const void* R) static LibInfo* NewLibInfo (const StrBuf* Name) -/* Create a new LibInfo struct, intialize and return it */ +/* Create a new LibInfo struct, initialize and return it */ { /* Allocate memory */ LibInfo* L = xmalloc (sizeof (LibInfo) + SB_GetLen (Name)); @@ -1463,7 +1463,7 @@ static int CompareLineInfoByLine (const void* L, const void* R) static ModInfo* NewModInfo (const StrBuf* Name) -/* Create a new ModInfo struct, intialize and return it */ +/* Create a new ModInfo struct, initialize and return it */ { /* Allocate memory */ ModInfo* M = xmalloc (sizeof (ModInfo) + SB_GetLen (Name)); @@ -1536,7 +1536,7 @@ static int CompareModInfoByName (const void* L, const void* R) static ScopeInfo* NewScopeInfo (const StrBuf* Name) -/* Create a new ScopeInfo struct, intialize and return it */ +/* Create a new ScopeInfo struct, initialize and return it */ { /* Allocate memory */ ScopeInfo* S = xmalloc (sizeof (ScopeInfo) + SB_GetLen (Name)); @@ -1697,7 +1697,7 @@ static int CompareSegInfoByName (const void* L, const void* R) static SpanInfo* NewSpanInfo (void) -/* Create a new SpanInfo struct, intialize and return it */ +/* Create a new SpanInfo struct, initialize and return it */ { /* Allocate memory */ SpanInfo* S = xmalloc (sizeof (SpanInfo)); @@ -1779,7 +1779,7 @@ static int CompareSpanInfoByAddr (const void* L, const void* R) static SymInfo* NewSymInfo (const StrBuf* Name) -/* Create a new SymInfo struct, intialize and return it */ +/* Create a new SymInfo struct, initialize and return it */ { /* Allocate memory */ SymInfo* S = xmalloc (sizeof (SymInfo) + SB_GetLen (Name)); @@ -2147,7 +2147,7 @@ static TypeInfo* ParseTypeString (InputData* D, StrBuf* Type) I += GT_GET_SIZE (A[I]) + 1; } else { /* Unknown type in type string */ - ParseError (D, CC65_ERROR, "Unkown type in type value"); + ParseError (D, CC65_ERROR, "Unknown type in type value"); return 0; } break; @@ -2733,7 +2733,7 @@ static int StrConstFollows (InputData* D) static int Consume (InputData* D, Token Tok, const char* Name) -/* Check for a token and consume it. Return true if the token was comsumed, +/* Check for a token and consume it. Return true if the token was consumed, ** return false otherwise. */ { @@ -6936,7 +6936,7 @@ const cc65_scopeinfo* cc65_scope_byspan (cc65_dbginfo Handle, unsigned SpanId) const cc65_scopeinfo* cc65_childscopes_byid (cc65_dbginfo Handle, unsigned Id) /* Return the direct child scopes of a scope with a given id. The function ** returns NULL if no scope with this id was found, otherwise a list of the -** direct childs. +** direct children. */ { const DbgInfo* Info; From a08f9e51a0ca78eff4037c09f05a04695872f000 Mon Sep 17 00:00:00 2001 From: polluks2 Date: Tue, 14 Dec 2021 13:13:16 +0100 Subject: [PATCH 013/361] Fixed many typos --- doc/apple2.sgml | 2 +- doc/apple2enh.sgml | 2 +- doc/atari.sgml | 12 ++++++------ doc/atari5200.sgml | 2 +- doc/ca65.sgml | 2 +- doc/cc65.sgml | 6 +++--- doc/cl65.sgml | 4 ++-- doc/co65.sgml | 4 ++-- doc/coding.sgml | 2 +- doc/da65.sgml | 2 +- doc/debugging.sgml | 6 +++--- doc/geos.sgml | 4 ++-- doc/grc65.sgml | 6 +++--- doc/intro.sgml | 2 +- doc/ld65.sgml | 2 +- doc/smc.sgml | 4 ++-- 16 files changed, 31 insertions(+), 31 deletions(-) diff --git a/doc/apple2.sgml b/doc/apple2.sgml index cf83dacc9..09052ade1 100644 --- a/doc/apple2.sgml +++ b/doc/apple2.sgml @@ -73,7 +73,7 @@ system takes care of actually moving the code into the Language Card. The amount of memory available in the Language Card for generated code depends on the parameters. There are -several usefull settings: +several useful settings: diff --git a/doc/apple2enh.sgml b/doc/apple2enh.sgml index 8b61df91c..a105cb47a 100644 --- a/doc/apple2enh.sgml +++ b/doc/apple2enh.sgml @@ -73,7 +73,7 @@ system takes care of actually moving the code into the Language Card. The amount of memory available in the Language Card for generated code depends on the parameters. There are -several usefull settings: +several useful settings: diff --git a/doc/atari.sgml b/doc/atari.sgml index 903895d17..85dcaaf5e 100644 --- a/doc/atari.sgml +++ b/doc/atari.sgml @@ -131,7 +131,7 @@ With the default load address of $2400 this gives a usable memory range o [$2400-$CFFF]. Please note that the first load chunk (which checks the system -compatibilty and available memory) will always be loaded at +compatibility and available memory) will always be loaded at $2E00, regardless of the specified start address. This address can only be changed by a custom linker config file. @@ -305,7 +305,7 @@ The names are the usual ones you can find in system reference manuals. Example: ... -Please note that memory location 762/$2FA is called " -Please inspect the The old "HEADER" memory description contained six bytes: $FFFF -and the first and last memory addess of the program. For the "system -check" load chunk this had to be split into two memory assigments. The +and the first and last memory address of the program. For the "system +check" load chunk this had to be split into two memory assignments The "HEADER" now only contains the $FFFF. The main program's first and last memory address were moved to a new segment, called "MAINHDR", which in the new linker config file goes into its own memory area (also diff --git a/doc/atari5200.sgml b/doc/atari5200.sgml index c7e5be73e..599ffe3c9 100644 --- a/doc/atari5200.sgml +++ b/doc/atari5200.sgml @@ -237,7 +237,7 @@ The runtime library provides a default game name which is "cc65 compiled". To change that, one has to link a file which puts data into the " .export __CART_NAME__: absolute = 1 .macpack atari diff --git a/doc/ca65.sgml b/doc/ca65.sgml index 8ae8eabd9..0638ab08c 100644 --- a/doc/ca65.sgml +++ b/doc/ca65.sgml @@ -301,7 +301,7 @@ Here is a description of all the command line options: compiler, see there for a list. Depending on the target, the default CPU type is also set. This can be - overriden by using the / option. + overridden by using the / option.