X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=tools%2Fcsprite%2Fsrc%2Fmain.c;h=c549b3ea65058b40272194958e0b3b876363999d;hb=3f4019dfbeea0b5e3b0bc657f1bad6bc2b53dd42;hp=fab302beeccd20cd14eaa9ba69a67253dc8ef2d5;hpb=c912e59b898fe1ac461a1468e4a2e1937de286d7;p=dosdemo diff --git a/tools/csprite/src/main.c b/tools/csprite/src/main.c index fab302b..c549b3e 100644 --- a/tools/csprite/src/main.c +++ b/tools/csprite/src/main.c @@ -3,7 +3,11 @@ #include #include #include +#ifdef WIN32 +#include +#else #include +#endif #include "image.h" struct rect { @@ -144,9 +148,10 @@ 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" + "\tsection .text USE32\n" "\tglobal %s\n" "\tglobal _%s\n" + "\tglobal %s_\n" "%s:\n" "_%s:\n" "\tmov eax, [esp + 12]\n" @@ -162,6 +167,17 @@ const char *prefixfmt[] = { "\tmov edx, eax\n" "\tmov eax, [esp + 16]\n" "\tjmp [titletab + eax * 4]\n\n" + "%s_:\n" + "\tpush eax\n" + "\tmov eax, ebx\n" + "\tshl eax, 9\n" + "\tshl ebx, 7\n" + "\tadd eax, ebx\n" + "\tshl edx, 1\n" + "\tadd eax, edx\n" + "\tpop edx\n" + "\tadd edx, eax\n" + "\tjmp [titletab + ecx * 4]\n\n" "titletab:\n" }; @@ -217,7 +233,7 @@ int proc_sheet(const char *fname) ysz = tile_ysz; } - printf(prefixfmt[asyntax], name, name, name, name, fbpitch); + printf(prefixfmt[asyntax], name, name, name, name, name, fbpitch, name); for(i=0; i