Can i use BIT $2007 to increment the PPU pointer and not write anything?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
User avatar
Controllerhead
Posts: 314
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Can i use BIT $2007 to increment the PPU pointer and not write anything?

Post by Controllerhead »

Title is the question. Is this safe to do? Are there any known fail cases?
Image
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Can i use BIT $2007 to increment the PPU pointer and not write anything?

Post by rainwarrior »

Yes, that can be used.

However, if using DPCM it should not, because there's a possibility of a double-read conflict if the sample is fetched at the same time, which will increment twice.
User avatar
Controllerhead
Posts: 314
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Re: Can i use BIT $2007 to increment the PPU pointer and not write anything?

Post by Controllerhead »

rainwarrior wrote: Mon Apr 26, 2021 1:01 pm However, if using DPCM it should not, because there's a possibility of a double-read conflict if the sample is fetched at the same time, which will increment twice.
Exactly the kind of in-depth knowledge i'm looking for. Thank you!
Image
puppydrum64
Posts: 160
Joined: Sat Apr 24, 2021 7:25 am

Re: Can i use BIT $2007 to increment the PPU pointer and not write anything?

Post by puppydrum64 »

rainwarrior wrote: Mon Apr 26, 2021 1:01 pm Yes, that can be used.

However, if using DPCM it should not, because there's a possibility of a double-read conflict if the sample is fetched at the same time, which will increment twice.
I always found that strange that this happens. Also another thing I find odd is that $4017 is associated with both the second controller and APU frame IRQs. Would there be a similar conflict there?
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Can i use BIT $2007 to increment the PPU pointer and not write anything?

Post by tepples »

$4017 write is APU frame IRQs. $4017 read is player 2. No conflict. It's like most mappers: $8000-$FFFF read is ROM, whereas $8000-$FFFF write is mapper commands.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Can i use BIT $2007 to increment the PPU pointer and not write anything?

Post by tokumaru »

puppydrum64 wrote: Mon May 10, 2021 7:44 amAlso another thing I find odd is that $4017 is associated with both the second controller and APU frame IRQs. Would there be a similar conflict there?
No, because the effects of accessing this address differ depending on whether the access is a read or a write. Like I said before, in addition to using the address lines when deciding which device to activate, the system also uses the read/write signal, and based on that it can select completely different devices on the same address.
Post Reply