OK, it is fixed, I used jed-editor, it adds {} automatically, unless you mentioned why wait_vblank() is inside if {}, I looked again and realized there's while{} too, changed my code, and works now, perfectly !
Thanks very much !
-jp
Search found 45 matches
- Fri Feb 18, 2011 7:20 am
- Forum: NESdev
- Topic: CC65, NES, joystick
- Replies: 20
- Views: 9823
- Fri Feb 18, 2011 7:14 am
- Forum: NESdev
- Topic: CC65, NES, joystick
- Replies: 20
- Views: 9823
I don't understand what exactly isn't working. Are you sure it hangs in read_joy()? Why are you including stdlib.h? Why is wait_vblank() inside the if() block? This is a template for an algorithmic composition program, stdlib.h because I need rand(), I use joystick to feed/change/alter parameters t...
- Fri Feb 18, 2011 2:01 am
- Forum: NESdev
- Topic: CC65, NES, joystick
- Replies: 20
- Views: 9823
- Fri Feb 18, 2011 1:02 am
- Forum: NESdev
- Topic: CC65, NES, joystick
- Replies: 20
- Views: 9823
- Thu Feb 17, 2011 3:25 pm
- Forum: NESdev
- Topic: CC65, NES, joystick
- Replies: 20
- Views: 9823
DPCM you can ignore. (It should have been made optional in the link script.) But if the header don exits , then of course nothing will open it. Yes, I already ignored DPCM simply by commenting it out. But header, where it should be, I mean, if I simply comment out the joy_read(), everything works, ...
- Thu Feb 17, 2011 12:11 pm
- Forum: NESdev
- Topic: CC65, NES, joystick
- Replies: 20
- Views: 9823
Well, still problems, the program compiles with two warnings, below: ld65: Warning: nes-nrom.cfg(45): Segment `HEADER' does not exist ld65: Warning: nes-nrom.cfg(45): Segment `DPCM' does not exist It still produces ROM file but neither FCEU nor mednafen do open it. I used nes-nrom.cfg, removed the t...
- Thu Feb 17, 2011 9:48 am
- Forum: NESdev
- Topic: CC65, NES, joystick
- Replies: 20
- Views: 9823
Seems like knes.c wasn't compiled and archived into knes.lib for some reason, did you use the supplied makefile? Try deleting the .lib and all .o files and recompiling knes.lib once more. I actually removed whole knes directory, unzipped from the original, replaced the nes.lib from snapshot, compil...
- Thu Feb 17, 2011 8:41 am
- Forum: NESdev
- Topic: CC65, NES, joystick
- Replies: 20
- Views: 9823
Okay, let's move on: I sticked to snapshot version, got the nes.lib and recompiled, removed -l options, compiled without errors. Using same code example we've worked , I get this error: Unresolved external `_read_joy' referenced in: snd1.s(16) ld65: Error: 1 unresolved external(s) found - cannot cre...
- Thu Feb 17, 2011 7:51 am
- Forum: NESdev
- Topic: CC65, NES, joystick
- Replies: 20
- Views: 9823
Thanks, I knew about your knes library replacement, I was actually going to try it next. I had (and still have:) the current official version, I downloaded snapshot version and installed it (before that mv cc65 cc65.org, working on Linux), before snapshot I downloaded your knes and compiled it witho...
- Thu Feb 17, 2011 6:19 am
- Forum: NESdev
- Topic: CC65, NES, joystick
- Replies: 20
- Views: 9823
Yes, of course, sorry, I was too busy. I'm using C, not asm, compiling using cl65 (-t nes -o XXX.nes XXX.c). An example, which doesn't work, probably as the joystick driver is not installed or something: #include <nes.h> #include <joystick.h> int joy; void main() { POKE(0x4015,0xFF); while(1) { joy ...
- Thu Feb 17, 2011 3:07 am
- Forum: NESdev
- Topic: CC65, NES, joystick
- Replies: 20
- Views: 9823
CC65, NES, joystick
Hi,
Could anyone put an example code in CC65 how to get joystick to work in NES ? I haven't found good (or any) examples, all my attempts so far haven't worked.
Thanks for advance !
-jp
Could anyone put an example code in CC65 how to get joystick to work in NES ? I haven't found good (or any) examples, all my attempts so far haven't worked.
Thanks for advance !
-jp
- Wed Oct 13, 2010 1:39 am
- Forum: NESdev
- Topic: NESASM - TASM
- Replies: 22
- Views: 8706
- Tue Oct 12, 2010 12:24 pm
- Forum: NESdev
- Topic: NESASM - TASM
- Replies: 22
- Views: 8706
Exactly, it is simple, just doesn't work. You're (and probably me too) close, in DASM: processor 6502 org $8000 .... program org $FFFA .word 0 .word start ; reset .word 0 Nothing else should be needed (of course correct iNES-header), still doesn't work. I need to study this more, found one example a...
- Tue Oct 12, 2010 10:50 am
- Forum: NESdev
- Topic: NESASM - TASM
- Replies: 22
- Views: 8706
OK, getting closer, found a better NESASM manual, now I probably know better what's the problem with DASM: 1. iNES header (is it 16 bytes, so it can be solved by hex editor and copy /b). 2. Banking: how it is done in DASM. Moving those four lines Tokumaru mentioned to the end didn't worked as it nee...
- Tue Oct 12, 2010 10:14 am
- Forum: NESdev
- Topic: NESASM - TASM
- Replies: 22
- Views: 8706