Alchemy
Loading...
Searching...
No Matches

sst.c File Reference

Go to the source code of this file.

Functions

s32 CountRemainingErasedFlashBytes (u8 *cursor)
 Returns how many bytes remain when the first non-erased byte is found.
s32 RunFlashEraseVerifier (u8 *sector, s32(*verify)(u8 *))
 Converts a nonzero erased-byte remainder into the flash verification error.
u16 _call_via_r3 (s32 mode, u8 *address, u8 expected, FlashWaitProc wait)
u16 EraseFlashChip (void)
 Issues the chip-erase command and waits for an erased byte.
u16 EraseFlashSector (u16 sector)
 Erases one of sixteen sectors, restoring the cartridge wait setting afterward.
u16 ProgramFlashByte (u8 *source, u8 *destination)
 Issues a byte-program command and waits for its destination to match.
u16 ProgramFlashSectorWithEraseRetry (u16 sector, u8 *source)
 Erases and verifies a sector with retries, then programs its bytes.

Variables

FlashWaitProc gFlash_Handler3
u16 gFlashNumRemainingBytes

Function Documentation

◆ CountRemainingErasedFlashBytes()

s32 CountRemainingErasedFlashBytes ( u8 * ptr)

Returns how many bytes remain when the first non-erased byte is found.

Definition at line 180 of file sst.c.

Referenced by Bios_SoundBiasOn(), CountRemainingErasedFlashBytes(), and ProgramFlashSectorWithEraseRetry().

◆ RunFlashEraseVerifier()

s32 RunFlashEraseVerifier ( u8 * ptr,
s32(* verify )(u8 *) )

Converts a nonzero erased-byte remainder into the flash verification error.

Definition at line 191 of file sst.c.

Referenced by ProgramFlashSectorWithEraseRetry(), RunFlashEraseVerifier(), and RunFlashEraseVerifier().

◆ _call_via_r3()

u16 _call_via_r3 ( s32 mode,
u8 * address,
u8 expected,
FlashWaitProc wait )

◆ EraseFlashChip()

u16 EraseFlashChip ( void )

Issues the chip-erase command and waits for an erased byte.

Definition at line 13 of file sst.c.

Referenced by EraseFlashChip().

◆ EraseFlashSector()

u16 EraseFlashSector ( u16 sector)

Erases one of sixteen sectors, restoring the cartridge wait setting afterward.

Definition at line 39 of file sst.c.

Referenced by EraseFlashSector(), ProgramFlashSector(), and ProgramFlashSectorWithEraseRetry().

◆ ProgramFlashByte()

u16 ProgramFlashByte ( u8 * source,
u8 * destination )

Issues a byte-program command and waits for its destination to match.

Definition at line 81 of file sst.c.

Referenced by ProgramFlashByte(), ProgramFlashSector(), and ProgramFlashSectorWithEraseRetry().

◆ ProgramFlashSectorWithEraseRetry()

u16 ProgramFlashSectorWithEraseRetry ( u16 sector,
u8 * source )

Erases and verifies a sector with retries, then programs its bytes.

Definition at line 95 of file sst.c.

Referenced by ProgramFlashSectorWithEraseRetry().

Variable Documentation

◆ gFlash_Handler3

FlashWaitProc gFlash_Handler3
extern

◆ gFlashNumRemainingBytes

u16 gFlashNumRemainingBytes
extern