From 9a759615ae8fa9108796aea2eebd07375aae316b Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Fri, 17 Oct 2008 21:30:38 +0000 Subject: [PATCH] Cleaned up some DOS leftovers. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@282 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- Makefile.dep | 5 +-- const.h | 5 --- divers.c | 27 ---------------- divers.h | 5 --- global.h | 46 --------------------------- graph.c | 3 -- init.c | 90 ---------------------------------------------------- init.h | 3 -- main.c | 20 +++--------- moteur.c | 2 -- palette.c | 6 ---- shade.c | 9 ------ struct.h | 2 +- 13 files changed, 8 insertions(+), 215 deletions(-) diff --git a/Makefile.dep b/Makefile.dep index 2bc0e61f..826ab25e 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -6,7 +6,7 @@ init.o: init.c const.h struct.h global.h loadsave.h graph.h boutons.h \ graph.o: graph.c sdlscreen.h struct.h const.h graph.h divers.h moteur.h \ boutons.h pages.h global.h loadsave.h erreurs.h sdlscreen.o: sdlscreen.c global.h struct.h const.h loadsave.h sdlscreen.h \ - divers.h erreurs.h + divers.h erreurs.h graph.h divers.o: divers.c struct.h const.h sdlscreen.h global.h loadsave.h \ graph.h erreurs.h boutons.h moteur.h divers.h clavier.h special.o: special.c const.h struct.h global.h loadsave.h graph.h \ @@ -17,7 +17,7 @@ boutons.o: boutons.c const.h struct.h global.h loadsave.h divers.h \ palette.o: palette.c const.h struct.h global.h loadsave.h divers.h \ graph.h moteur.h readline.h boutons.h pages.h aide.h sdlscreen.h aide.o: aide.c const.h struct.h global.h loadsave.h divers.h graph.h \ - moteur.h tables_aide.h aide.h + moteur.h tables_aide.h aide.h sdlscreen.h operatio.o: operatio.c const.h struct.h global.h loadsave.h divers.h \ moteur.h graph.h operatio.h boutons.h pages.h erreurs.h pages.o: pages.c global.h struct.h const.h loadsave.h pages.h graph.h \ @@ -40,6 +40,7 @@ shade.o: shade.c global.h struct.h const.h loadsave.h graph.h moteur.h \ divers.h readline.h aide.h sdlscreen.h clavier.o: clavier.c global.h struct.h const.h loadsave.h io.o: io.c struct.h const.h io.h +version.o: version.c gfxcfg.o: gfxcfg.c SFont.h struct.h const.h clavier.h io.h hotkeys.h SFont.o: SFont.c SFont.h clavier.o: clavier.c global.h struct.h const.h loadsave.h diff --git a/const.h b/const.h index bf1af00c..02a1693c 100644 --- a/const.h +++ b/const.h @@ -62,7 +62,6 @@ #define TAILLE_PILE_OPERATIONS 16 // Nombre maximum d'éléments utilisés par les opérations #define TAILLE_MAXI_PATH 37 // Taille maximum affichable du répertoire courant dans les fenêtres du fileselect #define TAILLE_COMMENTAIRE 32 // Taille maxi des commentaires pour le PKM -#define TAILLE_NOM_CONSTRUCTEUR 24 // Taille maxi du nom de constructeur VESA dans la fenêtre de stats. #define NB_PAGES_UNDO_MAX 99 // Nombre maximal de pages d'undo #define FACTEUR_DE_ZOOM_PAR_DEFAUT 4 // Facteur de zoom initial #define TAILLE_CHEMIN_FICHIER 260 // Le nombre de caractères maxi pour un nom de fichier avec chemin complet @@ -132,10 +131,6 @@ enum CODES_D_ERREURS enum TYPES_DE_MODES_VIDEO { MODE_SDL - /*MODE_MCGA, - MODE_X, - MODE_VESA, // Attention! Si on change la numérotation, il faut - MODE_XVESA // que les 2 plus grandes valeurs soient ces 2 modes!*/ }; // Les différentes catégories de bouton: diff --git a/divers.c b/divers.c index 306d9c46..f6b60aa5 100644 --- a/divers.c +++ b/divers.c @@ -367,11 +367,6 @@ void Wait_VBL(void) } } -void Passer_en_mode_texte(byte Nb_lignes) -{ - SDL_Quit(); //Ceci sera appellé à chaque sortie de mode vidéo == sortie du programme. le Nb_Lignes serait à enlever, cela dit, SDL s'en occupe très bien tout seul. -} - void Pixel_dans_brosse (word X,word Y,byte Couleur) { *(Brosse+Y*Brosse_Largeur+X)=Couleur; @@ -382,22 +377,6 @@ byte Lit_pixel_dans_brosse (word X,word Y) return *(Brosse + Y * Brosse_Largeur + X); } -void Clavier_de_depart(void) -{ - //SDL_EnableUNICODE(SDL_ENABLE); - //SDL_EnableKeyRepeat(250, 32); // TODO à placer à un meilleur endroit -} - -void Clavier_americain(void) -{ - //SDL_EnableUNICODE(SDL_DISABLE); -} - -word Detection_souris(void) -{ - UNIMPLEMENTED - return 0; -} byte Lit_pixel_dans_ecran_courant (word X,word Y) { @@ -567,11 +546,6 @@ void Set_mouse_position(void) ); } -void Clip_mouse(void) -{ - UNIMPLEMENTED -} - void Remplacer_toutes_les_couleurs_dans_limites(byte * Table_de_remplacement) { int Ligne; @@ -845,7 +819,6 @@ word Get_key(void) SDL_Event event; Attendre_fin_de_click(); // On prend le controle de la boucle d'évènements, donc il ne faut pas qu'on rate la fin de click ! - Clavier_de_depart(); while(1) { SDL_WaitEvent(&event); diff --git a/divers.h b/divers.h index 0ab461f4..f5f68bbf 100644 --- a/divers.h +++ b/divers.h @@ -24,15 +24,10 @@ void Copier_image_dans_brosse(short Debut_X,short Debut_Y,short Brosse_Largeur,s void Permuter_dans_l_image_les_couleurs(byte Couleur_1,byte Couleur_2); void Remap_general_LOWLEVEL(byte * Table_conv,byte * Buffer,short Largeur,short Hauteur,short Largeur_buffer); void Scroll_picture(short Decalage_X,short Decalage_Y); -void Clavier_americain(void); -void Clavier_de_depart(void); byte Recuperer_nb_lignes(void); -void Passer_en_mode_texte(byte Nb_lignes); -word Detection_souris(void); void Set_mouse_video_mode_number(void); void Get_input(void); void Set_mouse_position(void); -void Clip_mouse(void); void Attendre_fin_de_click(void); void Sensibilite_souris(word X,word Y); void Set_color(byte Couleur, byte Rouge, byte Vert, byte Bleu); diff --git a/global.h b/global.h index 5f90cb00..39224fa1 100644 --- a/global.h +++ b/global.h @@ -92,19 +92,8 @@ struct S_Mode_video byte Etat; // 0:Cool 1:OK ; 2:Bof ; 3:Naze ; si on rajoute +128 => incompatible }; GLOBAL struct S_Mode_video Mode_video[MAX_MODES_VIDEO]; - GLOBAL int Nb_modes_video; // Nombre de modes réellement recensés dans Mode_video[] -GLOBAL struct -{ - byte Granularite; // Facteur de gestion de la granularité - byte Code_fenetres; // Utilisation des fenêtres: 0=AA 1=BB 2=AB 3=BA - byte * WinFuncPtr; - byte * Adresse_physique_LFB; // Si = 0 => Pas de LFB - dword Taille_LFB; // Taille de la mémoire LFB -} VESA_Mode_Infos[4]; - - // Palette par défaut @@ -235,10 +224,6 @@ GLOBAL short Principal_Decalage_Y; // D GLOBAL short Ancien_Principal_Decalage_X; GLOBAL short Ancien_Principal_Decalage_Y; -#ifdef __WATCOMC__ - GLOBAL char Principal_Drive_fichier[2]; -#endif - GLOBAL char Principal_Repertoire_fichier[1024]; // |_ Nom complet = GLOBAL char Principal_Nom_fichier[256]; // | Repertoire_fichier+"\"+Nom_fichier GLOBAL byte Principal_Format_fichier; // Format auquel il faut lire et écrire le fichier @@ -546,37 +531,6 @@ GLOBAL word INPUT_Nouveau_Mouse_Y; GLOBAL byte INPUT_Nouveau_Mouse_K; GLOBAL byte INPUT_Keyb_mode; -GLOBAL int MC_Indice; -GLOBAL int MC_DR; -GLOBAL int MC_DV; -GLOBAL int MC_DB; -GLOBAL int * MC_Table_differences; - - // Variables concernant l'OBJ VIDEO - - // Partie concernant le mode X: -GLOBAL dword MODE_X_Decalage_synchro; -GLOBAL word MODE_X_Largeur_de_ligne; -GLOBAL dword MODE_X_Valeur_initiale_de_esi; -GLOBAL dword MODE_X_Valeur_initiale_de_edi; - // Partie concernant le VESA: -GLOBAL byte Granularite; // Facteur de gestion de la granularité de la carte -GLOBAL byte VESA_Erreur; -GLOBAL byte * VESA_WinFuncPtr; // Handler software de changement de banque -GLOBAL word * VESA_Liste_des_modes; -GLOBAL dword VESA_Decalage_synchro; -GLOBAL word VESA_Largeur_ecran_en_dword; -GLOBAL byte VESA_Banque_en_cours; // Variable normalement locale à VIDEO.ASM -GLOBAL byte VESA_Derniere_banque_Fenetre_A_utilisee; -GLOBAL byte VESA_Derniere_banque_Fenetre_B_utilisee; -GLOBAL fonction_action VESA_Change_banque_lecture; -GLOBAL fonction_action VESA_Change_banque_ecriture; -GLOBAL fonction_action VESA_Change_banque_lect_ecr; -GLOBAL byte VESA_Version_Unite; -GLOBAL byte VESA_Version_Decimale; -GLOBAL char VESA_Constructeur[TAILLE_NOM_CONSTRUCTEUR+1]; -GLOBAL word VESA_Taille_memoire; - // Les différents sprites: GLOBAL byte BLOCK_MENU[HAUTEUR_MENU][LARGEUR_MENU]; diff --git a/graph.c b/graph.c index 52d0c48a..a7163557 100644 --- a/graph.c +++ b/graph.c @@ -992,9 +992,6 @@ int Conversion_argument_mode(const char *Argument) //--------------------- Initialisation d'un mode vidéo ----------------------- -void * Mode_X_Ptr; // Pointeur sur la table à utiliser pour le changement de - // mode vidéo X - void Initialiser_mode_video(int Largeur, int Hauteur, int Fullscreen) { int Sensibilite_X; diff --git a/init.c b/init.c index f53e6ac5..3d987d53 100644 --- a/init.c +++ b/init.c @@ -71,43 +71,11 @@ void Chercher_repertoire_du_programme(char * Chaine) #endif } - -word Drive_Touche[26]= -{ - 0x041E, - 0x0430, - 0x042E, - 0x0420, - 0x0412, - 0x0421, - 0x0422, - 0x0423, - 0x0417, - 0x0424, - 0x0425, - 0x0426, - 0x0432, - 0x0431, - 0x0418, - 0x0419, - 0x0410, - 0x0413, - 0x041F, - 0x0414, - 0x0416, - 0x042F, - 0x0411, - 0x042D, - 0x0415, - 0x042C -}; - // Ajouter un lecteur à la liste de lecteurs void Ajouter_lecteur(byte Numero, char Lettre, byte Type) { Drive[Nb_drives].Lettre=Lettre; Drive[Nb_drives].Type =Type; - Drive[Nb_drives].Touche=Drive_Touche[Numero]; Nb_drives++; } @@ -192,32 +160,6 @@ int ActiverLecteur(int NumeroLecteur) #endif } -// Fonction de décryptage - - #define DECRYPT_TAILLE_CLE 14 - byte Decrypt_compteur=0; - const char Decrypt_cle[DECRYPT_TAILLE_CLE]="Sunset Design"; - - byte Decrypt(byte Octet) - { - byte Temp; - - Temp=Octet ^ Decrypt_cle[Decrypt_compteur]; - if ((++Decrypt_compteur)>=(DECRYPT_TAILLE_CLE-1)) - Decrypt_compteur=0; - return Temp; - } - -// Décryptage d'une donnée - -void Decrypte(byte * Donnee,int Taille) -{ - int Indice; - - for (Indice=0;Indice