"Hello World" on Raspberry Pi OS 32-Bit?

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
Bob_Yoseph
Posts: 14
Joined: Sun Mar 14, 2021 8:30 pm

"Hello World" on Raspberry Pi OS 32-Bit?

Post by Bob_Yoseph » Sun Mar 14, 2021 8:48 pm

Hello. I have downloaded CC65, TileMolester, and the FamiStudio 230 Sound Engine on to my RPi 3 Model B v1.2 from 2015. Due to circumstances, this is my only way of accessing the Internet, effectively making it my only way towards NES development.

To start I have I downloaded "6502 Machine Code for Beginners", "NESDoc", and a pdf version of Nerdy Nights through http://nerdy-nights.nes.science/. Since I wanted to stick to assembly, I decided to download the .zip of Dave Dribin's ca65 port.

I have attempted to compile the "03background" through "make" in the terminal and it shows me this error:

Code: Select all

pi@raspberrypi:~ $ cd  /home/pi/Desktop/NESGame_Dev/Reference_files/ddribin-nerdy-nights-e3d439692dda/03-background
pi@raspberrypi:~/Desktop/NESGame_Dev/Reference_files/ddribin-nerdy-nights-e3d439692dda/03-background $ make
cl65 -l -t nes -g -t nes -m background.map -Ln background.lbl -o background.nes background.asm
cl65: Don't know what to do with 'nes'
make: *** [../common.mk:23: background.nes] Error 1
I tried to read the cc65 documentation and didn't find anything. So where do I go from here?

lidnariq
Posts: 10456
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: "Hello World" on Raspberry Pi OS 32-Bit?

Post by lidnariq » Sun Mar 14, 2021 9:45 pm

-l takes a parameter, so it's parsing it as
"-l -t"
"nes".

Try "-l background.lst -t nes" &c

Bob_Yoseph
Posts: 14
Joined: Sun Mar 14, 2021 8:30 pm

Re: "Hello World" on Raspberry Pi OS 32-Bit?

Post by Bob_Yoseph » Wed Mar 17, 2021 5:39 am

I am new to some of the terminology that your are using, so I might have messed up. This is my 500th attempt to get into game development and programming. :/ Anyway, here's what happened:

Code: Select all

pi@raspberrypi:~ $ cd  /home/pi/Desktop/NESGame_Dev/Reference_files/ddribin-nerdy-nights-e3d439692dda/03-background pi@raspberrypi:~/Desktop/NESGame_Dev/Reference_files/ddribin-nerdy-nights-e3d439692dda/03-background $ -l background.lst -t nes bash: -l: command not found pi@raspberrypi:~/Desktop/NESGame_Dev/Reference_files/ddribin-nerdy-nights-e3d439692dda/03-background $

lidnariq
Posts: 10456
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: "Hello World" on Raspberry Pi OS 32-Bit?

Post by lidnariq » Wed Mar 17, 2021 12:09 pm

Where did the Makefile come from?


lidnariq
Posts: 10456
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: "Hello World" on Raspberry Pi OS 32-Bit?

Post by lidnariq » Wed Mar 17, 2021 5:18 pm

Edit the file "common.mk" inside.

On the line that says ASFLAGS = -l -t nes remove the -l

On the line that says CLFLAGS = -l -t nes -g $(CLCONFIG_FLAGS) -m $(PROGRAM).map -Ln $(PROGRAM).lbl add this one word:
CLFLAGS = -l $(PROGRAM).lst -t nes -g $(CLCONFIG_FLAGS) -m $(PROGRAM).map -Ln $(PROGRAM).lbl

Bob_Yoseph
Posts: 14
Joined: Sun Mar 14, 2021 8:30 pm

Re: "Hello World" on Raspberry Pi OS 32-Bit?

Post by Bob_Yoseph » Wed Mar 17, 2021 6:36 pm

There are only two files, which both are below, and there is no "common.mk" file.
Contents of "makefile":

Code: Select all

PROGRAM	= background
SOURCES	= background.asm

include ../common.mk
background.asm
(1.74 KiB) Downloaded 29 times

lidnariq
Posts: 10456
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: "Hello World" on Raspberry Pi OS 32-Bit?

Post by lidnariq » Wed Mar 17, 2021 7:08 pm

In the directory above that one. See how the Makefile says "include ../common.mk" ?

Bob_Yoseph
Posts: 14
Joined: Sun Mar 14, 2021 8:30 pm

Re: "Hello World" on Raspberry Pi OS 32-Bit?

Post by Bob_Yoseph » Fri Mar 19, 2021 5:13 pm

Ah.
Here is what happens when I type "make" in now:

Code: Select all

cl65 -l background.lst -t nes -g -t nes -m background.map -Ln background.lbl -o background.nes background.asm
ld65: Warning: /home/pi/develop/cc65/cfg/nes.cfg(18): Segment 'VECTORS' overflows memory area 'ROMV' by 6 bytes
ld65: Error: Cannot generate most of the files due to memory area overflow 
make: *** [../common.mk:23: background.nes] Error 1
And the result is three files: background.lst, background.map, and background.o.

lidnariq
Posts: 10456
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: "Hello World" on Raspberry Pi OS 32-Bit?

Post by lidnariq » Fri Mar 19, 2021 6:27 pm

In the asm file, look down for the place it says .segment "VECTORS".
Remove the line after it that says
.word 0, 0, 0 ; Unused, but needed to advance PC to $fffa.

Bob_Yoseph
Posts: 14
Joined: Sun Mar 14, 2021 8:30 pm

Re: "Hello World" on Raspberry Pi OS 32-Bit?

Post by Bob_Yoseph » Fri Mar 19, 2021 6:58 pm

Hey, it worked. Thanks.

So do you think that this will be a problem whenever I try to compile anything from the .zip file?

lidnariq
Posts: 10456
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: "Hello World" on Raspberry Pi OS 32-Bit?

Post by lidnariq » Fri Mar 19, 2021 7:03 pm

Yeah, you'll need to adjust all the examples' VECTORS sections.

Bob_Yoseph
Posts: 14
Joined: Sun Mar 14, 2021 8:30 pm

Re: "Hello World" on Raspberry Pi OS 32-Bit?

Post by Bob_Yoseph » Fri Mar 19, 2021 7:38 pm

Ok. Thanks.

Post Reply