Record RZX frame only when interrupt acnoldge or framcount >0

This commit is contained in:
fabio.olimpieri 2015-03-10 17:15:52 +00:00
parent d84f553d81
commit a4dd41f9b4
5 changed files with 14 additions and 3 deletions

View File

@ -1833,7 +1833,11 @@ int main(int argc,char *argv[])
if(ordenador.interr==1) {
Z80free_INT(&procesador,bus_empty());
if ((ordenador.precision==0)||(jump_frames>0)) ordenador.interr=0;
if (ordenador.recording_rzx) {if (ordenador.icount != 0xFFFF) rzx_update(&ordenador.icount);ordenador.icount=0;}
if (ordenador.recording_rzx)
{
if (ordenador.icount == 0xFFFF) ordenador.icount=0;
else if (test_IFF1(&procesador)||(ordenador.icount>10)) {rzx_update(&ordenador.icount);ordenador.icount=0;}
}
}
}

View File

@ -1952,7 +1952,7 @@ static int do_rzx(int which)
ordenador.frames_count_rzx=1;
retorno2 = load_rzx();
if (retorno2) break; //Error or no file
retorno2 = rzx_update(&ordenador.maxicount);
retorno2 = rzx_update(&ordenador.maxicount); //The first frame does not generate interrupt
if (retorno2 == RZX_FINISHED) {printf("RZX: Playing finished at fisrt frame\n"); break;}
//ordenador.cicles_counter=32; //to avoid the interrupt at first frame
ordenador.playing_rzx = 1;

View File

@ -293,6 +293,8 @@ void rzx_close_irb()
block.start=pos;
/* signal that we have exited the IRB */
rzx_status&=~RZX_IRB;
INcount=0;
INold=0xFFFF;
}
@ -678,7 +680,6 @@ int rzx_update(rzx_u16 *icount)
rzx_popen(fpos,"wb");
}
#endif
INcount=0;
INold=0xFFFF;
}

View File

@ -67,6 +67,11 @@ int Z80free_step(Z80FREE *processor) {
return (retval);
}
byte test_IFF1 (Z80FREE *processor)
{
return processor->IFF1;
}
int Z80free_ustep(Z80FREE *processor) {
static byte opcode,d1;

View File

@ -147,6 +147,7 @@ void Z80free_Wr_fake (register word Addr, register byte Value);
byte Z80free_In (register word Port);
void Z80free_Out (register word Port, register byte Value);
void Z80free_Out_fake (register word Port, register byte Value);
byte test_IFF1 (Z80FREE *);
/* Opcode functions */