From 4dfde387e404607bdeda9bf1f845145ef27e2cc6 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 12:27:53 +0200 Subject: [PATCH 01/23] Remove Dicander's code, as it is unused by the larger system --- wip-dicander/STARTUP.s | 82 ------------ wip-dicander/macros/16bitarithmetic.s | 140 -------------------- wip-dicander/macros/timer.s | 34 ----- wip-dicander/routines/line/line.s | 47 ------- wip-dicander/routines/line/line_down.s | 116 ---------------- wip-dicander/routines/line/line_down_inv.s | 77 ----------- wip-dicander/routines/line/line_test.s | 81 ----------- wip-dicander/routines/line/line_test_time.s | 49 ------- wip-dicander/routines/line/line_up.s | 78 ----------- wip-dicander/routines/line/line_up_inv.s | 76 ----------- wip-dicander/routines/memory/memcpy.s | 33 ----- wip-dicander/routines/memory/memcpy_test.s | 28 ---- wip-dicander/routines/memory/memset.s | 31 ----- wip-dicander/routines/memory/pixel_draw.s | 83 ------------ wip-dicander/routines/text/char_draw.s | 83 ------------ wip-dicander/run.sh | 10 -- wip-dicander/source.s | 67 ---------- 17 files changed, 1115 deletions(-) delete mode 100755 wip-dicander/STARTUP.s delete mode 100755 wip-dicander/macros/16bitarithmetic.s delete mode 100644 wip-dicander/macros/timer.s delete mode 100644 wip-dicander/routines/line/line.s delete mode 100644 wip-dicander/routines/line/line_down.s delete mode 100644 wip-dicander/routines/line/line_down_inv.s delete mode 100644 wip-dicander/routines/line/line_test.s delete mode 100644 wip-dicander/routines/line/line_test_time.s delete mode 100644 wip-dicander/routines/line/line_up.s delete mode 100644 wip-dicander/routines/line/line_up_inv.s delete mode 100644 wip-dicander/routines/memory/memcpy.s delete mode 100644 wip-dicander/routines/memory/memcpy_test.s delete mode 100755 wip-dicander/routines/memory/memset.s delete mode 100755 wip-dicander/routines/memory/pixel_draw.s delete mode 100644 wip-dicander/routines/text/char_draw.s delete mode 100755 wip-dicander/run.sh delete mode 100755 wip-dicander/source.s diff --git a/wip-dicander/STARTUP.s b/wip-dicander/STARTUP.s deleted file mode 100755 index ce821b9..0000000 --- a/wip-dicander/STARTUP.s +++ /dev/null @@ -1,82 +0,0 @@ -.scope STARTUP -;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- -;;Settings positions -CR1 = $d011; ;Graphic settings -VIC_bank_settings = $DD00 ; Vic position -Screen_RAM_settings =$D018 ;Screen RAM position relative to VIC - -;;########## VIC_BANK ################ -;;# BITMAP | $4000 -$5F3F -;;# Unused? | $5F3F - $6000 -;;# SCREAN RAM (color) | $6000 -$63E7 -;;# Unused? | $63E8 - $7FFF -;;# -;;#################################### - -;;Memory positions -VIC_bank = $4000 -VIC_bank_end = VIC_bank + $3FFF - -Bitmap = VIC_bank -Bitmap_end = $5F3F - -Screen_RAM = $2000 + VIC_bank -Screen_RAM_end = Screen_RAM + $03E7 - -Character_generator_ROM = $D000 - -;;Free up memory -;;https://www.c64-wiki.com/wiki/Bank_Switching -;; -;;Set graphic mode [Standard bitmap mode] -;;https://www.c64-wiki.com/wiki/Standard_Bitmap_Mode -LDA #%10111111 ; ECM = False Extended color mode -AND CR1 -STA CR1 - -LDA #%00100000; BMM = True Bitmap mode -ORA CR1 -STA CR1 - -;;Set VIC bank to bank 1 -;;https://www.c64-wiki.com/wiki/VIC_bank -LDA #%11111110 ;bit_0 = False -AND VIC_bank_settings -STA VIC_bank_settings - -LDA #%00000010; bit_1 = True -ORA VIC_bank_settings -STA VIC_bank_settings - -;;Set Scren-RAM to offset 8 ;https://www.c64-wiki.com/wiki/53272 (offset is 8k byte = 1024*8-ich) -LDA #%10001111 ; bit_6 =bit_5=bit_4 = Falsw -AND Screen_RAM_settings -STA Screen_RAM_settings - -LDA #%10000000; bit_1 = True -ORA Screen_RAM_settings -STA Screen_RAM_settings - -;;Paint the bitmap black. More bitmap: https://www.c64-wiki.com/wiki/53272, https://www.c64-wiki.com/wiki/Screen_RAM#Moving_of_screen_RAM -Mov_16 >B_start, VIC_bank -Mov_16 >B_end, $5f3f -LDA #$00 -jsr memset - - -;;Sets the screen color to black and white -Mov_16 >B_start, Screen_RAM -Mov_16 >B_end, Screen_RAM_end -LDA #%11110000 -jsr memset -SEI ;Disable interups (not all) -;;Disable BASIC ROM mohahaha -LDA #%11111110 -AND $0001 -STA $0001 -;https://www.c64-wiki.com/wiki/Bank_Switching -;Disable IO, CHAREN =0 -;LDA #%11111011 -;AND $0001 -;STA $0001 -.endscope diff --git a/wip-dicander/macros/16bitarithmetic.s b/wip-dicander/macros/16bitarithmetic.s deleted file mode 100755 index 0f41cc9..0000000 --- a/wip-dicander/macros/16bitarithmetic.s +++ /dev/null @@ -1,140 +0,0 @@ -;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- - -;; A file containing 16-bit macro arithmatic. -;; You may add ,! ass a 5:th parameter to skipp flagg clearing. -;; This will make it run faster but will have unintended behavior. - -;;Se below for some fast 16bit logic -;;http://6502.org/tutorials/compare_beyond.html - -;; Addition always uses the A register -;; a = a + b -.macro Add_16 a_low, a_hi, b_low, b_hi, fast_unsafe -;; IF to run it fast -.ifblank fast_unsafe - CLC -.endif -.if .not .match ({b_low}, a) - LDA b_low -.endif ;;untested - ADC a_low - STA a_low -.if .match ({b_hi}, x) ;;Untested - TXA -.else - LDA b_hi -.endif - ADC a_hi - STA a_hi -.endmacro - - -;; Subtraction uses always uses A register -;; a = a - b -.macro Sub_16 a_low, a_hi, b_low, b_hi, fast_unsafe -;; IF to run it fast -.ifblank fast_unsafe - SEC -.endif -;; if b_low = A and b_hi =A -.if .match({b_low}, a) .and .match({b_hi}, a) ;;untested - .LOCAL rewrite - .LOCAL rewrite2 - STA rewrite +1 - STA rewrite2 + 1 - LDA a_low - rewrite: - SBC #b_low - STA a_low - LDA a_hi - rewrite2: - SBC #b_hi - STA a_hi -;; if b_low = A -.elseif .match({b_low}, a) ;;untested - .LOCAL rewrite - STA rewrite +1 - LDA a_low - rewrite: - SBC #b_low - STA a_low - LDA a_hi - SBC b_hi - STA a_hi -.elseif .match({b_hi}, a) ;;untested - .LOCAL rewrite - STA rewrite +1 - LDA a_low - SBC b_low - STA a_low - LDA a_hi - rewrite: - SBC #b_hi - STA a_hi -.else - LDA a_low - SBC b_low - STA a_low - LDA a_hi - SBC b_hi - STA a_hi -.endif -.endmacro - -;; Subtraction uses always uses A register -;; a = (A, a_hi) - b -.macro Sub_16_A a_low, a_hi, b_low, b_hi, fast_unsafe -;; IF to run it fast -.ifblank fast_unsafe - SEC -.endif - SBC b_low - STA a_low - LDA a_hi - SBC b_hi - STA a_hi -.endmacro - - -;; Multiplication of 2 -;; a = a*2 -.macro Mult_16 low_, hi_, NOT_ROL -;; IF NOT_ROL -.ifblank fast_unsafe - ASL low_ - ROL hi_ -.else - ROL low_ - ROL hi_ -.endif -.endmacro - -.macro Mov_16 a_low, a_hi, b_low, b_hi - LDA b_low - STA a_low - LDA b_hi - STA a_hi -.endmacro - -;;http://www.6502.org/tutorials/compare_beyond.html -;;Larger then operation, uses the A register -;;IF a < b then: jump to label -; C =0 if jump to LABEL -.macro Lag_16 a_low, a_hi, b_low, b_hi, label - .LOCAL LABEL - LDA a_hi - CMP b_hi - BCC label - BNE LABEL - LDA a_low -.if .match ({b_low}, a) - .LOCAL next - STY next +1 -next: - CMP #$ff -.else - CMP b_low -.endif - BCC label - LABEL: -.endmacro diff --git a/wip-dicander/macros/timer.s b/wip-dicander/macros/timer.s deleted file mode 100644 index 92c7059..0000000 --- a/wip-dicander/macros/timer.s +++ /dev/null @@ -1,34 +0,0 @@ -;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- - -;; Max 0.9s -;; Exempel i kod: -;; -;; time_start -;; ... -;; time_stop -;; -;; Läs tiden genom att undersöka värdet i $f1 (BSD-format) -time = $f1 -.macro time_start - PHA - LDA $DC08 ; Bit 0..3: Tenth seconds in BCD-format, others may be 0 or 1 - ;;;;Clear all time data and set time =1. - AND #%11110000 - STA $DC08 - INC $DC08 - LDA $DC08 - ;;Time is only at bit 0 ..3 - AND #%00001111 - STA time - PLA -.endmacro - -.macro time_stop - PHA - LDA $DC08 ; Bit 0..3: Tenth seconds in BCD-format, others may be 0 or 1 - AND #%00001111 - SEC - SBC time - STA time - PLA -.endmacro diff --git a/wip-dicander/routines/line/line.s b/wip-dicander/routines/line/line.s deleted file mode 100644 index 5b656e8..0000000 --- a/wip-dicander/routines/line/line.s +++ /dev/null @@ -1,47 +0,0 @@ -;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- - -.proc line; X_pos =< X_end skall alltid gälla - .include "line.inc" - ; dx_ = $0c - ; dy_ = $06 - ;;dx - SEC - LDA X_end - SBC X_pos - STA dx - BCC dx_no_underflow;; X_end >= X_pos - EOR #$ff ; Fix bit underflow - dx_no_underflow: - SEC - LDA Y_pos - SBC Y_end - STA dy - BCC down ;normal Y_pos < Y_end -up:; Y_pos > Y_end - STA dy - CMP dx - BCC shallow; dy < dx -steep: - jsr line_up_inv - RTS -shallow: ;dy =< dx - lda dx - jsr line_up - RTS -down: - EOR #$ff ; Fix bit underflow - STA dy - CMP dx - BCC shallow_; dy < dx -steep_: - jsr line_down_inv - RTS -shallow_: ;dy < dx - jsr line_down - RTS - - .include "line_down.s" - .include "line_down_inv.s" - .include "line_up.s" - .include "line_up_inv.s" -.endproc diff --git a/wip-dicander/routines/line/line_down.s b/wip-dicander/routines/line/line_down.s deleted file mode 100644 index e90ab7a..0000000 --- a/wip-dicander/routines/line/line_down.s +++ /dev/null @@ -1,116 +0,0 @@ -;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- - -;;drawing line from 2 cordinates -;;# (X_pos, Y_pos) # -;;# * # -;;# * # -;;# * # -;;# (X_end, Y_end) # -;;NOTE THAT X_pos <= X_end, Y_pos <= Y_end. Max 45deg! - -.proc line_down - - .include "line.inc"; Defines memory positions, ex X_pos - - ;;We need to clear this memory - LDA #$00 - STA V - Mult_16 >V, dy_2, dy_2 = dy (same address) - - ;; This is an Bresenham's line algorithm, se wikipedia bellow. - ;;https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm - ;; We need to compute the Value D = 2*dy - dx, - ;; but it may be or get negative. - ;; IN the loop we may set D = D -V - ;; Because math D needs to be at least >=V. - ;; V_max = %00000001 11111111 - ;; We therefor need to add this offset to V 00000001 11111111 - ;; and to its branch logic later in the loop. - - ;;D = 2*dy - dx + 2*255 - Mov_16 >D, dy_2, D, D, dy_2 - LDA >dy_2 - STA case_2 +1 - ;; Modifies LDA V - LDA >V - STA case_1 +1 - ;; Modifies SBC btp_mem_pos), Y - STA (>btp_mem_pos), Y -increment_pixel_x: - LSR byte_to_paint ; Rotates the pixel one bit to the left ON THE SCREEN. - BCC increment_pixel_x_end; We need to move to the next chunk -move_8px_left: - ;; Next chunk is 8 addresses away. Look in pixel_draw for more detail. - ;; -8. - ;; C = 1 therefore you se 07 - Add_16 >btp_mem_pos, D, D - Sub_16_A >D, V, # C=1 - LDY #$00 - ;; Switch to chunk bellow - ; C = 1 - ; So we subtract #$3F, #$01 +C - Add_16 >btp_mem_pos, D, dy_2, #V - Mult_16 >V, dx_2, D, dx_2, D, D, dx_2 - STA case_2 +1 - LDA V - STA case_1 +1 - LDA btp_mem_pos), Y - STA (>btp_mem_pos), Y -increment_y_pos: - INY - CPY #$08 - BNE increment_y_pos_end -move_8px_down: - LDY #$00 - Add_16 >btp_mem_pos, D, D, V, #btp_mem_pos, D, dx_2, #B_start, VIC_bank - Mov_16 >B_end, $5f3f - LDA #$00 - jsr memset - - - LDA #$00 - STA X_pos_ - LDA #$60 - STA Y_pos_ - LDA #$ff - STA X_end - LDA #$0 - STA Y_end -@loop: - LDA Y_pos_ - STA Y_pos - LDA X_pos_ - STA X_pos - jsr line - INC Y_end - LDA Y_end - CMP #$bb - BEQ end_ - jmp @loop -end_: - jmp exit -.endscope diff --git a/wip-dicander/routines/line/line_test_time.s b/wip-dicander/routines/line/line_test_time.s deleted file mode 100644 index 7006dde..0000000 --- a/wip-dicander/routines/line/line_test_time.s +++ /dev/null @@ -1,49 +0,0 @@ -;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- -.scope line_test_time - .include "line.inc" - - ;;START TIME HERE - - ;;for testing stuff - Y_pos_ = $0D - X_pos_ = $0E - Y_end_ = $10 - X_end_ = $11 - LDA #$00 - STA X_pos_ - LDA #$30 - STA Y_pos_ - LDA #$ff - STA X_end - LDA #$30 - STA Y_end - - -@loop:;; mem f1 - LDA Y_pos_ - STA Y_pos - LDA X_pos_ - STA X_pos - - jsr line - INC Y_end - LDA Y_end - CMP #$50 - BEQ end__ - jmp @loop -end__: - ;;Lets cleer bitmap - B_start = $FCFD - B_end = $FEFF - VIC_bank = $4000 - VIC_bank_end = VIC_bank + $3FFF - ;;Paint the bitmap black. More bitmap: https://www.c64-wiki.com/wiki/53272, https://www.c64-wiki.com/wiki/Screen_RAM#Moving_of_screen_RAM - Mov_16 >B_start, VIC_bank - Mov_16 >B_end, $5f3f - LDA #$00 - jsr memset - - - jmp exit - -.endscope diff --git a/wip-dicander/routines/line/line_up.s b/wip-dicander/routines/line/line_up.s deleted file mode 100644 index 3296bd3..0000000 --- a/wip-dicander/routines/line/line_up.s +++ /dev/null @@ -1,78 +0,0 @@ -;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- - -;;drawing line from 2 cordinates -;;# * (X_end, Y_end) # -;;# # -;;# * # -;;# * # -;;# (X_pos, Y_pos) # -;; -;;NOTE THAT X_pos <= X_end, Y_pos >= Y_end. Max 45deg! - -.proc line_up - ;; Look at line_down for referense - .include "line.inc"; Defines memory positions, ex X_pos - - LDA #$00 - STA V - Mult_16 >V, dy_2, D, dy_2, D, D, dy_2 - STA case_2 +1 - LDA V - STA case_1 +1 - LDA btp_mem_pos, btp_mem_pos), Y - STA (>btp_mem_pos), Y -increment_pixel_x: - LSR byte_to_paint - BCC increment_pixel_x_end -move_8px_left: - Add_16 >btp_mem_pos, D, D, V, #btp_mem_pos, D, dy_2, #) Y_end, X_pos <= X_end. Min 45deg! - -.proc line_up_inv - ;; Look at line_down for referense - .include "line.inc"; Defines memory positions, ex X_pos - - LDA #$00 - STA V - Mult_16 >V, dx_2, D, dx_2, D, D, dx_2 - STA case_2 +1 - LDA V - STA case_1 +1 - LDA btp_mem_pos), Y - STA (>btp_mem_pos), Y -decrement_y_pos: - DEY - CPY #$ff - BNE decrement_y_pos_end -move_8px_up: - LDY #$07 - Sub_16>btp_mem_pos, D, D, V, #btp_mem_pos, D, dx_2, #B_start - Sub_16 >A_start, B_start, #$00 - - ;;Lets move B_start lover-nibble to Y - LDY >B_start - LDA #$00 - STA >B_start -loop: - Lag_16 >B_end, B_start), Y - STA (>A_start), Y - ;Tip save time by counting downward, fast to check if Y ==0 // hugo - INY - TYA - CMP #$ff - BNE loop - ;; Fix overflow - LDY #$00 - INC B_start, $D000 - ;#### TEMP INIT DATA #### - Mov_16 >B_end, ($D000 +$1F3F) - LDA #$10 - STA code - LDA #$10 - STA X_pos - STA Y_pos - - VIC_bank = $4000 - VIC_bank_end = VIC_bank + $3FFF - Mov_16 >A_start, VIC_bank - ;We first need to clear some memory - ;Mov_16 >A_end, >A_end, #<(VIC_bank+100), #>(VIC_bank +100) - LDA #$00 - JSR memcpy - STA B_start ,X) - - Add_16 >B_start, B_start - CMP >B_end - BEQ test - jmp loop -test: - LDA B_start, X) - RTS -.endproc diff --git a/wip-dicander/routines/memory/pixel_draw.s b/wip-dicander/routines/memory/pixel_draw.s deleted file mode 100755 index 2138d70..0000000 --- a/wip-dicander/routines/memory/pixel_draw.s +++ /dev/null @@ -1,83 +0,0 @@ -;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- - -;;Screen print. Draws a pixel at a specified position. -;; Destroys A X Y -.proc pixel_draw; Draws a pixel at [Y = FB , X = FC, FD]. Y = 0 - 320, X= 0 - 200 - .include "mem.inc" - Bitmap = $4000 - Bitmap_end = $5F3F - ;; X = X_pos (mod 8) - LDA >X_pos ; X (mod 8) - AND #%00000111 - TAX - - ;;Store pixel in byte_to_paint - LDA #%10000000 - INX -@shift_btp: ;; check out SMB instruction here! //Hugo - DEX - BEQ end__;X=0 end this - CLC - ROR A - jmp @shift_btp -end__: - STA byte_to_paint - - ;;FIND THE POSITION IN MEMORY TO WRITE PIXEL - ;; + + + + + > X - ;; + - ;; + - ;;\/ - ;; Y - ;; - - ;;pos = x_offset - LDA #%11111000 - AND >X_pos - STA >btp_mem_pos - - LDA C - STA >B - LDA #$00 - STA C, C, C, B, C, C, C, btp_mem_pos, C, btp_mem_pos, Bitmap, ! - - ;;Let draw some stuff - LDA byte_to_paint ;; note that both bytes are used! - ORA (>btp_mem_pos), Y - STA (>btp_mem_pos), Y - RTS -.endproc diff --git a/wip-dicander/routines/text/char_draw.s b/wip-dicander/routines/text/char_draw.s deleted file mode 100644 index 65ed67a..0000000 --- a/wip-dicander/routines/text/char_draw.s +++ /dev/null @@ -1,83 +0,0 @@ -;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- -;; petski: https://www.c64-wiki.com/wiki/File:ASCII-Codes.gif -;;https://www.c64-wiki.com/wiki/Character_set -;; Takes in a PETSKI-code in CODE -;; And prints it ON X_pos, Y_pos -;; Note that this is the real positions divided by 8 -.proc char_draw - Character_generator_ROM = $D000 - Y_pos_offset = $F9F8 ;Reuses from Y_pos - X_pos_offset = $FAF7 - X_pos = $FA - Y_pos = $F9 - charset = $FB - code = $FE - petski_position = $FEFF ;reuses code:s memory - screen_position = $FCFD - - ;#### TEMP INIT DATA #### - LDA #$10 - STA code - LDA #04 - STA X_pos - LDA #02 - STA Y_pos - - ;;Do arithimatic to know where to read and write bytes. - initial: - ;We first need to clear some memory - LDA #$00 - STA petski_position, petski_position, petski_position, Character_generator_ROM, ! - - ;;Calculate screen_position to use - Mov_16 >screen_position, VIC_bank - - ;; Add the X_pos has a offset multiplier of *8 because 1 chunk = 8 addresses - ;; *8 - Mult_16 >X_pos_offset, X_pos_offset, X_pos_offset, screen_position, Y_pos_offset, Y_pos_offset, Y_pos_offset, Y_pos_offset, Y_pos_offset, Y_pos_offset, Y_pos_offset, Y_pos_offset, Y_pos_offset, screen_position, Y_pos_offset, petski_position), Y - STA (>screen_position), Y - DEY - BNE @loop - LDA (>petski_position), Y - STA (>screen_position), Y - RTS -.endproc diff --git a/wip-dicander/run.sh b/wip-dicander/run.sh deleted file mode 100755 index fe7c135..0000000 --- a/wip-dicander/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -# !/bin/bash -killall x64sc - -#Note that program start at $080D -cl65 -o file.prg -u __EXEHDR__ -t c64 -C c64-asm.cfg -l file.list source.s \ -&& nohup flatpak run net.sf.VICE -windowypos 0 -windowxpos 960 -windowwidth 945 -windowheight 720 file.prg /dev/null & - -sleep 2 -rm source.o -rm file.prg diff --git a/wip-dicander/source.s b/wip-dicander/source.s deleted file mode 100755 index 19073bc..0000000 --- a/wip-dicander/source.s +++ /dev/null @@ -1,67 +0,0 @@ -;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- -.debuginfo + ; Generate debug info -;;Macros -.include "macros/16bitarithmetic.s" -;;inc files -.include "routines/memory/mem.inc" -;;Code to run -.include "STARTUP.s" -;.include "routines/line/line_test_time.s" -;;.include "routines/memory/memcpy_test.s" -;.include "fillscreen.s" -;Hacky hardcoding. I pick FC and FD to contain the 16 bit offset to the screen -LDA #$40 ;Remember kids, C64 is a little endian computer. Why, why why! Big endian makes more sense! -STA $FD ;THis means that the bitmap starts at $4000 -LDA #$00 -LDX #$60 -STA $FC - -mainloop: -;fill screen with white pixels -LDY #$00 -LDA #%10000000 ; Start out with setting the leftmost pixel to white in every byte in the bitmap -STA $FF ;$FF contains the pattern we are writing to part if the bitmap memory -STA $FE ;$FE conatins the most recent bit/pixel we are adding -;The idea is now to bitshift this to the right, until A is 0. When this happens it is time to update which byte we are working on -pixel_setting_loop: -LDA $FF -STA ($FC),Y -LDA $FE ;FE contains the most recent bit/pixel we are adding -LSR a -BNE more_pixels_in_byte -INC $FC -; if this overflows -BNE not_incrementing_other_byte -INC $FD -CPX $FD -; if the carry flag is zero, branch -BCC done_pixels -not_incrementing_other_byte: -LDA #%10000000 -STA $FE -STA $FF -more_pixels_in_byte: -STA $FE ;$FE conatins the most recent bit/pixel we are adding -ORA $FF ;Add the previous pixels. -STA $FF -JMP pixel_setting_loop -done_pixels: -;check is somebody has pressed space and if so exit, code blatantly stolen from Duuqnd -LDX #%01111111 -LDY #%00010000 -LDA #$ff -STA $DC02 -LDA #$00 -STA $DC03 -STX $DC00 -TYA -AND $DC01 -;Check if A is 0 -BEQ die -jmp mainloop -die: -;.include "routines/line/line.s" -;.include "routines/memory/pixel_draw.s" -.include "routines/memory/memset.s" -;.include "routines/memory/memcpy.s" - -- 2.39.5 From a206de10071d3ab2e3aeaafb31d88c885d395d3a Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 12:34:21 +0200 Subject: [PATCH 02/23] Move editor into repo root --- {wip-duuqnd/editor => editor}/binary-build.lisp | 0 {wip-duuqnd/editor => editor}/editor.asd | 0 {wip-duuqnd/editor => editor}/editor.lisp | 0 {wip-duuqnd/editor => editor}/package.lisp | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {wip-duuqnd/editor => editor}/binary-build.lisp (100%) rename {wip-duuqnd/editor => editor}/editor.asd (100%) rename {wip-duuqnd/editor => editor}/editor.lisp (100%) rename {wip-duuqnd/editor => editor}/package.lisp (100%) diff --git a/wip-duuqnd/editor/binary-build.lisp b/editor/binary-build.lisp similarity index 100% rename from wip-duuqnd/editor/binary-build.lisp rename to editor/binary-build.lisp diff --git a/wip-duuqnd/editor/editor.asd b/editor/editor.asd similarity index 100% rename from wip-duuqnd/editor/editor.asd rename to editor/editor.asd diff --git a/wip-duuqnd/editor/editor.lisp b/editor/editor.lisp similarity index 100% rename from wip-duuqnd/editor/editor.lisp rename to editor/editor.lisp diff --git a/wip-duuqnd/editor/package.lisp b/editor/package.lisp similarity index 100% rename from wip-duuqnd/editor/package.lisp rename to editor/package.lisp -- 2.39.5 From e00474bc980ef1e665063f774d5baa2b6508b74a Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 12:34:53 +0200 Subject: [PATCH 03/23] Move user-side compiler into repo root --- .../asm-function.lisp | 0 .../backend/code-generator.lisp | 0 .../backend/pre-assembly.lisp | 0 .../backend/value-allocator.lisp | 0 .../binary-test-build.lisp | 0 .../bytesquash.lisp | 0 .../error-handling.lisp | 0 .../high-level.lisp | 0 .../instruction-list.txt | Bin .../instruction.lisp | 0 .../interface.lisp | 0 .../label.lisp | 0 .../middle/compile-node-to-ir.lisp | 0 .../middle/data.lisp | 0 .../middle/graph-manipulation.lisp | 0 .../middle/instructions.lisp | 0 .../middle/jigs.lisp | 0 .../middle/optimizations.lisp | 0 .../middle/structure.lisp | 0 .../package.lisp | 0 .../parser.lisp | 0 .../populate-asm-functions.lisp | 0 .../reference.lisp | 0 .../s-print.lisp | 0 .../symbol-table.lisp | 0 .../tests/example-0.c6l | 0 .../tests/example-1.c6l | 0 .../tests/example-2.c6l | 0 .../tests/example-3.c6l | 0 .../tests/example-4.c6l | 0 .../tests/example-5.c6l | 0 .../tests/example-6.c6l | 0 .../tests/invalid-exprs-1.c6l | 0 .../tests/package.lisp | 0 .../tests/syntax-error-1.c6l | 0 .../tests/syntax-error-2.c6l | 0 .../tests/syntax-error-3.c6l | 0 .../tests/syntax-error-4.c6l | 0 .../tests/syntax-error-5.c6l | 0 .../tests/unit-tests.lisp | 0 .../tokenizer.lisp | 0 .../toolkit.lisp | 0 .../transform.lisp | 0 .../user-side-compiler.asd | 0 44 files changed, 0 insertions(+), 0 deletions(-) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/asm-function.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/backend/code-generator.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/backend/pre-assembly.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/backend/value-allocator.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/binary-test-build.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/bytesquash.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/error-handling.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/high-level.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/instruction-list.txt (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/instruction.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/interface.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/label.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/middle/compile-node-to-ir.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/middle/data.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/middle/graph-manipulation.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/middle/instructions.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/middle/jigs.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/middle/optimizations.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/middle/structure.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/package.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/parser.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/populate-asm-functions.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/reference.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/s-print.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/symbol-table.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/example-0.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/example-1.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/example-2.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/example-3.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/example-4.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/example-5.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/example-6.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/invalid-exprs-1.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/package.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/syntax-error-1.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/syntax-error-2.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/syntax-error-3.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/syntax-error-4.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/syntax-error-5.c6l (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tests/unit-tests.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/tokenizer.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/toolkit.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/transform.lisp (100%) rename {wip-duuqnd/user-side-compiler => user-side-compiler}/user-side-compiler.asd (100%) diff --git a/wip-duuqnd/user-side-compiler/asm-function.lisp b/user-side-compiler/asm-function.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/asm-function.lisp rename to user-side-compiler/asm-function.lisp diff --git a/wip-duuqnd/user-side-compiler/backend/code-generator.lisp b/user-side-compiler/backend/code-generator.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/backend/code-generator.lisp rename to user-side-compiler/backend/code-generator.lisp diff --git a/wip-duuqnd/user-side-compiler/backend/pre-assembly.lisp b/user-side-compiler/backend/pre-assembly.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/backend/pre-assembly.lisp rename to user-side-compiler/backend/pre-assembly.lisp diff --git a/wip-duuqnd/user-side-compiler/backend/value-allocator.lisp b/user-side-compiler/backend/value-allocator.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/backend/value-allocator.lisp rename to user-side-compiler/backend/value-allocator.lisp diff --git a/wip-duuqnd/user-side-compiler/binary-test-build.lisp b/user-side-compiler/binary-test-build.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/binary-test-build.lisp rename to user-side-compiler/binary-test-build.lisp diff --git a/wip-duuqnd/user-side-compiler/bytesquash.lisp b/user-side-compiler/bytesquash.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/bytesquash.lisp rename to user-side-compiler/bytesquash.lisp diff --git a/wip-duuqnd/user-side-compiler/error-handling.lisp b/user-side-compiler/error-handling.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/error-handling.lisp rename to user-side-compiler/error-handling.lisp diff --git a/wip-duuqnd/user-side-compiler/high-level.lisp b/user-side-compiler/high-level.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/high-level.lisp rename to user-side-compiler/high-level.lisp diff --git a/wip-duuqnd/user-side-compiler/instruction-list.txt b/user-side-compiler/instruction-list.txt similarity index 100% rename from wip-duuqnd/user-side-compiler/instruction-list.txt rename to user-side-compiler/instruction-list.txt diff --git a/wip-duuqnd/user-side-compiler/instruction.lisp b/user-side-compiler/instruction.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/instruction.lisp rename to user-side-compiler/instruction.lisp diff --git a/wip-duuqnd/user-side-compiler/interface.lisp b/user-side-compiler/interface.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/interface.lisp rename to user-side-compiler/interface.lisp diff --git a/wip-duuqnd/user-side-compiler/label.lisp b/user-side-compiler/label.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/label.lisp rename to user-side-compiler/label.lisp diff --git a/wip-duuqnd/user-side-compiler/middle/compile-node-to-ir.lisp b/user-side-compiler/middle/compile-node-to-ir.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/middle/compile-node-to-ir.lisp rename to user-side-compiler/middle/compile-node-to-ir.lisp diff --git a/wip-duuqnd/user-side-compiler/middle/data.lisp b/user-side-compiler/middle/data.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/middle/data.lisp rename to user-side-compiler/middle/data.lisp diff --git a/wip-duuqnd/user-side-compiler/middle/graph-manipulation.lisp b/user-side-compiler/middle/graph-manipulation.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/middle/graph-manipulation.lisp rename to user-side-compiler/middle/graph-manipulation.lisp diff --git a/wip-duuqnd/user-side-compiler/middle/instructions.lisp b/user-side-compiler/middle/instructions.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/middle/instructions.lisp rename to user-side-compiler/middle/instructions.lisp diff --git a/wip-duuqnd/user-side-compiler/middle/jigs.lisp b/user-side-compiler/middle/jigs.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/middle/jigs.lisp rename to user-side-compiler/middle/jigs.lisp diff --git a/wip-duuqnd/user-side-compiler/middle/optimizations.lisp b/user-side-compiler/middle/optimizations.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/middle/optimizations.lisp rename to user-side-compiler/middle/optimizations.lisp diff --git a/wip-duuqnd/user-side-compiler/middle/structure.lisp b/user-side-compiler/middle/structure.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/middle/structure.lisp rename to user-side-compiler/middle/structure.lisp diff --git a/wip-duuqnd/user-side-compiler/package.lisp b/user-side-compiler/package.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/package.lisp rename to user-side-compiler/package.lisp diff --git a/wip-duuqnd/user-side-compiler/parser.lisp b/user-side-compiler/parser.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/parser.lisp rename to user-side-compiler/parser.lisp diff --git a/wip-duuqnd/user-side-compiler/populate-asm-functions.lisp b/user-side-compiler/populate-asm-functions.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/populate-asm-functions.lisp rename to user-side-compiler/populate-asm-functions.lisp diff --git a/wip-duuqnd/user-side-compiler/reference.lisp b/user-side-compiler/reference.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/reference.lisp rename to user-side-compiler/reference.lisp diff --git a/wip-duuqnd/user-side-compiler/s-print.lisp b/user-side-compiler/s-print.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/s-print.lisp rename to user-side-compiler/s-print.lisp diff --git a/wip-duuqnd/user-side-compiler/symbol-table.lisp b/user-side-compiler/symbol-table.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/symbol-table.lisp rename to user-side-compiler/symbol-table.lisp diff --git a/wip-duuqnd/user-side-compiler/tests/example-0.c6l b/user-side-compiler/tests/example-0.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/example-0.c6l rename to user-side-compiler/tests/example-0.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/example-1.c6l b/user-side-compiler/tests/example-1.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/example-1.c6l rename to user-side-compiler/tests/example-1.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/example-2.c6l b/user-side-compiler/tests/example-2.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/example-2.c6l rename to user-side-compiler/tests/example-2.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/example-3.c6l b/user-side-compiler/tests/example-3.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/example-3.c6l rename to user-side-compiler/tests/example-3.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/example-4.c6l b/user-side-compiler/tests/example-4.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/example-4.c6l rename to user-side-compiler/tests/example-4.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/example-5.c6l b/user-side-compiler/tests/example-5.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/example-5.c6l rename to user-side-compiler/tests/example-5.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/example-6.c6l b/user-side-compiler/tests/example-6.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/example-6.c6l rename to user-side-compiler/tests/example-6.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/invalid-exprs-1.c6l b/user-side-compiler/tests/invalid-exprs-1.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/invalid-exprs-1.c6l rename to user-side-compiler/tests/invalid-exprs-1.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/package.lisp b/user-side-compiler/tests/package.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/package.lisp rename to user-side-compiler/tests/package.lisp diff --git a/wip-duuqnd/user-side-compiler/tests/syntax-error-1.c6l b/user-side-compiler/tests/syntax-error-1.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/syntax-error-1.c6l rename to user-side-compiler/tests/syntax-error-1.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/syntax-error-2.c6l b/user-side-compiler/tests/syntax-error-2.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/syntax-error-2.c6l rename to user-side-compiler/tests/syntax-error-2.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/syntax-error-3.c6l b/user-side-compiler/tests/syntax-error-3.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/syntax-error-3.c6l rename to user-side-compiler/tests/syntax-error-3.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/syntax-error-4.c6l b/user-side-compiler/tests/syntax-error-4.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/syntax-error-4.c6l rename to user-side-compiler/tests/syntax-error-4.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/syntax-error-5.c6l b/user-side-compiler/tests/syntax-error-5.c6l similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/syntax-error-5.c6l rename to user-side-compiler/tests/syntax-error-5.c6l diff --git a/wip-duuqnd/user-side-compiler/tests/unit-tests.lisp b/user-side-compiler/tests/unit-tests.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/tests/unit-tests.lisp rename to user-side-compiler/tests/unit-tests.lisp diff --git a/wip-duuqnd/user-side-compiler/tokenizer.lisp b/user-side-compiler/tokenizer.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/tokenizer.lisp rename to user-side-compiler/tokenizer.lisp diff --git a/wip-duuqnd/user-side-compiler/toolkit.lisp b/user-side-compiler/toolkit.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/toolkit.lisp rename to user-side-compiler/toolkit.lisp diff --git a/wip-duuqnd/user-side-compiler/transform.lisp b/user-side-compiler/transform.lisp similarity index 100% rename from wip-duuqnd/user-side-compiler/transform.lisp rename to user-side-compiler/transform.lisp diff --git a/wip-duuqnd/user-side-compiler/user-side-compiler.asd b/user-side-compiler/user-side-compiler.asd similarity index 100% rename from wip-duuqnd/user-side-compiler/user-side-compiler.asd rename to user-side-compiler/user-side-compiler.asd -- 2.39.5 From c0dc98a2c9fdf1b39392b54321adaa9064ac3142 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 13:20:29 +0200 Subject: [PATCH 04/23] Move wip-hugo stuff into "host" (to be sorted) --- {wip-hugo => host}/END.s | 0 {wip-hugo => host}/README.md | 0 {wip-hugo => host}/STARTUP.s | 0 {wip-hugo => host}/build.sh | 0 {wip-hugo => host}/build/new.labels.labels | 0 {wip-hugo => host}/build/program.lbl | 0 {wip-hugo => host}/dubbel_buffer/raster_irqs.s | 0 {wip-hugo => host}/macros/16aritmatic.s | 0 {wip-hugo => host}/macros/timer.s | 0 {wip-hugo => host}/program.lbl | 0 {wip-hugo => host}/retrodebugger_label_build_tool/end_file | 0 .../retrodebugger_label_build_tool/rdb_build_label.sh | 0 {wip-hugo => host}/retrodebugger_label_build_tool/start_file | 0 {wip-hugo => host}/retrodebugger_label_build_tool/temp_file | 0 {wip-hugo => host}/routines/arithmatic/arithmatic.inc | 0 {wip-hugo => host}/routines/arithmatic/div.s | 0 {wip-hugo => host}/routines/arithmatic/div_test.s | 0 {wip-hugo => host}/routines/arithmatic/mult.s | 0 {wip-hugo => host}/routines/arithmatic/mult_test.s | 0 {wip-hugo => host}/routines/circle/circle.inc | 0 {wip-hugo => host}/routines/circle/circle.s | 0 {wip-hugo => host}/routines/circle/circle_test.s | 0 {wip-hugo => host}/routines/circle/circle_test_position.s | 0 {wip-hugo => host}/routines/circle/circle_test_size.s | 0 {wip-hugo => host}/routines/line/line.inc | 0 {wip-hugo => host}/routines/line/line.s | 0 {wip-hugo => host}/routines/line/line_down.s | 0 {wip-hugo => host}/routines/line/line_down_inv.s | 0 {wip-hugo => host}/routines/line/line_test.s | 0 {wip-hugo => host}/routines/line/line_test_extensive.s | 0 {wip-hugo => host}/routines/line/line_up.s | 0 {wip-hugo => host}/routines/line/line_up_inv.s | 0 {wip-hugo => host}/routines/memory/mem.inc | 0 {wip-hugo => host}/routines/memory/memcpy.s | 0 {wip-hugo => host}/routines/memory/memcpy_test.s | 0 {wip-hugo => host}/routines/memory/memset.s | 0 {wip-hugo => host}/routines/memory/memset_alt.s | 0 {wip-hugo => host}/routines/memory/memset_test.s | 0 {wip-hugo => host}/routines/pixel/pixel.inc | 0 {wip-hugo => host}/routines/pixel/pixel_calc.s | 0 {wip-hugo => host}/routines/pixel/pixel_draw.s | 0 {wip-hugo => host}/routines/pixel/pixel_test.s | 0 {wip-hugo => host}/routines/text/char.inc | 0 {wip-hugo => host}/routines/text/char_draw.s | 0 {wip-hugo => host}/routines/text/char_draw_test.s | 0 {wip-hugo => host}/routines/triangle/lower_triangle.s | 0 {wip-hugo => host}/routines/triangle/triangle.inc | 0 {wip-hugo => host}/routines/triangle/triangle.s | 0 {wip-hugo => host}/routines/triangle/triangle_test.s | 0 {wip-hugo => host}/routines/triangle/upper_triangle.s | 0 {wip-hugo => host}/run.sh | 0 {wip-hugo => host}/run_retro_debugger.sh | 0 {wip-hugo => host}/source.s | 0 53 files changed, 0 insertions(+), 0 deletions(-) rename {wip-hugo => host}/END.s (100%) rename {wip-hugo => host}/README.md (100%) rename {wip-hugo => host}/STARTUP.s (100%) rename {wip-hugo => host}/build.sh (100%) rename {wip-hugo => host}/build/new.labels.labels (100%) rename {wip-hugo => host}/build/program.lbl (100%) rename {wip-hugo => host}/dubbel_buffer/raster_irqs.s (100%) rename {wip-hugo => host}/macros/16aritmatic.s (100%) rename {wip-hugo => host}/macros/timer.s (100%) rename {wip-hugo => host}/program.lbl (100%) rename {wip-hugo => host}/retrodebugger_label_build_tool/end_file (100%) rename {wip-hugo => host}/retrodebugger_label_build_tool/rdb_build_label.sh (100%) rename {wip-hugo => host}/retrodebugger_label_build_tool/start_file (100%) rename {wip-hugo => host}/retrodebugger_label_build_tool/temp_file (100%) rename {wip-hugo => host}/routines/arithmatic/arithmatic.inc (100%) rename {wip-hugo => host}/routines/arithmatic/div.s (100%) rename {wip-hugo => host}/routines/arithmatic/div_test.s (100%) rename {wip-hugo => host}/routines/arithmatic/mult.s (100%) rename {wip-hugo => host}/routines/arithmatic/mult_test.s (100%) rename {wip-hugo => host}/routines/circle/circle.inc (100%) rename {wip-hugo => host}/routines/circle/circle.s (100%) rename {wip-hugo => host}/routines/circle/circle_test.s (100%) rename {wip-hugo => host}/routines/circle/circle_test_position.s (100%) rename {wip-hugo => host}/routines/circle/circle_test_size.s (100%) rename {wip-hugo => host}/routines/line/line.inc (100%) rename {wip-hugo => host}/routines/line/line.s (100%) rename {wip-hugo => host}/routines/line/line_down.s (100%) rename {wip-hugo => host}/routines/line/line_down_inv.s (100%) rename {wip-hugo => host}/routines/line/line_test.s (100%) rename {wip-hugo => host}/routines/line/line_test_extensive.s (100%) rename {wip-hugo => host}/routines/line/line_up.s (100%) rename {wip-hugo => host}/routines/line/line_up_inv.s (100%) rename {wip-hugo => host}/routines/memory/mem.inc (100%) rename {wip-hugo => host}/routines/memory/memcpy.s (100%) rename {wip-hugo => host}/routines/memory/memcpy_test.s (100%) rename {wip-hugo => host}/routines/memory/memset.s (100%) rename {wip-hugo => host}/routines/memory/memset_alt.s (100%) rename {wip-hugo => host}/routines/memory/memset_test.s (100%) rename {wip-hugo => host}/routines/pixel/pixel.inc (100%) rename {wip-hugo => host}/routines/pixel/pixel_calc.s (100%) rename {wip-hugo => host}/routines/pixel/pixel_draw.s (100%) rename {wip-hugo => host}/routines/pixel/pixel_test.s (100%) rename {wip-hugo => host}/routines/text/char.inc (100%) rename {wip-hugo => host}/routines/text/char_draw.s (100%) rename {wip-hugo => host}/routines/text/char_draw_test.s (100%) rename {wip-hugo => host}/routines/triangle/lower_triangle.s (100%) rename {wip-hugo => host}/routines/triangle/triangle.inc (100%) rename {wip-hugo => host}/routines/triangle/triangle.s (100%) rename {wip-hugo => host}/routines/triangle/triangle_test.s (100%) rename {wip-hugo => host}/routines/triangle/upper_triangle.s (100%) rename {wip-hugo => host}/run.sh (100%) rename {wip-hugo => host}/run_retro_debugger.sh (100%) rename {wip-hugo => host}/source.s (100%) diff --git a/wip-hugo/END.s b/host/END.s similarity index 100% rename from wip-hugo/END.s rename to host/END.s diff --git a/wip-hugo/README.md b/host/README.md similarity index 100% rename from wip-hugo/README.md rename to host/README.md diff --git a/wip-hugo/STARTUP.s b/host/STARTUP.s similarity index 100% rename from wip-hugo/STARTUP.s rename to host/STARTUP.s diff --git a/wip-hugo/build.sh b/host/build.sh similarity index 100% rename from wip-hugo/build.sh rename to host/build.sh diff --git a/wip-hugo/build/new.labels.labels b/host/build/new.labels.labels similarity index 100% rename from wip-hugo/build/new.labels.labels rename to host/build/new.labels.labels diff --git a/wip-hugo/build/program.lbl b/host/build/program.lbl similarity index 100% rename from wip-hugo/build/program.lbl rename to host/build/program.lbl diff --git a/wip-hugo/dubbel_buffer/raster_irqs.s b/host/dubbel_buffer/raster_irqs.s similarity index 100% rename from wip-hugo/dubbel_buffer/raster_irqs.s rename to host/dubbel_buffer/raster_irqs.s diff --git a/wip-hugo/macros/16aritmatic.s b/host/macros/16aritmatic.s similarity index 100% rename from wip-hugo/macros/16aritmatic.s rename to host/macros/16aritmatic.s diff --git a/wip-hugo/macros/timer.s b/host/macros/timer.s similarity index 100% rename from wip-hugo/macros/timer.s rename to host/macros/timer.s diff --git a/wip-hugo/program.lbl b/host/program.lbl similarity index 100% rename from wip-hugo/program.lbl rename to host/program.lbl diff --git a/wip-hugo/retrodebugger_label_build_tool/end_file b/host/retrodebugger_label_build_tool/end_file similarity index 100% rename from wip-hugo/retrodebugger_label_build_tool/end_file rename to host/retrodebugger_label_build_tool/end_file diff --git a/wip-hugo/retrodebugger_label_build_tool/rdb_build_label.sh b/host/retrodebugger_label_build_tool/rdb_build_label.sh similarity index 100% rename from wip-hugo/retrodebugger_label_build_tool/rdb_build_label.sh rename to host/retrodebugger_label_build_tool/rdb_build_label.sh diff --git a/wip-hugo/retrodebugger_label_build_tool/start_file b/host/retrodebugger_label_build_tool/start_file similarity index 100% rename from wip-hugo/retrodebugger_label_build_tool/start_file rename to host/retrodebugger_label_build_tool/start_file diff --git a/wip-hugo/retrodebugger_label_build_tool/temp_file b/host/retrodebugger_label_build_tool/temp_file similarity index 100% rename from wip-hugo/retrodebugger_label_build_tool/temp_file rename to host/retrodebugger_label_build_tool/temp_file diff --git a/wip-hugo/routines/arithmatic/arithmatic.inc b/host/routines/arithmatic/arithmatic.inc similarity index 100% rename from wip-hugo/routines/arithmatic/arithmatic.inc rename to host/routines/arithmatic/arithmatic.inc diff --git a/wip-hugo/routines/arithmatic/div.s b/host/routines/arithmatic/div.s similarity index 100% rename from wip-hugo/routines/arithmatic/div.s rename to host/routines/arithmatic/div.s diff --git a/wip-hugo/routines/arithmatic/div_test.s b/host/routines/arithmatic/div_test.s similarity index 100% rename from wip-hugo/routines/arithmatic/div_test.s rename to host/routines/arithmatic/div_test.s diff --git a/wip-hugo/routines/arithmatic/mult.s b/host/routines/arithmatic/mult.s similarity index 100% rename from wip-hugo/routines/arithmatic/mult.s rename to host/routines/arithmatic/mult.s diff --git a/wip-hugo/routines/arithmatic/mult_test.s b/host/routines/arithmatic/mult_test.s similarity index 100% rename from wip-hugo/routines/arithmatic/mult_test.s rename to host/routines/arithmatic/mult_test.s diff --git a/wip-hugo/routines/circle/circle.inc b/host/routines/circle/circle.inc similarity index 100% rename from wip-hugo/routines/circle/circle.inc rename to host/routines/circle/circle.inc diff --git a/wip-hugo/routines/circle/circle.s b/host/routines/circle/circle.s similarity index 100% rename from wip-hugo/routines/circle/circle.s rename to host/routines/circle/circle.s diff --git a/wip-hugo/routines/circle/circle_test.s b/host/routines/circle/circle_test.s similarity index 100% rename from wip-hugo/routines/circle/circle_test.s rename to host/routines/circle/circle_test.s diff --git a/wip-hugo/routines/circle/circle_test_position.s b/host/routines/circle/circle_test_position.s similarity index 100% rename from wip-hugo/routines/circle/circle_test_position.s rename to host/routines/circle/circle_test_position.s diff --git a/wip-hugo/routines/circle/circle_test_size.s b/host/routines/circle/circle_test_size.s similarity index 100% rename from wip-hugo/routines/circle/circle_test_size.s rename to host/routines/circle/circle_test_size.s diff --git a/wip-hugo/routines/line/line.inc b/host/routines/line/line.inc similarity index 100% rename from wip-hugo/routines/line/line.inc rename to host/routines/line/line.inc diff --git a/wip-hugo/routines/line/line.s b/host/routines/line/line.s similarity index 100% rename from wip-hugo/routines/line/line.s rename to host/routines/line/line.s diff --git a/wip-hugo/routines/line/line_down.s b/host/routines/line/line_down.s similarity index 100% rename from wip-hugo/routines/line/line_down.s rename to host/routines/line/line_down.s diff --git a/wip-hugo/routines/line/line_down_inv.s b/host/routines/line/line_down_inv.s similarity index 100% rename from wip-hugo/routines/line/line_down_inv.s rename to host/routines/line/line_down_inv.s diff --git a/wip-hugo/routines/line/line_test.s b/host/routines/line/line_test.s similarity index 100% rename from wip-hugo/routines/line/line_test.s rename to host/routines/line/line_test.s diff --git a/wip-hugo/routines/line/line_test_extensive.s b/host/routines/line/line_test_extensive.s similarity index 100% rename from wip-hugo/routines/line/line_test_extensive.s rename to host/routines/line/line_test_extensive.s diff --git a/wip-hugo/routines/line/line_up.s b/host/routines/line/line_up.s similarity index 100% rename from wip-hugo/routines/line/line_up.s rename to host/routines/line/line_up.s diff --git a/wip-hugo/routines/line/line_up_inv.s b/host/routines/line/line_up_inv.s similarity index 100% rename from wip-hugo/routines/line/line_up_inv.s rename to host/routines/line/line_up_inv.s diff --git a/wip-hugo/routines/memory/mem.inc b/host/routines/memory/mem.inc similarity index 100% rename from wip-hugo/routines/memory/mem.inc rename to host/routines/memory/mem.inc diff --git a/wip-hugo/routines/memory/memcpy.s b/host/routines/memory/memcpy.s similarity index 100% rename from wip-hugo/routines/memory/memcpy.s rename to host/routines/memory/memcpy.s diff --git a/wip-hugo/routines/memory/memcpy_test.s b/host/routines/memory/memcpy_test.s similarity index 100% rename from wip-hugo/routines/memory/memcpy_test.s rename to host/routines/memory/memcpy_test.s diff --git a/wip-hugo/routines/memory/memset.s b/host/routines/memory/memset.s similarity index 100% rename from wip-hugo/routines/memory/memset.s rename to host/routines/memory/memset.s diff --git a/wip-hugo/routines/memory/memset_alt.s b/host/routines/memory/memset_alt.s similarity index 100% rename from wip-hugo/routines/memory/memset_alt.s rename to host/routines/memory/memset_alt.s diff --git a/wip-hugo/routines/memory/memset_test.s b/host/routines/memory/memset_test.s similarity index 100% rename from wip-hugo/routines/memory/memset_test.s rename to host/routines/memory/memset_test.s diff --git a/wip-hugo/routines/pixel/pixel.inc b/host/routines/pixel/pixel.inc similarity index 100% rename from wip-hugo/routines/pixel/pixel.inc rename to host/routines/pixel/pixel.inc diff --git a/wip-hugo/routines/pixel/pixel_calc.s b/host/routines/pixel/pixel_calc.s similarity index 100% rename from wip-hugo/routines/pixel/pixel_calc.s rename to host/routines/pixel/pixel_calc.s diff --git a/wip-hugo/routines/pixel/pixel_draw.s b/host/routines/pixel/pixel_draw.s similarity index 100% rename from wip-hugo/routines/pixel/pixel_draw.s rename to host/routines/pixel/pixel_draw.s diff --git a/wip-hugo/routines/pixel/pixel_test.s b/host/routines/pixel/pixel_test.s similarity index 100% rename from wip-hugo/routines/pixel/pixel_test.s rename to host/routines/pixel/pixel_test.s diff --git a/wip-hugo/routines/text/char.inc b/host/routines/text/char.inc similarity index 100% rename from wip-hugo/routines/text/char.inc rename to host/routines/text/char.inc diff --git a/wip-hugo/routines/text/char_draw.s b/host/routines/text/char_draw.s similarity index 100% rename from wip-hugo/routines/text/char_draw.s rename to host/routines/text/char_draw.s diff --git a/wip-hugo/routines/text/char_draw_test.s b/host/routines/text/char_draw_test.s similarity index 100% rename from wip-hugo/routines/text/char_draw_test.s rename to host/routines/text/char_draw_test.s diff --git a/wip-hugo/routines/triangle/lower_triangle.s b/host/routines/triangle/lower_triangle.s similarity index 100% rename from wip-hugo/routines/triangle/lower_triangle.s rename to host/routines/triangle/lower_triangle.s diff --git a/wip-hugo/routines/triangle/triangle.inc b/host/routines/triangle/triangle.inc similarity index 100% rename from wip-hugo/routines/triangle/triangle.inc rename to host/routines/triangle/triangle.inc diff --git a/wip-hugo/routines/triangle/triangle.s b/host/routines/triangle/triangle.s similarity index 100% rename from wip-hugo/routines/triangle/triangle.s rename to host/routines/triangle/triangle.s diff --git a/wip-hugo/routines/triangle/triangle_test.s b/host/routines/triangle/triangle_test.s similarity index 100% rename from wip-hugo/routines/triangle/triangle_test.s rename to host/routines/triangle/triangle_test.s diff --git a/wip-hugo/routines/triangle/upper_triangle.s b/host/routines/triangle/upper_triangle.s similarity index 100% rename from wip-hugo/routines/triangle/upper_triangle.s rename to host/routines/triangle/upper_triangle.s diff --git a/wip-hugo/run.sh b/host/run.sh similarity index 100% rename from wip-hugo/run.sh rename to host/run.sh diff --git a/wip-hugo/run_retro_debugger.sh b/host/run_retro_debugger.sh similarity index 100% rename from wip-hugo/run_retro_debugger.sh rename to host/run_retro_debugger.sh diff --git a/wip-hugo/source.s b/host/source.s similarity index 100% rename from wip-hugo/source.s rename to host/source.s -- 2.39.5 From bf2e6f8035610050cb4c6302a31d7cfcf0757fe3 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 13:22:09 +0200 Subject: [PATCH 05/23] Move public.inc to host --- {wip-duuqnd => host}/public.inc | 0 host/source.s | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename {wip-duuqnd => host}/public.inc (100%) diff --git a/wip-duuqnd/public.inc b/host/public.inc similarity index 100% rename from wip-duuqnd/public.inc rename to host/public.inc diff --git a/host/source.s b/host/source.s index 9c0bfd3..b949b61 100644 --- a/host/source.s +++ b/host/source.s @@ -26,7 +26,7 @@ ;.include "routines/triangle/triangle_test.s" exit: JMP exit -.include "../wip-duuqnd/public.inc" +.include "public.inc" .include "routines/line/line.s" .include "routines/circle/circle.s" .include "routines/triangle/triangle.s" -- 2.39.5 From 36c8d5238887d7acb09040adfaf51aef4f89f637 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 15:28:29 +0200 Subject: [PATCH 06/23] Add origin address to host program --- host/source.s | 1 + 1 file changed, 1 insertion(+) diff --git a/host/source.s b/host/source.s index b949b61..50a9093 100644 --- a/host/source.s +++ b/host/source.s @@ -3,6 +3,7 @@ ;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- .debuginfo + ; Generate debug info +.org $080D ;;Macros .include "macros/16aritmatic.s" ;;inc files -- 2.39.5 From a32dea0a11e1b5608557b21b816de7380c169657 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 15:28:44 +0200 Subject: [PATCH 07/23] Include batch compiler user program into host program --- host/source.s | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/host/source.s b/host/source.s index 50a9093..d545d0b 100644 --- a/host/source.s +++ b/host/source.s @@ -38,4 +38,8 @@ JMP exit .include "routines/memory/memcpy.s" .include "routines/arithmatic/mult.s" .include "routines/arithmatic/div.s" + +batch_userprog: +.incbin "userprog.bin", 0, 1024 + .include "END.s" -- 2.39.5 From ec867b25d3d0880ef4469ce8e98af0ddcb0dcf23 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 15:28:55 +0200 Subject: [PATCH 08/23] Correct ARGVEC and VARVEC offsets in code generator --- user-side-compiler/backend/code-generator.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user-side-compiler/backend/code-generator.lisp b/user-side-compiler/backend/code-generator.lisp index 8b0aca2..13d6547 100644 --- a/user-side-compiler/backend/code-generator.lisp +++ b/user-side-compiler/backend/code-generator.lisp @@ -50,8 +50,8 @@ ;; TODO: Handle case of too many arguments (? not realistically needed) t) -(defparameter +argvec-offset+ #x00) -(defparameter +varvec-offset+ #x08) +(defparameter +argvec-offset+ #xF0) +(defparameter +varvec-offset+ #x20) (defmacro with-variable-allocations (allocations &body body) `(let ((*variable-allocations* (make-hash-table))) -- 2.39.5 From 2206b1f8641d195a4d562f605f8ea17130a19269 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 15:29:08 +0200 Subject: [PATCH 09/23] Correct paths to host program listing and build script in USC --- user-side-compiler/populate-asm-functions.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user-side-compiler/populate-asm-functions.lisp b/user-side-compiler/populate-asm-functions.lisp index 6ad339a..83d9dae 100644 --- a/user-side-compiler/populate-asm-functions.lisp +++ b/user-side-compiler/populate-asm-functions.lisp @@ -68,8 +68,8 @@ (parse-asm-declaration main-text) (list name address declaration))))) -(defparameter *program-listing-filepath* #P"../../wip-hugo/program.lst") -(defparameter *program-build-filepath* #P"../../wip-hugo/build.sh") +(defparameter *program-listing-filepath* #P"../host/build/program.lst") +(defparameter *program-build-filepath* #P"../host/build.sh") (defun check-for-asm-build-script () (do ((path *program-build-filepath*)) -- 2.39.5 From 677b6a2f561bda29cfe5bdd20a2dc3467b398b3e Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 15:29:34 +0200 Subject: [PATCH 10/23] Rename "file.prg" to "host.prg" --- host/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/build.sh b/host/build.sh index 6f2a82d..f06944f 100755 --- a/host/build.sh +++ b/host/build.sh @@ -1,6 +1,6 @@ # !/bin/bash #Note that program start at $080D -cl65 -o build/file.prg -u __EXEHDR__ -t c64 -C c64-asm.cfg -l build/program.lst source.s -Ln build/program.lbl \ +cl65 -o build/host.prg -u __EXEHDR__ -t c64 -C c64-asm.cfg -l build/program.lst source.s -Ln build/program.lbl \ #VICE do not like - sed -i 's/-/m/g' program.lbl -- 2.39.5 From c076aa2055c4ae071200eed1a06f129f295feea7 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 15:29:55 +0200 Subject: [PATCH 11/23] Add "main loop" to host program, which executes user program --- host/mainloop.s | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 host/mainloop.s diff --git a/host/mainloop.s b/host/mainloop.s new file mode 100644 index 0000000..65854b1 --- /dev/null +++ b/host/mainloop.s @@ -0,0 +1,45 @@ +;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- +.scope mainsetup + USERPROG = $C000 + .repeat 4, I + ldy #$00 +: + lda batch_userprog+(I*256),Y + sta USERPROG+(I*256),Y + dey + bne :- + .endrep +.endscope + +.scope mainloop +ml: + USERPROG = $C000 + RASTER = $D012 + ;; Currently no code for fetching new programs, since we're testing with + ;; batch compiled version of the whole to begin with. + + ;; Bank in character ROM + lda #%11111011 + and $01 + sta $01 + + jsr USERPROG + + ;; Bank out character ROM, I/O in + lda #%00000100 + ora $01 + sta $01 +@framewait: + ldy RASTER + cpy #$66 + beq @framewait + inc FRAMECOUNT + jmp ml +.endscope + +.proc time ; user-procedure + lda FRAMECOUNT + rts +.endproc + +FRAMECOUNT: .byte 0 -- 2.39.5 From 32615cd6c94cb1ab49d77608b07458793ef91f41 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 19:58:53 +0200 Subject: [PATCH 12/23] Move loader to host --- {wip-duuqnd => host}/loader.s | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {wip-duuqnd => host}/loader.s (100%) diff --git a/wip-duuqnd/loader.s b/host/loader.s similarity index 100% rename from wip-duuqnd/loader.s rename to host/loader.s -- 2.39.5 From d605e299f5f0b225e4355f072a6eb96200524e4d Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 24 Jul 2025 23:51:03 +0200 Subject: [PATCH 13/23] Some unfinished fixing of program uploading --- .gitignore | 1 + host/loader.s | 57 +++++++++++++++++++++++++++---------------------- host/mainloop.s | 31 +++++++++++++++++++-------- host/source.s | 9 +++++--- 4 files changed, 60 insertions(+), 38 deletions(-) diff --git a/.gitignore b/.gitignore index 9f406fc..d292bd7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ *.lst *.note ./build/* +*.lbl \ No newline at end of file diff --git a/host/loader.s b/host/loader.s index d1a16c3..2aa5360 100644 --- a/host/loader.s +++ b/host/loader.s @@ -20,46 +20,46 @@ ;; More documentation on the Joystick port can be found here: https://www.c64-wiki.com/wiki/Joystick - progdest = $fe CLKMASK = %00000010 CTRL1 = $DC01 - .org $80d -coldstart: ;; Draw an at sign on screen to show that program has loaded - lda #$0 - sta $400 +setup_loader: + ;; Bank out character ROM, I/O in + lda #%00000100 + ora $01 + sta $01 + + lda #$00 sta progdest lda #$c0 sta progdest+1 -waitstart: ;; Wait until joystick 2 has been pulled down to start the program - lda $dc00 - and #$02 - bne waitstart - - ;; Change border colour for debugging - lda #$03 - sta $d020 -teststart: - jsr check_for_load_start ; Check if start_bit is correct - bcs @error ; The routine sets carry in the event of an error - beq teststart -@doneforever: - jmp $c000 ; starts the program? -@error: - lda #1 rts -check_for_load_start: +maybe_download_userprog: + ;; Bank out character ROM, I/O in + lda #%00000100 + ora $01 + sta $01 + lda #CLKMASK bit CTRL1 - bne start + bne download_userprog + lda #$00 rts -start: + +download_userprog: +.scope userprog_downloader sei + + lda #$00 + sta progdest + lda #$c0 + sta progdest+1 + ;; change border color for debugging purposes - ldx #$02 + ldx #$02 ; X needed for more than that debug color stx $d020 ldy #$00 jmp new_byte @@ -70,6 +70,9 @@ wait_for_bit_start: bit CTRL1 beq @loop + lda #$06 + sta $d020 + lda #CLKMASK bit CTRL1 beq error @@ -122,7 +125,7 @@ wait_for_bit_end: bit CTRL1 bne @loop ;; Debug show the clock is low - lda #$00 + lda #$02 sta $d020 jmp wait_for_bit_start @@ -137,9 +140,11 @@ error: ;; TODO cli sec + jmp $c000 rts BYTE = $400 LEN = $402 stop: .word $0000 loaded: .byte 0 +.endscope diff --git a/host/mainloop.s b/host/mainloop.s index 65854b1..61f670a 100644 --- a/host/mainloop.s +++ b/host/mainloop.s @@ -1,14 +1,26 @@ ;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- .scope mainsetup - USERPROG = $C000 - .repeat 4, I - ldy #$00 -: - lda batch_userprog+(I*256),Y - sta USERPROG+(I*256),Y - dey - bne :- - .endrep +;; USERPROG = $C000 +;; .repeat 4, I +;; ldy #$00 +;; : +;; lda batch_userprog+(I*256),Y +;; sta USERPROG+(I*256),Y +;; dey +;; bne :- +;; .endrep + +@waitstart: ;; Wait until joystick 2 has been pulled down to start the program + lda $dc00 + and #$02 + bne @waitstart + + jsr setup_loader + inc $d020 +@trying: + dec $d020 + jsr maybe_download_userprog + beq @trying .endscope .scope mainloop @@ -23,6 +35,7 @@ ml: and $01 sta $01 + ;;jsr maybe_download_userprog jsr USERPROG ;; Bank out character ROM, I/O in diff --git a/host/source.s b/host/source.s index d545d0b..30a16b4 100644 --- a/host/source.s +++ b/host/source.s @@ -12,13 +12,16 @@ .include "STARTUP.s" ;.include "dubbel_buffer/raster_irqs.s" +.include "mainloop.s" +.include "loader.s" + ;.include "routines/arithmatic/mult_test.s" ;.include "routines/arithmatic/div_test.s" ;.include "routines/circle/circle_test.s" ;.include "routines/circle/circle_test_size.s" ;.include "routines/circle/circle_test_position.s" ;.include "routines/line/line_test.s" -.include "routines/line/line_test_extensive.s" +;.include "routines/line/line_test_extensive.s" ;.include "routines/text/char_draw_test.s" ;.include "routines/pixel/pixel_test.s" ;.include "routines/memory/memcpy_test.s" @@ -39,7 +42,7 @@ JMP exit .include "routines/arithmatic/mult.s" .include "routines/arithmatic/div.s" -batch_userprog: -.incbin "userprog.bin", 0, 1024 +;batch_userprog: +;.incbin "userprog.bin", 0, 1024 .include "END.s" -- 2.39.5 From a48937fe3cd47a9461cc53af05b3e298567c33e2 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Fri, 25 Jul 2025 12:32:29 +0200 Subject: [PATCH 14/23] Move lookup tables into separate file --- host/END.s | 142 +------------------------------------------ host/lookup_tables.s | 140 ++++++++++++++++++++++++++++++++++++++++++ host/source.s | 1 + 3 files changed, 143 insertions(+), 140 deletions(-) create mode 100644 host/lookup_tables.s diff --git a/host/END.s b/host/END.s index bc46e95..fe880d5 100644 --- a/host/END.s +++ b/host/END.s @@ -1,140 +1,2 @@ -inverse_factor_value: ;lookup 00000001 --gives--> 10000000 , etc etc. only 1st 1 in binary numbers -NOP -.byte %10000000, %01000000; (inverse factor value) -NOP -.byte %00100000; (inverse factor value) -NOP -NOP;.byte $0; (log) -NOP;.byte $1; (log) -.byte %00010000; (inverse factor value) -log: -NOP -.byte $0; (log) -.byte $1; (log) -NOP -.byte $2 -NOP -NOP -.byte %00001000; (inverse factor value) -.byte $3 -NOP -NOP -;; i put another lookup table where nops normaly are' -binary_factor: -.byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001; (binary factor) -;; ^(log) -NOP -NOP -NOP -NOP -.byte %00000100; (inverse factor value) -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -.byte $5 -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -.byte %00000010; (inverse factor value) - -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -.byte $6 -;; i put another lookup table where nops normaly are -Bitmap = $4000 -;;This is used by pixel_draw! look at it for more detail -big_y_offset: - .lobytes $0000 + Bitmap - .hibytes $0000 + Bitmap - .lobytes $0140 + Bitmap - .hibytes $0140 + Bitmap - .lobytes $0280 + Bitmap - .hibytes $0280 + Bitmap - .lobytes $03C0 + Bitmap - .hibytes $03C0 + Bitmap - .lobytes $0500 + Bitmap - .hibytes $0500 + Bitmap - .lobytes $0640 + Bitmap - .hibytes $0640 + Bitmap - .lobytes $0780 + Bitmap - .hibytes $0780 + Bitmap - .lobytes $08C0 + Bitmap - .hibytes $08C0 + Bitmap - .lobytes $0A00 + Bitmap - .hibytes $0A00 + Bitmap - .lobytes $0B40 + Bitmap - .hibytes $0B40 + Bitmap - .lobytes $0C80 + Bitmap - .hibytes $0C80 + Bitmap - .lobytes $0DC0 + Bitmap - .hibytes $0DC0 + Bitmap - .lobytes $0F00 + Bitmap - .hibytes $0F00 + Bitmap - .lobytes $1040 + Bitmap - .hibytes $1040 + Bitmap - .lobytes $1180 + Bitmap - .hibytes $1180 + Bitmap - .lobytes $12C0 + Bitmap - .hibytes $12C0 + Bitmap - .lobytes $1400 + Bitmap - .hibytes $1400 + Bitmap - .lobytes $1540 + Bitmap - .hibytes $1540 + Bitmap - .lobytes $1680 + Bitmap - .hibytes $1680 + Bitmap - .lobytes $17C0 + Bitmap - .hibytes $17C0 + Bitmap - .lobytes $1900 + Bitmap - .hibytes $1900 + Bitmap - .lobytes $1A40 + Bitmap - .hibytes $1A40 + Bitmap - .lobytes $1B80 + Bitmap - .hibytes $1B80 + Bitmap - .lobytes $1CC0 + Bitmap - .hibytes $1CC0 + Bitmap - .lobytes $1E00 + Bitmap - .hibytes $1E00 + Bitmap -NOP -NOP -NOP -NOP -.byte %00000001 -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -.byte $7 +;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- +END_OF_PROGRAM: diff --git a/host/lookup_tables.s b/host/lookup_tables.s new file mode 100644 index 0000000..bc46e95 --- /dev/null +++ b/host/lookup_tables.s @@ -0,0 +1,140 @@ +inverse_factor_value: ;lookup 00000001 --gives--> 10000000 , etc etc. only 1st 1 in binary numbers +NOP +.byte %10000000, %01000000; (inverse factor value) +NOP +.byte %00100000; (inverse factor value) +NOP +NOP;.byte $0; (log) +NOP;.byte $1; (log) +.byte %00010000; (inverse factor value) +log: +NOP +.byte $0; (log) +.byte $1; (log) +NOP +.byte $2 +NOP +NOP +.byte %00001000; (inverse factor value) +.byte $3 +NOP +NOP +;; i put another lookup table where nops normaly are' +binary_factor: +.byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001; (binary factor) +;; ^(log) +NOP +NOP +NOP +NOP +.byte %00000100; (inverse factor value) +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +.byte $5 +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +.byte %00000010; (inverse factor value) + +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +.byte $6 +;; i put another lookup table where nops normaly are +Bitmap = $4000 +;;This is used by pixel_draw! look at it for more detail +big_y_offset: + .lobytes $0000 + Bitmap + .hibytes $0000 + Bitmap + .lobytes $0140 + Bitmap + .hibytes $0140 + Bitmap + .lobytes $0280 + Bitmap + .hibytes $0280 + Bitmap + .lobytes $03C0 + Bitmap + .hibytes $03C0 + Bitmap + .lobytes $0500 + Bitmap + .hibytes $0500 + Bitmap + .lobytes $0640 + Bitmap + .hibytes $0640 + Bitmap + .lobytes $0780 + Bitmap + .hibytes $0780 + Bitmap + .lobytes $08C0 + Bitmap + .hibytes $08C0 + Bitmap + .lobytes $0A00 + Bitmap + .hibytes $0A00 + Bitmap + .lobytes $0B40 + Bitmap + .hibytes $0B40 + Bitmap + .lobytes $0C80 + Bitmap + .hibytes $0C80 + Bitmap + .lobytes $0DC0 + Bitmap + .hibytes $0DC0 + Bitmap + .lobytes $0F00 + Bitmap + .hibytes $0F00 + Bitmap + .lobytes $1040 + Bitmap + .hibytes $1040 + Bitmap + .lobytes $1180 + Bitmap + .hibytes $1180 + Bitmap + .lobytes $12C0 + Bitmap + .hibytes $12C0 + Bitmap + .lobytes $1400 + Bitmap + .hibytes $1400 + Bitmap + .lobytes $1540 + Bitmap + .hibytes $1540 + Bitmap + .lobytes $1680 + Bitmap + .hibytes $1680 + Bitmap + .lobytes $17C0 + Bitmap + .hibytes $17C0 + Bitmap + .lobytes $1900 + Bitmap + .hibytes $1900 + Bitmap + .lobytes $1A40 + Bitmap + .hibytes $1A40 + Bitmap + .lobytes $1B80 + Bitmap + .hibytes $1B80 + Bitmap + .lobytes $1CC0 + Bitmap + .hibytes $1CC0 + Bitmap + .lobytes $1E00 + Bitmap + .hibytes $1E00 + Bitmap +NOP +NOP +NOP +NOP +.byte %00000001 +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +.byte $7 diff --git a/host/source.s b/host/source.s index 30a16b4..96fb898 100644 --- a/host/source.s +++ b/host/source.s @@ -44,5 +44,6 @@ JMP exit ;batch_userprog: ;.incbin "userprog.bin", 0, 1024 +.include "lookup_tables.s" .include "END.s" -- 2.39.5 From 77d30af636bec2bc6d6a2ba21e59d2f03e7c04fe Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Fri, 25 Jul 2025 12:32:53 +0200 Subject: [PATCH 15/23] Add IFDEF for "emulator preview" with userprog baked into host --- host/source.s | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/host/source.s b/host/source.s index 96fb898..2627f68 100644 --- a/host/source.s +++ b/host/source.s @@ -13,7 +13,9 @@ ;.include "dubbel_buffer/raster_irqs.s" .include "mainloop.s" +.ifndef EMULATOR_PREVIEW .include "loader.s" +.endif ;.include "routines/arithmatic/mult_test.s" ;.include "routines/arithmatic/div_test.s" @@ -42,8 +44,11 @@ JMP exit .include "routines/arithmatic/mult.s" .include "routines/arithmatic/div.s" -;batch_userprog: -;.incbin "userprog.bin", 0, 1024 .include "lookup_tables.s" +.ifdef EMULATOR_PREVIEW +batch_userprog: +.incbin "userprog.bin" +.endif + .include "END.s" -- 2.39.5 From 8ea1a2530a88ccbbc298020beac91a66d0eb2d58 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Fri, 25 Jul 2025 12:33:43 +0200 Subject: [PATCH 16/23] Remove duplicate entry in .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index d292bd7..59d5a4f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ *.prg *.o *.lst -*.lst *.note ./build/* *.lbl \ No newline at end of file -- 2.39.5 From d3b48e99f4e04f4a0d35119e298ed5c474e78c56 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Fri, 25 Jul 2025 12:35:22 +0200 Subject: [PATCH 17/23] Add some more to .gitignore --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 59d5a4f..7320a05 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,8 @@ *.lst *.note ./build/* -*.lbl \ No newline at end of file +*.lbl +*.bin +editor/c6le +editor/source-program_*.c6l +user-side-compiler/c6lc \ No newline at end of file -- 2.39.5 From 90ca5d683697df9c93e08af17a6ada43e43fdfbf Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Fri, 25 Jul 2025 12:50:26 +0200 Subject: [PATCH 18/23] Move host source code into "src" directory --- host/{ => src}/END.s | 0 host/{ => src}/STARTUP.s | 0 host/{ => src}/dubbel_buffer/raster_irqs.s | 0 host/{ => src}/loader.s | 0 host/{ => src}/lookup_tables.s | 0 host/{ => src}/macros/16aritmatic.s | 0 host/{ => src}/macros/timer.s | 0 host/{ => src}/mainloop.s | 0 host/{ => src}/public.inc | 0 host/{ => src}/routines/arithmatic/arithmatic.inc | 0 host/{ => src}/routines/arithmatic/div.s | 0 host/{ => src}/routines/arithmatic/div_test.s | 0 host/{ => src}/routines/arithmatic/mult.s | 0 host/{ => src}/routines/arithmatic/mult_test.s | 0 host/{ => src}/routines/circle/circle.inc | 0 host/{ => src}/routines/circle/circle.s | 0 host/{ => src}/routines/circle/circle_test.s | 0 host/{ => src}/routines/circle/circle_test_position.s | 0 host/{ => src}/routines/circle/circle_test_size.s | 0 host/{ => src}/routines/line/line.inc | 0 host/{ => src}/routines/line/line.s | 0 host/{ => src}/routines/line/line_down.s | 0 host/{ => src}/routines/line/line_down_inv.s | 0 host/{ => src}/routines/line/line_test.s | 0 host/{ => src}/routines/line/line_test_extensive.s | 0 host/{ => src}/routines/line/line_up.s | 0 host/{ => src}/routines/line/line_up_inv.s | 0 host/{ => src}/routines/memory/mem.inc | 0 host/{ => src}/routines/memory/memcpy.s | 0 host/{ => src}/routines/memory/memcpy_test.s | 0 host/{ => src}/routines/memory/memset.s | 0 host/{ => src}/routines/memory/memset_alt.s | 0 host/{ => src}/routines/memory/memset_test.s | 0 host/{ => src}/routines/pixel/pixel.inc | 0 host/{ => src}/routines/pixel/pixel_calc.s | 0 host/{ => src}/routines/pixel/pixel_draw.s | 0 host/{ => src}/routines/pixel/pixel_test.s | 0 host/{ => src}/routines/text/char.inc | 0 host/{ => src}/routines/text/char_draw.s | 0 host/{ => src}/routines/text/char_draw_test.s | 0 host/{ => src}/routines/triangle/lower_triangle.s | 0 host/{ => src}/routines/triangle/triangle.inc | 0 host/{ => src}/routines/triangle/triangle.s | 0 host/{ => src}/routines/triangle/triangle_test.s | 0 host/{ => src}/routines/triangle/upper_triangle.s | 0 host/{ => src}/source.s | 2 +- 46 files changed, 1 insertion(+), 1 deletion(-) rename host/{ => src}/END.s (100%) rename host/{ => src}/STARTUP.s (100%) rename host/{ => src}/dubbel_buffer/raster_irqs.s (100%) rename host/{ => src}/loader.s (100%) rename host/{ => src}/lookup_tables.s (100%) rename host/{ => src}/macros/16aritmatic.s (100%) rename host/{ => src}/macros/timer.s (100%) rename host/{ => src}/mainloop.s (100%) rename host/{ => src}/public.inc (100%) rename host/{ => src}/routines/arithmatic/arithmatic.inc (100%) rename host/{ => src}/routines/arithmatic/div.s (100%) rename host/{ => src}/routines/arithmatic/div_test.s (100%) rename host/{ => src}/routines/arithmatic/mult.s (100%) rename host/{ => src}/routines/arithmatic/mult_test.s (100%) rename host/{ => src}/routines/circle/circle.inc (100%) rename host/{ => src}/routines/circle/circle.s (100%) rename host/{ => src}/routines/circle/circle_test.s (100%) rename host/{ => src}/routines/circle/circle_test_position.s (100%) rename host/{ => src}/routines/circle/circle_test_size.s (100%) rename host/{ => src}/routines/line/line.inc (100%) rename host/{ => src}/routines/line/line.s (100%) rename host/{ => src}/routines/line/line_down.s (100%) rename host/{ => src}/routines/line/line_down_inv.s (100%) rename host/{ => src}/routines/line/line_test.s (100%) rename host/{ => src}/routines/line/line_test_extensive.s (100%) rename host/{ => src}/routines/line/line_up.s (100%) rename host/{ => src}/routines/line/line_up_inv.s (100%) rename host/{ => src}/routines/memory/mem.inc (100%) rename host/{ => src}/routines/memory/memcpy.s (100%) rename host/{ => src}/routines/memory/memcpy_test.s (100%) rename host/{ => src}/routines/memory/memset.s (100%) rename host/{ => src}/routines/memory/memset_alt.s (100%) rename host/{ => src}/routines/memory/memset_test.s (100%) rename host/{ => src}/routines/pixel/pixel.inc (100%) rename host/{ => src}/routines/pixel/pixel_calc.s (100%) rename host/{ => src}/routines/pixel/pixel_draw.s (100%) rename host/{ => src}/routines/pixel/pixel_test.s (100%) rename host/{ => src}/routines/text/char.inc (100%) rename host/{ => src}/routines/text/char_draw.s (100%) rename host/{ => src}/routines/text/char_draw_test.s (100%) rename host/{ => src}/routines/triangle/lower_triangle.s (100%) rename host/{ => src}/routines/triangle/triangle.inc (100%) rename host/{ => src}/routines/triangle/triangle.s (100%) rename host/{ => src}/routines/triangle/triangle_test.s (100%) rename host/{ => src}/routines/triangle/upper_triangle.s (100%) rename host/{ => src}/source.s (98%) diff --git a/host/END.s b/host/src/END.s similarity index 100% rename from host/END.s rename to host/src/END.s diff --git a/host/STARTUP.s b/host/src/STARTUP.s similarity index 100% rename from host/STARTUP.s rename to host/src/STARTUP.s diff --git a/host/dubbel_buffer/raster_irqs.s b/host/src/dubbel_buffer/raster_irqs.s similarity index 100% rename from host/dubbel_buffer/raster_irqs.s rename to host/src/dubbel_buffer/raster_irqs.s diff --git a/host/loader.s b/host/src/loader.s similarity index 100% rename from host/loader.s rename to host/src/loader.s diff --git a/host/lookup_tables.s b/host/src/lookup_tables.s similarity index 100% rename from host/lookup_tables.s rename to host/src/lookup_tables.s diff --git a/host/macros/16aritmatic.s b/host/src/macros/16aritmatic.s similarity index 100% rename from host/macros/16aritmatic.s rename to host/src/macros/16aritmatic.s diff --git a/host/macros/timer.s b/host/src/macros/timer.s similarity index 100% rename from host/macros/timer.s rename to host/src/macros/timer.s diff --git a/host/mainloop.s b/host/src/mainloop.s similarity index 100% rename from host/mainloop.s rename to host/src/mainloop.s diff --git a/host/public.inc b/host/src/public.inc similarity index 100% rename from host/public.inc rename to host/src/public.inc diff --git a/host/routines/arithmatic/arithmatic.inc b/host/src/routines/arithmatic/arithmatic.inc similarity index 100% rename from host/routines/arithmatic/arithmatic.inc rename to host/src/routines/arithmatic/arithmatic.inc diff --git a/host/routines/arithmatic/div.s b/host/src/routines/arithmatic/div.s similarity index 100% rename from host/routines/arithmatic/div.s rename to host/src/routines/arithmatic/div.s diff --git a/host/routines/arithmatic/div_test.s b/host/src/routines/arithmatic/div_test.s similarity index 100% rename from host/routines/arithmatic/div_test.s rename to host/src/routines/arithmatic/div_test.s diff --git a/host/routines/arithmatic/mult.s b/host/src/routines/arithmatic/mult.s similarity index 100% rename from host/routines/arithmatic/mult.s rename to host/src/routines/arithmatic/mult.s diff --git a/host/routines/arithmatic/mult_test.s b/host/src/routines/arithmatic/mult_test.s similarity index 100% rename from host/routines/arithmatic/mult_test.s rename to host/src/routines/arithmatic/mult_test.s diff --git a/host/routines/circle/circle.inc b/host/src/routines/circle/circle.inc similarity index 100% rename from host/routines/circle/circle.inc rename to host/src/routines/circle/circle.inc diff --git a/host/routines/circle/circle.s b/host/src/routines/circle/circle.s similarity index 100% rename from host/routines/circle/circle.s rename to host/src/routines/circle/circle.s diff --git a/host/routines/circle/circle_test.s b/host/src/routines/circle/circle_test.s similarity index 100% rename from host/routines/circle/circle_test.s rename to host/src/routines/circle/circle_test.s diff --git a/host/routines/circle/circle_test_position.s b/host/src/routines/circle/circle_test_position.s similarity index 100% rename from host/routines/circle/circle_test_position.s rename to host/src/routines/circle/circle_test_position.s diff --git a/host/routines/circle/circle_test_size.s b/host/src/routines/circle/circle_test_size.s similarity index 100% rename from host/routines/circle/circle_test_size.s rename to host/src/routines/circle/circle_test_size.s diff --git a/host/routines/line/line.inc b/host/src/routines/line/line.inc similarity index 100% rename from host/routines/line/line.inc rename to host/src/routines/line/line.inc diff --git a/host/routines/line/line.s b/host/src/routines/line/line.s similarity index 100% rename from host/routines/line/line.s rename to host/src/routines/line/line.s diff --git a/host/routines/line/line_down.s b/host/src/routines/line/line_down.s similarity index 100% rename from host/routines/line/line_down.s rename to host/src/routines/line/line_down.s diff --git a/host/routines/line/line_down_inv.s b/host/src/routines/line/line_down_inv.s similarity index 100% rename from host/routines/line/line_down_inv.s rename to host/src/routines/line/line_down_inv.s diff --git a/host/routines/line/line_test.s b/host/src/routines/line/line_test.s similarity index 100% rename from host/routines/line/line_test.s rename to host/src/routines/line/line_test.s diff --git a/host/routines/line/line_test_extensive.s b/host/src/routines/line/line_test_extensive.s similarity index 100% rename from host/routines/line/line_test_extensive.s rename to host/src/routines/line/line_test_extensive.s diff --git a/host/routines/line/line_up.s b/host/src/routines/line/line_up.s similarity index 100% rename from host/routines/line/line_up.s rename to host/src/routines/line/line_up.s diff --git a/host/routines/line/line_up_inv.s b/host/src/routines/line/line_up_inv.s similarity index 100% rename from host/routines/line/line_up_inv.s rename to host/src/routines/line/line_up_inv.s diff --git a/host/routines/memory/mem.inc b/host/src/routines/memory/mem.inc similarity index 100% rename from host/routines/memory/mem.inc rename to host/src/routines/memory/mem.inc diff --git a/host/routines/memory/memcpy.s b/host/src/routines/memory/memcpy.s similarity index 100% rename from host/routines/memory/memcpy.s rename to host/src/routines/memory/memcpy.s diff --git a/host/routines/memory/memcpy_test.s b/host/src/routines/memory/memcpy_test.s similarity index 100% rename from host/routines/memory/memcpy_test.s rename to host/src/routines/memory/memcpy_test.s diff --git a/host/routines/memory/memset.s b/host/src/routines/memory/memset.s similarity index 100% rename from host/routines/memory/memset.s rename to host/src/routines/memory/memset.s diff --git a/host/routines/memory/memset_alt.s b/host/src/routines/memory/memset_alt.s similarity index 100% rename from host/routines/memory/memset_alt.s rename to host/src/routines/memory/memset_alt.s diff --git a/host/routines/memory/memset_test.s b/host/src/routines/memory/memset_test.s similarity index 100% rename from host/routines/memory/memset_test.s rename to host/src/routines/memory/memset_test.s diff --git a/host/routines/pixel/pixel.inc b/host/src/routines/pixel/pixel.inc similarity index 100% rename from host/routines/pixel/pixel.inc rename to host/src/routines/pixel/pixel.inc diff --git a/host/routines/pixel/pixel_calc.s b/host/src/routines/pixel/pixel_calc.s similarity index 100% rename from host/routines/pixel/pixel_calc.s rename to host/src/routines/pixel/pixel_calc.s diff --git a/host/routines/pixel/pixel_draw.s b/host/src/routines/pixel/pixel_draw.s similarity index 100% rename from host/routines/pixel/pixel_draw.s rename to host/src/routines/pixel/pixel_draw.s diff --git a/host/routines/pixel/pixel_test.s b/host/src/routines/pixel/pixel_test.s similarity index 100% rename from host/routines/pixel/pixel_test.s rename to host/src/routines/pixel/pixel_test.s diff --git a/host/routines/text/char.inc b/host/src/routines/text/char.inc similarity index 100% rename from host/routines/text/char.inc rename to host/src/routines/text/char.inc diff --git a/host/routines/text/char_draw.s b/host/src/routines/text/char_draw.s similarity index 100% rename from host/routines/text/char_draw.s rename to host/src/routines/text/char_draw.s diff --git a/host/routines/text/char_draw_test.s b/host/src/routines/text/char_draw_test.s similarity index 100% rename from host/routines/text/char_draw_test.s rename to host/src/routines/text/char_draw_test.s diff --git a/host/routines/triangle/lower_triangle.s b/host/src/routines/triangle/lower_triangle.s similarity index 100% rename from host/routines/triangle/lower_triangle.s rename to host/src/routines/triangle/lower_triangle.s diff --git a/host/routines/triangle/triangle.inc b/host/src/routines/triangle/triangle.inc similarity index 100% rename from host/routines/triangle/triangle.inc rename to host/src/routines/triangle/triangle.inc diff --git a/host/routines/triangle/triangle.s b/host/src/routines/triangle/triangle.s similarity index 100% rename from host/routines/triangle/triangle.s rename to host/src/routines/triangle/triangle.s diff --git a/host/routines/triangle/triangle_test.s b/host/src/routines/triangle/triangle_test.s similarity index 100% rename from host/routines/triangle/triangle_test.s rename to host/src/routines/triangle/triangle_test.s diff --git a/host/routines/triangle/upper_triangle.s b/host/src/routines/triangle/upper_triangle.s similarity index 100% rename from host/routines/triangle/upper_triangle.s rename to host/src/routines/triangle/upper_triangle.s diff --git a/host/source.s b/host/src/source.s similarity index 98% rename from host/source.s rename to host/src/source.s index 2627f68..0d63e58 100644 --- a/host/source.s +++ b/host/src/source.s @@ -48,7 +48,7 @@ JMP exit .ifdef EMULATOR_PREVIEW batch_userprog: -.incbin "userprog.bin" +.incbin "../userprog.bin" .endif .include "END.s" -- 2.39.5 From 96cf505934bd3021530b9344b78d04653c63b415 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Fri, 25 Jul 2025 12:50:40 +0200 Subject: [PATCH 19/23] Delete label file (should not be under version control) --- host/program.lbl | 168 ----------------------------------------------- 1 file changed, 168 deletions(-) delete mode 100644 host/program.lbl diff --git a/host/program.lbl b/host/program.lbl deleted file mode 100644 index 2cec8a4..0000000 --- a/host/program.lbl +++ /dev/null @@ -1,168 +0,0 @@ -al 001444 .__BSS_LOAD__ -al 001444 .__BSS_RUN__ -al 000000 .__BSS_SIZE__ -al 000001 .__EXEHDR__ -al 000001 .__LOADADDR__ -al 000000 .__ZP_FILEOFFS__ -al 000002 .__ZP_LAST__ -al 0000FE .__ZP_SIZE__ -al 000002 .__ZP_START__ -al 001404 .big_y_offset -al 0013CE .binary_factor -al 0013C3 .log -al 0013BA .inverse_factor_value -al 0013B9 .for_i_end -al 0013B1 .R_pos -al 0013B5 .R_neg -al 0013A4 .for_i -al 00139A .div -al 001399 .endloop -al 00138C .loop -al 00138E .start -al 001387 .mult -al 001377 .change_length -al 001380 .y_overflow -al 001370 .loop -al 00136E .memcpy -al 00132F .big_set_end -al 001337 .small_set -al 001030 .big_set -al 001029 .memset -al 000FFF .move_data -al 000FD6 .calculate_screen_position -al 000FBC .calculate_petski_position -al 000FBC .char_draw -al 000FB3 .calc_byte_to_paint -al 000F95 .pixel_calc -al 000F90 .draw -al 000F88 .calc_byte_to_paint -al 000F6A .pixel_draw -al 000F68 .draw_lower_triangle -al 000F5C .draw_upper_triangle -al 000F45 .BC_overflow -al 000F5C .BC_overflow_end -al 000F28 .AB_overflow -al 000F3C .AB_overflow_end -al 000F1F .triangle -al 000F1E .end -al 000EF9 .qbb_y_overflow -al 000F15 .qbb_y_end -al 000EF3 .qbb_y -al 000ED9 .qdb_overflow -al 000EF3 .qdb_y_end -al 000ED5 .qdb_y -al 000EBB .qca_x_overflow -al 000ED5 .qca_x_end -al 000EB7 .qca_x -al 000E9D .qaa_x_overflow -al 000EB7 .qaa_x_end -al 000E99 .qaa_x -al 000E95 .change_x -al 000F15 .endif -al 000E95 .if -al 000E6C .qcb_x_overflow -al 000E87 .qcb_x_end -al 000E68 .qcb_x -al 000E4E .qdb_x_overflow -al 000E68 .qdb_x_end -al 000E4A .qdb_x -al 000E2E .qda_y_overflow -al 000E4A .qda_y_end -al 000E28 .qda_y -al 000E0E .qaa_y_underflow -al 000E28 .qaa_y_end -al 000E0A .qaa_y -al 000E08 .change_Y -al 000E00 .draw_qab -al 000DF8 .draw_qbb -al 000DF2 .draw_qdb -al 000DEA .draw_qcb -al 000DE4 .draw_qca -al 000DDC .draw_qda -al 000DD6 .draw_qba -al 000DCE .draw_qaa -al 000DCE .draw_pixels -al 000DCE .while_x_bigger_then_y -al 000DB4 .draw_right_px_in_circle -al 000D93 .draw_lower_px_in_circle -al 000D75 .draw_left_px_in_circle -al 000D57 .draw_upper_px_in_circle -al 000D4B .circle -al 000D2A .move_8px_left -al 000D26 .increment_pixel_x -al 000D1C .LOCALmMACRO_SYMBOLm002F -al 000D4A .end -al 000CFD .move_8px_up -al 000D0B .decrement_y_pos_end -al 000CFA .decrement_y_pos -al 000CF4 .for_y -al 000CDF .end_selfmod -al 000D1C .case_1 -al 000D3B .case_2 -al 000CCB .selfmod -al 000C90 .decrement_y_pos_end -al 000C7F .move_8px_up -al 000C7C .decrement_y_pos -al 000C72 .LOCALmMACRO_SYMBOLm0021 -al 000C9F .end -al 000C53 .move_8px_left -al 000C61 .increment_pixel_x_end -al 000C4F .increment_pixel_x -al 000C49 .for_x -al 000C35 .end_selfmod -al 000C72 .case_1 -al 000C90 .case_2 -al 000C21 .selfmod -al 000BD4 .move_8px_left -al 000BD0 .increment_pixel_x -al 000BC6 .LOCALmMACRO_SYMBOLm0017 -al 000BF5 .end -al 000BA7 .move_8px_down -al 000BB5 .increment_y_pos_end -al 000BA4 .increment_y_pos -al 000B9E .for_y -al 000B7D .end_selfmod -al 000BC6 .case_1 -al 000BE6 .case_2 -al 000B69 .selfmod -al 000B2E .decrement_y_pos_end -al 000B1D .move_8px_up -al 000B1A .decrement_y_pos -al 000B10 .LOCALmMACRO_SYMBOLm0009 -al 000B3D .end -al 000AF1 .move_8px_right -al 000AFF .decrement_pixel_x_end -al 000AED .decrement_pixel_x -al 000AE7 .for_x -al 000AC7 .end_selfmod -al 000B10 .case_1 -al 000B2E .case_2 -al 000AB3 .selfmod -al 000A88 .line_down -al 000B3E .line_down_inv -al 000A80 .steep_ -al 000A84 .shallow_ -al 000BF6 .line_up -al 000CA0 .line_up_inv -al 000A6E .steep -al 000A72 .shallow -al 000A68 .up -al 000A78 .down -al 000A5F .dx_no_underflow -al 000A54 .line -al 000A51 .exit -al 000A21 .end_test_y -al 000A15 .test_y -al 000A0B .end_test_x -al 0009FF .test_x -al 0009D0 .@loop -al 0009BE .long_line_test_b -al 0009A9 .clear_screen_ -al 000992 .@loop -al 000980 .long_line_test_a -al 00096B .clear_screen -al 000954 .@loop -al 0008FE .loop -al 0008C5 .loop -al 000897 .NMI_routine_end -al 000896 .NMI_routine -- 2.39.5 From e4d5fd6f5aa787f52f417de8dd15f9c3c492649c Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Fri, 25 Jul 2025 12:51:40 +0200 Subject: [PATCH 20/23] Remove another label file --- host/build/program.lbl | 159 ----------------------------------------- 1 file changed, 159 deletions(-) delete mode 100644 host/build/program.lbl diff --git a/host/build/program.lbl b/host/build/program.lbl deleted file mode 100644 index 5a6fe18..0000000 --- a/host/build/program.lbl +++ /dev/null @@ -1,159 +0,0 @@ -al 001315 .__BSS_LOAD__ -al 001315 .__BSS_RUN__ -al 000000 .__BSS_SIZE__ -al 000001 .__EXEHDR__ -al 000001 .__LOADADDR__ -al 000000 .__ZP_FILEOFFS__ -al 000002 .__ZP_LAST__ -al 0000FE .__ZP_SIZE__ -al 000002 .__ZP_START__ -al 0012D5 .big_y_offset -al 00129F .binary_factor -al 001294 .log -al 00128B .inverse_factor_value -al 00128A .for_i_end -al 001282 .R_pos -al 001286 .R_neg -al 001275 .for_i -al 00126B .div -al 00126A .endloop -al 00125D .loop -al 00125F .start -al 001258 .mult -al 001248 .change_length -al 001251 .y_overflow -al 001241 .loop -al 00123F .memcpy -al 001200 .big_set_end -al 001208 .small_set -al 000F01 .big_set -al 000EFA .memset -al 000ED0 .move_data -al 000EA7 .calculate_screen_position -al 000E8D .calculate_petski_position -al 000E8D .char_draw -al 000E84 .calc_byte_to_paint -al 000E66 .pixel_calc -al 000E61 .draw -al 000E59 .calc_byte_to_paint -al 000E3B .pixel_draw -al 000E39 .draw_lower_triangle -al 000E2D .draw_upper_triangle -al 000E16 .BC_overflow -al 000E2D .BC_overflow_end -al 000DF9 .AB_overflow -al 000E0D .AB_overflow_end -al 000DF0 .triangle -al 000DEF .end -al 000DCA .qbb_y_overflow -al 000DE6 .qbb_y_end -al 000DC4 .qbb_y -al 000DAA .qdb_overflow -al 000DC4 .qdb_y_end -al 000DA6 .qdb_y -al 000D8C .qca_x_overflow -al 000DA6 .qca_x_end -al 000D88 .qca_x -al 000D6E .qaa_x_overflow -al 000D88 .qaa_x_end -al 000D6A .qaa_x -al 000D66 .change_x -al 000DE6 .endif -al 000D66 .if -al 000D3D .qcb_x_overflow -al 000D58 .qcb_x_end -al 000D39 .qcb_x -al 000D1F .qdb_x_overflow -al 000D39 .qdb_x_end -al 000D1B .qdb_x -al 000CFF .qda_y_overflow -al 000D1B .qda_y_end -al 000CF9 .qda_y -al 000CDF .qaa_y_underflow -al 000CF9 .qaa_y_end -al 000CDB .qaa_y -al 000CD9 .change_Y -al 000CD1 .draw_qab -al 000CC9 .draw_qbb -al 000CC3 .draw_qdb -al 000CBB .draw_qcb -al 000CB5 .draw_qca -al 000CAD .draw_qda -al 000CA7 .draw_qba -al 000C9F .draw_qaa -al 000C9F .draw_pixels -al 000C9F .while_x_bigger_then_y -al 000C85 .draw_right_px_in_circle -al 000C64 .draw_lower_px_in_circle -al 000C46 .draw_left_px_in_circle -al 000C28 .draw_upper_px_in_circle -al 000C1C .circle -al 000BF9 .move_8px_left -al 000BF5 .increment_pixel_x -al 000C1B .end -al 000BD4 .move_8px_up -al 000BE2 .decrement_y_pos_end -al 000BD1 .decrement_y_pos -al 000BCB .for_y -al 000BB6 .end_selfmod -al 000BE9 .case_1 -al 000C0B .case_2 -al 000BA2 .selfmod -al 000B64 .decrement_y_pos_end -al 000B52 .move_8px_up -al 000B4F .decrement_y_pos -al 000B73 .end -al 000B2E .move_8px_left -al 000B3C .increment_pixel_x_end -al 000B2A .increment_pixel_x -al 000B24 .for_x -al 000B10 .end_selfmod -al 000B43 .case_1 -al 000B64 .case_2 -al 000AFC .selfmod -al 000AB7 .move_8px_left -al 000AB3 .increment_pixel_x -al 000AD8 .end -al 000A92 .move_8px_down -al 000AA0 .increment_y_pos_end -al 000A8F .increment_y_pos -al 000A89 .for_y -al 000A68 .end_selfmod -al 000AA7 .case_1 -al 000AC8 .case_2 -al 000A54 .selfmod -al 000A16 .decrement_y_pos_end -al 000A04 .move_8px_up -al 000A01 .decrement_y_pos -al 000A25 .end -al 0009E0 .move_8px_right -al 0009EE .decrement_pixel_x_end -al 0009DC .decrement_pixel_x -al 0009D6 .for_x -al 0009B6 .end_selfmod -al 0009F5 .case_1 -al 000A16 .case_2 -al 0009A2 .selfmod -al 000974 .line_down -al 000A26 .line_down_inv -al 00096C .steep_ -al 000970 .shallow_ -al 000AD9 .line_up -al 000B74 .line_up_inv -al 00095A .steep -al 00095E .shallow -al 000954 .up -al 000964 .down -al 00094B .dx_no_underflow -al 000940 .line -al 00093D .exit -al 000928 .@loop -al 000916 .long_line_test_b -al 000901 .clear_screen_ -al 0008EA .@loop -al 0008D8 .long_line_test_a -al 0008C3 .clear_screen -al 0008C0 .hihi -al 0008A9 .@loop -al 000897 .NMI_routine_end -al 000896 .NMI_routine -- 2.39.5 From e7c316bb6b49b3661b970fb6134e4d19519dd6be Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Fri, 25 Jul 2025 12:52:28 +0200 Subject: [PATCH 21/23] Add *.labels to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7320a05..9abcb09 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ ./build/* *.lbl *.bin +*.labels editor/c6le editor/source-program_*.c6l user-side-compiler/c6lc \ No newline at end of file -- 2.39.5 From 981b989ad1201c9c29efb01c0f17030d7ef44c8f Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Fri, 25 Jul 2025 12:52:46 +0200 Subject: [PATCH 22/23] Delete a new.labels.lables (what's this? why's this here?) --- host/build/new.labels.labels | 684 ----------------------------------- 1 file changed, 684 deletions(-) delete mode 100644 host/build/new.labels.labels diff --git a/host/build/new.labels.labels b/host/build/new.labels.labels deleted file mode 100644 index 6dbbc15..0000000 --- a/host/build/new.labels.labels +++ /dev/null @@ -1,684 +0,0 @@ -// Labels exported by RetroDebugger v0.64.72 on 2025/07/19 18:02:39 - -{ - Version: "1" - Segments: [ - { - Name: Default - CodeLabels: [ -{ - Address: "1444" - Name: .__BSS_LOAD__ - } -{ - Address: "1444" - Name: .__BSS_RUN__ - } -{ - Address: "0000" - Name: .__BSS_SIZE__ - } -{ - Address: "0001" - Name: .__EXEHDR__ - } -{ - Address: "0001" - Name: .__LOADADDR__ - } -{ - Address: "0000" - Name: .__ZP_FILEOFFS__ - } -{ - Address: "0002" - Name: .__ZP_LAST__ - } -{ - Address: "00FE" - Name: .__ZP_SIZE__ - } -{ - Address: "0002" - Name: .__ZP_START__ - } -{ - Address: "1404" - Name: .big_y_offset - } -{ - Address: "13CE" - Name: .binary_factor - } -{ - Address: "13C3" - Name: .log - } -{ - Address: "13BA" - Name: .inverse_factor_value - } -{ - Address: "13B9" - Name: .for_i_end - } -{ - Address: "13B1" - Name: .R_pos - } -{ - Address: "13B5" - Name: .R_neg - } -{ - Address: "13A4" - Name: .for_i - } -{ - Address: "139A" - Name: .div - } -{ - Address: "1399" - Name: .endloop - } -{ - Address: "138C" - Name: .loop - } -{ - Address: "138E" - Name: .start - } -{ - Address: "1387" - Name: .mult - } -{ - Address: "1377" - Name: .change_length - } -{ - Address: "1380" - Name: .y_overflow - } -{ - Address: "1370" - Name: .loop - } -{ - Address: "136E" - Name: .memcpy - } -{ - Address: "132F" - Name: .big_set_end - } -{ - Address: "1337" - Name: .small_set - } -{ - Address: "1030" - Name: .big_set - } -{ - Address: "1029" - Name: .memset - } -{ - Address: "0FFF" - Name: .move_data - } -{ - Address: "0FD6" - Name: .calculate_screen_position - } -{ - Address: "0FBC" - Name: .calculate_petski_position - } -{ - Address: "0FBC" - Name: .char_draw - } -{ - Address: "0FB3" - Name: .calc_byte_to_paint - } -{ - Address: "0F95" - Name: .pixel_calc - } -{ - Address: "0F90" - Name: .draw - } -{ - Address: "0F88" - Name: .calc_byte_to_paint - } -{ - Address: "0F6A" - Name: .pixel_draw - } -{ - Address: "0F68" - Name: .draw_lower_triangle - } -{ - Address: "0F5C" - Name: .draw_upper_triangle - } -{ - Address: "0F45" - Name: .BC_overflow - } -{ - Address: "0F5C" - Name: .BC_overflow_end - } -{ - Address: "0F28" - Name: .AB_overflow - } -{ - Address: "0F3C" - Name: .AB_overflow_end - } -{ - Address: "0F1F" - Name: .triangle - } -{ - Address: "0F1E" - Name: .end - } -{ - Address: "0EF9" - Name: .qbb_y_overflow - } -{ - Address: "0F15" - Name: .qbb_y_end - } -{ - Address: "0EF3" - Name: .qbb_y - } -{ - Address: "0ED9" - Name: .qdb_overflow - } -{ - Address: "0EF3" - Name: .qdb_y_end - } -{ - Address: "0ED5" - Name: .qdb_y - } -{ - Address: "0EBB" - Name: .qca_x_overflow - } -{ - Address: "0ED5" - Name: .qca_x_end - } -{ - Address: "0EB7" - Name: .qca_x - } -{ - Address: "0E9D" - Name: .qaa_x_overflow - } -{ - Address: "0EB7" - Name: .qaa_x_end - } -{ - Address: "0E99" - Name: .qaa_x - } -{ - Address: "0E95" - Name: .change_x - } -{ - Address: "0F15" - Name: .endif - } -{ - Address: "0E95" - Name: .if - } -{ - Address: "0E6C" - Name: .qcb_x_overflow - } -{ - Address: "0E87" - Name: .qcb_x_end - } -{ - Address: "0E68" - Name: .qcb_x - } -{ - Address: "0E4E" - Name: .qdb_x_overflow - } -{ - Address: "0E68" - Name: .qdb_x_end - } -{ - Address: "0E4A" - Name: .qdb_x - } -{ - Address: "0E2E" - Name: .qda_y_overflow - } -{ - Address: "0E4A" - Name: .qda_y_end - } -{ - Address: "0E28" - Name: .qda_y - } -{ - Address: "0E0E" - Name: .qaa_y_underflow - } -{ - Address: "0E28" - Name: .qaa_y_end - } -{ - Address: "0E0A" - Name: .qaa_y - } -{ - Address: "0E08" - Name: .change_Y - } -{ - Address: "0E00" - Name: .draw_qab - } -{ - Address: "0DF8" - Name: .draw_qbb - } -{ - Address: "0DF2" - Name: .draw_qdb - } -{ - Address: "0DEA" - Name: .draw_qcb - } -{ - Address: "0DE4" - Name: .draw_qca - } -{ - Address: "0DDC" - Name: .draw_qda - } -{ - Address: "0DD6" - Name: .draw_qba - } -{ - Address: "0DCE" - Name: .draw_qaa - } -{ - Address: "0DCE" - Name: .draw_pixels - } -{ - Address: "0DCE" - Name: .while_x_bigger_then_y - } -{ - Address: "0DB4" - Name: .draw_right_px_in_circle - } -{ - Address: "0D93" - Name: .draw_lower_px_in_circle - } -{ - Address: "0D75" - Name: .draw_left_px_in_circle - } -{ - Address: "0D57" - Name: .draw_upper_px_in_circle - } -{ - Address: "0D4B" - Name: .circle - } -{ - Address: "0D2A" - Name: .move_8px_left - } -{ - Address: "0D26" - Name: .increment_pixel_x - } -{ - Address: "0D1C" - Name: .LOCAL-MACRO_SYMBOL-002F - } -{ - Address: "0D4A" - Name: .end - } -{ - Address: "0CFD" - Name: .move_8px_up - } -{ - Address: "0D0B" - Name: .decrement_y_pos_end - } -{ - Address: "0CFA" - Name: .decrement_y_pos - } -{ - Address: "0CF4" - Name: .for_y - } -{ - Address: "0CDF" - Name: .end_selfmod - } -{ - Address: "0D1C" - Name: .case_1 - } -{ - Address: "0D3B" - Name: .case_2 - } -{ - Address: "0CCB" - Name: .selfmod - } -{ - Address: "0C90" - Name: .decrement_y_pos_end - } -{ - Address: "0C7F" - Name: .move_8px_up - } -{ - Address: "0C7C" - Name: .decrement_y_pos - } -{ - Address: "0C72" - Name: .LOCAL-MACRO_SYMBOL-0021 - } -{ - Address: "0C9F" - Name: .end - } -{ - Address: "0C53" - Name: .move_8px_left - } -{ - Address: "0C61" - Name: .increment_pixel_x_end - } -{ - Address: "0C4F" - Name: .increment_pixel_x - } -{ - Address: "0C49" - Name: .for_x - } -{ - Address: "0C35" - Name: .end_selfmod - } -{ - Address: "0C72" - Name: .case_1 - } -{ - Address: "0C90" - Name: .case_2 - } -{ - Address: "0C21" - Name: .selfmod - } -{ - Address: "0BD4" - Name: .move_8px_left - } -{ - Address: "0BD0" - Name: .increment_pixel_x - } -{ - Address: "0BC6" - Name: .LOCAL-MACRO_SYMBOL-0017 - } -{ - Address: "0BF5" - Name: .end - } -{ - Address: "0BA7" - Name: .move_8px_down - } -{ - Address: "0BB5" - Name: .increment_y_pos_end - } -{ - Address: "0BA4" - Name: .increment_y_pos - } -{ - Address: "0B9E" - Name: .for_y - } -{ - Address: "0B7D" - Name: .end_selfmod - } -{ - Address: "0BC6" - Name: .case_1 - } -{ - Address: "0BE6" - Name: .case_2 - } -{ - Address: "0B69" - Name: .selfmod - } -{ - Address: "0B2E" - Name: .decrement_y_pos_end - } -{ - Address: "0B1D" - Name: .move_8px_up - } -{ - Address: "0B1A" - Name: .decrement_y_pos - } -{ - Address: "0B10" - Name: .LOCAL-MACRO_SYMBOL-0009 - } -{ - Address: "0B3D" - Name: .end - } -{ - Address: "0AF1" - Name: .move_8px_right - } -{ - Address: "0AFF" - Name: .decrement_pixel_x_end - } -{ - Address: "0AED" - Name: .decrement_pixel_x - } -{ - Address: "0AE7" - Name: .for_x - } -{ - Address: "0AC7" - Name: .end_selfmod - } -{ - Address: "0B10" - Name: .case_1 - } -{ - Address: "0B2E" - Name: .case_2 - } -{ - Address: "0AB3" - Name: .selfmod - } -{ - Address: "0A88" - Name: .line_down - } -{ - Address: "0B3E" - Name: .line_down_inv - } -{ - Address: "0A80" - Name: .steep_ - } -{ - Address: "0A84" - Name: .shallow_ - } -{ - Address: "0BF6" - Name: .line_up - } -{ - Address: "0CA0" - Name: .line_up_inv - } -{ - Address: "0A6E" - Name: .steep - } -{ - Address: "0A72" - Name: .shallow - } -{ - Address: "0A68" - Name: .up - } -{ - Address: "0A78" - Name: .down - } -{ - Address: "0A5F" - Name: .dx_no_underflow - } -{ - Address: "0A54" - Name: .line - } -{ - Address: "0A51" - Name: .exit - } -{ - Address: "0A21" - Name: .end_test_y - } -{ - Address: "0A15" - Name: .test_y - } -{ - Address: "0A0B" - Name: .end_test_x - } -{ - Address: "09FF" - Name: .test_x - } -{ - Address: "09D0" - Name: .@loop - } -{ - Address: "09BE" - Name: .long_line_test_b - } -{ - Address: "09A9" - Name: .clear_screen_ - } -{ - Address: "0992" - Name: .@loop - } -{ - Address: "0980" - Name: .long_line_test_a - } -{ - Address: "096B" - Name: .clear_screen - } -{ - Address: "0954" - Name: .@loop - } -{ - Address: "08FE" - Name: .loop - } -{ - Address: "08C5" - Name: .loop - } -{ - Address: "0897" - Name: .NMI_routine_end - } -{ - Address: "0896" - Name: .NMI_routine - } - ] - } - ] -} -- 2.39.5 From 69b29fc77c848aa9404bb3c105266445f267aab3 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Fri, 25 Jul 2025 12:54:39 +0200 Subject: [PATCH 23/23] Replace host/build.sh with a Makefile --- host/Makefile | 20 ++++++++++++++++++++ host/build.sh | 6 ------ host/run.sh | 2 +- host/run_retro_debugger.sh | 2 +- 4 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 host/Makefile delete mode 100755 host/build.sh diff --git a/host/Makefile b/host/Makefile new file mode 100644 index 0000000..2a4e790 --- /dev/null +++ b/host/Makefile @@ -0,0 +1,20 @@ +BINARY := host.prg + +BUILD_DIR := ./build +SRC_DIR := ./src + +SRCS := $(shell find $(SRC_DIR) -name '*.s' -or -name '*.inc') +TOPLEVEL := source.s + +CL := cl65 + +CLFLAGS := -u __EXEHDR__ -t c64 -C c64-asm.cfg -l $(BUILD_DIR)/host.lst -Ln $(BUILD_DIR)/host.lbl + +$(BUILD_DIR)/$(BINARY): $(SRCS) + mkdir -p $(BUILD_DIR) + $(CL) -o $@ $(CLFLAGS) $(SRC_DIR)/$(TOPLEVEL) + +all: $(BUILD_DIR)/$(BINARY) + +preview: userprog.bin $(SRCS) + $(CL) -o $@ -D EMULATOR_PREVIEW $(CLFLAGS) $(SRC_DIR)/$(TOPLEVEL) diff --git a/host/build.sh b/host/build.sh deleted file mode 100755 index f06944f..0000000 --- a/host/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -# !/bin/bash -#Note that program start at $080D -cl65 -o build/host.prg -u __EXEHDR__ -t c64 -C c64-asm.cfg -l build/program.lst source.s -Ln build/program.lbl \ - -#VICE do not like - -sed -i 's/-/m/g' program.lbl diff --git a/host/run.sh b/host/run.sh index 725a15f..c53faaf 100755 --- a/host/run.sh +++ b/host/run.sh @@ -1,5 +1,5 @@ # !/bin/bash killall x64sc -./build.sh \ +make \ && nohup flatpak run net.sf.VICE -windowypos 0 -windowxpos 960 -windowwidth 945 -windowheight 720 -moncommands program.lbl build/file.prg /dev/null & diff --git a/host/run_retro_debugger.sh b/host/run_retro_debugger.sh index f4b7844..95ed63b 100755 --- a/host/run_retro_debugger.sh +++ b/host/run_retro_debugger.sh @@ -1,4 +1,4 @@ # !/bin/bash -./build.sh && +make && ./retrodebugger_label_build_tool/rdb_build_label.sh \ && nohup retrodebugger -b retrodebugger_label_build_tool/new.labels.labels -c64 ./build/file.prg /dev/null & -- 2.39.5