\r
//===========================================================================\r
\r
-//++++#if GRMODE == EGAGR\r
+//????#if GRMODE == EGAGR\r
+#if 0\r
\r
/*\r
======================\r
=\r
======================\r
*/\r
-/*++++\r
+\r
unsigned static sheight,swidth;\r
boolean static dothemask;\r
\r
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
#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
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
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
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
#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
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
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