From 228856c26d5f3da7e1e7056ee8e04c6baef63b8b Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Fri, 8 Jan 2021 04:37:03 +0100 Subject: [PATCH] Cleanup --- .build/bios.lst | 8 ---- .build/bios.rel | 13 ------ .build/bios.sym | 15 ------- .build/console.asm | 96 --------------------------------------------- .build/console.lst | 96 --------------------------------------------- .build/console.rel | 36 ----------------- .build/console.sym | 30 -------------- .build/crt.a | Bin 2552 -> 0 bytes .build/crt0.lst | 52 ------------------------ .build/crt0.rel | 37 ----------------- .build/crt0.sym | 25 ------------ .build/random.lst | 29 -------------- .build/random.rel | 12 ------ .build/random.sym | 15 ------- .gitignore | 1 + src/random.s | 6 ++- 16 files changed, 5 insertions(+), 466 deletions(-) delete mode 100644 .build/bios.lst delete mode 100644 .build/bios.rel delete mode 100644 .build/bios.sym delete mode 100644 .build/console.asm delete mode 100644 .build/console.lst delete mode 100644 .build/console.rel delete mode 100644 .build/console.sym delete mode 100644 .build/crt.a delete mode 100644 .build/crt0.lst delete mode 100644 .build/crt0.rel delete mode 100644 .build/crt0.sym delete mode 100644 .build/random.lst delete mode 100644 .build/random.rel delete mode 100644 .build/random.sym create mode 100644 .gitignore diff --git a/.build/bios.lst b/.build/bios.lst deleted file mode 100644 index e3d04be..0000000 --- a/.build/bios.lst +++ /dev/null @@ -1,8 +0,0 @@ - 0000 1 __bios_call:: - 0000 2A 01 00 [16] 2 ld hl, (1) - 0003 85 [ 4] 3 add l - 0004 6F [ 4] 4 ld l, a - 0005 D2r09r00 [10] 5 jp nc, bios_call_cont - 0008 24 [ 4] 6 inc h - 0009 7 bios_call_cont: - 0009 E9 [ 4] 8 jp (hl) diff --git a/.build/bios.rel b/.build/bios.rel deleted file mode 100644 index 13c4a9b..0000000 --- a/.build/bios.rel +++ /dev/null @@ -1,13 +0,0 @@ -XL2 -H 1 areas 2 global symbols -S .__.ABS. Def0000 -A _CODE size A flags 0 addr 0 -S __bios_call Def0000 -T 00 00 -R 00 00 00 00 -T 00 00 2A 01 00 85 6F D2 09 00 24 -R 00 00 00 00 00 08 00 00 -T 09 00 -R 00 00 00 00 -T 09 00 E9 -R 00 00 00 00 diff --git a/.build/bios.sym b/.build/bios.sym deleted file mode 100644 index 25996fe..0000000 --- a/.build/bios.sym +++ /dev/null @@ -1,15 +0,0 @@ - ASxxxx Assembler V02.00 + NoICE + SDCC mods (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80), page 1. -Hexadecimal [16-Bits] - -Symbol Table - - .__.$$$.= 2710 L | .__.ABS.= 0000 G | .__.CPU.= 0000 L - .__.H$L.= 0000 L | 0 __bios_c 0000 GR | 0 bios_cal 0009 R - - ASxxxx Assembler V02.00 + NoICE + SDCC mods (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80), page 2. -Hexadecimal [16-Bits] - -Area Table - - 0 _CODE size A flags 0 - diff --git a/.build/console.asm b/.build/console.asm deleted file mode 100644 index 754936b..0000000 --- a/.build/console.asm +++ /dev/null @@ -1,96 +0,0 @@ -;-------------------------------------------------------- -; File Created by SDCC : free open source ANSI-C Compiler -; Version 4.0.0 #11528 (Linux) -;-------------------------------------------------------- - .module console - .optsdcc -mz80 - -;-------------------------------------------------------- -; Public variables in this module -;-------------------------------------------------------- - .globl _get_char - .globl _put_char - .globl _put_string -;-------------------------------------------------------- -; special function registers -;-------------------------------------------------------- -;-------------------------------------------------------- -; ram data -;-------------------------------------------------------- - .area _DATA -;-------------------------------------------------------- -; ram data -;-------------------------------------------------------- - .area _INITIALIZED -;-------------------------------------------------------- -; absolute external ram data -;-------------------------------------------------------- - .area _DABS (ABS) -;-------------------------------------------------------- -; global & static initialisations -;-------------------------------------------------------- - .area _HOME - .area _GSINIT - .area _GSFINAL - .area _GSINIT -;-------------------------------------------------------- -; Home -;-------------------------------------------------------- - .area _HOME - .area _HOME -;-------------------------------------------------------- -; code -;-------------------------------------------------------- - .area _CODE -;src/console.c:3: char get_char() __naked { -; --------------------------------- -; Function get_char -; --------------------------------- -_get_char:: -;src/console.c:9: __endasm; - ld a, #6 - call __bios_call - ld l, a - ret -;src/console.c:10: } -;src/console.c:12: void put_char(char c) __naked { -; --------------------------------- -; Function put_char -; --------------------------------- -_put_char:: -;src/console.c:21: __endasm; - ld iy, #2 - add iy, sp - ld c, 0(iy) - ld a, #9 - call __bios_call - ret -;src/console.c:22: } -;src/console.c:24: void put_string(char* s) { -; --------------------------------- -; Function put_string -; --------------------------------- -_put_string:: -;src/console.c:25: while (*s) { - pop de - pop bc - push bc - push de -00101$: - ld a, (bc) - or a, a - ret Z -;src/console.c:26: put_char(*s); - push bc - push af - inc sp - call _put_char - inc sp - pop bc -;src/console.c:27: s++; - inc bc -;src/console.c:29: } - jr 00101$ - .area _CODE - .area _INITIALIZER - .area _CABS (ABS) diff --git a/.build/console.lst b/.build/console.lst deleted file mode 100644 index 88e2e38..0000000 --- a/.build/console.lst +++ /dev/null @@ -1,96 +0,0 @@ - 1 ;-------------------------------------------------------- - 2 ; File Created by SDCC : free open source ANSI-C Compiler - 3 ; Version 4.0.0 #11528 (Linux) - 4 ;-------------------------------------------------------- - 5 .module console - 6 .optsdcc -mz80 - 7 - 8 ;-------------------------------------------------------- - 9 ; Public variables in this module - 10 ;-------------------------------------------------------- - 11 .globl _get_char - 12 .globl _put_char - 13 .globl _put_string - 14 ;-------------------------------------------------------- - 15 ; special function registers - 16 ;-------------------------------------------------------- - 17 ;-------------------------------------------------------- - 18 ; ram data - 19 ;-------------------------------------------------------- - 20 .area _DATA - 21 ;-------------------------------------------------------- - 22 ; ram data - 23 ;-------------------------------------------------------- - 24 .area _INITIALIZED - 25 ;-------------------------------------------------------- - 26 ; absolute external ram data - 27 ;-------------------------------------------------------- - 28 .area _DABS (ABS) - 29 ;-------------------------------------------------------- - 30 ; global & static initialisations - 31 ;-------------------------------------------------------- - 32 .area _HOME - 33 .area _GSINIT - 34 .area _GSFINAL - 35 .area _GSINIT - 36 ;-------------------------------------------------------- - 37 ; Home - 38 ;-------------------------------------------------------- - 39 .area _HOME - 40 .area _HOME - 41 ;-------------------------------------------------------- - 42 ; code - 43 ;-------------------------------------------------------- - 44 .area _CODE - 45 ;src/console.c:3: char get_char() __naked { - 46 ; --------------------------------- - 47 ; Function get_char - 48 ; --------------------------------- - 0000 49 _get_char:: - 50 ;src/console.c:9: __endasm; - 0000 3E 06 [ 7] 51 ld a, #6 - 0002 CDr00r00 [17] 52 call __bios_call - 0005 6F [ 4] 53 ld l, a - 0006 C9 [10] 54 ret - 55 ;src/console.c:10: } - 56 ;src/console.c:12: void put_char(char c) __naked { - 57 ; --------------------------------- - 58 ; Function put_char - 59 ; --------------------------------- - 0007 60 _put_char:: - 61 ;src/console.c:21: __endasm; - 0007 FD 21 02 00 [14] 62 ld iy, #2 - 000B FD 39 [15] 63 add iy, sp - 000D FD 4E 00 [19] 64 ld c, 0(iy) - 0010 3E 09 [ 7] 65 ld a, #9 - 0012 CDr00r00 [17] 66 call __bios_call - 0015 C9 [10] 67 ret - 68 ;src/console.c:22: } - 69 ;src/console.c:24: void put_string(char* s) { - 70 ; --------------------------------- - 71 ; Function put_string - 72 ; --------------------------------- - 0016 73 _put_string:: - 74 ;src/console.c:25: while (*s) { - 0016 D1 [10] 75 pop de - 0017 C1 [10] 76 pop bc - 0018 C5 [11] 77 push bc - 0019 D5 [11] 78 push de - 001A 79 00101$: - 001A 0A [ 7] 80 ld a, (bc) - 001B B7 [ 4] 81 or a, a - 001C C8 [11] 82 ret Z - 83 ;src/console.c:26: put_char(*s); - 001D C5 [11] 84 push bc - 001E F5 [11] 85 push af - 001F 33 [ 6] 86 inc sp - 0020 CDr07r00 [17] 87 call _put_char - 0023 33 [ 6] 88 inc sp - 0024 C1 [10] 89 pop bc - 90 ;src/console.c:27: s++; - 0025 03 [ 6] 91 inc bc - 92 ;src/console.c:29: } - 0026 18 F2 [12] 93 jr 00101$ - 94 .area _CODE - 95 .area _INITIALIZER - 96 .area _CABS (ABS) diff --git a/.build/console.rel b/.build/console.rel deleted file mode 100644 index 481349b..0000000 --- a/.build/console.rel +++ /dev/null @@ -1,36 +0,0 @@ -XL2 -H 9 areas 5 global symbols -M console -O -mz80 -S .__.ABS. Def0000 -S __bios_call Ref0000 -A _CODE size 28 flags 0 addr 0 -S _get_char Def0000 -S _put_string Def0016 -S _put_char Def0007 -A _DATA size 0 flags 0 addr 0 -A _INITIALIZED size 0 flags 0 addr 0 -A _DABS size 0 flags 8 addr 0 -A _HOME size 0 flags 0 addr 0 -A _GSINIT size 0 flags 0 addr 0 -A _GSFINAL size 0 flags 0 addr 0 -A _INITIALIZER size 0 flags 0 addr 0 -A _CABS size 0 flags 8 addr 0 -T 00 00 -R 00 00 00 00 -T 00 00 3E 06 CD 00 00 6F C9 -R 00 00 00 00 02 05 01 00 -T 07 00 -R 00 00 00 00 -T 07 00 FD 21 02 00 FD 39 FD 4E 00 3E 09 CD 00 00 -R 00 00 00 00 02 0E 01 00 -T 15 00 C9 -R 00 00 00 00 -T 16 00 -R 00 00 00 00 -T 16 00 D1 C1 C5 D5 -R 00 00 00 00 -T 1A 00 -R 00 00 00 00 -T 1A 00 0A B7 C8 C5 F5 33 CD 07 00 33 C1 03 18 F2 -R 00 00 00 00 00 09 00 00 diff --git a/.build/console.sym b/.build/console.sym deleted file mode 100644 index 8e3352f..0000000 --- a/.build/console.sym +++ /dev/null @@ -1,30 +0,0 @@ - ASxxxx Assembler V02.00 + NoICE + SDCC mods (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80), page 1. -Hexadecimal [16-Bits] - -Symbol Table - - .__.$$$. = 2710 L - .__.ABS. = 0000 G - .__.CPU. = 0000 L - .__.H$L. = 0000 L - __bios_call **** GX - 0 _get_char 0000 GR - 0 _put_char 0007 GR - 0 _put_string 0016 GR - - - ASxxxx Assembler V02.00 + NoICE + SDCC mods (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80), page 2. -Hexadecimal [16-Bits] - -Area Table - - 0 _CODE size 28 flags 0 - 1 _DATA size 0 flags 0 - 2 _INITIALIZED size 0 flags 0 - 3 _DABS size 0 flags 8 - 4 _HOME size 0 flags 0 - 5 _GSINIT size 0 flags 0 - 6 _GSFINAL size 0 flags 0 - 7 _INITIALIZER size 0 flags 0 - 8 _CABS size 0 flags 8 - diff --git a/.build/crt.a b/.build/crt.a deleted file mode 100644 index acaaea028f41c986fc12f6d0b053fb02ea0b8ef6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2552 zcmb_e-EPw`6wU=mBTsR70E(UeNC=TO%~sKEsO<&fCS+~aRZ3fwlneH3yW+_>wiDa= zX%P}rlR4+d{`~ozFM0bRE7wmS&G*p$qaG#1cO2URAl#+j0jTBG3Exe_Fy7$xTU@U` z83wyvZ`5`5Vi;F1qcj~wLdeQItH6V8 zaeT-MsDAAqjzwiIA>C)Y11$1KoQU9avpU4mRHf(|nJkAa)D?l5b%|iUIpM;eTTfwG0 zjKUvdbJMWSvgV7n?IkyX0lJZL-Oj z+aa?!yusNzp-R&!^ z=_=1R+DrSg7NIQn`$yoD-Sd}%5VR0*kOY)q{+mvLCJ+$7&w?ZYyT=9|xzKrDBF)0!yhiX;{s212P38aq diff --git a/.build/crt0.lst b/.build/crt0.lst deleted file mode 100644 index d96893e..0000000 --- a/.build/crt0.lst +++ /dev/null @@ -1,52 +0,0 @@ - 1 ;-------------------------------------------------------------------------- - 2 ; cpm0.s - Generic cpm0.s for a Z80 CP/M-80 v2.2 Application - 3 ; Copyright (C) 2011, Douglas Goodall All Rights Reserved. - 4 ;-------------------------------------------------------------------------- - 5 - 6 .area _CODE - 0000 7 .ds 0x0100 - 0100 8 init: - 9 ;; Define an adequate stack - 0100 31r00r01 [10] 10 ld sp, #stktop - 11 - 12 ;; Initialise global variables - 0103 CDr00r00 [17] 13 call gsinit - 14 - 15 ;; Call the C main routine - 0106 CDr00r00 [17] 16 call _main - 17 - 18 ;; Return back to CP/M - 0109 0E 00 [ 7] 19 ld c, #0 - 010B CD 05 00 [17] 20 call 5 - 21 - 22 ;; Ordering of segments for the linker. - 23 .area _TPA - 24 - 25 .area _HOME - 26 .area _CODE - 27 .area _INITIALIZER - 28 .area _GSINIT - 29 .area _GSFINAL - 30 .area _DATA - 31 .area _INITIALIZED - 32 - 33 .area _STACK - 0000 34 .ds 256 - 0100 35 stktop: - 36 - 37 .area _GSINIT - 0000 38 gsinit:: - 0000 01r00r00 [10] 39 ld bc, #l__INITIALIZER - 0003 78 [ 4] 40 ld a, b - 0004 B1 [ 4] 41 or a, c - 0005 28 08 [12] 42 jr z, gsinit_next - 0007 11r00r00 [10] 43 ld de, #s__INITIALIZED - 000A 21r00r00 [10] 44 ld hl, #s__INITIALIZER - 000D ED B0 [21] 45 ldir - 000F 46 gsinit_next: - 47 .area _GSFINAL - 0000 C9 [10] 48 ret - 49 - 50 ;;;;;;;;;;;;;;;; - 51 ; eof - cpm0.s ; - 52 ;;;;;;;;;;;;;;;; diff --git a/.build/crt0.rel b/.build/crt0.rel deleted file mode 100644 index 5fa1805..0000000 --- a/.build/crt0.rel +++ /dev/null @@ -1,37 +0,0 @@ -XL2 -H 9 areas 6 global symbols -S _main Ref0000 -S .__.ABS. Def0000 -S s__INITIALIZED Ref0000 -S l__INITIALIZER Ref0000 -S s__INITIALIZER Ref0000 -A _CODE size 10E flags 0 addr 0 -A _TPA size 0 flags 0 addr 0 -A _HOME size 0 flags 0 addr 0 -A _INITIALIZER size 0 flags 0 addr 0 -A _GSINIT size F flags 0 addr 0 -S gsinit Def0000 -A _GSFINAL size 1 flags 0 addr 0 -A _DATA size 0 flags 0 addr 0 -A _INITIALIZED size 0 flags 0 addr 0 -A _STACK size 100 flags 0 addr 0 -T 00 00 -R 00 00 00 00 -T 00 01 -R 00 00 00 00 -T 00 01 31 00 01 CD 00 00 CD 00 00 0E 00 CD 05 00 -R 00 00 00 00 00 03 08 00 00 06 04 00 02 09 00 00 -T 00 00 -R 00 00 08 00 -T 00 01 -R 00 00 08 00 -T 00 00 -R 00 00 04 00 -T 00 00 01 00 00 78 B1 28 08 11 00 00 21 00 00 ED -R 00 00 04 00 02 03 03 00 02 0A 02 00 02 0D 04 00 -T 0E 00 B0 -R 00 00 04 00 -T 0F 00 -R 00 00 04 00 -T 00 00 C9 -R 00 00 05 00 diff --git a/.build/crt0.sym b/.build/crt0.sym deleted file mode 100644 index b118447..0000000 --- a/.build/crt0.sym +++ /dev/null @@ -1,25 +0,0 @@ - ASxxxx Assembler V02.00 + NoICE + SDCC mods (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80), page 1. -Hexadecimal [16-Bits] - -Symbol Table - - .__.$$$.= 2710 L | .__.ABS.= 0000 G | .__.CPU.= 0000 L - .__.H$L.= 0000 L | _main **** GX | 4 gsinit 0000 GR - 4 gsinit_n 000F R | 0 init 0100 R | l__INITI **** GX - s__INITI **** GX | s__INITI **** GX | 8 stktop 0100 R - - ASxxxx Assembler V02.00 + NoICE + SDCC mods (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80), page 2. -Hexadecimal [16-Bits] - -Area Table - - 0 _CODE size 10E flags 0 - 1 _TPA size 0 flags 0 - 2 _HOME size 0 flags 0 - 3 _INITIAL size 0 flags 0 - 4 _GSINIT size F flags 0 - 5 _GSFINAL size 1 flags 0 - 6 _DATA size 0 flags 0 - 7 _INITIAL size 0 flags 0 - 8 _STACK size 100 flags 0 - diff --git a/.build/random.lst b/.build/random.lst deleted file mode 100644 index d890d60..0000000 --- a/.build/random.lst +++ /dev/null @@ -1,29 +0,0 @@ - 1 ; Fast RND - 2 ; - 3 ; An 8-bit pseudo-random number generator, - 4 ; using a similar method to the Spectrum ROM, - 5 ; - without the overhead of the Spectrum ROM. - 6 ; - 7 ; R = random number seed - 8 ; an integer in the range [1, 256] - 9 ; - 10 ; R -> (33*R) mod 257 - 11 ; - 12 ; S = R - 1 - 13 ; an 8-bit unsigned integer - 14 - 0000 15 _random:: - 0000 3Ar00r00 [13] 16 ld a, (_seed) - 0003 47 [ 4] 17 ld b, a - 18 - 0004 0F [ 4] 19 rrca ; multiply by 32 - 0005 0F [ 4] 20 rrca - 0006 0F [ 4] 21 rrca - 0007 EE 1F [ 7] 22 xor #0x1f - 23 - 0009 80 [ 4] 24 add a, b - 000A DE FF [ 7] 25 sbc a, #255 ; carry - 26 - 000C 32r00r00 [13] 27 ld (_seed), a - 000F 6F [ 4] 28 ld l, a - 0010 C9 [10] 29 ret diff --git a/.build/random.rel b/.build/random.rel deleted file mode 100644 index 93e740e..0000000 --- a/.build/random.rel +++ /dev/null @@ -1,12 +0,0 @@ -XL2 -H 1 areas 3 global symbols -S _seed Ref0000 -S .__.ABS. Def0000 -A _CODE size 11 flags 0 addr 0 -S _random Def0000 -T 00 00 -R 00 00 00 00 -T 00 00 3A 00 00 47 0F 0F 0F EE 1F 80 DE FF 32 -R 00 00 00 00 02 03 00 00 -T 0D 00 00 00 6F C9 -R 00 00 00 00 02 02 00 00 diff --git a/.build/random.sym b/.build/random.sym deleted file mode 100644 index cdbced3..0000000 --- a/.build/random.sym +++ /dev/null @@ -1,15 +0,0 @@ - ASxxxx Assembler V02.00 + NoICE + SDCC mods (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80), page 1. -Hexadecimal [16-Bits] - -Symbol Table - - .__.$$$.= 2710 L | .__.ABS.= 0000 G | .__.CPU.= 0000 L - .__.H$L.= 0000 L | 0 _random 0000 GR | _seed **** GX - - ASxxxx Assembler V02.00 + NoICE + SDCC mods (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80), page 2. -Hexadecimal [16-Bits] - -Area Table - - 0 _CODE size 11 flags 0 - diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30bcfa4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.build/ diff --git a/src/random.s b/src/random.s index bca0b9f..b504040 100644 --- a/src/random.s +++ b/src/random.s @@ -12,8 +12,10 @@ ; S = R - 1 ; an 8-bit unsigned integer + .area _CODE + _random:: - ld a, (_seed) + ld a, (_random_seed) ld b, a rrca ; multiply by 32 @@ -24,6 +26,6 @@ _random:: add a, b sbc a, #255 ; carry - ld (_seed), a + ld (_random_seed), a ld l, a ret