add spi code space

This commit is contained in:
matthias@rpi 2023-11-13 19:14:39 +01:00
parent 3b41b47ccd
commit 182b8a2d75
2 changed files with 25 additions and 3 deletions

View File

@ -1,6 +1,8 @@
MEMORY {
RAM_ZP: start = $0000, size = $100, type = rw, file = "", fill = yes;
RAM: start = $0100, size = $5eff, type = rw, file = "", fill = yes;
# RAM: start = $0100, size = $5eff, type = rw, file = "", fill = yes;
RAM: start = $0100, size = $4eff, type = rw, file = "", fill = yes;
SPI: start = $5000, size = $1000, type = rw, file = "spi.bin", fill = no;
VIA1: start = $6000, size = $600f, type = rw, file = "", fill = yes;
VIA2: start = $7000, size = $700f, type = rw, file = "", fill = yes;
ROM: start = $8000, size = $8000, type = ro, file = %O, fill = yes;
@ -13,4 +15,5 @@ SEGMENTS {
CODE: load = ROM, type = ro;
RODATA: load = ROM, type = ro;
RESET_VECTOR: load = ROM, type = ro, start = $FFFA;
SPI: load = SPI, type = rw;
}

View File

@ -6,6 +6,7 @@
;********************************************************************************
.include "system/system.s65"
.include "programs/print_slow.s65"
.ifndef INCLUDE_SPI
INCLUDE_SPI = 1
@ -14,7 +15,24 @@ INCLUDE_SPI = 1
.bss
SPI_PAGES_WRITTEN: .res 1
SPI_BYTES_WRITTEN: .res 1
SPI_CODE_START: .res $1000
.segment "SPI"
SPI_CODE_START: ; .res $1000
lda $1000
sta $1000
lda $1000
sta $1000
lda $1000
sta $1000
lda IO1 + IO::RA
lda IO1 + IO::RA
bra SPI_CODE_START
; jsr lcd_clear
; PrintSlow msg,20
; jmp home
; msg:
; .asciiz "YO DAS WAR SPI"
.code
.struct SPI_P_Pins
@ -54,8 +72,9 @@ SPI_CODE_START: .res $1000
DEBUG_LED_ON 0
; print received byte
lda SPI_IO + IO::SR
jsr lcd_char
sta SPI_CODE_START,x
inc SPI_BYTES_WRITTEN
jsr lcd_char
rts
.endproc