Yes, I know, this is my third time making pong for a console, but this is just my way with getting familiar with a console.
Anyway yeah, I ported pong to the NES. Note that this version gets no inspiration from Nerdy Nights, which can be either good or bad, I can't remember.
I had actually attempted to do this a few months ago, but on a relative's computer, as mine was getting repairs. The relative's computer freaked out and deleted the source, and my PC's hard drive was damaged past restoration, so...yeah.
The source can be found here. Written for ca65. Its throne resides in my pong repo, because three different repos for the same game is. Well. Weird.
My to do list:
* make the source code readable (more comments)
* make the AI beatable (random value magic)
* make the source build into two roms: pong_ai.nes, which is you versus the computer, and pong_vs.nes, you versus player two.
Please give as much feedback as possible. As I said, that's the main reason I keep making pong games in the first place.
I Made a NES Pong Thing
Moderator: Moderators
I Made a NES Pong Thing
- Attachments
-
- pong.nes
- (16.02 KiB) Downloaded 269 times
Re: I Made a NES Pong Thing
Rather than make a better Pong, wouldn't you like to branch out into a more complex game?
Or, do what you want...
It would be nice if moving the paddle up or down during ball collision would change it's direction/speed.
ca65 has random number generator code, btw...it's under stdlib.h.
Or, do what you want...
It would be nice if moving the paddle up or down during ball collision would change it's direction/speed.
ca65 has random number generator code, btw...it's under stdlib.h.
nesdoug.com -- blog/tutorial on programming for the NES
Re: I Made a NES Pong Thing
My dilemma is what console, what tools, and what time.dougeff wrote:Rather than make a better Pong, wouldn't you like to branch out into a more complex game?
Direction, I can do. Speed, I can't.It would be nice if moving the paddle up or down during ball collision would change it's direction/speed.
You're talking about cc65; I'm using assembly. Will check out the C stuff, though, because it wouldn't be my first time taking something from there. ("My" NES defines)ca65 has random number generator code, btw...it's under stdlib.h.
Re: I Made a NES Pong Thing
Nope... The code is asm. Take a look. Cut/Paste it out of stdlib.h
...or maybe it was rand.s...
https://github.com/cc65/cc65/blob/maste ... mon/rand.s
...or maybe it was rand.s...
https://github.com/cc65/cc65/blob/maste ... mon/rand.s
nesdoug.com -- blog/tutorial on programming for the NES
Re: I Made a NES Pong Thing
You can still call functions from the cc65 runtime even in a pure-asm project.nicklausw wrote:You're talking about cc65; I'm using assembly. Will check out the C stuff, though, because it wouldn't be my first time taking something from there.
Re: I Made a NES Pong Thing
...what lidnariq said...
I think you have to type something like...
.import _rand, _srand
And CA65 automatically knows what you're talking about... I'm away from my computer at the moment, so I can't test it. Maybe you also need to have an include. (?)
And then later...jsr _rand will put a pseudorandom number in A [and X].
I think you have to type something like...
.import _rand, _srand
And CA65 automatically knows what you're talking about... I'm away from my computer at the moment, so I can't test it. Maybe you also need to have an include. (?)
And then later...jsr _rand will put a pseudorandom number in A [and X].
nesdoug.com -- blog/tutorial on programming for the NES
Re: I Made a NES Pong Thing
I'd rather just do copy-paste (and maybe "sorry") than go through the trouble of having to rely on the C suite.
Re: I Made a NES Pong Thing
This worked for me...(no need to include anything)
Code: Select all
.import _rand
.import _srand
.segment "CODE"
;you should first put a seed value in...
jsr _srand
jsr _rand ;then this generates a new random number
nesdoug.com -- blog/tutorial on programming for the NES
- rainwarrior
- Posts: 8733
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: I Made a NES Pong Thing
The linker would need to know where to find _rand. It's in the common lib, but you can just look at the code yourself if you like:
https://github.com/cc65/cc65/blob/maste ... mon/rand.s
Alternatively, I put a simple PRNG implementation on the wiki a while back because it kept coming up: http://wiki.nesdev.com/w/index.php/Rand ... _generator
https://github.com/cc65/cc65/blob/maste ... mon/rand.s
Alternatively, I put a simple PRNG implementation on the wiki a while back because it kept coming up: http://wiki.nesdev.com/w/index.php/Rand ... _generator