It is currently Tue Dec 12, 2017 4:57 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Mon Aug 22, 2016 5:11 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6510
Location: Seattle
furrykef wrote:
There might be some tutorial (either now or in the future) where DMA is done once during initialization and then ignored, which would make sense for a program without sprites. If that DMA is done before initializing sound, the poor user might waste hours trying to find out why he's getting garbage on the screen when he runs his program. And for what? To save two bytes in the sound initializer?
When the PPU first powers up, OAM contains garbage in the first place. Garbage from a nonsense DMA isn't going to be meaningfully differently deleterious...

That said, I should write that OAM cold-boot DRAM test.


Top
 Profile  
 
PostPosted: Mon Aug 22, 2016 5:27 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2982
Location: Tampere, Finland
furrykef wrote:
thefox wrote:
I bet this is why the comments about the purpose of the initialization values were removed, and also why it doesn't care about triggering a most likely harmless OAM DMA.

This is a dangerous attitude to have. For one thing, if you're going to put up a message saying not to modify the code at all, it had better be good code. It wasn't.

Second, you're making a lot of assumptions in calling the OAM DMA "most likely harmless". Sure, it's harmless if another DMA is done right afterward, but there's no reason to presume so. There might be some tutorial (either now or in the future) where DMA is done once during initialization and then ignored, which would make sense for a program without sprites. If that DMA is done before initializing sound, the poor user might waste hours trying to find out why he's getting garbage on the screen when he runs his program. And for what? To save two bytes in the sound initializer?

I'm not really arguing whether it's good or bad, just trying to provide my guess at why those decisions were made, since many people in the thread seemed to be misunderstanding the purpose of that page. (You're going to have to ask blargg if you want the real reasons, he created the page.)

BTW, doing OAM DMA once in initialization is bad practice. It's very easy to accidentally run too much code after the DMA before enabling rendering, causing it to decay and to not have a well-defined state after all. If you're not using sprites, you can turn off their rendering in $2001 and not care about the state of OAM.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Mon Aug 22, 2016 5:48 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5891
Location: Canada
thefox wrote:
I'm not really arguing whether it's good or bad

IMO the overall premise of this page is good. A fairly minimal set of steps showing how to make the APU play a sound on 4 of its channels. It's a nice little tutorial, similar to the first few programs I ever wrote to teach myself how to use the APU.

I have a laundry list of little nitpicks with it, which I left on the wiki (sorry to fragment the discussion), but I think in general the page is worth keeping and maintaining.


Top
 Profile  
 
PostPosted: Fri Aug 26, 2016 5:18 pm 
Offline
User avatar

Joined: Thu Jan 03, 2008 1:48 pm
Posts: 544
(Move to "NES Music", please. :) )


Top
 Profile  
 
PostPosted: Fri Aug 26, 2016 5:20 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5891
Location: Canada
There's no music in this thread. The questions are about programming.

Is it policy that anything related to sound program belongs in "NES Music" now? I don't think it's been this way in the past... most APU programming stuff seems to be under NESdev.


Top
 Profile  
 
PostPosted: Fri Aug 26, 2016 5:22 pm 
Offline
User avatar

Joined: Thu Jan 03, 2008 1:48 pm
Posts: 544
rainwarrior wrote:
There's no music in this thread. The questions are about programming.

Is it policy that anything related to sound program belongs in "NES Music" now? I don't think it's been this way in the past... most APU programming stuff seems to be under NESdev.

"Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music."


Top
 Profile  
 
PostPosted: Fri Aug 26, 2016 8:31 pm 
Offline

Joined: Sat Apr 25, 2015 1:47 pm
Posts: 336
Location: FL
I think most people would assume that means "anything else related to creating NES music", not how to correctly poke some registers in an assembly program.


Top
 Profile  
 
PostPosted: Sat Aug 27, 2016 5:38 am 
Offline
User avatar

Joined: Thu Jan 03, 2008 1:48 pm
Posts: 544
Pretty sure poking around at sound registers to make output is creating music/art; regardless of standard convention. :)


Top
 Profile  
 
PostPosted: Sat Aug 27, 2016 2:51 pm 
Offline

Joined: Fri Mar 02, 2012 11:10 pm
Posts: 35
I did think of a reason to write to the regs in ascending order instead of descending: I forgot that the registers $4003, $4007, etc. can act as triggers, so you might not want to write to them until after writing to the other registers for that channel. Dunno if that affects how this particular code works or not.


Top
 Profile  
 
PostPosted: Sat Aug 27, 2016 2:51 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
B00daW wrote:
(Move to "NES Music", please. :) )

Please don't. The discussion here has nothing to do with music.


Top
 Profile  
 
PostPosted: Sat Aug 27, 2016 3:14 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5891
Location: Canada
furrykef wrote:
I did think of a reason to write to the regs in ascending order instead of descending: I forgot that the registers $4003, $4007, etc. can act as triggers, so you might not want to write to them until after writing to the other registers for that channel. Dunno if that affects how this particular code works or not.

It doesn't really matter for the example, which doesn't use the triggered features, but I agree (I made the same suggestion on the wiki talk page). Those registers are canonically the "start a note" register, by design.


Top
 Profile  
 
PostPosted: Sun Aug 28, 2016 1:39 am 
Offline
User avatar

Joined: Thu Jan 03, 2008 1:48 pm
Posts: 544
Bregalad wrote:
B00daW wrote:
(Move to "NES Music", please. :) )

Please don't. The discussion here has nothing to do with music.

OK. Well, you used the word "nothing". Let's either reset 2a0x code without init code or play music code without clear commands during a reset.

How much of "nothing" is involved with initialization and clearing bits of APU code?

Secondary question, if PPU and/or APU code related to their respective "territories" is an instigated topic within "NESdev" of the forums, when is it not appropriate to move to respective forums of the questioned topic?


Top
 Profile  
 
PostPosted: Sun Aug 28, 2016 2:25 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5891
Location: Canada
B00daW wrote:
Let's either reset 2a0x code without init code or play music code without clear commands during a reset.

Lots of people make NES music without writing any code at all (and those people don't post in the Dev forum).

Programming stuff mostly go in the Dev forum. The resulting art and music mostly goes in the Graphics and Music forums.

There's a ton of PPU programming threads in the Dev forum, hardly anybody posts that kind of thing in the Graphics forum. The more technical Graphics forum posts are usually more like "what is possible on the NES", not "here's how reads from $2007 are buffered".

The Music forums are mostly music people have made, album releases, NSF rips, tools to make music, etc. Hardly anybody posts there about programming the APU.

People post against the trend in either forum now and then, but this isn't one of those. I agree that APU programming is related to music, but it's still more appropriate for the Dev forums. Ideally instead of separate forums I wish we'd just have category tags, so it could exist happily with both tags, but that just isn't the world we live in.


Top
 Profile  
 
PostPosted: Thu Sep 01, 2016 12:12 pm 
Offline
User avatar

Joined: Fri Jan 24, 2014 9:05 am
Posts: 140
Location: Hungary
Based on a quick look at that page I'm extremely happy that when I started out I only ever used the APU reference to do what I wanted... part of the truth was that I had already familiarized myself with most of the APU features through Famitracker so it all made sense to me.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group