From 3cb404e99456fcde409d79103f9f4626350fbb8a Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 4 Sep 2016 04:13:12 -0400 Subject: regenerate jumpmanjr.html --- jumpmanjr.html | 233 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 141 insertions(+), 92 deletions(-) diff --git a/jumpmanjr.html b/jumpmanjr.html index 7f008be..49cdb12 100644 --- a/jumpmanjr.html +++ b/jumpmanjr.html @@ -7,7 +7,7 @@
 ; da65 V2.15 - Git 104f898
-; Created:    2016-09-03 20:50:08
+; Created:    2016-09-04 04:12:02
 ; Input file: jumpmanjr.rom
 ; Page:       1
 
@@ -19,6 +19,7 @@
 dm_ypos         := $0054                        ; see draw_map and level_maps.txt
 dm_xpos         := $0055                        ; see draw_map and level_maps.txt
 SAVMSC          := $0058                        ; OS's idea of the start of screen memory [redundant to set here?]
+jiffy_timer_3_hi:= $00A2                        ; gets incremented every time 3_lo wraps around to zero
 zp_temp2        := $00AE                        ; used for (zp,y) addressing, also 2 temps for scores_screen
 bomb_idx        := $00B2                        ; bomb that was just picked up (times 2, suitable for index into a table of words)
 blistptr        := $00B4                        ; bomb_pickup: points to current level's bomblist
@@ -56,13 +57,15 @@
 CHBAS           := $02F4
 page6_vectors_minus_one:= $05FF                 ; 1-indexed
 page6_vectors   := $0600                        ; initialized with page6_initial_vectors
+jiffy_timer_3_lo:= $0619                        ; gets incremented every frame
 jiffy_timer_1   := $061A                        ; gets incremented every frame
 jiffy_timer_2   := $061B                        ; gets incremented every frame
+odd_frame_flag  := $061C                        ; a 1-bit frame counter (toggles every frame). possibly unused.
 speed_jiffy_timer:= $061E                       ; counts 0..initial_speed
 falling_flag    := $0621                        ; 1 = falling, reset to 0 when jumpman hits the ground
 current_speed   := $0624                        ; can be modified, e.g. set to $08 when being electrocuted
 initial_speed   := $0625                        ; current user's chosen speed, set at game start
-bonus_jiffy_timer:= $0626                       ; gets incremented every frame when playing a level, bonus-=100 when this reaches 0
+bonus_jiffy_timer:= $0626                       ; gets incremented every frame when playing a level, bonus-=100 when this wraps around to 0
 playing_level   := $0627                        ; 0 = not playing, non-0 = playing
 sfx_lock        := $062F                        ; lets other code know cue_sfx is still running? not 100% sure
 player_delta_x  := $0630                        ; amount to move jumpman this frame (1 or $FF aka -1)
@@ -957,15 +960,15 @@
         sta     GRAFM,x                         ; 8412 9D 11 D0                 ...
         dex                                     ; 8415 CA                       .
         bne     update_color_regs               ; 8416 D0 F7                    ..
-        inc     $0619                           ; 8418 EE 19 06                 ...
-        bne     L841F                           ; 841B D0 02                    ..
-        inc     $A2                             ; 841D E6 A2                    ..
-L841F:  inc     jiffy_timer_1                   ; 841F EE 1A 06                 ...
+        inc     jiffy_timer_3_lo                ; 8418 EE 19 06                 ...
+        bne     no_wrap                         ; 841B D0 02                    ..
+        inc     jiffy_timer_3_hi                ; 841D E6 A2                    ..
+no_wrap:inc     jiffy_timer_1                   ; 841F EE 1A 06                 ...
         inc     jiffy_timer_2                   ; 8422 EE 1B 06                 ...
-        inc     $061C                           ; 8425 EE 1C 06                 ...
-        lda     $061C                           ; 8428 AD 1C 06                 ...
+        inc     odd_frame_flag                  ; 8425 EE 1C 06                 ...
+        lda     odd_frame_flag                  ; 8428 AD 1C 06                 ...
         and     #$01                            ; 842B 29 01                    ).
-        sta     $061C                           ; 842D 8D 1C 06                 ...
+        sta     odd_frame_flag                  ; 842D 8D 1C 06                 ...
         lda     #$00                            ; 8430 A9 00                    ..
         sta     falling_flag                    ; 8432 8D 21 06                 .!.
         sta     $0622                           ; 8435 8D 22 06                 .".
@@ -1001,7 +1004,7 @@
         bne     no_dec_bonus                    ; 8486 D0 03                    ..
         jsr     decrement_time_bonus_jv         ; 8488 20 21 80                  !.
 no_dec_bonus:
-        lda     $0619                           ; 848B AD 19 06                 ...
+        lda     jiffy_timer_3_lo                ; 848B AD 19 06                 ...
         and     #$07                            ; 848E 29 07                    ).
         bne     check_joystick_enabled          ; 8490 D0 12                    ..
         inc     $0628                           ; 8492 EE 28 06                 .(.
@@ -1620,19 +1623,19 @@
 
 ; ----------------------------------------------------------------------------
 L88DC:  lda     #$00                            ; 88DC A9 00                    ..
-        sta     $A2                             ; 88DE 85 A2                    ..
+        sta     jiffy_timer_3_hi                ; 88DE 85 A2                    ..
 L88E0:  lda     $A0                             ; 88E0 A5 A0                    ..
         bne     L88E7                           ; 88E2 D0 03                    ..
-        sta     $A2                             ; 88E4 85 A2                    ..
+        sta     jiffy_timer_3_hi                ; 88E4 85 A2                    ..
 L88E6:  rts                                     ; 88E6 60                       `
 
 ; ----------------------------------------------------------------------------
-L88E7:  lda     $A2                             ; 88E7 A5 A2                    ..
+L88E7:  lda     jiffy_timer_3_hi                ; 88E7 A5 A2                    ..
         cmp     #$28                            ; 88E9 C9 28                    .(
         bcc     L88E6                           ; 88EB 90 F9                    ..
         lda     #$00                            ; 88ED A9 00                    ..
         sta     $A0                             ; 88EF 85 A0                    ..
-        sta     $A2                             ; 88F1 85 A2                    ..
+        sta     jiffy_timer_3_hi                ; 88F1 85 A2                    ..
         ldx     #$FF                            ; 88F3 A2 FF                    ..
         txs                                     ; 88F5 9A                       .
         jmp     init_game                       ; 88F6 4C 00 90                 L..
@@ -2711,7 +2714,7 @@
         sta     AUDC1                           ; 9057 8D 01 D2                 ...
         lda     #$ED                            ; 905A A9 ED                    ..
         sta     dli_vec_shadow_lo               ; 905C 8D AE 06                 ...
-; set work_level_sub0 to title_screen_color_snd
+; set work_level_sub0 to fade_in_letters
 ts_setup_sub0:
         lda     #$92                            ; 905F A9 92                    ..
         sta     dli_vec_shadow_hi               ; 9061 8D AF 06                 ...
@@ -2719,11 +2722,11 @@
         sta     work_level_sub0                 ; 9066 8D 82 07                 ...
         lda     #$91                            ; 9069 A9 91                    ..
         sta     work_level_sub0+1               ; 906B 8D 83 07                 ...
-; some ISR is writing to $9c...
-wait_until_9c_is_0e:
+; fade_in_letters increments $9c after every letter, $0e means they're all done (since there are 14 of them and we start counting at zero)
+wait_letters_done:
         lda     $9C                             ; 906E A5 9C                    ..
         cmp     #$0E                            ; 9070 C9 0E                    ..
-        bne     wait_until_9c_is_0e             ; 9072 D0 FA                    ..
+        bne     wait_letters_done               ; 9072 D0 FA                    ..
         lda     #$E6                            ; 9074 A9 E6                    ..
         sta     work_level_sub0                 ; 9076 8D 82 07                 ...
         lda     #$06                            ; 9079 A9 06                    ..
@@ -2753,6 +2756,8 @@
         sta     $9D                             ; 90B6 85 9D                    ..
         lda     #$07                            ; 90B8 A9 07                    ..
         sta     $B9                             ; 90BA 85 B9                    ..
+; set _sub0 to title_dancing
+start_dancing:
         lda     #$72                            ; 90BC A9 72                    .r
         sta     work_level_sub0                 ; 90BE 8D 82 07                 ...
         lda     #$91                            ; 90C1 A9 91                    ..
@@ -2819,20 +2824,24 @@
 replacement_block_char:
         .byte   $BF,$BF,$CF,$EF,$E7,$DB,$D9,$BF ; 9134 BF BF CF EF E7 DB D9 BF  ........
 ; ----------------------------------------------------------------------------
-; rotate colors and play the descending tone as the letters appear on the title screen
-title_screen_color_snd:
+; rotate colors and play the descending tone as each letter appears on the title screen. called once per frame, uses $9c to keep track of letter. caller stops this routine being called when $9c holds $0e (meaning the last letter is done).
+fade_in_letters:
         lda     $062A                           ; 913C AD 2A 06                 .*.
         sta     COLOR0                          ; 913F 8D C4 02                 ...
         ldy     $9C                             ; 9142 A4 9C                    ..
+; don't 'fade-in' the space in the title (offset 7)
+skip_space:
         cpy     #$07                            ; 9144 C0 07                    ..
-        beq     L9164                           ; 9146 F0 1C                    ..
+        beq     turn_letter_white               ; 9146 F0 1C                    ..
         clc                                     ; 9148 18                       .
         lda     $9D                             ; 9149 A5 9D                    ..
         adc     #$04                            ; 914B 69 04                    i.
         sta     $9D                             ; 914D 85 9D                    ..
-        beq     L9164                           ; 914F F0 13                    ..
+        beq     turn_letter_white               ; 914F F0 13                    ..
         sta     AUDF1                           ; 9151 8D 00 D2                 ...
-L9154:  lsr     a                               ; 9154 4A                       J
+; the luminance stays the same
+rotate_hue:
+        lsr     a                               ; 9154 4A                       J
         lsr     a                               ; 9155 4A                       J
         lsr     a                               ; 9156 4A                       J
         lsr     a                               ; 9157 4A                       J
@@ -2845,14 +2854,18 @@
         rts                                     ; 9163 60                       `
 
 ; ----------------------------------------------------------------------------
-L9164:  lda     $3045,y                         ; 9164 B9 45 30                 .E0
+; clear the high 2 bits on the letter, in screen memory
+turn_letter_white:
+        lda     $3045,y                         ; 9164 B9 45 30                 .E0
         and     #$3F                            ; 9167 29 3F                    )?
         sta     $3045,y                         ; 9169 99 45 30                 .E0
         inc     $9C                             ; 916C E6 9C                    ..
         iny                                     ; 916E C8                       .
-        jmp     L9154                           ; 916F 4C 54 91                 LT.
+        jmp     rotate_hue                      ; 916F 4C 54 91                 LT.
 
 ; ----------------------------------------------------------------------------
+; make jumpmen dance on title screen, called once/frame
+title_dancing:
         lda     $062A                           ; 9172 AD 2A 06                 .*.
         sta     COLOR0                          ; 9175 8D C4 02                 ...
         lda     $9C                             ; 9178 A5 9C                    ..
@@ -2940,6 +2953,8 @@
 L92E8:  .byte   $07,$00,$00,$02,$03,$48,$A9,$94 ; 92E8 07 00 00 02 03 48 A9 94  .....H..
         .byte   $8D,$0A,$D4,$8D,$18,$D0,$A9,$CA ; 92F0 8D 0A D4 8D 18 D0 A9 CA  ........
         .byte   $8D,$17,$D0,$68,$40,$00,$00,$00 ; 92F8 8D 17 D0 68 40 00 00 00  ...h@...
+; title screen music. only use of 4-part harmony in the game, this and _v1 _v2 _v3.
+sfx_title_v0:
         .byte   $01,$A0,$02,$0A,$80,$01,$A5,$02 ; 9300 01 A0 02 0A 80 01 A5 02  ........
         .byte   $3C,$20,$79,$20,$51,$20,$5B,$08 ; 9308 3C 20 79 20 51 20 5B 08  < y Q [.
         .byte   $60,$08,$6C,$08,$5B,$08,$60,$10 ; 9310 60 08 6C 08 5B 08 60 10  `.l.[.`.
@@ -2950,28 +2965,34 @@
         .byte   $60,$08,$51,$08,$79,$20,$79,$08 ; 9338 60 08 51 08 79 20 79 08  `.Q.y y.
         .byte   $6C,$08,$60,$08,$5B,$08,$51,$08 ; 9340 6C 08 60 08 5B 08 51 08  l.`.[.Q.
         .byte   $48,$08,$40,$08,$51,$08,$3C,$40 ; 9348 48 08 40 08 51 08 3C 40  H.@.Q.<@
-        .byte   $00,$01,$A0,$02,$0A,$60,$01,$A3 ; 9350 00 01 A0 02 0A 60 01 A3  .....`..
-        .byte   $02,$51,$40,$79,$10,$A2,$10,$79 ; 9358 02 51 40 79 10 A2 10 79  .Q@y...y
-        .byte   $10,$6C,$10,$79,$08,$A2,$08,$F3 ; 9360 10 6C 10 79 08 A2 08 F3  .l.y....
-        .byte   $10,$F3,$20,$79,$08,$A2,$08,$F3 ; 9368 10 F3 20 79 08 A2 08 F3  .. y....
-        .byte   $10,$A2,$10,$79,$10,$A2,$20,$F3 ; 9370 10 A2 10 79 10 A2 20 F3  ...y.. .
-        .byte   $20,$79,$10,$A2,$10,$79,$10,$A2 ; 9378 20 79 10 A2 10 79 10 A2   y...y..
-        .byte   $10,$79,$10,$A2,$10,$F3,$10,$F3 ; 9380 10 79 10 A2 10 F3 10 F3  .y......
-        .byte   $10,$F3,$08,$D9,$08,$C1,$08,$B6 ; 9388 10 F3 08 D9 08 C1 08 B6  ........
-        .byte   $08,$A2,$08,$90,$08,$80,$08,$A2 ; 9390 08 A2 08 90 08 80 08 A2  ........
-        .byte   $08,$79,$40,$00,$01,$A0,$02,$0A ; 9398 08 79 40 00 01 A0 02 0A  .y@.....
-        .byte   $40,$01,$A4,$02,$60,$60,$01,$A0 ; 93A0 40 01 A4 02 60 60 01 A0  @...``..
-        .byte   $02,$0A,$10,$01,$A3,$02,$F3,$20 ; 93A8 02 0A 10 01 A3 02 F3 20  ....... 
-        .byte   $A2,$30,$A2,$10,$C1,$10,$02,$A6 ; 93B0 A2 30 A2 10 C1 10 02 A6  .0......
-        .byte   $93,$01,$01,$A0,$02,$0A,$10,$01 ; 93B8 93 01 01 A0 02 0A 10 01  ........
-        .byte   $A3,$02,$A2,$20,$A2,$20,$F3,$30 ; 93C0 A3 02 A2 20 A2 20 F3 30  ... . .0
-        .byte   $01,$A0,$02,$0A,$40,$01,$A4,$02 ; 93C8 01 A0 02 0A 40 01 A4 02  ....@...
-        .byte   $79,$10,$A2,$10,$F3,$20,$00,$01 ; 93D0 79 10 A2 10 F3 20 00 01  y.... ..
-        .byte   $A0,$02,$0A,$20,$01,$A4,$02,$79 ; 93D8 A0 02 0A 20 01 A4 02 79  ... ...y
-        .byte   $78,$01,$A0,$02,$0A,$FF,$0A,$FF ; 93E0 78 01 A0 02 0A FF 0A FF  x.......
-        .byte   $0A,$40,$00,$00,$00,$00,$00,$00 ; 93E8 0A 40 00 00 00 00 00 00  .@......
-        .byte   $00,$00,$00,$00,$00,$00,$00,$00 ; 93F0 00 00 00 00 00 00 00 00  ........
-        .byte   $00,$00,$00,$00,$00,$00,$00,$00 ; 93F8 00 00 00 00 00 00 00 00  ........
+        .byte   $00                             ; 9350 00                       .
+sfx_title_v1:
+        .byte   $01,$A0,$02,$0A,$60,$01,$A3,$02 ; 9351 01 A0 02 0A 60 01 A3 02  ....`...
+        .byte   $51,$40,$79,$10,$A2,$10,$79,$10 ; 9359 51 40 79 10 A2 10 79 10  Q@y...y.
+        .byte   $6C,$10,$79,$08,$A2,$08,$F3,$10 ; 9361 6C 10 79 08 A2 08 F3 10  l.y.....
+        .byte   $F3,$20,$79,$08,$A2,$08,$F3,$10 ; 9369 F3 20 79 08 A2 08 F3 10  . y.....
+        .byte   $A2,$10,$79,$10,$A2,$20,$F3,$20 ; 9371 A2 10 79 10 A2 20 F3 20  ..y.. . 
+        .byte   $79,$10,$A2,$10,$79,$10,$A2,$10 ; 9379 79 10 A2 10 79 10 A2 10  y...y...
+        .byte   $79,$10,$A2,$10,$F3,$10,$F3,$10 ; 9381 79 10 A2 10 F3 10 F3 10  y.......
+        .byte   $F3,$08,$D9,$08,$C1,$08,$B6,$08 ; 9389 F3 08 D9 08 C1 08 B6 08  ........
+        .byte   $A2,$08,$90,$08,$80,$08,$A2,$08 ; 9391 A2 08 90 08 80 08 A2 08  ........
+        .byte   $79,$40,$00                     ; 9399 79 40 00                 y@.
+sfx_title_v2:
+        .byte   $01,$A0,$02,$0A,$40,$01,$A4,$02 ; 939C 01 A0 02 0A 40 01 A4 02  ....@...
+        .byte   $60,$60,$01,$A0,$02,$0A,$10,$01 ; 93A4 60 60 01 A0 02 0A 10 01  ``......
+        .byte   $A3,$02,$F3,$20,$A2,$30,$A2,$10 ; 93AC A3 02 F3 20 A2 30 A2 10  ... .0..
+        .byte   $C1,$10,$02,$A6,$93,$01,$01,$A0 ; 93B4 C1 10 02 A6 93 01 01 A0  ........
+        .byte   $02,$0A,$10,$01,$A3,$02,$A2,$20 ; 93BC 02 0A 10 01 A3 02 A2 20  ....... 
+        .byte   $A2,$20,$F3,$30,$01,$A0,$02,$0A ; 93C4 A2 20 F3 30 01 A0 02 0A  . .0....
+        .byte   $40,$01,$A4,$02,$79,$10,$A2,$10 ; 93CC 40 01 A4 02 79 10 A2 10  @...y...
+        .byte   $F3,$20,$00                     ; 93D4 F3 20 00                 . .
+sfx_title_v3:
+        .byte   $01,$A0,$02,$0A,$20,$01,$A4,$02 ; 93D7 01 A0 02 0A 20 01 A4 02  .... ...
+        .byte   $79,$78,$01,$A0,$02,$0A,$FF,$0A ; 93DF 79 78 01 A0 02 0A FF 0A  yx......
+        .byte   $FF,$0A,$40,$00,$00,$00,$00,$00 ; 93E7 FF 0A 40 00 00 00 00 00  ..@.....
+        .byte   $00,$00,$00,$00,$00,$00,$00,$00 ; 93EF 00 00 00 00 00 00 00 00  ........
+        .byte   $00,$00,$00,$00,$00,$00,$00,$00 ; 93F7 00 00 00 00 00 00 00 00  ........
+        .byte   $00                             ; 93FF 00                       .
 ; ----------------------------------------------------------------------------
 ask_num_players:
         ldx     #$FF                            ; 9400 A2 FF                    ..
@@ -5951,7 +5972,7 @@
         .byte   $FF                             ; A826 FF                       .
 ; ----------------------------------------------------------------------------
 hellstones_sub3:
-        lda     $0619                           ; A827 AD 19 06                 ...
+        lda     jiffy_timer_3_lo                ; A827 AD 19 06                 ...
         asl     a                               ; A82A 0A                       .
         asl     a                               ; A82B 0A                       .
         asl     a                               ; A82C 0A                       .
@@ -6842,7 +6863,7 @@
         .byte   $20,$20,$98,$C0,$B4,$80,$68,$40 ; B2D8 20 20 98 C0 B4 80 68 40    ....h@
 ; ----------------------------------------------------------------------------
 herethere_sub3:
-        lda     $0619                           ; B2E0 AD 19 06                 ...
+        lda     jiffy_timer_3_lo                ; B2E0 AD 19 06                 ...
         and     #$0F                            ; B2E3 29 0F                    ).
         bne     LB2F2                           ; B2E5 D0 0B                    ..
         lda     $068A                           ; B2E7 AD 8A 06                 ...
@@ -7088,12 +7109,15 @@
 ; ----------------------------------------------------------------------------
 hurr_sub0:
         lda     falling_flag                    ; B691 AD 21 06                 .!.
-        bne     LB697                           ; B694 D0 01                    ..
+        bne     falling_wind                    ; B694 D0 01                    ..
         rts                                     ; B696 60                       `
 
 ; ----------------------------------------------------------------------------
-LB697:  inc     player_x_pos                    ; B697 EE 7E 06                 .~.
-LB69A:  rts                                     ; B69A 60                       `
+; wind blows jumpman to the right when he's dying
+falling_wind:
+        inc     player_x_pos                    ; B697 EE 7E 06                 .~.
+hurr_done:
+        rts                                     ; B69A 60                       `
 
 ; ----------------------------------------------------------------------------
 hurr_sub1:
@@ -7104,7 +7128,7 @@
         cmp     #$02                            ; B6A5 C9 02                    ..
         bne     LB6BA                           ; B6A7 D0 11                    ..
 LB6A9:  lda     $0768                           ; B6A9 AD 68 07                 .h.
-        bne     LB69A                           ; B6AC D0 EC                    ..
+        bne     hurr_done                       ; B6AC D0 EC                    ..
         inc     $0768                           ; B6AE EE 68 07                 .h.
         lda     #$00                            ; B6B1 A9 00                    ..
         sta     AUDC1                           ; B6B3 8D 01 D2                 ...
@@ -7273,9 +7297,10 @@
         lda     score+1                         ; B844 AD 01 07                 ...
         adc     $A5                             ; B847 65 A5                    e.
         sta     score+1                         ; B849 8D 01 07                 ...
-        bcc     LB851                           ; B84C 90 03                    ..
+        bcc     el_hi_ok                        ; B84C 90 03                    ..
         inc     score+2                         ; B84E EE 02 07                 ...
-LB851:  clc                                     ; B851 18                       .
+el_hi_ok:
+        clc                                     ; B851 18                       .
         lda     work_level_time_bonus           ; B852 AD 91 07                 ...
         adc     $A4                             ; B855 65 A4                    e.
         sta     work_level_time_bonus           ; B857 8D 91 07                 ...
@@ -7291,21 +7316,25 @@
         lda     #$B8                            ; B86D A9 B8                    ..
         sta     sfx_ptr+1                       ; B86F 8D 3D 06                 .=.
         jsr     cue_sfx_jv                      ; B872 20 06 80                  ..
-LB875:  lda     sfx_slot_duration               ; B875 AD 46 06                 .F.
+; wait for sfx to finish
+el_wait_sfx:
+        lda     sfx_slot_duration               ; B875 AD 46 06                 .F.
         ora     $0644                           ; B878 0D 44 06                 .D.
-        bne     LB875                           ; B87B D0 F8                    ..
+        bne     el_wait_sfx                     ; B87B D0 F8                    ..
         dec     $A6                             ; B87D C6 A6                    ..
         bne     add_life_bonus                  ; B87F D0 BA                    ..
         sta     jiffy_timer_1                   ; B881 8D 1A 06                 ...
-LB884:  lda     jiffy_timer_1                   ; B884 AD 1A 06                 ...
+; wait approx 1/2 sec
+el_delay:
+        lda     jiffy_timer_1                   ; B884 AD 1A 06                 ...
         cmp     #$20                            ; B887 C9 20                    . 
-        bne     LB884                           ; B889 D0 F9                    ..
+        bne     el_delay                        ; B889 D0 F9                    ..
         lda     randomizer_mode                 ; B88B AD F3 06                 ...
-        bne     LB893                           ; B88E D0 03                    ..
+        bne     el_done                         ; B88E D0 03                    ..
         jmp     L8DA0                           ; B890 4C A0 8D                 L..
 
 ; ----------------------------------------------------------------------------
-LB893:  jmp     afterlife                       ; B893 4C 00 96                 L..
+el_done:jmp     afterlife                       ; B893 4C 00 96                 L..
 
 ; ----------------------------------------------------------------------------
 ; played when adding bonus per life at end of level
@@ -7348,11 +7377,11 @@
 demo_mode:
         lda     #$00                            ; B96B A9 00                    ..
         sta     jiffy_timer_1                   ; B96D 8D 1A 06                 ...
-; actually 64 jiffies, 1.067S ntsc, 1.28s pal
-wait_1_sec_2:
+; 96 jiffies, 1.6s ntsc, 1.92s pal
+demo_wait:
         lda     jiffy_timer_1                   ; B970 AD 1A 06                 ...
         cmp     #$60                            ; B973 C9 60                    .`
-        bne     wait_1_sec_2                    ; B975 D0 F9                    ..
+        bne     demo_wait                       ; B975 D0 F9                    ..
         lda     #$00                            ; B977 A9 00                    ..
         sta     FR1                             ; B979 85 E0                    ..
         lda     #$00                            ; B97B A9 00                    ..
@@ -7370,7 +7399,9 @@
         nop                                     ; B99A EA                       .
         nop                                     ; B99B EA                       .
         nop                                     ; B99C EA                       .
-LB99D:  ldy     #$16                            ; B99D A0 16                    ..
+; initially, FR1 points to $A000 (start of level descriptions), Y is $16, or offset to _map0 within level desc.
+demo_show_map:
+        ldy     #$16                            ; B99D A0 16                    ..
         lda     (FR1),y                         ; B99F B1 E0                    ..
         sta     dm_progctr                      ; B9A1 85 C0                    ..
         iny                                     ; B9A3 C8                       .
@@ -7378,41 +7409,47 @@
         sta     dm_progctr+1                    ; B9A6 85 C1                    ..
         ldy     FR1+2                           ; B9A8 A4 E2                    ..
         ldx     #$00                            ; B9AA A2 00                    ..
-LB9AC:  lda     level_names,y                   ; B9AC B9 00 BB                 ...
+demo_show_name:
+        lda     level_names,y                   ; B9AC B9 00 BB                 ...
         sec                                     ; B9AF 38                       8
         sbc     #$20                            ; B9B0 E9 20                    . 
         sta     $3DE8,x                         ; B9B2 9D E8 3D                 ..=
         iny                                     ; B9B5 C8                       .
         inx                                     ; B9B6 E8                       .
         cpx     #$14                            ; B9B7 E0 14                    ..
-        bne     LB9AC                           ; B9B9 D0 F1                    ..
-        jsr     LB9EC                           ; B9BB 20 EC B9                  ..
+        bne     demo_show_name                  ; B9B9 D0 F1                    ..
+        jsr     demo_set_colors                 ; B9BB 20 EC B9                  ..
         lda     #$00                            ; B9BE A9 00                    ..
         sta     jiffy_timer_1                   ; B9C0 8D 1A 06                 ...
         jsr     draw_map_jv                     ; B9C3 20 00 80                  ..
-LB9C6:  lda     jiffy_timer_1                   ; B9C6 AD 1A 06                 ...
+; approx 2/3 sec
+demo_wait_1:
+        lda     jiffy_timer_1                   ; B9C6 AD 1A 06                 ...
         cmp     #$40                            ; B9C9 C9 40                    .@
-        bne     LB9C6                           ; B9CB D0 F9                    ..
+        bne     demo_wait_1                     ; B9CB D0 F9                    ..
         jsr     clear_screen_mem_jv             ; B9CD 20 1E 80                  ..
         clc                                     ; B9D0 18                       .
         lda     FR1+2                           ; B9D1 A5 E2                    ..
         adc     #$14                            ; B9D3 69 14                    i.
         sta     FR1+2                           ; B9D5 85 E2                    ..
         cmp     #$F0                            ; B9D7 C9 F0                    ..
-        bne     LB9DE                           ; B9D9 D0 03                    ..
+        bne     demo_next_map                   ; B9D9 D0 03                    ..
         jmp     reinit_game                     ; B9DB 4C 0C 90                 L..
 
 ; ----------------------------------------------------------------------------
-LB9DE:  clc                                     ; B9DE 18                       .
+demo_next_map:
+        clc                                     ; B9DE 18                       .
         lda     FR1                             ; B9DF A5 E0                    ..
         adc     #$40                            ; B9E1 69 40                    i@
         sta     FR1                             ; B9E3 85 E0                    ..
-        bcc     LB99D                           ; B9E5 90 B6                    ..
+        bcc     demo_show_map                   ; B9E5 90 B6                    ..
         inc     FR1+1                           ; B9E7 E6 E1                    ..
-        jmp     LB99D                           ; B9E9 4C 9D B9                 L..
+        jmp     demo_show_map                   ; B9E9 4C 9D B9                 L..
 
 ; ----------------------------------------------------------------------------
-LB9EC:  ldy     #$2F                            ; B9EC A0 2F                    ./
+; FR1 points to levelXX_desc
+demo_set_colors:
+        ldy     #$2F                            ; B9EC A0 2F                    ./
         lda     (FR1),y                         ; B9EE B1 E0                    ..
         sta     COLOR0                          ; B9F0 8D C4 02                 ...
         iny                                     ; B9F3 C8                       .
@@ -7600,14 +7637,18 @@
         lda     #$8D                            ; BC49 A9 8D                    ..
         sta     $0809                           ; BC4B 8D 09 08                 ...
         sta     $088A                           ; BC4E 8D 8A 08                 ...
-LBC51:  lda     dli_vec_shadow_hi               ; BC51 AD AF 06                 ...
-        bne     LBC51                           ; BC54 D0 FB                    ..
+; wait until the dli has been set up (by vblank)
+wd_wait_dli:
+        lda     dli_vec_shadow_hi               ; BC51 AD AF 06                 ...
+        bne     wd_wait_dli                     ; BC54 D0 FB                    ..
         lda     #$96                            ; BC56 A9 96                    ..
         sta     COLOR0                          ; BC58 8D C4 02                 ...
         sta     jiffy_timer_1                   ; BC5B 8D 1A 06                 ...
-LBC5E:  lda     jiffy_timer_1                   ; BC5E AD 1A 06                 ...
+; wait 32 jiffies (approx 1/2 sec)
+wd_wait_32j:
+        lda     jiffy_timer_1                   ; BC5E AD 1A 06                 ...
         cmp     #$20                            ; BC61 C9 20                    . 
-        bne     LBC5E                           ; BC63 D0 F9                    ..
+        bne     wd_wait_32j                     ; BC63 D0 F9                    ..
         lda     #$03                            ; BC65 A9 03                    ..
         jsr     cue_music_jv                    ; BC67 20 18 80                  ..
         lda     #$CD                            ; BC6A A9 CD                    ..
@@ -7635,10 +7676,12 @@
         sta     $06AB                           ; BC9B 8D AB 06                 ...
         jsr     setup_gameboard_dlist_jv        ; BC9E 20 15 80                  ..
         ldx     #$0B                            ; BCA1 A2 0B                    ..
-LBCA3:  lda     total_score_msg_minus_one,x     ; BCA3 BD D1 BD                 ...
+; wait 32 jiffies (approx 1/2 sec)
+print_total_score_msg:
+        lda     total_score_msg_minus_one,x     ; BCA3 BD D1 BD                 ...
         sta     $3DE8,x                         ; BCA6 9D E8 3D                 ..=
         dex                                     ; BCA9 CA                       .
-        bne     LBCA3                           ; BCAA D0 F7                    ..
+        bne     print_total_score_msg           ; BCAA D0 F7                    ..
         lda     #$3D                            ; BCAC A9 3D                    .=
         sta     num_out+1                       ; BCAE 85 D4                    ..
         lda     #$F5                            ; BCB0 A9 F5                    ..
@@ -7650,15 +7693,17 @@
         dex                                     ; BCBB CA                       .
         bne     wd_xxx                          ; BCBC D0 F8                    ..
         jsr     print_number_jv                 ; BCBE 20 09 80                  ..
-LBCC1:  lda     $0663                           ; BCC1 AD 63 06                 .c.
-        bne     LBCC1                           ; BCC4 D0 FB                    ..
+; wait until music is done playing (not 100% sure though)
+wd_wait_music:
+        lda     $0663                           ; BCC1 AD 63 06                 .c.
+        bne     wd_wait_music                   ; BCC4 D0 FB                    ..
         lda     level                           ; BCC6 AD F6 06                 ...
         inc     randomizer_mode                 ; BCC9 EE F3 06                 ...
         rts                                     ; BCCC 60                       `
 
 ; ----------------------------------------------------------------------------
-; dunno, but referenced by code at $BC6A (part of well_done_screen)
-code_bccd:
+; used in work_level_sub0 slot during well_doneused in work_level_sub1 slot during well_done
+well_done_sub0:
         lda     $062A                           ; BCCD AD 2A 06                 .*.
         sta     COLOR2                          ; BCD0 8D C6 02                 ...
         lda     #$02                            ; BCD3 A9 02                    ..
@@ -7685,14 +7730,16 @@
         .byte   $38,$05,$6C,$30,$09,$18,$1A,$03 ; BD49 38 05 6C 30 09 18 1A 03  8.l0....
         .byte   $FF                             ; BD51 FF                       .
 ; ----------------------------------------------------------------------------
-; referenced by code at $BC83
-code_bd52:
+; used in work_level_sub1 slot during well_doneused in work_level_sub1 slot during well_done
+well_done_sub1:
         lda     falling_flag                    ; BD52 AD 21 06                 .!.
-        bne     LBD58                           ; BD55 D0 01                    ..
+        bne     wds1_cont                       ; BD55 D0 01                    ..
         rts                                     ; BD57 60                       `
 
 ; ----------------------------------------------------------------------------
-LBD58:  ldy     dlist_shadow_lo                 ; BD58 AC AC 06                 ...
+; we seem to be setting/clearing bit 7 in the display list, moving the line(s) where DLI(s) occur.
+wds1_cont:
+        ldy     dlist_shadow_lo                 ; BD58 AC AC 06                 ...
         lda     #$0D                            ; BD5B A9 0D                    ..
         sta     $0809,y                         ; BD5D 99 09 08                 ...
         lda     #$8D                            ; BD60 A9 8D                    ..
@@ -7705,13 +7752,15 @@
         sta     $080D,y                         ; BD72 99 0D 08                 ...
         inc     dlist_shadow_lo                 ; BD75 EE AC 06                 ...
         cpy     #$4E                            ; BD78 C0 4E                    .N
-        beq     LBD81                           ; BD7A F0 05                    ..
+        beq     wds1_finish                     ; BD7A F0 05                    ..
         cpy     #$CE                            ; BD7C C0 CE                    ..
-        beq     LBD81                           ; BD7E F0 01                    ..
+        beq     wds1_finish                     ; BD7E F0 01                    ..
         rts                                     ; BD80 60                       `
 
 ; ----------------------------------------------------------------------------
-LBD81:  lda     #$E6                            ; BD81 A9 E6                    ..
+; set things up for the next level?
+wds1_finish:
+        lda     #$E6                            ; BD81 A9 E6                    ..
         sta     work_level_sub1                 ; BD83 8D 84 07                 ...
         lda     #$06                            ; BD86 A9 06                    ..
         sta     work_level_sub1+1               ; BD88 8D 85 07                 ...
-- 
cgit v1.2.3