Prev: B729 Up: Map Next: B79B
B75A: Reset game
This resets the game.
Used by the routines at keyscan_break, escaped and main.
Cause discovery of all items.
reset_game B75A LD BC,$1000 Set B for 16 iterations (item__LIMIT) and set C (item index) to zero
Start loop (once per item)
reset_game_0 B75D PUSH BC Preserve the iteration counter and item index over the next call
B75E CALL item_discovered Cause item C to be discovered
B761 POP BC Restore
B762 INC C Increment the item index
B763 DJNZ reset_game_0 ...loop
Reset the message queue.
B765 LD HL,$7CFE Reset the message queue pointer to its default of message_queue[2]
B768 LD ($7D11),HL
B76B CALL reset_map_and_characters Reset all visible characters, clock, day_or_night flag, general flags, collapsed tunnel objects, lock the gates, reset all beds, clear the mess halls and reset characters
B76E XOR A Clear the hero's vischar flags
B76F LD ($8001),A
Reset score digits, hero_in_breakfast, red_flag, automatic_player_counter, in_solitary and morale_exhausted which occupy a contiguous ten byte region.
B772 LD HL,$A132 Point HL at score_digits
B775 LD B,$0A Set B for ten iterations
Start loop (once per score digit)
reset_game_1 B777 LD (HL),A Zero the byte
B778 INC HL Then advance to the next byte
B779 DJNZ reset_game_1 ...loop
Reset morale.
B77B LD (HL),$70 Set morale to morale_MAX
B77D CALL plot_score Draw the current score to the screen
Reset and redraw items.
B780 LD HL,$FFFF Set both items_held to item_NONE ($FF)
B783 LD ($8215),HL
B786 CALL draw_all_items Draw held items
Reset the hero's sprite.
B789 LD HL,$CE2E Set vischar.mi.sprite to the prisoner sprite set
B78C LD ($8015),HL
B78F LD A,$02 Set the global current room index to room_2_HUT2LEFT
B791 LD ($68A0),A
Put the hero to bed.
B794 CALL hero_sleeps The hero sleeps
B797 CALL enter_room The hero enters a room
B79A RET Return
Prev: B729 Up: Map Next: B79B