Homebrew Official [5.5.0/1][WIP] LiteNESU - A terrible (userspace) NES emulator

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,197
Trophies
2
XP
33,815
Country
Mexico
Wow.
First the Gameboy emulator for Wii U and now this?

Wii U homebrew is sure getting really interesting.
Can't wait for a way to boot Homebrew without relying on the browser exploit. :D (And HDD support of course) :P
 
  • Like
Reactions: Masterwin

DeslotlCL

GBAtemp's scalie trash
Member
Joined
Oct 28, 2015
Messages
2,847
Trophies
0
XP
2,755
Country
United States
Wow.
First the Gameboy emulator for Wii U and now this?

Wii U homebrew is sure getting really interesting.
Can't wait for a way to boot Homebrew without relying on the browser exploit. :D (And HDD support of course) :P
wasnt the gameboy emulatpr only for 5.3/5.4? This nes emulator is for 5.5!

Btw fantastic news! But how will this load the roms?
 
Last edited by DeslotlCL,

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,197
Trophies
2
XP
33,815
Country
Mexico

DeslotlCL

GBAtemp's scalie trash
Member
Joined
Oct 28, 2015
Messages
2,847
Trophies
0
XP
2,755
Country
United States

rw-r-r_0644

Well-Known Member
Member
Joined
Jan 13, 2016
Messages
351
Trophies
0
Age
22
XP
741
Country
Italy
Wow, nice work!
For Mario Bros corruption it may be caused by 2 things:
-ROM Corruption
-emulated RAM corrupted/wrong adress (most likely)
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
Right now, it renders each pixel one at a time. As far as I can tell, this is the main reason why everything is so slow (the OSScreen method for putting a pixel onto the screen is called 61k+ times each frame!) I don't really want to add the extra load of upscaling on top of all that until I can find a better rendering method (GX2 maybe? If anyone knows how that works please let me know)
Check out the description on @vgmoose 's game, by storing the coreinit pointers and simply passing those around to your various functions, you can get some drastic speedups.
https://github.com/vgmoose/space

In addition to Kakkoii's suggestion, you might want to look into editing the pixels in a RAM buffer and then sending it to the GPU when you're done, instead of poking thousands of pixels to the screen per frame. That should be significantly faster as well, if the OSScreen functions support it. If not, maybe look into how GX2 works and figure out how to draw a textured rectangle (or two triangles drawn to be like a rectangle), with your pixel data as the texture.
 

QuarkTheAwesome

🦊
OP
Member
Joined
Apr 19, 2015
Messages
1,023
Trophies
1
Location
Stuck in the PowerPC
Website
heyquark.com
XP
3,909
Country
Australia
But how will this load the roms?
I've got some really overcomplicated instructions on GitHub. I admit it's not the best.

What are the odds that an ELF version could be forked by yourself/someone else to take full advantage of hardware on 5.3.2 and 5.4?

I've only got a 5.5 console so I can't, but if someone else wants to I have no objections. As long as they tell me if they fix one of my bugs ;3

Will definitely start working on those rendering tricks this arvo. Thanks!

--------------------- MERGED ---------------------------

Wow, nice work!
For Mario Bros corruption it may be caused by 2 things:
-ROM Corruption
-emulated RAM corrupted/wrong adress (most likely)
I'm probably gonna start work on a version with a simple debugger once I get rendering sorted out, hopefully that'll tell us which one ;3
 
D

Deleted User

Guest
Check out the description on @vgmoose 's game, by storing the coreinit pointers and simply passing those around to your various functions, you can get some drastic speedups.
https://github.com/vgmoose/space

Why did you pass them in a struct to every functions? It looks like it's just a bunch of dynamic pointer to the functions. It looks a bit like the OpenGL extention where you have to get the pointer of the functions before to use them (glBindBufferARB for exemple).

Why not making a kind of dynamic loader that make them available in the global scope of the application at startup? There something that make it impossible in the elf loader?
 

vgmoose

Well-Known Member
Member
Joined
Jan 31, 2016
Messages
360
Trophies
1
Website
github.com
XP
3,065
Country
United States
Thank you for making this homebrew! I'm surprised at the compactness of the NES emulator code. Cool stuff!

Why did you pass them in a struct to every functions? It looks like it's just a bunch of dynamic pointer to the functions. It looks a bit like the OpenGL extention where you have to get the pointer of the functions before to use them (glBindBufferARB for exemple).

Why not making a kind of dynamic loader that make them available in the global scope of the application at startup? There something that make it impossible in the elf loader?
My only reason is it would crash whenever I tried that! I figured that that may have been the reason they were looked up on each call, so the passing is just a workaround for the global definitions crashing.
 
Last edited by vgmoose,
D

Deleted User

Guest
My only reason is it would crash whenever I tried that! I figured that that may have been the reason they were looked up on each call, so the passing is just a workaround for the global definitions crashing.

Yes I guess your code run without the loader so global are unusable, but since there is an elf loader now it should be possible maybe :)

Edit: The example https://github.com/dimok789/hello_world from dimok789 use this
 
Last edited by ,

vgmoose

Well-Known Member
Member
Joined
Jan 31, 2016
Messages
360
Trophies
1
Website
github.com
XP
3,065
Country
United States
Yes I guess your code run without the loader so global are unusable, but since there is an elf loader now it should be possible maybe :)

Edit: The example https://github.com/dimok789/hello_world from dimok789 use this
So that example is for a HBL ELF, and I've got a branch here that does it that way. As seen here it no longer uses the struct-passing method. However! I haven't tested if this works on 5.5.x or not.

I have a suspicion that exporting the functions like that requires kernel access, but am happy to be proven wrong
 
  • Like
Reactions: Masterwin

QuarkTheAwesome

🦊
OP
Member
Joined
Apr 19, 2015
Messages
1,023
Trophies
1
Location
Stuck in the PowerPC
Website
heyquark.com
XP
3,909
Country
Australia
After a bit of work, I've made the OSScreen methods global (similar to what @romain337 said) and it definitely seems a bit quicker. I've also cleaned up the drawing helpers I wasn't using, so that all good.
I couldn't upload a binary to GitHub ("something went wrong." I think their error messages are a bit too specific!) so I've attached it below.

Also, if anyone knows their way around GX2 that'd be awesome since it seems to me like OSScreen can't provide me a better option than rendering the pixels one at a time (happy to be proven wrong!).

EDIT: @Kakkoii Done, thanks!
 

Attachments

  • boot-preR2.elf.zip
    12.8 KB · Views: 201
Last edited by QuarkTheAwesome,

Kakkoii

Old fart
Member
Joined
Sep 14, 2007
Messages
631
Trophies
0
XP
586
Country
Canada
After a bit of work, I've made the OSScreen methods global (similar to what @romain337 said) and it definitely seems a bit quicker. I've also cleaned up the drawing helpers I wasn't using, so that all good.
I couldn't upload a binary to GitHub ("something went wrong." I think their error messages are a bit too specific!) so you'll have to compile it yourself for now.

Also, if anyone knows their way around GX2 that'd be awesome since it seems to me like OSScreen can't provide me a better option than rendering the pixels one at a time (happy to be proven wrong!).
You can attach a zip containing the binary to this forum post instead of the github.
 

QuarkTheAwesome

🦊
OP
Member
Joined
Apr 19, 2015
Messages
1,023
Trophies
1
Location
Stuck in the PowerPC
Website
heyquark.com
XP
3,909
Country
Australia
Finished a basic debugger here. I guess I'm gonna be spending some time with SMB now ;3
It's probably RAM corruption - I've noticed a few weird things just while making sure the debugger works.

Also, has anyone else noticed that you can't declare a global variable with an initial value properly? It seems like you have to add 1 to the value you actually want.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Julie_Pilgrim @ Julie_Pilgrim:
    the internet
  • Julie_Pilgrim @ Julie_Pilgrim:
    @Psionic Roshambo i have 16 gb in my pc and i run into issues with ram more than i'd like to admit
  • HiradeGirl @ HiradeGirl:
    I got only 8GB of RAM. But I want 32GB.
  • Sonic Angel Knight @ Sonic Angel Knight:
    Time to just download more ram
  • K3Nv2 @ K3Nv2:
    Yeah search Google
  • Sonic Angel Knight @ Sonic Angel Knight:
    Or, I also heard that if you use flash memory, it can act as more "RAM" at least windows tell me when I stick a flash drive into it.
  • Veho @ Veho:
    It can act as a swap drive but that isn't more RAM, it's slooow.
  • K3Nv2 @ K3Nv2:
    I wish we could have 1Gbps external storage by now
  • K3Nv2 @ K3Nv2:
    Like for micro
  • Veho @ Veho:
    New Myoo.
  • SylverReZ @ SylverReZ:
    @Veho, Yooo noice
  • SylverReZ @ SylverReZ:
    Looks like a Famicom handheld
  • Veho @ Veho:
    Yeah, they were going for that.
  • Veho @ Veho:
    It's not very good though.
  • Veho @ Veho:
    I'm watching the review, the emulators it uses suck bawls.
  • Veho @ Veho:
    Software update might improve it.
  • Psionic Roshambo @ Psionic Roshambo:
    Or maybe someone will make like Emulation Station for it or something?
  • Veho @ Veho:
    That counts as a software update :tpi:
    +1
  • OctoAori20 @ OctoAori20:
    Ello
  • K3Nv2 @ K3Nv2:
    I can think of the design teams process another joystick and no audio or a joystick and mono audio
  • Veho @ Veho:
    "You think we can just put the speakers at the top
    ?" "NO!"
    +1
  • K3Nv2 @ K3Nv2:
    Pft stereo speakers you're fired
    +1
    K3Nv2 @ K3Nv2: Pft stereo speakers you're fired +1