Compiling Stone Raider II
Posted: Tue Sep 29, 2015 9:49 pm
Hi there,
Most of you know that Rolf put the source code of his game, Stone Raider II, available to everyone in Github: https://github.com/rolfmichelsen/StoneRaiderII
The source code was written to be compiled using the software AllDream in Dragon 32. But, I've updated it in order to be compiled using "lwtools". Meanwhile Rolf approves the pull request, I attach the new source code if you want to try.
The good news is that I could find a way to compile and execute in a PC-environment, so I hope I could be useful to others. The steps are:
1) Compiling the source code using "lwasm":
lwasm -9 -b -o STONRAID.bin -d stonraid.asm
2) Using the script "bin2cas.pl", we can build a CASSETTE based on a binary:
perl -T bin2cas.pl -o stonraid.cas -e 0x2657 -l 0x2400 -n STONRAID --autorun -C STONRAID.bin
The value of 0x2400 is the same address that we set in the source code under "ORG" (line 9 of stonraid.asm), so it means the address where the program should be dumped. The value of 0x2657 is the address to be started after the cassette is loaded by the Dragon. As we executed "lwasm" in debug mode, we can find the line that looks like:
DEBUG 050 (1441383186): Register symbol @START: 0x2657
@START is the tag in our source code (line 158 of stonraid.asm) that set where our program starts its execution.
This is a little tedius, but the values are always the same if we compile it again. So, one we got it, we can reuse it directly.
3) Using XRoar, only load the file stonraid.cas and execute "CLOADM"
Don't hesitate to ask me any question if you've had any problem.
Most of you know that Rolf put the source code of his game, Stone Raider II, available to everyone in Github: https://github.com/rolfmichelsen/StoneRaiderII
The source code was written to be compiled using the software AllDream in Dragon 32. But, I've updated it in order to be compiled using "lwtools". Meanwhile Rolf approves the pull request, I attach the new source code if you want to try.
The good news is that I could find a way to compile and execute in a PC-environment, so I hope I could be useful to others. The steps are:
1) Compiling the source code using "lwasm":
lwasm -9 -b -o STONRAID.bin -d stonraid.asm
2) Using the script "bin2cas.pl", we can build a CASSETTE based on a binary:
perl -T bin2cas.pl -o stonraid.cas -e 0x2657 -l 0x2400 -n STONRAID --autorun -C STONRAID.bin
The value of 0x2400 is the same address that we set in the source code under "ORG" (line 9 of stonraid.asm), so it means the address where the program should be dumped. The value of 0x2657 is the address to be started after the cassette is loaded by the Dragon. As we executed "lwasm" in debug mode, we can find the line that looks like:
DEBUG 050 (1441383186): Register symbol @START: 0x2657
@START is the tag in our source code (line 158 of stonraid.asm) that set where our program starts its execution.
This is a little tedius, but the values are always the same if we compile it again. So, one we got it, we can reuse it directly.
3) Using XRoar, only load the file stonraid.cas and execute "CLOADM"
Don't hesitate to ask me any question if you've had any problem.