DEV Community

Cover image for Writing a NES game day 5
Draculinio
Draculinio

Posted on

Writing a NES game day 5

I was looking at the rest of the code that we have in the code we are analyzing BUT it is just some code that is claearing the memory, and is way better explained in nerdy nights website so let's continue with the blog.

In the weekend I was coding and following the tutorial (and in the future when I understand more of this I will be able to explain how all this assembler hell works) and first I was able to put a big and a little Mario on the screen as sprites.
Then I made Little Mario move back and forth with left and right pad and it is working.

Image description

Now, as you see there are other things in the picture, now I am working with the backgrounds (explaining this will be HELL). The problem that I am having now is that in the code I put this:

nametabledata:
    .byte $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$20,$24,$24,$24,$24  ;;row 1
    .byte $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24  ;;all sky ($24 = sky)

    .byte $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24  ;;row 2
    .byte $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24  ;;all sky

    .byte $24,$24,$24,$24,$45,$45,$24,$24,$45,$45,$45,$45,$45,$45,$24,$24  ;;row 3
    .byte $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$53,$54,$24,$24  ;;some brick tops

    .byte $24,$24,$24,$24,$47,$47,$24,$24,$47,$47,$47,$47,$47,$47,$24,$24  ;;row 4
    .byte $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$55,$56,$24,$01  ;;brick bottoms

Enter fullscreen mode Exit fullscreen mode

The thing is that it is loading in the reverse order (if you see, $24 is the sky tile in the .chr file and it is supposed that the upper part is filled with sky BUT the upper part is filled with the last row, so everything is upside down and I don't know why. If I can't change that I will need to see everything from down to top in the code wich will put another layer of complexity.

Top comments (0)