From ee22dab24722e61567b50f7087c3e354cee255df Mon Sep 17 00:00:00 2001 From: bjt Date: Mon, 15 Jul 2013 14:45:32 +0100 Subject: [PATCH 1/7] Improved cleanup on port trap failure. Bumped version numbers --- README | 4 +-- SOFTMPU.EXE | Bin 10343 -> 10378 bytes SRC/MIDI.C | 2 +- SRC/RESIDENT.ASM | 4 +++ SRC/SOFTMPU.ASM | 4 +++ SRC/STRINGS.ASM | 2 +- SRC/TRANS.ASM | 18 +++++++++---- SRC/UTILS.ASM | 67 +++++++++++++++++++++++++++++------------------ 8 files changed, 66 insertions(+), 35 deletions(-) diff --git a/README b/README index 28cf050..1a4dd95 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ ---------------------------------------------- -SoftMPU 1.3 by bjt - Software MPU-401 Emulator +SoftMPU 1.4 by bjt - Software MPU-401 Emulator ---------------------------------------------- Copyright (C) 2013 bjt Copyright (C) 2002-2013 The DOSBox Team @@ -24,7 +24,7 @@ work with the basic MPU interface found on sound cards. REQUIREMENTS -- MS-DOS 6.0 or later. SoftMPU will not work from within Windows +- MS-DOS 6.2 or later. SoftMPU will not work from within Windows - EMM386 must be loaded - Sound Blaster (or compatible) sound card with an MPU-401 interface supporting UART mode (e.g. Sound Blaster 16/AWE, Yamaha YMF71x) diff --git a/SOFTMPU.EXE b/SOFTMPU.EXE index 05fce71572f3f73177e5cbafc36dcf6a0a44253c..b3a8dbdafacb52cf159c2e91ebf918c0df613aeb 100644 GIT binary patch delta 3637 zcmZ`*eQaCR6~Fhsm+Q~iCQZ{)62}RS2@W%93Mom$Yuben1}$z>%2q?#!PY^wKalg> z4ymdgJ-Q@z#WbEKG>y{4-l{QaTe`3Ty@%<0sQ~qp41u3gYx*iD_w?WZJc@iLwCRKJ9Haw`-C>2r3o%*iNmr za4;idk}xCxl(;Q3;6gRS$fINfo{`@t)dU!w1n{&R;O@L-8l0;e4JysWp#cY(^SR__ zxO*NfBL06JI~(D04dgVR_&}O8U6_pb?#4l-Lks09NRKv#!Zk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xuMLsNzm@^^MI#&3+z+D4XuTRGto#{NOwV6*3;BFnyRNMKb4M9 z%&Px7FbbJioLUU+p%Dm%RVRtoyW#I5swM7p$)DL?FB9lo4S?hfUCnk0@@e}%qd<|U zYA*|Ct#|C>N-o}4)lnipU+!G7bXxkek-qfavHlwgGKj}F*&Ssrgk13Z!A}l~+x(BY z4y~$P!)V{+@f|OmZMn10bbKFurOJpSvZ?COgP#-gRBSU={z1&c{a5+eW};kzr8nx_ zWcxmh582emrD?VeziPxu*ZvaN-0mr6+NfXzu%!cJb*4cE2E+-!Pr~J-t|+ zdr|(-)fBdI9gMTW0GtM_OyiDnApZj7Ija$dQ6_L<;QjkHuM`A|n{+sVyO(j#vmwTY zciHeW7;>Wsq%tFQ>6^Eue}a`aBDC6&SaQx;#%%QvffJH8e14DZpf}DRY&z(T z^77g0>W6-ZEKL_ijJ>7G+o;!~oIt&1R#NE1t!oKSK}FXSufd@;%x~TK zEo`N`v`xOteNUwyXmwE)Q!;`VszpB$s6lz3doMm9pLaXL2e?{EIKZLM)#>z9x;9G> zaGK_gJ07x){w5;YYBlR^joi02n!ZCrIj#j;l@GPx7Trv*Hm3Yq3$6fSlWnxI5L&7{ zs|9P6H?^SG8(#wl^==$fUetnj-PW*yBR%`M+5+9rH6rni>9n`!5gTu8v>zt?KEM3) zrR^=cn-L*k!{UOkJE;bCL%1KYnMBixTchT*ipE}h0ys>u?2Tnk?=j~N8=SP=cCoq& SE+jwfc@?iY`>E%*+es for var access from init jmp FAR PTR EMMErr ; Fail @@InitSoftMPU: INVOKE MPU401_Init,cs:SBPortAddr,cs:SBIRQ,cs:MPUDataPortAddr,cs:DelaySysex diff --git a/SRC/SOFTMPU.ASM b/SRC/SOFTMPU.ASM index a790d34..044c90f 100644 --- a/SRC/SOFTMPU.ASM +++ b/SRC/SOFTMPU.ASM @@ -49,6 +49,10 @@ ; - Merged latest DOSBox reset delay patch ; - Fixed "It Came From The Desert" ; +; 1.4 +; +; - Improved EMM386 detection +; ; ------------------------------------------ StackSize EQU 0400h ; 1k stack for init diff --git a/SRC/STRINGS.ASM b/SRC/STRINGS.ASM index 3b915bb..c91b6db 100644 --- a/SRC/STRINGS.ASM +++ b/SRC/STRINGS.ASM @@ -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,0C4h DB 0C4h,0C4h,0C4h,0C4h,0C4h,0C4h,0BFh,0Dh,0Ah - DB 0B3h,'SoftMPU 1.3 by bjt ',0FEh,' Software MPU-401 Emulator',0B3h,0Dh,0Ah + DB 0B3h,'SoftMPU 1.4 by bjt ',0FEh,' Software MPU-401 Emulator',0B3h,0Dh,0Ah DB 0B3h,' ',0B3h,0Dh,0Ah DB 0B3h,'Copyright (C) 2013 bjt ',0B3h,0Dh,0Ah DB 0B3h,'Copyright (C) 2002-2013 The DOSBox Team ',0B3h,0Dh,0Ah diff --git a/SRC/TRANS.ASM b/SRC/TRANS.ASM index 46bed92..70817d6 100644 --- a/SRC/TRANS.ASM +++ b/SRC/TRANS.ASM @@ -297,9 +297,7 @@ Init: ; Ensure ds=cs je @@NoDelay mov dx,OFFSET DelaysEnabled int 021h ; Print sysex delay message -@@NoDelay: call InstTimerISR ; Install the IRQ 2/8 watchdog - call InstDOSISR ; Install the exec handler - pop ds +@@NoDelay: pop ds retf ; Return to caller EMMOK: ; Ensure ds=cs @@ -311,7 +309,11 @@ EMMOK: ; Ensure ds=cs inc eax mov DWORD PTR es:[si],eax ; Store complete ID string - ; Set RTC busy flag + ; Install support handlers + call InstTimerISR ; Install the IRQ 2/8 watchdog + call InstDOSISR ; Install the exec handler + + ; Set RTC busy flag ; Disable interrupts until we've replaced the handler pushf cli @@ -357,7 +359,7 @@ EMMOK: ; Ensure ds=cs jmp SHORT $+2 ; Short pause out 0A1h,al popf ; Start RTC interrupts - + ; Print success message mov ah,9 mov dx,OFFSET LoadedStart @@ -403,6 +405,12 @@ EMMErr: ; Ensure ds=cs push ds mov ax,cs mov ds,ax + + ; Clean up after ourselves + call ResetMPU ; Switch back to normal mode + call RestoreSB ; Remove SB handler + + ; Print an error and exit mov ah,9 mov dx,OFFSET EMMError int 021h diff --git a/SRC/UTILS.ASM b/SRC/UTILS.ASM index 5f748c0..fa93e14 100644 --- a/SRC/UTILS.ASM +++ b/SRC/UTILS.ASM @@ -129,19 +129,8 @@ WaitForDRR: mov LoopCounter,0FFFFh @@DRRClear: clc retn ; OK to send -SwitchToUART: call TrySetDSR ; Clear pending data - jc @@SwitchFailed -@@TryReset: call WaitForDRR ; OK to send? - jc @@SwitchFailed - mov dx,es:MPUCmdPortAddr - mov al,0FFh - out dx,al ; Send reset cmd - call WaitForDSR - jc @@ResetFailed ; No ACK - mov dx,es:MPUDataPortAddr - in al,dx - cmp al,0FEh - jne @@ResetFailed ; No ACK +SwitchToUART: call ResetMPU ; Ensure we're in a sane state + jc @@SwitchFailed call TrySetDSR ; Clear pending data jc @@SwitchFailed call WaitForDRR ; OK to send? @@ -158,12 +147,32 @@ SwitchToUART: call TrySetDSR ; Clear pending data clc retn ; Now in UART mode +@@SwitchFailed: stc + retn ; Can't switch to UART + +ResetMPU: mov SecondReset,0 + call TrySetDSR ; Clear pending data + jc @@ResetFailed2 +@@TryReset: call WaitForDRR ; OK to send? + jc @@ResetFailed2 + mov dx,es:MPUCmdPortAddr + mov al,0FFh + out dx,al ; Send reset cmd + call WaitForDSR + jc @@ResetFailed ; No ACK + mov dx,es:MPUDataPortAddr + in al,dx + cmp al,0FEh + jne @@ResetFailed ; No ACK + clc + retn ; Now in normal mode + @@ResetFailed: mov al,SecondReset inc SecondReset - cmp al,0 ; Maybe we were already in UART mode + cmp al,0 ; Maybe we were in UART mode je @@TryReset -@@SwitchFailed: stc - retn ; Can't switch to UART +@@ResetFailed2: stc + retn ; Failed to reset DetectSB: ; Try to detect a Sound Blaster at the specifed port & irq mov al,es:SBIRQ ; Get hardware irq number @@ -171,9 +180,8 @@ DetectSB: ; Try to detect a Sound Blaster at the specifed port & irq cmp al,010h jl @@FirstPIC2 add al,060h ; Interrupt is on the secondary PIC -@@FirstPIC2: push ax ; Save software int number - ; Save the existing handler +@@FirstPIC2: ; Save the existing handler push es mov ah,035h int 021h ; Get interrupt vector @@ -244,23 +252,30 @@ DetectSB: ; Try to detect a Sound Blaster at the specifed port & irq popf @@RestoreISR: ; Don't restore the handler on success - pop ax ; Get the interrupt num cmp es:SBDetected,1 ; Did the detection flag get set? je @@SBDetected - ; Restore the old handler - mov ah,025h ; Interrupt num in al - push ds - mov ds,es:OldSBISRSeg - mov dx,es:OldSBISRAddr - int 021h ; Register old handler - pop ds + call RestoreSB ; Restore the old handler stc retn ; Failed to detect SB @@SBDetected: clc retn +RestoreSB: ; Restore the old SB handler + mov al,es:SBIRQ ; Get hardware irq number + add al,8 + cmp al,010h + jl @@FirstPIC5 + add al,060h ; Interrupt is on the secondary PIC +@@FirstPIC5: mov ah,025h + push ds + mov ds,es:OldSBISRSeg + mov dx,es:OldSBISRAddr + int 021h ; Register old handler + pop ds + retn + DetectRTC: push es mov ah,0C0h int 015h ; Get configuration From ae50ac20c39b857b9609bdf808a78f388809d24a Mon Sep 17 00:00:00 2001 From: bjt Date: Mon, 15 Jul 2013 17:13:41 +0100 Subject: [PATCH 2/7] Added EMM386 version detection --- SOFTMPU.EXE | Bin 10378 -> 10423 bytes SRC/STRINGS.ASM | 3 ++- SRC/TRANS.ASM | 36 +++++++++++++++++++++++------------- SRC/UTILS.ASM | 4 ++-- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/SOFTMPU.EXE b/SOFTMPU.EXE index b3a8dbdafacb52cf159c2e91ebf918c0df613aeb..9ba917fbf3b72c419622629ec7ef25a4f816a291 100644 GIT binary patch delta 788 zcmZXST}V@57{}lDJ^MI2YOl!Dy6|kr+0h^m!b}P5lwX8R$w_A4;Dyjd5Y2hj+>VT( zHgUuWx+w??3W5q}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x(rXFc?iDAgK1CB?q@i6?l)@b}&=ud_&>o5DksnNDe z@er$NQmUz+tUXtvc5r^OCTn{`teo(LSSDJo7uE~%J8mZzAv=lczr@M^5Y)wtIcZuO z6X>!ww%@p!>rscC&1h5|ak{usR{q6}suRxZcH@}hyGT%E&-ST&OZz93H%U|YH|C%? AS^xk5 diff --git a/SRC/STRINGS.ASM b/SRC/STRINGS.ASM index c91b6db..2fb397c 100644 --- a/SRC/STRINGS.ASM +++ b/SRC/STRINGS.ASM @@ -39,7 +39,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,0C4h DB 0C4h,0C4h,0C4h,0C4h,0C4h,0C4h,0D9h,0Dh,0Ah,'$' -NoEMM DB '! Error: EMM386 is not available',0Dh,0Ah,'$' +NoEMM DB '! Error: EMM386 4.46 (or later) is not available',0Dh,0Ah,'$' EMMError DB '! Error: Port trap failed. Please submit a bug report',0Dh,0Ah,'$' LoadedError DB '! Error: SoftMPU is already loaded',0Dh,0Ah,'$' RTCError DB '! Error: Real Time Clock support not detected',0Dh,0Ah,'$' @@ -66,3 +66,4 @@ HelpText DB 'Usage: SOFTMPU /SB:nnn /IRQ:nn /MPU:nnn [/DELAY DB ' /IRQ:nn Sound Blaster interrupt (2-11)',0Dh,0Ah DB ' /MPU:nnn MPU-401 base I/O port address (220-350)',0Dh,0Ah DB ' /DELAYSYSEX Prevent Rev.0 MT-32 buffer overflow',0Dh,0Ah,'$' +EMMDevice DB 'EMMXXXX0',00h diff --git a/SRC/TRANS.ASM b/SRC/TRANS.ASM index 70817d6..7365801 100644 --- a/SRC/TRANS.ASM +++ b/SRC/TRANS.ASM @@ -25,6 +25,10 @@ TransientSeg SEGMENT 'transient' +EMMVersion LABEL WORD ; EMM386 version buffer +EMMMajor DB 02h +EMMMinor DB 00h + Init: ; Ensure ds=cs push ds mov ax,cs @@ -187,18 +191,24 @@ Init: ; Ensure ds=cs mov SBIRQNum,al ; Check for EMM386 - push ds - xor ax,ax - mov ds,ax - mov ax,ds:[019Ch] - or ax,ds:[019Eh] - pop ds - jz @@NoEMM - mov ax,0FFA5h - int 067h - cmp ax,0845Ah - jz @@FoundEMM - + mov ax,03D00h ; Open file R/O + mov dx,OFFSET EMMDevice + int 021h ; Get handle + jc @@NoEMM + + mov bx,ax + mov ax,04402h ; Get manager version + mov cx,02h + mov dx,OFFSET EMMVersion + int 021h + mov ah,03Eh ; Close file + int 021h + cmp EMMMajor,4 ; Require EMM386 >= 4.46 + jl @@NoEMM + + cmp EMMMinor,45 + jg @@FoundEMM + @@NoEMM: ; EMM386 not present mov ah,9 mov dx,OFFSET NoEMM @@ -408,7 +418,7 @@ EMMErr: ; Ensure ds=cs ; Clean up after ourselves call ResetMPU ; Switch back to normal mode - call RestoreSB ; Remove SB handler + call RestoreSBISR ; Remove SB handler ; Print an error and exit mov ah,9 diff --git a/SRC/UTILS.ASM b/SRC/UTILS.ASM index fa93e14..067c704 100644 --- a/SRC/UTILS.ASM +++ b/SRC/UTILS.ASM @@ -255,14 +255,14 @@ DetectSB: ; Try to detect a Sound Blaster at the specifed port & irq cmp es:SBDetected,1 ; Did the detection flag get set? je @@SBDetected - call RestoreSB ; Restore the old handler + call RestoreSBISR ; Restore the old handler stc retn ; Failed to detect SB @@SBDetected: clc retn -RestoreSB: ; Restore the old SB handler +RestoreSBISR: ; Restore the old SB handler mov al,es:SBIRQ ; Get hardware irq number add al,8 cmp al,010h From 4d462bd4608e730bb692d441c4603060ce2ed5d9 Mon Sep 17 00:00:00 2001 From: bjt Date: Mon, 15 Jul 2013 18:03:47 +0100 Subject: [PATCH 3/7] Added EMM386 install detection --- SOFTMPU.EXE | Bin 10423 -> 10448 bytes SRC/TRANS.ASM | 13 +++++++++++++ 2 files changed, 13 insertions(+) diff --git a/SOFTMPU.EXE b/SOFTMPU.EXE index 9ba917fbf3b72c419622629ec7ef25a4f816a291..b3ed7e49f17ea315bdcbbe758fe33aa8f1a4614b 100644 GIT binary patch delta 791 zcmZvWUuaTs6vyxHch%jr_KTq#V|1^7)|LL*N-Ba)leR);FosF`Fcy<=TypU(<>*E1m>%a8)^rm(3e{z(0R4bh zI553`O*b_7rg;D=0jjg0ioj-0jJXC0?5`k|3?%&?iH`?KuRdbftEUJg8<#`0jvUig zj(0AkDo>`6LH7s=p+j@e<>FZ1$gS|6Ii|0$B+Z+5p vd0Li(o$Ahav(?l%UYI=Bj*G_mt)j0K+j? delta 736 zcmcZ*xIK{BH){JtW_K2E<_nCQFN$tr+{9ER#F#p{T11_3{pQ6Y>0FZASfCO#D4|OkidJGk?D^ zi0KIy)qpS?nE3l;nbf+0j_W>r@CC<<04BXfp&TGKiwge>Cm=5j$OAIXfy{6Yph{1u zN;RMWD_o@nkjDn(*#MRD0@>^wY7KVY{6PEnGlE&%{QX-Q)fRa3+i=xz>u|kz!Kk;0 zi(>=hi~B$ZC&vy3+gUs2Fxd@}i;f=_)3`&q@8_KYw7GZu?%;oQZ;aaM6xD2Oly z5--&lfnsKGu^=D|=)ht*py(2y#$Bu+sf!>MCx~?&WY{MLpzJNU>>s!+6Hp1zi9Y-c zC9Jz5fgJhMa+6OgW{4Jn^nxwz1F^tHO_}Vbq^>X>$bT&>KNo1CKhT`lLUKJP`fj}V z&hX+Q$YtV_dzE4n>zM!lSL+sY<$trHp;Q#ea^!!b_n)thS+Ciyj+vqK@z29Q4(lCf zLsnP9kF4S)rV0ln6_dS{O&Mz^H!7>M)iUe-W2>FKPPtGNY+Qp~G(TerFWj)rCMt7S E04Dqv0RR91 diff --git a/SRC/TRANS.ASM b/SRC/TRANS.ASM index 7365801..9868fe4 100644 --- a/SRC/TRANS.ASM +++ b/SRC/TRANS.ASM @@ -191,6 +191,19 @@ Init: ; Ensure ds=cs mov SBIRQNum,al ; Check for EMM386 + push ds ; Installation checks + xor ax,ax + mov ds,ax + mov ax,ds:[019Ch] + or ax,ds:[019Eh] + pop ds + jz @@NoEMM + + mov ax,0FFA5h + int 067h + cmp ax,0845Ah + jne @@NoEMM + mov ax,03D00h ; Open file R/O mov dx,OFFSET EMMDevice int 021h ; Get handle From d2869c8ee74a3253f1cff41f66c0ec2ffb60fd18 Mon Sep 17 00:00:00 2001 From: bjt Date: Tue, 16 Jul 2013 10:50:41 +0100 Subject: [PATCH 4/7] Added EMM386 NOEMS detection --- SRC/INTHAND.ASM | 12 ++++++------ SRC/PORTHAND.ASM | 2 +- SRC/RESIDENT.ASM | 2 +- SRC/SOFTMPU.ASM | 1 + SRC/STRINGS.ASM | 1 + SRC/TRANS.ASM | 12 ++++++------ SRC/UTILS.ASM | 2 -- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/SRC/INTHAND.ASM b/SRC/INTHAND.ASM index d1171f7..50ce0ee 100644 --- a/SRC/INTHAND.ASM +++ b/SRC/INTHAND.ASM @@ -20,7 +20,7 @@ ; SoftMPU by bjt - Software MPU-401 Emulator ; ------------------------------------------ ; -; RTC, SB DMA and IRQ 2/8 Watchdog interrupt handlers +; RTC, SB DMA, DOS exec and IRQ watchdog interrupt handlers ; IntStackSize EQU 0100h ; 256 byte stack for handler @@ -54,7 +54,7 @@ Int70Handler: ASSUME ds:_DATA ; Access local vars via mov sp,ax ; Disable virtualised port access - mov NoVirtualise,1 + mov VirtualisePorts,0 ; Handle timer tick ; MPU lib has been initialised @@ -68,7 +68,7 @@ Int70Handler: ASSUME ds:_DATA ; Access local vars via popa ; Enable virtualised port access - mov NoVirtualise,0 + mov VirtualisePorts,1 ; Interrupts are still disabled ; Read status register C to clear pending interrupt @@ -176,11 +176,12 @@ TimerIntHandler:ASSUME ds:_DATA ; Access local vars via DOSIntHandler: ASSUME ds:_DATA ; Access local vars via cs - ; Check for exec call (4Bh) + ; Check for exec call (AH=04Bh,AL=00h) pushf cmp ah,04Bh jne @@ExitISR3 - + cmp al,0 + jne @@ExitISR3 mov NoSBEOI,0 ; Reset SB EOI control ; Parse filename for app detection substrings @@ -195,7 +196,6 @@ DOSIntHandler: ASSUME ds:_DATA ; Access local vars via cmp al,0 ; Check for null terminator je @@ExitISR2 jmp @@ParseFilename ; Next char - @@DisableSBEOI: mov NoSBEOI,1 ; Don't send SB EOI @@ExitISR2: pop eax pop si diff --git a/SRC/PORTHAND.ASM b/SRC/PORTHAND.ASM index c5e6f78..bbf4af0 100644 --- a/SRC/PORTHAND.ASM +++ b/SRC/PORTHAND.ASM @@ -33,7 +33,7 @@ PortHandler: ASSUME ds:_TEXT ; PM handler, can't read ; So we won't worry about a context switch... ; Interrupts are disabled already in here as well ; If we're inside the interrupt handler, pass through port access - cmp NoVirtualise,0 + cmp VirtualisePorts,1 je @@PortHandler2 stc ; Don't virtualise retf diff --git a/SRC/RESIDENT.ASM b/SRC/RESIDENT.ASM index 9568f59..79c59f4 100644 --- a/SRC/RESIDENT.ASM +++ b/SRC/RESIDENT.ASM @@ -39,7 +39,7 @@ SBPortAddr DW 0 SBIRQ DB 0 DelaySysex DB 0 -NoVirtualise DB 1 ; Port virtualisation control +VirtualisePorts DB 0 ; Port virtualisation control NoSBEOI DB 0 ; SBISR EOI control OldSBISR LABEL DWORD diff --git a/SRC/SOFTMPU.ASM b/SRC/SOFTMPU.ASM index 044c90f..887334f 100644 --- a/SRC/SOFTMPU.ASM +++ b/SRC/SOFTMPU.ASM @@ -52,6 +52,7 @@ ; 1.4 ; ; - Improved EMM386 detection +; - Automatic IRQ generation enable/disable ; ; ------------------------------------------ diff --git a/SRC/STRINGS.ASM b/SRC/STRINGS.ASM index 2fb397c..e32a6f4 100644 --- a/SRC/STRINGS.ASM +++ b/SRC/STRINGS.ASM @@ -67,3 +67,4 @@ HelpText DB 'Usage: SOFTMPU /SB:nnn /IRQ:nn /MPU:nnn [/DELAY DB ' /MPU:nnn MPU-401 base I/O port address (220-350)',0Dh,0Ah DB ' /DELAYSYSEX Prevent Rev.0 MT-32 buffer overflow',0Dh,0Ah,'$' EMMDevice DB 'EMMXXXX0',00h +EMMDevice2 DB 'EMMQXXX0',00h diff --git a/SRC/TRANS.ASM b/SRC/TRANS.ASM index 9868fe4..64d9e45 100644 --- a/SRC/TRANS.ASM +++ b/SRC/TRANS.ASM @@ -198,18 +198,19 @@ Init: ; Ensure ds=cs or ax,ds:[019Eh] pop ds jz @@NoEMM - mov ax,0FFA5h int 067h cmp ax,0845Ah jne @@NoEMM - mov ax,03D00h ; Open file R/O mov dx,OFFSET EMMDevice int 021h ; Get handle + jnc @@CheckVersion + mov ax,03D00h ; Open file R/O + mov dx,OFFSET EMMDevice2 + int 021h ; Get handle jc @@NoEMM - - mov bx,ax +@@CheckVersion: mov bx,ax mov ax,04402h ; Get manager version mov cx,02h mov dx,OFFSET EMMVersion @@ -218,7 +219,6 @@ Init: ; Ensure ds=cs int 021h cmp EMMMajor,4 ; Require EMM386 >= 4.46 jl @@NoEMM - cmp EMMMinor,45 jg @@FoundEMM @@ -406,7 +406,7 @@ EMMOK: ; Ensure ds=cs mov ah,049h int 021h ; Deallocate environment pop es - mov es:NoVirtualise,0 ; Enable port virtualisation + mov es:VirtualisePorts,1 ; Enable port virtualisation mov ah,031h mov dx,SEG STACK ; Int handlers have their own stack sub dx,bx ; Calc resident size from PSP in para diff --git a/SRC/UTILS.ASM b/SRC/UTILS.ASM index 067c704..f5d8506 100644 --- a/SRC/UTILS.ASM +++ b/SRC/UTILS.ASM @@ -242,7 +242,6 @@ DetectSB: ; Try to detect a Sound Blaster at the specifed port & irq pop dx ; Get PIC address cmp es:SBIRQ,9 je @@RestoreISR ; Allow IRQ 9<->2 mapping - pushf cli ; Disable interrupts in al,dx @@ -254,7 +253,6 @@ DetectSB: ; Try to detect a Sound Blaster at the specifed port & irq @@RestoreISR: ; Don't restore the handler on success cmp es:SBDetected,1 ; Did the detection flag get set? je @@SBDetected - call RestoreSBISR ; Restore the old handler stc retn ; Failed to detect SB From 10e3771e7cf7986797c4e981a59f863d3f44fa19 Mon Sep 17 00:00:00 2001 From: bjt Date: Wed, 17 Jul 2013 19:48:17 +0100 Subject: [PATCH 5/7] Added automatic IRQ generation enable/disable --- SOFTMPU.EXE | Bin 10448 -> 10681 bytes SRC/EXPORT.H | 1 + SRC/INTHAND.ASM | 72 ++++++++++++++++++++++++++++++++++++++--------- SRC/MPU401.C | 32 +++++++++++++++++---- SRC/PIC.C | 16 +++++++++++ SRC/RESIDENT.ASM | 5 ++-- SRC/TRANS.ASM | 19 +++++++------ 7 files changed, 115 insertions(+), 30 deletions(-) diff --git a/SOFTMPU.EXE b/SOFTMPU.EXE index b3ed7e49f17ea315bdcbbe758fe33aa8f1a4614b..693eb21dd002b37a98d90aba6537afaffdc6068e 100644 GIT binary patch literal 10681 zcmeG?ZEzDumfbz$kt}~m7%(9r@|ZOa*s?GNOfXm&FpiT8Aiy{T1vUbtgpGq)d1QwQ zA@VAeZHaYKyLG!)yEyBQ+W=LUDp5Fz;^c@y#3Bb~0cR5@+3Y!M!;KgRylmnx9L>ER zS(p%ZH(U4P>gpJIreAlze(&{ruV26J^6JfRmjK~O z2rWoL=oNT>4(~yDe+zH&WQ69yyAa+r@K(YrFrQ->c=!1~qk)ay{!+K;Dn^1j$U%Xm zb#7BBM$Q>-QwFq7b(;)OBnG)LjFFt1jm5Y`3q|289`NRtU?#T|yGLtE0iSvz0#CO9iJ`xAK*je!? ziv{-dvmn$)GTY5!YXXoQ0FuXjs5<-}axkGL;_Wbt)8Z_?=gp!n&XNIWv2m6n=|3qZ zMs(N<36{nrGMGMvcu)JEypnlw=+9=_o}FN^h<)ME7UHdBtHX`Rky9N$gsKeQbFME` zFo~`nPhu>|_;UXVClgvkjDp_anuBAOnHM-$jbwBZI1f3H=%yaFx;+3w^V&LhO4LhH1(G0|qJ^v4K>w z3i+7;Ld(hs-6_}*1GRrh7gBCryk30?_S7uE zwMDYbm0&rMu5AbdV4xir61=78z>e zjRF&z0kTkgH%=n3nnMW;piNMz1u8*~Ck&F_x?=}H(yMM0gaDYsOUPTwR*w!Lr_MKI z7I$)>VHzA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6ekvjMIW49NXy>Om==siVYxsR3duu%zI+IZ$1w?M>_4ML%od z1An%JwhdR?o&iX@m(&@d^*>->r;&DjNuhKKjZ$Kl5cGa?wRbMy!&mLLQ`7+Kv12%~73;>?IAeEAN3Z^B`R;89MBk43%Pad?T2Jzb7G|+#M zeJ_)I@?g?fyrV2iS(0jTbHih);$C=(7O_PGZ<5v#{!onLejOWkZq5u zRN{qrpb)+2g9eHhC$Wes>RKU>EHs*0j3A$wvOy10g}5VKy>nd&Cjb3$hj@X}jE6K6 zAugbunapN7nT=N`lQT;l7D$`Hc!XkXy^66(#rWO(f7Np=Nq0DQp+N5wwm;8re_G%p z>Mg?_yUW2t(9gX)ZwbHpS$B3&}|0%yQ-(yVxU_2;V_kU4CSWXl-^E$<0BhaKMdn*?9bQnj$Kr=0xf0 && ret<=0xf7) { /* MIDI data request */ mpu.state.channel=ret&7; @@ -603,7 +605,7 @@ next_event: static void MPU401_EOIHandlerDispatch(void) { if (mpu.state.send_now) { mpu.state.eoi_scheduled=true; - PIC_AddEvent(EOI_HANDLER,1); // Possible a bit longer + PIC_AddEvent(EOI_HANDLER,mpu.generate_irqs?1:0); // Possible a bit longer } else if (!mpu.state.eoi_scheduled) MPU401_EOIHandler(); } @@ -670,6 +672,25 @@ static void MPU401_Reset(void) { for (i=0;i<8;i++) {mpu.playbuf[i].type=T_OVERFLOW;mpu.playbuf[i].counter=0;} } +/* SOFTMPU: Enable/disable IRQ generation */ +void MPU401_SetEnableIRQGeneration(bool enable) +{ + if (mpu.generate_irqs && !enable) + { + mpu.generate_irqs=false; + + // Acknowledge any waiting IRQ + PIC_DeActivateIRQ(mpu.sbport); + + // Flush all pending events + PIC_FlushAllEvents(); + + return; + } + + mpu.generate_irqs=enable; +} + /* SOFTMPU: Initialisation */ void MPU401_Init(Bitu sbport,Bitu irq,Bitu mpuport,bool delaysysex) { @@ -685,8 +706,9 @@ void MPU401_Init(Bitu sbport,Bitu irq,Bitu mpuport,bool delaysysex) mpu.mode=M_UART; mpu.sbport=sbport; mpu.mpuport=mpuport; + mpu.generate_irqs=false; /* SOFTMPU */ - mpu.intelligent = true; /* Default is on */ + mpu.intelligent=true; /* Default is on */ if (!mpu.intelligent) return; /* SOFTMPU: Moved IRQ 9 handler init to asm */ diff --git a/SRC/PIC.C b/SRC/PIC.C index be5171c..7ecf4af 100644 --- a/SRC/PIC.C +++ b/SRC/PIC.C @@ -119,6 +119,22 @@ void PIC_RemoveEvents(EventID event) event_countdown[event]=0; } +/* SOFTMPU: Run all pending events */ +void PIC_FlushAllEvents(void) +{ + Bitu i; + + for (i=0;i 0) + { + event_countdown[i]=1; + } + } + + PIC_Update(false); +} + void PIC_Init(void) { Bitu i; diff --git a/SRC/RESIDENT.ASM b/SRC/RESIDENT.ASM index 79c59f4..71e0715 100644 --- a/SRC/RESIDENT.ASM +++ b/SRC/RESIDENT.ASM @@ -40,7 +40,8 @@ SBIRQ DB 0 DelaySysex DB 0 VirtualisePorts DB 0 ; Port virtualisation control -NoSBEOI DB 0 ; SBISR EOI control +IRQGeneration DB 1 ; SB IRQ generation control +SBEOI DB 1 ; SB ISR EOI control OldSBISR LABEL DWORD OldSBISRAddr DW ? @@ -58,7 +59,7 @@ SBDetected DB 0 ; Following data needs to be 4-byte aligned ; Might need to add some padding here for detection to work -IDPad DB 0 DUP (?) +IDPad DB 3 DUP (?) IDString DB '0S2M' ; Detection string INCLUDE inthand.asm ; Interrupt handlers diff --git a/SRC/TRANS.ASM b/SRC/TRANS.ASM index 64d9e45..960b34d 100644 --- a/SRC/TRANS.ASM +++ b/SRC/TRANS.ASM @@ -357,6 +357,15 @@ EMMOK: ; Ensure ds=cs pop ds popf ; Enable interrupts + ; Disable RTC interrupts by default + pushf + cli ; No interrupts while programming PIC + in al,0A1h + and al,0FEh ; Clear bit 0 = IRQ 8 (RTC) + jmp SHORT $+2 + out 0A1h,al + popf + ; Initialise the RTC mov al,0Bh ; Read status reg B call ReadRTC @@ -374,15 +383,6 @@ EMMOK: ; Ensure ds=cs mov al,0Ah call WriteRTC - ; Enable RTC interrupts - pushf - cli ; No interrupts while programming PIC - in al,0A1h - and al,0FEh ; Clear bit 0 = IRQ 8 (RTC) - jmp SHORT $+2 ; Short pause - out 0A1h,al - popf ; Start RTC interrupts - ; Print success message mov ah,9 mov dx,OFFSET LoadedStart @@ -407,6 +407,7 @@ EMMOK: ; Ensure ds=cs int 021h ; Deallocate environment pop es mov es:VirtualisePorts,1 ; Enable port virtualisation + mov es:IRQGeneration,0 ; Disable SB IRQ generation mov ah,031h mov dx,SEG STACK ; Int handlers have their own stack sub dx,bx ; Calc resident size from PSP in para From a61e8683a56877b9c17076f20423d5cde73e1efc Mon Sep 17 00:00:00 2001 From: bjt Date: Wed, 24 Jul 2013 09:56:10 +0100 Subject: [PATCH 6/7] Improved substring search --- README | 2 +- SOFTMPU.EXE | Bin 10681 -> 10611 bytes SRC/APPSTR.ASM | 28 +++++++++++++++++++ SRC/EXPORT.H | 2 +- SRC/INTHAND.ASM | 69 +++++++++++++++++++++-------------------------- SRC/MPU401.C | 18 ++++--------- SRC/PIC.C | 16 ----------- SRC/RESIDENT.ASM | 3 ++- SRC/SOFTMPU.ASM | 2 +- SRC/TRANS.ASM | 19 +++++++------ 10 files changed, 77 insertions(+), 82 deletions(-) create mode 100644 SRC/APPSTR.ASM diff --git a/README b/README index 1a4dd95..1fd548d 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ Copyright (C) 2013 bjt Copyright (C) 2002-2013 The DOSBox Team ---------------------------------------------- -Release Notes (09/07/13) +Release Notes (23/07/13) WHAT IS IT? diff --git a/SOFTMPU.EXE b/SOFTMPU.EXE index 693eb21dd002b37a98d90aba6537afaffdc6068e..7cf7796acc218592dce37df91131880bfc0e8a6c 100644 GIT binary patch literal 10611 zcmeG?e^gUfn)lxKcnRT0QdG27!^6Q;`4MAOS`i{vq}W!CTB$Xb8Z~L{P;tV0P-nD; zMi)pJ+Osn|vz?TXlIN5OQ#)}fu``s51 zYn|EY*+2H|Szm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100644 index 0000000..fdf9e7f --- /dev/null +++ b/SRC/APPSTR.ASM @@ -0,0 +1,28 @@ +; +; Copyright (C) 2013 bjt +; +; This program is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program; if not, write to the Free Software +; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +; + +; ------------------------------------------ +; SoftMPU by bjt - Software MPU-401 Emulator +; ------------------------------------------ +; +; App ID substrings +; + + ; Disable SB interrupts for these intelligent mode apps +AppIDStrings DB 'WC2.' ; Wing Commander II + DB 00h ; End diff --git a/SRC/EXPORT.H b/SRC/EXPORT.H index 92e7230..04db28a 100644 --- a/SRC/EXPORT.H +++ b/SRC/EXPORT.H @@ -40,7 +40,7 @@ typedef enum EventID {MPU_EVENT,RESET_DONE,EOI_HANDLER,NUM_EVENTS} EventID; void PIC_Update(bool blocking); void MPU401_Init(Bitu sbport,Bitu irq,Bitu mpuport,bool delaysysex); -void MPU401_SetEnableIRQGeneration(bool enable); +void MPU401_SetEnableSBIRQ(bool enable); Bitu MPU401_ReadStatus(void); void MPU401_WriteCommand(Bitu val); Bitu MPU401_ReadData(void); diff --git a/SRC/INTHAND.ASM b/SRC/INTHAND.ASM index df083ec..fde9082 100644 --- a/SRC/INTHAND.ASM +++ b/SRC/INTHAND.ASM @@ -102,7 +102,7 @@ SBIntHandler: ASSUME ds:_DATA ; Access local vars via ; Early out if required pushf - cmp IRQGeneration,1 + cmp SBIRQGen,1 je @@SBIntHandler2 popf jmp OldSBISR @@ -165,42 +165,32 @@ TimerIntHandler:ASSUME ds:_DATA ; Access local vars via jmp SHORT $+2 ; Enforce short pause between read & write out 021h,al ; Set new mask - ; Make sure IRQ 8 (RTC) is set correctly - ; It's needed to drive the MPU timers -@@IRQ2OK: in al,0A1h ; Get current mask - xor al,01h ; Invert - mov ah,al - and ah,01h - cmp ah,IRQGeneration ; Is it set correctly? - je @@IRQ8OK - jmp SHORT $+2 ; Enforce short pause between read & write - out 0A1h,al ; Set new mask - ; Restore scratch registers -@@IRQ8OK: mov ax,SavedAX +@@IRQ2OK: mov ax,SavedAX ; Chained ISR will have already sent an EOI iret ; Will restore int flag DOSIntHandler: ASSUME ds:_DATA ; Access local vars via cs - ; Disable interrupts to keep setting changes atomic - pushf - cli - ; Check for exec call (AH=04Bh,AL=00h) + pushf cmp ah,04Bh jne @@ExitISR3 cmp al,0 jne @@ExitISR3 + ; Disable interrupts to keep setting changes atomic + cli + ; Default settings - mov SBEOI,1 ; Reset SB EOI control - mov IRQGeneration,0 ; Reset IRQ generation control + mov SBEOI,1 ; Enable SB EOI + mov SBIRQGen,1 ; Enable SB IRQ generation ; Parse filename for app detection substrings push si push eax + push ebx mov si,dx cld ; Auto increment si @@ParseFilename:lodsd ; Get a dword from the filename @@ -213,18 +203,27 @@ DOSIntHandler: ASSUME ds:_DATA ; Access local vars via jmp @@CheckIRQGen @@DisableSBEOI: mov SBEOI,0 ; Don't send SB EOI - ; Should we enable IRQ generation? -@@CheckIRQGen: cmp eax,'.EGU' ; It Came From The Desert (HUGE.EXE) - je @@EnableIRQGen - cmp eax,'.RES' ; Laser Squad - je @@EnableIRQGen - cmp eax,'.ETA' ; Gateway - je @@EnableIRQGen - jmp @@NextChar -@@EnableIRQGen: mov IRQGeneration,1 ; Generate MPU interrupts -@@NextChar: sub si,3 ; Only step a byte at a time +@@CheckIRQGen: ; Should we disable SB IRQ generation? + push ds + push si + mov ebx,eax ; Save comparison string + mov ax,cs + mov ds,ax ; Copy cs->ds for data access + mov si,OFFSET AppIDStrings +@@ParseAppStrings: + lodsd ; Get an ID string + cmp al,0 ; Check for null terminator + je @@NextChar + cmp eax,ebx + je @@DisableIRQGen ; Found a match + jmp @@ParseAppStrings +@@DisableIRQGen:mov SBIRQGen,0 ; Disable SB interrupts +@@NextChar: pop si + pop ds + sub si,3 ; Only step a byte at a time jmp @@ParseFilename ; Next char -@@ExitISR2: pop eax ; Finished parsing +@@ExitISR2: pop ebx + pop eax ; Finished parsing pop si ; Now commit our changes @@ -232,16 +231,8 @@ DOSIntHandler: ASSUME ds:_DATA ; Access local vars via push ds mov ax,SEG _DATA mov ds,ax - INVOKE MPU401_SetEnableIRQGeneration,IRQGeneration + INVOKE MPU401_SetEnableSBIRQ,SBIRQGen pop ds - - ; Enable/disable RTC interrupts as requested - ; Interrupts are still disabled - in al,0A1h ; Get current mask - and al,0FEh - or al,IRQGeneration - jmp SHORT $+2 ; Enforce short pause between read & write - out 0A1h,al ; Set new mask popa @@ExitISR3: popf jmp OldDOSISR diff --git a/SRC/MPU401.C b/SRC/MPU401.C index 4cb920b..5ced731 100644 --- a/SRC/MPU401.C +++ b/SRC/MPU401.C @@ -51,7 +51,6 @@ void PIC_DeActivateIRQ(Bitu sbport); /* SOFTMPU */ void PIC_SetIRQMask(Bitu irq,bool masked); void PIC_AddEvent(EventID event,Bitu delay); void PIC_RemoveEvents(EventID event); -void PIC_FlushAllEvents(void); void MIDI_Init(Bitu mpuport,bool delaysysex); void MIDI_RawOutByte(Bit8u data); @@ -300,8 +299,8 @@ void MPU401_WriteCommand(Bitu val) { /* SOFTMPU */ break; case 0xff: /* Reset MPU-401 */ /*LOG(LOG_MISC,LOG_NORMAL)("MPU-401:Reset %X",val);*/ /* SOFTMPU */ + PIC_AddEvent(RESET_DONE,MPU401_RESETBUSY); mpu.state.reset=true; - PIC_AddEvent(RESET_DONE,mpu.generate_irqs?MPU401_RESETBUSY:0); /* SOFTMPU */ MPU401_Reset(); if (mpu.mode==M_UART) return;//do not send ack in UART mode break; @@ -605,7 +604,7 @@ next_event: static void MPU401_EOIHandlerDispatch(void) { if (mpu.state.send_now) { mpu.state.eoi_scheduled=true; - PIC_AddEvent(EOI_HANDLER,mpu.generate_irqs?1:0); // Possible a bit longer + PIC_AddEvent(EOI_HANDLER,1); // Possible a bit longer } else if (!mpu.state.eoi_scheduled) MPU401_EOIHandler(); } @@ -672,20 +671,13 @@ static void MPU401_Reset(void) { for (i=0;i<8;i++) {mpu.playbuf[i].type=T_OVERFLOW;mpu.playbuf[i].counter=0;} } -/* SOFTMPU: Enable/disable IRQ generation */ -void MPU401_SetEnableIRQGeneration(bool enable) +/* SOFTMPU: Enable/disable SB IRQ generation */ +void MPU401_SetEnableSBIRQ(bool enable) { if (mpu.generate_irqs && !enable) { - mpu.generate_irqs=false; - // Acknowledge any waiting IRQ PIC_DeActivateIRQ(mpu.sbport); - - // Flush all pending events - PIC_FlushAllEvents(); - - return; } mpu.generate_irqs=enable; @@ -706,7 +698,7 @@ void MPU401_Init(Bitu sbport,Bitu irq,Bitu mpuport,bool delaysysex) mpu.mode=M_UART; mpu.sbport=sbport; mpu.mpuport=mpuport; - mpu.generate_irqs=false; /* SOFTMPU */ + mpu.generate_irqs=true; /* SOFTMPU */ mpu.intelligent=true; /* Default is on */ if (!mpu.intelligent) return; diff --git a/SRC/PIC.C b/SRC/PIC.C index 7ecf4af..be5171c 100644 --- a/SRC/PIC.C +++ b/SRC/PIC.C @@ -119,22 +119,6 @@ void PIC_RemoveEvents(EventID event) event_countdown[event]=0; } -/* SOFTMPU: Run all pending events */ -void PIC_FlushAllEvents(void) -{ - Bitu i; - - for (i=0;i 0) - { - event_countdown[i]=1; - } - } - - PIC_Update(false); -} - void PIC_Init(void) { Bitu i; diff --git a/SRC/RESIDENT.ASM b/SRC/RESIDENT.ASM index 71e0715..082913f 100644 --- a/SRC/RESIDENT.ASM +++ b/SRC/RESIDENT.ASM @@ -40,8 +40,8 @@ SBIRQ DB 0 DelaySysex DB 0 VirtualisePorts DB 0 ; Port virtualisation control -IRQGeneration DB 1 ; SB IRQ generation control SBEOI DB 1 ; SB ISR EOI control +SBIRQGen DB 1 ; SB IRQ generation control OldSBISR LABEL DWORD OldSBISRAddr DW ? @@ -62,6 +62,7 @@ SBDetected DB 0 IDPad DB 3 DUP (?) IDString DB '0S2M' ; Detection string + INCLUDE appstr.asm ; App ID substrings INCLUDE inthand.asm ; Interrupt handlers INCLUDE porthand.asm ; Port handler code diff --git a/SRC/SOFTMPU.ASM b/SRC/SOFTMPU.ASM index 887334f..7e34878 100644 --- a/SRC/SOFTMPU.ASM +++ b/SRC/SOFTMPU.ASM @@ -51,8 +51,8 @@ ; ; 1.4 ; +; - Fixed games with digital FX ; - Improved EMM386 detection -; - Automatic IRQ generation enable/disable ; ; ------------------------------------------ diff --git a/SRC/TRANS.ASM b/SRC/TRANS.ASM index 960b34d..8abc5ce 100644 --- a/SRC/TRANS.ASM +++ b/SRC/TRANS.ASM @@ -357,15 +357,6 @@ EMMOK: ; Ensure ds=cs pop ds popf ; Enable interrupts - ; Disable RTC interrupts by default - pushf - cli ; No interrupts while programming PIC - in al,0A1h - and al,0FEh ; Clear bit 0 = IRQ 8 (RTC) - jmp SHORT $+2 - out 0A1h,al - popf - ; Initialise the RTC mov al,0Bh ; Read status reg B call ReadRTC @@ -383,6 +374,15 @@ EMMOK: ; Ensure ds=cs mov al,0Ah call WriteRTC + ; Enable RTC interrupts + pushf + cli ; No interrupts while programming PIC + in al,0A1h + and al,0FEh ; Clear bit 0 = IRQ 8 (RTC) + jmp SHORT $+2 ; Short pause + out 0A1h,al + popf ; Start RTC interrupts + ; Print success message mov ah,9 mov dx,OFFSET LoadedStart @@ -407,7 +407,6 @@ EMMOK: ; Ensure ds=cs int 021h ; Deallocate environment pop es mov es:VirtualisePorts,1 ; Enable port virtualisation - mov es:IRQGeneration,0 ; Disable SB IRQ generation mov ah,031h mov dx,SEG STACK ; Int handlers have their own stack sub dx,bx ; Calc resident size from PSP in para From c3d13735a74a1a098cd22b3c6ae87cf78e64772e Mon Sep 17 00:00:00 2001 From: bjt Date: Fri, 26 Jul 2013 09:51:29 +0100 Subject: [PATCH 7/7] Added more substrings --- README | 2 +- SOFTMPU.EXE | Bin 10611 -> 10627 bytes SRC/APPSTR.ASM | 6 +++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README b/README index 1fd548d..904fc06 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ Copyright (C) 2013 bjt Copyright (C) 2002-2013 The DOSBox Team ---------------------------------------------- -Release Notes (23/07/13) +Release Notes (26/07/13) WHAT IS IT? diff --git a/SOFTMPU.EXE b/SOFTMPU.EXE index 7cf7796acc218592dce37df91131880bfc0e8a6c..6590256b2593833009d2c3b94c9fd47ab97aa615 100644 GIT binary patch delta 604 zcmXw#PiPZC6vp2q>$X_KZZ>~FExSqD^bgvpG|)>R2NSCZQERD+hteo|=s}PsJt<9C z#Vi{Fx+g=0#9s6e+7PM%F9u6d+R|VzWxW(zbTz1`AWb~1Ge!@;;d{Jq-Z%4po|nf) zqnBmm0vmV$z%+9R7=SArfJkZtSBZMh1F!{I0UWV)jAQ?)L3`=7*8Im-~*)y9%0|8XsW=<&#c_a}^ z#6pE}ARS>AAEYDuDga7^m6TzR5L;m-0Zpo6f)lf%N4S3XOHcNkB<{4e%a*>01=|Z>{9owZDSDsLv&hcZ=AhcK{nYY<` zIgit3IZx6Xw5lX9OlxJ4cmqraYpO#dd6KPDV~(UvY8b+06v>BK8V@8fiYj^9q4)5v z2&1}do}I9dALTUdnkU`SEbVBiu3^jbT#hOOzgw{F;VI0pUmF%xw2;L9tqbO2JGo?W zhsC`N-vvNCkl-Dbb}b&jY}7G0lS3nZRN0UxbeTVr6Fq1V#N3|>$}b znScB)Hmf_yrJk;D#nLDpcV4!lXY9%02+Ec4ky{A$u?GY1(QP*A_3UM~Wsm#KI!kzm N*h8;Udf{D{{s23p)13eS diff --git a/SRC/APPSTR.ASM b/SRC/APPSTR.ASM index fdf9e7f..7c39365 100644 --- a/SRC/APPSTR.ASM +++ b/SRC/APPSTR.ASM @@ -24,5 +24,9 @@ ; ; Disable SB interrupts for these intelligent mode apps -AppIDStrings DB 'WC2.' ; Wing Commander II +AppIDStrings DB 'FB.E' ; Flashback + DB 'MM3.' ; Might and Magic III + DB 'SOC.' ; Sensible Soccer + DB 'UNVG' ; Waxworks + DB 'WC2.' ; Wing Commander II DB 00h ; End