Need guidance with nes to snes. UPDATE: Port Complete of Mega Man IV + MSU-1

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
infidelity
Posts: 490
Joined: Fri Mar 01, 2013 4:46 am

Re: Need guidance with nes to snes.

Post by infidelity »

Hmm. think I need some education with sprites. I'm using bsnes, I have the Sprite DMA buffer injected into the oam, I can see it within the memory editor of bsnes. Within the Sprite viewer I can see the tile, I can move it, and I can set the bits to make it choose a different palette and flip etc. But for some reason it is not coming on the screen? Idk what I could be missing? I even made it so it can appear on different windows in the Sprite viewer, still nothing. :-/
93143
Posts: 1717
Joined: Fri Jul 04, 2014 9:31 pm

Re: Need guidance with nes to snes.

Post by 93143 »

Have you turned on sprites with $212C?
infidelity
Posts: 490
Joined: Fri Mar 01, 2013 4:46 am

Re: Need guidance with nes to snes.

Post by infidelity »

Yup, i set it as 1F so that the sprites and all bg's are enabled. I was messing with $2101, and I was able to get sprites to appear, but only as sizes other than 8x8. Lile when I'm able to have a 16x16 sprite shown, I'll see the Sprite that I'm trying to enable, which is the 2nd Sprite. But when the Sprite size is set back to 8x8, I mo longer get sprites on the screen?

edit
ok i see whats wrong, for some reason my sprite palette needs to have CGRAM 108-10F set with colors, in order for my 8x8 sprites to appear. idk why that's happening, my bg tiles are appearing fine with their color values in cgram at 0000-0007/0020-0027/0040-0047/0060-0067, but again for some reason my sprites are only appearing when palettes are at 0108-010F/0128-012F/0148-014F/0168-016F?
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Need guidance with nes to snes.

Post by dougeff »

SMW only uses the first 8 colors for sprites, you don't need to write anything to the last 8 colors if you aren't using them. My guess is that something isn't quite right.

Is your sprite CHR file in 4bpp format? I could imagine a problem if you tried to use 2bpp, and the upper bytes were somehow filled with FF by default, then the last 8 colors would be relevant.
nesdoug.com -- blog/tutorial on programming for the NES
infidelity
Posts: 490
Joined: Fri Mar 01, 2013 4:46 am

Re: Need guidance with nes to snes.

Post by infidelity »

dougeff wrote: Tue Mar 30, 2021 6:29 pm SMW only uses the first 8 colors for sprites, you don't need to write anything to the last 8 colors if you aren't using them. My guess is that something isn't quite right.

Is your sprite CHR file in 4bpp format? I could imagine a problem if you tried to use 2bpp, and the upper bytes were somehow filled with FF by default, then the last 8 colors would be relevant.
All the gfx is 4bpp
93143
Posts: 1717
Joined: Fri Jul 04, 2014 9:31 pm

Re: Need guidance with nes to snes.

Post by 93143 »

Sprites always use the top half of CGRAM. Mode 2 BG tiles use the bottom half.

Also, CGRAM addresses are word addresses, like VRAM. I assume you're uploading a massive chunk starting from zero, and just reporting the byte offsets to us here, rather than somehow specifying 9-bit addresses in CGADD... If this is correct, then it means your colours are in the second quarter of the subpalette, implying that the third bit is set in all pixels. Make sure this is not true of pixels that are supposed to be transparent, or the transparency won't work.

This distinction between 8x8 sprites and other kinds is very weird. Are you sure your graphics converter is operating properly?
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: Need guidance with nes to snes.

Post by calima »

Also remember the priority. Prio 0 sprites are under most BG.
creaothceann
Posts: 611
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Need guidance with nes to snes.

Post by creaothceann »

And a sprite with a lower index has priority over a sprite with a higher index, even if the latter is hidden by a background. (iirc)
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
infidelity
Posts: 490
Joined: Fri Mar 01, 2013 4:46 am

Re: Need guidance with nes to snes.

Post by infidelity »

Well, while I was trying to figure out how to get sprites to appear on the screen, (even though the Sprite viewer I see it clear as day) I noticed a good portion of my copyright screen tiles had the incorrect attribute value. Thank God I'm trying to work sprites now, cause that was a huge mess with my attribute code, its tough doing this kind of thing while working full time and raising a family, i bring my laptop on the job when there is a lull, and I'll work on this port, last night I had some free time and boy oh boy idk what was going on with me, heh. But now the attributes are correct, I'm very proud of breaking down a 32x32 attribute byte, and getting the proper bits from each 16x16 block, and setting the bits up in a buffer with its appropriate 8x8 gfx tile.

With alllllll that said, I am now back at trying to get a Sprite onto the screen. I'm able to see my Sprite in the Sprite viewer, its reading the tile id I have for it in vram address $4000, and I'm able to set any of the 4 sprite palettes I want to it, I can change its flip, priority, position, I see that all happening in the Sprite viewer of bsnes, but nothing on screen. :-/ and I have $212C(off the top of my head) set to 1F, which enables sprites(1#) and all bgs(#F) idk what I'm missing.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Need guidance with nes to snes.

Post by Pokun »

Which display mode are you using?
infidelity
Posts: 490
Joined: Fri Mar 01, 2013 4:46 am

Re: Need guidance with nes to snes.

Post by infidelity »

Mode 2
update - will report back, I re-read an earlier reply I made regarding palettes with the sprites

update 2 - nothing, still cant then to appear on screen.

Mode 2, 8x8 tiles, vram for oam gfx resides at $2000. Have no issue seeing Sprite in the Sprite viewer, can choose palette, position, attributes, etc, just nothing on the main screen.

update 3 - ok, if I force 1F into $21C1 at the end of my oam DMA routine, it appears now.
creaothceann
Posts: 611
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Need guidance with nes to snes.

Post by creaothceann »

This video may be useful as a reference.
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
infidelity
Posts: 490
Joined: Fri Mar 01, 2013 4:46 am

Re: Need guidance with nes to snes.

Post by infidelity »

creaothceann wrote: Fri Apr 02, 2021 1:19 pm This video may be useful as a reference.
I stumbled on these videos last week, he does an excellent job with description & presentation.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Need guidance with nes to snes.

Post by dougeff »

$21C1
You mean $212c, TM, main screen
nesdoug.com -- blog/tutorial on programming for the NES
infidelity
Posts: 490
Joined: Fri Mar 01, 2013 4:46 am

Re: Need guidance with nes to snes.

Post by infidelity »

dougeff wrote: Fri Apr 02, 2021 4:57 pm
$21C1
You mean $212c, TM, main screen
Tried off the top of my head, heh. Too many $21xx for me to remember haha.

I'm hoping at some point today I can redo my code, yesterday I noticed something that didnt look right. I was fully prepared for things like this to pop up, since jts a double whammy of being new to snes, and doing a port as well. I'm making great progress though, just need to be more careful.
Post Reply