Accesing frames from a NES emulator

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
jiwidi
Posts: 1
Joined: Wed May 17, 2017 8:04 am

Accesing frames from a NES emulator

Post by jiwidi »

Hi guys, i have a project in mind related with some artificial inteligence playing NES, my biggest problem is the way to get the frame output (not building the IA haha) so i then process it in my ia, i need to get a refresh rate of at least 24frames per second, i read something about accesing ram to check values and then building the image? i seriusly have no idea of how to get the image from a emulator perspective rather than just screenshoting (not optimal), any of you guys know some NES emulator that could help me with this?

Thanks in advance
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Accesing frames from a NES emulator

Post by tokumaru »

FCEUX has Lua scripting capabilities, which allow you to easily analyze the state of the game every frame by peeking at the RAM. You'll certainly need to research the specific game(s) you'll be working with in order to know where to find all the relevant information about the player, the enemies, the levels, and so on.

EDIT: Here's an example of a small Lua script I wrote to display information about the hardware sprites. What you need to do is a little different from this, because you're interested in the game state, which is formatted differently in each game, but the script can still show you how to set things up, read from memory, draw to the screen, and other things you might need.
Post Reply