Nestopia

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
Lloyd Gordon
Posts: 150
Joined: Mon Nov 07, 2005 11:32 am
Location: Toronto
Contact:

Nestopia

Post by Lloyd Gordon » Thu Jul 06, 2006 6:33 pm

I'm trying Nestopia because I like the NTSC filter. However on Nestopia my second moving character doesn't show up even though it does on FCEUD and Nintendulator. I'm using a 0 mapper with the 8 X 16 sprites. Any ideas?

User avatar
Quietust
Posts: 1684
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Post by Quietust » Thu Jul 06, 2006 6:38 pm

It would be useful to know what program you're trying to run...
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.

User avatar
Memblers
Site Admin
Posts: 3897
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers » Fri Jul 07, 2006 5:56 am

I think he means on his own program.

Sounds strange. If it works on Nintendulator, it's probably ok on the NES. No way to be sure though without testing (I trust it for testing my PAL code timing though, hasn't failed me yet). Are you using Sprite-DMA?

I've got my dev system hooked up now if you want a test.

User avatar
Lloyd Gordon
Posts: 150
Joined: Mon Nov 07, 2005 11:32 am
Location: Toronto
Contact:

Nestopia

Post by Lloyd Gordon » Fri Jul 07, 2006 9:33 am

Sorry, I'm running my own code, a sidescrolling game. It's pretty simple so far. There are only 2 "characters", the one that the user moves and one enemy. It's the enemy that doesn't show up at all on Nestopia although it does on FCEUD and Nintendulator. The "enemy" movement seems more accurate on FCEUD for some reason. I only use sprite DMA which I update on every VBlank. The NTSC filter is really good on Nestopia as it shows how bad my artwork would look on the console on a real tv. It's sort of weird how Nestopia doesn't show the second character at all. Any help would be appreciated. I could email the .nes file. I still have problems with NTSC weird colour effects, which I think are due to palette choices and graphic detail.

User avatar
Bregalad
Posts: 8008
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Post by Bregalad » Fri Jul 07, 2006 10:27 am

Are you sure you don't have more than 8 sprites per line ?
Are you sure you have proper sprite name table select via $2000 at the end of VBlank ?
Useless, lumbering half-wits don't scare us.

User avatar
Quietust
Posts: 1684
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Post by Quietust » Fri Jul 07, 2006 10:29 am

I've got an NROM (actually CNROM) RAM cartridge, if you'd like to see how the program behaves on a "real NES" (as opposed to Nestopia) - email me a copy of the ROM image (via GMail; the account name is the same as I'm using here) and I'll test it tonight.
Bregalad wrote:Are you sure you don't have more than 8 sprites per line ?
Are you sure you have proper sprite name table select via $2000 at the end of VBlank ?
Either of those would have definitely caused problems in Nintendulator as well, so it must be something else.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.

User avatar
Lloyd Gordon
Posts: 150
Joined: Mon Nov 07, 2005 11:32 am
Location: Toronto
Contact:

Nestopia

Post by Lloyd Gordon » Sat Jul 08, 2006 6:21 pm

Bregalad:
I'm only using two characters each using 2 8x16 sprites. All the other sprites are hidden with a Vertical position of $F7 until I need them. So the 8 sprite per line limit shouldn't matter. Nestopia can turn off that limit and it doesn't change anything.
I'm not sure what sprite nametable select means. I select the proper nametable address via $2006 at the end of VBlank. I set up $2000 and $2001 only when I need to change something . I don't change $2000 routinely in VBlank and I only set $2000 D3, the Sprite Pattern Table Address, near the beginning of the program. I thought the NES ignores D3 of $2000 if D5 was set to 1 for 8 x 16 sprites. If I'm confused or missing something, please let me know.

Quietust :
I'll send you the .nes file on Gmail.

Thanks.

tepples
Posts: 22278
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Sat Jul 08, 2006 6:27 pm

Does it work in Nestopia if you take six cycles to lda #0 sta OAMADDR before each write to OAM_DMA ($4014)?

User avatar
Lloyd Gordon
Posts: 150
Joined: Mon Nov 07, 2005 11:32 am
Location: Toronto
Contact:

Post by Lloyd Gordon » Sat Jul 08, 2006 6:36 pm

Tepples:

NMI: pha ;Non-maskable interupt
txa ;store a,x,y
pha
tya
pha

lda #$00
sta $2003 ;initialize spram pointer
lda #$02 ;must update spram in Vblank
sta $4014 ;DMA sprite transfer

This is the beginning of my NMI code. Is this what you mean?

User avatar
Quietust
Posts: 1684
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Post by Quietust » Sat Jul 08, 2006 7:02 pm

I've just tested it on my CopyNES and it works fine - both characters (one being a square guy with arms and legs, the other looking like a blue cloud) are fully visible and appear to move around normally.

I suspect the problem may be related to uninitialized memory.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.

tepples
Posts: 22278
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Sat Jul 08, 2006 7:04 pm

You're copying page $0200 to OAM correctly, but what are you writing into each byte of $0200-$02FF?

User avatar
Lloyd Gordon
Posts: 150
Joined: Mon Nov 07, 2005 11:32 am
Location: Toronto
Contact:

Post by Lloyd Gordon » Sat Jul 08, 2006 7:35 pm

You're copying page $0200 to OAM correctly, but what are you writing into each byte of $0200-$02FF?

Right now, I'm just using 4 8 x 16 sprites to make two 16 x 16 characters so I'm updating the first 16 bytes of $0200-$02FF in non-NMI to keep track of the vertical & horizontal positions, tile numbers, & sprite attributes.

The second 16 x 16 character shows up correctly on FCEUD and Nintendulator but not at all on Nestopia. I'd like to amend my code so all the sprite graphics show up on Nestopia so I can optimize the palette choices for NTSC.

User avatar
Lloyd Gordon
Posts: 150
Joined: Mon Nov 07, 2005 11:32 am
Location: Toronto
Contact:

Post by Lloyd Gordon » Sat Jul 08, 2006 7:39 pm

Quietust:

Thanks for taking the time to run it. Now if only I could figure out how to get my sprites to show up properly on Nestopia. If my code works on the NES and not Nestopia does this mean this behaviour is caused by a bug in Nestopia?

Thanks everybody for the help.

Marty
Posts: 40
Joined: Fri Nov 12, 2004 5:02 am

Post by Marty » Sat Jul 08, 2006 7:42 pm

Have you tried it on my latest build, released yesterday?

If you have and it still doesn't work, could you send me your ROM image so I can have a look at it? martin-freij at home . se

User avatar
Bregalad
Posts: 8008
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Post by Bregalad » Sun Jul 09, 2006 1:23 pm

I recommand you to use $2005 and $2000 every VBlank to setup proper scrolling. $2006 is weird, because it only allow you 8-pixel precision. Use $2006 for scrolling only during rendering if you have no other way to do arround.
Useless, lumbering half-wits don't scare us.

Post Reply