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

Source listing in bootstrap.s is incorrect.

The OSI C1P alternative boot file format works, but the code in the
source listing does not match the ASCII-coded hex translation (which
is actually used). This is confusing to anyone trying to maintain the
code.

Also, the source code did not assemble when ASM is defined.

Also removed use of branch macros and an unnecessary "<" operator.

With these changes the source file should correctly match what
is used at run time.
This commit is contained in:
Jeff Tranter 2023-04-30 18:40:09 -04:00
parent e5f4ca6b89
commit 4d97e30b55

View File

@ -34,7 +34,7 @@ ram_top := __MAIN_START__ + __MAIN_SIZE__
.ifdef ASM
.include "osic1p.inc"
.include "screen-c1p-24x24.s"
.macpack generic
load := $08 ; private variables
@ -45,21 +45,23 @@ GETCHAR := $FFBF ; gets one character from ACIA
FIRSTVISC = $85 ; Offset of first visible character in video RAM
LINEDIST = $20 ; Offset in video RAM between two lines
ldy #<$0000
ldy #$00
lda #<load_addr
ldx #>load_addr
sta load
stx load+1
ldx #(<load_size) + 1
stx count
ldx #(>load_size) + 1
stx count+1 ; save size with each byte incremented separately
lda #<load_size
eor #$FF
sta count
lda #>load_size
eor #$FF
sta count+1
L1: dec count
bnz L2
dec count+1
bze L3
L1: inc count
bne L2
inc count+1
beq L3
L2: jsr GETCHAR ; (doesn't change .Y)
sta (load),y
@ -70,12 +72,12 @@ L2: jsr GETCHAR ; (doesn't change .Y)
lsr a
and #8 - 1
ora #$10 ; eight arrow characters
sta SCRNBASE + FIRSTVISC + 2 * LINEDIST + 11
sta C1P_SCR_BASE + FIRSTVISC + 2 * LINEDIST + 11
iny
bnz L1
bne L1
inc load+1
bnz L1 ; branch always
bne L1 ; branch always
L3: jmp load_addr