Extracting Super Mario Bros levels with Python

Output

Mathew Earl painstakingly extracts the backgrounds of Super Mario Bros. levels. Shared on GitHub:

For an upcoming project, I need to extract level data from the classic 1985 video game Super Mario Bros (SMB). More precisely, I want to extract the background imagery for each stage of the game, excluding HUD elements and moving sprites, etc.

Of course, I could just stitch together images from the game, and perhaps automate this process with computer vision techniques. But I think the method described below is more interesting, and allows for inspection of elements of the level perhaps not exposed through screenshots.

In this first stage of the project, we will explore 6502 assembly and an emulator written in Python. Full source code is available here.

Extracting Super Mario Bros levels with Python Matt s ramblings

Mapped tiles

Final tile

Check out the full post to get all the details!