Combo Twitches Between 1 and 0

Discussion in 'Sega Discussion' started by Scorpion Illuminati, Mar 9, 2016.

  1. Scorpion Illuminati

    Scorpion Illuminati Scorpion Illuminati Lead Developer(Site Supporter)

    Joined:
    Oct 1, 2015
    Messages:
    25
    Likes Received:
    1
    Code:
      ; start of green note code
      move.w (greennote_position_y), d1  ; green note position in d1
      btst #pad_button_left, d0  ; Check left pad
      bne.s @NoLeft  ; Branch if button off
      cmp.w d2, d1  ; is the player pressing too early
      blt.s @GreenNoteSafeArea  ; if so then don't accept it
      move.w #note_start_position_y, d1
      abcd d4, d3  ; increment the player's score
      abcd d6, d5  ; increment the player's combo meter
      bra @GreenNoteDone  ; continue through the rest of the code
    @GreenNoteSafeArea:
      moveq #0, d5  ; player played too early so reset the player's combo
    @GreenNoteDone:
    @NoLeft:
      ; green note movement code
      add.w (tempo), d1  ; add the tempo
      cmp.w  #(note_plane_border_offset-note_bounds_bottom), d1  ; does the player miss the fret entirely
      blt.s @GreenNoteNotWithinBounds  ; branch if the player hasn't
      move.w #note_start_position_y, d1  ; otherwise the player has so move the arrow back to the top
    @GreenNoteNotWithinBounds:
      move.w d1, (greennote_position_y)  ; set the left arrow's position normally
    
      ; start of red note code
      move.w (rednote_position_y), d1  ; red note position in d1
      btst #pad_button_right, d0  ; Check right pad
      bne.s @NoRight  ; Branch if button off
      cmp.w d2, d1  ; is the player pressing too early
      blt.s @RedNoteSafeArea  ; if so then don't accept it
      move.w #note_start_position_y, d1
      abcd d4, d3  ; increment the player's score
      abcd d6, d5  ; increment the the player's combo meter
      bra @RedNoteDone  ; continue through the rest of the code
    @RedNoteSafeArea:
    ;  moveq #0, d5  ; player played too early so reset the player's combo
    @RedNoteDone:
    @NoRight:
      ; red note movement code
      add.w (tempo), d1  ; add the tempo
      cmp.w  #(note_plane_border_offset-note_bounds_bottom), d1  ; does the player miss the note entirely
      blt.s @RedNoteNotWithinBounds  ; branch if the player hasn't
      move.w #note_start_position_y, d1  ; otherwise the player has so move the note back to the top
    @RedNoteNotWithinBounds:
      move.w d1, (rednote_position_y)  ; set the red note's position normally
    ...
      cmp.w #$9, d5  ; have the player reached a combo of 10
      bgt.s @SkipX1Multiplier  ; if not then branch to next step
      move.w #1, (multiplier)  ; set the multiplier to 1
      move.w #1, d4  ; set score delta to 1
    @SkipX1Multiplier:
      cmp.w #$10, d5  ; has the player reached a combo of 10
      blt.s @SkipX2Multiplier  ; if not then branch to the next step
      move.w #2, (multiplier)  ; set the multiplier to 2
      move.w #2, d4  ; set score delta to 2
    @SkipX2Multiplier:
      cmp.w #$20, d5  ; have the player reached a combo of 20
      blt.s @SkipX3Multiplier  ; if not then branch to the next step
      move.w #3, (multiplier)  ; set the multiplier to 3
      move.w #3, d4  ; set score delta to 3
    @SkipX3Multiplier:
      cmp.w #$30, d5  ; have the player reached a combo of 30
      blt.s @SkipX4Multiplier  ; if not then branch to the next step
      move.w #4, (multiplier)  ; set the multiplier to 4
      move.w #4, d4  ; set score delta to 4
    @SkipX4Multiplier:
    
      move.w d3, (score)  ; save the player's score
      move.w d4, (scoredelta)  ; save the score delta
      move.w d5, (combo)  ; save the player's combo
    
    For some reason the combo resets to 0 regardless of wither the player hits too early or with perfect timing. :p In fact if you do time it correctly you can see the combo meter go to 1 briefly then back to 0. :) I tried to see if register d5 is changed anywhere between the fret checking code and where the player's combo gets saved to ram and no it's not changed anywhere else. :huh: Any assistance in this matter would be greatly appreciated.

    Sincerely,

    Scorpion Illuminati
     
    Shane McRetro likes this.
  2. Shane McRetro

    Shane McRetro Blast Processed Since 199X

    Joined:
    Mar 11, 2012
    Messages:
    2,078
    Likes Received:
    194
    I wish I knew, maybe someone else around here can help? Anyone?
     
  3. Scorpion Illuminati

    Scorpion Illuminati Scorpion Illuminati Lead Developer(Site Supporter)

    Joined:
    Oct 1, 2015
    Messages:
    25
    Likes Received:
    1
    No worries at least you tried, and yea I was hoping someone here could help but so far no one is available. :confused: Unfortinately right now the latest version is delayed until this bug is fixed. :(
     
  4. Shane McRetro

    Shane McRetro Blast Processed Since 199X

    Joined:
    Mar 11, 2012
    Messages:
    2,078
    Likes Received:
    194
    Wow! I see you are using the Big Evil Engine Sega Genesis Framework by @Headcrab, maybe he will swoop in and save the day :)
     
  5. Shane McRetro

    Shane McRetro Blast Processed Since 199X

    Joined:
    Mar 11, 2012
    Messages:
    2,078
    Likes Received:
    194
    Ah ha! I remembered where I was thinking of in the chatbox - SpritesMind
     
  6. Scorpion Illuminati

    Scorpion Illuminati Scorpion Illuminati Lead Developer(Site Supporter)

    Joined:
    Oct 1, 2015
    Messages:
    25
    Likes Received:
    1
    Posted there, and as of this post still haven't received a single response. :( In fact I have posted everywhere, segaage, sonic-16, spritesmind, devster and here with no responses besides you on this thread. :(

    Signed,

    Scorpion Illuminati
     
  7. TriMesh

    TriMesh Site Supporter 2013-2017

    Joined:
    Jul 3, 2008
    Messages:
    2,324
    Likes Received:
    750
    From the look of it, the problem is that you don't set a flag to say that the button has already been pressed on this note - so after you release it, the code will jump to "NoLeft" and will clear the combo score at the end of the fret even if the timing was perfect. You need to set a flag when the button is processed, reset it at the end of each fret, and then add a check to the "NoLeft" code that resets the combo counter if and only if you hit the end of the time window with that flag clear.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page