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

Status
Not open for further replies.

cracker

Nyah!
Member
Joined
Aug 24, 2005
Messages
3,619
Trophies
1
XP
2,213
Country
United States
For anyone compiling themselves who want a better experience add

Code:
memset(((u16*)TopFB), 0, 400*240*2);

between

Code:
running = 1;
                           
SPC_Reset();

in main.c (currently line 814)

It clears the top screen of the logo artifacts that were distracting from the game.
 
  • Like
Reactions: Blueie

cracker

Nyah!
Member
Joined
Aug 24, 2005
Messages
3,619
Trophies
1
XP
2,213
Country
United States
True. I know it might not be for me but many others would probably love it. It would be cool to tack onto the end of a game to load it Super Gameboy style -- if present -- as well.
 

cracker

Nyah!
Member
Joined
Aug 24, 2005
Messages
3,619
Trophies
1
XP
2,213
Country
United States
I'll admit that I'm naive to the new-ish 3DS homebrew scene... How much RAM is allowed to homebrew (or commercial software for that matter)? I want to add something that might take a MB of RAM. I'm sure this will be fine but I'm just gathering info before I start. Also is it better to statically or dynamically allocate RAM -- are there any known side effects from the latter? TIA.
 

Silentsurvivor

Banned!
Banned
Joined
Sep 13, 2009
Messages
249
Trophies
0
XP
239
Country
United States
I didn't know Snes games could do that.
learning new things everyday :)

I might be wrong but I think some of the Final Fantasy games do that too

They write to the SRAM like a million times. If you're set to autowrite your flash memory won't like it. I don't know all the games that do that.
 

cracker

Nyah!
Member
Joined
Aug 24, 2005
Messages
3,619
Trophies
1
XP
2,213
Country
United States
I tried finding a list of games that use SRAM as extra WRAM but the only game I could find mention of was Yoshi's Island. I'm not even sure if that is correct because it could be RAM included in the special chip.
 

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
I know when you shut-down the 3DS or close a game from the Home menu, it can do things like save data. Would it be possible to do something like this with homebrew, either through Gateway or possibly Smea's ssspwn? If there's a kind of call-back method to allow your program to do "on-close" stuff, you could do your saving to flash memory there there. Like, when you load up a game, the save data is read in and stored in a section of RAM, to which when the game makes save calls, it'll write to that, but when you close the program or shut-down the system, it'll write that SRAM to the the flash memory.
 

bobmcjr

Well-Known Member
Member
Joined
Apr 26, 2013
Messages
1,156
Trophies
1
XP
3,244
Country
United States
Given that you have to pause the game with the touchscreen anyway to properly exit, why not save the game on pause?
 

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
CRT TV border would be doable, but I won't be the one drawing crazy borders as I have no drawing skills :P (blargSnes' interface probably witnesses that, heh)

However, if you want a CRT filter for the SNES video output, that's not coming anytime soon. We don't know enough about the PICA200 and I doubt it has enough support anyway (it doesn't seem to have real pixel shaders from what I've seen).


Which brings me to something else; I think I might be able to offload some rendering to the PICA200. Atleast, it's doable for color-math and master brightness I guess.


Saving on pause and all those things are coming.
 

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
Progress is kinda dropping because I'm entering univ, heh.


blargSnes is going to be ported to the most recent ctrulib. This implies, for one, correct framebuffer management (no more screens disappearing or turning into garbage).

I also plan on changing the renderer to use the PICA200 instead of straight writing to the framebuffer. This implies:

* hardware-assisted color math (blending) and master brightness. If my plans work, those will be emulated at literally no cost.
* possibility for flexible scaling modes (fullscreen, stretching while keeping ratio, in addition to the current 1:1 mode, and maybe more weird modes depending on games)
* possible 3D support in the future (may require special game-specific renderers though. The standard renderer will just squish all layers and sprites into two layers and blend them together, like the SNES PPU does)
* hell, let's get crazy... 3D borders?
* oh and also, proper VSync. No more tearing, and games will run at the correct speed.


Sound support will be coded in whenever I get access to a homebrew loader that gets me CSND access. Gateway users won't get sound (unless the Gateway team updates their firmware as needed). (currently this sucks because I'm also a Gateway user. blarg). Oh well, rest assured we're working on this issue. I'm kinda sidetracked between the actual blargSnes and trying to find a way to play sound.


Stay tuned!
 

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,921
Trophies
2
XP
30,066
Country
United Kingdom
Sound support will be coded in whenever I get access to a homebrew loader that gets me CSND access. Gateway users won't get sound (unless the Gateway team updates their firmware as needed). (currently this sucks because I'm also a Gateway user. blarg).

I'd say that if someone figures out the sound, and that it's possible for Gateway to update for it, and the code's made available to them, then they'd likely do it. They seem open to stuff like this that their customers want, especially if the groundwork is done for them.

Anyway progress sounding interesting, keep up the great work!
 

kyogre123

Mexican Pride
Member
Joined
Sep 23, 2013
Messages
2,920
Trophies
0
Age
34
XP
1,347
Country
Mexico
Sound support will be coded in whenever I get access to a homebrew loader that gets me CSND access. Gateway users won't get sound (unless the Gateway team updates their firmware as needed).

What? Why is that not supported (and why it relates to sound)? I thought Gateway only blocked kernel access.
 

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
Using the GPU for the final effects like color math is likely feasible. Not easy, it's going to require some weird blending equation, but possible.

Implementing any more of it on the GPU is impossible. You would need pixel shaders, which the PICA200 doesn't have.

There's also the part where any PPU register can be changed mid-frame. And as I said, the PPU does color-math by first flattening the layers into two screens and then blending them together. Trying to render each layer separately could (and likely will) give wrong blending results.

PPU emulation in software is the bottleneck, but I'll do my best to optimize it.


About sound, the issue isn't figuring out how to play sound, but getting access to it. CSND is nice and easy but only few system apps have access to it. Homebrew would get access to it if we were able to specify custom, unsigned accessdescs.

Alternately, there's the DSP which we can use. But it's mostly unknown and requires providing a signed DSP binary (ie stealing a binary from a game, not quite legal).


I'd also rather not rely on the Gateway team.
 
  • Like
Reactions: Huntereb
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Xdqwerty @ Xdqwerty:
    @SylverReZ I read that non-binary people identify as a blend of male and female. The point is i think i'm a blend of those and thus non binary
  • SylverReZ @ SylverReZ:
    @Xdqwerty, Non-binary people are those who don't identify themselves exclusively as male or female.
  • cearp @ cearp:
    I don't identify as anything, unless I need to get on a plane then I show ID
    +3
  • AncientBoi @ AncientBoi:
    👈 [homo, queer, fag, coksuqr, etc......]
    +3
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, I meant that I read that they can also identify as what i mentioned
    +2
  • BigOnYa @ BigOnYa:
    I identify as Long Rod Johnson, cause a cat called me that once.
    +2
  • AncientBoi @ AncientBoi:
    [takes a 👀 in your pants] Liar :angry:
    +3
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, and thus that would make me non binary since i feel like a blend of both male and female
    +1
  • AncientBoi @ AncientBoi:
    @Xdqwerty only time will tell, what/whom you are. At 14, its a bit early to "Define" yourself. :)
    +3
  • Psionic Roshambo @ Psionic Roshambo:
    I only recently have learned who I am and how much I am capable of and I'm 50 lol
    +3
  • Psionic Roshambo @ Psionic Roshambo:
    A thousand epiphanies and unbelievable pain and growth.
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    I wish I could sum it up for children to understand but it truly takes living a lifetime of learning
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    It's more than knowledge it's understanding
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Both are required
  • Xdqwerty @ Xdqwerty:
    @Psionic Roshambo, ask chatgpt or Google gémini to summarize it
  • Psionic Roshambo @ Psionic Roshambo:
    Lol summarize life's lessons
  • BigOnYa @ BigOnYa:
    My wifey tells me all the time "You need to grow the fuck up." Which I don't understand, cause I'm full grown already.
    +2
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, she means grow more
    +1
  • Xdqwerty @ Xdqwerty:
    Yawn
  • AncientBoi @ AncientBoi:
    farrrrrrrrrrrt
    +1
  • BigOnYa @ BigOnYa:
    @AncientBoi I imagine it don't make the fart sound anymore, probably sounds more like letting go of a balloon you just blew up.
    +3
  • SylverReZ @ SylverReZ:
    @BigOnYa, Tell her to grow a pair. :rofl2:
    +3
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, you played any Sega genesis games?
    Xdqwerty @ Xdqwerty: @SylverReZ, you played any Sega genesis games?