Based on the discussion above I build an update of my PoC code:
- Moved BIOSConfig from setregistermin() to setregistermax()
Now UnknownMHz b0 = ? -> UnknownMHz b0 = 0 -> NewvalueMHz + b0 = 0 -> NewvalueMHz + b0 = Newvalue(accpording to NewvalueMHz)
- Wrapped Code in SwappMMUMode
So the code is expected to work in 24bit mode as well
Thanks to zigzagjoe for the code.
- Added procedure setsecurevalue()
Just for better reading
- Moved some printf into procedure printdisclaimer()
Just for better reading
- Added #define INTERACTIVE and some #ifdef in main() and printgestalt()
if INTERACTIV is not defined, no print and no scan from console but read desired clock frequency from source code int newvalue = 33;
- Added #define DRYRUN to encapsulate all read from or write to registers, as those access crashes Basilsk 2 imediate.
Usualy DRYRUN should not be defined.
- Added code of Phipli to calculate n,m,p from desired CPU frequency
void calculateLong( int MHz, char *n, char *m, char *p )
- Added setrefreshintervall() to set refresh interval appropriate for other frequencies than 20, 25, 33, and 40 MHz
- Updated GestaltID based on recommendation of Phipli
- Changed some pokes in setlong()
Some users reported that setlong() in V0.2 crashes the device.
It seems to be a race condition in V0.2 that occur at some but not all devices that have resistors changed for 33MHz
Testing and feedback are very welcome.