SNES dev newbie questions

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: SNES dev newbie questions

Post by tepples »

A tutorial for another architecture might have described the ROL/ROR operations on non-65xx series CPUs, which tend to use the other kind of rotation that doesn't insert carry into the stream.

6502 ROL/ROR is like 68000 ROXL/ROXR or x86 RCL/RCR.
User avatar
juef
Posts: 67
Joined: Thu Jul 15, 2010 8:20 am
Location: Québec, Canada

Re: SNES dev newbie questions

Post by juef »

Indeed, the book is mostly about old x86 CPUs. Thank you all for the help!
User avatar
juef
Posts: 67
Joined: Thu Jul 15, 2010 8:20 am
Location: Québec, Canada

Re: SNES dev newbie questions

Post by juef »

So I managed to complete a few tests / demos, but I have yet again come upon a problem I'm not sure I quite understand.

This little project (full code here) only consists in displaying a picture. I used gfx2snes (a fork of pcx2snes I believe) on a 256px by 224px 8bpp PCX image, which resulted in tile data, a tilemap and palette. I chose to go with 16x16 tiles (because why not?) and stayed with 8bpp. The tile data was too big for one ROM bank so I put half of it in two different banks. Everything looks alright to me assembly-wise, but... I'll let screenshots from no$sns do the talking:

Original image:
Image

Video output (same for higan accuracy):
Image

BG1:
Image

Tile data:
Image

I did notice a few oddities when converting the image, however... gfx2snes (and presumably pcx2snes) inserted something like 64 null bytes at the beginning of the tile data...?! I stripped them and adjusted the code accordingly, without much change. Also, the tilemap it generates is quite huge: 2KB. I expected it to be (256*224) / (16*16) * 2 = 448 bytes. The Windows GUI version of eKid's pcx2snes did none of these, but the results were actually worse (which I guess isn't the tool's fault).

Any help / hint / advice would be greatly appreciated. Thank you!

[Edit] I'm still not sure why the generated tilemap is so big, nor why this doesn't work, but I got it working with pcx2snesWIN and 8x8 tiles rather than 16x16. I'll stick with that for now but I guess I know where to look should I decide to try 16x16 tiles again!
Last edited by juef on Sun Apr 06, 2014 3:52 pm, edited 1 time in total.
alekmaul
Posts: 54
Joined: Tue Apr 24, 2012 12:22 pm
Contact:

Re: SNES dev newbie questions

Post by alekmaul »

I did an update of gfx2snes to avoid 64x64 pix added for blank tile.
It is not yet commited on googlecode, sorry about that.
I will try to do this later this day.

*DONE* Last version of source code available
Post Reply