fixed compiled sprites
authorJohn Tsiombikas <nuclear@member.fsf.org>
Mon, 15 Jun 2020 05:31:03 +0000 (08:31 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Mon, 15 Jun 2020 05:31:03 +0000 (08:31 +0300)
Makefile
src/dos/audos.c
src/dos/main.c
tools/csprite/src/main.c
tools/scripts/instdfs
tools/scripts/pceminst

index 0b6a460..562b0d6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -46,8 +46,9 @@ bin = demo.exe
 
 opt = -otexan
 #opt = -od
 
 opt = -otexan
 #opt = -od
-def = -dM_PI=3.141592653589793 -dUSE_HLT
-libs = imago.lib anim.lib midas.lib
+def = -dM_PI=3.141592653589793 -dUSE_HLT -dNO_SOUND
+libs = imago.lib anim.lib
+# midas.lib
 
 AS = nasm
 CC = wcc386
 
 AS = nasm
 CC = wcc386
index 6b7709a..74376c6 100644 (file)
@@ -1,3 +1,4 @@
+#ifndef NO_SOUND
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -43,6 +44,7 @@ int au_init(void)
 
 void au_shutdown(void)
 {
 
 void au_shutdown(void)
 {
+       printf("au_shutdown\n");
        if(curmod) {
                au_stop_module(curmod);
        }
        if(curmod) {
                au_stop_module(curmod);
        }
@@ -220,3 +222,67 @@ void sleep_msec(unsigned long msec)
 #endif
        }
 }
 #endif
        }
 }
+
+#else  /* NO_SOUND */
+#include "audio.h"
+
+static int vol_master, vol_mus, vol_sfx;
+
+int au_init(void)
+{
+       vol_master = vol_mus = vol_sfx = 255;
+       return 0;
+}
+
+void au_shutdown(void)
+{
+       printf("au_shutdown\n");
+}
+
+struct au_module *au_load_module(const char *fname)
+{
+       return 0;
+}
+
+void au_free_module(struct au_module *mod)
+{
+}
+
+int au_play_module(struct au_module *mod)
+{
+       return -1;
+}
+
+void au_update(void)
+{
+}
+
+int au_stop_module(struct au_module *mod)
+{
+       return -1;
+}
+
+int au_module_state(struct au_module *mod)
+{
+       return AU_STOPPED;
+}
+
+int au_volume(int vol)
+{
+       AU_VOLADJ(vol_master, vol);
+       return vol_master;
+}
+
+int au_sfx_volume(int vol)
+{
+       AU_VOLADJ(vol_sfx, vol);
+       return vol_sfx;
+}
+
+
+int au_music_volume(int vol)
+{
+       AU_VOLADJ(vol_mus, vol);
+       return vol_mus;
+}
+#endif /* NO_SOUND */
index b415bb4..566d47e 100644 (file)
@@ -54,7 +54,7 @@ int main(int argc, char **argv)
                return 1;
        }
 
                return 1;
        }
 
-       if((vmidx = match_video_mode(640, 480, 16)) == -1) {
+       if((vmidx = match_video_mode(FB_WIDTH, FB_HEIGHT, FB_BPP)) == -1) {
                return 1;
        }
        if(!(vmem = set_video_mode(vmidx, 1))) {
                return 1;
        }
        if(!(vmem = set_video_mode(vmidx, 1))) {
index 039a0eb..a59aa3e 100644 (file)
@@ -144,7 +144,7 @@ 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 ...
         */
        /* 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"
        "\tglobal %s\n"
        "\tglobal _%s\n"
        "\tglobal %s_\n"
index bbd9b1f..39971cb 100755 (executable)
@@ -44,12 +44,14 @@ else
        cp demo.exe $destdir
        rm -f $destdir/data/*
        cp data/* $destdir/data/
        cp demo.exe $destdir
        rm -f $destdir/data/*
        cp data/* $destdir/data/
+       mkdir -p $destdir/libs/mikmod
+       cp libs/midas/midas.lib libs/midas/libmidas.a $destdir/libs/midas
 fi
 
 findsrc()
 {
        find . -name '*.c' -o -name '*.h' -o -name '*.asm' -o -name '*.inc' \
 fi
 
 findsrc()
 {
        find . -name '*.c' -o -name '*.h' -o -name '*.asm' -o -name '*.inc' \
-               -o -name '*.inl' -o -name Makefile.dj | sed 's/\.\///'
+               -o -name '*.inl' -o -name Makefile.dj -o -name Makefile | sed 's/\.\///'
 }
 for i in `findsrc`; do
        dir=`dirname $i`
 }
 for i in `findsrc`; do
        dir=`dirname $i`
index 30244e2..c0e8660 100755 (executable)
@@ -7,7 +7,7 @@
 mntpt=/pcem_dos
 do_umount=false
 
 mntpt=/pcem_dos
 do_umount=false
 
-if ! ( mount | grep pcem ); then
+if ! ( mount | grep pcem >/dev/null ); then
        mount $mntpt || exit 1
        do_umount=true
 fi
        mount $mntpt || exit 1
        do_umount=true
 fi