Choosing RUN in a trainer battle makes you win on DEBUG mode - pret/pokered GitHub Wiki
This is very simple. Code by ZetaPhoenix.
The enemy is fainted first to avoid some graphical glitches.
In engine/battle/core.asm
Go to TryRunningFromBattle.trainerBattle
.trainerBattle
+IF DEF(_DEBUG)
+ call FaintEnemyPokemon
+ call TrainerBattleVictory
+ jp _InitBattleCommon.endOfBattle
+ENDC
ld hl, NoRunningText
.printCantEscapeOrNoRunningText
call PrintText
ld a, 1
ld [wForcePlayerToChooseMon], a
call SaveScreenTilesToBuffer1
and a ; reset carry
ret