Homebrew Official Citra - New 3DS Emulator

  • Thread starter Thread starter bunnei
  • Start date Start date
  • Views Views 3,859,280
  • Replies Replies 7,211
  • Likes Likes 175
Before I write this I want to mention that I'm indifferent to any piracy debates, I'm just curious what the overall goal of the project is. One sentence of the main post says its mainly going to be used for running/debugging homebrew, while the next sentence talks about how it can boot some commercial games. So that leaves me a bit confused as to what the final goal is. Is it a "perfect" emulation of the 3DS that can play homebrew as well as .3ds files and the likes, or is it a "perfect" emulation in the sense that it can be used to develop homebrew? I support the project ether way but I can't help but be curious :P


(I would love to contribute bth but this is far beyond the scope of my skills in c++ lol, I might end up throwing some of my tax refund money at the project though, it seems worthwhile.)
 
Different people have different reasons to work on the emulator, hence there is no fixed set of goals we would be striving for. I'm personally purely interested in recreating and documenting the hardware, while others probably aim rather for "a Dolphin for 3DS emulation".
 
  • Like
Reactions: minexew
I had to butcher the sprintf calls as well to get it to output correct shaders on VS2012, but after that everything worked great. You can pretty much do anything that doesn't involve using an item.

Once touch input is implemented, the game will be fully playable! At one point I tried to implement touch input, but at my skill level the best I could do was get touch input at 0,0 and nowhere else. I think I need a better understanding of both C++ and the Citra code :P
 
I'm curious: why were Legend of Zelda: Ocinera of Time 3D and Cave Story the only games to not just boot, but run fullspeed? What's the difference between these games and other games build/graphics-wise that make them so compatible with Citra 3DS?
 
I'm curious: why were Legend of Zelda: Ocinera of Time 3D and Cave Story the only games to not just boot, but run fullspeed? What's the difference between these games and other games build/graphics-wise that make them so compatible with Citra 3DS?
They are likely testbed games for the emulator, and sadly a byproduct of this is sometimes inconsistent or inaccurate emulation that, though it gets the job done with one game, might actually have negative repercussions with other games at large.

This is a common problem with emulation development, and we can see it it at its worst with some emulators for the N64. ZSNES's horrid sound and other issues are also a good example, where some games are just out-right broken.
 
  • Like
Reactions: cearp and minexew
Okay, so I think I'm starting to understand all this OpenGL stuff. I was trying to implement alpha testing in the OpenGL renderer, which is harder than it should be since GL_ALPHA_TEST is no longer a thing. I got readable text in Cave Story, and I also fixed the transitions, but I seem to have caused problems in Ocarina of Time. I'm going to keep working on this, I really want to know more about working with C++ and OpenGL :D
 
Wow, what you guys are all doing looks really cool. Can I help out at all? I have my own physical copy of Cave Story 3D if it helps. Is there any specific site with build instructions and bug reporting and stuff?
 
Any more experienced devs wanna help me learn OpenGL? My crappy attempt at alpha testing is here, and here are some results: 1 2 3 4
The first 2 are examples of Cave Story working as it should, and the last 2 are examples of regressions in Ocarina of Time. Who knows; after I learn some more about C++ and OpenGL, I could be a lot more useful to Citra :)
 
Any more experienced devs wanna help me learn OpenGL? My crappy attempt at alpha testing is here, and here are some results: 1 2 3 4
The first 2 are examples of Cave Story working as it should, and the last 2 are examples of regressions in Ocarina of Time. Who knows; after I learn some more about C++ and OpenGL, I could be a lot more useful to Citra :)
This is definitely not the correct way to approach things. Alpha test discards the fragments with alpha values that fall under a specific criteria - it just so happens that cave story's text has alpha 0 on the unshaded parts on the text so it also works if you enable basic alpha blending. This approach will obviously never work in all cases, plus alpha test and alpha blending can be enabled at tge same time in some cases.

It would be a better idea to implement this once the renderer is outputting fragment shaders, so that the alpha test function can be appended to the end of the fragment shader dynamically to discard fragments with alpha outwith the criteria. Despite this, it's a pretty cool hack that could allow someone to play though cave story now if they wanted :)
 
What RHY3756547 said.

Alpha testing needs to be implemented in a fragment shader. You can see which registers affect the actual alpha blending in the software renderer's rasterizer.cpp. Note that there are separate alpha and rgb blend equations, which is known as dual source blending (a term you'll probably want to look up to use the correct OpenGL functions).

EDIT: btw, good luck on your hacking¸ it's a great approach to learn new stuff ;)
 
I'm still having some trouble with these fragment shaders. I'm confused as to how to access the registers from within the shader. This time I'm fairly confident I'm on the right track, but I'm still not there. Right now I've got a very basic implementation that simply discards anything with an alpha value of zero. This time there are no regressions and it looks almost right for Ocarina of Time and Cave Story, but I think I need to go all or nothing here. I just need to figure out how to access the register values from within the shader and I think I'll be able to create a full implementation. Sorry if this is really simple and I'm overlooking something completely obvious :P Here's my current basic implementation.

tfarley implemented alpha testing, so I guess I don't need help anymore. At least I learned a few things from this though :) Also, looking at tfarley's code, I did have the general idea right, mine was just an unfinished and simple version.
 

Site & Scene News

Popular threads in this forum