# Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

## Arbitrary Code Execution Discussion

### Setting all ailments in-battle - Page 1

Previous Page

- 1

Next Page

#### Setting all ailments in-battle

Posted by: Parzival
Date: 2017-04-26 18:04:08
So, just to get acquainted with 8F, I made a small script to set the CPU Ailment byte to FF, because why not. I don't think anyone will be interested, but just in case, here you go.
`ld a,$FF;
ld [$CFE9],a;
ret;`
In items, that'd be
`Lemonade x255
TM34 x233
TM07 x201`
I screwed everything up with one of my earlier tries, which was
`push af;
ld a,$FF;
ld [$CFE9],a;
pop af;
ret;`
I landed at 03:0573, which is an invalid opcode. I don't know what happened before that, because I can't find a way to press a button for one frame while in the BGB debugger.

#### Re: Setting all ailments in-battle

Posted by: ISSOtm
Date: 2017-04-26 18:28:16
Use the "Joypad" window.
Previous Page

- 1

Next Page