Search found 45 matches

by jp48
Fri Feb 18, 2011 7:20 am
Forum: NESdev
Topic: CC65, NES, joystick
Replies: 20
Views: 9823

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
by jp48
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...
by jp48
Fri Feb 18, 2011 2:01 am
Forum: NESdev
Topic: CC65, NES, joystick
Replies: 20
Views: 9823

OK, nes.h was already commented out, I added PPU.ctrl =NMI_ON and now VBLANK works correctly. Just the joystick. To check that it works, I copied the edited nes-nrom.cfg to knes/demo directory, cleaned *.o", demo.nes and compiled the demo game. All works, sound, joystick, etc. So, it seems that...
by jp48
Fri Feb 18, 2011 1:02 am
Forum: NESdev
Topic: CC65, NES, joystick
Replies: 20
Views: 9823

OK, let's continue: I added 'optional = yes' to DPCM line, copied both kernel.c and kernel.h, commented out #include <nes.h>, I need VBLANK so I use one from knes.h. No errors in compiling, still stucks to reading joystick ie. joy=read_joy(0); if(joy & JOY_UP) par1=40; If I comment out those two...
by jp48
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, ...
by jp48
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...
by jp48
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...
by jp48
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...
by jp48
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...
by jp48
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 ...
by jp48
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
by jp48
Wed Oct 13, 2010 1:39 am
Forum: NESdev
Topic: NESASM - TASM
Replies: 22
Views: 8706

Memblers and Tokumaru,

It was exactly that, 32KB ROM, code was longer than 16KB, just changed offset 4 of the header from 1 to 2, works now, perfectly !

A LOT of thanks of your patience and tips in solving this !!!


-jp
by jp48
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...
by jp48
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...
by jp48
Tue Oct 12, 2010 10:14 am
Forum: NESdev
Topic: NESASM - TASM
Replies: 22
Views: 8706

I've "copied" the iNES header from this tutorial: http://patater.com/gbaguy/day2n.htm It was a bit difficult, according the tutorial, to know what part was header, what code (without any prior knowledge of NESASM). I thought these lines were part of the header (which was weird in my mind t...