123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- #include <i86.h>
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <conio.h>
- #include "eurodefs.h"
- #include "euro_fxd.h"
- #include "euro.equ"
- #include "euro_sym.h"
- #include "euro_def.h"
- #include "euro_var.h"
- #include "euro_grf.h"
- #include "euro_dsk.h"
- #include "euro_fix.h"
- #include "euro_sel.h"
- #include "euro_inf.h"
- #include "defines.h"
- //********************************************************************************************************************************
- char InitialiseUser( char user, char cntrl )
- {
- if ( EUROgameType == EURO_friendly )
- {
- UserList[user].control = cntrl;
- user++;
- }
- if ( EUROgameType == EURO_championship )
- {
- UserList[user].control = cntrl;
- user++;
- }
-
- if ( (EUROgameType == EURO_network_game || EUROgameType == EURO_wireplay )
- && user==0 )
- {
- UserList[user].control = cntrl;
- user = 1;
- }
- return(user);
- }
- //********************************************************************************************************************************
- char CalculateMaxPlayers()
- {
- char players = 0;
- for ( char p=0; p<16 ; p++ )
- {
- if (CtrlFlags[p] == Usable)
- players++;
- }
- return(players);
- }
- //********************************************************************************************************************************
- void SetupMouseLimits( int Xmin, int Xmax, int Ymin, int Ymax )
- {
- if ( MouseDriverInstalled != 0 )
- {
- union REGS rg;
- rg.x.ecx = Xmin;
- rg.x.edx = Xmax;
- rg.x.eax = 7;
- int386(0x33,&rg,&rg);
- rg.x.ecx = Ymin;
- rg.x.edx = Ymax;
- rg.x.eax = 8;
- int386(0x33,&rg,&rg);
- }
- }
- //********************************************************************************************************************************
- char SetupControlMethods()
- {
- for ( char m=0; m<16 ; m++ )
- {CtrlFlags[m] = Unusable;}
- char user = 0;
- // ***> Configure KEYBOARD 1
-
- CtrlFlags[EuroKeyboard1] = Usable;
- user = InitialiseUser( user, EuroKeyboard1 );
-
- if (EUROverbose)
- printf ("þ Keyboard 1 initialised.\n");
- // ***> Configure KEYBOARD 2
- CtrlFlags[EuroKeyboard2] = Usable;
- user = InitialiseUser( user, EuroKeyboard2 );
- if (EUROverbose)
- printf ("þ Keyboard 2 initialised.\n");
- // ***> Configure JOYSTICK 1
-
- // CtrlFlags[EuroJoystick1] = Usable;
- // user = InitialiseUser( user, EuroJoystick1 );
- //
- // if (EUROverbose)
- // printf ("þ Joystick 1 initialised.\n");
- //
- // ***> Configure JOYSTICK 2
- // ***> Configure MOUSE
-
- union REGS rg;
- rg.x.eax = 0;
- int386(0x33,&rg,&rg);
- if ( (MouseDriverInstalled = rg.h.al) != 0 )
- {
- CtrlFlags[EuroMouse] = Usable;
- SetupMouseLimits( 0, 626, 1, 452 );
- user = InitialiseUser( user, EuroMouse);
- }
- if ( MouseDriverInstalled == 0 )
- {
- if (EUROverbose)
- printf ("þ Mouse Driver not found.\n");
- }
- else
- {
- if (EUROverbose)
- printf ("þ Mouse Driver found and initialised.\n");
- }
- // ***> Configure LOGITECH PAD
- return ( CalculateMaxPlayers() );
- }
- //********************************************************************************************************************************
- float WhichButton(short button, float var )
- {
- if ( button == LEFT_BUTTON )
- return(-var);
- else
- return(var);
- }
- //********************************************************************************************************************************
- void GetConsoleInput()
- {
- if ( MouseDriverInstalled != 0 )
- {
- short buttons;
- union REGS inregs, outregs;
- inregs.w.ax = 3;
- int386(0x33, &inregs, &outregs);
- SelectorXcoord = outregs.w.cx;
- SelectorYcoord = outregs.w.dx;
- buttons = outregs.w.bx;
-
- if ( DeBounce == 0 )
- ButtonState = buttons;
- else
- {
- ButtonState = 0;
- if ( buttons == 0 )
- DeBounce = 0;
- }
- }
- }
- //********************************************************************************************************************************
|