Homebrew SNES9x for Old 3DS

vander263

Well-Known Member
Member
Joined
Jan 21, 2017
Messages
177
Trophies
0
Age
33
XP
52
Country
Brazil
^I Think that GBA VC is not emulated, it's simulated in the ARM9 core, so it's pretty much like running in a GBA, at cost of savestate, graphical improvements and etc.., but for that accuracy, i think it's a pretty good trade :D, but if bubble2k16 modify it, it would be AWESOME, really.
 
  • Like
Reactions: hobbledehoy899

BL4Z3D247

GBAtemp Stoner
Member
Joined
Oct 22, 2008
Messages
1,942
Trophies
0
Age
39
Location
I'm so high, I don't even know!
XP
1,229
Country
United States
-snip-

@bubble2k16, anyways, since we're talking bugs, any plan to fix the freezing when exiting via the Home button? Not a big deal, just was curious as I'm so used to closing apps that way. If not, I'll just have to train myself to exit through Snes9x.

Also, as much as VC injects are awesome, they're not as convenient as a standalone emulator. If you have a lot it's a tedious task of deleting and/or organizing them. So if you do decide to work on a GBA emulator I'd be all for that but Xenogears on a N3DS would be dope as well. Either way it looks like I need to get a N3DS for your next project. :)
 
Last edited by Minox,
  • Like
Reactions: DrFleming

RupeeClock

Colors 3D Snivy!
Member
Joined
May 15, 2008
Messages
6,497
Trophies
1
Age
34
Website
Visit site
XP
2,974
Country
I'm in the office, and I forgot my console, but can someone tell me if it's already solved the problem of transparency of some sprites like the water layer in Kirby Dreamland 3? :)
Still opaque, unfortunately.
To achieve transparency effects in Dreamland 3, some basic hi-res mode workaround would be needed.
Dreamland 3 uses hi-res mode to output "transparency" layers like bushes or water, which are actually just meshed sprites rendered at double resolution.
A hack like using the 3D mode to render a second image with hi-res layers offset by a single pixel might work, but there's probably better ways.
 

bubble2k16

Well-Known Member
OP
Member
Joined
Jul 25, 2016
Messages
467
Trophies
0
XP
2,118
Country
Senegal
To achieve transparency effects in Dreamland 3, some basic hi-res mode workaround would be needed.
Dreamland 3 uses hi-res mode to output "transparency" layers like bushes or water, which are actually just meshed sprites rendered at double resolution.
A hack like using the 3D mode to render a second image with hi-res layers offset by a single pixel might work, but there's probably better ways.

Is it in one of the early stages of KDL3? Any kind soul can PM me the save states with that problematic levels? I haven't gotten that far in. :) Thank you!

^I Think that GBA VC is not emulated, it's simulated in the ARM9 core, so it's pretty much like running in a GBA, at cost of savestate, graphical improvements and etc.., but for that accuracy, i think it's a pretty good trade :D, but if bubble2k16 modify it, it would be AWESOME, really.

What's interesting here is that the GBA shares some similar graphics hardware with the SNES (which was why we could get SnezziDS to run at all the DS - except for the missing priorities and a few other things the graphics hardware were practically 1-to-1 match). That means we could tap on the rendering routines I've done for SNES9x to be used on a GBA emulator (not the VC one). It is not likely to run full speed on an Old 3DS, but it can at least give some performance boost to an sufficiently accurate emulator and push the new 3DS. Which is the most accurate GBA emulator today? mGBA or gPSP? Or VisualBoyAdvance (which will require some work to port to 3DS)?

Then again, a GBA VC will run 100% full speed on an Old 3DS right? If only we could inject a menu and get it to boot a GBA ROM from any where in an SD card. :)

But then again, a PSX would be more interesting. Maybe, just maybe, it just needs slightly more work to get it to run at 60fps.

Argh... choices! :rofl2:
 

vander263

Well-Known Member
Member
Joined
Jan 21, 2017
Messages
177
Trophies
0
Age
33
XP
52
Country
Brazil
@bubble2k16, how Savestates works?, i would love to learn how to make emulators really, i know C and all, i've implemented some opcodes of 8080 CPU, but i don't understand how cycle sync works and how to inputs, screens, interrupts works too, what you could recommend to me to learn?
 

bubble2k16

Well-Known Member
OP
Member
Joined
Jul 25, 2016
Messages
467
Trophies
0
XP
2,118
Country
Senegal
@bubble2k16, how Savestates works?, i would love to learn how to make emulators really, i know C and all, i've implemented some opcodes of 8080 CPU, but i don't understand how cycle sync works and how to inputs, screens, interrupts works too, what you could recommend to me to learn?

Wow, it's an in-depth topic. The basics of cycle counting is that you will need to know how many clock cycles each CPU opcode takes to execute. Referring to the CPU's actual documentation will tell you that. So every time you emulate them, you have the add the clock cycles to a counter. From there you determine when to fire your interrupts. And once you run enough cycles (based on the MHz clock speed of the processor), you will know that when it's time to draw your frame.

The actual ROM program (the one you emulate) instructs the sound/graphics/other hardware by either sending software service commands or by writing to specific locations in memory. From there your emulator reacts accordingly by updating the state of the emulated graphics hardware, or performs some action. Like in SNES, writing to certain registers in memory triggers a data transfer to the graphic's Video RAM. Then, when it's time to draw your frame, you simply render to the screen based on the current state of the emulated graphics hardware, and all the bitmaps / textures supplied by the game.

The same idea applies to sound with a few exceptions - sound has to be generated fast enough so that it can be continuous, otherwise the player will hear clicks, pops or other horrible artifacts.

And save states? You basically take current hardware state (CPU registers, current clock cycle, graphics registers, sound hardware registers, memory, and everything that can change and affect emulation) and save it to storage. Then load it up again later to continue the emulator for where it was previously.

That's the general idea, but the devil is in all the details, and it can get quite crazy, because the console hardware (both graphics, sound and CPU) may have some bugs itself, and sometimes your emulator has to emulate these bugs for it to work correctly for some games. It's a tough job. :) It took many years for Snes9x to reach version 1.43 with close to full compatibility, and more to reach version 1.5+. But if you want to try, for a start, it's a good idea to take a look at source codes for the emulator for simpler machines, like NES, or Atari and see how they work.

Depending on what console you want to emulate, you have to really understand the hardware very very well. The internet is your friend here. For my SNES needs, I go to http://wiki.superfamicom.org/snes/show/65816+Reference (and of course the source code for Snes9x v1.43 was the primary source) You have to look for yours. :)

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

1-4 has the water soon into the level, and the first part has foreground elements. I'll try and get a save state for you if you still want it.

Oh ok, I stopped at 1-3. I'll go back and try tonight. Thanks! :)
 
Last edited by bubble2k16,

ArugulaZ

Well-Known Member
Member
Joined
Sep 17, 2009
Messages
677
Trophies
1
XP
1,111
Country
United States
I'll admit, I'm a little shocked that people are so eager to play Playstation games on their 3DS. Having said that, there's still a lot of work left to do on the PSOne emulator for the Vita and Adrenaline doesn't yet have that functionality, so by all means go for it. It'd be nice to play Street Fighter EX+ Alpha with a worthy controller... a Dual Shock just doesn't cut it for that kind of game, and the PSP is only barely better suited. The 3DS circle pad, on the other hand...
 

Canzah

Well-Known Member
Member
Joined
Jul 8, 2012
Messages
492
Trophies
0
XP
1,410
Country
United Kingdom
Which is the most accurate GBA emulator today? mGBA or gPSP? Or VisualBoyAdvance (which will require some work to port to 3DS)?
mGBA is most accurate right now.

Then again, a GBA VC will run 100% full speed on an Old 3DS right?
That's because it's not really being emulated but rather runs natively with the AGB_FIRM as far as I know.
 
Last edited by Canzah,

Vague Rant

Deceptively cute
Member
Joined
Aug 7, 2008
Messages
2,464
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,316
Country
@bubble2k16 You needn't go as far as 1-4 at all.

The first use of high-res occurs on 1-1, after entering this door:
ZSkn30q.png

Which leads to this room, with hi-res "translucent" floating leaves:
wgWiVwa.png


For something very slightly easier to see, you might try 1-2, with "translucent" foreground bushes (?) at the very start of the level.
qBRdGPM.png
 

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,565
Country
Chile
Wow, it's an in-depth topic. The basics of cycle counting is that you will need to know how many clock cycles each CPU opcode takes to execute. Referring to the CPU's actual documentation will tell you that. So every time you emulate them, you have the add the clock cycles to a counter. From there you determine when to fire your interrupts. And once you run enough cycles (based on the MHz clock speed of the processor), you will know that when it's time to draw your frame.

The actual ROM program (the one you emulate) instructs the sound/graphics/other hardware by either sending software service commands or by writing to specific locations in memory. From there your emulator reacts accordingly by updating the state of the emulated graphics hardware, or performs some action. Like in SNES, writing to certain registers in memory triggers a data transfer to the graphic's Video RAM. Then, when it's time to draw your frame, you simply render to the screen based on the current state of the emulated graphics hardware, and all the bitmaps / textures supplied by the game.

The same idea applies to sound with a few exceptions - sound has to be generated fast enough so that it can be continuous, otherwise the player will hear clicks, pops or other horrible artifacts.

And save states? You basically take current hardware state (CPU registers, current clock cycle, graphics registers, sound hardware registers, memory, and everything that can change and affect emulation) and save it to storage. Then load it up again later to continue the emulator for where it was previously.

That's the general idea, but the devil is in all the details, and it can get quite crazy, because the console hardware (both graphics, sound and CPU) may have some bugs itself, and sometimes your emulator has to emulate these bugs for it to work correctly for some games. It's a tough job. :) It took many years for Snes9x to reach version 1.43 with close to full compatibility, and more to reach version 1.5+. But if you want to try, for a start, it's a good idea to take a look at source codes for the emulator for simpler machines, like NES, or Atari and see how they work.

Depending on what console you want to emulate, you have to really understand the hardware very very well. The internet is your friend here. For my SNES needs, I go to http://wiki.superfamicom.org/snes/show/65816+Reference (and of course the source code for Snes9x v1.43 was the primary source) You have to look for yours. :)

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



Oh ok, I stopped at 1-3. I'll go back and try tonight. Thanks! :)

And just to complement those cool tips also there´s the "mapping" model, where you can inherit HLE behaviour on real hardware (because target platform is same instruction set as host platform, aka, virtualization):

http://gbatemp.net/threads/gbarunner2.451970/#post-6902997

That way you don´t need to emulate cycles, but just have GUEST hardware IO mapped (target platform you want to emulate, trapped), so when GUEST mapped IO wants to send/receive stuff from ROM code, the bit behaviour is 1:1 (or 1: 0,9) (:
 
Last edited by Coto,
  • Like
Reactions: raphamotta

BL4Z3D247

GBAtemp Stoner
Member
Joined
Oct 22, 2008
Messages
1,942
Trophies
0
Age
39
Location
I'm so high, I don't even know!
XP
1,229
Country
United States
@bubble2k16 You needn't go as far as 1-4 at all.

The first use of high-res occurs on 1-1, after entering this door:
ZSkn30q.png

Which leads to this room, with hi-res "translucent" floating leaves:
wgWiVwa.png


For something very slightly easier to see, you might try 1-2, with "translucent" foreground bushes (?) at the very start of the level.
qBRdGPM.png
Why don't I have those translucent issses? I'm using the v1.00 CIA. The leaves in level 1-1 are solid for me.
 

Vague Rant

Deceptively cute
Member
Joined
Aug 7, 2008
Messages
2,464
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,316
Country
Why don't I have those translucent issses? I'm using the v1.00 CIA. The leaves in level 1-1 are solid for me.
Haha. That is the issue, they're supposed to be translucent. Later on in the game, these sorts of things will obscure the gameplay more and more to the point where you won't be able to play like that at all. On a real SNES, the hi-res mode is used to output all the see-through stuff in the streaky way you see in those screenshots. But TVs of the day wouldn't be providing the sort of sharp, pixel-perfect images you see in these screenshots, so the result of the simple analog "filtering" was that on screen it would just look like normal translucency. The idea now is that any emulator playing Kirby's Dream Land 3 really needs to do that filtering that used to just be a side effect of composite video and CRT TVs.
 

BL4Z3D247

GBAtemp Stoner
Member
Joined
Oct 22, 2008
Messages
1,942
Trophies
0
Age
39
Location
I'm so high, I don't even know!
XP
1,229
Country
United States
Haha. That is the issue, they're supposed to be translucent. Later on in the game, these sorts of things will obscure the gameplay more and more to the point where you won't be able to play like that at all. On a real SNES, the hi-res mode is used to output all the see-through stuff in the streaky way you see in those screenshots. But TVs of the day wouldn't be providing the sort of sharp, pixel-perfect images you see in these screenshots, so the result of the simple analog "filtering" was that on screen it would just look like normal translucency. The idea now is that any emulator playing Kirby's Dream Land 3 really needs to do that filtering that used to just be a side effect of composite video and CRT TVs.
Ohhhhh! Gotcha. It's been a while since I've played that game so forgot it was supposed to be translucent.
@bubble2k16 Before closing out the project, do you think you can add support for Satella View games?
For Satellaview games use blargSNES VC injections. I think he already mentioned there wasn't anything planned to further compatibility for Satellaview games as it would be too difficult.

Yeah, here it is:
@WeedZ - I did some read up. It seemed really more difficult than I thought. Snes9x v1.43 never really had great support for BS-X in the first place.
 
Last edited by BL4Z3D247,

Canzah

Well-Known Member
Member
Joined
Jul 8, 2012
Messages
492
Trophies
0
XP
1,410
Country
United Kingdom
Awesome dude! This app is great. It truly proves that o3dses can run snes games. Been playing with it for a while and it works great. Only tested super mario world mega man x amd alttp. All run at 60 fps.
Nintendo saying O3DS can't do SNES emulation isn't entirely a lie. Their VC emulator is entirely software based. O3DS couldn't do SNES emulation without hacks and entirely in software.
 

NoNAND

Give me back my legions!
Member
Joined
Aug 22, 2015
Messages
2,274
Trophies
1
Location
Somewhere
XP
5,065
Country
Albania
Nintendo saying O3DS can't do SNES emulation isn't entirely a lie. Their VC emulator is entirely software based. O3DS couldn't do SNES emulation without hacks and entirely in software.
Ok. Well i think both snes9x and blargsnes use hardware rendering. Can you tell me the difference between them
 
  • Like
Reactions: Deleted User

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Cranesbill @ Cranesbill: I forgot I was in this group :skull: