OSDN Git Service

p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I...
authorsparky4 <sparky4@cock.li>
Wed, 19 Apr 2017 14:36:14 +0000 (09:36 -0500)
committersparky4 <sparky4@cock.li>
Wed, 19 Apr 2017 14:36:14 +0000 (09:36 -0500)
src/imfplay.c
src/lib/16_ca.c
src/lib/16_head.h
src/lib/16_sd.c
src/lib/16_sd.h
src/lib/doslib
src/util/shbat/wbuild.sh
wbuild.sh

index 415bcfb..169ff8b 100755 (executable)
@@ -31,9 +31,9 @@
 // #include <fcntl.h>
 // #include <math.h>
 // #include <dos.h>
-struct glob_game_vars  *ggvv;
 
-static void (interrupt *old_irq0)();
+extern struct glob_game_vars   *ggvv;
+
 /*static void (interrupt *old_irq0)();
 static volatile unsigned long irq0_ticks=0;
 static volatile unsigned int irq0_cnt=0,irq0_add=0,irq0_max=0;
@@ -111,6 +111,7 @@ int imf_load_music(const char *path, global_game_variables_t *gvar) {
        return 1;
 }
 */
+#ifndef LIBIRQ0
 // WARNING: subroutine call in interrupt handler. make sure you compile with -zu flag for large/compact memory models
 void interrupt irq0()
 {
@@ -123,6 +124,7 @@ void interrupt irq0()
                p8259_OCW2(0,P8259_OCW2_NON_SPECIFIC_EOI);
        }
 }
+#endif
 /*
 void imf_tick() {
        if (imf_delay_countdown == 0) {
index 31339b4..fad1a01 100755 (executable)
@@ -1435,7 +1435,8 @@ cachein:
 \r
 //===========================================================================\r
 \r
-//++++#if GRMODE == EGAGR\r
+//????#if GRMODE == EGAGR\r
+#if 0\r
 \r
 /*\r
 ======================\r
@@ -1446,7 +1447,7 @@ cachein:
 =\r
 ======================\r
 */\r
-/*++++\r
+\r
 unsigned       static  sheight,swidth;\r
 boolean static dothemask;\r
 \r
@@ -1458,92 +1459,114 @@ void CAL_ShiftSprite (unsigned segment,unsigned source,unsigned dest,
        swidth = width;\r
        dothemask = domask;\r
 \r
-asm    mov     ax,[segment]\r
-asm    mov     ds,ax           // source and dest are in same segment, and all local\r
+       __asm {\r
+               mov     ax,[segment]\r
+               mov     ds,ax           // source and dest are in same segment, and all local\r
 \r
-asm    mov     bx,[source]\r
-asm    mov     di,[dest]\r
+               mov     bx,[source]\r
+               mov     di,[dest]\r
 \r
-asm    mov     bp,[pixshift]\r
-asm    shl     bp,1\r
-asm    mov     bp,WORD PTR [shifttabletable+bp]        // bp holds pointer to shift table\r
+               mov     bp,[pixshift]\r
+               shl     bp,1\r
+               mov     bp,WORD PTR [shifttabletable+bp]        // bp holds pointer to shift table\r
 \r
-asm    cmp     [ss:dothemask],0\r
-asm    je              skipmask\r
+               cmp     [ss:dothemask],0\r
+               je              skipmask\r
 \r
 //\r
 // table shift the mask\r
 //\r
-asm    mov     dx,[ss:sheight]\r
-\r
+               mov     dx,[ss:sheight]\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
 domaskrow:\r
-\r
-asm    mov     BYTE PTR [di],255       // 0xff first byte\r
-asm    mov     cx,ss:[swidth]\r
-\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
+               mov     BYTE PTR [di],255       // 0xff first byte\r
+               mov     cx,ss:[swidth]\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
 domaskbyte:\r
-\r
-asm    mov     al,[bx]                         // source\r
-asm    not     al\r
-asm    inc     bx                                      // next source byte\r
-asm    xor     ah,ah\r
-asm    shl     ax,1\r
-asm    mov     si,ax\r
-asm    mov     ax,[bp+si]                      // table shift into two bytes\r
-asm    not     ax\r
-asm    and     [di],al                         // and with first byte\r
-asm    inc     di\r
-asm    mov     [di],ah                         // replace next byte\r
-\r
-asm    loop    domaskbyte\r
-\r
-asm    inc     di                                      // the last shifted byte has 1s in it\r
-asm    dec     dx\r
-asm    jnz     domaskrow\r
-\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
+               mov     al,[bx]                         // source\r
+               not     al\r
+               inc     bx                                      // next source byte\r
+               xor     ah,ah\r
+               shl     ax,1\r
+               mov     si,ax\r
+               mov     ax,[bp+si]                      // table shift into two bytes\r
+               not     ax\r
+               and     [di],al                         // and with first byte\r
+               inc     di\r
+               mov     [di],ah                         // replace next byte\r
+\r
+               loop    domaskbyte\r
+\r
+               inc     di                                      // the last shifted byte has 1s in it\r
+               dec     dx\r
+               jnz     domaskrow\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
 skipmask:\r
-\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
 //\r
 // table shift the data\r
 //\r
-asm    mov     dx,ss:[sheight]\r
-asm    shl     dx,1\r
-asm    shl     dx,1                            // four planes of data\r
-\r
+               mov     dx,ss:[sheight]\r
+               shl     dx,1\r
+               shl     dx,1                            // four planes of data\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
 dodatarow:\r
-\r
-asm    mov     BYTE PTR [di],0         // 0 first byte\r
-asm    mov     cx,ss:[swidth]\r
-\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
+               mov     BYTE PTR [di],0         // 0 first byte\r
+               mov     cx,ss:[swidth]\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
 dodatabyte:\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
+               mov     al,[bx]                         // source\r
+               inc     bx                                      // next source byte\r
+               xor     ah,ah\r
+               shl     ax,1\r
+               mov     si,ax\r
+               mov     ax,[bp+si]                      // table shift into two bytes\r
+               or      [di],al                         // or with first byte\r
+               inc     di\r
+               mov     [di],ah                         // replace next byte\r
 \r
-asm    mov     al,[bx]                         // source\r
-asm    inc     bx                                      // next source byte\r
-asm    xor     ah,ah\r
-asm    shl     ax,1\r
-asm    mov     si,ax\r
-asm    mov     ax,[bp+si]                      // table shift into two bytes\r
-asm    or      [di],al                         // or with first byte\r
-asm    inc     di\r
-asm    mov     [di],ah                         // replace next byte\r
-\r
-asm    loop    dodatabyte\r
+               loop    dodatabyte\r
 \r
-asm    inc     di                                      // the last shifted byte has 0s in it\r
-asm    dec     dx\r
-asm    jnz     dodatarow\r
+               inc     di                                      // the last shifted byte has 0s in it\r
+               dec     dx\r
+               jnz     dodatarow\r
 \r
 //\r
 // done\r
 //\r
 \r
-asm    mov     ax,ss                           // restore data segment\r
-asm    mov     ds,ax\r
+               mov     ax,ss                           // restore data segment\r
+               mov     ds,ax\r
+       }\r
 \r
 }\r
 \r
 #endif\r
-*/\r
+\r
 //===========================================================================\r
 \r
 /*\r
index 6f6f788..adea8ff 100755 (executable)
@@ -33,7 +33,7 @@
 #include <dos.h>\r
 #include <stdio.h>\r
 #include <stdlib.h>\r
-#include <conio.h> // just for wait\r
+#include <conio.h> // this is where Open Watcom hides the outp() etc. functions // just for wait\r
 #include <time.h> // just for wait\r
 #include <ctype.h>\r
 #include <fcntl.h>\r
index a058a32..7e16839 100755 (executable)
@@ -23,7 +23,7 @@
 #include "src/lib/16_sd.h"\r
 \r
 //static void (interrupt *old_irq0)();\r
-extern struct glob_game_vars   *ggvv;\r
+void interrupt (*old_irq0)(void);\r
 \r
 void opl2out(word reg, word data)\r
 {\r
@@ -196,7 +196,6 @@ void FMSetVoice(int voiceNum, FMInstrument *ins){
        opl2out(opCellNum, ins->Feedback);\r
 } /* End of FMSetVoice */\r
 \r
-\r
 void SD_Initimf(global_game_variables_t *gvar)\r
 {\r
        if (!init_adlib()) {\r
@@ -271,8 +270,10 @@ int SD_imf_load_music(const char *path, global_game_variables_t *gvar)
        return 1;\r
 }\r
 \r
+#ifdef LIBIRQ0\r
+struct glob_game_vars  *ggvv;\r
 // WARNING: subroutine call in interrupt handler. make sure you compile with -zu flag for large/compact memory models\r
-/*void interrupt irq0()\r
+void interrupt irq0()\r
 {\r
        ggvv->ca.sd.irq0_ticks++;\r
        if ((ggvv->ca.sd.irq0_cnt += ggvv->ca.sd.irq0_add) >= ggvv->ca.sd.irq0_max) {\r
@@ -282,7 +283,8 @@ int SD_imf_load_music(const char *path, global_game_variables_t *gvar)
        else {\r
                p8259_OCW2(0,P8259_OCW2_NON_SPECIFIC_EOI);\r
        }\r
-}*/\r
+}\r
+#endif\r
 \r
 void SD_imf_tick(global_game_variables_t *gvar)\r
 {\r
index 611982f..3690fe3 100755 (executable)
@@ -34,6 +34,7 @@
 #define MAX_REGISTER                   0xF5\r
 #define ADLIB_FM_ADDRESS       0x388   /* adlib address/status register */\r
 #define ADLIB_FM_DATA          0x389   /* adlib data register           */\r
+#define LIBIRQ0\r
 \r
 /*\r
 * FM Instrument definition for .SBI files - SoundBlaster instrument\r
@@ -51,6 +52,7 @@ typedef struct{
        byte Feedback;                  /* feedback algorithm and strength  */\r
 } FMInstrument;\r
 \r
+extern void interrupt  (*old_irq0)(void);\r
 \r
 void opl2out(word reg, word data);\r
 void opl3out(word reg, word data);\r
@@ -64,7 +66,7 @@ void FMSetVoice(int voiceNum, FMInstrument *ins);
 void SD_Initimf(global_game_variables_t *gvar);\r
 void SD_imf_free_music(global_game_variables_t *gvar);\r
 int SD_imf_load_music(const char *path, global_game_variables_t *gvar);\r
-//void interrupt irq0(global_game_variables_t *gvar);\r
+void interrupt irq0(void);\r
 void SD_imf_tick(global_game_variables_t *gvar);\r
 void SD_adlib_shut_up();\r
 \r
index 2388e6c..45e9642 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 2388e6cde6d3bda5bb253198a853506e4f27d0bd
+Subproject commit 45e9642437301420932de3c8ebdd4a920ead57ce
index cd0d1f3..00e3ed4 100755 (executable)
@@ -1,15 +1,16 @@
 #! /bin/bash
-wmake -s -h clean
-wmake -s -h
-wmake -s -h comp
+pee="-h"
+wmake -s "$pee" clean
+wmake -s "$pee"
+wmake -s "$pee" comp
 #if [[ -f *.err ]]
 #then
 #      echo dumping *.err
        #cat *.err
-       wmake -s -h vomitchan
+       wmake -s "$pee" vomitchan
 #fi
 #if [ -f 16_head.o ]
 #then
 #      rm *.o
 #fi
-####wmake -s -h inntest.exe
+####wmake $pee inntest.exe
index cd0d1f3..00e3ed4 100755 (executable)
--- a/wbuild.sh
+++ b/wbuild.sh
@@ -1,15 +1,16 @@
 #! /bin/bash
-wmake -s -h clean
-wmake -s -h
-wmake -s -h comp
+pee="-h"
+wmake -s "$pee" clean
+wmake -s "$pee"
+wmake -s "$pee" comp
 #if [[ -f *.err ]]
 #then
 #      echo dumping *.err
        #cat *.err
-       wmake -s -h vomitchan
+       wmake -s "$pee" vomitchan
 #fi
 #if [ -f 16_head.o ]
 #then
 #      rm *.o
 #fi
-####wmake -s -h inntest.exe
+####wmake $pee inntest.exe