#-zkl = current codepage
DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1# -zm
-CFLAGS=-zk0 -wo -x -mc# -zdp# -zp16 -zq
+CFLAGS=-zk0 -wo -x -mc -zu# -zdp# -zp16 -zq
OFLAGS=-ot -ox -ob -oh -or# -om -ol -ol+
FLAGS=-0 -d2 -lr $(OFLAGS) $(CFLAGS) $(DFLAGS)
SRC=src$(DIRSEP)
if (b == 0xFF) {
if (c == 0x7F) { /* c=type d=len */
unsigned long len = midi_trk_read_delta(t);
-// fprintf(stderr,"Type 0x7F len=%lu %p/%p/%p\n",len,t->raw,t->read,t->fence);
+//====
+ fprintf(stderr,"Type 0x7F len=%lu %p/%p/%p\n",len,t->raw,t->read,t->fence);
+//====
if (len < 512UL) {
/* unknown */
midi_trk_skip(t,len);
}
}
else {
-// fprintf(stderr,"Type 0x%02x len=%lu %p/%p/%p\n",c,d,t->raw,t->read,t->fence);
+//====
+ fprintf(stderr,"Type 0x%02x len=%lu %p/%p/%p\n",c,d,t->raw,t->read,t->fence);
+//====
}
midi_trk_skip(t,d);
}
else {
unsigned long len = midi_trk_read_delta(t);
-// fprintf(stderr,"Sysex len=%lu %p/%p/%p\n",len,t->raw,t->read,t->fence);
+//====
+ fprintf(stderr,"Sysex len=%lu %p/%p/%p\n",len,t->raw,t->read,t->fence);
+//====
midi_trk_skip(t,len);
}
} break;
}
}
-void adlib_shut_up();
+//void adlib_shut_up();
void midi_reset_tracks();
void midi_reset_channels();
#include <dos.h>
//#include "src/lib/doslib/vga.h"
-//#include "src/lib/doslib/dos.h"
+#include "src/lib/doslib/dos.h"
#include "src/lib/16_head.h"
#include "src/lib/doslib/8254.h" /* 8254 timer */
#include "src/lib/doslib/8259.h"
printf("Cannot init library\n");
return 1;
}
- if (!probe_8254()) { // we need the timer to keep time with the music
+ if (!probe_8254()) { /* we need the timer to keep time with the music */
printf("8254 timer not found\n");
return 1;
}
return 1;
}
- write_8254_system_timer(T8254_REF_CLOCK_HZ / 100); // tick faster at 100Hz please
+ write_8254_system_timer(T8254_REF_CLOCK_HZ / 100); /* tick faster at 100Hz please */
irq0_cnt = 0;
irq0_add = 182;
- irq0_max = 1000; // about 18.2Hz
- old_irq0 = _dos_getvect(8);//IRQ0
+ irq0_max = 1000; /* about 18.2Hz */
+ old_irq0 = _dos_getvect(8);/*IRQ0*/
_dos_setvect(8,irq0);
- adlib_shut_up();
+ //adlib_shut_up();
midi_reset_channels();
midi_reset_tracks();
_cli();
_cli();
adv = irq0_ticks - ptick;
+ //adv = ptick;
if (adv >= 100UL) adv = 100UL;
ptick = irq0_ticks;
+ //ptick++;
_sti();
while (adv != 0) {
}
midi_playing = 0;
- adlib_shut_up();
+ //adlib_shut_up();
shutdown_adlib();
_dos_setvect(8,old_irq0);
- write_8254_system_timer(0); // back to normal 18.2Hz
+ write_8254_system_timer(0); /* back to normal 18.2Hz */
for (i=0;i < MIDI_MAX_TRACKS;i++) {
if (midi_trk[i].raw) {
#if TARGET_MSDOS == 16 && (defined(__LARGE__) || defined(__COMPACT__))
- _dos_freemem(FP_SEG(midi_trk[i].raw)); // NTS: Because we allocated with _dos_allocmem
+ _dos_freemem(FP_SEG(midi_trk[i].raw)); /* NTS: Because we allocated with _dos_allocmem */
#else
free(midi_trk[i].raw);
#endif