Skip to content

Commit

Permalink
fixed verify bug for VRAM and skip IO implementation
Browse files Browse the repository at this point in the history
When verifying data in VRAM, the bank wrap check was executed
unconditionally, which caused verify errors if it reached address $c000.
New implementation: when loading large PRG files from 0801, it
skips now the IO area from $9f00 to $9fff, and loads the rest of
the program in banked RAM. Same implementation as already implemented
in C with LOAD_HYPERCALLS enabled, and with the "-prg" argument of the
emulator, see here:
commanderx16/x16-emulator#188
  • Loading branch information
Frank-Buss committed Nov 3, 2019
1 parent 665891d commit 9547ea7
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions kernal/load.s
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,24 @@ ld60 inc eal ;increment store addr
;
;if necessary, wrap to next bank
;
lda eah
cmp #$c0 ;reached top of high ram?
bne ld64 ;no
lda verck ;check mode
beq ld62 ;verify
bpl ld64 ;loading into vram
ld62 lda #$a0 ;wrap to bottom of high ram
lda eah
cmp #$c0 ;reached top of high ram?
bne ld61 ;no
lda #$a0 ;wrap to bottom of high ram
sta eah
inc $9f61 ;move to next ram bank
;
;skip IO area
;
ld61 lda eah
cmp #$9f ;reached top of low ram?
bne ld64 ;no
lda #$a0 ;skip to start of high ram
sta eah
lda #0
sta $9f61

ld64 bit status ;eoi?
bvc ld40 ;no...continue load
Expand Down

0 comments on commit 9547ea7

Please sign in to comment.