Nerdy Night issue

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
CrypticSun
Posts: 3
Joined: Mon Jun 08, 2020 8:12 am

Nerdy Night issue

Post by CrypticSun » Mon Jun 08, 2020 8:24 am

Hi, we are two italian girls trying to learn about assembly, we downloaded the Nerdy Nignt guide and at the passage number 3, we don't know how to apply what the guide says. It doesn't give us the instructions, just a bunch of information that says to copy in our code. We are using FCEUXDSP, the same program used in this guide, we tried to follow all the instructions and now we are stuck in this last part. Can anyone help please?

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

Re: Nerdy Night issue

Post by tokumaru » Mon Jun 08, 2020 7:05 pm

What exactly is it that you don't get? If I'm looking at the correct lesson (is this it?), it first teaches you the basics of assembly programming, which you should read carefully even if it doesn't all make sense at first. Then it shows a minimal test program, little by little, creating something that assembles into a valid NES ROM and establishing a basic structure that can be reused in future lessons. Finally, there's a download which I assume contains the source code and support files necessary to compile this test program (NESASM itself is probably not included). What is it that you feel is missing? As far as I can tell, the entire program and the instructions to assemble it are all there.

Here's the thing about FCEUXD SP though: it's a severely outdated emulator that wasn't particularly accurate to begin with. You should at least be using FCEUX, which incorporated the debugging features of XD SP and is still maintained. But even FCEUX isn't particularly accurate (as is the case of every emulator in the FCEU line), and is a bit too relaxed with matters related to timing, meaning that it will hide certain programming mistakes. So even if you do use FCEUX for its debugging features, be sure to test your program in more accurate emulators as well, such as Mesen and Nintendulator.

CrypticSun
Posts: 3
Joined: Mon Jun 08, 2020 8:12 am

Re: Nerdy Night issue

Post by CrypticSun » Tue Jun 09, 2020 10:48 am

The thing is, we don't understand how to change the background colour, we have read the passage over and over without any result. The only thing that happened was an error message saying "syntax error", so we know we are doing some mistakes. What do we have to do? Thanks!!

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

Re: Nerdy Night issue

Post by tokumaru » Tue Jun 09, 2020 3:11 pm

Did you successfully assemble the original demo program? This is a very simple program that basically tells the NES "hey, make everything bluer".

Programs running on the CPU communicate with other parts of the hardware (such as the PPU, which is the component that generates images) through special addresses that act as communication ports. One such port is mapped to address $2001, and as explained in the article, each bit written to this address communicates something to the PPU.

The example program is setting only one bit in the value being written to $2001, which, according to the table shown in the article, means "intensify blues". If you want to try other colors, all you have to do is play with the top 3 bits of that value, causing other colors to be intensified. In the example program, %10000000 intensifies blues, but if you change that value to %01000000 the PPU will make the picture greener instead of bluer. You can also combine colors (e.g. turning both the red bit and the blue bit will make the screen look purple).

CrypticSun
Posts: 3
Joined: Mon Jun 08, 2020 8:12 am

Re: Nerdy Night issue

Post by CrypticSun » Tue Jun 09, 2020 4:10 pm

Ok! So we finally did it! Thank you so much, so now we know that we have to read more carefully, because it is starting to get complicated :shock:
Thank you again!

Post Reply