Xell-Reloaded Build Compatible With All Consoles, Including Winchester

  • Thread starter Thread starter alexfree
  • Start date Start date
  • Views Views 7,456
  • Replies Replies 31
  • Likes Likes 7
I managed to get Mupen64-360 running on an Xbox 360 with a Winchester motherboard. Here is an explanation generated by the AI that helped fix it, along with the download link for the corrected XeLL Reloaded and Mupen64-360 files. I haven't even read through the full explanation myself yet, so I'm sharing it as the AI produced it.

This was basically a vibe-coding project with GPT Codex and Claude, and the result appears to be very well done. That said, it took a lot of time, money, and perseverance. I also had to rely heavily on logical reasoning to work out the method, decide what to test, interpret the results, and keep the investigation moving. The AI did much of the coding, but getting to a working result still required a lot of hands-on testing and problem-solving.

I also plan to work on fixing more emulators, so stay tuned.

The investigation and fixes were carried out with the help of GPT Codex and Claude. Both were used to analyze the source code, interpret logs, identify bugs, and develop corrections, while the results were tested directly on the Xbox 360 Winchester.

The problem was not caused by a single incompatibility. It involved the XeLL ELF loader, USB recovery in libxenon, and the disk-mounting code used by Mupen64-360.

In XeLL Reloaded, we first fixed a build-order problem in the alex-free fork. The stage2.elf32.gz target removed object files that were still needed for the Stage 1 link, so the build order had to be adjusted. We also restored the missing rules file required by the toolchain. The most important change was restoring elf.c and elf_run.S from before the ELF loader rewrite in May 2020, while keeping the rest of libxenon modern. With that combination, XeLL finally managed to hand execution over to the recompiled Mupen.

In libxenon, we fixed a null-pointer access in qh_end_transfer() that caused the red crash screen with dar=0x3c. We also found that USB recovery was resetting port 0 instead of the port where the device was actually connected. In our case, the flash drive was on port 4, so recovery could repeatedly reset the wrong port and leave the storage driver stuck in its retry loop. Both reset calls were changed to use the device's actual port. Another fix made ehci_reset_usb_port() return an error after handing a non-high-speed port over to OHCI, preventing the EHCI code from trying to initialize a port it no longer owned. EHCI_TUNE_CERR was also restored from 0 to 3, although that was not the main cause of the problem.

Mupen64-360 was then rebuilt against the corrected libxenon. This required locating, compiling, and installing ZLX-Library, libxemit, and ntfs-xenon. We also had to rebuild and reinstall ZLX after an incomplete library caused linker errors involving symbols such as ZLX::Font, ZLX::Browser, and ZLX::Console.

The ROM-loading freeze turned out to have a separate cause. The flash drive was formatted as FAT directly at sector 0, without an MBR, a layout commonly called superfloppy. ZLX was seeing the 0x55AA signature and interpreting the FAT boot sector as a partition table. That produced invalid LBAs, including 0x7265206B, which initially looked like a USB or SCSI problem. The return address helped trace the issue back to FindPartitions() in mount.cpp.

We corrected the partition detection so that it checks for FAT16 or FAT32 directly at sector 0 before attempting to interpret the sector as an MBR. If a valid FAT filesystem is found there, it is mounted as a partition starting at sector 0. After this correction, the flash drive mounted correctly and ROMs started loading.

There was still a problem when both the flash drive and external HDD were connected. The TinyEHCI driver detected both devices, but ZLX was only mounting one USB interface at a time. We added support for mounting both interfaces and adjusted the order so that the flash drive remains uda0 and the external HDD becomes udb0. This matters because Mupen looks for its installation in uda0:/mupen64-360/. When the HDD was mounted as uda0, Mupen could no longer find the expected files, which caused problems with the background and ROM loading. With the corrected order, the flash drive remains the main device, the HDD is available as additional storage, and a single connected USB device still mounts as uda0.

The final working build is based on Mupen64-360 0.992 beta. Version 0.993 beta2 was also investigated, but it lost video output on the Winchester. From what we observed, it does not appear to have many code differences compared with 0.992 beta, although we did not perform a complete comparison.

I haven't tested the emulator extensively yet, but so far everything appears to be working perfectly. I tested Castlevania and The Legend of Zelda: Ocarina of Time, and both ran successfully. XeLL loads the recompiled Mupen64-360, ROMs work from the flash drive, and the external HDD can remain connected as additional storage.

Thank you for reading!

I updated the download links in my post and added a version with aspect ratio settings in the menu.

Now only in the newer version:
I've updated the download again with several audio, stability, and performance fixes:

  • Audio: Fixed resampler issues, improved audio queue/cache handling, and implemented a packet-based audio queue with a persistent resampler and DMA aligned to 2048-byte blocks.
  • Stability: Fixed texture copying issues and a recompiler heap bug.
  • Performance: Added a small CRC optimization and an ABI3/ENVMIXER3 optimization.
  • Additional changes: Removed the experimental profiler and increased the audio queue headroom from 16 KiB to 32 KiB.
NOTE: Download the latest Mupen64 (xenon.elf) from my most recent post containing an updated attachment, and replace the older file (the one in this post) with it.
 

Attachments

Last edited by fixingthings,
  • Like
Reactions: Vetus_Mundi
Awesome! I will try this out later. Thank you very much!

Could you maybe make it where it doesn't stretch the screen? It's fine for games with widescreen options as well as hacks. Perhaps an option?
 
Last edited by Vetus_Mundi,
Awesome! I will try this out later. Thank you very much!

Could maybe make it where it doesn't stretch the screen? It's fine for widescreen games and hacks. Perhaps an option?
Done! I've updated the download links in my post and added a version with aspect ratio settings in the menu.

Update: I'm still working on the fixes. The aspect ratio adjustment isn't quite right yet. Once I've finished fixing it, I'll come back and edit this post to let you know. The updated download will be available in my previous comment.
 
Last edited by fixingthings,
Awesome, thank you again. Do you have any plans to possibly update the core in the future?

If you do update and use not64 as a base, I should let you know that after the last 2019 version of not64, certain SM64 hacks on longer work, so if you decide to port any of them I would recommend that specific version, though sadly it would lack fixes for games in later versions.

Is there a way to remap buttons? I would like to map N64 B button to Xbox 360 X button. As far as I can tell there isn't a way to remap. Would you mind adding an option? I apologize if I am asking too much and if so, please let me know.

One thing I like better about this port of Mupen64 over the Wii and GC ports is the dynamic recompiler. I will explain:
There is a tool to inject N64 ar/gameshark codes into N64 roms. I use a walk through walls code for OOT 1.2.

It is temporarily activated by holding the A button. To get this code to work as intended some emulators/ports require the interpreter core to recompile the newly changed code. It can work on the dynamic recompiler on wii64 and not64 but the A button needs to be held most of the time until in-game. Unfortunately though it will stay active unless a save state is created and the game is reloaded without the A button being held or by switching to the interpreter core.
 
Last edited by Vetus_Mundi,
Awesome, thank you again. Do you have any plans to possibly update the core in the future?

If you do update and use not64 as a base, I should let you know that after the last 2019 version of not64, certain SM64 hacks on longer work, so if you decide to port any of them I would recommend that specific version, though sadly it would lack fixes for games in later versions.

Is there a way to remap buttons? I would like to map N64 B button to Xbox 360 X button. As far as I can tell there isn't a way to remap. Would you mind adding an option? I apologize if I am asking too much and if so, please let me know.

One thing I like better about this port of Mupen64 over the Wii and GC ports is the dynamic recompiler. I will explain:
There is a tool to inject N64 ar/gameshark codes into N64 roms. Some years ago I made a walk through walls code for OOT 1.2. I am not the first though.

Anyway, it is temporally activated by holding the A button. To get this code to work as intended some emulators/ports require the interpreter core to recompile the newly changed code. It can work on the dynamic recompiler on wii64 and not64 but the A button needs to be held most of the time until in-game. Unfortunate though it will stay active unless a save state is created and the game is reloaded without the A button being held or by switching to the interpreter core.
I don't have any plans for that at the moment. I've updated the download link (wait for the admins to approve it) with some new audio, stability, and performance patches. I plan to keep improving the emulator and will probably try to bring dulldc to XeLL on Winchester as well. Tomorrow, I'll try to add a button-mapping option. Stay tuned.
 
  • Like
Reactions: Vetus_Mundi
I don't have any plans for that at the moment. I've updated the download link (wait for the admins to approve it) with some new audio, stability, and performance patches. I plan to keep improving the emulator and will probably try to bring dulldc to XeLL on Winchester as well. Tomorrow, I'll try to add a button-mapping option. Stay tuned.

Great! Thank you again!

Speaking of nulldc, are you planning on adding the updates from the recent Wii port?

(Edit: Now I see the post and the attachment.:))

Edit 2: I noticed the dialog text on Ocarina of Time is now a bit blurrier. Was the framebuffer textures option enabled?
 
Last edited by Vetus_Mundi,
Great! Thank you again!

Speaking of nulldc, are you planning on adding the updates from the recent Wii port?

(Edit: Now I see the post and the attachment.:))

Edit 2: I noticed the dialog text on Ocarina of Time is now a bit blurrier. Was the framebuffer textures option enabled?
I’m going to replace the version in the original post with an earlier version from before my new fixes, as they apparently caused some issues. Please wait for the new download to be available in the original post. Unfortunately, I haven’t been able to remap the buttons yet.
 
  • Like
Reactions: Vetus_Mundi
I’m going to replace the version in the original post with an earlier version from before my new fixes, as they apparently caused some issues. Please wait for the new download to be available in the original post. Unfortunately, I haven’t been able to remap the buttons yet.

I have all three versions that you posted. I will probably go back to the second build until the update.

I am not sure if the blurrier textures is an issue as in an emulation issue or not. To be honest I should not have asked about the framebuffer textures being enabled because the subscreen pause in OOT would render mostly correct it it were enabled. I know they aren't enabled. My apologies.

Anyway thank you again.
 
  • Like
Reactions: fixingthings
I have all three versions that you posted. I will probably go back to the second build until the update.

I am not sure if the blurrier textures is an issue as in an emulation issue or not. To be honest I should not have asked about the framebuffer textures being enabled because the subscreen pause in OOT would render mostly correct it it were enabled. I know they aren't enabled. My apologies.

Anyway thank you again.
I think I managed to get the button remapper working. This time, I’ll try posting updates separately from the original post so I don’t end up replacing stable versions with problematic ones. Let me know if it works on your end. Also, check whether the text is still blurry (I didn’t quite understand your last comment about that). I’ve been playing OOT too, and I haven’t really noticed that issue.

Also, I think you noticed that the 4:3 aspect ratio isn’t quite perfect in OOT, at least on my end. I haven’t managed to fix it yet. For now, I’m trying to manage my coding AI tokens more efficiently. Looking forward to your feedback.

  • Audio: Fixed resampler issues, improved audio queue/cache handling, and implemented a packet-based audio queue with a persistent resampler and DMA aligned to 2048-byte blocks.
  • Stability: Fixed texture copying issues and a recompiler heap bug.
  • Performance: Added a small CRC optimization and an ABI3/ENVMIXER3 optimization.
  • Additional changes: Added controller remapping and increased the audio queue headroom from 16 KiB to 32 KiB.

    This is my latest version of Mupen64 for Xbox 360. If a newer version becomes available, I'll edit this post to let you know.
 

Attachments

Last edited by fixingthings,
  • Like
Reactions: Vetus_Mundi
Using the FB textures option on older versions of wii64 and probably not64 made games look blurrier but that was resolved in later versions of not64 at least.

To me the text (dialog text) looks blurry on the third version. I do not have a capture card so I can't capture clean screenshots of it.

Update:
The control mapping works good and it saves. I forgot to check the text clarity though. I will after I have tried the older version again.

Update 2: Please ignore what I posted about input lag. This version seems the same or about the same as the other versions and I think the older versions too from years ago. Also, the text looks cleaner to me on this build.

Speaking of the 4:3 option, it may not be perfect, but it's much better than the image being stretched all the way across the screen.

Thank you again. I really appreciate the options I requested being implemented. Will this version work on other motherboards?
 
Last edited by Vetus_Mundi,
  • Like
Reactions: fixingthings
Using the FB textures option on older versions of wii64 and probably not64 made games look blurrier but that was resolved in later versions of not64 at least.

To me the text (dialog text) looks blurry on the third version. I do not have a capture card so I can't capture clean screenshots of it.

Update:
The control mapping works good and it saves. I forgot to check the text clarity though. I will after I have tried the older version again.

Update 2: Please ignore what I posted about input lag. This version seems the same or about the same as the other versions and I think the older versions too from years ago. Also, the text looks cleaner to me on this build.

Speaking of the 4:3 option, it may not be perfect, but it's much better than the image being stretched all the way across the screen.

Thank you again. I really appreciate the options I requested being implemented. Will this version work on other motherboards?
Unfortunately, I don't have another Xbox 360 with a motherboard other than Winchester to test it on, but I bet it would work on other motherboard revisions.

Edit: Please keep the feedback coming, as it's helping me fix issues I hadn't noticed. Thanks for your attention!

Edit2: I'm doing my best to optimize the emulator, considering that, if I'm not mistaken, it's been 13 years since the last Mupen version. I think today's AI coding tools have a good chance of improving the emulator's performance, so I'll keep trying. My main focus right now is improving smoothness in OOT.
 
  • Like
Reactions: Vetus_Mundi
Unfortunately, I don't have another Xbox 360 with a motherboard other than Winchester to test it on, but I bet it would work on other motherboard revisions.

Edit: Please keep the feedback coming, as it's helping me fix issues I hadn't noticed. Thanks for your attention!

Edit2: I'm doing my best to optimize the emulator, considering that, if I'm not mistaken, it's been 13 years since the last Mupen version. I think today's AI coding tools have a good chance of improving the emulator's performance, so I'll keep trying. My main focus right now is improving smoothness in OOT.
I would like to thank you as well.

I do have another Xbox 360 console. It is a Falcon (v3). I don't use it much anymore as I have semi-retired it and mainly use my Winchester as it's newer, quieter and runs cooler than the Falcon.

I might test these builds out later on my Falcon but at the moment I don't feel like hooking it up. However if another person wants to test them out I think that would be great.

If xell had hardware accelerated video it would dramatically improve the performance. If I am correct the OpenXDK for Xbox 360 also lacks hardware accelerated video.

I noticed the ppsspp port is using the native default.xex format while mupen64 and nulldc use xell.
It's a shame they weren't updated to run in the standard format. This would have allowed them to run on all motherboard without issue.
 
Last edited by Vetus_Mundi,
  • Like
Reactions: fixingthings

Site & Scene News

Popular threads in this forum