Automatically generate the fpga bit .h file
This commit is contained in:
parent
1d928e7091
commit
7e0186d7a0
@ -198,7 +198,7 @@ ALL_ASFLAGS = -I. -x assembler-with-cpp $(ASFLAGS) $(CDEFS)
|
||||
# Default target.
|
||||
all: build
|
||||
|
||||
build: elf bin hex cfgware.h
|
||||
build: cfgware.h elf bin hex
|
||||
$(E) " SIZE $(TARGET).elf"
|
||||
$(Q)$(ELFSIZE)|grep -v debug
|
||||
cp $(TARGET).bin $(OBJDIR)/firmware.img
|
||||
@ -235,6 +235,7 @@ ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
cfgware.h: $(OBJDIR)/fpga_rle.bit
|
||||
$(E) " BIN2H $@"
|
||||
$(Q) $(BIN2H) $< $@
|
||||
|
||||
$(OBJDIR)/fpga_rle.bit: sd2sneslite.bit
|
||||
$(E) " RLE $@"
|
||||
$(Q) $(RLE) $< $@
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
# file to a C header. No copyright claimed.
|
||||
|
||||
BEGIN {
|
||||
print "// autoconf.h generated from " ARGV[1] " at " strftime() "\n" \
|
||||
print "// autoconf.h generated from " ARGV[1] " at NOW\n" \
|
||||
"#ifndef AUTOCONF_H\n" \
|
||||
"#define AUTOCONF_H"
|
||||
}
|
||||
|
||||
14
src/uncfgware.c
Normal file
14
src/uncfgware.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "cfgware.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < sizeof(cfgware); i++)
|
||||
{
|
||||
printf("%c", cfgware[i]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -3,20 +3,20 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char var_name[30] = "cfgware"
|
||||
char var_name[30] = "cfgware";
|
||||
FILE *fpIn = NULL, *fpOut = NULL;
|
||||
unsigned char buffer[5], i;
|
||||
if ( argc == 4 )
|
||||
if ( argc == 3 )
|
||||
{
|
||||
fpIn = fopen(argv[1], "rb");
|
||||
fpOut = fopen(argv[2], "wt");
|
||||
}
|
||||
else if (argc == 3)
|
||||
else if (argc == 2)
|
||||
{
|
||||
fpIn = fopen(argv[1], "rb");
|
||||
fpOut = stdout;
|
||||
}
|
||||
else if ( argc == 2 )
|
||||
else if ( argc == 1 )
|
||||
{
|
||||
fpIn = stdin;
|
||||
fpOut = stdout;
|
||||
@ -27,8 +27,8 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (argc > 1)
|
||||
sprintf()
|
||||
// if (argc > 1)
|
||||
// sprintf()
|
||||
|
||||
if (fpIn == NULL) { fprintf(stderr, "Can't open '%s`: Aborting.", argv[1]); return -1; }
|
||||
if (fpOut == NULL) { fprintf(stderr, "Can't open '%s`: Aborting.", argv[2]); return -1; }
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user