03 January 2014, 23:07 | #1 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 829
|
Startup Code (from Icon ) - Forbid function
As I understand correctly Forbid function is used to off multitasking and I should use pair Forbid and Permit function. But I don't understand why in startup code from icon there is the Forbid call before back to OS. Mean
Code:
... jsr Forbid(A6) move.l WBenchMsg(PC),A1 ;WBenchMsg from GetMsg jsr ReplyMsg(A6) moveq #0,D0 rts "; we forbid so workbench can't UnLoadSeg() us before we are done" But what about Permit ? Is there any detailed information about icon startup ? |
04 January 2014, 04:23 | #2 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Replying to the Workbench startup-message is how you tell Workbench that your program is about to end, but there's always the chance that a task-switch occurs between the call to ReplyMsg() and actually ending your program, so you need to disable multi-tasking to prevent this. It's not necessary to call Permit() again because this state is relative to each task, so multi-tasking will be correctly enabled again when your program ends.
The details are in the RKMs of course, and probably in the NKDs as well. |
04 January 2014, 10:45 | #3 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 829
|
Thanks a lot.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
C/C++ WB friendly fullscreen game startup code | NovaCoder | Coders. Tutorials | 1 | 20 August 2019 13:45 |
PNG Icon to Color Icon Converter? | Leandro Jardim | request.Apps | 1 | 24 May 2010 04:39 |
need help with modeid-function | Ratte | Coders. General | 6 | 17 August 2009 00:57 |
Snapshot function | Eny- | support.Apps | 4 | 16 July 2004 08:52 |
3D code and/or internet code for Blitz Basic 2.1 | EdzUp | Retrogaming General Discussion | 0 | 10 February 2002 11:40 |
|
|