So at this moment the game worked. Although the time was recorded it was not shown yet.
Since the game runs in a 1/50 sec timeloop each loop a counter is added 2x.
Showing the time that was needed to play the slowest team.
Still some room was left over. Nice to haves are options not really required for
the game but it makes a nice extra. I had 3 nice to haves:
1) Replay of all teams
2) The full name of the game on screen
3) The timing of each team
Ad1) Since the game could replay previous recorded teams it had to be possible to replay all recorded
teams too. The game starts with 1 team which also must be recorded. After a full play
you can restart the "gameplay" by simply setting 4 teams ready as a start and setting the team to
record to an impossible value like the fifth wheel. So in a few bytes a full replay was fixed.
Ad2) This is just layout of the lowres screen. Just add bytes to write the title.
Ad3) I added a blanc line with 23 bytes to write the times. When a team would be ready
it would write the actual time on that line. Again too easy. When a team is ready and the next is not then the first
team is ready when the second is So it wrote 4x the endtime of the slowest team. It needed a test if a time was not written yet.
And by adding the test it needed a cleared line before starting the game.
I added it as well.
With all extra's added I playtested the game It would be ready.
Team 1 worked great, team 2 too. Team 3 crashed! So what went wrong what
previously worked? At the end of the RAM some tables are stored. After that the machinestack is stored.
The stack needed room and altered the tables. So I needed bytes to get the game working again.
The statustable was just 4 bytes. This room was still free on the systemvariables. By changing that the stack might have
enough room. Not... now team 4 still crashed. I needed another few bytes.
I found them by altering a few routines. Now the game worked and was released.
Then I found 2 small cosmetic bugs. 1 was a repair of the car at no cost of bytes.
The other needed 1 byte. Memory was full, however.... a table could beshifted 1 place creating room
for the final cosmetic bug. This is the final version.
Ok, so this is how I coded the game. This still doesn't make any sense how it fits 1K.
Each game has a fixed order to go through. Loading, running BASIC, start machinecode, initial setup.
According to the memorylayout you would lose 60 bytes already for systemvariables, add to that
a BASIC program and initial setup in machinecode (at least the setting of IX-register) and you would lose
almost 80 bytes. Over the years I have managed to reuse memorylocations.
Over the systemvariables I was able to set the BASIC-call to machinecode and the initial setup.
This is default in each game. After loading you can use most of the systemvariables for
routines or data. In this game the first 36 bytes are used for the recorderdata.
As for the rest... well check the source.
#4000-#403B Sysvar, BASIC, Machinecodestart, timerecorder
#403c-#4107 Hiresroutine and arrow graphics
#4108-#41B3 Car graphic and hires linedisplay
#41B4-#4327 The game
#4328-#4388 Lowres screen
#43DE-#43FF Drive routine
I was at the Austrian Grand Prix this year and even saw Max' final move on Leclerc (I was at the right spot at the right time), but I did NOT get the idea to make such a game!
Great driver, great game - thanks!
final move on Leclerc
It was a tanks GP ?