gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
774 stars 181 forks source link

Star Wars - Rogue Squadron: implementation of Lemmy HLE code? #653

Closed olivieryuyu closed 7 years ago

olivieryuyu commented 9 years ago

As it has a very partial support, implementing partial HLE support from Lemmy code would be nice but of course not a priority

purplemarshmallow commented 9 years ago

Some info from Lemmy:

Rogue Squadron uses a so called heightfield microcode. So it is able to interprete height fields on the co-processor. The only other game with the same mechanism (to my knowledge) would the other Star Wars game.

I did some special work for Rogue Squadron (it is very unique) but didn't do any of the heightfield stuff. That's why you can see more than with other emus, but still I'd say it is unplayable.

olivieryuyu commented 7 years ago

I believe that command 0x5, which Lemmy called JUMP3 and he did not analyzed, is the key to understand further the case. 0x5 seems to generate triangles (aside TRI1 (0xBF) and TRI2 (0xB4)).

The code of 0x5 is simply huge so it will take a huge time.

gonetz commented 7 years ago

You have taken very challenging task. I'm sure that regardless of the result with this ucode, you will became an expert in RSP work. I personally hope to see progress in Zelda MM point lighting someday. Good luck!

gonetz commented 7 years ago

Today I started crowdfunding campaign for HLE support of Star Wars - Rogue Squadron: https://igg.me/at/swrs

I don't have accounts in FB or other social networks, so please spread the word :)

loganmc10 commented 7 years ago

I loved this game so much as a kid, good luck you guys!

olivieryuyu commented 7 years ago

please spread the news !! thanks!!!!

theboy181 commented 7 years ago

I would announce of discord.

Sent from my iPhone

On Jul 4, 2017, at 7:32 AM, Sergey Lipskiy notifications@github.com<mailto:notifications@github.com> wrote:

Today I started crowdfunding campaign for HLE support of Star Wars - Rogue Squadron: https://igg.me/at/swrs

I don't have accounts in FB or other social networks, so please spread the word :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/gonetz/GLideN64/issues/653#issuecomment-312892694, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AI3nHyjHnK0imRTatc-9hYy4Tj8dtjCTks5sKkzrgaJpZM4Fp-eg.

gonetz commented 7 years ago

83% already. We are close. Thanks to everyone for support!

theboy181 commented 7 years ago

I pm you on discord.

weinerschnitzel commented 7 years ago

The goal has been met. Nice!

gonetz commented 7 years ago

Honestly, I did not expect that it will met the goal so quickly. I had doubts that this task will be backed at all. I was wrong, that's good :) The task now gets top priority.

theboy181 commented 7 years ago

HLE the microcode seems like an interesting topic.. I backed you because of the work you do, not the the goal.. thanks again.

gonetz commented 7 years ago

Thanks to you for your support. It is important for me to know that my work is appreciated.

olivieryuyu commented 7 years ago

Just for information purpose, it is interesting to note that SWRG ucode is vaguely based on the F3DEX. Factor5 did not completey wrote from scratch the ucode.

Same applies for Battle of Naboo and Indiana Jones but this time it was based on F3DEX2.

Of course the changes are dramatic so both ucodes are completely non compatible with their original ucodes.

Hence at the end no ucode was totally written from scratch by external parties, meaning outside Nintendo and SGI. From an historical point of view, it is quite an interesting fact :)

olivieryuyu commented 7 years ago

progress of the implementation are awesome :)

gn0daxsqinroxjrdn4ny

theboy181 commented 7 years ago

@gonetz Question

  1. What is the debug code you are using to show the terrain in the Indago post?
  2. LLE is working for me but HLE has issues with the terrain in Alpha 2.7 zilmar spec. Was the above screenshot taken in HLE from Alpha2.7 build?
theboy181 commented 7 years ago

@olivieryuyu is that screen shot taken with PJ64, and are you forcing HLE with the plugin per-game? I just found out the Rouge Squadron when using Zilmars RSP doesn't respond to the set global HLE option. forcing it HLE in per game options, it will do HLE, but there will be many gfx issues. 2.7 aplha looks no different than the first build to me.

gonetz commented 7 years ago

I use mupen64plus to work with RS. Screen shot taken with mupen64plus build. Debug mode enabled by some flags in code, so you need to rebuild the project to get it.

gonetz commented 7 years ago

I updated Indiegogo campaign with new video and screen shots: https://igg.me/at/swrs

gonetz commented 7 years ago

https://youtu.be/uOorz-d2D6U

Frank-74 commented 7 years ago

Looks good. Indy and Naboo are also similar ucodes I think. Looks like they'll be the last games to be HLE'd, unless they're very similar to SW RS.

loganmc10 commented 7 years ago

@gonetz are the sources included in the alphas up to date? I'm trying to test this on Linux and I get:

gSP.cpp:1458:9: error: ‘struct SPVertex’ has no member named ‘st_scaled’
     vtx.st_scaled = 0;

If updating the sources is too much of a hassle or you aren't ready to do that yet don't worry about it.

theboy181 commented 7 years ago

Not sure but explosions seem to be missing. https://www.youtube.com/watch?v=JOBegdjT60g

gonetz commented 7 years ago

I put recent sources, but probably some file was not updated.

Command for explosions is not implemented yet. It is also very large and complex.

AmbientMalice commented 7 years ago

You're doing great work, guys.

Looks good. Indy and Naboo are also similar ucodes I think. Looks like they'll be the last games to be HLE'd, unless they're very similar to SW RS.

I'd be absolutely chuffed if Naboo/Indy were made easier to HLE by the work done here.

theboy181 commented 7 years ago

Mario no Photopi seems to be working in HLE with Sephomore on.

gonetz commented 7 years ago

@loganmc10

gSP.cpp:1458:9: error: ‘struct SPVertex’ has no member named ‘st_scaled’ vtx.st_scaled = 0;

I see, what happened. I removed st_scaled field, but forgot to correct __VEC4_OPT code since I don't use it for windows build. Just remove __VEC4_OPT code from gSPSWVertex, it need to be rewritten.

olivieryuyu commented 7 years ago

In order to do a good testing of the game, here the cheat code for having all levels: DEADDACK

theboy181 commented 7 years ago

how about forcing the game to Run Like the PC @ 60FPS.. ;)

Star Wars - Rouge Squadron (U) (V1.1) 60 FPS Hack

8002E4E8 0000

Note: Needs OC X2 to maintain 60FPS

olivieryuyu commented 7 years ago

Looks good. Indy and Naboo are also similar ucodes I think. Looks like they'll be the last games to be HLE'd, unless they're very similar to SW RS.

It will be most likely WDC & Stunt Racer.

Indy has some code similar to SWRG but some stuff are completely new.

AmbientMalice commented 7 years ago

Indy has some code similar to SWRG but some stuff are completely new.

I assume Battle for Naboo is same as Indy, or at least similar?

olivieryuyu commented 7 years ago

similar indeed

theboy181 commented 7 years ago

Good work.. @olivieryuyu did you help gonetz with this? Whats next? will it have to be behind a pay wall?

olivieryuyu commented 7 years ago

@theboy181

I did a huge work on SWRG.

gonetz commented 7 years ago

@olivieryuyu Jason aka theboy181 is one of most generous backers of the project. He also one of most generous backers of Rogue Squadron campaign. I wish I had more (many) of such supporters :)

@theboy181 as for olivieryuyu, N64 emulation is a hobby for me which I do for free. We would do that work on Rogue Squadron regardless of the campaign result. If campaign would fall, that task would completed later and not so fast. Campaign money is a motivation bonus, not a payment for our work. We are planning to continue our HLE projects. There is no pay wall, if I correctly understand what it means.

gonetz commented 7 years ago

I did a huge work on SWRG.

That's true. Started at April, finished this week. The task is not only huge, but also extremely difficult. I still can't believe that we done with it.

loganmc10 commented 7 years ago

@gonetz F3DSWRS.cpp needs #include <cmath> in Linux for fabs() and modf()

After including it, I get:

/home/loganmc10/mupen64plus-GLideN64/GLideN64/src/F3DSWRS.cpp: In function ‘void F3DSWRS_TexrectGen(u32, u32)’:
/home/loganmc10/mupen64plus-GLideN64/GLideN64/src/F3DSWRS.cpp:1281:68: error: cannot convert ‘float*’ to ‘double*’ for argument ‘2’ to ‘double modf(double, double*)’
  const f32 frac_x_f = fabs(modf(gSP.matrix.combined[0][0], &intpart));
                                                                    ^
/home/loganmc10/mupen64plus-GLideN64/GLideN64/src/F3DSWRS.cpp:1283:68: error: cannot convert ‘float*’ to ‘double*’ for argument ‘2’ to ‘double modf(double, double*)’
  const f32 frac_y_f = fabs(modf(gSP.matrix.combined[0][1], &intpart));
loganmc10 commented 7 years ago

Just changing intpart to f64 solved that problem. It looks really great you guys, runs at full speed in full screen on my laptop with Intel graphics (Linux)!

I hope the RetroPie form moderators are ready for the onslaught of people complaining that it doesn't run at full speed on a Raspberry Pi lol

loganmc10 commented 7 years ago

One small issue I noticed, in the mission select screen, as well as the "Mission Accomplished!" screen after a mission, parts of the screen "flicker" with weird colours, example below:

rogue_squadron-006

LegendOfDragoon commented 7 years ago

@loganmc10 that might be a emulator core issue. At least on older versions of Mupen64plus, I had some weird flickering issue in that part of the game, although it wasn't green.

loganmc10 commented 7 years ago

@LegendOfDragoon yeah it's not always green, that's just the frame I happened to capture. It looks like you're right, CountPerOp=1 fixes the flickering, so it was a core issue.

LegendOfDragoon commented 7 years ago

Interesting, that reminds me of when I used overclocking in 1964 to get rid of the flickering in that menu. Can't remember whether OCing completely removed it, or if it just reduced it. I'm thinking it might be due to inaccurate floating point code in the CPU core.

Is mupen64plus's VI refresh rate at 2200 by default or something? Odd how merely setting CountPerOp to 1, would do the trick.

loganmc10 commented 7 years ago

No it's 1500 by default. All the Factor 5 games have issues with CountPerOp=2 in mupen64plus. Indiana Jones and Naboo also have flickering. The background music doesn't work in Episode I racer unless CountPerOp=1. This is the same in Project64 (the missing music in EP I racer), I'm not sure about the flickering though

theboy181 commented 7 years ago

@gonetz and @olivieryuyu I meant no disrespect. I hope to see more improvements in compatibility with GLideN64, I just wondered if there would be another campaign for the rest of the games that needed HLE work.

I hope that you will take some time to polish what we have when you have achieved your personal goals. things like the FPS counter not being accurate, and the SSB64 bugged textures, and CRC issues with HD texture support still bother me and are on my wish list.

Regressions with Bloom are on that list too, but lower priority.

gonetz commented 7 years ago

@theboy181 Your wish list is sub-list of mine to-do plans :) The problem is where to get time for all tasks. I spent all my time during last month to complete RS. Huge task requires maximal efforts, I had little time for anything else. I'll be on vacation from next week until September. So, the plans postponed.

Regarding another campaign for HLE projects: it is hardly. Indiegogo has minimal campaign goal $500. I can't expect that each campaign can take so much. Indy probably can - many people wish it be HLEed. I'm planning to open project on Patreon. I already started it once in hope that it can collect enough funds for me to work on the project full time. It did not. But Patreon is good enough to get small monthly support.

theboy181 commented 7 years ago

@gonetz You deserve vacation, but I am confused about your Indiegog timeline. If you were planing on 3 month campaign, and you had vacation planed this may look a little confusing to your supporters.

Anyway, I have this to share with you for (if) you plan on making Naboo HLE.

Star Wars Episode 1 - Battle for Naboo (U) 60 FPS Hack

81080296 0001

Note: Needs OC x2

gonetz commented 7 years ago

The Indiegog timeline was planned in accordance with task difficulty, our experience and my vacation. Three month for task completion looked reasonable. Since campaign reached the goal within few days from start, the work started immediately. We worked hard and fast and completed the task to the end of the campaign. We kept our promises, so I see no reason for supporters to be confused.

fzurita commented 7 years ago

To me it sounds like @gonetz of planning vacation after seriously exhausting his brain power :)

gonetz commented 7 years ago

@fzurita You pretty close :) I have plenty of hard tasks on my work, plus hard tasks with my hobby. It really makes me feel exhausted.

AmbientMalice commented 7 years ago

When will the Rogue Squadron code be merged into the main branch?