mockingboard: running out of RAM, load it high

This commit is contained in:
Vince Weaver 2018-02-07 19:00:38 -05:00
parent 5498666f2f
commit 8a430e86f3
4 changed files with 24 additions and 17 deletions

View File

@ -29,7 +29,7 @@ FREQUENT_CHAR EQU 0
;R: .res (1024-64) ; N-F
R EQU $4000
R EQU $9000
; Init
lzss_init:
@ -142,9 +142,7 @@ output_loop:
load_carry1:
store_byte:
sta (OUTPUTL),Y ; store byte to output
inc OUTPUTL ; increment address
bne sb_carry
inc OUTPUTH ; handle overflow
@ -188,23 +186,16 @@ done_logo:
rts
;============================================
; inc_pointer - increments the output pointer
;============================================
inc_pointer:
ldx #OUTPUTL
;==================================================
; inc16 - increments a 16-bit pointer in zero page
;==================================================
inc16:
inc 0,X ; increment address
bne no_carry
bne not_zero
inx
inc 0,X ; handle overflow
no_carry:
not_zero:
rts

View File

@ -0,0 +1,12 @@
MEMORY {
ZP: start = $00, size = $1A, type = rw;
RAM: start = $4000, size = $5000, file = %O;
}
SEGMENTS {
CODE: load = RAM, type = ro;
RODATA: load = RAM, type = ro;
DATA: load = RAM, type = rw;
BSS: load = RAM, type = bss, define = yes;
ZEROPAGE: load = ZP, type = zp;
}

View File

@ -9,7 +9,7 @@ mock.dsk: KSP_THEME_UNCOMPRESSED KSP_THEME_COMPRESSED \
KSP_THEME_INTERRUPT INTERRUPT_TEST
$(DOS33) -y mock_test.dsk BSAVE -a 0x1000 KSP_THEME_UNCOMPRESSED
$(DOS33) -y mock_test.dsk BSAVE -a 0x1000 KSP_THEME_COMPRESSED
$(DOS33) -y mock_test.dsk BSAVE -a 0xc00 KSP_THEME_INTERRUPT
$(DOS33) -y mock_test.dsk BSAVE -a 0x4000 KSP_THEME_INTERRUPT
$(DOS33) -y mock_test.dsk BSAVE -a 0x1000 INTERRUPT_TEST
KSP_THEME_COMPRESSED: ksp_theme_compressed.o
@ -21,10 +21,11 @@ ksp_theme_compressed.o: ksp_theme_compressed.s \
ca65 -o ksp_theme_compressed.o ksp_theme_compressed.s -l ksp_theme_compressed.lst
KSP_THEME_INTERRUPT: ksp_theme_interrupt.o
ld65 -o KSP_THEME_INTERRUPT ksp_theme_interrupt.o -C ../linker_scripts/apple2_c00.inc
ld65 -o KSP_THEME_INTERRUPT ksp_theme_interrupt.o -C ../linker_scripts/apple2_4000.inc
ksp_theme_interrupt.o: ksp_theme_interrupt.s \
../asm_routines/mockingboard.s \
../asm_routines/lzss_decompress.s \
ksp_title.inc
ca65 -o ksp_theme_interrupt.o ksp_theme_interrupt.s -l ksp_theme_interrupt.lst

View File

@ -107,7 +107,7 @@ mockingboard_found:
; Enable 6502 interrupts
;============================
;
cli ; clear interrupt mask
; cli ; clear interrupt mask
bit SET_GR ; graphics mode
@ -119,7 +119,7 @@ mockingboard_found:
; Graphics
;==========================
uncompress_graphics:
jsr lzss_init ; init R to zero
;jsr lzss_init ; init R to zero
lda #>ksp_title ; load logo pointer
sta BASH
@ -131,7 +131,7 @@ uncompress_graphics:
lda #<ksp_title_end
sta LZSS_ENDL
; HGR page 1
; HGR page 2
lda #>$2000
sta OUTH
lda #<$2000
@ -315,3 +315,6 @@ done_message: .asciiz "DONE PLAYING"
;=============
.include "ksp_title.inc"
.include "ksp_squad.inc"
.include "ksp_loading.inc"