brunovalads/yoshisisland-disassembly

Un-disassembled SPC700 code found at $20A380

KungFuFurby opened this issue · 2 comments

$20A380 contains a SPC700 code fragment $9B bytes large (not counting the header) to be inserted at $3E20 in SPC700 RAM.

It would be this?

  dec   $00+x                   ; $23d8 |
  clrp                          ; $23da |
  cmp   x,$cd                   ; $23db |
  nop                           ; $23dd |
  incw  $2c                     ; $23de |
  mov   a,($2c+x)               ; $23e0 |
  mov   y,#$06                  ; $23e2 |
  mul   ya                      ; $23e4 |
  mov   $d2,#$97                ; $23e5 |
  mov   $d3,#$1d                ; $23e8 |
  addw  ya,$d2                  ; $23eb |
  movw  $d2,ya                  ; $23ed |
  mov   y,#$00                  ; $23ef |
  mov   a,$03c2                 ; $23f1 |
  or    a,#$04                  ; $23f4 |
  mov   x,a                     ; $23f6 |
  mov   $12,#$04                ; $23f7 |
  mov   a,($d2)+y               ; $23fa |
  push  y                       ; $23fc |
  push  x                       ; $23fd |
  pop   y                       ; $23fe |
  call  $05fa                   ; $23ff |
  push  y                       ; $2402 |
  pop   x                       ; $2403 |
  pop   y                       ; $2404 |
  inc   x                       ; $2405 |
  inc   y                       ; $2406 |
  dbnz  $12,$23fa               ; $2407 |
  mov   a,($d2)+y               ; $240a |
  mov   x,$03c0                 ; $240c |
  mov   $0221+x,a               ; $240f |
  inc   y                       ; $2412 |
  mov   a,($d2)+y               ; $2413 |
  mov   $0220+x,a               ; $2415 |
  jmp   $2236                   ; $2418 |
  set7  $13                     ; $241b |
  mov   a,#$60                  ; $241d |
  mov   y,#$03                  ; $241f |
  dec   $a0+x                   ; $2421 |
  call  $0c46                   ; $2423 |
  mov   a,$0361+x               ; $2426 |
  mov   y,a                     ; $2429 |
  mov   a,$0360+x               ; $242a |
  movw  $10,ya                  ; $242d |
  mov   $47,#$00                ; $242f |
  jmp   $056f                   ; $2432 |
  push  a                       ; $2435 |
  mov   y,#$5c                  ; $2436 |
  mov   a,#$00                  ; $2438 |
  call  $05fa                   ; $243a |
  pop   a                       ; $243d |
  mov   y,#$4c                  ; $243e |
  jmp   $05fa                   ; $2440 |
  mov   a,$03f1                 ; $2443 |
  bne   $2461                   ; $2446 |
  mov   a,$59                   ; $2448 |
  mov   $03f1,a                 ; $244a |
  mov   a,#$88                  ; $244d |
  mov   $59,a                   ; $244f |
  ret                           ; $2451 |

  mov   a,$03f1                 ; $2452 |
  beq   $2461                   ; $2455 |
  mov   a,$03f1                 ; $2457 |
  mov   $59,a                   ; $245a |
  mov   a,#$00                  ; $245c |
  mov   $03f1,a                 ; $245e |
  ret                           ; $2461 |

  mov   a,$03c1                 ; $2462 |
  and   a,$4a                   ; $2465 |
  beq   $2476                   ; $2467 |
  mov   a,$4a                   ; $2469 |
  setc                          ; $246b |
  sbc   a,$03c1                 ; $246c |
  mov   $4a,a                   ; $246f |
  mov   y,#$4d                  ; $2471 |

Nope, that's not it. It's this chunk of raw data, which is actually a snippet of SPC700 ASM (the first four bytes and the last four bytes are not part of the actual code: the last four bytes are the start of the next block at $D000, which is not SPC700 ASM).

db $9B, $00, $20 ; $20A380 |
db $3E, $CD, $00, $3A, $2C, $E7, $2C, $8D ; $20A383 |
db $06, $CF, $8F, $97, $D2, $8F, $1D, $D3 ; $20A38B |
db $7A, $D2, $DA, $D2, $8D, $00, $E5, $C2 ; $20A393 |
db $03, $08, $04, $5D, $8F, $04, $12, $F7 ; $20A39B |
db $D2, $6D, $4D, $EE, $3F, $FA, $05, $6D ; $20A3A3 |
db $CE, $EE, $3D, $FC, $6E, $12, $F0, $F7 ; $20A3AB |
db $D2, $E9, $C0, $03, $D5, $21, $02, $FC ; $20A3B3 |
db $F7, $D2, $D5, $20, $02, $5F, $36, $22 ; $20A3BB |
db $E2, $13, $E8, $60, $8D, $03, $9B, $A0 ; $20A3C3 |
db $3F, $46, $0C, $F5, $61, $03, $FD, $F5 ; $20A3CB |
db $60, $03, $DA, $10, $8F, $00, $47, $5F ; $20A3D3 |
db $6F, $05, $2D, $8D, $5C, $E8, $00, $3F ; $20A3DB |
db $FA, $05, $AE, $8D, $4C, $5F, $FA, $05 ; $20A3E3 |
db $E5, $F1, $03, $D0, $19, $E4, $59, $C5 ; $20A3EB |
db $F1, $03, $E8, $88, $C4, $59, $6F, $E5 ; $20A3F3 |
db $F1, $03, $F0, $0A, $E5, $F1, $03, $C4 ; $20A3FB |
db $59, $E8, $00, $C5, $F1, $03, $6F, $E5 ; $20A403 |
db $C1, $03, $24, $4A, $F0, $0D, $E4, $4A ; $20A40B |
db $80, $A5, $C1, $03, $C4, $4A, $8D, $4D ; $20A413 |
db $3F, $FA, $05, $6F, $51, $0C, $00, $D0 ; $20A41B |

YoshiFanatic1 actually did do a disassembly of that particular section, as stored here:
https://github.com/Yoshifanatic1/Yoshi-s-Island-Disassembly/blob/7be13ebf078a3e09849d533fea8db65894c5e36c/YI/SPC700/SPC700_Engine_YI.asm#L2556-L2655