Commit ebcdb861 authored by Jeffrey Lee's avatar Jeffrey Lee

Add ROM patches for the ADFS "disc error 20" fix

Detail:
  This set of changes adds a "disc error 20" fix to ADFS for RISC OS 3.50 thru 4.02, using similar code to that used for the fix that was applied to ADFS itself (in ADFS 3.54). This is to resolve issues with modern IDE devices which don't adhere to the DRQ timeout that old versions of the ATA spec mandated.
  File changes (all within Source/ROMPatch):
  - patches/s/ADFS354 - Generic assembler source for the disc error 20 fix
  - ihf2c/c/ihf2c - Source for a C utility that was used to help produce the ROM patch data
  - patches/adfs354,feb - Utility script for building the different versions of the ADFS patch and converting to ROMPatch form
  - patches/350/h/ADFSpatch, patches/360/h/ADFSpatch, patches/370/h/ADFSpatch, patches/371/h/ADFSpatch, patches/402/h/ADFSpatch - Added/updated ADFS patches
  - patches/350/h/patch, patches/371/h/patch, patches/402/h/patch - Include new ADFSpatch files where relevant
  - UK/h/messages - Update ROMPatch version numbers
  - c/rompatch, s/module - Add a word of writable workspace to the module which the ADFS patch can use
  - patches/402/h/CDSFTpatch - Remove duplicate patch (duplicate of RESLVpatch)
  - patches/402/h/MSGSpatch - Document the patches
  - ReadMe, Install/ROMPatch/!RunImage,ff8 - Remove redundant/outdated files (the main Boot makefile will build and install ROMPatch for us)
Admin:
  Tested on a RISC OS 3.70 StrongARM RiscPC with a CF-IDE adapter, disc error 20 is no more
  3.50/3.60/3.70/3.71/4.02 also tested under RPCEmu, manually provoking the different code paths to check hook points are correct


Version 1.26. Tagged as 'Boot-1_26'
parent 5af9987e
New version of ROMPatch, introduced to patch 3.70,
and added to source tree for 3.71.
*** There is no proper make install - if changed, the ***
*** new !!ROMPatch obey file and ROMPatch directory ***
*** (from Install directory) should be placed in: ***
*** ***
*** Sources.SystemRes.Boot.RO360Hook.Boot.PreDesk ***
[ This release of ROMPatches also supports patching 3.60.
To achieve this, the !!ROMPatch obey file and the ROMPatch
directory should be in !Boot.Choices.Boot.Tasks in the
3.6 !Boot. ]
......@@ -15,11 +15,11 @@
/* UK/messages.h */
#define M_name350 "ROM patches 3.50/2"
#define M_name360 "ROM patches 3.60/2"
#define M_name370 "ROM patches 3.70/3"
#define M_name371 "ROM patches 3.71/1"
#define M_name402 "ROM patches 4.02/5"
#define M_name350 "ROM patches 3.50/3"
#define M_name360 "ROM patches 3.60/3"
#define M_name370 "ROM patches 3.70/4"
#define M_name371 "ROM patches 3.71/2"
#define M_name402 "ROM patches 4.02/6"
#define E_ROMunknown "No patches for this ROM\n"
#define E_malloc "Not enough memory (malloc)\n"
......
......@@ -46,7 +46,7 @@
#include "UK/messages.h"
/* implemented in assembler */
extern uint32 module,moduleend,myflush;
extern uint32 module,moduleend,myflush,adfs354_word;
extern uint32 modDAhandler,moddata;
extern uint32 svcarmid(void);
extern void svccopy(uint32 *src, uint32 *dest, int bytes);
......@@ -57,6 +57,9 @@ extern void svcsetROML1PT(uint32 *L1PTaddr, uint32 *L1PTvals, int count, void
/* currently considered ROM size in bytes */
uint32 ROMsize;
/* Patched up once module inserted */
uint32 adfs354_word_addr = 0;
/* ROMs and their patches */
#include "patches/patch.h"
......@@ -578,6 +581,7 @@ int main(int argc, char *argv[])
/* insert module first, since DAhandler code there */
RMAaddr = insert_ROMPatches_module();
DAhandler_addr = (uint32)(&modDAhandler) - (uint32)(&module) + RMAaddr;
adfs354_word_addr = (uint32)(&adfs354_word) - (uint32)(&module) + RMAaddr;
/* 1 extra page required for L2PT entries */
patchDAsize = (Npatchpages + 1) << 12;
......
/* Copyright 2018 Castle Technology Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* convert IHF file to style required for ROM patch
only copes with IHF files containing single segments! */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
if (argc != 3)
{
fprintf(stderr,"usage: ihf2c <infile> <outfile>\n");
exit(1);
}
FILE *in = fopen(argv[1],"r");
FILE *out = fopen(argv[2],"w");
if ((in == NULL) || (out == NULL))
{
fprintf(stderr,"failed to open file(s)\n");
exit(1);
}
char buf[1024];
unsigned long base = 0;
while(fgets(buf,1024,in))
{
if (strstr(buf," segment based at "))
{
base = strtoul(buf+strlen(buf)-10,NULL,16);
}
if ((buf[0] == ':') && (strlen(buf) > 13))
{
char *c = buf+12;
if (!base)
{
fprintf(stderr,"base not set\n");
exit(1);
}
while (strlen(c) > 8)
{
fprintf(out," {(uint32 *)0x%08x, 0xffffffff, 0x%.8s},\n",base,c);
base += 4;
c += 8;
}
}
}
fclose(in);
fclose(out);
}
/* Copyright 2018 Castle Technology Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* patches/350/ADFSpatch.h */
static patchentry_t *ADFSpatches350_proc(void *handle)
{
static patchentry_t ADFSpatches350[] =
{
/* addr old new */
/* Disc error 20 hook */
{(uint32 *)0x038FC528, 0x03A00020, 0x0A03FEB4},
{(uint32 *)0x038FC52C, 0x08BD437E, 0xE1A00000},
{(uint32 *)0x038FC530, 0x039EF201, 0xE1A00000},
/* Disc error 20 patch */
{(uint32 *)0x039fc000, 0xffffffff, 0xE3A0E302},
{(uint32 *)0x039fc004, 0xffffffff, 0xE11E000F},
{(uint32 *)0x039fc008, 0xffffffff, 0x013EF00F},
{(uint32 *)0x039fc00c, 0xffffffff, 0x13A0E000},
{(uint32 *)0x039fc010, 0xffffffff, 0xE59C120C},
{(uint32 *)0x039fc014, 0xffffffff, 0xE59F2098},
{(uint32 *)0x039fc018, 0xffffffff, 0xE5821000},
{(uint32 *)0x039fc01c, 0xffffffff, 0xE3A01001},
{(uint32 *)0x039fc020, 0xffffffff, 0xE58C120C},
{(uint32 *)0x039fc024, 0xffffffff, 0xE28F1008},
{(uint32 *)0x039fc028, 0xffffffff, 0xE58C1210},
{(uint32 *)0x039fc02c, 0xffffffff, 0xE13EF00F},
{(uint32 *)0x039fc030, 0xffffffff, 0xE8BD837E},
{(uint32 *)0x039fc034, 0xffffffff, 0xE92D4001},
{(uint32 *)0x039fc038, 0xffffffff, 0xE1A0000F},
{(uint32 *)0x039fc03c, 0xffffffff, 0xE33FF3C2},
{(uint32 *)0x039fc040, 0xffffffff, 0xE1A00000},
{(uint32 *)0x039fc044, 0xffffffff, 0xE92D49FF},
{(uint32 *)0x039fc048, 0xffffffff, 0xE59CB214},
{(uint32 *)0x039fc04c, 0xffffffff, 0xE59F3060},
{(uint32 *)0x039fc050, 0xffffffff, 0xE5932000},
{(uint32 *)0x039fc054, 0xffffffff, 0xE2522001},
{(uint32 *)0x039fc058, 0xffffffff, 0x0A00000F},
{(uint32 *)0x039fc05c, 0xffffffff, 0xE5DB0818},
{(uint32 *)0x039fc060, 0xffffffff, 0xE3100008},
{(uint32 *)0x039fc064, 0xffffffff, 0x05832000},
{(uint32 *)0x039fc068, 0xffffffff, 0x03A02001},
{(uint32 *)0x039fc06c, 0xffffffff, 0x0A000005},
{(uint32 *)0x039fc070, 0xffffffff, 0xE59C11FC},
{(uint32 *)0x039fc074, 0xffffffff, 0xE59C01DC},
{(uint32 *)0x039fc078, 0xffffffff, 0xE1A0E00F},
{(uint32 *)0x039fc07c, 0xffffffff, 0xE59CF22C},
{(uint32 *)0x039fc080, 0xffffffff, 0xE59F2028},
{(uint32 *)0x039fc084, 0xffffffff, 0xE58C2210},
{(uint32 *)0x039fc088, 0xffffffff, 0xE58C220C},
{(uint32 *)0x039fc08c, 0xffffffff, 0xE8BD49FF},
{(uint32 *)0x039fc090, 0xffffffff, 0xE13FF000},
{(uint32 *)0x039fc094, 0xffffffff, 0xE1A00000},
{(uint32 *)0x039fc098, 0xffffffff, 0xE8FD8001},
{(uint32 *)0x039fc09c, 0xffffffff, 0xE3A00020},
{(uint32 *)0x039fc0a0, 0xffffffff, 0xE59C21D0},
{(uint32 *)0x039fc0a4, 0xffffffff, 0xE59C31E8},
{(uint32 *)0x039fc0a8, 0xffffffff, 0xE5DC71BC},
{(uint32 *)0x039fc0ac, 0xffffffff, 0xEAFC018D},
{(uint32 *)0x039fc0b0, 0xffffffff, 0x038FC744},
{(uint32 *)0x039fc0b4, 0xffffffff, 0x00000000}, /* Patched with adfs354_word_addr below */
{(uint32 *)0,0,0}
};
ADFSpatches350[(sizeof(ADFSpatches350)/sizeof(patchentry_t))-2].newval = adfs354_word_addr;
return ADFSpatches350;
}
......@@ -25,6 +25,7 @@
#include "patches/350/IICMpatch.h"
#include "patches/350/FCREpatch.h"
#include "patches/350/COLPpatch.h"
#include "patches/350/ADFSpatch.h"
static patchlist_proc patchlist350[] =
{
......@@ -35,6 +36,7 @@ static patchlist_proc patchlist350[] =
IICMpatches350_proc,
FCREpatches350_proc,
COLPpatches350_proc,
ADFSpatches350_proc,
NULL
};
......
......@@ -22,11 +22,67 @@ static patchentry_t *ADFSpatches360_proc(void *handle)
{
/* addr old new */
/* ADFSBuffers */
{(uint32 *)0x03934440, 0xE3540502, 0xE3540501},
{(uint32 *)0x03934444, 0x23E04000, 0x23E04102},
/* Disc error 20 hook */
{(uint32 *)0x039345C0, 0x03A00020, 0x0A08B28E},
{(uint32 *)0x039345C4, 0x08BD437E, 0xE1A00000},
{(uint32 *)0x039345C8, 0x039EF201, 0xE1A00000},
/* Disc error 20 patch */
{(uint32 *)0x03b61000, 0xffffffff, 0xE3A0E302},
{(uint32 *)0x03b61004, 0xffffffff, 0xE11E000F},
{(uint32 *)0x03b61008, 0xffffffff, 0x013EF00F},
{(uint32 *)0x03b6100c, 0xffffffff, 0x13A0E000},
{(uint32 *)0x03b61010, 0xffffffff, 0xE59C1220},
{(uint32 *)0x03b61014, 0xffffffff, 0xE59F2098},
{(uint32 *)0x03b61018, 0xffffffff, 0xE5821000},
{(uint32 *)0x03b6101c, 0xffffffff, 0xE3A01001},
{(uint32 *)0x03b61020, 0xffffffff, 0xE58C1220},
{(uint32 *)0x03b61024, 0xffffffff, 0xE28F1008},
{(uint32 *)0x03b61028, 0xffffffff, 0xE58C1224},
{(uint32 *)0x03b6102c, 0xffffffff, 0xE13EF00F},
{(uint32 *)0x03b61030, 0xffffffff, 0xE8BD837E},
{(uint32 *)0x03b61034, 0xffffffff, 0xE92D4001},
{(uint32 *)0x03b61038, 0xffffffff, 0xE1A0000F},
{(uint32 *)0x03b6103c, 0xffffffff, 0xE33FF3C2},
{(uint32 *)0x03b61040, 0xffffffff, 0xE1A00000},
{(uint32 *)0x03b61044, 0xffffffff, 0xE92D49FF},
{(uint32 *)0x03b61048, 0xffffffff, 0xE59CB228},
{(uint32 *)0x03b6104c, 0xffffffff, 0xE59F3060},
{(uint32 *)0x03b61050, 0xffffffff, 0xE5932000},
{(uint32 *)0x03b61054, 0xffffffff, 0xE2522001},
{(uint32 *)0x03b61058, 0xffffffff, 0x0A00000F},
{(uint32 *)0x03b6105c, 0xffffffff, 0xE5DB0818},
{(uint32 *)0x03b61060, 0xffffffff, 0xE3100008},
{(uint32 *)0x03b61064, 0xffffffff, 0x05832000},
{(uint32 *)0x03b61068, 0xffffffff, 0x03A02001},
{(uint32 *)0x03b6106c, 0xffffffff, 0x0A000005},
{(uint32 *)0x03b61070, 0xffffffff, 0xE59C1208},
{(uint32 *)0x03b61074, 0xffffffff, 0xE59C01E8},
{(uint32 *)0x03b61078, 0xffffffff, 0xE1A0E00F},
{(uint32 *)0x03b6107c, 0xffffffff, 0xE59CF240},
{(uint32 *)0x03b61080, 0xffffffff, 0xE59F2028},
{(uint32 *)0x03b61084, 0xffffffff, 0xE58C2224},
{(uint32 *)0x03b61088, 0xffffffff, 0xE58C2220},
{(uint32 *)0x03b6108c, 0xffffffff, 0xE8BD49FF},
{(uint32 *)0x03b61090, 0xffffffff, 0xE13FF000},
{(uint32 *)0x03b61094, 0xffffffff, 0xE1A00000},
{(uint32 *)0x03b61098, 0xffffffff, 0xE8FD8001},
{(uint32 *)0x03b6109c, 0xffffffff, 0xE3A00020},
{(uint32 *)0x03b610a0, 0xffffffff, 0xE59C21D4},
{(uint32 *)0x03b610a4, 0xffffffff, 0xE59C31F4},
{(uint32 *)0x03b610a8, 0xffffffff, 0xE5DC71BC},
{(uint32 *)0x03b610ac, 0xffffffff, 0xEAF74DBA},
{(uint32 *)0x03b610b0, 0xffffffff, 0x03934818},
{(uint32 *)0x03b610b4, 0xffffffff, 0x00000000}, /* Patched with adfs354_word_addr below */
{(uint32 *)0,0,0}
};
ADFSpatches360[(sizeof(ADFSpatches360)/sizeof(patchentry_t))-2].newval = adfs354_word_addr;
return ADFSpatches360;
}
......@@ -22,11 +22,67 @@ static patchentry_t *ADFSpatches370_proc(void *handle)
{
/* addr old new */
/* ADFSBuffers */
{(uint32 *)0x0394B940, 0xE3540502, 0xE3540501},
{(uint32 *)0x0394B944, 0x23E04000, 0x23E04102},
/* Disc error 20 hook */
{(uint32 *)0x0394BAC0, 0x03A00020, 0x0A09694E},
{(uint32 *)0x0394BAC4, 0x08BD437E, 0xE1A00000},
{(uint32 *)0x0394BAC8, 0x039EF201, 0xE1A00000},
/* Disc error 20 patch */
{(uint32 *)0x03ba6000, 0xffffffff, 0xE3A0E302},
{(uint32 *)0x03ba6004, 0xffffffff, 0xE11E000F},
{(uint32 *)0x03ba6008, 0xffffffff, 0x013EF00F},
{(uint32 *)0x03ba600c, 0xffffffff, 0x13A0E000},
{(uint32 *)0x03ba6010, 0xffffffff, 0xE59C1220},
{(uint32 *)0x03ba6014, 0xffffffff, 0xE59F2098},
{(uint32 *)0x03ba6018, 0xffffffff, 0xE5821000},
{(uint32 *)0x03ba601c, 0xffffffff, 0xE3A01001},
{(uint32 *)0x03ba6020, 0xffffffff, 0xE58C1220},
{(uint32 *)0x03ba6024, 0xffffffff, 0xE28F1008},
{(uint32 *)0x03ba6028, 0xffffffff, 0xE58C1224},
{(uint32 *)0x03ba602c, 0xffffffff, 0xE13EF00F},
{(uint32 *)0x03ba6030, 0xffffffff, 0xE8BD837E},
{(uint32 *)0x03ba6034, 0xffffffff, 0xE92D4001},
{(uint32 *)0x03ba6038, 0xffffffff, 0xE1A0000F},
{(uint32 *)0x03ba603c, 0xffffffff, 0xE33FF3C2},
{(uint32 *)0x03ba6040, 0xffffffff, 0xE1A00000},
{(uint32 *)0x03ba6044, 0xffffffff, 0xE92D49FF},
{(uint32 *)0x03ba6048, 0xffffffff, 0xE59CB228},
{(uint32 *)0x03ba604c, 0xffffffff, 0xE59F3060},
{(uint32 *)0x03ba6050, 0xffffffff, 0xE5932000},
{(uint32 *)0x03ba6054, 0xffffffff, 0xE2522001},
{(uint32 *)0x03ba6058, 0xffffffff, 0x0A00000F},
{(uint32 *)0x03ba605c, 0xffffffff, 0xE5DB0818},
{(uint32 *)0x03ba6060, 0xffffffff, 0xE3100008},
{(uint32 *)0x03ba6064, 0xffffffff, 0x05832000},
{(uint32 *)0x03ba6068, 0xffffffff, 0x03A02001},
{(uint32 *)0x03ba606c, 0xffffffff, 0x0A000005},
{(uint32 *)0x03ba6070, 0xffffffff, 0xE59C1208},
{(uint32 *)0x03ba6074, 0xffffffff, 0xE59C01E8},
{(uint32 *)0x03ba6078, 0xffffffff, 0xE1A0E00F},
{(uint32 *)0x03ba607c, 0xffffffff, 0xE59CF240},
{(uint32 *)0x03ba6080, 0xffffffff, 0xE59F2028},
{(uint32 *)0x03ba6084, 0xffffffff, 0xE58C2224},
{(uint32 *)0x03ba6088, 0xffffffff, 0xE58C2220},
{(uint32 *)0x03ba608c, 0xffffffff, 0xE8BD49FF},
{(uint32 *)0x03ba6090, 0xffffffff, 0xE13FF000},
{(uint32 *)0x03ba6094, 0xffffffff, 0xE1A00000},
{(uint32 *)0x03ba6098, 0xffffffff, 0xE8FD8001},
{(uint32 *)0x03ba609c, 0xffffffff, 0xE3A00020},
{(uint32 *)0x03ba60a0, 0xffffffff, 0xE59C21D4},
{(uint32 *)0x03ba60a4, 0xffffffff, 0xE59C31F4},
{(uint32 *)0x03ba60a8, 0xffffffff, 0xE5DC71BC},
{(uint32 *)0x03ba60ac, 0xffffffff, 0xEAF696FA},
{(uint32 *)0x03ba60b0, 0xffffffff, 0x0394BD18},
{(uint32 *)0x03ba60b4, 0xffffffff, 0x00000000}, /* Patched with adfs354_word_addr below */
{(uint32 *)0,0,0}
};
ADFSpatches370[(sizeof(ADFSpatches370)/sizeof(patchentry_t))-2].newval = adfs354_word_addr;
return ADFSpatches370;
}
/* Copyright 2018 Castle Technology Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* patches/371/ADFSpatch.h */
static patchentry_t *ADFSpatches371_proc(void *handle)
{
static patchentry_t ADFSpatches371[] =
{
/* addr old new */
/* Disc error 20 hook */
{(uint32 *)0x0394F510, 0x03A00020, 0x0A0966BA},
{(uint32 *)0x0394F514, 0x08BD437E, 0xE1A00000},
{(uint32 *)0x0394F518, 0x039EF201, 0xE1A00000},
/* Disc error 20 patch */
{(uint32 *)0x03ba9000, 0xffffffff, 0xE3A0E302},
{(uint32 *)0x03ba9004, 0xffffffff, 0xE11E000F},
{(uint32 *)0x03ba9008, 0xffffffff, 0x013EF00F},
{(uint32 *)0x03ba900c, 0xffffffff, 0x13A0E000},
{(uint32 *)0x03ba9010, 0xffffffff, 0xE59C1220},
{(uint32 *)0x03ba9014, 0xffffffff, 0xE59F2098},
{(uint32 *)0x03ba9018, 0xffffffff, 0xE5821000},
{(uint32 *)0x03ba901c, 0xffffffff, 0xE3A01001},
{(uint32 *)0x03ba9020, 0xffffffff, 0xE58C1220},
{(uint32 *)0x03ba9024, 0xffffffff, 0xE28F1008},
{(uint32 *)0x03ba9028, 0xffffffff, 0xE58C1224},
{(uint32 *)0x03ba902c, 0xffffffff, 0xE13EF00F},
{(uint32 *)0x03ba9030, 0xffffffff, 0xE8BD837E},
{(uint32 *)0x03ba9034, 0xffffffff, 0xE92D4001},
{(uint32 *)0x03ba9038, 0xffffffff, 0xE1A0000F},
{(uint32 *)0x03ba903c, 0xffffffff, 0xE33FF3C2},
{(uint32 *)0x03ba9040, 0xffffffff, 0xE1A00000},
{(uint32 *)0x03ba9044, 0xffffffff, 0xE92D49FF},
{(uint32 *)0x03ba9048, 0xffffffff, 0xE59CB228},
{(uint32 *)0x03ba904c, 0xffffffff, 0xE59F3060},
{(uint32 *)0x03ba9050, 0xffffffff, 0xE5932000},
{(uint32 *)0x03ba9054, 0xffffffff, 0xE2522001},
{(uint32 *)0x03ba9058, 0xffffffff, 0x0A00000F},
{(uint32 *)0x03ba905c, 0xffffffff, 0xE5DB0818},
{(uint32 *)0x03ba9060, 0xffffffff, 0xE3100008},
{(uint32 *)0x03ba9064, 0xffffffff, 0x05832000},
{(uint32 *)0x03ba9068, 0xffffffff, 0x03A02001},
{(uint32 *)0x03ba906c, 0xffffffff, 0x0A000005},
{(uint32 *)0x03ba9070, 0xffffffff, 0xE59C1208},
{(uint32 *)0x03ba9074, 0xffffffff, 0xE59C01E8},
{(uint32 *)0x03ba9078, 0xffffffff, 0xE1A0E00F},
{(uint32 *)0x03ba907c, 0xffffffff, 0xE59CF240},
{(uint32 *)0x03ba9080, 0xffffffff, 0xE59F2028},
{(uint32 *)0x03ba9084, 0xffffffff, 0xE58C2224},
{(uint32 *)0x03ba9088, 0xffffffff, 0xE58C2220},
{(uint32 *)0x03ba908c, 0xffffffff, 0xE8BD49FF},
{(uint32 *)0x03ba9090, 0xffffffff, 0xE13FF000},
{(uint32 *)0x03ba9094, 0xffffffff, 0xE1A00000},
{(uint32 *)0x03ba9098, 0xffffffff, 0xE8FD8001},
{(uint32 *)0x03ba909c, 0xffffffff, 0xE3A00020},
{(uint32 *)0x03ba90a0, 0xffffffff, 0xE59C21D4},
{(uint32 *)0x03ba90a4, 0xffffffff, 0xE59C31F4},
{(uint32 *)0x03ba90a8, 0xffffffff, 0xE5DC71BC},
{(uint32 *)0x03ba90ac, 0xffffffff, 0xEAF6998E},
{(uint32 *)0x03ba90b0, 0xffffffff, 0x0394F768},
{(uint32 *)0x03ba90b4, 0xffffffff, 0x00000000}, /* Patched with adfs354_word_addr below */
{(uint32 *)0,0,0}
};
ADFSpatches371[(sizeof(ADFSpatches371)/sizeof(patchentry_t))-2].newval = adfs354_word_addr;
return ADFSpatches371;
}
......@@ -19,10 +19,12 @@
#include "patches/371/ROMcrc.h"
#include "patches/371/CLIBpatch.h"
#include "patches/371/ADFSpatch.h"
static patchlist_proc patchlist371[] =
{
CLIBpatches371_proc,
ADFSpatches371_proc,
NULL
};
......
/* Copyright 2018 Castle Technology Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* patches/402/ADFSpatch.h */
static patchentry_t *ADFSpatches402_proc(void *handle)
{
static patchentry_t ADFSpatches402[] =
{
/* addr old new */
/* Disc error 20 hook */
{(uint32 *)0x039C1748, 0x03A00020, 0x0A08B34B},
{(uint32 *)0x039C174C, 0x08BD437E, 0xE1A00000},
{(uint32 *)0x039C1750, 0x039EF201, 0xE1A00000},
/* Disc error 20 patch */
{(uint32 *)0x03bee47c, 0xffffffff, 0xE3A0E302},
{(uint32 *)0x03bee480, 0xffffffff, 0xE11E000F},
{(uint32 *)0x03bee484, 0xffffffff, 0x013EF00F},
{(uint32 *)0x03bee488, 0xffffffff, 0x13A0E000},
{(uint32 *)0x03bee48c, 0xffffffff, 0xE59C1220},
{(uint32 *)0x03bee490, 0xffffffff, 0xE59F2098},
{(uint32 *)0x03bee494, 0xffffffff, 0xE5821000},
{(uint32 *)0x03bee498, 0xffffffff, 0xE3A01001},
{(uint32 *)0x03bee49c, 0xffffffff, 0xE58C1220},
{(uint32 *)0x03bee4a0, 0xffffffff, 0xE28F1008},
{(uint32 *)0x03bee4a4, 0xffffffff, 0xE58C1224},
{(uint32 *)0x03bee4a8, 0xffffffff, 0xE13EF00F},
{(uint32 *)0x03bee4ac, 0xffffffff, 0xE8BD837E},
{(uint32 *)0x03bee4b0, 0xffffffff, 0xE92D4001},
{(uint32 *)0x03bee4b4, 0xffffffff, 0xE1A0000F},
{(uint32 *)0x03bee4b8, 0xffffffff, 0xE33FF3C2},
{(uint32 *)0x03bee4bc, 0xffffffff, 0xE1A00000},
{(uint32 *)0x03bee4c0, 0xffffffff, 0xE92D49FF},
{(uint32 *)0x03bee4c4, 0xffffffff, 0xE59CB228},
{(uint32 *)0x03bee4c8, 0xffffffff, 0xE59F3060},
{(uint32 *)0x03bee4cc, 0xffffffff, 0xE5932000},
{(uint32 *)0x03bee4d0, 0xffffffff, 0xE2522001},
{(uint32 *)0x03bee4d4, 0xffffffff, 0x0A00000F},
{(uint32 *)0x03bee4d8, 0xffffffff, 0xE5DB0818},
{(uint32 *)0x03bee4dc, 0xffffffff, 0xE3100008},
{(uint32 *)0x03bee4e0, 0xffffffff, 0x05832000},
{(uint32 *)0x03bee4e4, 0xffffffff, 0x03A02001},
{(uint32 *)0x03bee4e8, 0xffffffff, 0x0A000005},
{(uint32 *)0x03bee4ec, 0xffffffff, 0xE59C1208},
{(uint32 *)0x03bee4f0, 0xffffffff, 0xE59C01E8},
{(uint32 *)0x03bee4f4, 0xffffffff, 0xE1A0E00F},
{(uint32 *)0x03bee4f8, 0xffffffff, 0xE59CF240},
{(uint32 *)0x03bee4fc, 0xffffffff, 0xE59F2028},
{(uint32 *)0x03bee500, 0xffffffff, 0xE58C2224},
{(uint32 *)0x03bee504, 0xffffffff, 0xE58C2220},
{(uint32 *)0x03bee508, 0xffffffff, 0xE8BD49FF},
{(uint32 *)0x03bee50c, 0xffffffff, 0xE13FF000},
{(uint32 *)0x03bee510, 0xffffffff, 0xE1A00000},
{(uint32 *)0x03bee514, 0xffffffff, 0xE8FD8001},
{(uint32 *)0x03bee518, 0xffffffff, 0xE3A00020},
{(uint32 *)0x03bee51c, 0xffffffff, 0xE59C21D4},
{(uint32 *)0x03bee520, 0xffffffff, 0xE59C31F4},
{(uint32 *)0x03bee524, 0xffffffff, 0xE5DC71BC},
{(uint32 *)0x03bee528, 0xffffffff, 0xEAF74CFD},
{(uint32 *)0x03bee52c, 0xffffffff, 0x039C19A0},
{(uint32 *)0x03bee530, 0xffffffff, 0x00000000}, /* Patched with adfs354_word_addr below */
{(uint32 *)0,0,0}
};
ADFSpatches402[(sizeof(ADFSpatches402)/sizeof(patchentry_t))-2].newval = adfs354_word_addr;
return ADFSpatches402;
}
......@@ -38,9 +38,6 @@ static patchentry_t *CDSFTpatches402_proc(void *handle)
{(uint32 *)0x03BEE418, 0xFFFFFFFF, 0xEBFFC9F8},
{(uint32 *)0x03BEE41C, 0xFFFFFFFF, 0xEAFFC917},
{(uint32 *)0x03B02128, 0x41525421, 0x6C6C754E},
{(uint32 *)0x03B0212C, 0x00004543, 0x00004A3A},
{(uint32 *)0,0,0}
};
......
......@@ -26,11 +26,13 @@ static patchentry_t *MSGSpatches402_proc(void *handle)
{
/* addr old new */
/* Filer template fix */
{(uint32 *)0x03886DAC, 0x04D00D32, 0x00240D32},
{(uint32 *)0x03886DB0, 0x00020000, 0x01F20000},
{(uint32 *)0x03886DB4, 0x07D00000, 0x03280000},
{(uint32 *)0x03886DB8, 0x02FA0000, 0x04680000},
/* Bottom row of ptr_write fix */
{(uint32 *)0x03920524, 0x00015555, 0x00015455},
{(uint32 *)0,0,0}
......
......@@ -28,6 +28,7 @@
#include "patches/402/DESKpatch.h"
#include "patches/402/DRWFpatch.h"
#include "patches/402/MTRANpatch.h"
#include "patches/402/ADFSpatch.h"
static patchlist_proc patchlist402[] =
......@@ -42,6 +43,7 @@ static patchlist_proc patchlist402[] =
CDSFTpatches402_proc,
PINBpatches402_proc,
MTRANpatches402_proc,
ADFSpatches402_proc,
NULL
};
......
| Copyright 2018 Castle Technology Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
| Utility for building the different versions of the ADFS "disc error 20" patch
| Assumes you've built the ihf2c tool (ROMPatch.ihf2c) and have it on your path!
set Machine 26
objasm adfs354.s -pd "ROMVer SETA 350" -o adfs354_350.o
link -IHF adfs354_350.o -o adfs354_350_ihf
ihf2c adfs354_350_ihf adfs354_350
objasm adfs354.s -pd "ROMVer SETA 360" -o adfs354_360.o
link -IHF adfs354_360.o -o adfs354_360_ihf
ihf2c adfs354_360_ihf adfs354_360
objasm adfs354.s -pd "ROMVer SETA 370" -o adfs354_370.o
link -IHF adfs354_370.o -o adfs354_370_ihf
ihf2c adfs354_370_ihf adfs354_370