"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 »

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: 11432
Joined: Sun Apr 13, 2008 11:12 am

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

Post by lidnariq »

-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 »

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: 11432
Joined: Sun Apr 13, 2008 11:12 am

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

Post by lidnariq »

Where did the Makefile come from?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

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

Post by lidnariq »

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 »

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 109 times
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

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

Post by lidnariq »

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 »

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: 11432
Joined: Sun Apr 13, 2008 11:12 am

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

Post by lidnariq »

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 »

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: 11432
Joined: Sun Apr 13, 2008 11:12 am

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

Post by lidnariq »

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 »

Ok. Thanks.
Post Reply