Language…
15 users online: 1337doom, AbuseFreakHacker,  BeeKaay, ben15420, Doopu, Gorry, Green, LadiesMan217, Mecke1990, OrangeBronzeDaisy, playagmes169, Rykon-V73, signature_steve, Skewer,  YouFailMe - Guests: 287 - Bots: 461
Users: 64,795 (2,369 active)
Latest user: mathew

Help converting this patch

Can anyone help me convert this to SA-1? It is for uberasm and I can't get it to work. It is supposed to make it so that Yoshi will show up at his house after the rescue flag has been set.

this is the original code that works on non SA-1 roms

Code
init:
    LDA $0EF8                       ; Yoshi Found for the first time flag
    BNE .ret
    LDX #$09
  - LDA $9E,x
    CMP #$35                        ; sprite number for green yoshi
    BNE +
    LDA $C2,x
    BEQ .found
  + DEX
    BPL -
  .ret
    RTL

  .found 
    STZ $14C8,x                     ; Sprite Status, setting this to 0 makes it so the sprite wont exist
    RTL



and this is the changes I have tried to make.

Code
init:
    LDA $6EF8                       ; Yoshi Found for the first time flag
    BNE .ret
    LDX #$09
  - LDA $9E,x
    CMP #$35                        ; sprite number for green yoshi
    BNE +
    LDA $C2,x
    BEQ .found
  + DEX
    BPL -
  .ret
    RTL

  .found 
    STZ $74C8,x                     ; Sprite Status, setting this to 0 makes it so the sprite wont exist
    RTL


I think it has something to do with the looping or sprite tables. I can't quite figure out what to change.
Trust the Fungus.
Both things are wrong here:

-The sprite tables are not converted.
-The loop is incomplete.

Final version:

Code
init:
    LDA $6EF8                       ; Yoshi Found for the first time flag
    BNE .ret
    LDX #$13
  - LDA $3200,x
    CMP #$35                        ; sprite number for green yoshi
    BNE +
    LDA $D8,x
    BEQ .found
  + DEX
    BPL -
  .ret
    RTL

  .found 
    STZ $3242,x                     ; Sprite Status, setting this to 0 makes it so the sprite wont exist
    RTL
Ok I tried that converted code but nothing happened.
Trust the Fungus.
Originally posted by Bensalot
Ok I tried that converted code but nothing happened.

You also converted incorrectly one sprite table which I overlook, sorry. Corrected.

Sprite tables do not follow normal conversion rules. You can find a list of all sprite tables and their remaps in the asm folder of PIXI --> sa-1 remaps.
Ok that worked. Thanks for the help.
Trust the Fungus.