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

Status
Not open for further replies.

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,927
Trophies
2
XP
30,152
Country
United Kingdom
From how I read it, they basically ported the game to a hypothetical system (a souped-up 3d megadrive), which involved making various changes to the original game's code (same as porting any game to another system, but not really the same thing as a remake), and then they wrote an emulator for this hypothetical system on the 3ds.
 

piratesephiroth

I wish I could read
Member
Joined
Sep 5, 2013
Messages
3,453
Trophies
2
Age
103
XP
3,234
Country
Brazil
they had to modify the scrolling of the background to add some perspective, so it doesn't look like the characters are floating (becuase that's plain ridiculous)
 

DiscostewSM

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
5,484
Trophies
2
Location
Sacramento, California
Website
lazerlight.x10.mx
XP
5,509
Country
United States
From how I read it, they basically ported the game to a hypothetical system (a souped-up 3d megadrive), which involved making various changes to the original game's code (same as porting any game to another system, but not really the same thing as a remake), and then they wrote an emulator for this hypothetical system on the 3ds.

That....actually makes some sense. Why rewrite the entire game's code for the 3DS when you can alter the emulator to include features (and necessary references for more power), and then just change the existing code of the game to incorporate those changes?
 

NCDyson

Hello Boys...
Member
Joined
Nov 9, 2009
Messages
278
Trophies
1
XP
319
Country
United States
Check the properties of the ROM files and make sure the archive checkbox is checked.

This is due to a bug in blargSnes's filesystem code. It will be fixed in the next release.


As for the next release, well:

* I thought I had got PICA200 rendering to work well, but not quite. It still flickered badly and overall not working well enough to be usable. I eventually did some investigation to find out what the GSP events were about and how to properly sync to the PICA200. In the end, it was worth it. Fast and stable display.

* Next step is, of course, adding the SNES video output to that. Probably not going to be too hard. Of course, there's the weird 3DS texture storage format coming into play, but I have ideas regarding that.

* The code behind the bottom screen UI is being rewritten. Internally, it's a lot easier to deal with, and will make it easier to add more UIs, config screens for example. A config screen would be nice for configuring things like scaling.

* With all that, two bugs in the new ctrulib have been fixed to this day. There will also be more, considering the whole 'return to home menu' part needs to be fixed.

any chance you could point us to the spec file and the files related to it? I tried to make my own, but am interested to see what other people have.
 

Arisotura

rise of melonism
OP
Member
Joined
Dec 5, 2009
Messages
839
Trophies
1
Age
30
Location
center of the Sun
Website
kuribo64.net
XP
2,498
Country
France
any chance you could point us to the spec file and the files related to it? I tried to make my own, but am interested to see what other people have.
I don't know what you mean there, but if it's related to blargSnes's code, the source code is available on Github.


> "Next step is, of course, adding the SNES video output to that. Probably not going to be too hard."
Well, scrap that.

Texture storage isn't the problem, I have that covered minus one or two details. The issue is that I need alphablending, and the Picky200 is getting in the way again. Basically, alphablending works fine except that the GPU seems to be reading zeros instead of the destination color. The result is that alphablending acts like decreasing brightness. This is nice but useless for what I want to do.

I have no idea where this issue may come from, so it's going to take a while to fix it.
 

loco365

Well-Known Member
Member
Joined
Sep 1, 2010
Messages
5,457
Trophies
0
XP
2,927


So, I decided to take this video and convert it to 3D, although I did have to fix it up a tad (The Left/Right is incorrect in the video - results in eyebleeding results, but when adjusted correctly...) and captured some stills for you all to look at. Hope you all enjoy it as much as I am:

D-Force:
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0003.MPO

Castlevania - Dracula X:
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0004.MPO

Rockman X3:
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0005.MPO

Romancing SaGa 3:
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0006.MPO

Super Mario RPG:
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0007.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0008.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0009.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0010.MPO

Chrono Trigger (Some of these are really damn good!):
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0011.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0012.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0013.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0014.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0015.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0016.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0017.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0018.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0019.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0020.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0021.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0022.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0023.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0024.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0025.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0026.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0027.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0028.MPO

Some of the games there were good, but not as good as these. I didn't find Super Mario World worked too well, as Mario and the coin boxes rendered on different levels, making it appear really odd when he jumped to hit them. The textboxes were also as glitchy as hell-looking.
 
  • Like
Reactions: DSoryu

NCDyson

Hello Boys...
Member
Joined
Nov 9, 2009
Messages
278
Trophies
1
XP
319
Country
United States
I don't know what you mean there, but if it's related to blargSnes's code, the source code is available on Github.
This is part of your makefile, which, as well as pretty much part almost every makefile I've seen where ctrulib is used.
Code:
LDFLAGS    =    -specs=3dsx.specs -g $(ARCH) \
            -Wl,-d,-q,--use-blx,-Map,$(TARGET).map
However, I've never been able to find the 3dsx.specs file, and I have to manually edit the makefiles to point back the the ccd00.ld script, otherwise the linker complains the file is missing.
Most of the stuff I've tried to use that ccd00.ld with, makerom gives me errors with elf section sizes or something like that. Was just curious if you had found it or not.

> "Next step is, of course, adding the SNES video output to that. Probably not going to be too hard."
Well, scrap that.

Texture storage isn't the problem, I have that covered minus one or two details. The issue is that I need alphablending, and the Picky200 is getting in the way again. Basically, alphablending works fine except that the GPU seems to be reading zeros instead of the destination color. The result is that alphablending acts like decreasing brightness. This is nice but useless for what I want to do.


I have no idea where this issue may come from, so it's going to take a while to fix it.

could that have something to do with this sutff: 3dBrew: Gx Commands/Alpha Function Values?
 

DSoryu

GBA/NDS Maniac
Member
Joined
May 5, 2010
Messages
2,375
Trophies
2
Location
In my house
XP
4,831
Country
Mexico
So, I decided to take this video and convert it to 3D, although I did have to fix it up a tad (The Left/Right is incorrect in the video - results in eyebleeding results, but when adjusted correctly...) and captured some stills for you all to look at. Hope you all enjoy it as much as I am:

D-Force:
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0003.MPO

Castlevania - Dracula X:
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0004.MPO

Rockman X3:
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0005.MPO

Romancing SaGa 3:
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0006.MPO

Super Mario RPG:
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0007.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0008.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0009.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0010.MPO

Chrono Trigger (Some of these are really damn good!):
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0011.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0012.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0013.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0014.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0015.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0016.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0017.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0018.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0019.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0020.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0021.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0022.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0023.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0024.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0025.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0026.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0027.MPO
https://dl.dropboxusercontent.com/u/34957059/SNES 3D/HNI_0028.MPO

Some of the games there were good, but not as good as these. I didn't find Super Mario World worked too well, as Mario and the coin boxes rendered on different levels, making it appear really odd when he jumped to hit them. The textboxes were also as glitchy as hell-looking.

THIS PART

amazing.png


The transparency effect looks VERY amazing, it really looks like glass :O
 

dronesplitter

Well-Known Member
Member
Joined
Sep 30, 2007
Messages
595
Trophies
0
XP
421
Country
United States
There's two ways to view those, parallel viewing and cross-eye 3d viewing method. I just wanted to mention that he had to swap the two images because they were meant for the cross-eye method, which is generally considered the better viewing method. For cross-eye, hold something like the tip of a pencil between you and the two images on your monitor and let your eyes make a third image between the two. Then, you just look from the pencil to the third image between the other two and let your eyes focus on it so that it becomes clear. Now you can watch the videos in 3D without transferring to your 3DS to do it :)

Note: I don't recommend doing that for long if you're not used to it. Fun to try out and practice, though.
 

loco365

Well-Known Member
Member
Joined
Sep 1, 2010
Messages
5,457
Trophies
0
XP
2,927
THIS PART

View attachment 10437

The transparency effect looks VERY amazing, it really looks like glass :O

The Mode 7 cutscene in the video looks so real. I'd love to try doing this with F-Zero or Pilotwings and see just how realistic it looks. I also wonder what Super FX games (Starfox 1/2) look like...

Edit: I have the emulator running, but I can't get it to record anything in 3D. I have an image in which you see both layers, but I can't get a video nor can I get a screenshot - it only records one of the framebuffers and not both.
 

DiscostewSM

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
5,484
Trophies
2
Location
Sacramento, California
Website
lazerlight.x10.mx
XP
5,509
Country
United States
The Mode 7 cutscene in the video looks so real. I'd love to try doing this with F-Zero or Pilotwings and see just how realistic it looks. I also wonder what Super FX games (Starfox 1/2) look like...

Edit: I have the emulator running, but I can't get it to record anything in 3D. I have an image in which you see both layers, but I can't get a video nor can I get a screenshot - it only records one of the framebuffers and not both.


I dunno about that Mode7 section. It still seemed flat to me. It's probably the sprites on top of it that make it feel a little different. The output for SFX-rendered games will likely be completely flat unless the emulation of the chip tacks on an additional buffer that exists outside of the SNES specifications (since the buffer the chip renders to is within the SNES RAM), and then when sending that section to the main display buffers, the additional buffer gets thrown in too.
 

Arisotura

rise of melonism
OP
Member
Joined
Dec 5, 2009
Messages
839
Trophies
1
Age
30
Location
center of the Sun
Website
kuribo64.net
XP
2,498
Country
France
http://imgur.com/IckONrR.jpg
http://imgur.com/N7ONRiL.jpg

Preliminary color math (blending) support. It's not perfect, though, but it's a start. (I observed some glitches in SMW)

In the end, I scrapped alphablending and went with multitexturing. That even worked better than alphablending would have, since SNES color math is more complex than the typical (color1 x alpha1 + color2 x alpha2) used in alphablending.

I will also be able to implement master brightness (fadein/fadeout) in hardware. In my current setup, there are just enough texture units and TEV stages remaining for it :)

That's pretty much the best one can do when emulating a SNES PPU with a 3D GPU that doesn't support pixel shaders. Trying to go any further would be complicated and too much inaccurate (ie result in glitches).

Mosaic and windows remain to be implemented, and they'll have to be done in software, potentially affecting speed.


The bright blue border around the screen is temporary. I didn't convert the default border/screen graphics or add code to load an external border yet.


There are also some other cool changes:

* new rendering method means proper VSync. Games won't run too fast anymore.
* no more glitches on the bottom screen while emulating
* new UI code. For one, the ROM list is more responsive, and key repeat is implemented more properly. It'll also be much easier to implement config screens and such.
 

Purple_Shyguy

Well-Known Member
Member
Joined
Nov 8, 2008
Messages
2,374
Trophies
2
Age
34
Location
Republic of Ireland
XP
4,855
Country
There's two ways to view those, parallel viewing and cross-eye 3d viewing method. I just wanted to mention that he had to swap the two images because they were meant for the cross-eye method, which is generally considered the better viewing method. For cross-eye, hold something like the tip of a pencil between you and the two images on your monitor and let your eyes make a third image between the two. Then, you just look from the pencil to the third image between the other two and let your eyes focus on it so that it becomes clear. Now you can watch the videos in 3D without transferring to your 3DS to do it :)

Note: I don't recommend doing that for long if you're not used to it. Fun to try out and practice, though.



I have a 3D Phone but it got abandoned android FW wise and so the max res I can watch on my youtube app is 360p. :ohnoes:

Even though I can view 3D video it looks like ass. Disappointing because lots of parts of the video im sure look great!
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://youtu.be/sg0D1PpgCXs?si=rnzM6Df7jeL6FiPz