• HomeBoards
  • RulesRules
  • HelpHelp
  • WikiWiki
  • Donate

Author Topic: Mupen64plus technical preview  (Read 46300 times)

Nebuleon (OP)

  • Posts: 37
Mupen64plus technical preview
« on: November 12, 2015, 08:26:15 am »
Hey guys!

Now that I have your attention... I'd like you guys to test Mupen64plus. (No, this wasn't a bait-and-switch topic.)

Before reading further, please heed Surkow's warnings about this thread in posts #3 and #28. tl;dr Support of games is not guaranteed. Full-speed gameplay is not guaranteed.

It's the result of 2 years of trying things with JIT compilation and finally arriving at a result I like. I'll spare you guys the technical details, but the JIT is much faster than the interpreter at doing its job. There are other jobs to do in an N64 emulator, like emulating the RSP and RDP, and handling video and audio, so while the task of emulating the CPU is much faster, all the other tasks are still running at the same speed, which may not be enough. I'm in the process of cleaning up the one massive commit that I wrote everything into, and writing documentation about the technical details so that interested people may read about everything.

So, while I'm fairly certain the JIT should be compatible with all the games the interpreter is compatible with (which is quite a lot of them), I'm not really able to test all games, so I'd like you guys' help on this, as well as a few more requests at the end of this post.

Here are two builds of Mupen64plus. The first is the highly compatible, but slow, interpreter build. It is the reference implementation that the JIT compiler should run like. The second is the faster JIT compiler build. If it doesn't run a game like the interpreter does, that's a bug.

Interpreter build: https://dl.dropboxusercontent.com/u/106475413/gcw-zero/preview/mupen64plus-interp.opk

JIT build (updated 2015-11-15): https://dl.dropboxusercontent.com/u/106475413/gcw-zero/preview/mupen64plus-alpha-20151115.opk
Source code is at the end of this post.

These are bare emulator builds. The usual gmenu2x file selector allows you to select uncompressed .n64, .v64 or .z64 format ROMs. There is no frontend with which to rewind, save states, modify configuration, or any of that.

When launching a ROM, especially one that is 16 MiB in size or more, please note that the GCW Zero will need to read, hash (for lookups in the ROM database, keyed on the MD5 hash) and byte-swap (the Nintendo 64 is big-endian, and the GCW Zero is little-endian) the ROM. It is a time-consuming task, which contributes to high startup time.

-- Controls --

You should be able to use the following controls to play N64 games:

(GCW Zero button = N64 button)
D-pad, A, B, Start, L Trigger, R Trigger = Same
D-pad = Analog
D-pad = D-pad
Analog = Nothing
Y = Z Trigger
X = C Button Left
Select = (Exit emulator)

The lack of analog nub mapping in this test version is due to mupen64plus-input-sdl not allowing a keyboard and a joystick to be used for the same player, as well as my lack of interest to investigate that due to my test GCW Zero having an analog nub that constantly reads fully up and to the left as soon as it's a little bit off-center, which makes using the analog nub aggravating.

As for the C Buttons, only C Button Left is mapped, because the GCW Zero has insufficient inputs, and A and B are pretty important.

-- My requests to everyone --

  • I'm no good when it comes to frontends. I'd like it if a frontend better than a bare emulator could be built. I would then include the frontend in the OPK if its license allows for that.
  • I'm no good when it comes to 3D and OpenGL (desktop or embedded). The graphics look odd in some games, but if they look as odd on the JIT as they do on the interpreter, I can't do much about that. Perhaps one of you could build gonetz's GlideN64 plugin and see if it's fast enough and compatible with OpenGL ES 2, or help fix it or report bugs if not. And then I could also include that in the OPK.
  • The input mapping may need adjustment per game to fit with the GCW Zero's buttons, of which there are fewer than on a Nintendo 64 controller. That would require per-game configuration in a frontend, similar to how ReGBA does it.
  • With that in mind, please report bugs in the JIT and I'll be happy to investigate them.

Improvements, praise and hate mail all go here! GitHub will be better for JIT bug reports, but they may go here too. Post away!

-- Source code that went into this release --

https://github.com/mupen64plus/mupen64plus-ui-console
https://github.com/Nebuleon/mupen64plus-core/commits/trace-jit-experimental
https://github.com/mupen64plus/mupen64plus-input-sdl
https://github.com/mupen64plus/mupen64plus-audio-sdl
https://github.com/mupen64plus/mupen64plus-rsp-hle
https://github.com/Nebuleon/mupen64plus-video-gles2n64 (this is based on a gles2n64 source dump, itself based on the GLN64 source code)
« Last Edit: November 16, 2015, 12:08:11 am by Nebuleon »
The Cloud is nice, but not if it decides to rain on your parade.

howie_k

  • Posts: 157
Re: Mupen64plus technical preview
« Reply #1 on: November 12, 2015, 09:32:51 am »
Glad to see you back on the boards, you were sorely missed

thefifthgiant

  • Posts: 108
Re: Mupen64plus technical preview
« Reply #2 on: November 12, 2015, 01:35:06 pm »
Glad to see you back on the boards, you were sorely missed

First of all, this. It's good to see you again nebuleon!

Secondly, wow! I thought that the possibility of an n64 emulator being worked on was killed off already. This thread will be swarming with posts soon I bet ;)

I'll do some testing when I get home later tonight and report back!

Surkow

  • * Administrator
  • Posts: 690
Re: Mupen64plus technical preview
« Reply #3 on: November 12, 2015, 02:42:43 pm »
Just as a reminder, although the Mupen64Plus technical preview work is impressive and exciting, end-users should not arrive here with the wrong expectations. Do not ask for support of specific games or if or when games become "faster". It is a work in progress and there is no guarantee of games being playable whatsoever.

Posting about game compatibility is fine, including any bugs you might encounter.

Harteex

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Mupen64plus technical preview
« Reply #4 on: November 12, 2015, 05:30:41 pm »
Awesome stuff Neb!

Looking forward to test and play around with later.

Greetdeath

  • Posts: 26
Re: Mupen64plus technical preview
« Reply #5 on: November 12, 2015, 06:10:14 pm »
Good to see you back!

Tested F-Zero X and Paper Mario, apart from some graphical glitches and weird textures, is impressive how well they run.

Screenshots for the curious:











Fluxchar

  • Posts: 127
Re: Mupen64plus technical preview
« Reply #6 on: November 12, 2015, 07:16:16 pm »
wow... will do testing when I get home. great to see nebu again

zhongtiao1

  • Posts: 249
Re: Mupen64plus technical preview
« Reply #7 on: November 12, 2015, 07:40:29 pm »
WOW. Great job Nebuleon! And thanks for coming back :)
Will test later today

Quickman

  • Posts: 220
Re: Mupen64plus technical preview
« Reply #8 on: November 12, 2015, 07:51:28 pm »
 This post made me squeal like a 13-year-old girl !!!

 It's amazing to see the possibility still remains! So exciting, I can't say it enough, this is just so exciting!

 Thank you
 for all of your incredible work Neb!
 if no one thanks you enough, allow me to do so at this exact moment,
thank you x 100,000,000,000,000,000,000,000,000,000 !!!
(I cannot remember how many zeros are in a Googolplex...I think 100, but just know that's what I was going for)

Can't wait to test   :) :) :D

THANK YOU!!
« Last Edit: November 13, 2015, 04:48:32 pm by Quickman »

Quickman

  • Posts: 220
Re: Mupen64plus technical preview
« Reply #9 on: November 12, 2015, 07:59:53 pm »
 Also if anyone would like to post YouTube video/quick clips of Nintendo 64 working emulation for comparison reasons and speed, I'd love to test and compare with others. Video footage always helps me greatly with bugs and glitches. Either way I'm very excited
And this is huge.

@Greetdeath how would you say your speed was (in percentage %) on the game photos you posted? Which emu build did you go with?
« Last Edit: November 12, 2015, 10:49:26 pm by Quickman »

David Knight

  • Posts: 577
Re: Mupen64plus technical preview
« Reply #10 on: November 12, 2015, 09:25:46 pm »
-- My requests to everyone --

  • I'm no good when it comes to frontends. I'd like it if a frontend better than a bare emulator could be built. I would then include the frontend in the OPK if its license allows for that.
  • I'm no good when it comes to 3D and OpenGL (desktop or embedded). The graphics look odd in some games, but if they look as odd on the JIT as they do on the interpreter, I can't do much about that. Perhaps one of you could build gonetz's GlideN64 plugin and see if it's fast enough and compatible with OpenGL ES 2, or help fix it or report bugs if not. And then I could also include that in the OPK.
  • The input mapping may need adjustment per game to fit with the GCW Zero's buttons, of which there are fewer than on a Nintendo 64 controller. That would require per-game configuration in a frontend, similar to how ReGBA does it.
  • With that in mind, please report bugs in the JIT and I'll be happy to investigate them.

I'll happy help out with coding the frontend, although I'd need help with any graphics assets.

ker

  • Posts: 620
Re: Mupen64plus technical preview
« Reply #11 on: November 12, 2015, 10:47:59 pm »
Nice to see you again and thank you very much for your work!!

Eliwood_san

  • Posts: 255
Re: Mupen64plus technical preview
« Reply #12 on: November 13, 2015, 12:07:35 am »
Thank you nebuleon for your support, im glad you come back here :3
« Last Edit: November 13, 2015, 12:13:26 am by alexei_gp »

care16la20

  • Posts: 178
Re: Mupen64plus technical preview
« Reply #13 on: November 13, 2015, 01:02:51 am »

Hi, for an alpha version: SUPERB RELEASE

Tried the JIT only with some games and:

- Mario Kart is FULL SPEED on time attack on most of the tracks
- Mario 64 is almost full speed but playable as I saw so far
- Harvest Moon 64 is almost full speed; Totally playable
- Quest 64 seems to be good speed but lacks the analog control so you cant move
- Yoshi Story is full speed but gfx is not good at all
- Cruisin USA stucks on a msg about mem card on the beginning
- Some games like Blast Corps only show the Nintendo logo and dont go further
- Banjo Kazzoie is FULL SPEED on not so large open areas (i was not going to try that one to not being disappointed and BANG !)

Again, superb alpha release Thanksssss
« Last Edit: November 13, 2015, 01:15:06 am by care16la20 »

Quickman

  • Posts: 220
Re: Mupen64plus technical preview
« Reply #14 on: November 13, 2015, 01:25:49 am »

Hi, for an alpha version: SUPERB RELEASE

Tried the JIT only with some games and:

- Mario Kart is FULL SPEED on time attack on most of the tracks
- Mario 64 is almost full speed but playable as I saw so far
- Harvest Moon 64 is almost full speed; Totally playable
- Quest 64 seems to be good speed but lacks the analog control so you cant move
- Yoshi Story is full speed but gfx is not good at all
- Cruisin USA stucks on a msg about mem card on the beginning
- Some games like Blast Corps only show the Nintendo logo and dont go further
- Banjo Kazzoie is FULL SPEED on not so large open areas (i was not going to try that one to not being disappointed and BANG !)

Again, superb alpha release Thanksssss
@care16la20
 This is so exciting! Thanks for all the feedback! I'll definitely be comparing notes to what I see on this thread.
You guys are the best, thank you so much for all your hard work!
Again, THIS IS SO EXCITING :)

thefifthgiant

  • Posts: 108
Re: Mupen64plus technical preview
« Reply #15 on: November 13, 2015, 01:31:22 am »
Ok, here we go, I tested a few games after work. Note that I wasn't able to have my volume on so I can't comment on sound.

Conkers Bad Fur Day:
Interpreter: Very slow, graphical glitches
JIT: same, but slightly faster

F-zero X: Climax (Hack):
Interpreter: A few glitches but pretty much full speed
JIT: same

Majora's Mask:
Interpreter: Very slow
JIT: slightly faster, still unplayable

Megaman 64:
Interpreter: Slow, but graphics looked good
JIT: not much different

The New Tetris:
Interpreter: reasonable speed, lots of graphical glitches (the pieces don't even show up!)
JIT: same

Ogre Battle 64:
Interpreter: graphics good, super slow intro (I was too impatient to wait for gameplay  :P)
JIT: Same, perhaps a little faster

Pokemon Stadium 2:
Interpreter: reasonable speed, a few graphics issues
JIT: same

Super Smash Bros.:
Interpreter: very slow
JIT: Same

Turok 2:
Interpreter: slow, graphics pretty good
JIT: Same, but somewhat faster

And because I was curious/optimistic/naive about the possibilities...

World Driver Championship
Interpreter: crash on boot (no surprise there)
JIT: crash on boot

Nebuleon (OP)

  • Posts: 37
Re: Mupen64plus technical preview
« Reply #16 on: November 13, 2015, 01:40:26 am »
Hi, for an alpha version: SUPERB RELEASE

Tried the JIT only with some games and:

- Mario Kart is FULL SPEED on time attack on most of the tracks
- Mario 64 is almost full speed but playable as I saw so far
- Harvest Moon 64 is almost full speed; Totally playable
a) - Quest 64 seems to be good speed but lacks the analog control so you cant move
- Yoshi Story is full speed but gfx is not good at all
- Cruisin USA stucks on a msg about mem card on the beginning
b) - Some games like Blast Corps only show the Nintendo logo and dont go further
- Banjo Kazzoie is FULL SPEED on not so large open areas (i was not going to try that one to not being disappointed and BANG !)

Again, superb alpha release Thanksssss

a) The directional cross on the GCW Zero should be mapped to the analog stick on player 1's N64 controller. I'll investigate the input mapping using X-OD-NeedsJoystick and separate the N64 d-pad from its analog stick.

b) Even the interpreter gets stuck on Blast Corps. I see the JIT compiling plenty of code after the Rare logo, but then it gets stuck in an emulated idle loop and redraws the same frame over and over. This is odd. It must require a feature that the main Mupen64plus code repository doesn't handle.
The Cloud is nice, but not if it decides to rain on your parade.

Nebuleon (OP)

  • Posts: 37
Re: Mupen64plus technical preview
« Reply #17 on: November 13, 2015, 01:56:20 am »
Ok, here we go, I tested a few games after work. Note that I wasn't able to have my volume on so I can't comment on sound.

Conkers Bad Fur Day:
Interpreter: Very slow, graphical glitches
a) JIT: same, but slightly faster

F-zero X: Climax (Hack):
Interpreter: A few glitches but pretty much full speed
JIT: same

Majora's Mask:
Interpreter: Very slow
JIT: slightly faster, still unplayable

Megaman 64:
Interpreter: Slow, but graphics looked good
JIT: not much different

The New Tetris:
b) Interpreter: reasonable speed, lots of graphical glitches (the pieces don't even show up!)
JIT: same

Ogre Battle 64:
Interpreter: graphics good, super slow intro (I was too impatient to wait for gameplay  :P)
JIT: Same, perhaps a little faster

Pokemon Stadium 2:
Interpreter: reasonable speed, a few graphics issues
JIT: same

Super Smash Bros.:
Interpreter: very slow
c) JIT: Same

Turok 2:
Interpreter: slow, graphics pretty good
JIT: Same, but somewhat faster

And because I was curious/optimistic/naive about the possibilities...

World Driver Championship
d) Interpreter: crash on boot (no surprise there)
JIT: crash on boot


a) I'll disagree here. Because Conker's Bad Fur Day is one of those games that give emulators trouble, due to the way it uses interrupts, exceptions, and virtual memory, I tested it extensively during the creation of the JIT, and in places, it's 4x faster than the interpreter. Though, in the others, the time taken by the GCW Zero on graphics alone is over 50%...

b) Ouch. I don't know what to do here. If you know how to unpack the OPK, mark 'mupen64plus' as executable and run it through SSH or gmenu2x, try editing the file called gles2n64.conf to see if a setting allows you to see the pieces.

c) Yep. Smash runs at 60 FPS; it's one of the few N64 games to do that. Graphics time is over 60% in that game.

d)
Code: [Select]
Core: Compiling LUI at native 702C7F94
Core: Compiling B at native 702C7F98
Core: Compiling B/[cycle count update] at native 702C7F9C
Core: Compiling B/SW at native 702C7FA8
Core: compiled 80001584+   3 at 702C7F84+ 184
Segmentation fault

The interpreter crashes too, though? That SW (Nintendo 64) instruction must be doing some really nasty stuff!

edit:

Code: [Select]
Program received signal SIGSEGV, Segmentation fault.
0x74f0acac in gDPLoadTLUT(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) () from ./mupen64plus-video-n64.so

Comes from the video plugin trying to access address 77C525A7 (for me) using a 16-bit load, but the address is both unaligned by 1 (which is somewhat bad) and not even referring to allocated memory (which is very bad).

Thanks for your testing :)
« Last Edit: November 13, 2015, 02:12:13 am by Nebuleon »
The Cloud is nice, but not if it decides to rain on your parade.

codingcampbell

  • Posts: 25
Re: Mupen64plus technical preview
« Reply #18 on: November 13, 2015, 02:10:12 am »
Thank you Nebuleon and others involved! I figured the GCW just didn't have the power for this, but this is a very impressive alpha release. Not knowing anything about emulators, my inclination is that audio processing is holding a lot of games back. I'd be interested in seeing a build without audio processing just to see if that's true. And hey, I'd play a muted full-speed Smash ;)

It'd also be great to have a L->Z and R->R shoulder mapping for games like Star Fox.


Here's a video for those interested in seeing it in action. Sorry for crappy focus, I'm not a video-making person really:

<a href="https://web.archive.org/web/20210724230644/https://www.youtube.com/watch?v=j-0RtQHvItQ" target="_blank">https://www.youtube.com/watch?v=j-0RtQHvItQ</a>

edit: I'm wrong about the button mapping (here and in the video), though shoulder buttons weren't working for me.

Quick summary:

Using the JIT build only. The interpreter seems to work the same, just slower.

1. Diddy Kong Racing - major graphical glitches, pretty trippy effect though

2. Star Fox 64 (1:50, gameplay at 4:10) - slow cutscenes and audio, first stage playable with some various graphical glitches

3. Super Mario 64 (5:50) - very playable, just slow

4. Super Smash Bros (10:30) - playable but slow, graphical glitches (e.g no eyes on pikachu, hah). Also there's a freeze (not a crash) you can see in the video at 12:00

5. Yoshi's Story (12:30) - 2D sprites seem to be working but none of the polygons really

« Last Edit: November 13, 2015, 02:20:51 am by codingcampbell »

Nebuleon (OP)

  • Posts: 37
Re: Mupen64plus technical preview
« Reply #19 on: November 13, 2015, 02:40:32 am »
Thank you Nebuleon and others involved! I figured the GCW just didn't have the power for this, but this is a very impressive alpha release. Not knowing anything about emulators, my inclination is that audio processing is holding a lot of games back. I'd be interested in seeing a build without audio processing just to see if that's true. And hey, I'd play a muted full-speed Smash ;)

It'd also be great to have a L->Z and R->R shoulder mapping for games like Star Fox.
Yeah, it'd make sense for Star Fox 64, but then other games that need L and R wouldn't get them, and so on. It's why a good frontend with per-game mappings would be better due to the GCW Zero not having enough buttons.

Here's a video for those interested in seeing it in action. Sorry for crappy focus, I'm not a video-making person really:

YOUTUBE OBJECT

edit: I'm wrong about the button mapping (here and in the video), though shoulder buttons weren't working for me.

Quick summary:

Using the JIT build only. The interpreter seems to work the same, just slower.

1. Diddy Kong Racing - major graphical glitches, pretty trippy effect though

2. Star Fox 64 (1:50, gameplay at 4:10) - slow cutscenes and audio, first stage playable with some various graphical glitches

3. Super Mario 64 (5:50) - very playable, just slow

4. Super Smash Bros (10:30) - playable but slow, graphical glitches (e.g no eyes on pikachu, hah). Also there's a freeze (not a crash) you can see in the video at 12:00

5. Yoshi's Story (12:30) - 2D sprites seem to be working but none of the polygons really
1. [Diddy Kong Racing] Wow, that looks so bad!

2. The weird letter offsetting in Star Fox 64 is an issue with texture index numbers in the video plugin; it's not your ROM. You'll notice that, within a single "text cutscene", every instance of one letter is always the next or previous letter in the alphabet. You can see a lot of them in the voice-acted cutscene before entering Corneria.

3. [Super Mario 64] Yeah, this one runs pretty well! Note that the cake cutscene is fullspeed, or close to fullspeed, as Lakitu appears, but then as Peach's Castle also appears, the frame rate drops considerably, and in the Bob-Omb Battlefield, it sounds like it runs about 50% as fast as an N64.

4. [Super Smash Bros.] Oh, maybe a softlock caused by the JIT. Do you happen to know if it also happens in the interpreter?

5. [Yoshi's Story] Well, that's disappointing; you don't see anything...

If you know how to unpack the OPK, mark 'mupen64plus' as executable and run it through SSH or gmenu2x, try editing the file called gles2n64.conf to see if a setting allows you to see anything more than what you're seeing now. I suspect depth-test settings will make it work better, but it'll probably be slower.
The Cloud is nice, but not if it decides to rain on your parade.