![]() |
Routines |
| Prev: AA5A | Up: Map | Next: AAC4 |
|
Used by the routine at RunGame.
Builds the view buffer at ScreenBuffer from the position of the view in ViewPosition and 5CE4, one strip at a time in twelve passes.
|
|||||
| BuildView | AA5B | LD HL,$0000 | HL is 00. | ||
| AA5E | LD ($5CF6),HL | Store it in TurningRate. | |||
| AA61 | LD HL,($5CE2) | Fetch the first value from ViewPosition. | |||
| AA64 | LD DE,($5CE4) | Fetch the second value from 5CE4. | |||
| AA68 | PUSH HL | Save the first value. | |||
| AA69 | ADD HL,DE | Add the second value. | |||
| AA6A | LD BC,$0080 | BC is 80. | |||
| AA6D | ADD HL,BC | Add it. | |||
| AA6E | LD ($5CE7),HL | Store the result in ViewOriginSum. | |||
| AA71 | POP HL | Retrieve the first value. | |||
| AA72 | SRL D | Halve the second value... | |||
| AA74 | RR E | ...with the carry going into E. | |||
| AA76 | SRL H | Halve the first value... | |||
| AA78 | RR L | ...with the carry going into L. | |||
| AA7A | AND A | Subtract the second halved value from the first. | |||
| AA7B | SBC HL,DE | ||||
| AA7D | LD ($5CEE),HL | Store the result in ViewOriginDifference. | |||
| AA80 | LD DE,$FFA8 | DE is FFA8. | |||
| AA83 | CALL AdjustViewOrigin_Signed | Call AdjustViewOrigin_Signed. | |||
| AA86 | LD HL,$E5D1 | Point HL at the first strip of the view buffer. | |||
| AA89 | LD ($5CBB),HL | Store it in StripAddress. | |||
| AA8C | LD B,$0C | Set the number of passes to 0C. | |||
| BuildView_Pass | AA8E | PUSH BC | Save the number of passes. | ||
| AA8F | LD HL,$E5D1 | Point HL at the first strip of the view buffer. | |||
| AA92 | LD DE,$0017 | Set the size of a row to 17. | |||
| AA95 | LD B,$80 | Set the number of rows to 80. | |||
| AA97 | XOR A | Set A to zero. | |||
| AA98 | LD ($5CF0),A | Store it in DrawingFlags. | |||
| AA9B | LD ($AA5A),A | Store it in RenderFlag. | |||
| BuildView_Clear | AA9E | LD (HL),A | Clear a byte of the strip. | ||
| AA9F | INC HL | Move onto the next byte. | |||
| AAA0 | LD (HL),A | Clear that byte. | |||
| AAA1 | ADD HL,DE | Move onto the next row. | |||
| AAA2 | DJNZ BuildView_Clear | Jump back until all of the rows have been cleared. | |||
| AAA4 | LD HL,$C0E1 | HL is C0E1. | |||
| AAA7 | CALL DrawLevelObjects | Call DrawLevelObjects. | |||
| AAAA | POP BC | Restore the number of passes. | |||
| AAAB | DEC B | Decrease it by one. | |||
| AAAC | RET Z | Return if all of the passes have been done. | |||
| AAAD | EXX | Switch to the alternate registers. | |||
| AAAE | CALL RemoveObjectEntities | Call RemoveObjectEntities. | |||
| AAB1 | LD DE,$E5BB | Point DE at ScreenBuffer. | |||
| AAB4 | LD HL,$E5BD | Point HL at the second column of the view buffer. | |||
| AAB7 | LD BC,$0BFE | Set the number of bytes to 0BFE. | |||
| AABA | LDIR | Move the contents of the view buffer along by two bytes. | |||
| AABC | LD E,$08 | E is 08. | |||
| AABE | CALL AdjustViewOrigin | Call AdjustViewOrigin. | |||
| AAC1 | EXX | Switch back to the normal registers. | |||
| AAC2 | JR BuildView_Pass | Jump back for the next pass. | |||
| Prev: AA5A | Up: Map | Next: AAC4 |