Code Review Requested: BeatmapParser

Discussion in 'Sega Discussion' started by Scorpion Illuminati, May 10, 2016.

  1. Scorpion Illuminati

    Scorpion Illuminati Scorpion Illuminati Lead Developer(Site Supporter)

    Joined:
    Oct 1, 2015
    Messages:
    25
    Likes Received:
    1
    Could someone with more expertise then me(everyone) please look at this code and let me know if it's sane?
    Code:
    ; ==============================================================
    ; Reads a beatmap
    ; a0 - beatmap address
    ; d0 - beatmap data
    ; beatmap format:
    ; 76543210
    ; Bit 7 - if set it is the end of the beatmap
    ; Bit 6 - Not Used
    ; Bit 5 - Not Used
    ; Bit 4 - if set green note should be placed on board
    ; Bit 3 - if set red note should be placed on board
    ; Bit 2 - if set yellow note should be placed on board
    ; Bit 1 - if set blue note should be placed on board
    ; Bit 0 - if set orange note should be placed board
    ; ==============================================================
    ReadBeatmap:
       move.b (a0), d0                                                             ; move beatmap data into d0
       btst #7, d0                                                                 ; test bit 7 to see if set
       bne.s @NotEndofBeatmap                                                      ; if not set skip
       moveq #64, d0                                                               ; clear all irrevelant bits
    @NotEndofBeatmap:
       rts
    
    I would test it myself but, i have no idea where to begin as i don't even know how to debug code. Any assistance in this matter would be greatly appreciated.

    Signed,

    Scorpion Illuminati
     
  2. klarth

    klarth Rapidly Rising Member

    Joined:
    Mar 22, 2006
    Messages:
    80
    Likes Received:
    0
    I havent done 68k in a while, but it looks like youre taking the byte at a0 and seeing if bit 7 is set to see if its the end. If its the end you throw decimal 64 in d0 and return, otherwise d0 has whatevers at offset a0 when you return. If thats what you want, thats what its doing
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page