mbbsemu / MBBSEmu

The MajorBBS Emulation Project is an Open Source, Cross-Platform emulator for easily running The MajorBBS & Worldgroup Modules
https://www.mbbsemu.com
MIT License
129 stars 14 forks source link

[EWEPNT] PHANTASIA - Missing Ordinal 660 #123

Closed dlightman311 closed 3 years ago

dlightman311 commented 3 years ago

Module Information

Describe the bug Module fails to init due to missing ordinal 660.

To Reproduce Steps to reproduce the behavior:

  1. Install module
  2. Run setup.exe to generate datafiles
  3. Configure in modules.json
  4. Start MBBSEmu
  5. See error

Screenshots

Critical Exception has occurred:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'Unknown Exported Function Ordinal in MAJORBBS: 660')
   at MBBSEmu.HostProcess.ExportedModules.Majorbbs.Invoke(UInt16 ordinal, Boolean offsetsOnly)
   at MBBSEmu.HostProcess.ExecutionUnits.ExecutionUnit.ExternalFunctionDelegate(UInt16 ordinal, UInt16 functionOrdinal)
   at MBBSEmu.HostProcess.ExecutionUnits.ExecutionUnit.Execute(IntPtr16 entryPoint, UInt16 channelNumber, Boolean simulateCallFar, Boolean bypassState, Queue`1 initialStackValues, UInt16 initialStackPointer)
   at MBBSEmu.Module.MbbsModule.Execute(IntPtr16 entryPoint, UInt16 channelNumber, Boolean simulateCallFar, Boolean bypassSetState, Queue`1 initialStackValues, UInt16 initialStackPointer)
   at MBBSEmu.HostProcess.MbbsHost.AddModule(MbbsModule module)
   at MBBSEmu.Program.Run(String[] args)

Software Information:

enusbaum commented 3 years ago

Ordinal MAJORBBS.660 is F_LXRSH which is a Borland C++ Macro for performing Left Shift on a Long Value.

The value is stored in DX:AX with CL holding the number of bits to shift. The resulting value is saved back to DX:AX

This is similar to F_LXLSH: https://github.com/enusbaum/MBBSEmu/blob/master/MBBSEmu/HostProcess/ExportedModules/Majorbbs.cs#L4382

enusbaum commented 3 years ago

Macro can be found here: https://github.com/bluewaysw/pcgeos/blob/963612ee4b3733aa5c6b7c439bd85180a4527862/Library/BorlandRTL/h_llsh.asm

enusbaum commented 3 years ago

Fixed in https://github.com/enusbaum/MBBSEmu/commit/3eb6cdc2766ee693a6702fc5f4b9f0b3683a697e