First upload of the code.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
1af8c74f53
commit
306a004e36
160
boutons.h
Normal file
160
boutons.h
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
void Message_Non_disponible(void);
|
||||||
|
void Message_Memoire_insuffisante(void);
|
||||||
|
void Bouton_Message_initial(void);
|
||||||
|
|
||||||
|
void Changer_la_forme_du_pinceau(byte Numero);
|
||||||
|
|
||||||
|
// Boutons relatifs aux couleurs
|
||||||
|
void Bouton_Pal_left(void);
|
||||||
|
void Bouton_Pal_left_fast(void);
|
||||||
|
void Bouton_Pal_right(void);
|
||||||
|
void Bouton_Pal_right_fast(void);
|
||||||
|
void Bouton_Choix_forecolor(void);
|
||||||
|
void Bouton_Choix_backcolor(void);
|
||||||
|
|
||||||
|
// Boutons relatifs au pinceaux
|
||||||
|
void Bouton_Brosse_monochrome(void);
|
||||||
|
void Bouton_Menu_pinceaux(void);
|
||||||
|
|
||||||
|
// Boutons relatifs au mode de dessin … main lev‚e
|
||||||
|
void Bouton_Dessin(void);
|
||||||
|
void Bouton_Dessin_Switch_mode(void);
|
||||||
|
|
||||||
|
// Dessin par ligne
|
||||||
|
void Bouton_Lignes(void);
|
||||||
|
void Bouton_Lignes_Switch_mode(void);
|
||||||
|
|
||||||
|
// Bouton relatif au remplissage
|
||||||
|
void Bouton_Fill(void);
|
||||||
|
void Bouton_Remplacer(void);
|
||||||
|
void Bouton_desenclencher_Fill(void);
|
||||||
|
|
||||||
|
// Spray
|
||||||
|
void Bouton_Spray(void);
|
||||||
|
void Bouton_Spray_Menu(void);
|
||||||
|
|
||||||
|
// Courbes de B‚zier
|
||||||
|
void Bouton_Courbes(void);
|
||||||
|
void Bouton_Courbes_Switch_mode(void);
|
||||||
|
|
||||||
|
// Boutons relatifs aux rectangles pleins et vides
|
||||||
|
void Bouton_Rectangle_vide(void);
|
||||||
|
void Bouton_Rectangle_plein(void);
|
||||||
|
|
||||||
|
// Boutons relatifs aux d‚grad‚s
|
||||||
|
void Bouton_Degrades(void);
|
||||||
|
void Degrade_Charger_infos_du_tableau(int Indice);
|
||||||
|
// Boutons relatifs aux cercles (ellipses) d‚grad‚(e)s
|
||||||
|
void Bouton_Cercle_degrade(void);
|
||||||
|
void Bouton_Ellipse_degrade(void);
|
||||||
|
|
||||||
|
// Boutons relatifs aux cercles (ellipses) plein(e)s et vides
|
||||||
|
void Bouton_Cercle_vide(void);
|
||||||
|
void Bouton_Ellipse_vide(void);
|
||||||
|
void Bouton_Cercle_plein(void);
|
||||||
|
void Bouton_Ellipse_pleine(void);
|
||||||
|
|
||||||
|
// Boutons relatifs aux polygones vides et pleins
|
||||||
|
void Bouton_Polygone(void);
|
||||||
|
void Bouton_Polyform(void);
|
||||||
|
void Bouton_Polyfill(void);
|
||||||
|
void Bouton_Filled_polyform(void);
|
||||||
|
|
||||||
|
// Boutons d'ajustement de l'image
|
||||||
|
void Bouton_Ajuster(void);
|
||||||
|
|
||||||
|
// Gestion du mode Shade
|
||||||
|
void Bouton_Shade_Mode(void);
|
||||||
|
void Bouton_Quick_shade_Mode(void);
|
||||||
|
void Bouton_Shade_Menu(void);
|
||||||
|
// Gestion du Stencil
|
||||||
|
void Bouton_Stencil_Mode(void);
|
||||||
|
void Bouton_Menu_Stencil(void);
|
||||||
|
// Gestion du Masque
|
||||||
|
void Bouton_Mask_Mode(void);
|
||||||
|
void Bouton_Mask_Menu(void);
|
||||||
|
// Mode grille (Snap)
|
||||||
|
void Bouton_Snap_Mode(void);
|
||||||
|
void Bouton_Menu_Grille(void);
|
||||||
|
// Mode trame (Sieve)
|
||||||
|
void Copier_trame_predefinie(byte Indice);
|
||||||
|
void Inverser_trame(void);
|
||||||
|
void Bouton_Trame_Mode(void);
|
||||||
|
void Bouton_Trame_Menu(void);
|
||||||
|
// Mode Smooth
|
||||||
|
void Bouton_Smooth_Mode(void);
|
||||||
|
void Bouton_Smooth_Mode(void);
|
||||||
|
// Boutons relatifs au mode Colorize
|
||||||
|
void Calculer_les_tables_de_Colorize(void);
|
||||||
|
void Bouton_Colorize_Mode(void);
|
||||||
|
void Bouton_Colorize_Menu(void);
|
||||||
|
// Boutons relatifs au mode Tiling
|
||||||
|
void Bouton_Tiling_Mode(void);
|
||||||
|
void Bouton_Tiling_Menu(void);
|
||||||
|
// Menu des effets
|
||||||
|
void Bouton_Effets(void);
|
||||||
|
|
||||||
|
// Prise de brosse
|
||||||
|
void Bouton_Brosse(void);
|
||||||
|
void Bouton_Restaurer_brosse(void);
|
||||||
|
void Bouton_desenclencher_Brosse(void);
|
||||||
|
// Prise de brosse au lasso
|
||||||
|
void Bouton_Lasso(void);
|
||||||
|
void Bouton_desenclencher_Lasso(void);
|
||||||
|
|
||||||
|
// Bouton relatifs … la pipette
|
||||||
|
void Bouton_Pipette(void);
|
||||||
|
void Bouton_desenclencher_Pipette(void);
|
||||||
|
void Bouton_Inverser_foreback(void);
|
||||||
|
|
||||||
|
// Mode loupe
|
||||||
|
void Bouton_Loupe(void);
|
||||||
|
void Bouton_Menu_Loupe(void);
|
||||||
|
void Bouton_desenclencher_Loupe(void);
|
||||||
|
|
||||||
|
// Les diff‚rents effets sur la brosse
|
||||||
|
void Bouton_Brush_FX(void);
|
||||||
|
|
||||||
|
// Boutons relatifs aux diff‚rentes pages
|
||||||
|
void Bouton_Page(void);
|
||||||
|
void Bouton_Copy_page(void);
|
||||||
|
void Copier_image_seule(void);
|
||||||
|
void Bouton_Kill(void);
|
||||||
|
|
||||||
|
// Boutons relatifs aux changements de r‚solution et de taille d'image
|
||||||
|
void Bouton_Resol(void);
|
||||||
|
void Bouton_Safety_resol(void);
|
||||||
|
|
||||||
|
// Boutons relatifs aux chargements et sauvegardes
|
||||||
|
void Bouton_Load(void);
|
||||||
|
void Bouton_Reload(void);
|
||||||
|
void Bouton_Save(void);
|
||||||
|
void Bouton_Autosave(void);
|
||||||
|
|
||||||
|
// R‚glage des paramŠtres de l'utilisateur
|
||||||
|
void Bouton_Settings(void);
|
||||||
|
|
||||||
|
// Annulation de la derniŠre modification
|
||||||
|
void Bouton_Undo(void);
|
||||||
|
void Bouton_Redo(void);
|
||||||
|
|
||||||
|
// Boutons relatifs aux effacements d'images
|
||||||
|
void Bouton_Clear(void);
|
||||||
|
void Bouton_Clear_colore(void);
|
||||||
|
|
||||||
|
// Quitter le programme
|
||||||
|
void Bouton_Quit(void);
|
||||||
|
|
||||||
|
// Cacher le menu
|
||||||
|
void Bouton_Cacher_menu(void);
|
||||||
|
|
||||||
|
void Stencil_Tagger_couleur(byte Couleur, byte Couleur_de_taggage);
|
||||||
|
|
||||||
|
void Load_picture(byte Image);
|
||||||
|
void Save_picture(byte Image);
|
||||||
|
|
||||||
|
void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * Mode, byte Cancel);
|
||||||
|
|
||||||
|
void Bouton_Smooth_Menu(void);
|
||||||
|
|
||||||
|
void Bouton_Smear_Mode(void);
|
||||||
BIN
cfg/ASCKEY.EXE
Normal file
BIN
cfg/ASCKEY.EXE
Normal file
Binary file not shown.
11
cfg/ASCKEY.PAS
Normal file
11
cfg/ASCKEY.PAS
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
var touche:byte;
|
||||||
|
begin
|
||||||
|
repeat
|
||||||
|
asm
|
||||||
|
mov ah,8
|
||||||
|
int 21h
|
||||||
|
mov touche,al
|
||||||
|
end;
|
||||||
|
write(touche,' ');
|
||||||
|
until touche=27
|
||||||
|
end.
|
||||||
BIN
cfg/KEYS.EXE
Normal file
BIN
cfg/KEYS.EXE
Normal file
Binary file not shown.
62
cfg/KEYS.PAS
Normal file
62
cfg/KEYS.PAS
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
var
|
||||||
|
Touche:word;
|
||||||
|
|
||||||
|
procedure Get_Key; assembler;
|
||||||
|
asm
|
||||||
|
|
||||||
|
mov Touche,0
|
||||||
|
|
||||||
|
|
||||||
|
mov ah,11h
|
||||||
|
int 16h
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jz @Get_input_Pas_de_touche
|
||||||
|
|
||||||
|
|
||||||
|
mov ah,10h
|
||||||
|
int 16h
|
||||||
|
|
||||||
|
|
||||||
|
mov byte ptr[Touche],ah
|
||||||
|
|
||||||
|
|
||||||
|
mov ah,02h
|
||||||
|
int 16h
|
||||||
|
|
||||||
|
|
||||||
|
and al,00001111b
|
||||||
|
|
||||||
|
|
||||||
|
mov ah,al
|
||||||
|
and ah,00000001b
|
||||||
|
shr al,1
|
||||||
|
or al,ah
|
||||||
|
|
||||||
|
|
||||||
|
mov byte ptr[Touche+1],al
|
||||||
|
|
||||||
|
@Get_input_Pas_de_touche:
|
||||||
|
end;
|
||||||
|
|
||||||
|
const HEXA_ORDER:string='0123456789ABCDEF';
|
||||||
|
function Byte2Hexa(Valeur:byte):string;
|
||||||
|
var Temp:string;
|
||||||
|
begin
|
||||||
|
Temp:='';
|
||||||
|
while length(Temp)<2 do
|
||||||
|
begin
|
||||||
|
Temp:=HEXA_ORDER[(Valeur mod 16)+1]+Temp;
|
||||||
|
Valeur:=Valeur div 16;
|
||||||
|
end;
|
||||||
|
Byte2Hexa:=Temp;
|
||||||
|
end;
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
repeat
|
||||||
|
Get_Key;
|
||||||
|
if (Touche<>0)
|
||||||
|
then write('(',hi(Touche),',',Byte2Hexa(lo(Touche)),') ');
|
||||||
|
until Touche=$0001;
|
||||||
|
END.
|
||||||
1040
cfg/SCANCODE.PAS
Normal file
1040
cfg/SCANCODE.PAS
Normal file
File diff suppressed because it is too large
Load Diff
72
cfg/VIDEOMOD.PAS
Normal file
72
cfg/VIDEOMOD.PAS
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
const
|
||||||
|
MODE_MCGA =$00;
|
||||||
|
MODE_X =$40;
|
||||||
|
MODE_VESA =$80;
|
||||||
|
MODE_XVESA=$C0;
|
||||||
|
|
||||||
|
Table_modes_video:array[1..NB_MODES_VIDEO,1..3] of word=
|
||||||
|
(
|
||||||
|
(MODE_MCGA ,320,200),
|
||||||
|
(MODE_X+1 ,320,224),
|
||||||
|
(MODE_X+1 ,320,240),
|
||||||
|
(MODE_X+1 ,320,256),
|
||||||
|
(MODE_X+1 ,320,270),
|
||||||
|
(MODE_X+1 ,320,282),
|
||||||
|
(MODE_X+1 ,320,300),
|
||||||
|
(MODE_X+1 ,320,360),
|
||||||
|
(MODE_X+1 ,320,400),
|
||||||
|
(MODE_X+1 ,320,448),
|
||||||
|
(MODE_X+1 ,320,480),
|
||||||
|
(MODE_X+1 ,320,512),
|
||||||
|
(MODE_X+1 ,320,540),
|
||||||
|
(MODE_X+1 ,320,564),
|
||||||
|
(MODE_X+1 ,320,600),
|
||||||
|
|
||||||
|
(MODE_X+1 ,360,200),
|
||||||
|
(MODE_X+1 ,360,224),
|
||||||
|
(MODE_X+1 ,360,240),
|
||||||
|
(MODE_X+1 ,360,256),
|
||||||
|
(MODE_X+1 ,360,270),
|
||||||
|
(MODE_X+1 ,360,282),
|
||||||
|
(MODE_X+1 ,360,300),
|
||||||
|
(MODE_X+1 ,360,360),
|
||||||
|
(MODE_X+1 ,360,400),
|
||||||
|
(MODE_X+1 ,360,448),
|
||||||
|
(MODE_X+1 ,360,480),
|
||||||
|
(MODE_X+1 ,360,512),
|
||||||
|
(MODE_X+1 ,360,540),
|
||||||
|
(MODE_X+1 ,360,564),
|
||||||
|
(MODE_X+1 ,360,600),
|
||||||
|
|
||||||
|
(MODE_X+1 ,400,200),
|
||||||
|
(MODE_X+1 ,400,224),
|
||||||
|
(MODE_X+1 ,400,240),
|
||||||
|
(MODE_X+1 ,400,256),
|
||||||
|
(MODE_X+1 ,400,270),
|
||||||
|
(MODE_X+1 ,400,282),
|
||||||
|
(MODE_X+1 ,400,300),
|
||||||
|
(MODE_X+1 ,400,360),
|
||||||
|
(MODE_X+1 ,400,400),
|
||||||
|
(MODE_X+1 ,400,448),
|
||||||
|
(MODE_X+1 ,400,480),
|
||||||
|
(MODE_X+1 ,400,512),
|
||||||
|
(MODE_X+1 ,400,540),
|
||||||
|
(MODE_X+1 ,400,564),
|
||||||
|
(MODE_X+1 ,400,600),
|
||||||
|
|
||||||
|
(MODE_XVESA+1 ,640,224),
|
||||||
|
(MODE_XVESA+1 ,640,240),
|
||||||
|
(MODE_XVESA+1 ,640,256),
|
||||||
|
(MODE_XVESA+1 ,640,270),
|
||||||
|
(MODE_XVESA+1 ,640,300),
|
||||||
|
(MODE_XVESA+1 ,640,350),
|
||||||
|
(MODE_VESA+1 ,640,400),
|
||||||
|
(MODE_XVESA+1 ,640,448),
|
||||||
|
(MODE_VESA+1 ,640,480),
|
||||||
|
(MODE_XVESA+1 ,640,512),
|
||||||
|
(MODE_XVESA+1 ,640,540),
|
||||||
|
(MODE_XVESA+1 ,640,564),
|
||||||
|
(MODE_XVESA+1 ,640,600),
|
||||||
|
(MODE_VESA+1 ,800,600),
|
||||||
|
(MODE_VESA+1 ,1024,768)
|
||||||
|
);
|
||||||
1772
cfg/gfxcfg.pas
Normal file
1772
cfg/gfxcfg.pas
Normal file
File diff suppressed because it is too large
Load Diff
449
const.h
Normal file
449
const.h
Normal file
@ -0,0 +1,449 @@
|
|||||||
|
#ifndef _CONST_H_
|
||||||
|
#define _CONST_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// D‚claration des constantes ////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#define M_PI 3.14159265358979323846264338328
|
||||||
|
#define M_2PI 6.28318530717958647692528676656
|
||||||
|
|
||||||
|
// Note: La taille du fichier GFX2.DAT est d‚finie au d‚but de INIT.C !
|
||||||
|
#define POURCENTAGE_VERSION "96.5%" // Libell‚ du pourcentage de la version á
|
||||||
|
#define VERSION1 2 // |
|
||||||
|
#define VERSION2 0 // |_ Num‚ro de version d‚coup‚ en
|
||||||
|
#define BETA1 96 // | plusieurs parties => 2.0 á95.5%
|
||||||
|
#define BETA2 5 // |
|
||||||
|
#define ALPHA_BETA "á" // Type de la version "à" ou "á"
|
||||||
|
#define TAILLE_FICHIER_CONFIG 10351 // Taille du fichier GFX2.CFG
|
||||||
|
#define NB_MODES_VIDEO 60 // Nombre de modes vid‚o
|
||||||
|
#define NB_BOUTONS 38 // Nombre de boutons … g‚rer
|
||||||
|
#define NB_TOUCHES 134 // Nombre de combinaisons de touches
|
||||||
|
#define NB_TOUCHES_SPECIALES 72 // Nombre de touches sp‚ciales
|
||||||
|
#define NB_OPERATIONS 32 // Nombre d'op‚rations g‚r‚es par le moteur
|
||||||
|
#define NB_FACTEURS_DE_ZOOM 12 // Nombre de facteurs de zoom
|
||||||
|
#define LARGEUR_MENU 254 // Largeur du menu en taille r‚elle
|
||||||
|
#define HAUTEUR_MENU 44 // Hauteur du menu en taille r‚elle
|
||||||
|
#define NB_SPRITES_CURSEUR 8 // Nombre de sprites de curseur
|
||||||
|
#define LARGEUR_SPRITE_CURSEUR 15 // Largeur d'un sprite de curseur en pixels
|
||||||
|
#define HAUTEUR_SPRITE_CURSEUR 15 // Hauteur d'un sprite de curseur en pixels
|
||||||
|
#define NB_SPRITES_EFFETS 9 // Nombre de sprites d'effets
|
||||||
|
#define NB_SPRITES_MENU 9 // Nombre de sprites de menu
|
||||||
|
#define LARGEUR_SPRITE_MENU 14 // Largeur d'un sprite de menu en pixels
|
||||||
|
#define HAUTEUR_SPRITE_MENU 14 // Hauteur d'un sprite de menu en pixels
|
||||||
|
#define LARGEUR_PINCEAU 16 // Largeur d'un sprite de pinceau pr‚d‚fini
|
||||||
|
#define HAUTEUR_PINCEAU 16 // Hauteur d'un sprite de pinceau pr‚d‚fini
|
||||||
|
#define TAILLE_MAXI_PINCEAU 127 // Taille maxi des pinceaux
|
||||||
|
#define NB_SPRITES_DRIVES 5 // Nombre de sprites de drives
|
||||||
|
#define LARGEUR_SPRITE_DRIVE 7 // Largeur d'un sprite de drive en pixels
|
||||||
|
#define HAUTEUR_SPRITE_DRIVE 7 // Hauteur d'un sprite de drive en pixels
|
||||||
|
#define NB_SPRITES_PINCEAU 48 // Nombre de sprites de pinceau
|
||||||
|
#define NB_TRAMES_PREDEFINIES 12 // Nombre de trames pr‚d‚finies
|
||||||
|
#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 NB_SECTIONS_AIDE 3 // Nombre de sections dans l'aide
|
||||||
|
|
||||||
|
// On impose … l'allocation dynamique des pages de backups de conserver un
|
||||||
|
// minimum de 256 Ko pour que le reste du programme puisse continuer …
|
||||||
|
// fonctionner.
|
||||||
|
#define QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER (256*1024)
|
||||||
|
|
||||||
|
#define A_GAUCHE 1 // Indique une direction (ou click) … gauche
|
||||||
|
#define A_DROITE 2 // Indique une direction (ou click) … droite
|
||||||
|
|
||||||
|
#define LARGEUR_BARRE_SPLIT 6 // [ Û±±° ]
|
||||||
|
#define PROPORTION_SPLIT 0.3 // proportion de la zone non-zoom‚e en largeur par rapport … l'‚cran
|
||||||
|
#define NB_PIXELS_ZOOMES_MIN 4 // Nombre minimal de pixels zoom‚s en largeur (Note: En dessous de 4, on ne peut plus scroller!)
|
||||||
|
|
||||||
|
// Les diff‚rents formats de fichiers:
|
||||||
|
|
||||||
|
#define NB_FORMATS_CONNUS 12 // Nombre de formats connus (devrait ˆtre la valeur maximale de NB_FORMATS_LOAD et NB_FORMATS_SAVE, mais plus g‚n‚ralement: Card({NB_FORMATS_LOAD} UNION {NB_FORMATS_SAVE}))
|
||||||
|
#define NB_FORMATS_LOAD 12 // Nombre de formats que l'on sait charger
|
||||||
|
#define NB_FORMATS_SAVE 12 // Nombre de formats que l'on sait sauver
|
||||||
|
|
||||||
|
enum FORMATS_RECONNUS
|
||||||
|
{
|
||||||
|
FORMAT_PKM=1, // |
|
||||||
|
FORMAT_LBM, // |
|
||||||
|
FORMAT_GIF, // | Il faudra penser … r‚ordonner
|
||||||
|
FORMAT_BMP, // | les donn‚es sur les formats dans
|
||||||
|
FORMAT_PCX, // | GLOBAL.H si on modifie ces cons-
|
||||||
|
FORMAT_IMG, // |_ tantes.
|
||||||
|
FORMAT_SCx, // |
|
||||||
|
FORMAT_PI1, // | Elles repr‚sentent l'indice o—
|
||||||
|
FORMAT_PC1, // | l'on doit aller piocher ces
|
||||||
|
FORMAT_CEL, // | donn‚es.
|
||||||
|
FORMAT_KCF, // |
|
||||||
|
FORMAT_PAL // |
|
||||||
|
};
|
||||||
|
|
||||||
|
#define FORMAT_PAR_DEFAUT FORMAT_PKM // Format par d‚faut (ah bon? oh!)
|
||||||
|
|
||||||
|
// Les diff‚rentes erreurs:
|
||||||
|
|
||||||
|
enum CODES_D_ERREURS
|
||||||
|
{
|
||||||
|
ERREUR_DAT_ABSENT=1, // Le fichier GFX2.DAT est absent
|
||||||
|
ERREUR_DAT_CORROMPU, // Mauvais fichier GFX2.DAT
|
||||||
|
ERREUR_CFG_ABSENT, // Le fichier GFX2.CFG est absent
|
||||||
|
ERREUR_CFG_CORROMPU, // Mauvais fichier GFX2.CFG
|
||||||
|
ERREUR_CFG_ANCIEN, // Ancienne version du fichier GFX2.CFG
|
||||||
|
ERREUR_MEMOIRE, // Plus de m‚moire
|
||||||
|
ERREUR_LIGNE_COMMANDE, // Erreur sur la ligne de commande
|
||||||
|
ERREUR_DRIVER_SOURIS, // Pas de driver souris install‚
|
||||||
|
ERREUR_MODE_VESA_INVALIDE, // Mode VESA demand‚ sur la ligne de commande invalide
|
||||||
|
ERREUR_MODE_INTERDIT, // Mode demand‚ sur la ligne de commande interdit (coch‚ en noir)
|
||||||
|
ERREUR_NUMERO_MODE, // Erreur de choix de mode sur la ligne de commande
|
||||||
|
ERREUR_SAUVEGARDE_CFG, // Erreur en ‚criture pour GFX2.CFG
|
||||||
|
ERREUR_REPERTOIRE_DISPARU, // Le r‚pertoire de lancement n'existe plus
|
||||||
|
ERREUR_INI_ABSENT, // Le fichier GFX2.INI est absent
|
||||||
|
ERREUR_INI_CORROMPU, // Le fichier GFX2.INI est corrompu
|
||||||
|
ERREUR_SAUVEGARDE_INI, // Le fichier GFX2.INI n'est pas inscriptible
|
||||||
|
ERREUR_SORRY_SORRY_SORRY // On le refera plus, promis
|
||||||
|
};
|
||||||
|
|
||||||
|
// Les diff‚rents types de modes vid‚os
|
||||||
|
|
||||||
|
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‚rents modes vid‚os (avec leur nø d'ordre)
|
||||||
|
|
||||||
|
enum MODES_VIDEO
|
||||||
|
{
|
||||||
|
MODE_320_200, // !!! MODE 0 !!!
|
||||||
|
MODE_320_224,
|
||||||
|
MODE_320_240,
|
||||||
|
MODE_320_256,
|
||||||
|
MODE_320_270,
|
||||||
|
MODE_320_282,
|
||||||
|
MODE_320_300,
|
||||||
|
MODE_320_360,
|
||||||
|
MODE_320_400,
|
||||||
|
MODE_320_448,
|
||||||
|
MODE_320_480,
|
||||||
|
MODE_320_512,
|
||||||
|
MODE_320_540,
|
||||||
|
MODE_320_564,
|
||||||
|
MODE_320_600,
|
||||||
|
MODE_360_200, // 15
|
||||||
|
MODE_360_224,
|
||||||
|
MODE_360_240,
|
||||||
|
MODE_360_256,
|
||||||
|
MODE_360_270,
|
||||||
|
MODE_360_282,
|
||||||
|
MODE_360_300,
|
||||||
|
MODE_360_360,
|
||||||
|
MODE_360_400,
|
||||||
|
MODE_360_448,
|
||||||
|
MODE_360_480,
|
||||||
|
MODE_360_512,
|
||||||
|
MODE_360_540,
|
||||||
|
MODE_360_564,
|
||||||
|
MODE_360_600,
|
||||||
|
MODE_400_200, // 30
|
||||||
|
MODE_400_224,
|
||||||
|
MODE_400_240,
|
||||||
|
MODE_400_256,
|
||||||
|
MODE_400_270,
|
||||||
|
MODE_400_282,
|
||||||
|
MODE_400_300,
|
||||||
|
MODE_400_360,
|
||||||
|
MODE_400_400,
|
||||||
|
MODE_400_448,
|
||||||
|
MODE_400_480,
|
||||||
|
MODE_400_512,
|
||||||
|
MODE_400_540,
|
||||||
|
MODE_400_564,
|
||||||
|
MODE_400_600,
|
||||||
|
MODE_640_224, // 45
|
||||||
|
MODE_640_240,
|
||||||
|
MODE_640_256,
|
||||||
|
MODE_640_270,
|
||||||
|
MODE_640_300,
|
||||||
|
MODE_640_350,
|
||||||
|
MODE_640_400,
|
||||||
|
MODE_640_448,
|
||||||
|
MODE_640_480,
|
||||||
|
MODE_640_512,
|
||||||
|
MODE_640_540,
|
||||||
|
MODE_640_564,
|
||||||
|
MODE_640_600,
|
||||||
|
MODE_800_600,
|
||||||
|
MODE_1024_768 // 59
|
||||||
|
};
|
||||||
|
|
||||||
|
// Les diff‚rentes cat‚gories de bouton:
|
||||||
|
|
||||||
|
enum FAMILLES_DE_BOUTONS
|
||||||
|
{
|
||||||
|
FAMILLE_OUTIL=1, // Outils de dessin
|
||||||
|
FAMILLE_INTERRUPTION, // Op‚ration ‚ph‚mŠre
|
||||||
|
FAMILLE_INSTANTANE, // Pif paf
|
||||||
|
FAMILLE_TOOLBAR, // Cache/Montre la barre d'outils
|
||||||
|
FAMILLE_EFFETS // Effets
|
||||||
|
};
|
||||||
|
|
||||||
|
// Les diff‚rentes formes de bouton:
|
||||||
|
|
||||||
|
enum FORMES_DE_BOUTONS
|
||||||
|
{
|
||||||
|
FORME_BOUTON_SANS_CADRE, // Ex: la palette
|
||||||
|
FORME_BOUTON_RECTANGLE, // Ex: la plupart
|
||||||
|
FORME_BOUTON_TRIANGLE_HAUT_GAUCHE, // Ex: Rectangles vides
|
||||||
|
FORME_BOUTON_TRIANGLE_BAS_DROITE // Ex: Rectangles pleins
|
||||||
|
};
|
||||||
|
|
||||||
|
// Les diff‚rentes formes de curseur:
|
||||||
|
|
||||||
|
enum FORMES_DE_CURSEUR
|
||||||
|
{
|
||||||
|
FORME_CURSEUR_FLECHE,
|
||||||
|
FORME_CURSEUR_CIBLE, // Utilise le pinceau
|
||||||
|
FORME_CURSEUR_CIBLE_PIPETTE, // Utilise le pinceau
|
||||||
|
FORME_CURSEUR_SABLIER,
|
||||||
|
FORME_CURSEUR_MULTIDIRECTIONNEL,
|
||||||
|
FORME_CURSEUR_HORIZONTAL,
|
||||||
|
FORME_CURSEUR_CIBLE_FINE, // Utilise le pinceau
|
||||||
|
FORME_CURSEUR_CIBLE_PIPETTE_FINE, // Utilise le pinceau
|
||||||
|
FORME_CURSEUR_CIBLE_XOR,
|
||||||
|
FORME_CURSEUR_RECTANGLE_XOR,
|
||||||
|
FORME_CURSEUR_ROTATE_XOR
|
||||||
|
};
|
||||||
|
|
||||||
|
// Les diff‚rentes formes de pinceaux (les types de pinceaux doivent ˆtre au d‚but)
|
||||||
|
|
||||||
|
enum FORMES_DE_PINCEAUX
|
||||||
|
{
|
||||||
|
FORME_PINCEAU_ROND,
|
||||||
|
FORME_PINCEAU_CARRE,
|
||||||
|
FORME_PINCEAU_BARRE_HORIZONTALE,
|
||||||
|
FORME_PINCEAU_BARRE_VERTICALE,
|
||||||
|
FORME_PINCEAU_SLASH,
|
||||||
|
FORME_PINCEAU_ANTISLASH,
|
||||||
|
FORME_PINCEAU_ALEATOIRE,
|
||||||
|
FORME_PINCEAU_X,
|
||||||
|
FORME_PINCEAU_PLUS,
|
||||||
|
FORME_PINCEAU_LOSANGE,
|
||||||
|
FORME_PINCEAU_ROND_TRAME,
|
||||||
|
FORME_PINCEAU_CARRE_TRAME,
|
||||||
|
FORME_PINCEAU_DIVERS,// Ce doit ˆtre le dernier des types de pinceaux, comme ‡a il indique le nombre de types de pinceaux (-1)
|
||||||
|
FORME_PINCEAU_POINT, // Utilis‚ pour r‚duire de pinceau … 1 point dans certaines op‚rations
|
||||||
|
FORME_PINCEAU_BROSSE_COULEUR,
|
||||||
|
FORME_PINCEAU_BROSSE_MONOCHROME
|
||||||
|
};
|
||||||
|
|
||||||
|
// Les diff‚rents ‚tats de bouton:
|
||||||
|
|
||||||
|
#define BOUTON_RELACHE 0
|
||||||
|
#define BOUTON_ENFONCE 1
|
||||||
|
|
||||||
|
// Les diff‚rents modes de Shade
|
||||||
|
|
||||||
|
enum MODES_DE_SHADE
|
||||||
|
{
|
||||||
|
MODE_SHADE_NORMAL,
|
||||||
|
MODE_SHADE_BOUCLE,
|
||||||
|
MODE_SHADE_NOSAT
|
||||||
|
};
|
||||||
|
|
||||||
|
// Les diff‚rents chunks du fichier .CFG
|
||||||
|
|
||||||
|
enum CHUNKS_CFG
|
||||||
|
{
|
||||||
|
CHUNK_TOUCHES,
|
||||||
|
CHUNK_MODES_VIDEO,
|
||||||
|
CHUNK_SHADE,
|
||||||
|
CHUNK_MASQUE,
|
||||||
|
CHUNK_STENCIL,
|
||||||
|
CHUNK_DEGRADES,
|
||||||
|
CHUNK_SMOOTH,
|
||||||
|
CHUNK_EXCLUDE_COLORS,
|
||||||
|
CHUNK_QUICK_SHADE
|
||||||
|
};
|
||||||
|
|
||||||
|
// Les diff‚rents types de lecteurs:
|
||||||
|
|
||||||
|
enum TYPES_DE_LECTEURS
|
||||||
|
{
|
||||||
|
DRIVE_FLOPPY_3_5, // 0: Diskette 3"«
|
||||||
|
DRIVE_FLOPPY_5_25, // 1: Diskette 5"¬
|
||||||
|
DRIVE_HDD, // 2: HDD
|
||||||
|
DRIVE_CDROM, // 3: CD-ROM
|
||||||
|
DRIVE_NETWORK // 4: Logique (r‚seau?)
|
||||||
|
};
|
||||||
|
|
||||||
|
// Les diff‚rents boutons:
|
||||||
|
|
||||||
|
enum NUMEROS_DE_BOUTONS
|
||||||
|
{
|
||||||
|
BOUTON_PINCEAUX,
|
||||||
|
BOUTON_AJUSTER,
|
||||||
|
BOUTON_DESSIN,
|
||||||
|
BOUTON_COURBES,
|
||||||
|
BOUTON_LIGNES,
|
||||||
|
BOUTON_SPRAY,
|
||||||
|
BOUTON_FLOODFILL,
|
||||||
|
BOUTON_POLYGONES,
|
||||||
|
BOUTON_POLYFILL,
|
||||||
|
BOUTON_RECTANGLES,
|
||||||
|
BOUTON_FILLRECT,
|
||||||
|
BOUTON_CERCLES,
|
||||||
|
BOUTON_FILLCERC,
|
||||||
|
BOUTON_GRADRECT,
|
||||||
|
BOUTON_GRADMENU,
|
||||||
|
BOUTON_SPHERES,
|
||||||
|
BOUTON_BROSSE,
|
||||||
|
BOUTON_POLYBROSSE,
|
||||||
|
BOUTON_EFFETS_BROSSE,
|
||||||
|
BOUTON_EFFETS,
|
||||||
|
BOUTON_TEXTE,
|
||||||
|
BOUTON_LOUPE,
|
||||||
|
BOUTON_PIPETTE,
|
||||||
|
BOUTON_RESOL,
|
||||||
|
BOUTON_PAGE,
|
||||||
|
BOUTON_SAUVER,
|
||||||
|
BOUTON_CHARGER,
|
||||||
|
BOUTON_PARAMETRES,
|
||||||
|
BOUTON_CLEAR,
|
||||||
|
BOUTON_AIDE,
|
||||||
|
BOUTON_UNDO,
|
||||||
|
BOUTON_KILL,
|
||||||
|
BOUTON_QUIT,
|
||||||
|
BOUTON_PALETTE,
|
||||||
|
BOUTON_PAL_LEFT,
|
||||||
|
BOUTON_PAL_RIGHT,
|
||||||
|
BOUTON_CHOIX_COL,
|
||||||
|
BOUTON_CACHER
|
||||||
|
};
|
||||||
|
|
||||||
|
// Les actions des touches sp‚ciales
|
||||||
|
|
||||||
|
enum ACTIONS_SPECIALES
|
||||||
|
{
|
||||||
|
SPECIAL_MOUSE_UP, // |
|
||||||
|
SPECIAL_MOUSE_DOWN, // |
|
||||||
|
SPECIAL_MOUSE_LEFT, // |
|
||||||
|
SPECIAL_MOUSE_RIGHT, // |
|
||||||
|
SPECIAL_CLICK_LEFT, // | Il faut garder
|
||||||
|
SPECIAL_CLICK_RIGHT, // | ces constantes
|
||||||
|
SPECIAL_NEXT_FORECOLOR, // | au d‚but de la
|
||||||
|
SPECIAL_PREVIOUS_FORECOLOR, // |_ liste car elles
|
||||||
|
SPECIAL_NEXT_BACKCOLOR, // | sont r‚utilis‚es
|
||||||
|
SPECIAL_PREVIOUS_BACKCOLOR, // | avec leurs valeurs
|
||||||
|
SPECIAL_RETRECIR_PINCEAU, // | brutes en ASM dans
|
||||||
|
SPECIAL_GROSSIR_PINCEAU, // | Get_input !!!
|
||||||
|
SPECIAL_NEXT_USER_FORECOLOR, // |
|
||||||
|
SPECIAL_PREVIOUS_USER_FORECOLOR, // |
|
||||||
|
SPECIAL_NEXT_USER_BACKCOLOR, // |
|
||||||
|
SPECIAL_PREVIOUS_USER_BACKCOLOR, // |
|
||||||
|
SPECIAL_SCROLL_UP,
|
||||||
|
SPECIAL_SCROLL_DOWN,
|
||||||
|
SPECIAL_SCROLL_LEFT,
|
||||||
|
SPECIAL_SCROLL_RIGHT,
|
||||||
|
SPECIAL_SCROLL_UP_FAST,
|
||||||
|
SPECIAL_SCROLL_DOWN_FAST,
|
||||||
|
SPECIAL_SCROLL_LEFT_FAST,
|
||||||
|
SPECIAL_SCROLL_RIGHT_FAST,
|
||||||
|
SPECIAL_SCROLL_UP_SLOW,
|
||||||
|
SPECIAL_SCROLL_DOWN_SLOW,
|
||||||
|
SPECIAL_SCROLL_LEFT_SLOW,
|
||||||
|
SPECIAL_SCROLL_RIGHT_SLOW,
|
||||||
|
SPECIAL_SHOW_HIDE_CURSOR,
|
||||||
|
SPECIAL_PINCEAU_POINT,
|
||||||
|
SPECIAL_DESSIN_CONTINU,
|
||||||
|
SPECIAL_FLIP_X,
|
||||||
|
SPECIAL_FLIP_Y,
|
||||||
|
SPECIAL_ROTATE_90,
|
||||||
|
SPECIAL_ROTATE_180,
|
||||||
|
SPECIAL_STRETCH,
|
||||||
|
SPECIAL_DISTORT,
|
||||||
|
SPECIAL_OUTLINE,
|
||||||
|
SPECIAL_NIBBLE,
|
||||||
|
SPECIAL_GET_BRUSH_COLORS,
|
||||||
|
SPECIAL_RECOLORIZE_BRUSH,
|
||||||
|
SPECIAL_ROTATE_ANY_ANGLE,
|
||||||
|
SPECIAL_LOAD_BRUSH,
|
||||||
|
SPECIAL_SAVE_BRUSH,
|
||||||
|
SPECIAL_INVERT_SIEVE,
|
||||||
|
SPECIAL_ZOOM_IN,
|
||||||
|
SPECIAL_ZOOM_OUT,
|
||||||
|
SPECIAL_CENTER_ATTACHMENT,
|
||||||
|
SPECIAL_TOP_LEFT_ATTACHMENT,
|
||||||
|
SPECIAL_TOP_RIGHT_ATTACHMENT,
|
||||||
|
SPECIAL_BOTTOM_LEFT_ATTACHMENT,
|
||||||
|
SPECIAL_BOTTOM_RIGHT_ATTACHMENT,
|
||||||
|
SPECIAL_EXCLUDE_COLORS_MENU,
|
||||||
|
SPECIAL_SHADE_MODE, // |
|
||||||
|
SPECIAL_SHADE_MENU, // |
|
||||||
|
SPECIAL_QUICK_SHADE_MODE, // |
|
||||||
|
SPECIAL_QUICK_SHADE_MENU, // |
|
||||||
|
SPECIAL_STENCIL_MODE, // |
|
||||||
|
SPECIAL_STENCIL_MENU, // |
|
||||||
|
SPECIAL_MASK_MODE, // | Il faut que le premier effet soit
|
||||||
|
SPECIAL_MASK_MENU, // | SPECIAL_SHADE_MODE, et que le
|
||||||
|
SPECIAL_GRID_MODE, // | dernier soit SPECIAL_TILING_MENU,
|
||||||
|
SPECIAL_GRID_MENU, // |_ et que seuls des effets soient
|
||||||
|
SPECIAL_SIEVE_MODE, // | d‚finis entre ces deux l… car
|
||||||
|
SPECIAL_SIEVE_MENU, // | des tests sur cet intervalle sont
|
||||||
|
SPECIAL_COLORIZE_MODE, // | faits dans le moteur.
|
||||||
|
SPECIAL_COLORIZE_MENU, // |
|
||||||
|
SPECIAL_SMOOTH_MODE, // |
|
||||||
|
SPECIAL_SMOOTH_MENU, // |
|
||||||
|
SPECIAL_SMEAR_MODE, // |
|
||||||
|
SPECIAL_TILING_MODE, // |
|
||||||
|
SPECIAL_TILING_MENU // |
|
||||||
|
};
|
||||||
|
|
||||||
|
// D‚finition des op‚rations:
|
||||||
|
|
||||||
|
enum OPERATIONS
|
||||||
|
{
|
||||||
|
OPERATION_DESSIN_CONTINU, // Dessin … la main continu
|
||||||
|
OPERATION_DESSIN_DISCONTINU, // Dessin … la main discontinu
|
||||||
|
OPERATION_DESSIN_POINT, // Dessin … la main point par point
|
||||||
|
OPERATION_LIGNE, // Lignes
|
||||||
|
OPERATION_K_LIGNE, // Lignes reli‚es
|
||||||
|
OPERATION_LIGNES_CENTREES, // Lignes concentriques
|
||||||
|
OPERATION_RECTANGLE_VIDE, // Rectangle vide
|
||||||
|
OPERATION_RECTANGLE_PLEIN, // Rectangle plein
|
||||||
|
OPERATION_CERCLE_VIDE, // Cercle vide
|
||||||
|
OPERATION_CERCLE_PLEIN, // Cercle plein
|
||||||
|
OPERATION_ELLIPSE_VIDE, // Ellipse vide
|
||||||
|
OPERATION_ELLIPSE_PLEINE, // Ellipse pleine
|
||||||
|
OPERATION_FILL, // Fill
|
||||||
|
OPERATION_REMPLACER, // Remplacer couleur
|
||||||
|
OPERATION_PRISE_BROSSE, // Prise de brosse rectangulaire
|
||||||
|
OPERATION_POLYBROSSE, // Prise d'une brosse multiforme
|
||||||
|
OPERATION_PIPETTE, // R‚cup‚ration d'une couleur
|
||||||
|
OPERATION_LOUPE, // Positionnement de la fenˆtre de loupe
|
||||||
|
OPERATION_COURBE_3_POINTS, // Courbe … 3 points
|
||||||
|
OPERATION_COURBE_4_POINTS, // Courbe … 4 points
|
||||||
|
OPERATION_SPRAY, // Spray
|
||||||
|
OPERATION_POLYGONE, // Polygone
|
||||||
|
OPERATION_POLYFORM, // Polyforme
|
||||||
|
OPERATION_POLYFILL, // Polyfill
|
||||||
|
OPERATION_FILLED_POLYFORM, // Polyforme rempli
|
||||||
|
OPERATION_SCROLL, // Scroll
|
||||||
|
OPERATION_CERCLE_DEGRADE, // Cercles d‚grad‚s
|
||||||
|
OPERATION_ELLIPSE_DEGRADEE, // Ellipses d‚grad‚es
|
||||||
|
OPERATION_TOURNER_BROSSE, // Faire tourner brosse
|
||||||
|
OPERATION_ETIRER_BROSSE, // Etirer brosse
|
||||||
|
OPERATION_DEFORMER_BROSSE, // Deformer brosse
|
||||||
|
|
||||||
|
OPERATION_AUCUNE
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
BIN
dat/FONTE1.FNT
Normal file
BIN
dat/FONTE1.FNT
Normal file
Binary file not shown.
BIN
dat/FONTE2.FNT
Normal file
BIN
dat/FONTE2.FNT
Normal file
Binary file not shown.
BIN
dat/FONTS.PKM
Normal file
BIN
dat/FONTS.PKM
Normal file
Binary file not shown.
BIN
dat/GFX2.PKM
Normal file
BIN
dat/GFX2.PKM
Normal file
Binary file not shown.
147
dat/GREETS.TXT
Normal file
147
dat/GREETS.TXT
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
Access
|
||||||
|
Ace
|
||||||
|
AcidJam
|
||||||
|
Acryl
|
||||||
|
Alexel
|
||||||
|
Alias
|
||||||
|
Amiral
|
||||||
|
Arrakis
|
||||||
|
Avocado
|
||||||
|
Baloo
|
||||||
|
Barti
|
||||||
|
Bat
|
||||||
|
Biro
|
||||||
|
Bisounours
|
||||||
|
BlackAxe
|
||||||
|
Bonnie
|
||||||
|
Boo
|
||||||
|
Boz
|
||||||
|
Carine
|
||||||
|
Chandra
|
||||||
|
Cheetah
|
||||||
|
Chill
|
||||||
|
Cougar
|
||||||
|
Cremax
|
||||||
|
Cyclone
|
||||||
|
Dake
|
||||||
|
Danny
|
||||||
|
Danube
|
||||||
|
Darjul
|
||||||
|
Darwin
|
||||||
|
DarkAngel
|
||||||
|
Das
|
||||||
|
Decker
|
||||||
|
DerPiipo
|
||||||
|
Destop
|
||||||
|
Diabolo
|
||||||
|
DineS
|
||||||
|
Drac
|
||||||
|
DrYes
|
||||||
|
Edyx
|
||||||
|
Eller
|
||||||
|
Ellyn
|
||||||
|
EOF
|
||||||
|
Fall
|
||||||
|
Fame
|
||||||
|
Fantom
|
||||||
|
Fear
|
||||||
|
Feather
|
||||||
|
Fennec
|
||||||
|
Filter
|
||||||
|
Fiver
|
||||||
|
Flan
|
||||||
|
Fred
|
||||||
|
FreddyV
|
||||||
|
Frost
|
||||||
|
Ga‰l(GDC)
|
||||||
|
GainX
|
||||||
|
Gandalf
|
||||||
|
Goblin
|
||||||
|
Greenpix7
|
||||||
|
Grid
|
||||||
|
GrosQuick
|
||||||
|
HackerCroll
|
||||||
|
Haplo
|
||||||
|
Hof
|
||||||
|
Hornet
|
||||||
|
Hulud
|
||||||
|
Java
|
||||||
|
JBT
|
||||||
|
J‚r“me
|
||||||
|
Julien(JCA)
|
||||||
|
KalMinDo
|
||||||
|
KaneWood
|
||||||
|
Karma
|
||||||
|
Keith303
|
||||||
|
Lazur
|
||||||
|
LightShow
|
||||||
|
Lluvia
|
||||||
|
Louie
|
||||||
|
Luk
|
||||||
|
Made
|
||||||
|
Mamos
|
||||||
|
Mandrixx
|
||||||
|
Mangue
|
||||||
|
Mars
|
||||||
|
Mephisto
|
||||||
|
Mercure
|
||||||
|
Mirec
|
||||||
|
Moa
|
||||||
|
Moxica
|
||||||
|
MRK
|
||||||
|
Nitch
|
||||||
|
Noal
|
||||||
|
Nytrik
|
||||||
|
Optic
|
||||||
|
Orome
|
||||||
|
Pahladin
|
||||||
|
Phar
|
||||||
|
Pink
|
||||||
|
Pixel
|
||||||
|
Profil
|
||||||
|
Prowler
|
||||||
|
Puznik
|
||||||
|
Quick
|
||||||
|
Ra
|
||||||
|
Raster
|
||||||
|
Ravian
|
||||||
|
RedBug
|
||||||
|
Rem
|
||||||
|
Rez
|
||||||
|
Roudoudou
|
||||||
|
Sacrilege
|
||||||
|
Sam
|
||||||
|
SandMan
|
||||||
|
Scape
|
||||||
|
S‚bastien
|
||||||
|
Shodan
|
||||||
|
Skal
|
||||||
|
Skyfire
|
||||||
|
Sphair
|
||||||
|
Sprocket
|
||||||
|
Stef
|
||||||
|
Stony
|
||||||
|
Sumaleth
|
||||||
|
Sunday
|
||||||
|
Suny
|
||||||
|
Sybaris
|
||||||
|
TBF
|
||||||
|
Tempest
|
||||||
|
Thor
|
||||||
|
TMK
|
||||||
|
TwoFace
|
||||||
|
Underking
|
||||||
|
Unreal
|
||||||
|
VaeVictis
|
||||||
|
Vastator
|
||||||
|
Vatin
|
||||||
|
Veckman
|
||||||
|
Wain
|
||||||
|
Wally
|
||||||
|
WillBe
|
||||||
|
Xoomie
|
||||||
|
Xtrm
|
||||||
|
YannSulu
|
||||||
|
Z
|
||||||
|
Zeb
|
||||||
|
Zebig
|
||||||
109
dat/HLP_CRDT.PAS
Normal file
109
dat/HLP_CRDT.PAS
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
{
|
||||||
|
Ce fichier contient la partie "Credits" de l'aide de GRAFX 2
|
||||||
|
}
|
||||||
|
|
||||||
|
procedure Generer_l_aide_Credits;
|
||||||
|
begin
|
||||||
|
Demarrer_section_d_aide;
|
||||||
|
{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
|
||||||
|
{XXXXXXXXXXXXXXXXXXXXXX}
|
||||||
|
Ecrire_ligne_d_aide(T,' GRAFX 2.00');
|
||||||
|
Ecrire_ligne_d_aide(S,' THE ULTIMATE MULTI-RESOLUTION GFX EDITOR');
|
||||||
|
Ecrire_ligne_d_aide(N,' Copyright (c) 1996-98 by SUNSET DESIGN');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(T,'CREDITS:');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(S,' WRITTEN AND DESIGNED BY:');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(S,' GUILLAUME DORME KARL MARITAUD');
|
||||||
|
Ecrire_ligne_d_aide(N,' alias "Robinson" & alias "X-Man"');
|
||||||
|
Ecrire_ligne_d_aide(N,' programmer programmer');
|
||||||
|
Ecrire_ligne_d_aide(N,' GFX artist');
|
||||||
|
Ecrire_ligne_d_aide(T,'');
|
||||||
|
Ecrire_ligne_d_aide(S,' MISCELLANEOUS:');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' This is our very first program compiled');
|
||||||
|
Ecrire_ligne_d_aide(N,' in Watcom C (10.6).');
|
||||||
|
Ecrire_ligne_d_aide(N,' Low-level routines were written in 80386');
|
||||||
|
Ecrire_ligne_d_aide(N,' Assembler (optimized for 80486) and');
|
||||||
|
Ecrire_ligne_d_aide(N,' compiled with Borland TASM 5 (4.1).');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' We were inspired by the XSetMode routine');
|
||||||
|
Ecrire_ligne_d_aide(N,' from ''XLIB2'' to create more amazing video');
|
||||||
|
Ecrire_ligne_d_aide(N,' resolutions.');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' Thanks to Eclipse for their EOS 3.05 dos');
|
||||||
|
Ecrire_ligne_d_aide(N,' extender (WEOSlite).');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' Some information taken from several docs');
|
||||||
|
Ecrire_ligne_d_aide(N,' (PCGPE, Intervue, PC Interdit...) gave us');
|
||||||
|
Ecrire_ligne_d_aide(N,' an invaluable help.');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' Thanks to Shawn Hargreaves for his');
|
||||||
|
Ecrire_ligne_d_aide(N,' filled polygon routine from Allegro v2.2.');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' Thanks to Carlos "Made" Pardo for his');
|
||||||
|
Ecrire_ligne_d_aide(N,' great GrafX2 logo.');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' A thousand thanks to the authors of the');
|
||||||
|
Ecrire_ligne_d_aide(N,' different things listed above.');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' We also would like to thank all the');
|
||||||
|
Ecrire_ligne_d_aide(N,' people who gave us ideas to improve');
|
||||||
|
Ecrire_ligne_d_aide(N,' GrafX2.');
|
||||||
|
Ecrire_ligne_d_aide(T,'');
|
||||||
|
Ecrire_ligne_d_aide(S,' FILE FORMATS CREDITS:');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' PKM : Sunset Design');
|
||||||
|
Ecrire_ligne_d_aide(N,' LBM : Electronic Arts');
|
||||||
|
Ecrire_ligne_d_aide(N,' GIF : Compuserve');
|
||||||
|
Ecrire_ligne_d_aide(N,' BMP : Microsoft');
|
||||||
|
Ecrire_ligne_d_aide(N,' PCX : Z-Soft');
|
||||||
|
Ecrire_ligne_d_aide(N,' IMG : Bivas (W. Wiedmann?)');
|
||||||
|
Ecrire_ligne_d_aide(N,' SCx : Colorix (?)');
|
||||||
|
Ecrire_ligne_d_aide(N,' CEL,KCF : K.O.S. (KISekae Set system)');
|
||||||
|
Ecrire_ligne_d_aide(N,' PI1,PC1 : Degas Elite');
|
||||||
|
Ecrire_ligne_d_aide(N,' PAL : ermmh... nobody (?)');
|
||||||
|
Ecrire_ligne_d_aide(T,'');
|
||||||
|
Ecrire_ligne_d_aide(T,'HOW TO CONTACT US ?');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(S,' SNAIL MAIL:');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' GUILLAUME DORME (Robinson)');
|
||||||
|
Ecrire_ligne_d_aide(N,' 15, rue de l''observatoire');
|
||||||
|
Ecrire_ligne_d_aide(N,' 87000 LIMOGES (FRANCE)');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' KARL MARITAUD (X-Man)');
|
||||||
|
Ecrire_ligne_d_aide(N,' 10, rue de la Brasserie');
|
||||||
|
Ecrire_ligne_d_aide(N,' 87000 LIMOGES (FRANCE)');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(S,' E-MAIL:');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' dorme@msi.unilim.fr');
|
||||||
|
Ecrire_ligne_d_aide(N,' maritaud@ensil.unilim.fr');
|
||||||
|
Ecrire_ligne_d_aide(T,'');
|
||||||
|
Ecrire_ligne_d_aide(T,'USELESS INFORMATION:');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' Source size: about 1400 Kb');
|
||||||
|
Ecrire_ligne_d_aide(N,' GrafX2''s birth date: July 20th 1996');
|
||||||
|
Ecrire_ligne_d_aide(T,'');
|
||||||
|
Ecrire_ligne_d_aide(T,'KNOWN BUGS:');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' - <Ctrl>+<C> stops the program when you');
|
||||||
|
Ecrire_ligne_d_aide(N,' are entering values. So don''t press');
|
||||||
|
Ecrire_ligne_d_aide(N,' these keys until we fix this bug.');
|
||||||
|
Ecrire_ligne_d_aide(N,' - A few different key combinations return');
|
||||||
|
Ecrire_ligne_d_aide(N,' the same code.');
|
||||||
|
Ecrire_ligne_d_aide(N,' - A red flash appears at start up when an');
|
||||||
|
Ecrire_ligne_d_aide(N,' empty Zip drive is found.');
|
||||||
|
Ecrire_ligne_d_aide(N,' - Some functions aren''t finished yet.');
|
||||||
|
Ecrire_ligne_d_aide(N,' This is normal for a Beta version, so');
|
||||||
|
Ecrire_ligne_d_aide(N,' don''t worry.');
|
||||||
|
Ecrire_ligne_d_aide(N,' But if you still find some bugs in the');
|
||||||
|
Ecrire_ligne_d_aide(N,' next versions, then we''d appreciate');
|
||||||
|
Ecrire_ligne_d_aide(N,' that you tell us what they exactly are');
|
||||||
|
Ecrire_ligne_d_aide(N,' and how and when they occur.');
|
||||||
|
{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
|
||||||
|
{XXXXXXXXXXXXXXXXXXXXXX}
|
||||||
|
Terminer_section_d_aide;
|
||||||
|
end;
|
||||||
67
dat/HLP_GRET.PAS
Normal file
67
dat/HLP_GRET.PAS
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
Ce fichier contient la partie "Greetings ..." de l'aide de GRAFX 2
|
||||||
|
}
|
||||||
|
|
||||||
|
procedure Generer_l_aide_Greetings;
|
||||||
|
begin
|
||||||
|
Demarrer_section_d_aide;
|
||||||
|
{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
|
||||||
|
{XXXXXXXXXXXXXXXXXXXXXX}
|
||||||
|
Ecrire_ligne_d_aide(T,'GREETINGS:');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,'Our best regards go to...');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' Access Filter Pink');
|
||||||
|
Ecrire_ligne_d_aide(N,' Ace Fiver Pixel');
|
||||||
|
Ecrire_ligne_d_aide(N,' AcidJam Flan Profil');
|
||||||
|
Ecrire_ligne_d_aide(N,' Acryl Fred Prowler');
|
||||||
|
Ecrire_ligne_d_aide(N,' Alexel FreddyV Puznik');
|
||||||
|
Ecrire_ligne_d_aide(N,' Alias Frost Quick');
|
||||||
|
Ecrire_ligne_d_aide(N,' Amiral Ga‰l(GDC) Ra');
|
||||||
|
Ecrire_ligne_d_aide(N,' Arrakis GainX Raster');
|
||||||
|
Ecrire_ligne_d_aide(N,' Avocado Gandalf Ravian');
|
||||||
|
Ecrire_ligne_d_aide(N,' Baloo Goblin RedBug');
|
||||||
|
Ecrire_ligne_d_aide(N,' Barti Greenpix7 Rem');
|
||||||
|
Ecrire_ligne_d_aide(N,' Bat Grid Rez');
|
||||||
|
Ecrire_ligne_d_aide(N,' Biro GrosQuick Roudoudou');
|
||||||
|
Ecrire_ligne_d_aide(N,' Bisounours HackerCroll Sacrilege');
|
||||||
|
Ecrire_ligne_d_aide(N,' BlackAxe Haplo Sam');
|
||||||
|
Ecrire_ligne_d_aide(N,' Bonnie Hof SandMan');
|
||||||
|
Ecrire_ligne_d_aide(N,' Boo Hornet Scape');
|
||||||
|
Ecrire_ligne_d_aide(N,' Boz Hulud S‚bastien');
|
||||||
|
Ecrire_ligne_d_aide(N,' Carine Java Shodan');
|
||||||
|
Ecrire_ligne_d_aide(N,' Chandra JBT Skal');
|
||||||
|
Ecrire_ligne_d_aide(N,' Cheetah J‚r“me Skyfire');
|
||||||
|
Ecrire_ligne_d_aide(N,' Chill Julien(JCA) Sphair');
|
||||||
|
Ecrire_ligne_d_aide(N,' Cougar KalMinDo Sprocket');
|
||||||
|
Ecrire_ligne_d_aide(N,' Cremax KaneWood Stef');
|
||||||
|
Ecrire_ligne_d_aide(N,' Cyclone Karma Stony');
|
||||||
|
Ecrire_ligne_d_aide(N,' Dake Keith303 Sumaleth');
|
||||||
|
Ecrire_ligne_d_aide(N,' Danny Lazur Sunday');
|
||||||
|
Ecrire_ligne_d_aide(N,' Danube LightShow Suny');
|
||||||
|
Ecrire_ligne_d_aide(N,' Darjul Lluvia Sybaris');
|
||||||
|
Ecrire_ligne_d_aide(N,' Darwin Louie TBF');
|
||||||
|
Ecrire_ligne_d_aide(N,' DarkAngel Luk Tempest');
|
||||||
|
Ecrire_ligne_d_aide(N,' Das Made Thor');
|
||||||
|
Ecrire_ligne_d_aide(N,' Decker Mamos TMK');
|
||||||
|
Ecrire_ligne_d_aide(N,' DerPiipo Mandrixx TwoFace');
|
||||||
|
Ecrire_ligne_d_aide(N,' Destop Mangue Underking');
|
||||||
|
Ecrire_ligne_d_aide(N,' Diabolo Mars Unreal');
|
||||||
|
Ecrire_ligne_d_aide(N,' DineS Mephisto VaeVictis');
|
||||||
|
Ecrire_ligne_d_aide(N,' Drac Mercure Vastator');
|
||||||
|
Ecrire_ligne_d_aide(N,' DrYes Mirec Vatin');
|
||||||
|
Ecrire_ligne_d_aide(N,' Edyx Moa Veckman');
|
||||||
|
Ecrire_ligne_d_aide(N,' Eller Moxica Wain');
|
||||||
|
Ecrire_ligne_d_aide(N,' Ellyn MRK Wally');
|
||||||
|
Ecrire_ligne_d_aide(N,' EOF Nitch WillBe');
|
||||||
|
Ecrire_ligne_d_aide(N,' Fall Noal Xoomie');
|
||||||
|
Ecrire_ligne_d_aide(N,' Fame Nytrik Xtrm');
|
||||||
|
Ecrire_ligne_d_aide(N,' Fantom Optic YannSulu');
|
||||||
|
Ecrire_ligne_d_aide(N,' Fear Orome Z');
|
||||||
|
Ecrire_ligne_d_aide(N,' Feather Pahladin Zeb');
|
||||||
|
Ecrire_ligne_d_aide(N,' Fennec Phar Zebig');
|
||||||
|
Ecrire_ligne_d_aide(N,' and all #pixel, #demofr and #coders.');
|
||||||
|
{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
|
||||||
|
{XXXXXXXXXXXXXXXXXXXXXX}
|
||||||
|
Terminer_section_d_aide;
|
||||||
|
end;
|
||||||
52
dat/HLP_RGST.PAS
Normal file
52
dat/HLP_RGST.PAS
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
{ Ce fichier contient la partie "Register?" de l'aide de GrafX2 }
|
||||||
|
|
||||||
|
procedure Generer_l_aide_Register;
|
||||||
|
begin
|
||||||
|
Demarrer_section_d_aide;
|
||||||
|
{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
|
||||||
|
{XXXXXXXXXXXXXXXXXXXXXX}
|
||||||
|
Ecrire_ligne_d_aide(T,'REGISTERING ?');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' You''ll probably say:');
|
||||||
|
Ecrire_ligne_d_aide(N,' "Does this mean that I have to pay?"');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' And we''ll reply to you: No...');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(T,'GRAFX 2.00 IS FREEWARE');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' ... But, but, but...');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' Considering the amount of work (and love)');
|
||||||
|
Ecrire_ligne_d_aide(N,' we put in this program, we would extremely');
|
||||||
|
Ecrire_ligne_d_aide(N,' appreciate that you "give" us something in');
|
||||||
|
Ecrire_ligne_d_aide(N,' exchange for the use you make of it.');
|
||||||
|
Ecrire_ligne_d_aide(N,' Let''s say some money, or a nice picture');
|
||||||
|
Ecrire_ligne_d_aide(N,' you drew with GrafX2, or a postcard...');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' If you make profit with an image you drew');
|
||||||
|
Ecrire_ligne_d_aide(N,' with GrafX2, it would be great if you sent');
|
||||||
|
Ecrire_ligne_d_aide(N,' us this picture. If you used it for a game,');
|
||||||
|
Ecrire_ligne_d_aide(N,' would be wiser not to send all your graphs,');
|
||||||
|
Ecrire_ligne_d_aide(N,' what about sending a copy of the game?');
|
||||||
|
Ecrire_ligne_d_aide(T,'');
|
||||||
|
Ecrire_ligne_d_aide(T,'FREEWARE CONVENTIONS:');
|
||||||
|
Ecrire_ligne_d_aide(N,'');
|
||||||
|
Ecrire_ligne_d_aide(N,' This version of GrafX2 is being released');
|
||||||
|
Ecrire_ligne_d_aide(N,' to you as is.');
|
||||||
|
Ecrire_ligne_d_aide(N,' All bugs should be reported to either');
|
||||||
|
Ecrire_ligne_d_aide(N,' Robinson or X-Man.');
|
||||||
|
Ecrire_ligne_d_aide(N,' The authors take no responsibility for');
|
||||||
|
Ecrire_ligne_d_aide(N,' lost work, or damaged equipment caused');
|
||||||
|
Ecrire_ligne_d_aide(N,' directly or indirectly by this program.');
|
||||||
|
Ecrire_ligne_d_aide(N,' GrafX2 cannot be modified in any way');
|
||||||
|
Ecrire_ligne_d_aide(N,' without our written consent.');
|
||||||
|
Ecrire_ligne_d_aide(N,' Finally, the charging of monetary fees by');
|
||||||
|
Ecrire_ligne_d_aide(N,' any unauthorized party for the circulation');
|
||||||
|
Ecrire_ligne_d_aide(N,' or use of this utility is expressly');
|
||||||
|
Ecrire_ligne_d_aide(N,' forbidden.');
|
||||||
|
Ecrire_ligne_d_aide(N,' This means that if you had to pay for');
|
||||||
|
Ecrire_ligne_d_aide(N,' getting GrafX2, you have been swindled.');
|
||||||
|
{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
|
||||||
|
{XXXXXXXXXXXXXXXXXXXXXX}
|
||||||
|
Terminer_section_d_aide;
|
||||||
|
end;
|
||||||
BIN
dat/IMG2FNT.EXE
Normal file
BIN
dat/IMG2FNT.EXE
Normal file
Binary file not shown.
88
dat/IMG2FNT.PAS
Normal file
88
dat/IMG2FNT.PAS
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
program IMG2FNT;
|
||||||
|
|
||||||
|
const
|
||||||
|
COULEUR_TEXTE=15;
|
||||||
|
|
||||||
|
var
|
||||||
|
Fichier:file;
|
||||||
|
Image:array[0..20479] of byte;
|
||||||
|
Fonte:array[0..2047] of byte;
|
||||||
|
Offset_dans_image:longint;
|
||||||
|
Masque:byte;
|
||||||
|
Position:word;
|
||||||
|
i,j,k,l:word;
|
||||||
|
Errcode:integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if (paramcount<2) or (paramcount>3) then
|
||||||
|
begin
|
||||||
|
writeln('Syntaxe: IMG2FNT <Image> <Fonte> [offset dans l''image]');
|
||||||
|
writeln('Attention: ne pas taper les extensions!');
|
||||||
|
halt(1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
if paramcount=3 then
|
||||||
|
begin
|
||||||
|
val(paramstr(3),Offset_dans_image,Errcode);
|
||||||
|
if Errcode<>0 then
|
||||||
|
begin
|
||||||
|
writeln('Syntaxe: IMG2FNT <Image> <Fonte> [offset dans l''image]');
|
||||||
|
writeln('Attention: ne pas taper les extensions!');
|
||||||
|
halt(1);
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Offset_dans_image:=0;
|
||||||
|
|
||||||
|
assign(Fichier,paramstr(1)+'.img');
|
||||||
|
reset(Fichier,1);
|
||||||
|
seek(Fichier,896+Offset_dans_image);
|
||||||
|
blockread(Fichier,Image,17280);
|
||||||
|
close(Fichier);
|
||||||
|
|
||||||
|
{Transformation de l'image en 0 pour le fond et 255 pour le texte}
|
||||||
|
for i:=0 to 17279 do
|
||||||
|
if Image[i]<>COULEUR_TEXTE
|
||||||
|
then Image[i]:=0
|
||||||
|
else Image[i]:=255;
|
||||||
|
|
||||||
|
for i:=0 to 255 do
|
||||||
|
for j:=0 to 7 do
|
||||||
|
begin
|
||||||
|
Fonte[(i shl 3)+j]:=0;
|
||||||
|
Masque:=128;
|
||||||
|
for k:=0 to 7 do
|
||||||
|
begin
|
||||||
|
asm {Position:=((i DIV 45)*2880) + ((i MOD 45)*8) + (j*360) +k}
|
||||||
|
mov ax,i
|
||||||
|
mov bl,45
|
||||||
|
div bl
|
||||||
|
push ax
|
||||||
|
xor ah,ah
|
||||||
|
mov bx,2880
|
||||||
|
mul bx
|
||||||
|
mov dx,ax
|
||||||
|
pop ax
|
||||||
|
mov cl,8
|
||||||
|
shr ax,cl
|
||||||
|
mov cl,3
|
||||||
|
shl ax,cl
|
||||||
|
add dx,ax
|
||||||
|
add dx,k
|
||||||
|
mov Position,dx
|
||||||
|
mov ax,j
|
||||||
|
mov bx,360
|
||||||
|
mul bx
|
||||||
|
add Position,ax
|
||||||
|
end;
|
||||||
|
Fonte[(i shl 3)+j]:=Fonte[(i shl 3)+j] + (Masque and Image[Position]);
|
||||||
|
Masque:=Masque shr 1;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
assign(Fichier,Paramstr(2)+'.fnt');
|
||||||
|
rewrite(Fichier,1);
|
||||||
|
blockwrite(Fichier,Fonte,2048);
|
||||||
|
close(Fichier);
|
||||||
|
end.
|
||||||
|
|
||||||
BIN
dat/MAKEDAT.EXE
Normal file
BIN
dat/MAKEDAT.EXE
Normal file
Binary file not shown.
738
dat/MAKEDAT.PAS
Normal file
738
dat/MAKEDAT.PAS
Normal file
@ -0,0 +1,738 @@
|
|||||||
|
program makedat;
|
||||||
|
|
||||||
|
type tpalette=array[0..767] of byte;
|
||||||
|
var palette:tpalette;
|
||||||
|
|
||||||
|
{****************************************************************************}
|
||||||
|
{****************************************************************************}
|
||||||
|
{****************************************************************************}
|
||||||
|
|
||||||
|
Procedure XMODE;assembler;
|
||||||
|
const
|
||||||
|
X360Y270 : array[0..18] of word =
|
||||||
|
( $12E7, $6B00, $5901, $5A02, $8E03, $5E04, $8A05, $3006, $F007, $0008,
|
||||||
|
$6109, $2010, $A911, $1B12, $2D13, $0014, $1F15, $2F16, $E317 );
|
||||||
|
asm
|
||||||
|
push ds
|
||||||
|
|
||||||
|
mov ax,13h
|
||||||
|
int 10h
|
||||||
|
|
||||||
|
mov dx,3c4h
|
||||||
|
mov ax,0604h
|
||||||
|
out dx,ax
|
||||||
|
mov ax,0100h
|
||||||
|
out dx,ax
|
||||||
|
|
||||||
|
lea si,X360Y270
|
||||||
|
lodsb
|
||||||
|
or al,al
|
||||||
|
jz @@DontSetDot
|
||||||
|
mov dx,3C2h
|
||||||
|
out dx,al
|
||||||
|
|
||||||
|
@@DontSetDot:
|
||||||
|
mov dx,3C4h
|
||||||
|
mov ax,0300h
|
||||||
|
out dx,ax
|
||||||
|
mov dx,3D4h
|
||||||
|
mov al,11h
|
||||||
|
out dx,al
|
||||||
|
inc dx
|
||||||
|
in al,dx
|
||||||
|
and al,07fh
|
||||||
|
out dx,al
|
||||||
|
dec dx
|
||||||
|
cld
|
||||||
|
xor cx,cx
|
||||||
|
lodsb
|
||||||
|
mov cl,al
|
||||||
|
|
||||||
|
@@SetCRTParmsLoop:
|
||||||
|
lodsw
|
||||||
|
out dx,ax
|
||||||
|
loop @@SetCRTParmsLoop
|
||||||
|
|
||||||
|
mov dx,3C4h
|
||||||
|
mov ax,0f02h
|
||||||
|
out dx,ax
|
||||||
|
mov ax,0A000h
|
||||||
|
mov es,ax
|
||||||
|
sub di,di
|
||||||
|
sub ax,ax
|
||||||
|
mov cx,8000h
|
||||||
|
rep stosw
|
||||||
|
|
||||||
|
mov dx,3D4h
|
||||||
|
mov al,13h
|
||||||
|
out dx,al
|
||||||
|
inc dx
|
||||||
|
mov ax,90
|
||||||
|
shr ax,1
|
||||||
|
out dx,al
|
||||||
|
|
||||||
|
pop ds
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure pixel(x,y : word;coul : byte);assembler;
|
||||||
|
asm
|
||||||
|
mov dx,3C4h
|
||||||
|
mov ax,0102h
|
||||||
|
mov cx,x
|
||||||
|
and cx,3
|
||||||
|
shl ah,cl
|
||||||
|
out dx,ax
|
||||||
|
|
||||||
|
mov ax,0A000h
|
||||||
|
mov es,ax
|
||||||
|
|
||||||
|
mov ax,y
|
||||||
|
mov bx,90
|
||||||
|
mul bx
|
||||||
|
|
||||||
|
mov bx,x
|
||||||
|
shr bx,2
|
||||||
|
add ax,bx
|
||||||
|
mov di,ax
|
||||||
|
mov al,coul
|
||||||
|
stosb
|
||||||
|
end;
|
||||||
|
|
||||||
|
Function lit_pixel(x,y : word):byte;
|
||||||
|
var a : byte;
|
||||||
|
begin
|
||||||
|
asm
|
||||||
|
mov ax,0A000h
|
||||||
|
mov es,ax
|
||||||
|
|
||||||
|
mov ax,y
|
||||||
|
mov bx,90
|
||||||
|
mul bx
|
||||||
|
|
||||||
|
mov bx,x
|
||||||
|
mov cl,bl
|
||||||
|
and cl,3
|
||||||
|
|
||||||
|
shr bx,2
|
||||||
|
add ax,bx
|
||||||
|
mov di,ax
|
||||||
|
|
||||||
|
mov dx,3CEh
|
||||||
|
mov al,4
|
||||||
|
mov ah,cl
|
||||||
|
out dx,ax
|
||||||
|
|
||||||
|
mov al,[es:di]
|
||||||
|
mov a,al
|
||||||
|
end;
|
||||||
|
lit_pixel:=a;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure set_palette; assembler;
|
||||||
|
asm
|
||||||
|
push ds
|
||||||
|
lea si,palette
|
||||||
|
mov dx,3C8h
|
||||||
|
xor al,al
|
||||||
|
out dx,al
|
||||||
|
inc dl
|
||||||
|
mov cx,768
|
||||||
|
rep outsb
|
||||||
|
pop ds
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{----------------------------------------------------------------------------}
|
||||||
|
{----------------------------------------------------------------------------}
|
||||||
|
{----------------------------------------------------------------------------}
|
||||||
|
|
||||||
|
type t_os_tampon=array[0..63999] of byte;
|
||||||
|
var os_index:word;
|
||||||
|
var os_tampon:^t_os_tampon;
|
||||||
|
|
||||||
|
function octet_suivant(var f:file):byte;
|
||||||
|
var effect_result:word;
|
||||||
|
begin
|
||||||
|
inc(os_index);
|
||||||
|
if (os_index>=64000) then
|
||||||
|
begin
|
||||||
|
{$I-}
|
||||||
|
blockread(f,os_tampon^,64000,effect_result);
|
||||||
|
{$I+}
|
||||||
|
os_index:=0;
|
||||||
|
end;
|
||||||
|
octet_suivant:=os_tampon^[os_index];
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure init_os;
|
||||||
|
begin
|
||||||
|
new(os_tampon);
|
||||||
|
os_index:=64000;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure close_os;
|
||||||
|
begin
|
||||||
|
dispose(os_tampon);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{----------------------------------------------------------------------------}
|
||||||
|
|
||||||
|
var eo_index:word;
|
||||||
|
var eo_tampon:^t_os_tampon;
|
||||||
|
|
||||||
|
procedure ecrire_octet(var f:file; octet:byte);
|
||||||
|
var
|
||||||
|
effect_result:word;
|
||||||
|
begin
|
||||||
|
eo_tampon^[eo_index]:=octet;
|
||||||
|
inc(eo_index);
|
||||||
|
if (eo_index>=64000) then
|
||||||
|
begin
|
||||||
|
blockwrite(f,eo_tampon^,64000,effect_result);
|
||||||
|
eo_index:=0;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure init_eo;
|
||||||
|
begin
|
||||||
|
new(eo_tampon);
|
||||||
|
eo_index:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure close_eo(var f:file);
|
||||||
|
var effect_result:word;
|
||||||
|
begin
|
||||||
|
if eo_index>0 then blockwrite(f,eo_tampon^,eo_index,effect_result);
|
||||||
|
dispose(eo_tampon);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{----------------------------------------------------------------------------}
|
||||||
|
{----------------------------------------------------------------------------}
|
||||||
|
{----------------------------------------------------------------------------}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{--------------------- DEPACKER une IMAGE au format PKM ---------------------}
|
||||||
|
procedure load_PKM(nom_fichier:string);
|
||||||
|
{errcode retourn‚: 0=OK , 1=pas un PKM , 2=taille incorrecte}
|
||||||
|
type
|
||||||
|
header = record {taille: 780 octets}
|
||||||
|
ident : array[1..3] of char; { chaŒne "PKM" }
|
||||||
|
methode : byte; { m‚thode de compression: }
|
||||||
|
{ 0 = compression en ligne (c)KM }
|
||||||
|
{ autres = inconnues pour le moment }
|
||||||
|
Recon1 : byte; { octet de reconnaissance sur 1 octet }
|
||||||
|
Recon2 : byte; { octet de reconnaissance sur 2 octets }
|
||||||
|
longx : word; { taille de l'image en X }
|
||||||
|
longy : word; { taille de l'image en Y }
|
||||||
|
palette : tpalette; { palette RVB 256*3 }
|
||||||
|
jump : word; { taille du saut entre le header et l'image }
|
||||||
|
end;
|
||||||
|
var
|
||||||
|
TailleX,TailleY:word;
|
||||||
|
errcode:byte;
|
||||||
|
coul,octet:byte;
|
||||||
|
taille_fichier:word;
|
||||||
|
i,j,k:word;
|
||||||
|
c:longint;
|
||||||
|
offsX,offsY,X,Y:word;
|
||||||
|
fich:file;
|
||||||
|
head: header;
|
||||||
|
taille_image: longint;
|
||||||
|
begin
|
||||||
|
offsX:=0;
|
||||||
|
offsY:=0;
|
||||||
|
assign(fich,Nom_Fichier);
|
||||||
|
reset(fich,1);
|
||||||
|
taille_fichier:=filesize(fich);
|
||||||
|
blockread(fich,head,SizeOf(Header));
|
||||||
|
if Head.LongY>270 then Head.LongY:=270;
|
||||||
|
|
||||||
|
if (head.ident<>'PKM') then
|
||||||
|
begin
|
||||||
|
errcode:=1;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if (head.longX>360) then
|
||||||
|
begin
|
||||||
|
errcode:=2;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ d‚finition de la palette }
|
||||||
|
Palette:=head.palette;
|
||||||
|
|
||||||
|
set_palette;
|
||||||
|
|
||||||
|
TailleX:=Head.LongX;
|
||||||
|
TailleY:=Head.LongY;
|
||||||
|
taille_image:=Head.LongX;
|
||||||
|
taille_image:=taille_image*Head.LongY;
|
||||||
|
Seek(fich,SizeOf(Header)+Head.Jump);
|
||||||
|
|
||||||
|
init_os;
|
||||||
|
|
||||||
|
j:=0;
|
||||||
|
octet:=octet_suivant(fich);
|
||||||
|
c:=0;
|
||||||
|
while (c<taille_image) and (j<taille_fichier-SizeOf(Header)-Head.Jump) do
|
||||||
|
begin
|
||||||
|
if (octet<>Head.Recon1) and (octet<>Head.Recon2)
|
||||||
|
then
|
||||||
|
begin
|
||||||
|
X:=c mod head.longX;
|
||||||
|
Y:=c div head.longX;
|
||||||
|
if (X<360) and (Y<270) then
|
||||||
|
pixel(X,Y,octet);
|
||||||
|
inc(j);
|
||||||
|
octet:=octet_suivant(fich);
|
||||||
|
inc(c);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if octet=Head.Recon1
|
||||||
|
then
|
||||||
|
begin
|
||||||
|
inc(j);
|
||||||
|
octet:=octet_suivant(fich);
|
||||||
|
coul:=octet;
|
||||||
|
inc(j);
|
||||||
|
octet:=octet_suivant(fich)-1;
|
||||||
|
for i:=0 to octet do
|
||||||
|
begin
|
||||||
|
X:=(c+i) mod head.longX;
|
||||||
|
Y:=(c+i) div head.longX;
|
||||||
|
if (X<360) and (Y<270) then
|
||||||
|
pixel(X,Y,coul);
|
||||||
|
end;
|
||||||
|
c:=c+octet+1;
|
||||||
|
inc(j);
|
||||||
|
octet:=octet_suivant(fich);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
inc(j);
|
||||||
|
octet:=octet_suivant(fich);
|
||||||
|
coul:=octet;
|
||||||
|
inc(j);
|
||||||
|
octet:=octet_suivant(fich);
|
||||||
|
k:=(octet shl 8)+octet_suivant(fich);
|
||||||
|
for i:=0 to (k-1) do
|
||||||
|
begin
|
||||||
|
X:=(c+i) mod head.longX;
|
||||||
|
Y:=(c+i) div head.longX;
|
||||||
|
if (X<360) and (Y<270) then
|
||||||
|
pixel(X,Y,coul);
|
||||||
|
end;
|
||||||
|
c:=c+k;
|
||||||
|
j:=j+2;
|
||||||
|
octet:=octet_suivant(fich);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
close_os;
|
||||||
|
close(fich);
|
||||||
|
errcode:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{****************************************************************************}
|
||||||
|
{****************************************************************************}
|
||||||
|
{****************************************************************************}
|
||||||
|
|
||||||
|
var Crypt_curseur:byte;
|
||||||
|
const Crypt_cle:string[13]='Sunset Design';
|
||||||
|
|
||||||
|
function crypt(octet:byte):byte;
|
||||||
|
begin
|
||||||
|
crypt:=octet xor ord(Crypt_cle[Crypt_curseur]);
|
||||||
|
Crypt_curseur:=(Crypt_curseur mod 13)+1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure Ecrire_palette(var Fichier:file);
|
||||||
|
var i:word;
|
||||||
|
begin
|
||||||
|
for i:=0 to 767 do ecrire_octet(Fichier,crypt(palette[i]));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure Lire_et_ecrire_sprite(var Fichier:file; x1,y1,x2,y2:word);
|
||||||
|
var i,j:word;
|
||||||
|
begin
|
||||||
|
for j:=y1 to y2 do
|
||||||
|
for i:=x1 to x2 do
|
||||||
|
ecrire_octet(Fichier,crypt(lit_pixel(i,j)));
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure Ecrire_trames_predefinies(var Fichier:file);
|
||||||
|
var
|
||||||
|
n,i,j:word;
|
||||||
|
Octet:byte;
|
||||||
|
Pixel_lu:byte;
|
||||||
|
begin
|
||||||
|
for n:=0 to 11 do {Pour chaque trame pr‚d‚finie}
|
||||||
|
begin
|
||||||
|
for j:=0 to 15 do
|
||||||
|
begin
|
||||||
|
Octet:=0;
|
||||||
|
for i:=0 to 7 do
|
||||||
|
begin
|
||||||
|
Octet:=(Octet shl 1);
|
||||||
|
Pixel_lu:=lit_pixel(9+(17*n)+i,196+j);
|
||||||
|
if Pixel_lu>0 then
|
||||||
|
inc(Octet);
|
||||||
|
end;
|
||||||
|
ecrire_octet(Fichier,crypt(Octet));
|
||||||
|
|
||||||
|
Octet:=0;
|
||||||
|
for i:=0 to 7 do
|
||||||
|
begin
|
||||||
|
Octet:=(Octet shl 1);
|
||||||
|
Pixel_lu:=lit_pixel(1+(17*n)+i,196+j);
|
||||||
|
if Pixel_lu>0 then
|
||||||
|
inc(Octet);
|
||||||
|
end;
|
||||||
|
ecrire_octet(Fichier,crypt(Octet));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure Rajouter_fichier(var Fichier:file;Nom_fichier:string;Crypter:boolean);
|
||||||
|
var
|
||||||
|
Fichier_a_ajouter:file;
|
||||||
|
Taille :word;
|
||||||
|
Indice :word;
|
||||||
|
begin
|
||||||
|
assign (Fichier_a_ajouter,Nom_fichier);
|
||||||
|
reset (Fichier_a_ajouter,1);
|
||||||
|
Taille:=filesize(Fichier_a_ajouter);
|
||||||
|
|
||||||
|
init_os;
|
||||||
|
if (Crypter) then
|
||||||
|
for Indice:=1 to Taille do
|
||||||
|
ecrire_octet(Fichier,crypt(octet_suivant(Fichier_a_ajouter)))
|
||||||
|
else
|
||||||
|
for Indice:=1 to Taille do
|
||||||
|
ecrire_octet(Fichier,octet_suivant(Fichier_a_ajouter));
|
||||||
|
close_os;
|
||||||
|
|
||||||
|
close(Fichier_a_ajouter);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure Coder_partie_de_fonte(var Fichier:file;Pos_X,Pos_Y,Nb_char:word);
|
||||||
|
var
|
||||||
|
X,Y:word;
|
||||||
|
Indice_char:word;
|
||||||
|
Couleur_temporaire:byte;
|
||||||
|
begin
|
||||||
|
for Indice_char:=1 to Nb_char do
|
||||||
|
begin
|
||||||
|
for X:=0 to 5 do
|
||||||
|
for Y:=0 to 7 do
|
||||||
|
begin
|
||||||
|
Couleur_temporaire:=lit_pixel(Pos_X+X,Pos_Y+Y);
|
||||||
|
|
||||||
|
if not (Couleur_temporaire in [25,7,15])
|
||||||
|
then Couleur_temporaire:=0;
|
||||||
|
|
||||||
|
ecrire_octet(Fichier,crypt(Couleur_temporaire));
|
||||||
|
end;
|
||||||
|
|
||||||
|
inc(Pos_X,6);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
var
|
||||||
|
Fichier:file;
|
||||||
|
Position_de_depart_de_la_section_d_aide:longint;
|
||||||
|
Nombre_de_lignes_d_aide :word;
|
||||||
|
Nombre_d_octets_utilises:word;
|
||||||
|
|
||||||
|
|
||||||
|
procedure Demarrer_section_d_aide;
|
||||||
|
begin
|
||||||
|
Nombre_de_lignes_d_aide :=0;
|
||||||
|
Nombre_d_octets_utilises:=0;
|
||||||
|
assign(Fichier,'GFX2.DAT');
|
||||||
|
reset (Fichier,1);
|
||||||
|
Position_de_depart_de_la_section_d_aide:=filesize(Fichier);
|
||||||
|
seek(Fichier,Position_de_depart_de_la_section_d_aide);
|
||||||
|
{On ‚crit temporairement des valeurs erron‚es dans le fichier:}
|
||||||
|
blockwrite(Fichier,Nombre_de_lignes_d_aide ,2); {Nb de lignes}
|
||||||
|
blockwrite(Fichier,Nombre_d_octets_utilises,2); {Nb d'octets utilis‚s}
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure Terminer_section_d_aide;
|
||||||
|
begin
|
||||||
|
seek (Fichier,Position_de_depart_de_la_section_d_aide);
|
||||||
|
{On ‚crit d‚finitivement les valeurs correctes dans le fichier:}
|
||||||
|
blockwrite(Fichier,Nombre_de_lignes_d_aide ,2); {Nb de lignes}
|
||||||
|
blockwrite(Fichier,Nombre_d_octets_utilises,2); {Nb d'octets utilis‚s}
|
||||||
|
close (Fichier);
|
||||||
|
end;
|
||||||
|
|
||||||
|
const
|
||||||
|
TITRE = 1;
|
||||||
|
SOUS_TITRE = 2;
|
||||||
|
NORMAL = 3;
|
||||||
|
T = TITRE;
|
||||||
|
S = SOUS_TITRE;
|
||||||
|
N = NORMAL;
|
||||||
|
|
||||||
|
{$I TABLES}
|
||||||
|
|
||||||
|
procedure Ecrire_ligne_d_aide(De_type:byte;Chaine:string);
|
||||||
|
var
|
||||||
|
Code:byte; {Code … inscrire dans le fichier}
|
||||||
|
Indice:byte; {Indice de balayage de la chaŒne}
|
||||||
|
begin
|
||||||
|
|
||||||
|
if length(Chaine)>44 then
|
||||||
|
begin
|
||||||
|
close (Fichier);
|
||||||
|
asm
|
||||||
|
mov ax,3
|
||||||
|
int 10h
|
||||||
|
end;
|
||||||
|
writeln('ERREUR DANS L''AIDE !!! Il y a une ligne qui est trop longue !!!');
|
||||||
|
halt(1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
case De_type of
|
||||||
|
|
||||||
|
TITRE :
|
||||||
|
begin
|
||||||
|
{1Šre ligne:}
|
||||||
|
|
||||||
|
{On code la taille de la 1Šre ligne chaŒne:}
|
||||||
|
Code:=(length(Chaine) shl 1) or $80;
|
||||||
|
blockwrite(Fichier,Code,1);
|
||||||
|
|
||||||
|
{On code la 1Šre ligne de la chaŒne selon la table des caractŠres}
|
||||||
|
{de titrage:}
|
||||||
|
for Indice:=1 to length(Chaine) do
|
||||||
|
begin
|
||||||
|
Code:=TABLE_TITRE[ord(Chaine[Indice])];
|
||||||
|
blockwrite(Fichier,Code,1);
|
||||||
|
inc(Code);
|
||||||
|
blockwrite(Fichier,Code,1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{On met … jour les compteurs:}
|
||||||
|
inc(Nombre_de_lignes_d_aide);
|
||||||
|
inc(Nombre_d_octets_utilises,(length(Chaine) shl 1)+1);
|
||||||
|
|
||||||
|
{2Šme ligne:}
|
||||||
|
|
||||||
|
{On code la taille de la 2Šme ligne chaŒne:}
|
||||||
|
Code:=(length(Chaine) shl 1) or $80;
|
||||||
|
blockwrite(Fichier,Code,1);
|
||||||
|
|
||||||
|
{On code la 2Šme ligne de la chaŒne selon la table des caractŠres}
|
||||||
|
{de titrage:}
|
||||||
|
for Indice:=1 to length(Chaine) do
|
||||||
|
begin
|
||||||
|
Code:=TABLE_TITRE[ord(Chaine[Indice])];
|
||||||
|
if Chaine[Indice] in ['A'..'V']
|
||||||
|
then inc(Code,44)
|
||||||
|
else inc(Code,40);
|
||||||
|
|
||||||
|
blockwrite(Fichier,Code,1);
|
||||||
|
inc(Code);
|
||||||
|
blockwrite(Fichier,Code,1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{On met … jour les compteurs:}
|
||||||
|
inc(Nombre_de_lignes_d_aide);
|
||||||
|
inc(Nombre_d_octets_utilises,(length(Chaine) shl 1)+1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
SOUS_TITRE :
|
||||||
|
begin
|
||||||
|
{On code la taille de la chaŒne:}
|
||||||
|
Code:=length(Chaine);
|
||||||
|
blockwrite(Fichier,Code,1);
|
||||||
|
|
||||||
|
{On code la chaŒne selon la table des sous-titres:}
|
||||||
|
for Indice:=1 to length(Chaine) do
|
||||||
|
begin
|
||||||
|
Code:=TABLE_SOUS_TITRE[ord(Chaine[Indice])];
|
||||||
|
blockwrite(Fichier,Code,1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{On met … jour les compteurs:}
|
||||||
|
inc(Nombre_de_lignes_d_aide);
|
||||||
|
inc(Nombre_d_octets_utilises,length(Chaine)+1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
NORMAL :
|
||||||
|
begin
|
||||||
|
{On code la taille de la chaŒne:}
|
||||||
|
Code:=length(Chaine);
|
||||||
|
blockwrite(Fichier,Code,1);
|
||||||
|
|
||||||
|
{On code la chaŒne selon la table des caractŠres normaux:}
|
||||||
|
for Indice:=1 to length(Chaine) do
|
||||||
|
begin
|
||||||
|
Code:=TABLE_NORMAL[ord(Chaine[Indice])];
|
||||||
|
blockwrite(Fichier,Code,1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{On met … jour les compteurs:}
|
||||||
|
inc(Nombre_de_lignes_d_aide);
|
||||||
|
inc(Nombre_d_octets_utilises,length(Chaine)+1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{$I HLP_GRET}
|
||||||
|
{$I HLP_CRDT}
|
||||||
|
{$I HLP_RGST}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
XMODE;
|
||||||
|
|
||||||
|
Load_PKM('GFX2.PKM');
|
||||||
|
|
||||||
|
assign(Fichier,'GFX2.DAT');
|
||||||
|
rewrite(Fichier,1);
|
||||||
|
init_eo;
|
||||||
|
|
||||||
|
Crypt_curseur:=1;
|
||||||
|
|
||||||
|
Ecrire_palette(Fichier);
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 1, 1,254, 44); {Menu}
|
||||||
|
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 2, 47, 15, 60); {Shade}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 19, 47, 32, 60); {Colorize}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 36, 47, 49, 60); {Smooth}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 53, 47, 66, 60); {Tiling}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 70, 47, 83, 60); {Stencil}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 87, 47,100, 60); {Sieve}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,104, 47,117, 60); {Grid}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,121, 47,134, 60); {Mask}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,138, 47,151, 60); {Smear}
|
||||||
|
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 1, 85, 15, 99); {Fleche}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 17, 85, 31, 99); {Viseur}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 65, 85, 79, 99); {Viseur pipette}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 33, 85, 47, 99); {Sablier}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 49, 85, 63, 99); {Multidirectionnel}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 81, 85, 95, 99); {Horizontal}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 97, 85,111, 99); {Viseur fin}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,113, 85,127, 99); {Viseur pipette fin}
|
||||||
|
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 2,102, 15,115); {Dessin continu}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 19,102, 32,115); {Dessin interrompu}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 36,102, 49,115); {Dessin point}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 53,102, 66,115); {Pinceau-brosse}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 70,102, 83,115); {Courbe 3 pts}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 87,102,100,115); {Courbe 4 pts}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,104,102,117,115); {Ligne}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,121,102,134,115); {K-Line}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,138,102,151,115); {Lignes concentiques}
|
||||||
|
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 1,120, 16,135); {Pinceau 1}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 18,120, 33,135); {Pinceau 2}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 35,120, 50,135); {Pinceau 3}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 52,120, 67,135); {Pinceau 4}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 69,120, 84,135); {Pinceau 5}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 86,120,101,135); {Pinceau 6}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,103,120,118,135); {Pinceau 7}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,120,120,135,135); {Pinceau 8}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,137,120,152,135); {Pinceau 9}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,154,120,169,135); {Pinceau 10}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,171,120,186,135); {Pinceau 11}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,188,120,203,135); {Pinceau 12}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 1,137, 16,152); {Pinceau 13}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 18,137, 33,152); {Pinceau 14}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 35,137, 50,152); {Pinceau 15}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 52,137, 67,152); {Pinceau 16}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 69,137, 84,152); {Pinceau 17}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 86,137,101,152); {Pinceau 18}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,103,137,118,152); {Pinceau 19}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,120,137,135,152); {Pinceau 20}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,137,137,152,152); {Pinceau 21}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,154,137,169,152); {Pinceau 22}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,171,137,186,152); {Pinceau 23}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,188,137,203,152); {Pinceau 24}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 1,154, 16,169); {Pinceau 25}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 18,154, 33,169); {Pinceau 26}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 35,154, 50,169); {Pinceau 27}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 52,154, 67,169); {Pinceau 28}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 69,154, 84,169); {Pinceau 29}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 86,154,101,169); {Pinceau 30}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,103,154,118,169); {Pinceau 31}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,120,154,135,169); {Pinceau 32}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,137,154,152,169); {Pinceau 33}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,154,154,169,169); {Pinceau 34}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,171,154,186,169); {Pinceau 35}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,188,154,203,169); {Pinceau 36}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 1,171, 16,186); {Pinceau 37}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 18,171, 33,186); {Pinceau 38}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 35,171, 50,186); {Pinceau 39}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 52,171, 67,186); {Pinceau 40}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 69,171, 84,186); {Pinceau 41}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 86,171,101,186); {Pinceau 42}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,103,171,118,186); {Pinceau 43}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,120,171,135,186); {Pinceau 44}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,137,171,152,186); {Pinceau 45}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,154,171,169,186); {Pinceau 46}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,171,171,186,186); {Pinceau 47}
|
||||||
|
Lire_et_ecrire_sprite(Fichier,188,171,203,186); {Pinceau 48}
|
||||||
|
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 1,188, 7,194); {Diskette 3"«}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 9,188, 15,194); {Diskette 5"¬}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 17,188, 23,194); {HDD}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 25,188, 31,194); {CD-ROM}
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 33,188, 39,194); {Network}
|
||||||
|
|
||||||
|
Lire_et_ecrire_sprite(Fichier, 1,213,231,268); {Logo GrafX2}
|
||||||
|
|
||||||
|
Ecrire_trames_predefinies(Fichier);
|
||||||
|
|
||||||
|
Rajouter_fichier(Fichier,'FONTE1.FNT',true); {Fonte systŠme}
|
||||||
|
|
||||||
|
Rajouter_fichier(Fichier,'FONTE2.FNT',true); {Fonte exotique}
|
||||||
|
|
||||||
|
Load_PKM('FONTS.PKM');
|
||||||
|
|
||||||
|
Coder_partie_de_fonte(Fichier,0,121,45); {Petites fontes}
|
||||||
|
Coder_partie_de_fonte(Fichier,0,129,45);
|
||||||
|
Coder_partie_de_fonte(Fichier,0,137,45);
|
||||||
|
Coder_partie_de_fonte(Fichier,0,145,12);
|
||||||
|
Coder_partie_de_fonte(Fichier,0,153,44); {Grosse fonte}
|
||||||
|
Coder_partie_de_fonte(Fichier,0,161,44);
|
||||||
|
Coder_partie_de_fonte(Fichier,0,169,40);
|
||||||
|
Coder_partie_de_fonte(Fichier,0,177,40);
|
||||||
|
|
||||||
|
close_eo(Fichier);
|
||||||
|
close (Fichier);
|
||||||
|
|
||||||
|
asm
|
||||||
|
mov ax,3
|
||||||
|
int 10h
|
||||||
|
end;
|
||||||
|
|
||||||
|
Generer_l_aide_Credits;
|
||||||
|
Generer_l_aide_Register;
|
||||||
|
Generer_l_aide_Greetings;
|
||||||
|
|
||||||
|
|
||||||
|
reset(Fichier,1);
|
||||||
|
seek(Fichier,filesize(Fichier));
|
||||||
|
init_eo;
|
||||||
|
Rajouter_fichier(Fichier,'GFX2.INI',false);
|
||||||
|
close_eo(Fichier);
|
||||||
|
|
||||||
|
writeln('Le fichier GFX2.DAT est cr‚‚. (taille = ',filesize(Fichier),' octets)');
|
||||||
|
close(Fichier);
|
||||||
|
END.
|
||||||
3
dat/MAKEFNT.BAT
Normal file
3
dat/MAKEFNT.BAT
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
@echo off
|
||||||
|
img2fnt fonts fonte1
|
||||||
|
img2fnt fonts fonte2 17280
|
||||||
BIN
dat/MKGREETS.EXE
Normal file
BIN
dat/MKGREETS.EXE
Normal file
Binary file not shown.
105
dat/MKGREETS.PAS
Normal file
105
dat/MKGREETS.PAS
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
program mkgreets;
|
||||||
|
|
||||||
|
const
|
||||||
|
NB_MAX_LIGNES=50;
|
||||||
|
TAILLE_MAX_NICK=14;
|
||||||
|
|
||||||
|
var
|
||||||
|
Fichier : text;
|
||||||
|
Greets : array[0..3,0..NB_MAX_LIGNES-1] of string[TAILLE_MAX_NICK];
|
||||||
|
Total_nicks: word;
|
||||||
|
|
||||||
|
{-----------------------------}
|
||||||
|
|
||||||
|
procedure Init_greets;
|
||||||
|
var
|
||||||
|
i,j:word;
|
||||||
|
begin
|
||||||
|
for i:=0 to 3 do
|
||||||
|
for j:=0 to NB_MAX_LIGNES-1 do
|
||||||
|
Greets[i,j]:='';
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-----------------------------}
|
||||||
|
|
||||||
|
procedure Compter_greets;
|
||||||
|
var
|
||||||
|
Temp:String;
|
||||||
|
begin
|
||||||
|
Total_nicks:=0;
|
||||||
|
while not eof(Fichier) do
|
||||||
|
begin
|
||||||
|
readln(Fichier,Temp);
|
||||||
|
inc(Total_nicks);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-----------------------------}
|
||||||
|
|
||||||
|
procedure Lire_greets;
|
||||||
|
var
|
||||||
|
Nb_nicks:word;
|
||||||
|
begin
|
||||||
|
Nb_nicks:=0;
|
||||||
|
while not eof(Fichier) do
|
||||||
|
begin
|
||||||
|
readln(Fichier,Greets[Nb_nicks div Total_nicks, Nb_nicks mod Total_nicks]);
|
||||||
|
inc(Nb_nicks);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-----------------------------}
|
||||||
|
|
||||||
|
procedure Ecrire_greets;
|
||||||
|
var
|
||||||
|
i:word;
|
||||||
|
begin
|
||||||
|
writeln(Fichier,'{');
|
||||||
|
writeln(Fichier,' Ce fichier contient la partie "Greetings ..." de l''aide de GRAFX 2');
|
||||||
|
writeln(Fichier,'}');
|
||||||
|
writeln(Fichier,'');
|
||||||
|
writeln(Fichier,'procedure Generer_l_aide_Greetings;');
|
||||||
|
writeln(Fichier,'begin');
|
||||||
|
writeln(Fichier,' Demarrer_section_d_aide;');
|
||||||
|
writeln(Fichier,' {XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}');
|
||||||
|
writeln(Fichier,' {XXXXXXXXXXXXXXXXXXXXXX}');
|
||||||
|
writeln(Fichier,' Ecrire_ligne_d_aide(T,''GREETINGS:'');');
|
||||||
|
writeln(Fichier,' Ecrire_ligne_d_aide(N,'''');');
|
||||||
|
writeln(Fichier,' Ecrire_ligne_d_aide(N,''Our best regards go to...'');');
|
||||||
|
writeln(Fichier,' Ecrire_ligne_d_aide(N,'''');');
|
||||||
|
|
||||||
|
for i:=0 to Total_nicks-1 do
|
||||||
|
begin
|
||||||
|
write(Fichier,' Ecrire_ligne_d_aide(N,'' ',Greets[0,i]);
|
||||||
|
if (Greets[1,i]<>'') then
|
||||||
|
write(Fichier,' ':TAILLE_MAX_NICK-length(Greets[0,i]),Greets[1,i]);
|
||||||
|
if (Greets[2,i]<>'') then
|
||||||
|
write(Fichier,' ':TAILLE_MAX_NICK-length(Greets[1,i]),Greets[2,i]);
|
||||||
|
writeln(Fichier,''');');
|
||||||
|
end;
|
||||||
|
|
||||||
|
writeln(Fichier,' Ecrire_ligne_d_aide(N,'' and all #pixel, #demofr and #coders.'');');
|
||||||
|
writeln(Fichier,' {XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}');
|
||||||
|
writeln(Fichier,' {XXXXXXXXXXXXXXXXXXXXXX}');
|
||||||
|
writeln(Fichier,' Terminer_section_d_aide;');
|
||||||
|
writeln(Fichier,'end;');
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-----------------------------}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Init_greets;
|
||||||
|
assign(Fichier,'greets.txt');
|
||||||
|
reset(Fichier);
|
||||||
|
Compter_greets;
|
||||||
|
Total_nicks:=(Total_nicks+2) div 3;
|
||||||
|
|
||||||
|
reset(Fichier);
|
||||||
|
Lire_greets;
|
||||||
|
close(Fichier);
|
||||||
|
|
||||||
|
assign(Fichier,'hlp_gret.pas');
|
||||||
|
rewrite(Fichier);
|
||||||
|
Ecrire_greets;
|
||||||
|
close(Fichier);
|
||||||
|
end.
|
||||||
259
dat/TABLES.PAS
Normal file
259
dat/TABLES.PAS
Normal file
@ -0,0 +1,259 @@
|
|||||||
|
{Ce fichier contient pour chaque type de fonte l'indice qu'il faut coder:}
|
||||||
|
|
||||||
|
const
|
||||||
|
|
||||||
|
TABLE_NORMAL:array[32..151] of byte =
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11,
|
||||||
|
12,
|
||||||
|
13,
|
||||||
|
14,
|
||||||
|
15,
|
||||||
|
16,
|
||||||
|
17,
|
||||||
|
18,
|
||||||
|
19,
|
||||||
|
20,
|
||||||
|
21,
|
||||||
|
22,
|
||||||
|
23,
|
||||||
|
24,
|
||||||
|
25,
|
||||||
|
26,
|
||||||
|
27,
|
||||||
|
28,
|
||||||
|
29,
|
||||||
|
30,
|
||||||
|
31,
|
||||||
|
32,
|
||||||
|
33,
|
||||||
|
34,
|
||||||
|
35,
|
||||||
|
36,
|
||||||
|
37,
|
||||||
|
38,
|
||||||
|
39,
|
||||||
|
40,
|
||||||
|
41,
|
||||||
|
42,
|
||||||
|
43,
|
||||||
|
44,
|
||||||
|
45,
|
||||||
|
46,
|
||||||
|
47,
|
||||||
|
48,
|
||||||
|
49,
|
||||||
|
50,
|
||||||
|
51,
|
||||||
|
52,
|
||||||
|
53,
|
||||||
|
54,
|
||||||
|
55,
|
||||||
|
56,
|
||||||
|
57,
|
||||||
|
58,
|
||||||
|
59,
|
||||||
|
60,
|
||||||
|
61,
|
||||||
|
0,
|
||||||
|
62,
|
||||||
|
63,
|
||||||
|
64,
|
||||||
|
65,
|
||||||
|
66,
|
||||||
|
67,
|
||||||
|
68,
|
||||||
|
69,
|
||||||
|
70,
|
||||||
|
71,
|
||||||
|
72,
|
||||||
|
73,
|
||||||
|
74,
|
||||||
|
75,
|
||||||
|
76,
|
||||||
|
77,
|
||||||
|
78,
|
||||||
|
79,
|
||||||
|
80,
|
||||||
|
81,
|
||||||
|
82,
|
||||||
|
83,
|
||||||
|
84,
|
||||||
|
85,
|
||||||
|
86,
|
||||||
|
87,
|
||||||
|
88,
|
||||||
|
89,
|
||||||
|
90,
|
||||||
|
91,
|
||||||
|
92,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
93,
|
||||||
|
94,
|
||||||
|
95,
|
||||||
|
96,
|
||||||
|
0,
|
||||||
|
97,
|
||||||
|
0,
|
||||||
|
98,
|
||||||
|
99,
|
||||||
|
100,
|
||||||
|
101,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
102,
|
||||||
|
0,
|
||||||
|
103,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
104,
|
||||||
|
105
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TABLE_SOUS_TITRE:array[32..90] of byte =
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
132,
|
||||||
|
133,
|
||||||
|
134,
|
||||||
|
135,
|
||||||
|
136,
|
||||||
|
137,
|
||||||
|
138,
|
||||||
|
139,
|
||||||
|
140,
|
||||||
|
141,
|
||||||
|
142,
|
||||||
|
143,
|
||||||
|
144,
|
||||||
|
145,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
146,
|
||||||
|
0,
|
||||||
|
106,
|
||||||
|
107,
|
||||||
|
108,
|
||||||
|
109,
|
||||||
|
110,
|
||||||
|
111,
|
||||||
|
112,
|
||||||
|
113,
|
||||||
|
114,
|
||||||
|
115,
|
||||||
|
116,
|
||||||
|
117,
|
||||||
|
118,
|
||||||
|
119,
|
||||||
|
120,
|
||||||
|
121,
|
||||||
|
122,
|
||||||
|
123,
|
||||||
|
124,
|
||||||
|
125,
|
||||||
|
126,
|
||||||
|
127,
|
||||||
|
128,
|
||||||
|
129,
|
||||||
|
130,
|
||||||
|
131
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TABLE_TITRE:array[32..90] of byte =
|
||||||
|
(
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
96,
|
||||||
|
98,
|
||||||
|
100,
|
||||||
|
102,
|
||||||
|
104,
|
||||||
|
106,
|
||||||
|
108,
|
||||||
|
110,
|
||||||
|
112,
|
||||||
|
114,
|
||||||
|
116,
|
||||||
|
118,
|
||||||
|
120,
|
||||||
|
122,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
126,
|
||||||
|
124,
|
||||||
|
126,
|
||||||
|
0, {A}
|
||||||
|
2, {B}
|
||||||
|
4, {C}
|
||||||
|
6, {D}
|
||||||
|
8, {E}
|
||||||
|
10, {F}
|
||||||
|
12, {G}
|
||||||
|
14, {H}
|
||||||
|
16, {I}
|
||||||
|
18, {J}
|
||||||
|
20, {K}
|
||||||
|
22, {L}
|
||||||
|
24, {M}
|
||||||
|
26, {N}
|
||||||
|
28, {O}
|
||||||
|
30, {P}
|
||||||
|
32, {Q}
|
||||||
|
34, {R}
|
||||||
|
36, {S}
|
||||||
|
38, {T}
|
||||||
|
40, {U}
|
||||||
|
42, {V}
|
||||||
|
88, {W}
|
||||||
|
90, {X}
|
||||||
|
92, {Y}
|
||||||
|
94 {Z}
|
||||||
|
);
|
||||||
|
|
||||||
289
dat/gfx2.ini
Normal file
289
dat/gfx2.ini
Normal file
@ -0,0 +1,289 @@
|
|||||||
|
###### GrafX2 initialization file ###### Fichier d'initialisation de GrafX2 ##
|
||||||
|
# # # #
|
||||||
|
# You may modify this file with any # Vous pouvez modifier ce fichier avec #
|
||||||
|
# standard ASCII text editor. # n'importe quel ‚diteur de texte #
|
||||||
|
# # ASCII standard. #
|
||||||
|
# # #
|
||||||
|
# Comments are preceded by ';' or # Les commentaires sont pr‚c‚d‚s par #
|
||||||
|
# '#'. # ';' ou '#'. #
|
||||||
|
# # #
|
||||||
|
# Options are not case sensitive and # Les options ne sont pas sensibles … #
|
||||||
|
# spaces are ignored. # la casse et les espaces sont ignor‚s.#
|
||||||
|
# # #
|
||||||
|
# You must not change the order of # Vous ne devez pas changer l'ordre #
|
||||||
|
# the sections and their options. # des sections et de leurs options. #
|
||||||
|
# You must not delete or put into # Vous ne devez pas effacer ou mettre #
|
||||||
|
# comment any section nor option. # en commentaire une section ou option.#
|
||||||
|
# # #
|
||||||
|
# Each option is preceded by a # Chaque option est pr‚c‚d‚e par un #
|
||||||
|
# comment which explains its meaning. # commentaire qui explique sa fonction.#
|
||||||
|
# # #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[MOUSE] # [SOURIS]
|
||||||
|
|
||||||
|
; The sensitivity of the mouse can ³ La sensibilit‚ de la souris peut
|
||||||
|
; take values from 1 to 64. The ³ prendre des valeurs de 1 … 64. Plus
|
||||||
|
; smaller values, the faster. ³ les valeurs sont petites, plus c'est
|
||||||
|
; ³ rapide.
|
||||||
|
X_sensitivity = 3 ; (default 3)
|
||||||
|
Y_sensitivity = 3 ; (default 3)
|
||||||
|
|
||||||
|
; Due to the fact that those stupid ³ A cause du fait que ces imb‚ciles de
|
||||||
|
; mouse drivers' makers don't care ³ programmeurs de gestionnaires de
|
||||||
|
; if the mouse moves by steps of 2, ³ souris se fichent que votre souris se
|
||||||
|
; 4 or even 8 pixels, we have to ³ deplace par pas de 2, 4 ou mˆme 8
|
||||||
|
; stretch the virtual area of the ³ pixels, nous devons ‚largir la zone
|
||||||
|
; mouse and divide coordinates to ³ virtuelle de la souris et diviser les
|
||||||
|
; get a one-pixel step motion. ³ coordonn‚es pour obtenir un pas de 1.
|
||||||
|
; (Warning: the mouse movement can ³ (Attention: le d‚placement de la
|
||||||
|
; be correct in some video modes ³ souris peut ˆtre correct dans certains
|
||||||
|
; but not in others... But all the ³ modes vid‚os mais pas dans d'autres...
|
||||||
|
; "Modes X" should behave the same ³ Mais tout les Modes X devraient se
|
||||||
|
; way, so you won't have to test ³ comporter de la mˆme maniŠre, donc
|
||||||
|
; them all). ³ vous n'aurez pas … tous les tester.
|
||||||
|
; A correction factor of 0 means ³ Un facteur de correction de 0 signifie
|
||||||
|
; that you are very lucky because ³ que vous avez de la chace car votre
|
||||||
|
; your driver doesn't need any ³ driver n'a pas besoin de correction.
|
||||||
|
; correction. If you set the ³ Si vous d‚finissez le facteur de
|
||||||
|
; correction factor to 1, it means ³ correction … 1, cela signifie que
|
||||||
|
; that your mouse moves by steps of ³ votre souris se d‚place par pas de 2
|
||||||
|
; 2 pixels; 2 for 4; 3 for 8, etc...³ pixels; 2 pour 4; 3 pour 8, etc...
|
||||||
|
; If you want to use GrafX2 in a ³ Si vous d‚sirez lancer GrafX2 dans une
|
||||||
|
; Win95 window, you should turn ³ fenˆtre Windows95, vous devriez passer
|
||||||
|
; these values to 0 (and increase X ³ ces valeurs … 0 (et augmenter les sen-
|
||||||
|
; and Y sensitivities above). ³ sibilit‚s X et Y d‚finies plus haut).
|
||||||
|
X_correction_factor = 3 ; (default 3)
|
||||||
|
Y_correction_factor = 3 ; (default 3)
|
||||||
|
|
||||||
|
; Aspect of the main cursor (cross) ³ Aspect du curseur principal (croix)
|
||||||
|
; 1: Solid ³ 1: Solide
|
||||||
|
; 2: Transparent ³ 2: Transparent
|
||||||
|
; 3: Thin (solid) ³ 3: Fin (solide)
|
||||||
|
Cursor_aspect = 1 ; (default 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[MENU] # [MENU]
|
||||||
|
|
||||||
|
; Colors of the menus (the black ³ Couleurs des menus (la couleur noire
|
||||||
|
; and the white colors cannot be ³ et la couleur blanche ne peuvent pas
|
||||||
|
; modified). ³ ˆtre modifi‚es).
|
||||||
|
; Values are in {Red,Green,Blue} ³ Les valeurs sont dans l'ordre {Rouge,
|
||||||
|
; order and are between 0 and 63. ³ Vert,Bleu} et vont de 0 … 63.
|
||||||
|
Light_color = 42,42,42 ; (default 42,42,42)
|
||||||
|
Dark_color = 27,27,27 ; (default 27,27,27)
|
||||||
|
;
|
||||||
|
; Light_color = 24,25,30 ; \_ Nightmare
|
||||||
|
; Dark_color = 13,14,19 ; /
|
||||||
|
;
|
||||||
|
; Light_color = 10,45,28 ; \_ Forest
|
||||||
|
; Dark_color = 5,27,12 ; /
|
||||||
|
;
|
||||||
|
; Light_color = 48,41,26 ; \_ Gold
|
||||||
|
; Dark_color = 26,22,15 ; /
|
||||||
|
;
|
||||||
|
; Light_color = 10,40,55 ; \_ Oceanic
|
||||||
|
; Dark_color = 10,20,32 ; /
|
||||||
|
|
||||||
|
; Aspect ratio and size of the ³ Proportion des menus et de la barre
|
||||||
|
; menus and the tool-bar. ³ d'outils.
|
||||||
|
; Possible values: ³ Valeurs possibles:
|
||||||
|
; 0: Do not adapt (pixels are not ³ 0: Ne pas adapter (les pixels ne sont
|
||||||
|
; stretched) ³ pas ‚tir‚s)
|
||||||
|
; 1: Adapt the menus and the tool- ³ 1: Adapter les menus et la barre
|
||||||
|
; bar according to the resolution³ d'outils suivant la r‚solution
|
||||||
|
; 2: Slightly adapt the ratio of ³ 2: Adapter l‚gŠrement les proportions
|
||||||
|
; the menus and tool-bar ³ des menus et de la barre d'outils
|
||||||
|
Menu_ratio = 1 ; (default 1)
|
||||||
|
|
||||||
|
; Font: ³ Police de caractŠres (fonte):
|
||||||
|
; 1: Classic ³ 1: Classique
|
||||||
|
; 2: Fun ³ 2: Fun
|
||||||
|
Font = 1 ; (default 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[FILE_SELECTOR] # [SELECTEUR_DE_FICHIERS]
|
||||||
|
|
||||||
|
; Show special files and ³ Afficher les fichiers et r‚pertoires
|
||||||
|
; directories (values are 'yes' or ³ sp‚ciaux (les valeurs sont 'yes' ou
|
||||||
|
; 'no'). ³ 'no').
|
||||||
|
Show_hidden_files = no ; (default 'no')
|
||||||
|
Show_hidden_directories = no ; (default 'no')
|
||||||
|
Show_system_directories = no ; (default 'no')
|
||||||
|
|
||||||
|
; Delay before displaying a preview ³ D‚lai avant d'afficher une preview
|
||||||
|
; in file-selectors (in 18.2th of ³ dans les s‚lecteurs de fichiers (en
|
||||||
|
; second). Possible values range ³ 18.2Šmes de seconde) Les valeurs
|
||||||
|
; from 1 to 256. ³ possibles vont de 1 … 256.
|
||||||
|
Preview_delay = 8 ; (default 8)
|
||||||
|
|
||||||
|
; Maximize the preview of the ³ Maximiser la preview des images pour
|
||||||
|
; pictures so that it is as big as ³ qu'elle soit aussi grande que
|
||||||
|
; possible. If you're not in the ³ possible.
|
||||||
|
; same resolution as the picture's ³ Si vous n'ˆtes pas dans la mˆme r‚so-
|
||||||
|
; one, it can try to correct the ³ lution que celle de l'image, cela peut
|
||||||
|
; aspect ratio, but if the picture ³ essayer de corriger les proportions,
|
||||||
|
; does not fill the whole screen, ³ mais si l'image ne prend pas tout
|
||||||
|
; it can be worse. ³ l'‚cran, cela peut ˆtre pire.
|
||||||
|
Maximize_preview = no ; (default 'no')
|
||||||
|
|
||||||
|
; This option is used to place the ³ Cette option est utilis‚e pour placer
|
||||||
|
; selection bar on a filename by ³ la barre de s‚lection sur un nom de
|
||||||
|
; typing its first letters. ³ fichier en tapant ses 1Šres lettres.
|
||||||
|
; For example, if you want to find ³ Par exemple, si vous voulez trouver le
|
||||||
|
; the "PICTURE.PKM" in a directory ³ fichier "PICTURE.PKM" dans un r‚per-
|
||||||
|
; that also contains "PALETTE.PAL", ³ toire contenant ‚galement le fichier
|
||||||
|
; you'll just have to type P and I. ³ "PALETTE.PAL", vous n'aurez qu'… taper
|
||||||
|
; The different values of "FFF" ³ P puis I.
|
||||||
|
; indicate if you want to find the ³ Les different valeurs de "FFF"
|
||||||
|
; name in both files and directories³ indiquent si vous voulez trouvez le nom
|
||||||
|
; or just in only one of these: ³ dans les fichiers ET les r‚pertoires ou
|
||||||
|
; 0: files and directories ³ simplement dans l'un OU l'autre.
|
||||||
|
; 1: files only ³ 0: fichiers et r‚pertoires
|
||||||
|
; 2: directories only ³ 1: fichiers seulement
|
||||||
|
; ³ 2: r‚pertoires seulement
|
||||||
|
Find_file_fast = 0 ; (default 0)
|
||||||
|
|
||||||
|
|
||||||
|
[LOADING] # [CHARGEMENT]
|
||||||
|
|
||||||
|
; Automatically set the resolution ³ Passer automatiquement dans la bonne
|
||||||
|
; when loading a picture. ³ r‚solution lors du chargement d'une
|
||||||
|
; You should set this value to ³ image.
|
||||||
|
; 'yes' after disabling the video ³ Vous devriez d‚finir cette option …
|
||||||
|
; modes that are not supported by ³ 'yes' aprŠs avoir inhib‚ les modes
|
||||||
|
; your video card or monitor. ³ vid‚o qui ne sont pas support‚s par
|
||||||
|
; ³ votre mat‚riel.
|
||||||
|
Auto_set_resolution = no ; (default 'no')
|
||||||
|
|
||||||
|
; If the variable above is set to ³ Si la variable ci-dessus est … 'yes',
|
||||||
|
; 'yes', this one tells if you want ³ celle-ci indique si vous voulez
|
||||||
|
; to set the resolution according ³ d‚finir la r‚solution suivant:
|
||||||
|
; to: ³ 1: les dimensions de "l'‚cran
|
||||||
|
; 1: the internal "original screen" ³ d'origine" internes … l'image
|
||||||
|
; dimensions of the picture ³ 2: les v‚ritables dimensions de
|
||||||
|
; 2: the actual dimensions of the ³ l'image
|
||||||
|
; picture ³
|
||||||
|
Set_resolution_according_to = 1 ; (default 1)
|
||||||
|
|
||||||
|
; If you load a picture with a ³ Si vous chargez une image ayant une
|
||||||
|
; palette of less than 256 colors, ³ palette de moins de 256 couleurs,
|
||||||
|
; this option defines if you want ³ cette option indique si vous souhaitez
|
||||||
|
; to clear the palette or to keep ³ effacer la palette ou bien conserver
|
||||||
|
; the colors of the previous ³ les couleurs de l'image pr‚c‚dente qui
|
||||||
|
; picture that are over the number ³ se situent au-del… du nombre de la
|
||||||
|
; of colors of the new picture. ³ nouvelle image.
|
||||||
|
; For example, if you load a ³ Par exemple, si vous chargez une image
|
||||||
|
; 32-color picture, the colors 32 ³ de 32 couleurs, les couleurs 32 … 255
|
||||||
|
; to 255 will be set to black if ³ seront pass‚es en noir si cette option
|
||||||
|
; this option is set to 'yes', or ³ est … 'yes', ou bien elles resteront
|
||||||
|
; they will be kept unchanged if ³ inchang‚es si elle est … 'no'.
|
||||||
|
; this option is set to 'no'. ³
|
||||||
|
Clear_palette = yes ; (default 'yes')
|
||||||
|
|
||||||
|
|
||||||
|
[MISCELLANEOUS] # [DIVERS]
|
||||||
|
|
||||||
|
; Draw the limits of the picture. ³ Afficher les limites de l'image
|
||||||
|
Draw_limits = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Adjust the brush grabbing in ³ Ajuster la capture de brosse en mode
|
||||||
|
; "grid" mode. ³ "grille".
|
||||||
|
Adjust_brush_pick = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Coordinates: ³ Coordonn‚es:
|
||||||
|
; 1: Relative ³ 1: Relatives
|
||||||
|
; 2: Absolute ³ 2: Absolues
|
||||||
|
Coordinates = 1 ; (default 1)
|
||||||
|
|
||||||
|
; Create a backup file when saving. ³ Cr‚er un fichier backup lors des
|
||||||
|
; ³ sauvegardes.
|
||||||
|
Backup = no ; (default 'no')
|
||||||
|
|
||||||
|
; Number of pages stored in memory ³ Nombre de pages stock‚es en m‚moire
|
||||||
|
; for "undoing". ³ destin‚es … annuler les derniŠres
|
||||||
|
; Values are between 1 and 99. ³ modifications. Valeurs entre 1 et 99.
|
||||||
|
Undo_pages = 1 ; (default 1)
|
||||||
|
|
||||||
|
; Speed of the scroll-bars (in VBLs ³ Vitesse des barre de d‚filement (en
|
||||||
|
; waited) while clicking with the ³ VBLs attendus) lorsque l'un des
|
||||||
|
; left or right button of the mouse.³ boutons de la souris est enfonc‚.
|
||||||
|
; Values can be between 1 and 255. ³ Les valeurs sont comprises entre 1 et
|
||||||
|
; The bigger values, the slower. ³ 255. Plus elles sont grandes, plus
|
||||||
|
; ³ c'est lent.
|
||||||
|
Gauges_scrolling_speed_Left = 10 ; (default 10)
|
||||||
|
Gauges_scrolling_speed_Right = 3 ; (default 3)
|
||||||
|
|
||||||
|
; Automatically save the configu- ³ Enregistre automatiquement la configu-
|
||||||
|
; ration when exiting the program. ³ ration lorsqu'on quitte le programme.
|
||||||
|
Auto_save = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Maximum number of vertices used ³ Nombre maximum de vertex utilis‚s dans
|
||||||
|
; in filled polygons and polyforms, ³ les polyg“nes et polyformes pleins, et
|
||||||
|
; and lasso. Possible values range ³ le lasso. Les valeurs possibles vont
|
||||||
|
; from 2 to 16384. ³ de 2 … 16384.
|
||||||
|
; Each vertex takes 4 bytes. ³ Chaque vertex prend 4 octets.
|
||||||
|
Vertices_per_polygon = 1024 ; (default 1024)
|
||||||
|
|
||||||
|
; Automatically zoom into the ³ Zoomer automatiquement la zone point‚e
|
||||||
|
; pointed area when you press the ³ par la souris lorsque vous appuyez sur
|
||||||
|
; short-key of the Magnifier button ³ la touche de raccourci de la loupe.
|
||||||
|
; while being above the picture. ³
|
||||||
|
Fast_zoom = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Separate the colors in the tool- ³ S‚parer les couleurs dans la barre
|
||||||
|
; bar by a black squaring. ³ d'outils par un quadrillage noir.
|
||||||
|
Separate_colors = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Initial value of the feedback for ³ Valeur initiale du "feedback" pour les
|
||||||
|
; the drawing modes (cf. docs). ³ modes de dessin (cf. docs).
|
||||||
|
FX_feedback = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; When you reduce the palette or ³ Si vous r‚duisez la palette ou "zappez"
|
||||||
|
; "zap" some colors out of it, it is³ quelques couleurs, il est possible
|
||||||
|
; possible that there are not enough³ qu'il ne reste pas assez de couleurs
|
||||||
|
; colors left to draw the menus. ³ pour afficher les menus. Mettre cette
|
||||||
|
; Switching the following variable ³ variable … 'yes' ramŠnera automatiquent
|
||||||
|
; on will bring back the colors of ³ les couleurs du menu s'il reste moins
|
||||||
|
; the menu if there are less than 4 ³ de 4 couleurs aprŠs une "r‚duction" ou
|
||||||
|
; colors left after "reducing" or ³ un "zapping".
|
||||||
|
; "zapping". ³
|
||||||
|
Safety_colors = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Display a message at startup ³ Afficher un message au d‚marrage
|
||||||
|
; telling the version number of the ³ indiquant le num‚ro de version du
|
||||||
|
; program. ³ programme.
|
||||||
|
Opening_message = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Take the Stencil into account when³ Prendre le Stencil en compte lorsqu'on
|
||||||
|
; clearing the image. ³ efface l'image.
|
||||||
|
Clear_with_stencil = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Directly set the discontinuous ³ Passer automatiquement en mode de
|
||||||
|
; freehand drawing mode after brush ³ dessin discontinu aprŠs la prise d'une
|
||||||
|
; grabbing. ³ brosse.
|
||||||
|
Auto_discontinuous = no ; (default 'no')
|
||||||
|
|
||||||
|
; Save the screen dimensions in GIF ³ Sauver les dimensions de l'‚cran dans
|
||||||
|
; files. If you want to read these ³ les fichiers GIF. Si vous voulez lire
|
||||||
|
; files with Photoshop or Alchemy, ³ ces fichiers avec Photoshop ou Alchemy,
|
||||||
|
; and maybe some other programs, you³ et peut-ˆtre d'autres programmes, vous
|
||||||
|
; must set this option to 'no'. ³ devez mettre cette option … 'no'.
|
||||||
|
Save_screen_size_in_GIF = no ; (default 'no')
|
||||||
|
|
||||||
|
; Automaticaly count the number of ³ Compter automatiquement le nombre de
|
||||||
|
; different colors used when opening³ couleurs diff‚rentes utilis‚es lors de
|
||||||
|
; the palette editor window. (Set it³ d'ouverture de la fenˆtre d'‚dition de
|
||||||
|
; to 'no' if you have a slow PC or ³ la palette. (Mettez-le … 'no' si vous
|
||||||
|
; if you edit huge pictures) ³ avez un PC lent ou bien si vous ‚ditez
|
||||||
|
; ³ d'‚normes images).
|
||||||
|
Auto_nb_colors_used = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Number of the default video mode ³ Num‚ro du mode vid‚o par d‚faut au
|
||||||
|
; at startup (see the list by typing³ d‚marrage (voir la liste en tapant
|
||||||
|
; "gfx2 /?" at the DOS prompt). ³ "gfx2 /?" sur la ligne de commande).
|
||||||
|
Default_video_mode = 0 ; (default 0)
|
||||||
93
divers.c
Normal file
93
divers.c
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
#include <SDL/SDL.h>
|
||||||
|
|
||||||
|
#include "struct.h"
|
||||||
|
#include "sdlscreen.h"
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
word Palette_Compter_nb_couleurs_utilisees(dword* Tableau)
|
||||||
|
{
|
||||||
|
int Nombre_De_Pixels=0; //ECX
|
||||||
|
Uint8* Pixel_Courant=Ecran; //ESI
|
||||||
|
Uint8 Couleur; //AL/EAX
|
||||||
|
word Nombre_Couleurs=0;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Calcul du nombre de pixels dans l'image
|
||||||
|
Nombre_De_Pixels=Principal_Hauteur_image*Principal_Largeur_image;
|
||||||
|
|
||||||
|
// On parcourt l'‚cran courant pour compter les utilisations des couleurs
|
||||||
|
for(i=0;i++;i>Nombre_De_Pixels)
|
||||||
|
{
|
||||||
|
Couleur=*Pixel_Courant; //on lit la couleur dans l'écran
|
||||||
|
|
||||||
|
Tableau[Couleur]++; //Un point de plus pour cette couleur
|
||||||
|
|
||||||
|
// On passe au pixel suivant
|
||||||
|
Pixel_Courant++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//On va maintenant compter dans la table les couleurs utilis‚es:
|
||||||
|
|
||||||
|
Couleur=0; //EDX
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (Tableau[Couleur]!=0)
|
||||||
|
Nombre_Couleurs++;
|
||||||
|
|
||||||
|
Couleur++;
|
||||||
|
|
||||||
|
}while (Couleur<256);
|
||||||
|
|
||||||
|
return Nombre_Couleurs;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Set_palette(T_Palette Palette)
|
||||||
|
{
|
||||||
|
SDL_SetPalette(Ecran, SDL_LOGPAL|SDL_PHYSPAL, Palette, 0, 256);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Attendre_fin_de_click(void)
|
||||||
|
{
|
||||||
|
do
|
||||||
|
SDL_PumpEvents();
|
||||||
|
while (SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Effacer_image_courante_Stencil(byte Couleur, byte * Pochoir)
|
||||||
|
//Effacer l'image courante avec une certaine couleur en mode Stencil
|
||||||
|
{
|
||||||
|
int Nombre_De_Pixels=0; //ECX
|
||||||
|
//al=Couleur
|
||||||
|
//edi=Ecran
|
||||||
|
Uint8* Pixel_Courant=Ecran; //dl
|
||||||
|
int i;
|
||||||
|
|
||||||
|
Nombre_De_Pixels=Principal_Hauteur_image*Principal_Largeur_image;
|
||||||
|
|
||||||
|
for(i=0;i++;i<Nombre_De_Pixels)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (Pochoir[*Pixel_Courant]=0);
|
||||||
|
*Pixel_Courant=Couleur;
|
||||||
|
Pixel_Courant++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Effacer_image_courante(byte Couleur)
|
||||||
|
// Effacer l'image courante avec une certaine couleur
|
||||||
|
{
|
||||||
|
SDL_FillRect(Ecran,NULL,Couleur);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Sensibilite_souris(word X,word Y)
|
||||||
|
{;//TODO Implémenter la sensibilité souris
|
||||||
|
}
|
||||||
|
|
||||||
|
void Get_input(void)
|
||||||
|
{
|
||||||
|
SDL_PollEvent(Evenement_SDL);
|
||||||
|
}
|
||||||
|
|
||||||
133
divers.h
Normal file
133
divers.h
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
void Effacer_ecran_courant(void);
|
||||||
|
void Copier_ecran_sur_brouillon(void);
|
||||||
|
void Copier_image_dans_brosse(short Debut_X,short Debut_Y,short Brosse_Largeur,short Brosse_Hauteur,word Largeur_image);
|
||||||
|
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);
|
||||||
|
void Set_palette(T_Palette Palette);
|
||||||
|
void Palette_256_to_64(T_Palette Palette);
|
||||||
|
void Palette_64_to_256(T_Palette Palette);
|
||||||
|
void Effacer_image_courante(byte Couleur);
|
||||||
|
void Effacer_image_courante_Stencil(byte Couleur, byte * Pochoir);
|
||||||
|
void Wait_VBL(void);
|
||||||
|
void Tempo_jauge(byte Vitesse);
|
||||||
|
dword Round_div(dword Numerateur,dword Diviseur);
|
||||||
|
word Palette_Compter_nb_couleurs_utilisees(dword * Tableau);
|
||||||
|
byte Get_key(void);
|
||||||
|
|
||||||
|
void Pixel_dans_ecran_courant (word X,word Y,byte Couleur);
|
||||||
|
void Pixel_dans_brosse (word X,word Y,byte Couleur);
|
||||||
|
byte Lit_pixel_dans_ecran_courant (word X,word Y);
|
||||||
|
byte Lit_pixel_dans_ecran_brouillon(word X,word Y);
|
||||||
|
byte Lit_pixel_dans_ecran_backup (word X,word Y);
|
||||||
|
byte Lit_pixel_dans_ecran_feedback (word X,word Y);
|
||||||
|
byte Lit_pixel_dans_brosse (word X,word Y);
|
||||||
|
|
||||||
|
long Freespace(byte Numero_de_lecteur);
|
||||||
|
// Numero_de_lecteur = 0 : Disque courant
|
||||||
|
// 1 : lecteur A:
|
||||||
|
// 2 : lecteur B:
|
||||||
|
// 3 : lecteur C:
|
||||||
|
// ... : ...
|
||||||
|
//
|
||||||
|
// R‚sultat = -1 si lecteur invalide, taille disponible sinon
|
||||||
|
|
||||||
|
byte Type_de_lecteur_de_disquette(byte Numero_de_lecteur);
|
||||||
|
// Numero_de_lecteur compris entre 0 et 3 (4 lecteurs de disquettes)
|
||||||
|
//
|
||||||
|
// R‚sultat = 0 : Pas de lecteur
|
||||||
|
// 1 : Lecteur 360 Ko
|
||||||
|
// 2 : Lecteur 1.2 Mo
|
||||||
|
// 3 : Lecteur 720 Ko
|
||||||
|
// 4 : Lecteur 1.4 Mo
|
||||||
|
// 5 : Lecteur 2.8 Mo (??? pas sur ???)
|
||||||
|
// 6 : Lecteur 2.8 Mo
|
||||||
|
|
||||||
|
byte Disk_map(byte Numero_de_lecteur);
|
||||||
|
// Renseigne sur la lettre logique d'un lecteur
|
||||||
|
// (utile pour tester si un lecteur de disquette est A: ou B: aux yeux du DOS)
|
||||||
|
//
|
||||||
|
// Entr‚e: Octet = nø du lecteur (1=A, 2=B ...)
|
||||||
|
//
|
||||||
|
// Sortie: Octet = 0FFh : Pas de lecteur (???)
|
||||||
|
// sinon: num‚ro repr‚sentant la lettre logique du lecteur
|
||||||
|
// (commence … 1)
|
||||||
|
|
||||||
|
byte Disque_dur_present(byte Numero_de_disque);
|
||||||
|
// Numero_de_disque = 0:C, 1:D, 2:E, ...
|
||||||
|
//
|
||||||
|
// R‚sultat = 0 : Pas de disque dur pr‚sent
|
||||||
|
// 1 : Disque dur pr‚sent
|
||||||
|
|
||||||
|
byte Lecteur_CDROM_present(byte Numero_de_lecteur);
|
||||||
|
// Numero_de_lecteur = 0 : lecteur A:
|
||||||
|
// 1 : lecteur B:
|
||||||
|
// 2 : lecteur C:
|
||||||
|
// ... : ...
|
||||||
|
//
|
||||||
|
// R‚sultat = 0 : Pas de lecteur CD-ROM pr‚sent
|
||||||
|
// 1 : Lecteur CD-ROM pr‚sent
|
||||||
|
|
||||||
|
|
||||||
|
void Ellipse_Calculer_limites(short Rayon_horizontal,short Rayon_vertical);
|
||||||
|
// Calcule les valeurs suivantes en fonction des deux paramŠtres:
|
||||||
|
//
|
||||||
|
// Ellipse_Rayon_vertical_au_carre
|
||||||
|
// Ellipse_Rayon_horizontal_au_carre
|
||||||
|
// Ellipse_Limite_High
|
||||||
|
// Ellipse_Limite_Low
|
||||||
|
|
||||||
|
|
||||||
|
byte Pixel_dans_ellipse(void);
|
||||||
|
// Indique si le pixel se trouvant … Ellipse_Curseur_X pixels
|
||||||
|
// (Ellipse_Curseur_X>0 = … droite, Ellipse_Curseur_X<0 = … gauche) et …
|
||||||
|
// Ellipse_Curseur_Y pixels (Ellipse_Curseur_Y>0 = en bas,
|
||||||
|
// Ellipse_Curseur_Y<0 = en haut) du centre se trouve dans l'ellipse en
|
||||||
|
// cours.
|
||||||
|
|
||||||
|
byte Pixel_dans_cercle(void);
|
||||||
|
// Indique si le pixel se trouvant … Cercle_Curseur_X pixels
|
||||||
|
// (Cercle_Curseur_X>0 = … droite, Cercle_Curseur_X<0 = … gauche) et …
|
||||||
|
// Cercle_Curseur_Y pixels (Cercle_Curseur_Y>0 = en bas,
|
||||||
|
// Cercle_Curseur_Y<0 = en haut) du centre se trouve dans le cercle en
|
||||||
|
// cours.
|
||||||
|
|
||||||
|
byte Bit(byte Octet, byte Rang);
|
||||||
|
// Extrait un bit d'un certain rang … partir d'un octet.
|
||||||
|
|
||||||
|
byte Couleur_ILBM_line(word Pos_X, word Vraie_taille_ligne);
|
||||||
|
// Renvoie la couleur du pixel (ILBM) en Pos_X.
|
||||||
|
|
||||||
|
// Gestion du chrono dans les fileselects
|
||||||
|
void Initialiser_chrono(long Delai);
|
||||||
|
void Tester_chrono(void);
|
||||||
|
|
||||||
|
void Remplacer_une_couleur(byte Ancienne_couleur, byte Nouvelle_couleur);
|
||||||
|
void Remplacer_toutes_les_couleurs_dans_limites(byte * Table_de_remplacement);
|
||||||
|
|
||||||
|
byte Meilleure_couleur(byte Rouge,byte Vert,byte Bleu);
|
||||||
|
byte Meilleure_couleur_sans_exclusion(byte Rouge,byte Vert,byte Bleu);
|
||||||
|
|
||||||
|
byte Effet_Colorize_interpole (word X,word Y,byte Couleur);
|
||||||
|
byte Effet_Colorize_additif (word X,word Y,byte Couleur);
|
||||||
|
byte Effet_Colorize_soustractif(word X,word Y,byte Couleur);
|
||||||
|
byte Effet_Trame(word X,word Y);
|
||||||
|
|
||||||
|
void Flip_Y_LOWLEVEL(void);
|
||||||
|
void Flip_X_LOWLEVEL(void);
|
||||||
|
void Rotate_90_deg_LOWLEVEL(byte * Source,byte * Destination);
|
||||||
|
void Rotate_180_deg_LOWLEVEL(void);
|
||||||
|
void Zoomer_une_ligne(byte * Ligne_originale,byte * Ligne_zoomee,word Facteur,word Largeur);
|
||||||
|
void Copier_une_partie_d_image_dans_une_autre(byte * Source,word S_Pos_X,word S_Pos_Y,word Largeur,word Hauteur,word Largeur_source,byte * Destination,word D_Pos_X,word D_Pos_Y,word Largeur_destination);
|
||||||
384
doc/Le moteur des opérations.html
Normal file
384
doc/Le moteur des opérations.html
Normal file
@ -0,0 +1,384 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<BASE HREF="http://www-msi.ensil.unilim.fr/~maritaud/sunset/GrafX2-fra-OpEngine.html">
|
||||||
|
|
||||||
|
<meta http-equiv="Content-Type"
|
||||||
|
content="text/html; charset=iso-8859-1">
|
||||||
|
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
|
||||||
|
<title>GrafX2 - Le moteur des opérations</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="#FFFFFF">
|
||||||
|
|
||||||
|
<h1 align="center">GrafX2 - Le moteur des opérations</h1>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h2>Explication du principe :</h2>
|
||||||
|
|
||||||
|
<p>Qu'appelle-t'on une opération? C'est l'emploi d'un outil de
|
||||||
|
dessin. Par exemple, le tracé libre à la main d'un pinceau (ou
|
||||||
|
d'une brosse) est une opération. Plus exactement, c'est tout
|
||||||
|
comportement de la souris lorsqu'elle se trouve sur les pixels de
|
||||||
|
l'image éditée. De ce fait, la gestion de la pipette se fait
|
||||||
|
également au travers des opérations.</p>
|
||||||
|
|
||||||
|
<p>Le moteur chargé de gérer ces opérations est simplifié
|
||||||
|
autant que possible. Son principe est le suivant : lorsque
|
||||||
|
la souris est au-dessus de l'image, la boucle principale de
|
||||||
|
gestion de GrafX2 (située dans MOTEUR.C) détermine la partie
|
||||||
|
atomique d'instructions à exécuter, puis l'exécute, pour
|
||||||
|
chaque combinaison d'un type d'opération (un entier, que l'on
|
||||||
|
nommera pour les besoins de cette page ID_OP), d'un état de la
|
||||||
|
souris (état de ses boutons plus exactement, codé sur un entier
|
||||||
|
également), et d'un nombre de valeurs présentes dans une pile
|
||||||
|
(pas la pile système, mais une pile de mots 16-bits
|
||||||
|
spécialement mise en place pour les opérations, afin qu'elles y
|
||||||
|
stockent des paramètres pour les opérations suivantes). On
|
||||||
|
appelle "partie atomique" une séquence d'instructions
|
||||||
|
qui doivent être exécutées intégralement à chaque itération
|
||||||
|
de la boucle principale. Elle se contente de ne faire que ce
|
||||||
|
qu'elle doit faire face à la situation qu'implique la
|
||||||
|
combinaison (ID_OP,Code souris, Etat pile) pour laquelle elle est
|
||||||
|
appelée.</p>
|
||||||
|
|
||||||
|
<p>En fait, le moteur doit être aidé pour déterminer les
|
||||||
|
insctructions à exécuter. Chacune de ces parties atomiques est
|
||||||
|
écrite sous la forme d'une fonction contenant tout le code qui
|
||||||
|
lui est nécessaire. Ces fonctions sont ce que l'on a appelé des
|
||||||
|
"fonction_action" (définition dans STRUCT.H), c'est à
|
||||||
|
dire une simple fonction qui ne reçoit pas de paramètres et qui
|
||||||
|
n'en renvoie pas. Un simple void Ma_fonction(void)...</p>
|
||||||
|
|
||||||
|
<p>Il n'est pas dans mon intention de vous apprendre à écrire
|
||||||
|
ces fonctions atomiques. Dans le cas des opérations les plus
|
||||||
|
simples à implémenter selon ce principe, la conception des
|
||||||
|
parties atomiques est assez intuitive, mais il arrive dans
|
||||||
|
certains cas que la méthode trouve certaines limites, il faut
|
||||||
|
alors tricher un peu (mais gentiment! - en plaçant des valeurs
|
||||||
|
arbitraires dans la pile uniquement pour permettre la transition
|
||||||
|
vers une autre combinaison choisie, donc une autre partie
|
||||||
|
atomique, par exemple). Vous pourrez trouver tous les exemples
|
||||||
|
que vous voudrez dans le fichier OPERATIO.C.</p>
|
||||||
|
|
||||||
|
<p>Après avoir écrit les parties atomiques qui vont être
|
||||||
|
nécessaires pour la gestion complète d'une opération (dans le
|
||||||
|
fichier OPERATIO.C), et avoir renseigné les prototypes de ces
|
||||||
|
fonctions (dans OPERATIO.H), il faut indiquer au moteur dans
|
||||||
|
quelles conditions utiliser ces fonctions. Cela se fait dans la
|
||||||
|
phase d'initialisation du programme (située dans le fichier
|
||||||
|
INIT.C), où l'on renseigne chacune des fonctions atomiques, en
|
||||||
|
décrivant les valeurs de combinaison qui doivent déclencher
|
||||||
|
leur appel. La fonction appelée se contente d'en prendre note en
|
||||||
|
remplissant un tableau nommé "Operation" (variable
|
||||||
|
globale déclarée dans GLOBAL.H, et indexée par les 3 valeurs
|
||||||
|
de la combinaison : ID_OP, code souris, état pile) à l'aide de
|
||||||
|
l'adresse de la fonction à appeler. Ce tableau va servir au
|
||||||
|
moteur à faire un appel direct de la fonction atomique d'après
|
||||||
|
la combinaison, sans avoir à faire toute une série de tests
|
||||||
|
(swich/case) fastidieux.</p>
|
||||||
|
|
||||||
|
<p>Comme nous avons pressenti qu'il arriverait fréquemment que
|
||||||
|
des fonctions atomiques auraient besoin systématiquement
|
||||||
|
d'effacer la souris pour faire des affichages à l'écran ou dans
|
||||||
|
l'image, et de la rafficher ensuite, et dans le souci d'éviter
|
||||||
|
de faire abusivement du copier/coller de code, nous avons
|
||||||
|
rajouté un booléen dans le tableau Operation qui permet
|
||||||
|
d'indiquer que la fonction atomique demande au moteur de se
|
||||||
|
charger lui-même de l'effacement et de la restauration du
|
||||||
|
curseur de la souris à l'écran. Finalement, je ne suis pas
|
||||||
|
certain que cela s'est révelé d'une grande utilité, mais je
|
||||||
|
vous le signale tout de même pour que vous compreniez
|
||||||
|
l'existance du paramètre "Effacer souris" qu'il faut
|
||||||
|
indiquer lorsqu'on renseigne une fonction atomique lors de
|
||||||
|
l'initialisation.</p>
|
||||||
|
|
||||||
|
<p>Il est important de noter qu'une fonction atomique est
|
||||||
|
appelée en permanence par la boucle principale, indépendamment
|
||||||
|
du fait que la souris change d'état ou non. Ces appels
|
||||||
|
répétés permettent par exemple d'avoir un spray qui continue
|
||||||
|
à agir lorsqu'on presse le bouton de la souris sans la
|
||||||
|
déplacer.</p>
|
||||||
|
|
||||||
|
<p>De plus, les fonctions atomiques n'ont pas à se soucier du
|
||||||
|
positionnement de la souris car dès que la pile contient des
|
||||||
|
données (généralement dès le premier clic), la souris est
|
||||||
|
limitée par le moteur afin de ne pas sortir de l'image. Le
|
||||||
|
moteur s'assure également que la souris ne franchis pas la barre
|
||||||
|
de split en mode "loupe". Enfin, n'oubliez pas de vider
|
||||||
|
complètement la pile en temps voulu, lorsque l'opération peut
|
||||||
|
s'achever! ;-)</p>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h2>Informations pour l'implémentation :</h2>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Le renseignement d'une fonction atomique se fait dans
|
||||||
|
INIT.C à l'aide de :</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Initialisation_operation(ID_OP, Etat souris, Taille pile,
|
||||||
|
Callback, Effacer souris);</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>La pile à disposition des opérations pour le stockage
|
||||||
|
des paramètres :<ul>
|
||||||
|
<li>Elle contient des mots 16-bits (type word,
|
||||||
|
définit dans STRUCT.H)</li>
|
||||||
|
<li>Pour y poser une valeur :
|
||||||
|
Operation_PUSH(val)</li>
|
||||||
|
<li>Pour en retirer une valeur :
|
||||||
|
Operation_POP(&var)</li>
|
||||||
|
<li>Exemples de valeurs à y mettre :
|
||||||
|
coordonnées de souris, de pinceau... des
|
||||||
|
couleurs... des valeurs bidons pour changer
|
||||||
|
l'état de la pile...<br>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>A l'intérieur d'une fonction atomique :<ul>
|
||||||
|
<li>Si la fonction correspond à la première étape
|
||||||
|
d'une opération, appeler
|
||||||
|
Initialiser_debut_operation()</li>
|
||||||
|
<li>Si la fonction correspond à la première étape
|
||||||
|
d'une opération qui peut modifier l'image,
|
||||||
|
appeler Backup() avant modification de l'image ;
|
||||||
|
ce qui permettra à l'utilisateur d'annuler la
|
||||||
|
modification avec "undo" s'il le
|
||||||
|
souhaite.</li>
|
||||||
|
<li>Pour afficher les coordonnées de la souris,
|
||||||
|
appeler Print_coordonnees() sans vous soucier de
|
||||||
|
savoir si la barre d'outils est visible. Si vous
|
||||||
|
avez besoin d'afficher une coordonnée qui doit
|
||||||
|
s'adapter au mode relatif ou absolu (selon le
|
||||||
|
paramétrage effectué par l'utilisateur),
|
||||||
|
utilisez Aff_coords_rel_ou_abs(RefX,RefY). Si les
|
||||||
|
coordonnées sont configurées pour être
|
||||||
|
relatives, cette fonction affichera la
|
||||||
|
différence entre les coordonnées actuelles du
|
||||||
|
pinceau et les coordonnées de référence
|
||||||
|
passées en paramètres. Dans le cas d'infos
|
||||||
|
spéciales à afficher dans la barre de menu, on
|
||||||
|
pourra se servir de la fonction
|
||||||
|
Print_dans_menu(texte,position en caractères).</li>
|
||||||
|
<li>Si vous avez besoin de vous assurer que les
|
||||||
|
boutons de la souris sont relâchés à un moment
|
||||||
|
de la fonction, utilisez Attendre_fin_de_click()</li>
|
||||||
|
<li>Etudiez OPERATIO.C pour avoir des exemples.<br>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>Pour démarrer une opération (après avoir cliqué sur
|
||||||
|
un bouton de la barre d'outils par exemple), appeler
|
||||||
|
Demarrer_pile_operation(ID_OP). Note: il faut que le
|
||||||
|
curseur soit caché avant l'appel (et son état n'est pas
|
||||||
|
changé après). (voir exemples dans BOUTONS.C)<br>
|
||||||
|
</li>
|
||||||
|
<li>On peut connaître l'ID_OP de l'opération en cours
|
||||||
|
grâce à la variable globale Operation_en_cours<br>
|
||||||
|
</li>
|
||||||
|
<li>La variable globale Operation_Taille_pile correspond à
|
||||||
|
la taille de la pile d'opérations. Elle peut être
|
||||||
|
consultée et éventuellement modifiée (même s'il est
|
||||||
|
préférable d'utiliser Operation_PUSH et Operation_POP
|
||||||
|
dans ce dernier cas).</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<p>Comment rajouter une opération?</p>
|
||||||
|
<div align="center"><center>
|
||||||
|
|
||||||
|
<table border="1" width="100%">
|
||||||
|
<tr>
|
||||||
|
<td width="100%">Dans CONST.H :<ul>
|
||||||
|
<li>rajouter un identifiant (ID_OP) dans l'enum
|
||||||
|
OPERATIONS (exemple : OPERATION_DUMMY)</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="100%">Dans GLOBAL.H :<ul>
|
||||||
|
<li>rajouter l'identifiant de la forme de curseur à
|
||||||
|
utiliser pour cette opération dans la table
|
||||||
|
CURSEUR_D_OPERATION[]. Faites bien attention à
|
||||||
|
l'insérer au bon endroit (place correspondant à
|
||||||
|
ID_OP).</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="100%">Dans OPERATIO.C :<ul>
|
||||||
|
<li>Ecrire chaque fonction atomique de l'opération.</li>
|
||||||
|
</ul>
|
||||||
|
<blockquote>
|
||||||
|
<p>Exemple :</p>
|
||||||
|
</blockquote>
|
||||||
|
<blockquote>
|
||||||
|
<blockquote>
|
||||||
|
<p>void Dummy_1_0(void)<br>
|
||||||
|
// Opération : OPERATION_DUMMY<br>
|
||||||
|
// Click Souris: 1<br>
|
||||||
|
// Taille_Pile : 0<br>
|
||||||
|
// Souris effacée: Oui (précisé grâce à
|
||||||
|
Initialiser_operation() dans INIT.C)<br>
|
||||||
|
{<br>
|
||||||
|
Initialiser_debut_operation();<br>
|
||||||
|
Backup();<br>
|
||||||
|
<br>
|
||||||
|
// ACTIONS...<br>
|
||||||
|
<br>
|
||||||
|
Operation_PUSH(une_valeur_nécessaire_pour_les_prochaines_étapes);<br>
|
||||||
|
Operation_PUSH(une_autre_valeur_nécessaire_plus_tard);<br>
|
||||||
|
}</p>
|
||||||
|
</blockquote>
|
||||||
|
</blockquote>
|
||||||
|
<blockquote>
|
||||||
|
<blockquote>
|
||||||
|
<p>(Pour cet exemple, l'étape suivante à
|
||||||
|
définir sera donc une étape avec la taille de
|
||||||
|
pile à 2)</p>
|
||||||
|
</blockquote>
|
||||||
|
</blockquote>
|
||||||
|
<ul>
|
||||||
|
<li>Il y a une action par défaut qui se contente
|
||||||
|
d'afficher les coordonnées de la souris
|
||||||
|
lorsqu'on ne définit pas explicitement de
|
||||||
|
fonction atomique gérant une certaine
|
||||||
|
combinaison (ID_OP, Etat souris, Taille pile).</li>
|
||||||
|
<li>Si l'opération représente une interruption
|
||||||
|
temporaire, et qu'il vous paraît juste de
|
||||||
|
restaurer l'opération précédente une fois
|
||||||
|
qu'elle est terminée (cas de la loupe, de la
|
||||||
|
pipette, des prises de brosse, ...), rajouter
|
||||||
|
l'ID_OP dans la section correspondante de la
|
||||||
|
fonction Demarrer_pile_operation(), en début de
|
||||||
|
fichier.</li>
|
||||||
|
<li>Si l'opération voit un intérêt à accepter que
|
||||||
|
l'utilisateur change de couleur de pinceau en
|
||||||
|
cours d'opération (cas du dessin continu,
|
||||||
|
discontinu, le spray, et les lignes centrées),
|
||||||
|
rajouter l'ID_OP dans la section correspondante
|
||||||
|
de la fonction Demarrer_pile_operation(), en
|
||||||
|
début de fichier.</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="100%">Dans OPERATIO.H :<ul>
|
||||||
|
<li>Ecrire le prototype des ces fonctions atomiques.</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="100%">Dans INIT.C :<ul>
|
||||||
|
<li>Dans Initialisation_des_operations(), pour chaque
|
||||||
|
fonction atomique de l'opération, écrire un
|
||||||
|
appel à Initialiser_operation(ID_OP, Etat
|
||||||
|
souris, Taille pile, Callback, Effacer souris);<ul>
|
||||||
|
<li>ID_OP : identifiant de l'opération
|
||||||
|
dont dépend la fonction atomique
|
||||||
|
(défini dans CONST.H)</li>
|
||||||
|
<li>Etat souris :<ul>
|
||||||
|
<li>0 = boutons relachés</li>
|
||||||
|
<li>1 = bouton gauche enfoncé</li>
|
||||||
|
<li>2 = bouton droit enfoncé</li>
|
||||||
|
<li>(note : l'état "boutons
|
||||||
|
gauche et droit enfoncés"
|
||||||
|
n'existe pas, seuls les 3 états
|
||||||
|
ci-dessus sont autorisés)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>Taille pile : nombre de paramètres
|
||||||
|
dans la pile</li>
|
||||||
|
<li>Callback : nom de la fonction
|
||||||
|
atomique à appeler pour la combinaison
|
||||||
|
des 3 paramètres précédents</li>
|
||||||
|
<li>Effacer souris : booléen indiquant
|
||||||
|
que le moteur se chargera d'effacer le
|
||||||
|
curseur souris avant l'appel à la
|
||||||
|
fonction atomique, et de le rafficher
|
||||||
|
après sa sortie.</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<blockquote>
|
||||||
|
<p>Exemple :</p>
|
||||||
|
</blockquote>
|
||||||
|
<blockquote>
|
||||||
|
<blockquote>
|
||||||
|
<p>Initialiser_operation(OPERATION_DUMMY, 1, 0,
|
||||||
|
Dummy_1_0, 1);</p>
|
||||||
|
</blockquote>
|
||||||
|
</blockquote>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</center></div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<SCRIPT language="Javascript">
|
||||||
|
<!--
|
||||||
|
|
||||||
|
// FILE ARCHIVED ON 20021206090126 AND RETRIEVED FROM THE
|
||||||
|
// INTERNET ARCHIVE ON 20070414155905.
|
||||||
|
// JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
|
||||||
|
// ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
|
||||||
|
// SECTION 108(a)(3)).
|
||||||
|
|
||||||
|
var sWayBackCGI = "http://web.archive.org/web/20021206090126/";
|
||||||
|
|
||||||
|
function xResolveUrl(url) {
|
||||||
|
var image = new Image();
|
||||||
|
image.src = url;
|
||||||
|
return image.src;
|
||||||
|
}
|
||||||
|
function xLateUrl(aCollection, sProp) {
|
||||||
|
var i = 0;
|
||||||
|
for(i = 0; i < aCollection.length; i++) {
|
||||||
|
if (typeof(aCollection[i][sProp]) == "string") {
|
||||||
|
if (aCollection[i][sProp].indexOf("mailto:") == -1 &&
|
||||||
|
aCollection[i][sProp].indexOf("javascript:") == -1) {
|
||||||
|
if(aCollection[i][sProp].indexOf("http") == 0) {
|
||||||
|
aCollection[i][sProp] = sWayBackCGI + aCollection[i][sProp];
|
||||||
|
} else {
|
||||||
|
aCollection[i][sProp] = sWayBackCGI + xResolveUrl(aCollection[i][sProp]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
xLateUrl(document.getElementsByTagName("IMG"),"src");
|
||||||
|
xLateUrl(document.getElementsByTagName("A"),"href");
|
||||||
|
xLateUrl(document.getElementsByTagName("AREA"),"href");
|
||||||
|
xLateUrl(document.getElementsByTagName("OBJECT"),"codebase");
|
||||||
|
xLateUrl(document.getElementsByTagName("OBJECT"),"data");
|
||||||
|
xLateUrl(document.getElementsByTagName("APPLET"),"codebase");
|
||||||
|
xLateUrl(document.getElementsByTagName("APPLET"),"archive");
|
||||||
|
xLateUrl(document.getElementsByTagName("EMBED"),"src");
|
||||||
|
xLateUrl(document.getElementsByTagName("BODY"),"background");
|
||||||
|
var forms = document.getElementsByTagName("FORM");
|
||||||
|
if (forms) {
|
||||||
|
var j = 0;
|
||||||
|
for (j = 0; j < forms.length; j++) {
|
||||||
|
f = forms[j];
|
||||||
|
if (typeof(f.action) == "string") {
|
||||||
|
if(typeof(f.method) == "string") {
|
||||||
|
if(typeof(f.method) != "post") {
|
||||||
|
f.action = sWayBackCGI + f.action;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-->
|
||||||
|
</SCRIPT>
|
||||||
|
|
||||||
|
</html>
|
||||||
176
doc/Les entrées.html
Normal file
176
doc/Les entrées.html
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<BASE HREF="http://www-msi.ensil.unilim.fr/~maritaud/sunset/GrafX2-fra-Input.html">
|
||||||
|
|
||||||
|
<meta http-equiv="Content-Type"
|
||||||
|
content="text/html; charset=iso-8859-1">
|
||||||
|
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
|
||||||
|
<title>GrafX2 - Les entrées</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body bgcolor="#FFFFFF">
|
||||||
|
|
||||||
|
<h1 align="center">GrafX2 - Les entrées</h1>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<p>Get_input() (dans DIVERS.ASM):</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Touches :<ul>
|
||||||
|
<li>Met à jour la variable "Touche", un
|
||||||
|
mot 16-bits qui contient dans sa partie basse la
|
||||||
|
valeur du scan-code (valeur plutôt liée à la
|
||||||
|
géographie de la touche) de la touche enfoncée
|
||||||
|
à traiter, et dans sa partie haute un codage des
|
||||||
|
touches de contrôles enfoncées au moment de
|
||||||
|
l'appel.<ul>
|
||||||
|
<li>(Touche & 0x0100) => Shift</li>
|
||||||
|
<li>(Touche & 0x0200) => Control</li>
|
||||||
|
<li>(Touche & 0x0400) => Alt</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>Met dans la variable "Touche_ASCII" la
|
||||||
|
valeur ASCII (valeur liée au caractère que
|
||||||
|
représente la touche) de la touche enfoncée à
|
||||||
|
traiter.</li>
|
||||||
|
<li>Dans le cas où la variable globale
|
||||||
|
"Autoriser_changement_de_couleur_pendant_operation"
|
||||||
|
serait à 0, et qu'il existerait au moins une
|
||||||
|
valeur dans la pile des opérations, la fonction
|
||||||
|
filtre les touches. Cela signifie que l'on ne
|
||||||
|
peut pas interrompre une opération en cours,
|
||||||
|
sauf pour changer la couleur du pinceau si
|
||||||
|
l'opération l'autorise (utile pour faire varier
|
||||||
|
la couleur du pinceau à l'aide des touches
|
||||||
|
pendant qu'on dessine).</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>Souris :<ul>
|
||||||
|
<li>Met à jour la position (Mouse_X,Mouse_Y) de la
|
||||||
|
souris en fonction de sa position dans un écran
|
||||||
|
virtuel. Cet écran est volontairement plus grand
|
||||||
|
que la résolution réelle du mode vidéo car de
|
||||||
|
nombreux drivers ne fournissent pas la position
|
||||||
|
de la souris au pixel près...</li>
|
||||||
|
<li>Met à jour l'état des boutons de la souris
|
||||||
|
(Mouse_K). La variable vaut 0 si aucun bouton
|
||||||
|
n'est enfoncé, 1 si seul le bouton gauche est
|
||||||
|
enfoncé, et 2 si seul le bouton droit est
|
||||||
|
enfoncé. Dans le cas où les 2 boutons seraient
|
||||||
|
enfoncé, Get_input() considère qu'aucun bouton
|
||||||
|
n'est enfoncé (Mouse_K = 0).</li>
|
||||||
|
<li>La fonction corrige la position de la souris afin
|
||||||
|
de l'empêcher de sortir de la surface d'image
|
||||||
|
sur laquelle elle se trouve si au moins une
|
||||||
|
valeur est dans la pile des opérations (la
|
||||||
|
souris ne sort pas de la zone de dessin tant que
|
||||||
|
l'opération de dessin n'est pas terminée), et
|
||||||
|
elle simule également le déplacement et les
|
||||||
|
clics de la souris si la combinaison de touches
|
||||||
|
courante correspond à de telles commandes. Dans
|
||||||
|
ce dernier cas, la touche est ensuite filtrée
|
||||||
|
afin d'éviter de faire travailler la fonction
|
||||||
|
appelante pour rien.</li>
|
||||||
|
<li>Dans le cas où la souris change d'état ou que
|
||||||
|
la variable globale
|
||||||
|
"Forcer_affichage_curseur" est placée
|
||||||
|
à 1, le curseur de la souris est réaffiché. La
|
||||||
|
fonction laisse toujours la variable
|
||||||
|
Forcer_affichage_curseur à 0 en fin d'appel.</li>
|
||||||
|
<li>La fonction fait appel à
|
||||||
|
Calculer_coordonnees_pinceau() qui se charge de
|
||||||
|
calculer convenablement les coordonnées du
|
||||||
|
pinceau (Pinceau_X,Pinceau_Y) en fonction de la
|
||||||
|
position de la souris à l'écran, de la position
|
||||||
|
de la zone de dessin dans l'image, du facteur de
|
||||||
|
zoom et de l'effet de la grille.</li>
|
||||||
|
</ul>
|
||||||
|
<p><strong>Important :</strong> Dans la plupart des cas,
|
||||||
|
vous n'avez pas à appeler cette fonction car le moteur
|
||||||
|
(boucle principale, gestionnaire de fenêtre, sélecteurs
|
||||||
|
de fichier, ...) s'en est déjà chargé. Vous pouvez
|
||||||
|
donc considérer que les variables concernées sont
|
||||||
|
déjà à jour. Si vous appeliez vous-même la fonction
|
||||||
|
Get_input() à un moment inoportun, certaines commandes
|
||||||
|
de l'utilisateur, prises en compte par le moteur, ne
|
||||||
|
seraient pas traitées.</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Attendre_fin_de_click() (dans DIVERS.ASM):</p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>S'il vous arrive d'avoir besoin de vous assurer que
|
||||||
|
l'utilisateur n'appuie plus sur les boutons de la souris à
|
||||||
|
un instant donné, cette fonction attend jusqu'à ce que
|
||||||
|
l'utilisateur relache le bouton. La valeur de Mouse_K vaut
|
||||||
|
alors 0, mais s'il a déplacé la souris avant de suspendre
|
||||||
|
sa pression, la position (Mouse_X,Mouse_Y) n'est pas encore
|
||||||
|
à jour. Cependant, cela ne devrait pas être génant (au
|
||||||
|
pire, un appel à Get_input() mettra ces valeurs à jour).</p>
|
||||||
|
</blockquote>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<SCRIPT language="Javascript">
|
||||||
|
<!--
|
||||||
|
|
||||||
|
// FILE ARCHIVED ON 20021011041425 AND RETRIEVED FROM THE
|
||||||
|
// INTERNET ARCHIVE ON 20070414155906.
|
||||||
|
// JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
|
||||||
|
// ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
|
||||||
|
// SECTION 108(a)(3)).
|
||||||
|
|
||||||
|
var sWayBackCGI = "http://web.archive.org/web/20021011041425/";
|
||||||
|
|
||||||
|
function xResolveUrl(url) {
|
||||||
|
var image = new Image();
|
||||||
|
image.src = url;
|
||||||
|
return image.src;
|
||||||
|
}
|
||||||
|
function xLateUrl(aCollection, sProp) {
|
||||||
|
var i = 0;
|
||||||
|
for(i = 0; i < aCollection.length; i++) {
|
||||||
|
if (typeof(aCollection[i][sProp]) == "string") {
|
||||||
|
if (aCollection[i][sProp].indexOf("mailto:") == -1 &&
|
||||||
|
aCollection[i][sProp].indexOf("javascript:") == -1) {
|
||||||
|
if(aCollection[i][sProp].indexOf("http") == 0) {
|
||||||
|
aCollection[i][sProp] = sWayBackCGI + aCollection[i][sProp];
|
||||||
|
} else {
|
||||||
|
aCollection[i][sProp] = sWayBackCGI + xResolveUrl(aCollection[i][sProp]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
xLateUrl(document.getElementsByTagName("IMG"),"src");
|
||||||
|
xLateUrl(document.getElementsByTagName("A"),"href");
|
||||||
|
xLateUrl(document.getElementsByTagName("AREA"),"href");
|
||||||
|
xLateUrl(document.getElementsByTagName("OBJECT"),"codebase");
|
||||||
|
xLateUrl(document.getElementsByTagName("OBJECT"),"data");
|
||||||
|
xLateUrl(document.getElementsByTagName("APPLET"),"codebase");
|
||||||
|
xLateUrl(document.getElementsByTagName("APPLET"),"archive");
|
||||||
|
xLateUrl(document.getElementsByTagName("EMBED"),"src");
|
||||||
|
xLateUrl(document.getElementsByTagName("BODY"),"background");
|
||||||
|
var forms = document.getElementsByTagName("FORM");
|
||||||
|
if (forms) {
|
||||||
|
var j = 0;
|
||||||
|
for (j = 0; j < forms.length; j++) {
|
||||||
|
f = forms[j];
|
||||||
|
if (typeof(f.action) == "string") {
|
||||||
|
if(typeof(f.method) == "string") {
|
||||||
|
if(typeof(f.method) != "post") {
|
||||||
|
f.action = sWayBackCGI + f.action;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-->
|
||||||
|
</SCRIPT>
|
||||||
|
|
||||||
|
</html>
|
||||||
1983
doc_eng.txt
Normal file
1983
doc_eng.txt
Normal file
File diff suppressed because it is too large
Load Diff
2113
doc_fra.txt
Normal file
2113
doc_fra.txt
Normal file
File diff suppressed because it is too large
Load Diff
472
dpmi.asm
Normal file
472
dpmi.asm
Normal file
@ -0,0 +1,472 @@
|
|||||||
|
.386P
|
||||||
|
.MODEL FLAT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_TEXT Segment dword public 'code'
|
||||||
|
Assume cs:_TEXT, ds:_DATA
|
||||||
|
|
||||||
|
|
||||||
|
; -- Fonctions DPMI --
|
||||||
|
public Physical_address_mapping
|
||||||
|
public Free_physical_address_mapping
|
||||||
|
public Lock_linear_region
|
||||||
|
public Unlock_linear_region
|
||||||
|
public Allocate_ldt_descriptor
|
||||||
|
public Free_ldt_descriptor
|
||||||
|
public Set_segment_base_address
|
||||||
|
public Set_segment_limit
|
||||||
|
public Set_descriptor_access_rights
|
||||||
|
public Get_segment_base_address
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Physical_address_mapping proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Physical_address:dword,Physical_size:dword,Linear_address_pointer:dword
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
|
||||||
|
; On met dans BX:CX l'adresse physique … mapper
|
||||||
|
mov eax,Physical_address
|
||||||
|
mov cx,ax
|
||||||
|
shr eax,16
|
||||||
|
mov bx,ax
|
||||||
|
|
||||||
|
; On met dans SI:DI la taille de l'adresse physique … mapper
|
||||||
|
mov eax,Physical_size
|
||||||
|
mov di,ax
|
||||||
|
shr eax,16
|
||||||
|
mov si,ax
|
||||||
|
|
||||||
|
; On appelle le service DPMI de mappage d'adresse physique
|
||||||
|
mov ax,0800h
|
||||||
|
int 31h
|
||||||
|
|
||||||
|
jc Physical_address_mapping_Erreur
|
||||||
|
|
||||||
|
; On sauve l'adresse lin‚aire … l'adresse donn‚e
|
||||||
|
mov eax,Linear_address_pointer
|
||||||
|
mov [eax+00h],cx
|
||||||
|
mov [eax+02h],bx
|
||||||
|
; Et on renvoie un code d'erreur nul
|
||||||
|
xor ax,ax
|
||||||
|
|
||||||
|
Physical_address_mapping_Erreur:
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Physical_address_mapping endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Free_physical_address_mapping proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Linear_address:dword
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
|
||||||
|
; On met dans BX:CX l'adresse lin‚aire … d‚mapper
|
||||||
|
mov eax,Linear_address
|
||||||
|
mov cx,ax
|
||||||
|
shr eax,16
|
||||||
|
mov bx,ax
|
||||||
|
|
||||||
|
; On appel le service DPMI de lib‚ration d'un mappage d'adresse physique
|
||||||
|
mov ax,0801h
|
||||||
|
int 31h
|
||||||
|
|
||||||
|
jc Free_physical_address_mapping_Erreur
|
||||||
|
|
||||||
|
; On renvoie un code d'erreur nul
|
||||||
|
xor ax,ax
|
||||||
|
|
||||||
|
Free_physical_address_mapping_Erreur:
|
||||||
|
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Free_physical_address_mapping endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Lock_linear_region proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Linear_address:dword,Linear_size:dword
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
|
||||||
|
; On met dans BX:CX l'adresse lin‚aire … locker
|
||||||
|
mov eax,Linear_address
|
||||||
|
mov cx,ax
|
||||||
|
shr eax,16
|
||||||
|
mov bx,ax
|
||||||
|
|
||||||
|
; On met dans SI:DI la taille de l'adresse lin‚aire … locker
|
||||||
|
mov eax,Linear_size
|
||||||
|
mov di,ax
|
||||||
|
shr eax,16
|
||||||
|
mov si,ax
|
||||||
|
|
||||||
|
; On appel le service DPMI de lockage d'adresse lin‚aire
|
||||||
|
mov ax,0600h
|
||||||
|
int 31h
|
||||||
|
|
||||||
|
jc Lock_linear_region_Erreur
|
||||||
|
|
||||||
|
; On renvoie un code d'erreur nul
|
||||||
|
xor ax,ax
|
||||||
|
|
||||||
|
Lock_linear_region_Erreur:
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Lock_linear_region endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Unlock_linear_region proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Linear_address:dword,Linear_size:dword
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
|
||||||
|
; On met dans BX:CX l'adresse lin‚aire … d‚locker
|
||||||
|
mov eax,Linear_address
|
||||||
|
mov cx,ax
|
||||||
|
shr eax,16
|
||||||
|
mov bx,ax
|
||||||
|
|
||||||
|
; On met dans SI:DI la taille de l'adresse lin‚aire … d‚locker
|
||||||
|
mov eax,Linear_size
|
||||||
|
mov di,ax
|
||||||
|
shr eax,16
|
||||||
|
mov si,ax
|
||||||
|
|
||||||
|
; On appel le service DPMI de d‚lockage d'adresse lin‚aire
|
||||||
|
mov ax,0601h
|
||||||
|
int 31h
|
||||||
|
|
||||||
|
jc Unlock_linear_region_Erreur
|
||||||
|
|
||||||
|
; On renvoie un code d'erreur nul
|
||||||
|
xor ax,ax
|
||||||
|
|
||||||
|
Unlock_linear_region_Erreur:
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Unlock_linear_region endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Allocate_ldt_descriptor proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Nombre_de_descripteurs:word,Base_selector_pointer:dword
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
|
||||||
|
; On met dans CX le nombre de descripteurs ldt … allouer
|
||||||
|
mov cx,Nombre_de_descripteurs
|
||||||
|
|
||||||
|
; On appel le service DPMI d'allocation de descripteurs ldt
|
||||||
|
mov ax,0000h
|
||||||
|
int 31h
|
||||||
|
|
||||||
|
jc Allocate_ldt_descriptor_Erreur
|
||||||
|
|
||||||
|
; On sauve la valeur du s‚lecteur de base
|
||||||
|
mov ebx,Base_selector_pointer
|
||||||
|
mov [ebx],ax
|
||||||
|
; Et on renvoie un code d'erreur nul
|
||||||
|
xor ax,ax
|
||||||
|
|
||||||
|
Allocate_ldt_descriptor_Erreur:
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Allocate_ldt_descriptor endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Free_ldt_descriptor proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Selector:word
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
|
||||||
|
; On met dans BX le descripteur ldt … lib‚rer
|
||||||
|
mov bx,Selector
|
||||||
|
|
||||||
|
; On appel le service DPMI de lib‚ration de descripteur ldt
|
||||||
|
mov ax,0001h
|
||||||
|
int 31h
|
||||||
|
|
||||||
|
jc Free_ldt_descriptor_Erreur
|
||||||
|
|
||||||
|
; On renvoie un code d'erreur nul
|
||||||
|
xor ax,ax
|
||||||
|
|
||||||
|
Free_ldt_descriptor_Erreur:
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Free_ldt_descriptor endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Set_segment_base_address proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Selector:word,Linear_base_address:dword
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
|
||||||
|
; On met dans CX:DX l'adresse de base lin‚aire … assigner au segment
|
||||||
|
mov eax,Linear_base_address
|
||||||
|
mov dx,ax
|
||||||
|
shr eax,16
|
||||||
|
mov cx,ax
|
||||||
|
|
||||||
|
; On met dans BX le s‚lecteur auquel il faut assigner l'adresse de base
|
||||||
|
mov bx,Selector
|
||||||
|
|
||||||
|
; On appel le service DPMI d'assignation d'adresse de base … un segment
|
||||||
|
mov ax,0007h
|
||||||
|
int 31h
|
||||||
|
|
||||||
|
jc Set_segment_base_address_Erreur
|
||||||
|
|
||||||
|
; On renvoie un code d'erreur nul
|
||||||
|
xor ax,ax
|
||||||
|
|
||||||
|
Set_segment_base_address_Erreur:
|
||||||
|
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Set_segment_base_address endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Set_segment_limit proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Selector:word,Segment_limit:dword
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
|
||||||
|
; On met dans CX:DX la limite (taille) … assigner au segment
|
||||||
|
mov eax,Segment_limit
|
||||||
|
mov dx,ax
|
||||||
|
shr eax,16
|
||||||
|
mov cx,ax
|
||||||
|
|
||||||
|
; On met dans BX le s‚lecteur auquel il faut assigner une limite
|
||||||
|
mov bx,Selector
|
||||||
|
|
||||||
|
; On appel le service DPMI d'assignation de limite … un segment
|
||||||
|
mov ax,0008h
|
||||||
|
int 31h
|
||||||
|
|
||||||
|
jc Set_segment_limit_Erreur
|
||||||
|
|
||||||
|
; On renvoie un code d'erreur nul
|
||||||
|
xor ax,ax
|
||||||
|
|
||||||
|
Set_segment_limit_Erreur:
|
||||||
|
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Set_segment_limit endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Set_descriptor_access_rights proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Selector:word,Rights:word
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
|
||||||
|
; On met dans CX les droits … assigner au segment
|
||||||
|
mov cx,Rights
|
||||||
|
|
||||||
|
; On met dans BX le s‚lecteur auquel il faut assigner des droits
|
||||||
|
mov bx,Selector
|
||||||
|
|
||||||
|
; On appel le service DPMI d'assignation de droits … un segment
|
||||||
|
mov ax,0009h
|
||||||
|
int 31h
|
||||||
|
|
||||||
|
jc Set_descriptor_access_rights_Erreur
|
||||||
|
|
||||||
|
; On renvoie un code d'erreur nul
|
||||||
|
xor ax,ax
|
||||||
|
|
||||||
|
Set_descriptor_access_rights_Erreur:
|
||||||
|
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Set_descriptor_access_rights endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Get_segment_base_address proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Selector:word,Linear_base_address_pointer:dword
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
|
||||||
|
; On met dans BX le s‚lecteur dont il faut lire l'adresse de base
|
||||||
|
mov bx,Selector
|
||||||
|
|
||||||
|
; On appel le service DPMI de lecture d'adresse de base d'un segment
|
||||||
|
mov ax,0006h
|
||||||
|
int 31h
|
||||||
|
|
||||||
|
jc Get_segment_base_address_Erreur
|
||||||
|
|
||||||
|
; On sauve l'adresse de base lin‚aire du segment
|
||||||
|
mov eax,Linear_base_address_pointer
|
||||||
|
mov [eax+00h],dx
|
||||||
|
mov [eax+02h],cx
|
||||||
|
; On renvoie un code d'erreur nul
|
||||||
|
xor ax,ax
|
||||||
|
|
||||||
|
Get_segment_base_address_Erreur:
|
||||||
|
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Get_segment_base_address endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_TEXT ENDS
|
||||||
|
END
|
||||||
20
dpmi.h
Normal file
20
dpmi.h
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
#ifndef _DPMI_H_
|
||||||
|
#define _DPMI_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
word Physical_address_mapping(byte * Physical_address,dword Size,byte * * Linear_address_pointer);
|
||||||
|
word Free_physical_address_mapping(byte * Linear_address);
|
||||||
|
word Lock_linear_region(byte * Linear_address,dword Size);
|
||||||
|
word Unlock_linear_region(byte * Linear_address,dword Size);
|
||||||
|
word Allocate_ldt_descriptor(word Nombre_de_descripteurs,word * Base_selector_pointer);
|
||||||
|
word Free_ldt_descriptor(word Selector);
|
||||||
|
word Set_segment_base_address(word Selector,byte * Linear_base_address);
|
||||||
|
word Set_segment_limit(word Selector,dword Segment_limit);
|
||||||
|
word Set_descriptor_access_rights(word Selector,word Rights);
|
||||||
|
word Get_segment_base_address(word Selector,byte * * Linear_base_address_pointer);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
21
file_id.diz
Normal file
21
file_id.diz
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||||
|
³ Sunset-Design presents á96.5%³
|
||||||
|
³ ÜÜÜÜ ÜÜÜÜ ÜÜÜ ÜÜÜÜÜ Ü Ü ÜÜÜÜ ³
|
||||||
|
³ Û Û Û Û Û Û ßÜ Üß Û ³
|
||||||
|
³ Û ÜÜ ÛÜÜÜß ÛÜÜÜÛ ÛÜÜ ßÜß Üßß ³
|
||||||
|
³ Û Û Û ßÜ Û Û Û Û Û Û .00 ³
|
||||||
|
³ ßÜÜÜÛ Û Û Û Û Û Û Û ÛÜÜÜÜ ³
|
||||||
|
³ ³
|
||||||
|
³ GrafX 2.00 Beta 96.5% ³
|
||||||
|
³ ³
|
||||||
|
³ °±²Û The ultimate multi-resolution Û²±° ³
|
||||||
|
³ °±²Û bitmap paint program for PC Û²±° ³
|
||||||
|
³ ³
|
||||||
|
³ features: ³
|
||||||
|
³ - all the useful tools and much more ³
|
||||||
|
³ - 60 resolutions! (MCGA, Mode-X, VESA) ³
|
||||||
|
³ (including Amiga resolutions!) ³
|
||||||
|
³ - GIF,LBM,BMP,PCX,PKM,... file support ³
|
||||||
|
³ ³
|
||||||
|
³ Try it! You'll love it! ³
|
||||||
|
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||||
539
files.c
Normal file
539
files.c
Normal file
@ -0,0 +1,539 @@
|
|||||||
|
#include "const.h"
|
||||||
|
#include "struct.h"
|
||||||
|
#include "global.h"
|
||||||
|
#include "graph.h"
|
||||||
|
#include "divers.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
|
#include "linux.h"
|
||||||
|
|
||||||
|
#define COULEUR_FICHIER_NORMAL CM_Clair // Couleur du texte pour une ligne de fichier non s‚lectionn‚
|
||||||
|
#define COULEUR_REPERTOIRE_NORMAL CM_Fonce // Couleur du texte pour une ligne de r‚pertoire non s‚lectionn‚
|
||||||
|
#define COULEUR_FOND_NORMAL CM_Noir // Couleur du fond pour une ligne non s‚lectionn‚e
|
||||||
|
#define COULEUR_FICHIER_SELECT CM_Blanc // Couleur du texte pour une ligne de fichier s‚lectionn‚e
|
||||||
|
#define COULEUR_REPERTOIRE_SELECT CM_Clair // Couleur du texte pour une ligne de rep‚rtoire s‚lectionn‚e
|
||||||
|
#define COULEUR_FOND_SELECT CM_Fonce // Couleur du fond pour une ligne s‚lectionn‚e
|
||||||
|
|
||||||
|
|
||||||
|
int Determiner_repertoire_courant(void)
|
||||||
|
// Modifie Principal_Repertoire_courant en y mettant sa nouvelle valeur (avec le nom du
|
||||||
|
// disque)
|
||||||
|
//
|
||||||
|
// Renvoie 1 s'il y a e–t une erreur d'accŠs
|
||||||
|
{
|
||||||
|
return (getcwd(Principal_Repertoire_courant,256)==NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Repertoire_existe(char * Repertoire)
|
||||||
|
// D‚termine si un r‚pertoire pass‚ en paramŠtre existe ou non dans le
|
||||||
|
// r‚pertoire courant.
|
||||||
|
{
|
||||||
|
DIR* Enreg; // Structure de lecture des ‚l‚ments
|
||||||
|
|
||||||
|
if (strcmp(Repertoire,"..")==0)
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// On va chercher si le r‚pertoire existe … l'aide d'un Opendir. S'il
|
||||||
|
// renvoie NULL c'est que le répertoire n'est pas accessible...
|
||||||
|
|
||||||
|
Enreg=opendir(Repertoire);
|
||||||
|
if (Enreg==NULL)
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
closedir(Enreg);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Fichier_existe(char * Fichier)
|
||||||
|
// D‚termine si un fichier pass‚ en paramŠtre existe ou non dans le
|
||||||
|
// r‚pertoire courant.
|
||||||
|
{
|
||||||
|
struct stat* buf;
|
||||||
|
int Resultat;
|
||||||
|
|
||||||
|
Resultat=stat(Fichier,buf);
|
||||||
|
if (Resultat!=0)
|
||||||
|
return(errno!=ENOENT);
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Conventions:
|
||||||
|
//
|
||||||
|
// * Le fileselect modifie le r‚pertoire courant. Ceci permet de n'avoir
|
||||||
|
// qu'un findfirst dans le r‚pertoire courant … faire:
|
||||||
|
|
||||||
|
|
||||||
|
// -- D‚struction de la liste chaŒn‚e ---------------------------------------
|
||||||
|
void Detruire_liste_du_fileselect(void)
|
||||||
|
// Cette proc‚dure d‚truit la chaine des fichiers. Elle doit ˆtre appel‚e
|
||||||
|
// avant de rappeler la fonction Lire_liste_des_fichiers, ainsi qu'en fin de
|
||||||
|
// programme.
|
||||||
|
{
|
||||||
|
// Pointeur temporaire de destruction
|
||||||
|
struct Element_de_liste_de_fileselect * Element_temporaire;
|
||||||
|
|
||||||
|
while (Liste_du_fileselect!=NULL)
|
||||||
|
{
|
||||||
|
// On m‚morise l'adresse du premier ‚l‚ment de la liste
|
||||||
|
Element_temporaire =Liste_du_fileselect;
|
||||||
|
// On fait avancer la tˆte de la liste
|
||||||
|
Liste_du_fileselect=Liste_du_fileselect->Suivant;
|
||||||
|
// Et on efface l'ancien premier ‚l‚ment de la liste
|
||||||
|
free(Element_temporaire);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -- Formatage graphique des noms de fichier / r‚pertoire ------------------
|
||||||
|
char * Nom_formate(char * Nom)
|
||||||
|
{
|
||||||
|
static char Resultat[13];
|
||||||
|
int Curseur;
|
||||||
|
int Autre_curseur;
|
||||||
|
|
||||||
|
if (strcmp(Nom,"..")==0)
|
||||||
|
{
|
||||||
|
strcpy(Resultat,".. ");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy(Resultat," . ");
|
||||||
|
// On commence par recopier la partie pr‚c‚dent le point:
|
||||||
|
for (Curseur=0;( (Nom[Curseur]!='.') && (Nom[Curseur]!='\0') );Curseur++)
|
||||||
|
Resultat[Curseur]=Nom[Curseur];
|
||||||
|
|
||||||
|
// Ensuite on recopie la partie qui suit le point (si n‚cessaire):
|
||||||
|
if (Nom[Curseur])
|
||||||
|
{
|
||||||
|
for (Curseur++,Autre_curseur=9;Nom[Curseur]!='\0';Curseur++,Autre_curseur++)
|
||||||
|
Resultat[Autre_curseur]=Nom[Curseur];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Resultat;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -- Rajouter … la liste des ‚l‚ments de la liste un ‚l‚ment ---------------
|
||||||
|
void Ajouter_element_a_la_liste(struct dirent* Enreg)
|
||||||
|
// Cette proc‚dure ajoute … la liste chain‚e un fichier pass‚ en argument.
|
||||||
|
{
|
||||||
|
// Pointeur temporaire d'insertion
|
||||||
|
struct Element_de_liste_de_fileselect * Element_temporaire;
|
||||||
|
|
||||||
|
// On alloue de la place pour un nouvel ‚l‚ment
|
||||||
|
Element_temporaire=(struct Element_de_liste_de_fileselect *)malloc(sizeof(struct Element_de_liste_de_fileselect));
|
||||||
|
|
||||||
|
// On met … jour le nouvel emplacement:
|
||||||
|
strcpy(Element_temporaire->Nom,Nom_formate(Enreg->d_name));
|
||||||
|
Element_temporaire->Type =(Enreg->d_type == DT_DIR);
|
||||||
|
|
||||||
|
Element_temporaire->Suivant =Liste_du_fileselect;
|
||||||
|
Element_temporaire->Precedent=NULL;
|
||||||
|
|
||||||
|
if (Liste_du_fileselect!=NULL)
|
||||||
|
Liste_du_fileselect->Precedent=Element_temporaire;
|
||||||
|
Liste_du_fileselect=Element_temporaire;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -- Lecture d'une liste de fichiers ---------------------------------------
|
||||||
|
void Lire_liste_des_fichiers(byte Format_demande)
|
||||||
|
// Cette proc‚dure charge dans la liste chain‚e les fichiers dont l'extension
|
||||||
|
// correspond au format demand‚.
|
||||||
|
{
|
||||||
|
int Attribut; // Attribut des fichiers/r‚pertoires … lire
|
||||||
|
DIR* Repertoire_Courant; //Répertoire courant
|
||||||
|
struct dirent* Enreg; // Structure de lecture des ‚l‚ments
|
||||||
|
char Filtre[6]="*."; // Place pour ‚crire "*.XXX" et un '\0'
|
||||||
|
|
||||||
|
char Chaine[20];
|
||||||
|
|
||||||
|
// Tout d'abord, on d‚duit du format demand‚ un filtre … utiliser:
|
||||||
|
if (Format_demande) // Format (extension) sp‚cifique
|
||||||
|
strcat(Filtre,Format_Extension[Format_demande-1]);
|
||||||
|
else // *.*
|
||||||
|
strcat(Filtre,"*");
|
||||||
|
|
||||||
|
|
||||||
|
// Ensuite, on vide la liste actuelle:
|
||||||
|
Detruire_liste_du_fileselect();
|
||||||
|
// AprŠs effacement, il ne reste ni fichier ni r‚pertoire dans la liste
|
||||||
|
Liste_Nb_fichiers=0;
|
||||||
|
Liste_Nb_repertoires=0;
|
||||||
|
|
||||||
|
// On lit tous les r‚pertoires:
|
||||||
|
|
||||||
|
Repertoire_Courant=opendir(getcwd(NULL,0));
|
||||||
|
/*
|
||||||
|
Ceci est à revoir... pas tout à fait géré pareil sous linux...
|
||||||
|
Attribut=(_A_NORMAL|_A_SUBDIR|//_A_RDONLY|_A_ARCH|
|
||||||
|
(_A_HIDDEN & Config.Lire_les_repertoires_caches)|
|
||||||
|
(_A_SYSTEM & Config.Lire_les_repertoires_systemes));
|
||||||
|
*/
|
||||||
|
Enreg=readdir(Repertoire_Courant);
|
||||||
|
while (Enreg)
|
||||||
|
{
|
||||||
|
// Si l'‚l‚ment n'est pas le r‚pertoire courant
|
||||||
|
if ( (strcmp(Enreg->d_name,".")!=0) &&
|
||||||
|
// et que l'‚l‚ment trouv‚ est r‚ellement un r‚pertoire
|
||||||
|
(Enreg->d_type == DT_DIR) )
|
||||||
|
{
|
||||||
|
// On rajoute le r‚pertore … la liste
|
||||||
|
Ajouter_element_a_la_liste(Enreg);
|
||||||
|
Liste_Nb_repertoires++;
|
||||||
|
}
|
||||||
|
// On cherche l'‚l‚ment suivant
|
||||||
|
Enreg=readdir(Repertoire_Courant);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enfin, on lit les fichiers du format demand‚:
|
||||||
|
|
||||||
|
/*
|
||||||
|
Ici aussi, à revoir...
|
||||||
|
Attribut=(_A_NORMAL|_A_SYSTEM|//_A_RDONLY|_A_ARCH|
|
||||||
|
(_A_HIDDEN & Config.Lire_les_fichiers_caches));
|
||||||
|
*/
|
||||||
|
|
||||||
|
rewinddir(Repertoire_Courant);
|
||||||
|
Enreg=readdir(Repertoire_Courant);
|
||||||
|
while (Enreg)
|
||||||
|
{
|
||||||
|
if (Enreg->d_type==DT_REG) //Il s'agit bien d'un fichier
|
||||||
|
{
|
||||||
|
// On rajoute le fichier … la liste
|
||||||
|
Ajouter_element_a_la_liste(Enreg);
|
||||||
|
Liste_Nb_fichiers++;
|
||||||
|
}
|
||||||
|
// On cherche l'‚l‚ment suivant
|
||||||
|
Enreg=readdir(Repertoire_Courant);
|
||||||
|
}
|
||||||
|
|
||||||
|
closedir(Repertoire_Courant);
|
||||||
|
|
||||||
|
Liste_Nb_elements=Liste_Nb_repertoires+Liste_Nb_fichiers;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -- Tri de la liste des fichiers et r‚pertoires ---------------------------
|
||||||
|
void Trier_la_liste_des_fichiers(void)
|
||||||
|
// Tri la liste chain‚e existante dans l'ordre suivant:
|
||||||
|
//
|
||||||
|
// * Les r‚pertoires d'abord, dans l'ordre alphab‚tique de leur nom
|
||||||
|
// * Les fichiers ensuite, dans l'ordre alphab‚tique de leur nom
|
||||||
|
{
|
||||||
|
byte La_liste_est_triee; // Bool‚en "La liste est tri‚e"
|
||||||
|
byte Inversion; // Bool‚en "Il faut inverser les ‚l‚ments"
|
||||||
|
struct Element_de_liste_de_fileselect * Element_precedent;
|
||||||
|
struct Element_de_liste_de_fileselect * Element_courant;
|
||||||
|
struct Element_de_liste_de_fileselect * Element_suivant;
|
||||||
|
struct Element_de_liste_de_fileselect * Element_suivant_le_suivant;
|
||||||
|
|
||||||
|
// Avant de trier quoi que ce soit, on v‚rifie qu'il y ait suffisamment
|
||||||
|
// d'‚l‚ments pour qu'il soit possibles qu'ils soient en d‚sordre:
|
||||||
|
if (Liste_Nb_elements>1)
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// Par d‚faut, on considŠre que la liste est tri‚e
|
||||||
|
La_liste_est_triee=1;
|
||||||
|
|
||||||
|
Element_courant=Liste_du_fileselect;
|
||||||
|
Element_suivant=Element_courant->Suivant;
|
||||||
|
|
||||||
|
while ( (Element_courant!=NULL) && (Element_suivant!=NULL) )
|
||||||
|
{
|
||||||
|
// On commence par supposer qu'il n'y pas pas besoin d'inversion
|
||||||
|
Inversion=0;
|
||||||
|
|
||||||
|
// Ensuite, on v‚rifie si les deux ‚l‚ments sont bien dans l'ordre ou
|
||||||
|
// non:
|
||||||
|
|
||||||
|
// Si l'‚l‚ment courant est un fichier est que le suivant est
|
||||||
|
// un r‚pertoire -> Inversion
|
||||||
|
if ( (Element_courant->Type==0) && (Element_suivant->Type==1) )
|
||||||
|
Inversion=1;
|
||||||
|
// Si les deux ‚l‚ments sont de mˆme type et que le nom du suivant
|
||||||
|
// est plus petit que celui du courant -> Inversion
|
||||||
|
else if ( (Element_courant->Type==Element_suivant->Type) &&
|
||||||
|
(strcmp(Element_courant->Nom,Element_suivant->Nom)>0) )
|
||||||
|
Inversion=1;
|
||||||
|
|
||||||
|
|
||||||
|
if (Inversion)
|
||||||
|
{
|
||||||
|
// Si les deux ‚l‚ments n‚cessitent d'ˆtre invers‚:
|
||||||
|
|
||||||
|
// On les inverses:
|
||||||
|
|
||||||
|
// On note avant tout les ‚l‚ments qui encapsulent nos deux amis
|
||||||
|
Element_precedent =Element_courant->Precedent;
|
||||||
|
Element_suivant_le_suivant=Element_suivant->Suivant;
|
||||||
|
|
||||||
|
// On permute le chaŒnage des deux ‚l‚ments entree eux
|
||||||
|
Element_courant->Suivant =Element_suivant_le_suivant;
|
||||||
|
Element_courant->Precedent=Element_suivant;
|
||||||
|
Element_suivant->Suivant =Element_courant;
|
||||||
|
Element_suivant->Precedent=Element_precedent;
|
||||||
|
|
||||||
|
// On tente un chaŒnage des ‚l‚ments encapsulant les compŠres:
|
||||||
|
if (Element_precedent!=NULL)
|
||||||
|
Element_precedent->Suivant=Element_suivant;
|
||||||
|
if (Element_suivant_le_suivant!=NULL)
|
||||||
|
Element_suivant_le_suivant->Precedent=Element_courant;
|
||||||
|
|
||||||
|
// On fait bien attention … modifier la tˆte de liste en cas de besoin
|
||||||
|
if (Element_courant==Liste_du_fileselect)
|
||||||
|
Liste_du_fileselect=Element_suivant;
|
||||||
|
|
||||||
|
// Ensuite, on se pr‚pare … ‚tudier les ‚l‚ments pr‚c‚dents:
|
||||||
|
Element_courant=Element_precedent;
|
||||||
|
|
||||||
|
// Et on constate que la liste n'‚tait pas encore g‚nialement tri‚e
|
||||||
|
La_liste_est_triee=0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Si les deux ‚l‚ments sont dans l'ordre:
|
||||||
|
|
||||||
|
// On passe aux suivants
|
||||||
|
Element_courant=Element_courant->Suivant;
|
||||||
|
Element_suivant=Element_suivant->Suivant;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (!La_liste_est_triee);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -- Affichage des ‚l‚ments de la liste de fichier / r‚pertoire ------------
|
||||||
|
void Afficher_la_liste_des_fichiers(short Decalage_premier,short Decalage_select)
|
||||||
|
//
|
||||||
|
// Decalage_premier = D‚calage entre le premier fichier visible dans le
|
||||||
|
// s‚lecteur et le premier fichier de la liste
|
||||||
|
//
|
||||||
|
// Decalage_select = D‚calage entre le premier fichier visible dans le
|
||||||
|
// s‚lecteur et le fichier s‚lectionn‚ dans la liste
|
||||||
|
//
|
||||||
|
{
|
||||||
|
struct Element_de_liste_de_fileselect * Element_courant;
|
||||||
|
byte Indice; // Indice du fichier qu'on affiche (0 -> 9)
|
||||||
|
byte Couleur_texte;
|
||||||
|
byte Couleur_fond;
|
||||||
|
|
||||||
|
|
||||||
|
// On v‚rifie s'il y a au moins 1 fichier dans la liste:
|
||||||
|
if (Liste_Nb_elements>0)
|
||||||
|
{
|
||||||
|
// On commence par chercher … pointer sur le premier fichier visible:
|
||||||
|
Element_courant=Liste_du_fileselect;
|
||||||
|
for (;Decalage_premier>0;Decalage_premier--)
|
||||||
|
Element_courant=Element_courant->Suivant;
|
||||||
|
|
||||||
|
// Pour chacun des 10 ‚l‚ments inscriptibles … l'‚cran
|
||||||
|
for (Indice=0;Indice<10;Indice++)
|
||||||
|
{
|
||||||
|
// S'il est s‚lectionn‚:
|
||||||
|
if (!Decalage_select)
|
||||||
|
{
|
||||||
|
// Si c'est un fichier
|
||||||
|
if (Element_courant->Type==0)
|
||||||
|
Couleur_texte=COULEUR_FICHIER_SELECT;
|
||||||
|
else
|
||||||
|
Couleur_texte=COULEUR_REPERTOIRE_SELECT;
|
||||||
|
|
||||||
|
Couleur_fond=COULEUR_FOND_SELECT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Si c'est un fichier
|
||||||
|
if (Element_courant->Type==0)
|
||||||
|
Couleur_texte=COULEUR_FICHIER_NORMAL;
|
||||||
|
else
|
||||||
|
Couleur_texte=COULEUR_REPERTOIRE_NORMAL;
|
||||||
|
|
||||||
|
Couleur_fond=COULEUR_FOND_NORMAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// On affiche l'‚l‚ment
|
||||||
|
Print_dans_fenetre(9,90+(Indice<<3),Element_courant->Nom,Couleur_texte,Couleur_fond);
|
||||||
|
|
||||||
|
// On passe … la ligne suivante
|
||||||
|
Decalage_select--;
|
||||||
|
Element_courant=Element_courant->Suivant;
|
||||||
|
if (!Element_courant)
|
||||||
|
break;
|
||||||
|
} // Fin de la boucle d'affichage
|
||||||
|
|
||||||
|
} // Fin du test d'existence de fichiers
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -- R‚cup‚rer le libell‚ d'un ‚l‚ment de la liste -------------------------
|
||||||
|
void Determiner_element_de_la_liste(short Decalage_premier,short Decalage_select,char * Libelle)
|
||||||
|
//
|
||||||
|
// Decalage_premier = D‚calage entre le premier fichier visible dans le
|
||||||
|
// s‚lecteur et le premier fichier de la liste
|
||||||
|
//
|
||||||
|
// Decalage_select = D‚calage entre le premier fichier visible dans le
|
||||||
|
// s‚lecteur et le fichier … r‚cup‚rer
|
||||||
|
//
|
||||||
|
// Libelle = Chaine de r‚ception du libell‚ de l'‚l‚ment
|
||||||
|
//
|
||||||
|
{
|
||||||
|
struct Element_de_liste_de_fileselect * Element_courant;
|
||||||
|
char * Curseur;
|
||||||
|
|
||||||
|
|
||||||
|
// On v‚rifie s'il y a au moins 1 fichier dans la liste:
|
||||||
|
if (Liste_Nb_elements>0)
|
||||||
|
{
|
||||||
|
// On commence par chercher … pointer sur le premier fichier visible:
|
||||||
|
Element_courant=Liste_du_fileselect;
|
||||||
|
for (;Decalage_premier>0;Decalage_premier--)
|
||||||
|
Element_courant=Element_courant->Suivant;
|
||||||
|
|
||||||
|
// Ensuite, on saute autant d'‚l‚ments que le d‚calage demand‚:
|
||||||
|
for (;Decalage_select>0;Decalage_select--)
|
||||||
|
Element_courant=Element_courant->Suivant;
|
||||||
|
|
||||||
|
// On recopie la chaŒne en la d‚formatant (i.e. tous les chars sauf ' ')
|
||||||
|
for (Curseur=Element_courant->Nom;*Curseur!='\0';Curseur++)
|
||||||
|
if (*Curseur!=' ')
|
||||||
|
*(Libelle++)=*Curseur;
|
||||||
|
*Libelle='\0';
|
||||||
|
} // Fin du test d'existence de fichiers
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------- D‚placements dans la liste de fichiers -----------------
|
||||||
|
|
||||||
|
void Select_Scroll_Down(short * Decalage_premier,short * Decalage_select)
|
||||||
|
// Fait scroller vers le bas le s‚lecteur de fichier... (si possible)
|
||||||
|
{
|
||||||
|
if ( ((*Decalage_select)<9)
|
||||||
|
&& ( (*Decalage_select)+1 < Liste_Nb_elements ) )
|
||||||
|
// Si la s‚lection peut descendre
|
||||||
|
Afficher_la_liste_des_fichiers(*Decalage_premier,++(*Decalage_select));
|
||||||
|
else // Sinon, descendre la fenˆtre (si possible)
|
||||||
|
if ((*Decalage_premier)+10<Liste_Nb_elements)
|
||||||
|
Afficher_la_liste_des_fichiers(++(*Decalage_premier),*Decalage_select);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Select_Scroll_Up(short * Decalage_premier,short * Decalage_select)
|
||||||
|
// Fait scroller vers le haut le s‚lecteur de fichier... (si possible)
|
||||||
|
{
|
||||||
|
if ((*Decalage_select)>0)
|
||||||
|
// Si la s‚lection peut monter
|
||||||
|
Afficher_la_liste_des_fichiers(*Decalage_premier,--(*Decalage_select));
|
||||||
|
else // Sinon, monter la fenˆtre (si possible)
|
||||||
|
if ((*Decalage_premier)>0)
|
||||||
|
Afficher_la_liste_des_fichiers(--(*Decalage_premier),*Decalage_select);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Select_Page_Down(short * Decalage_premier,short * Decalage_select)
|
||||||
|
{
|
||||||
|
if (Liste_Nb_elements-1>*Decalage_premier+*Decalage_select)
|
||||||
|
{
|
||||||
|
if (*Decalage_select<9)
|
||||||
|
{
|
||||||
|
if (Liste_Nb_elements<10)
|
||||||
|
{
|
||||||
|
*Decalage_premier=0;
|
||||||
|
*Decalage_select=Liste_Nb_elements-1;
|
||||||
|
}
|
||||||
|
else *Decalage_select=9;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Liste_Nb_elements>*Decalage_premier+18)
|
||||||
|
*Decalage_premier+=9;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*Decalage_premier=Liste_Nb_elements-10;
|
||||||
|
*Decalage_select=9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Afficher_la_liste_des_fichiers(*Decalage_premier,*Decalage_select);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Select_Page_Up(short * Decalage_premier,short * Decalage_select)
|
||||||
|
{
|
||||||
|
if (*Decalage_premier+*Decalage_select>0)
|
||||||
|
{
|
||||||
|
if (*Decalage_select>0)
|
||||||
|
*Decalage_select=0;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (*Decalage_premier>9)
|
||||||
|
*Decalage_premier-=9;
|
||||||
|
else
|
||||||
|
*Decalage_premier=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Afficher_la_liste_des_fichiers(*Decalage_premier,*Decalage_select);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Select_End(short * Decalage_premier,short * Decalage_select)
|
||||||
|
{
|
||||||
|
if (Liste_Nb_elements<10)
|
||||||
|
{
|
||||||
|
*Decalage_premier=0;
|
||||||
|
*Decalage_select=Liste_Nb_elements-1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*Decalage_premier=Liste_Nb_elements-10;
|
||||||
|
*Decalage_select=9;
|
||||||
|
}
|
||||||
|
Afficher_la_liste_des_fichiers(*Decalage_premier,*Decalage_select);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Select_Home(short * Decalage_premier,short * Decalage_select)
|
||||||
|
{
|
||||||
|
Afficher_la_liste_des_fichiers((*Decalage_premier)=0,(*Decalage_select)=0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
short Calculer_decalage_click_dans_fileselector(void)
|
||||||
|
/*
|
||||||
|
Renvoie le d‚calage dans le s‚lecteur de fichier sur lequel on a click‚.
|
||||||
|
Renvoie le d‚calage du dernier fichier si on a click‚ au del….
|
||||||
|
Renvoie -1 si le s‚lecteur est vide.
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
short Decalage_calcule;
|
||||||
|
|
||||||
|
Decalage_calcule=(((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y)-90)>>3;
|
||||||
|
if (Decalage_calcule>=Liste_Nb_elements)
|
||||||
|
Decalage_calcule=Liste_Nb_elements-1;
|
||||||
|
|
||||||
|
return Decalage_calcule;
|
||||||
|
}
|
||||||
33
files.h
Normal file
33
files.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// Modifie Principal_Repertoire_courant en y mettant sa nouvelle valeur
|
||||||
|
// (avec le nom du disque)
|
||||||
|
int Determiner_repertoire_courant(void);
|
||||||
|
// D‚termine si un r‚pertoire pass‚ en paramŠtre existe ou non dans le
|
||||||
|
// r‚pertoire courant.
|
||||||
|
int Repertoire_existe(char * Repertoire);
|
||||||
|
// D‚termine si un fichier pass‚ en paramŠtre existe ou non dans le
|
||||||
|
// r‚pertoire courant.
|
||||||
|
int Fichier_existe(char * Fichier);
|
||||||
|
|
||||||
|
// -- Destruction de la liste chaŒn‚e ---------------------------------------
|
||||||
|
void Detruire_liste_du_fileselect(void);
|
||||||
|
// -- Lecture d'une liste de fichiers ---------------------------------------
|
||||||
|
void Lire_liste_des_fichiers(byte Format_demande);
|
||||||
|
// -- Tri de la liste des fichiers et r‚pertoires ---------------------------
|
||||||
|
void Trier_la_liste_des_fichiers(void);
|
||||||
|
// -- Affichage des ‚l‚ments de la liste de fichier / r‚pertoire ------------
|
||||||
|
void Afficher_la_liste_des_fichiers(short Decalage_premier,short Decalage_select);
|
||||||
|
// -- R‚cup‚rer le libell‚ d'un ‚l‚ment de la liste -------------------------
|
||||||
|
void Determiner_element_de_la_liste(short Decalage_premier,short Decalage_select,char * Libelle);
|
||||||
|
|
||||||
|
// -- D‚placements dans la liste des fichiers -------------------------------
|
||||||
|
|
||||||
|
void Select_Scroll_Down(short * Decalage_premier,short * Decalage_select);
|
||||||
|
void Select_Scroll_Up (short * Decalage_premier,short * Decalage_select);
|
||||||
|
void Select_Page_Down (short * Decalage_premier,short * Decalage_select);
|
||||||
|
void Select_Page_Up (short * Decalage_premier,short * Decalage_select);
|
||||||
|
void Select_End (short * Decalage_premier,short * Decalage_select);
|
||||||
|
void Select_Home (short * Decalage_premier,short * Decalage_select);
|
||||||
|
|
||||||
|
short Calculer_decalage_click_dans_fileselector(void);
|
||||||
|
|
||||||
|
char * Nom_formate(char * Nom);
|
||||||
289
gfx2.ini
Normal file
289
gfx2.ini
Normal file
@ -0,0 +1,289 @@
|
|||||||
|
###### GrafX2 initialization file ###### Fichier d'initialisation de GrafX2 ##
|
||||||
|
# # # #
|
||||||
|
# You may modify this file with any # Vous pouvez modifier ce fichier avec #
|
||||||
|
# standard ASCII text editor. # n'importe quel ‚diteur de texte #
|
||||||
|
# # ASCII standard. #
|
||||||
|
# # #
|
||||||
|
# Comments are preceded by ';' or # Les commentaires sont pr‚c‚d‚s par #
|
||||||
|
# '#'. # ';' ou '#'. #
|
||||||
|
# # #
|
||||||
|
# Options are not case sensitive and # Les options ne sont pas sensibles … #
|
||||||
|
# spaces are ignored. # la casse et les espaces sont ignor‚s.#
|
||||||
|
# # #
|
||||||
|
# You must not change the order of # Vous ne devez pas changer l'ordre #
|
||||||
|
# the sections and their options. # des sections et de leurs options. #
|
||||||
|
# You must not delete or put into # Vous ne devez pas effacer ou mettre #
|
||||||
|
# comment any section nor option. # en commentaire une section ou option.#
|
||||||
|
# # #
|
||||||
|
# Each option is preceded by a # Chaque option est pr‚c‚d‚e par un #
|
||||||
|
# comment which explains its meaning. # commentaire qui explique sa fonction.#
|
||||||
|
# # #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[MOUSE] # [SOURIS]
|
||||||
|
|
||||||
|
; The sensitivity of the mouse can ³ La sensibilit‚ de la souris peut
|
||||||
|
; take values from 1 to 64. The ³ prendre des valeurs de 1 … 64. Plus
|
||||||
|
; smaller values, the faster. ³ les valeurs sont petites, plus c'est
|
||||||
|
; ³ rapide.
|
||||||
|
X_sensitivity = 3 ; (default 3)
|
||||||
|
Y_sensitivity = 3 ; (default 3)
|
||||||
|
|
||||||
|
; Due to the fact that those stupid ³ A cause du fait que ces imb‚ciles de
|
||||||
|
; mouse drivers' makers don't care ³ programmeurs de gestionnaires de
|
||||||
|
; if the mouse moves by steps of 2, ³ souris se fichent que votre souris se
|
||||||
|
; 4 or even 8 pixels, we have to ³ deplace par pas de 2, 4 ou mˆme 8
|
||||||
|
; stretch the virtual area of the ³ pixels, nous devons ‚largir la zone
|
||||||
|
; mouse and divide coordinates to ³ virtuelle de la souris et diviser les
|
||||||
|
; get a one-pixel step motion. ³ coordonn‚es pour obtenir un pas de 1.
|
||||||
|
; (Warning: the mouse movement can ³ (Attention: le d‚placement de la
|
||||||
|
; be correct in some video modes ³ souris peut ˆtre correct dans certains
|
||||||
|
; but not in others... But all the ³ modes vid‚os mais pas dans d'autres...
|
||||||
|
; "Modes X" should behave the same ³ Mais tout les Modes X devraient se
|
||||||
|
; way, so you won't have to test ³ comporter de la mˆme maniŠre, donc
|
||||||
|
; them all). ³ vous n'aurez pas … tous les tester.
|
||||||
|
; A correction factor of 0 means ³ Un facteur de correction de 0 signifie
|
||||||
|
; that you are very lucky because ³ que vous avez de la chace car votre
|
||||||
|
; your driver doesn't need any ³ driver n'a pas besoin de correction.
|
||||||
|
; correction. If you set the ³ Si vous d‚finissez le facteur de
|
||||||
|
; correction factor to 1, it means ³ correction … 1, cela signifie que
|
||||||
|
; that your mouse moves by steps of ³ votre souris se d‚place par pas de 2
|
||||||
|
; 2 pixels; 2 for 4; 3 for 8, etc...³ pixels; 2 pour 4; 3 pour 8, etc...
|
||||||
|
; If you want to use GrafX2 in a ³ Si vous d‚sirez lancer GrafX2 dans une
|
||||||
|
; Win95 window, you should turn ³ fenˆtre Windows95, vous devriez passer
|
||||||
|
; these values to 0 (and increase X ³ ces valeurs … 0 (et augmenter les sen-
|
||||||
|
; and Y sensitivities above). ³ sibilit‚s X et Y d‚finies plus haut).
|
||||||
|
X_correction_factor = 3 ; (default 3)
|
||||||
|
Y_correction_factor = 3 ; (default 3)
|
||||||
|
|
||||||
|
; Aspect of the main cursor (cross) ³ Aspect du curseur principal (croix)
|
||||||
|
; 1: Solid ³ 1: Solide
|
||||||
|
; 2: Transparent ³ 2: Transparent
|
||||||
|
; 3: Thin (solid) ³ 3: Fin (solide)
|
||||||
|
Cursor_aspect = 1 ; (default 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[MENU] # [MENU]
|
||||||
|
|
||||||
|
; Colors of the menus (the black ³ Couleurs des menus (la couleur noire
|
||||||
|
; and the white colors cannot be ³ et la couleur blanche ne peuvent pas
|
||||||
|
; modified). ³ ˆtre modifi‚es).
|
||||||
|
; Values are in {Red,Green,Blue} ³ Les valeurs sont dans l'ordre {Rouge,
|
||||||
|
; order and are between 0 and 63. ³ Vert,Bleu} et vont de 0 … 63.
|
||||||
|
Light_color = 42,42,42 ; (default 42,42,42)
|
||||||
|
Dark_color = 27,27,27 ; (default 27,27,27)
|
||||||
|
;
|
||||||
|
; Light_color = 24,25,30 ; \_ Nightmare
|
||||||
|
; Dark_color = 13,14,19 ; /
|
||||||
|
;
|
||||||
|
; Light_color = 10,45,28 ; \_ Forest
|
||||||
|
; Dark_color = 5,27,12 ; /
|
||||||
|
;
|
||||||
|
; Light_color = 48,41,26 ; \_ Gold
|
||||||
|
; Dark_color = 26,22,15 ; /
|
||||||
|
;
|
||||||
|
; Light_color = 10,40,55 ; \_ Oceanic
|
||||||
|
; Dark_color = 10,20,32 ; /
|
||||||
|
|
||||||
|
; Aspect ratio and size of the ³ Proportion des menus et de la barre
|
||||||
|
; menus and the tool-bar. ³ d'outils.
|
||||||
|
; Possible values: ³ Valeurs possibles:
|
||||||
|
; 0: Do not adapt (pixels are not ³ 0: Ne pas adapter (les pixels ne sont
|
||||||
|
; stretched) ³ pas ‚tir‚s)
|
||||||
|
; 1: Adapt the menus and the tool- ³ 1: Adapter les menus et la barre
|
||||||
|
; bar according to the resolution³ d'outils suivant la r‚solution
|
||||||
|
; 2: Slightly adapt the ratio of ³ 2: Adapter l‚gŠrement les proportions
|
||||||
|
; the menus and tool-bar ³ des menus et de la barre d'outils
|
||||||
|
Menu_ratio = 1 ; (default 1)
|
||||||
|
|
||||||
|
; Font: ³ Police de caractŠres (fonte):
|
||||||
|
; 1: Classic ³ 1: Classique
|
||||||
|
; 2: Fun ³ 2: Fun
|
||||||
|
Font = 1 ; (default 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[FILE_SELECTOR] # [SELECTEUR_DE_FICHIERS]
|
||||||
|
|
||||||
|
; Show special files and ³ Afficher les fichiers et r‚pertoires
|
||||||
|
; directories (values are 'yes' or ³ sp‚ciaux (les valeurs sont 'yes' ou
|
||||||
|
; 'no'). ³ 'no').
|
||||||
|
Show_hidden_files = no ; (default 'no')
|
||||||
|
Show_hidden_directories = no ; (default 'no')
|
||||||
|
Show_system_directories = no ; (default 'no')
|
||||||
|
|
||||||
|
; Delay before displaying a preview ³ D‚lai avant d'afficher une preview
|
||||||
|
; in file-selectors (in 18.2th of ³ dans les s‚lecteurs de fichiers (en
|
||||||
|
; second). Possible values range ³ 18.2Šmes de seconde) Les valeurs
|
||||||
|
; from 1 to 256. ³ possibles vont de 1 … 256.
|
||||||
|
Preview_delay = 8 ; (default 8)
|
||||||
|
|
||||||
|
; Maximize the preview of the ³ Maximiser la preview des images pour
|
||||||
|
; pictures so that it is as big as ³ qu'elle soit aussi grande que
|
||||||
|
; possible. If you're not in the ³ possible.
|
||||||
|
; same resolution as the picture's ³ Si vous n'ˆtes pas dans la mˆme r‚so-
|
||||||
|
; one, it can try to correct the ³ lution que celle de l'image, cela peut
|
||||||
|
; aspect ratio, but if the picture ³ essayer de corriger les proportions,
|
||||||
|
; does not fill the whole screen, ³ mais si l'image ne prend pas tout
|
||||||
|
; it can be worse. ³ l'‚cran, cela peut ˆtre pire.
|
||||||
|
Maximize_preview = no ; (default 'no')
|
||||||
|
|
||||||
|
; This option is used to place the ³ Cette option est utilis‚e pour placer
|
||||||
|
; selection bar on a filename by ³ la barre de s‚lection sur un nom de
|
||||||
|
; typing its first letters. ³ fichier en tapant ses 1Šres lettres.
|
||||||
|
; For example, if you want to find ³ Par exemple, si vous voulez trouver le
|
||||||
|
; the "PICTURE.PKM" in a directory ³ fichier "PICTURE.PKM" dans un r‚per-
|
||||||
|
; that also contains "PALETTE.PAL", ³ toire contenant ‚galement le fichier
|
||||||
|
; you'll just have to type P and I. ³ "PALETTE.PAL", vous n'aurez qu'… taper
|
||||||
|
; The different values of "FFF" ³ P puis I.
|
||||||
|
; indicate if you want to find the ³ Les different valeurs de "FFF"
|
||||||
|
; name in both files and directories³ indiquent si vous voulez trouvez le nom
|
||||||
|
; or just in only one of these: ³ dans les fichiers ET les r‚pertoires ou
|
||||||
|
; 0: files and directories ³ simplement dans l'un OU l'autre.
|
||||||
|
; 1: files only ³ 0: fichiers et r‚pertoires
|
||||||
|
; 2: directories only ³ 1: fichiers seulement
|
||||||
|
; ³ 2: r‚pertoires seulement
|
||||||
|
Find_file_fast = 0 ; (default 0)
|
||||||
|
|
||||||
|
|
||||||
|
[LOADING] # [CHARGEMENT]
|
||||||
|
|
||||||
|
; Automatically set the resolution ³ Passer automatiquement dans la bonne
|
||||||
|
; when loading a picture. ³ r‚solution lors du chargement d'une
|
||||||
|
; You should set this value to ³ image.
|
||||||
|
; 'yes' after disabling the video ³ Vous devriez d‚finir cette option …
|
||||||
|
; modes that are not supported by ³ 'yes' aprŠs avoir inhib‚ les modes
|
||||||
|
; your video card or monitor. ³ vid‚o qui ne sont pas support‚s par
|
||||||
|
; ³ votre mat‚riel.
|
||||||
|
Auto_set_resolution = no ; (default 'no')
|
||||||
|
|
||||||
|
; If the variable above is set to ³ Si la variable ci-dessus est … 'yes',
|
||||||
|
; 'yes', this one tells if you want ³ celle-ci indique si vous voulez
|
||||||
|
; to set the resolution according ³ d‚finir la r‚solution suivant:
|
||||||
|
; to: ³ 1: les dimensions de "l'‚cran
|
||||||
|
; 1: the internal "original screen" ³ d'origine" internes … l'image
|
||||||
|
; dimensions of the picture ³ 2: les v‚ritables dimensions de
|
||||||
|
; 2: the actual dimensions of the ³ l'image
|
||||||
|
; picture ³
|
||||||
|
Set_resolution_according_to = 1 ; (default 1)
|
||||||
|
|
||||||
|
; If you load a picture with a ³ Si vous chargez une image ayant une
|
||||||
|
; palette of less than 256 colors, ³ palette de moins de 256 couleurs,
|
||||||
|
; this option defines if you want ³ cette option indique si vous souhaitez
|
||||||
|
; to clear the palette or to keep ³ effacer la palette ou bien conserver
|
||||||
|
; the colors of the previous ³ les couleurs de l'image pr‚c‚dente qui
|
||||||
|
; picture that are over the number ³ se situent au-del… du nombre de la
|
||||||
|
; of colors of the new picture. ³ nouvelle image.
|
||||||
|
; For example, if you load a ³ Par exemple, si vous chargez une image
|
||||||
|
; 32-color picture, the colors 32 ³ de 32 couleurs, les couleurs 32 … 255
|
||||||
|
; to 255 will be set to black if ³ seront pass‚es en noir si cette option
|
||||||
|
; this option is set to 'yes', or ³ est … 'yes', ou bien elles resteront
|
||||||
|
; they will be kept unchanged if ³ inchang‚es si elle est … 'no'.
|
||||||
|
; this option is set to 'no'. ³
|
||||||
|
Clear_palette = yes ; (default 'yes')
|
||||||
|
|
||||||
|
|
||||||
|
[MISCELLANEOUS] # [DIVERS]
|
||||||
|
|
||||||
|
; Draw the limits of the picture. ³ Afficher les limites de l'image
|
||||||
|
Draw_limits = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Adjust the brush grabbing in ³ Ajuster la capture de brosse en mode
|
||||||
|
; "grid" mode. ³ "grille".
|
||||||
|
Adjust_brush_pick = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Coordinates: ³ Coordonn‚es:
|
||||||
|
; 1: Relative ³ 1: Relatives
|
||||||
|
; 2: Absolute ³ 2: Absolues
|
||||||
|
Coordinates = 1 ; (default 1)
|
||||||
|
|
||||||
|
; Create a backup file when saving. ³ Cr‚er un fichier backup lors des
|
||||||
|
; ³ sauvegardes.
|
||||||
|
Backup = no ; (default 'no')
|
||||||
|
|
||||||
|
; Number of pages stored in memory ³ Nombre de pages stock‚es en m‚moire
|
||||||
|
; for "undoing". ³ destin‚es … annuler les derniŠres
|
||||||
|
; Values are between 1 and 99. ³ modifications. Valeurs entre 1 et 99.
|
||||||
|
Undo_pages = 1 ; (default 1)
|
||||||
|
|
||||||
|
; Speed of the scroll-bars (in VBLs ³ Vitesse des barre de d‚filement (en
|
||||||
|
; waited) while clicking with the ³ VBLs attendus) lorsque l'un des
|
||||||
|
; left or right button of the mouse.³ boutons de la souris est enfonc‚.
|
||||||
|
; Values can be between 1 and 255. ³ Les valeurs sont comprises entre 1 et
|
||||||
|
; The bigger values, the slower. ³ 255. Plus elles sont grandes, plus
|
||||||
|
; ³ c'est lent.
|
||||||
|
Gauges_scrolling_speed_Left = 10 ; (default 10)
|
||||||
|
Gauges_scrolling_speed_Right = 3 ; (default 3)
|
||||||
|
|
||||||
|
; Automatically save the configu- ³ Enregistre automatiquement la configu-
|
||||||
|
; ration when exiting the program. ³ ration lorsqu'on quitte le programme.
|
||||||
|
Auto_save = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Maximum number of vertices used ³ Nombre maximum de vertex utilis‚s dans
|
||||||
|
; in filled polygons and polyforms, ³ les polyg“nes et polyformes pleins, et
|
||||||
|
; and lasso. Possible values range ³ le lasso. Les valeurs possibles vont
|
||||||
|
; from 2 to 16384. ³ de 2 … 16384.
|
||||||
|
; Each vertex takes 4 bytes. ³ Chaque vertex prend 4 octets.
|
||||||
|
Vertices_per_polygon = 1024 ; (default 1024)
|
||||||
|
|
||||||
|
; Automatically zoom into the ³ Zoomer automatiquement la zone point‚e
|
||||||
|
; pointed area when you press the ³ par la souris lorsque vous appuyez sur
|
||||||
|
; short-key of the Magnifier button ³ la touche de raccourci de la loupe.
|
||||||
|
; while being above the picture. ³
|
||||||
|
Fast_zoom = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Separate the colors in the tool- ³ S‚parer les couleurs dans la barre
|
||||||
|
; bar by a black squaring. ³ d'outils par un quadrillage noir.
|
||||||
|
Separate_colors = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Initial value of the feedback for ³ Valeur initiale du "feedback" pour les
|
||||||
|
; the drawing modes (cf. docs). ³ modes de dessin (cf. docs).
|
||||||
|
FX_feedback = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; When you reduce the palette or ³ Si vous r‚duisez la palette ou "zappez"
|
||||||
|
; "zap" some colors out of it, it is³ quelques couleurs, il est possible
|
||||||
|
; possible that there are not enough³ qu'il ne reste pas assez de couleurs
|
||||||
|
; colors left to draw the menus. ³ pour afficher les menus. Mettre cette
|
||||||
|
; Switching the following variable ³ variable … 'yes' ramŠnera automatiquent
|
||||||
|
; on will bring back the colors of ³ les couleurs du menu s'il reste moins
|
||||||
|
; the menu if there are less than 4 ³ de 4 couleurs aprŠs une "r‚duction" ou
|
||||||
|
; colors left after "reducing" or ³ un "zapping".
|
||||||
|
; "zapping". ³
|
||||||
|
Safety_colors = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Display a message at startup ³ Afficher un message au d‚marrage
|
||||||
|
; telling the version number of the ³ indiquant le num‚ro de version du
|
||||||
|
; program. ³ programme.
|
||||||
|
Opening_message = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Take the Stencil into account when³ Prendre le Stencil en compte lorsqu'on
|
||||||
|
; clearing the image. ³ efface l'image.
|
||||||
|
Clear_with_stencil = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Directly set the discontinuous ³ Passer automatiquement en mode de
|
||||||
|
; freehand drawing mode after brush ³ dessin discontinu aprŠs la prise d'une
|
||||||
|
; grabbing. ³ brosse.
|
||||||
|
Auto_discontinuous = no ; (default 'no')
|
||||||
|
|
||||||
|
; Save the screen dimensions in GIF ³ Sauver les dimensions de l'‚cran dans
|
||||||
|
; files. If you want to read these ³ les fichiers GIF. Si vous voulez lire
|
||||||
|
; files with Photoshop or Alchemy, ³ ces fichiers avec Photoshop ou Alchemy,
|
||||||
|
; and maybe some other programs, you³ et peut-ˆtre d'autres programmes, vous
|
||||||
|
; must set this option to 'no'. ³ devez mettre cette option … 'no'.
|
||||||
|
Save_screen_size_in_GIF = no ; (default 'no')
|
||||||
|
|
||||||
|
; Automaticaly count the number of ³ Compter automatiquement le nombre de
|
||||||
|
; different colors used when opening³ couleurs diff‚rentes utilis‚es lors de
|
||||||
|
; the palette editor window. (Set it³ d'ouverture de la fenˆtre d'‚dition de
|
||||||
|
; to 'no' if you have a slow PC or ³ la palette. (Mettez-le … 'no' si vous
|
||||||
|
; if you edit huge pictures) ³ avez un PC lent ou bien si vous ‚ditez
|
||||||
|
; ³ d'‚normes images).
|
||||||
|
Auto_nb_colors_used = yes ; (default 'yes')
|
||||||
|
|
||||||
|
; Number of the default video mode ³ Num‚ro du mode vid‚o par d‚faut au
|
||||||
|
; at startup (see the list by typing³ d‚marrage (voir la liste en tapant
|
||||||
|
; "gfx2 /?" at the DOS prompt). ³ "gfx2 /?" sur la ligne de commande).
|
||||||
|
Default_video_mode = 0 ; (default 0)
|
||||||
BIN
gfx2_fra.cfg
Normal file
BIN
gfx2_fra.cfg
Normal file
Binary file not shown.
73
gfx2_mem.bat
Normal file
73
gfx2_mem.bat
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem This batch file will run GrafX2 with a disk cache of 16 megabytes.
|
||||||
|
rem Use it ONLY IF you don't have enough memory to run GrafX2.
|
||||||
|
rem
|
||||||
|
rem (Ce fichier de commandes lancera GrafX2 avec un cache disque de 16 Mo.
|
||||||
|
rem Ne l'utilisez QUE SI vous n'avez pas assez de m‚moire pour lancer GrafX2.)
|
||||||
|
rem
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Modify the following line in order to indicate the path to DOS4GW.EXE.
|
||||||
|
rem (Modifiez la ligne suivante afin d'indiquer le chemin de DOS4GW.EXE)
|
||||||
|
rem
|
||||||
|
|
||||||
|
set PATHDOS4GW=DOS4GW.EXE
|
||||||
|
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem Modify the following line in order to indicate the path to GFX2.EXE.
|
||||||
|
rem (Modifiez la ligne suivante afin d'indiquer le chemin de GFX2.EXE)
|
||||||
|
rem
|
||||||
|
|
||||||
|
set PATHGFX2=C:\GFX2\GFX2.EXE
|
||||||
|
|
||||||
|
|
||||||
|
if "%1"=="/novm" goto NOVM
|
||||||
|
rem
|
||||||
|
rem The following line may not work correctly on some computers. In this case,
|
||||||
|
rem please read the DOS4GW manual which is not supplied with GrafX2.
|
||||||
|
rem
|
||||||
|
rem (La ligne suivante peut ne pas fonctionner correctement sur certains
|
||||||
|
rem ordinateurs. Dans ce cas, veuillez vous r‚f‚rer au manuel de DOS4GW qui
|
||||||
|
rem n'est pas fourni avec GrafX2)
|
||||||
|
rem
|
||||||
|
|
||||||
|
set DOS4GVM=1
|
||||||
|
:NOVM
|
||||||
|
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem The following lines will execute GrafX2
|
||||||
|
rem (Les lignes suivantes ‚x‚cuteront GrafX2)
|
||||||
|
rem
|
||||||
|
|
||||||
|
if not exist %PATHDOS4GW% goto DOSNOTFOUND
|
||||||
|
if not exist %PATHGFX2% goto GFXNOTFOUND
|
||||||
|
|
||||||
|
if "%1"=="/novm" goto RUNNOVM
|
||||||
|
%PATHDOS4GW% %PATHGFX2% %1
|
||||||
|
goto END
|
||||||
|
:RUNNOVM
|
||||||
|
%PATHDOS4GW% %PATHGFX2% %2
|
||||||
|
goto END
|
||||||
|
|
||||||
|
:DOSNOTFOUND
|
||||||
|
echo DOS4GW.EXE not found: please edit the GFX2_MEM.BAT file and enter its location.
|
||||||
|
goto END
|
||||||
|
:GFXNOTFOUND
|
||||||
|
echo GFX2.EXE not found: please edit the GFX2_MEM.BAT file and enter its location.
|
||||||
|
:END
|
||||||
|
|
||||||
|
|
||||||
|
rem
|
||||||
|
rem The following lines will remove all the environnement variables.
|
||||||
|
rem (Les lignes suivantes supprimeront toutes les variables d'environnement)
|
||||||
|
rem
|
||||||
|
|
||||||
|
set DOS4GVM=
|
||||||
|
set PATHGFX2=
|
||||||
|
set PATHDOS4GW=
|
||||||
756
global.h
Normal file
756
global.h
Normal file
@ -0,0 +1,756 @@
|
|||||||
|
#ifdef VARIABLES_GLOBALES
|
||||||
|
#define GLOBAL
|
||||||
|
#else
|
||||||
|
#define GLOBAL extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
// //
|
||||||
|
// Ce fichier contient les d‚claration des variables globales //
|
||||||
|
// //
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
// -- Section des variables de CONFIGURATION ---------------------------------
|
||||||
|
|
||||||
|
#ifndef _GLOBAL_H_
|
||||||
|
#define _GLOBAL_H_
|
||||||
|
|
||||||
|
#include <SDL/SDL.h>
|
||||||
|
#include "struct.h"
|
||||||
|
|
||||||
|
GLOBAL struct S_Config
|
||||||
|
{
|
||||||
|
byte Fonte;
|
||||||
|
int Lire_les_fichiers_caches;
|
||||||
|
int Lire_les_repertoires_caches;
|
||||||
|
int Lire_les_repertoires_systemes;
|
||||||
|
byte Afficher_limites_image;
|
||||||
|
byte Curseur;
|
||||||
|
byte Maximize_preview;
|
||||||
|
byte Auto_set_res;
|
||||||
|
byte Coords_rel;
|
||||||
|
byte Backup;
|
||||||
|
byte Adjust_brush_pick;
|
||||||
|
byte Auto_save;
|
||||||
|
byte Nb_pages_Undo;
|
||||||
|
byte Indice_Sensibilite_souris_X;
|
||||||
|
byte Indice_Sensibilite_souris_Y;
|
||||||
|
byte Mouse_Facteur_de_correction_X;
|
||||||
|
byte Mouse_Facteur_de_correction_Y;
|
||||||
|
byte Valeur_tempo_jauge_gauche;
|
||||||
|
byte Valeur_tempo_jauge_droite;
|
||||||
|
long Chrono_delay;
|
||||||
|
struct Composantes Coul_menu_pref[4];
|
||||||
|
int Nb_max_de_vertex_par_polygon;
|
||||||
|
byte Clear_palette;
|
||||||
|
byte Set_resolution_according_to;
|
||||||
|
byte Ratio;
|
||||||
|
byte Fast_zoom;
|
||||||
|
byte Find_file_fast;
|
||||||
|
byte Couleurs_separees;
|
||||||
|
byte FX_Feedback;
|
||||||
|
byte Safety_colors;
|
||||||
|
byte Opening_message;
|
||||||
|
byte Clear_with_stencil;
|
||||||
|
byte Auto_discontinuous;
|
||||||
|
byte Taille_ecran_dans_GIF;
|
||||||
|
byte Auto_nb_used;
|
||||||
|
byte Resolution_par_defaut;
|
||||||
|
} Config;
|
||||||
|
|
||||||
|
// Tableau des touches sp‚ciales
|
||||||
|
GLOBAL word Config_Touche[NB_TOUCHES_SPECIALES];
|
||||||
|
|
||||||
|
|
||||||
|
GLOBAL struct S_Mode_video
|
||||||
|
{
|
||||||
|
short Largeur;
|
||||||
|
short Hauteur;
|
||||||
|
byte Mode;
|
||||||
|
word Facteur_X;
|
||||||
|
word Facteur_Y;
|
||||||
|
char Ratio[5];
|
||||||
|
signed char Refresh; // <0 => entrelac‚
|
||||||
|
word Mode_VESA_de_base;
|
||||||
|
void * Pointeur;
|
||||||
|
byte Etat; // 0:Cool 1:OK ; 2:Bof ; 3:Naze ; si on rajoute +128 => incompatible
|
||||||
|
};
|
||||||
|
GLOBAL struct S_Mode_video Mode_video[NB_MODES_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
|
||||||
|
|
||||||
|
GLOBAL T_Palette Palette_defaut;
|
||||||
|
|
||||||
|
// Couleurs du menu
|
||||||
|
|
||||||
|
GLOBAL byte CM_Noir;
|
||||||
|
GLOBAL byte CM_Fonce;
|
||||||
|
GLOBAL byte CM_Clair;
|
||||||
|
GLOBAL byte CM_Blanc;
|
||||||
|
GLOBAL byte CM_Trans;
|
||||||
|
GLOBAL struct Composantes Coul_menu_pref[4];
|
||||||
|
|
||||||
|
// Etat des entr‚es
|
||||||
|
|
||||||
|
GLOBAL word Mouse_X; // Abscisse de la souris
|
||||||
|
GLOBAL word Mouse_Y; // Ordonn‚e de la souris
|
||||||
|
GLOBAL byte Mouse_K; // Etat des boutons de la souris
|
||||||
|
GLOBAL word Touche;
|
||||||
|
GLOBAL Uint8* Etat_Du_Clavier; // Scancode de la touche en cours et etat des touches de ctrl
|
||||||
|
GLOBAL byte Touche_ASCII; // Code ASCII de la touche en cours
|
||||||
|
|
||||||
|
GLOBAL byte Mouse_Facteur_de_correction_X;
|
||||||
|
GLOBAL byte Mouse_Facteur_de_correction_Y;
|
||||||
|
|
||||||
|
GLOBAL byte Autoriser_changement_de_couleur_pendant_operation;
|
||||||
|
|
||||||
|
// Donn‚es sur le curseur
|
||||||
|
|
||||||
|
GLOBAL byte Forme_curseur;
|
||||||
|
GLOBAL byte Forme_curseur_avant_fenetre; // Forme du curseur avant l'ouverture d'une fenˆtre
|
||||||
|
GLOBAL byte Forcer_affichage_curseur; // Forcer l'affichage du curseur au prochain Get_input();
|
||||||
|
GLOBAL byte Cacher_curseur;
|
||||||
|
GLOBAL byte Curseur_dans_menu; // Bool‚en "Le curseur se trouve dans le menu"
|
||||||
|
GLOBAL byte Curseur_dans_menu_precedent; // Bool‚en "Le curseur se trouvait pr‚c‚demment dans le menu"
|
||||||
|
GLOBAL word Curseur_Decalage_X[NB_SPRITES_CURSEUR]; // Coordonn‚es X du point sensible de curseurs en sprite
|
||||||
|
GLOBAL word Curseur_Decalage_Y[NB_SPRITES_CURSEUR]; // Coordonn‚es Y du point sensible de curseurs en sprite
|
||||||
|
GLOBAL byte SPRITE_CURSEUR[NB_SPRITES_CURSEUR][HAUTEUR_SPRITE_CURSEUR][LARGEUR_SPRITE_CURSEUR]; // Dessins des sprites de curseur
|
||||||
|
GLOBAL byte FOND_CURSEUR[HAUTEUR_SPRITE_CURSEUR][LARGEUR_SPRITE_CURSEUR]; // Contenu du dessous du curseur
|
||||||
|
|
||||||
|
// Donn‚es sur le pinceau
|
||||||
|
|
||||||
|
GLOBAL byte Pinceau_Forme;
|
||||||
|
GLOBAL byte Pinceau_Forme_avant_fill;
|
||||||
|
GLOBAL byte Pinceau_Forme_avant_pipette;
|
||||||
|
GLOBAL byte Pinceau_Forme_avant_lasso;
|
||||||
|
GLOBAL byte Cacher_pinceau;
|
||||||
|
GLOBAL short Pinceau_X;
|
||||||
|
GLOBAL short Pinceau_Y;
|
||||||
|
GLOBAL byte SPRITE_PINCEAU [NB_SPRITES_PINCEAU][HAUTEUR_PINCEAU][LARGEUR_PINCEAU];
|
||||||
|
GLOBAL word Pinceau_predefini_Largeur[NB_SPRITES_PINCEAU];
|
||||||
|
GLOBAL word Pinceau_predefini_Hauteur[NB_SPRITES_PINCEAU];
|
||||||
|
GLOBAL byte Pinceau_Type[NB_SPRITES_PINCEAU];
|
||||||
|
GLOBAL word Pinceau_predefini_Decalage_X[NB_SPRITES_PINCEAU];
|
||||||
|
GLOBAL word Pinceau_predefini_Decalage_Y[NB_SPRITES_PINCEAU];
|
||||||
|
GLOBAL byte * Pinceau_Sprite;
|
||||||
|
GLOBAL short Pinceau_Largeur;
|
||||||
|
GLOBAL short Pinceau_Hauteur;
|
||||||
|
GLOBAL short Pinceau_Decalage_X;
|
||||||
|
GLOBAL short Pinceau_Decalage_Y;
|
||||||
|
|
||||||
|
// Commandes graphiques
|
||||||
|
|
||||||
|
GLOBAL fonction_afficheur Pixel; // Affiche un point … l'‚cran
|
||||||
|
GLOBAL fonction_afficheur Pixel_dans_menu;// Affiche un point dans le menu (ou pas si le menu est invisible)
|
||||||
|
GLOBAL fonction_lecteur Lit_pixel; // Teste la couleur d'un pixel dans l'‚cran
|
||||||
|
GLOBAL fonction_effaceur Clear_screen; // Efface rapidement tout l'‚cran (en faisant attention de ne pas effacer le menu)
|
||||||
|
GLOBAL fonction_display Display_screen; // Affiche rapidement tout l'‚cran (en faisant attention de ne pas effacer le menu)
|
||||||
|
GLOBAL fonction_block Block; // Affiche rapidement un bloc … l'‚cran
|
||||||
|
GLOBAL fonction_afficheur Pixel_Preview_Normal; // Affiche un point de l'image … l'‚cran en mode normal (pas en mode loupe)
|
||||||
|
GLOBAL fonction_afficheur Pixel_Preview_Loupe; // Affiche un point de l'image … l'‚cran en mode loupe
|
||||||
|
GLOBAL fonction_afficheur Pixel_Preview; // Affiche un point de l'image … l'‚cran en fonction de l'‚tat du mode loupe
|
||||||
|
GLOBAL fonction_Ligne_XOR Ligne_horizontale_XOR;// Affiche une ligne horizontale en XOR (pour placer la loupe)
|
||||||
|
GLOBAL fonction_Ligne_XOR Ligne_verticale_XOR; // Affiche une ligne verticale en XOR (pour placer la loupe)
|
||||||
|
GLOBAL fonction_display_brush_Color Display_brush_Color; // Affiche une partie de la brosse en couleur
|
||||||
|
GLOBAL fonction_display_brush_Mono Display_brush_Mono; // Affiche une partie de la brosse en monochrome
|
||||||
|
GLOBAL fonction_display_brush_Color Clear_brush; // Efface la partie de la brosse affich‚e … l'‚cran
|
||||||
|
GLOBAL fonction_remap Remap_screen; // Remappe une partie de l'‚cran avec les nouvelles couleurs du menu
|
||||||
|
GLOBAL fonction_procsline Afficher_ligne; // Afficher une ligne
|
||||||
|
GLOBAL fonction_procsline Lire_ligne; // Afficher ou lire une ligne
|
||||||
|
GLOBAL fonction_display_zoom Display_zoomed_screen; // Affiche rapidement toute la partie zoom‚e … l'‚cran (en faisant attention de ne pas effacer le menu)
|
||||||
|
GLOBAL fonction_display_brush_Color_zoom Display_brush_Color_zoom;
|
||||||
|
GLOBAL fonction_display_brush_Mono_zoom Display_brush_Mono_zoom;
|
||||||
|
GLOBAL fonction_display_brush_Color_zoom Clear_brush_zoom;
|
||||||
|
|
||||||
|
// Donn‚es sur les dimensions de l'‚cran
|
||||||
|
|
||||||
|
GLOBAL int Resolution_actuelle; // R‚solution graphique courante
|
||||||
|
GLOBAL short Ecran_original_X; // |_ Dimensions de l'‚cran d'origine de
|
||||||
|
GLOBAL short Ecran_original_Y; // | l'image qui vient d'ˆtre charg‚e.
|
||||||
|
GLOBAL short Largeur_ecran; // Largeur de l'‚cran
|
||||||
|
GLOBAL short Hauteur_ecran; // Hauteur de l'‚cran
|
||||||
|
GLOBAL short Limite_Haut; // |
|
||||||
|
GLOBAL short Limite_Bas; // |_ Limites dans lesquelles
|
||||||
|
GLOBAL short Limite_Gauche; // | on peut ‚crire
|
||||||
|
GLOBAL short Limite_Droite; // |
|
||||||
|
GLOBAL short Limite_visible_Bas; // |_ Derniers points visibles
|
||||||
|
GLOBAL short Limite_visible_Droite; // | "… l'image"
|
||||||
|
|
||||||
|
GLOBAL short Limite_Haut_Zoom; // |
|
||||||
|
GLOBAL short Limite_Bas_Zoom; // |_ Limites dans lesquelles on peut
|
||||||
|
GLOBAL short Limite_Gauche_Zoom; // | ‚crire dans la partie zoom‚e
|
||||||
|
GLOBAL short Limite_Droite_Zoom; // |
|
||||||
|
GLOBAL short Limite_visible_Bas_Zoom; // |_ Derniers points visibles "…
|
||||||
|
GLOBAL short Limite_visible_Droite_Zoom; // | l'image" dans la partie zoom‚e
|
||||||
|
|
||||||
|
GLOBAL byte * Buffer_de_ligne_horizontale; // Buffer d'affichage de lignes
|
||||||
|
|
||||||
|
// Donn‚es sur l'image actuelle:
|
||||||
|
|
||||||
|
GLOBAL byte * Principal_Ecran; // Ecran virtuel courant
|
||||||
|
GLOBAL T_Palette Principal_Palette; // Palette de l'‚cran en cours
|
||||||
|
|
||||||
|
GLOBAL byte Principal_Image_modifiee; // L'image courante a ‚t‚ modifi‚e
|
||||||
|
GLOBAL short Principal_Largeur_image; // Largeur de l'image dans laquelle l'utilisateur d‚sire travailler
|
||||||
|
GLOBAL short Principal_Hauteur_image; // Hauteur de l'image dans laquelle l'utilisateur d‚sire travailler
|
||||||
|
GLOBAL short Principal_Decalage_X; // D‚calage en X de l'‚cran par rapport au d‚but de l'image
|
||||||
|
GLOBAL short Principal_Decalage_Y; // D‚calage en Y de l'‚cran par rapport au d‚but de l'image
|
||||||
|
GLOBAL short Ancien_Principal_Decalage_X;
|
||||||
|
GLOBAL short Ancien_Principal_Decalage_Y;
|
||||||
|
|
||||||
|
GLOBAL char Principal_Repertoire_fichier[256]; // |_ Nom complet =
|
||||||
|
GLOBAL char Principal_Nom_fichier[13]; // | Repertoire_fichier+"\"+Nom_fichier
|
||||||
|
GLOBAL byte Principal_Format_fichier; // Format auquel il faut lire et ‚crire le fichier
|
||||||
|
GLOBAL byte Principal_Format; // Format du fileselect
|
||||||
|
GLOBAL short Principal_File_list_Position; // D‚but de la partie affich‚e dans la liste de fichiers
|
||||||
|
GLOBAL short Principal_File_list_Decalage; // D‚calage de la barre de s‚lection dans le fileselector
|
||||||
|
GLOBAL char Principal_Repertoire_courant[256]; // R‚pertoire actuel sur disque
|
||||||
|
GLOBAL char Principal_Commentaire[TAILLE_COMMENTAIRE+1]; // Commentaire de l'image
|
||||||
|
|
||||||
|
GLOBAL short Principal_Split; // Position en X du bord gauche du split de la loupe
|
||||||
|
GLOBAL short Principal_X_Zoom; // (Menu_Facteur_X) + Position en X du bord droit du split de la loupe
|
||||||
|
GLOBAL float Principal_Proportion_split; // Proportion de la zone non-zoom‚e par rapport … l'‚cran
|
||||||
|
|
||||||
|
// Donn‚es sur le brouillon:
|
||||||
|
|
||||||
|
GLOBAL byte * Brouillon_Ecran; // Ecran virtuel brouillon
|
||||||
|
GLOBAL T_Palette Brouillon_Palette; // Palette de l'‚cran de brouillon
|
||||||
|
|
||||||
|
GLOBAL byte Brouillon_Image_modifiee; // Le brouillon a ‚t‚ modifi‚
|
||||||
|
GLOBAL short Brouillon_Largeur_image; // Largeur du brouillon dans laquelle l'utilisateur d‚sire travailler
|
||||||
|
GLOBAL short Brouillon_Hauteur_image; // Hauteur du brouillon dans laquelle l'utilisateur d‚sire travailler
|
||||||
|
GLOBAL short Brouillon_Decalage_X; // D‚calage en X du brouillon par rapport au d‚but de l'image
|
||||||
|
GLOBAL short Brouillon_Decalage_Y; // D‚calage en Y du brouillon par rapport au d‚but de l'image
|
||||||
|
GLOBAL short Ancien_Brouillon_Decalage_X;
|
||||||
|
GLOBAL short Ancien_Brouillon_Decalage_Y;
|
||||||
|
|
||||||
|
GLOBAL char Brouillon_Repertoire_fichier[256]; // |_ Nom complet =
|
||||||
|
GLOBAL char Brouillon_Nom_fichier[13]; // | Repertoire_fichier+"\"+Nom_fichier
|
||||||
|
GLOBAL byte Brouillon_Format_fichier; // Format auquel il faut lire et ‚crire le fichier
|
||||||
|
GLOBAL byte Brouillon_Format; // Format du fileselect
|
||||||
|
GLOBAL short Brouillon_File_list_Position; // D‚but de la partie affich‚e dans la liste de fichiers
|
||||||
|
GLOBAL short Brouillon_File_list_Decalage; // D‚calage de la barre de s‚lection dans le fileselector
|
||||||
|
GLOBAL char Brouillon_Repertoire_courant[256]; // R‚pertoire actuel sur disque
|
||||||
|
GLOBAL char Brouillon_Commentaire[TAILLE_COMMENTAIRE+1]; // Commentaire de l'image
|
||||||
|
|
||||||
|
GLOBAL short Brouillon_Split; // Position en X du bord gauche du split de la loupe
|
||||||
|
GLOBAL short Brouillon_X_Zoom; // (Menu_Facteur_X) + Position en X du bord droit du split de la loupe
|
||||||
|
GLOBAL float Brouillon_Proportion_split; // Proportion de la zone non-zoom‚e par rapport … l'‚cran
|
||||||
|
|
||||||
|
GLOBAL byte Brouillon_Loupe_Mode; // On est en mode loupe dans le brouillon
|
||||||
|
GLOBAL word Brouillon_Loupe_Facteur; // Facteur de zoom dans le brouillon
|
||||||
|
GLOBAL word Brouillon_Loupe_Hauteur; // Largeur de la fenˆtre de zoom dans le brouillon
|
||||||
|
GLOBAL word Brouillon_Loupe_Largeur; // Hauteur de la fenˆtre de zoom dans le brouillon
|
||||||
|
GLOBAL short Brouillon_Loupe_Decalage_X;// Decalage horizontal de la fenˆtre de zoom dans le brouillon
|
||||||
|
GLOBAL short Brouillon_Loupe_Decalage_Y;// Decalage vertical de la fenˆtre de zoom dans le brouillon
|
||||||
|
|
||||||
|
GLOBAL byte Masque_copie_couleurs[256]; // Tableau des couleurs … copier vers le brouillon
|
||||||
|
|
||||||
|
// Sauvegarde de l'image:
|
||||||
|
|
||||||
|
GLOBAL byte * Ecran_backup; // Sauvegarde de l'‚cran virtuel courant
|
||||||
|
GLOBAL S_Liste_de_pages * Principal_Backups; // Liste des pages de backup de la page principale
|
||||||
|
GLOBAL S_Liste_de_pages * Brouillon_Backups; // Liste des pages de backup de la page de brouillon
|
||||||
|
|
||||||
|
|
||||||
|
// Donn‚es sur la brosse:
|
||||||
|
|
||||||
|
GLOBAL byte * Brosse; // Sprite de la brosse
|
||||||
|
GLOBAL word Brosse_Decalage_X; // Centre horizontal de la brosse
|
||||||
|
GLOBAL word Brosse_Decalage_Y; // Centre vertical de la brosse
|
||||||
|
GLOBAL word Brosse_Largeur; // Largeur de la brosse
|
||||||
|
GLOBAL word Brosse_Hauteur; // Hauteur de la brosse
|
||||||
|
|
||||||
|
GLOBAL char Brosse_Repertoire_fichier[256]; // |
|
||||||
|
GLOBAL char Brosse_Nom_fichier[13]; // |
|
||||||
|
GLOBAL byte Brosse_Format_fichier; // | Infos sur le
|
||||||
|
GLOBAL byte Brosse_Format; // |_ s‚lecteur de
|
||||||
|
GLOBAL short Brosse_File_list_Position; // | fichiers de la
|
||||||
|
GLOBAL short Brosse_File_list_Decalage; // | brosse.
|
||||||
|
GLOBAL char Brosse_Repertoire_courant[256]; // |
|
||||||
|
GLOBAL char Brosse_Commentaire[TAILLE_COMMENTAIRE+1]; // |
|
||||||
|
|
||||||
|
GLOBAL byte Brosse_Centre_rotation_defini; // | Infos sur le
|
||||||
|
GLOBAL short Brosse_Centre_rotation_X; // |- centre de rotation
|
||||||
|
GLOBAL short Brosse_Centre_rotation_Y; // | de la brosse
|
||||||
|
|
||||||
|
// Donn‚es sur le menu
|
||||||
|
|
||||||
|
GLOBAL byte Menu_visible; // Le menu est actif … l'‚cran
|
||||||
|
GLOBAL word Menu_Ordonnee; // Ordonn‚e o— commence le menu
|
||||||
|
GLOBAL word Menu_Ordonnee_Texte; // Ordonn‚e o— commence le texte dans le menu
|
||||||
|
GLOBAL word Menu_Facteur_X; // Facteur de grossissement du menu en X
|
||||||
|
GLOBAL word Menu_Facteur_Y; // Facteur de grossissement du menu en Y
|
||||||
|
GLOBAL word Menu_Taille_couleur; // Taille d'une couleur de la palette du menu
|
||||||
|
|
||||||
|
|
||||||
|
// Donn‚es sur la fenˆtre de menu
|
||||||
|
|
||||||
|
GLOBAL byte Une_fenetre_est_ouverte;
|
||||||
|
|
||||||
|
GLOBAL word Fenetre_Pos_X; // Position du bord gauche de la fenˆtre dans l'‚cran
|
||||||
|
GLOBAL word Fenetre_Pos_Y; // Position du bord haut de la fenˆtre dans l'‚cran
|
||||||
|
GLOBAL word Fenetre_Largeur; // Largeur de la fenˆtre
|
||||||
|
GLOBAL word Fenetre_Hauteur; // Hauteur de la fenˆtre
|
||||||
|
|
||||||
|
GLOBAL byte Menu_visible_avant_fenetre; // Le menu ‚tait visible avant d'ouvir une fenˆtre
|
||||||
|
GLOBAL word Menu_Ordonnee_avant_fenetre; // Ordonn‚e du menu avant d'ouvrir une fenˆtre
|
||||||
|
GLOBAL byte Cacher_pinceau_avant_fenetre;// Le pinceau ‚tatit d‚j… cach‚ avant l'ouverture de la fenetre?
|
||||||
|
|
||||||
|
GLOBAL word Nb_boutons_fenetre;
|
||||||
|
GLOBAL struct Fenetre_Bouton_normal * Fenetre_Liste_boutons_normal;
|
||||||
|
GLOBAL struct Fenetre_Bouton_palette * Fenetre_Liste_boutons_palette;
|
||||||
|
GLOBAL struct Fenetre_Bouton_scroller * Fenetre_Liste_boutons_scroller;
|
||||||
|
GLOBAL struct Fenetre_Bouton_special * Fenetre_Liste_boutons_special;
|
||||||
|
GLOBAL int Fenetre_Attribut1;
|
||||||
|
GLOBAL int Fenetre_Attribut2;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// D‚finition des boutons ////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
GLOBAL struct
|
||||||
|
{
|
||||||
|
// Informations sur l'aspect du bouton (graphisme):
|
||||||
|
word Decalage_X; // D‚calage par rapport … la gauche du menu
|
||||||
|
word Decalage_Y; // D‚calage par rapport au haut du menu
|
||||||
|
word Largeur; // Largeur du bouton
|
||||||
|
word Hauteur; // Hauteur du bouton
|
||||||
|
byte Enfonce; // Le bouton est enfonc‚
|
||||||
|
byte Forme; // Forme du bouton
|
||||||
|
|
||||||
|
// Information sur les clicks de la souris:
|
||||||
|
fonction_action Gauche; // Action d‚clench‚e par un click gauche sur le bouton
|
||||||
|
fonction_action Droite; // Action d‚clench‚e par un click droit sur le bouton
|
||||||
|
word Raccourci_gauche; // Raccourci clavier ‚quivalent … un click gauche sur le bouton
|
||||||
|
word Raccourci_droite; // Raccourci clavier ‚quivalent … un click droit sur le bouton
|
||||||
|
|
||||||
|
// Informations sur le d‚senclenchement du bouton g‚r‚ par le moteur:
|
||||||
|
fonction_action Desenclencher; // Action appel‚e lors du d‚senclenchement du bouton
|
||||||
|
byte Famille; // Ensemble de boutons auquel celui-ci appartient
|
||||||
|
|
||||||
|
} Bouton[NB_BOUTONS];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Informations sur les diff‚rents modes de dessin
|
||||||
|
|
||||||
|
GLOBAL fonction_effet Fonction_effet;
|
||||||
|
|
||||||
|
GLOBAL byte * FX_Feedback_Ecran;
|
||||||
|
|
||||||
|
GLOBAL byte Exclude_color[256]; // Couleurs … exclure pour Meilleure_couleur
|
||||||
|
|
||||||
|
// Mode smear:
|
||||||
|
|
||||||
|
GLOBAL byte Smear_Mode; // Le mode smear est enclench‚
|
||||||
|
GLOBAL byte Smear_Debut; // On vient juste de commencer une op‚ration en Smear
|
||||||
|
GLOBAL byte * Smear_Brosse; // Sprite de la brosse de Smear
|
||||||
|
GLOBAL word Smear_Brosse_Largeur; // Largeur de la brosse de Smear
|
||||||
|
GLOBAL word Smear_Brosse_Hauteur; // Hauteur de la brosse de Smear
|
||||||
|
GLOBAL short Smear_Min_X,Smear_Max_X,Smear_Min_Y,Smear_Max_Y; // Bornes de la Brosse du smear
|
||||||
|
|
||||||
|
// Mode shade:
|
||||||
|
|
||||||
|
GLOBAL struct T_Shade Shade_Liste[8]; // Listes de shade
|
||||||
|
GLOBAL byte Shade_Actuel; // Num‚ro du shade en cours
|
||||||
|
GLOBAL byte * Shade_Table; // Table de conversion de shade en cours
|
||||||
|
GLOBAL byte Shade_Table_gauche[256]; // Table de conversion de shade pour un clic gauche
|
||||||
|
GLOBAL byte Shade_Table_droite[256]; // Table de conversion de shade pour un clic droit
|
||||||
|
GLOBAL byte Shade_Mode; // Le mode shade est enclench‚
|
||||||
|
|
||||||
|
GLOBAL byte Quick_shade_Mode; // Le mode quick-shade est enclench‚
|
||||||
|
GLOBAL byte Quick_shade_Step; // Pas du mode quick-shade
|
||||||
|
GLOBAL byte Quick_shade_Loop; // Normal / Loop / No sat.
|
||||||
|
|
||||||
|
// Mode stencil:
|
||||||
|
|
||||||
|
GLOBAL byte Stencil_Mode; // Le mode stencil est enclench‚
|
||||||
|
GLOBAL byte Stencil[256]; // Tableau des couleurs prot‚g‚es
|
||||||
|
|
||||||
|
// Mode grille:
|
||||||
|
|
||||||
|
GLOBAL byte Snap_Mode; // Le mode grille est enclench‚
|
||||||
|
GLOBAL short Snap_Largeur; // Largeur entre 2 points de la grille
|
||||||
|
GLOBAL short Snap_Hauteur; // Hauteur entre 2 points de la grille
|
||||||
|
GLOBAL short Snap_Decalage_X; // Position en X du point le + … gauche
|
||||||
|
GLOBAL short Snap_Decalage_Y; // Position en Y du point le + en haut
|
||||||
|
|
||||||
|
// Mode trame:
|
||||||
|
|
||||||
|
GLOBAL byte Trame_Mode; // Le mode Trame est enclench‚
|
||||||
|
GLOBAL byte Trame[16][16]; // Sprite de la trame
|
||||||
|
GLOBAL word TRAME_PREDEFINIE[12][16]; // Trames pr‚s‚finies (compact‚es sur 16*16 bits)
|
||||||
|
GLOBAL short Trame_Largeur; // Largeur de la trame
|
||||||
|
GLOBAL short Trame_Hauteur; // Hauteur de la trame
|
||||||
|
|
||||||
|
// Mode colorize:
|
||||||
|
|
||||||
|
GLOBAL byte Colorize_Mode; // Le mode Colorize est enclench‚
|
||||||
|
GLOBAL byte Colorize_Opacite; // Intensit‚ du Colorize
|
||||||
|
GLOBAL byte Colorize_Mode_en_cours; // Le type de Colorize en cours (0-2)
|
||||||
|
GLOBAL word Table_de_multiplication_par_Facteur_A[64];
|
||||||
|
GLOBAL word Table_de_multiplication_par_Facteur_B[64];
|
||||||
|
|
||||||
|
// Mode smooth:
|
||||||
|
|
||||||
|
GLOBAL byte Smooth_Mode; // Le mode Smooth est enclench‚
|
||||||
|
GLOBAL byte Smooth_Matrice[3][3]; // La matrice du Smooth actuel
|
||||||
|
|
||||||
|
// Mode Tiling:
|
||||||
|
|
||||||
|
GLOBAL byte Tiling_Mode; // Le mode Tiling est enclench‚
|
||||||
|
GLOBAL short Tiling_Decalage_X; // D‚calage du tiling en X
|
||||||
|
GLOBAL short Tiling_Decalage_Y; // D‚calage du tiling en Y
|
||||||
|
|
||||||
|
// Mode Mask
|
||||||
|
|
||||||
|
GLOBAL byte Mask_Mode; // Le mode Masque est enclench‚
|
||||||
|
GLOBAL byte Mask[256]; // Tableau des couleurs constituant le masque
|
||||||
|
|
||||||
|
// Mode loupe:
|
||||||
|
|
||||||
|
GLOBAL byte Loupe_Mode;
|
||||||
|
GLOBAL word Loupe_Facteur;
|
||||||
|
GLOBAL word Loupe_Hauteur;
|
||||||
|
GLOBAL word Loupe_Largeur;
|
||||||
|
GLOBAL short Loupe_Decalage_X;
|
||||||
|
GLOBAL short Loupe_Decalage_Y;
|
||||||
|
GLOBAL word * Table_mul_facteur_zoom;
|
||||||
|
GLOBAL word TABLE_ZOOM[NB_FACTEURS_DE_ZOOM][512];
|
||||||
|
|
||||||
|
#ifdef VARIABLES_GLOBALES
|
||||||
|
word FACTEUR_ZOOM[NB_FACTEURS_DE_ZOOM]={2,3,4,5,6,8,10,12,14,16,18,20};
|
||||||
|
#else
|
||||||
|
extern word FACTEUR_ZOOM[NB_FACTEURS_DE_ZOOM];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Donn‚es sur les ellipses et les cercles:
|
||||||
|
|
||||||
|
GLOBAL dword Table_des_carres[1025];
|
||||||
|
GLOBAL long Ellipse_Curseur_X;
|
||||||
|
GLOBAL long Ellipse_Curseur_Y;
|
||||||
|
GLOBAL long Ellipse_Rayon_vertical_au_carre;
|
||||||
|
GLOBAL long Ellipse_Rayon_horizontal_au_carre;
|
||||||
|
GLOBAL long Ellipse_Limite_High;
|
||||||
|
GLOBAL long Ellipse_Limite_Low;
|
||||||
|
GLOBAL long Cercle_Curseur_X;
|
||||||
|
GLOBAL long Cercle_Curseur_Y;
|
||||||
|
GLOBAL long Cercle_Limite;
|
||||||
|
|
||||||
|
// Donn‚es sur les d‚grad‚s:
|
||||||
|
|
||||||
|
GLOBAL short Degrade_Borne_Inferieure; // Plus petite couleur englob‚e par le d‚grad‚
|
||||||
|
GLOBAL short Degrade_Borne_Superieure; // Plus grande couleur englob‚e par le d‚grad‚
|
||||||
|
GLOBAL int Degrade_Inverse; // Bool‚en "Le d‚grad‚ est en r‚alit‚ invers‚"
|
||||||
|
GLOBAL long Degrade_Intervalle_bornes; // = Abs(Degrade_Borne_Inferieure-Degrade_Borne_Superieure)+1
|
||||||
|
GLOBAL long Degrade_Intervalle_total; // Valeur maximum des indices pass‚s … la fonction de d‚grad‚ (!!! >0 !!!)
|
||||||
|
GLOBAL long Degrade_Melange_aleatoire; // Facteur de m‚lange (1-256+) du d‚grad‚
|
||||||
|
GLOBAL fonction_degrade Traiter_degrade; // Fonction de traitement du d‚grad‚, varie selon la m‚thode choisie par l'utilisateur.
|
||||||
|
GLOBAL fonction_afficheur Traiter_pixel_de_degrade; // Redirection de l'affichage
|
||||||
|
|
||||||
|
GLOBAL struct T_Degrade_Tableau Degrade_Tableau[16]; // Donn‚es de tous les d‚grad‚s
|
||||||
|
GLOBAL int Degrade_Courant; // Indice du tableau correspondant au d‚grad‚ courant
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Donn‚es sur le Spray:
|
||||||
|
|
||||||
|
GLOBAL byte Spray_Mode; // Mode Mono(1) ou Multicolore(0)
|
||||||
|
GLOBAL short Spray_Size; // DiamŠtre du spray en pixels
|
||||||
|
GLOBAL byte Spray_Delay; // D‚lai en VBLs entre 2 "pschiitt"
|
||||||
|
GLOBAL byte Spray_Mono_flow; // Nombre de pixels qui sortent en mˆme temps en mono
|
||||||
|
GLOBAL byte Spray_Multi_flow[256]; // Idem pour chaque couleur
|
||||||
|
|
||||||
|
|
||||||
|
// Donn‚es diverses sur le programme:
|
||||||
|
|
||||||
|
GLOBAL byte Sortir_du_programme;
|
||||||
|
GLOBAL char Repertoire_du_programme[256]; // R‚pertoire dans lequel se trouve le programme
|
||||||
|
GLOBAL char Repertoire_initial[256]; // R‚pertoire … partir duquel … ‚t‚ lanc‚ le programme
|
||||||
|
GLOBAL byte Fore_color;
|
||||||
|
GLOBAL byte Back_color;
|
||||||
|
GLOBAL byte Mode_de_dessin_en_cours;
|
||||||
|
GLOBAL byte Courbe_en_cours;
|
||||||
|
GLOBAL byte Ligne_en_cours;
|
||||||
|
GLOBAL byte Couleur_debut_palette;
|
||||||
|
GLOBAL byte Un_fichier_a_ete_passe_en_parametre;
|
||||||
|
GLOBAL byte Une_resolution_a_ete_passee_en_parametre; // utilis‚e uniquement si la variable pr‚c‚dente est … 1
|
||||||
|
|
||||||
|
// Variables concernant l'OBJ DIVERS
|
||||||
|
|
||||||
|
GLOBAL word INPUT_Nouveau_Mouse_X;
|
||||||
|
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];
|
||||||
|
GLOBAL byte SPRITE_MENU[NB_SPRITES_MENU][HAUTEUR_SPRITE_MENU][LARGEUR_SPRITE_MENU];
|
||||||
|
GLOBAL byte SPRITE_EFFET[NB_SPRITES_EFFETS][HAUTEUR_SPRITE_MENU][LARGEUR_SPRITE_MENU];
|
||||||
|
|
||||||
|
GLOBAL byte * Logo_GrafX2;
|
||||||
|
|
||||||
|
GLOBAL byte Fonte_systeme[256*8*8];
|
||||||
|
GLOBAL byte Fonte_fun [256*8*8];
|
||||||
|
GLOBAL byte Fonte_help [315][6][8];
|
||||||
|
GLOBAL byte * Fonte;
|
||||||
|
|
||||||
|
// Les donn‚es de l'aide:
|
||||||
|
|
||||||
|
GLOBAL struct Section_d_aide Table_d_aide[NB_SECTIONS_AIDE];
|
||||||
|
GLOBAL byte Section_d_aide_en_cours; // Indice de la table d'aide en cours de consultation
|
||||||
|
GLOBAL word Position_d_aide_en_cours; // Num‚ro de la ligne d'aide en cours de consultation
|
||||||
|
|
||||||
|
// Donn‚es sur les op‚rations
|
||||||
|
|
||||||
|
GLOBAL word Operation_avant_interruption; // Nø de l'op‚ration en cours avant l'utilisation d'une interruption
|
||||||
|
GLOBAL word Operation_en_cours; // Nø de l'op‚ration en cours
|
||||||
|
GLOBAL word Operation_Pile[TAILLE_PILE_OPERATIONS]; // Pile simplifi‚e
|
||||||
|
GLOBAL byte Operation_Taille_pile; // Taille effective de la pile (0=vide)
|
||||||
|
GLOBAL byte Operation_dans_loupe; // Indique si l'op‚ration a commenc‚ dans la partie Zoom‚e ou non
|
||||||
|
|
||||||
|
GLOBAL short Pipette_Couleur;
|
||||||
|
GLOBAL short Pipette_X;
|
||||||
|
GLOBAL short Pipette_Y;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef VARIABLES_GLOBALES
|
||||||
|
byte CURSEUR_D_OPERATION[NB_OPERATIONS]=
|
||||||
|
{
|
||||||
|
FORME_CURSEUR_CIBLE , // Dessin … la main continu
|
||||||
|
FORME_CURSEUR_CIBLE , // Dessin … la main discontinu
|
||||||
|
FORME_CURSEUR_CIBLE , // Dessin … la main point par point
|
||||||
|
FORME_CURSEUR_CIBLE , // Lignes
|
||||||
|
FORME_CURSEUR_CIBLE , // Lignes reli‚es
|
||||||
|
FORME_CURSEUR_CIBLE , // Lignes centr‚es
|
||||||
|
FORME_CURSEUR_CIBLE_XOR , // Rectangle vide
|
||||||
|
FORME_CURSEUR_CIBLE_XOR , // Rectangle plein
|
||||||
|
FORME_CURSEUR_CIBLE , // Cercles vides
|
||||||
|
FORME_CURSEUR_CIBLE , // Cercles pleins
|
||||||
|
FORME_CURSEUR_CIBLE , // Ellipses vides
|
||||||
|
FORME_CURSEUR_CIBLE , // Ellipses pleines
|
||||||
|
FORME_CURSEUR_CIBLE , // Fill
|
||||||
|
FORME_CURSEUR_CIBLE , // Remplacer
|
||||||
|
FORME_CURSEUR_CIBLE_XOR , // Prise de brosse rectangulaire
|
||||||
|
FORME_CURSEUR_CIBLE , // Prise d'une brosse multiforme
|
||||||
|
FORME_CURSEUR_CIBLE_PIPETTE , // R‚cup‚ration d'une couleur
|
||||||
|
FORME_CURSEUR_RECTANGLE_XOR , // Positionnement de la fenˆtre de loupe
|
||||||
|
FORME_CURSEUR_CIBLE , // Courbe … 3 points
|
||||||
|
FORME_CURSEUR_CIBLE , // Courbe … 4 points
|
||||||
|
FORME_CURSEUR_CIBLE , // Spray
|
||||||
|
FORME_CURSEUR_CIBLE , // Polygone
|
||||||
|
FORME_CURSEUR_CIBLE , // Polyforme
|
||||||
|
FORME_CURSEUR_CIBLE , // Polyfill
|
||||||
|
FORME_CURSEUR_CIBLE , // Polyforme rempli
|
||||||
|
FORME_CURSEUR_MULTIDIRECTIONNEL, // Scroll
|
||||||
|
FORME_CURSEUR_CIBLE , // Cercles d‚grad‚s
|
||||||
|
FORME_CURSEUR_CIBLE , // Ellipses d‚grad‚es
|
||||||
|
FORME_CURSEUR_ROTATE_XOR , // Faire tourner brosse
|
||||||
|
FORME_CURSEUR_CIBLE_XOR , // Etirer brosse
|
||||||
|
FORME_CURSEUR_CIBLE // Deformer brosse
|
||||||
|
};
|
||||||
|
#else
|
||||||
|
extern byte CURSEUR_D_OPERATION[NB_OPERATIONS];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Proc‚dures … appeler: Op‚ration,Mouse_K,Etat de la pile
|
||||||
|
|
||||||
|
GLOBAL struct
|
||||||
|
{
|
||||||
|
byte Effacer_curseur; // Bool‚en "il faut effacer le curseur pour l'op‚ra."
|
||||||
|
fonction_action Action; // Action appel‚e
|
||||||
|
} Operation[NB_OPERATIONS][3][TAILLE_PILE_OPERATIONS];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Informations sur les lecteurs
|
||||||
|
|
||||||
|
GLOBAL byte Nb_drives;
|
||||||
|
GLOBAL struct T_Drive Drive[26];
|
||||||
|
GLOBAL byte SPRITE_DRIVE[NB_SPRITES_DRIVES][HAUTEUR_SPRITE_DRIVE][LARGEUR_SPRITE_DRIVE];
|
||||||
|
|
||||||
|
|
||||||
|
// -- Section des informations sur les formats de fichiers ------------------
|
||||||
|
|
||||||
|
// Comptage du nb d'‚l‚ments dans la liste:
|
||||||
|
GLOBAL short Liste_Nb_elements;
|
||||||
|
GLOBAL short Liste_Nb_fichiers;
|
||||||
|
GLOBAL short Liste_Nb_repertoires;
|
||||||
|
// Tˆte de la liste chaŒn‚e:
|
||||||
|
GLOBAL struct Element_de_liste_de_fileselect * Liste_du_fileselect;
|
||||||
|
|
||||||
|
// ------------------- Inititialisation des formats connus -------------------
|
||||||
|
|
||||||
|
#include "loadsave.h"
|
||||||
|
void Rien_du_tout(void);
|
||||||
|
|
||||||
|
#ifdef VARIABLES_GLOBALES
|
||||||
|
// Extension du format
|
||||||
|
char Format_Extension[NB_FORMATS_CONNUS][4]=
|
||||||
|
{
|
||||||
|
"PKM", // PKM
|
||||||
|
"LBM", // LBM
|
||||||
|
"GIF", // GIF
|
||||||
|
"BMP", // BMP
|
||||||
|
"PCX", // PCX
|
||||||
|
"IMG", // IMG
|
||||||
|
"SC?", // SCx
|
||||||
|
"PI1", // PI1
|
||||||
|
"PC1", // PC1
|
||||||
|
"CEL", // CEL
|
||||||
|
"KCF", // KCF
|
||||||
|
"PAL" // PAL
|
||||||
|
};
|
||||||
|
|
||||||
|
// Fonction … appeler pour v‚rifier la signature du fichier
|
||||||
|
fonction_action Format_Test[NB_FORMATS_LOAD]=
|
||||||
|
{
|
||||||
|
Test_PKM, // PKM
|
||||||
|
Test_LBM, // LBM
|
||||||
|
Test_GIF, // GIF
|
||||||
|
Test_BMP, // BMP
|
||||||
|
Test_PCX, // PCX
|
||||||
|
Test_IMG, // IMG
|
||||||
|
Test_SCx, // SCx
|
||||||
|
Test_PI1, // PI1
|
||||||
|
Test_PC1, // PC1
|
||||||
|
Test_CEL, // CEL
|
||||||
|
Test_KCF, // KCF
|
||||||
|
Test_PAL // PAL
|
||||||
|
};
|
||||||
|
|
||||||
|
// Fonction … appeler pour charger l'image
|
||||||
|
fonction_action Format_Load[NB_FORMATS_LOAD]=
|
||||||
|
{
|
||||||
|
Load_PKM, // PKM
|
||||||
|
Load_LBM, // LBM
|
||||||
|
Load_GIF, // GIF
|
||||||
|
Load_BMP, // BMP
|
||||||
|
Load_PCX, // PCX
|
||||||
|
Load_IMG, // IMG
|
||||||
|
Load_SCx, // SCx
|
||||||
|
Load_PI1, // PI1
|
||||||
|
Load_PC1, // PC1
|
||||||
|
Load_CEL, // CEL
|
||||||
|
Load_KCF, // KCF
|
||||||
|
Load_PAL // PAL
|
||||||
|
};
|
||||||
|
|
||||||
|
// Fonction … appeler pour sauvegarder l'image
|
||||||
|
fonction_action Format_Save[NB_FORMATS_SAVE]=
|
||||||
|
{
|
||||||
|
Save_PKM, // PKM
|
||||||
|
Save_LBM, // LBM
|
||||||
|
Save_GIF, // GIF
|
||||||
|
Save_BMP, // BMP
|
||||||
|
Save_PCX, // PCX
|
||||||
|
Save_IMG, // IMG
|
||||||
|
Save_SCx, // SCx
|
||||||
|
Save_PI1, // PI1
|
||||||
|
Save_PC1, // PC1
|
||||||
|
Save_CEL, // CEL
|
||||||
|
Save_KCF, // KCF
|
||||||
|
Save_PAL // PAL
|
||||||
|
};
|
||||||
|
|
||||||
|
// indique si l'on doit consid‚rer que l'image n'est plus modifi‚e
|
||||||
|
byte Format_Backup_done[NB_FORMATS_CONNUS]=
|
||||||
|
{
|
||||||
|
1, // PKM
|
||||||
|
1, // LBM
|
||||||
|
1, // GIF
|
||||||
|
1, // BMP
|
||||||
|
1, // PCX
|
||||||
|
1, // IMG
|
||||||
|
1, // SCx
|
||||||
|
1, // PI1
|
||||||
|
1, // PC1
|
||||||
|
1, // CEL
|
||||||
|
0, // KCF
|
||||||
|
0 // PAL
|
||||||
|
};
|
||||||
|
|
||||||
|
// Le format de fichier autorise un commentaire
|
||||||
|
byte Format_Commentaire[NB_FORMATS_CONNUS]=
|
||||||
|
{
|
||||||
|
1, // PKM
|
||||||
|
0, // LBM
|
||||||
|
0, // GIF
|
||||||
|
0, // BMP
|
||||||
|
0, // PCX
|
||||||
|
0, // IMG
|
||||||
|
0, // SCx
|
||||||
|
0, // PI1
|
||||||
|
0, // PC1
|
||||||
|
0, // CEL
|
||||||
|
0, // KCF
|
||||||
|
0 // PAL
|
||||||
|
};
|
||||||
|
#else
|
||||||
|
extern char Format_Extension[NB_FORMATS_CONNUS][4];
|
||||||
|
extern fonction_action Format_Load[NB_FORMATS_LOAD];
|
||||||
|
extern fonction_action Format_Save[NB_FORMATS_SAVE];
|
||||||
|
extern fonction_action Format_Test[NB_FORMATS_LOAD];
|
||||||
|
extern byte Format_Backup_done[NB_FORMATS_CONNUS];
|
||||||
|
extern byte Format_Commentaire[NB_FORMATS_CONNUS];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
GLOBAL signed char Erreur_fichier; // 0: op‚ration I/O OK
|
||||||
|
// 1: Erreur dŠs le d‚but de l'op‚ration
|
||||||
|
// 2: Erreur durant l'op‚ration => donn‚es modifi‚es
|
||||||
|
//-1: Interruption du chargement d'une preview
|
||||||
|
|
||||||
|
GLOBAL int Ligne_INI;
|
||||||
|
|
||||||
|
GLOBAL fonction_afficheur Pixel_de_chargement;
|
||||||
|
GLOBAL fonction_lecteur Lit_pixel_de_sauvegarde;
|
||||||
|
|
||||||
|
#endif
|
||||||
154
graph.h
Normal file
154
graph.h
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
//byte Meilleure_couleur(byte Rouge, byte Vert, byte Bleu);
|
||||||
|
|
||||||
|
void Remapper_ecran_apres_changement_couleurs_menu(void);
|
||||||
|
void Calculer_couleurs_menu_optimales(struct Composantes * Palette);
|
||||||
|
|
||||||
|
dword Memoire_libre(void);
|
||||||
|
|
||||||
|
void Liste2tables(word * Liste,short Pas,byte Mode,byte * Table_inc,byte * Table_dec);
|
||||||
|
|
||||||
|
void Num2str(dword Nombre,char * Chaine,byte Taille);
|
||||||
|
int Str2num(char * Chaine);
|
||||||
|
|
||||||
|
short Round(float Valeur);
|
||||||
|
short Round_max(short Numerateur,short Diviseur);
|
||||||
|
short Round_div_max(short Numerateur,short Diviseur);
|
||||||
|
|
||||||
|
int Min(int A,int B);
|
||||||
|
|
||||||
|
void Transformer_point(short X, short Y,
|
||||||
|
float cosA, float sinA, short * Xr, short * Yr);
|
||||||
|
|
||||||
|
void Recadrer_ecran_par_rapport_au_zoom(void);
|
||||||
|
void Calculer_split(void);
|
||||||
|
void Calculer_donnees_loupe(void);
|
||||||
|
void Calculer_limites(void);
|
||||||
|
void Calculer_coordonnees_pinceau(void);
|
||||||
|
|
||||||
|
char* Libelle_mode(int Mode);
|
||||||
|
|
||||||
|
void Initialiser_mode_video(int Numero);
|
||||||
|
void Pixel_dans_barre_d_outil(word X,word Y,byte Couleur);
|
||||||
|
void Pixel_dans_fenetre(word X,word Y,byte Couleur);
|
||||||
|
void Encadrer_couleur_menu(byte Couleur);
|
||||||
|
void Afficher_palette_du_menu(void);
|
||||||
|
void Afficher_menu(void);
|
||||||
|
void Recadrer_palette(void);
|
||||||
|
|
||||||
|
void Print_general(short X,short Y,char * Chaine,byte Couleur_texte,byte Couleur_fond);
|
||||||
|
void Print_dans_fenetre(short X,short Y,char * Chaine,byte Couleur_texte,byte Couleur_fond);
|
||||||
|
void Print_char_dans_fenetre(short Pos_X,short Pos_Y,char Caractere,byte Couleur_texte,byte Couleur_fond);
|
||||||
|
void Print_char_transparent_dans_fenetre(short Pos_X,short Pos_Y,char Caractere,byte Couleur);
|
||||||
|
void Print_dans_menu(char * Chaine, short Position);
|
||||||
|
void Print_coordonnees(void);
|
||||||
|
void Print_nom_fichier(void);
|
||||||
|
|
||||||
|
byte Aucun_effet(word X,word Y,byte Couleur);
|
||||||
|
byte Effet_Shade(word X,word Y,byte Couleur);
|
||||||
|
byte Effet_Quick_shade(word X,word Y,byte Couleur);
|
||||||
|
byte Effet_Tiling(word X,word Y,byte Couleur);
|
||||||
|
byte Effet_Smooth(word X,word Y,byte Couleur);
|
||||||
|
|
||||||
|
void Afficher_foreback(void);
|
||||||
|
|
||||||
|
|
||||||
|
void Afficher_pixel(short X,short Y,byte Couleur);
|
||||||
|
|
||||||
|
void Afficher_pinceau(short X,short Y,byte Couleur,byte Preview);
|
||||||
|
void Effacer_pinceau(short X,short Y);
|
||||||
|
void Effacer_curseur(void);
|
||||||
|
void Afficher_curseur(void);
|
||||||
|
|
||||||
|
byte Demande_de_confirmation(char * Message);
|
||||||
|
void Warning_message(char * Message);
|
||||||
|
|
||||||
|
void Afficher_limites_de_l_image(void);
|
||||||
|
void Afficher_ecran(void);
|
||||||
|
void Fenetre_Afficher_cadre_general(word Pos_X,word Pos_Y,word Largeur,word Hauteur,
|
||||||
|
byte Couleur_HG,byte Couleur_BD,byte Couleur_S,byte Couleur_CHG,byte Couleur_CBD);
|
||||||
|
void Fenetre_Afficher_cadre_mono(word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte Couleur);
|
||||||
|
void Fenetre_Afficher_cadre_creux(word Pos_X,word Pos_Y,word Largeur,word Hauteur);
|
||||||
|
void Fenetre_Afficher_cadre_bombe(word Pos_X,word Pos_Y,word Largeur,word Hauteur);
|
||||||
|
void Fenetre_Afficher_cadre(word Pos_X,word Pos_Y,word Largeur,word Hauteur);
|
||||||
|
|
||||||
|
void Afficher_sprite_dans_menu(int Numero_bouton,int Numero_sprite);
|
||||||
|
void Afficher_pinceau_dans_menu(void);
|
||||||
|
void Afficher_pinceau_dans_fenetre(word X,word Y,int Numero);
|
||||||
|
|
||||||
|
void Dessiner_zigouigoui(word X,word Y, byte Couleur, short Sens);
|
||||||
|
void Bloc_degrade_dans_fenetre(word Pos_X,word Pos_Y,word Debut_block,word Fin_block);
|
||||||
|
void Redimentionner_image(word Largeur_choisie,word Hauteur_choisie);
|
||||||
|
|
||||||
|
void Fenetre_Afficher_sprite_drive(word Pos_X,word Pos_Y,byte Type);
|
||||||
|
|
||||||
|
void Capturer_brosse(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,short Effacement);
|
||||||
|
void Rotate_90_deg(void);
|
||||||
|
void Etirer_brosse(short X1, short Y1, short X2, short Y2);
|
||||||
|
void Etirer_brosse_preview(short X1, short Y1, short X2, short Y2);
|
||||||
|
void Tourner_brosse(float Angle);
|
||||||
|
void Tourner_brosse_preview(float Angle);
|
||||||
|
|
||||||
|
void Remap_brosse(void);
|
||||||
|
void Get_colors_from_brush(void);
|
||||||
|
void Outline_brush(void);
|
||||||
|
void Nibble_brush(void);
|
||||||
|
|
||||||
|
void Remplir(byte Couleur_de_remplissage);
|
||||||
|
void Remplacer(byte Nouvelle_couleur);
|
||||||
|
|
||||||
|
void Pixel_figure_Preview (short Pos_X,short Pos_Y,byte Couleur);
|
||||||
|
void Pixel_figure_Preview_xor(short Pos_X,short Pos_Y,byte Couleur);
|
||||||
|
|
||||||
|
void Tracer_cercle_vide_Definitif(short Centre_X,short Centre_Y,short Rayon,byte Couleur);
|
||||||
|
void Tracer_cercle_vide_Preview (short Centre_X,short Centre_Y,short Rayon,byte Couleur);
|
||||||
|
void Effacer_cercle_vide_Preview (short Centre_X,short Centre_Y,short Rayon);
|
||||||
|
void Tracer_cercle_plein (short Centre_X,short Centre_Y,short Rayon,byte Couleur);
|
||||||
|
|
||||||
|
void Tracer_ellipse_vide_Definitif(short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,byte Couleur);
|
||||||
|
void Tracer_ellipse_vide_Preview (short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,byte Couleur);
|
||||||
|
void Effacer_ellipse_vide_Preview (short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical);
|
||||||
|
void Tracer_ellipse_pleine (short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,byte Couleur);
|
||||||
|
|
||||||
|
void Tracer_ligne_Definitif (short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
|
||||||
|
void Tracer_ligne_Preview (short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
|
||||||
|
void Tracer_ligne_Preview_xor(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
|
||||||
|
void Effacer_ligne_Preview (short Debut_X,short Debut_Y,short Fin_X,short Fin_Y);
|
||||||
|
|
||||||
|
void Tracer_rectangle_vide(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
|
||||||
|
void Tracer_rectangle_plein(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y,byte Couleur);
|
||||||
|
|
||||||
|
void Tracer_courbe_Definitif(short X1, short Y1, short X2, short Y2, short X3, short Y3, short X4, short Y4, byte Couleur);
|
||||||
|
void Tracer_courbe_Preview (short X1, short Y1, short X2, short Y2, short X3, short Y3, short X4, short Y4, byte Couleur);
|
||||||
|
void Effacer_courbe_Preview (short X1, short Y1, short X2, short Y2, short X3, short Y3, short X4, short Y4, byte Couleur);
|
||||||
|
|
||||||
|
void Aerographe(short Bouton_clicke);
|
||||||
|
|
||||||
|
void Degrade_de_base (long Indice,short Pos_X,short Pos_Y);
|
||||||
|
void Degrade_de_trames_simples (long Indice,short Pos_X,short Pos_Y);
|
||||||
|
void Degrade_de_trames_etendues(long Indice,short Pos_X,short Pos_Y);
|
||||||
|
void Degrade_aleatoire (long Indice,short Pos_X,short Pos_Y);
|
||||||
|
|
||||||
|
void Tracer_cercle_degrade (short Centre_X,short Centre_Y,short Rayon,short Eclairage_X,short Eclairage_Y);
|
||||||
|
void Tracer_ellipse_degradee(short Centre_X,short Centre_Y,short Rayon_horizontal,short Rayon_vertical,short Eclairage_X,short Eclairage_Y);
|
||||||
|
|
||||||
|
void Polyfill(int Vertices, short * Points, int Color);
|
||||||
|
void Capturer_brosse_au_lasso(int Vertices, short * Points,short Effacement);
|
||||||
|
|
||||||
|
// Gestion des backups:
|
||||||
|
void Download_infos_page_principal(S_Page * Page);
|
||||||
|
void Upload_infos_page_principal(S_Page * Page);
|
||||||
|
void Download_infos_page_brouillon(S_Page * Page);
|
||||||
|
void Upload_infos_page_brouillon(S_Page * Page);
|
||||||
|
void Download_infos_backup(S_Liste_de_pages * Liste);
|
||||||
|
int Initialiser_les_listes_de_backups_en_debut_de_programme(int Taille,int Largeur,int Hauteur);
|
||||||
|
void Detruire_les_listes_de_backups_en_fin_de_programme(void);
|
||||||
|
void Nouveau_nombre_de_backups(int Nouveau);
|
||||||
|
int Backup_avec_nouvelles_dimensions(int Upload,int Largeur,int Hauteur);
|
||||||
|
int Backuper_et_redimensionner_brouillon(int Largeur,int Hauteur);
|
||||||
|
void Backup(void);
|
||||||
|
void Undo(void);
|
||||||
|
void Redo(void);
|
||||||
|
void Detruire_la_page_courante(void);
|
||||||
|
void Interchanger_image_principale_et_brouillon(void);
|
||||||
|
|
||||||
|
void Changer_facteur_loupe(byte Indice_facteur);
|
||||||
273
history.txt
Normal file
273
history.txt
Normal file
@ -0,0 +1,273 @@
|
|||||||
|
HISTORY of GRAFX: (in chronological order: latest version at the end)
|
||||||
|
|
||||||
|
* GRAFX 1.0á -> 1.02 (09/??/1995 -> 07/??/1996)
|
||||||
|
Forget it!
|
||||||
|
|
||||||
|
* GRAFX 2.00 Beta 90% (11/01/1996) - Wired'96 release
|
||||||
|
This version was 1st shown at the Wired'96 demo party in Belgium.
|
||||||
|
We gave it to many people there, so let's start history from here.
|
||||||
|
Note that there were a few different "90%" versions because we didn't
|
||||||
|
want to change the number just for tiny bug-fixes.
|
||||||
|
|
||||||
|
* GRAFX 2.00 Beta 91% (11/20/1996)
|
||||||
|
- Fixed: Terrific bug in Help/Messages (one line was too long and
|
||||||
|
crashed the program!).
|
||||||
|
- Added: Some new parameters for the settings.
|
||||||
|
- Added: Now, you can automatically set the best resolution for the
|
||||||
|
picture loaded and/or slightly adapt the picture to keep the colors of
|
||||||
|
the menu (for those who want to use GrafX2 as a viewer).
|
||||||
|
- Fixed: Bug that occured when you wanted to restore your previous
|
||||||
|
brush while being in "grab brush" mode.
|
||||||
|
- Added: English user's manual written (will be updated later, and
|
||||||
|
translated into French).
|
||||||
|
- Fixed: No more displays pixels out of the preview window when
|
||||||
|
loading corrupt pictures.
|
||||||
|
- Fixed: Small bug in LBM loading (for non-standard widths).
|
||||||
|
- Fixed: Minor error when saving the original screen dimensions in PKM
|
||||||
|
files. (we didn't save words with Intel conventions)
|
||||||
|
- Fixed: Exactly the same bug for LBM (but with Motorola conventions)
|
||||||
|
- Removed: No more saving the current palette when exiting the program
|
||||||
|
(that was useless and boring when pictures had a weird palette).
|
||||||
|
|
||||||
|
* GRAFX 2.00 Beta 92% (11/27/1996)
|
||||||
|
- Fixed/Removed: Error message occuring when accessing a drive with no
|
||||||
|
disk or so finally suppressed!
|
||||||
|
- Fixed: BMP loading was almost completely bugged and it should now be
|
||||||
|
completely debugged.
|
||||||
|
- Fixed/Modified: Set_palette routine (the previous one was fast but
|
||||||
|
did not work with some weird cards that don't support a REP OUTSB).
|
||||||
|
- Added: Multi-Undo.
|
||||||
|
- Added: Backup (*.BAK) files.
|
||||||
|
|
||||||
|
* GRAFX 2.00 Beta 93% (12/12/1996)
|
||||||
|
- Fixed: Bug that occured when approaching the borders of the screen
|
||||||
|
in grid mode with the type of cursor used for brush grabbing.
|
||||||
|
- Fixed: Small but annoying bug when saving files with a name of 9
|
||||||
|
characters.
|
||||||
|
- Fixed: Saved PAL files no longer modify the picture's name (some
|
||||||
|
mistake must have been done when we implemented the backup option).
|
||||||
|
- Added: Now, you can stop the loading of previews by pressing a key.
|
||||||
|
- Improved: Video cards that don't use the same VESA bank for reading
|
||||||
|
and writing should now work correctly.
|
||||||
|
- Improved: Frame displayed around the magnifier's preview.
|
||||||
|
- Improved: Menu of resolutions completely modified, and many new
|
||||||
|
modes added.
|
||||||
|
- Modified: The default colors of the menu have been slightly
|
||||||
|
lightened.
|
||||||
|
- Improved: The whole configuration is now saved and reloaded in the
|
||||||
|
settings menu.
|
||||||
|
|
||||||
|
* GRAFX 2.00 Beta 94.0|1|2% (02/13-23/1997) - ACE CD #4 & Volcanic3 releases
|
||||||
|
(These different versions were too close from each other to be
|
||||||
|
separated in this file. Just check the last modifications to know
|
||||||
|
which version you have)
|
||||||
|
- Added/Improved: (approximative) HAM6 and HAM8 support in IFF(LBM)
|
||||||
|
files, and improved compatibily with Amiga IFF files => should be
|
||||||
|
total now.
|
||||||
|
- Added: The absolutely useless :) CEL and KCF (KISS) file formats.
|
||||||
|
- Added: The not much more useful SCx (ColoRIX) file format.
|
||||||
|
- Improved: You can now use the keys to scroll the text in the Help.
|
||||||
|
- Fixed: Small bug in the scrolling list of resolutions (1 extra line
|
||||||
|
was displayed at the end of the list when current mode was 640x512).
|
||||||
|
- Added: English user's manual translated into French (and corrected..
|
||||||
|
There can be bugs in text files :)).
|
||||||
|
- Improved: Now, you can use the brush as an eraser by right clicking.
|
||||||
|
- Added: X-Invert in the palette editor.
|
||||||
|
- Fixed: Small bug in the reduce-palette function.
|
||||||
|
- Improved: GIF saving strongly accelerated (finally!).
|
||||||
|
- Improved: Shade mode completely modified (customized shades added).
|
||||||
|
- Fixed: Tiny bug in the block definition of the palette editor.
|
||||||
|
- Improved: Non-standard PCX files that don't reset the compression
|
||||||
|
after each line should be supported now (at least for 256-color
|
||||||
|
pictures).
|
||||||
|
- Added: Undo in the Shade menu.
|
||||||
|
- Added: Statistics screen.
|
||||||
|
|
||||||
|
* GRAFX 2.00 Beta 94.666% (03/20/1997)
|
||||||
|
- Fixed: Statistics screen no longer displays that VESA 1.2 is not
|
||||||
|
supported.
|
||||||
|
- Fixed: A few bugs of no consequence.
|
||||||
|
- Fixed: Bug in the mode-X initialization introduced in the previous
|
||||||
|
version.
|
||||||
|
- Added: It is possible to choose between Relative and Absolute
|
||||||
|
coordinates in the settings menu.
|
||||||
|
- Improved: The colors of the menu are now calculated from the current
|
||||||
|
palette, so you won't have to be concerned by the colors of the menu
|
||||||
|
any more.
|
||||||
|
- Fixed: The VESA modes are no longer disabled for some video cards.
|
||||||
|
- Imporoved: "Windows 95" keys are now usable.
|
||||||
|
- Modified: We now use the EOS dos-extender Copyright (c) 1996 by
|
||||||
|
Eclipse, so read carefully the docs if you can't use GrafX2 anymore.
|
||||||
|
|
||||||
|
* GRAFX 2.00 Beta 95% (07/18/1997) - Wired'97 release
|
||||||
|
(It's GrafX2 creation's 1st anniversary! =D (...but still Beta :/)
|
||||||
|
We wrote the usual "void main(int argc, char * argv[])" one year ago!)
|
||||||
|
- Fixed: PCX files with odd widths should be supported now. (We fixed
|
||||||
|
a bug in version 94.1% which added a new one) :(
|
||||||
|
- Fixed: Small display bug in the grid of the Sieve menu.
|
||||||
|
- Fixed: Oops! We forgot to remap the colors of the menu when loading
|
||||||
|
a PAL file. That's stupid! :)
|
||||||
|
- Improved: The number of predefined paintbrushes has been doubled.
|
||||||
|
- Added: Outline and Nibble effects for brushes.
|
||||||
|
- Improved: The "Brush grabbing", "Zoom" and "Pipette" options are no
|
||||||
|
more stopped by hiding/showing the tool-bar.
|
||||||
|
- Improved: Now, you can change the current color while drawing.
|
||||||
|
- Improved: The "auto-set resolution" option works better.
|
||||||
|
- Added: The 3 color components are displayed in the toolbar when you
|
||||||
|
want to choose a color.
|
||||||
|
- Added: A small preview of the color selected by the pipette is
|
||||||
|
displayed in the tool-bar.
|
||||||
|
- Fixed: GIF saving (the bug didn't corrupt the file but resulted in a
|
||||||
|
file that wasn't as well compressed as it should have been).
|
||||||
|
- Fixed: GIF loading doesn't flash any more on some pictures that were
|
||||||
|
not corrupt; and LBM neither when loading is interrupted by user.
|
||||||
|
- Added: Menu where you can choose what you want to copy to the spare
|
||||||
|
page (pixels, palette, or both...).
|
||||||
|
- Modified: The size of the palette editor has been very slightly
|
||||||
|
reduced.
|
||||||
|
- Modified: The Stencil is now taken into account when using the
|
||||||
|
"Clear" button.
|
||||||
|
- Improved: The "magnify" mode is finally displayed with a splitted
|
||||||
|
screen where you can see both zoomed and unzoomed parts of the picture.
|
||||||
|
- Added: Now, you can load a picture from the command line (type
|
||||||
|
"gfx2 /?" for the syntax).
|
||||||
|
- Added: The preview of a PAL file is now displayed in file-selectors.
|
||||||
|
- Modified: The tool-bar has been reduced vertically by about 1/3.
|
||||||
|
- Fixed: Bug in the Grid menu. (The user was able to enter a null grid
|
||||||
|
step. Doh!)
|
||||||
|
- Added: "Adjust brush pick" option.
|
||||||
|
- Fixed: DP2e (LBM-"PBM") files (including new BBM files) with odd
|
||||||
|
width are now loaded correctly.
|
||||||
|
- Improved: LBM files are now saved with their exact width and not
|
||||||
|
with a multiple-of-16 witdh (viewers that can't read these files are
|
||||||
|
"badly coded" because we save them correctly).
|
||||||
|
- Improved: The selector bar is now placed on last visited directory
|
||||||
|
when you change directory.
|
||||||
|
- Added: "Mask" drawing mode.
|
||||||
|
- Added: "Smear" drawing mode.
|
||||||
|
- Improved: "Shade" mode options (normal, loop, saturation).
|
||||||
|
- Added: You can define if you want Feedback (or not) while drawing
|
||||||
|
in the drawing modes (effects).
|
||||||
|
- Improved: The amount of memory used for brushes has been reduced.
|
||||||
|
- Improved: Scrolling lists speed slightly accelerated.
|
||||||
|
- Improved: FloodFill slightly accelerated.
|
||||||
|
|
||||||
|
* GRAFX 2.00 Beta 95.5% (09/04/1997)
|
||||||
|
- Improved: SCx files with less than 256 colors are now supported.
|
||||||
|
- Fixed: Bug when double-clicking on the Floodfill button.
|
||||||
|
- Fixed: Bug when "flood-filling" with an effect with feedback.
|
||||||
|
- Fixed: Bug when filling a vertical-1-pixel-wide area.
|
||||||
|
- Fixed: Bug of the shape of the cursor when a window is open in
|
||||||
|
magnify mode.
|
||||||
|
- Added: Special cursor shape for the pipette.
|
||||||
|
- Modified: The method to recenter the page when exiting magnifier
|
||||||
|
mode (the picture recovers its position as it was before zooming).
|
||||||
|
- Added: Linear Frame Buffer (VESA 2.0 LFB) supported.
|
||||||
|
- Added: You can now load and save brushes (from the Brush FX menu).
|
||||||
|
- Fixed: A few video modes (Modes X with a height multiple of 270).
|
||||||
|
- Fixed: You couldn't save the configuration in the settings menu if
|
||||||
|
the Auto-save option was off.
|
||||||
|
- Improved: Polyform has now reached its definitive behaviour.
|
||||||
|
- Added: Polyfill and filled polyform.
|
||||||
|
- Added: Lasso (polyformed brushes).
|
||||||
|
- Added: Concentric lines.
|
||||||
|
- Added: GFX2.INI file (check its contents for new options).
|
||||||
|
- Improved: GFX2.CFG file will have ascending compatibility with
|
||||||
|
future versions from now.
|
||||||
|
- Added: Some drawing tips have been detailed in the documentation
|
||||||
|
files.
|
||||||
|
- Improved: Pipette handling.
|
||||||
|
|
||||||
|
* GRAFX 2.00 Beta 96% (11/03/1997) - Saturne (aborted) party 5 release
|
||||||
|
- Added: Now, you can increase or decrease the size of the paintbrush.
|
||||||
|
The default keys are [,<] and [.>] ([;.] and [:/] for azerty).
|
||||||
|
- Added: Typing the first letters of a filename in file-selectors will
|
||||||
|
place the selection bar onto it.
|
||||||
|
- Fixed: Small but annoying bugs in the writing of the GFX2.CFG file
|
||||||
|
in GFXCFG. The data concerning Shade and Stencil modes were destroyed.
|
||||||
|
- Added/Improved: It is now possible to define the matrix of the
|
||||||
|
Smooth mode. We also seized the opportunity to improve the Smooth on
|
||||||
|
the boundaries of the picture, and to improve the function that
|
||||||
|
calculates nearest colors.
|
||||||
|
- Added: The "Replace color" option that replaces all the pixels of
|
||||||
|
the color pointed by the mouse with the paintbrush color. This tool is
|
||||||
|
accessible by right clicking on the Floodfill button.
|
||||||
|
- Improved: FloodFill slightly accelerated (especially with small
|
||||||
|
surfaces).
|
||||||
|
- Fixed: The picture was automatically zoomed when choosing a zoom
|
||||||
|
factor in the menu if the Fast_zoom option was set.
|
||||||
|
- Added: "Stretch brush".
|
||||||
|
- Added: Now, you can move windows (menus) and even hide the palette
|
||||||
|
menu for picking a color that is behind it (with the key just below
|
||||||
|
<Escape>).
|
||||||
|
- Fixed: Small bug in "Menu_ratio=2" mode when remapping the screen
|
||||||
|
after color changes.
|
||||||
|
- Added: "Thin" cursor type (looks like VGApaint's one).
|
||||||
|
- Fixed: A few video modes (Modes X with a height multiple of 224 and
|
||||||
|
some others).
|
||||||
|
- Added: It is now possible to select the colors that can be used for
|
||||||
|
the smooth and transparency modes, and remapping.
|
||||||
|
- Fixed: Clicking twice on the Lasso button did not restore the paint-
|
||||||
|
brush correctly.
|
||||||
|
- Fixed: the absolute coordinates option wasn't correctly saved in
|
||||||
|
the .INI file.
|
||||||
|
- Added: A few new parameters can be defined in the .INI file.
|
||||||
|
- Added: "Copy palette to spare page and remap destination" option
|
||||||
|
(accessible from the "Copy to spare page" menu (default: Shift+Tab)).
|
||||||
|
|
||||||
|
* GRAFX 2.00 Beta 96.1% (02/28/1998) - Volcanic Party 4 release
|
||||||
|
- Fixed: File selector gauges don't bug any more when there are more
|
||||||
|
than 584 entries :) in the current directory.
|
||||||
|
- Fixed: The file selector _should_ hang no more on non-image (or
|
||||||
|
corrupt image) files containing data that look like a known format
|
||||||
|
signature.
|
||||||
|
- Fixed: Old and horrible :) video bug. Most of the VESA video cards
|
||||||
|
that displayed unexpected pixels (when moving the mouse for instance)
|
||||||
|
should work better (perfectly?) now.
|
||||||
|
- Fixed: The mouse correction factors didn't work properly.
|
||||||
|
- Added: Quick-shade mode.
|
||||||
|
- Improved: You can hide any menu that needs a color selection to pick
|
||||||
|
up a color behind the window.
|
||||||
|
- Added: A couple of new parameters in the GFX2.INI file.
|
||||||
|
|
||||||
|
* GRAFX 2.00 Alpha 96.3% (04/11/1998) - Lucky n' Tigrou Party 2 release
|
||||||
|
!!! Warning: possibly unstable version !!!
|
||||||
|
- Improved: You can edit pictures bigger than 1024x768, and small
|
||||||
|
pictures take much less memory, allowing to have many more undo pages!
|
||||||
|
- Improved: The list of undo pages is preserved when you load a
|
||||||
|
picture, modify its size, or just go to the spare page.
|
||||||
|
- Added: You can "kill" a page (i.e. removing it from the list of undo
|
||||||
|
pages).
|
||||||
|
- Modified: The Settings menu has been reorganized.
|
||||||
|
- Improved: The drawing mode is no more set to "discontinuous" by
|
||||||
|
default.
|
||||||
|
- Improved: The function to compute the best matching RGB color used
|
||||||
|
in smooth, colorize, and some other operations has been strongly
|
||||||
|
accelerated on 486 and Cyrix processors, while it should be about the
|
||||||
|
same speed or very slightly slower on Intel Pentiums (II) than before.
|
||||||
|
- Fixed: The program finally works under Windows NT (without dos4gw)!
|
||||||
|
|
||||||
|
* GRAFX 2.00 Beta 96.5% (12/23/1999) - Xmas'99 release
|
||||||
|
- Fixed: This version seems (is!) stable even with huge pictures. :)
|
||||||
|
- Fixed: A few options on brushes kept modifying the continuity of the
|
||||||
|
free-hand drawing mode.
|
||||||
|
- Fixed: The "nibble brush" operation crashed sometimes.
|
||||||
|
- Fixed: Remapping the screen after modifying colors in the palette
|
||||||
|
editor displayed, in rare cases, unexpected pixels or even crashed.
|
||||||
|
It didn't remap correctly the picture in "Magnify" mode, too.
|
||||||
|
- Fixed: Catastrophic bug occuring when you "flood-filled" an area
|
||||||
|
starting at the bottom of the picture.
|
||||||
|
- Added: An option in GFX2.INI to tell if the number of colors used
|
||||||
|
must be automatically calculated, and another one for the default
|
||||||
|
video mode at startup.
|
||||||
|
- Fixed: The colors of the menu are now correctly remapped when
|
||||||
|
getting colors from the brush.
|
||||||
|
- Added: Degas Elite's file formats (PI1,PC1,...) support.
|
||||||
|
- Added: True-color BMP (Windows) and PCX images can be loaded. They
|
||||||
|
will be converted to a 256-color image with palette optimization and
|
||||||
|
Floyd/Steinberg dithering. Note: some other true-color formats will be
|
||||||
|
added in the next release.
|
||||||
|
- Fixed: Loading corrupt pictures with null dimensions could crash.
|
||||||
|
- Improved: Brush streching is now in "real time" (and snaps to the
|
||||||
|
grid if "Adjust brush picking" is set).
|
||||||
|
- Added: Brush rotation by any angle.
|
||||||
15
init.h
Normal file
15
init.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
void Chercher_repertoire_du_programme(char * Chaine);
|
||||||
|
void Rechercher_drives(void);
|
||||||
|
void Charger_DAT(void);
|
||||||
|
void Initialisation_des_boutons(void);
|
||||||
|
void Initialisation_des_operations(void);
|
||||||
|
int Charger_CFG(int Tout_charger);
|
||||||
|
int Sauver_CFG(void);
|
||||||
|
void Initialiser_les_tables_de_multiplication(void);
|
||||||
|
void Initialiser_la_table_des_carres(void);
|
||||||
|
void Initialiser_la_table_precalculee_des_distances_de_couleur(void);
|
||||||
|
|
||||||
|
void Definition_des_modes_video(void);
|
||||||
|
|
||||||
|
#include "readini.h"
|
||||||
|
#include "saveini.h"
|
||||||
17
linux.c
Normal file
17
linux.c
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
void _splitpath(char* Buffer, char* Chemin, char* Nom_Fichier)
|
||||||
|
{
|
||||||
|
int i=0, Position_Du_Dernier_Slash;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Chemin[i]=Buffer[i];
|
||||||
|
if (Buffer[i]=='/')
|
||||||
|
Position_Du_Dernier_Slash=i;
|
||||||
|
i++;
|
||||||
|
}while (Buffer[i]!=0);
|
||||||
|
|
||||||
|
i=Position_Du_Dernier_Slash+1;
|
||||||
|
Chemin[i]=0;
|
||||||
|
strcpy(Nom_Fichier,Buffer+i);
|
||||||
|
}
|
||||||
9
linux.h
Normal file
9
linux.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
void _splitpath(char* Buffer, char* Chemin, char* Nom_Fichier);
|
||||||
|
/* Sépare dans la chaîne passée dans Buffer le chemin d'accès du nom de fichier */
|
||||||
|
|
||||||
|
struct find_t {
|
||||||
|
unsigned char attrib;
|
||||||
|
char name[256];
|
||||||
|
};
|
||||||
|
|
||||||
|
#define _A_SUBDIR 1
|
||||||
5321
loadsave.c
Normal file
5321
loadsave.c
Normal file
File diff suppressed because it is too large
Load Diff
69
loadsave.h
Normal file
69
loadsave.h
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
|
||||||
|
void Pixel_Chargement_dans_ecran_courant(short Pos_X,short Pos_Y,byte Couleur);
|
||||||
|
void Pixel_Chargement_dans_preview (short Pos_X,short Pos_Y,byte Couleur);
|
||||||
|
void Pixel_Chargement_dans_brosse (short Pos_X,short Pos_Y,byte Couleur);
|
||||||
|
|
||||||
|
void Nom_fichier_complet(char * Nom_du_fichier, byte Sauve_Colorix);
|
||||||
|
|
||||||
|
void Charger_image(byte Image);
|
||||||
|
void Sauver_image(byte Image);
|
||||||
|
|
||||||
|
// -- PKM -------------------------------------------------------------------
|
||||||
|
void Test_PKM(void);
|
||||||
|
void Load_PKM(void);
|
||||||
|
void Save_PKM(void);
|
||||||
|
|
||||||
|
// -- LBM -------------------------------------------------------------------
|
||||||
|
void Test_LBM(void);
|
||||||
|
void Load_LBM(void);
|
||||||
|
void Save_LBM(void);
|
||||||
|
|
||||||
|
// -- GIF -------------------------------------------------------------------
|
||||||
|
void Test_GIF(void);
|
||||||
|
void Load_GIF(void);
|
||||||
|
void Save_GIF(void);
|
||||||
|
|
||||||
|
// -- PCX -------------------------------------------------------------------
|
||||||
|
void Test_PCX(void);
|
||||||
|
void Load_PCX(void);
|
||||||
|
void Save_PCX(void);
|
||||||
|
|
||||||
|
// -- BMP -------------------------------------------------------------------
|
||||||
|
void Test_BMP(void);
|
||||||
|
void Load_BMP(void);
|
||||||
|
void Save_BMP(void);
|
||||||
|
|
||||||
|
// -- IMG -------------------------------------------------------------------
|
||||||
|
void Test_IMG(void);
|
||||||
|
void Load_IMG(void);
|
||||||
|
void Save_IMG(void);
|
||||||
|
|
||||||
|
// -- SCx -------------------------------------------------------------------
|
||||||
|
void Test_SCx(void);
|
||||||
|
void Load_SCx(void);
|
||||||
|
void Save_SCx(void);
|
||||||
|
|
||||||
|
// -- CEL -------------------------------------------------------------------
|
||||||
|
void Test_CEL(void);
|
||||||
|
void Load_CEL(void);
|
||||||
|
void Save_CEL(void);
|
||||||
|
|
||||||
|
// -- KCF -------------------------------------------------------------------
|
||||||
|
void Test_KCF(void);
|
||||||
|
void Load_KCF(void);
|
||||||
|
void Save_KCF(void);
|
||||||
|
|
||||||
|
// -- PAL -------------------------------------------------------------------
|
||||||
|
void Test_PAL(void);
|
||||||
|
void Load_PAL(void);
|
||||||
|
void Save_PAL(void);
|
||||||
|
|
||||||
|
// -- PI1 -------------------------------------------------------------------
|
||||||
|
void Test_PI1(void);
|
||||||
|
void Load_PI1(void);
|
||||||
|
void Save_PI1(void);
|
||||||
|
|
||||||
|
// -- PC1 -------------------------------------------------------------------
|
||||||
|
void Test_PC1(void);
|
||||||
|
void Load_PC1(void);
|
||||||
|
void Save_PC1(void);
|
||||||
631
main.c
Normal file
631
main.c
Normal file
@ -0,0 +1,631 @@
|
|||||||
|
#define VARIABLES_GLOBALES
|
||||||
|
|
||||||
|
#include "const.h"
|
||||||
|
#include "struct.h"
|
||||||
|
#include "global.h"
|
||||||
|
#include "graph.h"
|
||||||
|
#include "divers.h"
|
||||||
|
#include "init.h"
|
||||||
|
#include "boutons.h"
|
||||||
|
#include "moteur.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <SDL/SDL.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include "linux.h" //Fichier avec diverses fonctions qui existaient sous dos mais pas sous linux...
|
||||||
|
#include "pages.h"
|
||||||
|
#include "files.h"
|
||||||
|
#include "loadsave.h"
|
||||||
|
#include "sdlscreen.h"
|
||||||
|
|
||||||
|
byte Ancien_nb_lignes; // Ancien nombre de lignes de l'‚cran
|
||||||
|
|
||||||
|
|
||||||
|
//--- Affichage de la syntaxe, et de la liste des modes vid‚os disponibles ---
|
||||||
|
void Afficher_syntaxe(void)
|
||||||
|
{
|
||||||
|
printf("Syntax: GFX2 [<picture>] [<Video mode number>|<Help>]\n\n");
|
||||||
|
printf("<Help> can be /? or /h\n\n");
|
||||||
|
printf("Available video modes:\nÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
|
||||||
|
printf("\t 0:%s",Libelle_mode(0));
|
||||||
|
printf("\t15:%s",Libelle_mode(15));
|
||||||
|
printf("\t30:%s",Libelle_mode(30));
|
||||||
|
printf("\t45:%s\n",Libelle_mode(45));
|
||||||
|
printf("\t 1:%s",Libelle_mode(1));
|
||||||
|
printf("\t16:%s",Libelle_mode(16));
|
||||||
|
printf("\t31:%s",Libelle_mode(31));
|
||||||
|
printf("\t46:%s\n",Libelle_mode(46));
|
||||||
|
printf("\t 2:%s",Libelle_mode(2));
|
||||||
|
printf("\t17:%s",Libelle_mode(17));
|
||||||
|
printf("\t32:%s",Libelle_mode(32));
|
||||||
|
printf("\t47:%s\n",Libelle_mode(47));
|
||||||
|
printf("\t 3:%s",Libelle_mode(3));
|
||||||
|
printf("\t18:%s",Libelle_mode(18));
|
||||||
|
printf("\t33:%s",Libelle_mode(33));
|
||||||
|
printf("\t48:%s\n",Libelle_mode(48));
|
||||||
|
printf("\t 4:%s",Libelle_mode(4));
|
||||||
|
printf("\t19:%s",Libelle_mode(19));
|
||||||
|
printf("\t34:%s",Libelle_mode(34));
|
||||||
|
printf("\t49:%s\n",Libelle_mode(49));
|
||||||
|
printf("\t 5:%s",Libelle_mode(5));
|
||||||
|
printf("\t20:%s",Libelle_mode(20));
|
||||||
|
printf("\t35:%s",Libelle_mode(35));
|
||||||
|
printf("\t50:%s\n",Libelle_mode(50));
|
||||||
|
printf("\t 6:%s",Libelle_mode(6));
|
||||||
|
printf("\t21:%s",Libelle_mode(21));
|
||||||
|
printf("\t36:%s",Libelle_mode(36));
|
||||||
|
printf("\t51:%s\n",Libelle_mode(51));
|
||||||
|
printf("\t 7:%s",Libelle_mode(7));
|
||||||
|
printf("\t22:%s",Libelle_mode(22));
|
||||||
|
printf("\t37:%s",Libelle_mode(37));
|
||||||
|
printf("\t52:%s\n",Libelle_mode(52));
|
||||||
|
printf("\t 8:%s",Libelle_mode(8));
|
||||||
|
printf("\t23:%s",Libelle_mode(23));
|
||||||
|
printf("\t38:%s",Libelle_mode(38));
|
||||||
|
printf("\t53:%s\n",Libelle_mode(53));
|
||||||
|
printf("\t 9:%s",Libelle_mode(9));
|
||||||
|
printf("\t24:%s",Libelle_mode(24));
|
||||||
|
printf("\t39:%s",Libelle_mode(39));
|
||||||
|
printf("\t54:%s\n",Libelle_mode(54));
|
||||||
|
printf("\t10:%s",Libelle_mode(10));
|
||||||
|
printf("\t25:%s",Libelle_mode(25));
|
||||||
|
printf("\t40:%s",Libelle_mode(40));
|
||||||
|
printf("\t55:%s\n",Libelle_mode(55));
|
||||||
|
printf("\t11:%s",Libelle_mode(11));
|
||||||
|
printf("\t26:%s",Libelle_mode(26));
|
||||||
|
printf("\t41:%s",Libelle_mode(41));
|
||||||
|
printf("\t56:%s\n",Libelle_mode(56));
|
||||||
|
printf("\t12:%s",Libelle_mode(12));
|
||||||
|
printf("\t27:%s",Libelle_mode(27));
|
||||||
|
printf("\t42:%s",Libelle_mode(42));
|
||||||
|
printf("\t57:%s\n",Libelle_mode(57));
|
||||||
|
printf("\t13:%s",Libelle_mode(13));
|
||||||
|
printf("\t28:%s",Libelle_mode(28));
|
||||||
|
printf("\t43:%s",Libelle_mode(43));
|
||||||
|
printf("\t58:%s\n",Libelle_mode(58));
|
||||||
|
printf("\t14:%s",Libelle_mode(14));
|
||||||
|
printf("\t29:%s",Libelle_mode(29));
|
||||||
|
printf("\t44:%s",Libelle_mode(44));
|
||||||
|
printf("\t59:%s\n",Libelle_mode(59));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------- Sortie impromptue ----------------------------
|
||||||
|
void Erreur(int Code)
|
||||||
|
{
|
||||||
|
T_Palette Palette_temporaire;
|
||||||
|
int Indice;
|
||||||
|
|
||||||
|
if (Code==0)
|
||||||
|
{
|
||||||
|
memcpy(Palette_temporaire,Principal_Palette,sizeof(T_Palette));
|
||||||
|
for (Indice=0;Indice<=255;Indice++)
|
||||||
|
Palette_temporaire[Indice].R=255;
|
||||||
|
Set_palette(Palette_temporaire);
|
||||||
|
for (Indice=0;Indice<10;Indice++)
|
||||||
|
Wait_VBL();
|
||||||
|
Set_palette(Principal_Palette);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Passer_en_mode_texte(Ancien_nb_lignes);
|
||||||
|
switch (Code)
|
||||||
|
{
|
||||||
|
case ERREUR_DAT_ABSENT : printf("Error: File GFX2.DAT is missing!\n");
|
||||||
|
printf("This program cannot run without this file.\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_DAT_CORROMPU : printf("Error: File GFX2.DAT is corrupt!\n");
|
||||||
|
printf("This program cannot run without a correct version of this file.\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_CFG_ABSENT : printf("Error: File GFX2.CFG is missing!\n");
|
||||||
|
printf("Please run GFXCFG to create it.\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_CFG_CORROMPU : printf("Error: File GFX2.CFG is corrupt!\n");
|
||||||
|
printf("Please run GFXCFG to make a valid file.\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_CFG_ANCIEN : printf("Error: File GFX2.CFG is from another version of GrafX2.\n");
|
||||||
|
printf("Please run GFXCFG to update this file.\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_MEMOIRE : printf("Error: Not enough memory!\n\n");
|
||||||
|
printf("You should try removing memory drivers and useless TSRs to free some memory.\n\n");
|
||||||
|
printf("If it still doesn't work, try running GFX2_MEM.BAT if you have got DOS4GW.EXE\n");
|
||||||
|
printf("somewhere on your disk (after having edited the batch file).\n");
|
||||||
|
printf("This also requires 16 free Megabytes on your disk to create the memory cache.\n");
|
||||||
|
printf("This will slow down the program but, at least, you'll get GrafX2 running.\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_LIGNE_COMMANDE : printf("Error: Too many parameters.\n\n");
|
||||||
|
Afficher_syntaxe();
|
||||||
|
break;
|
||||||
|
case ERREUR_DRIVER_SOURIS : printf("Error: No mouse detected!\n");
|
||||||
|
printf("Check if a mouse driver is installed and if your mouse is correctly connected.\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_MODE_VESA_INVALIDE : printf("Error: Requested VESA mode not supported by your video card!\n");
|
||||||
|
printf("You should try to run a VESA driver such as UNIVESA or UNIVBE.\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_MODE_INTERDIT : printf("Error: The requested video mode has been disabled from the resolution menu!\n");
|
||||||
|
printf("If you want to run the program in this mode, you'll have to start it with an\n");
|
||||||
|
printf("enabled mode, then enter the resolution menu and enable the mode you want.\n");
|
||||||
|
printf("Check also if the 'Default_video_mode' parameter in GFX2.INI is correct.\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_NUMERO_MODE : printf("Error: Invalid parameter or file not found.\n\n");
|
||||||
|
Afficher_syntaxe();
|
||||||
|
break;
|
||||||
|
case ERREUR_SAUVEGARDE_CFG : printf("Error: Write error while saving settings!\n");
|
||||||
|
printf("Settings have not been saved correctly, and the GFX2.CFG file may have been\n");
|
||||||
|
printf("corrupt. If so, please run GFXCFG to make a new valid file.\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_REPERTOIRE_DISPARU : printf("Error: Directory you ran the program from not found!\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_INI_ABSENT : printf("Error: File GFX2.INI is missing!\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_INI_CORROMPU : printf("Error: File GFX2.INI is corrupt!\n");
|
||||||
|
printf("It contains bad values at line %d.\n",Ligne_INI);
|
||||||
|
break;
|
||||||
|
case ERREUR_SAUVEGARDE_INI : printf("Error: Cannot rewrite file GFX2.INI!\n");
|
||||||
|
break;
|
||||||
|
case ERREUR_SORRY_SORRY_SORRY : printf("Error: Sorry! Sorry! Sorry! Please forgive me!\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Clavier_de_depart();
|
||||||
|
exit(Code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------- Analyse de la ligne de commande ---------------------
|
||||||
|
void Analyse_de_la_ligne_de_commande(int argc,char * argv[])
|
||||||
|
{
|
||||||
|
byte Option2=1;
|
||||||
|
char *Buffer;
|
||||||
|
|
||||||
|
|
||||||
|
Un_fichier_a_ete_passe_en_parametre=0;
|
||||||
|
Une_resolution_a_ete_passee_en_parametre=0;
|
||||||
|
|
||||||
|
switch (argc)
|
||||||
|
{
|
||||||
|
case 1 : // Mode par d‚faut
|
||||||
|
Resolution_actuelle=Config.Resolution_par_defaut;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2 :
|
||||||
|
case 3 :
|
||||||
|
if (Fichier_existe(argv[1]))
|
||||||
|
{
|
||||||
|
Un_fichier_a_ete_passe_en_parametre=1;
|
||||||
|
Option2=2;
|
||||||
|
|
||||||
|
// On r‚cupŠre le chemin complet du paramŠtre
|
||||||
|
Buffer=realpath(argv[1],NULL);
|
||||||
|
// Et on d‚coupe ce chemin en r‚pertoire(path) + fichier(.ext)
|
||||||
|
_splitpath(Buffer,Principal_Repertoire_fichier,Principal_Nom_fichier);
|
||||||
|
// chdir(Principal_Repertoire_fichier);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (argc==3)
|
||||||
|
Erreur(ERREUR_NUMERO_MODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Option2<argc)
|
||||||
|
{
|
||||||
|
if ( (!strcmp(argv[Option2],"/?")) ||
|
||||||
|
(!strcmp(argv[Option2],"/h")) ||
|
||||||
|
(!strcmp(argv[Option2],"/H")) )
|
||||||
|
{
|
||||||
|
Passer_en_mode_texte(Ancien_nb_lignes);
|
||||||
|
Clavier_de_depart();
|
||||||
|
Afficher_syntaxe();
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Resolution_actuelle=Str2num(argv[Option2]); // Mode d‚sir‚ par l'utilisateur
|
||||||
|
if ( (Resolution_actuelle<MODE_320_200) || (Resolution_actuelle>MODE_1024_768) )
|
||||||
|
Erreur(ERREUR_NUMERO_MODE);
|
||||||
|
Une_resolution_a_ete_passee_en_parametre=Un_fichier_a_ete_passe_en_parametre;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Erreur: trop de paramŠtres sur la ligne de commande
|
||||||
|
Erreur(ERREUR_LIGNE_COMMANDE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Mode_video[Resolution_actuelle].Etat>=128)
|
||||||
|
Erreur(ERREUR_MODE_VESA_INVALIDE);
|
||||||
|
else
|
||||||
|
if (Mode_video[Resolution_actuelle].Etat==3)
|
||||||
|
Erreur(ERREUR_MODE_INTERDIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------ Initialiser le programme -------------------------
|
||||||
|
void Initialisation_du_programme(int argc,char * argv[])
|
||||||
|
{
|
||||||
|
int Temp;
|
||||||
|
int Mode_dans_lequel_on_demarre;
|
||||||
|
|
||||||
|
// On commence ‚galement par interdire d'appuyer sur Ctrl+Pause et Ctrl+C
|
||||||
|
signal(SIGINT ,SIG_IGN);
|
||||||
|
|
||||||
|
printf("°±²Û GrafX 2.00 %s%s þ Copyright (c)1996-1999 Sunset Design Û²±°\n",ALPHA_BETA,POURCENTAGE_VERSION);
|
||||||
|
|
||||||
|
// On cr‚e dŠs maintenant les descripteurs des listes de pages pour la page
|
||||||
|
// principale et la page de brouillon afin que leurs champs ne soient pas
|
||||||
|
// invalide lors des appels aux multiples fonctions manipul‚es …
|
||||||
|
// l'initialisation du programme.
|
||||||
|
Principal_Backups=(S_Liste_de_pages *)malloc(sizeof(S_Liste_de_pages));
|
||||||
|
Brouillon_Backups=(S_Liste_de_pages *)malloc(sizeof(S_Liste_de_pages));
|
||||||
|
Initialiser_S_Liste_de_pages(Principal_Backups);
|
||||||
|
Initialiser_S_Liste_de_pages(Brouillon_Backups);
|
||||||
|
|
||||||
|
// On calcule tout de suite la table pr‚calcul‚e utilis‚e pour la recherche
|
||||||
|
// des meilleures couleurs afin de ne pas avoir de valeurs catastrophiques
|
||||||
|
// d‚sign‚es au d‚marrage (couleurs du menu, ...)
|
||||||
|
Initialiser_la_table_precalculee_des_distances_de_couleur();
|
||||||
|
|
||||||
|
// On d‚termine dŠs le d‚part o— se trouve le fichier:
|
||||||
|
Chercher_repertoire_du_programme(argv[0]);
|
||||||
|
// On d‚tecte les lecteurs qui sont accessibles:
|
||||||
|
Rechercher_drives();
|
||||||
|
// On d‚termine le r‚pertoire courant:
|
||||||
|
Determiner_repertoire_courant();
|
||||||
|
|
||||||
|
// On en profite pour le m‚moriser dans le r‚pertoire principal:
|
||||||
|
strcpy(Repertoire_initial,Principal_Repertoire_courant);
|
||||||
|
|
||||||
|
// On initialise les donn‚es sur le nom de fichier de l'image principale:
|
||||||
|
strcpy(Principal_Repertoire_fichier,Principal_Repertoire_courant);
|
||||||
|
strcpy(Principal_Nom_fichier,"NO_NAME.PKM");
|
||||||
|
Principal_Format_fichier=FORMAT_PAR_DEFAUT;
|
||||||
|
// On initialise les donn‚es sur le nom de fichier de l'image de brouillon:
|
||||||
|
strcpy(Brouillon_Repertoire_courant,Principal_Repertoire_courant);
|
||||||
|
strcpy(Brouillon_Repertoire_fichier,Principal_Repertoire_fichier);
|
||||||
|
strcpy(Brouillon_Nom_fichier ,Principal_Nom_fichier);
|
||||||
|
Brouillon_Format_fichier =Principal_Format_fichier;
|
||||||
|
strcpy(Brosse_Repertoire_courant,Principal_Repertoire_courant);
|
||||||
|
strcpy(Brosse_Repertoire_fichier,Principal_Repertoire_fichier);
|
||||||
|
strcpy(Brosse_Nom_fichier ,Principal_Nom_fichier);
|
||||||
|
Brosse_Format_fichier =Principal_Format_fichier;
|
||||||
|
|
||||||
|
// On initialise ce qu'il faut pour que les fileselects ne plantent pas:
|
||||||
|
Liste_du_fileselect=NULL; // Au d‚but, il n'y a pas de fichiers dans la liste
|
||||||
|
Principal_File_list_Position=0; // Au d‚but, le fileselect est en haut de la liste des fichiers
|
||||||
|
Principal_File_list_Decalage=0; // Au d‚but, le fileselect est en haut de la liste des fichiers
|
||||||
|
Principal_Format=0;
|
||||||
|
Brouillon_File_list_Position=0;
|
||||||
|
Brouillon_File_list_Decalage=0;
|
||||||
|
Brouillon_Format=0;
|
||||||
|
Brosse_File_list_Position=0;
|
||||||
|
Brosse_File_list_Decalage=0;
|
||||||
|
Brosse_Format=0;
|
||||||
|
|
||||||
|
// On initialise les commentaires des images … des chaŒnes vides
|
||||||
|
Principal_Commentaire[0]='\0';
|
||||||
|
Brouillon_Commentaire[0]='\0';
|
||||||
|
Brosse_Commentaire[0]='\0';
|
||||||
|
|
||||||
|
// On initialise d'ot' trucs
|
||||||
|
Principal_Decalage_X=0;
|
||||||
|
Principal_Decalage_Y=0;
|
||||||
|
Ancien_Principal_Decalage_X=0;
|
||||||
|
Ancien_Principal_Decalage_Y=0;
|
||||||
|
Principal_Split=0;
|
||||||
|
Principal_X_Zoom=0;
|
||||||
|
Principal_Proportion_split=PROPORTION_SPLIT;
|
||||||
|
Loupe_Mode=0;
|
||||||
|
Loupe_Facteur=FACTEUR_DE_ZOOM_PAR_DEFAUT;
|
||||||
|
Loupe_Hauteur=0;
|
||||||
|
Loupe_Largeur=0;
|
||||||
|
Loupe_Decalage_X=0;
|
||||||
|
Loupe_Decalage_Y=0;
|
||||||
|
Brouillon_Decalage_X=0;
|
||||||
|
Brouillon_Decalage_Y=0;
|
||||||
|
Ancien_Brouillon_Decalage_X=0;
|
||||||
|
Ancien_Brouillon_Decalage_Y=0;
|
||||||
|
Brouillon_Split=0;
|
||||||
|
Brouillon_X_Zoom=0;
|
||||||
|
Brouillon_Proportion_split=PROPORTION_SPLIT;
|
||||||
|
Brouillon_Loupe_Mode=0;
|
||||||
|
Brouillon_Loupe_Facteur=FACTEUR_DE_ZOOM_PAR_DEFAUT;
|
||||||
|
Brouillon_Loupe_Hauteur=0;
|
||||||
|
Brouillon_Loupe_Largeur=0;
|
||||||
|
Brouillon_Loupe_Decalage_X=0;
|
||||||
|
Brouillon_Loupe_Decalage_Y=0;
|
||||||
|
|
||||||
|
// On initialise tous les modes vid‚o
|
||||||
|
Definition_des_modes_video();
|
||||||
|
|
||||||
|
// On initialise les donn‚es sur l'‚tat du programme:
|
||||||
|
// Donn‚e sur la sortie du programme:
|
||||||
|
Sortir_du_programme=0;
|
||||||
|
// Donn‚es sur l'‚tat du menu:
|
||||||
|
Pixel_dans_menu=Pixel_dans_barre_d_outil;
|
||||||
|
Menu_visible=1;
|
||||||
|
// Donn‚es sur les couleurs et la palette:
|
||||||
|
Fore_color=15;
|
||||||
|
Back_color=0;
|
||||||
|
Couleur_debut_palette=0;
|
||||||
|
// Donn‚es sur le curseur:
|
||||||
|
Forme_curseur=FORME_CURSEUR_CIBLE;
|
||||||
|
Cacher_curseur=0;
|
||||||
|
// Donn‚es sur le pinceau:
|
||||||
|
Pinceau_X=0;
|
||||||
|
Pinceau_Y=0;
|
||||||
|
Pinceau_Forme=FORME_PINCEAU_ROND;
|
||||||
|
Cacher_pinceau=0;
|
||||||
|
|
||||||
|
Pixel_de_chargement=Pixel_Chargement_dans_ecran_courant;
|
||||||
|
|
||||||
|
Forcer_affichage_curseur=0;
|
||||||
|
|
||||||
|
// On initialise la table des carr‚s:
|
||||||
|
Initialiser_la_table_des_carres();
|
||||||
|
|
||||||
|
// On initialise tout ce qui concerne les op‚rations et les effets
|
||||||
|
Operation_Taille_pile=0;
|
||||||
|
Mode_de_dessin_en_cours=OPERATION_DESSIN_CONTINU;
|
||||||
|
Ligne_en_cours =OPERATION_LIGNE;
|
||||||
|
Courbe_en_cours =OPERATION_COURBE_3_POINTS;
|
||||||
|
Fonction_effet=Aucun_effet;
|
||||||
|
// On initialise les infos de la loupe:
|
||||||
|
Loupe_Mode=0;
|
||||||
|
Loupe_Facteur=FACTEUR_DE_ZOOM_PAR_DEFAUT;
|
||||||
|
Initialiser_les_tables_de_multiplication();
|
||||||
|
Table_mul_facteur_zoom=TABLE_ZOOM[2];
|
||||||
|
Principal_Proportion_split=PROPORTION_SPLIT;
|
||||||
|
Brouillon_Proportion_split=PROPORTION_SPLIT;
|
||||||
|
// On initialise les infos du mode smear:
|
||||||
|
Smear_Mode=0;
|
||||||
|
Smear_Brosse_Largeur=LARGEUR_PINCEAU;
|
||||||
|
Smear_Brosse_Hauteur=HAUTEUR_PINCEAU;
|
||||||
|
// On initialise les infos du mode smooth:
|
||||||
|
Smooth_Mode=0;
|
||||||
|
// On initialise les infos du mode shade:
|
||||||
|
Shade_Mode=0; // Les autres infos du Shade sont charg‚es avec la config
|
||||||
|
Quick_shade_Mode=0; // idem
|
||||||
|
// On initialise les infos sur les d‚grad‚s:
|
||||||
|
Traiter_pixel_de_degrade =Afficher_pixel; // Les autres infos sont charg‚es avec la config
|
||||||
|
// On initialise les infos de la grille:
|
||||||
|
Snap_Mode=0;
|
||||||
|
Snap_Largeur=8;
|
||||||
|
Snap_Hauteur=8;
|
||||||
|
Snap_Decalage_X=0;
|
||||||
|
Snap_Decalage_Y=0;
|
||||||
|
// On initialise les infos du mode Colorize:
|
||||||
|
Colorize_Mode=0; // Mode colorize inactif par d‚faut
|
||||||
|
Colorize_Opacite=50; // Une interpolation de 50% par d‚faut
|
||||||
|
Colorize_Mode_en_cours=0; // Par d‚faut, la m‚thode par interpolation
|
||||||
|
Calculer_les_tables_de_Colorize();
|
||||||
|
// On initialise les infos du mode Tiling:
|
||||||
|
Tiling_Mode=0; // Pas besoin d'initialiser les d‚calages car ‡a se fait
|
||||||
|
// en prenant une brosse (toujours mis … 0).
|
||||||
|
// On initialise les infos du mode Mask:
|
||||||
|
Mask_Mode=0;
|
||||||
|
|
||||||
|
// Infos du Spray
|
||||||
|
Spray_Mode=1; // Mode Mono
|
||||||
|
Spray_Size=31;
|
||||||
|
Spray_Delay=1;
|
||||||
|
Spray_Mono_flow=10;
|
||||||
|
memset(Spray_Multi_flow,0,256);
|
||||||
|
srand(time(NULL)); // On randomize un peu tout ‡a...
|
||||||
|
|
||||||
|
// R‚cup‚ration du nombre de lignes de l'ancien mode
|
||||||
|
Ancien_nb_lignes=Recuperer_nb_lignes();
|
||||||
|
// Passer en clavier am‚ricain
|
||||||
|
Clavier_americain();
|
||||||
|
|
||||||
|
// Tester la pr‚sence de la souris
|
||||||
|
if (!Detection_souris()) Erreur(ERREUR_DRIVER_SOURIS);
|
||||||
|
|
||||||
|
// Initialisation des boutons
|
||||||
|
Initialisation_des_boutons();
|
||||||
|
// Initialisation des op‚rations
|
||||||
|
Initialisation_des_operations();
|
||||||
|
|
||||||
|
Une_fenetre_est_ouverte=0;
|
||||||
|
|
||||||
|
// Charger les sprites et la palette
|
||||||
|
Charger_DAT();
|
||||||
|
// Charger la configuration des touches
|
||||||
|
Temp=Charger_CFG(1);
|
||||||
|
if (Temp)
|
||||||
|
Erreur(Temp);
|
||||||
|
// Charger la configuration du .INI
|
||||||
|
Temp=Charger_INI(&Config);
|
||||||
|
if (Temp)
|
||||||
|
Erreur(Temp);
|
||||||
|
|
||||||
|
// Transfert des valeurs du .INI qui ne changent pas dans des variables
|
||||||
|
// plus accessibles:
|
||||||
|
Palette_defaut[252]=Coul_menu_pref[0]=Config.Coul_menu_pref[0];
|
||||||
|
Palette_defaut[253]=Coul_menu_pref[1]=Config.Coul_menu_pref[1];
|
||||||
|
Palette_defaut[254]=Coul_menu_pref[2]=Config.Coul_menu_pref[2];
|
||||||
|
Palette_defaut[255]=Coul_menu_pref[3]=Config.Coul_menu_pref[3];
|
||||||
|
memcpy(Principal_Palette,Palette_defaut,sizeof(T_Palette));
|
||||||
|
|
||||||
|
CM_Noir =0;
|
||||||
|
CM_Fonce=25;
|
||||||
|
CM_Clair=7;
|
||||||
|
CM_Blanc=15;
|
||||||
|
CM_Trans=1;
|
||||||
|
Calculer_couleurs_menu_optimales(Palette_defaut);
|
||||||
|
|
||||||
|
// Infos sur les trames (Sieve)
|
||||||
|
Trame_Mode=0;
|
||||||
|
Copier_trame_predefinie(0);
|
||||||
|
|
||||||
|
// On s‚lectionne toutes les couleurs pour le masque de copie de couleurs vers le brouillon
|
||||||
|
memset(Masque_copie_couleurs,1,256);
|
||||||
|
|
||||||
|
// Prise en compte de la fonte
|
||||||
|
if (Config.Fonte)
|
||||||
|
Fonte=Fonte_fun;
|
||||||
|
else
|
||||||
|
Fonte=Fonte_systeme;
|
||||||
|
|
||||||
|
// Allocation de m‚moire pour la brosse
|
||||||
|
if (!(Brosse =(byte *)malloc( 1* 1))) Erreur(ERREUR_MEMOIRE);
|
||||||
|
if (!(Smear_Brosse =(byte *)malloc(TAILLE_MAXI_PINCEAU*TAILLE_MAXI_PINCEAU))) Erreur(ERREUR_MEMOIRE);
|
||||||
|
|
||||||
|
// Pinceau
|
||||||
|
if (!(Pinceau_Sprite=(byte *)malloc(TAILLE_MAXI_PINCEAU*TAILLE_MAXI_PINCEAU))) Erreur(ERREUR_MEMOIRE);
|
||||||
|
*Pinceau_Sprite=1;
|
||||||
|
Pinceau_Largeur=1;
|
||||||
|
Pinceau_Hauteur=1;
|
||||||
|
|
||||||
|
// D‚tection des modes SDL en ‚tat de fonctionner:
|
||||||
|
Liste_Modes_Videos_SDL= SDL_ListModes(NULL, 0);
|
||||||
|
|
||||||
|
//Ici, trier les modes dispos ou pas dans le tableau global ...
|
||||||
|
|
||||||
|
/*
|
||||||
|
Support_VESA();
|
||||||
|
if (!VESA_Erreur)
|
||||||
|
{
|
||||||
|
Mode_VESA_supporte(0x100,0);
|
||||||
|
Mode_VESA_supporte(0x101,1);
|
||||||
|
Mode_VESA_supporte(0x103,2);
|
||||||
|
Mode_VESA_supporte(0x105,3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
//Pas de VESA...
|
||||||
|
{
|
||||||
|
for (Temp=0; Temp<NB_MODES_VIDEO; Temp++)
|
||||||
|
{
|
||||||
|
if (Mode_video[Temp].Mode>=MODE_VESA)
|
||||||
|
Mode_video[Temp].Etat+=128;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
Analyse_de_la_ligne_de_commande(argc,argv);
|
||||||
|
|
||||||
|
Mode_dans_lequel_on_demarre=Resolution_actuelle;
|
||||||
|
Buffer_de_ligne_horizontale=NULL;
|
||||||
|
Resolution_actuelle=-1; // On n'‚tait pas dans un mode graphique
|
||||||
|
Initialiser_mode_video(Mode_dans_lequel_on_demarre);
|
||||||
|
|
||||||
|
Principal_Largeur_image=Largeur_ecran;
|
||||||
|
Principal_Hauteur_image=Hauteur_ecran;
|
||||||
|
Brouillon_Largeur_image=Largeur_ecran;
|
||||||
|
Brouillon_Hauteur_image=Hauteur_ecran;
|
||||||
|
|
||||||
|
// Allocation de m‚moire pour les diff‚rents ‚crans virtuels (et brosse)
|
||||||
|
if (Initialiser_les_listes_de_backups_en_debut_de_programme(Config.Nb_pages_Undo+1,Largeur_ecran,Hauteur_ecran)==0)
|
||||||
|
Erreur(ERREUR_MEMOIRE);
|
||||||
|
|
||||||
|
// On remet le nom par d‚faut pour la page de brouillon car il ‚t‚ modifi‚
|
||||||
|
// par le passage d'un fichier en paramŠtre lors du traitement pr‚c‚dent.
|
||||||
|
// Note: le fait que l'on ne modifie que les variables globales Brouillon_*
|
||||||
|
// et pas les infos contenues dans la page de brouillon elle-mˆme ne m'ins-
|
||||||
|
// -pire pas confiance mais ‡a a l'air de marcher sans poser de problŠmes,
|
||||||
|
// alors...
|
||||||
|
if (Un_fichier_a_ete_passe_en_parametre)
|
||||||
|
{
|
||||||
|
strcpy(Brouillon_Repertoire_fichier,Brouillon_Repertoire_courant);
|
||||||
|
strcpy(Brouillon_Nom_fichier,"NO_NAME.PKM");
|
||||||
|
Brouillon_Format_fichier=FORMAT_PAR_DEFAUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nettoyage de l'‚cran virtuel (les autres recevront celui-ci par copie)
|
||||||
|
memset(Principal_Ecran,0,Principal_Largeur_image*Principal_Hauteur_image);
|
||||||
|
|
||||||
|
// Initialisation de diverses variables par calcul:
|
||||||
|
Calculer_donnees_loupe();
|
||||||
|
Calculer_limites();
|
||||||
|
Calculer_coordonnees_pinceau();
|
||||||
|
|
||||||
|
// On affiche le menu:
|
||||||
|
Afficher_menu();
|
||||||
|
Afficher_pinceau_dans_menu();
|
||||||
|
|
||||||
|
// On affiche le curseur pour d‚butter correctement l'‚tat du programme:
|
||||||
|
Afficher_curseur();
|
||||||
|
|
||||||
|
Brouillon_Image_modifiee=0;
|
||||||
|
Principal_Image_modifiee=0;
|
||||||
|
|
||||||
|
// Le programme d‚bute en mode de dessin … la main
|
||||||
|
Enclencher_bouton(BOUTON_DESSIN,A_GAUCHE);
|
||||||
|
|
||||||
|
// On initialise la brosse initiale … 1 pixel blanc:
|
||||||
|
Brosse_Largeur=1;
|
||||||
|
Brosse_Hauteur=1;
|
||||||
|
Capturer_brosse(0,0,0,0,0);
|
||||||
|
*Brosse=CM_Blanc;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------- Fermeture du programme --------------------------
|
||||||
|
void Fermeture_du_programme(void)
|
||||||
|
{
|
||||||
|
unsigned Bidon;
|
||||||
|
int Retour;
|
||||||
|
|
||||||
|
// On libŠre le buffer de gestion de lignes
|
||||||
|
free(Buffer_de_ligne_horizontale);
|
||||||
|
|
||||||
|
// On libŠre le pinceau sp‚cial
|
||||||
|
free(Pinceau_Sprite);
|
||||||
|
|
||||||
|
// On libŠre la table pr‚calcul‚e des distances de teintes
|
||||||
|
free(MC_Table_differences);
|
||||||
|
|
||||||
|
// On libŠre les diff‚rents ‚crans virtuels et brosse:
|
||||||
|
free(Brosse);
|
||||||
|
Nouveau_nombre_de_backups(0);
|
||||||
|
free(Brouillon_Ecran);
|
||||||
|
free(Principal_Ecran);
|
||||||
|
|
||||||
|
// On libŠre ‚galement les donn‚es de l'aide:
|
||||||
|
for (Bidon=0;Bidon<NB_SECTIONS_AIDE;Bidon++)
|
||||||
|
free(Table_d_aide[Bidon].Debut_de_la_liste);
|
||||||
|
|
||||||
|
Passer_en_mode_texte(Ancien_nb_lignes);
|
||||||
|
Clavier_de_depart();
|
||||||
|
|
||||||
|
// On prend bien soin de passer dans le r‚pertoire initial:
|
||||||
|
if (chdir(Repertoire_initial)!=-1)
|
||||||
|
{
|
||||||
|
/* A revoir ...
|
||||||
|
_dos_setdrive(Repertoire_initial[0]-64,&Bidon);
|
||||||
|
*/
|
||||||
|
// On sauvegarde les donn‚es dans le .CFG et dans le .INI
|
||||||
|
if (Config.Auto_save)
|
||||||
|
{
|
||||||
|
Retour=Sauver_CFG();
|
||||||
|
if (Retour)
|
||||||
|
Erreur(Retour);
|
||||||
|
Retour=Sauver_INI(&Config);
|
||||||
|
if (Retour)
|
||||||
|
Erreur(Retour);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Erreur(ERREUR_REPERTOIRE_DISPARU);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------- Proc‚dure principale ---------------------------
|
||||||
|
int main(int argc,char * argv[])
|
||||||
|
{
|
||||||
|
Initialisation_du_programme(argc,argv);
|
||||||
|
|
||||||
|
if (Config.Opening_message && (!Un_fichier_a_ete_passe_en_parametre))
|
||||||
|
Bouton_Message_initial();
|
||||||
|
free(Logo_GrafX2);
|
||||||
|
|
||||||
|
if (Un_fichier_a_ete_passe_en_parametre)
|
||||||
|
{
|
||||||
|
Bouton_reload();
|
||||||
|
Une_resolution_a_ete_passee_en_parametre=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Gestion_principale();
|
||||||
|
|
||||||
|
Fermeture_du_programme();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
4
make.inc
Normal file
4
make.inc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
system dos4g
|
||||||
|
op stub=weoslite.exe
|
||||||
|
file video,divers,graph,init,special,boutons,palette,aide,operatio,loadsave,readline,moteur,main,files,dpmi,vesalfb,op_c,op_asm
|
||||||
|
name gfx2
|
||||||
62
makefile
Normal file
62
makefile
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
CC = gcc
|
||||||
|
COPT = -Wall -Os
|
||||||
|
ASMC = tasm
|
||||||
|
ASMOPT = /mx /r /zn /os
|
||||||
|
|
||||||
|
|
||||||
|
gfx2 : main.o init.o graph.o video.o divers.o special.o boutons.o palette.o aide.o operatio.o loadsave.o readline.o moteur.o files.o dpmi.o vesalfb.o op_c.o op_asm.o
|
||||||
|
wlink @make.inc
|
||||||
|
|
||||||
|
main.o : const.h struct.h global.h graph.h divers.h init.h boutons.h moteur.h files.h loadsave.h main.c vesalfb.h vesahigh.c readini.h saveini.h
|
||||||
|
$(CC) $(COPT) main.c
|
||||||
|
|
||||||
|
init.o : const.h struct.h global.h modesvdo.h graph.h boutons.h palette.h aide.h operatio.h init.c readini.c saveini.c
|
||||||
|
$(CC) $(COPT) init.c
|
||||||
|
|
||||||
|
graph.o : graph.c pages.c const.h struct.h global.h video.h divers.h
|
||||||
|
$(CC) $(COPT) graph.c
|
||||||
|
|
||||||
|
video.o : global.h const.h video.asm
|
||||||
|
$(ASMC) $(ASMOPT) video.c
|
||||||
|
|
||||||
|
divers.o : global.h const.h divers.asm
|
||||||
|
$(ASMC) $(ASMOPT) divers.c
|
||||||
|
|
||||||
|
special.o : const.h struct.h global.h graph.h moteur.h special.c
|
||||||
|
$(CC) $(COPT) special.c
|
||||||
|
|
||||||
|
boutons.obj : boutons.c shade.c const.h struct.h global.h divers.h graph.h moteur.h readline.h files.h loadsave.h init.h readini.h saveini.h
|
||||||
|
$(CC) $(COPT) boutons
|
||||||
|
|
||||||
|
palette.obj : const.h struct.h global.h divers.h graph.h moteur.h readline.h palette.c
|
||||||
|
$(CC) $(COPT) palette
|
||||||
|
|
||||||
|
aide.obj : const.h struct.h global.h divers.h graph.h moteur.h aide.c
|
||||||
|
$(CC) $(COPT) aide
|
||||||
|
|
||||||
|
moteur.obj : const.h struct.h global.h graph.h divers.h moteur.c
|
||||||
|
$(CC) $(COPT) moteur
|
||||||
|
|
||||||
|
operatio.obj : const.h struct.h global.h divers.h moteur.h graph.h operatio.h operatio.c
|
||||||
|
$(CC) $(COPT) operatio
|
||||||
|
|
||||||
|
readline.obj : const.h struct.h global.h divers.h graph.h readline.c
|
||||||
|
$(CC) $(COPT) readline
|
||||||
|
|
||||||
|
files.obj : const.h struct.h global.h graph.h divers.h files.c
|
||||||
|
$(CC) $(COPT) files
|
||||||
|
|
||||||
|
loadsave.obj : const.h struct.h global.h divers.h graph.h loadsave.c pages.h op_c.h op_asm.h
|
||||||
|
$(CC) $(COPT) loadsave
|
||||||
|
|
||||||
|
op_c.obj : struct.h op_c.c op_c.h op_asm.h
|
||||||
|
$(CC) $(COPT) op_c
|
||||||
|
|
||||||
|
dpmi.obj : dpmi.asm dpmi.h
|
||||||
|
$(ASMC) $(ASMOPT) dpmi
|
||||||
|
|
||||||
|
vesalfb.obj : vesalfb.asm vesalfb.h dpmi.h
|
||||||
|
$(ASMC) $(ASMOPT) vesalfb
|
||||||
|
|
||||||
|
op_asm.obj : struct.h op_asm.asm op_c.h op_asm.h
|
||||||
|
$(ASMC) $(ASMOPT) op_asm
|
||||||
227
mcnormal.asm
Normal file
227
mcnormal.asm
Normal file
@ -0,0 +1,227 @@
|
|||||||
|
; -- Calcul de la meilleure couleur s'approchant d'une teinte particuliŠre --
|
||||||
|
|
||||||
|
Meilleure_couleur proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Rouge:byte,Vert:byte,Bleu:byte
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
|
||||||
|
|
||||||
|
; On place dans ESI l'adresse de la palette
|
||||||
|
mov esi,offset Principal_Palette
|
||||||
|
|
||||||
|
; On place l'indice de la couleur au d‚but de la table d'exclusion de coul.
|
||||||
|
mov MC_Indice,offset Exclude_color
|
||||||
|
|
||||||
|
; EDI servira … stocker la meilleure diff‚rence
|
||||||
|
mov edi,07FFFFFFFh
|
||||||
|
|
||||||
|
; On se sert de CL pour compter la couleur en cours
|
||||||
|
; (et CH servira … stocker la meilleure couleur)
|
||||||
|
xor cx,cx
|
||||||
|
|
||||||
|
; On nettoie la partie haute de EAX:
|
||||||
|
xor eax,eax
|
||||||
|
|
||||||
|
Meilleure_couleur_Pour_chaque_couleur:
|
||||||
|
|
||||||
|
; On v‚rifie que la couleur ne soit pas exclue
|
||||||
|
mov ebx,MC_Indice
|
||||||
|
cmp byte ptr [ebx],0
|
||||||
|
jnz Meilleure_couleur_Pas_mieux
|
||||||
|
|
||||||
|
; EBX sert … pointer la table pr‚calcul‚e
|
||||||
|
mov ebx,MC_Table_differences
|
||||||
|
|
||||||
|
; On calcule la diff‚rence:
|
||||||
|
;
|
||||||
|
; Le calcul s'effectue dans EDX (on y cumule les diff‚rences), en se
|
||||||
|
; servant de EBX pour pointer la table pr‚calcul‚e, et de AX comme
|
||||||
|
; indice dans la table
|
||||||
|
|
||||||
|
; On s'occupe de la composante Rouge
|
||||||
|
mov al,[esi]
|
||||||
|
mov dl,[esi+1] ; et en entrelac‚ de la composante verte
|
||||||
|
mov ah,Rouge
|
||||||
|
mov dh,Vert
|
||||||
|
sub al,ah
|
||||||
|
sub dl,dh
|
||||||
|
and eax,127
|
||||||
|
and edx,127
|
||||||
|
mov edx,[ebx+4*edx+128*4]
|
||||||
|
add edx,[ebx+4*eax]
|
||||||
|
|
||||||
|
; On s'occupe de la composante Bleue
|
||||||
|
mov al,[esi+2]
|
||||||
|
mov ah,Bleu
|
||||||
|
sub al,ah
|
||||||
|
and eax,127
|
||||||
|
add edx,[ebx+4*eax+256*4]
|
||||||
|
|
||||||
|
jz Meilleure_couleur_Correspond_impeccablement
|
||||||
|
|
||||||
|
cmp edx,edi
|
||||||
|
jae Meilleure_couleur_Pas_mieux
|
||||||
|
|
||||||
|
; L…, on sait que CL contient une meilleure couleur que CH
|
||||||
|
|
||||||
|
mov ch,cl ; On commence par mettre CH … CL
|
||||||
|
mov edi,edx ; Ensuite, on peut mettre DI (meilleure diff‚rence) … jour
|
||||||
|
|
||||||
|
Meilleure_couleur_Pas_mieux:
|
||||||
|
|
||||||
|
inc MC_Indice
|
||||||
|
add esi,3
|
||||||
|
|
||||||
|
inc cl
|
||||||
|
jnz Meilleure_couleur_Pour_chaque_couleur
|
||||||
|
|
||||||
|
; Ici, on sait que CH contient d‚j… la meilleure couleur. On va donc faire
|
||||||
|
; une sortie rapide (c'est pas bien, mais ‡a fait gagner 3 cycles)
|
||||||
|
|
||||||
|
mov al,ch
|
||||||
|
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Meilleure_couleur_Correspond_impeccablement:
|
||||||
|
|
||||||
|
; Ici, on sait que CL contient la couleur qui correspond exactement aux
|
||||||
|
; exigences de l'appelant
|
||||||
|
|
||||||
|
mov al,cl
|
||||||
|
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Meilleure_couleur endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; -- Calcul de la meilleure couleur s'approchant d'une teinte particuliŠre --
|
||||||
|
; -- et ceci SANS exclure certaines couleurs coch‚es par l'utilisateur --
|
||||||
|
|
||||||
|
Meilleure_couleur_sans_exclusion proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Rouge:byte,Vert:byte,Bleu:byte
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
|
||||||
|
|
||||||
|
; On place dans ESI l'adresse de la palette
|
||||||
|
mov esi,offset Principal_Palette
|
||||||
|
|
||||||
|
; EDI servira … stocker la meilleure diff‚rence
|
||||||
|
mov edi,07FFFFFFFh
|
||||||
|
|
||||||
|
; On se sert de CL pour compter la couleur en cours
|
||||||
|
; (et CH servira … stocker la meilleure couleur)
|
||||||
|
xor cx,cx
|
||||||
|
|
||||||
|
; On nettoie la partie haute de EAX:
|
||||||
|
xor eax,eax
|
||||||
|
|
||||||
|
; EBX sert … pointer la table pr‚calcul‚e
|
||||||
|
mov ebx,MC_Table_differences
|
||||||
|
|
||||||
|
MCSE_Pour_chaque_couleur:
|
||||||
|
|
||||||
|
; On calcule la diff‚rence:
|
||||||
|
;
|
||||||
|
; Le calcul s'effectue dans EDX (on y cumule les diff‚rences), en se
|
||||||
|
; servant de EBX pour pointer la table pr‚calcul‚e, et de AX comme
|
||||||
|
; indice dans la table
|
||||||
|
|
||||||
|
; On s'occupe de la composante Rouge
|
||||||
|
mov al,[esi]
|
||||||
|
mov dl,[esi+1] ; et en entrelac‚ de la composante verte
|
||||||
|
mov ah,Rouge
|
||||||
|
mov dh,Vert
|
||||||
|
sub al,ah
|
||||||
|
sub dl,dh
|
||||||
|
and eax,127
|
||||||
|
and edx,127
|
||||||
|
mov edx,[ebx+4*edx+128*4]
|
||||||
|
add edx,[ebx+4*eax]
|
||||||
|
|
||||||
|
; On s'occupe de la composante Bleue
|
||||||
|
mov al,[esi+2]
|
||||||
|
mov ah,Bleu
|
||||||
|
sub al,ah
|
||||||
|
and eax,127
|
||||||
|
add edx,[ebx+4*eax+256*4]
|
||||||
|
|
||||||
|
jz MCSE_Correspond_impeccablement
|
||||||
|
|
||||||
|
cmp edx,edi
|
||||||
|
jae MCSE_Pas_mieux
|
||||||
|
|
||||||
|
; L…, on sait que CL contient une meilleure couleur que CH
|
||||||
|
|
||||||
|
mov ch,cl ; On commence par mettre CH … CL
|
||||||
|
mov edi,edx ; Ensuite, on peut mettre DI (meilleure diff‚rence) … jour
|
||||||
|
|
||||||
|
MCSE_Pas_mieux:
|
||||||
|
|
||||||
|
add esi,3
|
||||||
|
|
||||||
|
inc cl
|
||||||
|
jnz MCSE_Pour_chaque_couleur
|
||||||
|
|
||||||
|
; Ici, on sait que CH contient d‚j… la meilleure couleur. On va donc faire
|
||||||
|
; une sortie rapide (c'est pas bien, mais ‡a fait gagner 3 cycles)
|
||||||
|
|
||||||
|
mov al,ch
|
||||||
|
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
MCSE_Correspond_impeccablement:
|
||||||
|
|
||||||
|
; Ici, on sait que CL contient la couleur qui correspond exactement aux
|
||||||
|
; exigences de l'appelant
|
||||||
|
|
||||||
|
mov al,cl
|
||||||
|
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Meilleure_couleur_sans_exclusion endp
|
||||||
246
mcpourp2.asm
Normal file
246
mcpourp2.asm
Normal file
@ -0,0 +1,246 @@
|
|||||||
|
; -- Calcul de la meilleure couleur s'approchant d'une teinte particuliŠre --
|
||||||
|
Meilleure_couleur proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Rouge:byte,Vert:byte,Bleu:byte
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
|
||||||
|
|
||||||
|
; On place dans ESI l'adresse de la palette
|
||||||
|
mov esi,offset Principal_Palette
|
||||||
|
|
||||||
|
; On place l'indice de la couleur au d‚but de la table d'exclusion de coul.
|
||||||
|
mov MC_Indice,offset Exclude_color
|
||||||
|
|
||||||
|
; EDI servira … stocker la meilleure diff‚rence
|
||||||
|
mov edi,07FFFFFFFh
|
||||||
|
|
||||||
|
; On se sert de CL pour compter la couleur en cours
|
||||||
|
; (et CH servira … stocker la meilleure couleur)
|
||||||
|
xor cx,cx
|
||||||
|
|
||||||
|
Meilleure_couleur_Pour_chaque_couleur:
|
||||||
|
|
||||||
|
mov ebx,MC_Indice
|
||||||
|
cmp byte ptr [ebx],0
|
||||||
|
jnz Meilleure_couleur_Pas_mieux
|
||||||
|
|
||||||
|
; On calcule la diff‚rence:
|
||||||
|
|
||||||
|
; On s'occupe de la composante Rouge
|
||||||
|
xor ebx,ebx
|
||||||
|
xor eax,eax
|
||||||
|
mov bl,[esi]
|
||||||
|
mov al,Rouge
|
||||||
|
sub eax,ebx
|
||||||
|
imul eax
|
||||||
|
mov MC_DR,eax
|
||||||
|
|
||||||
|
; On s'occupe de la composante Verte
|
||||||
|
xor ebx,ebx
|
||||||
|
xor eax,eax
|
||||||
|
mov bl,[esi+1]
|
||||||
|
mov al,Vert
|
||||||
|
sub eax,ebx
|
||||||
|
imul eax
|
||||||
|
mov MC_DV,eax
|
||||||
|
|
||||||
|
; On s'occupe de la composante Bleue
|
||||||
|
xor ebx,ebx
|
||||||
|
xor eax,eax
|
||||||
|
mov bl,[esi+2]
|
||||||
|
mov al,Bleu
|
||||||
|
sub eax,ebx
|
||||||
|
imul eax
|
||||||
|
mov MC_DB,eax
|
||||||
|
|
||||||
|
; On totalise la "distance" dans EBX
|
||||||
|
mov eax,30
|
||||||
|
mul MC_DR
|
||||||
|
mov ebx,eax
|
||||||
|
|
||||||
|
mov eax,59
|
||||||
|
mul MC_DV
|
||||||
|
add ebx,eax
|
||||||
|
|
||||||
|
mov eax,11
|
||||||
|
mul MC_DB
|
||||||
|
add ebx,eax
|
||||||
|
jz Meilleure_couleur_Correspond_impeccablement
|
||||||
|
|
||||||
|
cmp ebx,edi
|
||||||
|
jae Meilleure_couleur_Pas_mieux
|
||||||
|
|
||||||
|
; L…, on sait que CL contient une meilleure couleur que CH
|
||||||
|
|
||||||
|
mov ch,cl ; On commence par mettre CH … CL
|
||||||
|
mov edi,ebx ; Ensuite, on peut mettre DI (meilleure diff‚rence) … jour
|
||||||
|
|
||||||
|
Meilleure_couleur_Pas_mieux:
|
||||||
|
|
||||||
|
inc MC_Indice
|
||||||
|
add esi,3
|
||||||
|
|
||||||
|
inc cl
|
||||||
|
jnz Meilleure_couleur_Pour_chaque_couleur
|
||||||
|
|
||||||
|
; Ici, on sait que CH contient d‚j… la meilleure couleur. On va donc faire
|
||||||
|
; une sortie rapide (c'est pas bien, mais ‡a fait gagner 3 cycles)
|
||||||
|
|
||||||
|
mov al,ch
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Meilleure_couleur_Correspond_impeccablement:
|
||||||
|
|
||||||
|
; Ici, on sait que CL contient la couleur qui correspond exactement aux
|
||||||
|
; exigences de l'appelant
|
||||||
|
|
||||||
|
mov al,cl
|
||||||
|
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Meilleure_couleur endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; -- Calcul de la meilleure couleur s'approchant d'une teinte particuliŠre --
|
||||||
|
; -- et ceci SANS exclure certaines couleurs coch‚es par l'utilisateur --
|
||||||
|
|
||||||
|
Meilleure_couleur_sans_exclusion proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Rouge:byte,Vert:byte,Bleu:byte
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
|
||||||
|
|
||||||
|
; On place dans ESI l'adresse de la palette
|
||||||
|
mov esi,offset Principal_Palette
|
||||||
|
|
||||||
|
; EDI servira … stocker la meilleure diff‚rence
|
||||||
|
mov edi,07FFFFFFFh
|
||||||
|
|
||||||
|
; On se sert de CL pour compter la couleur en cours
|
||||||
|
; (et CH servira … stocker la meilleure couleur)
|
||||||
|
xor cx,cx
|
||||||
|
|
||||||
|
MCSE_Pour_chaque_couleur:
|
||||||
|
|
||||||
|
; On calcule la diff‚rence:
|
||||||
|
|
||||||
|
; On s'occupe de la composante Rouge
|
||||||
|
xor ebx,ebx
|
||||||
|
xor eax,eax
|
||||||
|
mov bl,[esi]
|
||||||
|
mov al,Rouge
|
||||||
|
sub eax,ebx
|
||||||
|
imul eax
|
||||||
|
mov MC_DR,eax
|
||||||
|
|
||||||
|
; On s'occupe de la composante Verte
|
||||||
|
xor ebx,ebx
|
||||||
|
xor eax,eax
|
||||||
|
mov bl,[esi+1]
|
||||||
|
mov al,Vert
|
||||||
|
sub eax,ebx
|
||||||
|
imul eax
|
||||||
|
mov MC_DV,eax
|
||||||
|
|
||||||
|
; On s'occupe de la composante Bleue
|
||||||
|
xor ebx,ebx
|
||||||
|
xor eax,eax
|
||||||
|
mov bl,[esi+2]
|
||||||
|
mov al,Bleu
|
||||||
|
sub eax,ebx
|
||||||
|
imul eax
|
||||||
|
mov MC_DB,eax
|
||||||
|
|
||||||
|
; On totalise la "distance" dans EBX
|
||||||
|
mov eax,30
|
||||||
|
mul MC_DR
|
||||||
|
mov ebx,eax
|
||||||
|
|
||||||
|
mov eax,59
|
||||||
|
mul MC_DV
|
||||||
|
add ebx,eax
|
||||||
|
|
||||||
|
mov eax,11
|
||||||
|
mul MC_DB
|
||||||
|
add ebx,eax
|
||||||
|
jz MCSE_Correspond_impeccablement
|
||||||
|
|
||||||
|
cmp ebx,edi
|
||||||
|
jae MCSE_Pas_mieux
|
||||||
|
|
||||||
|
; L…, on sait que CL contient une meilleure couleur que CH
|
||||||
|
|
||||||
|
mov ch,cl ; On commence par mettre CH … CL
|
||||||
|
mov edi,ebx ; Ensuite, on peut mettre DI (meilleure diff‚rence) … jour
|
||||||
|
|
||||||
|
MCSE_Pas_mieux:
|
||||||
|
|
||||||
|
add esi,3
|
||||||
|
|
||||||
|
inc cl
|
||||||
|
jnz MCSE_Pour_chaque_couleur
|
||||||
|
|
||||||
|
; Ici, on sait que CH contient d‚j… la meilleure couleur. On va donc faire
|
||||||
|
; une sortie rapide (c'est pas bien, mais ‡a fait gagner 3 cycles)
|
||||||
|
|
||||||
|
mov al,ch
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
MCSE_Correspond_impeccablement:
|
||||||
|
|
||||||
|
; Ici, on sait que CL contient la couleur qui correspond exactement aux
|
||||||
|
; exigences de l'appelant
|
||||||
|
|
||||||
|
mov al,cl
|
||||||
|
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Meilleure_couleur_sans_exclusion endp
|
||||||
219
modesvdo.h
Normal file
219
modesvdo.h
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
// Diff‚rentes tables utilis‚es pour les changements de modes vid‚os X
|
||||||
|
|
||||||
|
/*
|
||||||
|
word X376Y564[] =
|
||||||
|
{ 0x11EB, 0x6E00, 0x5D01, 0x5E02, 0x9103, 0x6204, 0x8F05, 0x6206, 0xF007,
|
||||||
|
0x6009, 0x3E10, 0x8911, 0x3312, 0x2F13, 0x0014, 0x3C15, 0x5C16, 0xE317 };
|
||||||
|
|
||||||
|
// !! NE MARCHENT PAS DU TOUT !!
|
||||||
|
word X368Y200[] =
|
||||||
|
{ 0x09C7, 0x3300, 0x2D01, 0x3102, 0x9303, 0x3004, 0x9605, 0x2E13, 0x0014,
|
||||||
|
0xE317 };
|
||||||
|
word X640Y256[] =
|
||||||
|
{ 0x12E3, 0xAD00, 0x9F01, 0x9F02, 0x8903, 0xA004, 0x0605, 0x2B06, 0x3E07,
|
||||||
|
0x0008, 0x6109, 0x9C10, 0x8E11, 0xFF12, 0x5013, 0x0014, 0x7315, 0xFE16,
|
||||||
|
0xE317 };
|
||||||
|
word X640Y256[] =
|
||||||
|
{ 0x12E3, 0xAD00, 0x9F01, 0x9F02, 0x8903, 0xA004, 0x0605, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6109, 0x0A10, 0xAC11, 0xFF12, 0x5013, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
*/
|
||||||
|
|
||||||
|
word X320Y224[] =
|
||||||
|
{ 0x0BA3, 0x6F06, 0xBA07, 0x0008, 0x4109, 0x0810, 0x8A11, 0xBF12, 0x0014,
|
||||||
|
0xC715, 0x0416, 0xE317 };
|
||||||
|
word X320Y240[] =
|
||||||
|
{ 0x0AE3, 0x0D06, 0x3E07, 0x4109, 0xEA10, 0xAC11, 0xDF12, 0x0014, 0xE715,
|
||||||
|
0x0616, 0xE317 };
|
||||||
|
word X320Y256[] =
|
||||||
|
{ 0x0CE3, 0x2306, 0xB207, 0x0008, 0x6109, 0x0A10, 0xAC11, 0xFF12, 0x2013,
|
||||||
|
0x0014, 0x0715, 0x1A16, 0xE317 };
|
||||||
|
word X320Y270[] =
|
||||||
|
{ 0x0BE7, 0x3006, 0xF007, 0x0008, 0x6109, 0x2010, 0xA911, 0x1B12, 0x0014,
|
||||||
|
0x1F15, 0x2F16, 0xE317 };
|
||||||
|
word X320Y282[] =
|
||||||
|
{ 0x0CE3, 0x6206, 0xF007, 0x6109, 0x310F, 0x3710, 0x8911, 0x3312, 0x2F13,
|
||||||
|
0x0014, 0x3C15, 0x5C16, 0xE317 };
|
||||||
|
word X320Y300[] =
|
||||||
|
{ 0x0DE3, 0x4606, 0x1F07, 0x0008, 0x4009, 0x3110, 0x8011, 0x2B12, 0x2013,
|
||||||
|
0x0014, 0x2F15, 0x4416, 0xE317 };
|
||||||
|
word X320Y360[] =
|
||||||
|
{ 0x09E3, 0x4009, 0x8810, 0x8511, 0x6712, 0x2013, 0x0014, 0x6D15, 0xBA16,
|
||||||
|
0xE317 };
|
||||||
|
word X320Y400[] =
|
||||||
|
{ 0x03E3, 0x4009, 0x0014, 0xE317 };
|
||||||
|
word X320Y448[] =
|
||||||
|
{ 0x0BA3, 0x6F06, 0xBA07, 0x0008, 0x4009, 0x0810, 0x8A11, 0xBF12, 0x0014,
|
||||||
|
0xC715, 0x0416, 0xE317 };
|
||||||
|
word X320Y480[] =
|
||||||
|
{ 0x0AE3, 0x0D06, 0x3E07, 0x4009, 0xEA10, 0xAC11, 0xDF12, 0x0014, 0xE715,
|
||||||
|
0x0616 , 0xE317};
|
||||||
|
word X320Y512[] =
|
||||||
|
{ 0x0CE3, 0x2306, 0xB207, 0x0008, 0x6009, 0x0A10, 0xAC11, 0xFF12, 0x2013,
|
||||||
|
0x0014, 0x0715, 0x1A16, 0xE317 };
|
||||||
|
word X320Y540[] =
|
||||||
|
{ 0x0BE7, 0x3006, 0xF007, 0x0008, 0x6009, 0x2010, 0xA911, 0x1B12, 0x0014,
|
||||||
|
0x1F15, 0x2F16, 0xE317 };
|
||||||
|
word X320Y564[] =
|
||||||
|
{ 0x0CE7, 0x6206, 0xF007, 0x0008, 0x6009, 0x3E10, 0x8911, 0x3312, 0x2013,
|
||||||
|
0x0014, 0x3C15, 0x5C16, 0xE317 };
|
||||||
|
word X320Y600[] =
|
||||||
|
{ 0x0BE7, 0xBE06, 0xF007, 0x0008, 0x6009, 0x7C10, 0x8C11, 0x5712, 0x0014,
|
||||||
|
0x5815, 0x7016, 0xE317 };
|
||||||
|
word X360Y200[] =
|
||||||
|
{ 0x09E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x2D13, 0x0014,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y224[] =
|
||||||
|
{ 0x12A7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x6F06, 0xBA07,
|
||||||
|
0x0008, 0x4109, 0x0810, 0x8A11, 0xBF12, 0x2D13, 0x0014, 0xC715, 0x0416,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y240[] =
|
||||||
|
{ 0x11E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x0D06, 0x3E07,
|
||||||
|
0x4109, 0xEA10, 0xAC11, 0xDF12, 0x2D13, 0x0014, 0xE715, 0x0616, 0xE317 };
|
||||||
|
word X360Y256[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6109, 0x0E10, 0xAC11, 0xFF12, 0x2D13, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y270[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x3006, 0xF007,
|
||||||
|
0x0008, 0x6109, 0x2010, 0xA911, 0x1B12, 0x2D13, 0x0014, 0x1F15, 0x2F16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y282[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x6206, 0xF007,
|
||||||
|
0x6109, 0x310F, 0x3710, 0x8911, 0x3312, 0x2D13, 0x0014, 0x3C15, 0x5C16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y300[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x4606, 0x1F07,
|
||||||
|
0x0008, 0x4009, 0x3110, 0x8011, 0x2B12, 0x2D13, 0x0014, 0x2F15, 0x4416,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y360[] =
|
||||||
|
{ 0x0FE7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x4009, 0x8810,
|
||||||
|
0x8511, 0x6712, 0x2D13, 0x0014, 0x6D15, 0xBA16, 0xE317 };
|
||||||
|
word X360Y400[] =
|
||||||
|
{ 0x0AE7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x4009, 0x2D13,
|
||||||
|
0x0014, 0xE317 };
|
||||||
|
word X360Y448[] =
|
||||||
|
{ 0x12A7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x6F06, 0xBA07,
|
||||||
|
0x0008, 0x4009, 0x0810, 0x8A11, 0xBF12, 0x2D13, 0x0014, 0xC715, 0x0416,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y480[] =
|
||||||
|
{ 0x11E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x0D06, 0x3E07,
|
||||||
|
0x4009, 0xEA10, 0xAC11, 0xDF12, 0x2D13, 0x0014, 0xE715, 0x0616, 0xE317 };
|
||||||
|
word X360Y512[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6009, 0x0E10, 0xAC11, 0xff12, 0x2D13, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y540[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x3006, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x2010, 0xA911, 0x1B12, 0x2D13, 0x0014, 0x1F15, 0x2F16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y564[] =
|
||||||
|
{ 0x12EB, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x6206, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x3E10, 0x8911, 0x3312, 0x2D13, 0x0014, 0x3C15, 0x5C16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y600[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0xBE06, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x7C10, 0x8C11, 0x5712, 0x2D13, 0x0014, 0x5815, 0x7016,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y200[] =
|
||||||
|
{ 0x09E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x3213, 0x0014,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y224[] =
|
||||||
|
{ 0x12A7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x6F06, 0xBA07,
|
||||||
|
0x0008, 0x4109, 0x0810, 0x8A11, 0xBF12, 0x3213, 0x0014, 0xC715, 0x0416,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y240[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x0D06, 0x3E07,
|
||||||
|
0x0008, 0x4109, 0xEA10, 0xAC11, 0xDF12, 0x3213, 0x0014, 0xE715, 0x0616,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y256[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6109, 0x1310, 0xAC11, 0xFF12, 0x3213, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y270[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x3006, 0xF007,
|
||||||
|
0x0008, 0x6109, 0x2010, 0xA911, 0x1B12, 0x3213, 0x0014, 0x1F15, 0x2F16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y282[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x6206, 0xF007,
|
||||||
|
0x6109, 0x310F, 0x3710, 0x8911, 0x3312, 0x3213, 0x0014, 0x3C15, 0x5C16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y300[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x4606, 0x1F07,
|
||||||
|
0x0008, 0x4009, 0x3110, 0x8011, 0x2B12, 0x3213, 0x0014, 0x2F15, 0x4416,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y360[] =
|
||||||
|
{ 0x0FE7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x4009, 0x8810,
|
||||||
|
0x8511, 0x6712, 0x3213, 0x0014, 0x6D15, 0xBA16, 0xE317 };
|
||||||
|
word X400Y400[] =
|
||||||
|
{ 0x0AE7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x4009, 0x3213,
|
||||||
|
0x0014, 0xE317 };
|
||||||
|
word X400Y448[] =
|
||||||
|
{ 0x12A7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x6F06, 0xBA07,
|
||||||
|
0x0008, 0x4009, 0x0810, 0x8A11, 0xBF12, 0x3213, 0x0014, 0xC715, 0x0416,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y480[] =
|
||||||
|
{ 0x11E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x0D06, 0x3E07,
|
||||||
|
0x4009, 0xEA10, 0xAC11, 0xDF12, 0x3213, 0x0014, 0xE715, 0x0616, 0xE317 };
|
||||||
|
word X400Y512[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6009, 0x1310, 0xAC11, 0xFF12, 0x3213, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y540[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x3006, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x2010, 0xA911, 0x1B12, 0x3213, 0x0014, 0x1F15, 0x2F16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y564[] =
|
||||||
|
{ 0x12EB, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x6206, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x3E10, 0x8911, 0x3312, 0x3213, 0x0014, 0x3C15, 0x5C16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y600[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0xBE06, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x7C10, 0x8C11, 0x5712, 0x3213, 0x0014, 0x5815, 0x7016,
|
||||||
|
0xE317 };
|
||||||
|
|
||||||
|
// Diff‚rentes tables utilis‚es pour les modifications de modes vid‚os VESA
|
||||||
|
|
||||||
|
word Y224[] =
|
||||||
|
{ 0x09A3, 0x6F06, 0xBA07, 0x0008, 0x4109, 0x0810, 0x8A11, 0xBF12, 0xC715,
|
||||||
|
0x0416 };
|
||||||
|
word Y240[] =
|
||||||
|
{ 0x09E3, 0x0D06, 0x3E07, 0x0008, 0x4109, 0xEA10, 0xAC11, 0xDF12, 0xE715,
|
||||||
|
0x0616 };
|
||||||
|
word Y256[] =
|
||||||
|
{ 0x0900, 0x2B06, 0xB207, 0x0008, 0x6109, 0x0A10, 0xAC11, 0xFF12, 0x0715,
|
||||||
|
0x1A16 };
|
||||||
|
word Y270[] =
|
||||||
|
{ 0x09E7, 0x3006, 0xF007, 0x0008, 0x6109, 0x2010, 0xA911, 0x1B12, 0x1F15,
|
||||||
|
0x2F16 };
|
||||||
|
word Y282[] =
|
||||||
|
{ 0x0AE3, 0x6206, 0xF007, 0x0008, 0x6109, 0x310F, 0x3710, 0x8911, 0x3312,
|
||||||
|
0x3C15, 0x5C16 };
|
||||||
|
word Y300[] =
|
||||||
|
{ 0x09E3, 0x4606, 0x1F07, 0x0008, 0x4009, 0x3110, 0x8011, 0x2B12, 0x2F15,
|
||||||
|
0x4416 };
|
||||||
|
word Y350[] =
|
||||||
|
{ 0x09A3, 0xBF06, 0x1F07, 0x0008, 0x4009, 0x8310, 0x8511, 0x5D12, 0x6315,
|
||||||
|
0xBA16 };
|
||||||
|
word Y360[] =
|
||||||
|
{ 0x07E3, 0x0008, 0x4009, 0x8810, 0x8511, 0x6712, 0x6D15, 0xBA16 };
|
||||||
|
word Y400[] =
|
||||||
|
{ 0x01E3, 0x4009 };
|
||||||
|
word Y448[] =
|
||||||
|
{ 0x09A3, 0x6F06, 0xBA07, 0x0008, 0x4009, 0x0810, 0x8A11, 0xBF12, 0xC715,
|
||||||
|
0x0416 };
|
||||||
|
word Y480[] =
|
||||||
|
{ 0x09E3, 0x0D06, 0x3E07, 0x0008, 0x4009, 0xEA10, 0xAC11, 0xDF12, 0xE715,
|
||||||
|
0x0616 };
|
||||||
|
word Y512[] =
|
||||||
|
{ 0x0900, 0x2B06, 0xB207, 0x0008, 0x6009, 0x0A10, 0xAC11, 0xFF12, 0x0715,
|
||||||
|
0x1A16 };
|
||||||
|
word Y540[] =
|
||||||
|
{ 0x09E7, 0x3006, 0xF007, 0x0008, 0x6009, 0x2010, 0xA911, 0x1B12, 0x1F15,
|
||||||
|
0x2F16 };
|
||||||
|
word Y564[] =
|
||||||
|
{ 0x09E7, 0x6206, 0xF007, 0x0008, 0x6009, 0x3E10, 0x8911, 0x3312, 0x3C15,
|
||||||
|
0x5C16 };
|
||||||
|
word Y600[] =
|
||||||
|
{ 0x09E7, 0xBE06, 0xF007, 0x0008, 0x6009, 0x7C10, 0x8C11, 0x5712, 0x5815,
|
||||||
|
0x7016 };
|
||||||
45
moteur.h
Normal file
45
moteur.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
void Gestion_principale (void);
|
||||||
|
void Tracer_cadre_de_bouton_du_menu(byte Numero,byte Enfonce);
|
||||||
|
void Desenclencher_bouton (int Numero);
|
||||||
|
void Enclencher_bouton (int Numero,byte Click);
|
||||||
|
void Annuler_les_effets (void);
|
||||||
|
void Restaurer_les_effets (void);
|
||||||
|
void Ouvrir_fenetre (word Largeur,word Hauteur, char * Titre);
|
||||||
|
void Fermer_fenetre (void);
|
||||||
|
|
||||||
|
void Fenetre_Dessiner_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Hauteur,
|
||||||
|
char * Titre,byte Lettre_soulignee,byte Clickable);
|
||||||
|
void Fenetre_Enfoncer_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Hauteur);
|
||||||
|
void Fenetre_Desenfoncer_bouton_normal(word Pos_X,word Pos_Y,word Largeur,word Hauteur);
|
||||||
|
void Fenetre_Dessiner_bouton_palette(word Pos_X,word Pos_Y);
|
||||||
|
|
||||||
|
void Calculer_hauteur_curseur_jauge(struct Fenetre_Bouton_scroller * Enreg);
|
||||||
|
void Fenetre_Dessiner_jauge(struct Fenetre_Bouton_scroller * Enreg);
|
||||||
|
void Fenetre_Dessiner_bouton_scroller(struct Fenetre_Bouton_scroller * Enreg);
|
||||||
|
|
||||||
|
void Fenetre_Contenu_bouton_saisie(struct Fenetre_Bouton_special * Enreg, char * Contenu);
|
||||||
|
void Fenetre_Dessiner_bouton_saisie(word Pos_X,word Pos_Y,word Largeur_en_caracteres);
|
||||||
|
|
||||||
|
void Fenetre_Definir_bouton_normal(word Pos_X, word Pos_Y,
|
||||||
|
word Largeur, word Hauteur,
|
||||||
|
char * Titre,byte Lettre_soulignee,
|
||||||
|
byte Clickable, word Raccourci);
|
||||||
|
|
||||||
|
void Fenetre_Definir_bouton_palette(word Pos_X, word Pos_Y);
|
||||||
|
void Fenetre_Effacer_tags(void);
|
||||||
|
void Tagger_intervalle_palette(byte Debut,byte Fin);
|
||||||
|
|
||||||
|
void Fenetre_Definir_bouton_scroller(word Pos_X, word Pos_Y,
|
||||||
|
word Hauteur,
|
||||||
|
word Nb_elements,
|
||||||
|
word Nb_elements_visibles,
|
||||||
|
word Position_initiale);
|
||||||
|
void Fenetre_Definir_bouton_special(word Pos_X,word Pos_Y,word Largeur,word Hauteur);
|
||||||
|
void Fenetre_Definir_bouton_saisie(word Pos_X,word Pos_Y,word Largeur_en_caracteres);
|
||||||
|
|
||||||
|
byte Fenetre_click_dans_zone(short Debut_X,short Debut_Y,short Fin_X,short Fin_Y);
|
||||||
|
short Attendre_click_dans_palette(struct Fenetre_Bouton_palette * Enreg);
|
||||||
|
void Recuperer_couleur_derriere_fenetre(byte * Couleur, byte * Click);
|
||||||
|
|
||||||
|
short Fenetre_Bouton_clicke(void);
|
||||||
1498
op_asm.asm
Normal file
1498
op_asm.asm
Normal file
File diff suppressed because it is too large
Load Diff
153
op_asm.h
Normal file
153
op_asm.h
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
#ifndef _OP_ASM_H_
|
||||||
|
#define _OP_ASM_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "op_c.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void OPASM_DitherFS_6123(
|
||||||
|
Bitmap256 Destination, // Pointeur sur le 1er pixel de la ligne
|
||||||
|
Bitmap24B Source, // Idem mais sur la source
|
||||||
|
int Largeur, // Largeur … traiter, =(largeur_image-2), (>0)
|
||||||
|
struct Composantes * Palette, // Palette de l'image destination
|
||||||
|
byte * TableC, // Table de conversion 24b->8b
|
||||||
|
byte ReducR, // 8-Nb_bits_rouges
|
||||||
|
byte ReducV, // 8-Nb_bits_verts
|
||||||
|
byte ReducB, // 8-Nb_bits_bleus
|
||||||
|
byte NbbV, // Nb_bits_verts
|
||||||
|
byte NbbB); // Nb_bits_bleus
|
||||||
|
|
||||||
|
void OPASM_DitherFS_623(
|
||||||
|
Bitmap256 Destination, // Pointeur sur le 1er pixel de la ligne
|
||||||
|
Bitmap24B Source, // Idem mais sur la source
|
||||||
|
int Largeur, // Largeur … traiter, =(largeur_image-2), (>0)
|
||||||
|
struct Composantes * Palette, // Palette de l'image destination
|
||||||
|
byte * TableC, // Table de conversion 24b->8b
|
||||||
|
byte ReducR, // 8-Nb_bits_rouges
|
||||||
|
byte ReducV, // 8-Nb_bits_verts
|
||||||
|
byte ReducB, // 8-Nb_bits_bleus
|
||||||
|
byte NbbV, // Nb_bits_verts
|
||||||
|
byte NbbB); // Nb_bits_bleus
|
||||||
|
|
||||||
|
void OPASM_DitherFS_12(
|
||||||
|
Bitmap256 Destination, // Pointeur sur le 1er pixel de la ligne
|
||||||
|
Bitmap24B Source, // Idem mais sur la source
|
||||||
|
int Largeur, // Largeur … traiter, =(largeur_image-2), (>0)
|
||||||
|
struct Composantes * Palette, // Palette de l'image destination
|
||||||
|
byte * TableC, // Table de conversion 24b->8b
|
||||||
|
byte ReducR, // 8-Nb_bits_rouges
|
||||||
|
byte ReducV, // 8-Nb_bits_verts
|
||||||
|
byte ReducB, // 8-Nb_bits_bleus
|
||||||
|
byte NbbV, // Nb_bits_verts
|
||||||
|
byte NbbB); // Nb_bits_bleus
|
||||||
|
|
||||||
|
void OPASM_DitherFS_6(
|
||||||
|
Bitmap256 Destination, // Pointeur sur le 1er pixel de la ligne
|
||||||
|
Bitmap24B Source, // Idem mais sur la source
|
||||||
|
int Largeur, // Largeur … traiter, =(largeur_image-1), (>0)
|
||||||
|
struct Composantes * Palette, // Palette de l'image destination
|
||||||
|
byte * TableC, // Table de conversion 24b->8b
|
||||||
|
byte ReducR, // 8-Nb_bits_rouges
|
||||||
|
byte ReducV, // 8-Nb_bits_verts
|
||||||
|
byte ReducB, // 8-Nb_bits_bleus
|
||||||
|
byte NbbV, // Nb_bits_verts
|
||||||
|
byte NbbB); // Nb_bits_bleus
|
||||||
|
|
||||||
|
void OPASM_DitherFS(
|
||||||
|
Bitmap256 Destination, // Pointeur sur le pixel
|
||||||
|
Bitmap24B Source, // Idem mais sur la source
|
||||||
|
byte * TableC, // Table de conversion 24b->8b
|
||||||
|
byte ReducR, // 8-Nb_bits_rouges
|
||||||
|
byte ReducV, // 8-Nb_bits_verts
|
||||||
|
byte ReducB, // 8-Nb_bits_bleus
|
||||||
|
byte NbbV, // Nb_bits_verts
|
||||||
|
byte NbbB); // Nb_bits_bleus
|
||||||
|
|
||||||
|
void OPASM_DitherFS_2(
|
||||||
|
Bitmap256 Destination, // Pointeur sur le 1er pixel de la colonne
|
||||||
|
Bitmap24B Source, // Idem mais sur la source
|
||||||
|
int Hauteur, // Hauteur … traiter, =(hauteur_image-1), (>0)
|
||||||
|
struct Composantes * Palette, // Palette de l'image destination
|
||||||
|
byte * TableC, // Table de conversion 24b->8b
|
||||||
|
byte ReducR, // 8-Nb_bits_rouges
|
||||||
|
byte ReducV, // 8-Nb_bits_verts
|
||||||
|
byte ReducB, // 8-Nb_bits_bleus
|
||||||
|
byte NbbV, // Nb_bits_verts
|
||||||
|
byte NbbB); // Nb_bits_bleus
|
||||||
|
|
||||||
|
void OPASM_Compter_occurences(
|
||||||
|
int * Destination, // Pointeur sur la table d'occurences
|
||||||
|
Bitmap24B Source, // Pointeur sur l'image
|
||||||
|
int Taille, // Nombre de pixels dans l'image
|
||||||
|
byte ReducR, // 8-Nb_bits_rouges
|
||||||
|
byte ReducV, // 8-Nb_bits_verts
|
||||||
|
byte ReducB, // 8-Nb_bits_bleus
|
||||||
|
byte NbbV, // Nb_bits_verts
|
||||||
|
byte NbbB); // Nb_bits_bleus
|
||||||
|
|
||||||
|
void OPASM_Analyser_cluster(
|
||||||
|
int * TableO, // Table d'occurences
|
||||||
|
int * rmin, // rmin << rdec
|
||||||
|
int * vmin, // vmin << vdec
|
||||||
|
int * bmin, // bmin << bdec
|
||||||
|
int * rmax, // rmax << rdec
|
||||||
|
int * vmax, // vmax << vdec
|
||||||
|
int * bmax, // bmax << bdec
|
||||||
|
int rdec, // rdec
|
||||||
|
int vdec, // vdec
|
||||||
|
int bdec, // bdec
|
||||||
|
int rinc, // Incr‚mentation sur les rouges 1 << rdec
|
||||||
|
int vinc, // Incr‚mentation sur les verts 1 << vdec
|
||||||
|
int binc, // Incr‚mentation sur les bleus 1 << bdec
|
||||||
|
int * Nbocc); // Nombre d'occurences
|
||||||
|
|
||||||
|
void OPASM_Split_cluster_Rouge(
|
||||||
|
int * tableO, // Table d'occurences
|
||||||
|
int rmin, // rmin << rdec
|
||||||
|
int vmin, // vmin << vdec
|
||||||
|
int bmin, // bmin << bdec
|
||||||
|
int rmax, // rmax << rdec
|
||||||
|
int vmax, // vmin << vdec
|
||||||
|
int bmax, // bmin << bdec
|
||||||
|
int rinc, // Incr‚mentation sur les rouges 1 << rdec
|
||||||
|
int vinc, // Incr‚mentation sur les verts 1 << vdec
|
||||||
|
int binc, // Incr‚mentation sur les bleus 1 << bdec
|
||||||
|
int limite, // Nombre d'occurences minimales
|
||||||
|
int rdec, // rdec
|
||||||
|
int * rouge); // Valeur du rouge atteignant la limite
|
||||||
|
|
||||||
|
void OPASM_Split_cluster_Vert(
|
||||||
|
int * tableO, // Table d'occurences
|
||||||
|
int rmin, // rmin << rdec
|
||||||
|
int vmin, // vmin << vdec
|
||||||
|
int bmin, // bmin << bdec
|
||||||
|
int rmax, // rmax << rdec
|
||||||
|
int vmax, // vmin << vdec
|
||||||
|
int bmax, // bmin << bdec
|
||||||
|
int rinc, // Incr‚mentation sur les rouges 1 << rdec
|
||||||
|
int vinc, // Incr‚mentation sur les verts 1 << vdec
|
||||||
|
int binc, // Incr‚mentation sur les bleus 1 << bdec
|
||||||
|
int limite, // Nombre d'occurences minimales
|
||||||
|
int vdec, // vdec
|
||||||
|
int * vert); // Valeur du vert atteignant la limite
|
||||||
|
|
||||||
|
void OPASM_Split_cluster_Bleu(
|
||||||
|
int * tableO, // Table d'occurences
|
||||||
|
int rmin, // rmin << rdec
|
||||||
|
int vmin, // vmin << vdec
|
||||||
|
int bmin, // bmin << bdec
|
||||||
|
int rmax, // rmax << rdec
|
||||||
|
int vmax, // vmin << vdec
|
||||||
|
int bmax, // bmin << bdec
|
||||||
|
int rinc, // Incr‚mentation sur les rouges 1 << rdec
|
||||||
|
int vinc, // Incr‚mentation sur les verts 1 << vdec
|
||||||
|
int binc, // Incr‚mentation sur les bleus 1 << bdec
|
||||||
|
int limite, // Nombre d'occurences minimales
|
||||||
|
int bdec, // bdec
|
||||||
|
int * bleu); // Valeur du bleu atteignant la limite
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
190
op_c.h
Normal file
190
op_c.h
Normal file
@ -0,0 +1,190 @@
|
|||||||
|
#ifndef _OP_C_H_
|
||||||
|
#define _OP_C_H_
|
||||||
|
|
||||||
|
|
||||||
|
#include "struct.h"
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////// D‚finition des types de base
|
||||||
|
|
||||||
|
typedef struct Composantes * Bitmap24B;
|
||||||
|
typedef byte * Bitmap256;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////// D‚finition d'une table de conversion
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int nbb_r; // Nb de bits de pr‚cision sur les rouges
|
||||||
|
int nbb_v; // Nb de bits de pr‚cision sur les verts
|
||||||
|
int nbb_b; // Nb de bits de pr‚cision sur les bleu
|
||||||
|
|
||||||
|
int rng_r; // Nb de valeurs sur les rouges (= 1<<nbb_r)
|
||||||
|
int rng_v; // Nb de valeurs sur les verts (= 1<<nbb_v)
|
||||||
|
int rng_b; // Nb de valeurs sur les bleus (= 1<<nbb_b)
|
||||||
|
|
||||||
|
int dec_r; // Coefficient multiplicateur d'accŠs dans la table (= nbb_v+nbb_b)
|
||||||
|
int dec_v; // Coefficient multiplicateur d'accŠs dans la table (= nbb_b)
|
||||||
|
int dec_b; // Coefficient multiplicateur d'accŠs dans la table (= 0)
|
||||||
|
|
||||||
|
int red_r; // Coefficient r‚ducteur de traduction d'une couleur rouge (= 8-nbb_r)
|
||||||
|
int red_v; // Coefficient r‚ducteur de traduction d'une couleur verte (= 8-nbb_v)
|
||||||
|
int red_b; // Coefficient r‚ducteur de traduction d'une couleur bleue (= 8-nbb_b)
|
||||||
|
|
||||||
|
byte * table;
|
||||||
|
} Table_conversion;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////// D‚finition d'une table d'occurences
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int nbb_r; // Nb de bits de pr‚cision sur les rouges
|
||||||
|
int nbb_v; // Nb de bits de pr‚cision sur les verts
|
||||||
|
int nbb_b; // Nb de bits de pr‚cision sur les bleu
|
||||||
|
|
||||||
|
int rng_r; // Nb de valeurs sur les rouges (= 1<<nbb_r)
|
||||||
|
int rng_v; // Nb de valeurs sur les verts (= 1<<nbb_v)
|
||||||
|
int rng_b; // Nb de valeurs sur les bleus (= 1<<nbb_b)
|
||||||
|
|
||||||
|
int dec_r; // Coefficient multiplicateur d'accŠs dans la table (= nbb_v+nbb_b)
|
||||||
|
int dec_v; // Coefficient multiplicateur d'accŠs dans la table (= nbb_b)
|
||||||
|
int dec_b; // Coefficient multiplicateur d'accŠs dans la table (= 0)
|
||||||
|
|
||||||
|
int red_r; // Coefficient r‚ducteur de traduction d'une couleur rouge (= 8-nbb_r)
|
||||||
|
int red_v; // Coefficient r‚ducteur de traduction d'une couleur verte (= 8-nbb_v)
|
||||||
|
int red_b; // Coefficient r‚ducteur de traduction d'une couleur bleue (= 8-nbb_b)
|
||||||
|
|
||||||
|
int * table;
|
||||||
|
} Table_occurence;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////// D‚finition d'un ensemble de couleur
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int occurences; // Nb total d'occurences des couleurs de l'ensemble
|
||||||
|
|
||||||
|
// Grande couverture
|
||||||
|
byte Rmin,Rmax;
|
||||||
|
byte Vmin,Vmax;
|
||||||
|
byte Bmin,Bmax;
|
||||||
|
|
||||||
|
// Couverture minimale
|
||||||
|
byte rmin,rmax;
|
||||||
|
byte vmin,vmax;
|
||||||
|
byte bmin,bmax;
|
||||||
|
|
||||||
|
byte plus_large; // Composante ayant la plus grande variation (0=Rouge,1=Vert,2=Bleu)
|
||||||
|
byte r,v,b; // Couleur synth‚tisant l'ensemble
|
||||||
|
byte h; // Chrominance
|
||||||
|
byte l; // Luminosit‚
|
||||||
|
} Cluster;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////// D‚finition d'un ensemble de clusters
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int nb;
|
||||||
|
int nbmax;
|
||||||
|
Cluster * clusters;
|
||||||
|
} ClusterSet;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////// D‚finition d'un d‚grad‚
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int nbcouleurs; // Nombre de couleurs dans le d‚grad‚
|
||||||
|
float min; // Chrominance minimale du d‚grad‚
|
||||||
|
float max; // Chrominance maximale du d‚grad‚
|
||||||
|
float hue; // Chrominance moyenne du d‚grad‚
|
||||||
|
} Degrade;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////// D‚finition d'un ensemble de d‚grad‚
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int nb; // Nombre de d‚grad‚s dans l'ensemble
|
||||||
|
int nbmax; // Nombre maximum de d‚grad‚s
|
||||||
|
Degrade * degrades; // Les d‚grad‚s
|
||||||
|
} DegradeSet;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
///////////////////////////// M‚thodes de gestion des tables de conversion //
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Table_conversion * TC_New(int nbb_r,int nbb_v,int nbb_b);
|
||||||
|
void TC_Delete(Table_conversion * t);
|
||||||
|
byte TC_Get(Table_conversion * t,int r,int v,int b);
|
||||||
|
void TC_Set(Table_conversion * t,int r,int v,int b,byte i);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
/////////////////////////////// M‚thodes de gestion des tables d'occurence //
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void TO_Init(Table_occurence * t);
|
||||||
|
Table_occurence * TO_New(int nbb_r,int nbb_v,int nbb_b);
|
||||||
|
void TO_Delete(Table_occurence * t);
|
||||||
|
int TO_Get(Table_occurence * t,int r,int v,int b);
|
||||||
|
void TO_Set(Table_occurence * t,int r,int v,int b,int i);
|
||||||
|
void TO_Inc(Table_occurence * t,int r,int v,int b);
|
||||||
|
void TO_Compter_occurences(Table_occurence * t,Bitmap24B image,int taille);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
///////////////////////////////////////// M‚thodes de gestion des clusters //
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void Cluster_Analyser(Cluster * c,Table_occurence * to);
|
||||||
|
void Cluster_Split(Cluster * c,Cluster * c1,Cluster * c2,int teinte,Table_occurence * to);
|
||||||
|
void Cluster_Calculer_teinte(Cluster * c,Table_occurence * to);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//////////////////////////// M‚thodes de gestion des ensembles de clusters //
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CS_Init(ClusterSet * cs,Table_occurence * to);
|
||||||
|
ClusterSet * CS_New(int nbmax,Table_occurence * to);
|
||||||
|
void CS_Delete(ClusterSet * cs);
|
||||||
|
void CS_Get(ClusterSet * cs,Cluster * c);
|
||||||
|
void CS_Set(ClusterSet * cs,Cluster * c);
|
||||||
|
void CS_Generer(ClusterSet * cs,Table_occurence * to);
|
||||||
|
void CS_Calculer_teintes(ClusterSet * cs,Table_occurence * to);
|
||||||
|
void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_occurence * to,Table_conversion * tc,struct Composantes * palette);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//////////////////////////// M‚thodes de gestion des ensembles de d‚grad‚s //
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void DS_Init(DegradeSet * ds,ClusterSet * cs);
|
||||||
|
DegradeSet * DS_New(ClusterSet * cs);
|
||||||
|
void DS_Delete(DegradeSet * ds);
|
||||||
|
void DS_Generer(DegradeSet * ds,ClusterSet * cs);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Convertie avec le plus de pr‚cision possible une image 24b en 256c
|
||||||
|
// Renvoie s'il y a eu une erreur ou pas..
|
||||||
|
int Convert_bitmap_24B_to_256(Bitmap256 Dest,Bitmap24B Source,int largeur,int hauteur,struct Composantes * palette);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
4301
operatio.c
Normal file
4301
operatio.c
Normal file
File diff suppressed because it is too large
Load Diff
171
operatio.h
Normal file
171
operatio.h
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
void Demarrer_pile_operation(word Operation_demandee);
|
||||||
|
void Operation_PUSH(short Valeur);
|
||||||
|
void Operation_POP(short * Valeur);
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////// OPERATION_DESSIN_CONTINU
|
||||||
|
void Freehand_Mode1_1_0(void);
|
||||||
|
void Freehand_Mode1_1_2(void);
|
||||||
|
void Freehand_Mode12_0_2(void);
|
||||||
|
void Freehand_Mode1_2_0(void);
|
||||||
|
void Freehand_Mode1_2_2(void);
|
||||||
|
|
||||||
|
///////////////////////////////////////////////// OPERATION_DESSIN_DISCONTINU
|
||||||
|
void Freehand_Mode2_1_0(void);
|
||||||
|
void Freehand_Mode2_1_2(void);
|
||||||
|
void Freehand_Mode2_2_0(void);
|
||||||
|
void Freehand_Mode2_2_2(void);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////// OPERATION_DESSIN_POINT
|
||||||
|
void Freehand_Mode3_1_0(void);
|
||||||
|
void Freehand_Mode3_2_0(void);
|
||||||
|
void Freehand_Mode3_0_1(void);
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////// OPERATION_LIGNE
|
||||||
|
|
||||||
|
void Ligne_12_0(void);
|
||||||
|
void Ligne_12_5(void);
|
||||||
|
void Ligne_0_5(void);
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////// OPERATION_LOUPE
|
||||||
|
|
||||||
|
void Loupe_12_0(void);
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////// OPERATION_RECTANGLE_?????
|
||||||
|
|
||||||
|
void Rectangle_12_0(void);
|
||||||
|
void Rectangle_12_5(void);
|
||||||
|
void Rectangle_vide_0_5(void);
|
||||||
|
void Rectangle_plein_0_5(void);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////// OPERATION_CERCLE_?????
|
||||||
|
|
||||||
|
void Cercle_12_0(void);
|
||||||
|
void Cercle_12_5(void);
|
||||||
|
void Cercle_vide_0_5(void);
|
||||||
|
void Cercle_plein_0_5(void);
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////// OPERATION_ELLIPSE_?????
|
||||||
|
|
||||||
|
void Ellipse_12_0(void);
|
||||||
|
void Ellipse_12_5(void);
|
||||||
|
void Ellipse_vide_0_5(void);
|
||||||
|
void Ellipse_pleine_0_5(void);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////// OPERATION_PRISE_BROSSE
|
||||||
|
|
||||||
|
void Brosse_12_0(void);
|
||||||
|
void Brosse_12_5(void);
|
||||||
|
void Brosse_0_5(void);
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////// OPERATION_ETIRER_BROSSE
|
||||||
|
|
||||||
|
void Etirer_brosse_12_0(void);
|
||||||
|
void Etirer_brosse_1_7(void);
|
||||||
|
void Etirer_brosse_0_7(void);
|
||||||
|
void Etirer_brosse_2_7(void);
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////// OPERATION_TOURNER_BROSSE
|
||||||
|
|
||||||
|
void Tourner_brosse_12_0(void);
|
||||||
|
void Tourner_brosse_1_5(void);
|
||||||
|
void Tourner_brosse_0_5(void);
|
||||||
|
void Tourner_brosse_2_5(void);
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////// OPERATION_POLYBROSSE
|
||||||
|
|
||||||
|
void Polybrosse_12_8(void);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////// OPERATION_FILL
|
||||||
|
|
||||||
|
void Fill_1_0(void);
|
||||||
|
void Fill_2_0(void);
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////// OPERATION_REMPLACER
|
||||||
|
|
||||||
|
void Remplacer_1_0(void);
|
||||||
|
void Remplacer_2_0(void);
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////// OPERATION_PIPETTE
|
||||||
|
|
||||||
|
void Pipette_0_0(void);
|
||||||
|
void Pipette_12_0(void);
|
||||||
|
void Pipette_1_1(void);
|
||||||
|
void Pipette_2_1(void);
|
||||||
|
void Pipette_0_1(void);
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////// OPERATION_K_LIGNE
|
||||||
|
|
||||||
|
void K_Ligne_12_0(void);
|
||||||
|
void K_Ligne_12_6(void);
|
||||||
|
void K_Ligne_0_6(void);
|
||||||
|
void K_Ligne_12_7(void);
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////// OPERATION_COURBE_?_POINTS
|
||||||
|
|
||||||
|
void Courbe_34_points_1_0(void);
|
||||||
|
void Courbe_34_points_2_0(void);
|
||||||
|
void Courbe_34_points_1_5(void);
|
||||||
|
void Courbe_34_points_2_5(void);
|
||||||
|
|
||||||
|
void Courbe_4_points_0_5(void);
|
||||||
|
void Courbe_4_points_1_9(void);
|
||||||
|
void Courbe_4_points_2_9(void);
|
||||||
|
|
||||||
|
void Courbe_3_points_0_5(void);
|
||||||
|
void Courbe_3_points_0_11(void);
|
||||||
|
void Courbe_3_points_12_11(void);
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////// OPERATION_SPRAY
|
||||||
|
|
||||||
|
void Spray_1_0(void);
|
||||||
|
void Spray_2_0(void);
|
||||||
|
void Spray_12_3(void);
|
||||||
|
void Spray_0_3(void);
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////// OPERATION_*POLY*
|
||||||
|
|
||||||
|
void Polygone_12_0(void);
|
||||||
|
void Polygone_12_9(void);
|
||||||
|
|
||||||
|
void Polyfill_12_0(void);
|
||||||
|
void Polyfill_0_8(void);
|
||||||
|
void Polyfill_12_8(void);
|
||||||
|
void Polyfill_12_9(void);
|
||||||
|
|
||||||
|
void Polyform_12_0(void);
|
||||||
|
void Polyform_12_8(void);
|
||||||
|
void Polyform_0_8(void);
|
||||||
|
|
||||||
|
void Filled_polyform_12_0(void);
|
||||||
|
void Filled_polyform_12_8(void);
|
||||||
|
void Filled_polyform_0_8(void);
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////// OPERATION_SCROLL
|
||||||
|
|
||||||
|
void Scroll_12_0(void);
|
||||||
|
void Scroll_12_4(void);
|
||||||
|
void Scroll_0_4(void);
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////// OPERATION_CERCLE_DEGRADE
|
||||||
|
|
||||||
|
void Cercle_degrade_12_0(void);
|
||||||
|
void Cercle_degrade_12_6(void);
|
||||||
|
void Cercle_degrade_0_6(void);
|
||||||
|
void Cercle_degrade_12_8(void);
|
||||||
|
void Cercle_ou_ellipse_degrade_0_8(void);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////// OPERATION_ELLIPSE_DEGRADEE
|
||||||
|
|
||||||
|
void Ellipse_degradee_12_0(void);
|
||||||
|
void Ellipse_degradee_12_6(void);
|
||||||
|
void Ellipse_degradee_0_6(void);
|
||||||
|
void Ellipse_degradee_12_8(void);
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////// OPERATION_LIGNES_CENTREES
|
||||||
|
|
||||||
|
void Lignes_centrees_12_0(void);
|
||||||
|
void Lignes_centrees_12_3(void);
|
||||||
|
void Lignes_centrees_0_3(void);
|
||||||
|
void Lignes_centrees_12_7(void);
|
||||||
|
void Lignes_centrees_0_7(void);
|
||||||
|
|
||||||
71
pages.h
Normal file
71
pages.h
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
#ifndef _PAGES_H_
|
||||||
|
#define _PAGES_H_
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
/////////////////////////// GESTION DU BACKUP ////////////////////////////
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// GESTION DES PAGES
|
||||||
|
///
|
||||||
|
|
||||||
|
void Initialiser_S_Page(S_Page * Page);
|
||||||
|
void Download_infos_page_principal(S_Page * Page);
|
||||||
|
void Upload_infos_page_principal(S_Page * Page);
|
||||||
|
void Download_infos_page_brouillon(S_Page * Page);
|
||||||
|
void Upload_infos_page_brouillon(S_Page * Page);
|
||||||
|
void Download_infos_backup(S_Liste_de_pages * Liste);
|
||||||
|
int Allouer_une_page(S_Page * Page,int Largeur,int Hauteur);
|
||||||
|
void Liberer_une_page(S_Page * Page);
|
||||||
|
void Copier_S_page(S_Page * Destination,S_Page * Source);
|
||||||
|
int Taille_d_une_page(S_Page * Page);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// GESTION DES LISTES DE PAGES
|
||||||
|
///
|
||||||
|
|
||||||
|
void Initialiser_S_Liste_de_pages(S_Liste_de_pages * Liste);
|
||||||
|
int Allouer_une_liste_de_pages(S_Liste_de_pages * Liste,int Taille);
|
||||||
|
void Liberer_une_liste_de_pages(S_Liste_de_pages * Liste);
|
||||||
|
int Taille_d_une_liste_de_pages(S_Liste_de_pages * Liste);
|
||||||
|
void Reculer_dans_une_liste_de_pages(S_Liste_de_pages * Liste);
|
||||||
|
void Avancer_dans_une_liste_de_pages(S_Liste_de_pages * Liste);
|
||||||
|
int Nouvelle_page_possible(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courante,S_Liste_de_pages * Liste_secondaire);
|
||||||
|
void Detruire_derniere_page_allouee_de_la_liste(S_Liste_de_pages * Liste);
|
||||||
|
void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courante,S_Liste_de_pages * Liste_secondaire);
|
||||||
|
void Changer_nombre_de_pages_d_une_liste(S_Liste_de_pages * Liste,int Nb);
|
||||||
|
void Detruire_la_page_courante_d_une_liste(S_Liste_de_pages * Liste);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// GESTION DES BACKUPS
|
||||||
|
///
|
||||||
|
|
||||||
|
int Initialiser_les_listes_de_backups_en_debut_de_programme(int Taille,int Largeur,int Hauteur);
|
||||||
|
void Detruire_les_listes_de_backups_en_fin_de_programme(void);
|
||||||
|
void Nouveau_nombre_de_backups(int Nouveau);
|
||||||
|
int Backup_avec_nouvelles_dimensions(int Upload,int Largeur,int Hauteur);
|
||||||
|
int Backuper_et_redimensionner_brouillon(int Largeur,int Hauteur);
|
||||||
|
void Backup(void);
|
||||||
|
void Undo(void);
|
||||||
|
void Redo(void);
|
||||||
|
void Detruire_la_page_courante(void);
|
||||||
|
void Interchanger_image_principale_et_brouillon(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// GESTION DES EMPRUNTS DE MEMOIRE DE PAGE
|
||||||
|
///
|
||||||
|
|
||||||
|
int Emprunt_memoire_de_page_possible(int taille);
|
||||||
|
void * Emprunter_memoire_de_page(int taille);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
2
palette.h
Normal file
2
palette.h
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
void Bouton_Palette(void);
|
||||||
|
void Bouton_Palette_secondaire(void);
|
||||||
642
readini.c
Normal file
642
readini.c
Normal file
@ -0,0 +1,642 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include "const.h"
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
char lowercase_to_uppercase[256];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Calculer_la_table_lowercase_to_uppercase(void)
|
||||||
|
{
|
||||||
|
int Indice;
|
||||||
|
int Resultat;
|
||||||
|
|
||||||
|
for (Indice=0;Indice<256;Indice++)
|
||||||
|
{
|
||||||
|
Resultat=Indice;
|
||||||
|
|
||||||
|
if ((Indice>='a') && (Indice<='z'))
|
||||||
|
Resultat+='A'-'a';
|
||||||
|
|
||||||
|
lowercase_to_uppercase[Indice]=Resultat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Charger_INI_Clear_string(char * String)
|
||||||
|
{
|
||||||
|
int Indice;
|
||||||
|
|
||||||
|
for (Indice=0;String[Indice]!='\0';)
|
||||||
|
{
|
||||||
|
if ((String[Indice]==' ') ||
|
||||||
|
(String[Indice]=='\t'))
|
||||||
|
{
|
||||||
|
// Suppression d'un espace ou d'un tab:
|
||||||
|
|
||||||
|
strcpy(String+Indice,String+Indice+1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if ((String[Indice]==';') ||
|
||||||
|
(String[Indice]=='#') ||
|
||||||
|
(String[Indice]=='\n'))
|
||||||
|
{
|
||||||
|
// Rencontre d'un commentaire ou d'un saut de ligne:
|
||||||
|
|
||||||
|
String[Indice]='\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Passage en majuscule d'un caractŠre:
|
||||||
|
|
||||||
|
String[Indice]=lowercase_to_uppercase[String[Indice]];
|
||||||
|
Indice++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int Charger_INI_Seek_pattern(char * Buffer,char * Pattern)
|
||||||
|
{
|
||||||
|
int Indice_buffer;
|
||||||
|
int Indice_pattern;
|
||||||
|
|
||||||
|
// A partir de chaque lettre de la chaŒne Buffer
|
||||||
|
for (Indice_buffer=0;Buffer[Indice_buffer]!='\0';Indice_buffer++)
|
||||||
|
{
|
||||||
|
// On regarde si la chaŒne Pattern est ‚quivalente … la position courante
|
||||||
|
// de la chaŒne Buffer:
|
||||||
|
for (Indice_pattern=0;(Pattern[Indice_pattern]!='\0') && (Buffer[Indice_buffer+Indice_pattern]==Pattern[Indice_pattern]);Indice_pattern++);
|
||||||
|
|
||||||
|
// Si on a trouv‚ la chaŒne Pattern dans la chaŒne Buffer, on renvoie la
|
||||||
|
// position … laquelle on l'a trouv‚e (+1 pour que si on la trouve au
|
||||||
|
// d‚but ‡a ne renvoie pas la mˆme chose que si on ne l'avait pas
|
||||||
|
// trouv‚e):
|
||||||
|
if (Pattern[Indice_pattern]=='\0')
|
||||||
|
return (Indice_buffer+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Si on ne l'a pas trouv‚e, on renvoie 0:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int Charger_INI_Reach_group(FILE * File,char * Buffer,char * Group)
|
||||||
|
{
|
||||||
|
int Arret;
|
||||||
|
char * Group_upper;
|
||||||
|
char * Buffer_upper;
|
||||||
|
|
||||||
|
// On alloue les zones de m‚moire:
|
||||||
|
Group_upper=(char *)malloc(1024);
|
||||||
|
Buffer_upper=(char *)malloc(1024);
|
||||||
|
|
||||||
|
// On commence par se faire une version majuscule du groupe … rechercher:
|
||||||
|
strcpy(Group_upper,Group);
|
||||||
|
Charger_INI_Clear_string(Group_upper);
|
||||||
|
|
||||||
|
Arret=0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// On lit une ligne dans le fichier:
|
||||||
|
if (fgets(Buffer,1024,File)==0)
|
||||||
|
{
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Group_upper);
|
||||||
|
return ERREUR_INI_CORROMPU;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ligne_INI++;
|
||||||
|
|
||||||
|
// On s'en fait une version en majuscule:
|
||||||
|
strcpy(Buffer_upper,Buffer);
|
||||||
|
Charger_INI_Clear_string(Buffer_upper);
|
||||||
|
|
||||||
|
// On compare la chaŒne avec le groupe recherch‚:
|
||||||
|
Arret=Charger_INI_Seek_pattern(Buffer_upper,Group_upper);
|
||||||
|
}
|
||||||
|
while (!Arret);
|
||||||
|
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Group_upper);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int Charger_INI_Get_value(char * String,int * Index,int * Value)
|
||||||
|
{
|
||||||
|
// On teste si la valeur actuelle est YES (ou Y):
|
||||||
|
|
||||||
|
if (Charger_INI_Seek_pattern(String+(*Index),"YES,")==1)
|
||||||
|
{
|
||||||
|
(*Value)=1;
|
||||||
|
(*Index)+=4;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (strcmp(String+(*Index),"YES")==0)
|
||||||
|
{
|
||||||
|
(*Value)=1;
|
||||||
|
(*Index)+=3;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (Charger_INI_Seek_pattern(String+(*Index),"Y,")==1)
|
||||||
|
{
|
||||||
|
(*Value)=1;
|
||||||
|
(*Index)+=2;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (strcmp(String+(*Index),"Y")==0)
|
||||||
|
{
|
||||||
|
(*Value)=1;
|
||||||
|
(*Index)+=1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
|
||||||
|
// On teste si la valeur actuelle est NO (ou N):
|
||||||
|
|
||||||
|
if (Charger_INI_Seek_pattern(String+(*Index),"NO,")==1)
|
||||||
|
{
|
||||||
|
(*Value)=0;
|
||||||
|
(*Index)+=3;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (strcmp(String+(*Index),"NO")==0)
|
||||||
|
{
|
||||||
|
(*Value)=0;
|
||||||
|
(*Index)+=2;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (Charger_INI_Seek_pattern(String+(*Index),"N,")==1)
|
||||||
|
{
|
||||||
|
(*Value)=0;
|
||||||
|
(*Index)+=2;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (strcmp(String+(*Index),"N")==0)
|
||||||
|
{
|
||||||
|
(*Value)=0;
|
||||||
|
(*Index)+=1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (String[*Index]=='$')
|
||||||
|
{
|
||||||
|
(*Value)=0;
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
(*Index)++;
|
||||||
|
|
||||||
|
if ((String[*Index]>='0') && (String[*Index]<='9'))
|
||||||
|
(*Value)=((*Value)*16)+String[*Index]-'0';
|
||||||
|
else
|
||||||
|
if ((String[*Index]>='A') && (String[*Index]<='F'))
|
||||||
|
(*Value)=((*Value)*16)+String[*Index]-'A'+10;
|
||||||
|
else
|
||||||
|
if (String[*Index]==',')
|
||||||
|
{
|
||||||
|
(*Index)++;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (String[*Index]=='\0')
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return ERREUR_INI_CORROMPU;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if ((String[*Index]>='0') && (String[*Index]<='9'))
|
||||||
|
{
|
||||||
|
(*Value)=0;
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
if ((String[*Index]>='0') && (String[*Index]<='9'))
|
||||||
|
(*Value)=((*Value)*10)+String[*Index]-'0';
|
||||||
|
else
|
||||||
|
if (String[*Index]==',')
|
||||||
|
{
|
||||||
|
(*Index)++;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (String[*Index]=='\0')
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return ERREUR_INI_CORROMPU;
|
||||||
|
|
||||||
|
(*Index)++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return ERREUR_INI_CORROMPU;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int Charger_INI_Get_values(FILE * File,char * Buffer,char * Option,int Nb_values_expected,int * Values)
|
||||||
|
{
|
||||||
|
int Arret;
|
||||||
|
char * Option_upper;
|
||||||
|
char * Buffer_upper;
|
||||||
|
int Indice_buffer;
|
||||||
|
int Nb_valeurs;
|
||||||
|
|
||||||
|
// On alloue les zones de m‚moire:
|
||||||
|
Option_upper=(char *)malloc(1024);
|
||||||
|
Buffer_upper=(char *)malloc(1024);
|
||||||
|
|
||||||
|
// On commence par se faire une version majuscule de l'option … rechercher:
|
||||||
|
strcpy(Option_upper,Option);
|
||||||
|
Charger_INI_Clear_string(Option_upper);
|
||||||
|
|
||||||
|
Arret=0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// On lit une ligne dans le fichier:
|
||||||
|
if (fgets(Buffer,1024,File)==0)
|
||||||
|
{
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Option_upper);
|
||||||
|
return ERREUR_INI_CORROMPU;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ligne_INI++;
|
||||||
|
|
||||||
|
// On s'en fait une version en majuscule:
|
||||||
|
strcpy(Buffer_upper,Buffer);
|
||||||
|
Charger_INI_Clear_string(Buffer_upper);
|
||||||
|
|
||||||
|
// On compare la chaŒne avec l'option recherch‚e:
|
||||||
|
Arret=Charger_INI_Seek_pattern(Buffer_upper,Option_upper);
|
||||||
|
|
||||||
|
// Si on l'a trouv‚e:
|
||||||
|
if (Arret)
|
||||||
|
{
|
||||||
|
Nb_valeurs=0;
|
||||||
|
|
||||||
|
// On se positionne juste aprŠs la chaŒne "="
|
||||||
|
Indice_buffer=Charger_INI_Seek_pattern(Buffer_upper,"=");
|
||||||
|
|
||||||
|
// Tant qu'on a pas atteint la fin de la ligne
|
||||||
|
while (Buffer_upper[Indice_buffer]!='\0')
|
||||||
|
{
|
||||||
|
if (Charger_INI_Get_value(Buffer_upper,&Indice_buffer,Values+Nb_valeurs))
|
||||||
|
{
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Option_upper);
|
||||||
|
return ERREUR_INI_CORROMPU;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ((++Nb_valeurs) == Nb_values_expected) &&
|
||||||
|
(Buffer_upper[Indice_buffer]!='\0') )
|
||||||
|
{
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Option_upper);
|
||||||
|
return ERREUR_INI_CORROMPU;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Nb_valeurs<Nb_values_expected)
|
||||||
|
{
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Option_upper);
|
||||||
|
return ERREUR_INI_CORROMPU;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (!Arret);
|
||||||
|
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Option_upper);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int Charger_INI(struct S_Config * Conf)
|
||||||
|
{
|
||||||
|
FILE * Fichier;
|
||||||
|
char * Buffer;
|
||||||
|
int Valeurs[3];
|
||||||
|
int Indice;
|
||||||
|
char * Nom_du_fichier;
|
||||||
|
int Retour;
|
||||||
|
|
||||||
|
Calculer_la_table_lowercase_to_uppercase();
|
||||||
|
|
||||||
|
Ligne_INI=0;
|
||||||
|
|
||||||
|
// On alloue les zones de m‚moire:
|
||||||
|
Buffer=(char *)malloc(1024);
|
||||||
|
Nom_du_fichier=(char *)malloc(256);
|
||||||
|
|
||||||
|
// On calcule le nom du fichier qu'on manipule:
|
||||||
|
strcpy(Nom_du_fichier,Repertoire_du_programme);
|
||||||
|
strcat(Nom_du_fichier,"GFX2.INI");
|
||||||
|
|
||||||
|
Fichier=fopen(Nom_du_fichier,"r");
|
||||||
|
if (Fichier!=0)
|
||||||
|
{
|
||||||
|
if (Retour=Charger_INI_Reach_group(Fichier,Buffer,"[MOUSE]"))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"X_sensitivity",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<1) || (Valeurs[0]>255))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Indice_Sensibilite_souris_X=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Y_sensitivity",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<1) || (Valeurs[0]>255))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Indice_Sensibilite_souris_Y=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"X_correction_factor",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>4))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Mouse_Facteur_de_correction_X=Mouse_Facteur_de_correction_X=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Y_correction_factor",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>4))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Mouse_Facteur_de_correction_Y=Mouse_Facteur_de_correction_Y=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Cursor_aspect",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<1) || (Valeurs[0]>3))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Curseur=Valeurs[0]-1;
|
||||||
|
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Reach_group(Fichier,Buffer,"[MENU]"))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Conf->Coul_menu_pref[0].R=0;
|
||||||
|
Conf->Coul_menu_pref[0].V=0;
|
||||||
|
Conf->Coul_menu_pref[0].B=0;
|
||||||
|
Conf->Coul_menu_pref[3].R=63;
|
||||||
|
Conf->Coul_menu_pref[3].V=63;
|
||||||
|
Conf->Coul_menu_pref[3].B=63;
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Light_color",3,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>63))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
if ((Valeurs[1]<0) || (Valeurs[1]>63))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
if ((Valeurs[2]<0) || (Valeurs[2]>63))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Coul_menu_pref[2].R=Valeurs[0];
|
||||||
|
Conf->Coul_menu_pref[2].V=Valeurs[1];
|
||||||
|
Conf->Coul_menu_pref[2].B=Valeurs[2];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Dark_color",3,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>63))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
if ((Valeurs[1]<0) || (Valeurs[1]>63))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
if ((Valeurs[2]<0) || (Valeurs[2]>63))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Coul_menu_pref[1].R=Valeurs[0];
|
||||||
|
Conf->Coul_menu_pref[1].V=Valeurs[1];
|
||||||
|
Conf->Coul_menu_pref[1].B=Valeurs[2];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Menu_ratio",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>2))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Ratio=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Font",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<1) || (Valeurs[0]>2))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Fonte=Valeurs[0]-1;
|
||||||
|
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Reach_group(Fichier,Buffer,"[FILE_SELECTOR]"))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Show_hidden_files",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Lire_les_fichiers_caches=Valeurs[0]?-1:0;
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Show_hidden_directories",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Lire_les_repertoires_caches=Valeurs[0]?-1:0;
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Show_system_directories",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Lire_les_repertoires_systemes=Valeurs[0]?-1:0;
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Preview_delay",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<1) || (Valeurs[0]>256))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Chrono_delay=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Maximize_preview",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Maximize_preview=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Find_file_fast",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>2))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Find_file_fast=Valeurs[0];
|
||||||
|
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Reach_group(Fichier,Buffer,"[LOADING]"))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Auto_set_resolution",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Auto_set_res=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Set_resolution_according_to",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<1) || (Valeurs[0]>2))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Set_resolution_according_to=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Clear_palette",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Clear_palette=Valeurs[0];
|
||||||
|
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Reach_group(Fichier,Buffer,"[MISCELLANEOUS]"))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Draw_limits",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Afficher_limites_image=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Adjust_brush_pick",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Adjust_brush_pick=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Coordinates",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<1) || (Valeurs[0]>2))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Coords_rel=2-Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Backup",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Backup=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Undo_pages",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<1) || (Valeurs[0]>99))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Nb_pages_Undo=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Gauges_scrolling_speed_Left",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<1) || (Valeurs[0]>255))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Valeur_tempo_jauge_gauche=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Gauges_scrolling_speed_Right",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<1) || (Valeurs[0]>255))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Valeur_tempo_jauge_droite=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Auto_save",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Auto_save=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Vertices_per_polygon",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<2) || (Valeurs[0]>16384))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Nb_max_de_vertex_par_polygon=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Fast_zoom",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Fast_zoom=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Separate_colors",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Couleurs_separees=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"FX_feedback",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->FX_Feedback=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Safety_colors",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Safety_colors=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Opening_message",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Opening_message=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Clear_with_stencil",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Clear_with_stencil=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Auto_discontinuous",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Auto_discontinuous=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Save_screen_size_in_GIF",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Taille_ecran_dans_GIF=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Auto_nb_colors_used",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<0) || (Valeurs[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Auto_nb_used=Valeurs[0];
|
||||||
|
|
||||||
|
if (Retour=Charger_INI_Get_values (Fichier,Buffer,"Default_video_mode",1,Valeurs))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
if ((Valeurs[0]<MODE_320_200) || (Valeurs[0]>MODE_1024_768))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
Conf->Resolution_par_defaut=Valeurs[0];
|
||||||
|
|
||||||
|
fclose(Fichier);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
free(Nom_du_fichier);
|
||||||
|
free(Buffer);
|
||||||
|
return ERREUR_INI_ABSENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
free(Nom_du_fichier);
|
||||||
|
free(Buffer);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Gestion des erreurs:
|
||||||
|
|
||||||
|
Erreur_Retour:
|
||||||
|
|
||||||
|
fclose(Fichier);
|
||||||
|
free(Nom_du_fichier);
|
||||||
|
free(Buffer);
|
||||||
|
return Retour;
|
||||||
|
|
||||||
|
Erreur_ERREUR_INI_CORROMPU:
|
||||||
|
|
||||||
|
fclose(Fichier);
|
||||||
|
free(Nom_du_fichier);
|
||||||
|
free(Buffer);
|
||||||
|
return ERREUR_INI_CORROMPU;
|
||||||
|
}
|
||||||
255
readline.c
Normal file
255
readline.c
Normal file
@ -0,0 +1,255 @@
|
|||||||
|
#include "const.h"
|
||||||
|
#include "struct.h"
|
||||||
|
#include "global.h"
|
||||||
|
#include "graph.h"
|
||||||
|
#include "divers.h"
|
||||||
|
|
||||||
|
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
|
||||||
|
//Û Û°
|
||||||
|
//Û READLINE (proc‚dure permettant de saisir une chaŒne de caractŠres) Û°
|
||||||
|
//Û Û°
|
||||||
|
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ°
|
||||||
|
// °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
|
||||||
|
|
||||||
|
#define COULEUR_TEXTE CM_Noir
|
||||||
|
#define COULEUR_FOND CM_Clair
|
||||||
|
#define COULEUR_TEXTE_CURSEUR CM_Noir
|
||||||
|
#define COULEUR_FOND_CURSEUR CM_Fonce
|
||||||
|
|
||||||
|
|
||||||
|
// V‚rification de la validit‚ d'un nom de fichier
|
||||||
|
byte Chaine_valide(char * Chaine)
|
||||||
|
{
|
||||||
|
byte Point_trouve=0; // Bool‚en "on a trouv‚ un point dans la chaine"
|
||||||
|
byte Taille_racine=0; // Taille de la racine du nom de fichier
|
||||||
|
byte Taille_extension=0; // Taille de l'extension du nom de fichier
|
||||||
|
byte Position; // Position du caractŠre dans la chaŒne en cours d'‚tude
|
||||||
|
|
||||||
|
for (Position=0;Chaine[Position]!='\0';Position++)
|
||||||
|
{
|
||||||
|
if (Chaine[Position]!='.')
|
||||||
|
{
|
||||||
|
if (Point_trouve)
|
||||||
|
Taille_extension++;
|
||||||
|
else
|
||||||
|
Taille_racine++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Point_trouve)
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
Point_trouve=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ( (Taille_racine>0) && (Taille_racine<=8) && (Taille_extension<=3) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Suppresion d'un caractŠre … une certaine POSITION dans une CHAINE.
|
||||||
|
void Supprimer_caractere(char * Chaine, byte Position)
|
||||||
|
{
|
||||||
|
for (;Chaine[Position]!='\0';Position++)
|
||||||
|
Chaine[Position]=Chaine[Position+1];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Inserer_caractere(char * Chaine, char Lettre, byte Position)
|
||||||
|
// Insertion d'une LETTRE … une certaine POSITION
|
||||||
|
// dans une CHAINE d'une certaine TAILLE.
|
||||||
|
{
|
||||||
|
char Char_tempo;
|
||||||
|
|
||||||
|
for (;Lettre!='\0';Position++)
|
||||||
|
{
|
||||||
|
// On m‚morise le caractŠre qui se trouve en "Position"
|
||||||
|
Char_tempo=Chaine[Position];
|
||||||
|
// On splotch la lettre … ins‚rer
|
||||||
|
Chaine[Position]=Lettre;
|
||||||
|
// On place le caractŠre m‚moris‚ dans "Lettre" comme nouvelle lettre … ins‚rer
|
||||||
|
Lettre=Char_tempo;
|
||||||
|
}
|
||||||
|
// On termine la chaine
|
||||||
|
Chaine[Position]='\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Rafficher_toute_la_chaine(word Pos_X,word Pos_Y,char * Chaine,byte Position)
|
||||||
|
{
|
||||||
|
Print_dans_fenetre(Pos_X,Pos_Y,Chaine,COULEUR_TEXTE,COULEUR_FOND);
|
||||||
|
Print_char_dans_fenetre(Pos_X+(Position<<3),Pos_Y,Chaine[Position],COULEUR_TEXTE_CURSEUR,COULEUR_FOND_CURSEUR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//****************************************************************************
|
||||||
|
//* Enhanced super scanf deluxe pro plus giga mieux :-) *
|
||||||
|
//****************************************************************************
|
||||||
|
byte Readline(word Pos_X,word Pos_Y,char * Chaine,byte Taille_maxi,byte Type_saisie)
|
||||||
|
// ParamŠtres:
|
||||||
|
// Pos_X, Pos_Y : Coordonn‚es de la saisie dans la fenˆtre
|
||||||
|
// Chaine : ChaŒne recevant la saisie (et contenant ‚ventuellement une valeur initiale)
|
||||||
|
// Taille_maxi : Nombre de caractŠres logeant dans la zone de saisie
|
||||||
|
// Type_saisie : 0=ChaŒne, 1=Nombre, 2=Nom de fichier (12 carcactŠres)
|
||||||
|
// Sortie:
|
||||||
|
// 0: Sortie par annulation (Esc.) / 1: sortie par acceptation (Return)
|
||||||
|
{
|
||||||
|
char Chaine_initiale[256];
|
||||||
|
byte Position;
|
||||||
|
byte Taille;
|
||||||
|
char Touche_lue=0;
|
||||||
|
byte Touche_autorisee;
|
||||||
|
|
||||||
|
|
||||||
|
// Effacement de la chaŒne
|
||||||
|
Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y),
|
||||||
|
Taille_maxi*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND);
|
||||||
|
|
||||||
|
// Mise … jour des variables se rapportant … la chaŒne en fonction de la chaŒne initiale
|
||||||
|
strcpy(Chaine_initiale,Chaine);
|
||||||
|
|
||||||
|
if (Type_saisie==1)
|
||||||
|
itoa(atoi(Chaine),Chaine,10); // On tasse la chaine … gauche
|
||||||
|
// Chaine[0]='\0'; // On efface la chaŒne si c'est valeur num‚rique
|
||||||
|
|
||||||
|
Taille=strlen(Chaine);
|
||||||
|
Position=(Taille<Taille_maxi)? Taille:Taille-1;
|
||||||
|
Rafficher_toute_la_chaine(Pos_X,Pos_Y,Chaine,Position);
|
||||||
|
|
||||||
|
|
||||||
|
while ((Touche_lue!=13) && (Touche_lue!=27))
|
||||||
|
{
|
||||||
|
Touche_lue=Get_key();
|
||||||
|
switch (Touche_lue)
|
||||||
|
{
|
||||||
|
case 0 :
|
||||||
|
Touche_lue=Get_key();
|
||||||
|
switch (Touche_lue)
|
||||||
|
{
|
||||||
|
case 83 : // Suppr.
|
||||||
|
if (Position<Taille)
|
||||||
|
{
|
||||||
|
Supprimer_caractere(Chaine,Position);
|
||||||
|
Taille--;
|
||||||
|
// Effacement de la chaŒne
|
||||||
|
Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y),
|
||||||
|
Taille_maxi*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND);
|
||||||
|
Rafficher_toute_la_chaine(Pos_X,Pos_Y,Chaine,Position);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 75 : // Gauche
|
||||||
|
if (Position)
|
||||||
|
{
|
||||||
|
// Effacement de la chaŒne
|
||||||
|
if (Position==Taille)
|
||||||
|
Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y),
|
||||||
|
Taille_maxi*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND);
|
||||||
|
Rafficher_toute_la_chaine(Pos_X,Pos_Y,Chaine,--Position);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 77 : // Droite
|
||||||
|
if ((Position<Taille) && (Position<Taille_maxi-1))
|
||||||
|
Rafficher_toute_la_chaine(Pos_X,Pos_Y,Chaine,++Position);
|
||||||
|
break;
|
||||||
|
case 71 : // Home
|
||||||
|
if (Position)
|
||||||
|
{
|
||||||
|
// Effacement de la chaŒne
|
||||||
|
if (Position==Taille)
|
||||||
|
Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y),
|
||||||
|
Taille_maxi*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND);
|
||||||
|
Rafficher_toute_la_chaine(Pos_X,Pos_Y,Chaine,Position=0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 79 : // End
|
||||||
|
if ((Position<Taille) && (Position<Taille_maxi-1))
|
||||||
|
Rafficher_toute_la_chaine(Pos_X,Pos_Y,Chaine,Position=(Taille<Taille_maxi)?Taille:Taille-1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 8 :
|
||||||
|
if (Position)
|
||||||
|
{
|
||||||
|
Supprimer_caractere(Chaine,--Position);
|
||||||
|
Taille--;
|
||||||
|
// Effacement de la chaŒne
|
||||||
|
Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y),
|
||||||
|
Taille_maxi*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND);
|
||||||
|
Rafficher_toute_la_chaine(Pos_X,Pos_Y,Chaine,Position);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 13 :
|
||||||
|
if ( (Type_saisie!=2) || (Chaine_valide(Chaine)) )
|
||||||
|
break;
|
||||||
|
// Si on ‚tait en saisie de nom de fichier et qu'il y ait une erreur
|
||||||
|
// dans la chaŒne
|
||||||
|
Erreur(0); // On flash en rouge & ...
|
||||||
|
Touche_lue=27; // ... on simule l'appuie sur la touche [Esc]
|
||||||
|
case 27 :
|
||||||
|
// On restaure la chaine initiale
|
||||||
|
strcpy(Chaine,Chaine_initiale);
|
||||||
|
Taille=strlen(Chaine);
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
if (Taille<Taille_maxi)
|
||||||
|
{
|
||||||
|
// On va regarder si l'utilisateur le droit de se servir de cette touche
|
||||||
|
Touche_autorisee=0; // On commence par supposer qu'elle est interdite
|
||||||
|
switch(Type_saisie)
|
||||||
|
{
|
||||||
|
case 0 : // N'importe quelle chaŒne:
|
||||||
|
if (Touche_lue>=' ')
|
||||||
|
Touche_autorisee=1;
|
||||||
|
break;
|
||||||
|
case 1 : // Nombre
|
||||||
|
if ( (Touche_lue>='0') && (Touche_lue<='9') )
|
||||||
|
Touche_autorisee=1;
|
||||||
|
break;
|
||||||
|
default : // Nom de fichier
|
||||||
|
// On commence par passez la lettre en majuscule
|
||||||
|
if ( (Touche_lue>='a') && (Touche_lue<='z') )
|
||||||
|
Touche_lue-=32;
|
||||||
|
// Ensuite on regarde si la touche est autoris‚e
|
||||||
|
if ( (Touche_lue> ' ') && (Touche_lue!='+') && (Touche_lue!='\\') &&
|
||||||
|
(Touche_lue!='>') && (Touche_lue!='<') && (Touche_lue!='*') &&
|
||||||
|
(Touche_lue!='?') && (Touche_lue!=':') && (Touche_lue!='|') &&
|
||||||
|
(Touche_lue!='/') && (Touche_lue!='"') && (Touche_lue!='=') &&
|
||||||
|
(Touche_lue!=',') && (Touche_lue!=';') && (Touche_lue!='[') &&
|
||||||
|
(Touche_lue!=']') )
|
||||||
|
Touche_autorisee=1;
|
||||||
|
} // Fin du "switch(Type_saisie)"
|
||||||
|
|
||||||
|
// Si la touche ‚tait autoris‚e...
|
||||||
|
if (Touche_autorisee)
|
||||||
|
{
|
||||||
|
// ... alors on l'insŠre ...
|
||||||
|
Inserer_caractere(Chaine,Touche_lue,Position/*,Taille*/);
|
||||||
|
// ce qui augmente la taille de la chaine
|
||||||
|
Taille++;
|
||||||
|
// et qui risque de d‚placer le curseur vers la droite
|
||||||
|
if (Taille<Taille_maxi)
|
||||||
|
Position++;
|
||||||
|
// Enfin, on raffiche la chaine
|
||||||
|
Rafficher_toute_la_chaine(Pos_X,Pos_Y,Chaine,Position);
|
||||||
|
} // Fin du test d'autorisation de touche
|
||||||
|
} // Fin du test de place libre
|
||||||
|
} // Fin du "switch(Touche_lue)"
|
||||||
|
} // Fin du "while"
|
||||||
|
|
||||||
|
// Effacement de la chaŒne
|
||||||
|
Block(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y),
|
||||||
|
Taille_maxi*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3),COULEUR_FOND);
|
||||||
|
// On raffiche la chaine correctement
|
||||||
|
if (Type_saisie==1)
|
||||||
|
{
|
||||||
|
if (Chaine[0]=='\0')
|
||||||
|
{
|
||||||
|
strcpy(Chaine,"0");
|
||||||
|
Taille=1;
|
||||||
|
}
|
||||||
|
Print_dans_fenetre(Pos_X+((Taille_maxi-Taille)<<3),Pos_Y,Chaine,COULEUR_TEXTE,COULEUR_FOND);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Print_dans_fenetre(Pos_X,Pos_Y,Chaine,COULEUR_TEXTE,COULEUR_FOND);
|
||||||
|
|
||||||
|
return (Touche_lue==13);
|
||||||
|
}
|
||||||
9
readline.h
Normal file
9
readline.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
byte Readline(word Pos_X,word Pos_Y,char * Chaine,byte Taille_maxi,byte Type_saisie);
|
||||||
|
// ParamŠtres:
|
||||||
|
// Pos_X, Pos_Y : Coordonn‚es de la saisie dans la fenˆtre
|
||||||
|
// Chaine : ChaŒne recevant la saisie (et contenant ‚ventuellement une valeur initiale)
|
||||||
|
// Taille_maxi : Nombre de caractŠres logeant dans la zone de saisie
|
||||||
|
// Type_saisie : 0=ChaŒne, 1=Nombre, 2=Nom de fichier (12 caractŠres)
|
||||||
|
// Sortie:
|
||||||
|
// 0: Sortie par annulation (Esc.) / 1: sortie par acceptation (Return)
|
||||||
145
readme!.1st
Normal file
145
readme!.1st
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||||
|
³!!!!!!! PLEASE READ THIS FILE !!!!!!!³!!!!!! VEUILLEZ LIRE CE FICHIER !!!!!!³
|
||||||
|
³!! ENTIRELY BEFORE RUNNING GRAFX2 !!!³! ENTIEREMENT AVANT DE LANCER GRAFX2 !³
|
||||||
|
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||||
|
³
|
||||||
|
³
|
||||||
|
If you are reading this file right ³ Si vous lisez ce fichier maintenant,
|
||||||
|
now, I'm sure that it is for one out ³ Je suis s–r que c'est pour l'une de
|
||||||
|
of these four reasons: ³ ces quatre raisons:
|
||||||
|
³
|
||||||
|
1) You are THE ONE who first reads ³ 1) Vous ˆtes CELUI qui lit les
|
||||||
|
README.1ST files before running ³ fichiers README.1ST avant de lancer
|
||||||
|
new programs. ³ de nouveaux programmes.
|
||||||
|
³
|
||||||
|
2) Today is a rainy day and you've ³ 2) Il pleut aujourd'hui et vous avez
|
||||||
|
already finished all the games ³ d‚j… termin‚ tous les jeux que vous
|
||||||
|
you've... "purchased". So you ³ avez... "achet‚s". Donc vous n'avez
|
||||||
|
have nothing else to do that ³ rien d'autre … faire que de lire ce
|
||||||
|
reading this damn file. ³ fichu fichier.
|
||||||
|
³
|
||||||
|
3) You had the quite good reflex ³ 3) Vous avez eu l'assez bon r‚flŠxe
|
||||||
|
(for someone who did not read ³ (pour quelqu'un qui n'a pas lu ce
|
||||||
|
this file) to switch off your PC ³ fichier) d'‚teindre votre PC avant
|
||||||
|
before your monitor burns, and ³ que votre moniteur grille, et
|
||||||
|
now you wonder why. ³ maintenant vous cherchez pourquoi.
|
||||||
|
³
|
||||||
|
4) You have burnt your monitor ³ 4) Vous avez bouzill‚ votre moniteur
|
||||||
|
because you didn't read this ³ parce que vous n'avez pas lu ce
|
||||||
|
file first. And you now have all ³ fichier en premier. Et maintenant
|
||||||
|
the time to read it on your ³ vous avez tout le temps de le lire
|
||||||
|
neighbour's computer before you ³ sur l'ordinateur de votre voisin en
|
||||||
|
can buy another monitor. ³ attendant de pouvoir vous acheter
|
||||||
|
³ un nouvel ‚cran.
|
||||||
|
³
|
||||||
|
³
|
||||||
|
úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄú
|
||||||
|
³
|
||||||
|
³
|
||||||
|
So here is what you must know about ³ Donc voici ce que vous devez savoir
|
||||||
|
GrafX2 before running it: ³ … propos de GrafX2 avant de le lancer:
|
||||||
|
³
|
||||||
|
³
|
||||||
|
Video problems: ³ ProblŠmes vid‚o:
|
||||||
|
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ³ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
||||||
|
³
|
||||||
|
- This program provides a huge ³ - Ce programme propose un trŠs grand
|
||||||
|
range of video resolutions. All ³ nombre de modes vid‚o. Toutes ces
|
||||||
|
these resolutions may not work with ³ r‚solutions peuvent ne pas marcher
|
||||||
|
your monitor or video card. This ³ avec votre moniteur ou carte vid‚o.
|
||||||
|
should result by your monitor to ³ Ceci peut r‚sulter par un sifflement
|
||||||
|
whistle and stay black or display ³ de votre moniteur ou bien plus g‚n‚-
|
||||||
|
shit. ³ ralement qu'il affiche n'importe
|
||||||
|
So we added a keyboard shortcut ³ quoi ou qu'il reste tout noir.
|
||||||
|
for you to come back to a normal ³ Par cons‚quent, nous avons ajout‚
|
||||||
|
resolution (MCGA 320x200). The ³ un raccourci clavier pour que vous
|
||||||
|
default keys for this shortcut are ³ puissiez revenir … un r‚solution
|
||||||
|
[Shift]+[Return]. But, since you ³ normale (MCGA 320x200). La combinai-
|
||||||
|
can configure all the keys with ³ son de touches par d‚faut est
|
||||||
|
GFXCFG, you should check its actual ³ [Shift]+[Return]. Mais, puisque vous
|
||||||
|
value by running this setup program.³ pouvez configurer toutes les touches
|
||||||
|
³ avec GFXCFG, vous devriez v‚rifier
|
||||||
|
Note that we take no responsa- ³ la combinaison exacte en lan‡ant ce
|
||||||
|
bility for any problems you could ³ programme.
|
||||||
|
encounter with GrafX2. ³
|
||||||
|
³ Notez que ne sommes aucunement
|
||||||
|
Important: ³ responsables d'‚ventuels problŠmes
|
||||||
|
If the standard VESA modes (i.e. ³ que vous pourriez rencontrer avec
|
||||||
|
640x400,640x480,800x600 & 1024x768) ³ GrafX2.
|
||||||
|
don't work, please type this line ³
|
||||||
|
from the DOS command line: ³ Important:
|
||||||
|
TESTVESA > VESA.TXT ³ Si les modes VESA standards (i.e.
|
||||||
|
and send us the file thus created ³ 640x400,640x480,800x600 & 1024x768)
|
||||||
|
telling us the name of your video ³ ne fonctionnent pas, veuillez taper
|
||||||
|
card. It would be even better if you³ ceci sur la ligne de commande DOS:
|
||||||
|
sent a version of this file with no ³ TESTVESA > VESA.TXT
|
||||||
|
VESA driver in memory and another ³ et nous envoyer le fichier ainsi
|
||||||
|
one with a resident driver (such as ³ cr‚‚ en nous donnant le nom de votre
|
||||||
|
UNIVBE (c)Scitech Software). ³ carte vid‚o. Ce serait encore mieux
|
||||||
|
³ si vous nous envoyiez une version de
|
||||||
|
³ ce fichier avec aucun gestionnaire
|
||||||
|
³ VESA en m‚moire et une autre avec un
|
||||||
|
³ driver r‚sident (tel que UNIVBE
|
||||||
|
³ (c)Scitech Software).
|
||||||
|
³
|
||||||
|
³
|
||||||
|
Problems with the keys? ³ ProblŠmes avec les touches?
|
||||||
|
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ³ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
||||||
|
³
|
||||||
|
- The button in the bottom-left ³ - Le bouton dans le coin bas-gauche
|
||||||
|
corner of the tool-bar (the one ³ de la barre d'outils (celui avec une
|
||||||
|
with a cross) was designed to hide ³ croix) a ‚t‚ con‡u pour cacher la
|
||||||
|
the tool-bar. But, the danger with ³ barre d'outils. Mais le danger avec
|
||||||
|
this button is that, if you don't ³ ce bouton est que si vous ne con-
|
||||||
|
know the key to have it back, you ³ naissez pas la touche qui permet de
|
||||||
|
will be in trouble :). ³ la rafficher, vous serez embˆt‚ :).
|
||||||
|
The default key is [F10] but ³ La touche par d‚faut est [F10]
|
||||||
|
check it in the setup program. ³ mais v‚rifiez-la avec GFXCFG.
|
||||||
|
³
|
||||||
|
- The default key for exiting the ³ - La touche par d‚faut pour quitter
|
||||||
|
program is [Q] (for QWERTY ³ le programme est [Q] (pour claviers
|
||||||
|
keyboards). This can be useful if ³ QWERTY). Cela peut ˆtre utile si
|
||||||
|
you don't remember how to show the ³ vous ne vous rappelez pas comment
|
||||||
|
tool-bar. ³ remontrer la barre d'outils.
|
||||||
|
³
|
||||||
|
- The key-configuration program ³ - Le programme de configuration des
|
||||||
|
displays the values for QWERTY ³ touches affiche ces derniŠres pour
|
||||||
|
keyboards. So if you have an AZERTY ³ les claviers QWERTY. Donc, si vous
|
||||||
|
keyboard for example, and want to ³ avez un clavier AZERTY par exemple
|
||||||
|
use your true Q key for quitting, ³ et que vous voulez utiliser votre
|
||||||
|
don't worry if the program displays ³ vraie touche Q pour quitter, ne vous
|
||||||
|
'A'. ³ ‚tonnez pas si le programme affiche
|
||||||
|
³ 'A'.
|
||||||
|
- Though keys are designed for ³
|
||||||
|
QWERTY keyboards, "typing areas" ³ - Bien que les touches soient g‚r‚es
|
||||||
|
will read the key-codes of your ³ pour claviers QWERTY, les zones de
|
||||||
|
country. For example, when you'll ³ saisie lisent les touches de votre
|
||||||
|
have to enter a file name, you'll ³ pays. Par exemple, lorsque vous
|
||||||
|
get what you type (cool! :)). ³ entrerez un nom de fichier, vous
|
||||||
|
³ obtiendrez ce que vous tapez (cool!)
|
||||||
|
- For people who would like to get ³ :).
|
||||||
|
directly the AZERTY equivalent of ³
|
||||||
|
the default configuration file, we ³ - Pour ceux qui voudraient avoir
|
||||||
|
have added the GFX2_FRA.CFG file. ³ directement l'‚quivalent AZERTY du
|
||||||
|
Then you'll just have to rename it ³ fichier de configuration par d‚faut,
|
||||||
|
to GFX2.CFG (great!) ;). ³ nous avons inclus le fichier
|
||||||
|
³ GFX2_FRA.CFG. Vous n'aurez qu'… le
|
||||||
|
³ renommer en GFX2.CFG (g‚nial!) ;).
|
||||||
|
³
|
||||||
|
³
|
||||||
|
úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄú
|
||||||
|
³
|
||||||
|
³
|
||||||
|
OK! Now you can use and abuse of ³ OK! Maintenant vous pouvez user et
|
||||||
|
this program! ³ abuser de ce programme!
|
||||||
|
³
|
||||||
|
³
|
||||||
|
PS: Pleeeease! If you think something ³ PS: Par piti‚‚‚‚! Si vous pensez que
|
||||||
|
is going wrong, read all the docs ³ quelque chose ne tourne pas rond,
|
||||||
|
before complaining! Maybe that's ³ lisez toutes les docs avant de
|
||||||
|
merely because you don't know how ³ vous plaindre! Peut-ˆtre que c'est
|
||||||
|
to use it that it doesn't act as ³ simplement parce que vous ne savez
|
||||||
|
you expect. ;) ³ pas comment l'utiliser qu'une
|
||||||
|
³ option n'agit pas comme vous
|
||||||
|
| esp‚rez.
|
||||||
|
ú
|
||||||
60
readme.txt
Normal file
60
readme.txt
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
GrafX2 - The Ultimate 256-color bitmap paint program
|
||||||
|
Copyright (C)1996-2001 Sunset Design (G.Dorme & K.Maritaud)
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
Here you can find the source code of GrafX2.
|
||||||
|
You can use and modify it as you want (in the
|
||||||
|
limits fixed the GNU GPL).
|
||||||
|
But you are strongly encouraged to submit new
|
||||||
|
versions to the authors (see addresses below)
|
||||||
|
if you plan to release them.
|
||||||
|
|
||||||
|
The GFX2_SRC directory contains the current state
|
||||||
|
of our own directory when we were programming GrafX2.
|
||||||
|
The source code is mainly in French but you'll find
|
||||||
|
more explanations (in both English and French) on
|
||||||
|
our web site (see address below).
|
||||||
|
|
||||||
|
The subdirectory "DAT" contains the source code
|
||||||
|
of the program used to generate the GFX2.DAT file.
|
||||||
|
|
||||||
|
The subdirectory "CFG" contains the source code
|
||||||
|
of the GFXCFG program used for redefining keys
|
||||||
|
and recreating corrupt configuration files.
|
||||||
|
|
||||||
|
The current version of GrafX2 must be compiled
|
||||||
|
with Watcom C (we used version 10.6).
|
||||||
|
The auxiliary programs (GFXCFG, MAKEDAT, etc...)
|
||||||
|
must be compiled with Borland Turbo Pascal 7.
|
||||||
|
Both Watcom C and Borland Turbo Pascal 7 are now
|
||||||
|
FREE to use.
|
||||||
|
|
||||||
|
|
||||||
|
------- GNU G.P.L. disclaimer -------
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
You can contact the authors here:
|
||||||
|
|
||||||
|
Guillaume DORME
|
||||||
|
address: 15, rue de l'Observatoire, 87000 LIMOGES (FRANCE)
|
||||||
|
e-mail: dorme@msi.unilim.fr
|
||||||
|
|
||||||
|
Karl Maritaud
|
||||||
|
address: 10, rue de la Brasserie, 87000 LIMOGES (FRANCE)
|
||||||
|
e-mail: maritaud@ensil.unilim.fr
|
||||||
|
|
||||||
|
http://w3.ensil.unilim.fr/~maritaud/sunset
|
||||||
502
saveini.c
Normal file
502
saveini.c
Normal file
@ -0,0 +1,502 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include "const.h"
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
int Sauver_INI_Reach_group(FILE * Old_file,FILE * New_file,char * Buffer,char * Group)
|
||||||
|
{
|
||||||
|
int Arret;
|
||||||
|
char * Group_upper;
|
||||||
|
char * Buffer_upper;
|
||||||
|
|
||||||
|
// On alloue les zones de m‚moire:
|
||||||
|
Group_upper =(char *)malloc(1024);
|
||||||
|
Buffer_upper=(char *)malloc(1024);
|
||||||
|
|
||||||
|
// On commence par se faire une version majuscule du groupe … rechercher:
|
||||||
|
strcpy(Group_upper,Group);
|
||||||
|
Charger_INI_Clear_string(Group_upper);
|
||||||
|
|
||||||
|
Arret=0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// On lit une ligne dans le fichier:
|
||||||
|
if (fgets(Buffer,1024,Old_file)==0)
|
||||||
|
{
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Group_upper);
|
||||||
|
return ERREUR_INI_CORROMPU;
|
||||||
|
}
|
||||||
|
|
||||||
|
// On s'en fait une version en majuscule:
|
||||||
|
strcpy(Buffer_upper,Buffer);
|
||||||
|
Charger_INI_Clear_string(Buffer_upper);
|
||||||
|
|
||||||
|
// On compare la chaŒne avec le groupe recherch‚:
|
||||||
|
Arret=Charger_INI_Seek_pattern(Buffer_upper,Group_upper);
|
||||||
|
if (fprintf(New_file,"%s",Buffer)<0)
|
||||||
|
{
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Group_upper);
|
||||||
|
return ERREUR_SAUVEGARDE_INI;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (Arret==0);
|
||||||
|
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Group_upper);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int Sauver_INI_char_in_value_alphabet(char Char)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
( // Chiffre
|
||||||
|
(Char>='0') &&
|
||||||
|
(Char<='9')
|
||||||
|
) ||
|
||||||
|
( // Lettre majuscule
|
||||||
|
(Char>='A') &&
|
||||||
|
(Char<='Z')
|
||||||
|
) ||
|
||||||
|
( // Lettre minuscule
|
||||||
|
(Char>='a') &&
|
||||||
|
(Char<='z')
|
||||||
|
) ||
|
||||||
|
(Char == '$') // Symbole d'hexad‚cimal
|
||||||
|
)
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Sauver_INI_Set_value(char * Destination,char * Source,int Nb_values_to_set,int * Values,int Litteral)
|
||||||
|
{
|
||||||
|
int Indice_destination;
|
||||||
|
int Indice_source;
|
||||||
|
int Indice_valeur;
|
||||||
|
|
||||||
|
// On commence par recopier tout jusqu'au symbole '=':
|
||||||
|
for (Indice_source=0;Source[Indice_source]!='=';Indice_source++)
|
||||||
|
Destination[Indice_source]=Source[Indice_source];
|
||||||
|
|
||||||
|
// Puis on recopie le symbole '=':
|
||||||
|
Destination[Indice_source]=Source[Indice_source];
|
||||||
|
Indice_source++;
|
||||||
|
|
||||||
|
// Puis on recopie tous les espaces qui suivent:
|
||||||
|
for (;Source[Indice_source]==' ';Indice_source++)
|
||||||
|
Destination[Indice_source]=Source[Indice_source];
|
||||||
|
|
||||||
|
// Pour l'instant, la source et la destination en sont au mˆme point:
|
||||||
|
Indice_destination=Indice_source;
|
||||||
|
|
||||||
|
// Puis pour chaque valeur … recopier:
|
||||||
|
for (Indice_valeur=0;Indice_valeur<Nb_values_to_set;Indice_valeur++)
|
||||||
|
{
|
||||||
|
// Dans la destination, on ‚crit la valeur:
|
||||||
|
if (Litteral)
|
||||||
|
{
|
||||||
|
// La valeur doit ˆtre ‚crite sous la forme Yes/No
|
||||||
|
|
||||||
|
if (Values[Indice_valeur])
|
||||||
|
{
|
||||||
|
// La valeur <=> Yes
|
||||||
|
|
||||||
|
memcpy(Destination+Indice_destination,"yes",3);
|
||||||
|
Indice_destination+=3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// La valeur <=> No
|
||||||
|
|
||||||
|
memcpy(Destination+Indice_destination,"no",2);
|
||||||
|
Indice_destination+=2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// La valeur doit ˆtre ‚crite sous forme num‚rique
|
||||||
|
|
||||||
|
if (Source[Indice_source]=='$')
|
||||||
|
{
|
||||||
|
// On va ‚crire la valeur sous forme hexad‚cimale:
|
||||||
|
|
||||||
|
// On commence par inscrire le symbole '$':
|
||||||
|
Destination[Indice_destination]='$';
|
||||||
|
|
||||||
|
// Puis on y concatŠne la valeur:
|
||||||
|
sprintf(Destination+Indice_destination+1,"%x",Values[Indice_valeur]);
|
||||||
|
Indice_destination+=strlen(Destination+Indice_destination);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// On va ‚crire la valeur sous forme d‚cimale:
|
||||||
|
|
||||||
|
sprintf(Destination+Indice_destination,"%d",Values[Indice_valeur]);
|
||||||
|
Indice_destination+=strlen(Destination+Indice_destination);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dans la source, on saute la valeur:
|
||||||
|
for (;Sauver_INI_char_in_value_alphabet(Source[Indice_source]) && (Source[Indice_source]!='\0');Indice_source++);
|
||||||
|
|
||||||
|
if (Indice_valeur!=(Nb_values_to_set-1))
|
||||||
|
{
|
||||||
|
// Il reste d'autres valeurs … ‚crire
|
||||||
|
|
||||||
|
// On recopie tous les caractŠres de la source jusqu'au suivant qui
|
||||||
|
// d‚signe une valeur:
|
||||||
|
for (;(!Sauver_INI_char_in_value_alphabet(Source[Indice_source])) && (Source[Indice_source]!='\0');Indice_source++,Indice_destination++)
|
||||||
|
Destination[Indice_destination]=Source[Indice_source];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// C'est la derniŠre valeur … initialiser
|
||||||
|
|
||||||
|
// On recopie toute la fin de la ligne:
|
||||||
|
for (;Source[Indice_source]!='\0';Indice_source++,Indice_destination++)
|
||||||
|
Destination[Indice_destination]=Source[Indice_source];
|
||||||
|
|
||||||
|
// Et on n'oublie pas d'y mettre l''\0':
|
||||||
|
Destination[Indice_destination]='\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int Sauver_INI_Set_values(FILE * Old_file,FILE * New_file,char * Buffer,char * Option,int Nb_values_to_set,int * Values,int Litteral)
|
||||||
|
{
|
||||||
|
int Arret;
|
||||||
|
char * Option_upper;
|
||||||
|
char * Buffer_upper;
|
||||||
|
char * Buffer_resultat;
|
||||||
|
int Indice_buffer;
|
||||||
|
|
||||||
|
// On alloue les zones de m‚moire:
|
||||||
|
Option_upper=(char *)malloc(1024);
|
||||||
|
Buffer_upper=(char *)malloc(1024);
|
||||||
|
Buffer_resultat=(char *)malloc(1024);
|
||||||
|
|
||||||
|
// On commence par se faire une version majuscule de l'option … rechercher:
|
||||||
|
strcpy(Option_upper,Option);
|
||||||
|
Charger_INI_Clear_string(Option_upper);
|
||||||
|
|
||||||
|
Arret=0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// On lit une ligne dans le fichier:
|
||||||
|
if (fgets(Buffer,1024,Old_file)==0)
|
||||||
|
{
|
||||||
|
free(Buffer_resultat);
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Option_upper);
|
||||||
|
return ERREUR_INI_CORROMPU;
|
||||||
|
}
|
||||||
|
|
||||||
|
// On s'en fait une version en majuscule:
|
||||||
|
strcpy(Buffer_upper,Buffer);
|
||||||
|
Charger_INI_Clear_string(Buffer_upper);
|
||||||
|
|
||||||
|
// On compare la chaŒne avec l'option recherch‚e:
|
||||||
|
Arret=Charger_INI_Seek_pattern(Buffer_upper,Option_upper);
|
||||||
|
|
||||||
|
if (Arret)
|
||||||
|
{
|
||||||
|
// On l'a trouv‚e:
|
||||||
|
|
||||||
|
Sauver_INI_Set_value(Buffer_resultat,Buffer,Nb_values_to_set,Values,Litteral);
|
||||||
|
if (fprintf(New_file,"%s",Buffer_resultat)<0)
|
||||||
|
{
|
||||||
|
free(Buffer_resultat);
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Option_upper);
|
||||||
|
return ERREUR_SAUVEGARDE_INI;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// On l'a pas trouv‚e:
|
||||||
|
|
||||||
|
if (fprintf(New_file,"%s",Buffer)<0)
|
||||||
|
{
|
||||||
|
free(Buffer_resultat);
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Option_upper);
|
||||||
|
return ERREUR_SAUVEGARDE_INI;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (Arret==0);
|
||||||
|
|
||||||
|
free(Buffer_resultat);
|
||||||
|
free(Buffer_upper);
|
||||||
|
free(Option_upper);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Sauver_INI_Flush(FILE * Old_file,FILE * New_file,char * Buffer)
|
||||||
|
{
|
||||||
|
while (fgets(Buffer,1024,Old_file)!=0)
|
||||||
|
fprintf(New_file,"%s",Buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int Sauver_INI(struct S_Config * Conf)
|
||||||
|
{
|
||||||
|
FILE * Ancien_fichier;
|
||||||
|
FILE * Nouveau_fichier;
|
||||||
|
char * Buffer;
|
||||||
|
int Valeurs[3];
|
||||||
|
char * Nom_du_fichier;
|
||||||
|
char * Nom_du_fichier_temporaire;
|
||||||
|
int Retour;
|
||||||
|
|
||||||
|
// On alloue les zones de m‚moire:
|
||||||
|
Buffer=(char *)malloc(1024);
|
||||||
|
Nom_du_fichier=(char *)malloc(256);
|
||||||
|
Nom_du_fichier_temporaire=(char *)malloc(256);
|
||||||
|
|
||||||
|
// On calcule les noms des fichiers qu'on manipule:
|
||||||
|
strcpy(Nom_du_fichier,Repertoire_du_programme);
|
||||||
|
strcat(Nom_du_fichier,"GFX2.INI");
|
||||||
|
|
||||||
|
strcpy(Nom_du_fichier_temporaire,Repertoire_du_programme);
|
||||||
|
strcat(Nom_du_fichier_temporaire,"GFX2.$$$");
|
||||||
|
|
||||||
|
// On renome l'ancienne version du fichier INI vers un fichier temporaire:
|
||||||
|
if (rename(Nom_du_fichier,Nom_du_fichier_temporaire)!=0)
|
||||||
|
goto Erreur_ERREUR_SAUVEGARDE_INI;
|
||||||
|
|
||||||
|
Ancien_fichier=fopen(Nom_du_fichier_temporaire,"r");
|
||||||
|
if (Ancien_fichier!=0)
|
||||||
|
{
|
||||||
|
Nouveau_fichier=fopen(Nom_du_fichier,"w");
|
||||||
|
if (Nouveau_fichier!=0)
|
||||||
|
{
|
||||||
|
if (Retour=Sauver_INI_Reach_group(Ancien_fichier,Nouveau_fichier,Buffer,"[MOUSE]"))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Indice_Sensibilite_souris_X;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"X_sensitivity",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Indice_Sensibilite_souris_Y;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Y_sensitivity",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Mouse_Facteur_de_correction_X;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"X_correction_factor",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Mouse_Facteur_de_correction_Y;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Y_correction_factor",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=(Conf->Curseur)+1;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Cursor_aspect",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
|
||||||
|
if (Retour=Sauver_INI_Reach_group(Ancien_fichier,Nouveau_fichier,Buffer,"[MENU]"))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Coul_menu_pref[2].R;
|
||||||
|
Valeurs[1]=Conf->Coul_menu_pref[2].V;
|
||||||
|
Valeurs[2]=Conf->Coul_menu_pref[2].B;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Light_color",3,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Coul_menu_pref[1].R;
|
||||||
|
Valeurs[1]=Conf->Coul_menu_pref[1].V;
|
||||||
|
Valeurs[2]=Conf->Coul_menu_pref[1].B;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Dark_color",3,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Ratio;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Menu_ratio",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=(Conf->Fonte)+1;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Font",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
|
||||||
|
if (Retour=Sauver_INI_Reach_group(Ancien_fichier,Nouveau_fichier,Buffer,"[FILE_SELECTOR]"))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Lire_les_fichiers_caches?1:0;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Show_hidden_files",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Lire_les_repertoires_caches?1:0;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Show_hidden_directories",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Lire_les_repertoires_systemes?1:0;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Show_system_directories",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Chrono_delay;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Preview_delay",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Maximize_preview;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Maximize_preview",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Find_file_fast;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Find_file_fast",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
|
||||||
|
if (Retour=Sauver_INI_Reach_group(Ancien_fichier,Nouveau_fichier,Buffer,"[LOADING]"))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Auto_set_res;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Auto_set_resolution",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Set_resolution_according_to;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Set_resolution_according_to",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Clear_palette;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Clear_palette",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
|
||||||
|
if (Retour=Sauver_INI_Reach_group(Ancien_fichier,Nouveau_fichier,Buffer,"[MISCELLANEOUS]"))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Afficher_limites_image;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Draw_limits",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Adjust_brush_pick;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Adjust_brush_pick",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=2-Conf->Coords_rel;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Coordinates",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Backup;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Backup",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Nb_pages_Undo;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Undo_pages",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Valeur_tempo_jauge_gauche;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Gauges_scrolling_speed_Left",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Valeur_tempo_jauge_droite;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Gauges_scrolling_speed_Right",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Auto_save;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Auto_save",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Nb_max_de_vertex_par_polygon;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Vertices_per_polygon",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Fast_zoom;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Fast_zoom",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Couleurs_separees;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Separate_colors",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->FX_Feedback;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"FX_feedback",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Safety_colors;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Safety_colors",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Opening_message;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Opening_message",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Clear_with_stencil;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Clear_with_stencil",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Auto_discontinuous;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Auto_discontinuous",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Taille_ecran_dans_GIF;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Save_screen_size_in_GIF",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Auto_nb_used;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Auto_nb_colors_used",1,Valeurs,1))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Valeurs[0]=Conf->Resolution_par_defaut;
|
||||||
|
if (Retour=Sauver_INI_Set_values (Ancien_fichier,Nouveau_fichier,Buffer,"Default_video_mode",1,Valeurs,0))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
Sauver_INI_Flush(Ancien_fichier,Nouveau_fichier,Buffer);
|
||||||
|
|
||||||
|
fclose(Nouveau_fichier);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fclose(Ancien_fichier);
|
||||||
|
goto Erreur_ERREUR_SAUVEGARDE_INI;
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(Ancien_fichier);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
free(Nom_du_fichier_temporaire);
|
||||||
|
free(Nom_du_fichier);
|
||||||
|
free(Buffer);
|
||||||
|
return ERREUR_INI_ABSENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
// On efface le fichier temporaire <=> Ancienne version du .INI
|
||||||
|
remove(Nom_du_fichier_temporaire);
|
||||||
|
|
||||||
|
free(Nom_du_fichier_temporaire);
|
||||||
|
free(Nom_du_fichier);
|
||||||
|
free(Buffer);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Gestion des erreurs:
|
||||||
|
|
||||||
|
Erreur_Retour:
|
||||||
|
|
||||||
|
fclose(Nouveau_fichier);
|
||||||
|
fclose(Ancien_fichier);
|
||||||
|
free(Nom_du_fichier_temporaire);
|
||||||
|
free(Nom_du_fichier);
|
||||||
|
free(Buffer);
|
||||||
|
return Retour;
|
||||||
|
|
||||||
|
Erreur_ERREUR_SAUVEGARDE_INI:
|
||||||
|
|
||||||
|
free(Nom_du_fichier_temporaire);
|
||||||
|
free(Nom_du_fichier);
|
||||||
|
free(Buffer);
|
||||||
|
return ERREUR_SAUVEGARDE_INI;
|
||||||
|
}
|
||||||
33
sdlscreen.h
Normal file
33
sdlscreen.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#ifndef SDLSCREEN_H_INCLUDED
|
||||||
|
#define SDLSCREEN_H_INCLUDED
|
||||||
|
|
||||||
|
#include <SDL/SDL.h>
|
||||||
|
#include "struct.h"
|
||||||
|
//Set_Mode_SDL();
|
||||||
|
|
||||||
|
void Pixel_SDL (word X,word Y,byte Couleur);
|
||||||
|
byte Lit_Pixel_SDL (word X,word Y);
|
||||||
|
void Effacer_Tout_l_Ecran_SDL (byte Couleur);
|
||||||
|
void Block_SDL (word Debut_X,word Debut_Y,word Largeur,word Hauteur,byte Couleur);
|
||||||
|
void Pixel_Preview_Normal_SDL (word X,word Y,byte Couleur);
|
||||||
|
void Pixel_Preview_Loupe_SDL (word X,word Y,byte Couleur);
|
||||||
|
void Ligne_horizontale_XOR_SDL(word Pos_X,word Pos_Y,word Largeur);
|
||||||
|
void Ligne_verticale_XOR_SDL (word Pos_X,word Pos_Y,word Hauteur);
|
||||||
|
void Display_brush_Color_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse);
|
||||||
|
void Display_brush_Mono_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse);
|
||||||
|
void Clear_brush_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_image);
|
||||||
|
void Remap_screen_SDL (word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * Table_de_conversion);
|
||||||
|
void Afficher_partie_de_l_ecran_SDL (word Largeur,word Hauteur,word Largeur_image);
|
||||||
|
void Afficher_une_ligne_ecran_SDL (word Pos_X,word Pos_Y,word Largeur,byte * Ligne);
|
||||||
|
void Lire_une_ligne_ecran_SDL (word Pos_X,word Pos_Y,word Largeur,byte * Ligne);
|
||||||
|
void Afficher_partie_de_l_ecran_zoomee_SDL(word Largeur,word Hauteur,word Largeur_image,byte * Buffer);
|
||||||
|
void Display_brush_Color_zoom_SDL(word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_brosse,byte * Buffer);
|
||||||
|
void Display_brush_Mono_zoom_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse,byte * Buffer);
|
||||||
|
void Clear_brush_zoom_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_image,byte * Buffer);
|
||||||
|
|
||||||
|
SDL_Rect ** Liste_Modes_Videos_SDL;
|
||||||
|
SDL_Surface* Ecran;
|
||||||
|
|
||||||
|
SDL_Event* Evenement_SDL;
|
||||||
|
|
||||||
|
#endif // SDLSCREEN_H_INCLUDED
|
||||||
6
shade.h
Normal file
6
shade.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef SHADE_H_INCLUDED
|
||||||
|
#define SHADE_H_INCLUDED
|
||||||
|
|
||||||
|
void Bouton_Quick_shade_Menu(void);
|
||||||
|
|
||||||
|
#endif // SHADE_H_INCLUDED
|
||||||
327
special.c
Normal file
327
special.c
Normal file
@ -0,0 +1,327 @@
|
|||||||
|
#include "const.h"
|
||||||
|
#include "struct.h"
|
||||||
|
#include "global.h"
|
||||||
|
#include "graph.h"
|
||||||
|
#include "moteur.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------- Modifier le pinceau sp‚cial -------------------------
|
||||||
|
|
||||||
|
void Modifier_pinceau(int Largeur, int Hauteur)
|
||||||
|
{
|
||||||
|
int Pos_X,Pos_Y;
|
||||||
|
int X,Y;
|
||||||
|
float Rayon2;
|
||||||
|
|
||||||
|
if (Largeur<1) Largeur=1;
|
||||||
|
if (Hauteur<1) Hauteur=1;
|
||||||
|
if (Largeur>TAILLE_MAXI_PINCEAU) Largeur=TAILLE_MAXI_PINCEAU;
|
||||||
|
if (Hauteur>TAILLE_MAXI_PINCEAU) Hauteur=TAILLE_MAXI_PINCEAU;
|
||||||
|
Pinceau_Largeur=Largeur;
|
||||||
|
Pinceau_Hauteur=Hauteur;
|
||||||
|
Pinceau_Decalage_X=Pinceau_Largeur>>1;
|
||||||
|
Pinceau_Decalage_Y=Pinceau_Hauteur>>1;
|
||||||
|
switch (Pinceau_Forme)
|
||||||
|
{
|
||||||
|
case FORME_PINCEAU_ROND :
|
||||||
|
Rayon2=Pinceau_Decalage_X+0.414213562; // [0.410..0.415[
|
||||||
|
Rayon2*=Rayon2;
|
||||||
|
for (Pos_Y=0; Pos_Y<Pinceau_Hauteur; Pos_Y++)
|
||||||
|
for (Pos_X=0; Pos_X<Pinceau_Largeur; Pos_X++)
|
||||||
|
{
|
||||||
|
X=Pos_X-Pinceau_Decalage_X;
|
||||||
|
Y=Pos_Y-Pinceau_Decalage_Y;
|
||||||
|
Pinceau_Sprite[(Pos_Y*TAILLE_MAXI_PINCEAU)+Pos_X]=( ((X*X)+(Y*Y)) < Rayon2 );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_CARRE :
|
||||||
|
for (Pos_X=0,Pos_Y=0; Pos_X<Pinceau_Hauteur; Pos_X++,Pos_Y+=TAILLE_MAXI_PINCEAU)
|
||||||
|
memset(Pinceau_Sprite+Pos_Y,1,Pinceau_Largeur);
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_ROND_TRAME :
|
||||||
|
Rayon2=Pinceau_Decalage_X+0.414213562; // [0.410..0.415[
|
||||||
|
Rayon2*=Rayon2;
|
||||||
|
for (Pos_Y=0; Pos_Y<Pinceau_Hauteur; Pos_Y++)
|
||||||
|
for (Pos_X=0; Pos_X<Pinceau_Largeur; Pos_X++)
|
||||||
|
{
|
||||||
|
X=Pos_X-Pinceau_Decalage_X;
|
||||||
|
Y=Pos_Y-Pinceau_Decalage_Y;
|
||||||
|
Pinceau_Sprite[(Pos_Y*TAILLE_MAXI_PINCEAU)+Pos_X]=( (!((Pos_X+Pos_Y)&1)) && (((X*X)+(Y*Y)) < Rayon2));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_CARRE_TRAME:
|
||||||
|
for (Pos_Y=0; Pos_Y<Pinceau_Hauteur; Pos_Y++)
|
||||||
|
for (Pos_X=0; Pos_X<Pinceau_Largeur; Pos_X++)
|
||||||
|
Pinceau_Sprite[(Pos_Y*TAILLE_MAXI_PINCEAU)+Pos_X]=!((Pos_X+Pos_Y)&1);
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_PLUS:
|
||||||
|
X=Pinceau_Largeur>>1;
|
||||||
|
for (Pos_Y=0; Pos_Y<Pinceau_Hauteur; Pos_Y++)
|
||||||
|
for (Pos_X=0; Pos_X<Pinceau_Largeur; Pos_X++)
|
||||||
|
Pinceau_Sprite[(Pos_Y*TAILLE_MAXI_PINCEAU)+Pos_X]=((Pos_X==X) || (Pos_Y==X));
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_SLASH:
|
||||||
|
X=Pinceau_Largeur>>1;
|
||||||
|
for (Pos_Y=0; Pos_Y<Pinceau_Hauteur; Pos_Y++)
|
||||||
|
for (Pos_X=0; Pos_X<Pinceau_Largeur; Pos_X++)
|
||||||
|
Pinceau_Sprite[(Pos_Y*TAILLE_MAXI_PINCEAU)+Pos_X]=(Pos_X==(Pinceau_Largeur-(Pos_Y+1)));
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_ANTISLASH:
|
||||||
|
X=Pinceau_Largeur>>1;
|
||||||
|
for (Pos_Y=0; Pos_Y<Pinceau_Hauteur; Pos_Y++)
|
||||||
|
for (Pos_X=0; Pos_X<Pinceau_Largeur; Pos_X++)
|
||||||
|
Pinceau_Sprite[(Pos_Y*TAILLE_MAXI_PINCEAU)+Pos_X]=(Pos_X==Pos_Y);
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_BARRE_HORIZONTALE:
|
||||||
|
memset(Pinceau_Sprite,1,Pinceau_Largeur);
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_BARRE_VERTICALE:
|
||||||
|
for (Pos_Y=0; Pos_Y<Pinceau_Hauteur; Pos_Y++)
|
||||||
|
Pinceau_Sprite[(Pos_Y*TAILLE_MAXI_PINCEAU)]=1;
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_X:
|
||||||
|
X=Pinceau_Largeur>>1;
|
||||||
|
for (Pos_Y=0; Pos_Y<Pinceau_Hauteur; Pos_Y++)
|
||||||
|
for (Pos_X=0; Pos_X<Pinceau_Largeur; Pos_X++)
|
||||||
|
Pinceau_Sprite[(Pos_Y*TAILLE_MAXI_PINCEAU)+Pos_X]=( (Pos_X==Pos_Y) || (Pos_X==(Pinceau_Hauteur-(Pos_Y+1))) );
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_LOSANGE:
|
||||||
|
X=Pinceau_Largeur>>1;
|
||||||
|
for (Pos_Y=0; Pos_Y<Pinceau_Hauteur; Pos_Y++)
|
||||||
|
for (Pos_X=0; Pos_X<Pinceau_Largeur; Pos_X++)
|
||||||
|
{
|
||||||
|
if (Pos_X<=X)
|
||||||
|
Y=X-Pos_X;
|
||||||
|
else
|
||||||
|
Y=Pos_X-X;
|
||||||
|
if (Pos_Y<=X)
|
||||||
|
Y+=X-Pos_Y;
|
||||||
|
else
|
||||||
|
Y+=Pos_Y-X;
|
||||||
|
Pinceau_Sprite[(Pos_Y*TAILLE_MAXI_PINCEAU)+Pos_X]=(Y<=X);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_ALEATOIRE:
|
||||||
|
Rayon2=Pinceau_Decalage_X+0.414213562; // [0.410..0.415[
|
||||||
|
Rayon2*=Rayon2;
|
||||||
|
for (Pos_Y=0; Pos_Y<Pinceau_Hauteur; Pos_Y++)
|
||||||
|
for (Pos_X=0; Pos_X<Pinceau_Largeur; Pos_X++)
|
||||||
|
{
|
||||||
|
X=Pos_X-Pinceau_Decalage_X;
|
||||||
|
Y=Pos_Y-Pinceau_Decalage_Y;
|
||||||
|
Pinceau_Sprite[(Pos_Y*TAILLE_MAXI_PINCEAU)+Pos_X]=( (((X*X)+(Y*Y)) < Rayon2) && (!(rand()&7)) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Retrecir_pinceau(void)
|
||||||
|
{
|
||||||
|
if ( (Pinceau_Forme<FORME_PINCEAU_DIVERS)
|
||||||
|
&& ( (Pinceau_Largeur>1)
|
||||||
|
|| (Pinceau_Hauteur>1) ) )
|
||||||
|
{
|
||||||
|
Effacer_curseur();
|
||||||
|
switch (Pinceau_Forme)
|
||||||
|
{
|
||||||
|
case FORME_PINCEAU_ROND:
|
||||||
|
case FORME_PINCEAU_ROND_TRAME:
|
||||||
|
case FORME_PINCEAU_X:
|
||||||
|
case FORME_PINCEAU_PLUS:
|
||||||
|
case FORME_PINCEAU_LOSANGE:
|
||||||
|
case FORME_PINCEAU_ALEATOIRE:
|
||||||
|
if (Pinceau_Largeur&1)
|
||||||
|
Modifier_pinceau(Pinceau_Largeur-2,Pinceau_Hauteur-2);
|
||||||
|
else
|
||||||
|
Modifier_pinceau(Pinceau_Largeur-1,Pinceau_Hauteur-1);
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_CARRE:
|
||||||
|
case FORME_PINCEAU_SLASH:
|
||||||
|
case FORME_PINCEAU_ANTISLASH:
|
||||||
|
case FORME_PINCEAU_CARRE_TRAME:
|
||||||
|
Modifier_pinceau(Pinceau_Largeur-1,Pinceau_Hauteur-1);
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_BARRE_HORIZONTALE:
|
||||||
|
Modifier_pinceau(Pinceau_Largeur-1,1);
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_BARRE_VERTICALE:
|
||||||
|
Modifier_pinceau(1,Pinceau_Hauteur-1);
|
||||||
|
}
|
||||||
|
Afficher_pinceau_dans_menu();
|
||||||
|
Afficher_curseur();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Grossir_pinceau(void)
|
||||||
|
{
|
||||||
|
if ( (Pinceau_Forme<FORME_PINCEAU_DIVERS)
|
||||||
|
&& ( (Pinceau_Largeur<TAILLE_MAXI_PINCEAU)
|
||||||
|
|| (Pinceau_Hauteur<TAILLE_MAXI_PINCEAU) ) )
|
||||||
|
{
|
||||||
|
Effacer_curseur();
|
||||||
|
switch (Pinceau_Forme)
|
||||||
|
{
|
||||||
|
case FORME_PINCEAU_ROND:
|
||||||
|
case FORME_PINCEAU_ROND_TRAME:
|
||||||
|
case FORME_PINCEAU_ALEATOIRE:
|
||||||
|
case FORME_PINCEAU_X:
|
||||||
|
case FORME_PINCEAU_PLUS:
|
||||||
|
case FORME_PINCEAU_LOSANGE:
|
||||||
|
if (Pinceau_Largeur&1)
|
||||||
|
Modifier_pinceau(Pinceau_Largeur+2,Pinceau_Hauteur+2);
|
||||||
|
else
|
||||||
|
Modifier_pinceau(Pinceau_Largeur+1,Pinceau_Hauteur+1);
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_CARRE:
|
||||||
|
case FORME_PINCEAU_SLASH:
|
||||||
|
case FORME_PINCEAU_ANTISLASH:
|
||||||
|
case FORME_PINCEAU_CARRE_TRAME:
|
||||||
|
Modifier_pinceau(Pinceau_Largeur+1,Pinceau_Hauteur+1);
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_BARRE_HORIZONTALE:
|
||||||
|
Modifier_pinceau(Pinceau_Largeur+1,1);
|
||||||
|
break;
|
||||||
|
case FORME_PINCEAU_BARRE_VERTICALE:
|
||||||
|
Modifier_pinceau(1,Pinceau_Hauteur+1);
|
||||||
|
}
|
||||||
|
Afficher_pinceau_dans_menu();
|
||||||
|
Afficher_curseur();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------- Passer … la ForeColor suivante -----------------------
|
||||||
|
void Special_Next_forecolor(void)
|
||||||
|
{
|
||||||
|
Effacer_curseur();
|
||||||
|
Encadrer_couleur_menu(CM_Noir);
|
||||||
|
|
||||||
|
Fore_color++;
|
||||||
|
|
||||||
|
Recadrer_palette();
|
||||||
|
Afficher_foreback();
|
||||||
|
|
||||||
|
Encadrer_couleur_menu(CM_Blanc);
|
||||||
|
Afficher_curseur();
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------- Passer … la ForeColor pr‚c‚dente ----------------------
|
||||||
|
void Special_Previous_forecolor(void)
|
||||||
|
{
|
||||||
|
Effacer_curseur();
|
||||||
|
Encadrer_couleur_menu(CM_Noir);
|
||||||
|
|
||||||
|
Fore_color--;
|
||||||
|
|
||||||
|
Recadrer_palette();
|
||||||
|
Afficher_foreback();
|
||||||
|
|
||||||
|
Encadrer_couleur_menu(CM_Blanc);
|
||||||
|
Afficher_curseur();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------- Passer … la BackColor suivante -----------------------
|
||||||
|
void Special_Next_backcolor(void)
|
||||||
|
{
|
||||||
|
Effacer_curseur();
|
||||||
|
Back_color++;
|
||||||
|
Afficher_foreback();
|
||||||
|
Afficher_curseur();
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------- Passer … la BackColor pr‚c‚dente ----------------------
|
||||||
|
void Special_Previous_backcolor(void)
|
||||||
|
{
|
||||||
|
Effacer_curseur();
|
||||||
|
Back_color--;
|
||||||
|
Afficher_foreback();
|
||||||
|
Afficher_curseur();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------- Scroller l'‚cran (pas en mode loupe) ------------------
|
||||||
|
void Scroller_ecran(short Decalage_en_X,short Decalage_en_Y)
|
||||||
|
{
|
||||||
|
short Decalage_temporaire_X;
|
||||||
|
short Decalage_temporaire_Y;
|
||||||
|
|
||||||
|
Decalage_temporaire_X=Principal_Decalage_X+Decalage_en_X;
|
||||||
|
Decalage_temporaire_Y=Principal_Decalage_Y+Decalage_en_Y;
|
||||||
|
|
||||||
|
if (Decalage_temporaire_X+Largeur_ecran>Principal_Largeur_image)
|
||||||
|
Decalage_temporaire_X=Principal_Largeur_image-Largeur_ecran;
|
||||||
|
if (Decalage_temporaire_Y+Menu_Ordonnee>Principal_Hauteur_image)
|
||||||
|
Decalage_temporaire_Y=Principal_Hauteur_image-Menu_Ordonnee;
|
||||||
|
if (Decalage_temporaire_X<0)
|
||||||
|
Decalage_temporaire_X=0;
|
||||||
|
if (Decalage_temporaire_Y<0)
|
||||||
|
Decalage_temporaire_Y=0;
|
||||||
|
|
||||||
|
if ( (Principal_Decalage_X!=Decalage_temporaire_X) ||
|
||||||
|
(Principal_Decalage_Y!=Decalage_temporaire_Y) )
|
||||||
|
{
|
||||||
|
Effacer_curseur();
|
||||||
|
Principal_Decalage_X=Decalage_temporaire_X;
|
||||||
|
Principal_Decalage_Y=Decalage_temporaire_Y;
|
||||||
|
|
||||||
|
Calculer_limites();
|
||||||
|
Calculer_coordonnees_pinceau();
|
||||||
|
|
||||||
|
Afficher_ecran(); // <=> Display_screen + Afficher_limites_de_l_image
|
||||||
|
Afficher_curseur();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------- Scroller la fenˆtre de la loupe --------------------
|
||||||
|
void Scroller_loupe(short Decalage_en_X,short Decalage_en_Y)
|
||||||
|
{
|
||||||
|
short Decalage_temporaire_X;
|
||||||
|
short Decalage_temporaire_Y;
|
||||||
|
|
||||||
|
Decalage_temporaire_X=Loupe_Decalage_X+Decalage_en_X;
|
||||||
|
Decalage_temporaire_Y=Loupe_Decalage_Y+Decalage_en_Y;
|
||||||
|
|
||||||
|
if (Decalage_temporaire_X+Loupe_Largeur>Principal_Largeur_image)
|
||||||
|
Decalage_temporaire_X=Principal_Largeur_image-Loupe_Largeur;
|
||||||
|
if (Decalage_temporaire_Y+Loupe_Hauteur>Principal_Hauteur_image)
|
||||||
|
Decalage_temporaire_Y=Principal_Hauteur_image-Loupe_Hauteur;
|
||||||
|
if (Decalage_temporaire_X<0)
|
||||||
|
Decalage_temporaire_X=0;
|
||||||
|
if (Decalage_temporaire_Y<0)
|
||||||
|
Decalage_temporaire_Y=0;
|
||||||
|
|
||||||
|
if ( (Loupe_Decalage_X!=Decalage_temporaire_X) ||
|
||||||
|
(Loupe_Decalage_Y!=Decalage_temporaire_Y) )
|
||||||
|
{
|
||||||
|
Effacer_curseur();
|
||||||
|
Loupe_Decalage_X=Decalage_temporaire_X;
|
||||||
|
Loupe_Decalage_Y=Decalage_temporaire_Y;
|
||||||
|
|
||||||
|
Recadrer_ecran_par_rapport_au_zoom();
|
||||||
|
|
||||||
|
Calculer_limites();
|
||||||
|
Calculer_coordonnees_pinceau();
|
||||||
|
|
||||||
|
Afficher_ecran();
|
||||||
|
Afficher_curseur();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -------------- Changer le Zoom (grƒce aux touches [+] et [-]) -------------
|
||||||
|
void Zoom(short Sens)
|
||||||
|
{
|
||||||
|
short Indice;
|
||||||
|
for (Indice=0; FACTEUR_ZOOM[Indice]!=Loupe_Facteur; Indice++);
|
||||||
|
Indice+=Sens;
|
||||||
|
|
||||||
|
if ( (Indice>=0) && (Indice<NB_FACTEURS_DE_ZOOM) )
|
||||||
|
{
|
||||||
|
Effacer_curseur();
|
||||||
|
Changer_facteur_loupe(Indice);
|
||||||
|
if (Loupe_Mode)
|
||||||
|
Afficher_ecran();
|
||||||
|
Afficher_curseur();
|
||||||
|
}
|
||||||
|
}
|
||||||
13
special.h
Normal file
13
special.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
void Modifier_pinceau(int Largeur, int Hauteur);
|
||||||
|
void Retrecir_pinceau(void);
|
||||||
|
void Grossir_pinceau(void);
|
||||||
|
|
||||||
|
void Special_Next_forecolor(void);
|
||||||
|
void Special_Previous_forecolor(void);
|
||||||
|
void Special_Next_backcolor(void);
|
||||||
|
void Special_Previous_backcolor(void);
|
||||||
|
|
||||||
|
void Scroller_ecran(short Decalage_en_X,short Decalage_en_Y);
|
||||||
|
void Scroller_loupe(short Decalage_en_X,short Decalage_en_Y);
|
||||||
|
|
||||||
|
void Zoom(short Sens);
|
||||||
213
struct.h
Normal file
213
struct.h
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
#ifndef _STRUCT_H_
|
||||||
|
#define _STRUCT_H_
|
||||||
|
|
||||||
|
#include "const.h"
|
||||||
|
|
||||||
|
// D‚claration des types de base /////////////////////////////////////////////
|
||||||
|
|
||||||
|
typedef unsigned char byte;
|
||||||
|
typedef unsigned short word;
|
||||||
|
typedef unsigned long dword;
|
||||||
|
|
||||||
|
typedef void (* fonction_action) (void);
|
||||||
|
typedef void (* fonction_afficheur) (word,word,byte);
|
||||||
|
typedef byte (* fonction_lecteur) (word,word);
|
||||||
|
typedef void (* fonction_effaceur) (byte);
|
||||||
|
typedef void (* fonction_display) (word,word,word);
|
||||||
|
typedef byte (* fonction_effet) (word,word,byte);
|
||||||
|
typedef void (* fonction_block) (word,word,word,word,byte);
|
||||||
|
typedef byte (* fonction_test_sign) (void);
|
||||||
|
typedef void (* fonction_Ligne_XOR) (word,word,word);
|
||||||
|
typedef void (* fonction_display_brush_Color) (word,word,word,word,word,word,byte,word);
|
||||||
|
typedef void (* fonction_display_brush_Mono) (word,word,word,word,word,word,byte,byte,word);
|
||||||
|
typedef void (* fonction_degrade) (long,short,short);
|
||||||
|
typedef void (* fonction_remap) (word,word,word,word,byte *);
|
||||||
|
typedef void (* fonction_procsline) (word,word,word,byte *);
|
||||||
|
typedef void (* fonction_display_zoom) (word,word,word,byte *);
|
||||||
|
typedef void (* fonction_display_brush_Color_zoom) (word,word,word,word,word,word,byte,word,byte *);
|
||||||
|
typedef void (* fonction_display_brush_Mono_zoom) (word,word,word,word,word,word,byte,byte,word,byte *);
|
||||||
|
|
||||||
|
struct Composantes
|
||||||
|
{
|
||||||
|
byte R;
|
||||||
|
byte V;
|
||||||
|
byte B;
|
||||||
|
};
|
||||||
|
typedef struct Composantes T_Palette[256];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
struct Fenetre_Bouton_normal
|
||||||
|
{
|
||||||
|
short Numero;
|
||||||
|
word Pos_X;
|
||||||
|
word Pos_Y;
|
||||||
|
word Largeur;
|
||||||
|
word Hauteur;
|
||||||
|
byte Clickable;
|
||||||
|
word Raccourci;
|
||||||
|
struct Fenetre_Bouton_normal * Next;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Fenetre_Bouton_palette
|
||||||
|
{
|
||||||
|
short Numero;
|
||||||
|
word Pos_X;
|
||||||
|
word Pos_Y;
|
||||||
|
struct Fenetre_Bouton_palette * Next;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Fenetre_Bouton_scroller
|
||||||
|
{
|
||||||
|
short Numero;
|
||||||
|
word Pos_X;
|
||||||
|
word Pos_Y;
|
||||||
|
word Hauteur;
|
||||||
|
word Nb_elements;
|
||||||
|
word Nb_visibles;
|
||||||
|
word Position;
|
||||||
|
word Hauteur_curseur;
|
||||||
|
struct Fenetre_Bouton_scroller * Next;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Fenetre_Bouton_special
|
||||||
|
{
|
||||||
|
short Numero;
|
||||||
|
word Pos_X;
|
||||||
|
word Pos_Y;
|
||||||
|
word Largeur;
|
||||||
|
word Hauteur;
|
||||||
|
struct Fenetre_Bouton_special * Next;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct T_Drive
|
||||||
|
{
|
||||||
|
char Lettre;
|
||||||
|
byte Type; // 0: Diskette 3"« / 1: Diskette 5"¬ / 2: HDD / 3: CD-ROM / 4: Logique
|
||||||
|
word Touche;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// D‚claration du type d'‚l‚ment qu'on va m‚moriser dans la liste:
|
||||||
|
struct Element_de_liste_de_fileselect
|
||||||
|
{
|
||||||
|
char Nom[13]; // Le nom du fichier ou du r‚pertoire
|
||||||
|
byte Type; // Type d'‚l‚ment : 0 = Fichier, 1 = R‚pertoire
|
||||||
|
|
||||||
|
// donn‚es de chaŒnage de la liste
|
||||||
|
struct Element_de_liste_de_fileselect * Suivant;
|
||||||
|
struct Element_de_liste_de_fileselect * Precedent;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// D‚claration d'une section d'aide:
|
||||||
|
struct Section_d_aide
|
||||||
|
{
|
||||||
|
word Nombre_de_lignes;
|
||||||
|
byte * Debut_de_la_liste; // PremiŠre ligne de la liste
|
||||||
|
};
|
||||||
|
|
||||||
|
// D‚claration d'une info sur un d‚grad‚
|
||||||
|
struct T_Degrade_Tableau
|
||||||
|
{
|
||||||
|
byte Debut; // PremiŠre couleur du d‚grad‚
|
||||||
|
byte Fin; // DerniŠre couleur du d‚grad‚
|
||||||
|
int Inverse; // "Le d‚grad‚ va de Fin … Debut"
|
||||||
|
long Melange; // Valeur de m‚lange du d‚grad‚ (0-255)
|
||||||
|
int Technique; // Technique … utiliser (0-2)
|
||||||
|
};
|
||||||
|
|
||||||
|
// D‚claration d'une info de shade
|
||||||
|
struct T_Shade
|
||||||
|
{
|
||||||
|
word Liste[512]; // Liste de couleurs
|
||||||
|
byte Pas; // Pas d'incr‚mentation/d‚cr‚mentation
|
||||||
|
byte Mode; // Mode d'utilisation (Normal/Boucle/Non-satur‚)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Structure des donn‚es dans le fichier de config.
|
||||||
|
|
||||||
|
struct Config_Mode_video
|
||||||
|
{
|
||||||
|
byte Etat;
|
||||||
|
word Largeur;
|
||||||
|
word Hauteur;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Config_Header
|
||||||
|
{
|
||||||
|
char Signature[3];
|
||||||
|
byte Version1;
|
||||||
|
byte Version2;
|
||||||
|
byte Beta1;
|
||||||
|
byte Beta2;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Config_Chunk
|
||||||
|
{
|
||||||
|
byte Numero;
|
||||||
|
word Taille;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Config_Infos_touche
|
||||||
|
{
|
||||||
|
word Numero;
|
||||||
|
word Touche;
|
||||||
|
word Touche2;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Structures utilis‚es pour les descriptions de pages et de liste de pages.
|
||||||
|
// Lorsqu'on gŠrera les animations, il faudra aussi des listes de listes de
|
||||||
|
// pages.
|
||||||
|
|
||||||
|
// Ces structures sont manipul‚es … travers des fonctions de gestion du
|
||||||
|
// backup dans "graph.c".
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
byte * Image; // Bitmap de l'image
|
||||||
|
int Largeur; // Largeur du bitmap
|
||||||
|
int Hauteur; // Hauteur du bitmap
|
||||||
|
T_Palette Palette; // Palette de l'image
|
||||||
|
|
||||||
|
char Commentaire[TAILLE_COMMENTAIRE+1]; // Commentaire de l'image
|
||||||
|
|
||||||
|
char Repertoire_fichier[256]; // |_ Nom complet =
|
||||||
|
char Nom_fichier[13]; // | Repertoire_fichier+"\"+Nom_fichier
|
||||||
|
byte Format_fichier; // Format auquel il faut lire et ‚crire le fichier
|
||||||
|
|
||||||
|
/*
|
||||||
|
short Decalage_X; // D‚calage en X de l'‚cran par rapport au d‚but de l'image
|
||||||
|
short Decalage_Y; // D‚calage en Y de l'‚cran par rapport au d‚but de l'image
|
||||||
|
short Ancien_Decalage_X; // Le mˆme avant le passage en mode loupe
|
||||||
|
short Ancien_Decalage_Y; // Le mˆme avant le passage en mode loupe
|
||||||
|
|
||||||
|
short Split; // Position en X du bord gauche du split de la loupe
|
||||||
|
short X_Zoom; // (Menu_Facteur_X) + Position en X du bord droit du split de la loupe
|
||||||
|
float Proportion_split; // Proportion de la zone non-zoom‚e par rapport … l'‚cran
|
||||||
|
|
||||||
|
byte Loupe_Mode; // On est en mode loupe
|
||||||
|
word Loupe_Facteur; // Facteur de zoom
|
||||||
|
word Loupe_Hauteur; // Largeur de la fenˆtre de zoom
|
||||||
|
word Loupe_Largeur; // Hauteur de la fenˆtre de zoom
|
||||||
|
short Loupe_Decalage_X; // Decalage horizontal de la fenˆtre de zoom
|
||||||
|
short Loupe_Decalage_Y; // Decalage vertical de la fenˆtre de zoom
|
||||||
|
*/
|
||||||
|
} S_Page;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int Taille_liste; // Nb de S_Page dans le vecteur "Pages"
|
||||||
|
int Nb_pages_allouees; // Nb de S_Page d‚signant des pages allou‚es
|
||||||
|
S_Page * Pages; // Liste de pages (Taille_liste ‚l‚ments)
|
||||||
|
} S_Liste_de_pages;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
732
tech_eng.txt
Normal file
732
tech_eng.txt
Normal file
@ -0,0 +1,732 @@
|
|||||||
|
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||||
|
³°±²Û Technical documentation for GrafX 2.00 - Version 1.08 (10/05/1997) Û²±°³
|
||||||
|
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||||
|
|
||||||
|
This file deals with:
|
||||||
|
|
||||||
|
- the PKM picture format
|
||||||
|
- the values to send to the CRTC to access all the amazing video modes
|
||||||
|
available in GrafX 2.00
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||||
|
³ °±²Û The PKM picture format - by Karl Maritaud Û²±° ³
|
||||||
|
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||||
|
|
||||||
|
|
||||||
|
First of all, I'd like to say that I made this file format some years ago
|
||||||
|
when I didn't knew how to load any good format (eg. GIF) and wanted to have
|
||||||
|
my own format.
|
||||||
|
PKM format was designed to be very simple, easy to encode and decode. Its
|
||||||
|
header is very simple (short) and evolutive.
|
||||||
|
The only real default I can find in this format is that you can only save
|
||||||
|
256-color pictures.
|
||||||
|
I know that you will think:
|
||||||
|
"Oh no just another fucking format! I'll never use it! Its compression
|
||||||
|
is too poor and I prefer GIF!".
|
||||||
|
And I'll answer:
|
||||||
|
"Yeah! You're right. But if you dunno how to load GIF and want a simple
|
||||||
|
format with a quite good compression rate (on simple pictures at least),
|
||||||
|
it could be useful."
|
||||||
|
|
||||||
|
So, here comes the format documentation...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The HEADER:
|
||||||
|
ÍÍÍÍÍÍÍÍÍÍÍ
|
||||||
|
|
||||||
|
The header is the following 780-byte-structure. (Don't worry about the size.
|
||||||
|
That's just because the palette is considered as a part of the header).
|
||||||
|
|
||||||
|
|
||||||
|
ÚÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||||
|
³ Pos ³ Field ³ Type ³ Size ³ Description ³
|
||||||
|
ÆÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍØÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͵
|
||||||
|
³ 0 ³ Signature ³ char ³ 3 ³ Constant string "PKM" (with NO size ³
|
||||||
|
³ ³ ³ ³ ³ delimitation '\0' or so...) ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 3 ³ Version ³ byte ³ 1 ³ For the moment, it can take only the ³
|
||||||
|
³ ³ ³ ³ ³ value 0. ³
|
||||||
|
³ ³ ³ ³ ³ Other packing methods may change this ³
|
||||||
|
³ ³ ³ ³ ³ field but there is only one for now... ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 4 ³ Pack_byte ³ byte ³ 1 ³ Value of the recognition byte for color ³
|
||||||
|
³ ³ ³ ³ ³ repetitions that are coded on 1 byte. ³
|
||||||
|
³ ³ ³ ³ ³ (See the picture packing section for a ³
|
||||||
|
³ ³ ³ ³ ³ better explanation) ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 5 ³ Pack_word ³ byte ³ 1 ³ Value of the recognition byte for color ³
|
||||||
|
³ ³ ³ ³ ³ repetitions that are coded on 2 bytes. ³
|
||||||
|
³ ³ ³ ³ ³ (See the picture packing section...) ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 6 ³ Width ³ word ³ 2 ³ Picture width (in pixels) ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 8 ³ Height ³ word ³ 2 ³ Picture height (in pixels) ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 10 ³ Palette ³ byte ³ 768 ³ RGB palette (RGB RGB ... 256 times) with ³
|
||||||
|
³ ³ ³ ³ ³ values from 0 to 63. I know the standard ³
|
||||||
|
³ ³ ³ ³ ³ in picture files is 0 to 255 but I find ³
|
||||||
|
³ ³ ³ ³ ³ it stupid! It is really easier to send ³
|
||||||
|
³ ³ ³ ³ ³ the whole palette in port 3C9h with a ³
|
||||||
|
³ ³ ³ ³ ³ REP OUTSB without palette convertion. ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 778 ³ PH_size ³ word ³ 2 ³ Post-header size. This is the number of ³
|
||||||
|
³ ³ ³ ³ ³ bytes between the header and the picture ³
|
||||||
|
³ ³ ³ ³ ³ data. This value can be equal to 0. ³
|
||||||
|
ÀÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||||
|
|
||||||
|
Data of type "word" are stored with Intel conventions: lower byte first.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The POST-HEADER:
|
||||||
|
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
||||||
|
|
||||||
|
The post-header has a variable size. It was designed to support new features
|
||||||
|
for this file format without changing the whole format.
|
||||||
|
|
||||||
|
It consists in field identifiers followed by their size and their value.
|
||||||
|
A field identifier is coded with 1 byte and a field size also.
|
||||||
|
|
||||||
|
|
||||||
|
These field identifiers are: (this list may be updated...)
|
||||||
|
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
|
||||||
|
|
||||||
|
0 : Comment on the picture
|
||||||
|
1 : Original screen dimensions
|
||||||
|
2 : Back color (transparent color)
|
||||||
|
|
||||||
|
If you encounter a field that you don't know just jump over it. But if a
|
||||||
|
field tells you to jump to a position that is over the beginning of the
|
||||||
|
picture data, there is an error in the file.
|
||||||
|
|
||||||
|
|
||||||
|
The fields:
|
||||||
|
ÄÄÄÄÄÄÄÄÄÄÄ
|
||||||
|
|
||||||
|
* Comment:
|
||||||
|
|
||||||
|
With this field, artists will be able to comment their pictures.
|
||||||
|
Note that GrafX 2 has a comment size limit of 32 chars. But you can
|
||||||
|
comment a picture with up to 255 chars if you make your own viewer
|
||||||
|
since GrafX 2 will just ignore extra characters.
|
||||||
|
|
||||||
|
Example: [0],[16],[Picture by X-Man]
|
||||||
|
This sequence means:
|
||||||
|
- the field is a comment
|
||||||
|
- the comment takes 16 characters (there is no end-of-string character
|
||||||
|
since you know its size)
|
||||||
|
- the comment is "Picture by X-Man"
|
||||||
|
|
||||||
|
* Original screen dimensions:
|
||||||
|
|
||||||
|
Since GrafX 2 supplies a huge range of resolutions, it seemed convenient
|
||||||
|
to add a field that indicates what were the original screen dimensions.
|
||||||
|
|
||||||
|
Example: [1],[4],[320],[256]
|
||||||
|
This sequence means:
|
||||||
|
- the field is a screen dimensions descriptor
|
||||||
|
- the dimensions are 2 words (so this value must be always equal to 4)
|
||||||
|
- the original screen width was 320 pixels
|
||||||
|
- the original screen height was 256 pixels
|
||||||
|
|
||||||
|
Note that words stored in fields are written Intel-like. The 90% BETA
|
||||||
|
version did not respect this norm. I'm really sorry about this. This is
|
||||||
|
not very serious but pictures saved with version 90% and loaded with a
|
||||||
|
latest version (91% and more) won't set the right resolution.
|
||||||
|
|
||||||
|
* Back color:
|
||||||
|
|
||||||
|
Saving the back color (transparent color) is especially useful when you
|
||||||
|
want to save a brush.
|
||||||
|
The size of this field is 1 byte (index of the color between 0 and 255).
|
||||||
|
|
||||||
|
Example: [2],[1],[255]
|
||||||
|
This sequence means:
|
||||||
|
- the field is a screen dimensions descriptor
|
||||||
|
- the value takes 1 byte
|
||||||
|
- the transparent color is 255
|
||||||
|
|
||||||
|
|
||||||
|
The PICTURE PACKING METHOD:
|
||||||
|
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
||||||
|
|
||||||
|
The PKM compression method is some sort of Run-Length-Compression which is
|
||||||
|
very efficient on pictures with long horizontal color repetitions.
|
||||||
|
Actually, the compression is efficient if there are often more than 3 times
|
||||||
|
the same color consecutively.
|
||||||
|
|
||||||
|
I think that it would be better to give you the algorithm instead of swim-
|
||||||
|
ming in incomprehensible explanations.
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
/*
|
||||||
|
functions:
|
||||||
|
Read_byte(File) reads and returns 1 byte from File
|
||||||
|
Draw_pixel(X,Y,Color) draws a pixel of a certain Color at pos. (X,Y)
|
||||||
|
File_length(File) returns the total length in bytes of File
|
||||||
|
|
||||||
|
variables:
|
||||||
|
type of Image_size is dword
|
||||||
|
type of Data_size is dword
|
||||||
|
type of Packed_data_counter is dword
|
||||||
|
type of Pixels_counter is dword
|
||||||
|
type of Color is byte
|
||||||
|
type of Byte_read is byte
|
||||||
|
type of Word_read is word
|
||||||
|
type of Counter is word
|
||||||
|
type of File is <binary file>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* At this point you've already read the header and post-header. */
|
||||||
|
|
||||||
|
Image_size <- Header.Width * Header.Height
|
||||||
|
Data_size <- File_length(File) - (780+Header.PH_size)
|
||||||
|
|
||||||
|
Packed_data_counter <- 0
|
||||||
|
Pixels_counter <- 0
|
||||||
|
|
||||||
|
/* Depacking loop: */
|
||||||
|
WHILE ((Pixels_counter<Image_size) AND (Packed_data_counter<Data_size)) DO
|
||||||
|
{
|
||||||
|
Byte_read <- Read_byte(File)
|
||||||
|
|
||||||
|
/* If it is not a packet recognizer, it's a raw pixel */
|
||||||
|
IF ((Byte_read<>Header.Pack_byte) AND (Byte_read<>Header.Pack_word))
|
||||||
|
THEN
|
||||||
|
{
|
||||||
|
Draw_pixel(Pixels_counter MOD Header.Width,
|
||||||
|
Pixels_counter DIV Header.Width,
|
||||||
|
Byte_read)
|
||||||
|
|
||||||
|
Pixels_counter <- Pixels_counter + 1
|
||||||
|
Packed_data_counter <- Packed_data_counter + 1
|
||||||
|
}
|
||||||
|
ELSE /* Is the number of pixels to repeat coded... */
|
||||||
|
{ /* ... with 1 byte */
|
||||||
|
IF (Byte_read = Header.Pack_byte) THEN
|
||||||
|
{
|
||||||
|
Color <- Read_byte(File)
|
||||||
|
Byte_read <- Read_byte(File)
|
||||||
|
|
||||||
|
FOR Counter FROM 0 TO (Byte_read-1) STEP +1
|
||||||
|
Draw_pixel((Pixels_counter+Counter) MOD Header.Width,
|
||||||
|
(Pixels_counter+Counter) DIV Header.Width,
|
||||||
|
Color)
|
||||||
|
|
||||||
|
Pixels_counter <- Pixels_counter + Byte_read
|
||||||
|
Packed_data_counter <- Packed_data_counter + 3
|
||||||
|
}
|
||||||
|
ELSE /* ... with 2 bytes */
|
||||||
|
{
|
||||||
|
Color <- Read_byte(File)
|
||||||
|
Word_read <- (word value) (Read_byte(File) SHL 8)+Read_byte(File)
|
||||||
|
|
||||||
|
FOR Counter FROM 0 TO (Word_read-1) STEP +1
|
||||||
|
Draw_pixel((Pixels_counter+Counter) MOD Header.Width,
|
||||||
|
(Pixels_counter+Counter) DIV Header.Width,
|
||||||
|
Color)
|
||||||
|
|
||||||
|
Pixels_counter <- Pixels_counter + Word_read
|
||||||
|
Packed_data_counter <- Packed_data_counter + 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
For example, the following sequence:
|
||||||
|
(we suppose that Pack_byte=01 and Pack_word=02)
|
||||||
|
04 03 01 05 06 03 02 00 01 2C
|
||||||
|
will be decoded as:
|
||||||
|
04 03 05 05 05 05 05 05 03 00 00 00 ... (repeat 0 300 times (012Ch=300))
|
||||||
|
|
||||||
|
Repetitions that fit in a word must be written with their higher byte first.
|
||||||
|
I know that it goes against Intel standard but since I read bytes from the
|
||||||
|
file thru a buffer (really faster), I don't care about the order (Sorry :)).
|
||||||
|
But words in the header and post-header must be written and read Intel-like!
|
||||||
|
|
||||||
|
|
||||||
|
Packing advices:
|
||||||
|
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
|
||||||
|
|
||||||
|
* As you can see, there could be a problem when you'd want to pack a raw
|
||||||
|
pixel with a color equal to Pack_byte or Pack_word. These pixels should
|
||||||
|
always be coded as a packet even if there is only one pixel.
|
||||||
|
|
||||||
|
Example: (we suppose that Pack_byte=9)
|
||||||
|
9 will be encoded 9,9,1 (The 1st 9 in the encoded...
|
||||||
|
9,9 will be encoded 9,9,2 ... sequence is Pack_byte)
|
||||||
|
etc...
|
||||||
|
|
||||||
|
* It seems obvious to find values for Pack_byte and Pack_word that are
|
||||||
|
(almost) never used. So a small routine that finds the 2 less used colors
|
||||||
|
in the image should be called before starting to pack the picture. This can
|
||||||
|
be done almost instantaneously in Assembler.
|
||||||
|
|
||||||
|
* When you want to pack a 2-color-sequence, just write these 2 colors one
|
||||||
|
after the other (Color,Color) because it only takes 2 bytes instead of 3 if
|
||||||
|
you had to write a packet (Pack_byte,Color,2).
|
||||||
|
|
||||||
|
* If you pack a very simple picture which has a sequence of more than 65535
|
||||||
|
same consecutive bytes, you must break the sequence and continue with a new
|
||||||
|
packet.
|
||||||
|
|
||||||
|
Example: you have to pack 65635 same consecutive bytes (eg. color 0)
|
||||||
|
(we suppose that Pack_byte=01 and Pack_word=02)
|
||||||
|
You'll write: 02 00 FF FF 01 00 64 (FFFFh=65535, 64h=100)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||||
|
³ °±²Û Setting GrafX 2.00 video modes Û²±° ³
|
||||||
|
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||||
|
|
||||||
|
|
||||||
|
All set-mode procs are in 386 ASM. Anyway, if you can't understand any
|
||||||
|
line of ASM, I really can't see the use you'll have of these procedures.
|
||||||
|
|
||||||
|
They are designed to be used in FLAT memory model. Anyway, it wouldn't
|
||||||
|
take too much time for you to adapt them to the model you use since only
|
||||||
|
memory indexations can be affected by this (so use DS:SI instead of ESI,
|
||||||
|
ES:DI instead of EDI, and beware to the address 0A0000h that will become
|
||||||
|
0A000h:0000h).
|
||||||
|
|
||||||
|
|
||||||
|
MCGA: (Standard VGA mode)
|
||||||
|
ÍÍÍÍÍ
|
||||||
|
|
||||||
|
Is there anybody in this world who still don't now how to set the MCGA
|
||||||
|
320x200 256 colors mode ??!?
|
||||||
|
Well... I hope you are a novice if you read the 2 following lines :)
|
||||||
|
|
||||||
|
|
||||||
|
mov ax,0013h
|
||||||
|
int 10h
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
X-Modes: (Extended VGA modes)
|
||||||
|
ÍÍÍÍÍÍÍÍ
|
||||||
|
|
||||||
|
Well... I think the original Mode X was 320x240 but now, many people call
|
||||||
|
"X-Modes" (or Modes X, or Tweaked modes) all the VGA modes that use more
|
||||||
|
that 64Kb of video memory with the "Unchained" structure.
|
||||||
|
Setting a pixel in any X-Mode can be done by one same function (but I
|
||||||
|
won't explain to you how to do that. You just have to tell the function what
|
||||||
|
the plane width (screen_width/4) is).
|
||||||
|
If you can't understand anything about what I say (unchained, planes...),
|
||||||
|
just read any good documentation about Mode X.
|
||||||
|
|
||||||
|
We'd like to thank the authors of XLIB2 for saving our time by having made
|
||||||
|
this useful function. We slightly optimized it for our needs but the most
|
||||||
|
important parts are here.
|
||||||
|
|
||||||
|
|
||||||
|
mov ax,13h ; Yeah! The MCGA mode again! All X-Modes must start from
|
||||||
|
int 10h ; the standard VGA mode, but many things change after.
|
||||||
|
|
||||||
|
mov dx,3C6h ; During the initialization, we'll turn the palette into
|
||||||
|
xor al,al ; black in order to avoid the user to see all our
|
||||||
|
out dx,al ; manipulations.
|
||||||
|
|
||||||
|
mov dx,3C4h ; We will inform the TIMING SEQUENCER register to switch
|
||||||
|
mov ax,0604h ; in unchained mode (mode-X), without odd/even management
|
||||||
|
out dx,ax ; and with an access to the 256Kb of the video card.
|
||||||
|
mov ax,0100h ; Now we will engage the synchronous reset of the TS
|
||||||
|
out dx,ax ; register because we're about to play with registers.
|
||||||
|
|
||||||
|
mov al,01h ; Like with the palette, we ask the video card not to
|
||||||
|
out dx,al ; peek the memory to display it anymore. Thus, it's
|
||||||
|
inc dx ; one more way to avoid interferences in the display,
|
||||||
|
in al,dx ; which happens until the mode is completely initialized
|
||||||
|
mov ah,al ; and stable. In addition, we can expect that asking a
|
||||||
|
mov al,01h ; memory reading interruption will turn the system
|
||||||
|
push ax ; faster, and thus speed up the initialization of the
|
||||||
|
mov al,ah ; graphic mode (hope makes you live :))
|
||||||
|
or al,20h ;
|
||||||
|
out dx,al ;
|
||||||
|
|
||||||
|
mov esi,X_ptr ; Pointer on the list of constants to send to the CRTC.
|
||||||
|
cld
|
||||||
|
|
||||||
|
lodsb ; This loads in AL a value that will tell what to do
|
||||||
|
; with the MISCELLANEOUS register, and increases ESI.
|
||||||
|
; The value is equal to ZERO => Nothing to do
|
||||||
|
; or ELSE => Send AL to MISCELLANEOUS
|
||||||
|
|
||||||
|
or al,al ; Shall we modify the basic video mode?
|
||||||
|
jz NoThankYou ; No?Ä¿ Actually the answer is always "Yes".
|
||||||
|
mov dx,3C2h ; ³ Except for a few modes such as
|
||||||
|
out dx,al ; ³ 320x200 in Mode X
|
||||||
|
NoThankYou: ; <ÄÄÄÙ (but our 320x200 is MCGA...)
|
||||||
|
|
||||||
|
mov dx,3C4h ; Manipulations with MISCELLANEOUS register are over, we
|
||||||
|
mov ax,0300h ; can now disengage the synchronous register of the TS.
|
||||||
|
out dx,ax
|
||||||
|
|
||||||
|
; Now, what about teasing the CRTC?
|
||||||
|
|
||||||
|
mov dx,3D4h ; In the 18th register of the CRTC, we will disengage the
|
||||||
|
mov al,11h ; protection bit. Without this, the values we would have
|
||||||
|
out dx,al ; sent to the CRTC registers would have been ignored.
|
||||||
|
inc dx
|
||||||
|
in al,dx
|
||||||
|
and al,7Fh
|
||||||
|
out dx,al
|
||||||
|
|
||||||
|
dec dx ; DX points back to the CRTC register entry
|
||||||
|
lodsb ; This loads in AL the number of CRTC registers to modify
|
||||||
|
xor ecx,ecx ; You must clear ECX before...
|
||||||
|
mov cl,al ; ... starting to repeat AL (CL) times OUTSW
|
||||||
|
rep outsw ; Let's send all the CRTC parameters!
|
||||||
|
|
||||||
|
; Just in case the 20th CRTC register would have been forgotten in the
|
||||||
|
; initialisation table, we can compute it by ourselves (Yeah, we are good
|
||||||
|
; guys).
|
||||||
|
|
||||||
|
mov ax,Screen_width ; You must tell the routine what the Screen width is
|
||||||
|
shr ax,3
|
||||||
|
mov ah,al
|
||||||
|
mov al,13h
|
||||||
|
out dx,ax
|
||||||
|
|
||||||
|
mov dx,3C4h ; Now you have the good resolution but there can be
|
||||||
|
mov ax,0F02h ; shitty pixels on the screen coming from the uncleared
|
||||||
|
out dx,ax ; memory areas.
|
||||||
|
mov edi,0A0000h ; So we'll clean memory starting from 0A0000h with the
|
||||||
|
xor eax,eax ; value 0 (which is the standard black) and on a range
|
||||||
|
mov ecx,4000h ; of 4000h dwords (256Kb).
|
||||||
|
rep stosd ; Let's wipe all this out.
|
||||||
|
|
||||||
|
mov dx,3C4h ; We can ask the VGA to read again the memory to display
|
||||||
|
pop ax ; it on the screen...
|
||||||
|
out dx,ax ;
|
||||||
|
mov dx,3C6h ; ... and turn on the palette so the picture appears to
|
||||||
|
mov al,0FFh ; the user.
|
||||||
|
out dx,al ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The table of constants you must send is one of these:
|
||||||
|
(These are tables for C but they can be easily used in other languages)
|
||||||
|
|
||||||
|
word X320Y224[] =
|
||||||
|
{ 0x0BA3, 0x6F06, 0xBA07, 0x0008, 0x4109, 0x0810, 0x8A11, 0xBF12, 0x0014,
|
||||||
|
0xC715, 0x0416, 0xE317 };
|
||||||
|
word X320Y240[] =
|
||||||
|
{ 0x0AE3, 0x0D06, 0x3E07, 0x4109, 0xEA10, 0xAC11, 0xDF12, 0x0014, 0xE715,
|
||||||
|
0x0616, 0xE317 };
|
||||||
|
word X320Y256[] =
|
||||||
|
{ 0x0CE3, 0x2306, 0xB207, 0x0008, 0x6109, 0x0A10, 0xAC11, 0xFF12, 0x2013,
|
||||||
|
0x0014, 0x0715, 0x1A16, 0xE317 };
|
||||||
|
word X320Y270[] =
|
||||||
|
{ 0x0BE7, 0x3006, 0xF007, 0x0008, 0x6109, 0x2010, 0xA911, 0x1B12, 0x0014,
|
||||||
|
0x1F15, 0x2F16, 0xE317 };
|
||||||
|
word X320Y282[] =
|
||||||
|
{ 0x0CE3, 0x6206, 0xF007, 0x6109, 0x310F, 0x3710, 0x8911, 0x3312, 0x2F13,
|
||||||
|
0x0014, 0x3C15, 0x5C16, 0xE317 };
|
||||||
|
word X320Y300[] =
|
||||||
|
{ 0x0DE3, 0x4606, 0x1F07, 0x0008, 0x4009, 0x3110, 0x8011, 0x2B12, 0x2013,
|
||||||
|
0x0014, 0x2F15, 0x4416, 0xE317 };
|
||||||
|
word X320Y360[] =
|
||||||
|
{ 0x09E3, 0x4009, 0x8810, 0x8511, 0x6712, 0x2013, 0x0014, 0x6D15, 0xBA16,
|
||||||
|
0xE317 };
|
||||||
|
word X320Y400[] =
|
||||||
|
{ 0x03E3, 0x4009, 0x0014, 0xE317 };
|
||||||
|
word X320Y448[] =
|
||||||
|
{ 0x0BA3, 0x6F06, 0xBA07, 0x0008, 0x4009, 0x0810, 0x8A11, 0xBF12, 0x0014,
|
||||||
|
0xC715, 0x0416, 0xE317 };
|
||||||
|
word X320Y480[] =
|
||||||
|
{ 0x0AE3, 0x0D06, 0x3E07, 0x4009, 0xEA10, 0xAC11, 0xDF12, 0x0014, 0xE715,
|
||||||
|
0x0616 , 0xE317};
|
||||||
|
word X320Y512[] =
|
||||||
|
{ 0x0CE3, 0x2306, 0xB207, 0x0008, 0x6009, 0x0A10, 0xAC11, 0xFF12, 0x2013,
|
||||||
|
0x0014, 0x0715, 0x1A16, 0xE317 };
|
||||||
|
word X320Y540[] =
|
||||||
|
{ 0x0BE7, 0x3006, 0xF007, 0x0008, 0x6009, 0x2010, 0xA911, 0x1B12, 0x0014,
|
||||||
|
0x1F15, 0x2F16, 0xE317 };
|
||||||
|
word X320Y564[] =
|
||||||
|
{ 0x0CE7, 0x6206, 0xF007, 0x0008, 0x6009, 0x3E10, 0x8911, 0x3312, 0x2013,
|
||||||
|
0x0014, 0x3C15, 0x5C16, 0xE317 };
|
||||||
|
word X320Y600[] =
|
||||||
|
{ 0x0BE7, 0xBE06, 0xF007, 0x0008, 0x6009, 0x7C10, 0x8C11, 0x5712, 0x0014,
|
||||||
|
0x5815, 0x7016, 0xE317 };
|
||||||
|
word X360Y200[] =
|
||||||
|
{ 0x09E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x2D13, 0x0014,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y224[] =
|
||||||
|
{ 0x12A7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x6F06, 0xBA07,
|
||||||
|
0x0008, 0x4109, 0x0810, 0x8A11, 0xBF12, 0x2D13, 0x0014, 0xC715, 0x0416,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y240[] =
|
||||||
|
{ 0x11E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x0D06, 0x3E07,
|
||||||
|
0x4109, 0xEA10, 0xAC11, 0xDF12, 0x2D13, 0x0014, 0xE715, 0x0616, 0xE317 };
|
||||||
|
word X360Y256[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6109, 0x0E10, 0xAC11, 0xFF12, 0x2D13, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y270[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x3006, 0xF007,
|
||||||
|
0x0008, 0x6109, 0x2010, 0xA911, 0x1B12, 0x2D13, 0x0014, 0x1F15, 0x2F16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y282[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x6206, 0xF007,
|
||||||
|
0x6109, 0x310F, 0x3710, 0x8911, 0x3312, 0x2D13, 0x0014, 0x3C15, 0x5C16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y300[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x4606, 0x1F07,
|
||||||
|
0x0008, 0x4009, 0x3110, 0x8011, 0x2B12, 0x2D13, 0x0014, 0x2F15, 0x4416,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y360[] =
|
||||||
|
{ 0x0FE7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x4009, 0x8810,
|
||||||
|
0x8511, 0x6712, 0x2D13, 0x0014, 0x6D15, 0xBA16, 0xE317 };
|
||||||
|
word X360Y400[] =
|
||||||
|
{ 0x0AE7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x4009, 0x2D13,
|
||||||
|
0x0014, 0xE317 };
|
||||||
|
word X360Y448[] =
|
||||||
|
{ 0x12A7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x6F06, 0xBA07,
|
||||||
|
0x0008, 0x4009, 0x0810, 0x8A11, 0xBF12, 0x2D13, 0x0014, 0xC715, 0x0416,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y480[] =
|
||||||
|
{ 0x11E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x0D06, 0x3E07,
|
||||||
|
0x4009, 0xEA10, 0xAC11, 0xDF12, 0x2D13, 0x0014, 0xE715, 0x0616, 0xE317 };
|
||||||
|
word X360Y512[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6009, 0x0E10, 0xAC11, 0xff12, 0x2D13, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y540[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x3006, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x2010, 0xA911, 0x1B12, 0x2D13, 0x0014, 0x1F15, 0x2F16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y564[] =
|
||||||
|
{ 0x12EB, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x6206, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x3E10, 0x8911, 0x3312, 0x2D13, 0x0014, 0x3C15, 0x5C16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y600[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0xBE06, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x7C10, 0x8C11, 0x5712, 0x2D13, 0x0014, 0x5815, 0x7016,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y200[] =
|
||||||
|
{ 0x09E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x3213, 0x0014,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y224[] =
|
||||||
|
{ 0x12A7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x6F06, 0xBA07,
|
||||||
|
0x0008, 0x4109, 0x0810, 0x8A11, 0xBF12, 0x3213, 0x0014, 0xC715, 0x0416,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y240[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x0D06, 0x3E07,
|
||||||
|
0x0008, 0x4109, 0xEA10, 0xAC11, 0xDF12, 0x3213, 0x0014, 0xE715, 0x0616,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y256[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6109, 0x1310, 0xAC11, 0xFF12, 0x3213, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y270[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x3006, 0xF007,
|
||||||
|
0x0008, 0x6109, 0x2010, 0xA911, 0x1B12, 0x3213, 0x0014, 0x1F15, 0x2F16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y282[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x6206, 0xF007,
|
||||||
|
0x6109, 0x310F, 0x3710, 0x8911, 0x3312, 0x3213, 0x0014, 0x3C15, 0x5C16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y300[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x4606, 0x1F07,
|
||||||
|
0x0008, 0x4009, 0x3110, 0x8011, 0x2B12, 0x3213, 0x0014, 0x2F15, 0x4416,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y360[] =
|
||||||
|
{ 0x0FE7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x4009, 0x8810,
|
||||||
|
0x8511, 0x6712, 0x3213, 0x0014, 0x6D15, 0xBA16, 0xE317 };
|
||||||
|
word X400Y400[] =
|
||||||
|
{ 0x0AE7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x4009, 0x3213,
|
||||||
|
0x0014, 0xE317 };
|
||||||
|
word X400Y448[] =
|
||||||
|
{ 0x12A7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x6F06, 0xBA07,
|
||||||
|
0x0008, 0x4009, 0x0810, 0x8A11, 0xBF12, 0x3213, 0x0014, 0xC715, 0x0416,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y480[] =
|
||||||
|
{ 0x11E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x0D06, 0x3E07,
|
||||||
|
0x4009, 0xEA10, 0xAC11, 0xDF12, 0x3213, 0x0014, 0xE715, 0x0616, 0xE317 };
|
||||||
|
word X400Y512[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6009, 0x1310, 0xAC11, 0xFF12, 0x3213, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y540[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x3006, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x2010, 0xA911, 0x1B12, 0x3213, 0x0014, 0x1F15, 0x2F16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y564[] =
|
||||||
|
{ 0x12EB, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x6206, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x3E10, 0x8911, 0x3312, 0x3213, 0x0014, 0x3C15, 0x5C16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y600[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0xBE06, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x7C10, 0x8C11, 0x5712, 0x3213, 0x0014, 0x5815, 0x7016,
|
||||||
|
0xE317 };
|
||||||
|
|
||||||
|
|
||||||
|
The structure: (example)
|
||||||
|
|
||||||
|
ÚÄÄÄÄThis is the number of values to send to the CRTC registers. This
|
||||||
|
³ is actually the number of words in the tables minus 1 (because the
|
||||||
|
³ 1st word of the table is not sent to the CRTC but contains a value
|
||||||
|
³ to send to the MISCELLANEOUS register and the number of values to
|
||||||
|
³ send to the CRTC registers ;) ).
|
||||||
|
³
|
||||||
|
³ ÚÄÄThis is the value to send to the MISCEALLANEOUS register (or ZERO
|
||||||
|
³ ³ if no value must be sent to it).
|
||||||
|
³ ³
|
||||||
|
³ ³ ÚÄÄÄThis is a value to send to a register of the CRTC.
|
||||||
|
³ ³ ³
|
||||||
|
³ ³ ³ ÚÄThis is the index of the CRTC register that will receive
|
||||||
|
³ ³ ³ ³ the value.
|
||||||
|
ÿÿ ÿÿ
|
||||||
|
{ 0x0AE3, 0x0D06, 0x3E07, 0x4109, 0xEA10, 0xAC11, 0xDF12, 0x0014, 0xE715,
|
||||||
|
0x0616, 0xE317 };
|
||||||
|
|
||||||
|
You can notice that CRTC registers 0 to 5 (and 13h) define the screen
|
||||||
|
width while registers 6 to 17h (except 13h) define the screen height.
|
||||||
|
|
||||||
|
|
||||||
|
We have more modes in our pocket than the "few" :) ones we included in
|
||||||
|
GrafX 2.00, but they aren't really useful or stable. But we may decice to
|
||||||
|
include them anyway in a next version.
|
||||||
|
If some of your favourite modes are missing, just send us the list of
|
||||||
|
constants we must shoot at the CRTC just following the structure we use
|
||||||
|
above.
|
||||||
|
|
||||||
|
IMPORTANT! The constant values listed above are not supported by every
|
||||||
|
monitor or video card.
|
||||||
|
We have tested GrafX2 with several different configurations and
|
||||||
|
we constated that some modes don't work at all with some video
|
||||||
|
cards while some others can be overscanned, out of center, dark,
|
||||||
|
too bright, or shrunk.
|
||||||
|
But they all work fine with our poor little Tseng Labs ET4000...
|
||||||
|
|
||||||
|
If you already have a good knowledge about CRTC and have different values
|
||||||
|
than ours for certain modes, please let us know. We'll use them if they work
|
||||||
|
better with a majority of computers.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
VESA: (A "pseudo-standard" for Super-VGA modes)
|
||||||
|
ÍÍÍÍÍ
|
||||||
|
|
||||||
|
We use VESA for modes that require a width of 640, 800 or 1024 pixels.
|
||||||
|
But there is a way to combine X-Modes height with VESA so it's possible to
|
||||||
|
have modes as weird as in X-Mode.
|
||||||
|
|
||||||
|
|
||||||
|
mov ax,4F02h
|
||||||
|
mov bx,Video_mode
|
||||||
|
int 10h
|
||||||
|
|
||||||
|
|
||||||
|
256-color-VESA video modes are:
|
||||||
|
100h : 640x400
|
||||||
|
101h : 640x480
|
||||||
|
103h : 800x600
|
||||||
|
105h : 1024x768
|
||||||
|
107h : 1280x1024 (not available in GrafX2 because only supported with
|
||||||
|
video cards with 2 or more Megabytes of video memory)
|
||||||
|
|
||||||
|
|
||||||
|
As with X-Modes, you can modify CRTC registers to access "Xtd-VESA" modes!
|
||||||
|
(Note that some video cards don't support the modification of the VGA CRTC
|
||||||
|
registers in VESA modes.)
|
||||||
|
|
||||||
|
|
||||||
|
To enter these extended VESA modes, set a standard VESA mode with the right
|
||||||
|
width, and then call Modify_CRTC_registers with the proper Height table.
|
||||||
|
|
||||||
|
Example (640x512) :
|
||||||
|
VESA_Set_mode(101h) /* Set a video mode with the same width */
|
||||||
|
Modify_CRTC_registers(Y512) /* Modify height */
|
||||||
|
|
||||||
|
|
||||||
|
* Height tables:
|
||||||
|
|
||||||
|
word Y224[] =
|
||||||
|
{ 0x09A3, 0x6F06, 0xBA07, 0x0008, 0x4109, 0x0810, 0x8A11, 0xBF12, 0xC715,
|
||||||
|
0x0416 };
|
||||||
|
word Y240[] =
|
||||||
|
{ 0x09E3, 0x0D06, 0x3E07, 0x0008, 0x4109, 0xEA10, 0xAC11, 0xDF12, 0xE715,
|
||||||
|
0x0616 };
|
||||||
|
word Y256[] =
|
||||||
|
{ 0x0900, 0x2B06, 0xB207, 0x0008, 0x6109, 0x0A10, 0xAC11, 0xFF12, 0x0715,
|
||||||
|
0x1A16 };
|
||||||
|
word Y270[] =
|
||||||
|
{ 0x09E7, 0x3006, 0xF007, 0x0008, 0x6109, 0x2010, 0xA911, 0x1B12, 0x1F15,
|
||||||
|
0x2F16 };
|
||||||
|
word Y282[] =
|
||||||
|
{ 0x0AE3, 0x6206, 0xF007, 0x0008, 0x6109, 0x310F, 0x3710, 0x8911, 0x3312,
|
||||||
|
0x3C15, 0x5C16 };
|
||||||
|
word Y300[] =
|
||||||
|
{ 0x09E3, 0x4606, 0x1F07, 0x0008, 0x4009, 0x3110, 0x8011, 0x2B12, 0x2F15,
|
||||||
|
0x4416 };
|
||||||
|
word Y350[] =
|
||||||
|
{ 0x09A3, 0xBF06, 0x1F07, 0x0008, 0x4009, 0x8310, 0x8511, 0x5D12, 0x6315,
|
||||||
|
0xBA16 };
|
||||||
|
word Y360[] =
|
||||||
|
{ 0x07E3, 0x0008, 0x4009, 0x8810, 0x8511, 0x6712, 0x6D15, 0xBA16 };
|
||||||
|
word Y400[] =
|
||||||
|
{ 0x01E3, 0x4009 };
|
||||||
|
word Y448[] =
|
||||||
|
{ 0x09A3, 0x6F06, 0xBA07, 0x0008, 0x4009, 0x0810, 0x8A11, 0xBF12, 0xC715,
|
||||||
|
0x0416 };
|
||||||
|
word Y480[] =
|
||||||
|
{ 0x09E3, 0x0D06, 0x3E07, 0x0008, 0x4009, 0xEA10, 0xAC11, 0xDF12, 0xE715,
|
||||||
|
0x0616 };
|
||||||
|
word Y512[] =
|
||||||
|
{ 0x0900, 0x2B06, 0xB207, 0x0008, 0x6009, 0x0A10, 0xAC11, 0xFF12, 0x0715,
|
||||||
|
0x1A16 };
|
||||||
|
word Y540[] =
|
||||||
|
{ 0x09E7, 0x3006, 0xF007, 0x0008, 0x6009, 0x2010, 0xA911, 0x1B12, 0x1F15,
|
||||||
|
0x2F16 };
|
||||||
|
word Y564[] =
|
||||||
|
{ 0x09E7, 0x6206, 0xF007, 0x0008, 0x6009, 0x3E10, 0x8911, 0x3312, 0x3C15,
|
||||||
|
0x5C16 };
|
||||||
|
word Y600[] =
|
||||||
|
{ 0x09E7, 0xBE06, 0xF007, 0x0008, 0x6009, 0x7C10, 0x8C11, 0x5712, 0x5815,
|
||||||
|
0x7016 };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Modifying CRTC registers: (inspired by X-Modes init... See above for more
|
||||||
|
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ details or comments)
|
||||||
|
|
||||||
|
mov esi,XVESA_Ptr
|
||||||
|
cld
|
||||||
|
|
||||||
|
lodsb
|
||||||
|
or al,al ; Shall we modify the basic video mode?
|
||||||
|
jz NoThankYou ; No?Ä¿ The answer can be "No" because initialisations
|
||||||
|
mov dx,3C2h ; ³ of certain VESA modes directly set the right
|
||||||
|
out dx,al ; ³ value for the Miscellaneous register.
|
||||||
|
NoThankYou: ; <ÄÄÄÙ
|
||||||
|
|
||||||
|
mov dx,3D4h
|
||||||
|
mov al,11h
|
||||||
|
out dx,al
|
||||||
|
inc dx
|
||||||
|
in al,dx
|
||||||
|
and al,7Fh
|
||||||
|
out dx,al
|
||||||
|
|
||||||
|
dec dx
|
||||||
|
lodsb
|
||||||
|
xor ecx,ecx
|
||||||
|
mov cl,al
|
||||||
|
rep outsw
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If you are cunning enough, you'll be able to combine constants used in
|
||||||
|
X-Modes to get more "Xtd-VESA" modes such as 640x200, 800x480, etc...
|
||||||
|
(but I don't think this will work with 1024x??? because this mode is
|
||||||
|
generally interlaced... But who knows?...)
|
||||||
|
The most difficult is to find the right value for the MISCELLANEOUS
|
||||||
|
register.
|
||||||
769
tech_fra.txt
Normal file
769
tech_fra.txt
Normal file
@ -0,0 +1,769 @@
|
|||||||
|
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||||
|
³°±²Û Doc. technique pour GrafX 2.00 - Version 1.08 (5 octobre 1997) Û²±°³
|
||||||
|
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||||
|
|
||||||
|
Ce fichier traite:
|
||||||
|
|
||||||
|
- du format d'image PKM
|
||||||
|
- des valeurs … envoyer au CRTC pour avoir accŠs … tous les modes vid‚os
|
||||||
|
incroyables disponibles dans GrafX 2.00
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||||
|
³ °±²Û Le format d'image PKM - par Karl Maritaud Û²±° ³
|
||||||
|
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||||
|
|
||||||
|
|
||||||
|
Tout d'abord, je tiens a dire que j'ai cr‚‚ ce format il y a d‚j… quelques
|
||||||
|
ann‚es, … l'‚poque o— je ne savais pas comment charger les meilleurs formats
|
||||||
|
(GIF par exemple) et que je voulais ‚galement avoir mon propre format.
|
||||||
|
Le format PKM a ‚t‚ con‡u pour ˆtre trŠs simple, facile … encoder et …
|
||||||
|
d‚coder. De plus, son header est trŠs simple (court) et evolutif.
|
||||||
|
Le seul vrai d‚faut que je puisse y trouver est que l'on ne peut sauver
|
||||||
|
des images qu'en 256 couleurs.
|
||||||
|
Je sais que vous allez vous dire:
|
||||||
|
"Oh non! Encore un nouveau format … la con! J'm'en servirai jamais! En
|
||||||
|
plus le taux de compression est naze! Je prefŠre le GIF!".
|
||||||
|
Et je r‚pondrai:
|
||||||
|
"Ouais! T'as raison. Mais si tu ne sais pas comment charger du GIF et
|
||||||
|
que tu veux un format simple avec une compression correcte (du moins sur
|
||||||
|
les images simples), il peut ˆtre utile."
|
||||||
|
|
||||||
|
Donc, voici la documentation de ce format...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Le HEADER:
|
||||||
|
ÍÍÍÍÍÍÍÍÍÍ
|
||||||
|
|
||||||
|
Le header est la structure de 780 octets suivante. (Ne vous inqui‚tez pas …
|
||||||
|
propos de la taille. C'est tout simplement parce que la palette fait partie
|
||||||
|
du header).
|
||||||
|
|
||||||
|
|
||||||
|
ÚÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||||
|
³ Pos ³ Champ ³ Type ³Taille³ Description ³
|
||||||
|
ÆÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍØÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͵
|
||||||
|
³ 0 ³ Signature ³ char ³ 3 ³ ChaŒne constante "PKM" (SANS d‚limitation³
|
||||||
|
³ ³ ³ ³ ³ de taille '\0' ou autres...) ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 3 ³ Version ³ byte ³ 1 ³ Pour le moment, ce champ ne peut prendre ³
|
||||||
|
³ ³ ³ ³ ³ que la valeur 0. ³
|
||||||
|
³ ³ ³ ³ ³ D'autres m‚thodes de compression pourront³
|
||||||
|
³ ³ ³ ³ ³ la modifier mais pour l'instant il n'y en³
|
||||||
|
³ ³ ³ ³ ³ a qu'une seule. ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 4 ³ Pack_byte ³ byte ³ 1 ³ Valeur de l'octet de reconnaissance pour ³
|
||||||
|
³ ³ ³ ³ ³ les r‚p‚titions de couleurs cod‚es sur 1 ³
|
||||||
|
³ ³ ³ ³ ³ Octet. (Voir la section sur la m‚thode de³
|
||||||
|
³ ³ ³ ³ ³ compression pour plus d'informations) ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 5 ³ Pack_word ³ byte ³ 1 ³ Valeur de l'octet de reconnaissance pour ³
|
||||||
|
³ ³ ³ ³ ³ les r‚p‚titions de couleurs cod‚es sur 2 ³
|
||||||
|
³ ³ ³ ³ ³ Octets. (Voir la section sur la m‚thode ³
|
||||||
|
³ ³ ³ ³ ³ de compression pour plus d'informations) ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 6 ³ Largeur ³ word ³ 2 ³ Largeur de l'image (en pixels) ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 8 ³ Hauteur ³ word ³ 2 ³ Hauteur de l'image (en pixels) ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 10 ³ Palette ³ byte ³ 768 ³ Palette RGB (RGB RGB ... 256 fois) avec ³
|
||||||
|
³ ³ ³ ³ ³ des valeurs de 0 … 63. Je sais que le ³
|
||||||
|
³ ³ ³ ³ ³ standard dans les fichiers d'images est ³
|
||||||
|
³ ³ ³ ³ ³ de 0 … 255 mais je trouve ‡a cr‚tin! ³
|
||||||
|
³ ³ ³ ³ ³ C'est tellement plus simple d'envoyer la ³
|
||||||
|
³ ³ ³ ³ ³ palette toute entiŠre dans le port 3C9h ³
|
||||||
|
³ ³ ³ ³ ³ avec un REP OUTSB sans avoir … convertir ³
|
||||||
|
³ ³ ³ ³ ³ la palette. ³
|
||||||
|
ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||||
|
³ 778 ³ Taille_PH ³ word ³ 2 ³ Taille du Post-header. C'est le nombre ³
|
||||||
|
³ ³ ³ ³ ³ d'octets entre le header et les donn‚es ³
|
||||||
|
³ ³ ³ ³ ³ de l'image. Cette valeur peut valoir 0. ³
|
||||||
|
ÀÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||||
|
|
||||||
|
Les donn‚es du type "word" sont stock‚es selon les conventions d'Intel:
|
||||||
|
c'est-…-dire l'octet de poids le plus faible en premier.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Le POST-HEADER:
|
||||||
|
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
||||||
|
|
||||||
|
Le post-header a une taille variable. Il a ‚t‚ con‡u pour supporter les
|
||||||
|
nouvelles fonctions de ce format sans avoir a changer complŠtement le format.
|
||||||
|
|
||||||
|
Il est constitu‚ d'identificateurs de champ suivis par leur taille et leur
|
||||||
|
contenu.
|
||||||
|
Un identificateur de champ est cod‚ sur 1 octet ainsi que sa taille.
|
||||||
|
|
||||||
|
|
||||||
|
Ces identificateurs de champ sont: (cette liste peut ˆtre rallong‚e...)
|
||||||
|
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
|
||||||
|
|
||||||
|
0 : Commentaire sur l'image
|
||||||
|
1 : Dimensions de l'‚cran d'origine
|
||||||
|
2 : Couleur de fond (couleur de transparence)
|
||||||
|
|
||||||
|
Si vous rencontrez un champ inconnu par votre routine de chargment, sautez
|
||||||
|
simplement au del…. Mais, par contre, si un champ vous dit de sauter … une
|
||||||
|
position qui tombe aprŠs le d‚but th‚orique des donn‚es de l'image, alors
|
||||||
|
c'est qu'il y a une erreur dans le fichier.
|
||||||
|
|
||||||
|
|
||||||
|
Les champs:
|
||||||
|
ÄÄÄÄÄÄÄÄÄÄÄ
|
||||||
|
|
||||||
|
* Commentaire:
|
||||||
|
|
||||||
|
Grƒce … ce champ, les artistes vont pouvoir commenter leurs dessins.
|
||||||
|
Notez que GrafX 2 a une taille limite de commentaire de 32 caractŠres.
|
||||||
|
Mais vous pourrez avoir des commentaires allant jusqu'… 255 caractŠres
|
||||||
|
si vous cr‚ez votre propre viewer puisque GrafX 2 ignorera simplement
|
||||||
|
les caractŠres en trop.
|
||||||
|
|
||||||
|
Exemple: [0],[15],[Dessin de X-Man]
|
||||||
|
Cette s‚quence signifie:
|
||||||
|
- le champ est un commentaire
|
||||||
|
- le commentaire a une taille de 15 caractŠres (il n'y a pas de
|
||||||
|
caractŠre de fin de chaŒne puisque vous connaissez sa taille)
|
||||||
|
- le commentaire est "Dessin de X-Man"
|
||||||
|
|
||||||
|
* Dimensions de l'‚cran d'origine:
|
||||||
|
|
||||||
|
Puisque GrafX 2 propose un ‚norme choix de r‚solutions, il a sembl‚
|
||||||
|
pratique d'ajouter un champ indicant quelles ‚taient les dimensions de
|
||||||
|
l'‚cran d'origine.
|
||||||
|
|
||||||
|
Exemple: [1],[4],[320],[256]
|
||||||
|
Cette s‚quence signifie:
|
||||||
|
- Le champ d‚crit les dimensions de l'‚cran d'origine
|
||||||
|
- Les dimensions sont 2 words (donc cette valeur doit ˆtre ‚gale … 4)
|
||||||
|
- La largeur de l'‚cran d'origine ‚tait de 320 pixels
|
||||||
|
- La hauteur de l'‚cran d'origine ‚tait de 256 pixels
|
||||||
|
|
||||||
|
Notez que les words stock‚s dans les champs sont ‚crits … la maniŠre
|
||||||
|
Intel. La BETA-version 90% ne respectait pas cette norme (d‚sol‚).
|
||||||
|
Ce n'est pas bien grƒve mais les images sauv‚es avec la version 90% et
|
||||||
|
recharg‚es avec une version post‚rieure (91% et plus) ne passeront pas
|
||||||
|
dans la bonne r‚solution.
|
||||||
|
|
||||||
|
* Couleur de fond:
|
||||||
|
|
||||||
|
Enregistrer la couleur de fond (couleur de transparence) se r‚vŠle
|
||||||
|
particuliŠrement utile lorsque vous voulez sauvegarder une brosse.
|
||||||
|
La taille de ce champ est 1 octet (indice de la couleur entre 0 et 255).
|
||||||
|
|
||||||
|
Exemple: [2],[1],[255]
|
||||||
|
Cette s‚quence signifie:
|
||||||
|
- le champ d‚crit la couleur de fond
|
||||||
|
- la valeur prend 1 octet
|
||||||
|
- La couleur de transparence est 255
|
||||||
|
|
||||||
|
|
||||||
|
La METHODE DE COMPACTAGE DE L'IMAGE:
|
||||||
|
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
||||||
|
|
||||||
|
La m‚thode de compression PKM est une sorte de "Run-Length-Compression" qui
|
||||||
|
est trŠs efficace sur les images comportant de longues r‚p‚titions d'une mˆme
|
||||||
|
couleur horizontalement.
|
||||||
|
En fait la compression commence … ˆtre efficace s'il y a souvent plus de 3
|
||||||
|
fois la mˆme couleur cons‚cutivement.
|
||||||
|
|
||||||
|
Je pense qu'il est pr‚f‚rable de vous donner directement l'algorithme plut“t
|
||||||
|
que de nager dans des explications incomprehensibles.
|
||||||
|
|
||||||
|
|
||||||
|
DEBUT
|
||||||
|
/*
|
||||||
|
fonctions:
|
||||||
|
Lire_octet(Fichier) Lit et retourne 1 octet … partir de
|
||||||
|
Fichier
|
||||||
|
Dessiner_pixel(X,Y,Couleur) Dessine un pixel d'une certaine Couleur
|
||||||
|
… la position (X,Y)
|
||||||
|
Taille_fichier(Fichier) Retourne la taille totale d'un Fichier
|
||||||
|
en octets
|
||||||
|
|
||||||
|
variables:
|
||||||
|
le type de Taille_image est dword
|
||||||
|
le type de Taille_donnees est dword
|
||||||
|
le type de Compteur_donnees est dword
|
||||||
|
le type de Compteur_pixels est dword
|
||||||
|
le type de Couleur est byte
|
||||||
|
le type de Octet_lu est byte
|
||||||
|
le type de Word_lu est word
|
||||||
|
le type de Compteur est word
|
||||||
|
le type de Fichier est <fichier binaire>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* A cet endroit, le header et le post-header ont d‚j… ‚t‚ lus. */
|
||||||
|
|
||||||
|
Taille_image <- Header.Largeur * Header.Hauteur
|
||||||
|
Taille_donnees <- Taille_fichier(Fichier) - (780+Header.Taille_PH)
|
||||||
|
|
||||||
|
Compteur_donnees <- 0
|
||||||
|
Compteur_pixels <- 0
|
||||||
|
|
||||||
|
/* Boucle de d‚compression: */
|
||||||
|
TANT QUE ((Compteur_pixels<Taille_image)
|
||||||
|
ET (Compteur_donnees<Taille_donnees)) FAIRE
|
||||||
|
{
|
||||||
|
Octet_lu <- Lire_octet(Fichier)
|
||||||
|
|
||||||
|
/* Si pas un octet de reconnaissance de paquet, c'est un pixel brut */
|
||||||
|
SI ((Octet_lu<>Header.Pack_byte) ET (Octet_lu<>Header.Pack_word))
|
||||||
|
ALORS
|
||||||
|
{
|
||||||
|
Dessiner_pixel(Compteur_pixels MOD Header.Largeur,
|
||||||
|
Compteur_pixels DIV Header.Largeur,
|
||||||
|
Octet_lu)
|
||||||
|
|
||||||
|
Compteur_pixels <- Compteur_pixels + 1
|
||||||
|
Compteur_donnees <- Compteur_donnees + 1
|
||||||
|
}
|
||||||
|
SINON /* Est-ce que le nombre de pixels … r‚p‚ter est cod‚... */
|
||||||
|
{ /* ... sur 1 octet ? */
|
||||||
|
SI (Octet_lu = Header.Pack_byte) ALORS
|
||||||
|
{
|
||||||
|
Couleur <- Lire_octet(Fichier)
|
||||||
|
Octet_lu <- Lire_octet(Fichier)
|
||||||
|
|
||||||
|
POUR Compteur ALLANT DE 0 A (Octet_lu-1) PAR PAS DE +1
|
||||||
|
Dessiner_pixel((Compteur_pixels+Compteur) MOD Header.Largeur,
|
||||||
|
(Compteur_pixels+Compteur) DIV Header.Largeur,
|
||||||
|
Couleur)
|
||||||
|
|
||||||
|
Compteur_pixels <- Compteur_pixels + Octet_lu
|
||||||
|
Compteur_donnees <- Compteur_donnees + 3
|
||||||
|
}
|
||||||
|
SINON /* ... sur 2 octets ? */
|
||||||
|
{
|
||||||
|
Couleur <- Lire_octet(Fichier)
|
||||||
|
Word_lu <- (word) (Lire_octet(Fichier) SHL 8)+Lire_octet(Fichier)
|
||||||
|
|
||||||
|
POUR Compteur ALLANT DE 0 A (Word_lu-1) PAR PAS DE +1
|
||||||
|
Dessiner_pixel((Compteur_pixels+Compteur) MOD Header.Largeur,
|
||||||
|
(Compteur_pixels+Compteur) DIV Header.Largeur,
|
||||||
|
Couleur)
|
||||||
|
|
||||||
|
Compteur_pixels <- Compteur_pixels + Word_lu
|
||||||
|
Compteur_donnees <- Compteur_donnees + 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FIN
|
||||||
|
|
||||||
|
|
||||||
|
Par exemple, la s‚quence suivante:
|
||||||
|
(on suppose que Pack_byte=01 et Pack_word=02)
|
||||||
|
04 03 01 05 06 03 02 00 01 2C
|
||||||
|
sera d‚cod‚e comme:
|
||||||
|
04 03 05 05 05 05 05 05 03 00 00 00 ... (rep‚ter 0 300 fois (012Ch=300))
|
||||||
|
|
||||||
|
Les r‚p‚titions qui tiennent sur un word doivent ˆtre ‚crites avec leur
|
||||||
|
octet de poids le plus fort en premier. Je sais que ‡a va … l'encontre du
|
||||||
|
standard Intel mais puisque je lis les octets du fichier au travers d'un
|
||||||
|
buffer (franchement plus rapide), Je me fous complŠtement de l'ordre
|
||||||
|
(D‚sol‚ :)). Mais les words du header et du post-header doivent ˆtre ‚crits
|
||||||
|
et lus … la maniŠre Intel!
|
||||||
|
|
||||||
|
|
||||||
|
Conseils de compactage:
|
||||||
|
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
|
||||||
|
|
||||||
|
* Comme vous pouvez le constater, il pourrait y avoir un problŠme lorsque
|
||||||
|
vous devriez compacter un pixel brut de couleur ‚gale … Pack_byte ou …
|
||||||
|
Pack_word. Ces pixels doivent toujours ˆtre cod‚s comme des paquets mˆme
|
||||||
|
s'il n'y a qu'un seul pixel.
|
||||||
|
|
||||||
|
Exemple: (supposons que Pack_byte=9)
|
||||||
|
9 sera encod‚ 9,9,1 (Le 1er 9 dans la s‚quence...
|
||||||
|
9,9 sera encod‚ 9,9,2 ... encod‚e est Pack_byte)
|
||||||
|
etc...
|
||||||
|
|
||||||
|
* Il semble ‚vident de trouver des valeurs pour Pack_byte et Pack_word qui
|
||||||
|
ne sont jamais (ou presque) utilis‚es. Donc, une petite routine qui trouve
|
||||||
|
les 2 couleurs les moins utilis‚es dans l'image devrait ˆtre appel‚e avant
|
||||||
|
de commencer la compression. Ceci peut ˆtre r‚alis‚ presque instantan‚ment
|
||||||
|
en Assembleur.
|
||||||
|
|
||||||
|
* Quand vous voulez ‚crire une s‚quence de 2 couleurs identiques, ‚crivez
|
||||||
|
simplement ces 2 couleurs l'une aprŠs l'autre (Couleur,Couleur) puisque ‡a
|
||||||
|
ne prend que 2 octets au lieu de 3 si vous aviez ‚crit un paquet (Pack_byte,
|
||||||
|
Couleur,2).
|
||||||
|
|
||||||
|
* Si vous compressez une image extrˆmement simple qui comporte une s‚quence
|
||||||
|
de plus de 65535 fois la mˆme couleur cons‚cutivement, vous devez "casser"
|
||||||
|
la s‚quence et continuer avec un nouveau paquet.
|
||||||
|
|
||||||
|
Exemple: vous devez compacter les 65635 mˆmes octets cons‚cutifs (de
|
||||||
|
couleur 0 par exemple)
|
||||||
|
(On suppose que Pack_byte=01 et Pack_word=02)
|
||||||
|
Vous devrez alors ‚crire: 02 00 FF FF 01 00 64 (FFFFh=65535, 64h=100)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||||
|
³ °±²Û Passer dans les modes vid‚os de GrafX 2.00 Û²±° ³
|
||||||
|
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||||
|
|
||||||
|
|
||||||
|
Toutes les proc‚dures d'initialisation de mode sont ‚crites en ASM 386. De
|
||||||
|
toutes fa‡ons, si vous ne comprenez pas une ligne d'ASM, je ne vois vraiment
|
||||||
|
pas … quoi pourront vous servir ces proc‚dures.
|
||||||
|
|
||||||
|
Elles ont ‚t‚ con‡ues pour ˆtre utilis‚es dans le modŠle de m‚moire FLAT.
|
||||||
|
Mais cela ne devrait pas vous prendre trop de temps de les adapter au modŠle
|
||||||
|
que vous souhaitez utiliser puisqu'il n'y a que les manipulations de m‚moire
|
||||||
|
que cela affectera (utilisez donc DS:SI au lieu de ESI, ES:DI … la place de
|
||||||
|
EDI et faŒtes attention … l'adresse 0A0000h qui se transforme en l'adresse
|
||||||
|
0A000h:0000h).
|
||||||
|
|
||||||
|
|
||||||
|
MCGA: (Mode VGA standard)
|
||||||
|
ÍÍÍÍÍ
|
||||||
|
|
||||||
|
Y-a-t'il quelqu'un sur cette planŠte qui ne sache toujours pas comment
|
||||||
|
on passe en mode MCGA 320x200 en 256 couleurs ??!?
|
||||||
|
Bon... Je suppose que vous ˆtes un novice si vous lisez les 2 lignes
|
||||||
|
suivantes :)
|
||||||
|
|
||||||
|
|
||||||
|
mov ax,0013h
|
||||||
|
int 10h
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Modes X: (Modes VGA ‚tendus)
|
||||||
|
ÍÍÍÍÍÍÍÍ
|
||||||
|
|
||||||
|
Bon... Il me semble que le Mode X original ‚tait en 320x240, mais
|
||||||
|
maintenant tout le monde appelle "Modes X" (ou X-Modes, ou Tweaked modes)
|
||||||
|
tous les modes VGA qui utilise plus de 64Ko de m‚moire vid‚o et la structure
|
||||||
|
"Unchained".
|
||||||
|
Afficher un pixel dans n'importe quel Mode X peut ˆtre effectu‚ par la
|
||||||
|
mˆme et unique fonction (mais je ne vous expliquerai pas comment faire, il
|
||||||
|
vous suffit d'indiquer … la fonction la taille des plans (Largeur/4)).
|
||||||
|
Si vous ne comprenez rien … ce que je dis, (Unchained, plans...) il vous
|
||||||
|
suffit de lire n'importe quelle bonne documentation sur le Mode X.
|
||||||
|
|
||||||
|
|
||||||
|
Nous tenons … remercier les auteurs de XLIB2 pour nous avoir ‚conomis‚ du
|
||||||
|
temps en ayant ‚crit cette fonction. Nous l'avons l‚gŠrement optimis‚e en
|
||||||
|
fonction de nos besoins, mais l'essentiel en a ‚t‚ conserv‚.
|
||||||
|
|
||||||
|
|
||||||
|
mov ax,13h ; Oui! Encore le mode MCGA! Tous les Modes X doivent
|
||||||
|
int 10h ; commencer … partir du mode VGA standard, mais bien des
|
||||||
|
; choses changent par la suite.
|
||||||
|
|
||||||
|
mov dx,3C6h ; Pour la dur‚e de l'initialisation, on va ‚teindre la
|
||||||
|
xor al,al ; palette de fa‡on … ce que l'utilisateur ne subisse pas
|
||||||
|
out dx,al ; nos triturations.
|
||||||
|
|
||||||
|
mov dx,3C4h ; Nous allons demander au registre TIMING SEQUENCER de
|
||||||
|
mov ax,0604h ; passer dans le mode "Unchained" (mode X), sans g‚rer de
|
||||||
|
out dx,ax ; parit‚, et un accŠs aux 256Ko de la carte vid‚o.
|
||||||
|
mov ax,0100h ; On va ensuite enclencher le reset synchrone du registre
|
||||||
|
out dx,ax ; TS car on s'apprˆte … jouer avec les registres.
|
||||||
|
|
||||||
|
mov al,01h ; De la mˆme fa‡on que pour la palette, on demande … la
|
||||||
|
out dx,al ; carte vid‚o de ne plus scruter la m‚moire pour
|
||||||
|
inc dx ; afficher son contenu. Ainsi, c'est une fa‡on de plus
|
||||||
|
in al,dx ; d'‚viter l'affichage parasite qui arrive le temps que
|
||||||
|
mov ah,al ; le mode soit totalement initialis‚ et stabilis‚.
|
||||||
|
mov al,01h ; De plus, on peut esp‚rer qu'en demandant un arrˆt de
|
||||||
|
push ax ; la lecture de la m‚moire, le systŠme s'en voit un peu
|
||||||
|
mov al,ah ; acc‚l‚r‚, et ainsi acc‚l‚rer l'initialisation du mode
|
||||||
|
or al,20h ; graphique (l'espoir fait vivre :))
|
||||||
|
out dx,al ;
|
||||||
|
|
||||||
|
mov esi,X_ptr ; Pointeur sur la liste des constantes … envoyer au CRTC.
|
||||||
|
cld
|
||||||
|
|
||||||
|
lodsb ; Ceci charge dans AL une valeur qui nous dira quoi faire
|
||||||
|
; avec le registre MISCELLANEOUS, et incr‚mente ESI.
|
||||||
|
; La valeur est ‚gale … ZERO => Rien … faire
|
||||||
|
; sinon => Envoyer AL au reg. MISC.
|
||||||
|
|
||||||
|
or al,al ; Devons nous modifier le mode vid‚o de base ?
|
||||||
|
jz NonMerci ; Non?Ä¿ En fait, la r‚ponse est toujours "Oui".
|
||||||
|
mov dx,3C2h ; ³ Sauf pour quelques modes tels que le
|
||||||
|
out dx,al ; ³ 320x200 en Mode X
|
||||||
|
NonMerci: ; <ÄÄÄÄÙ (mais notre mode 320x200 est en MCGA...)
|
||||||
|
|
||||||
|
mov dx,3C4h ; On en a termin‚ avec les manipulations du registre
|
||||||
|
mov ax,0300h ; MISCELLANEOUS, on peut maintenant d‚senclencher le
|
||||||
|
out dx,ax ; reset synchrone du registre TIMING SEQUENCER.
|
||||||
|
|
||||||
|
; Et maintenant, si on jouait avec le CRTC?
|
||||||
|
|
||||||
|
mov dx,3D4h ; Dans le 18Šme registre du CRTC, on va d‚senclencher le
|
||||||
|
mov al,11h ; bit de protection. Sans cela, les valeurs que nous
|
||||||
|
out dx,al ; aurions envoy‚es aux registres du CRTC auraient ‚t‚
|
||||||
|
inc dx ; ignor‚es.
|
||||||
|
in al,dx
|
||||||
|
and al,7Fh
|
||||||
|
out dx,al
|
||||||
|
|
||||||
|
dec dx ; DX pointe … nouveau sur "l'entr‚e" du registre CRTC.
|
||||||
|
lodsb ; Ceci met dans AL le nombre de registres CRTC … changer
|
||||||
|
xor ecx,ecx ; On doit nettoyer ECX avant de commencer … r‚p‚ter...
|
||||||
|
mov cl,al ; ...CL (AL) fois OUTSW
|
||||||
|
rep outsw ; On peut envoyer la sauce aux registres du CRTC!
|
||||||
|
|
||||||
|
; Juste au cas o— le 20Šme registre CRTC aurait ‚t‚ oubli‚ dans la table
|
||||||
|
; d'initialisation, on peut le calculer nous-mˆmes (Ouaip, on est des
|
||||||
|
; braves gars).
|
||||||
|
|
||||||
|
mov ax,Screen_width ; Vous devez indiquer … la routine quelle est la
|
||||||
|
shr ax,3 ; largeur de l'‚cran
|
||||||
|
mov ah,al
|
||||||
|
mov al,13h
|
||||||
|
out dx,ax
|
||||||
|
|
||||||
|
mov dx,3C4h ; Maintenant vous avez la bonne r‚solution mais il peut
|
||||||
|
mov ax,0F02h ; y avoir des pixels pourris … l'‚cran … cause de zones
|
||||||
|
out dx,ax ; non nettoy‚es de la m‚moire vid‚o.
|
||||||
|
mov edi,0A0000h ; Donc on va nettoyer la m‚moire … partir de 0A0000h
|
||||||
|
xor eax,eax ; avec la valeur 0 (qui est le noir standard) et sur une
|
||||||
|
mov ecx,4000h ; longueur de 4000h dwords (256Ko).
|
||||||
|
rep stosd ; Allez, liquidez-moi tout ‡a!
|
||||||
|
|
||||||
|
mov dx,3C4h ; On peut redemander … la carte VGA de relire la m‚moire
|
||||||
|
pop ax ; pour afficher l'‚cran...
|
||||||
|
out dx,ax ;
|
||||||
|
mov dx,3C6h ; ... et r‚tablir la palette pour que l'image soit
|
||||||
|
mov al,0FFh ; visible … l'utilisateur.
|
||||||
|
out dx,al ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
La table de constantes que vous devez employer est l'une des suivantes:
|
||||||
|
(Ces tables sont au format C, mais elles peuvent facilement ˆtres employ‚es
|
||||||
|
dans d'autres langages)
|
||||||
|
|
||||||
|
word X320Y224[] =
|
||||||
|
{ 0x0BA3, 0x6F06, 0xBA07, 0x0008, 0x4109, 0x0810, 0x8A11, 0xBF12, 0x0014,
|
||||||
|
0xC715, 0x0416, 0xE317 };
|
||||||
|
word X320Y240[] =
|
||||||
|
{ 0x0AE3, 0x0D06, 0x3E07, 0x4109, 0xEA10, 0xAC11, 0xDF12, 0x0014, 0xE715,
|
||||||
|
0x0616, 0xE317 };
|
||||||
|
word X320Y256[] =
|
||||||
|
{ 0x0CE3, 0x2306, 0xB207, 0x0008, 0x6109, 0x0A10, 0xAC11, 0xFF12, 0x2013,
|
||||||
|
0x0014, 0x0715, 0x1A16, 0xE317 };
|
||||||
|
word X320Y270[] =
|
||||||
|
{ 0x0BE7, 0x3006, 0xF007, 0x0008, 0x6109, 0x2010, 0xA911, 0x1B12, 0x0014,
|
||||||
|
0x1F15, 0x2F16, 0xE317 };
|
||||||
|
word X320Y282[] =
|
||||||
|
{ 0x0CE3, 0x6206, 0xF007, 0x6109, 0x310F, 0x3710, 0x8911, 0x3312, 0x2F13,
|
||||||
|
0x0014, 0x3C15, 0x5C16, 0xE317 };
|
||||||
|
word X320Y300[] =
|
||||||
|
{ 0x0DE3, 0x4606, 0x1F07, 0x0008, 0x4009, 0x3110, 0x8011, 0x2B12, 0x2013,
|
||||||
|
0x0014, 0x2F15, 0x4416, 0xE317 };
|
||||||
|
word X320Y360[] =
|
||||||
|
{ 0x09E3, 0x4009, 0x8810, 0x8511, 0x6712, 0x2013, 0x0014, 0x6D15, 0xBA16,
|
||||||
|
0xE317 };
|
||||||
|
word X320Y400[] =
|
||||||
|
{ 0x03E3, 0x4009, 0x0014, 0xE317 };
|
||||||
|
word X320Y448[] =
|
||||||
|
{ 0x0BA3, 0x6F06, 0xBA07, 0x0008, 0x4009, 0x0810, 0x8A11, 0xBF12, 0x0014,
|
||||||
|
0xC715, 0x0416, 0xE317 };
|
||||||
|
word X320Y480[] =
|
||||||
|
{ 0x0AE3, 0x0D06, 0x3E07, 0x4009, 0xEA10, 0xAC11, 0xDF12, 0x0014, 0xE715,
|
||||||
|
0x0616 , 0xE317};
|
||||||
|
word X320Y512[] =
|
||||||
|
{ 0x0CE3, 0x2306, 0xB207, 0x0008, 0x6009, 0x0A10, 0xAC11, 0xFF12, 0x2013,
|
||||||
|
0x0014, 0x0715, 0x1A16, 0xE317 };
|
||||||
|
word X320Y540[] =
|
||||||
|
{ 0x0BE7, 0x3006, 0xF007, 0x0008, 0x6009, 0x2010, 0xA911, 0x1B12, 0x0014,
|
||||||
|
0x1F15, 0x2F16, 0xE317 };
|
||||||
|
word X320Y564[] =
|
||||||
|
{ 0x0CE7, 0x6206, 0xF007, 0x0008, 0x6009, 0x3E10, 0x8911, 0x3312, 0x2013,
|
||||||
|
0x0014, 0x3C15, 0x5C16, 0xE317 };
|
||||||
|
word X320Y600[] =
|
||||||
|
{ 0x0BE7, 0xBE06, 0xF007, 0x0008, 0x6009, 0x7C10, 0x8C11, 0x5712, 0x0014,
|
||||||
|
0x5815, 0x7016, 0xE317 };
|
||||||
|
word X360Y200[] =
|
||||||
|
{ 0x09E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x2D13, 0x0014,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y224[] =
|
||||||
|
{ 0x12A7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x6F06, 0xBA07,
|
||||||
|
0x0008, 0x4109, 0x0810, 0x8A11, 0xBF12, 0x2D13, 0x0014, 0xC715, 0x0416,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y240[] =
|
||||||
|
{ 0x11E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x0D06, 0x3E07,
|
||||||
|
0x4109, 0xEA10, 0xAC11, 0xDF12, 0x2D13, 0x0014, 0xE715, 0x0616, 0xE317 };
|
||||||
|
word X360Y256[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6109, 0x0E10, 0xAC11, 0xFF12, 0x2D13, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y270[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x3006, 0xF007,
|
||||||
|
0x0008, 0x6109, 0x2010, 0xA911, 0x1B12, 0x2D13, 0x0014, 0x1F15, 0x2F16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y282[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x6206, 0xF007,
|
||||||
|
0x6109, 0x310F, 0x3710, 0x8911, 0x3312, 0x2D13, 0x0014, 0x3C15, 0x5C16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y300[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x4606, 0x1F07,
|
||||||
|
0x0008, 0x4009, 0x3110, 0x8011, 0x2B12, 0x2D13, 0x0014, 0x2F15, 0x4416,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y360[] =
|
||||||
|
{ 0x0FE7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x4009, 0x8810,
|
||||||
|
0x8511, 0x6712, 0x2D13, 0x0014, 0x6D15, 0xBA16, 0xE317 };
|
||||||
|
word X360Y400[] =
|
||||||
|
{ 0x0AE7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x4009, 0x2D13,
|
||||||
|
0x0014, 0xE317 };
|
||||||
|
word X360Y448[] =
|
||||||
|
{ 0x12A7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x6F06, 0xBA07,
|
||||||
|
0x0008, 0x4009, 0x0810, 0x8A11, 0xBF12, 0x2D13, 0x0014, 0xC715, 0x0416,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y480[] =
|
||||||
|
{ 0x11E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x0D06, 0x3E07,
|
||||||
|
0x4009, 0xEA10, 0xAC11, 0xDF12, 0x2D13, 0x0014, 0xE715, 0x0616, 0xE317 };
|
||||||
|
word X360Y512[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6009, 0x0E10, 0xAC11, 0xff12, 0x2D13, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y540[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x3006, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x2010, 0xA911, 0x1B12, 0x2D13, 0x0014, 0x1F15, 0x2F16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y564[] =
|
||||||
|
{ 0x12EB, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0x6206, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x3E10, 0x8911, 0x3312, 0x2D13, 0x0014, 0x3C15, 0x5C16,
|
||||||
|
0xE317 };
|
||||||
|
word X360Y600[] =
|
||||||
|
{ 0x12E7, 0x6B00, 0x5901, 0x5A02, 0x8E03, 0x5E04, 0x8A05, 0xBE06, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x7C10, 0x8C11, 0x5712, 0x2D13, 0x0014, 0x5815, 0x7016,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y200[] =
|
||||||
|
{ 0x09E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x3213, 0x0014,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y224[] =
|
||||||
|
{ 0x12A7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x6F06, 0xBA07,
|
||||||
|
0x0008, 0x4109, 0x0810, 0x8A11, 0xBF12, 0x3213, 0x0014, 0xC715, 0x0416,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y240[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x0D06, 0x3E07,
|
||||||
|
0x0008, 0x4109, 0xEA10, 0xAC11, 0xDF12, 0x3213, 0x0014, 0xE715, 0x0616,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y256[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6109, 0x1310, 0xAC11, 0xFF12, 0x3213, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y270[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x3006, 0xF007,
|
||||||
|
0x0008, 0x6109, 0x2010, 0xA911, 0x1B12, 0x3213, 0x0014, 0x1F15, 0x2F16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y282[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x6206, 0xF007,
|
||||||
|
0x6109, 0x310F, 0x3710, 0x8911, 0x3312, 0x3213, 0x0014, 0x3C15, 0x5C16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y300[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x4606, 0x1F07,
|
||||||
|
0x0008, 0x4009, 0x3110, 0x8011, 0x2B12, 0x3213, 0x0014, 0x2F15, 0x4416,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y360[] =
|
||||||
|
{ 0x0FE7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x4009, 0x8810,
|
||||||
|
0x8511, 0x6712, 0x3213, 0x0014, 0x6D15, 0xBA16, 0xE317 };
|
||||||
|
word X400Y400[] =
|
||||||
|
{ 0x0AE7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x4009, 0x3213,
|
||||||
|
0x0014, 0xE317 };
|
||||||
|
word X400Y448[] =
|
||||||
|
{ 0x12A7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x6F06, 0xBA07,
|
||||||
|
0x0008, 0x4009, 0x0810, 0x8A11, 0xBF12, 0x3213, 0x0014, 0xC715, 0x0416,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y480[] =
|
||||||
|
{ 0x11E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x0D06, 0x3E07,
|
||||||
|
0x4009, 0xEA10, 0xAC11, 0xDF12, 0x3213, 0x0014, 0xE715, 0x0616, 0xE317 };
|
||||||
|
word X400Y512[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x2B06, 0xB207,
|
||||||
|
0x0008, 0x6009, 0x1310, 0xAC11, 0xFF12, 0x3213, 0x0014, 0x0715, 0x1A16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y540[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x3006, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x2010, 0xA911, 0x1B12, 0x3213, 0x0014, 0x1F15, 0x2F16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y564[] =
|
||||||
|
{ 0x12EB, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0x6206, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x3E10, 0x8911, 0x3312, 0x3213, 0x0014, 0x3C15, 0x5C16,
|
||||||
|
0xE317 };
|
||||||
|
word X400Y600[] =
|
||||||
|
{ 0x12E7, 0x7100, 0x6301, 0x6402, 0x9203, 0x6604, 0x8205, 0xBE06, 0xF007,
|
||||||
|
0x0008, 0x6009, 0x7C10, 0x8C11, 0x5712, 0x3213, 0x0014, 0x5815, 0x7016,
|
||||||
|
0xE317 };
|
||||||
|
|
||||||
|
|
||||||
|
La structure: (exemple)
|
||||||
|
|
||||||
|
ÚÄÄÄÄCeci est le nombre de valeurs … envoyer aux registres CRTC. C'est
|
||||||
|
³ en fait le nombre de words dans la table moins 1 (… cause du 1er
|
||||||
|
³ word de la table qui n'est pas envoy‚ au CRTC mais qui contient
|
||||||
|
³ une valeur … envoyer au registre MISCELLANEOUS et le nombre de
|
||||||
|
³ valeurs … envoyer aux registres CRTC ;) ).
|
||||||
|
³
|
||||||
|
³ ÚÄÄCeci est la valeur … envoyer au registre MISCELLANEOUS (ou 0 si
|
||||||
|
³ ³ aucune valeur ne doit y ˆtre envoy‚e).
|
||||||
|
³ ³
|
||||||
|
³ ³ ÚÄÄÄCeci est une valeur … envoyer dans un registre du CRTC.
|
||||||
|
³ ³ ³
|
||||||
|
³ ³ ³ ÚÄCeci est le num‚ro du registre du CRTC qui recevra la
|
||||||
|
³ ³ ³ ³ valeur cit‚e pr‚c‚demment.
|
||||||
|
ÿÿ ÿÿ
|
||||||
|
{ 0x0AE3, 0x0D06, 0x3E07, 0x4109, 0xEA10, 0xAC11, 0xDF12, 0x0014, 0xE715,
|
||||||
|
0x0616, 0xE317 };
|
||||||
|
|
||||||
|
Vous pouvez remarquer que les registres 0 … 5 (et le 13h) du CRTC
|
||||||
|
d‚finissent la largeur de l'‚cran, alors que les registres 6 … 17h (…
|
||||||
|
l'exception du 13h) definissent la hauteur de l'‚cran.
|
||||||
|
|
||||||
|
|
||||||
|
Nous avons plus de modes en poche que les quelques-uns :) que nous avons
|
||||||
|
inclus dans GrafX 2.00, mais ils ne sont ni vraiment utiles ni vraiment
|
||||||
|
stables. Nous pourrons toutefois d‚cider de les inclure dans une prochaine
|
||||||
|
version.
|
||||||
|
S'il manque certains de vos modes pr‚f‚res, envoyez nous simplement la
|
||||||
|
liste des constantes que l'on doit balancer au CRTC … la maniŠre de la
|
||||||
|
structure utilis‚e ci-dessus.
|
||||||
|
|
||||||
|
IMPORTANT! Les valeurs des constantes cit‚es plus haut ne sont pas
|
||||||
|
support‚es par tous les moniteurs ou les cartes vid‚os.
|
||||||
|
Nous avons test‚ GrafX2 avec diff‚rentes configurations et avons
|
||||||
|
constat‚s que certains modes ne marchent pas du tout avec
|
||||||
|
certaines cartes vid‚os, alors que d'autres d‚bordent de l'‚cran,
|
||||||
|
sont d‚centr‚s, assombris, trop clairs, ou tass‚s.
|
||||||
|
Toutefois, ils marchent tous correctement avec notre pauvre
|
||||||
|
petite Tseng Labs ET4000...
|
||||||
|
|
||||||
|
Si vous avez d‚j… une bonne connaissance … propos du CRTC, et avez des
|
||||||
|
valeurs diff‚rentes des notres pour certains modes, merci de nous en
|
||||||
|
informer. Nous nous en servirons s'ils marchent mieux sur une majorit‚
|
||||||
|
d'ordinateurs.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
VESA: (Un "pseudo-standard" pour les modes Super-VGA)
|
||||||
|
ÍÍÍÍÍ
|
||||||
|
|
||||||
|
Nous nous servons du VESA pour des modes qui n‚cessitent une largeur de
|
||||||
|
640, 800 ou 1024 pixels. Mais il existe un moyen de combiner la hauteur des
|
||||||
|
Modes X avec les modes VESA, il est ainsi possible d'avoir des modes aussi
|
||||||
|
timbr‚s qu'en Mode X.
|
||||||
|
|
||||||
|
|
||||||
|
mov ax,4F02h
|
||||||
|
mov bx,Video_mode
|
||||||
|
int 10h
|
||||||
|
|
||||||
|
|
||||||
|
Les modes VESA 256 couleur VESA sont:
|
||||||
|
100h : 640x400
|
||||||
|
101h : 640x480
|
||||||
|
103h : 800x600
|
||||||
|
105h : 1024x768
|
||||||
|
107h : 1280x1024 (non disponible dans GrafX2 parce qu'uniquement support‚
|
||||||
|
par des cartes vid‚o avec 2 Megaoctets ou plus de m‚moire
|
||||||
|
vid‚o)
|
||||||
|
|
||||||
|
|
||||||
|
Comme avec les Modes X, vous pouvez modifier les registres CRTC pour acc‚der
|
||||||
|
aux modes "VESA-X"! (Notez que certaines cartes vid‚o ne supportent pas les
|
||||||
|
modifications des registres du CRTC VGA dans les modes VESA.)
|
||||||
|
|
||||||
|
|
||||||
|
Pour passer dans ces modes ‚tendus, passez dans un mode VESA standard ayant
|
||||||
|
la bonne largeur, puis appelez Modif_registres_CRTC avec la bonne table de
|
||||||
|
hauteur.
|
||||||
|
|
||||||
|
Exemple (640x512) :
|
||||||
|
VESA_Set_mode(101h) // On passe dans un mode qui a la mˆme largeur
|
||||||
|
Modif_registres_CRTC(Y512) // On modifie la hauteur
|
||||||
|
|
||||||
|
|
||||||
|
* Tables des hauteurs:
|
||||||
|
|
||||||
|
word Y224[] =
|
||||||
|
{ 0x09A3, 0x6F06, 0xBA07, 0x0008, 0x4109, 0x0810, 0x8A11, 0xBF12, 0xC715,
|
||||||
|
0x0416 };
|
||||||
|
word Y240[] =
|
||||||
|
{ 0x09E3, 0x0D06, 0x3E07, 0x0008, 0x4109, 0xEA10, 0xAC11, 0xDF12, 0xE715,
|
||||||
|
0x0616 };
|
||||||
|
word Y256[] =
|
||||||
|
{ 0x0900, 0x2B06, 0xB207, 0x0008, 0x6109, 0x0A10, 0xAC11, 0xFF12, 0x0715,
|
||||||
|
0x1A16 };
|
||||||
|
word Y270[] =
|
||||||
|
{ 0x09E7, 0x3006, 0xF007, 0x0008, 0x6109, 0x2010, 0xA911, 0x1B12, 0x1F15,
|
||||||
|
0x2F16 };
|
||||||
|
word Y282[] =
|
||||||
|
{ 0x0AE3, 0x6206, 0xF007, 0x0008, 0x6109, 0x310F, 0x3710, 0x8911, 0x3312,
|
||||||
|
0x3C15, 0x5C16 };
|
||||||
|
word Y300[] =
|
||||||
|
{ 0x09E3, 0x4606, 0x1F07, 0x0008, 0x4009, 0x3110, 0x8011, 0x2B12, 0x2F15,
|
||||||
|
0x4416 };
|
||||||
|
word Y350[] =
|
||||||
|
{ 0x09A3, 0xBF06, 0x1F07, 0x0008, 0x4009, 0x8310, 0x8511, 0x5D12, 0x6315,
|
||||||
|
0xBA16 };
|
||||||
|
word Y360[] =
|
||||||
|
{ 0x07E3, 0x0008, 0x4009, 0x8810, 0x8511, 0x6712, 0x6D15, 0xBA16 };
|
||||||
|
word Y400[] =
|
||||||
|
{ 0x01E3, 0x4009 };
|
||||||
|
word Y448[] =
|
||||||
|
{ 0x09A3, 0x6F06, 0xBA07, 0x0008, 0x4009, 0x0810, 0x8A11, 0xBF12, 0xC715,
|
||||||
|
0x0416 };
|
||||||
|
word Y480[] =
|
||||||
|
{ 0x09E3, 0x0D06, 0x3E07, 0x0008, 0x4009, 0xEA10, 0xAC11, 0xDF12, 0xE715,
|
||||||
|
0x0616 };
|
||||||
|
word Y512[] =
|
||||||
|
{ 0x0900, 0x2B06, 0xB207, 0x0008, 0x6009, 0x0A10, 0xAC11, 0xFF12, 0x0715,
|
||||||
|
0x1A16 };
|
||||||
|
word Y540[] =
|
||||||
|
{ 0x09E7, 0x3006, 0xF007, 0x0008, 0x6009, 0x2010, 0xA911, 0x1B12, 0x1F15,
|
||||||
|
0x2F16 };
|
||||||
|
word Y564[] =
|
||||||
|
{ 0x09E7, 0x6206, 0xF007, 0x0008, 0x6009, 0x3E10, 0x8911, 0x3312, 0x3C15,
|
||||||
|
0x5C16 };
|
||||||
|
word Y600[] =
|
||||||
|
{ 0x09E7, 0xBE06, 0xF007, 0x0008, 0x6009, 0x7C10, 0x8C11, 0x5712, 0x5815,
|
||||||
|
0x7016 };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Modifier les registres CRTC: (inspir‚ de l'init. des Modes X... voir plus
|
||||||
|
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ haut pour de plus amples d‚tails)
|
||||||
|
|
||||||
|
mov esi,XVESA_Ptr
|
||||||
|
cld
|
||||||
|
|
||||||
|
lodsb
|
||||||
|
or al,al ; Devons nous modifier le mode vid‚o de base ?
|
||||||
|
jz NonMerci ; Non?Ä¿ La r‚ponse peut ˆtre "Non" car les initialisations
|
||||||
|
mov dx,3C2h ; ³ de certains modes VESA mettent directement la
|
||||||
|
out dx,al ; ³ bonne valeur pour le registre MISCELLANEOUS.
|
||||||
|
NonMerci: ; <ÄÄÄÄÙ
|
||||||
|
|
||||||
|
mov dx,3D4h
|
||||||
|
mov al,11h
|
||||||
|
out dx,al
|
||||||
|
inc dx
|
||||||
|
in al,dx
|
||||||
|
and al,7Fh
|
||||||
|
out dx,al
|
||||||
|
|
||||||
|
dec dx
|
||||||
|
lodsb
|
||||||
|
xor ecx,ecx
|
||||||
|
mov cl,al
|
||||||
|
rep outsw
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Si vous ˆtes suffisament astucieux, vous pourrez combiner les constantes
|
||||||
|
utilis‚es dans les Modes X pour obtenir plus de modes "VESA-X" tels que le
|
||||||
|
640x200, 800x480, etc... (mais je ne pense pas que ‡a marche convenablement
|
||||||
|
avec les largeurs de 1024 pixels puisque ce mode est g‚n‚ralement
|
||||||
|
entrelac‚... Mais qui sait?...)
|
||||||
|
Je pense que le plus difficile est de trouver la bonne valeur du registre
|
||||||
|
MISCELLANEOUS.
|
||||||
7
testvesa/comp.bat
Normal file
7
testvesa/comp.bat
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
@echo off
|
||||||
|
50
|
||||||
|
wmake
|
||||||
|
if errorlevel 1 goto END
|
||||||
|
if not exist testvesa.exe goto END
|
||||||
|
if %0==COMP testvesa %1
|
||||||
|
:END
|
||||||
4
testvesa/make.inc
Normal file
4
testvesa/make.inc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
system dos4g
|
||||||
|
op stub=weoslite.exe
|
||||||
|
file vesa,testvesa
|
||||||
|
name testvesa
|
||||||
8
testvesa/makefile
Normal file
8
testvesa/makefile
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
testvesa.exe : testvesa.obj vesa.obj
|
||||||
|
wlink @make.inc
|
||||||
|
|
||||||
|
testvesa.obj : testvesa.c vesa.h
|
||||||
|
wcc386 /we /4s /fp3 testvesa
|
||||||
|
|
||||||
|
vesa.obj : vesa.asm vesa.h
|
||||||
|
tasm /mx /zn /os vesa
|
||||||
196
testvesa/testvesa.c
Normal file
196
testvesa/testvesa.c
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
|
||||||
|
typedef unsigned char byte;
|
||||||
|
typedef unsigned short word;
|
||||||
|
typedef unsigned long dword;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "vesa.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
char * Version_to_string(word Version)
|
||||||
|
{
|
||||||
|
static char Chaine[20];
|
||||||
|
|
||||||
|
sprintf(Chaine,"%d",(Version>>8));
|
||||||
|
strcat(Chaine,".");
|
||||||
|
sprintf(Chaine+strlen(Chaine),"%d",(Version & 0xFF));
|
||||||
|
|
||||||
|
return Chaine;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Lire_infos_VESA(void)
|
||||||
|
{
|
||||||
|
struct S_Buffer_VESA Buffer_VESA;
|
||||||
|
struct S_Buffer_mode_VESA Buffer_mode_VESA;
|
||||||
|
word Retour;
|
||||||
|
int Nombre_de_modes;
|
||||||
|
word * Liste_des_modes;
|
||||||
|
int Offset1;
|
||||||
|
int Offset2;
|
||||||
|
char Libelle_du_nombre_de_couleurs[16];
|
||||||
|
int Nombre_de_bits;
|
||||||
|
|
||||||
|
Retour=Get_VESA_info(&Buffer_VESA);
|
||||||
|
|
||||||
|
if (Retour==0x004F)
|
||||||
|
{
|
||||||
|
if (memcmp(Buffer_VESA.Signature,"VESA",4)==0)
|
||||||
|
{
|
||||||
|
printf("VESA version : %s\n",Version_to_string(Buffer_VESA.Version));
|
||||||
|
printf("Builder : %s\n",Buffer_VESA.Fabricant);
|
||||||
|
printf("Capabilities : %d\n",Buffer_VESA.Capacite);
|
||||||
|
printf("Video memory : %dK\n",Buffer_VESA.Memoire*64);
|
||||||
|
|
||||||
|
if (Buffer_VESA.Version>=0x0200)
|
||||||
|
{
|
||||||
|
printf("OEM version : %s\n",Version_to_string(Buffer_VESA.Version_bios));
|
||||||
|
printf("Vendor : %s\n",Buffer_VESA.Vendeur);
|
||||||
|
printf("Product : %s\n",Buffer_VESA.Produit);
|
||||||
|
printf("Revision : %s\n",Buffer_VESA.Revision);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Comptage du nombre de modes:
|
||||||
|
Nombre_de_modes=0;
|
||||||
|
for (Offset1=0;Buffer_VESA.Liste_des_modes[Offset1]!=0xFFFF;Offset1++)
|
||||||
|
Nombre_de_modes++;
|
||||||
|
|
||||||
|
// Allocation d'une liste dupliqu‚e des modes:
|
||||||
|
Liste_des_modes=(word *)malloc(sizeof(word)*Nombre_de_modes);
|
||||||
|
|
||||||
|
// Copie de la liste des modes originale vers la dupliqu‚e:
|
||||||
|
memcpy(Liste_des_modes,Buffer_VESA.Liste_des_modes,sizeof(word)*Nombre_de_modes);
|
||||||
|
|
||||||
|
// Affichage de la liste des modes:
|
||||||
|
for (Offset1=0;Offset1<Nombre_de_modes;Offset1++)
|
||||||
|
{
|
||||||
|
// Lecture des infos du mode:
|
||||||
|
Retour=Get_VESA_mode_info(Liste_des_modes[Offset1],&Buffer_mode_VESA);
|
||||||
|
|
||||||
|
// Affichage des infos de ce mode:
|
||||||
|
|
||||||
|
if (Retour==0x004F)
|
||||||
|
{
|
||||||
|
if (Buffer_mode_VESA.Nb_bits_par_pixel<=8)
|
||||||
|
{
|
||||||
|
Nombre_de_bits=0;
|
||||||
|
sprintf(Libelle_du_nombre_de_couleurs,"%d col.",1<<Buffer_mode_VESA.Nb_bits_par_pixel);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Nombre_de_bits=Buffer_mode_VESA.Taille_masque_rouge+
|
||||||
|
Buffer_mode_VESA.Taille_masque_vert+
|
||||||
|
Buffer_mode_VESA.Taille_masque_bleu;
|
||||||
|
|
||||||
|
switch (Nombre_de_bits)
|
||||||
|
{
|
||||||
|
case 15:
|
||||||
|
strcpy(Libelle_du_nombre_de_couleurs,"32K");
|
||||||
|
break;
|
||||||
|
case 16:
|
||||||
|
strcpy(Libelle_du_nombre_de_couleurs,"64K");
|
||||||
|
break;
|
||||||
|
case 24:
|
||||||
|
if (Buffer_mode_VESA.Nb_bits_par_pixel==24)
|
||||||
|
strcpy(Libelle_du_nombre_de_couleurs,"16M");
|
||||||
|
else
|
||||||
|
strcpy(Libelle_du_nombre_de_couleurs,"16M 32-bits");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
sprintf(Libelle_du_nombre_de_couleurs,"%d col.",1<<Nombre_de_bits);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("\nMode : %Xh\t(",Liste_des_modes[Offset1]);
|
||||||
|
|
||||||
|
if (Buffer_mode_VESA.Attributs&16)
|
||||||
|
printf("Graphmode: ");
|
||||||
|
else
|
||||||
|
printf("Textmode : ");
|
||||||
|
|
||||||
|
printf("%dx%d - %s - ",Buffer_mode_VESA.Largeur,
|
||||||
|
Buffer_mode_VESA.Hauteur,Libelle_du_nombre_de_couleurs);
|
||||||
|
|
||||||
|
switch (Buffer_mode_VESA.Attributs&192)
|
||||||
|
{
|
||||||
|
case 0 : printf("Banked)\n"); break;
|
||||||
|
case 128 : printf("Banked/LFB)\n"); break;
|
||||||
|
case 192 : printf("LFB)\n"); break;
|
||||||
|
default : printf("BUGGED!)\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(" Attributes : %Xh\n",Buffer_mode_VESA.Attributs);
|
||||||
|
printf(" Window A attributes : %Xh\n",Buffer_mode_VESA.Attributs_fenetre_A);
|
||||||
|
printf(" Window B attributes : %Xh\n",Buffer_mode_VESA.Attributs_fenetre_B);
|
||||||
|
printf(" Granularity : %dK\n",Buffer_mode_VESA.Granularite);
|
||||||
|
printf(" Window size : %dK\n",Buffer_mode_VESA.Taille_fenetres);
|
||||||
|
printf(" Window A segment : %Xh\n",Buffer_mode_VESA.Segment_fenetre_A);
|
||||||
|
printf(" Window B segment : %Xh\n",Buffer_mode_VESA.Segment_fenetre_B);
|
||||||
|
printf(" WinFunction pointer : %p\n",Buffer_mode_VESA.WinFuncPtr);
|
||||||
|
printf(" Bytes per line : %d\n",Buffer_mode_VESA.Octets_par_ligne);
|
||||||
|
printf(" Width : %d\n",Buffer_mode_VESA.Largeur);
|
||||||
|
printf(" Height : %d\n",Buffer_mode_VESA.Hauteur);
|
||||||
|
printf(" Character width : %d\n",Buffer_mode_VESA.Largeur_de_char);
|
||||||
|
printf(" Character height : %d\n",Buffer_mode_VESA.Hauteur_de_char);
|
||||||
|
printf(" Number of planes : %d\n",Buffer_mode_VESA.Nb_plans);
|
||||||
|
printf(" Bits per pixel : %d\n",Buffer_mode_VESA.Nb_bits_par_pixel);
|
||||||
|
printf(" Number of banks : %d\n",Buffer_mode_VESA.Nb_banques);
|
||||||
|
printf(" Memory model : %d\n",Buffer_mode_VESA.Modele_de_memoire);
|
||||||
|
printf(" Bank size : %d\n",Buffer_mode_VESA.Taille_des_banques);
|
||||||
|
printf(" Number of pages : %d\n",Buffer_mode_VESA.Nombre_de_pages);
|
||||||
|
|
||||||
|
if (Nombre_de_bits)
|
||||||
|
{
|
||||||
|
printf(" Red mask size : %d\n",Buffer_mode_VESA.Taille_masque_rouge);
|
||||||
|
printf(" Red mask position : %d\n",Buffer_mode_VESA.Pos_masque_rouge);
|
||||||
|
printf(" Green mask size : %d\n",Buffer_mode_VESA.Taille_masque_vert);
|
||||||
|
printf(" Green mask position : %d\n",Buffer_mode_VESA.Pos_masque_vert);
|
||||||
|
printf(" Blue mask size : %d\n",Buffer_mode_VESA.Taille_masque_bleu);
|
||||||
|
printf(" Blue mask position : %d\n",Buffer_mode_VESA.Pos_masque_bleu);
|
||||||
|
printf(" Reserved mask size : %d\n",Buffer_mode_VESA.Taille_masque_res);
|
||||||
|
printf(" Reserved mask pos. : %d\n",Buffer_mode_VESA.Pos_masque_res);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(" Direct screen mode : %d\n",Buffer_mode_VESA.Direct_screen_mode);
|
||||||
|
printf(" LFB address : %p\n",Buffer_mode_VESA.Adresse_LFB);
|
||||||
|
printf(" Offscreen address : %p\n",Buffer_mode_VESA.Adresse_offscreen);
|
||||||
|
printf(" Offscreen size : %dK\n",Buffer_mode_VESA.Taille_offscreen);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("\nMode : %Xh",Liste_des_modes[Offset1]);
|
||||||
|
printf(" Mode not supported (not enough memory or bad monitor)\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Lib‚ration de la liste dupliqu‚e:
|
||||||
|
free(Liste_des_modes);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf("VESA bugged.\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Retour==0xFF00)
|
||||||
|
printf("Memory allocation impossible.\n");
|
||||||
|
else
|
||||||
|
printf("No VESA supported: %d\n",Retour);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
printf("\nÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»");
|
||||||
|
printf("\nºÛ²±° VESA tester - Copyright (c)1997 Sunset Design °±²Ûº");
|
||||||
|
printf("\nÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n\n");
|
||||||
|
Lire_infos_VESA();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
BIN
testvesa/testvesa.exe
Normal file
BIN
testvesa/testvesa.exe
Normal file
Binary file not shown.
237
testvesa/vesa.asm
Normal file
237
testvesa/vesa.asm
Normal file
@ -0,0 +1,237 @@
|
|||||||
|
.386P
|
||||||
|
.MODEL FLAT
|
||||||
|
|
||||||
|
_TEXT Segment dword public 'code'
|
||||||
|
Assume cs:_TEXT, ds:_DATA
|
||||||
|
|
||||||
|
|
||||||
|
; -- Fonctions VESA --
|
||||||
|
public Get_VESA_info
|
||||||
|
public Get_VESA_mode_info
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; - -- --- ----\/\ Lecture des informations VESA : /\/---- --- -- -
|
||||||
|
|
||||||
|
Convertir_adresse_MR_MP proc near
|
||||||
|
|
||||||
|
; EDI = Adresse d'une adresse … corriger
|
||||||
|
|
||||||
|
push eax
|
||||||
|
push ecx
|
||||||
|
|
||||||
|
mov eax,[edi] ; EAX = adresse … corriger
|
||||||
|
mov ecx,eax
|
||||||
|
shr eax,16
|
||||||
|
shl eax,4
|
||||||
|
and ecx,0FFFFh
|
||||||
|
add eax,ecx
|
||||||
|
mov [edi],eax
|
||||||
|
|
||||||
|
pop ecx
|
||||||
|
pop eax
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Convertir_adresse_MR_MP endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Get_VESA_info proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Buffer:dword
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
|
||||||
|
|
||||||
|
; On commence par allouer un buffer en mode r‚el de 1024+64 octets
|
||||||
|
mov ax,0100h ; "DPMI : Allocate Dos memory blocks"
|
||||||
|
mov bx,68d ; BX = (1024+64)/16 = 68 paragraphes
|
||||||
|
int 31h
|
||||||
|
jc GVI_Erreur
|
||||||
|
|
||||||
|
; On sauve l'handle du buffer dans la pile
|
||||||
|
push dx
|
||||||
|
|
||||||
|
; On place dans EDX l'adresse du buffer
|
||||||
|
xor edx,edx
|
||||||
|
mov dx,ax
|
||||||
|
shl edx,4
|
||||||
|
|
||||||
|
; On nettoie ce(s) buffer(s)
|
||||||
|
mov edi,edx ; On place en EDX
|
||||||
|
xor eax,eax ; ... la valeur 0
|
||||||
|
mov ecx,0110h ; ... sur 1024+64 positions
|
||||||
|
rep stosd ; !!! Maintenant !!!
|
||||||
|
|
||||||
|
; On demande les infos VESA: (AX=4F00, ES:DI=Adresse du buffer)
|
||||||
|
mov edi,edx ; Adresse des valeurs des registres … passer … l'interruption
|
||||||
|
add edx,40h ; EDX=segment du buffer d'infos VESA
|
||||||
|
shr edx,4
|
||||||
|
mov dword ptr[edi+1Ch],00004F00h ; EAX pass‚ … l'interruption
|
||||||
|
mov dword ptr[edi+00h],00000000h ; EDI pass‚ … l'interruption
|
||||||
|
mov word ptr[edi+22h],dx ; ES pass‚ … l'interruption
|
||||||
|
shl edx,4
|
||||||
|
mov dword ptr[edx],32454256h ; valeur hexa de "VBE2"
|
||||||
|
mov ax,0300h ; Service DPMI simuler une interruption en mode r‚el
|
||||||
|
mov bl,10h ; Interruption … appeler (int vid‚o)
|
||||||
|
xor bh,bh ; Flags de mode d'appel d'interruption
|
||||||
|
xor cx,cx ; Nb d'elements de la pile … passer
|
||||||
|
int 31h ; Appel de l'interruption du DPMI
|
||||||
|
|
||||||
|
; On place dans EBX la valeur EAX de retour de l'interruption
|
||||||
|
mov ebx,dword ptr[edi+1Ch]
|
||||||
|
|
||||||
|
; On recopie le buffer du mode r‚el vers le mode prot‚g‚
|
||||||
|
mov ecx,256 ; (256 dword = 1024 octets)
|
||||||
|
mov esi,edx
|
||||||
|
mov edi,Buffer
|
||||||
|
rep movsd
|
||||||
|
|
||||||
|
; Puis on corrige chacune des adresses:
|
||||||
|
mov edi,Buffer
|
||||||
|
add edi,06h
|
||||||
|
call Convertir_adresse_MR_MP ; Fabricant
|
||||||
|
add edi,08h
|
||||||
|
call Convertir_adresse_MR_MP ; Liste des modes
|
||||||
|
add edi,08h
|
||||||
|
call Convertir_adresse_MR_MP ; Vendeur
|
||||||
|
add edi,04h
|
||||||
|
call Convertir_adresse_MR_MP ; Produit
|
||||||
|
add edi,04h
|
||||||
|
call Convertir_adresse_MR_MP ; R‚vision
|
||||||
|
|
||||||
|
; On libŠre le buffer en mode r‚el de 1024+64 octets
|
||||||
|
mov ax,0101h ; "DPMI : Free Dos memory blocks"
|
||||||
|
pop dx ; DX = handle du buffer
|
||||||
|
int 31h
|
||||||
|
jnc GVI_Pas_d_erreur
|
||||||
|
|
||||||
|
|
||||||
|
GVI_Erreur:
|
||||||
|
|
||||||
|
mov bx,0FF00h
|
||||||
|
|
||||||
|
GVI_Pas_d_erreur:
|
||||||
|
|
||||||
|
mov ax,bx
|
||||||
|
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Get_VESA_info endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Get_VESA_mode_info proc near
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
|
||||||
|
arg Mode:word,Buffer:dword
|
||||||
|
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
|
||||||
|
|
||||||
|
; On commence par allouer un buffer en mode r‚el de 256+64 octets
|
||||||
|
mov ax,0100h ; "DPMI : Allocate Dos memory blocks"
|
||||||
|
mov bx,20d ; BX = (256+64)/16 = 20 paragraphes
|
||||||
|
int 31h
|
||||||
|
jc GVMI_Erreur
|
||||||
|
|
||||||
|
; On sauve l'handle du buffer dans la pile
|
||||||
|
push dx
|
||||||
|
|
||||||
|
; On place dans EDX l'adresse du buffer
|
||||||
|
xor edx,edx
|
||||||
|
mov dx,ax
|
||||||
|
shl edx,4
|
||||||
|
|
||||||
|
; On nettoie ce(s) buffer(s)
|
||||||
|
mov edi,edx ; On place en EDX
|
||||||
|
xor eax,eax ; ... la valeur 0
|
||||||
|
mov ecx,0080d ; ... sur 256+64 positions
|
||||||
|
rep stosd ; !!! Maintenant !!!
|
||||||
|
|
||||||
|
; On demande les infos VESA: (AX=4F01, CX=Mode, ES:DI=Adresse du buffer)
|
||||||
|
mov edi,edx ; Adresse des valeurs des registres … passer … l'interruption
|
||||||
|
add edx,40h ; EDX=segment du buffer d'infos VESA
|
||||||
|
shr edx,4
|
||||||
|
mov ax,Mode ; ECX=Mode vid‚o dont ont recherche les informations
|
||||||
|
mov dword ptr[edi+1Ch],00004F01h ; EAX pass‚ … l'interruption
|
||||||
|
mov word ptr[edi+18h],ax ; ECX pass‚ … l'interruption
|
||||||
|
mov dword ptr[edi+00h],00000000h ; EDI pass‚ … l'interruption
|
||||||
|
mov word ptr[edi+22h],dx ; ES pass‚ … l'interruption
|
||||||
|
shl edx,4
|
||||||
|
mov ax,0300h ; Service DPMI simuler une interruption en mode r‚el
|
||||||
|
mov bl,10h ; Interruption … appeler (int vid‚o)
|
||||||
|
xor bh,bh ; Flags de mode d'appel d'interruption
|
||||||
|
xor cx,cx ; Nb d'elements de la pile … passer
|
||||||
|
int 31h ; Appel de l'interruption du DPMI
|
||||||
|
|
||||||
|
; On place dans EBX la valeur EAX de retour de l'interruption
|
||||||
|
mov ebx,dword ptr[edi+1Ch]
|
||||||
|
|
||||||
|
; On recopie le buffer du mode r‚el vers le mode prot‚g‚
|
||||||
|
mov ecx,64 ; (64 dword = 256 octets)
|
||||||
|
mov esi,edx
|
||||||
|
mov edi,Buffer
|
||||||
|
rep movsd
|
||||||
|
|
||||||
|
; Puis on corrige chacune des adresses:
|
||||||
|
mov edi,Buffer
|
||||||
|
add edi,0Ch
|
||||||
|
call Convertir_adresse_MR_MP ; Adresse WinFuncPtr (Mode r‚el)
|
||||||
|
|
||||||
|
; On libŠre le buffer en mode r‚el de 256+64 octets
|
||||||
|
mov ax,0101h ; "DPMI : Free Dos memory blocks"
|
||||||
|
pop dx ; DX = handle du buffer
|
||||||
|
int 31h
|
||||||
|
jnc GVMI_Pas_d_erreur
|
||||||
|
|
||||||
|
|
||||||
|
GVMI_Erreur:
|
||||||
|
|
||||||
|
mov bx,0FF00h
|
||||||
|
|
||||||
|
GVMI_Pas_d_erreur:
|
||||||
|
|
||||||
|
mov ax,bx
|
||||||
|
|
||||||
|
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
mov esp,ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
Get_VESA_mode_info endp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_TEXT ENDS
|
||||||
|
END
|
||||||
82
testvesa/vesa.h
Normal file
82
testvesa/vesa.h
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
|
||||||
|
#ifndef _VESA_H_
|
||||||
|
#define _VESA_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
struct S_Buffer_VESA
|
||||||
|
{
|
||||||
|
// VESA 1.0
|
||||||
|
char Signature[4]; // = 'VESA'
|
||||||
|
word Version; // Nø de version
|
||||||
|
char * Fabricant; // Nom du fabricant
|
||||||
|
dword Capacite; // Bits de capacit‚ du DAC
|
||||||
|
word * Liste_des_modes; // Liste des modes vid‚os support‚s par le VESA
|
||||||
|
word Memoire; // Taille de la m‚moire en blocs de 64K
|
||||||
|
|
||||||
|
// VESA 2.0
|
||||||
|
word Version_bios; // Version du BIOS du fabricant
|
||||||
|
char * Vendeur; // Nom du vendeur
|
||||||
|
char * Produit; // Nom du produit
|
||||||
|
char * Revision; // Nom de la r‚vision
|
||||||
|
|
||||||
|
// Filler
|
||||||
|
byte Filler[990]; // Reserv‚
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
struct S_Buffer_mode_VESA
|
||||||
|
{
|
||||||
|
// VESA 1.0
|
||||||
|
word Attributs; // Attributs du mode (00h)
|
||||||
|
byte Attributs_fenetre_A; // Attributs de la fenˆtre A (02h)
|
||||||
|
byte Attributs_fenetre_B; // Attributs de la fenˆtre B (03h)
|
||||||
|
word Granularite; // Granularit‚ des fenˆtres en Ko (04h)
|
||||||
|
word Taille_fenetres; // Taille des fenˆtres en Ko (06h)
|
||||||
|
word Segment_fenetre_A; // Segment de la fenˆtre A (08h)
|
||||||
|
word Segment_fenetre_B; // Segment de la fenˆtre B (0Ah)
|
||||||
|
byte * WinFuncPtr; // Fonction d'AX=4F05 en mode r‚el(0Ch)
|
||||||
|
word Octets_par_ligne; // Nombre d'octets par ligne (10h)
|
||||||
|
|
||||||
|
// Optionnels ou OEM
|
||||||
|
word Largeur; // Largeur en pixels (12h)
|
||||||
|
word Hauteur; // Hauteur en pixels (14h)
|
||||||
|
byte Largeur_de_char; // Largeur des caractŠres en pxls (16h)
|
||||||
|
byte Hauteur_de_char; // Hauteur des caractŠres en pxls (17h)
|
||||||
|
byte Nb_plans; // Nombre de plans de m‚moire (18h)
|
||||||
|
byte Nb_bits_par_pixel; // Nombre de bits par pixel (19h)
|
||||||
|
byte Nb_banques; // Nombre de banques (1Ah)
|
||||||
|
byte Modele_de_memoire; // ModŠle de m‚moire (1Bh)
|
||||||
|
byte Taille_des_banques; // Taille des banques en Ko (1Ch)
|
||||||
|
byte Nombre_de_pages; // Nombre de pages d'image (1Dh)
|
||||||
|
byte Reserve; // Reserv‚ (=1) (1Eh)
|
||||||
|
|
||||||
|
// VESA 1.2
|
||||||
|
byte Taille_masque_rouge; // Taille du masque des rouges (1Fh)
|
||||||
|
byte Pos_masque_rouge; // Position du masque des rouges (20h)
|
||||||
|
byte Taille_masque_vert; // Taille du masque des verts (21h)
|
||||||
|
byte Pos_masque_vert; // Position du masque des verts (22h)
|
||||||
|
byte Taille_masque_bleu; // Taille du masque des bleus (23h)
|
||||||
|
byte Pos_masque_bleu; // Position du masque des bleus (24h)
|
||||||
|
byte Taille_masque_res; // Taille d'un masque reserv‚ (25h)
|
||||||
|
byte Pos_masque_res; // Position d'un masque reserv‚ (26h)
|
||||||
|
byte Direct_screen_mode; // Direct screen mode info (27h)
|
||||||
|
|
||||||
|
// VESA 2.0
|
||||||
|
byte * Adresse_LFB; // Adresse du LFB (28h)
|
||||||
|
byte * Adresse_offscreen; // Pointeur vers le d‚but de la m‚moire offscreen (2Ch)
|
||||||
|
word Taille_offscreen; // Taille de la m‚moire offscreen en Ko (30h)
|
||||||
|
|
||||||
|
// Filler
|
||||||
|
byte Filler[206];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
word Get_VESA_info ( struct S_Buffer_VESA * Buffer_VESA);
|
||||||
|
word Get_VESA_mode_info(word Mode, struct S_Buffer_mode_VESA * Buffer_mode_VESA);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
BIN
testvesa/weoslite.exe
Normal file
BIN
testvesa/weoslite.exe
Normal file
Binary file not shown.
26
todo.txt
Normal file
26
todo.txt
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
WHAT WE STILL HAVE TO DO TO "COMPLETE" GRAFX 2.00:
|
||||||
|
|
||||||
|
- Rectangles filled with gradation
|
||||||
|
- Distort brushes
|
||||||
|
- Allow to use HSB values to define colors.
|
||||||
|
- FX on the picture (flip, stretch, shrink, ...)
|
||||||
|
- Text (we hope we'll be able to use TrueType fonts)
|
||||||
|
- Improve clicks on buttons in the menus (don't block the mouse).
|
||||||
|
|
||||||
|
|
||||||
|
OTHER POSSIBLE IMPROVEMENTS:
|
||||||
|
|
||||||
|
- Add "Anti-aliasing" mode.
|
||||||
|
- Add more drawing modes.
|
||||||
|
- Support Windows 95 long filenames.
|
||||||
|
- Add more video modes and fix some others.
|
||||||
|
- Add PiNG, TIFf, TarGA and JPeG file supports (in our dreams ;)).
|
||||||
|
- Allow to load more types of truecolor pictures with Dithering or
|
||||||
|
Floyd/Steinberg color reduction.
|
||||||
|
- Add Pop-up menus.
|
||||||
|
- Palette sort.
|
||||||
|
- ...
|
||||||
|
- Fix unknown (and known) bugs! :)
|
||||||
|
|
||||||
|
|
||||||
|
Note: There is no special order for the things to do listed above.
|
||||||
Loading…
x
Reference in New Issue
Block a user