In order to reduce RAM usage of a game I'm (once every 2 years ) working on, heavy usage of BLOAD makes it crash. Older version of the game using inlines works ok.
I know FILESELECT is kind of buggy when it comes to do nasty stuffs, if one can consider MALLOC is a nasty command
So, here's what I do, can't post the complete source of the game indeed :
in the init proc :
- Code: Tout sélectionner
' DETERMINE LE CHEMIN COURANT POUR LE PROG APRES COMPILE
chemin$=CHR$(GEMDOS(25)+65)+":"+DIR$(0)+"\"
then when a file is needed, just call a proc this way:
- Code: Tout sélectionner
@charge("blah.sht",place%)
- Code: Tout sélectionner
> PROCEDURE charge(fichier$,emplacement%)
oussa$=chemin$+"datas.rz\"+fichier$+chr$(0)
'cmd$=chr$(0)
'env$=chr$(0)+chr$(0)
'bp%=gemdos(63,L:V:oussa$,L:flong%)
BLOAD oussa$,emplacement%
RETURN
It all works well twice= loading menu, menu runs, select something, load files, run the something, load menu files, run menu *2
and then it doesn't want to load anymore. Checked as many things as i can inside the code, seems ther's no mistake left.
Then, I made the prog just loop the menu : load menu files, run menu, select something, load menu files, run menu
And I still got the same prob.
So wether there's an error in the code i can't find, wether BLOAD ain't that rock solid command.
I also tried with OPEN/BGET , still same prob. As you can see in the above code, I'm about to go into gemdos call but, damn i don't know how to do / not sure it will work better.
As anyone experienced something like that ? Any idea ?
Thx