Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The QuickEdit and WordFinder applications expect to execute from a 128KB Eprom. Their bank switching code uses static addressing, so if they are not blown to the last banks in a card this will fail. Several fixes to the code are needed to convert it to relative bank addressing.

Method

The Application DORs reveal that the application code resides in SPELL.63 (mostly WordFinder) and SPELL.62 (mostly QuickEdit, though some functions are called from SPELL.63). The remaining six banks, SPELL.56 to SPELL 61, comprise the dictionary.

...

This patching task was complicated by the WordFinder bank switching code being situated before the executable entry point, nestled in between the two Application DORs. My initial disassembly starting at file offset $01D1 (entry point) had missed this, wasting a lot of time.

SPELL.62

Original code location 1:

...

Code Block
; Address $C286, or offset $0286 in SPELL.62

.hook_function_in_bank_63
; IN:
;   A = Position in function jump table ($00 to $0A)
;
    PUSH AF                          ; F5           Store function input on stack
    LD   C, $03                      ; OE 03
    OZ   OS_Mgb                      ; E7 5A        Get bank bound to segment 3 (running bank), stored in B
    INC  B                           ; 04           Increment B to pick next bank address (SPELL.63)
    NOP                              ; 00
    NOP                              ; 00
    NOP                              ; 00
    NOP                              ; 00
    NOP                              ; 00
    LD   C, $01                      ; 0E 01
    OZ   OS_Mpb                      ; E7 5D        Bind SPELL.63 into segment 1
    JP   $7F80                       ; C3 80 7F     Jump to $7F80 in segment 1 (file offset $3F80)

SPELL.63

Original code location 1:

...

Code Block
; Address $7F8B, or offset $3F8B in SPELL.63

    LD   C, $01                      ; 0E 01
    OZ   OS_Mgb                      ; E7 5A        Get bank bound to segment 1 (running bank), stored in B
    DEC  B                           ; 05           Decrement B to pick preceding bank address (SPELL.62)
    NOP                              ; 00
    NOP                              ; 00
    NOP                              ; 00
    NOP                              ; 00
    NOP                              ; 00
    LD   C, $03                      ; 0E 03    
    OZ   OS_Mpb                      ; E7 5D        Bind that bank address to segment 3
    POP  DE                          ; D1
    POP  BC                          ; C1
    POP  HL                          ; E1
    POP  AF                          ; F1           Restore register states from stack
    RET                              ; C9           Return

Download Patches

These patches are published in the IPS format, popular for ROM patches.

...