Homebrew SNES9x for Old 3DS

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,565
Country
Chile
cool, 3ds has enough ram to map a rom, which evades funky memory mappings (such as detect the current bank + offset for reloads), which breaks most games. :D
 

DiscostewSM

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
5,484
Trophies
2
Location
Sacramento, California
Website
lazerlight.x10.mx
XP
5,505
Country
United States
@DiscostewSM You also might want to check this, I believe you're very knowledgeable about Snes emulation on 3DS,
Knowledgeable on how various subsystems of the base SNES work, yes, like the PPU, but other than understanding what each opcode does, the rest of the emulation, like timings, interrupt firing, etc are still foreign to me. And, to be quite honest, Snes9x's code always takes me for a loop due to how it is laid out. I will say though that from what I saw in the code here, the method for using hardware rendering is similar to how StapleButter did it in blargSNES, where it converts the tilecels on a need-to-display basis into a texture cache, and builds a list of polygon pairs to represent each tilecel in each background and sprite. Haven't gone in-depth with it though.
 
  • Like
Reactions: AtlasFontaine

bubble2k16

Well-Known Member
OP
Member
Joined
Jul 25, 2016
Messages
467
Trophies
0
XP
2,118
Country
Senegal
Yes, DiscostewSM, some of the ideas for the hardware accelerated rendering came from BlargSNES.

You helped in the hardware-assisted Mode 7 rendering for BlargSNES, didn't you? Keen in giving a fellow coder here a hand? :)

I've been taking care of optimisation for emulation on the opcodes side, and I think I've done most of what I could (except maybe for speed hacks). Now, a lot of the bottleneck is now at screen rendering. I haven't gone around to use stencil buffers for windowing in the way it's done in BlargSNES. I suspect implementing that should give some games that use windowing for effects a modest boost in speed.



Knowledgeable on how various subsystems of the base SNES work, yes, like the PPU, but other than understanding what each opcode does, the rest of the emulation, like timings, interrupt firing, etc are still foreign to me. And, to be quite honest, Snes9x's code always takes me for a loop due to how it is laid out. I will say though that from what I saw in the code here, the method for using hardware rendering is similar to how StapleButter did it in blargSNES, where it converts the tilecels on a need-to-display basis into a texture cache, and builds a list of polygon pairs to represent each tilecel in each background and sprite. Haven't gone in-depth with it though.
 

DiscostewSM

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
5,484
Trophies
2
Location
Sacramento, California
Website
lazerlight.x10.mx
XP
5,505
Country
United States
Yes, DiscostewSM, some of the ideas for the hardware accelerated rendering came from BlargSNES.

You helped in the hardware-assisted Mode 7 rendering for BlargSNES, didn't you? Keen in giving a fellow coder here a hand? :)

I've been taking care of optimisation for emulation on the opcodes side, and I think I've done most of what I could (except maybe for speed hacks). Now, a lot of the bottleneck is now at screen rendering. I haven't gone around to use stencil buffers for windowing in the way it's done in BlargSNES. I suspect implementing that should give some games that use windowing for effects a modest boost in speed.

The basis for the hardware-rendered Mode 7 is actually quite simple. Mode 7 is just a 1024x1024 layer that is scaled/rotated, and adjustable per scanline, so represent this as a texture buffer, then use it as a texture source per scanline to render to the buffers that you would do normal rendering of backgrounds. As to rendering to this large texture buffer in the first place, it requires some adjustments, because the 3DS has an issue with rendering to a destination that uses a window greater than a 1023x1016 (width greater than 1023 causes no polygons to be rendered, and height greater than 1016 causes the GPU to hang). So, render with a window area of 512x512 for each corner, and assign a polygon list for each that contains static coordinates, that only changes with regard to what tile is shown in each slot (which could be done when writing to SNES VRAM).

Now, there are additional settings for Mode 7, but first focus on the regular Mode 7 format first. I'm sure you've looked over blargSNES's code, so you should be able to see how I implemented Mode 7 there.
 
P

PaiiNSteven

Guest
Holy shit. Good on you! Thanks so much!

Savestates and cheats would be dandy in future updates. Watching this thread.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • BigOnYa @ BigOnYa:
    Biomutant looks cool tho, may have to try that
  • Quincy @ Quincy:
    Usually when such a big title leaks the Temp will be the first to report about it (going off of historical reports here, Pokemon SV being the latest one I can recall seeing pop up here)
  • K3Nv2 @ K3Nv2:
    I still like how a freaking mp3 file hacks webos all that security defeated by text yet again
  • BigOnYa @ BigOnYa:
    They have simulators for everything nowdays, cray cray. How about a sim that shows you playing the Switch.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
    K3Nv2 @ K3Nv2: @BigOnYa...