add loader

This commit is contained in:
David Voswinkel
2009-07-28 08:37:40 +02:00
parent 1c8c3dc244
commit 7f84c8d97a
48 changed files with 19969 additions and 0 deletions

20
snes/loader/conv_rle.py Normal file
View File

@@ -0,0 +1,20 @@
import binascii
data = open("rom.smc","r").read()
data = binascii.rlecode_hqx(data)
print '''
#include <avr/pgmspace.h>
#define ROM_SIZE %i
const char _rom[ROM_SIZE] PROGMEM = {
''' % len(data)
for idx,c in enumerate(data):
c = ord(c)
if idx<len(data)-1:
print "0x%02x," % c,
else:
print "0x%02x" % c,
if idx and idx%16==0:
print
print '''
};
'''