Compare commits

..

No commits in common. "d605e299f5f0b225e4355f072a6eb96200524e4d" and "c076aa2055c4ae071200eed1a06f129f295feea7" have entirely different histories.

4 changed files with 38 additions and 60 deletions

1
.gitignore vendored
View file

@ -5,4 +5,3 @@
*.lst
*.note
./build/*
*.lbl

View file

@ -1,26 +1,14 @@
;;; -*- 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
@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
USERPROG = $C000
.repeat 4, I
ldy #$00
:
lda batch_userprog+(I*256),Y
sta USERPROG+(I*256),Y
dey
bne :-
.endrep
.endscope
.scope mainloop
@ -35,7 +23,6 @@ ml:
and $01
sta $01
;;jsr maybe_download_userprog
jsr USERPROG
;; Bank out character ROM, I/O in

View file

@ -12,16 +12,13 @@
.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"
@ -42,7 +39,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"

View file

@ -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
setup_loader:
;; Bank out character ROM, I/O in
lda #%00000100
ora $01
sta $01
lda #$00
.org $80d
coldstart: ;; Draw an at sign on screen to show that program has loaded
lda #$0
sta $400
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
maybe_download_userprog:
;; Bank out character ROM, I/O in
lda #%00000100
ora $01
sta $01
check_for_load_start:
lda #CLKMASK
bit CTRL1
bne download_userprog
bne start
lda #$00
rts
download_userprog:
.scope userprog_downloader
start:
sei
lda #$00
sta progdest
lda #$c0
sta progdest+1
;; change border color for debugging purposes
ldx #$02 ; X needed for more than that debug color
ldx #$02
stx $d020
ldy #$00
jmp new_byte
@ -70,9 +70,6 @@ wait_for_bit_start:
bit CTRL1
beq @loop
lda #$06
sta $d020
lda #CLKMASK
bit CTRL1
beq error
@ -125,7 +122,7 @@ wait_for_bit_end:
bit CTRL1
bne @loop
;; Debug show the clock is low
lda #$02
lda #$00
sta $d020
jmp wait_for_bit_start
@ -140,11 +137,9 @@ error:
;; TODO
cli
sec
jmp $c000
rts
BYTE = $400
LEN = $402
stop: .word $0000
loaded: .byte 0
.endscope