’Cause all games were better on the GBC

You are not logged in.

#1 2014-02-25 16:20:28

Registered: 2011-02-27
Post 50/51

Emulate Twitchplayspokemon

Would it be hard to emulate ''twitchplayspokemon''?

I would like to do this in pokemon gold.
after every move you make, the computer does 5 moves (or whatever) randomly.


#2 2014-02-25 23:56:42

From: Spain
Registered: 2012-09-16
Post 169/450

Re: Emulate Twitchplayspokemon

HRAM address ffa7 keeps track of whether there is a button pressed at the moment or not. So what you could do is, during every vblank, check if ffa7 is non-zero (meaning that there's a button pressed) and also (not sure if this one is necessary though) check if the game is not already running in auto input mode (if [c2c7]=ff, it's auto input mode, else normal mode). If so, start an automated input of N random moves. And when it ends return to normal input for the next move.

Auto-input is controlled by WRAM addresses c2c7-c2cb but you can call the StartAutoInput (at 0x9ee in Crystal) routine that will start an auto input by reading data from a:hl. Call StopAutiInput (at 0xa0a in Crystal) to return to normal input.

Anyway, this is just the idea and there would be more things to take into account. You will need help from someone more experienced than me to tell you how to do it without having to go nuts figuring out the actual implementation like I would have to do. I'm figuring out most things by looking at the disassembly of Pokemon Crystal; you should do that too. Have a look at joypad.asm and vblank.asm inside the home folder. To find up the addresses look them up in hram.asm and wram.asm. Alternatively, you could track down the catching tutorial (guy at route 29 after you get pokedex), because it's the only time -I think- auto input is actually used. Since you wan't the auto input to be random, you will have to randomize the five (or N) addresses where auto input is going to be read from in every sequence.

Last edited by Crystal_ (2014-02-26 00:00:02)


#3 2014-02-26 00:03:45

Idea Killer
Registered: 2011-01-05
Post 574/630

Re: Emulate Twitchplayspokemon

everyone's just putting the input into the emulator.
not even through the emulator, but through the operating system

You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.


#4 2014-02-26 19:51:43

Registered: 2011-02-27
Post 51/51

Re: Emulate Twitchplayspokemon

Sometimes its better if its coded in the rom.
If you are playing on a device that can only emulate the game for example.


Board footer

Powered by FluxBB