From: John Tsiombikas Date: Thu, 19 Dec 2019 15:57:02 +0000 (+0200) Subject: added csprite stuff to the djgpp makefile X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=commitdiff_plain;h=815504923a05c5f22a756b021997983e512474e1 added csprite stuff to the djgpp makefile --- diff --git a/Makefile.dj b/Makefile.dj index 9306382..b5c42bb 100644 --- a/Makefile.dj +++ b/Makefile.dj @@ -4,6 +4,8 @@ obj = $(src:.c=.cof) $(asmsrc:.asm=.cof) dep = $(obj:.cof=.dep) bin = demo.exe +asmsrc += font.asm + ifeq ($(findstring COMMAND.COM, $(SHELL)), COMMAND.COM) hostsys = dos else @@ -75,3 +77,10 @@ clean: cleandep: rm -f $(dep) endif + + +tools/csprite/csprite: + $(MAKE) -C tools/csprite + +font.asm: data/legible.fnt tools/csprite/csprite + tools/csprite/csprite -n cs_font -s 8x16 -conv565 -nasm $< >$@ diff --git a/tools/csprite/src/main.c b/tools/csprite/src/main.c index d1f024b..0192002 100644 --- a/tools/csprite/src/main.c +++ b/tools/csprite/src/main.c @@ -113,8 +113,11 @@ int main(int argc, char **argv) /* prototype of generated function is (void *fb, int x, int y, int idx) */ const char *prefixfmt[] = { /* GNU assembler template */ + "\t.text\n" "\t.global %s\n" + "\t.global _%s\n" "%s:\n" + "_%s:\n" "\tmov 12(%%esp), %%eax\n" "\tmov $%d, %%ecx\n" "\tmul %%ecx\n" @@ -129,8 +132,11 @@ const char *prefixfmt[] = { /* TODO hardcoding the 16bpp changes for now, generalize later * and while we're at it, let's get rid of the mul too ... */ + "\tsection .text\n" "\tglobal %s\n" + "\tglobal _%s\n" "%s:\n" + "_%s:\n" "\tmov eax, [esp + 12]\n" ";\tmov ecx, %d\n" ";\tmul ecx\n" @@ -185,7 +191,7 @@ int proc_sheet(const char *fname) ysz = tile_ysz; } - printf(prefixfmt[asyntax], name, name, fbpitch); + printf(prefixfmt[asyntax], name, name, name, name, fbpitch); for(i=0; i