CC57 arbitrary code execution (run scripts continuously) (Pokémon Red and Blue)

2,208 views · Published 26 December 2018 · 8:44 · Indexed 5 October 2026

Channel: Evie (ChickasaurusGL) 🌺 · 2018 · Gaming

Watch on YouTube

More information in the description below:
You will need to set up 4F, 8F, -g m, etc. to item 3 with the following assembly code represented by items:

ld a,dd
ld (cc57),a
ld a,c9
ld (d5d5),a
ld bc, 0006 (or modify if your code is more than/less than six bytes long)
ld hl, d339
ld de, d5d5
call 00b5
ret

@d339 (item 14 quantity): Your code you want to run continuously here

In short, set up the arbitrary code execution method to item 3, with the following items:

i3 Lemonade x221
i4 TM34 x87
i5 TM04 x62
i6 TM01 x4
i7 TM13 x213
i8 Master Ball x6 (or modify quantity if your code is more than or less than 6 bytes long)
i9 j. (item 0x00) x33
i10 Max Repel x211
i11 Max Potion x213
i12 TM13 x205
i13 'blank' (item 0xB5) x0
i14 TM01 x(will vary based on code, use 00 if in doubt)

Then, place the code you want to run continuously at item 14. In this video, we use a code that causes a perpetual bounce effect, allowing us to bypass NPC scripted movement and jump through walls.

Example item 14 script:

'Bounce forever'

Source code:

ld a,FE
ld (d736),a
ret
Actual items:

i14 TM01 x62
i15 TM54 x254
i16 Max Revive x215
i17 TM01 x any

CC57 arbitrary code execution unfortunately disables encounters and cannot be used in a battle. It persists even after changing maps. You can disable it by saving and resetting the game.

Here is another example; it runs the more traditional walk through walls, but beware you may not be able to exit buildings without changing D367 (Fly/Dig/Escape Rope/Teleport(?) permissions) due to stepping out of bounds:

ld a,01
ld (cd38),a
ret

; i14: TM01 x1
  i15  TM34 x56
  i16  TM05 x201

More from this channel