Search found 152 matches

by FinalZero
Tue Aug 02, 2011 11:35 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

Okay, I'll try that. I didn't know there was a cc65 wiki. Thanks for the link. * * * Also, I use "byte" as a typedef for "unsigned char" (and "ushort" for "unsigned short", etc). The latter is just too long to type. * * * Btw, is there a irc channel for this b...
by FinalZero
Tue Aug 02, 2011 11:13 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

Compiler does not optimize things like this. Okay Also, why you need this code to be fast? It is called like once per frame, you can do it in pure C and it will not have any real impact on perfomance. I guess I don't know if I do or not. If you want, you can make this (or any other) function in ass...
by FinalZero
Tue Aug 02, 2011 10:05 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

I get an error on the following line of code: for(char i = 0; i < limit; i++) The error is simply: "expression expected". The whole function is: for(char i = 0; i < limit; i++) { lda gamepadARaw // Bit 0 of Raw == Current Button Status shr // Bit 0 of Raw -> Carry rol gamepadA // Bit 0 of ...
by FinalZero
Tue Aug 02, 2011 9:04 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

Now you can access it from C file if declare it there as an extern:
Okay. I think I get it now. include the header which has

Code: Select all

extern const unsigned char my_data[];
and then assemble the .s file which has the actual code, and then link the .o from it's output. Right?
by FinalZero
Tue Aug 02, 2011 8:43 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

Yes, they point to places in the ROM for data and such. If they don't exist, it won't output a file. In assembly I'd just .include the file. How do I include the file in C? I can't just use "#include "something.s"", because it'll think that it's a C file, when it's actually asse...
by FinalZero
Tue Aug 02, 2011 8:35 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

If those aren't pointers to ROM, then it should throw an error. The first pass it pretty much assembles all the code and data and the 2nd pass it fills in the labels with the info, in a nutshell, I believe....
They're pointers/addresses, but they're defined/declared in the included assembly file.
by FinalZero
Tue Aug 02, 2011 8:22 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

Say I have the following assembly file: mainLoop: jsr readGamepadA jsr handleInput jsr vBlankWait jsr drawSprites jmp mainLoop How will it assemble if it doesn't know what any of those identifiers are? Your probably right though. I don't know how import and export work, and my assembly is still shaky.
by FinalZero
Tue Aug 02, 2011 8:13 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

I realized the problem with 2) in my previous post. My code actually had: #pragma charmap('0', 0x00) It was complaining about the 0x00. Apparently, one can't map anything from NOR to 0. cc65 itself generates an assembly file, so there is no problem to add an assembly file. Just assemble it and then ...
by FinalZero
Tue Aug 02, 2011 6:45 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

A couple more questions, this time about cc65. 1) #pragma charmap('\0', 0xFF) is illegal, so C doesn't barf. I suppose there's no way to tell C to terminate strings with something other than '\0' (0x00), is there? I realize that it isn't that big of an issue anyways; Just move your font around so 0x...
by FinalZero
Tue Aug 02, 2011 7:43 am
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

The return address (minus one) is pushed, and the new address is loaded into the program counter.
I made a mistake. I meant RTS, not JSR...
The same, except that the stack pointer wraps around within the $0100-$01FF page.
That sounds bad.

* * *

Thank you for you timely response.
by FinalZero
Tue Aug 02, 2011 6:29 am
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

So, I've mustered the strength and moral courage to try and do this again. I have some free time before university begins again in the fall. * * * So, here's a new round of questions: 1) The registers are only a byte large, right? How does one do/simulate math with 2 or more bytes? 2) What happens i...
by FinalZero
Fri Feb 11, 2011 12:09 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

The basics of day/night can be done by screwing with the palette and/or the tint bits. Look at the difference in SMB1 between 1-1 and 3-1 for a crude idea of how to do this. Zelda: ALTTP had a light and dark world with mostly the same outdoor map, and there was some sort of differential coding: obj...
by FinalZero
Fri Feb 11, 2011 3:12 am
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

[tokumaru's text] Oh, you're describing the same thing that SMB3 does for pipes. I'm not sure why I wasn't able to realize that one could use that for walls too... But then you are not making NES programs anymore, but FCEUX programs, don't you agree? If you are going to deliberately ignore a system...
by FinalZero
Thu Feb 10, 2011 10:44 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

You mean how the wall overlaps the characters? The best way to do that on the NES would be to use mask sprites... sprites with the same shape as the wall, with higher priority (lower OAM index) than the character sprites and with the "behind background" bit set. When your character sprite...
by FinalZero
Wed Feb 09, 2011 8:23 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61218

Dithering means adding noise to spread out rounding errors. Spatial dithering spreads out rounding errors between neighboring pixels. Temporal dithering spreads out rounding errors from one frame to the next: each pixel is flickered. "Spatiotemporal" dithering spreads out rounding errors ...