Need guidance with nes to snes. UPDATE: Port Complete of Mega Man IV + MSU-1
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
-
- Posts: 490
- Joined: Fri Mar 01, 2013 4:46 am
Re: Need guidance with nes to snes.
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. :-/
Re: Need guidance with nes to snes.
Have you turned on sprites with $212C?
-
- Posts: 490
- Joined: Fri Mar 01, 2013 4:46 am
Re: Need guidance with nes to snes.
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?
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?
Re: Need guidance with nes to snes.
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.
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
-
- Posts: 490
- Joined: Fri Mar 01, 2013 4:46 am
Re: Need guidance with nes to snes.
All the gfx is 4bppdougeff 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.
Re: Need guidance with nes to snes.
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?
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?
Re: Need guidance with nes to snes.
Also remember the priority. Prio 0 sprites are under most BG.
-
- Posts: 611
- Joined: Mon Jan 23, 2006 7:47 am
- Location: Germany
- Contact:
Re: Need guidance with nes to snes.
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
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
-
- Posts: 490
- Joined: Fri Mar 01, 2013 4:46 am
Re: Need guidance with nes to snes.
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.
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.
Re: Need guidance with nes to snes.
Which display mode are you using?
-
- Posts: 490
- Joined: Fri Mar 01, 2013 4:46 am
Re: Need guidance with nes to snes.
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.
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.
-
- Posts: 611
- Joined: Mon Jan 23, 2006 7:47 am
- Location: Germany
- Contact:
Re: Need guidance with nes to snes.
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
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
-
- Posts: 490
- Joined: Fri Mar 01, 2013 4:46 am
Re: Need guidance with nes to snes.
I stumbled on these videos last week, he does an excellent job with description & presentation.
Re: Need guidance with nes to snes.
You mean $212c, TM, main screen$21C1
nesdoug.com -- blog/tutorial on programming for the NES
-
- Posts: 490
- Joined: Fri Mar 01, 2013 4:46 am
Re: Need guidance with nes to snes.
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.