cpct_reenableFirmware

Re-enables previously disabled Amstrad CPC firmware.

C Definition

void cpct_reenableFirmware (u16 firmware_ROM_pointer) __z88dk_fastcall;

Assembly call

call cpct_reenableFirmware_asm

Input Parameters (2 Bytes)

(2B HL) *firmware_ROM_pointer*2 bytes with previous pointer stored at 0x0039.  This is the address where firmware ROM code starts.

Parameter Restrictions

  • firmware_ROM_pointer is a 16bits value that should have been previously obtained calling cpct_disableFirmware or cpct_removeInterruptHandler.  This 16bits value should be the pointer to the firmware ROM code that must be called every time an interrupt happens.  This pointer is placed at 0x0039, along with a JP instruction (0xC3) at 0x0038.  Being the CPU in interrupt mode 1, a jump to 0x0038 address is produced 6 times per frame, 300 times per second.

Details

Restores normal operation of Amstrad CPC firmware after having been disabled.  Do not try to call this function before disabling firmware.  If you do, the most normal result is getting your Amstrad CPC resetted.

This function could also be used to change the present interrupt handler.  However, take into account that it does not create a safe wrapper for the given interrupt handler.  Use it with care in this case.

Destroyed Register values

HL

Required memory

11 bytes

Time Measures

Case | microSecs(us) | CPU Cycles
-----------------------------------
Any  |      16       |     64
-----------------------------------
Re-enables previously disabled Amstrad CPC firmware.
unsigned int (u16 = unsigned 16-bits, 2 bytes)
Disables Amstrad CPC firmware, preventing it from being executed at every CPU interrupt.
Sets nothing as interrupt handler (returns every time it is called).
Close