z80 icon indicating copy to clipboard operation
z80 copied to clipboard

How to exit halted state (using python interface)?

Open mortenjc opened this issue 1 year ago • 2 comments

Hi

I am working on yet another old microcomputer from the 70s. It uses the halt instruction to wait for interrupts.

I try to fake the interrupt by storing the current PC on the and then adjust the PC to point to the interrupt address.

This does not seem to work. Presumable the emulator needs to be informed to leave the halt state?

Is there any example for how to fake an interrupt (to simulate external hardware)?

Cheers

Morten

mortenjc avatar Dec 02 '24 11:12 mortenjc

Hi Morten, a1fc0e2b1dc948a7745c9f15fca1236ec10eb5f2 makes the Z80Machine.halted field writable, so now it should be possible to exit the halted mode by setting the field to be false. The commit adds an example that does exactly that.

kosarev avatar Dec 02 '24 15:12 kosarev

Hey,

That was quick.

It seems to work fine!

Thanks Morten

mortenjc avatar Dec 03 '24 12:12 mortenjc