Skip to content

Instantly share code, notes, and snippets.

@Jacajack
Created January 16, 2017 00:44
Show Gist options
  • Save Jacajack/163c83ce055422139707c694a1cb0550 to your computer and use it in GitHub Desktop.
Save Jacajack/163c83ce055422139707c694a1cb0550 to your computer and use it in GitHub Desktop.
PPM to raw VGA (or whatever, 320x200) data in assembly format. Never tested
#!/usr/bin/python
width = 320
height = 200
with open( "splash.ppm", "r" ) as fin:
ppm = fin.read( ).splitlines( True )
#print( ppm[4] );
#print( ppm[58396] == "255\n" );
print( "splash:" );
for i in range( 320*200 ):
if ( ppm[4+(i*3)] == "255\n" ):
print( "\tdb 0x7" );
else:
print( "\tdb 0x0" );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment