Skip to content

Commit

Permalink
Merge pull request #21 from bjt42/wip
Browse files Browse the repository at this point in the history
Removed RTC check. MPU detection no longer requires ACK. Added support for Princess Maker
  • Loading branch information
bjt42 authored Jan 21, 2018
2 parents 24e4685 + 6bc3548 commit b149617
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 48 deletions.
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
----------------------------------------
SoftMPU 1.9 - Software MPU-401 Emulator
SoftMPU 1.91 - Software MPU-401 Emulator
----------------------------------------
Copyright (C) 2013-2014 bjt, elianda
Copyright (C) 2013-2018 bjt, elianda
Copyright (C) 2002-2013 The DOSBox Team
----------------------------------------

Release Notes (16/06/14)
Release Notes (21/01/18)

WHAT IS IT?

Expand Down
Binary file modified SOFTMPU.EXE
Binary file not shown.
3 changes: 2 additions & 1 deletion SRC/APPSTR.ASM
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;
; Copyright (C) 2013-2014 bjt
; Copyright (C) 2013-2018 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
Expand Down Expand Up @@ -51,6 +51,7 @@ AppIDStrings DW 0EEC5h ; A-10 Tank Killer (A.EX
DW 0702Fh ; Laser Squad (LASER.EXE)
DW 0DF0Ch ; Laser Squad (LSQDBCC.EXE)
DW 0121Eh ; Laser Squad (SQUAD.EXE)
DW 0ADC4h ; Princess Maker (AUTOEXEC.EXE)
DW 02717h ; Princess Maker 2 (MMD.COM)
DW 03A59h ; Princess Maker 2 (PM2.EXE)
DW 04B38h ; Princess Maker 2 (PMDL.COM)
Expand Down
5 changes: 2 additions & 3 deletions SRC/STRINGS.ASM
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;
; Copyright (C) 2013-2014 bjt, elianda
; Copyright (C) 2013-2018 bjt, elianda
;
; 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
Expand Down 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.9 ',0FEh,' Software MPU-401 Emulator ',0B3h,0Dh,0Ah
DB 0B3h,'SoftMPU 1.91 ',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 All @@ -42,7 +42,6 @@ Header DB 0DAh
NoEMM DB '! Error: EMM386 4.46+ or QEMM 7.03+ not detected',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,'$'
SBErrorStart DB '! Error: Sound Blaster not detected at port ','$'
SBErrorMid DB ' IRQ ','$'
SBErrorEnd DB 0Dh,0Ah,'$'
Expand Down
20 changes: 2 additions & 18 deletions SRC/TRANS.ASM
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;
; Copyright (C) 2013-2014 bjt, elianda
; Copyright (C) 2013-2018 bjt, elianda
;
; 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
Expand Down Expand Up @@ -175,9 +175,6 @@ Init: ; Ensure ds=cs
jle @@SBPortOK

@@SBPortNotOK: ; The SB port was out of range
; That's only OK if we're in serial mode
cmp es:OutMode,M_SERIAL
jne PrintHelp
mov es:SBPortAddr,0

@@SBPortOK: ; Write the port addresses into our strings
Expand Down Expand Up @@ -231,9 +228,6 @@ Init: ; Ensure ds=cs
jle @@SBIRQOK

@@SBIRQNotOK: ; The SB IRQ was out of range
; That's only OK if we're in serial mode
cmp es:OutMode,M_SERIAL
jne PrintHelp
mov es:SBIRQ,0
mov es:SBPortAddr,0 ; Zero the SB port too

Expand Down Expand Up @@ -350,17 +344,7 @@ Init: ; Ensure ds=cs
pop ds
popf ; Enable interrupts

; Check we've got a BIOS with RTC support
call DetectRTC
jnc @@RTCOK

; Failed to detect the RTC
mov ah,9
mov dx,OFFSET RTCError
int 021h
jmp Terminate

@@RTCOK: ; Only init HW MPU when required
; Only init HW MPU when required
cmp es:OutMode,M_MPU401
jne @@SkipUART

Expand Down
24 changes: 1 addition & 23 deletions SRC/UTILS.ASM
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;
; Copyright (C) 2013-2014 bjt, elianda
; Copyright (C) 2013-2018 bjt, elianda
;
; 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
Expand Down Expand Up @@ -141,11 +141,8 @@ SwitchToUART: call ResetMPU ; Ensure we're in a sane
mov al,03Fh
out dx,al ; Set UART cmd
call WaitForDSR
jc @@SwitchFailed ; No ACK
mov dx,es:MPUDataPortAddr
in al,dx
cmp al,0FEh
jne @@SwitchFailed ; No ACK
clc
retn ; Now in UART mode

Expand All @@ -161,11 +158,8 @@ ResetMPU: mov SecondReset,0
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

Expand Down Expand Up @@ -331,22 +325,6 @@ RestoreSBISR: ; Restore the old SB handler
pop ds
retn

DetectRTC: push es
mov ah,0C0h
int 015h ; Get configuration
jc @@RTCNotDetected
mov al,es:[bx+5] ; Get feature info 1
test al,020h ; Check for RTC
jz @@RTCNotDetected
pop es
clc ; Got an RTC
retn

@@RTCNotDetected:
pop es
stc
retn ; Failed to detect RTC

InstTimerISR: ; Install a handler on int 08h (IRQ 0/Timer) that makes sure IRQ 2 (cascade) remains unmasked
; Doesn't matter if the timer frequency is increased by another app later
; Save the existing handler
Expand Down

0 comments on commit b149617

Please sign in to comment.