Skip to content

Commit

Permalink
Merge pull request #17 from bjt42/wip
Browse files Browse the repository at this point in the history
Release 1.9
  • Loading branch information
bjt42 committed Jun 16, 2014
2 parents f646e24 + 2827452 commit b8a3ed5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
----------------------------------------
SoftMPU 1.8 - Software MPU-401 Emulator
SoftMPU 1.9 - Software MPU-401 Emulator
----------------------------------------
Copyright (C) 2013-2014 bjt, elianda
Copyright (C) 2002-2013 The DOSBox Team
----------------------------------------

Release Notes (20/02/14)
Release Notes (16/06/14)

WHAT IS IT?

Expand Down
Binary file modified SOFTMPU.EXE
Binary file not shown.
26 changes: 18 additions & 8 deletions SRC/MIDI.C
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ typedef int Bits;
#define MAX_TRACKED_CHANNELS 16
#define MAX_TRACKED_NOTES 8

static char* MIDI_welcome_msg = "\xf0\x41\x10\x16\x12\x20\x00\x00 SoftMPU v1.8 \x25\xf7"; /* SOFTMPU */
static char* MIDI_welcome_msg = "\xf0\x41\x10\x16\x12\x20\x00\x00 SoftMPU v1.9 \x24\xf7"; /* SOFTMPU */

static Bit8u MIDI_note_off[3] = { 0x80,0x00,0x00 }; /* SOFTMPU */

Expand Down Expand Up @@ -107,6 +107,7 @@ static struct {
struct {
Bit8u buf[SYSEX_SIZE];
Bitu used;
Bitu usedbufs;
Bitu delay;
Bit32u start;
} sysex;
Expand Down Expand Up @@ -356,28 +357,36 @@ void MIDI_RawOutByte(Bit8u data) {
}
/* Test for a active sysex tranfer */
if (midi.status==0xf0) {
if (!(data&0x80)) {
if (midi.sysex.used<(SYSEX_SIZE-1)) midi.sysex.buf[midi.sysex.used++] = data;
if (!(data&0x80)) {
/* SOFTMPU: Large sysex support */
/*if (midi.sysex.used<(SYSEX_SIZE-1))*/ midi.sysex.buf[midi.sysex.used++] = data;

if (midi.sysex.used==SYSEX_SIZE)
{
PlayMsg(midi.sysex.buf, SYSEX_SIZE);
midi.sysex.used = 0;
midi.sysex.usedbufs++;
}
return;
} else {
midi.sysex.buf[midi.sysex.used++] = 0xf7;

if ((midi.sysex.start) && (midi.sysex.used >= 4) && (midi.sysex.used <= 9) && (midi.sysex.buf[1] == 0x41) && (midi.sysex.buf[3] == 0x16)) {
if ((midi.sysex.start) && (midi.sysex.usedbufs == 0) && (midi.sysex.used >= 4) && (midi.sysex.used <= 9) && (midi.sysex.buf[1] == 0x41) && (midi.sysex.buf[3] == 0x16)) {
/*LOG(LOG_ALL,LOG_ERROR)("MIDI:Skipping invalid MT-32 SysEx midi message (too short to contain a checksum)");*/ /* SOFTMPU */
} else {
/*LOG(LOG_ALL,LOG_NORMAL)("Play sysex; address:%02X %02X %02X, length:%4d, delay:%3d", midi.sysex.buf[5], midi.sysex.buf[6], midi.sysex.buf[7], midi.sysex.used, midi.sysex.delay);*/
PlayMsg(midi.sysex.buf, midi.sysex.used); /* SOFTMPU */
if (midi.sysex.start) {
if (midi.sysex.buf[5] == 0x7F) {
if (midi.sysex.usedbufs == 0 && midi.sysex.buf[5] == 0x7F) {
/*midi.sysex.delay = 290;*/ /* SOFTMPU */ // All Parameters reset
MIDI_sysex_delay = 290*(RTCFREQ/1000);
} else if (midi.sysex.buf[5] == 0x10 && midi.sysex.buf[6] == 0x00 && midi.sysex.buf[7] == 0x04) {
} else if (midi.sysex.usedbufs == 0 && midi.sysex.buf[5] == 0x10 && midi.sysex.buf[6] == 0x00 && midi.sysex.buf[7] == 0x04) {
/*midi.sysex.delay = 145;*/ /* SOFTMPU */ // Viking Child
MIDI_sysex_delay = 145*(RTCFREQ/1000);
} else if (midi.sysex.buf[5] == 0x10 && midi.sysex.buf[6] == 0x00 && midi.sysex.buf[7] == 0x01) {
} else if (midi.sysex.usedbufs == 0 && midi.sysex.buf[5] == 0x10 && midi.sysex.buf[6] == 0x00 && midi.sysex.buf[7] == 0x01) {
/*midi.sysex.delay = 30;*/ /* SOFTMPU */ // Dark Sun 1
MIDI_sysex_delay = 30*(RTCFREQ/1000);
} else MIDI_sysex_delay = ((midi.sysex.used/2)+2)*(RTCFREQ/1000); /*(Bitu)(((float)(midi.sysex.used) * 1.25f) * 1000.0f / 3125.0f) + 2;
} else MIDI_sysex_delay = ((((midi.sysex.usedbufs*SYSEX_SIZE)+midi.sysex.used)/2)+2)*(RTCFREQ/1000); /*(Bitu)(((float)(midi.sysex.used) * 1.25f) * 1000.0f / 3125.0f) + 2;
midi.sysex.start = GetTicks();*/ /* SOFTMPU */
}
}
Expand All @@ -395,6 +404,7 @@ void MIDI_RawOutByte(Bit8u data) {
if (midi.status==0xf0) {
midi.sysex.buf[0]=0xf0;
midi.sysex.used=1;
midi.sysex.usedbufs=0;
}
}
if (midi.cmd_len) {
Expand Down
4 changes: 4 additions & 0 deletions SRC/SOFTMPU.ASM
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
; - Tweaked playback speed
; - Fixed ESS ISA chipset detection
; - Fixed SYSEX delay timing
;
; 1.9
;
; - Large SYSEX message support
; ------------------------------------------

StackSize EQU 0400h ; 1k stack for init
Expand Down
2 changes: 1 addition & 1 deletion SRC/STRINGS.ASM
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Header DB 0DAh
DB 0C4h,0C4h,0C4h,0C4h,0C4h,0C4h,0C4h,0C4h,0C4h,0C4h
DB 0C4h,0C4h,0C4h,0C4h,0C4h,0C4h,0C4h,0C4h,0C4h
DB 0C4h,0BFh,0Dh,0Ah
DB 0B3h,'SoftMPU 1.8 ',0FEh,' Software MPU-401 Emulator ',0B3h,0Dh,0Ah
DB 0B3h,'SoftMPU 1.9 ',0FEh,' Software MPU-401 Emulator ',0B3h,0Dh,0Ah
DB 0B3h,' ',0B3h,0Dh,0Ah
DB 0B3h,'Copyright (C) 2013-2014 bjt, elianda ',0B3h,0Dh,0Ah
DB 0B3h,'Copyright (C) 2002-2013 The DOSBox Team',0B3h,0Dh,0Ah
Expand Down

0 comments on commit b8a3ed5

Please sign in to comment.