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
132 stars 14 forks source link

[CHRGLOB] Bud Globals - Crash on Initilization #99

Closed tuday2 closed 4 years ago

tuday2 commented 4 years ago

Module Information

Describe the bug Fails to initialize

To Reproduce Steps to reproduce the behavior:

  1. Add to modules.json
  2. MBBSEMU fails to load module
  3. Example of module where .DAT files do not autogenerate, had to create all 4 dat files manually from .VIR (CHRGLOB, CHRMACRO, CHRRCNT, CHRUGRAM)

Expected behavior Module loads

Screenshots

Critical Exception has occurred:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'Unknown Exported Function Ordinal in MAJORBBS: 157')
   at MBBSEmu.HostProcess.ExportedModules.Majorbbs.Invoke(UInt16 ordinal, Boolean offsetsOnly)
   at MBBSEmu.HostProcess.ExecutionUnits.ExecutionUnit.ExternalFunctionDelegate(UInt16 ordinal, UInt16 functionOrdinal)
   at MBBSEmu.CPU.CpuCore.Tick()
   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 4 years ago

Couple issues here:

  1. There IS code in place that should handle the Btrieve .VIR -> .DAT copying, but it's not firing apparently. We'll need to figure out what's going on there.

https://github.com/enusbaum/MBBSEmu/blob/master/MBBSEmu/Btrieve/BtrieveFileProcessor.cs#L104

  1. Ordinal MAJORBBS.157 is DCDATE which takes in a string date value and returns a packed/encoded int version of the date. The opposite process of MAJORBBS.428 which is NCDATE
tuday2 commented 4 years ago
  1. There IS code in place that should handle the Btrieve .VIR -> .DAT copying, but it's not firing apparently. We'll need to figure out what's going on there.

https://github.com/enusbaum/MBBSEmu/blob/master/MBBSEmu/Btrieve/BtrieveFileProcessor.cs#L104

Ok, this part is fixed with PR #120