Hi, I'm having trouble when editing some long events in my already big game. The AGD editor seems unable to handle the expand of the source code.
I've seen a great video on youtube from thEpOpE - Sergio, (video here) where he explains where AGD stores pointers to AGD source code and to processed z80 code. If you mess with those pointer you can workaround this same issue I've got.
As seen in the video, I've checked some pointers (i.e. number of screens) and it seems ok, but source code pointer in my game doesn't seem to be in the same place as in the video. I suspect that AGD 4.7 changes that pointer from 4.6.
Could somebody help me clarify where those source code and compiled code pointers are stored in AGD 4.7???
Hi Manu, which pointers are you referring to exactly?
The starting address for games coded with AGD 4.x is always 32000. Actual code begins lower in the RAM, especially according to the content of events such as Game Initialization and Sprite Initialization.
Take the following into account as well:
User-defined variables (A-R) for V4.6: 32029-32046
User-defined variables (A-T) for V4.7: 32029-32048
Keys locations in V4.6 are: Right 35331 Left 35332 Down 35333 Up 35334 Fire 35335 Custom 1 35336 Custom 2 35337
Keys locations in V4.7 are: Right 35339 Left 35340 Down 35341 Up 35342 Fire 35343 Custom 1 35344 Custom 2 35345 ASCII codes for score in V4.6 (6 bytes) start at 34453 ASCII codes for score in V4.7 (6 bytes) start at 34495
Common addresses to V4.6 and V4.7 are: 31232 Character set (768 bytes) 32027 SCREEN 32028 LIVES 32056 Victory flag (if <> 0 victory, if = 0 defeat)
Last Edit: Dec 30, 2018 13:11:58 GMT by alessandro
I'll try to explain, this stuff is more advanced than what I thought I would need to cope with and I hope I've understood it well...
As it is shown in the video I mentioned, when AGD code is too large to be uncompressed in the remaining memory and you need to edit the AGD scripts from the events, Sergio, the author of the video suggest to merge a copy of the game with the full code but with less screens (let's name it A copy) and a copy of the game with all the screens but the scripts not edited yet (You can guess: this would be the B copy)
The idea is to edit whatever you need in A, then extract the complete AGD code from A, save it in a file (a .bin file I think) and the inject it in the B copy, thus you get a copy with all the code and all the screens. To make it work, you need to alter the internal AGD pointer in B where it stores where it is supposed to end the AGD source code and the z80 code starts.
In AGD 4.6, the AGD code start it is supposed to be in $7D4F (32079 in decimal) and z80 code start is supposed to be stored in $7D51 (32081). Apparently, in 4.7 those pointers are in different addresses than 4.6 ... and those two are the address I would like to know (maybe with AGD 4.7 the extra room for new variables pushed them forward?)