VOGONS

Common searches


First post, by dontbugster

User metadata
Rank Newbie
Rank
Newbie

I was testing new release from ao486 from Mister FPGA which does some OPL3 improvements.
https://github.com/MiSTer-devel/ao486_MiSTer

Author says that can't make doom detect the OPL3, even setting the params:
SET DMXOPTION=-opl3-phase
DOOM.EXE -opl3 -phase

So my question is... what's exactly doing on DMX for OPL3 detection?

Reply 1 of 5, by Never_Again

User metadata
Rank Newbie
Rank
Newbie
signed int FmBoardInstalled()
{
unsigned __int8 v0; // al@1
signed int v1; // ebx@1
unsigned __int8 v2; // al@2
unsigned __int8 v3; // al@2
unsigned __int8 v4; // al@2
unsigned __int8 v5; // al@2
unsigned __int8 v6; // al@2
unsigned __int8 v7; // al@3
unsigned __int8 v8; // bl@3
char v9; // cl@3
signed int type_1; // edx@5
signed int type_2; // ebx@7
unsigned __int8 v12; // al@9
unsigned __int8 v13; // al@10

FmOutPort0(4, 96);
FmOutPort0(4, 128);
v0 = __inbyte(dword_70B70); // inp(Port)
FmOutPort0(2, 255);
v1 = 200;
FmOutPort0(4, 33);
do
{
v2 = __inbyte(dword_70B70);
v3 = __inbyte(dword_70B70);
v4 = __inbyte(dword_70B70);
v5 = __inbyte(dword_70B70);
v1 -= 5;
v6 = __inbyte(dword_70B70);
}
while ( v1 > 0 );
v7 = __inbyte(dword_70B70);
v8 = v7;
FmOutPort0(4, 96);
FmOutPort0(4, 128);
if ( v9 & 0xE0 || (unsigned __int8)(v8 & 0xE0) != 192 )
type_1 = 0;
else
type_1 = 2;
type_2 = type_1;
if ( type_1 )
{
MaxVoices = 9;
if ( DmxOption & 2 )
{
v12 = __inbyte(dword_70B70);
if ( !v12 )
{
v13 = __inbyte(dword_70B70 + 2);
if ( v13 == 255 )
{
MaxVoices = 18;
Opl3 = 1;
type_2 = 3;
}
}
}
}
Show last 2 lines
  return type_2;
}

This is based on disassembly of the Ultimate DOOM exec, the function starts at 0x54224. Before DMXOPTION was introduced the last section used this instead:

if ( inp(Port) != 0x06 )

Reply 2 of 5, by synthop

User metadata
Rank Newbie
Rank
Newbie

AMAZING! I've been trying everything I could think of the last few days. I think the missing key is the last port read on address +2 is expected to return 255. This is not something my code currently does. Thank you!