diff options
| -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).  | 
