Hello.
I'm currently writing a NES emulator which will be integrated in an AI lab software platform.
To have AI programs have a high level of control over the game played, I'd like to run the emulation frame by frame, ie. get AI inputs, run the CPU/PPU/APU for one frame, and then output the state of the world back to the AI. Is this possible ? I don't know if i should run the different chips sequentially or in parallel (every clock cycle) yet.
I'm mainly worried about timing: if we return from emulation loop as soon as the PPU emits the VBlank interrupt, the CPU is not executed during the VBlank period, so i don't know if the game will have the time to execute properly.
Another thing I'd like to know is there is a way to execute PPU dynamically. Let me explain: AI algorithms often require a huge number of simulation loops to find a solution. I don't _need_ to render the image, but it can be nice for a supervisor to check what the AI is doing. So i was wondering if it's possible to enable/disable the PPU (only at startup, not during emulation properly), in order to save time on large-scale simulations.
This last request is (for me) in contradiction with the frame-based timing above : if we disable the PPU, we'll never get the VBlank interrupt, so executing CPU for just one frame is not possible.
Thanks for reading.
P-S: If Nesdev is not the appropriate place for my questions, I'll be glad if you could tell me better suited sites (general emulation forums, i guess)
I'm currently writing a NES emulator which will be integrated in an AI lab software platform.
To have AI programs have a high level of control over the game played, I'd like to run the emulation frame by frame, ie. get AI inputs, run the CPU/PPU/APU for one frame, and then output the state of the world back to the AI. Is this possible ? I don't know if i should run the different chips sequentially or in parallel (every clock cycle) yet.
I'm mainly worried about timing: if we return from emulation loop as soon as the PPU emits the VBlank interrupt, the CPU is not executed during the VBlank period, so i don't know if the game will have the time to execute properly.
Another thing I'd like to know is there is a way to execute PPU dynamically. Let me explain: AI algorithms often require a huge number of simulation loops to find a solution. I don't _need_ to render the image, but it can be nice for a supervisor to check what the AI is doing. So i was wondering if it's possible to enable/disable the PPU (only at startup, not during emulation properly), in order to save time on large-scale simulations.
This last request is (for me) in contradiction with the frame-based timing above : if we disable the PPU, we'll never get the VBlank interrupt, so executing CPU for just one frame is not possible.
Thanks for reading.
P-S: If Nesdev is not the appropriate place for my questions, I'll be glad if you could tell me better suited sites (general emulation forums, i guess)