Re: [cc65] Help!,does anyone know how to use NES joystick with cc65

From: Groepaz <groepaz1gmx.net>
Date: 2009-02-17 13:49:06
On Dienstag 17 Februar 2009, zhblue (newsclan) wrote:
> i tried to use NES joystick on cc65
> #include <conio.h>
> #include <stdio.h>
> #include <nes.h>
> #include <joystick.h>
> //.....
> void testjoy(){
>    char err=0;
>    const char * stdjoy="nes-stdjoy.joy";
>    err=joy_load_driver(stdjoy);
>    cprintf("%u",err);
> }
> int main (void)
> {
>    testjoy();
>    while(1){
>    };
> }
> ======error reported========
>
> D:\zhblue\cc65>ca65 -t nes hello.s
>
> D:\zhblue\cc65>ld65 -t nes hello.o nes.o nes.lib atmos.lib -o hello.nes
> Unresolved external `_close' referenced in:
>  joy_load.s(18)
> Unresolved external `_open' referenced in:
>  joy_load.s(16)
> Unresolved external `_read' referenced in:
>  joy_load.s(17)
> ld65.exe: Error: 3 unresolved external(s) found - cannot create output file
> ======================
> Does anyone can help me, or share some working codes on NES joystick in
> cc65 ----------------------------------------------------------------------

a) you shouldnt be linking to atmos.lib at all, this lib is for the oric, not 
for the nes.
b) you have to create a static module from the nes joystick driver and link 
that (look here: http://www.cc65.org/snapshot-doc/co65-4.html), you can not 
load it - because there is no external mass storage to load it from in the 
first place =P
c) i know for a fact that this nes joystickdriver works... i wrote it (*g*), 
used it in my contiki port, and also some other guy tested it on a real nes.

-- 

http://www.hitmen-console.org    http://magicdisk.untergrund.net
http://www.pokefinder.org        http://ftp.pokefinder.org

A chicken is an egg's way of making another egg. 
<Samuel Butler>

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Feb 17 13:49:19 2009

This archive was generated by hypermail 2.1.8 : 2009-02-17 13:49:21 CET