The 717260 patch consist of three parts:
The parts are combined into one Newton installer package. The patch installer is triggering the installation of the first two embedded packages.
The files in the package can be split into four groups. The patch packages are constructed out of NSOF stream objects, which in turn are either extracted from the original patch verbatim, or generated by the Newton C++ tools by linking compiled code together.
The REx patch part patches the ROM extension found at address 0x01e00000.
The ROM patch part patches the jump tables starting at 0x01a00000.
The ROM and REx patches are combined into sequential areas. This is the layout of the ROM patch:
% Physical Address % Virtual Address % Source File % Section %
%------------------%-----------------%-------------%---------%
% 0x00000000 % % ROMMMU.s % MMU patch table, 8192 bytes of patch entries to patch 2048 MMU pages %
% 0x00002000 % 0x01d80000 % Patch1.s % %
% 0x00003000 % 0x01ae0000 % Patch2.s % %
% 0x00004000 % 0x01b40000 % Patch3.s % %
% 0x00005000 % 0x01a8c000 % Patch4.s % %
% 0x00006000 % 0x01bac000 % Patch5.s % %
% 0x00007000 % 0x01c11000 % Patch6.s % %
Below is an example of how the TClassOneModem::PrepareCommand is patched. The function implementation is located at address 0x0006399c in the MP2x00 US ROM, and the jumptable entry is at address 0x01a16b3c. Patching the function is achieved by letting the jump table entry point to the patched function.
The ROMMMU.s file contains the first step for this, it maps the page starting at 0x01A16000 to RAM:
; patches of 0x2000
DontLoadPages 22 ; 0x01A00000 - 0x01A15000
LoadPage 2 ; 0x01A16000 needs to be patched
DontLoadPages 9 ; 0x01A17000 - 0x01A1F000
The next step is in Patch1.s, it contains the new page for address 0x01A16000:
L01D80B00
reORG SETA {PC} - 0x1A16B00
...
B 0x001B9AA8 + reORG
B 0x01B40C5C + reORG ; patch from 0x0006399C, address of the original function
B 0x001E0F68 + reORG
...
And the final part is in Patch6.s, where the new code for the TClassOneModem::PrepareCommand function is located at address 0x01B40C5C:
L01B40C3C
STMFD sp!,{R0,LR}
...
STMFD sp!,{R0,R1,LR}
BL 0x0006399C ; call to the original function, new code follows
LDMFD sp!,{R1,R2,LR}
TEQ R2,#15
MOVNE PC,LR
LDR R2,[R1,#1932]
ADD R2,R2,#0x000007D0
STR R2,[R1,#1932]
MOV PC,LR
Prerequisites are MPW, the Newton C++ tools and NTK. The steps to recreate the package are: