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,511
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,511
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.
  • K3Nv2 @ K3Nv2:
    why
  • Xdqwerty @ Xdqwerty:
    @K3Nv2, it's not funny
  • K3Nv2 @ K3Nv2:
    ok
  • BigOnYa @ BigOnYa:
    Wut?
  • K3Nv2 @ K3Nv2:
    That's not funny
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    So two cannibals where eating a clown and one says to the other. Hey does this taste funny to you?
    +2
  • K3Nv2 @ K3Nv2:
    What do you call a slow car? Retired
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Did you hear about the police car that someone stole the wheels off of? The police are working tirelessly to find the thieves.
    +2
  • K3Nv2 @ K3Nv2:
    A firefighter got arrested for assault his main claim was what I was told he was on fire
    +2
  • BigOnYa @ BigOnYa:
    What do you call a hooker with a runny nose? Full
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    What do you tell a woman with two black eyes? Nothing you already told her twice!
  • K3Nv2 @ K3Nv2:
    Diddy also works
  • K3Nv2 @ K3Nv2:
    A scientist heard the word batman so he put a naked lady in a cage with a bat
  • Psionic Roshambo @ Psionic Roshambo:
    Chuck Norris won a staring contest, with the sun.
  • K3Nv2 @ K3Nv2:
    A vampires favorite thing to do is moon you
  • BigOnYa @ BigOnYa:
    What's the difference between an airplane, and Ken's mom? Not everyone has been in an airplane.
  • K3Nv2 @ K3Nv2:
    What's the difference between @BigOnYa and his wife? Nothing both want to bone me
    +3
  • RedColoredStars @ RedColoredStars:
    How much wood could a wood chuck chuck if a wood chuck could chuck norris
    +1
  • BakerMan @ BakerMan:
    how do i know? you're a guy, and he wants to bone every guy on this site (maybe, idk)
    +1
  • K3Nv2 @ K3Nv2:
    He wants to bone anything with a dick
    +1
  • Xdqwerty @ Xdqwerty:
    Good night
    +1
  • BigOnYa @ BigOnYa:
    Nighty night, big day tomorrow. Congrats.
    K3Nv2 @ K3Nv2: https://www.instagram.com/reel/C7iLZ35NrQt/?igsh=MWd2Z3U0dmNlMmNxcw==