Raising an interrupt on the native arm Co-processor

bbc micro/electron/atom/risc os coding queries and routines
Post Reply
User avatar
dudleysoft71
Posts: 113
Joined: Tue May 26, 2020 6:56 pm
Contact:

Raising an interrupt on the native arm Co-processor

Post by dudleysoft71 » Mon Jul 06, 2020 7:36 pm

I'm trying to raise in interrupt on the native arm Co-processor on PiTubeDirect. I tried to turn on the Interrupt on register 1 on the parasite side and during my vblank interrupt I write to register 1 data, according to the tube programming guide this should trigger an interrupt on the parasite, and looking at the source for the pi side it should trigger. I used OS_ChangeEnvironment to set a new escape handler, and nothing happens. I need to be able to generate a regular 50hz interrupt signal on the Pi because the frontier port requires a regular signal to generate the vsync signal for the running VM.

If anyone has any experience with interrupts over the tube who could help it would be appreciated.

User avatar
hoglet
Posts: 9440
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Raising an interrupt on the native arm Co-processor

Post by hoglet » Mon Jul 06, 2020 8:37 pm

dudleysoft71 wrote:
Mon Jul 06, 2020 7:36 pm
I'm trying to raise in interrupt on the native arm Co-processor on PiTubeDirect. I tried to turn on the Interrupt on register 1 on the parasite side and during my vblank interrupt I write to register 1 data, according to the tube programming guide this should trigger an interrupt on the parasite, and looking at the source for the pi side it should trigger. I used OS_ChangeEnvironment to set a new escape handler, and nothing happens. I need to be able to generate a regular 50hz interrupt signal on the Pi because the frontier port requires a regular signal to generate the vsync signal for the running VM.

If anyone has any experience with interrupts over the tube who could help it would be appreciated.
You should be able to do what you want with events:

Use OS_ChangeEnvironment to replace the default EVENT_HANDLER with your own code.

Then use *FX 14, 4 (or the equivalent OSBYTE) to enable the VSYNC Event.

The default event handler doesn't do anything unless you have compiled with DEBUG_ARM defined:
https://github.com/hoglet67/PiTubeDirec ... ive.c#L107

Dave

User avatar
dudleysoft71
Posts: 113
Joined: Tue May 26, 2020 6:56 pm
Contact:

Re: Raising an interrupt on the native arm Co-processor

Post by dudleysoft71 » Mon Jul 06, 2020 9:18 pm

Okay, thanks that sounds exactly what I need.

I'll give it a try tomorrow, hopefully once I've got it working the game should run at a better pace, currently its dependent on framerate which can make it just a little slow.

User avatar
dudleysoft71
Posts: 113
Joined: Tue May 26, 2020 6:56 pm
Contact:

Re: Raising an interrupt on the native arm Co-processor

Post by dudleysoft71 » Wed Jul 08, 2020 5:03 pm

hoglet wrote:
Mon Jul 06, 2020 8:37 pm

You should be able to do what you want with events:

Use OS_ChangeEnvironment to replace the default EVENT_HANDLER with your own code.

Then use *FX 14, 4 (or the equivalent OSBYTE) to enable the VSYNC Event.

The default event handler doesn't do anything unless you have compiled with DEBUG_ARM defined:
https://github.com/hoglet67/PiTubeDirec ... ive.c#L107

Dave
Just tried that out and it works a treat, a much better solution than fudging it into the flip and idle calls.

Post Reply

Return to “programming”