Prev: 24384 Up: Map Next: 24448
24403: Create Game Window
Used by the routines at LevelNew, PlayerTurnEnds, GameOver_1UP, Game_Restart and StartGame.
Blanks the screen, draws the banner, colours the score line and prints the 1UP, 2UP and HI scores. The in-game text is drawn using the ROM character set, so the screenshots on this page and the others load the ROM and set CHARS to 15360 (the snapshot does not hold the value that the ROM would have set).
game-window
Blank the screen and write the banner.
CreateWindow 24403 XOR A Set the border to BLACK.
24404 OUT (254),A
24406 CALL ResetAttributes Blank the attribute buffer using ResetAttributes.
24409 CALL ResetScreen Blank the screen buffer using ResetScreen.
24412 CALL PrintBanner Print the "1UP", "HI" and "2UP" banner using PrintBanner.
Set the attributes for the 1UP lives graphic.
24415 LD HL,22536 Point HL at the first cell of the 1UP lives graphic in the attribute buffer (22536).
24418 LD A,71 Set the colour to INK:WHITE, PAPER:BLACK (BRIGHT).
24420 LD (HL),A Colour the first cell of the 1UP lives graphic.
24421 INC HL Move onto the second cell.
24422 LD (HL),A Colour the second cell of the 1UP lives graphic.
Set the attributes for the 2UP lives graphic.
24423 LD HL,22550 Point HL at the first cell of the 2UP lives graphic in the attribute buffer (22550).
24426 LD (HL),A Colour the first cell of the 2UP lives graphic.
24427 INC HL Move onto the second cell.
24428 LD (HL),A Colour the second cell of the 2UP lives graphic.
Set the attributes for the score line (the whole line is INK:YELLOW, PAPER:BLACK (BRIGHT)).
24429 LD HL,22560 Point HL at the start of the score line in the attribute buffer (22560).
24432 LD BC,8262 Set the column counter to 32 and the colour to INK:YELLOW, PAPER:BLACK (BRIGHT).
CreateWindow_Loop 24435 LD (HL),C Colour a cell of the score line.
24436 INC L Move onto the next column.
24437 DJNZ CreateWindow_Loop Decrease the column counter by one and loop back to CreateWindow_Loop until the whole score line has been coloured.
Print the three scores.
24439 CALL Score_1UP Print the 1UP score using Score_1UP.
24442 CALL Score_2UP Print the 2UP score using Score_2UP.
24445 JP Score_HI Jump to Score_HI to print the HI score.
View the equivalent code in;
Prev: 24384 Up: Map Next: 24448