experimental/menu_ui.s

Download file

Release 2026-11-04-r2 · SHA256 13da84a700db64245cd529639459454ec1e4903746ca0b9a1efdb645a3f20bf0 · Click a line number for a direct link.

1    .ifndef WITH_COSMETIC_UI2    .equ WITH_COSMETIC_UI,03    .endif4| Consistent Xbox labels: native Genesis C = Xbox B (select), native B = Xbox5| A (back alias), Start retains the reference Line Editor's done/back action.6| Explicit menu-only call sites; never remap skating/pass/shot controller input.7 .text8 .globl _start9_start:10 bra.w common_back11 bra.w line_back12 bra.w player_back13 bra.w line_footer_end14 bra.w common_footer_end15 bra.w main_footer_end16 bra.w main_play17 bra.w footer_line18 bra.w footer_common19 bra.w footer_main20 bra.w normalize_back21 bra.w pregame_wait_footer22 bra.w footer_pregame23 bra.w resume_hud24 bra.w input_footer25 bra.w footer_standings26 bra.w footer_leaders27 bra.w footer_teamstats28 bra.w replay_exit29 bra.w footer_confirm30 bra.w root_without_help3132common_back:33 move.w %sr,-(%sp)34 cmpi.l #0x7D64,2(%sp)            | pictured root pause/period scoreboard35 beq.s common_root_no_help36 cmpi.l #0x1127E,2(%sp)           | same native pregame/intermission scoreboard37 beq.s common_root_no_help38 move.w (%sp)+,%sr39 bsr.w footer_common              | nested selection/confirmation keeps its actual help40 bra.s common_keys41common_root_no_help:42 move.w (%sp)+,%sr43 bsr.w root_without_help44common_keys:45 btst #4,%d146 beq.s common_start47 move.w %sr,-(%sp)48 cmpi.l #0x1127E,2(%sp)49 bne.s common_back_parent50 cmpi.l #0x13190,40(%sp)51 bne.s common_back_parent52 tst.w 0xFFFFC3F453 bne.s common_back_parent54 move.w (%sp)+,%sr55 jmp 0x172FA                      | pregame A returns to settings, never starts the match56common_back_parent:57 move.w (%sp)+,%sr58 bra.s common_leave59common_start:60 btst #7,%d161 bne.s common_leave62 jmp 0x7E9063common_leave:64 jmp 0x7EEC65line_back:66 btst #4,%d167 bne.s line_leave68 btst #7,%d169 bne.s line_leave70 jmp 0x833871line_leave:72 jmp 0x881273player_back:74 btst #4,%d175 bne.s player_leave76 btst #7,%d177 bne.s player_leave78 jmp 0x844679player_leave:80 jmp 0x831A81main_play:82 btst #5,%d1                       | Xbox B, same actual select button as Line Editor83 bne.s main_go84 btst #7,%d185 bne.s main_go86 jmp 0xF749687main_go:88 jmp 0xF843E89line_footer_end:90 bsr.w footer_line91 clr.w 0xFFFFB030                  | exact displaced native CLR/RTS92 rts93common_footer_end:94 move.w %sr,-(%sp)95 cmpi.l #0x7DCE,0xFFFFCF28        | native root scoreboard redraw callback96 bne.s common_footer_with_help97 move.w (%sp)+,%sr98 bsr.w root_without_help99 bra.s common_footer_delay100common_footer_with_help:101 move.w (%sp)+,%sr102 bsr.w footer_common103common_footer_delay:104 move.w #24,0xFFFFBD26             | native menu animation delay remains105 rts106main_footer_end:107 bsr.w footer_main108 movem.l (%sp)+,%d0-%d7/%a0-%a6    | exact original renderer epilogue109 rts110footer_line:111 movem.l %d0-%d7/%a0-%a6,-(%sp)112 movea.l #1,%a2113 lea line_text(%pc),%a1114 lea navigation_text(%pc),%a3115 bra.s footer116footer_pregame:117 movem.l %d0-%d7/%a0-%a6,-(%sp)118 movea.l #2,%a2119 lea pregame_text(%pc),%a1120 lea navigation_text(%pc),%a3121 bra.s footer122footer_common:123 movem.l %d0-%d7/%a0-%a6,-(%sp)124 movea.l #1,%a2125 lea common_text(%pc),%a1126 lea navigation_text(%pc),%a3127 bra.s footer128footer_main:129 movem.l %d0-%d7/%a0-%a6,-(%sp)130 movea.l #0,%a2131 lea main_text(%pc),%a1132 lea navigation_text(%pc),%a3133footer:134 move.w %sr,-(%sp)135 movem.w 0xFFFFB028,%d0-%d4         | x,y,attribute,plane VM fields136 movem.w %d0-%d4,-(%sp)137 move.w 0xFFFFBF78,-(%sp)138 move.w 0xFFFFC2F8,-(%sp)139 ori.w #0x700,%sr140 cmpa.l #0,%a2141 bne.s footer_font_ready142 bset #3,0xFFFFC2F8                | main help uses the same crisp small font as native menu labels143footer_font_ready:144 cmpa.l #3,%a2145 beq.w footer_replay146 cmpa.l #0,%a2147 beq.s footer_plane_ready148 | Own a fixed40-column bottom strip in both native32/40-column modes. Native149 | news remains above it; the last24 cells of each64-column row stay untouched.150 bclr #0,0xFFFFC2F0               | repaint native score/clock after this menu-owned overlay151 move.w #0x9218,0xC00004152 clr.w 0xFFFFB02E153 move.w #0x8F02,0xC00004154 move.l #0x6C000003,%d2155 moveq #3,%d1156footer_backing_row:157 move.l %d2,0xC00004158 moveq #39,%d0159footer_backing:160 move.w #0xA403,0xC00000161 dbra %d0,footer_backing162 addi.l #0x00800000,%d2             | next128-byte row, preserve24 hidden cells163 dbra %d1,footer_backing_row164 | Native blank font tiles are transparent. Retire the obsolete lower-panel165 | artwork on plane B too, otherwise its old arrows/frame shine through help.166 move.l #0x4C000003,%d2167 moveq #3,%d1168footer_old_panel_row:169 move.l %d2,0xC00004170 moveq #39,%d0171footer_old_panel:172 move.w #0x07FF,0xC00000173 dbra %d0,footer_old_panel174 addi.l #0x00800000,%d2175 dbra %d1,footer_old_panel_row176footer_plane_ready:177 jsr 0x25D01C                     | stable grey help panel before native text writes178 .if WITH_COSMETIC_UI179 cmpa.l #0,%a2180 bne.s main_frame_done181 bsr.w main_frame182main_frame_done:183 .endif184 cmpa.l #0,%a2185 beq.s footer_navigation_done186 move.l %a1,-(%sp)187 move.w #1,0xFFFFB028188 move.w #25,0xFFFFB02A189 move.w #0x8000,0xFFFFB02C190 movea.l %a3,%a1191 jsr 0x25D004                     | centre the actual native navigation help192 jsr 0x11BA4193 movea.l (%sp)+,%a1194footer_navigation_done:195 .if WITH_COSMETIC_UI196 cmpa.l #0,%a2197 bne.s ordinary_footer_position198 move.w #7,0xFFFFB028             | 26 visible glyph cells, centred in36-cell interior199 move.w #26,0xFFFFB02A200 bra.s final_footer_position201ordinary_footer_position:202 .endif203 move.w #1,0xFFFFB028204 move.w #27,0xFFFFB02A205 cmpa.l #1,%a2206 bne.s help_row_ready207 move.w #26,0xFFFFB02A208help_row_ready:209 jsr 0x25D004                     | retain keys/meaning; centre the trimmed help210 .if WITH_COSMETIC_UI211final_footer_position:212 .endif213 move.w #0x8000,0xFFFFB02C214 | Common/LineEditor menus expose the dedicated planeA footer above. Main215 | settings retain their own native selected text plane.216 jsr 0x11BA4                      | native game text, original fonts/palette217footer_restore:218 move.w (%sp)+,0xFFFFC2F8219 move.w (%sp)+,0xFFFFBF78220 movem.w (%sp)+,%d0-%d4221 movem.w %d0-%d4,0xFFFFB028222 jsr 0x11952                      | restore actual native text-cell VDP destination223 jsr 0x25D008                     | private grey blue-content modal preview224 move.w (%sp)+,%sr225 movem.l (%sp)+,%d0-%d7/%a0-%a6226 rts227footer_replay:228 | Manual VCR help owns only the centre of the last row: leave both HUD boxes229 | untouched. The scripted automatic-replay branch never calls input_footer.230 clr.w 0xFFFFB02E231 move.w #9,0xFFFFB028232 move.w #27,0xFFFFB02A233 move.w #0x8000,0xFFFFB02C234 jsr 0x11952235 move.w #0x8F02,0xC00004236 moveq #22,%d0237footer_replay_clear:238 move.w #0xA403,0xC00000239 dbra %d0,footer_replay_clear240 jsr 0x11BA4241 btst #0,0xFFFFC2F6242 beq.w footer_restore243 | Retire obsolete Genesis B/C button artwork in the manual options window.244 | Keep its native frame/pattern bank, and describe the actual Xbox controls.245 move.w #8,0xFFFFB02E246 move.w #4,0xFFFFB02A247 moveq #5,%d1248footer_replay_option_row:249 cmpi.w #6,0xFFFFB02A250 beq.s footer_replay_option_next251 move.w #3,0xFFFFB028252 jsr 0x11952253 moveq #13,%d0254footer_replay_option_clear:255 move.w #0x8521,0xC00000256 dbra %d0,footer_replay_option_clear257footer_replay_option_next:258 addq.w #1,0xFFFFB02A259 dbra %d1,footer_replay_option_row260 move.w #3,0xFFFFB028261 move.w #4,0xFFFFB02A262 lea replay_heading(%pc),%a1263 jsr 0x11BA4264 move.w #3,0xFFFFB028265 move.w #7,0xFFFFB02A266 lea replay_reverse(%pc),%a1267 jsr 0x11BA4268 move.w #3,0xFFFFB028269 move.w #9,0xFFFFB02A270 lea replay_back(%pc),%a1271 jsr 0x11BA4272 bra.w footer_restore273normalize_back:274 btst #4,%d1275 beq.s no_new_back276 bset #7,%d1277no_new_back:278 btst #4,%d3279 beq.s no_held_back280 bset #7,%d3281no_held_back:282 rts283line_text:   .word 34284 .ascii "A Back  B Select  Start Done    "285 .even286common_text: .word 34287 .ascii "A Back  B Select  Start Back    "288 .even289 .if WITH_COSMETIC_UI290main_text: .word 28291 .ascii "D-pad Change  B/Start Play"292 .else293main_text:   .word 34294 .ascii "D-pad Change   B/Start Play     "295 .endif296 .even297298| Native pregame's timed idle loop redraws its news ticker without invoking299| the key handler. Draw help AFTER that native call, scoped to its authenticated300| saved return13190. Matchups/ordinary clock waits retain their original maps.301pregame_wait_footer:302 jsr 0x15EC0303 cmpi.l #0x13190,32(%sp)304 bne.s pregame_wait_original305 bsr.w root_without_help306pregame_wait_original:307 move.w 0xFFFFB03E,%d0308 jmp 0x11298309310resume_hud:311 | The native rink renderer restores plane B before this hook. Retire only312 | menu-owned plane A text; then let the native code rebuild BOTH HUD boxes.313 move.w %sr,-(%sp)314 movem.l %d0-%d2,-(%sp)315 ori.w #0x700,%sr316 move.w #0x8F02,0xC00004317 move.l #0x6C000003,%d2318 moveq #3,%d1319resume_help_row:320 move.l %d2,0xC00004321 moveq #39,%d0322resume_help_clear:323 move.w #0x07FF,0xC00000324 dbra %d0,resume_help_clear325 addi.l #0x00800000,%d2326 dbra %d1,resume_help_row327 movem.l (%sp)+,%d0-%d2328 move.w (%sp)+,%sr329 bclr #0,0xFFFFC2F0               | footer owns the lower rows only while the menu is open330 jsr 0x12C04                      | redraw both native real-score and clock boxes on return331 jmp 0x7DB4                       | tail-hook: preserve native wait/palette fade-in before pause RTS332pregame_text: .word 34333 .ascii "A Back  B Select  Start Play    "334 .even335336navigation_text: .word 34337 .ascii "D-pad: Move selection           "338 .even339340root_without_help:341 | jdc rr.png exception: restore the native full-height scoreboard window.342 | Other pages retain their contextual help. Resume retires hidden help cells.343 move.w %sr,-(%sp)344 ori.w #0x700,%sr345 move.w #0x921C,0xC00004346 move.w (%sp)+,%sr347 rts348349| Called only by the normal (not scripted automatic replay) native A41E350| menu reader. Its caller is at6(SP): our return4 + reader's saved SR2.351| Draw after the page itself, using the page's actual native button actions.352input_footer:353 movem.l %d0-%d7/%a0-%a6,-(%sp)354 move.w %sr,-(%sp)355 move.l 68(%sp),%d0356 lea common_text(%pc),%a1357 lea navigation_text(%pc),%a3358 cmpi.l #0x832A,%d0359 beq.w input_line360 cmpi.l #0x8438,%d0361 beq.w input_draw362 cmpi.l #0x8172,%d0363 beq.w input_scroll364 cmpi.l #0x8F7A,%d0365 beq.w input_scroll366 cmpi.l #0x920C,%d0367 beq.w input_scroll368 cmpi.l #0xFDCE2,%d0369 beq.w input_scroll370 cmpi.l #0x8A8A,%d0371 beq.w input_roster372 cmpi.l #0x950C,%d0373 beq.w input_stats374 cmpi.l #0xFA220,%d0375 beq.w input_cards376 cmpi.l #0x9FC6,%d0377 beq.w input_wait378 cmpi.l #0xA0AA,%d0379 beq.w input_replay380 move.w (%sp)+,%sr381 movem.l (%sp)+,%d0-%d7/%a0-%a6382 rts383input_replay:384 lea replay_text(%pc),%a1385 btst #0,0xFFFFC2F6386 beq.s input_replay_ready387 lea replay_options(%pc),%a1388input_replay_ready:389 btst #4,%d1390 beq.s input_replay_draw391 bset #0,0xFFFFC2F6               | A backs directly to pause, Start still opens VCR options392input_replay_draw:393 movea.l #3,%a2394 move.w (%sp)+,%sr395 bra.w footer396input_line:397 lea line_text(%pc),%a1398 bra.s input_draw399input_scroll:400 lea back_text(%pc),%a1401 lea scroll_text(%pc),%a3402 bra.s input_draw403input_roster:404 lea teams_text(%pc),%a1405 lea roster_nav(%pc),%a3406 bra.s input_draw407input_stats:408 lea teams_text(%pc),%a1409 lea stats_nav(%pc),%a3410 bra.s input_draw411input_cards:412 lea cards_text(%pc),%a1413 lea cards_nav(%pc),%a3414 bra.s input_draw415input_wait:416 lea back_text(%pc),%a1417 lea blank_text(%pc),%a3418 cmpi.l #0x9E24,72(%sp)            | Change Goalie is a real selector, not a read-only page419 bne.s input_wait_readonly420 lea common_text(%pc),%a1421 lea navigation_text(%pc),%a3422 bra.s input_draw423input_wait_readonly:424 cmpi.l #0xFDAC2,72(%sp)425 bne.s input_draw426 lea period_nav(%pc),%a3427input_draw:428 movea.l #1,%a2429 move.w (%sp)+,%sr430 bra.w footer431432footer_standings:433 movem.l %d0-%d7/%a0-%a6,-(%sp)434 movea.l #1,%a2435 lea standings_text(%pc),%a1436 lea standings_nav(%pc),%a3437 bra.w footer438footer_leaders:439 movem.l %d0-%d7/%a0-%a6,-(%sp)440 movea.l #1,%a2441 lea leaders_text(%pc),%a1442 lea page_nav(%pc),%a3443 bra.w footer444footer_teamstats:445 movem.l %d0-%d7/%a0-%a6,-(%sp)446 movea.l #1,%a2447 lea back_text(%pc),%a1448 lea page_nav(%pc),%a3449 bra.w footer450footer_confirm:451 movem.l %d0-%d7/%a0-%a6,-(%sp)452 movea.l #1,%a2453 lea confirm_text(%pc),%a1454 lea blank_text(%pc),%a3455 bra.w footer456457back_text: .word 34458 .ascii "A/Start Back"459 .space 32-(.-back_text-2),32460scroll_text: .word 34461 .ascii "Up/Down: Scroll"462 .space 32-(.-scroll_text-2),32463teams_text: .word 34464 .ascii "A/Start Back  X Teams"465 .space 32-(.-teams_text-2),32466roster_nav: .word 34467 .ascii "L/R Line  U/D Status"468 .space 32-(.-roster_nav-2),32469stats_nav: .word 34470 .ascii "L/R Stat  U/D Scroll"471 .space 32-(.-stats_nav-2),32472cards_text: .word 34473 .ascii "A/Start Back  B Next  X Teams"474 .space 32-(.-cards_text-2),32475cards_nav: .word 34476 .ascii "Left/Right: Player"477 .space 32-(.-cards_nav-2),32478blank_text: .word 34479 .space 32,32480period_nav: .word 34481 .ascii "Left/Right: Stat"482 .space 32-(.-period_nav-2),32483standings_text: .word 34484 .ascii "A/Start Back  B Players"485 .space 32-(.-standings_text-2),32486standings_nav: .word 34487 .ascii "L/R Division  U/D Team"488 .space 32-(.-standings_nav-2),32489leaders_text: .word 34490 .ascii "A/Start Back  B Sort"491 .space 32-(.-leaders_text-2),32492page_nav: .word 34493 .ascii "Left/Right: Page"494 .space 32-(.-page_nav-2),32495replay_text: .word 25496 .ascii "A Back B Play Start Opt"497 .space 23-(.-replay_text-2),32498 .even499replay_options: .word 25500 .ascii "A/Start Back B Reverse"501 .space 23-(.-replay_options-2),32502 .even503replay_heading: .word 16504 .ascii "Replay Options"505replay_reverse: .word 16506 .ascii "B Reverse     "507replay_back: .word 16508 .ascii "A/Start Back  "509confirm_text: .word 34510 .ascii "A/Start Cancel  B Confirm"511 .space 32-(.-confirm_text-2),32512513replay_exit:514 btst #4,%d1515 bne.s replay_exit_parent516 clr.w 0xFFFFCF20                 | exact native Start/automatic exit: return to game517 bset #1,0xFFFFC2F6518 jmp 0xA3A8519replay_exit_parent:520 move.w #1,0xFFFFCF20              | A returns to the parent pause menu, not Resume Game521 bclr #1,0xFFFFC2F6                | parent must redraw after VCR retired its maps522 jmp 0xA3A8523524 .if WITH_COSMETIC_UI525| Main menu only: five rows stay in the original settings panel. Retire its526| unused sixth row with its original lower border atrow24; own a second native527| frame atrows25..27. Exact original3x3 frame tiles05B4..05BC, no new artwork.528| PlaneA columns1..38 only; all borders/hidden cells/planeB/palette preserved.529main_frame:530 move.w #0x8F02,0xC00004531 lea main_frame_tiles(%pc),%a0532 move.l #0x6C020003,%d2533 moveq #3,%d1534main_frame_row:535 move.l %d2,0xC00004536 move.w (%a0)+,0xC00000537 move.w (%a0)+,%d3538 moveq #35,%d0539main_frame_fill:540 move.w %d3,0xC00000541 dbra %d0,main_frame_fill542 move.w (%a0)+,0xC00000543 addi.l #0x00800000,%d2544 dbra %d1,main_frame_row545 | The fifth visible value's native selection also ends on row24. Our546 | outer-panel bottom has just covered its lower-left corner at column16.547 | Restore only that original corner; other selections keep a straight548 | outer bottom, so scrolling upward never leaves a stale selection notch.549 move.w %d7,%d0550 lsr.w #1,%d0551 sub.w 0xFFFFD422,%d0552 cmpi.w #4,%d0553 bne.s main_frame_done_corner554 move.l #0x6C200003,0xC00004555 move.w #0x8034,0xC00000556main_frame_done_corner:557 rts558main_frame_tiles:559 .word 0x05BA,0x05BB,0x05BC         | original settings bottom560 .word 0x05B4,0x05B5,0x05B6         | help top561 .word 0x05B7,0x05B8,0x05B9         | help interior562 .word 0x05BA,0x05BB,0x05BC         | help bottom, last visible row563 .endif564