@@ -675,7 +675,7 @@ void z80_device::device_start()
675675 save_item (NAME (m_tmp_irq_vector));
676676 save_item (NAME (m_shared_data.w ));
677677 save_item (NAME (m_shared_data2.w ));
678- save_item (NAME (m_rtemp ));
678+ save_item (NAME (m_irtmp. w ));
679679 save_item (NAME (m_ref));
680680
681681 // Reset registers to their initial values
@@ -710,7 +710,7 @@ void z80_device::device_start()
710710 m_busack_state = 0 ;
711711 m_ea = 0 ;
712712 m_service_attention = 0 ;
713- m_rtemp = 0 ;
713+ m_irtmp. w = 0 ;
714714
715715 space (AS_PROGRAM ).cache (m_args);
716716 space (has_space (AS_OPCODES ) ? AS_OPCODES : AS_PROGRAM ).cache (m_opcodes);
@@ -744,8 +744,9 @@ void z80_device::device_start()
744744 state_add (Z80_DE2 , " DE2" , m_de2.w );
745745 state_add (Z80_HL2 , " HL2" , m_hl2.w );
746746 state_add (Z80_WZ , " WZ" , WZ );
747- state_add (Z80_R , " R" , m_rtemp ).callimport ().callexport ();
747+ state_add (Z80_R , " R" , m_irtmp. b . l ).callimport ().callexport ();
748748 state_add (Z80_I , " I" , m_i);
749+ state_add (Z80_IR , " IR" , m_irtmp.w ).noshow ().callimport ().callexport ();
749750 state_add (Z80_IM , " IM" , m_im).mask (0x3 );
750751 state_add (Z80_IFF1 , " IFF1" , m_iff1).mask (0x1 );
751752 state_add (Z80_IFF2 , " IFF2" , m_iff2).mask (0x1 );
@@ -844,9 +845,12 @@ void z80_device::state_import(const device_state_entry &entry)
844845 case Z80_F : case Z80_AF :
845846 set_f (F);
846847 break ;
848+ case Z80_IR :
849+ m_i = m_irtmp.b .h ;
850+ [[fallthrough]] ;
847851 case Z80_R :
848- m_r = m_rtemp & 0x7f ;
849- m_r2 = m_rtemp & 0x80 ;
852+ m_r = m_irtmp. b . l & 0x7f ;
853+ m_r2 = m_irtmp. b . l & 0x80 ;
850854 break ;
851855
852856 default :
@@ -861,8 +865,8 @@ void z80_device::state_export(const device_state_entry &entry)
861865 case Z80_F : case Z80_AF :
862866 F = get_f ();
863867 break ;
864- case Z80_R :
865- m_rtemp = (m_r & 0x7f ) | (m_r2 & 0x80 );
868+ case Z80_IR : case Z80_R :
869+ m_irtmp. w = (m_i << 8 ) | (( m_r & 0x7f ) | (m_r2 & 0x80 ) );
866870 break ;
867871
868872 default :
0 commit comments