libretro / virtualjaguar-libretro

Hard fork of Virtual Jaguar (abandoned project) to Libretro
31 stars 36 forks source link

[spike] Emulator needs massive improvements #38

Open Cee123 opened 5 years ago

Cee123 commented 5 years ago

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 Air Cars

Atari Karts Weird bar down the side of the screen during the game Atari Karts

Battlesphere Gold Only loads if Bios is enabled. But menus are glitched - black screen after menu, game doesn't work at all Battlesphere

Club Drive Half the title screen is cut off and textures are missing. Club Drive Club Drive 2

Cybermorph Missing/glitched textures Cybermorph

Doom Weird bar down half of the screen during the game Doom

Fight for Life Flickering graphics, mainly in the menu Fight for Life

Flashback - Quest for Identity Game displays on the left side of the screen Flashback - Quest for Identity Flashback Quest for Identity 2

Hover Strike Glitched and flickering graphics Hover Strike Hover Strike 2

Hyper Force Black screen after title, doesn't work at all

I-War Half the title screen is cut off, glitched and flickering graphics I-War I-War 2

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 Iron Soldier 2

Kasumi Ninja Severe Graphics issues, flickering at the title screen, missing textures, black screen freezes Kasumi Ninja Kasumi Ninja2

Missile Command 3D Some minor graphics glitches/flickering. Nothing too serious. Missile Command 3D

NBA Jam - Tournament Edition Some minor occasional screen jumping, nothing too serious.

Pinball Fantasies Some of the introduction screens are cut off Pinball Fantasies

Powerdrive Rally Some of the introduction screens are cut off, game crashes upon starting a new game Powerdrive Rally

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 Super Burnout

Supercross 3D Displays on the left side of the screen, blurry textures Supercross 3D

Syndicate Works good, but there are pink patches in the writing Syndicate

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 Trevor McFur in the Crescent Galaxy

Val D'isere Skiing and Snowboarding Game displays on the left side of the screen Val D'isere Skiing and Snowboarding

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

Cee123 commented 5 years ago

Bounty posted to fix issues with this core - $250 https://www.bountysource.com/issues/76219168-list-of-games-with-issues

Chlorophytus commented 5 years ago

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.

Cee123 commented 5 years ago

Nice. Hoping someone can pick this up again, seems a bit broken in its current state.

Tasosgemah commented 5 years ago

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.

Cee123 commented 5 years ago

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.

Tasosgemah commented 5 years ago

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 :(

Chlorophytus commented 5 years ago

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.

Cee123 commented 5 years ago

That's awesome! You're a legend.

Cee123 commented 5 years ago

A few of these issues don't seem to exist in the standalone virtual jaguar (but most of them unfortunately still do).

Tasosgemah commented 5 years ago

Well, the standalone is version 2.1.2 while the core is based on an older 2.1.0 version it seems.

Cee123 commented 5 years ago

@Tasosgemah Really? Damn.

Cee123 commented 4 years ago

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.

Tasosgemah commented 4 years ago

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.

Cee123 commented 4 years ago

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.

Cee123 commented 4 years ago

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.

Tasosgemah commented 4 years ago

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.

Cee123 commented 4 years ago

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.

Tasosgemah commented 4 years ago

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.

Cee123 commented 4 years ago

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.

Chlorophytus commented 4 years ago

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.

Cee123 commented 4 years ago

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 Air Cars (World)@Sat April 11 2020 11-13-48-038

Atari Karts - No annoying bar down the side of the screen Atari Karts (World)@Sat April 11 2020 11-14-35-622

Battle Sphere Gold - The menus are still glitchy but in different parts. Battle Sphere Gold (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-23-02-427

Club Drive - Displays properly and doesn't crash Club Drive (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-23-43-661 Club Drive (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-23-58-013

Cybermorph - No glitches Cybermorph (World) (Rev 2)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-25-34-557

Doom - No annoying bar down half of the screen Doom (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-26-01-863

Fight for Life - Now this is interesting. There is also a considerable amount of flickering/glitching with the Phoenix Emulator Fight for Life (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-26-59-740

Flashback - The Quest for Identity - Displays properly Flashback - The Quest for Identity (World) (En,Fr)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-27-34-264 Flashback - The Quest for Identity (World) (En,Fr)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-28-00-797

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 Hover Strike (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-28-27-039 Hover Strike (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-28-44-133 Hover Strike (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-29-21-098

Hyperforce - Works! It's playable on Phoenix, but completely unplayable and not supported on Virtual Jaguar Hyper Force (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-30-07-815 Hyper Force (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-30-27-756

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. Iron Soldier 2 (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-33-10-301

I-War - Displays properly and no flickering or glitching I-War (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-30-55-382 I-War (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-31-29-703

Kasumi Ninja - Displays properly, no missing textures/sprites Kasumi Ninja (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-34-02-268 Kasumi Ninja (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-34-10-834 Kasumi Ninja (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-34-41-518

Missing Command 3D - The background textures aren't screwed and glitchy Missile Command 3D (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-35-18-999

NBA Jam - Works fine without any glitches or jumping NBA Jam - Tournament Edition (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-36-27-469

Pinball Fantasies - Everything displays properly Pinball Fantasies (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-37-07-687

Power Drive Rally - Everything displays properly, and it doesn't crash. Power Drive Rally (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-38-19-454

Ruiner Pinball - Works! Perfectly playable on Phoenix but doesn't work and is unsupported on Virtual Jaguar Ruiner Pinball (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-38-40-471 Ruiner Pinball (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-38-54-888 Ruiner Pinball (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-39-09-627

Skyhammer - Works, and does NOT freeze like on Virtual Jaguar Skyhammer (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-40-16-347

Super Burnout - Displays properly, no flickering Super Burnout (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-40-48-656

Supercross 3D - Displays normally, I didn't realize the game textures were naturally like that for this game. This emulators shows that. SuperCross 3D (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-41-46-178

Syndicate - No annoying pink glitches during menus Syndicate (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-42-20-757

Tempest 2000 - Works fine, with no flickering Tempest 2000 (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-43-04-386

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. Towers II (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-43-39-041 Towers II (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-44-01-691

Trevor McFur in the Crescent Galaxy - Everything displays normally Trevor McFur in the Crescent Galaxy (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-44-32-642 Trevor McFur in the Crescent Galaxy (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-44-43-542

Val d'Isere Skiing and Snowboarding - Everything displays normally. Val d'Isere Skiing and Snowboarding (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-45-28-565

White Men Can't Jump - Works! Doesn't work and is unsupported on Virtual Jaguar. White Men Can't Jump (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-46-12-459 White Men Can't Jump (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-46-18-576 White Men Can't Jump (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-46-34-700

Wolfenstein 3D - Works. Doesn't seem to work on Virtual Jaguar. Wolfenstein 3D (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-47-09-443

Zero 5 - Works with no flickering or glitching. Zero 5 (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-47-46-994

Zoop! - Works and does NOT crash at all Zoop! (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-48-19-427 Zoop! (World)@ BIOS  Atari Jaguar (World)@Sat April 11 2020 11-48-33-633

As I found out, even the Phoenix Emulator isn't without glitches or issues. But most games seem to run properly at least.

JoeMatt commented 3 years ago

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.

JoeMatt commented 3 years ago

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.

Cee123 commented 3 years ago

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!

Cee123 commented 3 years ago

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

20210916_102544-20210916-102615506

20210916_102459-20210916-10261620

I also tried to compile it for Windows but got a bunch of error messages

Capture

JoeMatt commented 3 years ago

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.

Cee123 commented 3 years ago

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.

JoeMatt commented 3 years ago

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

Cee123 commented 3 years ago

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.

Cee123 commented 3 years ago

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!

Tasosgemah commented 3 years ago

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.

Cee123 commented 3 years ago

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.

flytrapdev commented 2 years ago

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 : image

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 !

flytrapdev commented 2 years ago

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 :

image

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 : image

hizzlekizzle commented 2 years ago

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

JoeMatt commented 2 years ago

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...

JoeMatt commented 2 years ago

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.

JoeMatt commented 2 years ago

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

https://github.com/libretro/beetle-pce-libretro/blob/816b888bc33604df3fef0fb2ca309c0578ae52ac/libretro.cpp#L1650

https://github.com/libretro/beetle-pce-libretro/blob/816b888bc33604df3fef0fb2ca309c0578ae52ac/libretro.cpp#L1775

flytrapdev commented 2 years ago

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)

flytrapdev commented 2 years ago

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.

image

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 ?

hizzlekizzle commented 2 years ago

Yeah, sounds like a good improvement.

Tasosgemah commented 2 years ago

Thanks for the update. It's nice to see some game fix/updates for Virtual Jaguar after so long

flytrapdev commented 2 years ago

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...

TheDirtyWilly commented 1 year ago

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?

hizzlekizzle commented 1 year ago

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.

TheDirtyWilly commented 1 year ago

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.

hizzlekizzle commented 1 year ago

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.

TheDirtyWilly commented 1 year ago

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.