libsrc/atari/system_check.s: fix MEMLO check
Old check forced the program's load address to be one more than MEMLO. But MEMLO points to the first byte of usable RAM, not the last byte of unusable RAM. Problem found by Flashjazzcat, see https://github.com/cc65/cc65/issues/2964.
This commit is contained in:
1 parent
7ff3dfdabf
commit
b4e66ea886
1 file changed
+9
-9
@@ -136,10 +136,10 @@ sys_ok: jsr sdcheck ; check for SpartaDOS-X, and if found, whether i
|
||||
|
||||
sd_ok: .include "xlmemchk.inc" ; calculate lowest address we will use when we move the screen buffer down
|
||||
|
||||
lda MEMLO
|
||||
cmp lowadr
|
||||
lda MEMLO+1
|
||||
sbc lowadr+1
|
||||
;lda lowadr ; already loaded in xlmemchk.inc
|
||||
cmp MEMLO
|
||||
lda lowadr+1
|
||||
sbc MEMLO+1
|
||||
bcc memlo_ok
|
||||
|
||||
; load address was too low
|
||||
@@ -184,11 +184,11 @@ syschk:
|
||||
|
||||
bcc mem_err ; program doesn't fit into memory
|
||||
|
||||
lda MEMLO
|
||||
cmp #<__STARTADDRESS__
|
||||
lda MEMLO+1
|
||||
sbc #>__STARTADDRESS__
|
||||
bcc memlo_ok
|
||||
lda #<__STARTADDRESS__
|
||||
cmp MEMLO
|
||||
lda #>__STARTADDRESS__
|
||||
sbc MEMLO+1
|
||||
bcs memlo_ok
|
||||
|
||||
; load address was too low
|
||||
print_string2 lmemerr_txt, lmemerr_txt_len
|
||||
|
||||
Reference in new issue
Block a user