diff options
author | B. Watson <urchlay@slackware.uk> | 2025-04-28 08:13:55 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2025-04-28 08:13:55 -0400 |
commit | ba3ffa27f20b697a8bc1de49a582efdef2182231 (patch) | |
tree | c4727544047323fa638b424e6a7d540af62ad0e2 /reloc.s | |
parent | 7dcc80ef56ec8284da6615721dba64c9aa075686 (diff) | |
download | atari8-self-relocator-ba3ffa27f20b697a8bc1de49a582efdef2182231.tar.gz |
reloc.s: remove redundant code, handle code_run correctly.
Diffstat (limited to 'reloc.s')
-rw-r--r-- | reloc.s | 24 |
1 files changed, 11 insertions, 13 deletions
@@ -70,9 +70,7 @@ exitwait: sta COLOR2 rts .else - lda #$40 ; turn the screen red... - sta COLOR2 -freeze: bne freeze ; wait for the user to press Reset. +freeze: bcc freeze ; wait for the user to press Reset. .endif relocate_code: @@ -114,8 +112,6 @@ relocate_code: ; KISS principle. ldy #0 move_loop: - lda (code_ptr),y - pha cpx #8 bne shiftit @@ -131,8 +127,9 @@ tpok: sta shfreg shiftit: + ; get next bit from bitmap byte inx - pla + lda (code_ptr),y asl shfreg bcc dontadj sbc offset_pages @@ -162,15 +159,16 @@ dontadj: adc MEMLO+1 sta MEMLO+1 ; MEMLO now MEMLO + code length + 1 byte - ; is RUNAD in our code space? If not, it points somewhere - ; within DOS, and shouldn't be altered. - lda RUNAD+1 - cmp code_start+1 - bcc do_init + ; do we have a run address? + lda code_run+1 + beq do_init ; no: $00xx not valid. - ; fix up RUNAD - sbc offset_pages ; carry already set by the cmp above + ; point RUNAD at adjusted run address. + sec + sbc offset_pages sta RUNAD+1 + lda code_run + sta RUNAD do_init: ; if there's an init address, call it (just like DOS would). |