Define a Pallete Only For The Background

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

Moderator: Moderators

User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Zepper wrote:Meh, Tokumaru was faster. :)
Yeah, but the truth is that there isn't a single way to do this. Your code is slightly different from mine, but it's just as good. You also included the resetting of the $2006/$2005 latch, which I didn't because I'm very organized with my PPU operations and always use $2006/$2005 in pairs.

There are a thousand different ways to set the palettes, and if he keeps using the trial and error method of finding something that works he'll not find which of those thousand ways is best for him. He'll only find the best way if he understands what is going on in the code.

I remember that in high school and in college a lot of teachers just gave the students blocks of code without actually explaining why they did what they were supposed to do. This is a very poor way to teach programming, and the tests were basically cut&paste-fests, and if anything slightly different from what was seen in class was asked, the students weren't able to change a freaking variable in the code in order to adapt it to a new situation.

Some people on the internet end up doing the exact same thing. They just want a block of code to achieve a task, rather than deeply understand each step of that block of code. I just don't want Nathan to follow that route, or he won't get very far.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

nathanpc wrote::lol: Dois brazucas
Just wait; a brazilian more will pop in at any moment ;-)
tokumaru wrote:Some people on the internet end up doing the exact same thing. They just want a block of code to achieve a task, rather than deeply understand each step of that block of code. I just don't want Nathan to follow that route, or he won't get very far.
Sometimes what they want is called a "library". For example, if you want to parse JSON, you don't want to reinvent the wheel and understand the parser; you just want to put a JSON string in and get a dict out.
Post Reply