Prev: 31393 Up: Map Next: 31562
31417: InitGameView
Initialises the room view. Clears the room-mode byte, freezes both map-marker channels (bit 7 of 31263/31264) and the two encounter layers, resets the corridor cursor to segment 8, clears the game window, draws the room background (resetting view type 4 — the encounter screen — to a normal deck view first), seeds the corridor strip from the 19-byte template at 30197, then paints the menu column's colour bands and prints its header row and the seven crew-name rows.
Used by the routines at 35163, 35338, 35440, 36457, 37584, 39400, 40941, 45676 and 45732.
31417 XOR A A = 0
31418 LD (31252),A clear room mode byte at 31252
31421 LD HL,31263 HL = 31263 (crew animation flags)
31424 SET 7,(HL) freeze animation channel A (bit 7 = freeze)
31426 INC HL
31427 SET 7,(HL) freeze animation channel B
31429 LD A,128 $80
31431 LD (39741),A freeze the alien-body encounter layer
31434 LD (39753),A freeze the Jones run layer
31437 LD A,8 segment 8 = centre of 19-segment corridor
31439 LD (33683),A store as current corridor cursor (33683)
31442 LD A,32 space char
31444 CALL 33479 draw blank room border / clear game window
31447 LD A,(31243) read room-type byte (31243)
31450 CP 4 type 4 = the encounter screen:
31452 JR NZ,31459
31454 LD A,1 reset it to a normal deck view (type 1)
31456 LD (31243),A
31459 CALL 31267 draw room background (walls, doors, floor tiles)
31462 LD DE,29630 DE = 29630 (corridor position table, 19 bytes)
31465 LD HL,30197 HL = 30197 (corridor position templates)
31468 LD BC,19 copy 19 entries
31471 LDIR initialise position table from template
31473 LD HL,22550 HL = $5816 (attribute row for top of game window)
31476 LD A,7 white ink on black paper
31478 LD C,1 1 row of the 10-cell menu column
31480 CALL 31612 paint attribute column
31483 LD A,40 8 rows of black-on-cyan (40)
31485 LD C,8
31487 CALL 31612
31490 LD A,32 2 rows of black-on-green (32)
31492 LD C,2
31494 CALL 31612
31497 LD A,23 5 rows of white-on-red (23)
31499 LD C,5
31501 CALL 31612
31504 XOR A 3 rows of black (0)
31505 LD C,3
31507 CALL 31612
31510 LD C,1 and 1 more row of white-on-black (7)
31512 LD A,7
31514 CALL 31612
31517 LD HL,16406 menu-column header (row 0, col 22)
31520 LD (31257),HL
31523 LD A,82 string 82
31525 CALL 31634 DrawSprite
31528 LD HL,30197 tile source = the corridor strip template
31531 LD (31261),HL
31534 CALL 31626 DrawNextCorridorTile: draw its first entry
31537 LD B,7 then 7 blank rows (string 92)
31539 PUSH BC
31540 LD A,92
31542 CALL 31634 DrawSprite
31545 POP BC
31546 DJNZ 31539
31548 LD HL,16470 crew names from row 2, col 22
31551 LD (31257),HL
31554 LD A,1 A' = crew id 1 (Dallas)
31556 EX AF,AF'
31557 LD A,7 7 name rows
This entry point is used by the routine at 31577. Orders-screen crew-name loop head: A' holds the next crew id, A the remaining row count (7 names on menu rows 2-8).
31559 EX AF,AF' A = crew id to print
31560 DEFB 42,25 first 2 bytes of "LD HL,(draw pointer)": the operand-high byte is the LD A,D at 31562, so falling through loads HL and continues after it
Prev: 31393 Up: Map Next: 31562