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,496
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,496
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
    Veho @ Veho: Spring is in the air. +1