Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

The Monolithic XBOX 360 (XBLIG) Thread #3

Open
0x0ade opened this issue Oct 20, 2017 · 16 comments
Open

The Monolithic XBOX 360 (XBLIG) Thread #3

0x0ade opened this issue Oct 20, 2017 · 16 comments

Comments

@0x0ade
Copy link
Owner

0x0ade commented Oct 20, 2017

This is where we dump bugs, stack traces and discuss anything that prevents us from booting (or even running) XBLIG games using XnaToFna. Both "code-" and content-related issues belong here.

Enhancement ideas are welcome, too!

Right now, Iced Lizard Games donated a few of their XBLIG titles, containing both XNA 4.0 and XNA 3.1 games. Again, thank you!

XNA 3.1 titles will depend on the "timemachine" branch (which will be merged into master once it's done... that is, if it will be ever done, given the previous bad experience with it).

XNA 4.0 titles "boot," but they fail doing anything useful as the content formats changed between the X360 and PC targets. This was already expected, but I still don't know to which extent / how exactly the formats differ.

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 20, 2017

Got one of Iced Lizard Games' games booting using XnaToFna + the Windows content:

https://twitter.com/0x0ade/status/921486706334937088

Screenshot

I still need to figure out all differences between the X360 and Windows content formats and to start working on the converters, but this is already a milestone in itself.

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 22, 2017

cf99acf takes care of X360 global settings and wave banks, also adding "support" for XMA2 based on the existing XWMA feeder. It creates a technically incorrect extended header but ffmpeg doesn't complain... yet.

Fixing sound banks is the next step.

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 22, 2017

"Death vs. The IRS" boots now using just XnaToFna to convert the content... but it has got some rendering issues:

Screenshot

Tweet: https://twitter.com/0x0ade/status/922228083108835328

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 23, 2017

Had to fix the variation handling:

ushort count;
ushort flags;
if (platform == 1) {
count = SwapEndian(x360, reader.ReadUInt16());
flags = SwapEndian(x360, reader.ReadUInt16());
} else {
flags = SwapEndian(x360, reader.ReadUInt16());
count = SwapEndian(x360, reader.ReadUInt16());
}
writer.Write(count);
writer.Write(flags);

I don't know if platform or endianness affects this (they're two separate values for us but who knows how XACT actually sees this). platform seems to always be 1 for PC anyway.

EDIT: It really seems to be one u32, not two u16. https://twitter.com/fesh0r/status/922586589796081664

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 24, 2017

X360 texture support has been merged into FNA: FNA-XNA/FNA@2c4121c

I got "Amazing Princess Sarah" to boot using FNA, unfortunately using hacks to get the SoundEffectReader to read the big endian values. Sounds don't play as the game uses XMA2 for its sound effects (format == 0x0166).

I already wiped those changes from existence as that's too hacky. Instead, I see the following ways to progress:

  • XnaToFna reads any .xnb content using something similar to the FNA ContentReader. It'll heavily rely on reflection magic as XnaToFna could otherwise destroy any "unknown" data.
    • Pro: It's more in line with what XnaToFna currently does: Transform any "incompatible" content into a compatible format.
    • Con: We're running the game's code outside of the game.
  • New FNA extension allowing games to offer a "unknown audio format processor," using ffmpeg if available by default.
    • Pro: Way easier to set up.
    • Con: ffmpeg C# wrappers / bindings do exist, but it's effectively adding an optional dependency to FNA. Depending on ffmpeg as a "process" and not as a "library" is quite dirty (process overhead, platform limitations).

I don't want to "clutter" FNA with XnaToFna-only features. XnaToFna should do the heavy lifting.
Yet on the other hand, ffmpeg "support" for FNA could help with making FNA support wma and wmv, but the way I'm planning it to do is too hacky (converting from wma / wmv to ogg / ogv at runtime) and it'll only find usage in XnaToFna.

I'll sleep on it and decide on how to progress tomorrow.

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 24, 2017

@flibitijibibo What do you think is the best option here? Making XnaToFna deal with the game's content (risking issues with how XnaToFna should deal with content type readers)? Or offering a way for games (or anything sitting in between) to deal with unknown audio formats via an FNA extension / making FNA optionally depend on ffmpeg (which may only get used with XnaToFna anyway)?

@flibitijibibo
Copy link
Collaborator

Because of the ffmpeg license and bulkiness of the library in general I would keep that kind of stuff in XnaToFna.

Long-term, we need to figure out how to decode xWMA and possibly XMA without using GPL sources and add it to FACT. Support is wayyyy overdue and sidestepping it is by far the biggest headache for XNA devs (even bigger than threaded GL, which is saying something).

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 25, 2017

It seems like effects are affected by the endianness swap, too:
image

MojoShader expects 0xbcf00bcf while effectCode effectively contains 0xcf0bf0bc.

... although honestly, I completely forgot about X360 effects...

@flibitijibibo
Copy link
Collaborator

My guess is it's going to be a problem through the entire shader. Additionally you have to worry about vfetch instancing:

https://blogs.msdn.microsoft.com/shawnhar/2010/06/17/drawinstancedprimitives-in-xna-game-studio-4-0/

It's possible the vfetch instruction could just be turned into gl_InstanceID but good luck doing all the swapping throughout the parser. SWAPXX will only get you so far:

https://github.com/flibitijibibo/MojoShader/blob/f895e060b62ebb28dbb4dda32176c20ee82abb58/mojoshader_internal.h#L155

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 26, 2017

4b79f57 adds a XNB content handler, which is implemented in actually not the worst way possible. Short explanation:

  • Load the game assemblies after patching them.
    • Also set up AppDomain.CurrentDomain.AssemblyResolve to return the assemblies when looking them up based on their simple name only.
  • Start a FNA "game" to set up a working environment.
  • Use MonoMod.Detour to hook...
    • ContentManager.GetContentReaderFromXnb to set up the output stream in the CopyingStream and to write a basic XNB header.
    • ContentReader..ctor to wrap the passed stream in a CopyingStream.
  • Set up ContentTypeReaderManager.typeCreators to use EffectTransformer (currently bypasses effect loads) and SoundEffectTransformer instead of FNA's EffectReader and SoundEffectReader.
  • Game.Content.Load<object> every XNB

This seems to work surprisingly well! I initially thought about creating a custom ContentTransformer based on the ContentReader, but that'd just reinvent the wheel... and would introduce issues with the game's ContentTypeReaders.

The SoundEffectTransformer fixes any endianness issues if platform == 'x' and currently converts XMA2 to PCM if format == 0x0166 (I still need to setup a xWMA sound effect "feeder"). It wraps the existing data in a RIFF container and passes it on to ffmpeg.

The only issue right now is a "clicking" noise at the start of every sound (in the game I'm testing this with), but other than that, it seems to work just fine.

This is effectively the last thing I wanted to get working before the weekend.

@0x0ade
Copy link
Owner Author

0x0ade commented Oct 26, 2017

Although not strictly X360-related, I made XnaToFna "man-in-the-middle" GraphicsDeviceManager.ApplyChanges, checking for the following environment variables:

  • XNATOFNA_DISPLAY_FULLSCREEN (can be either 0 or 1 to force-disable / force-enable fullscreen).
  • XNATOFNA_DISPLAY_WIDTH
  • XNATOFNA_DISPLAY_HEIGHT
  • XNATOFNA_DISPLAY_SIZE (format: WxH, f.e. 1600x900)

This allows me to finally fit "Amazing Princess Sarah" X360 on a monitor smaller than 1080p.

image

@hardcaz
Copy link

hardcaz commented May 9, 2022

is there a way to check what version of xna a game is using?

@joojoooo
Copy link

Trying to get "Amazing Princess Sarah" Xbox 360 indie or any indie to work on Windows 10, can anyone help? No idea what I'm doing wrong.

I downloaded latest prebuilt release from this repo and following the release notes added ffmpeg.exe and fnalibs (dead links, downloaded with wayback machine)

I extract the game with Horizon:

Then put it in the folder previously prepared and run XnaToFna.exe in PowerShell:

PowerShell log:
C:\Users\gioia\Downloads\XNAtoFNA> .\XnaToFna.exe
[XnaToFna] [Version] 18.5.0.42592
[XnaToFna] [ScanPath] Scanning directory C:\Users\gioia\Downloads\XNAtoFNA
[XnaToFna] [ScanPath] Found Content directory: C:\Users\gioia\Downloads\XNAtoFNA\Content
[XnaToFna] [ScanPath] Checking assembly AmazingPrincessSarah (rw)
[XnaToFna] [ScanPath] XnaToFna-ing AmazingPrincessSarah
[XnaToFna] [ScanPath] Checking assembly FNA (r-)
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Avatar -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Content.Pipeline -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Game -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Graphics -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Input.Touch -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Storage -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Video -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Xact -> FNA
[XnaToFna] [ScanPath] Checking assembly Mono.Cecil (rw)
[XnaToFna] [ScanPath] WARNING: Cannot load assembly: System.IO.IOException: The process cannot access the file 'C:\Users\gioia\Downloads\XNAtoFNA\Mono.Cecil.dll' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
   at MonoMod.Utils.MonoModExt.ReadModule(String path, ReaderParameters rp) in D:\Repos\XnaToFna\lib-projs\MonoMod\MonoMod.Utils\MonoModExt.cs:line 45
   at XnaToFna.XnaToFnaUtil.ScanPath(String path) in D:\Repos\XnaToFna\src\XnaToFnaUtil.cs:line 258
[XnaToFna] [ScanPath] Checking assembly Mono.Cecil.Mdb (rw)
[XnaToFna] [ScanPath] Checking assembly Mono.Cecil.Pdb (rw)
[XnaToFna] [ScanPath] Checking assembly Mono.Cecil.Rocks (rw)
[XnaToFna] [ScanPath] Checking assembly MonoMod (rw)
[XnaToFna] [ScanPath] WARNING: Cannot load assembly: System.IO.IOException: The process cannot access the file 'C:\Users\gioia\Downloads\XNAtoFNA\MonoMod.exe' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
   at MonoMod.Utils.MonoModExt.ReadModule(String path, ReaderParameters rp) in D:\Repos\XnaToFna\lib-projs\MonoMod\MonoMod.Utils\MonoModExt.cs:line 45
   at XnaToFna.XnaToFnaUtil.ScanPath(String path) in D:\Repos\XnaToFna\src\XnaToFnaUtil.cs:line 258
[XnaToFna] [ScanPath] Checking assembly MonoMod.RuntimeDetour (rw)
[XnaToFna] [ScanPath] WARNING: Cannot load assembly: System.IO.IOException: The process cannot access the file 'C:\Users\gioia\Downloads\XNAtoFNA\MonoMod.RuntimeDetour.dll' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
   at MonoMod.Utils.MonoModExt.ReadModule(String path, ReaderParameters rp) in D:\Repos\XnaToFna\lib-projs\MonoMod\MonoMod.Utils\MonoModExt.cs:line 45
   at XnaToFna.XnaToFnaUtil.ScanPath(String path) in D:\Repos\XnaToFna\src\XnaToFnaUtil.cs:line 258
[XnaToFna] [ScanPath] Checking assembly MonoMod.Utils (rw)
[XnaToFna] [ScanPath] WARNING: Cannot load assembly: System.IO.IOException: The process cannot access the file 'C:\Users\gioia\Downloads\XNAtoFNA\MonoMod.Utils.dll' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
   at MonoMod.Utils.MonoModExt.ReadModule(String path, ReaderParameters rp) in D:\Repos\XnaToFna\lib-projs\MonoMod\MonoMod.Utils\MonoModExt.cs:line 45
   at XnaToFna.XnaToFnaUtil.ScanPath(String path) in D:\Repos\XnaToFna\src\XnaToFnaUtil.cs:line 258
[XnaToFna] [ScanPath] Checking assembly XnaToFna (r-)
[XnaToFna] [OrderModules] Unordered:
[XnaToFna] [OrderModules] #1: AmazingPrincessSarah
[XnaToFna] [OrderModules] #2: FNA
[XnaToFna] [OrderModules] #3: XnaToFna
[XnaToFna] [OrderModules] Reordered:
[XnaToFna] [OrderModules] #1: AmazingPrincessSarah
[XnaToFna] [OrderModules] #2: FNA
[XnaToFna] [OrderModules] #3: XnaToFna
[XnaToFna] [Relink] Relinking AmazingPrincessSarah
[XnaToFna] [Relink] Updating dependencies
[XnaToFna] [Relink] Replacing dependency Microsoft.Xna.Framework.Game -> FNA
[XnaToFna] [Relink] Adding dependency XnaToFna
[XnaToFna] [Relink] Updating module attributes
[XnaToFna] [Relink] Mapping dependencies for MonoMod
[XnaToFna] [MonoMod] Cannot map dependency AmazingPrincessSarah.exe -> ((Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553), (Microsoft.Xna.Framework.GamerServices)) - not found
[XnaToFna] [Relink] Pre-processing
[XnaToFna] [Relink] Relinking (MonoMod PatchRefs pass)
[XnaToFna] [Relink] Post-processing
[XnaToFna] [PostProcess] Found type overriding Game: AmazingPrincessSarah.MainPRG)
[XnaToFna] [PostProcess] Injecting call to XnaToFnaHelper.PreUpdate into game Update
[XnaToFna] [Relink] Injecting XnaToFna entry point hook
[XnaToFna] [Relink] Rewriting and disposing module

OpenAL not found! Need FNA.dll.config?

Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'soft_oal.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at Microsoft.Xna.Framework.SDL2_FNAPlatform.CreateALDevice()
   at Microsoft.Xna.Framework.Audio.AudioDevice.Initialize()
   at Microsoft.Xna.Framework.FrameworkDispatcher.Update()
   at Microsoft.Xna.Framework.Game..ctor()
   at XnaToFna.ContentHelperGame..ctor() in D:\Repos\XnaToFna\src\Content\ContentHelperGame.cs:line 26
   at XnaToFna.XnaToFnaUtil.UpdateContent() in D:\Repos\XnaToFna\src\XnaToFnaUtil.cs:line 549
   at XnaToFna.Program.Main(String[] args) in D:\Repos\XnaToFna\src\Program.cs:line 130

What should I do? Thx

@bruh-joseph
Copy link

sup trying to port city tuesday with this
getting this weird azz error
C:\Users\bruh johnson\Desktop\City TuesdayXNA\584E07D1>XnaToFna.exe
[XnaToFna] [Version] 18.5.0.42592
[XnaToFna] [ScanPath] Scanning directory C:\Users\bruh johnson\Desktop\City TuesdayXNA\584E07D1
[XnaToFna] [ScanPath] Found Content directory: C:\Users\bruh johnson\Desktop\City TuesdayXNA\584E07D1\Content
[XnaToFna] [ScanPath] Checking assembly CityTuesday (rw)
[XnaToFna] [ScanPath] XnaToFna-ing CityTuesday
[XnaToFna] [ScanPath] Checking assembly EasyStorage (rw)
[XnaToFna] [ScanPath] XnaToFna-ing EasyStorage
[XnaToFna] [ScanPath] Checking assembly fbDeprofiler (rw)
[XnaToFna] [ScanPath] Checking assembly FNA (r-)
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Avatar -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Content.Pipeline -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Game -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Graphics -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Input.Touch -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Storage -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Video -> FNA
[XnaToFna] [ScanPath] Mapping Microsoft.Xna.Framework.Xact -> FNA
[XnaToFna] [ScanPath] Checking assembly Mono.Cecil (rw)
[XnaToFna] [ScanPath] WARNING: Cannot load assembly: System.IO.IOException: The process cannot access the file 'C:\Users\bruh johnson\Desktop\City TuesdayXNA\584E07D1\Mono.Cecil.dll' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at MonoMod.Utils.MonoModExt.ReadModule(String path, ReaderParameters rp) in D:\Repos\XnaToFna\lib-projs\MonoMod\MonoMod.Utils\MonoModExt.cs:line 45
at XnaToFna.XnaToFnaUtil.ScanPath(String path)
[XnaToFna] [ScanPath] Checking assembly Mono.Cecil.Mdb (rw)
[XnaToFna] [ScanPath] Checking assembly Mono.Cecil.Pdb (rw)
[XnaToFna] [ScanPath] WARNING: Cannot load assembly: System.IO.IOException: The process cannot access the file 'C:\Users\bruh johnson\Desktop\City TuesdayXNA\584E07D1\Mono.Cecil.Pdb.dll' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at MonoMod.Utils.MonoModExt.ReadModule(String path, ReaderParameters rp) in D:\Repos\XnaToFna\lib-projs\MonoMod\MonoMod.Utils\MonoModExt.cs:line 45
at XnaToFna.XnaToFnaUtil.ScanPath(String path)
[XnaToFna] [ScanPath] Checking assembly Mono.Cecil.Rocks (rw)
[XnaToFna] [ScanPath] Checking assembly MonoMod (rw)
[XnaToFna] [ScanPath] WARNING: Cannot load assembly: System.IO.IOException: The process cannot access the file 'C:\Users\bruh johnson\Desktop\City TuesdayXNA\584E07D1\MonoMod.exe' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at MonoMod.Utils.MonoModExt.ReadModule(String path, ReaderParameters rp) in D:\Repos\XnaToFna\lib-projs\MonoMod\MonoMod.Utils\MonoModExt.cs:line 45
at XnaToFna.XnaToFnaUtil.ScanPath(String path)
[XnaToFna] [ScanPath] Checking assembly MonoMod.RuntimeDetour (rw)
[XnaToFna] [ScanPath] WARNING: Cannot load assembly: System.IO.IOException: The process cannot access the file 'C:\Users\bruh johnson\Desktop\City TuesdayXNA\584E07D1\MonoMod.RuntimeDetour.dll' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at MonoMod.Utils.MonoModExt.ReadModule(String path, ReaderParameters rp) in D:\Repos\XnaToFna\lib-projs\MonoMod\MonoMod.Utils\MonoModExt.cs:line 45
at XnaToFna.XnaToFnaUtil.ScanPath(String path)
[XnaToFna] [ScanPath] Checking assembly MonoMod.Utils (rw)
[XnaToFna] [ScanPath] WARNING: Cannot load assembly: System.IO.IOException: The process cannot access the file 'C:\Users\bruh johnson\Desktop\City TuesdayXNA\584E07D1\MonoMod.Utils.dll' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at MonoMod.Utils.MonoModExt.ReadModule(String path, ReaderParameters rp) in D:\Repos\XnaToFna\lib-projs\MonoMod\MonoMod.Utils\MonoModExt.cs:line 45
at XnaToFna.XnaToFnaUtil.ScanPath(String path)
[XnaToFna] [ScanPath] Checking assembly SharedXML (rw)
[XnaToFna] [ScanPath] Checking assembly XnaToFna (r-)
[XnaToFna] [OrderModules] Unordered:
[XnaToFna] [OrderModules] #1: CityTuesday
[XnaToFna] [OrderModules] #2: EasyStorage
[XnaToFna] [OrderModules] #3: FNA
[XnaToFna] [OrderModules] #4: XnaToFna
[XnaToFna] [OrderModules] Reordering CityTuesday dependency FNA.dll
[XnaToFna] [OrderModules] Reordering CityTuesday dependency XnaToFna.exe
[XnaToFna] [OrderModules] Reordering EasyStorage dependency FNA.dll
[XnaToFna] [OrderModules] Reordering EasyStorage dependency XnaToFna.exe
[XnaToFna] [OrderModules] Reordered:
[XnaToFna] [OrderModules] #1: FNA
[XnaToFna] [OrderModules] #2: XnaToFna
[XnaToFna] [OrderModules] #3: EasyStorage
[XnaToFna] [OrderModules] #4: CityTuesday
[XnaToFna] [Relink] Relinking EasyStorage
[XnaToFna] [Relink] Updating dependencies
[XnaToFna] [Relink] Updating module attributes
[XnaToFna] [Relink] Mapping dependencies for MonoMod
[XnaToFna] [MonoMod] Cannot map dependency EasyStorage.dll -> ((Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553), (Microsoft.Xna.Framework.GamerServices)) - not found
[XnaToFna] [Relink] Pre-processing
[XnaToFna] [Relink] Relinking (MonoMod PatchRefs pass)
[XnaToFna] [Relink] Post-processing
[XnaToFna] [Relink] Rewriting and disposing module

[XnaToFna] [Relink] Relinking CityTuesday
[XnaToFna] [Relink] Updating dependencies
[XnaToFna] [Relink] Updating module attributes
[XnaToFna] [Relink] Mapping dependencies for MonoMod
[XnaToFna] [MonoMod] Cannot map dependency CityTuesday.exe -> ((Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553), (Microsoft.Xna.Framework.GamerServices)) - not found
[XnaToFna] [Relink] Pre-processing
[XnaToFna] [Relink] Relinking (MonoMod PatchRefs pass)

Unhandled Exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
at Mono.Collections.Generic.Collection`1.get_Item(Int32 index)
at MonoMod.MonoModder.PatchRefsInMethod(MethodDefinition method) in D:\Repos\XnaToFna\lib-projs\MonoMod\MonoMod\MonoModder.cs:line 1804
at MonoMod.MonoModder.PatchRefsInType(TypeDefinition type) in D:\Repos\XnaToFna\lib-projs\MonoMod\MonoMod\MonoModder.cs:line 1725
at MonoMod.MonoModder.PatchRefs() in D:\Repos\XnaToFna\lib-projs\MonoMod\MonoMod\MonoModder.cs:line 1592
at XnaToFna.XnaToFnaUtil.Relink(ModuleDefinition mod)
at XnaToFna.XnaToFnaUtil.RelinkAll()
at XnaToFna.Program.Main(String[] args)

@ViperAcidZX
Copy link

Is there any way to get Ancient's Protect Me Knight! (まもって騎士) working through porting it to FNA? I have no idea how to code or program and ran into these problems with the log I got in the attached log.

log.txt

@mekael
Copy link

mekael commented Jan 16, 2024

Is there any way to get Ancient's Protect Me Knight! (まもって騎士) working through porting it to FNA? I have no idea how to code or program and ran into these problems with the log I got in the attached log.

log.txt

Surprisingly I was working on this yesterday. drop me a line at Mekael-ohanigan@proton.me

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

7 participants