Open Cee123 opened 5 years ago
Bounty posted to fix issues with this core - $250 https://www.bountysource.com/issues/76219168-list-of-games-with-issues
Speaking of, I was going to teach myself how to do Atari Jaguar code a few days ago. I will try to help with this, maybe I can get to a point.
Nice. Hoping someone can pick this up again, seems a bit broken in its current state.
Most of these issues (if not all) apply to the standalone emulator which hasn't been updated since 2014 IIRC. So they are not exclusive libretro core issues.
Also, the latest standalone version is 2.1.3 while the RetroArch core seems to be based on the older 2.1.0 version from 2013. Though, i don't think there's a huge difference in compatibility or if any new fixes exist for the core exclusively since then.
Oh and btw, there is a "DOOM Res hack" switch in the core options that fixes DOOM's screen but the emulation of the game is very slow anyway.
You are right. The standalone emulator hasn't been updated since 2014. It has the same issues also. The only properly working Jaguar emulator is Irata Jaguar for Android. That, and Real3DOplayer. But sadly, it's closed source and paid only. :(
I reached out to the dev to see if he'd make his emulators open source or at least port them to other OSes but he said he's too busy.
Yeah I was aware of the Doom hack, seems to fix the problem for that game. But that's only one game. And yeah unfortunately it runs too slow.
Irata Jaguar is based on the Russian Phoenix emulator for PC. It's the only good Jaguar emulator and yes, it's closed source. So no RetroArch fun with this one :(
I'll work on a Jaguar emulator called jagger
but I will be doing it in a slow manner due to circumstances.
I will try to make it portable too. If I have to, I will use Arm NEON and x86 SSE (no AVX, Silvermont/Goldmont(+) SBCs will SIGILL
the moment a >=256-bit vector operation is encountered), but I really just want use pure C.
I do have Gemini Lake hardware for those tight corner cases.
That's awesome! You're a legend.
A few of these issues don't seem to exist in the standalone virtual jaguar (but most of them unfortunately still do).
Well, the standalone is version 2.1.2 while the core is based on an older 2.1.0 version it seems.
@Tasosgemah Really? Damn.
Does this emulator use Interpreter or Dynamic Recompiler? Seems like it runs on Interpreter, hence the speed issues. Maybe I should've opened a bounty for a Dynamic Recompiler.
I don't think the issue with this emulator is it's speed. There are major compatibility and accuracy issues. Everything runs at full speed otherwise on any low-end system.
I don't think the issue with this emulator is it's speed. There are major compatibility and accuracy issues. Everything runs at full speed otherwise on any low-end system.
Full speed on any low-end system? This core runs slow on everything I've tried (HTC Phone, Samsung Phone, Raspberry Pi 3B, Odroid XU4, Odroid N2, Raspberry Pi 4, Android Q Box+). Except for PC. And I mean some serious, serious lagging. But even on PC, some games are painfully slow or don't work at all. And some games run like they're in fast forward.
Just noticed there's a Virtualjaguar RX available. I downloaded it and it seems to work pretty well so far. I wonder if they'd be willing to do a libretro port of it either now or in future.
I don't think the issue with this emulator is it's speed. There are major compatibility and accuracy issues. Everything runs at full speed otherwise on any low-end system.
Full speed on any low-end system? This core runs slow on everything I've tried (HTC Phone, Samsung Phone, Raspberry Pi 3B, Odroid XU4, Odroid N2, Raspberry Pi 4, Android Q Box+). Except for PC. And I mean some serious, serious lagging. But even on PC, some games are painfully slow or don't work at all. And some games run like they're in fast forward.
Ok maybe it doesn't run full speed on the lowest end systems. It does run full speed on a Core 2 Duo from 2006 so i figured it's fast enough. But still, it's not the speed that is the main issue here. Even on a fast PC at least half of the software doesn't run correctly or at all.
I've decided to retract the bounty on this. It's been well over a year now and nothing's happened. My bounty of $250 has been refunded. During that time, unfortunately I saw no contributions or anyone volunteering to take on the bounty. Hopefully we do see some kind of continued development on a Jaguar emulator in the future but I'm not holding my breath anymore.
Yeah, virtual jaguar is at this state for more than a decade now so i don't think anyone cares about it anymore. There are better chances for some new emulator to pop up in the future or MAME surpassing it. Too bad because Jaguar emulation is one of the few gaps left for RetroArch.
It's a real shame. Jaguar and also CD-i emulation are lacking. There is a Virtualjaguar Rx but it doesn't seem to have made many improvements over the original and has been inactive since mid 2019. And there is Phoenix Emulator but it's closed source and not only has the developer expressed total disinterest in making a retroarch port (dismissed it completely!), he has also shown total disinterest in his own emulators and won't respond to messages. This whole thing is a bit of a disappointment.
I was working on an emulator that uses Musashi for the 68000 manager processor and probably some complex stuff elsewhere but I feel like I’ve taken on too many projects. CD-I emulation could be nice since those apparently have timekeeper modules that are savefile memory. I am not sure, but Jaguar is better to code since there’s docs out there. The documentation for what I think are the actual Atari ASICs used in the console are out, and the owners let it fly.
I will get some rest. I am interested.
Sent from my iPad
On Mar 26, 2020, at 9:59 PM, Cee123 notifications@github.com wrote:
It's a real shame. Jaguar and also CD-i emulation are lacking. There is a Virtualjaguar Rx but it doesn't seem to have made many improvements over the original. And there is Phoenix Emulator but it's closed source and not only has the developer expressed total disinterest in making a retroarch port (dismissed it completely), he has also shown total disinterest in his own emulators and won't respond to messages. This whole thing is a bit of a disappointment.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Well I tested a bunch of games on the Phoenix Emulator if anyone is interested. Most of the issues aren't experienced using that emulator but there are a couple that are still the same.
Air Cars - Displays properly
Atari Karts - No annoying bar down the side of the screen
Battle Sphere Gold - The menus are still glitchy but in different parts.
Club Drive - Displays properly and doesn't crash
Cybermorph - No glitches
Doom - No annoying bar down half of the screen
Fight for Life - Now this is interesting. There is also a considerable amount of flickering/glitching with the Phoenix Emulator
Flashback - The Quest for Identity - Displays properly
Hover Strike - Displays properly, but interestingly it freezes during the start of a new game and the horizon doesn't display on the Phoenix Emulator. This doesn't happen on Virtual Jaguar
Hyperforce - Works! It's playable on Phoenix, but completely unplayable and not supported on Virtual Jaguar
Iron Soldier - Interestingly, this game didn't work on Phoenix Emulator either. It just crashes to a black screen after character selection. But the music still plays.
Iron Soldier 2 - Title displays properly. Interestingly, this also doesn't work - crashes to a black screen upon the beginning of a new game.
I-War - Displays properly and no flickering or glitching
Kasumi Ninja - Displays properly, no missing textures/sprites
Missing Command 3D - The background textures aren't screwed and glitchy
NBA Jam - Works fine without any glitches or jumping
Pinball Fantasies - Everything displays properly
Power Drive Rally - Everything displays properly, and it doesn't crash.
Ruiner Pinball - Works! Perfectly playable on Phoenix but doesn't work and is unsupported on Virtual Jaguar
Skyhammer - Works, and does NOT freeze like on Virtual Jaguar
Super Burnout - Displays properly, no flickering
Supercross 3D - Displays normally, I didn't realize the game textures were naturally like that for this game. This emulators shows that.
Syndicate - No annoying pink glitches during menus
Tempest 2000 - Works fine, with no flickering
Towers II - Works. Doesn't work on Virtual Jaguar. BUT. During the game, there is a flickering bar horizontally across the screen. It was difficult to capture in a screenshot of the game.
Trevor McFur in the Crescent Galaxy - Everything displays normally
Val d'Isere Skiing and Snowboarding - Everything displays normally.
White Men Can't Jump - Works! Doesn't work and is unsupported on Virtual Jaguar.
Wolfenstein 3D - Works. Doesn't seem to work on Virtual Jaguar.
Zero 5 - Works with no flickering or glitching.
Zoop! - Works and does NOT crash at all
As I found out, even the Phoenix Emulator isn't without glitches or issues. But most games seem to run properly at least.
I have some hacks, and I mean hacks, to improve some speed.
https://github.com/Provenance-Emu/virtualjaguar-libretro/tree/master
I haven't looked at this in 2 years, but I do remember some simple hacks such as using C struct's wiser for bit shift operands gave me a ton of speed up in the blitter memory copy and other functions, at least on ARM64.
For some reason, when profiling, some really basic bitwise ops were super slow. Using structs to represent the registers and casting using different C struct packings.
8f0f57375a922c86be28624d34891e992667a74e 2d5f483ae5483b0269aa20b36963212b8e5d2fae 8d25cab08133e8cd1c60fc9971d5c6f42db250b0
Inlining some things, 2d5f483ae5483b0269aa20b36963212b8e5d2fae 0285ac2b1f3eb824c13d94716d4105299dfffb83
Also some loop unrolling, c6bc3709c7177e25bd0a872a549f338d55f83d68
I'm using these hacks in Provenance. I haven't tested in forver, but users report pretty decent success with our Jaguar core and we don't even have options to switch the bios from internal or provided, which is needed for many games. I'm assuming these improvements have helped more than hurt but not sure if they'll be cross platform.
The struct packings should be endian agnostic based on using macros and the fact that I can test well in iOS simulator (intel) and device (arm) which have different endianeness.
YMMV on other platforms.
I made a PR, https://github.com/libretro/virtualjaguar-libretro/pulls
I fixed the CI issues and it even improved 3 CI warnings! Maybe someone can build and run on retroach linux or windows to test?
I use a completely different front end so I don't have a build env setup on my Mac for retroarch atm.
Wow, that's awesome! So going to try this, and test it out. That's awesome that someone has made progress on this. Fantastic work!
I just tested it out on my Odroid XU4 and my Odroid N2+ and couldn't get it to work on either of them. Each time I loaded a game, it would just freeze on a black screen. And with the bios it just freezes.
Odroid XU4 - Tested with RetroArena/Ares, Retroarch 1.8.5 virtualjaguar_libretro (Odroid XU4).zip
Odroid N2 Plus - Tested with RetroArena/Ares and EmuElec (same thing on both) virtualjaguar_libretro (Odroid N2+).zip
I also tried to compile it for Windows but got a bunch of error messages
Thanks for the reply.
The windows issues are probably because at the time I wasn't considered with backwards compatibility, was just trying to get something to work so I probably broke a bunch of cross platform things.
The the former issue, it does at least get to the bios screen? To me that's important data because that means it's linking and running. It may be another platform issue past that though (probably path handling or something I made iOS/Mac specific, not remembering what I did two years ago).
That's promising though because those are easy fixes.
The core works on iOS/Mac for me so the code should be good, looks like a porting platform issue in that case.
That's alright, no problem. Thank you for your work!
Yeah it gets to the bios screen but then freezes. Not sure if the bios needs to be turned on or off. I've tried with both. But I've noticed a MASSIVE difference in which the speed of the bios actually loads. It was slow before on both my XU4 and my N2. But now it's actually quicker. If the games themselves run like this they should be perfectly playable. This is interesting.
I might get some log files maybe so we can have some idea of what the issue might be.
Yeah probably is a porting issue. If it works on iOS and Mac then that's good news. It should be able to get working on Windows, Linux (including arm and arm64) and Android.
I'm taking ownership of admin here.
I've been working on a few PRs that have already been merged, and a few more in testing.
This bounty should maybe be split up into categories or limited in scope. 100% support all in one go seems unlikely for some time, perhaps smaller goals would encourage more help.
LMK what the community thinks and if anyone has any updated info on if some of the issues stated above are working in latest master or #58
I'm taking ownership of admin here.
I've been working on a few PRs that have already been merged, and a few more in testing.
This bounty should maybe be split up into categories or limited in scope. 100% support all in one go seems unlikely for some time, perhaps smaller goals would encourage more help.
1. Fix general graphic issues 2. Fix general performance issues 3. Fix all game specific bugs that remain after 1/2
LMK what the community thinks and if anyone has any updated info on if some of the issues stated above are working in latest master or #58
Thanks heaps for that. That's awesome news to hear! Yeah you are right, I should've split this into multiple specific issues. When I posted this, that was after I tried this emulator on my PC and Odroid XU4, I noticed that almost no games were working properly and the performance was horrible. I had never even heard of the Jaguar before that and found this was one of the few emulators available for it. I was hoping someone would make some progress over the years.
Thank you for your hard work. Nice to see someone working on this. That's awesome.
I have to say, I was really impressed with the performance the last time I updated this emulator on my PC. I noticed the improvements straight away! It ran very good! Keep up the excellent work!
I have to say, I was really impressed with the performance the last time I updated this emulator on my PC. I noticed the improvements straight away! It ran very good! Keep up the excellent work!
Are we still talking about the libretro core? Because that one is still 2.1.0 version.
I have to say, I was really impressed with the performance the last time I updated this emulator on my PC. I noticed the improvements straight away! It ran very good! Keep up the excellent work!
Are we still talking about the libretro core? Because that one is still 2.1.0 version.
Yeah, it's still the same version. But he seems to have added some enhancements in performance. Something that's been long overdue. I still need to try it on Arm devices. Hopefully it will run smoother.
Apologies for the bump.
The emulator doesn't seem to account for changes in horizontal resolution in some of the games. After taking a quick glance at the code, it seems like the horizontal resolution is hard-coded to 320 pixels. This works for most games, however when a game changes this resolution, the emulator doesn't take it into account. For instance in the case of Atari Karts, the in-game resolution is ~256x240, but the output resolution is still set to 320x240, which is why only part of the screen is used.
A "simple" fix would be to use the TOMGetVideoModeWidth()
function from src/tom.c
to detect changes in resolution during gameplay and update the av_info accordingly.
I tried it myself, but the best outcome I got was this :
The function doesn't return the "true" horizontal resolution, it returns a slightly larger value (326 instead of 320 etc.) There is probably a way to determine the effective resolution but I'm not sure how, as I'm not familiar at all with the Jaguar hardware.
Maybe someone more familiar with the Jaguar could help...
I'm also not too familiar with the libretro functions (e.g retro_get_system_av_info
), in the sense that I'm not sure what the different fields represent in relation to the video buffer (max_width, game_width etc.)
I'll try reading some of the Jaguar hardware docs to see if I can find something useful. If anybody has more information on this please reach out !
After some tinkering I found a potential solution.
Basically, the "screen pitch" needs to be updated when the resolution is changed. With some hardcoded values I was able to get the correct aspect ratio in Atari Karts :
I tried setting it automatically but that crashed the emulator, so there's still some work to do to make it work with other games.
I'm also not sure how this will affect Doom, since that game changes video modes during rendering.
EDIT : This method also seems to work with hi-res modes, like here in Club Drive :
Ah, yeah, this is a common thing for cores to do. You can take a look at beetle-pce for an example how they handle it: https://github.com/libretro/beetle-pce-libretro/blob/master/libretro.cpp
Oh wow!
Nice stuff guys!
I'm super busy on Provenance, patching some other EMUs to iOS and a new project called SideStore.
I can def review and test anything but can't really write code at the moment.
Still plan to one day update the blitter...
I'm also not too familiar with the libretro functions (e.g
retro_get_system_av_info
), in the sense that I'm not sure what the different fields represent in relation to the video buffer (max_width, game_width etc.)
I'm pretty familiar with this. What you looking to do?
I'm also not sure how this will affect Doom, since that game changes video modes during rendering.
Doom already has bespoke code so don't fret on that one for now. On Provenance we auto detect doom and turn on doom hacks, I think retroarch does too actually and also have args for it.
We could just use the doomResHack flag to skip stuff that's broken if needed.
Ah, yeah, this is a common thing for cores to do. You can take a look at beetle-pce for an example how they handle it: https://github.com/libretro/beetle-pce-libretro/blob/master/libretro.cpp
exact lines for reference
Thanks for the information !
I thought it was related to the libretro functions but apparently not, setting the screen pitch to the new resolution was enough. I'm still updating the av_info when the resolution changes however. Although for some reason, when the new display width is higher than 512, the screen remains black. I'm not sure what's causing this, I thought it was a hard-coded limit in the emulator but apparently it's not. This happens when the width is set to 652, as is the case in the Pinball Fantasies intro and the I-War and Aircars title screens. I'm tempted to just halve the width and skip every other pixel when that happens.
I've also noted that some games crash Retroarch completely. Aircars crashes at the title screen, and Atari Karts crashes after playing for a while. I tried it with the regular virtual jaguar core and it also happened, so I'm guessing it's an unrelated issue. (I'm running RetroArch on Kubuntu 22.04, using the deb package from the libretro-stable PPA)
I found the fix for hi-res title screens : the libretro core max width was too low.
Here is the I-War title screen at the correct resolution.
So far, this seems to fix resolution issues in the following games : Atari Karts, Club Drive, Evolution Dino Dudes, Flashback, I-War, Pinball Fantasies and Trevor McFur.
Should I submit a pull request for this ?
Yeah, sounds like a good improvement.
Thanks for the update. It's nice to see some game fix/updates for Virtual Jaguar after so long
No problem !
I got interested in Jaguar emulation again after the release of Atari 50. I'm kind of disappointed with the state of Jaguar emulation these days. The only decent emulator is closed source (Project Phoenix). Maybe Digital Eclipse will release their new emulator to the public but I'm not holding my breath...
Excuse my ignorance here... @flytrapdev you seem to have found a great fix for nearly all of the Jaguar games in this core! How does one go about applying this fix to the core? I saw you edited the .C file with the resolution changes, but does it need to be recompiled now? And if so how do I obtain the latest version, or do we have to wait on the author?
Yes, it needs to be recompiled with the fix. Updated builds should be available from RetroArch's online updater and/or buildbot.libretro.com in the nightly/.../latest directories.
Thanks! To throw a monkey wrench in the works, I was hoping to get this working on the NVIDIA Shield RetroArch virtual jaguar core. I've tried the online updater and there are no changes yet. Still trying to get info on manually updating the Shield RetroArch cores.
you can download it manually from the buildbot site and then use the "install a core" routine from the 'load core' menu to move it into the correct location.
However, you may want to just sideload the apk from the website, which pulls directly from the buildbot instead of using the Play Store servers, since Google won't allow us to update the packages on their Store for the foreseeable future.
TY @hizzlekizzle, this worked beautifully! I used the buildbot.libretro.com nightly/android/latest/arm64-v8a/virtualjaguar_libretro_android.so.zip and the "Load Core" > "Install or Restore a Core" routine. I may sideload the latest RetroArch.apk though, does seem like a better option.
Ok, so I tested out a bunch of Jaguar games and noticed a lot of them are broken or have issues. And decided to make a list of which ones have issues. This emulator seems to need a lot of work.
Air Cars Half the title screen is cut off
Atari Karts Weird bar down the side of the screen during the game
Battlesphere Gold Only loads if Bios is enabled. But menus are glitched - black screen after menu, game doesn't work at all
Club Drive Half the title screen is cut off and textures are missing.
Cybermorph Missing/glitched textures
Doom Weird bar down half of the screen during the game
Fight for Life Flickering graphics, mainly in the menu
Flashback - Quest for Identity Game displays on the left side of the screen
Hover Strike Glitched and flickering graphics
Hyper Force Black screen after title, doesn't work at all
I-War Half the title screen is cut off, glitched and flickering graphics
Iron Soldier Black screen after character selection, doesn't work at all
Iron Soldier 2 Title displays on the left side of the screen, black screen after title but music still plays, doesn't work at all
Kasumi Ninja Severe Graphics issues, flickering at the title screen, missing textures, black screen freezes
Missile Command 3D Some minor graphics glitches/flickering. Nothing too serious.
NBA Jam - Tournament Edition Some minor occasional screen jumping, nothing too serious.
Pinball Fantasies Some of the introduction screens are cut off
Powerdrive Rally Some of the introduction screens are cut off, game crashes upon starting a new game
Raiden Only works if the BIOS is enabled, otherwise black screen freezes
Ruiner Pinball Black screen, doesn't work at all
Skyhammer Works but freezes during game
Super Burnout Some of the letters are cut off, black screen doesnt work at all when starting a new game
Supercross 3D Displays on the left side of the screen, blurry textures
Syndicate Works good, but there are pink patches in the writing
Tempest 2000 Works good, but there's some minor flickering occasionally
Towers II Unplayable due to flickering/flashing
Trevor McFur in the Crescent Galaxy Half the screen is cut off during the loading screen
Val D'isere Skiing and Snowboarding Game displays on the left side of the screen
White Men Can't Jump Black screen, doesn't work at all
Wolfenstein 3D Black screen, doesn't work at all
Zero 5 Game works good, but some mild flickering
Zoop Game crashes and doesn't work