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: 11938
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: 11938
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!

therektafire
Posts: 3
Joined: Thu Nov 30, 2017 12:34 am

Re: Nerdy Night issue

Post by therektafire » Thu Jan 07, 2021 7:53 pm

tokumaru wrote:
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".
I'm going through the NN tutorials right now and the day 3 code works perfectly fine for me on FCEUX but not on mesen... when running it on mesen for me the screen is completely green and changing the intensity bits only changes how bright the green is... I did a test by adding some code that cycles the intensity bits between red green blue and none every 256 frames, on fceux it cycles the colors correctly but on mesen like I said it just shows different shades of green. I assume that's because mesen is more accurate? If so what do I need to do to make the screen the correct color on it

Pokun
Posts: 1691
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Nerdy Night issue

Post by Pokun » Fri Jan 08, 2021 4:25 pm

Yeah I guess it's just FCEUX not being accurate enough. I don't think Nerdy Nights initializes the palette in the first lesson so the backdrop can have any color. Until you learn how to do that (fill the palette with black $0F) you might want to stick with FCEUX.

The fact that the Nerdy Nights tutorial doesn't initialize everything is one of its flaws. Anything stored in any kind of RAM should normally be initialized after reset (including VRAM and palette), but you can learn to do that later.

Post Reply