English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Blitz Basic (https://eab.abime.net/forumdisplay.php?f=126)
-   -   Int 5 (& "longer" code) (https://eab.abime.net/showthread.php?t=106076)

Cobe 03 March 2021 21:35

Int 5 (& "longer" code)
 
I havent tried this yet, but am thinking theoreticaly for now.

What happens if code that we set in int 5 takes more than one vertical blank to be finished?

grond 03 March 2021 21:52

It will be executed again upon exiting the irq service routine.

Cobe 04 March 2021 17:56

Meaning what? At second vbl it wont be called again cause its already being executed?

grond 04 March 2021 18:40

Quote:

Originally Posted by Cobe (Post 1467365)
Meaning what? At second vbl it wont be called again cause its already being executed?

An IRQ of the same priority cannot interrupt a running IRQ, hence, the VBL can't interrupt the VBL still being executed. Since the interrupt source is cleared at the beginning of the interrupt handler and the new VBL sets it again, in the moment the interrupt routine quits (and the IRQ status flag is cleared), the next VBL will be triggered. This would also happen if the raster beam is now already drawing a new frame onto the monitor such that the VBL would be delayed. If the VBL routine runs for two frames or more, one VBL will be dropped.

Old games often had almost all game code in the VBL routine so that it was synced from the VBL. This is not advisable and a rather ugly hack. Of course, this must not be done at all if you have the OS running.

Cobe 05 March 2021 17:33

Aha, ok. Thanks for explanation.

phx 05 March 2021 18:09

Quote:

Originally Posted by grond (Post 1467379)
Old games often had almost all game code in the VBL routine so that it was synced from the VBL. This is not advisable and a rather ugly hack.

For what reason is that an ugly hack?
It may be not advisable if you don't manage to run your engine in 50fps. But that's all.

grond 05 March 2021 18:52

Quote:

Originally Posted by phx (Post 1467662)
For what reason is that an ugly hack?
It may be not advisable if you don't manage to run your engine in 50fps. But that's all.

Yes, you are right. If you are alone in the system, it is ok. I guess the fact that you are blocking interrupts of lower priority if you do calculations that need not be carried out with priority (which should be much of the game logic) doesn't really play a role in an Amiga game running as the only program.


All times are GMT +2. The time now is 20:41.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.06358 seconds with 11 queries