Flash EPROM enhancements from OZ 5.0, back ported to the standard library

#1 · Created  · Last updated

Merged pull request

Merged in flashepr-backport (pull request #1)

2a6b464·Author: ·Closed by: ·2022-08-06


Z88 Flash EPROM support was substantially improved in 2018 when support for many new device types was added to OZ 5.0 and to OZ 4.7.1.

Unfortunately applications dependent on the standard library were excluded from these improvements, in particular:

  1. Romupdate - essential for upgrading an unmodified Z88 to a modern OZ version

  2. Romcombiner - for blowing card applications

  3. Flashstore - for file backups/restores to and from RAM

  4. Flashtest - for diagnosing flash card hardware

This had become problematic since the obsolescence of AMD AM29Fx flash chips. New cards sold by Rakewell are now SST type.

This pull request brings those 2018 code improvements to stdlib, merging in the new device definitions and following updated routines:

  • AM29Fx_InitCmdMode

  • AM29Fx_CmdMode

  • AM29Fx_PollChipId

  • AM29Fx_BlowByte

  • AM29Fx_EraseSector

  • AM29Fx_ExeCommand

OZ executes most of these routines from lowram. In stdlib execution from RAM is achieved using ExecRoutineOnStack. Calls cannot be used when running from the stack, so each routine needed to be unrolled for stdlib. Some small changes were needed to account for differences in CPU register usage, register constraints in ExecRoutineOnStack, and to integrate with the pre-existing error handling.

Flashtest has been updated to detect a 4K sector size, and to report the flash memory chip type before the test starts.

Gunther Strube made some small adjustments to the Flashstore help text to keep the app size within a single 16K block when compiled against this new stdlib version.

0 attachments


Loading commits...