![]() |
Routines |
| Prev: AC28 | Up: Map | Next: AF7F |
|
Used by the routine at GameEntry.
Clears the whole game variables area (from RandomSeed1 up to the end of the objects table at Font) and then carries on to set up a new game. The low byte of the system FRAMES counter is kept across the clear and used as the first random seed, so that every game plays differently.
|
||||
|
Clear the variables and keep the seed.
|
||||
| StartGame | AF6C | LD HL,$5BA0 | Point HL at RandomSeed1. | |
| AF6F | LD BC,$0568 | Set the number of bytes to 0568. | ||
| AF72 | LD A,($5C78) | Fetch the low byte of FRAMES. | ||
| AF75 | PUSH AF | Stash the seed on the stack. | ||
| AF76 | CALL FillMemory | Call FillMemory. | ||
| AF79 | POP AF | Restore the seed from the stack. | ||
| AF7A | LD ($5BA0),A | Write it to RandomSeed1. | ||
| AF7D | JR InitialiseGame | Jump to InitialiseGame. | ||
|
View the equivalent code in;
|
||||
| Prev: AC28 | Up: Map | Next: AF7F |