Created
October 15, 2016 01:22
-
-
Save endrift/752230729cbf2e29192dbe2c4a5e86c2 to your computer and use it in GitHub Desktop.
mGBA Python bindings example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mgba import core,image | |
c=core.loadPath('ruby.gba') | |
i=image.Image(*c.desiredVideoDimensions()) | |
c.setVideoBuffer(i) | |
c.reset() | |
for x in range(800): c.runFrame() | |
with open("out.png", "w") as f: i.savePNG(f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mgba.core | |
import mgba.image | |
core = mgba.core.loadPath('ruby.gba') | |
screen = mgba.image.Image(*core.desiredVideoDimensions()) | |
core.setVideoBuffer(screen) | |
core.reset() | |
for i in range(800): | |
core.runFrame() | |
with open("out.png", "w") as f: | |
screen.savePNG(f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can I set the width and height of the game ?