X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=tools%2Fcsprite%2Fsrc%2Fmain.c;h=0192002391c0a2972a2f26f666c7ab4170a4dd9f;hp=f0880b851d580a1834f3e163c0f0d7c681c73769;hb=815504923a05c5f22a756b021997983e512474e1;hpb=bebb02a472ecf3ba95366bbd3934478433cd9498 diff --git a/tools/csprite/src/main.c b/tools/csprite/src/main.c index f0880b8..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" @@ -126,11 +129,22 @@ const char *prefixfmt[] = { "tiletab:\n", /* NASM template */ - "\tglobl %s\n" + /* 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" + ";\tmov ecx, %d\n" + ";\tmul ecx\n" + "\tmov ecx, eax\n" + "\tshl eax, 9\n" + "\tshl ecx, 7\n" + "\tadd eax, ecx\n" + "\tadd eax, [esp + 8]\n" "\tadd eax, [esp + 8]\n" "\tadd eax, [esp + 4]\n" "\tmov edx, eax\n" @@ -177,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