I'm on mobile and don't have a link right now, but there was a guy a while back that did a TAS speedrun of I think Pokemon red/blue, and got a full RCE exploit to work, rewrote the cartridge to the play the opening to the next game in the series (Pokemon gold), and after playing that for a bit hit the endgame credits of the first game breaking the world record at the time.
https://arstechnica.com/gaming/2016/01/how-a-game-playing-ro...