Help with sprites

This is for people involved in the developement of Snes9x, or SNES emulators in general.
BUG REPORTS BELONG IN TECH SUPPORT/BUG TRACKING!
Post Reply
Ian Reed
Snes9x White Belt
Posts: 7
Joined: Fri Apr 11, 2014 5:17 am

Help with sprites

Post by Ian Reed »

Hi,

I'm working on a project to add accessibility features to Chrono Trigger.
I'm primarily using this documentation:
http://emu-docs.org/Super%20NES/General ... ml#Reg2107

Essentially I have a hook in the Snes9X code each render loop that checks a non blocking TCP socket to see if my secondary app would like some more information.
If so, it sends VRAM and CGData along with variables pulled from SPPU.
Then my secondary app uses the information to make the game more accessible for blind and visually impaired players.

For example, I am currently able to detect normal dialog windows in Chrono Trigger and parse the text that is custom drawn in BG 3 on a tile character number range of 256 through 511.
Then I play the dialog through text to speech.
I am also able to detect letters, numbers, and icons that are drawn 1 per tile.
This then allows me to read the stats in the party menu, etc.

I'm now looking into sprites.
I see this on SPPU:
struct SOBJ OBJ[128];
So I can get the positions and other information about every sprite.

My question is: How do I know which of the 128 sprites are actually being drawn to the screen right now?
Also, am I referencing the best documentation, or is there a better link someone can point me to?

I really appreciate any help anyone can offer.

Thanks,
Ian Reed
Ian Reed
Snes9x White Belt
Posts: 7
Joined: Fri Apr 11, 2014 5:17 am

Re: Help with sprites

Post by Ian Reed »

Just an update.
I've pretty much figured out that sometimes the game changes the sprite's priority bits to hide it, but more often it just moves it to VPos 224 or greater so it's off the screen.

I'd still appreciate a link to better documentation if any exists as I'm having some oddities with my tile map addressing.
Specifically there is one case where BG 3 has an SCSize of 64x32 and instead of bit shifting the Snes9X SCBase 1 to the left I need to bit shift it 1 to the right in order to get what seems to be the accurate tile map.
I have another case where the seemingly correct tile address is not as simple as bit shifting SCBase in the opposite direction.
For most cases though, my tile map addressing seems correct.
Admittedly the Snes9X code is a form of working documentation, but not always as easy to understand as real documentation.
Well, thanks in advance to anyone who can assist me.
User avatar
telmo
Snes9x White Belt
Posts: 11
Joined: Tue Nov 26, 2013 4:33 am
Location: Sao Jose, Santa Catarina, Brazil

Re: Help with sprites

Post by telmo »

Sorry to bump this thread, but this is pretty awesome. Good luck with your project.
Ian Reed
Snes9x White Belt
Posts: 7
Joined: Fri Apr 11, 2014 5:17 am

Re: Help with sprites

Post by Ian Reed »

Hi telmo.
Thanks for the supportive words.
I actually had a big break from this project, but I'm looking at starting it up again.
I made a quick demo for people to see where it's at.
It's audio only and intended for the blind, but you might enjoy it as well.
http://BlindAudioGames.com/Downloads/Ch ... iaDemo.mp3

It shows Chrono Trigger and Lufia 2.
Enjoy!
Post Reply