6 #include <vgakeyboard.h>
8 #include "../../driver.h"
9 #include "../common/args.h"
10 #include "../common/config.h"
11 #include "../common/unixdsp.h"
14 #include "svga-video.h"
15 #include "lnx-joystick.h"
16 #include "unix-netplay.h"
18 static int soundo=48000;
20 static int sfragsize=7,snfrags=8;
24 CFGSTRUCT DriverConfig[]={
29 NACA("joybmap",joyBMap),
38 "-vmode x Select video mode(all are 8 bpp).\n\
39 1 = 256x240 5 = 640x480(\"1 per 4\")\n\
40 2 = 256x256 6 = 256x224(with scanlines)\n\
41 3 = 256x256(with scanlines) 7 = 320x240\n\
42 4 = 640x480(with scanlines) 8 = 256x224\n\
43 -vsync x Wait for the screen's vertical retrace before updating the\n\
44 screen. Refer to the documentation for caveats.\n\
47 -joyx y Joystick mapped to virtual joystick x(1-4).\n\
48 0 = Disabled, reset configuration.\n\
49 Otherwise, y(1-inf) = joystick number.\n\
52 Otherwise, x = playback rate.\n\
53 -sfragsize x Set sound fragment size to 2^x samples.\n\
54 -snfrags x Set number of sound fragments to x.\n\
55 -f8bit x Force 8-bit sound.\n\
58 -connect s Connect to server 's' for TCP/IP network play.\n\
59 -server Be a host/server for TCP/IP network play.\n\
60 -netport x Use TCP/IP port x for network play.";
63 static int docheckie[2]={0,0};
64 ARGPSTRUCT DriverArgs[]={
65 {"-joy1",0,&joy[0],0},{"-joy2",0,&joy[1],0},
66 {"-joy3",0,&joy[2],0},{"-joy4",0,&joy[3],0},
67 {"-snfrags",0,&snfrags,0},{"-sfragsize",0,&sfragsize,0},
68 {"-vmode",0,&vmode,0},
69 {"-vsync",0,&doptions,0x8000|DO_VSYNC},
70 {"-sound",0,&soundo,0},
71 {"-f8bit",0,&f8bit,0},
72 {"-connect",&docheckie[0],&netplayhost,0x4001},
73 {"-server",&docheckie[1],0,0},
74 {"-netport",0,&Port,0},
78 void DoDriverArgs(void)
88 FCEUI_SetNetworkPlay(netplay);
91 if(!joy[x]) memset(joyBMap[x],0,4*sizeof(int));
102 if(InitUNIXDSPSound(&rate,f8bit?0:1,sfragsize,snfrags))
111 void WriteSound(int32 *Buffer, int Count, int NoWaiting)
113 WriteUNIXDSPSound(Buffer,Count,NoWaiting);
123 vga_setmousesupport(1);
124 mouse_setxrange(0,260);
125 mouse_setyrange(0,260);
135 void GetMouseData(uint32 *MouseData)
139 MouseData[0]=mouse_getx();
140 MouseData[1]=mouse_gety();
142 MouseData[2]=((z&MOUSE_LEFTBUTTON)?1:0)|((z&MOUSE_RIGHTBUTTON)?2:0);
145 #include "unix-basedir.h"
147 int InitKeyboard(void)
149 if(keyboard_init()==-1)
151 puts("Error initializing keyboard.");
154 keyboard_translatekeys(TRANSLATE_CURSORKEYS | TRANSLATE_DIAGONAL);
158 int UpdateKeyboard(void)
160 return(keyboard_update());
163 char *GetKeyboard(void)
165 return(keyboard_getstate());
168 void KillKeyboard(void)
173 int main(int argc, char *argv[])
175 puts("\nStarting FCE Ultra "VERSION_STRING"...\n");
177 return(CLImain(argc,argv));