Hello folks!
I recently bought a PowerBook Wallstreet/PDQ. Of course the PRAM battery is dead. That's nothing too bad but since I'm a software guy I thought that it should be possible to save the (x)PRAM to disk on shutdown and restore it after reboot if a PRAM reset is detected (e.g. year < 2024 or year >= 2039). So the last volume settings, display brightness, region (Date & Time) and so on are restored.
I know there are some solutions to achieve my needs but... Where's the fun part when just using them?

I really want to understand things how they were done back in the days.
Btw: "PRAM-Reader" (
https://macintoshgarden.org/apps/pram-reader) doesn't work at all. Restoring the saved state leads to a black screen and a complete hang.
What I've found out:
- "Old" PRAM is 20bytes, "extended" PRAM is 236bytes (according to "Inside Macintosh, Parameter RAM Utilities", from 1994).
- Getting the pointer for the PRAM is done by using "GetSysPPtr".
- Changing values is done by changing them directly in memory.
- Saving is done by using "WriteParam".
The documentation seems to work with the first 20 bytes (reading and writing works). But the extended PRAM doesn't seem to be directly after these 20 bytes. Reading 256 bytes and then writing them back causes crashes, hangs and so on.
And here comes the tricky part: I want to do everything in REALbasic! (That's the language I'm most familiar with on Mac.)
I hope someone out there has some advice for me.
Thank you all!
Mike