Editorial changes in parse_poke

This commit is contained in:
fabio.olimpieri 2012-08-23 09:29:44 +00:00
parent 4426bfde5f
commit d8367e488f

View File

@ -1225,7 +1225,7 @@ do
fscanf(fpoke, "%1s %d %d %d %d", &flag, &bank, &address, &value, &original_value); fscanf(fpoke, "%1s %d %d %d %d", &flag, &bank, &address, &value, &original_value);
if (((flag!='M')&&(flag!='Z'))||(bank>8)||(bank<0)||(address>0xFFFF)||(address<0x4000)||(value>256)||(value<0)||(original_value>255)||(original_value<0)) {ritorno=1;break;} if (((flag!='M')&&(flag!='Z'))||(bank>8)||(bank<0)||(address>0xFFFF)||(address<0x4000)||(value>256)||(value<0)||(original_value>255)||(original_value<0)) {ritorno=1;break;}
if (feof(fpoke)) {ritorno=1;break;} if (feof(fpoke)) {ritorno=1;break;}
if ((!(bank&0x8))&&((ordenador.mode128k==1)||(ordenador.mode128k==2)||(ordenador.mode128k==4))) //+3? if ((!(bank&0x8))&&(ordenador.mode128k)) //128k,+2,+3,SP
{ {
old_mport1 = ordenador.mport1; old_mport1 = ordenador.mport1;
ordenador.mport1 = (unsigned char) (bank&0x7); ordenador.mport1 = (unsigned char) (bank&0x7);
@ -1237,7 +1237,7 @@ do
{if (original_value) old_poke[trainer][poke]=(unsigned char) original_value; else old_poke[trainer][poke]= Z80free_Rd_fake ((word) address);} {if (original_value) old_poke[trainer][poke]=(unsigned char) original_value; else old_poke[trainer][poke]= Z80free_Rd_fake ((word) address);}
if (restore) value = (int) old_poke[trainer][poke]; if (restore) value = (int) old_poke[trainer][poke];
} }
//if ((value == 256) && (k & KEY_SELECT)) {value = choice_value(); Z80free_Wr_fake ((word)address, (unsigned char) value);} TODO
if (((value < 256) && (k & KEY_SELECT))||(restore)) Z80free_Wr_fake ((word)address, (unsigned char) value); if (((value < 256) && (k & KEY_SELECT))||(restore)) Z80free_Wr_fake ((word)address, (unsigned char) value);
ordenador.mport1 = old_mport1; ordenador.mport1 = old_mport1;
set_memory_pointers (); // set the pointers set_memory_pointers (); // set the pointers
@ -1250,10 +1250,10 @@ do
{if (original_value) old_poke[trainer][poke]=(unsigned char) original_value; else old_poke[trainer][poke]= Z80free_Rd_fake ((word) address);} {if (original_value) old_poke[trainer][poke]=(unsigned char) original_value; else old_poke[trainer][poke]= Z80free_Rd_fake ((word) address);}
if (restore) value = (int) old_poke[trainer][poke]; if (restore) value = (int) old_poke[trainer][poke];
} }
//if ((value == 256) && (k & KEY_SELECT)) {value = choice_value(); Z80free_Wr_fake ((word)address, (unsigned char) value);} TODO
if (((value < 256) && (k & KEY_SELECT))||(restore)) Z80free_Wr_fake ((word)address, (unsigned char) value); if (((value < 256) && (k & KEY_SELECT))||(restore)) Z80free_Wr_fake ((word)address, (unsigned char) value);
} }
poke++; poke++;
} }
while (flag!='Z'); while (flag!='Z');