瀏覽代碼

fix convert script and makefile

optixx 14 年之前
父節點
當前提交
f027b93a1a
共有 4 個文件被更改,包括 25 次插入7 次删除
  1. 3 2
      avr/usbload/Makefile
  2. 2 2
      avr/usbload/loader.c
  3. 12 0
      avr/usbload/loader.h
  4. 8 3
      scripts/conv_rle.py

+ 3 - 2
avr/usbload/Makefile

@@ -23,7 +23,8 @@ F_CPU   = 20000000	# in Hz
 TARGET  = main
 AVRDUDE = avrdude -c usbasp -p $(DEVICE)
 SIZE    = avr-size
-
+LOADER  = ../../roms/qd16boot02.smc
+ROM_CONVERT = ../../scripts/conv_rle.py
 
 
 
@@ -77,7 +78,7 @@ flash: main.hex
 	$(AVRDUDE) -U flash:w:main.hex:i
 
 loader:
-	python ../../scripts/conv_rle.py ../../snes/qd16/qd16boot.smc
+	python $(ROM_CONVERT) $(LOADER)
 
 
 .c.o:

+ 2 - 2
avr/usbload/loader.c

@@ -1,6 +1,6 @@
 /*
-File: ../../snes/qd16/qd16boot.smc 
-Time: Fri, 16 Oct 2009 07:38:50
+File: qd16boot02.smc 
+Time: Fri, 16 Oct 2009 07:51:04
 */
 #include <avr/pgmspace.h>       
 #include <loader.h>       

+ 12 - 0
avr/usbload/loader.h

@@ -0,0 +1,12 @@
+/*
+File: qd16boot02.smc 
+Time: Fri, 16 Oct 2009 07:51:04
+*/
+#ifndef __FIFO_H__
+#define __FIFO_H__
+
+#define ROM_BUFFER_SIZE  58046
+#define ROM_HUFFMAN_SIZE 0
+#define ROM_RLE_SIZE     58046
+
+#endif

+ 8 - 3
scripts/conv_rle.py

@@ -37,7 +37,10 @@ if huffman == True:
 cfile = open("/tmp/loader.c","w")
 hfile = open("/tmp/loader.h","w")
 
-hfile.write('''
+hfile.write('''/*
+File: %s 
+Time: %s
+*/
 #ifndef __FIFO_H__
 #define __FIFO_H__
 
@@ -46,7 +49,9 @@ hfile.write('''
 #define ROM_RLE_SIZE     %i
 
 #endif
-''' % (len(data), huffman_size, rle_size))
+''' % (os.path.basename(SOURCE),time.strftime("%a, %d %b %Y %H:%M:%S", 
+        time.localtime()),len(data), huffman_size, rle_size))
+hfile.close()
 
 cfile.write('''/*
 File: %s 
@@ -56,7 +61,7 @@ Time: %s
 #include <loader.h>       
 
 const char _rom[ROM_BUFFER_SIZE] PROGMEM = {
-''' % (sys.argv[1],time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())))
+''' % (os.path.basename(SOURCE),time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())))
 
 for idx,c in enumerate(data):
     c = ord(c)