|
Post by andrewvanbeck on Oct 16, 2015 8:20:47 GMT
Hi All,
Got a query that I'm sure some kind soul can answer for me.
Looking at the basic loader for AGD is a bit confusing - it doesn't specify memory addresses so customising it is a bit of a gamble, I need to be able to poke the assembly to change control scheme etc, so I need the address of the program, but all I got is full stops!
The standard loader looks a bit like this:
10 CLEAR .: LOAD ""SCREEN$ : POKE .,. : LOAD ""CODE : RANDOMIZE USR .
So the bit that's confusing me, is what should I use instead of '.' - Especially the POKE, I've no idea what that's for. I did get it working with an additional loading screen for the HUD border, sneaking in an additional LOAD""SCREEN$ after loading the code, all good - but I need to do more, and I'm sure I need to use real memory locations. It's a 2-player game so I need to take over the control scheme to allow all the control options I want.
|
|
|
Post by alessandro on Oct 16, 2015 21:23:23 GMT
All AGD games start at address 32000 so you must launch them with RANDOMIZE USR 32000 (or LET variable=USR 32000 if you want to store the score in a variable).
CLEARing the RAM in order to make room for the code is a different matter. While in AGD 3.x code always began at 31232, in 4.x the actual beginning of the code may vary but usually it won't go lower than 31000.
It is much wiser, then, to leave the BASIC loader option aside altogether and saving just the game code. That way, you will know which address you have to refer to for the CLEAR command. Of course, remember to CLEAR (code beginning address)-1 before loading the game, e.g. if the code begins at 31020 you must issue a CLEAR 31019 command before loading it.
The POKE command should be a POKE 23739,111 issued in order to prevent the "Bytes:" message from appearing and overwriting the loading screen.
|
|
|
Post by andrewvanbeck on Oct 16, 2015 21:27:26 GMT
Awesome, thanks Alessandro, much appreciated
|
|
|
Post by alessandro on Oct 16, 2015 21:28:16 GMT
You're welcome
|
|
V0R73X
Central Cavern
Posts: 1
|
Post by V0R73X on Aug 13, 2016 0:31:53 GMT
Hi Guys, I am having the same issue with the full stops instead of values (AGD 3.0). From your answer above Randomize USR 32000 does start the game, however on most commercial games I have seen, the clear command is always 1 less than the Randomize USR so I tried
10 Clear 31999 20 Load ""Screen$ 30 Randomize USR 32000
And it just crashes, I re read the post and realised as you say, clearing the ram at 31232 then Randomize USR 32000 works. my question is though is there a documentation anywhere explaining this stuff, I am currently using version 3.0 as I followed Paul Jenkinson's excellent youtube videos, I didn't realise there were newer versions of AGD, but for future reference where can I read up on AGD and also read up on the scripting language, maybe some example code? I have read the 3.0 docs but it says make a basic loader as below.
10 CLEAR 31487: LOAD ""CODE : RANDOMIZE USR 32256
but this just gives a yellow border and hangs.
Sorry if this is basic stuff, but I am a total noob to programming anything I don't know much basic never mind machine code, it's all voodoo to me.
Regards, Chris.
|
|
|
Post by andrewvanbeck on Aug 15, 2016 10:07:06 GMT
I've only used v4.6 to the extent of having to make a loader, but I'll post what I ended up with - I think it changes with each version, because the code might get larger or smaller as things are tidied up or added.
Really the best source of help is this forum and the facebook page, AGD has a fairly small user base, but there tends to always be someone who knows what to do. Just post on this forum and you'll get an answer I'm sure.
|
|
|
Post by alessandro on Aug 15, 2016 12:40:43 GMT
Hi Guys, I am having the same issue with the full stops instead of values (AGD 3.0). From your answer above Randomize USR 32000 does start the game, however on most commercial games I have seen, the clear command is always 1 less than the Randomize USR The CLEAR command reserves space in the RAM by setting the RAMTOP system variable at the specified address. Therefore, if your M/C program starts at address, say, 32000, you must issue a CLEAR 31999 command before loading it. Refer to Chapter 24 of the Spectrum BASIC programming manual to know more ( here is an online version of it if you don't have the original booklet handy). And it just crashes, I re read the post and realised as you say, clearing the ram at 31232 then Randomize USR 32000 works. 3.x game code always starts at location 31232 and goes upwards. my question is though is there a documentation anywhere explaining this stuff Code generated by AGD 4.x goes upwards and downwards as well. To understand where in the RAM a particular game code starts, open it (without the BASIC loader, just the game code itself) in your favorite emulator and take notice of the starting address in the tape browser window. Bytes where game variables are stored also vary from 3.x to 4.x. If you see the "full stops", reload the game in AGD and save it in a new file without the BASIC loader. I am currently using version 3.0 as I followed Paul Jenkinson's excellent youtube videos Do not use it, it has been outdated for ages. I didn't realise there were newer versions of AGD, but for future reference where can I read up on AGD and also read up on the scripting language, maybe some example code? Perusing this forum would be a good starting point. Also load some game code (without the BASIC loader, just the game code itself) into AGD and take a look at the scripts yourself. But remember that AGD is not retrocompatible, i.e. games coded with 3.x versions cannot be examined nor modified with AGD 4.x.
|
|
|
Post by lukebord1 on Sept 26, 2016 1:28:34 GMT
|
|