SHARE
TWEET

Zelda Disk Custom Code

LuigiBlood Sep 1st, 2017 (edited) 121 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ddhook_scenedetect:
  2.     lh a0,0xA4(a0)
  3.     bnez a0,ddhook_scenedetect_notdeku
  4.     lui t0,(ddhook_list_start>>16)
  5.     addiu t0,(ddhook_list_start&0xFFFF)
  6.     lui t1,(ddhook_roomload>>16)
  7.     addiu t1,(ddhook_roomload&0xFFFF)
  8.     sw t1,8(t0)
  9.     b ddhook_scenedetect_return
  10.     nop
  11. ddhook_scenedetect_notdeku:
  12.     lui t0,(ddhook_list_start>>16)
  13.     addiu t0,(ddhook_list_start&0xFFFF)
  14.     sw 0,8(t0)
  15. ddhook_scenedetect_return:
  16.     jr ra
  17.     nop
  18.    
  19. ddhook_roomload:
  20.     //A0=p->Scene Heap
  21.     //A1=p->Room Heap
  22.     //A2=Room ID
  23.    
  24.     addiu sp,sp,-0x10
  25.     sw ra,4(sp)
  26.  
  27.     lw a0,0x0134(a1)    //load Room List Pointer
  28.     sll a3,a2,3         //Room ID * 8
  29.     addu a2,a0,a3       //calculate offset from Room ID
  30.     lw a0,0x34(a1)      //A0=RAM Address
  31.     lw a3,0x8(a2)       //RoomEnd
  32.     lw a1,0x0(a2)       //RoomStart (A1=VROM Address)
  33.     subu a2,a3,a1       //A2=Size
  34.    
  35.     jal 0x801C7C1C  //read from disk
  36.     nop
  37.    
  38.     lw ra,4(sp)
  39.     addiu sp,sp,0x10
  40.     jr ra
  41.     nop
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top