Compare commits
No commits in common. "d605e299f5f0b225e4355f072a6eb96200524e4d" and "c076aa2055c4ae071200eed1a06f129f295feea7" have entirely different histories.
d605e299f5
...
c076aa2055
4 changed files with 38 additions and 60 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,4 +5,3 @@
|
||||||
*.lst
|
*.lst
|
||||||
*.note
|
*.note
|
||||||
./build/*
|
./build/*
|
||||||
*.lbl
|
|
|
@ -1,26 +1,14 @@
|
||||||
;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*-
|
;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*-
|
||||||
.scope mainsetup
|
.scope mainsetup
|
||||||
;; USERPROG = $C000
|
USERPROG = $C000
|
||||||
;; .repeat 4, I
|
.repeat 4, I
|
||||||
;; ldy #$00
|
ldy #$00
|
||||||
;; :
|
:
|
||||||
;; lda batch_userprog+(I*256),Y
|
lda batch_userprog+(I*256),Y
|
||||||
;; sta USERPROG+(I*256),Y
|
sta USERPROG+(I*256),Y
|
||||||
;; dey
|
dey
|
||||||
;; bne :-
|
bne :-
|
||||||
;; .endrep
|
.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
|
.endscope
|
||||||
|
|
||||||
.scope mainloop
|
.scope mainloop
|
||||||
|
@ -35,7 +23,6 @@ ml:
|
||||||
and $01
|
and $01
|
||||||
sta $01
|
sta $01
|
||||||
|
|
||||||
;;jsr maybe_download_userprog
|
|
||||||
jsr USERPROG
|
jsr USERPROG
|
||||||
|
|
||||||
;; Bank out character ROM, I/O in
|
;; Bank out character ROM, I/O in
|
||||||
|
|
|
@ -12,16 +12,13 @@
|
||||||
.include "STARTUP.s"
|
.include "STARTUP.s"
|
||||||
;.include "dubbel_buffer/raster_irqs.s"
|
;.include "dubbel_buffer/raster_irqs.s"
|
||||||
|
|
||||||
.include "mainloop.s"
|
|
||||||
.include "loader.s"
|
|
||||||
|
|
||||||
;.include "routines/arithmatic/mult_test.s"
|
;.include "routines/arithmatic/mult_test.s"
|
||||||
;.include "routines/arithmatic/div_test.s"
|
;.include "routines/arithmatic/div_test.s"
|
||||||
;.include "routines/circle/circle_test.s"
|
;.include "routines/circle/circle_test.s"
|
||||||
;.include "routines/circle/circle_test_size.s"
|
;.include "routines/circle/circle_test_size.s"
|
||||||
;.include "routines/circle/circle_test_position.s"
|
;.include "routines/circle/circle_test_position.s"
|
||||||
;.include "routines/line/line_test.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/text/char_draw_test.s"
|
||||||
;.include "routines/pixel/pixel_test.s"
|
;.include "routines/pixel/pixel_test.s"
|
||||||
;.include "routines/memory/memcpy_test.s"
|
;.include "routines/memory/memcpy_test.s"
|
||||||
|
@ -42,7 +39,7 @@ JMP exit
|
||||||
.include "routines/arithmatic/mult.s"
|
.include "routines/arithmatic/mult.s"
|
||||||
.include "routines/arithmatic/div.s"
|
.include "routines/arithmatic/div.s"
|
||||||
|
|
||||||
;batch_userprog:
|
batch_userprog:
|
||||||
;.incbin "userprog.bin", 0, 1024
|
.incbin "userprog.bin", 0, 1024
|
||||||
|
|
||||||
.include "END.s"
|
.include "END.s"
|
||||||
|
|
|
@ -20,46 +20,46 @@
|
||||||
|
|
||||||
;; More documentation on the Joystick port can be found here: https://www.c64-wiki.com/wiki/Joystick
|
;; More documentation on the Joystick port can be found here: https://www.c64-wiki.com/wiki/Joystick
|
||||||
|
|
||||||
|
|
||||||
progdest = $fe
|
progdest = $fe
|
||||||
CLKMASK = %00000010
|
CLKMASK = %00000010
|
||||||
CTRL1 = $DC01
|
CTRL1 = $DC01
|
||||||
|
|
||||||
setup_loader:
|
.org $80d
|
||||||
;; Bank out character ROM, I/O in
|
coldstart: ;; Draw an at sign on screen to show that program has loaded
|
||||||
lda #%00000100
|
lda #$0
|
||||||
ora $01
|
sta $400
|
||||||
sta $01
|
|
||||||
|
|
||||||
lda #$00
|
|
||||||
sta progdest
|
sta progdest
|
||||||
lda #$c0
|
lda #$c0
|
||||||
sta progdest+1
|
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
|
rts
|
||||||
|
|
||||||
maybe_download_userprog:
|
check_for_load_start:
|
||||||
;; Bank out character ROM, I/O in
|
|
||||||
lda #%00000100
|
|
||||||
ora $01
|
|
||||||
sta $01
|
|
||||||
|
|
||||||
lda #CLKMASK
|
lda #CLKMASK
|
||||||
bit CTRL1
|
bit CTRL1
|
||||||
bne download_userprog
|
bne start
|
||||||
|
|
||||||
lda #$00
|
lda #$00
|
||||||
rts
|
rts
|
||||||
|
start:
|
||||||
download_userprog:
|
|
||||||
.scope userprog_downloader
|
|
||||||
sei
|
sei
|
||||||
|
|
||||||
lda #$00
|
|
||||||
sta progdest
|
|
||||||
lda #$c0
|
|
||||||
sta progdest+1
|
|
||||||
|
|
||||||
;; change border color for debugging purposes
|
;; change border color for debugging purposes
|
||||||
ldx #$02 ; X needed for more than that debug color
|
ldx #$02
|
||||||
stx $d020
|
stx $d020
|
||||||
ldy #$00
|
ldy #$00
|
||||||
jmp new_byte
|
jmp new_byte
|
||||||
|
@ -70,9 +70,6 @@ wait_for_bit_start:
|
||||||
bit CTRL1
|
bit CTRL1
|
||||||
beq @loop
|
beq @loop
|
||||||
|
|
||||||
lda #$06
|
|
||||||
sta $d020
|
|
||||||
|
|
||||||
lda #CLKMASK
|
lda #CLKMASK
|
||||||
bit CTRL1
|
bit CTRL1
|
||||||
beq error
|
beq error
|
||||||
|
@ -125,7 +122,7 @@ wait_for_bit_end:
|
||||||
bit CTRL1
|
bit CTRL1
|
||||||
bne @loop
|
bne @loop
|
||||||
;; Debug show the clock is low
|
;; Debug show the clock is low
|
||||||
lda #$02
|
lda #$00
|
||||||
sta $d020
|
sta $d020
|
||||||
|
|
||||||
jmp wait_for_bit_start
|
jmp wait_for_bit_start
|
||||||
|
@ -140,11 +137,9 @@ error:
|
||||||
;; TODO
|
;; TODO
|
||||||
cli
|
cli
|
||||||
sec
|
sec
|
||||||
jmp $c000
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
BYTE = $400
|
BYTE = $400
|
||||||
LEN = $402
|
LEN = $402
|
||||||
stop: .word $0000
|
stop: .word $0000
|
||||||
loaded: .byte 0
|
loaded: .byte 0
|
||||||
.endscope
|
|
Loading…
Add table
Reference in a new issue