mrtomftw
Abandoned Uranium Working
Posts: 15
|
Post by mrtomftw on Feb 21, 2019 15:56:03 GMT
Hi,
I'm trying to create my own basic loader for the game I've created in AGD, because I want to add a loading screen later. I've been testing out a loader I wrote using threads I read on this forum and the tutorials people have linked to, and while it loads once I select a control method I get the BASIC message "0 OK, 50:1" which then obviously returns me to BASIC.
I've figured out that my game starts at 30471, so I've cleared from 30470 and the last line of code is RANDOMIZE USR 30471... As you can see from the screenshots it displays the menu that I created using AGD but I can't go any further than that.
Where am I going wrong?
|
|
|
Post by alessandro on Feb 21, 2019 16:28:36 GMT
Hi mrtomftw,
if you look at the code, you will find that at the very beginning of it (address 30471 in your case) there is a RET instruction, so there is nothing wrong going on, the computer is just executing it, i.e. returning to BASIC. AGD-authored games start by calling address 32000 in fact. In BASIC, that translates to RANDOMIZE USR 32000.
|
|
mrtomftw
Abandoned Uranium Working
Posts: 15
|
Post by mrtomftw on Feb 21, 2019 16:34:43 GMT
One quick change and it works perfectly. Thank you
|
|
mrtomftw
Abandoned Uranium Working
Posts: 15
|
Post by mrtomftw on Feb 21, 2019 20:16:45 GMT
After some testing I've found it gives the same "0 OK, 50:1" message at Game Over or when the game is completed. It doesn't do this when using the AGD generated BASIC loader... So how do I avoid this?
|
|
|
Post by alessandro on Feb 21, 2019 20:30:37 GMT
Hi, again, it's perfectly normal. You are executing a machine code program from BASIC, and since AGD puts a RET instruction at the end of the execution, the program returns to BASIC. The AGD-generated loader (I presume, because I never saved code with it) alters the system variables so that the code returns to address 32000 and is then executed again.
To do the same with your own loader, you have to add this line:
60 GO TO 50
This way, the BASIC program will execute the game code again. If you wish to pause the game and let the user press a key before restarting, add a PAUSE 0 command before GO TO 50.
|
|
mrtomftw
Abandoned Uranium Working
Posts: 15
|
Post by mrtomftw on Feb 21, 2019 20:44:31 GMT
Oh God how did I not think of that? I'm kicking myself. Thanks again! I'm sure you'll be glad to hear I got the loading screen working without a fuss so this is it - I can finish the last touches of the game and release it
|
|
|
Post by alessandro on Feb 21, 2019 22:04:55 GMT
Sure! I'll be waiting for it, then
|
|