Routines |
Prev: AB6A | Up: Map | Next: ABA0 |
This uses the current room index and the night-time flag to decide which screen attributes should be used for the game window. Additionally, when in non-illuminated tunnel rooms it will wipe the visible tiles to obscure the tunnel's route.
Used by the routines at pick_up_item, drop_item, event_another_day_dawns, zoombox, action_shovel and searchlight_mask_test.
|
||||||||
choose_game_window_attributes | AB6B | LD A,($68A0) | If the global current room index is room_28_HUT1LEFT or below... | |||||
AB6E | CP $1D | |||||||
AB70 | JR NC,choose_attribute_tunnel | |||||||
The hero is outside, or in a room, but not in a tunnel.
|
||||||||
AB72 | LD A,($A146) | Read the night-time flag | ||||||
AB75 | LD C,$07 | Default attribute is attribute_WHITE_OVER_BLACK | ||||||
AB77 | AND A | Is it night-time? | ||||||
AB78 | JR Z,set_attribute_from_C | Jump if not | ||||||
Consider night-time colours.
|
||||||||
AB7A | LD A,($68A0) | Read the global current room index | ||||||
AB7D | LD C,$41 | For outside at night we use attribute_BRIGHT_BLUE_OVER_BLACK | ||||||
AB7F | AND A | Are we outside? | ||||||
AB80 | JR Z,set_attribute_from_C | Jump if so | ||||||
AB82 | LD C,$05 | Otherwise for inside at night we use attribute_CYAN_OVER_BLACK | ||||||
set_attribute_from_C | AB84 | LD A,C | Copy | |||||
set_attribute_from_A | AB85 | LD ($AB6A),A | Assign game_window_attribute | |||||
AB88 | RET | Return | ||||||
The hero is in a tunnel.
|
||||||||
choose_attribute_tunnel | AB89 | LD C,$02 | For an illuminated tunnel we use attribute_RED_OVER_BLACK | |||||
AB8B | LD HL,($8215) | Load HL with items_held | ||||||
If the hero holds a torch - illuminate the room.
|
||||||||
AB8E | LD A,$04 | Load item_TORCH into A | ||||||
AB90 | CP L | Item is torch? | ||||||
AB91 | JR Z,set_attribute_from_C | Jump if so | ||||||
AB93 | CP H | Item is torch? | ||||||
AB94 | JR Z,set_attribute_from_C | Jump if so | ||||||
The hero holds no torch - wipe the tiles so that nothing gets drawn.
|
||||||||
AB96 | CALL wipe_visible_tiles | Wipe the visible tiles array | ||||||
AB99 | CALL plot_interior_tiles | Render visible tiles array into the screen buffer | ||||||
AB9C | LD A,$01 | For a dark tunnel we use attribute_BLUE_OVER_BLACK | ||||||
AB9E | JR set_attribute_from_A | Jump to set_attribute_from_A |
Prev: AB6A | Up: Map | Next: ABA0 |