experimental/replaytitle.s

Download file

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

1    .ifndef WITH_REPLAY_HUD2    .equ WITH_REPLAY_HUD,03    .endif4    .ifndef WITH_FRAMED_PP_REPLAY5    .equ WITH_FRAMED_PP_REPLAY,06    .endif7    .if WITH_FRAMED_PP_REPLAY8    .equ PANEL_FIRST,189    .else10    .equ PANEL_FIRST,2311    .endif12| Big chrome "REPLAY" over the automatic goal replay (jdc 2026-10-26-r23), instead of the13| native VCR box (A <<  B ||>  C >, window plane rows 2-4, columns 2-9, tiles from $B026).14| r25: REPLAY on rows 0-2 and a smaller "X+B SKIP" (pad A + C) on rows 3-4 in the box's15| own 14 tiles (the game reloads them from ROM at every replay start).16| Called by replay.s every frame while its replay plays (ARST $A502). First playing frame:17| the 27 tiles go to the crowd meters' VRAM ($FC20, tile $7E1: crowd.s neither draws nor18| re-uploads them during the replay, and re-uploads them right after). Every frame: the19| window plane rows 1-3, columns 2-10 show them (priority, palette 0 greys) and row 4,20| columns 2-9 (the box's shadow) is cleared. On exit the game redraws its whole window panel21| there, so nothing of ours stays. Tiles: replaytitle.py (Open Sans Condensed ExtraBold22| Italic, outline, silver bands).23    .equ ARCNT,0xFFF73A24    .equ TILE,0x7E125    .equ VDATA,0xC0000026    .equ VCTRL,0xC0000427    .text28    .globl _start29_start:30    .if WITH_REPLAY_HUD31    bra.w draw_title32    bra.w capture_panel33    .if WITH_FRAMED_PP_REPLAY34    .ascii "PPFR"                    | declared snapshot protocol; never executed35    .word 18,18036    .endif37    .endif38draw_title:39    movem.l %d0-%d5/%a0-%a1,-(%sp)40    move.w %sr,-(%sp)41    ori.w #0x700,%sr42    lea VDATA,%a143    .if WITH_REPLAY_HUD44    bsr.w restore_panel45    .endif46    move.w 0xFFFFB026,%d5              | the VCR box's own tiles (reloaded from ROM by every replay)47    cmpi.w #1,ARCNT48    bne.s 2f49    .if WITH_REPLAY_HUD50    move.w %d5,%d051    addi.w #14,%d0                  | native VCR allocation is76tiles, title uses14..4052    lsl.w #5,%d053    .else54    move.w #TILE*32,%d0                | tiles, once: REPLAY to the meters' VRAM,55    .endif56    bsr.w wcmd57    lea title(%pc),%a058    move.w #27*8-1,%d2591:  move.l (%a0)+,(%a1)60    dbra %d2,1b61    move.w %d5,%d0                     | the hint over the box's tiles62    lsl.w #5,%d063    .if WITH_REPLAY_HUD64    bsr.w wcmd65    .else66    bsr.s wcmd67    .endif68    lea hint(%pc),%a069    move.w #14*8-1,%d27011: move.l (%a0)+,(%a1)71    dbra %d2,11b722:  moveq #0,%d3                       | rows 0..2: REPLAY, 9 tiles from column 273    .if WITH_REPLAY_HUD74    move.w %d5,%d475    addi.w #0x8000+14,%d476    .else77    move.w #0x8000+TILE,%d478    .endif793:  bsr.s cell80    moveq #8,%d2814:  move.w %d4,(%a1)82    addq.w #1,%d483    dbra %d2,4b84    addq.w #1,%d385    cmpi.w #3,%d386    bcs.s 3b87    ori.w #0x8000,%d5                  | rows 3..4: X+B SKIP, 7 tiles, then the box's last column885:  bsr.s cell89    moveq #6,%d2906:  move.w %d5,(%a1)91    addq.w #1,%d592    dbra %d2,6b93    move.w #0x07FF,(%a1)94    move.w #0x07FF,(%a1)95    addq.w #1,%d396    cmpi.w #5,%d397    bcs.s 5b98    move.w (%sp)+,%sr99    movem.l (%sp)+,%d0-%d5/%a0-%a1100    rts101cell:                                  | d3 = row -> VDP write at the window plane, column 2102    move.w 0xFFFFB00E,%d1              | log2 of the plane width103    move.w %d3,%d0104    lsl.w %d1,%d0105    addq.w #2,%d0106    add.w %d0,%d0107    add.w 0xFFFFB00C,%d0108wcmd:                                  | d0 = VRAM address -> write command109    moveq #0,%d1110    move.w %d0,%d1111    lsl.l #2,%d1112    lsr.w #2,%d1113    swap %d1114    ori.l #0x40000000,%d1115    move.l %d1,VCTRL116    rts117    .if WITH_REPLAY_HUD118| Caller owns the declared90/180-byte map on its stack; preserve full ABI.119| F670..F673 is a transient pointer, separate from shootout F65C..F66F.120capture_panel:121    movem.l %d0-%d3/%a0-%a1,-(%sp)122    move.w %sr,-(%sp)123    ori.w #0x700,%sr124    move.l %a0,0xFFFFF670125    lea VDATA,%a1126    move.w #0x8F02,VCTRL127    moveq #PANEL_FIRST,%d3128capture_row:129    bsr.w panel_address130    andi.l #0xBFFFFFFF,%d1131    move.l %d1,VCTRL132    moveq #8,%d2133capture_word:134    move.w (%a1),(%a0)+135    dbra %d2,capture_word136    addq.w #1,%d3137    cmpi.w #28,%d3138    bcs.s capture_row139    move.w (%sp)+,%sr140    movem.l (%sp)+,%d0-%d3/%a0-%a1141    rts142restore_panel:143    move.w #0x8F02,VCTRL144    movea.l 0xFFFFF670,%a0145    move.l %a0,%d0146    beq.s restore_done147    moveq #PANEL_FIRST,%d3148restore_row:149    bsr.s panel_address150    move.l %d1,VCTRL151    moveq #8,%d2152restore_word:153    move.w (%a0)+,(%a1)154    dbra %d2,restore_word155    addq.w #1,%d3156    cmpi.w #28,%d3157    bcs.s restore_row158restore_done:159    rts160panel_address:161    moveq #0,%d1162    move.w %d3,%d1163    lsl.w #7,%d1164    swap %d1165    ori.l #0x60000003,%d1166    rts167    .endif168    .even169title:170    .long 0x00000000,0x00000000,0x00000000,0x00000044,0x00000041,0x00000041,0x00000441,0x00000411171    .long 0x00000000,0x00000000,0x00000000,0x44444440,0x11111144,0x11111114,0x11111114,0x11411114172    .long 0x00000000,0x00000000,0x00000000,0x04444444,0x04111111,0x04111111,0x44111111,0x41111444173    .long 0x00000000,0x00000000,0x00000000,0x44444444,0x14411111,0x14411111,0x14411111,0x44111141174    .long 0x00000000,0x00000000,0x00000000,0x44400444,0x11440411,0x11140411,0x11144411,0x11144111175    .long 0x00000000,0x00000000,0x00000000,0x44400000,0x11400000,0x11400004,0x14400004,0x14000004176    .long 0x00000000,0x00000000,0x00000000,0x44444440,0x41111140,0x41111140,0x11111140,0x11111140177    .long 0x00000000,0x00000000,0x00000000,0x44444404,0x41111444,0x41111441,0x41111441,0x41111411178    .long 0x00000000,0x00000000,0x00000000,0x44444000,0x11114000,0x11144000,0x11440000,0x11400000179    .long 0x00000433,0x00000455,0x00000455,0x00004466,0x00004666,0x00004555,0x00004333,0x00004333180    .long 0x33433334,0x55455554,0x55455554,0x66666644,0x66666644,0x55555444,0x33333404,0x33333404181    .long 0x43333400,0x45555444,0x45555555,0x46666666,0x66666664,0x55554444,0x33334000,0x33334000182    .long 0x04333343,0x44555545,0x44555545,0x44666666,0x46666666,0x45555555,0x43333444,0x43334400183    .long 0x33344333,0x55544555,0x55544555,0x66444666,0x64446666,0x44045555,0x40043333,0x00043333184    .long 0x34000044,0x54000045,0x54000445,0x44000466,0x40004466,0x40004555,0x40004333,0x40044333185    .long 0x33333340,0x55555540,0x55455540,0x66466640,0x66466640,0x54455540,0x33333340,0x33333340186    .long 0x44333333,0x04555555,0x04555555,0x04666666,0x04666664,0x04555544,0x04333340,0x04333340187    .long 0x34400000,0x54000000,0x44000000,0x40000000,0x40000000,0x00000000,0x00000000,0x00000000188    .long 0x00044111,0x00041111,0x00043333,0x00043333,0x00044444,0x00000000,0x00000000,0x00000000189    .long 0x41111444,0x44111141,0x44333343,0x44333343,0x44444444,0x00000000,0x00000000,0x00000000190    .long 0x11144444,0x11111114,0x33333344,0x33333344,0x44444444,0x00000000,0x00000000,0x00000000191    .long 0x41114000,0x11114000,0x33334000,0x33334000,0x44444000,0x00000000,0x00000000,0x00000000192    .long 0x00441114,0x00411111,0x00433333,0x00433333,0x00444444,0x00000000,0x00000000,0x00000000193    .long 0x44441111,0x11141111,0x33333334,0x33433334,0x44444444,0x00000000,0x00000000,0x00000000194    .long 0x11111140,0x44411140,0x44333340,0x04333340,0x04444440,0x00000000,0x00000000,0x00000000195    .long 0x04111140,0x04111140,0x44333440,0x43333400,0x44444400,0x00000000,0x00000000,0x00000000196    .long 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000197| end of title198hint:199    .long 0x55555555,0x56666666,0x56444444,0x56444444,0x56334433,0x56334433,0x56433334,0x56443344200    .long 0x55555555,0x66666666,0x44444444,0x44444444,0x44444444,0x44433444,0x44433444,0x43333334201    .long 0x55555555,0x66666666,0x44444444,0x44444444,0x33333444,0x33443344,0x33443344,0x33333444202    .long 0x55555555,0x66666666,0x44444444,0x44444444,0x44433334,0x44334433,0x44334444,0x44433334203    .long 0x55555555,0x66666666,0x44444444,0x44444444,0x43344334,0x43343344,0x43333444,0x43334444204    .long 0x55555555,0x66666666,0x44444444,0x44444444,0x33333343,0x44334443,0x44334443,0x44334443205    .long 0x55555555,0x66666665,0x44444465,0x44444465,0x33334465,0x34433465,0x34433465,0x33334465206    .long 0x56433334,0x56334433,0x56334433,0x56444444,0x56444444,0x56444444,0x56666666,0x55555555207    .long 0x44433444,0x44433444,0x44444444,0x44444444,0x44444444,0x44444444,0x66666666,0x55555555208    .long 0x33443344,0x33443344,0x33333444,0x44444444,0x44444444,0x44444444,0x66666666,0x55555555209    .long 0x44444433,0x44334433,0x44433334,0x44444444,0x44444444,0x44444444,0x66666666,0x55555555210    .long 0x43333444,0x43343344,0x43344334,0x44444444,0x44444444,0x44444444,0x66666666,0x55555555211    .long 0x44334443,0x44334443,0x33333343,0x44444444,0x44444444,0x44444444,0x66666666,0x55555555212    .long 0x34444465,0x34444465,0x34444465,0x44444465,0x44444465,0x44444465,0x66666665,0x55555555213| end of hint214