diff --git a/src/jkcemu/Main.java b/src/jkcemu/Main.java index fd1116f..9bb5577 100644 --- a/src/jkcemu/Main.java +++ b/src/jkcemu/Main.java @@ -1,5 +1,5 @@ /* - * (c) 2008-2021 Jens Mueller + * (c) 2008-2022 Jens Mueller * * Kleincomputer-Emulator * @@ -65,9 +65,9 @@ public class Main { public static final String APPNAME = "JKCEMU"; - public static final String VERSION = "0.9.8.1"; + public static final String VERSION = "0.9.8.2"; public static final String APPINFO = APPNAME + " Version " + VERSION; - public static final String COPYRIGHT = "(c) 2008-2021 Jens M\u00FCller"; + public static final String COPYRIGHT = "(c) 2008-2022 Jens M\u00FCller"; public static final String FILE_GROUP_AUDIO = "audio"; public static final String FILE_GROUP_DEBUG_BREAK = "debug.breakpoints"; diff --git a/src/jkcemu/audio/AudioFrm.java b/src/jkcemu/audio/AudioFrm.java index d5ea23b..ef6c460 100644 --- a/src/jkcemu/audio/AudioFrm.java +++ b/src/jkcemu/audio/AudioFrm.java @@ -201,7 +201,11 @@ public static AudioFrm open( ScreenFrm screenFrm ) public void openFile( File file, byte[] fileBytes, int offs ) { - this.tabTapeIn.openFile( file, fileBytes, offs ); + int idx = this.tabbedPane.indexOfComponent( this.tabTapeIn ); + if( idx >= 0 ) { + fireSelectTab( idx ); + this.tabTapeIn.openFile( file, fileBytes, offs ); + } } @@ -358,18 +362,7 @@ public void resetFired( EmuSys newEmuSys, Properties newProps ) // Fenstergroesse anpassen oder Fenster schliessen if( nTabs > 0 ) { pack(); - if( idxToSelect >= 0 ) { - final int idx = idxToSelect; - EventQueue.invokeLater( - new Runnable() - { - @Override - public void run() - { - selectTab( idx ); - } - } ); - } + fireSelectTab( idxToSelect ); } else { doClose(); } @@ -408,6 +401,22 @@ private void enableAudio( } + private void fireSelectTab( final int idx ) + { + if( idx >= 0 ) { + EventQueue.invokeLater( + new Runnable() + { + @Override + public void run() + { + selectTab( idx ); + } + } ); + } + } + + private void selectTab( int idx ) { if( (idx >= 0) && (idx < this.tabbedPane.getTabCount()) ) { diff --git a/src/jkcemu/audio/TapeInFld.java b/src/jkcemu/audio/TapeInFld.java index 57e904f..55b25a6 100644 --- a/src/jkcemu/audio/TapeInFld.java +++ b/src/jkcemu/audio/TapeInFld.java @@ -403,21 +403,27 @@ public boolean checkEnableAudio( Properties props ) public void openFile( File file, byte[] fileBytes, int offs ) { if( (file != null) || (fileBytes != null) ) { - EmuSys emuSys = this.emuThread.getEmuSys(); - if( (emuSys != null) && (getTapeIn() == null) ) { - if( emuSys.supportsTapeIn() ) { - int speedKHz = this.audioFrm.getAndCheckSpeed(); - if( speedKHz > 0 ) { - this.rbFromFile.setSelected( true ); - try { + try { + if( getTapeIn() != null ) { + throw new IOException( "Die Audiofunktion \'Eingang Kassette\'" + + " ist bereits aktiv.\n" + + "Diese m\u00FCssen Sie zuerst deaktivieren,\n" + + "bevor Sie eine neue Datei \u00F6ffnen k\u00F6nnen." ); + } + EmuSys emuSys = this.emuThread.getEmuSys(); + if( emuSys != null ) { + if( emuSys.supportsTapeIn() ) { + int speedKHz = this.audioFrm.getAndCheckSpeed(); + if( speedKHz > 0 ) { + this.rbFromFile.setSelected( true ); enableFile( speedKHz, file, fileBytes, offs ); } - catch( IOException ex ) { - BaseDlg.showErrorDlg( this, ex ); - } } } } + catch( IOException ex ) { + BaseDlg.showErrorDlg( this, ex ); + } } } @@ -748,12 +754,13 @@ public void updFieldsEnabled() boolean pause = false; boolean progress = false; String formatText = null; + AudioIn audioIn = null; File file = this.fldFile.getFile(); EmuSys emuSys = this.emuThread.getEmuSys(); if( emuSys != null ) { + audioIn = emuSys.getTapeIn(); supported = emuSys.supportsTapeIn(); } - AudioIn audioIn = getTapeIn(); if( audioIn != null ) { running = true; fromLine = (audioIn instanceof AudioInLine); @@ -928,7 +935,8 @@ private boolean enableLine() throws IOException private AudioIn getTapeIn() { - return emuThread.getEmuSys().getTapeIn(); + EmuSys emuSys = this.emuThread.getEmuSys(); + return emuSys != null ? emuSys.getTapeIn() : null; } diff --git a/src/jkcemu/base/TabTitleFld.java b/src/jkcemu/base/TabTitleFld.java index ceb0927..69bba76 100644 --- a/src/jkcemu/base/TabTitleFld.java +++ b/src/jkcemu/base/TabTitleFld.java @@ -1,5 +1,5 @@ /* - * (c) 2019-2020 Jens Mueller + * (c) 2019-2022 Jens Mueller * * Kleincomputer-Emulator * @@ -15,7 +15,6 @@ import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTabbedPane; diff --git a/src/jkcemu/emusys/KC85.java b/src/jkcemu/emusys/KC85.java index 8f7d5a4..4c5c2e1 100644 --- a/src/jkcemu/emusys/KC85.java +++ b/src/jkcemu/emusys/KC85.java @@ -1,5 +1,5 @@ /* - * (c) 2008-2021 Jens Mueller + * (c) 2008-2022 Jens Mueller * * Kleincomputer-Emulator * @@ -128,7 +128,7 @@ public class KC85 extends EmuSys implements public static final String VALUE_D004 = "D004"; public static final String VALUE_D008 = "D008"; public static final String VALUE_ROM_20 = "2.0"; - public static final String VALUE_ROM_33 = "3.3"; + public static final String VALUE_ROM_35 = "3.5"; public static final boolean DEFAULT_SWAP_KEY_CHAR_CASE = true; public static final int DEFAULT_PROMPT_AFTER_RESET_MILLIS_MAX_2 = 5000; diff --git a/src/jkcemu/emusys/kc85/D004.java b/src/jkcemu/emusys/kc85/D004.java index 9c14af9..382c87a 100644 --- a/src/jkcemu/emusys/kc85/D004.java +++ b/src/jkcemu/emusys/kc85/D004.java @@ -1,5 +1,5 @@ /* - * (c) 2009-2021 Jens Mueller + * (c) 2009-2022 Jens Mueller * * Kleincomputer-Emulator * @@ -30,9 +30,9 @@ public class D004 extends AbstractKC85Module private static final String TEXT_D004_ROM_FILE = "D004-ROM-Datei"; - private static byte[] romD004_20 = null; - private static byte[] romD004_331_2 = null; - private static byte[] romD004_331_4 = null; + private static byte[] romD004_20 = null; + private static byte[] romD004_35_2 = null; + private static byte[] romD004_35_4 = null; private volatile boolean connected; private boolean cpuEnableValue; @@ -175,15 +175,15 @@ protected byte[] loadROM( KC85 kc85 ) if( romBytes == null ) { if( this.romProp.equals( KC85.VALUE_ROM_20 ) ) { romBytes = getROMBytes20(); - } else if( this.romProp.equals( KC85.VALUE_ROM_33 ) ) { + } else if( this.romProp.equals( KC85.VALUE_ROM_35 ) ) { if( kc85.getKCTypeNum() >= 4 ) { - romBytes = getROMBytes331_4(); + romBytes = getROMBytes35_4(); } else { - romBytes = getROMBytes331_2(); + romBytes = getROMBytes35_2(); } } else { if( kc85.getKCTypeNum() >= 4 ) { - romBytes = getROMBytes331_4(); + romBytes = getROMBytes35_4(); } else { romBytes = getROMBytes20(); } @@ -247,10 +247,16 @@ public int getTypeByte() public int readMemByte( int addr ) { int rv = -1; - if( this.enabled && (this.romBytes != null) ) { - int idx = addr - this.romAddr; - if( (idx >= 0) && (idx < this.romBytes.length) ) { - rv = (int) this.romBytes[ idx ] & 0xFF; + if( this.enabled + && (addr >= this.romAddr) + && (addr < (this.romAddr + 0x2000)) ) + { + rv = 0xFF; + if( this.romBytes != null ) { + int idx = addr - this.romAddr; + if( (idx >= 0) && (idx < this.romBytes.length) ) { + rv = (int) this.romBytes[ idx ] & 0xFF; + } } } return rv; @@ -389,24 +395,24 @@ private byte[] getROMBytes20() } - private byte[] getROMBytes331_2() + private byte[] getROMBytes35_2() { - if( romD004_331_2 == null ) { - romD004_331_2 = EmuUtil.readResource( + if( romD004_35_2 == null ) { + romD004_35_2 = EmuUtil.readResource( this.kc85.getScreenFrm(), - "/rom/kc85/d004_331_2.bin" ); + "/rom/kc85/d004_35_2.bin" ); } - return romD004_331_2; + return romD004_35_2; } - private byte[] getROMBytes331_4() + private byte[] getROMBytes35_4() { - if( romD004_331_4 == null ) { - romD004_331_4 = EmuUtil.readResource( + if( romD004_35_4 == null ) { + romD004_35_4 = EmuUtil.readResource( this.kc85.getScreenFrm(), - "/rom/kc85/d004_331_4.bin" ); + "/rom/kc85/d004_35_4.bin" ); } - return romD004_331_4; + return romD004_35_4; } } diff --git a/src/jkcemu/emusys/kc85/D008.java b/src/jkcemu/emusys/kc85/D008.java index cd0be29..51ce344 100644 --- a/src/jkcemu/emusys/kc85/D008.java +++ b/src/jkcemu/emusys/kc85/D008.java @@ -1,5 +1,5 @@ /* - * (c) 2018-2021 Jens Mueller + * (c) 2018-2022 Jens Mueller * * Kleincomputer-Emulator * @@ -132,10 +132,16 @@ protected byte[] loadROM( KC85 kc85 ) public int readMemByte( int addr ) { int rv = -1; - if( this.enabled && (this.romBytes != null) ) { - int idx = (this.romBank * 0x2000) + addr - this.romAddr; - if( (idx >= 0) && (idx < this.romBytes.length) ) { - rv = (int) this.romBytes[ idx ] & 0xFF; + if( this.enabled + && (addr >= this.romAddr) + && (addr < (this.romAddr + 0x2000)) ) + { + rv = 0xFF; + if( this.romBytes != null ) { + int idx = (this.romBank * 0x2000) + addr - this.romAddr; + if( (idx >= 0) && (idx < this.romBytes.length) ) { + rv = (int) this.romBytes[ idx ] & 0xFF; + } } } return rv; diff --git a/src/jkcemu/emusys/kc85/KC85SettingsFld.java b/src/jkcemu/emusys/kc85/KC85SettingsFld.java index 8aa6117..5816d07 100644 --- a/src/jkcemu/emusys/kc85/KC85SettingsFld.java +++ b/src/jkcemu/emusys/kc85/KC85SettingsFld.java @@ -1,5 +1,5 @@ /* - * (c) 2010-2021 Jens Mueller + * (c) 2010-2022 Jens Mueller * * Kleincomputer-Emulator * @@ -186,7 +186,7 @@ public class KC85SettingsFld private JButton btnModuleDown; private JRadioButton rbDiskStationNone; private JRadioButton rbDiskStationD004_20; - private JRadioButton rbDiskStationD004_33; + private JRadioButton rbDiskStationD004_35; private JRadioButton rbDiskStationD008; private JLabel labelDiskStationRom; private JLabel labelDiskStationSpeed; @@ -403,14 +403,14 @@ public KC85SettingsFld( gbcDiskStation.gridy++; this.tabDiskStation.add( this.rbDiskStationD004_20, gbcDiskStation ); - this.rbDiskStationD004_33 = GUIFactory.createRadioButton( - "Floppy-Disk-Erweiterung D004 mit ROM-Version 3.31" + this.rbDiskStationD004_35 = GUIFactory.createRadioButton( + "Floppy-Disk-Erweiterung D004 mit ROM-Version 3.5" + " (optional mit GIDE)" ); - grpDiskStation.add( this.rbDiskStationD004_33 ); - this.rbDiskStationD004_33.addActionListener( this ); + grpDiskStation.add( this.rbDiskStationD004_35 ); + this.rbDiskStationD004_35.addActionListener( this ); gbcDiskStation.insets.top = 0; gbcDiskStation.gridy++; - this.tabDiskStation.add( this.rbDiskStationD004_33, gbcDiskStation ); + this.tabDiskStation.add( this.rbDiskStationD004_35, gbcDiskStation ); this.rbDiskStationD008 = GUIFactory.createRadioButton( "Floppy-Disk-Erweiterung D008 (immer mit GIDE)" ); @@ -806,9 +806,9 @@ public void applyInput( if( this.rbDiskStationD004_20.isSelected() ) { diskStation = KC85.VALUE_D004; diskStationRom = KC85.VALUE_ROM_20; - } else if( this.rbDiskStationD004_33.isSelected() ) { + } else if( this.rbDiskStationD004_35.isSelected() ) { diskStation = KC85.VALUE_D004; - diskStationRom = KC85.VALUE_ROM_33; + diskStationRom = KC85.VALUE_ROM_35; } else if( this.rbDiskStationD008.isSelected() ) { diskStation = KC85.VALUE_D008; } @@ -917,7 +917,7 @@ protected boolean doAction( EventObject e ) doModuleIntoDiskStation(); } else if( (src == this.rbDiskStationNone) || (src == this.rbDiskStationD004_20) - || (src == this.rbDiskStationD004_33) + || (src == this.rbDiskStationD004_35) || (src == this.rbDiskStationD008) || (src == this.rbDiskStationSpeedDefault) || (src == this.rbDiskStationSpeed8MHz) @@ -1100,7 +1100,7 @@ else if( romType.toLowerCase().startsWith( KC85.VALUE_PREFIX_FILE ) ) { if( diskStationRom20 ) { this.rbDiskStationD004_20.setSelected( true ); } else { - this.rbDiskStationD004_33.setSelected( true ); + this.rbDiskStationD004_35.setSelected( true ); } break; case KC85.VALUE_D008: @@ -1548,7 +1548,7 @@ private int getSelectedModuleModelRow() private boolean isDiskStationEnabled() { return this.rbDiskStationD004_20.isSelected() - || this.rbDiskStationD004_33.isSelected() + || this.rbDiskStationD004_35.isSelected() || this.rbDiskStationD008.isSelected(); } @@ -1646,7 +1646,7 @@ private void showModuleChangePopup( Component c, int x, int y ) private void updDiskStationFieldsEnabled() { boolean d4_20 = this.rbDiskStationD004_20.isSelected(); - boolean d4_33 = this.rbDiskStationD004_33.isSelected(); + boolean d4_33 = this.rbDiskStationD004_35.isSelected(); boolean state = (d4_20 || d4_33 || this.rbDiskStationD008.isSelected()); this.tabGIDE.setEnabledEx( state, d4_20 || d4_33 ); this.labelDiskStationRom.setEnabled( state ); diff --git a/src/jkcemu/etc/ChessboardFrm.java b/src/jkcemu/etc/ChessboardFrm.java index 77e8425..957ad93 100644 --- a/src/jkcemu/etc/ChessboardFrm.java +++ b/src/jkcemu/etc/ChessboardFrm.java @@ -1,5 +1,5 @@ /* - * (c) 2009-2020 Jens Mueller + * (c) 2009-2022 Jens Mueller * * Kleincomputer-Emulator * @@ -161,9 +161,9 @@ private ChessboardFrm( EmuThread emuThread ) // Fenstergroesse + pack(); setResizable( false ); if( !applySettings( Main.getProperties() ) ) { - pack(); setLocationByPlatform( true ); } } diff --git a/src/jkcemu/file/FileActionMngr.java b/src/jkcemu/file/FileActionMngr.java index 4706c80..92dfd2c 100644 --- a/src/jkcemu/file/FileActionMngr.java +++ b/src/jkcemu/file/FileActionMngr.java @@ -52,6 +52,7 @@ import jkcemu.image.ImageFrm; import jkcemu.text.TextEditFrm; import jkcemu.tools.FileChecksumFrm; +import jkcemu.tools.filebrowser.FileBrowserFrm; import jkcemu.tools.fileconverter.FileConvertFrm; import jkcemu.tools.findfiles.FindFilesFrm; import jkcemu.tools.hexdiff.HexDiffFrm; @@ -414,14 +415,12 @@ public void addFileMenuItemsTo( JPopupMenu popup, JMenu menu ) menu ); addSeparator( popup, menu ); - if( DesktopHelper.isOpenSupported() ) { - addJMenuItem( + addJMenuItem( "Mit zugeh\u00F6rigem Programm \u00F6ffnen...", ACTION_OPEN_EXTERNAL, popup, menu ); - addSeparator( popup, menu ); - } + addSeparator( popup, menu ); addJMenuItem( "Pr\u00FCfsumme/Hashwert berechnen...", @@ -633,6 +632,7 @@ public boolean doFileAction( FileObject fObj ) throws IOException } if( !done && DesktopHelper.isOpenSupported() ) { openExternal( file ); + done = true; } } } @@ -966,6 +966,11 @@ private void doFileDelete( { java.util.List paths = getPaths( files ); if( !paths.isEmpty() ) { + /* + * Detailansicht des Datei-Browsers leeren, + * um eventuelle Dateisperren aufzuheben. + */ + FileBrowserFrm.clearPreview(); FileRemover.startRemove( this.owner, paths, @@ -1012,13 +1017,13 @@ private void doFileEditText( private void doFileOpenExternal( java.util.List files ) { + boolean done = false; if( DesktopHelper.isOpenSupported() ) { - File file = getFile( files, false ); - if( file != null ) { - if( file.isFile() || file.isDirectory() ) { - openExternal( file ); - } - } + openExternal( getFile( files, false ) ); + } else { + BaseDlg.showErrorDlg( + this.owner, + "Funktion auf diesem System nicht unterst\u00FCtzt." ); } } @@ -1874,17 +1879,17 @@ private java.util.List getPaths( private void openExternal( File file ) { - if( file.canRead() ) { + if( file != null ) { try { + if( !file.canRead() ) { + throw new IOException( + "Datei/Verzeichnis kann nicht gelesen werden." ); + } DesktopHelper.open( file ); } catch( IOException ex ) { BaseDlg.showErrorDlg( this.owner, ex ); } - } else { - BaseDlg.showErrorDlg( - this.owner, - "Datei/Verzeichnis kann nicht gelesen werden." ); } } diff --git a/src/jkcemu/tools/filebrowser/FileBrowserFrm.java b/src/jkcemu/tools/filebrowser/FileBrowserFrm.java index ef46317..3eb6a88 100644 --- a/src/jkcemu/tools/filebrowser/FileBrowserFrm.java +++ b/src/jkcemu/tools/filebrowser/FileBrowserFrm.java @@ -220,6 +220,13 @@ public class FileBrowserFrm private boolean pasteState; + public static void clearPreview() + { + if( instance != null ) + instance.setPreviewedFileNode( null ); + } + + public static FileBrowserFrm open( ScreenFrm screenFrm ) { if( instance != null ) { diff --git a/src/jkcemu/tools/filebrowser/FilePreviewFld.java b/src/jkcemu/tools/filebrowser/FilePreviewFld.java index fb7e329..e199af3 100644 --- a/src/jkcemu/tools/filebrowser/FilePreviewFld.java +++ b/src/jkcemu/tools/filebrowser/FilePreviewFld.java @@ -259,6 +259,7 @@ public void run() } } if( fileChanged && (this.thread != null) ) { + this.imageCard.setImage( null ); String cardName = null; // Datei auswerten diff --git a/src/jkcemu/tools/filebrowser/ImageCard.java b/src/jkcemu/tools/filebrowser/ImageCard.java index 96cc8f8..dd0a23f 100644 --- a/src/jkcemu/tools/filebrowser/ImageCard.java +++ b/src/jkcemu/tools/filebrowser/ImageCard.java @@ -1,5 +1,5 @@ /* - * (c) 2008-2020 Jens Mueller + * (c) 2008-2021 Jens Mueller * * Kleincomputer-Emulator * @@ -18,6 +18,7 @@ package jkcemu.tools.filebrowser; import java.awt.Component; +import java.awt.EventQueue; import java.awt.Graphics; import java.awt.Image; import java.util.Stack; @@ -48,17 +49,24 @@ public ImageCard() public void setImage( Image image ) { synchronized( this.forFlushing ) { - if( this.orgImage != null ) { - if( image != this.orgImage ) { - /* - * Image.flush() nur im Event-Thread aufrufen, - * d.h. in der paint-Methode - */ - this.forFlushing.push( this.orgImage ); - if( this.scaledImage != null ) { - this.forFlushing.push( this.scaledImage ); - } + if( (this.orgImage != null) && (image != this.orgImage) ) { + /* + * Image.flush() nur im Event-Thread aufrufen, + * d.h. in der paint-Methode + */ + this.forFlushing.push( this.orgImage ); + if( this.scaledImage != null ) { + this.forFlushing.push( this.scaledImage ); } + EventQueue.invokeLater( + new Runnable() + { + @Override + public void run() + { + flushImages(); + } + } ); } this.orgImage = image; this.scaledImage = null; @@ -72,11 +80,6 @@ public void setImage( Image image ) @Override public void paint( Graphics g ) { - synchronized( this.forFlushing ) { - while( !this.forFlushing.empty() ) { - this.forFlushing.pop().flush(); - } - } Image image = this.orgImage; if( image != null ) { int w = getWidth(); @@ -101,7 +104,7 @@ public void paint( Graphics g ) if( (this.scaledImage == null) && (wImg > 0) && (hImg > 0) ) { this.scaledW = wImg; this.scaledH = hImg; - this.scaledImage = this.orgImage.getScaledInstance( + this.scaledImage = image.getScaledInstance( wImg, hImg, Image.SCALE_SMOOTH ); @@ -115,4 +118,16 @@ public void paint( Graphics g ) } } } + + + /* --- private Methoden --- */ + + private void flushImages() + { + synchronized( this.forFlushing ) { + while( !this.forFlushing.empty() ) { + this.forFlushing.pop().flush(); + } + } + } } diff --git a/src/rom/kc85/caos48_c000.bin b/src/rom/kc85/caos48_c000.bin index 386c479..d56d412 100644 Binary files a/src/rom/kc85/caos48_c000.bin and b/src/rom/kc85/caos48_c000.bin differ diff --git a/src/rom/kc85/caos48_e000.bin b/src/rom/kc85/caos48_e000.bin index ef74c52..5ad7f7f 100644 Binary files a/src/rom/kc85/caos48_e000.bin and b/src/rom/kc85/caos48_e000.bin differ diff --git a/src/rom/kc85/d004_331_2.bin b/src/rom/kc85/d004_35_2.bin similarity index 68% rename from src/rom/kc85/d004_331_2.bin rename to src/rom/kc85/d004_35_2.bin index 3a59805..b5253e4 100644 Binary files a/src/rom/kc85/d004_331_2.bin and b/src/rom/kc85/d004_35_2.bin differ diff --git a/src/rom/kc85/d004_331_4.bin b/src/rom/kc85/d004_35_4.bin similarity index 67% rename from src/rom/kc85/d004_331_4.bin rename to src/rom/kc85/d004_35_4.bin index c18b380..1087251 100644 Binary files a/src/rom/kc85/d004_331_4.bin and b/src/rom/kc85/d004_35_4.bin differ diff --git a/src/rom/kc85/d008.bin b/src/rom/kc85/d008.bin index 38fc9e7..be9b0cb 100644 Binary files a/src/rom/kc85/d008.bin and b/src/rom/kc85/d008.bin differ diff --git a/src/z80emu/Z80CPU.java b/src/z80emu/Z80CPU.java index 740230f..7ba7edc 100644 --- a/src/z80emu/Z80CPU.java +++ b/src/z80emu/Z80CPU.java @@ -1,5 +1,5 @@ /* - * (c) 2008-2021 Jens Mueller + * (c) 2008-2022 Jens Mueller * * Z80-Emulator * @@ -138,7 +138,7 @@ public Z80CPU( Z80Memory memory, Z80IOSystem ioSys ) this.pcListener = null; this.addrListener = null; this.tStatesListeners = null; - this.interruptSources = new Z80InterruptSource[ 0 ]; + this.interruptSources = null; this.haltStateListeners = new ArrayList<>(); this.maxSpeedListeners = new ArrayList<>(); this.statusListeners = new ArrayList<>(); @@ -1183,7 +1183,7 @@ public void run() if( this.lastInstWasEIorDI ) { this.lastInstWasEIorDI = false; } else { - if( this.iff1 ) { + if( this.iff1 && (this.interruptSources != null) ) { for( Z80InterruptSource iSource : this.interruptSources ) { if( iSource.isInterruptAccepted() ) { break; @@ -3204,9 +3204,11 @@ private void execED_40to4F( int opCode ) break; case 0x4D: // RETI doInstRETN(); - for( Z80InterruptSource iSource : this.interruptSources ) { - if( iSource.interruptFinish( this.instBegPC ) ) { - break; + if( this.interruptSources != null ) { + for( Z80InterruptSource iSource : this.interruptSources ) { + if( iSource.interruptFinish( this.instBegPC ) ) { + break; + } } } this.instTStates += 14;