.version GC_EP3
.quest_num 88532
.language 1
.episode Episode1
.name "GC Ep3 USA patch enabler"
.short_desc ""
.long_desc ""

start:
  // This script is identical to q88530-gc-e.bin.txt, except the addresses are
  // changed to be suitable for US Ep3.
  leti               r3, 0x80004000

  write4             0x80452A4C, 0x80109B28
  write4             0x80452A50, 0x8000C324
  write4             0x80452A54, r3

  read4              r0, 0x8057A5F0
  leto               r4, code
  read4              r4, r4
  add                r4, r0
  leto               r5, code_end
  read4              r5, r5
  add                r5, r0

copy_byte:
  jmp_eq             r4, r5, copy_done
  read1              r0, r4
  write1             r3, r0
  addi               r3, 1
  addi               r4, 1
  jmp                copy_byte

copy_done:
  .data              F9FE00400080
  .data              F9FF

  ba_initial_floor   17
  write2             0x8057A510, 1

  write4             0x80452A4C, 0
  write4             0x80452A50, 0
  write4             0x80452A54, 0

  ret

code:
  .include_native    q8853x-gc.s
code_end:
