English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 28 September 2018, 22:28   #1
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
substitute for WBStartup

Hi,
I was trying to replace internal WBStartup command with following code (only first part/problematic shown below)
Code:
DEFTYPE.WBStartup *wbmsg

*pr.Process = FindTask_(0)
If( *pr\pr_CLI = 0 )
  WaitPort_( *pr\pr_MsgPort )
  *wbmsg = GetMsg_( *pr\pr_MsgPort )
EndIf
...
when running it waits forever at WaitPort_() - it means it was started from WB but doesn't get any "back" message from workbench.
What am I doing wrong?

Thanks
peceha is offline  
Old 29 September 2018, 09:01   #2
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
The code looks correct, but is probably in the wrong place of your program.

I'm not a Basic coder, so just guessing here. But if this "internal WBStartup command" is an entry point in your program which is called by Blitz in case the program was called from Workbench, then Blitz has already detected that the program was called from Workbench and it has already received the startup message.

There must be some other way to get the message. Especially if Blitz offers an entry point for Workbench start, then it will probably also supply the startup message somehow.

The construct with WaitPort(pr_MsgPort) only works at the very beginning of the program, when AmigaDOS jumps into the very first instruction of the load module. I am not sure if Basic will allow you to replace this part of the code at all.
thomas is offline  
Old 29 September 2018, 09:24   #3
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
It crossed my mind that Blitz would not allow it at all.
That part is placed at the very top of the code.

Anyway, I was just trying to make a binary file smaller. I noticed that replacing Blitz's commands with system's ones greatly reduces the final size of executable... looks like this one is a NO GO.

Thanks for explanation.
peceha is offline  
Old 01 October 2018, 22:40   #4
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Yeah, it's not possible in Blitz 2. AmiBlitz3 allows custom startup handlers IIRC, but also creates larger executables so for that specific purpose it's probably not an option.
Daedalus is offline  
Old 02 October 2018, 12:58   #5
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
http://aminet.net/package/dev/basic/NewCommandSet
http://aminet.net/package/dev/basic/Blitz_WBstart
idrougge is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot get WBStartup struct when starting from Workbench (with VBCC) tygre Coders. C/C++ 10 08 December 2015 23:30
ChipQuik and substitute kipper2k Hardware mods 18 27 September 2013 10:55
Kickstart substitute gilgamesh request.UAE Wishlist 19 17 January 2009 15:37
Problem in wbstartup creates software failure demax support.Other 5 15 March 2008 12:53
WBStartup in OS3.9... th4t1guy support.Apps 6 26 August 2003 23:40

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:18.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.16547 seconds with 15 queries