Grafx2 can now read and convert gfx2.cfg from the original DOS (96.5%) format.

Older .cfg files in svn were saved incorrectly: the wrong size of chunk #5
(0x0101 instead of 0xE1) made it impossible to re-read the file in gfxcfg.

gfxcfg can read and save gfx2.cfg. Upward compatibility is provided:
- If new chunk types are added to the format, it only needs a re-compile. Older
files can be read and saved.
- If new keyboard shortcuts are added (134 currently), the older files can be
read and the default shortcut will be used for missing keys.

Fixed many endianness cases, hopefully
Fixed LBM loading : bug in ASM->C conversion of Couleur_ILBM_line()
Broke PCX loading : argh!


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@176 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2008-09-29 23:15:08 +00:00
parent 11a4a488a6
commit acfe5836ce
16 changed files with 635 additions and 421 deletions

8
init.c
View File

@@ -1717,8 +1717,7 @@ int Charger_CFG(int Tout_charger)
// Version DOS de Robinson et X-Man
if ( (CFG_Header.Version1== 2)
&& (CFG_Header.Version2== 0)
&& (CFG_Header.Beta1== 96)
&& (CFG_Header.Beta2== 5) )
&& (CFG_Header.Beta1== 96))
{
// Les touches (scancodes) sont à convertir)
Conversion_touches = 1;
@@ -1792,7 +1791,7 @@ int Charger_CFG(int Tout_charger)
}
break;
case CHUNK_MODES_VIDEO: // Modes vidéo
if ((Chunk.Taille/5/*sizeof(CFG_Mode_video)*/)!=NB_MODES_VIDEO)
if ((Chunk.Taille/sizeof(CFG_Mode_video))!=NB_MODES_VIDEO)
goto Erreur_lecture_config;
for (Indice=1; Indice<=NB_MODES_VIDEO; Indice++)
{
@@ -1862,6 +1861,7 @@ int Charger_CFG(int Tout_charger)
case CHUNK_DEGRADES: // Infos sur les dégradés
if (Tout_charger)
{
// fixme endianness : Degrade_Courant est un int, enregistre en byte
if (fread(&Degrade_Courant,1,1,Handle)!=1)
goto Erreur_lecture_config;
for(Indice=0;Indice<16;Indice++)
@@ -1995,7 +1995,7 @@ int Sauver_CFG(void)
// Sauvegarde de l'état de chaque mode vidéo
Chunk.Numero=CHUNK_MODES_VIDEO;
Chunk.Taille=NB_MODES_VIDEO*5 /*sizeof(CFG_Mode_video)*/;
Chunk.Taille=NB_MODES_VIDEO * sizeof(CFG_Mode_video);
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
//On remet les octets dans l'ordre "normal"
Chunk.Taille=bswap_16(Chunk.Taille);