Illegal Function call, but.......
Illegal Function call, but.......
(OP)
it only gives me the error when i try to run the program as an executable.
It gives me this "Illegal function call in module SPACDRIV at address 0540:0991"
But i don't get any errors when I run it through QBX
Does anyone know what is causing this? This is very important to me.
~PlystirE~
It gives me this "Illegal function call in module SPACDRIV at address 0540:0991"
But i don't get any errors when I run it through QBX
Does anyone know what is causing this? This is very important to me.
~PlystirE~
RE: Illegal Function call, but.......
We can't even speculate based on a module name and an address.
RE: Illegal Function call, but.......
Are you using CHAIN at all? If so, don't create a run-time needed EXE - create a standalone one or this error will occur.
Also, having too complex of an equation on a line will often cause this error. If you have a super-size equation on a line, try simplifying it by breaking it up into smaller parts, or compile with the /FPa option(alternative math).
- Dav
Visit THE CODE POST
http://www.thecodepost.com
RE: Illegal Function call, but.......
I once tried only compiling my title screen (after declarations and everything) and it gave me the same error, so i don't think it was an equation problem. (plus i have this thing about not seeing the rest of a line while I'm coding)
Here are all of my declarations that I had when the error came up.
DECLARE SUB dead (res$)
DECLARE SUB shop1 ()
DECLARE SUB shoplist ()
DECLARE SUB compo ()
DECLARE SUB specs ()
DECLARE SUB track ()
DECLARE SUB BBS ()
DECLARE SUB missi ()
DECLARE SUB shop3 ()
DECLARE SUB compmiss (miss$)
DECLARE SUB findmission ()
DECLARE SUB waitkey ()
DECLARE FUNCTION shipcolli! (x!, y!, sx!, sy!)
DECLARE SUB printtex (tex$, x1!, y1!)
COMMON SHARED globalct AS DOUBLE, upkey$, downkey$, leftkey$, rightkey$, enterkey$, Drilllev, collectorlev, astdock, Blaster
COMMON SHARED credit, shiptype, Stati, tracktype$, tracknum, fuel, lifesupport
ON ERR GOTO traperr
RANDOMIZE TIMER
upkey$ = CHR$(0) + CHR$(72)
downkey$ = CHR$(0) + CHR$(80)
leftkey$ = CHR$(0) + CHR$(75)
rightkey$ = CHR$(0) + CHR$(77)
enterkey$ = CHR$(13)
'load sprites
DIM ship1u(100)
DIM ship1ub(100)
DIM ship1d(100)
DIM ship1db(100)
DIM ship1l(100)
DIM ship1lb(100)
DIM ship1r(100)
DIM ship1rb(100)
DIM ship1um(100)
DIM ship1ubm(100)
DIM ship1dm(100)
DIM ship1dbm(100)
DIM ship1lm(100)
DIM ship1lbm(100)
DIM ship1rm(100)
DIM ship1rbm(100)
DIM ship2u(100)
DIM ship2ub(100)
DIM ship2d(100)
DIM ship2db(100)
DIM ship2l(100)
DIM ship2lb(100)
DIM ship2r(100)
DIM ship2rb(100)
DIM ship2um(100)
DIM ship2ubm(100)
DIM ship2dm(100)
DIM ship2dbm(100)
DIM ship2lm(100)
DIM ship2lbm(100)
DIM ship2rm(100)
DIM ship2rbm(100)
DIM station(15 * 25)
DIM stationm(15 * 25)
DIM planet1(30 * 30)
DIM planet1m(30 * 30)
DIM sun1(40 * 40)
DIM sun1m(40 * 40)
DIM ast1(100)
DIM ast1m(100)
DIM ast2(100)
DIM ast2m(100)
DIM fuel(18 * 6)
DIM life(45 * 6)
DIM batt(30 * 6)
DEF SEG = VARSEG(ship1u(100))
BLOAD "SHIP1u.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship1ub(100))
BLOAD "SHIP1uB.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship1d(100))
BLOAD "ship1d.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship1db(100))
BLOAD "SHIP1dB.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship1l(100))
BLOAD "SHIP1l.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship1lb(100))
BLOAD "SHIP1lB.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship1r(100))
BLOAD "SHIP1r.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship1rb(100))
BLOAD "SHIP1rB.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship1um(100))
BLOAD "SHIP1u.msk", 0
DEF SEG
DEF SEG = VARSEG(ship1ubm(100))
BLOAD "SHIP1uB.msk", 0
DEF SEG
DEF SEG = VARSEG(ship1dm(100))
BLOAD "SHIP1d.msk", 0
DEF SEG
DEF SEG = VARSEG(ship1dbm(100))
BLOAD "SHIP1dB.msk", 0
DEF SEG
DEF SEG = VARSEG(ship1lm(100))
BLOAD "SHIP1l.msk", 0
DEF SEG
DEF SEG = VARSEG(ship1lbm(100))
BLOAD "SHIP1lB.msk", 0
DEF SEG
DEF SEG = VARSEG(ship1rm(100))
BLOAD "SHIP1r.msk", 0
DEF SEG
DEF SEG = VARSEG(ship1rbm(100))
BLOAD "SHIP1rB.msk", 0
DEF SEG
DEF SEG = VARSEG(station(25 * 15))
BLOAD "stat1.qxs", 0
DEF SEG
DEF SEG = VARSEG(stationm(25 * 15))
BLOAD "stat1.msk", 0
DEF SEG
DEF SEG = VARSEG(planet1(30 * 30))
BLOAD "planet1.qxs", 0
DEF SEG
DEF SEG = VARSEG(planet1m(30 * 30))
BLOAD "planet1.msk", 0
DEF SEG
DEF SEG = VARSEG(sun1(40 * 40))
BLOAD "sun1.qxs", 0
DEF SEG
DEF SEG = VARSEG(sun1m(40 * 40))
BLOAD "sun1.msk", 0
DEF SEG
DEF SEG = VARSEG(ast1(100))
BLOAD "ast1.QXS", 0
DEF SEG
DEF SEG = VARSEG(ast1m(100))
BLOAD "ast1.msk", 0
DEF SEG
DEF SEG = VARSEG(ast2(100))
BLOAD "ast2.QXS", 0
DEF SEG
DEF SEG = VARSEG(ast2m(100))
BLOAD "ast2.msk", 0
DEF SEG
DEF SEG = VARSEG(ship2u(100))
BLOAD "SHIP2u.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship2ub(100))
BLOAD "SHIP2uB.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship2d(100))
BLOAD "SHIP2d.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship2db(100))
BLOAD "SHIP2dB.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship2l(100))
BLOAD "SHIP2l.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship2lb(100))
BLOAD "SHIP2lB.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship2r(100))
BLOAD "SHIP2r.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship2rb(100))
BLOAD "SHIP2rB.QXS", 0
DEF SEG
DEF SEG = VARSEG(ship2um(100))
BLOAD "SHIP2u.msk", 0
DEF SEG
DEF SEG = VARSEG(ship2ubm(100))
BLOAD "SHIP2uB.msk", 0
DEF SEG
DEF SEG = VARSEG(ship2dm(100))
BLOAD "SHIP2d.msk", 0
DEF SEG
DEF SEG = VARSEG(ship2dbm(100))
BLOAD "SHIP2dB.msk", 0
DEF SEG
DEF SEG = VARSEG(ship2lm(100))
BLOAD "SHIP2l.msk", 0
DEF SEG
DEF SEG = VARSEG(ship2lbm(100))
BLOAD "SHIP2lB.msk", 0
DEF SEG
DEF SEG = VARSEG(ship2rm(100))
BLOAD "SHIP2r.msk", 0
DEF SEG
DEF SEG = VARSEG(ship2rbm(100))
BLOAD "SHIP2rB.msk", 0
DEF SEG
DEF SEG = VARSEG(fuel(18 * 6))
BLOAD "fuel.qxs", 0
DEF SEG
DEF SEG = VARSEG(life(45 * 6))
BLOAD "life.qxs", 0
DEF SEG
DEF SEG = VARSEG(batt(30 * 6))
BLOAD "batt.qxs", 0
DEF SEG
DIM starsx(50)
DIM starsy(50)
DIM stars2x(50)
DIM stars2y(50)
DIM stars3x(50)
DIM stars3y(50)
ΓΏ
deng, i guess i never realised just how much i had to declare :|
~PlystirE~
RE: Illegal Function call, but.......
Also make sure that the BLOAD files are in the correct folder. To make sure try using SHELL "cd c:\folder"
If nothing works the easiest way to find the error is to cut it in half and compile the first part, if that works then the error is in the second half, and just keep breaking it down like that until you've narrowed onto it.
If a man says something in the forest and no woman hears it is he still wrong?
RE: Illegal Function call, but.......
Wouldn't QB give me an error if the BLOAD files were not in the correct folder?
I suppose I better start cutting my declarations down then huh? ;) ;)
~PlystirE~
RE: Illegal Function call, but.......
It turns out that it gets the error when I place sprites onto the screen. Now why is it giving me an error for that?
And why is it only giving me the error when it's ran as a stand-alone exe? Shouldn't it be the same as running from QB?
Is there something wrong with compiler?
~PlystirE~
RE: Illegal Function call, but.......
But looking at your declarations I find...
DECLARE FUNCTION shipcolli! (x!, y!, sx!, sy!)
Since your paramenters x!, y!, sx! and sy! and the function itself are all single precision, it looks like you are dealing with some rather large numbers. Isn't it possible that you are trying to address an area of the screen beyond the physical dimensions of the screen?
You will probably narrow down the source of the error if you convert this function, its parameters and the appropriate variables within the function to the integer variable type. That way your program will error-out while running in the IDE and you can correct the source of the problem (perhaps a faulty formula?) by inspecting the (perhaps large? perhaps negative?) values you are using to address the screen.
Why does your program only crash in compiled form? Once again, without being able to test the code, one can only speculate.
RE: Illegal Function call, but.......
well i completely reverted my game to work....I had to make all my sprites on screen pixel by pixel.
~PlystirE~
RE: Illegal Function call, but.......
If a man says something in the forest and no woman hears it is he still wrong?
RE: Illegal Function call, but.......
------------------------
SUB DebugStart (LocationName$)
open "C:\DebugPRG.txt" for append as #250
print #250, "--Activated: "; LocationName$
Close #250
END SUB
SUB DebugEnd (LocationName$)
open "C:\DebugPRG.txt" for append as #250
print #250, "Deactivated: "; LocationName$
Close #250
END SUB
------------------------
You can all these subs at the beginning of each DECLARED SUB and pass along the name of each...You can also use them in the MAIN module JUST BEFORE CALLING them.
I know it will fill up pretty fast, but it's better than re-writing the whole thing.
--MiggyD
RE: Illegal Function call, but.......
MiggyD: Thanks for the Debug info but I've already tried soething like that and this error doesn't seem to be able to be trapped as most errors do.
~PlystirE~
RE: Illegal Function call, but.......
Ive had that problem about 35 times and just found that out about a month ago...
The shadow sees all cause the shadow is all
shadow_master@snowboard.com
RE: Illegal Function call, but.......
RE: Illegal Function call, but.......
Thanks for the info guys. Much kudos
~PlystirE~