This is implementation of original Roland MPU 401
interface card based on card's manual.
Due to architectural limitations of dosbox, interrupt
request buffering and similar techniques had to be used
to simulate behavior of real MPU 401. As a result, this
emulation has somewhat limited functionality when
compared to a real device.
Some minor modifications of dosbox's interrupt
controller code also had to be done, as well as mpu
configuration. Archive includes patch for those changes
and should be applied to dosbox 0.61. MPU-401 emulation
is in mpu401.cpp file in archive which should replace
old mpu401.cpp in dosbox source.
Emulation was successfully tested with following games
(using canadacow's latest MT-32 emulator as midi device):
Curse of Enchantia
Innocent until Caught
David Wolf (1990, Dynamix)
Ecargxus (Demo by TPC)
If you can find any other games or applications that
use this hardware in intelligent mode, please post it
here or let me know.
Program that use MPU commands other than 3F and FF,
or which reset device and than give-up using it, are
most likely using intelligent mode.
MPU-401 emulation files (+small fix)
update and fix for some glitch issues
Logged In: YES
user_id=535630
Hi Srecko,
I took at glance at your emulator.
I don't really agree on the proposed changes in pic.cpp
Are you certain that the mpu has irq 2 ?
We can discuss this futher if the mpu has to be on irq 2.
(as then I have to reread the pic schematics:) else we have
to think of a different irq ;)
Thanks in advance,
Peter
Logged In: YES
user_id=624122
Hi,
I checked; Laser Squad and Curse of enchantia only run with
mpu-401 on irq 2. Further, games' interrupt service routines
don't deactivate IRQ, as if they expect for MPU-401 to do so
(or want auto_eoi to be on ?). So I had to do edit edit a
bit in pic.cpp and with that all irq problems disappeared:)
This has effect on almost any game that uses intelligent
mode. But some of them work even without the pic changes, I
think because irq 0 and 1 still do the job (higher priority).
Btw. why is irq 2 disabled in pic code ?
Problem with MPU-401 is that it can request more data at
once (it has 8 tracks and when track counter is 0 it
requests data by calling IRQ for that track). Some games
have slowdowns because of this and not much can be done to
prevent that.
I still have to look at "legend entertainment" games which
send undocumented commands and data strings to mpu-401
(when I'll have enough time for that).
Logged In: YES
user_id=535630
well a pic has 8 lines in and if one of the lines goes up
the outline goes up as well (while considering the priorities)
A pc has two pics. one pic(2) (irq 8-15) has an outline
which is connected to the line in number 2 (irq 2) in pic 1:
the ouline of that irq (0-7) is connected to cpu and signals
for irq's
So in our opinion irq can not be used as it's connected to
pic and not the hardware (On modern systems this isn't true
anymore)
(So an irq 2 means that there is an irq to be handled in the
second pic so (8-15)
Logged In: YES
user_id=624122
The MPU-401 manual says that Data Set Ready output of status
port is usually connected to host's interrupt input( DSR is
set when data is to be sent to host). Maybe device could run
interrupts directly (i.e interrupt A), without PIC (I'm only
guessing; i don't know if that could be done)
Games mostly use only "irq 2". I even found in a manual of
one offering more options that default irq for mpu-401 is 2.
Logged In: YES
user_id=535630
Hi Srecko,
well It seems somehow that irq2 is rerouted to irq 9
which irq handler calls the handler of irq2
I need some time to really understand this info and make it
into dosbox. I think it's wise to continue our conversation
by email.
Grtz Peter
new interrupt code,cleanups
Logged In: YES
user_id=624122
I uploaded a new version. Much was modified to use new
interrupt handler and request buffer is replaced with
simpler mask word. New pic modifications are also included
in patch.
I've run out of ideas for problems that still exist:
1. Playback speed is bit slow with some games but normal
with others.
2. Legend Entertainment games do play something but sounds
very weird compared to adlib output.
3. Ecargxus demo likes to unset IF flag, causing delays
(especially when scrolling).
4. Some games experience slowdowns when much data is being
sent. I couldn't find a cause.
5. Implementation of "request to send data" command is not
compatible with some games using UART mode, while otherwise
a game wouldn't work with it modified (I learned that
yesterday). For that reason "intelligent" variable in
dosbox.conf will be set to false by default and mpu-401 will
work in simple uart mode.
Logged In: YES
user_id=535630
mpu401 doesn't want to compile.
I emailed you the exact responses
fixed compilation error and increased default tempo
Logged In: YES
user_id=535630
Okay commit it all.