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

Status
Not open for further replies.

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
I gave it a try, and I may have missed something, but it didn't work. It basically just returned a 'not implemented' error code.

I also tried replacing the 0 value with APPID_APPLICATION and 0xFFFF8001, to no avail.


If this only works with APT:S, well, I'm fucked.
 

Normmatt

Former AKAIO Programmer
Member
Joined
Dec 14, 2004
Messages
2,159
Trophies
0
Age
32
Website
normmatt.com
XP
1,898
Country
New Zealand
I gave it a try, and I may have missed something, but it didn't work. It basically just returned a 'not implemented' error code.

I also tried replacing the 0 value with APPID_APPLICATION and 0xFFFF8001, to no avail.


If this only works with APT:S, well, I'm fucked.


It should work at least according to NSMB2. (SML3D doesn't use it)
 

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
Well then, I'd be curious to see how NSMB2 does it.

Given how much resources PPU emulation is taking, I fail to see how I'll be able to emulate sound without another severe performance hit if I can't offload that to something else than the appcore.


Unrelatedly, I guess I'm done with the 'PPU tidbits' part. Mode 3 and 256-color layers are done: http://i.imgur.com/Othvtn2.jpg -- this finally makes SMAS playable without having to choose a game blindly.

At this point, implementing modes 0/2/4 would be ridiculously easy, if we ignore offset-per-tile for a while.


I'm going to focus on the new scheduler I guess. Last big thing to do before a first release.
 

Normmatt

Former AKAIO Programmer
Member
Joined
Dec 14, 2004
Messages
2,159
Trophies
0
Age
32
Website
normmatt.com
XP
1,898
Country
New Zealand
Well then, I'd be curious to see how NSMB2 does it.

Given how much resources PPU emulation is taking, I fail to see how I'll be able to emulate sound without another severe performance hit if I can't offload that to something else than the appcore.


Unrelatedly, I guess I'm done with the 'PPU tidbits' part. Mode 3 and 256-color layers are done: http://i.imgur.com/Othvtn2.jpg -- this finally makes SMAS playable without having to choose a game blindly.

At this point, implementing modes 0/2/4 would be ridiculously easy, if we ignore offset-per-tile for a while.


I'm going to focus on the new scheduler I guess. Last big thing to do before a first release.


According to NSMB its arguments are:

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

Bond697 had an extra entry in it which NSMB2 doesn't seem to have.
 

Bond697

Dies, died, will die.
Member
Joined
Jun 7, 2009
Messages
350
Trophies
0
Age
38
Location
CT
XP
454
Country
United States
yeah, i misread. just had another look. in my haste at work yesterday, or maybe a graphical glitch in remote desktop from scrolling around too fast, i definitely thought there were 2 strd instructions in a row.

e: while i'm here, if you wanted to check the amount of syscore time that was being used:

cmdbuf[0] = 0x500040
cmdbuf[1] = 1
 

cracker

Nyah!
Member
Joined
Aug 24, 2005
Messages
3,616
Trophies
0
XP
2,157
Country
United States
SNES Games always have a sprite layer, basic 3DS should just have the sprite layer in the front and thats it :)

bQDr9UR.png

Did you render that yourself or is there an emulator that gives an exploded view? I hope the latter because that looks pretty sweet.

Good job StapleButter! You're kicking some ass on this emulator. :grog:
 
  • Like
Reactions: Margen67

Normmatt

Former AKAIO Programmer
Member
Joined
Dec 14, 2004
Messages
2,159
Trophies
0
Age
32
Website
normmatt.com
XP
1,898
Country
New Zealand
Well then, I'd be curious to see how NSMB2 does it.

Given how much resources PPU emulation is taking, I fail to see how I'll be able to emulate sound without another severe performance hit if I can't offload that to something else than the appcore.


Unrelatedly, I guess I'm done with the 'PPU tidbits' part. Mode 3 and 256-color layers are done: http://i.imgur.com/Othvtn2.jpg -- this finally makes SMAS playable without having to choose a game blindly.

At this point, implementing modes 0/2/4 would be ridiculously easy, if we ignore offset-per-tile for a while.


I'm going to focus on the new scheduler I guess. Last big thing to do before a first release.

Just took a quick look and it seems your drawing the screen twice, why not just memcpy the first buffer to the second instead of calling the drawing methods again?

EDIT: NM misread your code.

Thank you two! I just tried it and it works like a charm. Amazing!
:)
 

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
Normmatt: Each time, it uses a different layer enable register for drawing the layers (PPU_MainScreen/PPU_SubScreen).

The SNES has two 'screens': main screen and sub screen. For each, the PPU draws the layers according to the corresponding layer enable register, and the two screens are mixed together, optionally with blending.

Emulating this is important because it also affects priorities. For example, in SMW, the background layer is enabled in the subscreen, and the other layers and sprites are enabled in the mainscreen. Ignoring the mainscreen/subscreen feature would cause some sprites (like those flying piranha plants that jump out of pipes) to appear behind the background when they should appear in front of it.

(you reminded me of the workarounds lolSnes used to make up for the lack of mainscreen/subscreen on the DS, heh)


Idaho: Exactly :)
 
  • Like
Reactions: Dartz150 and Idaho

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
You get the same screen transition as on the real thing. Garbage may show up inbetween though, as I don't emulate master brightness.


Also, fuck no. I can't use CSND. It's not listed in gw_workaround.rsf. And of course, adding it there doesn't work either (3DS menu just goes 'card has been ejected, press home to return to menu').

fuuuuuuuuck >_<
 

shamzie

Conform comrades
Member
Joined
Mar 19, 2014
Messages
1,220
Trophies
0
Location
Manchester
XP
1,573
Country
United Kingdom
You get the same screen transition as on the real thing. Garbage may show up inbetween though, as I don't emulate master brightness.


Also, fuck no. I can't use CSND. It's not listed in gw_workaround.rsf. And of course, adding it there doesn't work either (3DS menu just goes 'card has been ejected, press home to return to menu').

fuuuuuuuuck >_<

I don't have a clue on what you are talking about, I just no you're doing a great job and you'll figure out whatever it is that needs to be done :) don't give up!
 

bobmcjr

Well-Known Member
Member
Joined
Apr 26, 2013
Messages
1,119
Trophies
0
XP
2,565
Country
United States
You get the same screen transition as on the real thing. Garbage may show up inbetween though, as I don't emulate master brightness.


Also, fuck no. I can't use CSND. It's not listed in gw_workaround.rsf. And of course, adding it there doesn't work either (3DS menu just goes 'card has been ejected, press home to return to menu').

fuuuuuuuuck >_<
I'm guessing that CSND has to be part of ServiceAccessControl? It's in SystemControlInfo. I find it odd they would leave CSND out since the microphone and camera appear to be included in ServiceAccessControl
 

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
Isn't there a DSP microcode set up by the firmware? (or does it use CSND?)

DSP would be tricky. I started looking into it, and well... it's a pain. The only documentation is littered with errors, the assembly language is weird and confusing, and half the disassembled code makes no sense.
 
Status
Not open for further replies.
General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: Lol