1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-01 13:41:34 +00:00

Merge pull request #2371 from alexthissen/lynx-upload

Lynx upload fixes for IRQ and configuration
This commit is contained in:
Bob Andrews 2024-01-22 15:50:40 +01:00 committed by GitHub
commit 7a7e98d799
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 14 deletions

View File

@ -5,16 +5,17 @@ SYMBOLS {
__BANK1BLOCKSIZE__: type = weak, value = $0000; # bank 1 block size __BANK1BLOCKSIZE__: type = weak, value = $0000; # bank 1 block size
__EXEHDR__: type = import; __EXEHDR__: type = import;
__BOOTLDR__: type = import; __BOOTLDR__: type = import;
__DEFDIR__: type = import;
__UPLOADER__: type = import; __UPLOADER__: type = import;
__UPLOADERSIZE__: type = export, value = $61;
__HEADERSIZE__: type = export, value = 64;
} }
MEMORY { MEMORY {
ZP: file = "", define = yes, start = $0000, size = $0100; ZP: file = "", define = yes, start = $0000, size = $0100;
HEADER: file = %O, start = $0000, size = $0040; HEADER: file = %O, start = $0000, size = __HEADERSIZE__;
BOOT: file = %O, start = $0200, size = __STARTOFDIRECTORY__; BOOT: file = %O, start = $0200, size = __STARTOFDIRECTORY__;
DIR: file = %O, start = $0000, size = 8; DIR: file = %O, start = $0000, size = 16;
MAIN: file = %O, define = yes, start = $0200, size = $BD38 - __STACKSIZE__; MAIN: file = %O, define = yes, start = $0200, size = $C038 - __UPLOADERSIZE__ - $200 - __STACKSIZE__;
UPLDR: file = %O, define = yes, start = $BFDC, size = $005C; UPLOAD: file = %O, define = yes, start = $C038 - __UPLOADERSIZE__, size = $0061;
} }
SEGMENTS { SEGMENTS {
ZEROPAGE: load = ZP, type = zp; ZEROPAGE: load = ZP, type = zp;
@ -30,8 +31,8 @@ SEGMENTS {
RODATA: load = MAIN, type = ro, define = yes; RODATA: load = MAIN, type = ro, define = yes;
DATA: load = MAIN, type = rw, define = yes; DATA: load = MAIN, type = rw, define = yes;
BSS: load = MAIN, type = bss, define = yes; BSS: load = MAIN, type = bss, define = yes;
UPCODE: load = UPLDR, type = ro, define = yes; UPCODE: load = UPLOAD, type = ro, define = yes;
UPDATA: load = UPLDR, type = rw, define = yes; UPDATA: load = UPLOAD, type = rw, define = yes;
} }
FEATURES { FEATURES {
CONDES: type = constructor, CONDES: type = constructor,

View File

@ -18,7 +18,7 @@
.import ldeaxysp, decsp2, pushax, incsp8 .import ldeaxysp, decsp2, pushax, incsp8
.import tosandeax,decax1,tosdiveax,axlong,ldaxysp .import tosandeax,decax1,tosdiveax,axlong,ldaxysp
.import lynxskip0, lynxblock,tosasreax .import lynxskip0, lynxblock,tosasreax
.import __BLOCKSIZE__ .import __BANK0BLOCKSIZE__
.importzp _FileCurrBlock .importzp _FileCurrBlock
.segment "CODE" .segment "CODE"
@ -32,15 +32,15 @@
jsr ldeaxysp jsr ldeaxysp
jsr pusheax jsr pusheax
ldx #$00 ldx #$00
lda #<(__BLOCKSIZE__/1024 + 9) lda #<(__BANK0BLOCKSIZE__/1024 + 9)
jsr tosasreax jsr tosasreax
sta _FileCurrBlock sta _FileCurrBlock
jsr lynxblock jsr lynxblock
ldy #$05 ldy #$05
jsr ldeaxysp jsr ldeaxysp
jsr pusheax jsr pusheax
lda #<(__BLOCKSIZE__-1) lda #<(__BANK0BLOCKSIZE__-1)
ldx #>(__BLOCKSIZE__-1) ldx #>(__BANK0BLOCKSIZE__-1)
jsr axlong jsr axlong
jsr tosandeax jsr tosandeax
eor #$FF eor #$FF

View File

@ -17,7 +17,7 @@
.include "extzp.inc" .include "extzp.inc"
.export lynxskip0, lynxread0 .export lynxskip0, lynxread0
.export lynxblock .export lynxblock
.import __BLOCKSIZE__ .import __BANK0BLOCKSIZE__
.code .code
@ -88,7 +88,7 @@ lynxblock:
lda __iodat lda __iodat
sta IODAT sta IODAT
stz _FileBlockByte stz _FileBlockByte
lda #<($100-(>__BLOCKSIZE__)) lda #<($100-(>__BANK0BLOCKSIZE__))
sta _FileBlockByte+1 sta _FileBlockByte+1
ply ply
plx plx

View File

@ -33,7 +33,7 @@ loop1:
cont1: cont1:
jsr read_byte jsr read_byte
sta (load_ptr2),y sta (load_ptr2),y
sta PALETTE ; feedback ;-) sta PALETTE + 1 ; feedback ;-)
iny iny
bne loop1 bne loop1
inc load_ptr2+1 inc load_ptr2+1
@ -69,6 +69,8 @@ again:
; last action : clear interrupt ; last action : clear interrupt
; ;
exit: exit:
lda #$10
sta INTRST
clc clc
rts rts