| Prev: 6CF4 | Up: Map | Next: 6DDD |
6D17: Level overview screen
|
Displays a preview fly-over of the upcoming terrain before the game starts. Shows scrolling terrain with game number and scrolling title text. Player can press Enter to start the game early, or wait for 5 scroll units to auto-start.
|
||||
| overview | 6D17 | LD BC,$0010 | Initialize scroll position (state_scroll_offset = $0010) and scroll speed (state_island_line_idx = $10). | |
| 6D1A | LD ($5F70),BC | |||
| 6D1E | LD A,$10 | |||
| 6D20 | LD ($5EFD),A | |||
| 6D23 | LD D,$0C | Set screen colors (PAPER RIVER, INK BANK) via clear_screen. | ||
| 6D25 | CALL clear_screen | |||
| 6D28 | CALL init_udg | Clear/initialize screen via init_udg. | ||
| 6D2B | LD DE,$8000 | Print status line 1 (status_line_1, length $31 bytes) using ROM PR_STRING ($203C). | ||
| 6D2E | LD BC,$0031 | |||
| 6D31 | CALL $203C | |||
| 6D34 | CALL print_bridge | Initialize gameplay: call print_bridge, setup_overview_status_player_2, init_starting_bridge (init_starting_bridge). | ||
| 6D37 | CALL setup_overview_status_player_2 | |||
| 6D3A | CALL init_starting_bridge | |||
| 6D3D | CALL init_current_bridge | Initialize terrain rendering. | ||
| 6D40 | LD A,$04 | Print "GAME" text (status_line_4, length 5) using ROM PR_STRING. | ||
| 6D42 | LD ($5EEE),A | |||
| 6D45 | LD DE,$805A | |||
| 6D48 | LD BC,$0005 | |||
| 6D4B | CALL $203C | |||
| 6D4E | LD A,($923A) | Print game number: load game mode from state_game_mode, add "1" for ASCII digit, output via RST $10. | ||
| 6D51 | ADD A,$31 | |||
| 6D53 | RST $10 | |||
| 6D54 | LD A,$68 | Initialize state: set LAST_K to 'h' (paused state), clear state_terrain_position, save initial scroll value to state_overview_start_scroll. | ||
| 6D56 | LD ($5C08),A | |||
| 6D59 | LD A,$00 | |||
| 6D5B | LD ($5F7D),A | |||
| 6D5E | LD A,($5EF0) | |||
| 6D61 | LD ($5D43),A | |||
|
This entry point is used by the routine at reset_scroll_text.
|
||||
| overview_loop | 6D64 | LD A,$BF | Check Enter key (row 6, bit 0). Handle Enter if pressed. | |
| 6D66 | IN A,($FE) | |||
| 6D68 | BIT 0,A | |||
| 6D6A | CALL Z,handle_enter | |||
| 6D6D | LD A,($5D43) | Check if 5 scroll units passed: if (state_bridge_index - state_overview_start_scroll) == 5, jump to return_to_control_selection to start game. | ||
| 6D70 | LD B,A | |||
| 6D71 | LD A,($5EF0) | |||
| 6D74 | SUB B | |||
| 6D75 | CP $05 | |||
| 6D77 | JP Z,return_to_control_selection | |||
| 6D7A | CALL scroll_text_crawl | Text crawl: 1st of 2 pixel shifts this frame. | ||
| 6D7D | CALL render_plane_and_terrain | Render plane and terrain, increment tick counter, operate viewport objects and projectiles. | ||
| 6D80 | LD HL,$5EEF | |||
| 6D83 | INC (HL) | |||
| 6D84 | CALL operate_viewport_slots | |||
| 6D87 | CALL operate_tank_shell | |||
| 6D8A | CALL operate_helicopter_missile | |||
| 6D8D | CALL advance_scroll | Advance terrain scroll and render terrain. | ||
| 6D90 | CALL scroll_text_crawl | Text crawl: 2nd of 2 pixel shifts this frame. | ||
| 6D93 | LD HL,$5F81 | Increment frame counter state_overview_frame, scan keyboard, enable interrupts. | ||
| 6D96 | INC (HL) | |||
| 6D97 | CALL $02BF | |||
| 6D9A | EI | |||
| 6D9B | LD A,($5C08) | Check if Enter was pressed. If so, jump to play. | ||
| 6D9E | CP $0D | |||
| 6DA0 | JP Z,play | |||
| 6DA3 | LD A,($5F81) | Check frame counter AND 3: if not zero, loop back to overview_loop. | ||
| 6DA6 | AND $03 | |||
| 6DA8 | CP $00 | |||
| 6DAA | JP NZ,overview_loop | |||
| 6DAD | LD A,$01 | Open lower screen (K) channel via ROM CHAN_OPEN ($1601) to print next text crawl character. | ||
| 6DAF | CALL $1601 | |||
| 6DB2 | LD A,$10 | INK BLACK | ||
| 6DB4 | RST $10 | |||
| 6DB5 | LD A,$00 | |||
| 6DB7 | RST $10 | |||
| 6DB8 | LD A,$11 | PAPER BLACK | ||
| 6DBA | RST $10 | |||
| 6DBB | LD A,$00 | |||
| 6DBD | RST $10 | |||
| 6DBE | LD A,$16 | AT 1,31 — bottom-right corner of the lower screen (char row 23, column 31). | ||
| 6DC0 | RST $10 | |||
| 6DC1 | LD A,$01 | |||
| 6DC3 | RST $10 | |||
| 6DC4 | LD A,$1F | |||
| 6DC6 | RST $10 | |||
| 6DC7 | LD HL,($5F7E) | Advance text pointer (ptr_scroller) and read next character. Every 4 frames = 8 pixels scrolled = 1 character width. | ||
| 6DCA | INC HL | |||
| 6DCB | LD ($5F7E),HL | |||
| 6DCE | LD A,(HL) | |||
| 6DCF | CP $FF | |||
| 6DD1 | JP Z,reset_scroll_text | If $FF (end of text), jump to reset_scroll_text to reset pointer. Otherwise print character via RST $10, reopen upper screen (S) channel (A=2), and fall through to loop. | ||
| 6DD4 | RST $10 | |||
| 6DD5 | LD A,$02 | |||
| 6DD7 | CALL $1601 | |||
| 6DDA | JP overview_loop | |||
| Prev: 6CF4 | Up: Map | Next: 6DDD |