Homebrew blargSnes -- SNES emulator for the 3DS (WIP)

Status
Not open for further replies.

DiscostewSM

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
5,472
Trophies
1
Location
Sacramento, California
Website
lazerlight.x10.mx
XP
4,998
Country
United States
A game like Donkey Kong Country may work well with 3D because the layers seem complete and separate from one another, but a game like Final Fantasy VI may not do so well because the map layout for places like towns use the tiles of the layers to kinda stitch it all together, even though the tiles are on separate layers, not to mention that sprites would shift from being above one layer to being behind them for areas like bridges, causing an unusual and sudden change in depth.

Not saying the 3D effect isn't useful, it's just not optimal for all situations.
 

spinal_cord

Knows his stuff
Member
Joined
Jul 21, 2007
Messages
3,177
Trophies
0
Age
41
Location
somewhere
Website
spinalcode.co.uk
XP
2,601
Country
A game like Donkey Kong Country may work well with 3D because the layers seem complete and separate from one another, but a game like Final Fantasy VI may not do so well because the map layout for places like towns use the tiles of the layers to kinda stitch it all together, even though the tiles are on separate layers, not to mention that sprites would shift from being above one layer to being behind them for areas like bridges, causing an unusual and sudden change in depth.

Not saying the 3D effect isn't useful, it's just not optimal for all situations.



Simple solution -- user separation settings + use the 3D slider :-)
 
  • Like
Reactions: dubbz82

gamesquest1

Nabnut
Global Moderator
Joined
Sep 23, 2013
Messages
15,153
Trophies
2
XP
12,226
personally i think if your doing it for the 3ds you should atleast try to get some sort of 3D effect to make it......standout:rofl:
 

Kane49

Well-Known Member
Member
Joined
Nov 4, 2013
Messages
446
Trophies
0
Age
35
XP
343
Country
Gambia, The
SNES Games always have a sprite layer, basic 3DS should just have the sprite layer in the front and thats it :)

bQDr9UR.png
 

gamesquest1

Nabnut
Global Moderator
Joined
Sep 23, 2013
Messages
15,153
Trophies
2
XP
12,226
I'd much prefer that to be optional.
the 3d slider makes 3d always optional.....but then again i also didn't say "3D should be mandatory" i just meant that even if the 3d effect isn't fantastic it would still be cool to at least have a little play around with it to see what it looks like, i think the ini settings would be a good idea so games that work well with it could have it enabled and then there can be game specific tweaks if some games use odd layer setups...or it could just always be disabled for games where its particularly bad

but still all this talk of 3D and its not even properly working yet :P

couple of games i think 3d would work pretty well for would be shoot 'em ups off the top of my head like pop 'n twinbee,super strike gunner, R-type. im sure other games could work well but shoot 'em ups seem like the most natural games for it to work well with it
 

GorTesK

Mad Hatter
Member
Joined
Jan 29, 2013
Messages
1,099
Trophies
0
Age
33
Location
Down The Rabbit Hole
XP
591
Country
Gambia, The
No one has answered my question!!!! HOW DO I RUN BLARGSNES?

you have to compile it from the source
if you don't know how, then maybe this is nothing you should use
there is a reason, why the author said, he will release a compiled version, when it is ready - before that everything is experimental
 
  • Like
Reactions: Margen67

the_randomizer

The Temp's official fox whisperer
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
37
Location
Dr. Wahwee's castle
XP
18,927
Country
United States
the 3d slider makes 3d always optional.....but then again i also didn't say "3D should be mandatory" i just meant that even if the 3d effect isn't fantastic it would still be cool to at least have a little play around with it to see what it looks like, i think the ini settings would be a good idea so games that work well with it could have it enabled and then there can be game specific tweaks if some games use odd layer setups...or it could just always be disabled for games where its particularly bad

but still all this talk of 3D and its not even properly working yet :P

couple of games i think 3d would work pretty well for would be shoot 'em ups off the top of my head like pop 'n twinbee,super strike gunner, R-type. im sure other games could work well but shoot 'em ups seem like the most natural games for it to work well with it


Getting the sprites to show up and other stability is top priority. Let the emulator get into a working state before suggesting 3D.
 

gamesquest1

Nabnut
Global Moderator
Joined
Sep 23, 2013
Messages
15,153
Trophies
2
XP
12,226
Getting the sprites to show up and other stability is top priority. Let the emulator get into a working state before suggesting 3D.
thats the point i was trying to make there originally,
but still all this talk of 3D and its not even properly working yet :P
but got a bit sidetracked with talk about how 3D *could* work good on some games
 
  • Like
Reactions: Margen67

planetarian

Well-Known Member
Member
Joined
Aug 5, 2014
Messages
143
Trophies
0
Age
35
XP
364
Country
United States
Sure, your explanation makes sense, but I really don't think any SNES games did that. Load up an snes emulator that allows removing layers (usually with num keys 1-5) I don't remember ever sing a game where the back/foreground is masked out in any way. Usually the whole layer is drawn, quite often if there was more than one background layer used, it was for parallaxling so would scrol at different speeds anyway.

Naturally, it's not something that every game, or even a significant number of games, would do. It is beneficial to do it that way, but it does take a bit more finesse to pull off.

I'm just making note that some games DO use slightly different rendering mechanisms that may not be perfectly compatible with the standard layering mechanism. Other examples of games that would break standard layer rendering would be any games that do 3D or pseudo-3D rendering (see: racing games, star fox, DOOM)...
 

shinyquagsire23

SALT/Sm4sh Leak Guy
Member
Joined
Nov 18, 2012
Messages
1,970
Trophies
0
Age
24
Location
Las Vegas
XP
3,638
Country
United States
Naturally, it's not something that every game, or even a significant number of games, would do. It is beneficial to do it that way, but it does take a bit more finesse to pull off.

I'm just making note that some games DO use slightly different rendering mechanisms that may not be perfectly compatible with the standard layering mechanism. Other examples of games that would break standard layer rendering would be any games that do 3D or pseudo-3D rendering (see: racing games, star fox, DOOM)...

A per-game setting system might solve this, where each game as a sort of config file and maybe certain RAM hooks to determine which layers go where on the Z stack in which areas.
 

Arisotura

rise of melonism
OP
Member
Joined
Dec 5, 2009
Messages
839
Trophies
1
Age
28
Location
center of the Sun
Website
kuribo64.net
XP
2,452
Country
France
Indeed. I also think that pseudo-3D games that make use of Mode7-powered perspective or SuperFX will work better in 3D. Sidescrollers might work but it'd have to be tried out. Games that use non-Mode7 pseudo-3D (Pokémon style) won't work well at all without major hacks.

But for now, funky 3D effects aren't what I'm after.


I'm going to reimplement savegames. The reason it was disabled was that I wanted to get the lolSnes core working on the 3DS, and disabled all the extra stuff that could have interfered so I'd know where issues would come from. Now this can safely be reenabled.

After that, I'd like to experiment a new event scheduler system, hoping it'll bring some speedup. I'll let you know :)

Past all that, what will remain will be mostly some PPU tidbits, and I will be able to release a first blargSnes version I guess :)


Unrelatedly, it'd be nice if someone could get the exheader and accessdesc of Super Mario 3D Land, so we can verify if the rumor that it uses the two ARM11 cores is true. I dumped my SM3DL cart but the exheader and accessdesc are encrypted.

I tried to modify makerom so I could build a .3ds with an affinity mask of 3 instead of 1. But that .3ds wouldn't start, the system would just go 'the cart has been ejected'. Either I missed something there, or it's just not possible to use the two cores.

I hope it's possible. It would greatly help with performance in the case of blargSnes.
 

DiscostewSM

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
5,472
Trophies
1
Location
Sacramento, California
Website
lazerlight.x10.mx
XP
4,998
Country
United States
Indeed. I also think that pseudo-3D games that make use of Mode7-powered perspective or SuperFX will work better in 3D. Sidescrollers might work but it'd have to be tried out. Games that use non-Mode7 pseudo-3D (Pokémon style) won't work well at all without major hacks.

Unless I'm mistaken, attempting to get the 3D effect with Mode7 usage may not entirely be possible, at least not in the way we want it. The layer may scale and rotate, but technically, there isn't any real depth to work off of except for the priority that all other layers work off of. Even if you attempted to work off of scaling, it would still have to be confined within the boundary of all other layers, sprites included, because changing how it appears depth-wise would look off if it makes it go far back or forward enough past another layer's depth. It would make a nauseating effect similar to when you tilt the 3DS enough so that what each eye sees is swapped, making it look like what is in front actually has a greater depth.

With SuperFX games like StarFox, however, it may be more plausible. For handling those games (not necessarily SMW2:YI), polygons are rendered to a frame buffer in the SNES's RAM, and then that gets sent to the display combined with other things like background layers. If it has commands for determining camera position/orientation, then perhaps you could make an additional buffer outside of the system, offset/angle each perspective as would be the norm of generating this effect, have the polygons rendered to both, and then when placing that frame buffer onto the main render buffer, you can take the additional frame buffer you made and rendered to, and simply place it on the 2nd main buffer. No offsetting would be needed like you would do with background layers and sprites because you technically made the effect in the SuperFX render stage.

At least, that's how I'd imagine it would be. I know a lot about the GBA hardware, but I never delve into how the SNES does things with as much vigor, so part of my theory is based on the GBA.
 

Arisotura

rise of melonism
OP
Member
Joined
Dec 5, 2009
Messages
839
Trophies
1
Age
28
Location
center of the Sun
Website
kuribo64.net
XP
2,452
Country
France
3D on Mode7 perspective can work if the perspective is always horizontal (or if you manage to calculate the angle from the per-scanline mode7 parameters).


So, I'm done with SRAM. That reminded me of the other reason why it was left out: it had to be ported to the 3DS filesystem API (we don't have fopen/fread/etc yet). But in the end, this API is fairly easy to use, so it went well.

Bringing it back also increased compatibility a bit, too, heh. SMAS now starts, although you have to blindly press buttons in the menus to get to the desired game because the menu uses mode 3 and that isn't supported yet (actually I'm lazy and only support the more common mode 1 :P ).

Kirby's Dream Course gets stuck on a 'wrong region' type screen because I didn't reimplement the NTSC/PAL switch. Well atleast it isn't getting stuck on the piracy screen anymore :P

Most other games get stuck while trying to communicate with the SPC700 because my SPC700 skipping method is still not good.


I'm going to implement a few more PPU modes that can be done easily.
 

Bond697

Dies, died, will die.
Member
Joined
Jun 7, 2009
Messages
350
Trophies
0
Age
37
Location
CT
XP
444
Country
United States
Indeed. I also think that pseudo-3D games that make use of Mode7-powered perspective or SuperFX will work better in 3D. Sidescrollers might work but it'd have to be tried out. Games that use non-Mode7 pseudo-3D (Pokémon style) won't work well at all without major hacks.

But for now, funky 3D effects aren't what I'm after.


I'm going to reimplement savegames. The reason it was disabled was that I wanted to get the lolSnes core working on the 3DS, and disabled all the extra stuff that could have interfered so I'd know where issues would come from. Now this can safely be reenabled.

After that, I'd like to experiment a new event scheduler system, hoping it'll bring some speedup. I'll let you know :)

Past all that, what will remain will be mostly some PPU tidbits, and I will be able to release a first blargSnes version I guess :)


Unrelatedly, it'd be nice if someone could get the exheader and accessdesc of Super Mario 3D Land, so we can verify if the rumor that it uses the two ARM11 cores is true. I dumped my SM3DL cart but the exheader and accessdesc are encrypted.

I tried to modify makerom so I could build a .3ds with an affinity mask of 3 instead of 1. But that .3ds wouldn't start, the system would just go 'the cart has been ejected'. Either I missed something there, or it's just not possible to use the two cores.

I hope it's possible. It would greatly help with performance in the case of blargSnes.

you're allowed to use up to 30%(between 5 and 30) of the syscore's cpu time as of sdk version 3.0 and it's part of the APT: library. i doubt you'd see anything special in the exheader or access descriptor. aside from maybe apt service access, but that would probably be there for other reasons anyway.

after you do that, you create a thread with a core number of 1.

your current tests are failing because right now the syscore has 0% cpu time assigned to the application.
 

Arisotura

rise of melonism
OP
Member
Joined
Dec 5, 2009
Messages
839
Trophies
1
Age
28
Location
center of the Sun
Website
kuribo64.net
XP
2,452
Country
France
Nice! Do you know details about how I'd use this, though? I fail to see a related function in 3dbrew's listing.

I tried playing with the flags of APTU::Initialize, but to no avail. Setting bit0 or bit2 has no visible effect, and setting bit1 causes the app to stay on the 'Nintendo 3DS' loading screen forever.
 

Bond697

Dies, died, will die.
Member
Joined
Jun 7, 2009
Messages
350
Trophies
0
Age
37
Location
CT
XP
444
Country
United States
0x4F0080

arguments passed should look like:

cmdbuf[0] = 0x4F0080
cmdbuf[1] = 1
cmdbuf[2] = *percentage* (if you want the entire 30%, make it 30)


if that doesn't work, i'll have to have a quick look at the applet module when i get home from work.

e:

APT:U should do it. i don't think APT:S is available in the access control in the rsf that everyone uses to build with. if it does require APT:S, you're out of luck. at least for now.
 
  • Like
Reactions: jacobas92

DiscostewSM

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
5,472
Trophies
1
Location
Sacramento, California
Website
lazerlight.x10.mx
XP
4,998
Country
United States
3D on Mode7 perspective can work if the perspective is always horizontal (or if you manage to calculate the angle from the per-scanline mode7 parameters).

What I described is what Kane49 demonstrated with that picture posted. A Mode 7 layer is like any other layer as far as priority layering is concerned. You could limit the depth you generate based on other layers so it neither has a depth less than the layer just in front of it nor greater than the layer behind it. Would still make it odd in some scenarios, like racing games where multiple sprites are on the same layer above the Mode 7 layer, so they kinda pop out rather than being at whatever suggested depth the game was meant to make them appear as. Even for such games, the point at the bottom of the screen meant to show how close to the track the camera is (vs off in the distance) would not be shown as closer than your own racer because of the same layering issue. Then there's also changing layer priorities in between scanlines. While such a thing isn't limited to Mode 7, if you were able to process angles to generate sloping depths for it, that altering of the layer priority mid-frame could make it produce an odd cut-off effect.
 
Status
Not open for further replies.
General chit-chat
Help Users
    KenniesNewName @ KenniesNewName: @Veho may want to wait