From: sparky4 Date: Thu, 16 Jul 2015 22:38:00 +0000 (-0500) Subject: the midi stuff is broke!! >< X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e71252703c56101ac7fe042bee4bf8da0ead0465;p=proj16%2F16.git the midi stuff is broke!! >< modified: 16.exe modified: exmmtest.exe modified: fmemtest.exe modified: fontgfx.exe modified: fonttes0.exe modified: fonttest.exe modified: inputest.exe modified: makefile modified: maptest.exe modified: miditest.exe modified: palettec.exe modified: pcxtest.exe modified: sountest.exe modified: src/lib/midi.c modified: src/lib/midi.h modified: src/miditest.c modified: test.exe modified: test2.exe modified: testemm.exe modified: tsthimem.exe --- diff --git a/16.exe b/16.exe index 4f7763a7..01c5a5db 100644 Binary files a/16.exe and b/16.exe differ diff --git a/exmmtest.exe b/exmmtest.exe index 3099ebc4..81f8adca 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/fmemtest.exe b/fmemtest.exe index f74dc944..4df97337 100644 Binary files a/fmemtest.exe and b/fmemtest.exe differ diff --git a/fontgfx.exe b/fontgfx.exe index 0582b483..467876eb 100644 Binary files a/fontgfx.exe and b/fontgfx.exe differ diff --git a/fonttes0.exe b/fonttes0.exe index 01bc01dd..a344db54 100644 Binary files a/fonttes0.exe and b/fonttes0.exe differ diff --git a/fonttest.exe b/fonttest.exe index 2cc9c1d7..723156c1 100644 Binary files a/fonttest.exe and b/fonttest.exe differ diff --git a/inputest.exe b/inputest.exe index c6a2851f..f83dba5f 100644 Binary files a/inputest.exe and b/inputest.exe differ diff --git a/makefile b/makefile index 1bdf1263..c055a3fd 100644 --- a/makefile +++ b/makefile @@ -13,7 +13,7 @@ TARGET_OS = dos #-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) diff --git a/maptest.exe b/maptest.exe index cb6dd8c3..a80241dc 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/miditest.exe b/miditest.exe index f9206c60..f595dbe1 100644 Binary files a/miditest.exe and b/miditest.exe differ diff --git a/palettec.exe b/palettec.exe index 533a71d0..218d24ce 100644 Binary files a/palettec.exe and b/palettec.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index 2e3f94de..11c81339 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/sountest.exe b/sountest.exe index f17ef13f..ac0c4bde 100644 Binary files a/sountest.exe and b/sountest.exe differ diff --git a/src/lib/midi.c b/src/lib/midi.c index fe8aa5e2..760906c8 100644 --- a/src/lib/midi.c +++ b/src/lib/midi.c @@ -423,7 +423,9 @@ void midi_tick_track(unsigned int i) { 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); @@ -452,7 +454,9 @@ void midi_tick_track(unsigned int i) { } } 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); @@ -463,7 +467,9 @@ void midi_tick_track(unsigned int i) { } 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; @@ -484,7 +490,7 @@ void midi_tick_track(unsigned int i) { } } -void adlib_shut_up(); +//void adlib_shut_up(); void midi_reset_tracks(); void midi_reset_channels(); diff --git a/src/lib/midi.h b/src/lib/midi.h index b98f0590..ac740c80 100644 --- a/src/lib/midi.h +++ b/src/lib/midi.h @@ -27,7 +27,7 @@ #include //#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" diff --git a/src/miditest.c b/src/miditest.c index 01230166..73b47057 100644 --- a/src/miditest.c +++ b/src/miditest.c @@ -32,7 +32,7 @@ int main(int argc,char **argv) { 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; } @@ -48,14 +48,14 @@ int main(int argc,char **argv) { 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(); @@ -68,8 +68,10 @@ int main(int argc,char **argv) { _cli(); adv = irq0_ticks - ptick; + //adv = ptick; if (adv >= 100UL) adv = 100UL; ptick = irq0_ticks; + //ptick++; _sti(); while (adv != 0) { @@ -88,15 +90,15 @@ int main(int argc,char **argv) { } 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 diff --git a/test.exe b/test.exe index 6553fc9e..3121770b 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index f33345c9..dd3b21a1 100644 Binary files a/test2.exe and b/test2.exe differ diff --git a/testemm.exe b/testemm.exe index 34a1fb24..3db9514b 100644 Binary files a/testemm.exe and b/testemm.exe differ diff --git a/tsthimem.exe b/tsthimem.exe index dd740988..f14444b0 100644 Binary files a/tsthimem.exe and b/tsthimem.exe differ