Objective - Play Mario game and record the score and position, and later map it to level map png (https://nesmaps.com/maps/SuperMarioBrothers/SuperMarioBrosWorld1-1Map.html)
Method - I can get the score, however figuring the position is tricky. In FCEUX I am watching few RAM registers (explained below) to extract the mario and screen position, when playing NES Super Mario Bros.
Relevant registers -
0x006D Player horizontal position in level
0x0086 Player x position on screen
0x071C ScreenEdge X-Position, loads next screen when player past it?
0x071D Player x position, moves screen position forward when this moves
0x0755 Player_Position For Scroll. It moves up to 0x70 (sometimes even 0x72) when player moves. When this register is frozen, NOTHING changes in the level, not even internally.
Current understanding - It looks like the level is divided into sections (section number is given by 0x006D), however I'm not able to figure out how to calculate the
absolute left screen edge position and
absolute mario position.