file_name
stringlengths
6
86
file_path
stringlengths
45
249
content
stringlengths
47
6.26M
file_size
int64
47
6.26M
language
stringclasses
1 value
extension
stringclasses
1 value
repo_name
stringclasses
767 values
repo_stars
int64
8
14.4k
repo_forks
int64
0
1.17k
repo_open_issues
int64
0
788
repo_created_at
stringclasses
767 values
repo_pushed_at
stringclasses
767 values
DialogAttachImage.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/DialogAttachImage.java
package net.sourceforge.fidocadj.dialogs; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.awt.image.*; import java.io.*; import javax.imageio.*; import javax.swing.event.*; import net.sourceforge.fidocadj.globals.Globals; import net.sourceforge.fidocadj.dialogs.mindimdialog.MinimumSizeDialog; /** The class DialogAttachImage allows to determine which image has to be attached and shown as a background (for retracing/vectorization purposes). <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2017-2023 by Davide Bucci </pre> @author Davide Bucci */ public final class DialogAttachImage extends MinimumSizeDialog { private final JFrame parent; // Parent window private final JTextField fileName; // File name text field private final JTextField resolution; // Resolution text field private final JTextField xcoord; // x coordinate of the left top corner private final JTextField ycoord; // y coordinate of the left top corner private final JTextField xsize; // x size in mm of the image private final JTextField ysize; // y size in mm of the image private BufferedImage img; private boolean isCalculating; // A size calculation is being made. private static final int useResolution=0; private static final int useSizeX=1; private static final int useSizeY=2; private boolean attach; // Indicates that the attach should be done private boolean showImage; /** Standard constructor. @param p the dialog parent */ public DialogAttachImage(JFrame p) { super(500, 450, p, Globals.messages.getString("Attach_image_t"), true); parent=p; showImage=true; int ygrid=0; // Obtain the current content pane and create the grid layout manager // which will be used for putting the elements of the interface. GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints; Container contentPane=getContentPane(); contentPane.setLayout(bgl); JLabel lblfilename= new JLabel(Globals.messages.getString("Image_file_attach")); constraints = DialogUtil.createConst(0,ygrid,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,6,6,6)); contentPane.add(lblfilename, constraints); fileName=new JTextField(10); fileName.setText(""); fileName.getDocument().addDocumentListener(new DocumentListener() { /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void insertUpdate(DocumentEvent e) { loadImage(); } /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void removeUpdate(DocumentEvent e) { loadImage(); } /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void changedUpdate(DocumentEvent e) { loadImage(); } }); constraints = DialogUtil.createConst(1,ygrid,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,6,6,6)); contentPane.add(fileName, constraints); JButton browse=new JButton(Globals.messages.getString("Browse")); constraints = DialogUtil.createConst(2,ygrid++,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(6,0,12,12)); contentPane.add(browse, constraints); browse.addActionListener(createBrowseActionListener()); JLabel lblresolution= new JLabel(Globals.messages.getString("Image_resolution")); constraints = DialogUtil.createConst(0,ygrid,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,6,6,6)); contentPane.add(lblresolution, constraints); resolution=new JTextField(10); resolution.setText("200"); // If the user changes the resolution, update the size calculation. resolution.getDocument().addDocumentListener(new DocumentListener() { /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void insertUpdate(DocumentEvent e) { calculateSizeAndResolution(useResolution); } /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void removeUpdate(DocumentEvent e) { calculateSizeAndResolution(useResolution); } /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void changedUpdate(DocumentEvent e) { calculateSizeAndResolution(useResolution); } }); constraints = DialogUtil.createConst(1,ygrid++,2,1,100,100, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,6,6,6)); contentPane.add(resolution, constraints); JLabel lblsize= new JLabel(Globals.messages.getString("Image_size_mm")); constraints = DialogUtil.createConst(0,ygrid,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,6,6,6)); contentPane.add(lblsize, constraints); xsize=new JTextField(5); xsize.setText(""); xsize.getDocument().addDocumentListener(new DocumentListener() { /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void insertUpdate(DocumentEvent e) { calculateSizeAndResolution(useSizeX); } /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void removeUpdate(DocumentEvent e) { calculateSizeAndResolution(useSizeX); } /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void changedUpdate(DocumentEvent e) { calculateSizeAndResolution(useSizeX); } }); constraints = DialogUtil.createConst(1,ygrid,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,6,6,6)); contentPane.add(xsize, constraints); ysize=new JTextField(5); ysize.setText(""); ysize.getDocument().addDocumentListener(new DocumentListener() { /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void insertUpdate(DocumentEvent e) { calculateSizeAndResolution(useSizeY); } /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void removeUpdate(DocumentEvent e) { calculateSizeAndResolution(useSizeY); } /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void changedUpdate(DocumentEvent e) { calculateSizeAndResolution(useSizeY); } }); constraints = DialogUtil.createConst(2,ygrid++,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,6,6,6)); contentPane.add(ysize, constraints); JLabel lblcoords= new JLabel(Globals.messages.getString("Top_left_coords")); constraints = DialogUtil.createConst(0,ygrid,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,6,6,6)); contentPane.add(lblcoords, constraints); xcoord=new JTextField(5); xcoord.setText("0"); constraints = DialogUtil.createConst(1,ygrid,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,6,6,6)); contentPane.add(xcoord, constraints); ycoord=new JTextField(5); ycoord.setText("0"); constraints = DialogUtil.createConst(2,ygrid++,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,6,6,6)); contentPane.add(ycoord, constraints); // Put the No image, OK and Cancel buttons and make them active. JButton noImg=new JButton(Globals.messages.getString("No_img")); JButton ok=new JButton(Globals.messages.getString("Ok_btn")); JButton cancel=new JButton(Globals.messages.getString("Cancel_btn")); Box b=Box.createHorizontalBox(); b.add(Box.createHorizontalGlue()); ok.setPreferredSize(cancel.getPreferredSize()); b.add(noImg); b.add(Box.createHorizontalStrut(12)); if (Globals.okCancelWinOrder) { b.add(ok); b.add(Box.createHorizontalStrut(12)); b.add(cancel); } else { b.add(cancel); b.add(Box.createHorizontalStrut(12)); b.add(ok); } constraints = DialogUtil.createConst(1,ygrid++,3,1,0,0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12,40,0,0)); contentPane.add(b, constraints); // Add buttons noImg.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { attach=true; showImage=false; fileName.setText(""); setVisible(false); } }); ok.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { if(validateForm()) { attach=true; setVisible(false); } } }); cancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { setVisible(false); } }); // Here is an action in which the dialog is closed AbstractAction cancelAction = new AbstractAction () { @Override public void actionPerformed (ActionEvent e) { setVisible(false); } }; DialogUtil.addCancelEscape (this, cancelAction); pack(); DialogUtil.center(this); getRootPane().setDefaultButton(ok); } /** Calculate the relations between size and resolution of the image. @param useSize if true, calculate resolution from size. if false, calculate size from resolution. */ private void calculateSizeAndResolution(int useSize) { if(isCalculating || img==null) { return; } isCalculating=true; final double oneinch=25.4; // Conversion between inches and mm. switch (useSize) { case useResolution: try { double res=getResolution(); double w=img.getWidth()/res*oneinch; double h=img.getHeight()/res*oneinch; xsize.setText(Globals.roundTo(w,3)); ysize.setText(Globals.roundTo(h,3)); } catch (NumberFormatException eE){ isCalculating=false; return; } break; case useSizeX: try { double sizex=getSizeX(); double res=img.getWidth()/sizex*oneinch; setResolution(res); double h=img.getHeight()/res*oneinch; ysize.setText(Globals.roundTo(h,3)); } catch (NumberFormatException eE){ isCalculating=false; return; } break; case useSizeY: try { double sizey=getSizeY(); double res=img.getHeight()/sizey*oneinch; setResolution(res); double w=img.getWidth()/res*oneinch; xsize.setText(Globals.roundTo(w,3)); } catch (NumberFormatException eE){ isCalculating=false; return; } break; default: } isCalculating=false; } /** By implementing writeObject method, // we can prevent // subclass from serialization */ private void writeObject(ObjectOutputStream out) throws IOException { throw new NotSerializableException(); } /* By implementing readObject method, // we can prevent // subclass from de-serialization */ private void readObject(ObjectInputStream in) throws IOException { throw new NotSerializableException(); } /** Create an action listener which handle clicking on the 'browse' button. @return the ActionListener */ private ActionListener createBrowseActionListener() { return new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { // Open the browser in order to let the user select the file // name on which export if(Globals.useNativeFileDialogs) { // Native file dialog FileDialog fd = new FileDialog(parent, Globals.messages.getString("Select_file_export"), FileDialog.LOAD); String filen; // Set defaults and make visible. fd.setDirectory(new File(fileName.getText()).getPath()); fd.setVisible(true); // The user has selected a file. if(fd.getFile() != null) { filen=Globals.createCompleteFileName( fd.getDirectory(), fd.getFile()); fileName.setText(filen); } } else { // Swing file dialog JFileChooser fc = new JFileChooser( new File(fileName.getText()).getPath()); int r = fc.showOpenDialog(null); if (r == JFileChooser.APPROVE_OPTION) { fileName.setText(fc.getSelectedFile().toString()); } } loadImage(); calculateSizeAndResolution(useResolution); } }; } /** Validate the data entered by the user. @return true if the data is valid. */ private boolean validateForm() { try { img=ImageIO.read(new File(getFilename())); getResolution(); getSizeX(); getSizeY(); getCornerX(); getCornerY(); } catch (NumberFormatException nN) { JOptionPane.showMessageDialog(parent, Globals.messages.getString("Format_invalid"), "", JOptionPane.INFORMATION_MESSAGE); return false; } catch (IOException eE) { JOptionPane.showMessageDialog(parent, Globals.messages.getString("Can_not_attach_image"), "", JOptionPane.INFORMATION_MESSAGE); return false; } return true; } /** Load the background image. Or at least try to do it! */ private void loadImage() { try { img=ImageIO.read(new File(getFilename())); } catch (IOException eE) { System.err.println("Error: Could not load the background image"); } } /** Indicates that the image attach should be done: the user selected the "ok" button. @return a boolean value which indicates if the attach should be done. */ public boolean shouldAttach() { return attach; } /** Get the filename @return a string containing the file name given by the user. */ public String getFilename() { return fileName.getText(); } /** Set the filename @param s a string containing the file name given by the user. */ public void setFilename(String s) { fileName.setText(s); } /** Get the resolution. @return the resolution in dpi of the image to be used. */ public double getResolution() { return Double.parseDouble(resolution.getText()); } /** Get the width of the image. @return the width in mm */ public double getSizeX() { return Double.parseDouble(xsize.getText()); } /** Get the height of the image. @return the height in mm */ public double getSizeY() { return Double.parseDouble(ysize.getText()); } /** Set the resolution @param r the resolution in dpi of the image to be used. */ public void setResolution(double r) { resolution.setText(Globals.roundTo(r)); } /** Set the coordinates of the left topmost point of the image (use FidoCadJ coordinates). @param x the x coordinate. @param y the y coordinate. */ public void setCorner(double x, double y) { xcoord.setText(Globals.roundTo(x,3)); ycoord.setText(Globals.roundTo(y,3)); } /** Get the x coordinate of the left topmost point of the image (use FidoCadJ coordinates). @return the x coordinate. */ public double getCornerX() { return Double.parseDouble(xcoord.getText()); } /** Check if the image has to be shown or not. @return true if the image attached has to be shown. */ public boolean getShowImage() { return showImage; } /** Get the currently loaded image. @return the image. */ public BufferedImage getImage() { return img; } /** Get the y coordinate of the left topmost point of the image (use FidoCadJ coordinates). @return the y coordinate. */ public double getCornerY() { return Double.parseDouble(ycoord.getText()); } }
19,941
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
BareBonesBrowserLaunch.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/BareBonesBrowserLaunch.java
package net.sourceforge.fidocadj.dialogs; import javax.swing.JOptionPane; /** <b>Bare Bones Browser Launch for Java</b><br> Utility class to open a web page from a Swing application in the user's default browser.<br> Supports: Mac OS X, GNU/Linux, Unix, Windows XP/Vista/7<br> Example Usage:<code><br> &nbsp; &nbsp; String url = "http://www.google.com/";<br> &nbsp; &nbsp; BareBonesBrowserLaunch.openURL(url);<br></code> Latest Version: <a href="http://www.centerkey.com/java/browser/"> www.centerkey.com/java/browser</a><br> Author: Dem Pilafian<br> Public Domain Software -- Free to Use as You Like @version 3.1, June 6, 2010 - (mod. 2023) */ public final class BareBonesBrowserLaunch { static final String[] browsers = { "google-chrome", "firefox", "opera", "epiphany", "konqueror", "conkeror", "midori", "kazehakase", "mozilla" }; static final String errMsg = "Error attempting to launch web browser"; private BareBonesBrowserLaunch() { // Does nothing. } /** Opens the specified web page in the user's default browser @param url A web address (URL) of a web page (ex: "http://www.google.com/") */ public static void openURL(String url) { try { //attempt to use Desktop library from JDK 1.6+ Class<?> d = Class.forName("java.awt.Desktop"); d.getDeclaredMethod("browse", new Class[] {java.net.URI.class}).invoke( d.getDeclaredMethod("getDesktop").invoke(null), new Object[] {java.net.URI.create(url)}); //above code mimicks: java.awt.Desktop.getDesktop().browse() } catch (Exception ignore) { //library not available or failed String osName = System.getProperty("os.name"); try { if (osName.startsWith("Mac OS")) { Class.forName("com.apple.eio.FileManager") .getDeclaredMethod("openURL", new Class[] {String.class}).invoke(null, new Object[] {url}); } else if (osName.startsWith("Windows")) { Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler " + url); } else { //assume Unix or Linux String browser = null; for (String b : browsers) { if (browser == null && Runtime.getRuntime().exec(new String[] {"which", b}).getInputStream().read() != -1) { Runtime.getRuntime().exec(new String[] {browser = b, url}); } } if (browser == null) { System.out.println("Browser not found"); } } } catch (Exception e) { JOptionPane.showMessageDialog(null, errMsg + "\n" + e.toString()); } } } }
3,171
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
ParameterDescription.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/ParameterDescription.java
package net.sourceforge.fidocadj.dialogs; /** The user should check the parameter type before using. The allowed parameter types are: (Integer|Double|String|Boolean|Point). <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2008-2023 by Davide Bucci </pre> @author Davide Bucci */ public class ParameterDescription { public Object parameter; // the parameter to be passed public String description; // string describing the parameter public boolean isExtension; // is this parameter a extension of FidoCAD? /** Creator. */ public ParameterDescription () { isExtension = false; } /** Obtain a text representation of the object, mainly for debug purposes. @return the representation of the object. */ @Override public String toString() { String s; s="[ParameterDescription("+parameter+", "+description+"]"; return s; } }
1,634
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
CellLayer.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/CellLayer.java
package net.sourceforge.fidocadj.dialogs; import java.io.*; import java.awt.*; import javax.swing.*; import net.sourceforge.fidocadj.graphic.swing.ColorSwing; import net.sourceforge.fidocadj.layers.LayerDesc; /** The class CellLayer is a simple panel showing the color, the visibility and the description of each layer. To be used with LayerCellRenderer @author Davide Bucci <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. </pre> Copyright 2007-2023 by Davide Bucci */ public class CellLayer extends JPanel { private final JList list; private final boolean isSelected; private final LayerDesc layer; /** Constructor. The user should provide the list in which the element is used, information about the layer as well as the selection state @param la the layer to be used @param l the JList in which the element is used @param is the selection state which will be used for the background */ CellLayer(LayerDesc la, JList l, boolean is) { layer=la; list=l; isSelected=is; setPreferredSize(new Dimension(150,18)); } /** By implementing writeObject method, // we can prevent // subclass from serialization */ private void writeObject(ObjectOutputStream out) throws IOException { throw new NotSerializableException(); } /* By implementing readObject method, // we can prevent // subclass from de-serialization */ private void readObject(ObjectInputStream in) throws IOException { throw new NotSerializableException(); } /** Here we draw the layer description. A coloured box followed by the name of the layer. We need to take care if the element is selected or not. In this case, we change accordingly the background of the part where we are writing the layer name. @param g the graphic context on which to draw. */ @Override public void paintComponent(Graphics g) { g.setColor(isSelected ? list.getSelectionBackground(): list.getBackground()); g.fillRect(0,0, getWidth(), getHeight()); ColorSwing c=(ColorSwing) layer.getColor(); g.setColor(c.getColorSwing()); g.fillRect(2,2, getHeight(), getHeight()-4); if(layer.getVisible()) { if (isSelected) { g.setColor(list.getSelectionForeground()); } } else { g.setColor(SystemColor.textInactiveText); } Graphics2D g2=(Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); //g.setFont(new Font("Helvetica", Font.PLAIN, 14)); g.drawString(layer.getDescription(), 6*getHeight()/4, (int)(3.8*getHeight()/5)); } }
3,568
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
OSKeybPanel.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/OSKeybPanel.java
package net.sourceforge.fidocadj.dialogs; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.UIManager; /** Create a small virtual keyboard for help inserting UTF-8 symbols such as greek alphabet letters and so on. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2012-2023 by phylum2, Davide Bucci TODO: avoid using magic numbers in the code </pre> @author phylum2 */ public final class OSKeybPanel extends JPanel { String symbols = "\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A" +"\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\u03A3\u03A4\u03A5" +"\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6" +"\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0" +"\u03C1\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8\u03C9@\00uA7\u00B7" +"\u00F7\u00D7\u00B1\u2264\u2265\u2260\u2261\u007E\u2248\u221E" +"\u221A\u00AF\u2211\u2202\u2229\u222B\u00AB\u00BB\u00A6\u007C" +"\u00F8\u00BC\u00BD\u00BE\u215B\u215C\u215D\u215E\u2030\u00BA" +"\u00AA\u00B9\u00B2\u00B3\u00B0\u02DC\u2194\u2192\u2190\u2193" +"\u2191\u0027"; JButton[] k = new JButton[symbols.length()]; JDialog txt; int posX=0; int posY=0; /** Attach the current panel to a dialog to intercept keyboard operations. @param o the dialog to be attached to. */ public void setField(JDialog o) { txt = o; } /** Types of keyboard available. */ public enum KEYBMODES {GREEK, MATH, MISC} /** Create the keyboard panel of the selected type. @param mode type of the keyboard to be employed. */ public OSKeybPanel(KEYBMODES mode) { super(); GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints=new GridBagConstraints(); setLayout(bgl); constraints = DialogUtil.createConst(0,0,1,1,0,0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0)); Font standardF = UIManager.getDefaults().getFont("TextPane.font"); int size = standardF.getSize(); Font f = new Font("Courier New",0,size+1); Font fbig = new Font("Courier New",0,size+2); ActionListener al = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JDialog jd = (JDialog) txt; // We must find a target for the results of the keyboard // actions. if (!(jd.getMostRecentFocusOwner() instanceof JTextField)) { return; } JTextField jfd = (JTextField)jd.getMostRecentFocusOwner(); if (jfd.getSelectedText()!=null) { String ee = jfd.getText().replace( jfd.getSelectedText(), ""); jfd.setText(ee); } int p = jfd.getCaretPosition(); if (p<0) { jfd.setText(jfd.getText()+e.getActionCommand()); } else { String s = jfd.getText().substring(0,p); String t = jfd.getText().substring(p); jfd.setText(s+e.getActionCommand()+t); jfd.setCaretPosition(++p); } jfd.requestFocus(); } }; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 100; constraints.weighty = 100; // Create an array of buttons containing the array characters. // All is done automatically, so changing the array contents // automatically will change the buttons. for (int i=0;i<symbols.length();i++) { k[i] = new JButton(String.valueOf(symbols.charAt(i))); if (mode == KEYBMODES.GREEK && i>47) { continue; } if (mode == KEYBMODES.MISC && i<48) { continue; } k[i].setFont(i>71 ? fbig : f); k[i].setFocusable(false); k[i].addActionListener(al); k[i].putClientProperty("Quaqua.Button.style","toggleCenter"); if (constraints.gridx>7) { k[i].putClientProperty("Quaqua.Button.style","toggleWest"); constraints.gridy++; constraints.gridx=0; k[i-1].putClientProperty("Quaqua.Button.style","toggleEast"); } add(k[i], constraints); constraints.gridx++; } // TODO: avoid using numbers in the code, but calculate automatically // the indices. k[0].putClientProperty("Quaqua.Button.style","toggleWest"); k[symbols.length()-1].putClientProperty( "Quaqua.Button.style","toggleEast"); k[47].putClientProperty("Quaqua.Button.style","toggleEast"); k[48].putClientProperty( "Quaqua.Button.style","toggleWest"); } }
5,962
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
DialogCopyAsImage.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/DialogCopyAsImage.java
package net.sourceforge.fidocadj.dialogs; import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import net.sourceforge.fidocadj.globals.Globals; import net.sourceforge.fidocadj.graphic.DimensionG; import net.sourceforge.fidocadj.graphic.PointG; import net.sourceforge.fidocadj.dialogs.mindimdialog.MinimumSizeDialog; import net.sourceforge.fidocadj.circuit.model.DrawingModel; import net.sourceforge.fidocadj.geom.DrawingSize; import net.sourceforge.fidocadj.circuit.views.Export; /** Choose file format, size and options for the "Copy as image". This dialog is a stripped-down version of the DialogExport one. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2020-2023 by Davide Bucci </pre> @author Davide Bucci */ public final class DialogCopyAsImage extends MinimumSizeDialog implements ActionListener { private boolean copy; // Indicates that the copy should be done private static final double EPS=1E-5; // Resolution comparison precision // Swing elements private JComboBox<String> resolution; // Resolution combo box private JCheckBox antiAlias_CB; // AntiAlias checkbox private JCheckBox blackWhite_CB; // Black and white checkbox private final JTabbedPane tabsPane; // Tab panel for res/size exp. private JTextField xsizePixel; // The x size of the image private JTextField ysizePixel; // The y size of the image private final DrawingModel dm; // The drawing to be exported private final DimensionG dim; // The drawing size in l.u. private JLabel expectedSize; // The calculated size /** Constructor: it needs the parent frame. @param p the dialog's parent. @param c the drawing model containing the drawing to be exported. */ public DialogCopyAsImage (JFrame p, DrawingModel c) { super(450,400,p,Globals.messages.getString("Circ_exp_t"), true); // Ensure that under MacOSX >= 10.5 Leopard, this dialog will appear // as a document modal sheet (NOTE: it does not work) dm=c; getRootPane().putClientProperty("apple.awt.documentModalSheet", Boolean.TRUE); // Calculate the size of the drawing in logic units: PointG o=new PointG(); dim = DrawingSize.getImageSize(dm,1.0,true,o); addComponentListener(this); copy=false; // Obtain the current content pane and create the grid layout manager // which will be used for putting the elements of the interface. GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints; Container contentPane=getContentPane(); contentPane.setLayout(bgl); constraints = DialogUtil.createConst(1,0,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(12,40,0,0)); JPanel panel = createResolutionBasedExportPanel(); constraints.gridx=0; constraints.gridy=0; constraints.weightx=100; constraints.weighty=100; constraints.gridy=0; constraints.gridwidth=4; constraints.gridheight=2; constraints.anchor=GridBagConstraints.EAST; constraints.fill=GridBagConstraints.BOTH; constraints.insets=new Insets(20,20,20,20); tabsPane = new JTabbedPane(); tabsPane.addTab(Globals.messages.getString("res_export"), panel); JPanel sizepanel = createSizeBasedExportPanel(); tabsPane.addTab(Globals.messages.getString("size_export"), sizepanel); contentPane.add(tabsPane, constraints); constraints.gridx=0; constraints.gridy=2; constraints.gridwidth=4; constraints.gridheight=1; constraints.anchor=GridBagConstraints.EAST; constraints.fill=GridBagConstraints.HORIZONTAL; constraints.insets=new Insets(20,20,20,20); JPanel commonPane = createCommonInterfaceElements(); contentPane.add(commonPane, constraints); constraints.gridx=0; constraints.gridy=3; constraints.gridwidth=4; constraints.gridheight=1; constraints.anchor=GridBagConstraints.EAST; constraints.insets=new Insets(20,20,20,20); // Put the OK and Cancel buttons and make them active. Box b=Box.createHorizontalBox(); b.add(Box.createHorizontalGlue()); JButton ok=new JButton(Globals.messages.getString("Ok_btn")); JButton cancel=new JButton(Globals.messages.getString("Cancel_btn")); ok.setPreferredSize(cancel.getPreferredSize()); if (Globals.okCancelWinOrder) { b.add(ok); b.add(Box.createHorizontalStrut(12)); b.add(cancel); } else { b.add(cancel); b.add(Box.createHorizontalStrut(12)); b.add(ok); } contentPane.add(b, constraints); // Add cancel button ok.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { int selection; selection=JOptionPane.OK_OPTION; if (selection==JOptionPane.OK_OPTION) { copy=true; setVisible(false); } } }); cancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { setVisible(false); } }); // Here is an action in which the dialog is closed AbstractAction cancelAction = new AbstractAction () { @Override public void actionPerformed (ActionEvent e) { setVisible(false); } }; DialogUtil.addCancelEscape (this, cancelAction); pack(); DialogUtil.center(this); getRootPane().setDefaultButton(ok); } /** By implementing writeObject method, // we can prevent // subclass from serialization */ private void writeObject(ObjectOutputStream out) throws IOException { throw new NotSerializableException(); } /* By implementing readObject method, // we can prevent // subclass from de-serialization */ private void readObject(ObjectInputStream in) throws IOException { throw new NotSerializableException(); } /** Indicates that the copy should be done: the user selected the "ok" button. @return a boolean value which indicates if the copy should be done. */ public boolean shouldExport() { return copy; } /** Indicates that the antiAlias should be activated. @return a boolean value which indicates if the anti alias should be activated. */ public boolean getAntiAlias() { return antiAlias_CB.isSelected(); } /** Indicates that the black and white copy should be activated. @return a boolean value which indicates if the copy should be done in black and white. */ public boolean getBlackWhite() { return blackWhite_CB.isSelected(); } /** Indicates if the copy should be size-based or resolution-based. @return true if the copy is size-based (i.e. the image size in pixels should be given) or false if the copy is resolution-based (i.e. the image size is calculated from the typographical resolution. */ public boolean getResolutionBasedExport() { return tabsPane.getSelectedIndex()==0; } /** Set if the copy should be size-based or resolution-based. @param s true if the copy is size-based (i.e. the image size in pixels should be given) or false if the copy is resolution-based (i.e. the image size is calculated from the typographical resolution. */ public void setResolutionBasedExport(boolean s) { tabsPane.setSelectedIndex(s?0:1); } /** Sets the actual anti alias state @param a a boolean which indicates the default anti alias state */ public void setAntiAlias(boolean a) { antiAlias_CB.setSelected(a); } /** Sets the actual black and white state @param a a boolean which indicates the default black and white state */ public void setBlackWhite(boolean a) { blackWhite_CB.setSelected(a); } /** Set the default unit per pixel value @param d the default unit per pixel value */ public void setUnitPerPixel(double d) { int index=0; if (Math.abs(d-0.36)<EPS) { index=0; } if (Math.abs(d-0.75)<EPS) { index=1; } if (Math.abs(d-1.50)<EPS) { index=2; } if (Math.abs(d-3.00)<EPS) { index=3; } if (Math.abs(d-6.00)<EPS) { index=4; } if (Math.abs(d-9.00)<EPS) { index=5; } if (Math.abs(d-12.0)<EPS) { index=6; } resolution.setSelectedIndex(index); } /** Set the x size of the picture. @param xs the wanted x size. */ public void setXsizeInPixels(int xs) { xsizePixel.setText(""+xs); } /** If the resolution is size-based, get the x size of the picture. @return the wanted x size. */ public int getXsizeInPixels() { return Integer.parseInt(xsizePixel.getText()); } /** Set the y size of the picture. @param ys the wanted y size. */ public void setYsizeInPixels(int ys) { ysizePixel.setText(""+ys); } /** If the resolution is size-based, get the y size of the picture. @return the wanted y size. */ public int getYsizeInPixels() { return Integer.parseInt(ysizePixel.getText()); } /** Get the default unit per pixel value @return the unit per pixel value */ public double getUnitPerPixel() { int index=resolution.getSelectedIndex(); switch(index) { case 0: return 0.36; // 72/200 case 1: return 0.75; // 150/200 case 2: return 1.50; // 300/200 case 3: return 3.00; // 600/200 case 4: return 6.00; // 1200/200 case 5: return 9.00; // 1800/200 case 6: return 12.0; // 2400/200 default: return 0.36; // Not recognized. } } /** Create a JPanel containing all the interface elements needed for a size-based copy of bitmap images. @return the created panel. */ private JPanel createSizeBasedExportPanel() { JPanel panel = new JPanel(); GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints=new GridBagConstraints(); panel.setLayout(bgl); JLabel xSizeLabel=new JLabel(Globals.messages.getString("ctrl_x_radius")); constraints = DialogUtil.createConst(1,0,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,40,6,6)); panel.add(xSizeLabel, constraints); xsizePixel=new JTextField(); constraints = DialogUtil.createConst(2,0,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(xsizePixel, constraints); JLabel ySizeLabel=new JLabel(Globals.messages.getString("ctrl_y_radius")); constraints = DialogUtil.createConst(1,1,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,40,6,6)); panel.add(ySizeLabel, constraints); ysizePixel=new JTextField(); constraints = DialogUtil.createConst(2,1,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(ysizePixel, constraints); return panel; } /** Create a JPanel containing the interface elements needed for the configuration of copy operation. @return the created panel. */ private JPanel createResolutionBasedExportPanel() { JPanel panel = new JPanel(); GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints=new GridBagConstraints(); panel.setLayout(bgl); JLabel resolutionLabel=new JLabel(Globals.messages.getString("Resolution")); constraints = DialogUtil.createConst(1,0,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,40,6,6)); panel.add(resolutionLabel, constraints); resolution = createResolutionComboBox(); constraints = DialogUtil.createConst(2,0,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(resolution, constraints); expectedSize= new JLabel("x"); constraints = DialogUtil.createConst(2,1,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(expectedSize, constraints); return panel; } private JPanel createCommonInterfaceElements() { JPanel panel=new JPanel(); GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints=new GridBagConstraints(); panel.setLayout(bgl); antiAlias_CB=new JCheckBox(Globals.messages.getString("Anti_aliasing")); constraints = DialogUtil.createConst(2,1,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(antiAlias_CB, constraints); // Add antialias cb blackWhite_CB=new JCheckBox(Globals.messages.getString("B_W")); constraints = DialogUtil.createConst(2,2,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,0,0,0)); panel.add(blackWhite_CB, constraints); // Add black/white cb return panel; } /** Create a JComboBox containing the resolutions, described as strings. @return the JComboBox created. */ private JComboBox<String> createResolutionComboBox() { JComboBox<String> res=new JComboBox<String>(); res.addItem("72x72 dpi"); res.addItem("150x150 dpi"); res.addItem("300x300 dpi"); res.addItem("600x600 dpi"); res.addItem("1200x1200 dpi"); res.addItem("1800x1800 dpi"); res.addItem("2400x2400 dpi"); res.addActionListener (new ActionListener () { @Override public void actionPerformed(ActionEvent e) { int width = (int)( (dim.width+Export.exportBorder)*getUnitPerPixel()); int height = (int)( (dim.height+Export.exportBorder)*getUnitPerPixel()); expectedSize.setText(""+width+" x "+height+" pixels"); } }); return res; } /** Event handling routine for the user interface. For the moment, it does not do much, except setting the enabled state of buttons and elements of the UI, depending on which kind of copy is being done. @param evt the event to be processed. */ @Override public void actionPerformed(ActionEvent evt) { // It is a bitmap based copy xsizePixel.setEnabled(true); ysizePixel.setEnabled(true); resolution.setEnabled(true); // Resolution combo box antiAlias_CB.setEnabled(true); // AntiAlias checkbox blackWhite_CB.setEnabled(true); // Black and white checkbox } }
16,595
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
CellArrow.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/CellArrow.java
package net.sourceforge.fidocadj.dialogs; import java.io.*; import java.awt.*; import javax.swing.*; import net.sourceforge.fidocadj.primitives.Arrow; import net.sourceforge.fidocadj.graphic.swing.Graphics2DSwing; /** The class CellArrow is a simple panel showing the arrow characteristics. To be used with ArrowCellRenderer. @author Davide Bucci <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2009-2023 by Davide Bucci </pre> */ public class CellArrow extends JPanel { private final boolean isSelected; private final ArrowInfo arrow; private final JList list; /** Constructor. The user should provide the list in which the element is used, information about the arrow style as well as the selection state @param la the arrow style to be used @param l the JList in which the element is used @param is the selection state which will be used for the background */ CellArrow(ArrowInfo la,JList l, boolean is) { arrow=la; list=l; isSelected=is; setPreferredSize(new Dimension(50,18)); } /** By implementing writeObject method, // we can prevent // subclass from serialization */ private void writeObject(ObjectOutputStream out) throws IOException { throw new NotSerializableException(); } /* By implementing readObject method, // we can prevent // subclass from de-serialization */ private void readObject(ObjectInputStream in) throws IOException { throw new NotSerializableException(); } /** Paint the arrow in the panel, using the current style. @param g the graphic context. */ @Override public void paintComponent(Graphics g) { g.setColor(isSelected ? list.getSelectionBackground(): list.getBackground()); g.fillRect(0,0, getWidth(), getHeight()); g.setColor(isSelected ? list.getSelectionForeground(): list.getForeground()); g.drawLine(getWidth()/3+10, getHeight()/2,2*getWidth()/3, getHeight()/2); Arrow arrowDummy=new Arrow(); arrowDummy.drawArrowPixels(new Graphics2DSwing(g), getWidth()/3, getHeight()/2, 2*getWidth()/3, getHeight()/2, 10, 4, arrow.style); } }
3,046
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
DialogAbout.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/DialogAbout.java
package net.sourceforge.fidocadj.dialogs; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.net.*; import net.sourceforge.fidocadj.globals.Globals; import net.sourceforge.fidocadj.dialogs.mindimdialog.MinimumSizeDialog; /** Shows a rather standard "About" dialog. Nothing more exotic than showing the nice icon of the program, its name as well as three lines of description. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2007-2023 by Davide Bucci </pre> @author Davide Bucci */ public final class DialogAbout extends MinimumSizeDialog { /** Standard constructor: it needs the parent frame. @param parent the dialog's parent */ public DialogAbout (JFrame parent) { super(300, 200, parent, "", true); DialogUtil.center(this, .30,.35,350,300); setResizable(false); addComponentListener(this); // Shows the icon of the program and then three lines read from the // resources which describe the software and give the credits. GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints=new GridBagConstraints(); Container contentPane=getContentPane(); contentPane.setLayout(bgl); URL url=DialogAbout.class.getResource( "icona_fidocadj_128x128.png"); JLabel icon=new JLabel(""); constraints.weightx=100; constraints.weighty=100; constraints.gridx=0; constraints.gridy=0; constraints.gridwidth=1; constraints.gridheight=1; constraints.anchor=GridBagConstraints.CENTER; constraints.insets=new Insets(10,20,0,20); if (url != null) { icon.setIcon(new ImageIcon(url)); } contentPane.add(icon, constraints); JLabel programName=new JLabel("FidoCadJ"); Font f=new Font("Lucida Grande",Font.BOLD,18); programName.setFont(f); constraints.gridx=0; constraints.gridy=1; constraints.gridwidth=1; constraints.gridheight=1; constraints.anchor=GridBagConstraints.CENTER; constraints.insets=new Insets(0,20,0,20); contentPane.add(programName, constraints); JLabel programVersion=new JLabel( Globals.messages.getString("Version")+Globals.version); constraints.gridx=0; constraints.gridy=2; constraints.gridwidth=1; constraints.gridheight=1; constraints.anchor=GridBagConstraints.CENTER; contentPane.add(programVersion, constraints); JLabel programDescription1=new JLabel( Globals.messages.getString("programDescription1")); constraints.gridx=0; constraints.gridy=3; constraints.gridwidth=1; constraints.gridheight=1; constraints.anchor=GridBagConstraints.CENTER; contentPane.add(programDescription1, constraints); JLabel programDescription2=new JLabel( Globals.messages.getString("programDescription2")); constraints.gridx=0; constraints.gridy=4; constraints.gridwidth=1; constraints.gridheight=1; constraints.anchor=GridBagConstraints.CENTER; constraints.insets=new Insets(0,20,20,20); contentPane.add(programDescription2, constraints); JLabel programDescription3=new JLabel( Globals.messages.getString("programDescription3")); constraints.gridx=0; constraints.gridy=5; constraints.gridwidth=1; constraints.gridheight=1; constraints.anchor=GridBagConstraints.CENTER; constraints.insets=new Insets(0,20,20,20); contentPane.add(programDescription3, constraints); class OpenUrlAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { BareBonesBrowserLaunch.openURL( "http://darwinne.github.io/FidoCadJ/"); // The following code works only in Java above v. 1.6 and // the minimum requirements for FidoCadJ are Java 1.9 // UPDATE: this has changed and we may consider employing a more // standard code now. /* if (Desktop.isDesktopSupported()) { try { Desktop.getDesktop().browse(uri); } catch (IOException err) { /* TODO: error handling * } } else { /* TODO: error handling * }*/ } } JButton link=new JButton( "<HTML> <a href=\"http://darwinne.github.io/FidoCadJ/\">"+ "http://darwinne.github.io/FidoCadJ/</a></HTML>"); constraints.gridx=0; constraints.gridy=6; constraints.gridwidth=1; constraints.gridheight=2; constraints.anchor=GridBagConstraints.CENTER; constraints.insets=new Insets(0,20,20,20); link.setBorderPainted(false); link.addActionListener(new OpenUrlAction()); contentPane.add(link, constraints); pack(); } }
5,744
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
LayerInfo.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/LayerInfo.java
package net.sourceforge.fidocadj.dialogs; /** <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2009-2023 by Davide Bucci </pre> @author Davide Bucci */ public class LayerInfo { int layer; /** Create a LayerInfo object with the given layer @param i the layer to be used. */ public LayerInfo(int i) { layer=i; } public int getLayer() { return layer; } }
1,084
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
DialogLayer.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/DialogLayer.java
package net.sourceforge.fidocadj.dialogs; import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import net.sourceforge.fidocadj.globals.Globals; import net.sourceforge.fidocadj.layers.LayerDesc; import net.sourceforge.fidocadj.dialogs.mindimdialog.MinimumSizeDialog; import java.util.*; /** List and choose the layer to be edited. The class dialogLayer allows to choose which layers should be displayed, on which color and characteristics. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2007-2023 by Davide Bucci </pre> @author Davide Bucci */ public final class DialogLayer extends MinimumSizeDialog implements ComponentListener { private final java.util.List<LayerDesc> layers; public JList<LayerDesc> layerList; /** Constructor. @param parent the dialog parent @param l a LayerDesc vector containing the layers' attributes */ public DialogLayer (JFrame parent, java.util.List<LayerDesc> l) { super(400,350, parent, Globals.messages.getString("Layer_editor"), true); DialogUtil.center(this, .40,.40,400,350); addComponentListener(this); layers=l; // Ensure that under MacOSX >= 10.5 Leopard, this dialog will appear // as a document modal sheet getRootPane().putClientProperty("apple.awt.documentModalSheet", Boolean.TRUE); GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints; Container contentPane=getContentPane(); contentPane.setLayout(bgl); layerList = new JList<LayerDesc>(new Vector<LayerDesc>(layers)); JScrollPane sl=new JScrollPane(layerList); layerList.setCellRenderer(new LayerCellRenderer()); constraints = DialogUtil.createConst(0,0,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(20,20,6,20)); contentPane.add(sl, constraints); JButton ok = new JButton(Globals.messages.getString("Ok_btn")); JButton cancel = new JButton(Globals.messages.getString("Cancel_btn")); JButton edit = new JButton(Globals.messages.getString("Edit")); // Put the OK and Cancel buttons and make them active. Box b=Box.createHorizontalBox(); b.add(edit); b.add(Box.createHorizontalGlue()); ok.setPreferredSize(cancel.getPreferredSize()); if (Globals.okCancelWinOrder) { b.add(ok); b.add(Box.createHorizontalStrut(12)); b.add(cancel); } else { b.add(cancel); b.add(Box.createHorizontalStrut(12)); b.add(ok); } constraints = DialogUtil.createConst(0,1,1,1,100,0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0,20,20,20)); contentPane.add(b,constraints); // Add cancel button layerList.addMouseListener(new ActionDClick(this)); edit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { activateLayerEditor(layerList.getSelectedIndex()); } }); ok.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { setVisible(false); } }); cancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { setVisible(false); } }); // Here is an action in which the dialog is closed AbstractAction cancelAction = new AbstractAction () { @Override public void actionPerformed (ActionEvent e) { setVisible(false); } }; DialogUtil.addCancelEscape (this, cancelAction); pack(); DialogUtil.center(this); getRootPane().setDefaultButton(ok); } /** By implementing writeObject method, // we can prevent // subclass from serialization */ private void writeObject(ObjectOutputStream out) throws IOException { throw new NotSerializableException(); } /* By implementing readObject method, // we can prevent // subclass from de-serialization */ private void readObject(ObjectInputStream in) throws IOException { throw new NotSerializableException(); } /** Check if the layer index is non negative and then show the dialog for the editing of the selected layer. @param index the index of the layer to be modified. */ public void activateLayerEditor(int index) { if (index>=0) { DialogEditLayer del=new DialogEditLayer(null, (LayerDesc) layers.get(layerList.getSelectedIndex())); del.setVisible(true); if (del.getActive()){ del.acceptLayer(); repaint(); } } else { JOptionPane.showMessageDialog(null, Globals.messages.getString("Warning_select_layer"), Globals.messages.getString("Layer_editor"), JOptionPane.INFORMATION_MESSAGE, null); } } } /** ActionDClick is a class which activates the layer editor when the user double clicks into the layerList JList object contained in the DialogLayer object. If in Java there was a "friend" class specificator like the one in C++, I would probably define this class as a friend of DialogLayer, thus avoiding of having to make layerList public. */ class ActionDClick extends MouseAdapter { private final DialogLayer dl; /** Method handling a double click event. @param i the DialogLayer object which has been clicked. */ public ActionDClick(DialogLayer i) { dl = i; } /** Handle a click of the mouse. @param e the mouse event object. */ @Override public void mouseClicked(MouseEvent e) { if(e.getClickCount() == 2){ int t = dl.layerList.locationToIndex(e.getPoint()); dl.layerList.ensureIndexIsVisible(t); dl.activateLayerEditor(t); } } }
7,033
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
DialogUtil.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/DialogUtil.java
package net.sourceforge.fidocadj.dialogs; import java.awt.event.*; import java.awt.*; import javax.swing.*; /** Some routines useful with dialog windows. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2007-2023 by Davide Bucci </pre> */ public final class DialogUtil { private DialogUtil() { // nothing } /** Center the frame on the screen and set its height and width to half the screen size. @param frame the window to be centered. */ public static void center(Window frame) { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Point center = ge.getCenterPoint(); int w = frame.getWidth(); int h = frame.getHeight(); int x = center.x - w/2; int y = center.y - h/2; frame.setBounds(x, y, w, h); frame.validate(); } /** Center the frame on the screen and set its height and width to the given proportion of the screen size @param frame the window to be centered @param propX the horisontal proportion, between 0.0 and 1.0. @param propY the vertical proportion, between 0.0 and 1.0. */ public static void center(Window frame, double propX, double propY) { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Point center = ge.getCenterPoint(); Rectangle bounds = ge.getMaximumWindowBounds(); int w = Math.max((int)(bounds.width*propX), Math.min(frame.getWidth(), bounds.width)); int h = Math.max((int)(bounds.height*propY), Math.min(frame.getHeight(), bounds.height)); int x = center.x - w/2; int y = center.y - h/2; frame.setBounds(x, y, w, h); frame.validate(); } /** Center the frame on the screen and set its height and width to the given proportion of the screen size. Specify also the minimum size in pixels. @param frame the window to be centered @param propX the horisontal proportion, between 0.0 and 1.0. @param propY the vertical proportion, between 0.0 and 1.0. @param minx minimum horisontal size in pixels. @param miny minimum vertical size in pixels. */ public static void center(Window frame, double propX, double propY, int minx, int miny) { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Point center = ge.getCenterPoint(); Rectangle bounds = ge.getMaximumWindowBounds(); int w = Math.max((int)(bounds.width*propX), Math.min(frame.getWidth(), bounds.width)); if(w<minx) { w=minx; } int h = Math.max((int)(bounds.height*propY), Math.min(frame.getHeight(), bounds.height)); if(h<miny) { h=miny; } int x = center.x - w/2; int y = center.y - h/2; frame.setBounds(x, y, w, h); frame.validate(); } /** Maps the escape key with the action given (ideally, it should probably close the dialog window). Example follows: <pre> // Here is an action in which the dialog is closed AbstractAction cancelAction = new AbstractAction () { public void actionPerformed (ActionEvent e) { setVisible(false); } }; dialogUtil.addCancelEscape (this, cancelAction); </pre> @param f the dialog window on which the action should be applied @param cancelAction the action to be performed in response to the Esc key */ public static void addCancelEscape (JDialog f, AbstractAction cancelAction) { // Map the Esc key to the cancel action description in the dialog box's // input map. String cancelActionKey = "CANCEL_ACTION_KEY"; int noModifiers = 0; KeyStroke escapeKey = KeyStroke.getKeyStroke (KeyEvent.VK_ESCAPE, noModifiers, false); InputMap inputMap = f.getRootPane ().getInputMap (JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); inputMap.put (escapeKey, cancelActionKey); f.getRootPane ().getActionMap ().put (cancelActionKey, cancelAction); } /** Set up the constraints for the GridLayout manager @param gridx the x position in the grid @param gridy the y position in the grid @param width the width of the control @param height the heigth of the control @param weightx the weightx to be adopted @param weighty the weighty to be adopted @param anch the anchor value @param fill the fill valuue @param insets the insets to be used @return the constraints object created. */ public static GridBagConstraints createConst(int gridx, int gridy, int width, int height, int weightx, int weighty, int anch, int fill, Insets insets) { GridBagConstraints constraints=new GridBagConstraints(); constraints.gridx=gridx; constraints.gridy=gridy; constraints.gridwidth=width; constraints.gridheight=height; constraints.weightx=weightx; constraints.weighty=weighty; constraints.fill = fill; constraints.anchor = anch; constraints.insets=insets; return constraints; } }
6,208
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
CellDash.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/CellDash.java
package net.sourceforge.fidocadj.dialogs; import java.io.*; import java.awt.*; import javax.swing.*; import net.sourceforge.fidocadj.globals.Globals; /** The class CellArrow is a simple panel showing the dash style characteristics. To be used with ArrowCellRenderer. @author Davide Bucci <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. </pre> Copyright 2009-2023 by Davide Bucci */ public class CellDash extends JPanel { private final boolean isSelected; private final DashInfo dash; private final JList list; /** Constructor. The user should provide the list in which the element is used, information about the dashing style as well as the selection state @param la the dashing style to be used @param l the JList in which the element is used @param is the selection state which will be used for the background */ CellDash(DashInfo la,JList l, boolean is) { dash=la; list=l; isSelected=is; setPreferredSize(new Dimension(50,18)); } /** By implementing writeObject method, // we can prevent // subclass from serialization */ private void writeObject(ObjectOutputStream out) throws IOException { throw new NotSerializableException(); } /* By implementing readObject method, // we can prevent // subclass from de-serialization */ private void readObject(ObjectInputStream in) throws IOException { throw new NotSerializableException(); } /** This routine is called by the callback system when there is the need to draw on the screen the element. @param g the graphic context on which to draw. */ @Override public void paintComponent(Graphics g) { // Show the dashing styles in a list. g.setColor(isSelected ? list.getSelectionBackground(): list.getBackground()); // We draw the background with the correct color depending wether // the element is selected or not. g.fillRect(0,0, getWidth(), getHeight()); g.setColor(isSelected ? list.getSelectionForeground(): list.getForeground()); // We then proceed by drawing an horisontal line showing the dashing // style corresponding to the element // Maybe just applyStroke of the GraphicsSwing object can be enough? BasicStroke dashed = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, Globals.dash[dash.style], 0.0f); ((Graphics2D) g).setStroke(dashed); g.drawLine(getWidth()/3, getHeight()/2,2*getWidth()/3, getHeight()/2); } }
3,570
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
DialogOptions.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/DialogOptions.java
package net.sourceforge.fidocadj.dialogs; import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.io.*; import net.sourceforge.fidocadj.globals.Globals; import net.sourceforge.fidocadj.dialogs.mindimdialog.MinimumSizeDialog; /** The dialogOptions class implements a modal dialog, which allows the user to choose which circuit drawing options (size, anti aliasing, profiling) should be activated. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2007-2023 by Davide Bucci </pre> */ public final class DialogOptions extends MinimumSizeDialog { public double zoomValue; public boolean profileTime; public boolean antiAlias; public boolean textToolbar; public boolean smallIconsToolbar; public int gridSize; public boolean extStrict; public boolean shiftCP; public double stroke_size_straight_i; public double connectionSize_i; public String libDirectory; public int pcblinewidth_i; public int pcbpadwidth_i; public int pcbpadheight_i; public int pcbpadintw_i; public String macroFont; public int macroSize_i; private final JFrame parent; private JCheckBox antiAlias_CB; private JCheckBox profile_CB; private JCheckBox extStrict_CB; private JCheckBox shiftCP_CB; private JTextField gridWidth; private JTextField libD; private JCheckBox textToolbar_CB; private JCheckBox smallIconsToolbar_CB; private JTextField pcblinewidth; private JTextField pcbpadwidth; private JTextField pcbpadheight; private JTextField pcbpadintw; private JTextField connectionSize; private JTextField macroSize; private JTextField stroke_size_straight; private JComboBox<String> comboFont; /** Standard constructor. @param pa the parent frame. @param z the current zoom. @param p the current profile status. @param a the current anti aliasing state. @param gs the current grid activation state. @param libDir the current library directory. @param tt the current text in the toolbar state. @param sit the current small icon state. @param plw the current PCB line width. @param pw the current PCB pad width. @param ph the current PCB pad height. @param piw the current PCB bad internal hole diameter. @param ex strict compatibility with FidoCAD for Windows. @param mf the current Macro font. @param sssi stroke width to be used for segments and straight lines. @param ccs connection size. @param ms text height for macros. @param sdcp shift during copy and paste. */ public DialogOptions (JFrame pa, double z, boolean p, boolean a, int gs, String libDir, boolean tt, boolean sit, int plw, int pw, int ph, int piw, boolean ex, String mf, double sssi, double ccs, int ms, boolean sdcp) { super(600,450,pa, Globals.messages.getString("Cir_opt_t"), true); addComponentListener(this); shiftCP=sdcp; parent=pa; zoomValue=z; profileTime=p; antiAlias=a; gridSize=gs; libDirectory = libDir; textToolbar=tt; smallIconsToolbar=sit; extStrict=ex; macroFont = mf; pcblinewidth_i = plw; pcbpadwidth_i = pw; pcbpadheight_i = ph; pcbpadintw_i = piw; connectionSize_i=ccs; macroSize_i = ms; stroke_size_straight_i =sssi; setSize(600,500); GridBagConstraints constraints; Container contentPane=getContentPane(); contentPane.setLayout(new GridBagLayout()); JTabbedPane tabsPane = new JTabbedPane(); // Creates four panes and then populate them. tabsPane.addTab(Globals.messages.getString("Restart"), createRestartPane()); tabsPane.addTab(Globals.messages.getString("Drawing"), createDrawingOptPanel()); tabsPane.addTab(Globals.messages.getString("PCBsizes"), createPCBsizePanel()); tabsPane.addTab(Globals.messages.getString("FidoCad"), createExtensionsPanel()); constraints = DialogUtil.createConst(0,0,3,1,100,100, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,20,6,20)); contentPane.add(tabsPane, constraints); // Put the OK and Cancel buttons and make them active. JButton ok=new JButton(Globals.messages.getString("Ok_btn")); JButton cancel=new JButton(Globals.messages.getString("Cancel_btn")); constraints = DialogUtil.createConst(0,1,3,1,100,100, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,20,20,20)); // Put the OK and Cancel buttons and make them active. Box b=Box.createHorizontalBox(); b.add(Box.createHorizontalGlue()); ok.setPreferredSize(cancel.getPreferredSize()); if (Globals.okCancelWinOrder) { b.add(ok); b.add(Box.createHorizontalStrut(12)); b.add(cancel); } else { b.add(cancel); b.add(Box.createHorizontalStrut(12)); b.add(ok); } contentPane.add(b, constraints); // Add cancel button ok.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { int ng=-1; shiftCP=shiftCP_CB.isSelected(); antiAlias=antiAlias_CB.isSelected(); profileTime=profile_CB.isSelected(); textToolbar=textToolbar_CB.isSelected(); smallIconsToolbar=smallIconsToolbar_CB.isSelected(); extStrict = extStrict_CB.isSelected(); macroFont = (String)comboFont.getSelectedItem(); int s=0; try{ s=Integer.parseInt(macroSize.getText().trim()); ng=Integer.parseInt(gridWidth.getText().trim()); libDirectory=libD.getText().trim(); pcblinewidth_i=Integer.parseInt( pcblinewidth.getText().trim()); pcbpadwidth_i=Integer.parseInt( pcbpadwidth.getText().trim()); pcbpadheight_i=Integer.parseInt( pcbpadheight.getText().trim()); pcbpadintw_i=Integer.parseInt( pcbpadintw.getText().trim()); stroke_size_straight_i=Double.parseDouble( stroke_size_straight.getText().trim()); connectionSize_i=Double.parseDouble( connectionSize.getText().trim()); if(ng>0) { gridSize=ng; } else { JOptionPane.showMessageDialog(parent, Globals.messages.getString("Format_invalid"), "", JOptionPane.INFORMATION_MESSAGE); return; } if(s>0) { macroSize_i=s; } else { JOptionPane.showMessageDialog(null, Globals.messages.getString("Font_size_invalid"), "", JOptionPane.INFORMATION_MESSAGE); return; } setVisible(false); } catch (NumberFormatException eE) { JOptionPane.showMessageDialog(parent, Globals.messages.getString("Format_invalid")+ " "+eE.getMessage(), "", JOptionPane.INFORMATION_MESSAGE); } } }); cancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { setVisible(false); } }); // Here is an action in which the dialog is closed AbstractAction cancelAction = new AbstractAction () { @Override public void actionPerformed (ActionEvent e) { setVisible(false); } }; DialogUtil.addCancelEscape (this, cancelAction); pack(); DialogUtil.center(this); getRootPane().setDefaultButton(ok); } /** Creates the panel dedicated to the startup options of FidoCadJ. @return the panel containing startup options. */ private JPanel createRestartPane() { JPanel restartOptionPanel=new JPanel(); restartOptionPanel.setLayout(new GridBagLayout()); GridBagConstraints constraints=new GridBagConstraints(); restartOptionPanel.setOpaque(false); JLabel liblbl=new JLabel(Globals.messages.getString("lib_dir")); constraints = DialogUtil.createConst(0,0,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(20,40,6,0)); // Add lib dir label restartOptionPanel.add(liblbl, constraints); libD=new JTextField(10); libD.setText(libDirectory); constraints = DialogUtil.createConst(0,1,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(6,40,6,20)); restartOptionPanel.add(libD,constraints); // Add lib dir tf JButton libB=new JButton(Globals.messages.getString("Browse")); constraints.insets=new Insets(0,0,0,40); libB.setOpaque(false); constraints.gridx=1; constraints.gridy=1; restartOptionPanel.add(libB, constraints); // Add lib dir button libB.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { String din; if(Globals.useNativeFileDialogs) { // Use the native (AWT) file dialogs instead of Swing's FileDialog fd = new FileDialog(parent, Globals.messages.getString("Select_lib_directory"), FileDialog.LOAD); fd.setDirectory(libD.getText()); System.setProperty("apple.awt.fileDialogForDirectories", "true"); fd.setVisible(true); System.setProperty("apple.awt.fileDialogForDirectories", "false"); if(fd.getDirectory()==null || fd.getFile() ==null) { din = null; } else { din=new File(fd.getDirectory(),fd.getFile()). getPath(); } } else { // Use Swing's file dialog. JFileChooser fc = new JFileChooser( new File(libD.getText()).getPath()); fc.setDialogTitle( Globals.messages.getString("Select_lib_directory")); fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); // Dock library panel. new LibraryPanel(fc); int r = fc.showOpenDialog(null); if (r == JFileChooser.APPROVE_OPTION) { din=fc.getSelectedFile().getPath(); } else { din=null; } } if(din != null) { libD.setText(din); } } }); JLabel restw = new JLabel(Globals.messages.getString("restart_info")); constraints = DialogUtil.createConst(0,3,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(6,40,6,0)); restartOptionPanel.add(restw, constraints); textToolbar_CB=new JCheckBox(Globals.messages.getString("TextToolbar")); textToolbar_CB.setSelected(textToolbar); textToolbar_CB.setOpaque(false); constraints = DialogUtil.createConst(0,4,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(6,40,6,0)); // Add text in tb cb restartOptionPanel.add(textToolbar_CB, constraints); constraints = DialogUtil.createConst(0,5,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(6,40,6,20)); smallIconsToolbar_CB=new JCheckBox(Globals.messages.getString("SmallIcons")); smallIconsToolbar_CB.setSelected(smallIconsToolbar); smallIconsToolbar_CB.setOpaque(false); constraints = DialogUtil.createConst(0,6,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(6,40,20,20)); // Add small icons restartOptionPanel.add(smallIconsToolbar_CB, constraints); return restartOptionPanel; } /** Creates the panel dedicated to the drawing options of FidoCadJ. @return the panel containing the drawing options. */ private JPanel createDrawingOptPanel() { JPanel drawingOptPanel = new JPanel(); GridBagConstraints constraints=new GridBagConstraints(); drawingOptPanel.setLayout(new GridBagLayout()); drawingOptPanel.setOpaque(false); profile_CB=new JCheckBox(Globals.messages.getString("Profile")); profile_CB.setOpaque(false); profile_CB.setSelected(profileTime); constraints = DialogUtil.createConst(1,1,2,1,100,100, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(6,6,6,20)); if(Globals.isBeta) { drawingOptPanel.add(profile_CB, constraints); // Add profiler cb } JLabel gridlbl=new JLabel(Globals.messages.getString("Grid_width")); constraints = DialogUtil.createConst(0,2,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,6,6,6)); drawingOptPanel.add(gridlbl, constraints); // Add Grid label gridWidth=new JTextField(10); gridWidth.setText(""+gridSize); constraints = DialogUtil.createConst(1,2,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,6,6,6)); drawingOptPanel.add(gridWidth, constraints); // Add grid width tf /********************************************************************** Stroke sizes **********************************************************************/ JLabel connectionSizelbl=new JLabel(Globals.messages.getString( "connection_size")); constraints = DialogUtil.createConst(0,8,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,6,6,6)); drawingOptPanel.add(connectionSizelbl, constraints); connectionSize=new JTextField(10); connectionSize.setText(""+connectionSize_i); constraints = DialogUtil.createConst(1,8,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,6,6,6)); drawingOptPanel.add(connectionSize, constraints); JLabel strokeSizeStrlbl=new JLabel(Globals.messages.getString( "stroke_size_straight")); constraints = DialogUtil.createConst(0,9,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,6,6,6)); drawingOptPanel.add(strokeSizeStrlbl, constraints); stroke_size_straight=new JTextField(10); stroke_size_straight.setText(""+stroke_size_straight_i); constraints = DialogUtil.createConst(1,9,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,6,6,6)); drawingOptPanel.add(stroke_size_straight, constraints); /********************************************************************** Macro font **********************************************************************/ JLabel macroFontlbl=new JLabel(Globals.messages.getString( "macrofont")); constraints = DialogUtil.createConst(0,11,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,6,6,6)); drawingOptPanel.add(macroFontlbl, constraints);// Macro font selection // Get all installed font families GraphicsEnvironment gE; gE = GraphicsEnvironment.getLocalGraphicsEnvironment(); String[] s = gE.getAvailableFontFamilyNames(); comboFont=new JComboBox<String>(); //System.out.println(macroFont); for (int i = 0; i < s.length; ++i) { comboFont.addItem(s[i]); if (s[i].equals(macroFont)) { comboFont.setSelectedIndex(i); } } constraints = DialogUtil.createConst(1,11,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,6,6,6)); drawingOptPanel.add(comboFont, constraints);// Add primitive font combo JLabel macroSizelbl=new JLabel(Globals.messages.getString( "macroSize")); constraints = DialogUtil.createConst(0,12,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,6,6,6)); drawingOptPanel.add(macroSizelbl, constraints); macroSize=new JTextField(10); macroSize.setText(""+macroSize_i); constraints = DialogUtil.createConst(1,12,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,6,6,6)); drawingOptPanel.add(macroSize, constraints); antiAlias_CB=new JCheckBox(Globals.messages.getString("Anti_al")); antiAlias_CB.setSelected(antiAlias); antiAlias_CB.setOpaque(false); constraints = DialogUtil.createConst(1,13,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,6,6,40)); drawingOptPanel.add(antiAlias_CB, constraints); // Add antialias cb shiftCP_CB=new JCheckBox(Globals.messages.getString("Shift_cp")); shiftCP_CB.setSelected(shiftCP); shiftCP_CB.setOpaque(false); constraints = DialogUtil.createConst(1,14,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,6,6,40)); drawingOptPanel.add(shiftCP_CB, constraints); // Add shift C/P cb return drawingOptPanel; } /** Creates the panel dedicated to the default PCB track and pad sizes options of FidoCadJ. @return the panel containing the PCB settings. */ private JPanel createPCBsizePanel() { /********************************************************************** PCB line and pad default sizes **********************************************************************/ JPanel pcbSizePanel = new JPanel(); GridBagConstraints constraints=new GridBagConstraints(); pcbSizePanel.setLayout(new GridBagLayout()); pcbSizePanel.setOpaque(false); JLabel pcblinelbl=new JLabel(Globals.messages.getString( "pcbline_width")); constraints = DialogUtil.createConst(0,0,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0,0,0,0)); pcbSizePanel.add(pcblinelbl, constraints); // Add pcbline label pcblinewidth=new JTextField(10); pcblinewidth.setText(""+pcblinewidth_i); constraints = DialogUtil.createConst(1,0,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,6,6,6)); pcbSizePanel.add(pcblinewidth, constraints); // Add pcbline width tf JLabel pcbpadwidthlbl=new JLabel(Globals.messages.getString( "pcbpad_width")); constraints = DialogUtil.createConst(0,1,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,6,6,6)); pcbSizePanel.add(pcbpadwidthlbl, constraints); // Add pcbpad width label pcbpadwidth=new JTextField(10); pcbpadwidth.setText(""+pcbpadwidth_i); constraints = DialogUtil.createConst(1,1,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,6,6,6)); pcbSizePanel.add(pcbpadwidth, constraints); // Add pcbpad width tf JLabel pcbpadheightlbl=new JLabel(Globals.messages.getString( "pcbpad_height")); constraints = DialogUtil.createConst(0,2,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,6,6,6)); pcbSizePanel.add(pcbpadheightlbl, constraints); // Add pcbline label pcbpadheight=new JTextField(10); pcbpadheight.setText(""+pcbpadheight_i); constraints = DialogUtil.createConst(1,2,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,6,6,6)); pcbSizePanel.add(pcbpadheight, constraints); // Add pcbline height tf JLabel pcbpadintwlbl=new JLabel(Globals.messages.getString( "pcbpad_intw")); constraints = DialogUtil.createConst(0,3,1,1,100,100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,6,6,6)); pcbSizePanel.add(pcbpadintwlbl, constraints);// Add pcbpad int w label pcbpadintw=new JTextField(10); pcbpadintw.setText(""+pcbpadintw_i); constraints = DialogUtil.createConst(1,3,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,6,6,6)); pcbSizePanel.add(pcbpadintw, constraints); // Add pcbline width tf return pcbSizePanel; } /** Creates the panel dedicated to the extensions introduced by FidoCadJ on the original FidoCAD file format. @return the panel concerning extensions to the very old FidoCAD format. */ private JPanel createExtensionsPanel() { /********************************************************************** FidoCadJ extensions **********************************************************************/ JPanel extensionsPanel = new JPanel(); GridBagConstraints constraints=new GridBagConstraints(); extensionsPanel.setLayout(new GridBagLayout()); extensionsPanel.setOpaque(false); extStrict_CB=new JCheckBox(Globals.messages.getString( "strict_FC_comp")); extStrict_CB.setSelected(extStrict); extStrict_CB.setOpaque(false); constraints = DialogUtil.createConst(0,0,2,1,100,100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,40,6,40)); extensionsPanel.add(extStrict_CB, constraints); // Strict FidoCAD // compatibility return extensionsPanel; } }
24,155
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
DialogExport.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/DialogExport.java
package net.sourceforge.fidocadj.dialogs; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; import net.sourceforge.fidocadj.globals.Globals; import net.sourceforge.fidocadj.graphic.DimensionG; import net.sourceforge.fidocadj.graphic.PointG; import net.sourceforge.fidocadj.dialogs.mindimdialog.MinimumSizeDialog; import net.sourceforge.fidocadj.circuit.model.DrawingModel; import net.sourceforge.fidocadj.geom.DrawingSize; import net.sourceforge.fidocadj.circuit.views.Export; /** Choose file format, size and options of the graphic exporting. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2007-2023 by Davide Bucci </pre> @author Davide Bucci */ public final class DialogExport extends MinimumSizeDialog implements ActionListener { private final JFrame parent; private boolean export; // Indicates that the export should be done private static final int PNG_INDEX=0; // Combo list index: png format private static final int JPG_INDEX=1; // Combo list index: jpg format private static final int SVG_INDEX=2; // Combo list index: svg format private static final int EPS_INDEX=3; // Combo list index: eps format private static final int PGF_INDEX=4; // Combo list index: pgf format private static final int PDF_INDEX=5; // Combo list index: pgf format private static final int SCR_INDEX=6; // idem: Eagle scr format private static final int PCB_INDEX=7; // idem: gEDA pcb-rnd format private static final double EPS=1E-5; // Resolution comparison precision // Swing elements private JComboBox<String> resolution; // Resolution combo box private JCheckBox antiAlias_CB; // AntiAlias checkbox private JCheckBox blackWhite_CB; // Black and white checkbox private final JComboBox<String> fileFormat; // File format combo box private JTextField fileName; // File name text field private final JTabbedPane tabsPane; // Tab panel for res/size exp. private JTextField multiplySizes; // Size mult. for vector exp. private JTextField xsizePixel; // The x size of the image private JTextField ysizePixel; // The y size of the image private final DrawingModel dm; // The drawing to be exported private final DimensionG dim; // The drawing size in l.u. private JCheckBox splitLayers_CB; // The split layers c.b. private JLabel expectedSize; // The calculated size /** Constructor: it needs the parent frame. @param p the dialog's parent. @param c the drawing model containing the drawing to be exported. */ public DialogExport (JFrame p, DrawingModel c) { super(450,400,p,Globals.messages.getString("Circ_exp_t"), true); // Ensure that under MacOSX >= 10.5 Leopard, this dialog will appear // as a document modal sheet dm=c; getRootPane().putClientProperty("apple.awt.documentModalSheet", Boolean.TRUE); // Calculate the size of the drawing in logic units: PointG o=new PointG(); dim = DrawingSize.getImageSize(dm,1.0,true,o); addComponentListener(this); export=false; parent=p; // Obtain the current content pane and create the grid layout manager // which will be used for putting the elements of the interface. GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints; Container contentPane=getContentPane(); contentPane.setLayout(bgl); // The first thing we need to put is the combobox describing the file // format to be used. This is important, since part of the remaining // dialog should be changed depending on the format chosen. JLabel fileFormatLabel=new JLabel(Globals.messages.getString("File_format")); constraints = DialogUtil.createConst(1,0,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12,40,0,0)); contentPane.add(fileFormatLabel, constraints); fileFormat=new JComboBox<String>(); fileFormat.addItem("PNG (Bitmap)"); fileFormat.addItem("JPG (Bitmap)"); fileFormat.addItem("SVG (Vector, Scalable Vector Graphic)"); fileFormat.addItem("EPS (Vector, Encapsulated Postscript)"); fileFormat.addItem("PGF (Vector, PGF packet for LaTeX)"); fileFormat.addItem("PDF (Vector, Portable Document File)"); fileFormat.addItem("CadSoft Eagle SCR (Script)"); fileFormat.addItem("gEDA PCB, pcb-rnd (.pcb) file"); fileFormat.setSelectedIndex(0); constraints = DialogUtil.createConst(2,0,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12,0,0,20)); contentPane.add(fileFormat, constraints); // We need to track when the user changes the file format since some // options will be made available or not depending if the file format // chosen is vector based or bitmap based. fileFormat.addActionListener(this); JPanel panel = createResolutionBasedExportPanel(); JButton ok=new JButton(Globals.messages.getString("Ok_btn")); JButton cancel=new JButton(Globals.messages.getString("Cancel_btn")); constraints.gridx=0; constraints.gridy=1; constraints.gridwidth=4; constraints.gridheight=1; constraints.anchor=GridBagConstraints.EAST; constraints.insets=new Insets(20,20,20,20); tabsPane = new JTabbedPane(); tabsPane.addTab(Globals.messages.getString("res_export"), panel); JPanel sizepanel = createSizeBasedExportPanel(); tabsPane.addTab(Globals.messages.getString("size_export"), sizepanel); contentPane.add(tabsPane, constraints); constraints.gridx=0; constraints.gridy=2; constraints.gridwidth=4; constraints.gridheight=1; constraints.anchor=GridBagConstraints.EAST; constraints.insets=new Insets(20,20,20,20); JPanel commonPane = createCommonInterfaceElements(); contentPane.add(commonPane, constraints); constraints.gridx=0; constraints.gridy=3; constraints.gridwidth=4; constraints.gridheight=1; constraints.anchor=GridBagConstraints.EAST; constraints.insets=new Insets(20,20,20,20); // Put the OK and Cancel buttons and make them active. Box b=Box.createHorizontalBox(); b.add(Box.createHorizontalGlue()); ok.setPreferredSize(cancel.getPreferredSize()); if (Globals.okCancelWinOrder) { b.add(ok); b.add(Box.createHorizontalStrut(12)); b.add(cancel); } else { b.add(cancel); b.add(Box.createHorizontalStrut(12)); b.add(ok); } contentPane.add(b, constraints); // Add cancel button ok.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { int selection; // Check if the magnification factor is correct. double mult = Double.parseDouble(multiplySizes.getText()); if(multiplySizes.isEnabled() && (mult<0.01 || mult>100)) { export=false; JOptionPane.showMessageDialog(null, Globals.messages.getString("Warning_mul"), Globals.messages.getString("Warning"), JOptionPane.WARNING_MESSAGE); return; } if("".equals(fileName.getText().trim())){ export=false; JOptionPane.showMessageDialog(null, Globals.messages.getString("Warning_noname"), Globals.messages.getString("Warning"), JOptionPane.WARNING_MESSAGE); return; } selection=JOptionPane.OK_OPTION; if (selection==JOptionPane.OK_OPTION) { export=true; setVisible(false); } } }); cancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { setVisible(false); } }); // Here is an action in which the dialog is closed AbstractAction cancelAction = new AbstractAction () { @Override public void actionPerformed (ActionEvent e) { setVisible(false); } }; DialogUtil.addCancelEscape (this, cancelAction); pack(); DialogUtil.center(this); getRootPane().setDefaultButton(ok); } /** By implementing writeObject method, // we can prevent // subclass from serialization */ private void writeObject(ObjectOutputStream out) throws IOException { throw new NotSerializableException(); } /* By implementing readObject method, // we can prevent // subclass from de-serialization */ private void readObject(ObjectInputStream in) throws IOException { throw new NotSerializableException(); } /** Indicates that the export should be done: the user selected the "ok" button. @return a boolean value which indicates if the export should be done. */ public boolean shouldExport() { return export; } /** Indicates that the antiAlias should be activated. @return a boolean value which indicates if the anti alias should be activated. */ public boolean getAntiAlias() { return antiAlias_CB.isSelected(); } /** Indicates that the black and white export should be activated. @return a boolean value which indicates if the export should be done in black and white. */ public boolean getBlackWhite() { return blackWhite_CB.isSelected(); } /** Indicates that the layers should be split into different files. @return a boolean value which indicates if the layers should be split. */ public boolean getSplitLayers() { return splitLayers_CB.isSelected(); } /** Indicates that the layers should be split into different files. @param s a boolean value which indicates if the layers should be split. */ public void setSplitLayers(boolean s) { splitLayers_CB.setSelected(s); } /** Indicates if the export should be size-based or resolution-based. @return true if the export is size-based (i.e. the image size in pixels should be given) or false if the export is resolution-based (i.e. the image size is calculated from the typographical resolution. */ public boolean getResolutionBasedExport() { return tabsPane.getSelectedIndex()==0; } /** Set if the export should be size-based or resolution-based. @param s true if the export is size-based (i.e. the image size in pixels should be given) or false if the export is resolution-based (i.e. the image size is calculated from the typographical resolution. */ public void setResolutionBasedExport(boolean s) { tabsPane.setSelectedIndex(s?0:1); } /** Indicates which export format has been selected. @return a string describing the image format (e.g. "png", "jpg"). */ public String getFormat() { switch(fileFormat.getSelectedIndex()){ case PNG_INDEX: return "png"; case JPG_INDEX: return "jpg"; case SVG_INDEX: return "svg"; case EPS_INDEX: return "eps"; case PGF_INDEX: return "pgf"; case PDF_INDEX: return "pdf"; case SCR_INDEX: return "scr"; case PCB_INDEX: return "pcb"; default: System.out.println ( "dialogExport.getExportFormat Warning:"+ " file format set to png"); return "png"; } } /** @return a string containing the file name given by the user */ public String getFilename() { return fileName.getText(); } /** Sets the actual file name @param f a string containing the default file name */ public void setFilename(String f) { fileName.setText(f); } /** Sets the actual anti alias state @param a a boolean which indicates the default anti alias state */ public void setAntiAlias(boolean a) { antiAlias_CB.setSelected(a); } /** Sets the actual black and white state @param a a boolean which indicates the default black and white state */ public void setBlackWhite(boolean a) { blackWhite_CB.setSelected(a); } /** Set the default unit per pixel value @param d the default unit per pixel value */ public void setUnitPerPixel(double d) { int index=0; if (Math.abs(d-0.36)<EPS) { index=0; } if (Math.abs(d-0.75)<EPS) { index=1; } if (Math.abs(d-1.50)<EPS) { index=2; } if (Math.abs(d-3.00)<EPS) { index=3; } if (Math.abs(d-6.00)<EPS) { index=4; } if (Math.abs(d-9.00)<EPS) { index=5; } if (Math.abs(d-12.0)<EPS) { index=6; } resolution.setSelectedIndex(index); } /** Set the magnification factor for vector format export @param d the default unit per pixel value */ public void setMagnification(double d) { multiplySizes.setText(""+d); } /** Get the magnification factor for vector format export @return the unit per pixel value */ public double getMagnification() { return Double.parseDouble(multiplySizes.getText()); } /** Set the x size of the picture. @param xs the wanted x size. */ public void setXsizeInPixels(int xs) { xsizePixel.setText(""+xs); } /** If the resolution is size-based, get the x size of the picture. @return the wanted x size. */ public int getXsizeInPixels() { return Integer.parseInt(xsizePixel.getText()); } /** Set the y size of the picture. @param ys the wanted y size. */ public void setYsizeInPixels(int ys) { ysizePixel.setText(""+ys); } /** If the resolution is size-based, get the y size of the picture. @return the wanted y size. */ public int getYsizeInPixels() { return Integer.parseInt(ysizePixel.getText()); } /** Get the default unit per pixel value @return the unit per pixel value */ public double getUnitPerPixel() { int index=resolution.getSelectedIndex(); switch(index) { case 0: return 0.36; // 72/200 case 1: return 0.75; // 150/200 case 2: return 1.50; // 300/200 case 3: return 3.00; // 600/200 case 4: return 6.00; // 1200/200 case 5: return 9.00; // 1800/200 case 6: return 12.0; // 2400/200 default: return 0.36; // Not recognized. } } /** Sets the default export format. @param s The export format. If the format string is not recognized (valid strings are {"png"|"jpg"|"svg"|"eps"|"pgf"| "pdf"|"scr"|"pcb"}), use the png format. */ public void setFormat(String s) { if ("png".equals(s)) { fileFormat.setSelectedIndex(PNG_INDEX); } else if ("jpg".equals(s)) { fileFormat.setSelectedIndex(JPG_INDEX); } else if ("svg".equals(s)) { fileFormat.setSelectedIndex(SVG_INDEX); } else if ("eps".equals(s)) { fileFormat.setSelectedIndex(EPS_INDEX); } else if ("pgf".equals(s)) { fileFormat.setSelectedIndex(PGF_INDEX); } else if ("pdf".equals(s)) { fileFormat.setSelectedIndex(PDF_INDEX); } else if ("scr".equals(s)) { fileFormat.setSelectedIndex(SCR_INDEX); } else if ("pcb".equals(s)) { fileFormat.setSelectedIndex(PCB_INDEX); } else { fileFormat.setSelectedIndex(PNG_INDEX); } } /** Create a JPanel containing all the interface elements needed for a size-based export of bitmap images. @return the created panel. */ private JPanel createSizeBasedExportPanel() { JPanel panel = new JPanel(); GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints=new GridBagConstraints(); panel.setLayout(bgl); JLabel xSizeLabel=new JLabel(Globals.messages.getString("ctrl_x_radius")); constraints = DialogUtil.createConst(1,0,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,40,6,6)); panel.add(xSizeLabel, constraints); xsizePixel=new JTextField(); constraints = DialogUtil.createConst(2,0,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(xsizePixel, constraints); JLabel ySizeLabel=new JLabel(Globals.messages.getString("ctrl_y_radius")); constraints = DialogUtil.createConst(1,1,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,40,6,6)); panel.add(ySizeLabel, constraints); ysizePixel=new JTextField(); constraints = DialogUtil.createConst(2,1,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(ysizePixel, constraints); return panel; } /** Create a JPanel containing the interface elements needed for the configuration of export operation. @return the created panel. */ private JPanel createResolutionBasedExportPanel() { JPanel panel = new JPanel(); GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints=new GridBagConstraints(); panel.setLayout(bgl); JLabel resolutionLabel=new JLabel(Globals.messages.getString("Resolution")); constraints = DialogUtil.createConst(1,0,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,40,6,6)); panel.add(resolutionLabel, constraints); resolution = createResolutionComboBox(); constraints = DialogUtil.createConst(2,0,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(resolution, constraints); expectedSize= new JLabel("x"); constraints = DialogUtil.createConst(2,1,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(expectedSize, constraints); return panel; } private JPanel createCommonInterfaceElements() { JPanel panel=new JPanel(); GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints=new GridBagConstraints(); panel.setLayout(bgl); antiAlias_CB=new JCheckBox(Globals.messages.getString("Anti_aliasing")); constraints = DialogUtil.createConst(2,1,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(antiAlias_CB, constraints); // Add antialias cb blackWhite_CB=new JCheckBox(Globals.messages.getString("B_W")); constraints = DialogUtil.createConst(2,2,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(blackWhite_CB, constraints); // Add black/white cb JLabel multiplySizesLabel=new JLabel(Globals.messages.getString("Multiply_sizes")); constraints = DialogUtil.createConst(1,3,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,40,0,0)); panel.add(multiplySizesLabel, constraints); multiplySizes=new JTextField(); constraints = DialogUtil.createConst(2,3,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(multiplySizes, constraints); splitLayers_CB= new JCheckBox( Globals.messages.getString("Split_layers_multiple_files")); constraints = DialogUtil.createConst(2,4,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(splitLayers_CB, constraints); // Add split layers cb JLabel fileNameLabel=new JLabel(Globals.messages.getString("File_name")); constraints = DialogUtil.createConst(1,5,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,40,12,0)); panel.add(fileNameLabel, constraints); fileName=new JTextField(); constraints = DialogUtil.createConst(2,5,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,12,0)); panel.add(fileName, constraints); // See request #3526600 // fileName.setEditable(false); JButton browse=new JButton(Globals.messages.getString("Browse")); constraints = DialogUtil.createConst(3,5,1,1,0,0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(6,0,12,12)); panel.add(browse, constraints); browse.addActionListener(createBrowseActionListener()); return panel; } /** Create an action listener which handle clicking on the 'browse' button. @return the ActionListener */ private ActionListener createBrowseActionListener() { return new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { // Open the browser in order to let the user select the file // name on which export if(Globals.useNativeFileDialogs) { // Native file dialog FileDialog fd = new FileDialog(parent, Globals.messages.getString("Select_file_export"), FileDialog.SAVE); String filen; // Set defaults and make visible. fd.setDirectory(new File(fileName.getText()).getPath()); fd.setVisible(true); // The user has selected a file. if(fd.getFile() != null) { filen=Globals.createCompleteFileName( fd.getDirectory(), fd.getFile()); fileName.setText(filen); } } else { // Swing file dialog JFileChooser fc = new JFileChooser( new File(fileName.getText()).getPath()); int r = fc.showSaveDialog(null); if (r == JFileChooser.APPROVE_OPTION) { fileName.setText(fc.getSelectedFile().toString()); } } } }; } /** Create a JComboBox containing the resolutions, described as strings. @return the JComboBox created. */ private JComboBox<String> createResolutionComboBox() { JComboBox<String> res=new JComboBox<String>(); res.addItem("72x72 dpi"); res.addItem("150x150 dpi"); res.addItem("300x300 dpi"); res.addItem("600x600 dpi"); res.addItem("1200x1200 dpi"); res.addItem("1800x1800 dpi"); res.addItem("2400x2400 dpi"); res.addActionListener (new ActionListener () { @Override public void actionPerformed(ActionEvent e) { int width = (int)( (dim.width+Export.exportBorder)*getUnitPerPixel()); int height = (int)( (dim.height+Export.exportBorder)*getUnitPerPixel()); expectedSize.setText(""+width+" x "+height+" pixels"); } }); return res; } /** Event handling routine for the user interface. For the moment, it does not do much, except setting the enabled state of buttons and elements of the UI, depending on which kind of export is being done. @param evt the event to be processed. */ @Override public void actionPerformed(ActionEvent evt) { int idx=fileFormat.getSelectedIndex(); // Once the index of the selected item is obtained, we proceed // by checking if it is a bitmap format if(idx==0 || idx == 1) { // It is a bitmap based export xsizePixel.setEnabled(true); ysizePixel.setEnabled(true); resolution.setEnabled(true); // Resolution combo box antiAlias_CB.setEnabled(true); // AntiAlias checkbox blackWhite_CB.setEnabled(true); // Black and white checkbox multiplySizes.setEnabled(false); // Size multiplications multiplySizes.setText("1.0"); } else { // It is a vector based export xsizePixel.setEnabled(false); ysizePixel.setEnabled(false); expectedSize.setText(""); // Don't show the size in pixels resolution.setEnabled(false); // Resolution combo box antiAlias_CB.setEnabled(false); // AntiAlias checkbox blackWhite_CB.setEnabled(true); // Black and white checkbox multiplySizes.setEnabled(true); // Size multiplications } } }
27,290
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
DialogSymbolize.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/DialogSymbolize.java
package net.sourceforge.fidocadj.dialogs; import net.sourceforge.fidocadj.circuit.CircuitPanel; import net.sourceforge.fidocadj.circuit.controllers.EditorActions; import net.sourceforge.fidocadj.circuit.controllers.ParserActions; import net.sourceforge.fidocadj.circuit.controllers.SelectionActions; import net.sourceforge.fidocadj.circuit.model.DrawingModel; import net.sourceforge.fidocadj.geom.DrawingSize; import net.sourceforge.fidocadj.geom.MapCoordinates; import net.sourceforge.fidocadj.globals.Globals; import net.sourceforge.fidocadj.globals.LibUtils; import net.sourceforge.fidocadj.primitives.GraphicPrimitive; import net.sourceforge.fidocadj.primitives.MacroDesc; import net.sourceforge.fidocadj.dialogs.mindimdialog.MinimumSizeDialog; import java.io.*; import java.awt.*; import java.awt.event.*; import java.io.FileNotFoundException; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.LinkedList; import java.util.Locale; import javax.swing.*; import javax.swing.event.*; /** Choose file format, size and options of the graphic exporting. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2012-2023 Phylum2, Davide Bucci </pre> @author Phylum2, Davide Bucci */ public final class DialogSymbolize extends MinimumSizeDialog { final private JPanel parent; private DrawingModel cp; // Swing elements private JComboBox<String> libFilename; private JTextField libName; private JTextField name; private JTextField key; private JComboBox<String> group; private JCheckBox snapToGrid; OriginCircuitPanel cpanel = new OriginCircuitPanel(false); /** Gets the library to be created or modified. @return the given library (string description). */ public String getLibraryName() { String s=libName.getText(); return s.trim(); } /** Gets the name of the macro to be created @return the name */ public String getMacroName() { return name.getText(); } /** Gets the prefix (filename) of the macro to be created @return the filename/prefix */ public String getPrefix() { return libFilename.getEditor().getItem().toString(); } /** Gets the group of the macro to be created @return the name of the group */ public String getGroup() { return group.getEditor().getItem().toString(); } /** List all the libraries available which are not standard in the libFilename combo box. If there are no non standard libraries, suggest a default name. */ private void enumLibs() { libFilename.removeAllItems(); List<String> lst = new LinkedList<String>(); Map<String,MacroDesc> m=cpanel.dmp.getLibrary(); for (Entry<String,MacroDesc> e : m.entrySet()) { MacroDesc md = e.getValue(); // Add only non standard libs. if(!lst.contains(md.filename) && !LibUtils.isStdLib(md)) { libFilename.addItem(md.filename); lst.add(md.filename); } } if (((DefaultComboBoxModel) libFilename.getModel()).getSize() == 0) { libFilename.addItem("user_lib"); } libFilename.setEditable(true); } /** By implementing writeObject method, // we can prevent // subclass from serialization */ private void writeObject(ObjectOutputStream out) throws IOException { throw new NotSerializableException(); } /* By implementing readObject method, // we can prevent // subclass from de-serialization */ private void readObject(ObjectInputStream in) throws IOException { throw new NotSerializableException(); } /** Create the GUI for the dialog. @return the panel containing the user interface. */ private JPanel createInterfacePanel() { JPanel panel = new JPanel(); GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints=new GridBagConstraints(); panel.setLayout(bgl); JLabel libraryLabel=new JLabel(Globals.messages.getString("Library_file")); constraints = DialogUtil.createConst(1,0,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,0,0,0)); panel.add(libraryLabel, constraints); libFilename=new JComboBox<String>(); constraints = DialogUtil.createConst(2,0,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(libFilename, constraints); JLabel libraryNameLabel=new JLabel(Globals.messages.getString("Library_name")); constraints = DialogUtil.createConst(1,1,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,0,0,0)); panel.add(libraryNameLabel, constraints); libName = new JTextField(); constraints = DialogUtil.createConst(2,1,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(6,0,0,0)); panel.add(libName, constraints); MouseAdapter ma = new MouseAdapter() { boolean grid = false; /** Mouse click: either show the grid (button 3), or move the origin. */ @Override public void mouseReleased(MouseEvent e) { // Toggle grid visibility, via the secondary mouse button if (e.getButton()==e.BUTTON3) { grid = !grid; cpanel.setGridVisibility(grid); cpanel.repaint(); } else { mouseDragged(e); } } /** Drag the origin of axes using the mouse. */ @Override public void mouseDragged(MouseEvent evt) { int x=evt.getX(); int y=evt.getY(); if(snapToGrid.isSelected()) { cpanel.xl=cpanel.getMapCoordinates().unmapXsnap(x); cpanel.yl=cpanel.getMapCoordinates().unmapYsnap(y); } else { cpanel.xl=cpanel.getMapCoordinates().unmapXnosnap(x); cpanel.yl=cpanel.getMapCoordinates().unmapYnosnap(y); } x=cpanel.getMapCoordinates().mapXi(cpanel.xl,cpanel.yl,false); y=cpanel.getMapCoordinates().mapYi(cpanel.xl,cpanel.yl,false); cpanel.setDx(x); cpanel.setDy(y); cpanel.repaint(); } }; // Make sort that the user can move the origin both by clicking // and by dragging the mouse pointer. cpanel.addMouseListener(ma); cpanel.addMouseMotionListener(ma); // Reasonable size cpanel.setSize(256, 256); cpanel.setPreferredSize(new Dimension(256, 256)); cpanel.add(Box.createVerticalStrut(256)); cpanel.add(Box.createHorizontalStrut(256)); cpanel.dmp.setLayers(cp.getLayers()); cpanel.dmp.setLibrary(cp.getLibrary()); enumLibs(); cpanel.antiAlias = true; cpanel.profileTime = false; MacroDesc macro = buildMacro("temp","temp","temp","temp", "temp", new Point(100,100)); cpanel.setBorder(BorderFactory.createLoweredBevelBorder()); // Set the current objects in the preview panel. cpanel.getParserActions().addString( new StringBuffer(macro.description), false); // Calculate an optimum preview size in order to show all elements. MapCoordinates m = DrawingSize.calculateZoomToFit(cpanel.dmp, cpanel.getSize().width*80/100, cpanel.getSize().height*80/100, true); m.setXCenter(-m.getXCenter()+10); m.setYCenter(-m.getYCenter()+10); cpanel.setMapCoordinates(m); cpanel.resetOrigin(); constraints = DialogUtil.createConst(3,0,8,8,100,100, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6,6,6,6)); panel.add(cpanel, constraints); JLabel groupLabel=new JLabel(Globals.messages.getString("Group")); // constraints = DialogUtil.createConst(1,3,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,40,0,0)); panel.add(groupLabel, constraints); group=new JComboBox<String>(); listGroups(); if (group.getItemCount()==0) { group.addItem(Globals.messages.getString("Group"). toLowerCase(Locale.getDefault())); } group.setEditable(true); libFilename.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent arg0) { listGroups(); } }); libFilename.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { listGroups(); } }); constraints = DialogUtil.createConst(2,3,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,0,0)); panel.add(group, constraints); JLabel nameLabel=new JLabel(Globals.messages.getString("Name")); // constraints = DialogUtil.createConst(1,4,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,40,12,0)); panel.add(nameLabel, constraints); name=new JTextField(); name.setText( Globals.messages.getString("Name"). toLowerCase(Locale.getDefault())); constraints = DialogUtil.createConst(2,4,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,12,0)); panel.add(name, constraints); JLabel nameLabel1=new JLabel(Globals.messages.getString("Key")); // constraints = DialogUtil.createConst(1,5,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(6,40,12,0)); panel.add(nameLabel1, constraints); key=new JTextField(); long t=System.nanoTime(); long h=0; for(int i=0; t>0; ++i) { t>>=i*8; h^=t & 0xFF; } constraints = DialogUtil.createConst(2,5,1,1,100,100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6,0,12,0)); panel.add(key, constraints); key.getDocument().addDocumentListener(new DocumentListener() { /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void insertUpdate(DocumentEvent e) { showValidity(); } /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void removeUpdate(DocumentEvent e) { showValidity(); } /** Needed to implement the DocumentListener interface @param e the document event. */ @Override public void changedUpdate(DocumentEvent e) { showValidity(); } /** Change the background color of the fiel depending on the validity of the key currently defined. */ public void showValidity() { if(isKeyInvalid()) { key.setBackground(Color.RED.darker()); key.setForeground(Color.WHITE); } else { Color c1=UIManager.getColor("TextField.background"); Color c2=UIManager.getColor("TextField.foreground"); if(c1!=null && c2!=null) { key.setBackground(c1); key.setForeground(c2); } else { key.setBackground(Color.GREEN.darker().darker()); key.setForeground(Color.WHITE); } } } }); while(isKeyInvalid()) { key.setText(String.valueOf(h++)); } snapToGrid=new JCheckBox( Globals.messages.getString("SnapToGridOrigin")); constraints = DialogUtil.createConst(2,6,1,1,0,0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6,0,0,0)); panel.add(snapToGrid, constraints); // Keep in mind the last edited library and group if (Globals.lastCLib!=null) { libFilename.setSelectedItem(Globals.lastCLib); } if (Globals.lastCGrp!=null) { group.setSelectedItem(Globals.lastCGrp); } libFilename.getEditor().selectAll(); return panel; } /** Obtain all the groups in a given library and put them in the group list. */ private void listGroups() { // Obtain all the groups in a given library. List<String> l = LibUtils.enumGroups(cp.getLibrary(), libFilename.getEditor().getItem().toString()); // Update the group list. group.removeAllItems(); for (String s : l) { group.addItem(s); } libName.setText(LibUtils.getLibName(cp.getLibrary(), libFilename.getEditor().getItem().toString())); } /** Standard constructor. @param circuitPanel the panel containing a complete editor. @param p the model */ public DialogSymbolize (CircuitPanel circuitPanel, DrawingModel p) { super(350,250,(JFrame)null, Globals.messages.getString("SaveSymbol"), true); parent = circuitPanel; addComponentListener(this); // Obtain the current content pane and create the grid layout manager // which will be used for putting the elements of the interface. GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints; Container contentPane=getContentPane(); contentPane.setLayout(bgl); constraints = DialogUtil.createConst(2,0,1,1,100,100, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12,0,0,20)); setCircuit(p); JPanel panel = createInterfacePanel(); JButton ok=new JButton(Globals.messages.getString("Ok_btn")); JButton cancel=new JButton(Globals.messages.getString("Cancel_btn")); constraints.gridx=0; constraints.gridy=1; constraints.gridwidth=4; constraints.gridheight=1; constraints.anchor=GridBagConstraints.EAST; constraints.insets=new Insets(20,20,20,20); contentPane.add(panel, constraints); constraints.gridx=0; constraints.gridy=2; constraints.gridwidth=4; constraints.gridheight=1; constraints.anchor=GridBagConstraints.EAST; constraints.insets=new Insets(20,20,20,20); // Put the OK and Cancel buttons and make them active. Box b=Box.createHorizontalBox(); b.add(Box.createHorizontalGlue()); ok.setPreferredSize(cancel.getPreferredSize()); if (Globals.okCancelWinOrder) { b.add(ok); b.add(Box.createHorizontalStrut(12)); b.add(cancel); } else { b.add(cancel); b.add(Box.createHorizontalStrut(12)); b.add(ok); } // Add the OK/cancel buttons in the correct order contentPane.add(b, constraints); ok.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { // Check if there is a valid key available. We can not continue // without a key! if (isKeyAbsent()) { JOptionPane.showMessageDialog(null, Globals.messages.getString("InvKey"), Globals.messages.getString("Symbolize"), JOptionPane.ERROR_MESSAGE); key.requestFocus(); return; } else if(isKeyDuplicate()) { JOptionPane.showMessageDialog(null, Globals.messages.getString("DupKey"), Globals.messages.getString("Symbolize"), JOptionPane.ERROR_MESSAGE); key.requestFocus(); return; } else if(isKeyContainingInvalidChars()) { JOptionPane.showMessageDialog(null, Globals.messages.getString("SpaceKey"), Globals.messages.getString("Symbolize"), JOptionPane.ERROR_MESSAGE); key.requestFocus(); return; } Point p = new Point(200-cpanel.xl, 200-cpanel.yl); MacroDesc macro = buildMacro(getMacroName().trim(), key.getText().trim(),getLibraryName().trim(), getGroup().trim(), getPrefix().trim(),p); cp.getLibrary().put(macro.key, macro); // add to lib // Save the new symbol in the current libFilename try { LibUtils.save(cp.getLibrary(), LibUtils.getLibPath(getPrefix()).trim(), getLibraryName(), getPrefix()); } catch (FileNotFoundException fF) { JOptionPane.showMessageDialog(null, Globals.messages.getString("DirNotFound"), Globals.messages.getString("Symbolize"), JOptionPane.ERROR_MESSAGE); } setVisible(false); ((JFrame)Globals.activeWindow).repaint(); // Update libs updateTreeLib(); Globals.lastCLib = getLibraryName(); Globals.lastCGrp = getGroup(); } }); cancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { setVisible(false); } }); // Here is an action in which the dialog is closed AbstractAction cancelAction = new AbstractAction () { @Override public void actionPerformed (ActionEvent e) { setVisible(false); } }; DialogUtil.addCancelEscape (this, cancelAction); pack(); DialogUtil.center(this); getRootPane().setDefaultButton(ok); } /** Check if the current key is duplicate or not. @return true if a duplicate exists in the library. */ private boolean isKeyDuplicate() { return LibUtils.checkKey(cp.getLibrary(), getPrefix().trim(), getPrefix().trim()+"."+key.getText().trim()); } /** Check if the current key is containing invalid characters. @return true the current key is containing invalid chars. */ private boolean isKeyContainingInvalidChars() { // Currently, the only recognized invalid chars are spaces and dots. return key.getText().contains(" ") || key.getText().contains("."); } /** Check if the current key is specified. @return true the current key is not empty */ private boolean isKeyAbsent() { return key.getText().length()<1; } /** Check if the key is valid or not. */ private boolean isKeyInvalid() { return isKeyAbsent() || isKeyContainingInvalidChars() || isKeyDuplicate(); } protected MacroDesc buildMacro(String myname, String mykey, String mylib, String mygrp, String myprefix, Point origin) { StringBuilder ss = new StringBuilder(); SelectionActions sa = new SelectionActions(cp); new EditorActions(cp, sa, null); // Check if there is anything selected. if (sa.getFirstSelectedPrimitive() == null) { return null; } // Move the selected primitives around the origin just // determined and add them to the macro description contained // in ss. DrawingModel ps = new DrawingModel(); try { ps.setLibrary(cp.getLibrary()); ParserActions pa = new ParserActions(ps); for (GraphicPrimitive g : cp.getPrimitiveVector()) { if (g.getSelected()) { pa.addString(new StringBuffer(g.toString(true)), true); } } //sa.setSelectionAll(true); } catch (Exception e){ e.printStackTrace(); } for (GraphicPrimitive psp : ps.getPrimitiveVector()) { if (!psp.getSelected()) { continue; } psp.movePrimitive(origin.x, origin.y); ss.append(psp.toString(true)); } parent.repaint(); String desc = ss.toString(); return new MacroDesc(myprefix+"."+mykey, myname, desc, mygrp, mylib, myprefix); } /** Update all the libs shown in the tree. */ protected void updateTreeLib() { // TODO: // This is a tricky code. What if a new menu option is added? // This would be better, but there is something to solve about access. // ((FidoFrame)Globals.activeWindow).loadLibraries(); Container cc; cc = (JFrame)Globals.activeWindow; ((AbstractButton) ((JFrame) cc).getJMenuBar() .getMenu(3).getSubElements()[0].getSubElements()[1]).doClick(); } /** Sets the drawing database on which to work @param p the database */ public void setCircuit(DrawingModel p) { this.cp = p; } }
23,018
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
ArrowInfo.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/ArrowInfo.java
package net.sourceforge.fidocadj.dialogs; /** This class contains information about the arrow style. It is useful for the automatic generation of the properties dialog. @author Davide Bucci <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2009-2023 by Davide Bucci </pre> */ public class ArrowInfo { public int style; /** Standard constructor: specify the style to be used. @param i style to set */ public ArrowInfo(int i) { style=i; } /** Obtain the style of the arrow. @return the arrow style. */ public int getStyle() { return style; } }
1,305
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
DashInfo.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/DashInfo.java
package net.sourceforge.fidocadj.dialogs; /** This class contains some settings about the actual dashing style. It is used in the automatic primitive characteristics dialog. @author Davide Bucci <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2009-2023 by Davide Bucci </pre> */ public class DashInfo { // Here we store the dash style public int style; /** Creator. @param i the style to be stored */ public DashInfo(int i) { style=i; } /** Retrieve the style. @return the style. */ public int getStyle() { return style; } }
1,295
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
LayerCellRenderer.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/LayerCellRenderer.java
package net.sourceforge.fidocadj.dialogs; import java.awt.*; import javax.swing.*; import net.sourceforge.fidocadj.layers.LayerDesc; /** The class LayerCellRenderer is used in the layer list in order to show the characteristics of each layer (visibility, color). <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. </pre> @author Davide Bucci @version December 2007 - 2023 */ public class LayerCellRenderer implements ListCellRenderer<LayerDesc> { /** Method required for the ListCellRenderer interface; it draws a layer element in the cell and adds its event listeners. @param list the list of elements. @param value the current layer description. @param index the index of the current element in the list. @param isSelected true if the element is selected. @param cellHasFocus true if the element has focus. @return the created component. */ @Override public Component getListCellRendererComponent( final JList<? extends LayerDesc> list, final LayerDesc value, final int index, final boolean isSelected, final boolean cellHasFocus) { final LayerDesc layer=(LayerDesc) value; return new CellLayer(layer, list, isSelected); } }
1,944
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/print/package-info.java
/** Package containing classes for the printing options dialog, as well as the print preview. */ package net.sourceforge.fidocadj.dialogs.print;
152
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
PrintPreview.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/print/PrintPreview.java
package net.sourceforge.fidocadj.dialogs.print; import java.io.*; import java.awt.*; import java.awt.print.*; import java.awt.event.*; import java.awt.image.*; import java.awt.geom.AffineTransform; import javax.swing.border.EtchedBorder; // NOPMD (bug in PMD 7.0?) import javax.swing.BorderFactory; // NOPMD (bug in PMD 7.0?) import net.sourceforge.fidocadj.circuit.CircuitPanel; import net.sourceforge.fidocadj.PrintTools; /** Shows a print preview. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2015-2023 by Davide Bucci </pre> @author Davide Bucci */ public final class PrintPreview extends CircuitPanel implements ComponentListener { private final PageFormat pageDescription; private double topMargin; private double bottomMargin; private double leftMargin; private double rightMargin; private BufferedImage pageImage; private final PrintTools printObject; private final DialogPrint dialog; private int currentPage; private double oldBaseline; /** Constructor. @param isEditable true if the panel should be editable. @param p the PageFormat description. @param ddp the DialogPrint object to communicate with. */ public PrintPreview(boolean isEditable, PageFormat p, DialogPrint ddp) { super(isEditable); pageDescription=p; currentPage=0; dialog=ddp; setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); setGridVisibility(false); addComponentListener(this); int width=200; int height=320; pageImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); printObject=new PrintTools(); printObject.associateToCircuitPanel(this); printObject.setShowMargins(true); Graphics2D g2=(Graphics2D)pageImage.createGraphics(); g2.setColor(Color.white); g2.fillRect(0,0,width,height); g2.scale(1.0/160,1.0/160); try { printObject.print(g2, pageDescription, 0); } catch (PrinterException pe) { System.err.println("Some problem here!"); } } /** By implementing writeObject method, // we can prevent // subclass from serialization */ private void writeObject(ObjectOutputStream out) throws IOException { throw new NotSerializableException(); } /* By implementing readObject method, // we can prevent // subclass from de-serialization */ private void readObject(ObjectInputStream in) throws IOException { throw new NotSerializableException(); } /** Set the size of the margins, in centimeters. The orientation of those margins should correspond to the page in the portrait orientation. @param tm top margin. @param bm bottom margin. @param lm left margin. @param rm right margin. */ public void setMargins(double tm, double bm, double lm, double rm) { topMargin=tm; bottomMargin=bm; leftMargin=lm; rightMargin=rm; } /** Set the current page to be printed. @param p the page to be printed. @return the number of the selected page (it may differ from the one which is passed as an argument, since a sanity check is done). */ public int setCurrentPage(int p) { pageImage = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB); Graphics2D g2=(Graphics2D)pageImage.createGraphics(); try { if (printObject.print(g2, pageDescription, p) ==Printable.PAGE_EXISTS) { currentPage=p; } else { currentPage=0; } } catch (PrinterException pe) { currentPage=0; } return currentPage; } /** Show the margins. @param g the graphic context where to draw. */ @Override public void paintComponent(Graphics g) { getDrawingModel().setChanged(true); // Needed? Color c = g.getColor(); Graphics2D g2d = (Graphics2D) g; int shadowShiftX=4; int shadowShiftY=4; double baseline=getWidth()*0.6; if(Math.abs(oldBaseline-baseline)>1e5) { /// TODO check -> 1e-5 !!! updatePreview(); } double ratio=pageDescription.getHeight()/pageDescription.getWidth(); if(dialog.getLandscape()) { baseline=getWidth()*0.8; pageDescription.setOrientation(pageDescription.LANDSCAPE); } else { pageDescription.setOrientation(pageDescription.PORTRAIT); } // Draw the background. g2d.setColor(getBackground()); g2d.fillRect(0,0,getWidth(), getHeight()); // Draw the shadow of the page. g2d.setColor(Color.gray.darker()); g2d.fillRect((int)Math.round(getWidth()/2.0-baseline/2.0)+shadowShiftX, (int)Math.round(getHeight()/2.0-baseline*ratio/2.0)+shadowShiftY, (int)Math.round(baseline), (int)Math.round(baseline*ratio)); // Draw the image containing the preview. g2d.drawImage(pageImage, (int)Math.round(getWidth()/2.0-baseline/2.0), (int)Math.round(getHeight()/2.0-baseline*ratio/2.0), null); // Draw the contour of the page. g2d.setColor(Color.black); g2d.drawRect((int)Math.round(getWidth()/2.0-baseline/2.0), (int)Math.round(getHeight()/2.0-baseline*ratio/2.0), (int)Math.round(baseline)-1, (int)Math.round(baseline*ratio)); g2d.setColor(c); } /** Called when the panel is resized. TODO: this is not very memory efficient, since an image is created each time the panel is resized. @param e the event descriptor. */ @Override public void componentResized(ComponentEvent e) { updatePreview(); } /** Update the printing preview by calculating again the image containing it. It will be shown at the following repaint operation. */ public void updatePreview() { printObject.configurePrinting(dialog, pageDescription, false); double baseline=getWidth()*0.6; double pageWidth=pageDescription.getWidth(); double pageHeight=pageDescription.getHeight(); double ratio=pageHeight/pageWidth; if(dialog.getLandscape()) { baseline=getWidth()*0.8; pageDescription.setOrientation(pageDescription.LANDSCAPE); } else { pageDescription.setOrientation(pageDescription.PORTRAIT); } int width=(int)baseline; int height=(int)Math.round(baseline*ratio); if(width<1) { width=1; } if(height<1) { height=1; } pageImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics2D g2d=(Graphics2D)pageImage.createGraphics(); AffineTransform oldTransform = g2d.getTransform(); // Activate anti-aliasing g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setColor(Color.white); g2d.fillRect(0,0,width,height); g2d.scale(width/pageWidth, height/pageHeight); try { printObject.setMargins(topMargin, bottomMargin, leftMargin, rightMargin); printObject.print(g2d, pageDescription, currentPage); } catch (PrinterException pe) { System.err.println("Some problem here!"); } g2d.setTransform(oldTransform); oldBaseline=baseline; } /** Get the total number of pages in the preview. @return the number of pages. */ public int getTotalNumberOfPages() { int numpages=0; pageImage = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB); Graphics2D g2=(Graphics2D)pageImage.createGraphics(); try { while(printObject.print(g2, pageDescription, numpages) ==Printable.PAGE_EXISTS) { ++numpages; } } catch (PrinterException pe) { System.err.println("Some problems when trying to print."); } return numpages; } /** Called when the panel is hidden. @param e the event descriptor. */ @Override public void componentHidden(ComponentEvent e) { // Nothing to do here } /** Called when the panel is moved. @param e the event descriptor. */ @Override public void componentMoved(ComponentEvent e) { // Nothing to do here } /** Called when the panel is shown. @param e the event descriptor. */ @Override public void componentShown(ComponentEvent e) { // Nothing to do here } }
9,711
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
DialogPrint.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/print/DialogPrint.java
package net.sourceforge.fidocadj.dialogs.print; import java.awt.*; import java.awt.event.*; import java.awt.print.*; import java.util.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.plaf.basic.BasicArrowButton; import net.sourceforge.fidocadj.globals.Globals; import net.sourceforge.fidocadj.dialogs.mindimdialog.MinimumSizeDialog; import net.sourceforge.fidocadj.dialogs.DialogUtil; import net.sourceforge.fidocadj.circuit.model.DrawingModel; import net.sourceforge.fidocadj.dialogs.LayerCellRenderer; import net.sourceforge.fidocadj.layers.LayerDesc; /** Choose file format, size and options of the graphic exporting. The class dialogPrint implements a modal dialog to select printing options. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2007-2023 by Davide Bucci </pre> @author Davide Bucci */ public final class DialogPrint extends MinimumSizeDialog { private final JCheckBox mirror_CB; private final JCheckBox fit_CB; private final JCheckBox bw_CB; private final JCheckBox landscape_CB; private final PrintPreview prp; private final JTextField tTopMargin; private final JTextField tBottomMargin; private final JTextField tLeftMargin; private final JTextField tRightMargin; private final JCheckBox onlyLayerCB; private final JLabel pageNum; private final JComboBox<LayerDesc> layerSel; private double maxHorisontalMargin; private double maxVerticalMargin; private boolean oldLandscapeState=false; private int currentLayerSelected=-1; // This contains the number of pages when the drawing is not resized to // fit one page. private int numberOfPages=0; // This contains the current page to be printed. private int currentPage=0; private boolean print; // Indicates that the print should be done /** Standard constructor: it needs the parent frame. @param parent the dialog's parent. @param drawingModel the drawing model to be employed. @param pageDescription the description of the page to be printed. */ public DialogPrint (JFrame parent, DrawingModel drawingModel, PageFormat pageDescription) { super(400,350, parent,Globals.messages.getString("Print_dlg"), true); addComponentListener(this); print=false; final int lColumn=5; final int eColumn=6; // Ensure that under MacOSX >= 10.5 Leopard, this dialog will appear // as a document modal sheet getRootPane().putClientProperty("apple.awt.documentModalSheet", Boolean.TRUE); GridBagLayout bgl=new GridBagLayout(); GridBagConstraints constraints=new GridBagConstraints(); Container contentPane=getContentPane(); contentPane.setLayout(bgl); constraints.insets.right=30; JLabel empty=new JLabel(" "); constraints.weightx=100; constraints.weighty=100; constraints.gridx=0; constraints.gridy=0; constraints.gridwidth=1; constraints.gridheight=1; contentPane.add(empty, constraints); // Add " " label JLabel empty1=new JLabel(" "); constraints.weightx=100; constraints.weighty=100; constraints.gridx=eColumn+2; constraints.gridy=0; constraints.gridwidth=1; constraints.gridheight=1; contentPane.add(empty1, constraints); // Add " " label prp=new PrintPreview(false, pageDescription, this); prp.add(Box.createVerticalStrut(256)); prp.add(Box.createHorizontalStrut(256)); prp.setDrawingModel(drawingModel); constraints.anchor=GridBagConstraints.EAST; constraints.fill=GridBagConstraints.BOTH; constraints.weightx=100; constraints.weighty=100; constraints.gridx=1; constraints.gridy=0; constraints.gridwidth=3; constraints.gridheight=9; constraints.insets = new Insets(10,0,10,0); contentPane.add(prp, constraints); // Print preview! final BasicArrowButton decr = new BasicArrowButton(BasicArrowButton.WEST); numberOfPages=prp.getTotalNumberOfPages(); pageNum=new JLabel(""+(currentPage+1)+"/"+numberOfPages); constraints.anchor=GridBagConstraints.EAST; constraints.fill=GridBagConstraints.BOTH; constraints.weightx=100; constraints.weighty=100; constraints.gridx=2; constraints.gridy=9; constraints.gridwidth=1; constraints.gridheight=1; constraints.insets = new Insets(2,0,0,0); contentPane.add(pageNum, constraints); // Num of pages constraints.anchor=GridBagConstraints.EAST; constraints.fill=GridBagConstraints.BOTH; constraints.weightx=100; constraints.weighty=100; constraints.gridx=1; constraints.gridy=9; constraints.gridwidth=1; constraints.gridheight=1; constraints.insets = new Insets(2,0,0,0); contentPane.add(decr, constraints); // Decrement page decr.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { if(currentPage>0) { --currentPage; } currentPage=prp.setCurrentPage(currentPage); prp.updatePreview(); prp.repaint(); pageNum.setText(""+(currentPage+1)+"/"+numberOfPages); } }); final BasicArrowButton incr = new BasicArrowButton(BasicArrowButton.EAST); constraints.anchor=GridBagConstraints.EAST; constraints.fill=GridBagConstraints.BOTH; constraints.weightx=100; constraints.weighty=100; constraints.gridx=3; constraints.gridy=9; constraints.gridwidth=1; constraints.gridheight=1; contentPane.add(incr, constraints); // Increment page incr.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { if(currentPage<numberOfPages-1) { ++currentPage; } currentPage=prp.setCurrentPage(currentPage); prp.updatePreview(); prp.repaint(); pageNum.setText(""+(currentPage+1)+"/"+numberOfPages); } }); if(numberOfPages>1) { incr.setEnabled(true); decr.setEnabled(true); } else { incr.setEnabled(false); decr.setEnabled(false); } JLabel lTopMargin=new JLabel(Globals.messages.getString("TopMargin")); constraints.anchor=GridBagConstraints.WEST; constraints.fill=GridBagConstraints.HORIZONTAL; constraints.weightx=100; constraints.weighty=100; constraints.gridx=eColumn; constraints.gridy=0; constraints.gridwidth=1; constraints.gridheight=1; constraints.insets = new Insets(5,0,0,0); contentPane.add(lTopMargin, constraints); // Top margin label DocumentListener dl=new DocumentListener() { private void patata() { try { double tm=Double.parseDouble(tTopMargin.getText()); double bm=Double.parseDouble(tBottomMargin.getText()); double lm=Double.parseDouble(tLeftMargin.getText()); double rm=Double.parseDouble(tRightMargin.getText()); prp.setMargins(tm,bm,lm,rm); numberOfPages=prp.getTotalNumberOfPages(); currentPage=prp.setCurrentPage(currentPage); prp.updatePreview(); pageNum.setText(""+(currentPage+1)+"/"+numberOfPages); } catch (NumberFormatException n) { System.out.println("Warning: can not convert a number"); } prp.repaint(); } @Override public void changedUpdate(DocumentEvent e) { patata(); } @Override public void removeUpdate(DocumentEvent e) { patata(); } @Override public void insertUpdate(DocumentEvent e) { patata(); } }; // The event listener for all those checkboxes ChangeListener updatePreview = new ChangeListener() { @Override public void stateChanged(ChangeEvent changeEvent) { numberOfPages=prp.getTotalNumberOfPages(); /*if(fit_CB.isSelected()) { currentPage = 0; incr.setEnabled(false); decr.setEnabled(false); } else { if(numberOfPages>1) { incr.setEnabled(true); decr.setEnabled(true); } }*/ if(numberOfPages>1) { incr.setEnabled(true); decr.setEnabled(true); } else { incr.setEnabled(false); decr.setEnabled(false); } currentPage=prp.setCurrentPage(currentPage); prp.updatePreview(); prp.repaint(); pageNum.setText(""+(currentPage+1)+"/"+numberOfPages); } }; tTopMargin=new JTextField(10); constraints.weightx=100; constraints.weighty=100; constraints.gridx=lColumn; constraints.gridy=0; constraints.gridwidth=1; constraints.gridheight=1; constraints.insets = new Insets(3,5,0,0); contentPane.add(tTopMargin, constraints); // Top margin text tTopMargin.getDocument().addDocumentListener(dl); JLabel lBottomMargin=new JLabel( Globals.messages.getString("BottomMargin")); constraints.anchor=GridBagConstraints.WEST; constraints.weightx=100; constraints.weighty=100; constraints.gridx=eColumn; constraints.gridy=1; constraints.gridwidth=1; constraints.gridheight=1; constraints.insets = new Insets(0,0,0,0); contentPane.add(lBottomMargin, constraints); // Bottom margin label tBottomMargin=new JTextField(10); Dimension ddmin=tBottomMargin.getMinimumSize(); ddmin.width=100; tBottomMargin.setMinimumSize(ddmin); constraints.weightx=100; constraints.weighty=100; constraints.gridx=lColumn; constraints.gridy=1; constraints.gridwidth=1; constraints.gridheight=1; constraints.insets = new Insets(0,5,0,0); contentPane.add(tBottomMargin, constraints); // Bottom margin text tBottomMargin.getDocument().addDocumentListener(dl); JLabel lLeftMargin=new JLabel(Globals.messages.getString("LeftMargin")); constraints.anchor=GridBagConstraints.WEST; constraints.weightx=100; constraints.weighty=100; constraints.gridx=eColumn; constraints.gridy=2; constraints.gridwidth=1; constraints.gridheight=1; contentPane.add(lLeftMargin, constraints); // Left margin label tLeftMargin=new JTextField(10); constraints.weightx=100; constraints.weighty=100; constraints.gridx=lColumn; constraints.gridy=2; constraints.gridwidth=1; constraints.gridheight=1; contentPane.add(tLeftMargin, constraints); // Left margin text tLeftMargin.getDocument().addDocumentListener(dl); JLabel lRightMargin=new JLabel( Globals.messages.getString("RightMargin")); constraints.anchor=GridBagConstraints.WEST; constraints.weightx=100; constraints.weighty=100; constraints.gridx=eColumn; constraints.gridy=3; constraints.gridwidth=1; constraints.gridheight=1; contentPane.add(lRightMargin, constraints); // Right margin label tRightMargin=new JTextField(10); constraints.weightx=100; constraints.weighty=100; constraints.gridx=lColumn; constraints.gridy=3; constraints.gridwidth=1; constraints.gridheight=1; contentPane.add(tRightMargin, constraints); // Right margin text tRightMargin.getDocument().addDocumentListener(dl); onlyLayerCB=new JCheckBox(Globals.messages.getString( "PrintOnlyLayer")); constraints.gridx=lColumn; constraints.gridy=4; constraints.gridwidth=1; constraints.gridheight=1; constraints.anchor=GridBagConstraints.WEST; contentPane.add(onlyLayerCB, constraints); // Print only 1 layer cb onlyLayerCB.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent changeEvent) { if(onlyLayerCB.isSelected()) { if(layerSel!=null) { layerSel.setEnabled(true); currentLayerSelected=layerSel.getSelectedIndex(); } } else { layerSel.setEnabled(false); } prp.updatePreview(); prp.repaint(); } }); layerSel = new JComboBox<LayerDesc>( (Vector<LayerDesc>)drawingModel.getLayers()); layerSel.setRenderer(new LayerCellRenderer()); layerSel.setEnabled(false); constraints.weightx=100; constraints.weighty=100; constraints.gridx=lColumn+1; constraints.gridy=4; constraints.gridwidth=1; constraints.gridheight=1; contentPane.add(layerSel, constraints); // Layer selection layerSel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { if (layerSel.getSelectedIndex()>=0) { currentLayerSelected=layerSel.getSelectedIndex(); if(onlyLayerCB.isSelected()) { prp.updatePreview(); prp.repaint(); } } } }); mirror_CB=new JCheckBox(Globals.messages.getString("Mirror")); constraints.gridx=lColumn; constraints.gridy=5; constraints.gridwidth=2; constraints.gridheight=1; constraints.anchor=GridBagConstraints.WEST; contentPane.add(mirror_CB, constraints); // Add Print Mirror cb mirror_CB.addChangeListener(updatePreview); fit_CB=new JCheckBox(Globals.messages.getString("FitPage")); constraints.gridx=lColumn; constraints.gridy=6; constraints.gridwidth=2; constraints.gridheight=1; constraints.anchor=GridBagConstraints.WEST; contentPane.add(fit_CB, constraints); // Add Fit to page cb fit_CB.addChangeListener(updatePreview); bw_CB=new JCheckBox(Globals.messages.getString("B_W")); constraints.gridx=lColumn; constraints.gridy=7; constraints.gridwidth=2; constraints.gridheight=1; constraints.anchor=GridBagConstraints.WEST; contentPane.add(bw_CB, constraints); // Add BlackWhite cb bw_CB.addChangeListener(updatePreview); landscape_CB=new JCheckBox(Globals.messages.getString("Landscape")); constraints.gridx=lColumn; constraints.gridy=8; constraints.gridwidth=2; constraints.gridheight=1; constraints.anchor=GridBagConstraints.WEST; contentPane.add(landscape_CB, constraints); // Add landscape cb landscape_CB.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent changeEvent) { // If the page was rotated, the margins should be adapted // so they always correspond to the same place in the page. if(!oldLandscapeState && landscape_CB.isSelected()) { String d=tLeftMargin.getText(); tLeftMargin.setText(tBottomMargin.getText()); tBottomMargin.setText(tRightMargin.getText()); tRightMargin.setText(tTopMargin.getText()); tTopMargin.setText(d); } else if(oldLandscapeState && !landscape_CB.isSelected()){ String d=tTopMargin.getText(); tTopMargin.setText(tRightMargin.getText()); tRightMargin.setText(tBottomMargin.getText()); tBottomMargin.setText(tLeftMargin.getText()); tLeftMargin.setText(d); } numberOfPages=prp.getTotalNumberOfPages(); prp.updatePreview(); prp.repaint(); oldLandscapeState=landscape_CB.isSelected(); } }); // Put the OK and Cancel buttons and make them active. JButton ok=new JButton(Globals.messages.getString("Ok_btn")); JButton cancel=new JButton(Globals.messages.getString("Cancel_btn")); constraints.gridx=1; constraints.gridy=10; constraints.gridwidth=7; constraints.gridheight=1; constraints.insets = new Insets(20,0,0,0); //top padding constraints.anchor=GridBagConstraints.EAST; // Put the OK and Cancel buttons and make them active. Box b=Box.createHorizontalBox(); b.add(Box.createHorizontalGlue()); ok.setPreferredSize(cancel.getPreferredSize()); if (Globals.okCancelWinOrder) { b.add(ok); b.add(Box.createHorizontalStrut(12)); b.add(cancel); } else { b.add(cancel); b.add(Box.createHorizontalStrut(12)); b.add(ok); } ok.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { if(validateInput()) { print=true; setVisible(false); } } }); cancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { print=false; setVisible(false); } }); // Here is an action in which the dialog is closed AbstractAction cancelAction = new AbstractAction () { @Override public void actionPerformed (ActionEvent e) { setVisible(false); } }; constraints.insets = new Insets(10,0,10,0); contentPane.add(b, constraints); // Add OK/cancel dialog DialogUtil.addCancelEscape (this, cancelAction); pack(); DialogUtil.center(this); getRootPane().setDefaultButton(ok); } /** Check if the drawing should be mirrored. @return true wether the mirroring should be done. */ public boolean getMirror() { return mirror_CB.isSelected(); } /** Check if the drawing should be fit to the page @return true wether the fitting should be done. */ public boolean getFit() { return fit_CB.isSelected(); } /** Check if the page orientation should be landscape @return true wether the orientation is landscape. */ public boolean getLandscape() { return landscape_CB.isSelected(); } /** Get the layer to be printed if a single layer is what the user need. @return the layer to be printed if greater or equal than 0 or -1 if all layers should be printed. */ public int getSingleLayerToPrint() { if (!onlyLayerCB.isSelected()) { return -1; } return currentLayerSelected; } /** Check if the black and white checkbox is selected. @return true if the checkbox is active. */ public boolean getBW() { return bw_CB.isSelected(); } /** Set the mirror attribute @param m true if the printout should be done in mirroring mode. */ public void setMirror(boolean m) { mirror_CB.setSelected(m); } /** Set the resize to fit option @param f true if the drawing should be stretched in order to fit the page. */ public void setFit(boolean f) { fit_CB.setSelected(f); } /** Set the landscape mode @param l true if the output should be in landscape mode. It will be in portrait orientation otherwise. */ public void setLandscape(boolean l) { landscape_CB.setSelected(l); oldLandscapeState=l; } /** Set the size of the margins, in centimeters. The orientation of those margins should correspond to the page in the portrait orientation. @param tm top margin. @param bm bottom margin. @param lm left margin. @param rm right margin. */ public void setMargins(double tm, double bm, double lm, double rm) { tTopMargin.setText(Globals.roundTo(tm,3)); tBottomMargin.setText(Globals.roundTo(bm,3)); tLeftMargin.setText(Globals.roundTo(lm,3)); tRightMargin.setText(Globals.roundTo(rm,3)); } /** Check if the input is valid. @return true if the input is valid. */ private boolean validateInput() { double tm; double bm; double lm; double rm; try { tm=Double.parseDouble(tTopMargin.getText()); bm=Double.parseDouble(tBottomMargin.getText()); lm=Double.parseDouble(tLeftMargin.getText()); rm=Double.parseDouble(tRightMargin.getText()); } catch (NumberFormatException n) { JOptionPane.showMessageDialog(this, Globals.messages.getString("Format_invalid"), "", JOptionPane.INFORMATION_MESSAGE); return false; } if(tm+bm>=maxVerticalMargin || lm+rm>=maxHorisontalMargin) { JOptionPane.showMessageDialog(this, Globals.messages.getString("Margins_too_large"), "", JOptionPane.INFORMATION_MESSAGE); return false; } return true; } /** Defines the limits for the sum of the horisontal and vertical margins. @param maxhor the limit of the left+right margins (in cm) @param maxvert the limit of the top+bottom margins (in cm) */ public void setMaxMargins(double maxhor, double maxvert) { maxHorisontalMargin=maxhor; maxVerticalMargin=maxvert; } /** Get the size of the top margin, in centimeters. @return the margin size. */ public double getTMargin() { return Double.parseDouble(tTopMargin.getText()); } /** Get the size of the bottom margin, in centimeters. @return the margin size. */ public double getBMargin() { return Double.parseDouble(tBottomMargin.getText()); } /** Get the size of the left margin, in centimeters. @return the margin size. */ public double getLMargin() { return Double.parseDouble(tLeftMargin.getText()); } /** Get the size of the right margin, in centimeters. @return the margin size. */ public double getRMargin() { return Double.parseDouble(tRightMargin.getText()); } /** Print in black and white @param l if true, print in black and white, if false respect the colors associated to the layers. */ public void setBW(boolean l) { bw_CB.setSelected(l); } /** Indicates that the printing should be done: the user selected the "ok" button @return a boolean value which indicates if the printing should be done */ public boolean shouldPrint() { return print; } }
25,035
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/mindimdialog/package-info.java
/** Package containing classes dealing with controlling the size of JDialog. */ package net.sourceforge.fidocadj.dialogs.mindimdialog;
134
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
MinimumSizeDialog.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/dialogs/mindimdialog/MinimumSizeDialog.java
package net.sourceforge.fidocadj.dialogs.mindimdialog; import javax.swing.*; import java.awt.event.*; /** Implements a dialog having a minimum size. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2015-2023 by Davide Bucci </pre> @author Davide Bucci */ public class MinimumSizeDialog extends JDialog implements ComponentListener { // The minimum size in pixels. private final int minWidth; private final int minHeight; /** Constructor. @param minW minimum width in pixels. @param minH minimum height in pixels. @param parent the parent frame. @param title the tile of the dialog. @param modal true if it is a modal dialog, false otherwise. */ public MinimumSizeDialog( int minW, int minH, JFrame parent, String title, boolean modal) { super(parent, title, modal); minWidth=minW; minHeight=minH; } /** Required for the implementation of the ComponentListener interface. In this case, prevents from resizing the dialog in a size which is too small. @param e the component event which happened. */ @Override public void componentResized(ComponentEvent e) { int width = getWidth(); int height = getHeight(); boolean resize = false; if (width < minWidth) { resize = true; width = minWidth; } if (height < minHeight) { resize = true; height = minHeight; } if (resize) { setSize(width, height); } } /** Required for the implementation of the ComponentListener interface. @param e the component event which happened. */ @Override public void componentMoved(ComponentEvent e) { // Nothing to do } /** Required for the implementation of the ComponentListener interface. @param e the component event which happened. */ @Override public void componentShown(ComponentEvent e) { // Nothing to do } /** Required for the implementation of the ComponentListener interface. @param e the component event which happened. */ @Override public void componentHidden(ComponentEvent e) { // Nothing to do } }
2,999
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/package-info.java
/** Package providing a model (database) as well as a representation of libraries. MacroDesc class (currently in the primitives package) will be moved here in the future. */ package net.sourceforge.fidocadj.librarymodel;
233
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
LibraryModel.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/LibraryModel.java
package net.sourceforge.fidocadj.librarymodel; import java.util.*; import java.io.FileNotFoundException; import java.io.IOException; import net.sourceforge.fidocadj.undo.UndoActorListener; import net.sourceforge.fidocadj.circuit.model.DrawingModel; import net.sourceforge.fidocadj.globals.LibUtils; import net.sourceforge.fidocadj.librarymodel.event.KeyChangeEvent; import net.sourceforge.fidocadj.librarymodel.event.LibraryListener; import net.sourceforge.fidocadj.librarymodel.event.RemoveEvent; import net.sourceforge.fidocadj.librarymodel.event.AddEvent; import net.sourceforge.fidocadj.librarymodel.event.RenameEvent; import net.sourceforge.fidocadj.primitives.MacroDesc; // TODO: comment public methods // NOTE: This model has no adding macro method. /** Model class for macro operation. This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014-2023 Kohta Ozaki - Davide Bucci */ public class LibraryModel { final private List<LibraryListener> libraryListeners; final private DrawingModel drawingModel; final private List<Library> libraries; // Bridge for existing system. private Map<String,MacroDesc> masterLibrary; private UndoActorListener undoActorListener; /** Costructor. @param drawingModel DrawingModel instance to fetch macros. */ public LibraryModel(DrawingModel drawingModel) { this.drawingModel = drawingModel; libraryListeners = new ArrayList<LibraryListener>(); libraries = new ArrayList<Library>(); updateLibraries(); } /** Adds LibraryListener. @param listener LibraryLisner. */ public void addLibraryListener(LibraryListener listener) { libraryListeners.add(listener); } /** Removes LibraryListener. @param listener LibraryListener. */ public void removeLibraryListener(LibraryListener listener) { libraryListeners.remove(listener); } /** Removes category from library. Notices LibraryListeners after removed. @param category Category to remove. @throws IllegalLibraryAccessException If access standard library. */ public void remove(Category category) throws IllegalLibraryAccessException { Library parentLibrary; if(category==null) { return; } parentLibrary = category.getParentLibrary(); if(parentLibrary.isStdLib()) { throw new IllegalLibraryAccessException( "A category in standard library can't be removed."); } parentLibrary.removeCategory(category); synchronizeMasterLibrary(); save(); saveLibraryState(); fireRemoved(parentLibrary,category); } /** Removes library and deletes file. Notices LibraryListeners after removed. @param library Library to remove. @throws IllegalLibraryAccessException If access standard library. */ public void remove(Library library) throws IllegalLibraryAccessException { // NOTE: We must consider this method contains deleting file. if(library==null) { return; } if(library.isStdLib()) { throw new IllegalLibraryAccessException( "A standard library can't be removed."); } libraries.remove(library); synchronizeMasterLibrary(); try{ LibUtils.deleteLib(library.getFilename()); } catch (FileNotFoundException e){ System.out.println("library not found:"+library.getFilename()); } catch (IOException e) { System.out.println("Exception: "+e); } saveLibraryState(); fireRemoved(null,library); } /** Removes macro from library. Notices LibraryListeners after removed. @param macro MacroDesc to remove. @throws IllegalLibraryAccessException If access standard library. */ public void remove(MacroDesc macro) throws IllegalLibraryAccessException { Category category; if(macro==null) { return; } category = (Category)getParentNode(macro); if(category==null) { throw new IllegalLibraryAccessException("It's a wondering macro."); } if(category.getParentLibrary().isStdLib()) { throw new IllegalLibraryAccessException( "A standard library can't be removed."); } category.removeMacro(macro); synchronizeMasterLibrary(); save(); saveLibraryState(); fireRemoved(category,macro); } /** Renames macro. Notices LibraryListeners after renamed. @param macro MacroDesc to rename. @param newName New macro name. @throws IllegalLibraryAccessException If access standard library. @throws IllegalNameException If new name is invalid. */ public void rename(MacroDesc macro,String newName) throws IllegalNameException, IllegalLibraryAccessException { if(macro==null) { return; } String oldName = macro.name; //validation if(newName==null || newName.length()==0) { throw new IllegalNameException("Name length must not be zero."); } if(isStdLib(macro)) { throw new IllegalLibraryAccessException( "A macro in standard library can't be renamed."); } // TODO:validation // macro.isValidName(newName); macro.name = newName; save(); saveLibraryState(); fireRenamed(getParentNode(macro),macro,oldName); } /** Renames category. Notices LibraryListeners after renamed. @param category Category to rename. @param newName New category name. @throws IllegalLibraryAccessException If access standard library. @throws IllegalNameException If new name is invalid. */ public void rename(Category category,String newName) throws IllegalNameException,IllegalLibraryAccessException { String oldName = category.getName(); //validation if(newName==null || newName.length()==0) { throw new IllegalNameException("Name length must not be zero."); } if(category.getParentLibrary().isStdLib()) { throw new IllegalLibraryAccessException( "A category in standard library can't be renamed."); } if(!Category.isValidName(newName)) { throw new IllegalNameException("invalid name"); } category.setName(newName); synchronizeMacros(category.getParentLibrary()); save(); saveLibraryState(); fireRenamed(getParentNode(category),category,oldName); } /** Renames library. Notices LibraryListeners after renamed. @param library Library to rename. @param newName New library name. @throws IllegalLibraryAccessException If access standard library. @throws IllegalNameException If new name is invalid. */ public void rename(Library library,String newName) throws IllegalNameException,IllegalLibraryAccessException { String oldName = library.getName(); //validation if(newName==null || newName.length()==0) { throw new IllegalNameException("Name length must not be zero."); } if(library.isStdLib()) { throw new IllegalLibraryAccessException( "A standard library can't be renamed."); } if(!Library.isValidName(newName)) { throw new IllegalNameException("invalid name"); } library.setName(newName); synchronizeMacros(library); synchronizeMasterLibrary(); save(); saveLibraryState(); fireRenamed(null,library,oldName); } /** Copies macro into category. Notices LibraryListeners after copied. @param macro target macro. @param destCategory destination category. */ public void copy(MacroDesc macro, Category destCategory) { //TODO: Standard library check. MacroDesc newMacro; System.out.println("copy:"+macro+destCategory); newMacro = copyMacro(macro,destCategory); synchronizeMacros(destCategory.getParentLibrary()); synchronizeMasterLibrary(); save(); saveLibraryState(); fireAdded(destCategory,newMacro); } /** Utility function. */ private MacroDesc copyMacro(MacroDesc macro, Category destCategory) { MacroDesc newMacro; String newPlainKey; int retry; if(macro==null || destCategory==null) { return null; } newMacro = cloneMacro(macro); newPlainKey = createRandomMacroKey(); for(retry=20; 0<retry; retry--) { if(!destCategory.getParentLibrary().containsMacroKey(newPlainKey)) { break; } } if(retry<0) { throw new RuntimeException("Key generation failed."); } newMacro.key = createMacroKey(destCategory.getParentLibrary(). getFilename(),newPlainKey); destCategory.addMacro(newMacro); return newMacro; } /** Copies category into library. Notices LibraryListeners after copied. @param category target category. @param destLibrary destination library. */ public void copy(Category category, Library destLibrary) { //TODO: Standard library check. Category newCategory; if(category==null || destLibrary==null) { return; } newCategory = new Category(category.getName(), category.getParentLibrary(), false); for(MacroDesc macro:category.getAllMacros()) { copyMacro(macro,newCategory); } destLibrary.addCategory(newCategory); synchronizeMacros(destLibrary); synchronizeMasterLibrary(); save(); saveLibraryState(); fireAdded(destLibrary, newCategory); } /** Changes macro key. Notices LibraryListeners after changed. @param macro MacroDesc to change key. @param newKey New macro key without library prefix. @throws IllegalLibraryAccessException If access standard library. @throws IllegalKeyException If new key is invalid. */ public void changeKey(MacroDesc macro,String newKey) throws IllegalKeyException,IllegalLibraryAccessException { String oldKey; Category category; if(macro==null || newKey.length()==0) { throw new IllegalKeyException("Name length must not be zero."); } if(isStdLib(macro)) { throw new IllegalLibraryAccessException( "A macro in standard library can't be renamed."); } // key validation // key exists check category = (Category)getParentNode(macro); if(category.getParentLibrary().containsMacroKey(newKey)) { throw new IllegalKeyException("New key already exists."); } oldKey = getPlainMacroKey(macro); macro.key = createMacroKey(macro.filename,newKey); save(); saveLibraryState(); fireKeyChanged(getParentNode(macro),macro,oldKey); } /** Utility function. */ private MacroDesc cloneMacro(MacroDesc macro) { return new MacroDesc(macro.key, macro.name, macro.description, macro.category, macro.library, macro.filename); } /** Returns macro key without library prefix. @param macro macro. @return String plain key. */ public static String getPlainMacroKey(MacroDesc macro) { String[] parted; if(macro==null) { return null; } parted = macro.key.split("\\."); if(1<parted.length) { return parted[1]; } else { return parted[0]; } } /** Returns new macro key. @return String plain key. */ public static String createRandomMacroKey() { long t=System.nanoTime(); long h=0; for(int i=0; t>0; ++i) { t>>=i*8; h^=t & 0xFF; } return String.valueOf(h); } /** Returns identifiable macro key. @param fileName filename of library. @param key plain key. @return String key. */ public static String createMacroKey(String fileName,String key) { String macroKey = fileName+"."+key; return macroKey.toLowerCase(new Locale("en")); } /** Synchronizes MacroDesc's properties with library. */ private void synchronizeMacros(Library library) { String plainKey; if(library.isStdLib()) { return; } for(Category category:library.getAllCategories()) { for(MacroDesc m:category.getAllMacros()) { m.category = category.getName(); m.library = library.getName(); m.filename = library.getFilename(); plainKey = getPlainMacroKey(m); m.key = createMacroKey(library.getFilename(),plainKey); } } } /** Sets UndoActorListener. @param undoActorListener UndoActorListener. */ public void setUndoActorListener(UndoActorListener undoActorListener) { this.undoActorListener = undoActorListener; } /** Returns true if macro is in standard library. This method will be removed in the future. @param macro MacroDesc */ private boolean isStdLib(MacroDesc macro) { // An alternative way to see if a macro is standard or not // is to extract the prefix from the key and to see if the // prefix is "" or the one of the standard libraries. for(Library l:getAllLibraries()) { if(l.isStdLib()) { for(Category c:l.getAllCategories()) { for(MacroDesc m:c.getAllMacros()) { if(macro.equals(m)) { return true; } } } } } return false; } private void fireAdded(Object parentNode,Object addedNode) { for(LibraryListener l:libraryListeners) { l.libraryNodeAdded(new AddEvent(parentNode,addedNode)); } } private void fireRenamed(Object parentNode,Object renamedNode, String oldName) { for(LibraryListener l:libraryListeners) { l.libraryNodeRenamed(new RenameEvent(parentNode,renamedNode, oldName)); } } private void fireRemoved(Object parentNode,Object removedNode) { for(LibraryListener l:libraryListeners) { l.libraryNodeRemoved(new RemoveEvent(parentNode,removedNode)); } } private void fireKeyChanged(Object parentNode,Object changedNode, String oldKey) { for(LibraryListener l:libraryListeners) { l.libraryNodeKeyChanged(new KeyChangeEvent(parentNode,changedNode, oldKey)); } } // NOTE: This implementation is incorrect. (DB why? equals may fail?) private Object getParentNode(Object node) { for(Library l:getAllLibraries()) { if(node.equals(l)) { return null; // A library does not have any parent! } for(Category c:l.getAllCategories()) { if(node.equals(c)) { return l; } for(MacroDesc m:c.getAllMacros()) { if(node.equals(m)) { return c; } } } } return null; // Node not found } /** Returns MacroDesc map. @return Map composed of String key and MacroDesc from parser. */ public Map<String,MacroDesc> getAllMacros() { return masterLibrary; } /** Returns Libraries as list. @return List of Library objects. */ public List<Library> getAllLibraries() { return libraries; } /** Saves library to file. */ public void save() { //TODO: throw necessary exceptions. for(Library library:libraries){ try{ if(!library.isStdLib()){ LibUtils.save(masterLibrary, LibUtils.getLibPath(library.getFilename()), library.getName().trim(), library.getFilename()); } } catch (FileNotFoundException e) { System.out.println("Error accessing to the file."); } } } /** Saves library state for undo. */ public void saveLibraryState() { try { LibUtils.saveLibraryState(undoActorListener); } catch (IOException e) { System.out.println("Exception: "+e); } } /** Not implemented. */ public void undoLibrary() { // TODO: this should undo the last library operation. } /** Updates library. */ public void forceUpdate() { updateLibraries(); fireChanged(); } private void fireChanged() { for(LibraryListener l:libraryListeners) { l.libraryLoaded(); } } /** Bridges existing components. This method will be removed in the future. */ private void synchronizeMasterLibrary() { masterLibrary.clear(); for(Library library:libraries) { for(Category category:library.getAllCategories()) { for(MacroDesc macro:category.getAllMacros()) { masterLibrary.put(macro.key,macro); } } } } private void updateLibraries() { Library library; Category category; boolean catIsHidden; String key; Map<String,Library> tmpLibraryMap = new HashMap<String,Library>(); masterLibrary = drawingModel.getLibrary(); libraries.clear(); for(MacroDesc md:masterLibrary.values()) { cleanMacro(md); key = md.filename + "/" + md.library; if(tmpLibraryMap.containsKey(key)) { library = tmpLibraryMap.get(key); } else { library = new Library(md.library,md.filename,LibUtils.isStdLib(md)); tmpLibraryMap.put(key,library); libraries.add(library); } if(library.getCategory(md.category)==null) { catIsHidden = "hidden".equals(md.category); category = new Category(md.category,library,catIsHidden); library.addCategory(category); } else { category = library.getCategory(md.category); } category.addMacro(md); } fireChanged(); } private void cleanMacro(MacroDesc macro) { macro.name = macro.name.trim(); } /** Exception for library operation error. */ public class LibraryException extends Exception { LibraryException(String message) { super(message); } } /** Exception for an illegal name (when searching, etc...) */ public class IllegalNameException extends LibraryException { IllegalNameException(String message) { super(message); } } /** Exception for an illegal library access (i.e. non existant, most of the times). */ public class IllegalLibraryAccessException extends LibraryException { IllegalLibraryAccessException(String message) { super(message); } } /** Exception for an illegal key in a library. */ public class IllegalKeyException extends LibraryException { IllegalKeyException(String message) { super(message); } } }
21,379
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
Library.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/Library.java
package net.sourceforge.fidocadj.librarymodel; import java.util.*; /** The Library class provides a set of methods to manipulate libraries. This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014-2023 Kohta Ozaki */ public class Library { private String libraryName; private final String filename; private final boolean isStd; private final List<Category> categories; /** Standard constructor. @param libraryName the name of the library. @param filename the name of the file where the library is contained. @param isStd true if the library should be considered as standard. */ Library(String libraryName, String filename,boolean isStd) { this.libraryName = libraryName; this.filename = filename; this.isStd = isStd; categories = new ArrayList<Category>(); } /** Get the name of the library. @return the library name. */ public String getName() { return libraryName; } /** Set the name of the library. @param name the name to be employed. */ public void setName(String name) { this.libraryName = name; } /** Get the name of the file of the library. @return the filename. */ public String getFilename() { return filename; } /** Gets all the categories contained in the library. @return a list containing all categories. */ public List<Category> getAllCategories() { return categories; } /** Get a category in the library. @param name the name of the category to be retrieved. @return the category with the required name or null if nothing has been found. */ public Category getCategory(String name) { Category result=null; for(Category c:categories) { if(c.getName().equals(name)) { result=c; break; } } return result; } /** Add the given category to the library. @param category the category to be added. */ public void addCategory(Category category) { categories.add(category); } /** Remove a category from the library. @param category the category to be removed. */ public void removeCategory(Category category) { categories.remove(category); } /** Check if the library is standard. @return true if the library is standard. */ public boolean isStdLib() { return isStd; } /** Check if the library is hidden. TODO: this method always returns false. @return true if the library is hidden. */ public boolean isHidden() { return false; } /** Check if the name of the library is valid. TODO: this method always returns true. @param name the name to be checked. @return true if the name is valid. */ public static boolean isValidName(String name) { return true; } /** Check if the library contains the macro specified with the key. @param key the key to be searched for. @return true if the key is found, false otherwise. */ public boolean containsMacroKey(String key) { if(key==null) { return true; } for(Category category:categories) { if(category.containsMacroKey(key)) { return true; } } return false; } /** Provide a string description of the library. @return the string description (simply the name) of the library. */ @Override public String toString() { return getName(); } }
4,410
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
Category.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/Category.java
package net.sourceforge.fidocadj.librarymodel; import java.util.*; import net.sourceforge.fidocadj.primitives.MacroDesc; /** The Category class provides a set of methods to manipulate categories in a library. This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014 Kohta Ozaki */ public class Category { String name; Library parentLibrary; List<MacroDesc> macros; boolean isHidden; /** Standard constructor. @param name the name of the category. @param parentLibrary the parent library to which the category belongs. @param idHidden true if the category should not be shown. */ Category(String name,Library parentLibrary,boolean isHidden) { macros = new ArrayList<MacroDesc>(); this.name = name; this.parentLibrary = parentLibrary; this.isHidden = isHidden; } /** Get the parent library. @return the parent library. */ public Library getParentLibrary() { return parentLibrary; } /** Set the parent library. @param parentLibrary the parent library to be employed. */ public void setParentLibrary(Library parentLibrary) { this.parentLibrary = parentLibrary; } /** Get the name of the category. @return the name. */ public String getName() { return name; } /** Set the name of the category. @param name the name. */ public void setName(String name) { this.name = name; } /** Add a macro to this category. @param macroDesc the macro to be added. */ public void addMacro(MacroDesc macroDesc) { macros.add(macroDesc); } /** Remove a macro from this category. @param macroDesc the macro to be removed. */ public void removeMacro(MacroDesc macroDesc) { macros.remove(macroDesc); } /** Get a list of all macros comprised in the category. @return the list of macros. */ public List<MacroDesc> getAllMacros() { return macros; } /** Check if the category is hidden. @return true if the category is hidden, false if it is visible. */ public boolean isHidden() { return isHidden; } /** Check if the category name is valid. TODO: this method doesn't do much: it always returns true. @param name the name of the category to be checked. @return true if the name is valid. */ public static boolean isValidName(String name) { return true; } /** Check if a macro having a given key is already contained in the category. @param key the key of the macro to search for. @return true if the macro is already present. */ public boolean containsMacroKey(String key) { if(key==null) { return true; } for(MacroDesc macro:macros) { if(LibraryModel.getPlainMacroKey(macro).equals(key)) { return true; } } return false; } }
3,752
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/utils/package-info.java
/** Various general purpose classes for libraries. */ package net.sourceforge.fidocadj.librarymodel.utils;
112
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
LibraryUndoExecutor.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/utils/LibraryUndoExecutor.java
package net.sourceforge.fidocadj.librarymodel.utils; import java.io.*; import net.sourceforge.fidocadj.undo.LibraryUndoListener; import net.sourceforge.fidocadj.globals.FileUtils; import net.sourceforge.fidocadj.globals.LibUtils; import net.sourceforge.fidocadj.librarymodel.LibraryModel; import net.sourceforge.fidocadj.FidoFrame; /** Execute undo actions on libraries. This class does not handle the temporary files and dir operations required by the undo operation on libraries. It just performs the low level file copy operations required. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014 Kohta Ozaki </pre> */ public class LibraryUndoExecutor implements LibraryUndoListener { FidoFrame fidoFrame; LibraryModel libraryModel; /** Constructor. @param frame the main UI window to which this class will be associated. @param model the drawing model. */ public LibraryUndoExecutor(FidoFrame frame, LibraryModel model) { fidoFrame = frame; libraryModel = model; } /** Execute an undo operation on a library. @param s the path to the temporary library directory where the libraries are stored immediately before the operation which should be undone has been performed. */ public void undoLibrary(String s) { try { File sourceDir = new File(s); String d=LibUtils.getLibDir(); File destinationDir = new File(d); FileUtils.copyDirectory(sourceDir, destinationDir); fidoFrame.loadLibraries(); libraryModel.forceUpdate(); } catch (IOException e) { System.out.println("Cannot restore library directory contents."); } } }
2,455
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
CircuitPanelUpdater.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/utils/CircuitPanelUpdater.java
package net.sourceforge.fidocadj.librarymodel.utils; import net.sourceforge.fidocadj.circuit.CircuitPanel; import net.sourceforge.fidocadj.circuit.controllers.ParserActions; import net.sourceforge.fidocadj.circuit.model.DrawingModel; import net.sourceforge.fidocadj.librarymodel.event.LibraryListener; import net.sourceforge.fidocadj.librarymodel.event.AddEvent; import net.sourceforge.fidocadj.librarymodel.event.KeyChangeEvent; import net.sourceforge.fidocadj.librarymodel.event.RemoveEvent; import net.sourceforge.fidocadj.librarymodel.event.RenameEvent; import net.sourceforge.fidocadj.FidoFrame; /** Class implementing a library listener, with some callback methods. SWING version <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014 Kohta Ozaki </pre> */ public class CircuitPanelUpdater implements LibraryListener { FidoFrame fidoFrame; /** Constructor. @param fidoFrame the frame containing the user interface. */ public CircuitPanelUpdater(FidoFrame fidoFrame) { this.fidoFrame = fidoFrame; } /** Called when a library has been loaded. */ public void libraryLoaded() { updateCircuitPanel(); } /** Called when a library has been renamed. @param e the renaming event. */ public void libraryNodeRenamed(RenameEvent e) { //NOP } /** Called when a node has been removed from a library. @param e the remove event. */ public void libraryNodeRemoved(RemoveEvent e) { updateCircuitPanel(); } /** Called when a node has been added. @param e the adding event. */ public void libraryNodeAdded(AddEvent e) { //NOP } /** Called when the key for a node (macro) has been changed. @param e the node key changing event. */ public void libraryNodeKeyChanged(KeyChangeEvent e) { updateCircuitPanel(); } /** Parse again the circuit and redraw everything. */ private void updateCircuitPanel() { CircuitPanel cp = fidoFrame.cc; DrawingModel ps = cp.dmp; ParserActions pa = new ParserActions(ps); cp.getParserActions().parseString(pa.getText(true)); cp.repaint(); } }
2,941
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/event/package-info.java
/** Package for handling events on the libraries. TODO: improve documentation of this package: what is the general philosophy? How are the classes interacting together? What is the relation between a "node" and an element in a directory? */ package net.sourceforge.fidocadj.librarymodel.event;
310
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
AddEvent.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/event/AddEvent.java
package net.sourceforge.fidocadj.librarymodel.event; /** Event handling in library editing: add a node to a library. This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014 Kohta Ozaki */ public class AddEvent { final private Object addedNode; final private Object parentNode; /** Standard constructor. @param parentNode node which will become the parent node. @param addedNode node to be added. */ public AddEvent(Object parentNode, Object addedNode) { this.parentNode = parentNode; this.addedNode = addedNode; } /** Return the value of addedNode. @return the addedNode. */ public Object getAddedNode() { return addedNode; } /** Return the value of parentNode. @return the parentNode. */ public Object getParentNode() { return parentNode; } }
1,554
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
RemoveEvent.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/event/RemoveEvent.java
package net.sourceforge.fidocadj.librarymodel.event; /** Remove event data on a library. This file is part of FidoCadJ. <pre> FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014 Kohta Ozaki </pre> */ public class RemoveEvent { final private Object removedNode; final private Object parentNode; /** Standard constructor. @param parentNode the node which is the parent to the removed node. @param removedNode the removed node. */ public RemoveEvent(Object parentNode,Object removedNode) { this.parentNode = parentNode; this.removedNode = removedNode; } /** Returns the value of removedNode. @return the value of removedNode. */ public Object getRemovedNode() { return removedNode; } /** Returns the value of parentNode. @return the value of parentNode. */ public Object getParentNode() { return parentNode; } }
1,611
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
RenameEvent.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/event/RenameEvent.java
package net.sourceforge.fidocadj.librarymodel.event; /** Rename event containing data. This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014 Kohta Ozaki */ public class RenameEvent { final private Object renamedNode; final private Object parentNode; final private String oldName; /** Standard constructor. @param parentNode the parent node to the renamed one. @param renamedNode the renamed node. @param oldName the old name of the renamed node. */ public RenameEvent(Object parentNode,Object renamedNode,String oldName) { this.parentNode = parentNode; this.renamedNode = renamedNode; this.oldName = oldName; } /** Returns the value of renamedNode. @return the value of renamedNode. */ public Object getRenamedNode() { return renamedNode; } /** Returns the value of parentNode. @return the value of parentNode. */ public Object getParentNode() { return parentNode; } /** Returns the value of oldName. @return the old name of the node. */ public String getOldName() { return oldName; } }
1,857
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
LibraryListener.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/event/LibraryListener.java
package net.sourceforge.fidocadj.librarymodel.event; /** Interface for a listener of events on library. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014-2023 Kohta Ozaki, Davide Bucci </pre> */ public interface LibraryListener { /** Called when a library has been loaded. */ void libraryLoaded(); /** Called when a node has been renamed. @param e information about the rename event. */ void libraryNodeRenamed(RenameEvent e); /** Called when a node has been removed. @param e information about the remove event. */ void libraryNodeRemoved(RemoveEvent e); /** Called when a node has been added. @param e information about the added event. */ void libraryNodeAdded(AddEvent e); /** Called when a key has been changed in a node @param e information about the key change event. */ void libraryNodeKeyChanged(KeyChangeEvent e); }
1,627
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
KeyChangeEvent.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/event/KeyChangeEvent.java
package net.sourceforge.fidocadj.librarymodel.event; /** Key changed during library operations. I.e. the action of changing the key of a macro. This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014 Kohta Ozaki */ public class KeyChangeEvent { final private Object keyChangedNode; final private Object parentNode; final private String oldKey; /** Standard constructor. @param parentNode node which will become the parent node. @param keyChangedNode node on which the key should be changed. @param oldKey the old key which was associated to the macro. */ public KeyChangeEvent(Object parentNode,Object keyChangedNode,String oldKey) { this.parentNode = parentNode; this.keyChangedNode = keyChangedNode; this.oldKey = oldKey; } /** Returns the value of keyChangedNode. @return the value of keyChangedNode. */ public Object getKeyChangedNode() { return keyChangedNode; } /** Returns the value of parentNode. @return the value of parentNode. */ public Object getParentNode() { return parentNode; } /** Returns the old key. @return the old key. */ public String getOldKey() { return oldKey; } }
1,961
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
LibraryListenerAdapter.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/librarymodel/event/LibraryListenerAdapter.java
package net.sourceforge.fidocadj.librarymodel.event; /** Adapter class of LibraryListener interface. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2014 Kohta Ozaki </pre> */ public class LibraryListenerAdapter implements LibraryListener { /** Called when a library has been loaded. */ public void libraryLoaded() { // Nothing to do. } /** Called when a node has been renamed. @param e information about the rename event. */ public void libraryNodeRenamed(RenameEvent e) { // Nothing to do. } /** Called when a node has been removed. @param e information about the remove event. */ public void libraryNodeRemoved(RemoveEvent e) { // Nothing to do. } /** Called when a node has been added. @param e information about the added event. */ public void libraryNodeAdded(AddEvent e) { // Nothing to do. } /** Called when a key has been changed in a node @param e information about the key change event. */ public void libraryNodeKeyChanged(KeyChangeEvent e) { // Nothing to do. } }
1,858
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
UndoState.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/undo/UndoState.java
package net.sourceforge.fidocadj.undo; /** Track the undo/redo state. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2008-2023 by Davide Bucci </pre> @author Davide Bucci */ public class UndoState { // Contains a textual description of the drawing public String text; // Is true if there has been a modification of the drawing: something // that needs the file to be saved, unless the user wants to discard // changes. public boolean isModified; // The file name of the drawing. public String fileName; // True if an editing operation on the libraries has // been performed. public boolean libraryOperation; // The tempory directory where the libraries are be stored. public String libraryDir; /** Standard constructor. */ public UndoState() { text=""; isModified=false; fileName=""; libraryDir=""; } /** Convert to string the undo operation represented by this object. This method is useful mainly for debug purposes. @return a String completely describing the object. */ @Override public String toString() { return "text="+text+"\nfileName="+fileName+ "\nOperation on a library: "+libraryOperation+ "\nlibraryDir="+libraryDir; } }
2,015
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
package-info.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/undo/package-info.java
/** Everything which is needed to implement a undo buffer. */ package net.sourceforge.fidocadj.undo;
101
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
LibraryUndoListener.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/undo/LibraryUndoListener.java
package net.sourceforge.fidocadj.undo; /** Interface used to callback notify that an undo action on libraries should be performed. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2008-2023 by Davide Bucci </pre> @author Davide Bucci */ public interface LibraryUndoListener { /** Undo the last library action. TODO: complete that. @param s the ? */ void undoLibrary(String s); }
1,119
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
UndoManager.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/undo/UndoManager.java
package net.sourceforge.fidocadj.undo; import java.util.*; /** Implementation of a circular buffer of the given size. This is tailored in particular for the undo/redo system. The choice of the circular buffer is reasonable since one expects that in the classical undo systems the very old states are overwritten when the maximum number of undo steps is reached. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2008-2023 by Davide Bucci </pre> @author Davide Bucci */ public class UndoManager { private final List<UndoState> undoBuffer; private int pointer; private int sizeMax; private boolean isRedoable; /** Creates a new undo buffer of the given size. @param s the size of the circular buffer. */ public UndoManager (int s) { sizeMax=s; undoBuffer = new Vector<UndoState>(sizeMax); undoReset(); } /** For debug purposes, print the contents of the undo buffer. */ public void printUndoState() { System.out.println("==============================================="); for (int i=0; i<undoBuffer.size();++i) { if(i==pointer-2) { System.out.println("*****************"); } System.out.println("undoBuffer["+i+"]="+undoBuffer.get(i)); if(i==pointer-2) { System.out.println("*****************"); } } System.out.println("Is the next operation on a library? "+ (isNextOperationOnALibrary()?"Yes":"No")); } /** Removes all the elements from the circular buffer. */ public final void undoReset() { undoBuffer.clear(); pointer=0; isRedoable=false; } /** Pushes a new undo state in the buffer. @param state the state to be committed. */ public void undoPush(UndoState state) { if(undoBuffer.size()==sizeMax) { undoBuffer.remove(0); --pointer; } undoBuffer.add(pointer++, state); isRedoable=false; // If the buffer contains other elements after the pointer, erase // them. This happens when several undo operation is followed by an // edit: you can not redo or merge the old undo "timeline" with the // new one. for(int i=pointer; i<undoBuffer.size();++i) { undoBuffer.remove(pointer); } } /** Checks if the next operation is done on a library instead than on a drawing. @return true if the next operation is on a library. */ public boolean isNextOperationOnALibrary() { if(pointer>=undoBuffer.size() || pointer<1) { return false; } try { if(undoBuffer.get(pointer).libraryOperation) { return true; } } catch (NoSuchElementException e) { return false; } return false; } /** Pops the last undo state from the buffer @return the recovered state. @throws NoSuchElementException if the buffer is empty. */ public UndoState undoPop() throws NoSuchElementException { --pointer; if(pointer<1) { pointer=1; } UndoState o=undoBuffer.get(pointer-1); isRedoable=true; return o; } /** Redo the last undo state from the buffer @return the recovered state. @throws NoSuchElementException if the buffer is empty. */ public UndoState undoRedo() throws NoSuchElementException { if (!isRedoable) { NoSuchElementException e=new NoSuchElementException(); throw e; } ++pointer; if(pointer>undoBuffer.size()) { pointer=undoBuffer.size(); } return undoBuffer.get(pointer-1); } }
4,578
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
UndoActorListener.java
/FileExtraction/Java_unseen/DarwinNE_FidoCadJ/src/net/sourceforge/fidocadj/undo/UndoActorListener.java
package net.sourceforge.fidocadj.undo; /** Interface used to callback notify that an undo action on libraries should be performed. <pre> This file is part of FidoCadJ. FidoCadJ is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FidoCadJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FidoCadJ. If not, @see <a href=http://www.gnu.org/licenses/>http://www.gnu.org/licenses/</a>. Copyright 2008-2023 by Davide Bucci </pre> @author Davide Bucci */ public interface UndoActorListener { /** Save the current undo state. */ void saveUndoState(); /** Save the library state. @param tempLibraryDirectory the temporary directory. */ void saveUndoLibrary(String tempLibraryDirectory); }
1,211
Java
.java
DarwinNE/FidoCadJ
107
39
47
2015-07-26T02:26:30Z
2023-12-01T11:46:47Z
C64_1.java
/FileExtraction/Java_unseen/ice00_jc64/src/debug/C64_1.java
/** * @(#)C64.java 1999/09/19 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.hardware.machine; //package debug; import sw_emulator.hardware.powered; import sw_emulator.hardware.signaller; import sw_emulator.hardware.bus.C64Bus; import sw_emulator.hardware.memory.dinamic; import sw_emulator.hardware.memory.DRAM; import sw_emulator.hardware.memory.ColorRAM; import sw_emulator.hardware.memory.ROM; import sw_emulator.hardware.Clock; import sw_emulator.hardware.cartridge.Cartridge; import sw_emulator.hardware.cartridge.GameCartridge; import sw_emulator.hardware.cpu.M6510; import sw_emulator.hardware.chip.PLA82S100; import sw_emulator.hardware.chip.M6569; import sw_emulator.hardware.chip.M6526; import sw_emulator.hardware.chip.Sid; import sw_emulator.hardware.io.C64M6510IO; import sw_emulator.hardware.io.C64VicII_IO; import sw_emulator.hardware.io.C64Cia1IO; import sw_emulator.hardware.io.C64Cia2IO; import sw_emulator.hardware.io.C64CartridgeIO; import sw_emulator.hardware.device.C64Keyboard; import sw_emulator.hardware.device.TV; import sw_emulator.hardware.device.C64Form; import sw_emulator.util.AndPort; import sw_emulator.software.cartridge.FileCartridge; /** * Debug the game cartridge */ /** * Emulate the Commodore 64 computer. * * @author Ice * @version 1.00 19/09/1999 */ public class C64_1 implements powered{ /** * Path where the roms images are stored */ public static final String ROM_PATH="./rom/"; /** * 8Kb of Ram memory address 0x0000 0x1FFF */ protected DRAM ram0=new DRAM(8*1024, 0x0000); /** * 8Kb of Ram memory address 0x2000 0x3FFF */ protected DRAM ram1=new DRAM(8*1024, 0x2000); /** * 8Kb of Ram memory address 0x4000 0x5FFF */ protected DRAM ram2=new DRAM(8*1024, 0x4000); /** * 8Kb of Ram memory address 0x6000 0x7FFF */ protected DRAM ram3=new DRAM(8*1024, 0x6000); /** * 8Kb of Ram memory address 0x8000 0x9FFF */ protected DRAM ram4=new DRAM(8*1024, 0x8000); /** * 8Kb of Ram memory address 0xA000 0xBFFF */ protected DRAM ram5=new DRAM(8*1024, 0xA000); /** * 8Kb of Ram memory address 0xC000 0xDFFF */ protected DRAM ram6=new DRAM(8*1024, 0xC000); /** * 8Kb of Ram memory address 0xE000 0xFFFF */ protected DRAM ram7=new DRAM(8*1024, 0xE000); /** * Dinamic memories that need refresh */ protected dinamic[] dinamicMemories={ ram0, ram1, ram2, ram3, ram4, ram5, ram6, ram7 }; /** * The 8Kbyte of Basic ROM memory */ public ROM basic=new ROM(8*1024, 0xA000); /** * The 8Kbyte of Kernal ROM memory */ public ROM kernal=new ROM(8*1024, 0xE000); /** * The 4Kbyte of Char generator ROM memory */ public ROM chargen=new ROM(4*1024, 0xD000); /** * The bus of the C64 */ public C64Bus bus=new C64Bus(); /** * The 1Kb of color ram */ public ColorRAM color=new ColorRAM(1024, 0xD800, bus); /** * The 8Mhz clock signal */ public Clock clock=new Clock(Clock.PAL); /** * The TV attached to the C64 Vic II output */ public TV tv=new TV(); /** * The application menu bar */ public C64Form c64Form=new C64Form(); /** * The M6569 Vic II */ public M6569 vic=new M6569(clock.monitor, bus, C64Bus.V_VIC, null, dinamicMemories, tv); /** * The Mos 6510 cpu */ public M6510 cpu=new M6510(vic.intMonitor, bus, C64Bus.V_CPU, null); /** * The Mos SID chip */ public Sid sid=new Sid(); // to modify /** * The cartridge port */ public Cartridge exp=new Cartridge(null, vic.intMonitor, bus); /** * A game Cartridge */ public GameCartridge gameExp; /** * The Cia 1 chip */ public M6526 cia1=new M6526(M6526.PAL, vic.intMonitor, null); /** * The Cia2 chip */ public M6526 cia2=new M6526(M6526.PAL, vic.intMonitor, null); /** * The PLA82S100 chip of C64 */ public PLA82S100 pla=new PLA82S100(bus, exp, ram0, ram1, ram2, ram3, ram4, ram5, ram6, ram7, basic, kernal, chargen, vic, sid, color, cia1, cia2); /** * The C64 keyboard */ public C64Keyboard keyb=new C64Keyboard(null); /** * The IO signals of C64 cpu */ public C64M6510IO cpuIO=new C64M6510IO(pla); /** * The 74LS08 And port with output pin 6. * This give AEC signal to Cpu. */ protected AndPort and6=new AndPort(cpu, signaller.S_AEC, signaller.S_DMA, signaller.S_AEC); /** * The 74LS08 And port with output pin 3. * This give RDY signal to Cpu. */ protected AndPort and3=new AndPort(cpu, signaller.S_BA, signaller.S_DMA, signaller.S_RDY); /** * The Vic IO signals connections */ public C64VicII_IO vicIO=new C64VicII_IO(cpu, exp, and6, and3); /** * The Cia 1 IO signals connections */ public C64Cia1IO cia1IO=new C64Cia1IO(cpu, exp, keyb.monitor, keyb.colLines); /** * The Cia 2 IO signals connections */ public C64Cia2IO cia2IO=new C64Cia2IO(cpu, exp, pla); /** * The expansion IO signals connections */ public C64CartridgeIO expIO=new C64CartridgeIO(cpu, pla, and6, and3); /** * Manage file cartridge */ public FileCartridge fileCart=new FileCartridge(expIO, vic.intMonitor, bus); public C64_1() { initMemory(); c64Form.addTV(tv); c64Form.setVisible(true); // read cartridge: fileCart.setFileName("/mnt/new/home/ice/dig_dug.crt"); System.out.println(fileCart.readFile()); System.out.println(fileCart.determineCart()); gameExp=(GameCartridge)fileCart.getCartridge(0); gameExp.setIO(expIO); pla.setExpansion(gameExp); cpu.setIO(cpuIO); // set cpu IO signals vic.setIO(vicIO); // set vic IO signals keyb.setIO(cia1IO); // set keyb IO signals exp.setIO(expIO); // set exp IO signals cia1.setIO(cia1IO); // set cia 1 IO signals cia2.setIO(cia2IO); // set cia 2 IO signals bus.setColor(color); // set up color ram for Vic in bus kernal.change(0xfd84, (byte)0xa0); // don't fill the memory kernal.change(0xfd85, (byte)00); System.out.println("Power ON the machine"); powerOn(); clock.setRealTime(1); ///debug: use slow clock System.out.println("Start the clock..."); clock.startClock(); System.out.println("exit main"); } public static void main(String[] args) { C64_1 c64 = new C64_1(); } /** * Initialize the C64 Memories chip (RAM and ROMs). * If there's error, the program halt with error message. */ public void initMemory() { System.out.println("Reading machine ROMs"); if (!(basic.load(ROM_PATH+"basic.rom") && kernal.load(ROM_PATH+"kernal.rom") && chargen.load(ROM_PATH+"char.rom"))) { System.err.println("Error reading the ROM images."); System.exit(1); } } /** * Power on the electronic component in the machine */ public void powerOn() { gameExp.powerOn(); exp.powerOn(); pla.powerOn(); System.out.println(" Pla: power is on"); cpu.powerOn(); System.out.println(" Cpu: power is on"); vic.powerOn(); System.out.println(" VIC: power is on"); } /** * Power off the electronic component in the machine */ public void powerOff() { pla.powerOff(); System.out.println("Pla: power is off"); cpu.powerOff(); System.out.println(" Cpu: power is off"); vic.powerOff(); System.out.println(" VIC: power is off"); } }
8,581
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
UtTest4.java
/FileExtraction/Java_unseen/ice00_jc64/src/debug/UtTest4.java
package debug; import sw_emulator.hardware.cpu.*; import sw_emulator.hardware.bus.*; import sw_emulator.hardware.memory.*; import sw_emulator.util.*; import sw_emulator.software.machine.*; public class UtTest4 {//extends M6510 { public C64Dasm dasm; public ROM kernal; public ROM basic; /** public UtTest4(Monitor monitor, Bus bus, ROM kernal, ROM basic) { dasm=new C64Dasm(); this.monitor=monitor; this.bus=bus; this.kernal=kernal; this.basic=basic; start(); }*/ /** public void decode() { if (regPC<0xE000) if (regPC>0xA000) ;///System.out.print(dasm.cdasm(basic.memory, regPC-1-0xA000, regPC-0xA000, regPC-1)); else System.out.println(regPC); else ;///System.out.print(dasm.cdasm(kernal.memory, regPC-1-0xE000, regPC-0xE000, regPC-1)); super.decode(); }*/ }
875
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
T.java
/FileExtraction/Java_unseen/ice00_jc64/src/debug/T.java
// test the disassembler of C64 package sw_emulator; import sw_emulator.software.machine.*; import java.io.*; public class T { public C64Dasm dis=new C64Dasm(); public FileInputStream fi; public FileOutputStream fo; public byte[] buffer=new byte[123456]; public String result; public File fin; public File fon; public T() { int b; int i; try { try { fin=new File("/home/ice/a3"); fon=new File("/home/ice/a3.lst"); System.out.println(fin.exists()); System.out.println(fin.getName()); System.out.println(fin.getPath()); fi=new FileInputStream(fin); fo=new FileOutputStream(fon); b=0; i=0x340; while (b!=-1) { if (i<0x3b4) i++; else {b=fi.read(); buffer[i]=(byte)b; i++; } } System.out.println("In Buffer readed"); { fi.read(buffer, 4, 0xc8);} result=null;///dis.cdasm(buffer, 0x340, 0x400, 0x340); System.out.println("Out Buffe created"); System.out.println(result); for ( i=0; i<result.length(); i++) fo.write((int)result.charAt(i)); } catch (FileNotFoundException e) {} } catch (IOException e1) {} } public static void main(String[] args) { T test2 = new T(); test2.invokedStandalone = true; } private boolean invokedStandalone = false; }
1,308
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
Test4.java
/FileExtraction/Java_unseen/ice00_jc64/src/debug/Test4.java
// test M6510 emulation in a simple C64 memory map package sw_emulator; import sw_emulator.hardware.cpu.*; import sw_emulator.hardware.memory.*; import sw_emulator.hardware.bus.*; import sw_emulator.hardware.*; public class Test4 { /** * Path where the roms images are stored */ public static final String ROM_PATH="e:\\programmi\\jbuilder2\\myprojects\\sw_emulator\\"; public C64Bus bus=null;//new C64Bus(null, null, null); /** * The 64Kbyte of ram memory */ public Memory ram=new Memory(64*1024, 0); /** * The 8Kbyte of Basic ROM memory */ public ROM basic=new ROM(8*1024, 0xA000); /** * The 8Kbyte of Kernal ROM memory */ public ROM kernal=new ROM(8*1024, 0xE000); /** * The 4Kbyte of Char generator ROM memory */ public ROM chargen=new ROM(4*1024, 0xD000); /** * The 1Kb of color ram */ public ColorRAM color=new ColorRAM(1024, 0xD800, bus); /** * The 8Mhz clock signal */ public Clock clock=new Clock(Clock.PAL); /** * The Motorola 6510 cpu */ ///public UtTest4 cpu=new UtTest4(clock.monitor, bus, kernal, basic); /** * Table for read functions pointers */ protected readableBus[] rT; /** * Table for write functions pointers */ protected writeableBus[] wT; /** * Initialize the C64 Memories chip (RAM and ROMs). * If there's error, the program halt with error message. */ public void initMemory() { if (!(basic.load(ROM_PATH+"Basic.rom") && kernal.load(ROM_PATH+"Kernal.rom") && chargen.load(ROM_PATH+"Char.rom"))) { System.err.println("Error reading the ROM image."); System.exit(1); } } public Test4() { int i; initMemory(); wT=new writeableBus[0x10000>>8]; rT=new readableBus[0x10000>>8]; for (i=0; i<(0x10000>>8); i++) { wT[i]=ram; rT[i]=ram; } for (i=(0xA000>>8); i<(0xC000>>8); i++) rT[i]=basic; for (i=(0xE000>>8); i<(0x10000>>8); i++) rT[i]=kernal; if (rT[255]==kernal) System.out.println("OK"); bus.setTableCpu(rT, wT); clock.setRealTime(1000); clock.startClock(); ///cpu.powerOn(); while (true) { //System.out.println(cpu.regPC); } } public static void main(String[] args) { Test4 test4 = new Test4(); } }
2,350
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
Test1.java
/FileExtraction/Java_unseen/ice00_jc64/src/debug/Test1.java
// test the disassembler of M6510 package sw_emulator; import java.io.*; import sw_emulator.software.cpu.M6510Dasm; import sw_emulator.math.Unsigned; import java.lang.*; public class Test1 { M6510Dasm dis=new M6510Dasm(); public Test1() { byte[] buf={0,0,0, 0, 0, 0, 0}; int pos=0; long pc=644; for (int i =0; i<256; i++) { buf[0]=(byte)i; buf[1]=(byte)(i+1); buf[2]=(byte)(i+2); System.out.println(dis.dasm(buf, pos, pc)+" "+dis.dcom()); } System.out.println(Unsigned.done((byte)4)); //try { // wait(10000); //} catch(InterruptedException e) {} } public static void main(String[] args) { Test1 test1 = new Test1(); test1.invokedStandalone = true; } private boolean invokedStandalone = false; }
814
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
TestTV.java
/FileExtraction/Java_unseen/ice00_jc64/src/debug/TestTV.java
package debug; import sw_emulator.hardware.device.raster; import sw_emulator.hardware.device.TV; class TestTV implements Runnable { raster tv; public void Main() { tv = new TV(); } public void run() { Thread runner = Thread.currentThread(); while(true) { for(int i=0;i<200;i++) { int randomClr=((int)(Math.random()*100.0))%raster.PALETTE_SIZE; for(int j=0;j<320;j++) tv.sendPixel(randomClr); } //tv.updateFrame(); tv.displayCurrentFrame(); tv.newFrame(); try{ runner.sleep(5); }catch(Exception e){System.err.println("Interrupted Exception.");} } } public static void main(String argv[]) { TestTV prg = new TestTV(); Thread runner = new Thread(prg); runner.start(); } }
913
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
C64_test.java
/FileExtraction/Java_unseen/ice00_jc64/src/debug/C64_test.java
/** * @(#)C64.java 1999/09/19 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package debug; import sw_emulator.hardware.powered; import sw_emulator.hardware.signaller; import sw_emulator.hardware.bus.C64Bus; import sw_emulator.hardware.memory.dinamic; import sw_emulator.hardware.memory.DRAM; import sw_emulator.hardware.memory.ColorRAM; import sw_emulator.hardware.memory.ROM; import sw_emulator.hardware.Clock; import sw_emulator.hardware.cartridge.Cartridge; import sw_emulator.hardware.cpu.M6510; import sw_emulator.hardware.chip.PLA82S100; import sw_emulator.hardware.chip.M6569; import sw_emulator.hardware.chip.M6526; import sw_emulator.hardware.chip.Sid; import sw_emulator.hardware.io.C64M6510IO; import sw_emulator.hardware.io.C64VicII_IO; import sw_emulator.hardware.io.C64Cia1IO; import sw_emulator.hardware.io.C64Cia2IO; import sw_emulator.hardware.io.C64CartridgeIO; import sw_emulator.hardware.device.C64Keyboard; import sw_emulator.hardware.device.TV; import sw_emulator.hardware.device.C64Form; import sw_emulator.util.AndPort; import java.lang.*; import java.io.*; // debug: // load a prg contain the C64 test suit /** * Emulate the Commodore 64 computer. * * @author Ice * @version 1.00 19/09/1999 */ public class C64_test implements powered{ /** * Path where the roms images are stored */ public static final String ROM_PATH="/rom/"; /** * 8Kb of Ram memory address 0x0000 0x1FFF */ protected DRAM ram0=new DRAM(8*1024, 0x0000); /** * 8Kb of Ram memory address 0x2000 0x3FFF */ protected DRAM ram1=new DRAM(8*1024, 0x2000); /** * 8Kb of Ram memory address 0x4000 0x5FFF */ protected DRAM ram2=new DRAM(8*1024, 0x4000); /** * 8Kb of Ram memory address 0x6000 0x7FFF */ protected DRAM ram3=new DRAM(8*1024, 0x6000); /** * 8Kb of Ram memory address 0x8000 0x9FFF */ protected DRAM ram4=new DRAM(8*1024, 0x8000); /** * 8Kb of Ram memory address 0xA000 0xBFFF */ protected DRAM ram5=new DRAM(8*1024, 0xA000); /** * 8Kb of Ram memory address 0xC000 0xDFFF */ protected DRAM ram6=new DRAM(8*1024, 0xC000); /** * 8Kb of Ram memory address 0xE000 0xFFFF */ protected DRAM ram7=new DRAM(8*1024, 0xE000); /** * Dinamic memories that need refresh */ protected dinamic[] dinamicMemories={ ram0, ram1, ram2, ram3, ram4, ram5, ram6, ram7 }; /** * The 8Kbyte of Basic ROM memory */ public ROM basic=new ROM(8*1024, 0xA000); /** * The 8Kbyte of Kernal ROM memory */ public ROM kernal=new ROM(8*1024, 0xE000); /** * The 4Kbyte of Char generator ROM memory */ public ROM chargen=new ROM(4*1024, 0xD000); /** * The bus of the C64 */ public C64Bus bus=new C64Bus(); /** * The 1Kb of color ram */ public ColorRAM color=new ColorRAM(1024, 0xD800, bus); /** * The 8Mhz clock signal */ public Clock clock=new Clock(Clock.PAL); /** * The TV attached to the C64 Vic II output */ public TV tv=new TV(); /** * The application menu bar */ public C64Form c64Form=new C64Form(); /** * The M6569 Vic II */ public M6569 vic=new M6569(clock.monitor, bus, C64Bus.V_VIC, null, dinamicMemories, tv); /** * The Mos 6510 cpu */ public M6510 cpu=new M6510(vic.intMonitor, bus, C64Bus.V_CPU, null); /** * The Mos SID chip */ public Sid sid=new Sid(); // to modify /** * The cartridge port */ public Cartridge exp=new Cartridge(null, vic.intMonitor, bus); /** * The Cia 1 chip */ public M6526 cia1=new M6526(M6526.PAL, vic.intMonitor, null); /** * The Cia2 chip */ public M6526 cia2=new M6526(M6526.PAL, vic.intMonitor, null); /** * The PLA82S100 chip of C64 */ public PLA82S100 pla=new PLA82S100(bus, exp, ram0, ram1, ram2, ram3, ram4, ram5, ram6, ram7, basic, kernal, chargen, vic, sid, color, cia1, cia2); /** * The C64 keyboard */ public C64Keyboard keyb=new C64Keyboard(null); /** * The IO signals of C64 cpu */ public C64M6510IO cpuIO=new C64M6510IO(pla); /** * The 74LS08 And port with output pin 6. * This give AEC signal to Cpu. */ protected AndPort and6=new AndPort(cpu, signaller.S_AEC, signaller.S_DMA, signaller.S_AEC); /** * The 74LS08 And port with output pin 3. * This give RDY signal to Cpu. */ protected AndPort and3=new AndPort(cpu, signaller.S_BA, signaller.S_DMA, signaller.S_RDY); /** * The Vic IO signals connections */ public C64VicII_IO vicIO=new C64VicII_IO(cpu, exp, and6, and3); /** * The Cia 1 IO signals connections */ public C64Cia1IO cia1IO=new C64Cia1IO(cpu, exp, keyb.monitor, keyb.colLines); /** * The Cia 2 IO signals connections */ public C64Cia2IO cia2IO=new C64Cia2IO(cpu, exp, pla); /** Devices that will need tod signal */ protected signaller[] devicesTod={cia1, cia2}; /** * The expansion IO signals connections */ public C64CartridgeIO expIO=new C64CartridgeIO(cpu, pla, and6, and3); public C64_test() { clock.registerTod(devicesTod); // register cia for using tod from the clock initMemory(); c64Form.addTV(tv); c64Form.setVisible(true); cpu.setIO(cpuIO); // set cpu IO signals vic.setIO(vicIO); // set vic IO signals keyb.setIO(cia1IO); // set keyb IO signals exp.setIO(expIO); // set exp IO signals cia1.setIO(cia1IO); // set cia 1 IO signals cia2.setIO(cia2IO); // set cia 2 IO signals bus.setColor(color); // set up color ram for Vic in bus kernal.change(0xfd84, (byte)0xa0); // don't fill the memory kernal.change(0xfd85, (byte)00); kernal.change(0xea87, (byte)0x60); // kernal.change(0xe445, (byte)0x16); // jmp 2070 // kernal.change(0xe446, (byte)0x08); byte[] fileImage; FileInputStream file; // the file try { file=new FileInputStream("c:\\temp\\MMU.prg"); try { int kk=file.available(); fileImage=new byte[kk]; file.read(fileImage); int address=fileImage[0]+fileImage[1]*256; System.err.println(address); for (int i=2; i<kk; i++) ram0.change(address+i-2,fileImage[i]); for (int i=2; i<kk; i++) { if (fileImage[i]==-98) { //0x9e String addr=""; int k=1; while (fileImage[i+k]!=0) { addr=addr+(fileImage[i+k]-48); k++; } int val=Integer.valueOf(addr); System.err.println(val); kernal.change(0xe445, (byte)(val & 0xff)); // jmp 2070 kernal.change(0xe446, (byte)(val>>8)); break; } } } catch (IOException e) { System.err.println("err"); } } catch (FileNotFoundException e) { System.err.println("err"); } catch (SecurityException e1) { System.err.println("err"); } System.out.println("Power ON the machine"); powerOn(); clock.setRealTime(1); ///debug: use slow clock System.out.println("Start the clock..."); clock.startClock(); } public static void main(String[] args) { C64_test c64 = new C64_test(); } /** * Initialize the C64 Memories chip (RAM and ROMs). * If there's error, the program halt with error message. */ public void initMemory() { System.out.println("Reading machine ROMs"); if (!(basic.load(ROM_PATH+"basic.rom") && kernal.load(ROM_PATH+"kernal.rom") && chargen.load(ROM_PATH+"char.rom"))) { System.err.println("Error reading the ROM images."); System.exit(1); } } /** * Power on the electronic component in the machine */ public void powerOn() { pla.powerOn(); System.out.println(" Pla: power is on"); cpu.powerOn(); System.out.println(" Cpu: power is on"); vic.powerOn(); System.out.println(" VIC: power is on"); cia1.powerOn(); System.out.println(" CIA1: power is on"); cia2.powerOn(); System.out.println(" CIA2: power is on"); sid.powerOn(); System.out.println(" SID: power is on"); } /** * Power off the electronic component in the machine */ public void powerOff() { pla.powerOff(); System.out.println("Pla: power is off"); cpu.powerOff(); System.out.println(" Cpu: power is off"); vic.powerOff(); System.out.println(" VIC: power is off"); cia1.powerOff(); System.out.println(" CIA1: power is off"); cia2.powerOff(); System.out.println(" CIA2: power is off"); sid.powerOff(); System.out.println(" SID: power is off"); } }
9,921
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
Test3.java
/FileExtraction/Java_unseen/ice00_jc64/src/debug/Test3.java
// test M6510 emulation in a simple C64 memory map package debug; import sw_emulator.hardware.cpu.*; import sw_emulator.hardware.memory.*; import sw_emulator.hardware.bus.*; import sw_emulator.hardware.io.*; import sw_emulator.util.*; import sw_emulator.hardware.*; public class Test3 { /** * Path where the roms images are stored */ public static final String ROM_PATH="e:\\programmi\\jbuilder2\\myprojects\\sw_emulator\\"; public C64Bus bus=null;//new C64Bus(null, null, null); /** * The 64Kbyte of ram memory */ public Memory ram=new Memory(64*1024, 0); /** * The 8Kbyte of Basic ROM memory */ public ROM basic=new ROM(8*1024, 0xA000); /** * The 8Kbyte of Kernal ROM memory */ public ROM kernal=new ROM(8*1024, 0xE000); /** * The 4Kbyte of Char generator ROM memory */ public ROM chargen=new ROM(4*1024, 0xD000); /** * The 1Kb of color ram */ public ColorRAM color=new ColorRAM(1024, 0xD800, bus); /** * The 8Mhz clock signal */ public Clock clock=new Clock(Clock.PAL); public C64M6510IO io=null;///new C64M6510IO(); /** * The Motorola 6510 cpu */ public M6510 cpu=new M6510(clock.monitor, bus, C64Bus.V_CPU, io); /** * Table for read functions pointers */ protected readableBus[] rT; /** * Table for write functions pointers */ protected writeableBus[] wT; /** * Initialize the C64 Memories chip (RAM and ROMs). * If there's error, the program halt with error message. */ public void initMemory() { if (!(basic.load(ROM_PATH+"Basic.rom") && kernal.load(ROM_PATH+"Kernal.rom") && chargen.load(ROM_PATH+"Char.rom"))) { System.err.println("Error reading the ROM image."); System.exit(1); } } public Test3() { int i; initMemory(); wT=new writeableBus[0x10000>>8]; rT=new readableBus[0x10000>>8]; for (i=0; i<(0x10000>>8); i++) { wT[i]=ram; rT[i]=ram; } for (i=(0xA000>>8); i<(0xC000>>8); i++) rT[i]=basic; for (i=(0xE000>>8); i<(0x10000>>8); i++) rT[i]=kernal; if (rT[255]==kernal) System.out.println("OK"); bus.setTableCpu(rT, wT); clock.setRealTime(1000); clock.startClock(); cpu.powerOn(); while (true) { //System.out.println(cpu.regPC); } } public static void main(String[] args) { Test3 test3 = new Test3(); } }
2,450
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
TestTV2.java
/FileExtraction/Java_unseen/ice00_jc64/src/debug/TestTV2.java
package debug; import sw_emulator.hardware.device.raster; import sw_emulator.hardware.device.TV; import java.io.*; class TestTV2 { raster tv; public TestTV2() { tv=new TV(); byte[] charData = load("data/char.rom"); write(charData); //tv.updateFrame(); tv.displayCurrentFrame(); } static byte[] load(String file) { byte[] data=null; try{ File f=new File(file); BufferedInputStream is=new BufferedInputStream(new FileInputStream(f)); data = new byte[(int)f.length()]; is.read(data); is.close(); }catch(Exception e){ System.err.println("Errore :="+e.getMessage()); } return data; } void write(byte[] charData) { int k=0; int err=0; while(err<=8) { for(int i=0;i<8;i++) { for(int j=0;j<40;j++) { try{ write(charData[k+i+j*8]); }catch(Exception e) { // tv.flush(); err++; break; } } } k+=40*8; } } void write(byte value) { byte mask=(byte)-128; if((value&mask)!=0) { tv.sendPixel(raster.LIGHT_BLUE); } else { tv.sendPixel(raster.BLUE); } mask=(byte)64; for(int i=0;i<7;i++) { if((value&mask)!=0){ tv.sendPixel(raster.LIGHT_BLUE); } else { tv.sendPixel(raster.BLUE); } mask>>=1; } } public static void main(String argv[]) { TestTV2 test=new TestTV2(); } }
1,640
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
Test2.java
/FileExtraction/Java_unseen/ice00_jc64/src/debug/Test2.java
// test the disassembler of C64 package sw_emulator; import sw_emulator.software.machine.*; import java.io.*; public class Test2 { public C64Dasm dis=new C64Dasm(); public FileInputStream fi; public FileOutputStream fo; public byte[] buffer=new byte[123456]; public String result; public File fin; public File fon; public Test2() { int b; int i; try { try { fin=new File("/home/ice/Download/sid/Matt_Gray/Driller.sid"); fon=new File("/home/ice/driller.lst"); System.out.println(fin.exists()); System.out.println(fin.getName()); System.out.println(fin.getPath()); fi=new FileInputStream(fin); fo=new FileOutputStream(fon); b=0; i=0x900-0x7c-2; while (b!=-1) { b=fi.read(); buffer[i]=(byte)b; i++; } System.out.println("In Buffer readed"); { fi.read(buffer, 4, 0xc8);} result=null;//dis.cdasm(buffer, 0x900, 0x1600, 0x900); System.out.println("Out Buffe created"); System.out.println(result); for ( i=0; i<result.length(); i++) fo.write((int)result.charAt(i)); } catch (FileNotFoundException e) {} } catch (IOException e1) {} } public static void main(String[] args) { Test2 test2 = new Test2(); test2.invokedStandalone = true; } private boolean invokedStandalone = false; }
1,329
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
FileDasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/FileDasm.java
/** * @(#)FileDasm.java 2001/05/05 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software; import sw_emulator.software.memory.MemoryFlags; import sw_emulator.software.machine.C64SidDasm; import sw_emulator.software.machine.C64MusDasm; import sw_emulator.software.machine.C64Dasm; import sw_emulator.math.Unsigned; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.FileNotFoundException; import java.io.IOException; import sw_emulator.software.memory.memoryState; /** * Disassemble a given file in raw format (.prg) or in psid (.sid) format. * The action performed is simple: all the data is interpreted as code, * using one passed to the data. This make the result a simple way to figure * how the code is formed. * From this version, it is used the SIDLN memory state for better * disassembling of prg/sid files. * * Some of the code is taken from libsidplay source * * @author Ice * @version 1.02 14/10/2003 */ public class FileDasm { /** Complete name of the input file */ public String inN; /** Complete name of the output file */ public String outN; /** The input file stream */ public BufferedInputStream inF; /** The output file stream */ public BufferedOutputStream outF; /** The names of SIDLN output files*/ public String[] names; /** The language to use */ public byte lang=C64Dasm.LANG_ENGLISH; /** Contains the data of input file */ public byte[] inB=new byte[0x66000]; /** The output of disassembler */ public String outB; /** Position in buffer of start of sid program */ public int sidPos; /** PC value of start of sid program */ public int sidPC; /** PC value of start of mus program */ public int musPC; /** Mus file voice 1 address */ public int ind1; /** Mus file voice 2 address */ public int ind2; /** Mus file voice 3 address */ public int ind3; /** Mus file txt address */ public int txtA; /** The state of the memory */ public MemoryFlags memory; /** Memory to use */ public MemoryDasm[] memoryDasm=new MemoryDasm[0xFFFF+1];; /** CHR$ conversion table (0x01 = no output) */ public static char CHRtab[] = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xd, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x20,0x21, 0x1,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f, 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x24,0x5d,0x20,0x20, // alternative: CHR$(92=0x5c) => ISO Latin-1(0xa3) 0x2d,0x23,0x7c,0x2d,0x2d,0x2d,0x2d,0x7c,0x7c,0x5c,0x5c,0x2f,0x5c,0x5c,0x2f,0x2f, 0x5c,0x23,0x5f,0x23,0x7c,0x2f,0x58,0x4f,0x23,0x7c,0x23,0x2b,0x7c,0x7c,0x26,0x5c, // 0x80-0xFF 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x20,0x7c,0x23,0x2d,0x2d,0x7c,0x23,0x7c,0x23,0x2f,0x7c,0x7c,0x2f,0x5c,0x5c,0x2d, 0x2f,0x2d,0x2d,0x7c,0x7c,0x7c,0x7c,0x2d,0x2d,0x2d,0x2f,0x5c,0x5c,0x2f,0x2f,0x23, 0x2d,0x23,0x7c,0x2d,0x2d,0x2d,0x2d,0x7c,0x7c,0x5c,0x5c,0x2f,0x5c,0x5c,0x2f,0x2f, 0x5c,0x23,0x5f,0x23,0x7c,0x2f,0x58,0x4f,0x23,0x7c,0x23,0x2b,0x7c,0x7c,0x26,0x5c, 0x20,0x7c,0x23,0x2d,0x2d,0x7c,0x23,0x7c,0x23,0x2f,0x7c,0x7c,0x2f,0x5c,0x5c,0x2d, 0x2f,0x2d,0x2d,0x7c,0x7c,0x7c,0x7c,0x2d,0x2d,0x2d,0x2f,0x5c,0x5c,0x2f,0x2f,0x23 }; public static void main(String[] args) { FileDasm fileDasm= new FileDasm(args); } /** * Construct the file disassembler with the passed parameters */ public FileDasm(String[] args) { int result; // result of file reading // look for good parameters if (!lookParameter(args)) { showHelp(); return; } // create the memory state of this program memory=new MemoryFlags(names); byte[] memoryFlags=memory.getMemoryState(0, 0xFFFF); for (int i=0; i<memoryDasm.length; i++) { memoryDasm[i]=new MemoryDasm(); memoryDasm[i].address=i; } for (int i=0; i<memoryDasm.length; i++) { memoryDasm[i].isData = (memoryFlags[i] & (memoryState.MEM_READ | memoryState.MEM_READ_FIRST | memoryState.MEM_WRITE | memoryState.MEM_WRITE_FIRST | memoryState.MEM_SAMPLE)) !=0; memoryDasm[i].isCode = (memoryFlags[i] & (memoryState.MEM_EXECUTE | memoryState.MEM_EXECUTE_FIRST)) !=0; } // see if the file is present try { inF=new BufferedInputStream(new FileInputStream(inN)); } catch (FileNotFoundException e) { System.out.println("Input file not found: abort"+e); return; } catch (SecurityException e1) { System.out.println("Security exception in open the input file: abort\n"); return; } // read the file System.out.println("Read the input file..."); try { result=inF.read(inB); inF.close(); } catch (IOException e) { return; } // skip little file if (result<0x80) { System.out.println("The file is little: skip disassembling"); return; } // see if the file can be created try { outF=new BufferedOutputStream(new FileOutputStream(outN)); } catch (FileNotFoundException e) { System.out.println("Output file can not be created: abort: "+e); return; } catch (SecurityException e1) { System.out.println("Securety exception in creating the output file: abort\n"); return; } // execute the disassembling of the file System.out.println("Disassemble the input file ..."); if (isPSID()) { C64SidDasm sid=new C64SidDasm(); sid.setMemory(memoryDasm); outB=sid.cdasm(inB, sidPos, result, sidPC); } else if (isMUS(result)) { C64MusDasm mus=new C64MusDasm(); outB="VOICE 1 MUSIC DATA: \n\n"; outB+=mus.cdasm(inB, ind1, ind2-1, ind1+musPC); outB+="\nVOICE 2 MUSIC DATA: \n\n"; outB+=mus.cdasm(inB, ind2, ind3-1, ind2+musPC); outB+="\nVOICE 3 MUSIC DATA: \n\n"; outB+=mus.cdasm(inB, ind3, txtA-1, ind3+musPC); } else { C64Dasm prg=new C64Dasm(); prg.setMemory(memoryDasm); int start=Unsigned.done(inB[0])+Unsigned.done(inB[1])*256; outB=prg.cdasm(inB, 2, result, start); } // write output to the file System.out.println("Save the output file ..."); try { for (int i=0; i<outB.length(); i++) outF.write((int)outB.charAt(i)); outF.flush(); } catch (IOException e) { System.out.println("Error writing the output file of " + outB.length()+ " bytes."); } } /** * Show the help about program syntax */ public void showHelp() { System.out.println("JC64Dis: dissassembler for pgr/sid/mus files (beta release 1)"); System.out.println("by Ice Team Free Software Group 1999-2003\n"); System.out.println("Usage: jc64dis [-xx] in_file out_file [RAWx.BIN ...]"); System.out.println("where -xx is for the language to use: en (english)/it (italian)"); System.out.println(" in_file is the input file"); System.out.println(" out_file is the output file"); System.out.println(" RAWx.bin are the SIDLN memory states file"); } /** * Look for the passed paramether * * @param args the passed paramether * @return true if parameter are good formed */ public boolean lookParameter(String[] args) { names=null; // are the parameters in the rigth number? if (args.length<2) { return false; } int pos=0; // the position of the input file if (args[0].equals("-en")) { lang=C64Dasm.LANG_ENGLISH; pos=1; } else { if (args[0].equals("-it")) { lang=C64Dasm.LANG_ITALIAN; pos=1; } } inN=args[pos]; outN=args[++pos]; if ((args.length-pos)==0) return true; // copy the names names=new String[args.length-pos-1]; for (int i=++pos, j=0; i<args.length; i++, j++) { names[j]=args[i]; } return true; } /** * Determine if the input file is a PSID or RSID file * * @return true if the file is a PSID or RSID file */ public boolean isPSID() { int psidVersion; // version of psid file int psidDOff; // psid data offeset int psidLAddr; // psid load address int psidIAddr; // psid init address int psidPAddr; // psid play address int psidSong; // number of songs int psidSSong; // start song // check header if (((inB[0]!='P') && (inB[0]!='R')) ||(inB[1]!='S')||(inB[2]!='I')||(inB[3]!='D')) return false; // check PSID version if ((inB[4]!='\0')|| (inB[5]!='\1' && inB[5]!='\2')) return false; psidVersion=(int)inB[5]; // check PSID data offset if ((inB[6]!='\0')|| (inB[7]!=0x76 && inB[7]!=0x7C)) return false; psidDOff=(int)inB[7]; if (psidVersion==2 && psidDOff==0x76) return false; if (psidVersion==1 && psidDOff==0x7C) return false; psidLAddr=Unsigned.done(inB[9])+Unsigned.done(inB[8])*256; psidIAddr=Unsigned.done(inB[11])+Unsigned.done(inB[10])*256; psidPAddr=Unsigned.done(inB[13])+Unsigned.done(inB[12])*256; psidSong=Unsigned.done(inB[15])+Unsigned.done(inB[14])*256; psidSSong=Unsigned.done(inB[17])+Unsigned.done(inB[16])*256; //write these data as header of output file try { StringBuffer tmp=new StringBuffer(""); char first; if (inB[0]==0x52) first='R'; else first='P'; outF.write((first+"SID file version "+psidVersion+"\n").getBytes()); outF.write(("Load Address: "+Integer.toHexString(psidLAddr)+"\n").getBytes()); outF.write(("Init Address: "+Integer.toHexString(psidIAddr)+"\n").getBytes()); outF.write(("Play Address: "+Integer.toHexString(psidPAddr)+"\n").getBytes()); for (int i=0x16; i<0x36; i++) { if (inB[i]==0) break; tmp.append((char)inB[i]); } outF.write(("name: "+tmp+"\n").getBytes()); tmp=new StringBuffer(""); for (int i=0x36; i<0x56; i++) { if (inB[i]==0) break; tmp.append((char)inB[i]); } outF.write(("author: "+tmp+"\n").getBytes()); tmp=new StringBuffer(""); for (int i=0x56; i<0x76; i++) { if (inB[i]==0) break; tmp.append((char)inB[i]); } outF.write(("copyright: "+tmp+"\n").getBytes()); outF.write(("songs: "+psidSong+" (startsong: "+psidSSong+")\n\n").getBytes()); } catch (IOException e) { System.out.println("Error writing output file: "+e); } //calculate address for disassembler if (psidLAddr==0) { sidPC=Unsigned.done(inB[psidDOff])+Unsigned.done(inB[psidDOff+1])*256; sidPos=psidDOff+2; } else { sidPos=psidDOff; sidPC=psidLAddr; } return true; } /** * Determine if the input file is a MUS/STR file * * @param length the length of the file * @return true if the file is a MUS file */ public boolean isMUS(int length) { int v1Length; // length of voice 1 data int v2Length; // length of voice 2 data int v3Length; // length of voice 3 data musPC=Unsigned.done(inB[0])+Unsigned.done(inB[1])*256; v1Length=Unsigned.done(inB[2])+Unsigned.done(inB[3])*256; v2Length=Unsigned.done(inB[4])+Unsigned.done(inB[5])*256; v3Length=Unsigned.done(inB[6])+Unsigned.done(inB[7])*256; // calculate pointer to voice data ind1=8; ind2=ind1+v1Length; ind3=ind2+v2Length; if (inB[ind2-2]==0x01 && inB[ind2-1]==0x4F && inB[ind3-2]==0x01 && inB[ind3-1]==0x4F && inB[ind3+v3Length-2]==0x01 && inB[ind3+v3Length-1]==0x4F) { // write songs information try { StringBuffer tmp=new StringBuffer(""); int pos=v1Length+v2Length+v3Length+8; txtA=pos; for (int line=0; line<5; line++ ) { char c; char si=0; // count copied characters do { // ASCII CHR$ conversion c=CHRtab[Unsigned.done(inB[pos])]; if ((c>=0x20) && (si<=31)) { tmp.append(c); // copy to info string } // If character is 0x9d (left arrow key) then move back. if ((inB[pos]==0x9d) && (si>=0)) { si--; } pos++; } while ( !((c==0x0D) || (c==0x00) || (pos>length)) ); tmp.append('\n'); } tmp.append('\n'); outF.write((tmp+"\n").getBytes()); } catch (IOException e) { System.out.println("Error writing output file: "+e); } return true; } else return false; } }
14,051
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
MemoryDasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/MemoryDasm.java
/** * @(#)memoryState.java 2019/12/21 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software; import java.io.Serializable; import java.util.Objects; import sw_emulator.software.BasicDetokenize.BasicType; import sw_emulator.swing.main.DataType; /** * Memory cell for the disassembler * * @author ice */ public class MemoryDasm implements Cloneable, Serializable { /** Empty type */ public static final char TYPE_EMPTY=' '; /** Plus (+) type */ public static final char TYPE_PLUS = '+'; /** Minus (-) type */ public static final char TYPE_MINUS = '-'; /** Major (>) type */ public static final char TYPE_MAJOR = '>'; /** Minur (<) type */ public static final char TYPE_MINOR = '<'; /** Plus & Major (^) type */ public static final char TYPE_PLUS_MAJOR = '^'; /** Plus & Minor (\) type */ public static final char TYPE_PLUS_MINOR = '\\'; /** Minus & Major (,) type */ public static final char TYPE_MINUS_MAJOR = ','; /** Minus & Minor (;) type */ public static final char TYPE_MINUS_MINOR = ';'; /** Address of memory (0..$FFFF) */ public int address; /** Memory comment from dasm disassemble */ public String dasmComment; /** Memory comment from user (if not null it surclass the dasm one) */ public String userComment; /** Memory block comment from user */ public String userBlockComment; /** Location defined by dasm disassemble */ public String dasmLocation; /** Location defined by user */ public String userLocation; /** True if the memory area is inside the read data to disassemble */ public boolean isInside; /** True if this is code */ public boolean isCode; /** True if this is data */ public boolean isData; /** True if this is garbage */ public boolean isGarbage; /** If inside it store the copy of value of memory */ public byte copy; /** Constant index to use if applicable into the kind of data */ public byte index=-1; /** Related address (#< or #>)*/ public int related=-1; /** Type of relation for related */ public char type=TYPE_EMPTY; /** Address of memory as base of relocation (0..$FFFF) */ public int relatedAddressBase; /** Address of memory as destination of relocation (0..$FFFF) */ public int relatedAddressDest; /** Type of data */ public DataType dataType=DataType.NONE; /** Type of basic for data */ public BasicType basicType=BasicType.NONE; /** * Test if a given object is equal to this * * @param o the object to test * @return true if it is equal */ @Override public boolean equals(Object o) { if (!(o instanceof MemoryDasm)) return false; MemoryDasm d=(MemoryDasm) o; if (this.address != d.address) return false; if (!Objects.equals(this.dasmComment, d.dasmComment)) return false; if (!Objects.equals(this.userComment, d.userComment)) return false; if (!Objects.equals(this.userBlockComment, d.userBlockComment)) return false; if (!Objects.equals(this.dasmLocation, d.dasmLocation)) return false; if (!Objects.equals(this.userLocation, d.userLocation)) return false; if (this.isInside != d.isInside) return false; if (this.isCode != d.isCode) return false; if (this.isData != d.isData) return false; if (this.isGarbage != d.isGarbage) return false; if (this.copy != d.copy) return false; if (this.related != d.related) return false; if (this.type != d.type) return false; if (this.dataType != d.dataType) return false; if (this.index != d.index) return false; if (this.relatedAddressBase != d.relatedAddressBase) return false; if (this.relatedAddressDest != d.relatedAddressDest) return false; return true; } @Override public int hashCode() { int hash = 7; hash = 53 * hash + this.address; hash = 53 * hash + Objects.hashCode(this.dasmComment); hash = 53 * hash + Objects.hashCode(this.userComment); hash = 53 * hash + Objects.hashCode(this.userBlockComment); hash = 53 * hash + Objects.hashCode(this.dasmLocation); hash = 53 * hash + Objects.hashCode(this.userLocation); hash = 53 * hash + (this.isInside ? 1 : 0); hash = 53 * hash + (this.isCode ? 1 : 0); hash = 53 * hash + (this.isData ? 1 : 0); hash = 53 * hash + (this.isGarbage ? 1 : 0); hash = 53 * hash + this.copy; hash = 53 * hash + this.related; hash = 53 * hash + this.type; hash = 53 * hash + this.index; hash = 53 * hash + Objects.hashCode(this.dataType); hash = 53 * hash + this.relatedAddressBase; hash = 53 * hash + this.relatedAddressDest; return hash; } @Override public MemoryDasm clone() { MemoryDasm m = new MemoryDasm(); m.address=this.address; m.copy=this.copy; m.dasmComment=this.dasmComment; m.dasmLocation=this.dasmLocation; m.isCode=this.isCode; m.isData=this.isData; m.isGarbage=this.isGarbage; m.isInside=this.isInside; m.related=this.related; m.type=this.type; m.userBlockComment=this.userBlockComment; m.userComment=this.userComment; m.userLocation=this.userLocation; m.dataType=this.dataType; m.index=this.index; m.relatedAddressBase=this.relatedAddressBase; m.relatedAddressDest=this.relatedAddressDest; return m; } }
6,306
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
Assembler.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/Assembler.java
/** * @(#)Assembler 2020/11/01 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.Locale; import sw_emulator.math.Unsigned; import static sw_emulator.software.Assembler.Byte.DB_BYTE_H; import static sw_emulator.software.Assembler.Word.DW_WORD_H; import sw_emulator.software.BasicDetokenize.BasicType; import static sw_emulator.software.MemoryDasm.TYPE_MAJOR; import static sw_emulator.software.MemoryDasm.TYPE_MINOR; import static sw_emulator.software.MemoryDasm.TYPE_MINUS; import static sw_emulator.software.MemoryDasm.TYPE_MINUS_MAJOR; import static sw_emulator.software.MemoryDasm.TYPE_MINUS_MINOR; import static sw_emulator.software.MemoryDasm.TYPE_PLUS; import static sw_emulator.software.MemoryDasm.TYPE_PLUS_MAJOR; import static sw_emulator.software.MemoryDasm.TYPE_PLUS_MINOR; import sw_emulator.swing.main.Carets; import sw_emulator.swing.main.Carets.Type; import sw_emulator.swing.main.Constant; import sw_emulator.swing.main.DataType; import sw_emulator.swing.main.Option; /** * Assembler builder. * It manages the creation of a source output based onto rules * * @author ice */ public class Assembler { private static final String SPACES=" "; private static final String TABS="\t\t\t\t\t\t\t\t\t\t"; /** * Return spaces/tabs to use in start of data area * * @return the spaces/tabs */ protected static String getDataSpacesTabs() { return SPACES.substring(0, option.numDataSpaces)+TABS.substring(0, option.numDataTabs); } /** * Return spaces/tabs to use in comment after data * * @param skip dimension to skip * @return the spaces/tabs */ protected static String getDataCSpacesTabs(int skip) { return SPACES.substring(0, (option.numDataCSpaces-skip<0 ? 1: option.numDataCSpaces-skip))+TABS.substring(0, option.numDataCTabs); } /** * Return spaces/tabs to use in comment after instruction * * @param skip amount to skip * @return the spaces/tabs */ protected String getInstrCSpacesTabs(int skip) { return SPACES.substring(0, (option.numInstrCSpaces-skip<0 ? 1:option.numInstrCSpaces-skip))+TABS.substring(0, option.numInstrCTabs); } /** * Convert a unsigned byte (containing in a int) to Exe upper case 2 chars * * @param value the byte value to convert * @return the exe string rapresentation of byte */ protected static String ByteToExe(int value) { int tmp=value; if (value<0) return "??"; String ret=Integer.toHexString(tmp); if (ret.length()==1) ret="0"+ret; return ret.toUpperCase(Locale.ENGLISH); } /** * Convert a unsigned short (containing in a int) to Exe upper case 4 chars * * @param value the short value to convert * @return the exe string rapresentation of byte */ protected static String ShortToExe(int value) { int tmp=value; if (value<0) return "????"; String ret=Integer.toHexString(tmp); int len=ret.length(); switch (len) { case 1: ret="000"+ret; break; case 2: ret="00"+ret; break; case 3: ret="0"+ret; break; } return ret.toUpperCase(Locale.ENGLISH); } /** * Return the hex number string with appropriate prefix/suffix ($ of h) * * @param value the string value of the hex number * @param defaultMode the mode $ as default * @return the hex string with prefix */ protected static String HexNum(String value, boolean defaultMode) { if (defaultMode) return "$"+value; else return value+"h"; } /** * Return the bin number string with appropriate prefix/suffix ($ of b) * * @param value the string value of the bin number * @param defaultMode the mode % as default * @return the bin string with prefix */ protected static String BinNum(String value, boolean defaultMode) { if (defaultMode) return "%"+value; else return value+"b"; } /** * Convert an 8 bit 0/1 string to monocolor dots * * @param bin the bin to convert * @return the converted peace */ protected static String BinToMono(String bin) { String d0=""; String d1=""; switch (option.dotsType) { case Option.DOTS_ASCII: d0="."; d1="*"; break; case Option.DOTS_UTF16: d0="\u2591"; d1="\u2589"; break; } return bin.replace("0", d0).replace("1", d1); } /** * Convert an 8 bit 0/1 string to multicolor dots * * @param bin the bin to convert * @return the converted peace */ protected static String BinToMulti(String bin) { String d00=""; String d11=""; String d01=""; String d10=""; switch (option.dotsType) { case Option.DOTS_ASCII: d00=".."; d01="@@"; d10="##"; d11="**"; break; case Option.DOTS_UTF16: d00="\u2591\u2591"; d01="\u2592\u2592"; d10="\u2593\u2593"; d11="\u2589\u2589"; break; } String p0=bin.substring(0, 2).replace("00", d00).replace("11", d11).replace("01", d01).replace("10", d10); String p1=bin.substring(2, 4).replace("00", d00).replace("11", d11).replace("01", d01).replace("10", d10); String p2=bin.substring(4, 6).replace("00", d00).replace("11", d11).replace("01", d01).replace("10", d10); String p3=bin.substring(6, 8).replace("00", d00).replace("11", d11).replace("01", d01).replace("10", d10); return p0+p1+p2+p3; } /** * Action type */ public interface ActionType { /** * Flush the actual data to the output stream * * @param str the output stream */ void flush(StringBuilder str); /** * Put a value to the stream * * @param str the otput stream * @param mem * @param option the option to use */ void putValue(StringBuilder str, MemoryDasm mem, Option option); /** * Setting up the action type if this is the case * * @param str the output stream */ default void setting(StringBuilder str) {}; } /** * Name of the assembler */ public enum Name { DASM { @Override public String getName() { return "Dasm"; } }, TMPX { @Override public String getName() { return "TMPx"; } }, CA65 { @Override public String getName() { return "CA65"; } }, ACME { @Override public String getName() { return "ACME"; } }, KICK { @Override public String getName() { return "KickAssembler"; } }, TASS64 { @Override public String getName() { return "64Tass"; } }, GLASS { @Override public String getName() { return "Glass"; } }, AS { @Override public String getName() { return "(Macro Assembler) AS"; } } ; /** * Get the name of assembler * * @return the name of assembler */ public abstract String getName(); } /** * Starting declaration * -> processor 6502 * -> cpu = 6502 * -> .cpu "6502" * -> .cpu 6502 * -> .cpu _6502 * -> .setcpu 6502x * -> .p02 * -> !CPU 6510 */ public enum Starting implements ActionType { PROC, // processor 6502 FAKE, // cpu = 6502 FAKEZ, // cpu equ 80 DOT_CPU_A, // .cpu "6502" DOT_CPU, // .cpu 6502 DOT_CPU_UND, // .cpu _6502 DOT_SETCPU, // .setcpu 6502x DOT_P02, // .p02 MARK_CPU, // !cpu 6510 CPU_M, // cpu 6502 CPU_I; // cpu 8048 @Override public void flush(StringBuilder str) { switch (aStarting) { case PROC: str.append(getDataSpacesTabs()).append("processor 6502\n\n"); break; case FAKE: str.append(getDataSpacesTabs()).append("cpu = 6502\n\n"); break; case FAKEZ: str.append(getDataSpacesTabs()).append("cpu: equ 80\n\n"); break; case DOT_CPU_A: str.append(getDataSpacesTabs()).append(".cpu \"6502\"\n\n"); break; case DOT_CPU: str.append(getDataSpacesTabs()).append(".cpu 6502\n\n"); break; case DOT_CPU_UND: str.append(getDataSpacesTabs()).append(".cpu _6502\n\n"); break; case DOT_SETCPU: str.append(getDataSpacesTabs()).append(".setcpu \"6502x\"\n\n"); break; case DOT_P02: str.append(getDataSpacesTabs()).append(".p02\n\n"); break; case MARK_CPU: str.append(getDataSpacesTabs()).append("!cpu 6510\n\n"); break; case CPU_M: str.append(getDataSpacesTabs()).append("cpu 6502\n\n"); break; case CPU_I: str.append(getDataSpacesTabs()).append("cpu 8048\n\n"); break; } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { } } /** * Origin declaration * -> org $xxyy * -> .org $xxyy * -> *=$xxyy * -> .pc $xxyy */ public enum Origin implements ActionType { ORG, // org $xxyy DOT_ORG, // .org $xxyy ASTERISK, // *= $xxyy DOT_PC, // .pc $xxyy ORG_H; // org xxyyh @Override public void flush(StringBuilder str) { switch (aOrigin) { case ORG: str.append(getDataSpacesTabs()).append("org $").append(ShortToExe(lastPC)).append("\n\n"); break; case DOT_ORG: str.append(getDataSpacesTabs()).append(".org $").append(ShortToExe(lastPC)).append("\n\n"); break; case ASTERISK: str.append(getDataSpacesTabs()).append("*=$").append(ShortToExe(lastPC)).append("\n\n"); break; case DOT_PC: str.append(getDataSpacesTabs()).append(".pc $").append(ShortToExe(lastPC)).append("\n\n"); break; case ORG_H: str.append(getDataSpacesTabs()).append("org ").append(ShortToExe(lastPC)).append("h\n\n"); break; } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { } } /** * Label declaration type * -> xxxx * -> xxxx: */ public enum Label implements ActionType { NAME, // xxxx NAME_COLON; // xxxx: @Override public void flush(StringBuilder str) { // add the label if it was declared by dasm or user String label=null; int start=str.length(); if (lastMem.userLocation!=null && !"".equals(lastMem.userLocation)) label=lastMem.userLocation; else if (lastMem.dasmLocation!=null && !"".equals(lastMem.dasmLocation)) label=lastMem.dasmLocation; switch (aLabel) { case NAME: str.append(label); break; case NAME_COLON: str.append(label).append(":"); break; } carets.add(start, str.length(), lastMem, Type.LABEL); } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { } } /** * Line comment * * -> ; xxx * -> /* xxx *\/ * -> // xxx */ public enum Comment implements ActionType { SEMICOLON, // ; xxxx CSTYLE, // /* xxx */ DOUBLE_BAR; // // xxx @Override public void flush(StringBuilder str) { String comment=lastMem.dasmComment; if (lastMem.userComment != null /*&& !"".equals(lastMem.userComment)*/) comment=lastMem.userComment; if (comment==null || "".equals(comment)) { str.append("\n"); return; } int start=str.length(); switch (aComment) { case SEMICOLON: str.append("; ").append(comment).append("\n"); break; case CSTYLE: str.append("/* ").append(comment).append(" */\n"); break; case DOUBLE_BAR: str.append("// ").append(comment).append("\n"); break; } carets.add(start, str.length(), lastMem, Type.COMMENT); } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { } } /** * Block comment * * -> ; xxx * -> // xxx * -> /\* xxx *\/ * -> if 0 xxx endif * -> .if 0 xxx .fi * -> .if 0 xxx .endif * -> #if UNDEF xxx #endif * -> !if 0 { xxx } * -> .comment xxx .endc */ public enum BlockComment implements ActionType { SEMICOLON, // ; xxx DOUBLE_BAR, // // xxx CSTYLE, // /* xxx */ IF, // if 0 xxx endif DOT_IF_FI, // .if 0 xxx .fi DOT_IF, // .if 0 xxx .endif SHARP_IF, // #if UNDEF xxx #endif MARK_IF, // !if 0 { xxx } DOT_COMMENT; // .comment xxx .endc// .comment xxx .endc @Override public void flush(StringBuilder str) { if (lastMem==null || lastMem.userBlockComment==null) return; int start=str.length(); // split by new line String[] lines = lastMem.userBlockComment.split("\\r?\\n"); // there macro in comment? if (lastMem.userBlockComment.contains("[<")) { // expand them String tmp; String[] tmpLines; ArrayList<String> alist=new ArrayList(); for (String line : lines) { tmp=getMacro(line); // if length differs, then it was exploded if (tmp.length()>line.length()) { tmpLines=tmp.split("\\r?\\n"); for (String tmpLine: tmpLines) { alist.add(tmpLine); } } else alist.add(tmp); } // give back the list of (exploed) lines lines=new String[alist.size()]; for (int i=0; i<lines.length; i++) { lines[i]=alist.get(i); } } switch (aBlockComment) { case SEMICOLON: for (String line : lines) { if (" ".equals(line)) str.append("\n"); else str.append(";").append(line).append("\n"); } break; case DOUBLE_BAR: for (String line : lines) { if (" ".equals(line)) str.append("\n"); else str.append("//").append(line).append("\n"); } break; case CSTYLE: boolean isOpen=false; for (String line : lines) { if (" ".equals(line)) { if (isOpen) { str.append("*/\n\n"); isOpen=false; } else str.append("\n\n"); } else { if (!isOpen) { isOpen=true; str.append("/*\n"); } str.append(line).append("\n"); } } if (isOpen) str.append("*/\n"); break; case IF: isOpen=false; for (String line : lines) { if (" ".equals(line)) { if (isOpen) { str.append(" endif\n\n"); isOpen=false; } else str.append("\n\n"); } else { if (!isOpen) { isOpen=true; str.append(" if 0\n"); } str.append(line).append("\n"); } } if (isOpen) str.append(" endif\n"); break; case DOT_IF: isOpen=false; for (String line : lines) { if (" ".equals(line)) { if (isOpen) { str.append(".endif\n\n"); isOpen=false; } else str.append("\n\n"); } else { if (!isOpen) { isOpen=true; str.append(".if 0\n"); } str.append(line).append("\n"); } } if (isOpen) str.append(".endif\n"); break; case DOT_IF_FI: isOpen=false; for (String line : lines) { if (" ".equals(line)) { if (isOpen) { str.append(".fi\n\n"); isOpen=false; } else str.append("\n\n"); } else { if (!isOpen) { isOpen=true; str.append(".if 0\n"); } str.append(line).append("\n"); } } if (isOpen) str.append(".fi\n"); break; case SHARP_IF: isOpen=false; for (String line : lines) { if (" ".equals(line)) { if (isOpen) { str.append("#endif\n\n"); isOpen=false; } else str.append("\n\n"); } else { if (!isOpen) { isOpen=true; str.append("#if UNDEF \n"); } str.append(line).append("\n"); } } if (isOpen) str.append("#endif\n"); break; case MARK_IF: isOpen=false; for (String line : lines) { if (" ".equals(line)) { if (isOpen) { str.append("}\n\n"); isOpen=false; } else str.append("\n\n"); } else { if (!isOpen) { isOpen=true; str.append("!if 0 {\n"); } str.append(line).append("\n"); } } if (isOpen) str.append("}\n"); break; case DOT_COMMENT: isOpen=false; for (String line : lines) { if (" ".equals(line)) { if (isOpen) { str.append(".comment\n\n"); isOpen=false; } else str.append("\n\n"); } else { if (!isOpen) { isOpen=true; str.append(".comment\n"); } str.append(line).append("\n"); } } if (isOpen) str.append(".endc\n"); break; } carets.add(start, str.length(), lastMem, Type.BLOCK_COMMENT); } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { } /** Enum for direction of blocks in memory */ enum Dir {NONE, UPDN, DNUP}; /** Enum for char block type */ enum Chars {NONE(0, 0), MONO(11, 7), MULTI(12, 7); public int left; public int right; Chars(int left, int right) { this.left=left; this.right=right; } }; /** Enum for sprite block type */ enum Sprites {NONE(0, 0), MONO(13, 7), MULTI(14, 7); public int left; public int right; Sprites(int left, int right) { this.left=left; this.right=right; } }; /** * Get the line or macro explosion * Possible macro: * <ul> * <li>[<CHAR#MONO#NxM#UPDN>]</li> * <li>[<CHAR#MONO#NxM#DNUP>]</li> * <li>[<CHAR#MULTI#NxM#UPDN>]</li> * <li>[<CHAR#MULTI#NxM#DNUP>]</li> * <li>[<SPRITE#MONO#NxM#UPDN>]</li> * <li>[<SPRITE#MONO#NxM#DNUP>] </li> * <li>[<SPRITE#MULTI#NxM#UPDN>]</li> * <li>[<SPRITE#MULTI#NxM#DNUP>]</li> * </ul> * * @param line the line to process * * @return the line or macro explosion */ private String getMacro(String line) { Dir dir; Chars chars=Chars.NONE; Sprites sprites=Sprites.NONE; String uline=line.toUpperCase(); // search for macro ending if (uline.endsWith("#UPDN>]")) dir=Dir.UPDN; else if (uline.endsWith("#DNUP>]")) dir=Dir.DNUP; else return line; // look for chars if (uline.startsWith("[<CHAR#MONO#")) chars=Chars.MONO; if (uline.startsWith("[<CHAR#MULTI#")) chars=Chars.MULTI; // look for sprites if (uline.startsWith("[<SPRITE#MONO#")) sprites=Sprites.MONO; if (uline.startsWith("[<SPRITE#MULTI#")) sprites=sprites.MULTI; if (chars==Chars.NONE && sprites==Sprites.NONE) return line; //determine the NxM size String body=""; if (chars!=Chars.NONE) body=uline.substring(chars.left+1, uline.length()-chars.right).trim(); if (sprites!=Sprites.NONE) body=uline.substring(sprites.left+1, uline.length()-sprites.right).trim(); int pos=body.indexOf("X"); if (pos<=0) return line; int left=0; int right=0; try { left=Integer.parseInt(body.substring(0, pos)); right=Integer.parseInt(body.substring(pos+1)); } catch (Exception e) { return line; } if (left==0 || right==0) return line; StringBuffer buf=new StringBuffer(); // abort if users try to force to go ovet the actual memory try { //lastMem.address if (chars!=Chars.NONE) { // up to dx, then sx dn if (dir==Dir.UPDN) { for (int r=0; r<right; r++) { for (int i=0; i<8; i++) { buf.append(" "); for (int c=0; c<left; c++) { if (chars==Chars.MONO) buf.append(BinToMono(Integer.toBinaryString((memory[lastMem.address+8*(r*left+c)+i].copy & 0xFF) + 0x100).substring(1))); else buf.append(BinToMulti(Integer.toBinaryString((memory[lastMem.address+8*(r*left+c)+i].copy & 0xFF) + 0x100).substring(1))); } buf.append("\n"); } } } else { // dir is now sx to dn, then up to dx for (int r=0; r<right; r++) { for (int i=0; i<8; i++) { buf.append(" "); for (int c=0; c<left; c++) { if (chars==Chars.MONO) buf.append(BinToMono(Integer.toBinaryString((memory[lastMem.address+8*(c*right+r)+i].copy & 0xFF) + 0x100).substring(1))); else buf.append(BinToMulti(Integer.toBinaryString((memory[lastMem.address+8*(c*right+r)+i].copy & 0xFF) + 0x100).substring(1))); } buf.append("\n"); } } } return buf.toString(); } if (sprites!=Sprites.NONE) { // up to dx, then sx dn if (dir==Dir.UPDN) { for (int r=0; r<right; r++) { for (int i=0; i<21; i++) { buf.append(" "); for (int c=0; c<left; c++) { if (sprites==Sprites.MONO) { buf.append(BinToMono(Integer.toBinaryString((memory[lastMem.address+64*(r*left+c)+(i*3)].copy & 0xFF) + 0x100).substring(1))); buf.append(BinToMono(Integer.toBinaryString((memory[lastMem.address+64*(r*left+c)+(i*3)+1].copy & 0xFF) + 0x100).substring(1))); buf.append(BinToMono(Integer.toBinaryString((memory[lastMem.address+64*(r*left+c)+(i*3)+2].copy & 0xFF) + 0x100).substring(1))); } else { buf.append(BinToMulti(Integer.toBinaryString((memory[lastMem.address+64*(r*left+c)+(i*3)].copy & 0xFF) + 0x100).substring(1))); buf.append(BinToMulti(Integer.toBinaryString((memory[lastMem.address+64*(r*left+c)+(i*3)+1].copy & 0xFF) + 0x100).substring(1))); buf.append(BinToMulti(Integer.toBinaryString((memory[lastMem.address+64*(r*left+c)+(i*3)+2].copy & 0xFF) + 0x100).substring(1))); } } buf.append("\n"); } } } else { // dir is now sx to dn, then up to dx for (int r=0; r<right; r++) { for (int i=0; i<21; i++) { buf.append(" "); for (int c=0; c<left; c++) { if (sprites==Sprites.MONO) { buf.append(BinToMono(Integer.toBinaryString((memory[lastMem.address+64*(c*right+r)+(i*3)].copy & 0xFF) + 0x100).substring(1))); buf.append(BinToMono(Integer.toBinaryString((memory[lastMem.address+64*(c*right+r)+(i*3)+1].copy & 0xFF) + 0x100).substring(1))); buf.append(BinToMono(Integer.toBinaryString((memory[lastMem.address+64*(c*right+r)+(i*3)+2].copy & 0xFF) + 0x100).substring(1))); } else { buf.append(BinToMulti(Integer.toBinaryString((memory[lastMem.address+64*(c*right+r)+(i*3)].copy & 0xFF) + 0x100).substring(1))); buf.append(BinToMulti(Integer.toBinaryString((memory[lastMem.address+64*(c*right+r)+(i*3)+1].copy & 0xFF) + 0x100).substring(1))); buf.append(BinToMulti(Integer.toBinaryString((memory[lastMem.address+64*(c*right+r)+(i*3)+2].copy & 0xFF) + 0x100).substring(1))); } } buf.append("\n"); } } } return buf.toString(); } } catch (Exception e) { return line; } return line; } } /** * Byte declaration type * -> .byte $xx * -> .char $xx * -> byte $xx * -> dc $xx * -> dc.b $xx * -> .by $xx * -> -byt $xx * -> !byte $xx * -> !8 $xx * -> !08 $xx */ public enum Byte implements ActionType { DOT_BYTE, // .byte $xx DOT_CHAR, // .char $xx BYTE, // byte $xx DC_BYTE, // dc $xx DC_B_BYTE, // dc.b $xx DOT_BYT_BYTE, // .byt $xx DOT_BY_BYTE, // .by $xx MARK_BYTE, // !byte $xx MARK_BY_BYTE, // !by $xx EIGHT_BYTE, // !8 $xx ZEROEIGHT_BYTE, // !08 $xx DB_BYTE, // db $xx DB_BYTE_H; // db xxh BasicDetokenize basicList=new BasicDetokenize(); /** * Clear the BASIC list */ public void clearBasic() { basicList.clear(); } @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; MemoryDasm mem; MemoryDasm memRel; MemoryDasm memRel2; MemoryDasm memBase; MemoryDasm memDest; int initial=str.length(); int start=initial; // create starting command according to the kind of byte switch (aByte) { case DOT_BYTE: case DB_BYTE_H: str.append(getDataSpacesTabs()).append((".byte ")); break; case DOT_CHAR: str.append(getDataSpacesTabs()).append((".char ")); break; case DOT_BY_BYTE: str.append(getDataSpacesTabs()).append((".by ")); break; case BYTE: str.append(getDataSpacesTabs()).append(("byte ")); break; case DC_BYTE: str.append(getDataSpacesTabs()).append(("dc ")); break; case DC_B_BYTE: str.append(getDataSpacesTabs()).append(("dc.b ")); break; case MARK_BY_BYTE: str.append(getDataSpacesTabs()).append(("!by ")); break; case DOT_BYT_BYTE: str.append(getDataSpacesTabs()).append((".byt ")); break; case MARK_BYTE: str.append(getDataSpacesTabs()).append(("!byte ")); break; case EIGHT_BYTE: str.append(getDataSpacesTabs()).append(("!8 ")); break; case ZEROEIGHT_BYTE: str.append(getDataSpacesTabs()).append(("!08 ")); break; case DB_BYTE: str.append(getDataSpacesTabs()).append(("db ")); break; } Iterator<MemoryDasm> iter=list.iterator(); while (iter.hasNext()) { // accodate each bytes in the format choosed mem=iter.next(); memRel=listRel.pop(); memRel2=listRel2.pop(); memBase=listBase.pop(); memDest=listDest.pop(); if (mem.type==TYPE_MINOR || mem.type==TYPE_MAJOR || mem.type==TYPE_PLUS_MAJOR || mem.type==TYPE_PLUS_MINOR || mem.type==TYPE_MINUS_MAJOR || mem.type==TYPE_MINUS_MINOR) { char type; // add a automatic label onto references byte if (memRel.dasmLocation==null || "".equals(memRel.dasmLocation)) { memRel.dasmLocation="W"+ShortToExe(memRel.address); } switch (mem.type) { case TYPE_PLUS_MAJOR: case TYPE_MINUS_MAJOR: type=TYPE_MAJOR; break; case TYPE_PLUS_MINOR: case TYPE_MINUS_MINOR: type=TYPE_MINOR; break; default: type=mem.type; break; } if (memRel2!=null) { switch (memRel.type) { case TYPE_PLUS: /// this is a memory in table label int rel=memRel.related; int pos=memRel.address-memRel.related; str.append(getLocationPos(mem, memBase, memDest, memRel2, rel, pos, type)); break; case TYPE_PLUS_MAJOR: case TYPE_PLUS_MINOR: /// this is a memory in table label rel=(memRel.related>>16) & 0xFFFF; pos=memRel.address-rel; str.append(getLocationPos(mem, memBase, memDest, memRel2, rel, pos, type)); break; case TYPE_MINUS_MAJOR: case TYPE_MINUS_MINOR: /// this is a memory in table label rel=(memRel.related>>16) & 0xFFFF; pos=memRel.address-rel; str.append(getLocationNeg(mem, memBase, memDest, memRel2, rel, pos, type)); break; case TYPE_MINUS: /// this is a memory in table label rel=memRel.related; pos=memRel.address-memRel.related; str.append(getLocationNeg(mem, memBase, memDest, memRel2, rel, pos, type)); break; default: str.append(getLocation(mem, memBase, memDest, memRel, type)); break; } } else str.append(getLocation(mem, memBase, memDest, memRel, type)); } else str.append(getByteType(mem.dataType, mem.copy, mem.index)); carets.add(start, str.length(), mem, Type.BYTE); if (!listRel.isEmpty()) str.append(", "); else { if (mem.dasmLocation==null && mem.userLocation==null) { str.append(getDataCSpacesTabs(str.length()-initial-getDataSpacesTabs().length())); MemoryDasm tmp=lastMem; lastMem=mem; aComment.flush(str); lastMem=tmp; } else str.append("\n"); } start=str.length(); } list.clear(); } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if (list.size()==option.maxByteAggregate) flush(str); if (mem.basicType!=BasicType.NONE) { basicList.add(mem.copy); if (basicList.isComplete()) mem.dasmComment=basicList.detokenizedCommand(mem.basicType); } else { basicList.clear(); } if (mem.dasmLocation==null && mem.userLocation==null) { // look for comment inside String comment=lastMem.dasmComment; if (lastMem.userComment != null) comment=lastMem.userComment; if (!(comment==null || "".equals(comment))) flush(str); } } /** * Get the right type representation for M6502 or Z80 representation * In M6502: <xx, >xx * In Z80: xx, xx>>8 * * @param type the type to valuate * @param value the value * @return the right type value */ private String getRightType(char type, String value) { // add () if there are relative address to avoid compilation errors like in Dasm if (value.contains("+") || value.contains("-")) value="("+value+")"; switch (aByte) { case DB_BYTE: if (type==TYPE_MINOR) return value; else return value+">>8"; default: return type+value; } } /** * Get the location (positive) * * @param mem the memory location * @param memBase the base memory location * @param memDest the destination memory location * @param memRel the memory relative location * @param rel the rel address * @param pos the position offset * @param type the type * @return the string of the location */ private String getLocationPos(MemoryDasm mem, MemoryDasm memBase, MemoryDasm memDest, MemoryDasm memRel, int rel, int pos, char type) { boolean defaultMode=(aByte!=DB_BYTE_H); if (mem.relatedAddressBase+mem.relatedAddressDest !=0) { String base; String dest; if (memBase.userLocation!=null && !"".equals(memBase.userLocation)) base=memBase.userLocation; else if (memBase.dasmLocation!=null && !"".equals(memBase.dasmLocation)) base=memBase.dasmLocation; else base=HexNum(ShortToExe(memBase.address), defaultMode); if (memDest.userLocation!=null && !"".equals(memDest.userLocation)) dest=memDest.userLocation; else if (memDest.dasmLocation!=null && !"".equals(memDest.dasmLocation)) dest=memDest.dasmLocation; else dest=HexNum(ShortToExe(memDest.address), defaultMode); if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return getRightType(type, base+"-"+dest+"+"+memRel.userLocation+"+"+pos); else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return getRightType(type, base+"-"+dest+"+"+memRel.dasmLocation+"+"+pos); else return getRightType(type,base+"-"+dest+"+"+ HexNum(ShortToExe(memRel.address), defaultMode)+"+"+pos); } else { if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return getRightType(type, memRel.userLocation+"+"+pos); else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return getRightType(type, memRel.dasmLocation+"+"+pos); else return getRightType(type,HexNum(ShortToExe(rel), defaultMode)+"+"+pos); } } /** * Get the location (negative) * * @param mem the memory location * @param memBase the base memory location * @param memDest the destination memory location * @param memRel the memory relative location * @param rel the rel address * @param pos the position offset * @param type the type * @return the string of the location */ private String getLocationNeg(MemoryDasm mem, MemoryDasm memBase, MemoryDasm memDest, MemoryDasm memRel, int rel, int pos, char type) { boolean defaultMode=(aByte!=DB_BYTE_H); if (mem.relatedAddressBase+mem.relatedAddressDest !=0) { String base; String dest; if (memBase.userLocation!=null && !"".equals(memBase.userLocation)) base=memBase.userLocation; else if (memBase.dasmLocation!=null && !"".equals(memBase.dasmLocation)) base=memBase.dasmLocation; else base=HexNum(ShortToExe(memBase.address), defaultMode); if (memDest.userLocation!=null && !"".equals(memDest.userLocation)) dest=memDest.userLocation; else if (memDest.dasmLocation!=null && !"".equals(memDest.dasmLocation)) dest=memDest.dasmLocation; else dest=HexNum(ShortToExe(memDest.address), defaultMode); if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return getRightType(type, base+"-"+dest+"+"+memRel.userLocation+pos); else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return getRightType(type, base+"-"+dest+"+"+memRel.dasmLocation+pos); else return getRightType(type,base+"-"+dest+"+"+ HexNum(ShortToExe(memRel.address), defaultMode)+pos); } else { if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return getRightType(type, memRel.userLocation+pos); else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return getRightType(type, memRel.dasmLocation+pos); else return getRightType(type, HexNum(ShortToExe(rel), defaultMode)+pos); } } /** * Get the location * * @param mem the memory location * @param memBase the base memory location * @param memDest the destination memory location * @param memRel the memory relative location * @param type the type * @return */ private String getLocation(MemoryDasm mem, MemoryDasm memBase, MemoryDasm memDest, MemoryDasm memRel, char type) { boolean defaultMode=(aByte!=DB_BYTE_H); if (mem.relatedAddressBase+mem.relatedAddressDest !=0) { String base; String dest; if (memBase.userLocation!=null && !"".equals(memBase.userLocation)) base=memBase.userLocation; else if (memBase.dasmLocation!=null && !"".equals(memBase.dasmLocation)) base=memBase.dasmLocation; else base=HexNum(ShortToExe(memBase.address), defaultMode); if (memDest.userLocation!=null && !"".equals(memDest.userLocation)) dest=memDest.userLocation; else if (memDest.dasmLocation!=null && !"".equals(memDest.dasmLocation)) dest=memDest.dasmLocation; else dest=HexNum(ShortToExe(memDest.address), defaultMode); if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return getRightType(type, base+"-"+dest+"+"+memRel.userLocation); else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return getRightType(type, base+"-"+dest+"+"+memRel.dasmLocation); else return getRightType(type,base+"-"+dest+"+"+ HexNum(ShortToExe(memRel.address), defaultMode)); } else { if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return getRightType(type, memRel.userLocation); else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return getRightType(type, memRel.dasmLocation); else return getRightType(type, HexNum(ShortToExe(memRel.address), defaultMode)); } } /** * Return the byte represented as by the given type * * @param dataType the type to use * @param value the byte value * @param index the index of constant * @return the converted string */ private String getByteType(DataType dataType, byte value, byte index) { boolean defaultMode=(aByte!=DB_BYTE_H); if (aByte==DOT_CHAR && value<0) { switch (dataType) { case BYTE_DEC: return "-"+Math.abs(value); case BYTE_BIN: return "-"+BinNum(Integer.toBinaryString((Math.abs(value) & 0xFF) + 0x100).substring(1), defaultMode); case BYTE_CHAR: //return "\""+(char)Unsigned.done(value)+"\""; return "-'"+(char)Math.abs(value); case BYTE_HEX: default: return "-"+HexNum(ByteToExe(Math.abs(value)), defaultMode); } } else { if (index!=-1) { String res=constant.table[index][value & 0xFF]; if (res!=null && !"".equals(res)) return res; } switch (dataType) { case BYTE_DEC: return ""+Unsigned.done(value); case BYTE_BIN: return BinNum(Integer.toBinaryString((value & 0xFF) + 0x100).substring(1), defaultMode); case BYTE_CHAR: int val=(value & 0xFF); switch (option.assembler) { case DASM: if ( (!option.allowUtf && (val<0x20 || val==0x22 || (val>127))) || (option.allowUtf && ((val==0x00) || (val==0x0A) || (val==0x22) || (val>127))) ) return HexNum(ByteToExe(Unsigned.done(value)), defaultMode); else return "'"+(char)Unsigned.done(value); case TMPX: if ( (!option.allowUtf && (val<=0x19) || (val==0x22) || (val>127)) || (option.allowUtf && ((val==0x08) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) return HexNum(ByteToExe(Unsigned.done(value)), defaultMode); else return "'"+(char)Unsigned.done(value); case CA65: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x22) || (val>127))) ) return HexNum(ByteToExe(Unsigned.done(value)), defaultMode); else if (val>=0x20) return "'"+(char)Unsigned.done(value)+"'"; else return "\""+(char)Unsigned.done(value)+"\""; case ACME: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ( (val==0x00) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) return HexNum(ByteToExe(Unsigned.done(value)), defaultMode); else if (val==0x27 || val==0x5C) return "'\\"+(char)Unsigned.done(value)+"'"; else return "'"+(char)Unsigned.done(value)+"'"; case KICK: if (!option.allowUtf && (val<=0x1F || val>=0x80)) return HexNum(ByteToExe(Unsigned.done(value)), defaultMode); if (val==0x0A || (val>=0x0C && val<=0x0F) || val==0x040 || val==0x05B || val==0x05D || (val>=0x61 && val<=0x7A) || val==0x7F || val==0xA0 || val==0xA3 ) return HexNum(ByteToExe(Unsigned.done(value)), defaultMode); else return "'"+(char)Unsigned.done(value)+"'"; case TASS64: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) return HexNum(ByteToExe(Unsigned.done(value)), defaultMode); else return "\""+(char)Unsigned.done(value)+"\""; default: return "'"+(char)Unsigned.done(value); } case BYTE_HEX: default: return HexNum(ByteToExe(Unsigned.done(value)), defaultMode); } } } } /** * Word declaration type * -> .word $xxyy * -> .wo $xxyy * -> .sint $xxyy * -> word $xxyy * -> dc.w $xxyy * -> .dbyte $xxyy * -> !word $xxyy * -> !16 $xxyy * -> dw $xxyy * -> dw xxyyh */ public enum Word implements ActionType { DOT_WORD, // .word $xxyy DOT_WO_WORD, // .wo $xxyy DOT_SINT, // .sint $xxyy WORD, // word $xxyy DC_W_WORD, // dc.w $xxyy DOT_DBYTE, // .dbyte $xxyy MARK_WORD, // !word $xxyy SIXTEEN_WORD, // !16 $xxyy DW_WORD, // dw $xxyy DW_WORD_H; // dw xxyyh @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; MemoryDasm memLow; MemoryDasm memHigh; MemoryDasm memRelLow; MemoryDasm memRelHigh; MemoryDasm memRel2Low; MemoryDasm memRel2High; MemoryDasm memBaseLo; MemoryDasm memBaseHi; MemoryDasm memDestLo; MemoryDasm memDestHi; int pos1=str.length(); // store initial position int start=pos1; // create starting command according to the kind of byte switch (aWord) { case DOT_WORD: str.append(getDataSpacesTabs()).append((".word ")); break; case DOT_WO_WORD: str.append(getDataSpacesTabs()).append((".wo ")); break; case DOT_SINT: str.append(getDataSpacesTabs()).append((".sint ")); break; case WORD: str.append(getDataSpacesTabs()).append(("word ")); break; case DC_W_WORD: str.append(getDataSpacesTabs()).append(("dc.w ")); break; case DOT_DBYTE: str.append(getDataSpacesTabs()).append((".dbyte ")); break; case MARK_WORD: str.append(getDataSpacesTabs()).append(("!word ")); break; case SIXTEEN_WORD: str.append(getDataSpacesTabs()).append(("!16 ")); break; case DW_WORD: case DW_WORD_H: str.append(getDataSpacesTabs()).append(("dw ")); break; } int pos2=str.length(); // store final position boolean isFirst=true; // true if this is the first output while (!list.isEmpty()) { // if only 1 byte left, use byte coding if (list.size()==1) { if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } aByte.flush(str); } else { memLow=list.pop(); memRelLow=listRel.pop(); memRel2Low=listRel2.pop(); memBaseLo=listBase.pop(); memDestLo=listDest.pop(); memHigh=list.pop(); memRelHigh=listRel.pop(); memRel2High=listRel2.pop(); memBaseHi=listBase.pop(); memDestHi=listDest.pop(); if (( ((memLow.type==TYPE_MINOR || memLow.type==TYPE_PLUS_MINOR) && (memHigh.type==TYPE_MAJOR || memHigh.type==TYPE_PLUS_MAJOR)) || ((memLow.type==TYPE_MINOR || memLow.type==TYPE_MINUS_MINOR) && (memHigh.type==TYPE_MAJOR || memHigh.type==TYPE_MINUS_MAJOR)) ) && (memLow.related & 0xFFFF)==(memHigh.related & 0xFFFF)) { if (memRel2Low!=null) { switch (memRelLow.type) { case TYPE_PLUS: /// this is a memory in table label int rel=memRelLow.related; int pos=memRelLow.address-memRelLow.related; str.append(getLocationPos(memLow, memBaseLo, memDestLo, memRel2Low, rel, pos)); break; case TYPE_PLUS_MAJOR: case TYPE_PLUS_MINOR: /// this is a memory in table label rel=(memRelLow.related>>16) & 0xFFFF; pos=memRelLow.address-rel; str.append(getLocationPos(memLow, memBaseLo, memDestLo, memRel2Low, rel, pos)); break; case TYPE_MINUS_MAJOR: case TYPE_MINUS_MINOR: /// this is a memory in table label rel=(memRelLow.related>>16) & 0xFFFF; pos=memRelLow.address-rel; str.append(getLocationNeg(memLow, memBaseLo, memDestLo, memRel2Low, rel, pos)); break; case TYPE_MINUS: /// this is a memory in table label rel=memRelLow.related; pos=memRelLow.address-memRelLow.related; str.append(getLocationNeg(memLow, memBaseLo, memDestLo, memRel2Low, rel, pos)); break; default: str.append(getLocation(memLow, memBaseLo, memDestLo, memRelLow)); break; } } else { if (memRelLow.dasmLocation==null || "".equals(memRelLow.dasmLocation)) { memRelLow.dasmLocation="W"+ShortToExe(memRelLow.address); } str.append(getLocation(memLow, memBaseLo, memDestLo, memRelLow)); } isFirst=false; } else { // if cannot make a word with relative locations, force all to be of byte type if (memLow.type==TYPE_MINOR || memLow.type==TYPE_MAJOR || memLow.type==TYPE_PLUS_MAJOR || memLow.type==TYPE_PLUS_MINOR || memLow.type==TYPE_MINUS_MAJOR || memLow.type==TYPE_MINUS_MINOR || memHigh.type==TYPE_MINOR || memHigh.type==TYPE_MAJOR || memHigh.type==TYPE_PLUS_MAJOR || memHigh.type==TYPE_PLUS_MINOR || memHigh.type==TYPE_MINUS_MAJOR || memHigh.type==TYPE_MINUS_MINOR ) { list.addFirst(memHigh); list.addFirst(memLow); listRel.addFirst(memRelHigh); listRel.addFirst(memRelLow); listRel2.addFirst(null); listRel2.addFirst(null); listBase.addFirst(null); listBase.addFirst(null); listDest.addFirst(null); listDest.addFirst(null); if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } aByte.flush(str); } else { if (aWord==DOT_SINT && memHigh.copy<0) str.append("-$").append(ByteToExe(Math.abs(memHigh.copy))).append(ByteToExe(Unsigned.done(memLow.copy))); else { boolean defaultMode=(aWord!=DW_WORD_H); // look for constant if (memLow.index!=-1 && memHigh.index!=-1 && memLow.index==memHigh.index) { String res=constant.table[memLow.index][(memLow.copy & 0xFF) + ((memHigh.copy & 0xFF)<<8)]; if (res!=null && !"".equals(res)) str.append(res); else str.append( HexNum(ByteToExe(Unsigned.done(memHigh.copy))+ByteToExe(Unsigned.done(memLow.copy)), defaultMode) ); } else str.append( HexNum(ByteToExe(Unsigned.done(memHigh.copy))+ByteToExe(Unsigned.done(memLow.copy)), defaultMode) ); } isFirst=false; } } carets.add(start, str.length(), memLow, Type.WORD); if (list.size()>=2) str.append(", "); else { if (memHigh.dasmLocation==null && memHigh.userLocation==null) { str.append(getDataCSpacesTabs(str.length()-pos1-getDataSpacesTabs().length())); MemoryDasm tmp=lastMem; lastMem=memHigh; aComment.flush(str); lastMem=tmp; } else str.append("\n"); } start=str.length(); } } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if (list.size()==option.maxWordAggregate*2) flush(str); if (mem.dasmLocation==null && mem.userLocation==null) { // look for comment inside String comment=lastMem.dasmComment; if (lastMem.userComment != null) comment=lastMem.userComment; if (!(comment==null || "".equals(comment))) flush(str); } } /** * Get location (positive) * @param mem the memory location * @param memBase the base memory location * @param memDest the destination memory location * @param memRel the memory location relative * @param rel the relative position * @param pos the offset position * @return the location */ private String getLocationPos(MemoryDasm mem, MemoryDasm memBase, MemoryDasm memDest, MemoryDasm memRel, int rel, int pos) { boolean defaultMode=(aWord!=DW_WORD_H); if (mem.relatedAddressBase+mem.relatedAddressDest !=0) { String base; String dest; if (memBase.userLocation!=null && !"".equals(memBase.userLocation)) base=memBase.userLocation; else if (memBase.dasmLocation!=null && !"".equals(memBase.dasmLocation)) base=memBase.dasmLocation; else base=HexNum(ShortToExe(memBase.address), defaultMode); if (memDest.userLocation!=null && !"".equals(memDest.userLocation)) dest=memDest.userLocation; else if (memDest.dasmLocation!=null && !"".equals(memDest.dasmLocation)) dest=memDest.dasmLocation; else dest=HexNum(ShortToExe(memDest.address), defaultMode); if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return base+"-"+dest+"+"+memRel.userLocation+"+"+pos; else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return base+"-"+dest+"+"+memRel.dasmLocation+"+"+pos; else return base+"-"+dest+"+"+ HexNum(ShortToExe(memRel.address), defaultMode)+"+"+pos; } else { if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return memRel.userLocation+"+"+pos; else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return memRel.dasmLocation+"+"+pos; else return HexNum(ShortToExe(rel), defaultMode)+"+"+pos; } } /** * Get location (negative) * * @param mem the memory location * @param memBase the base memory location * @param memDest the destination memory location * @param memRel the memory location relative * @param rel the relative position * @param pos the offset position * @return the location */ private String getLocationNeg(MemoryDasm mem, MemoryDasm memBase, MemoryDasm memDest, MemoryDasm memRel, int rel, int pos) { boolean defaultMode=(aWord!=DW_WORD_H); if (mem.relatedAddressBase+mem.relatedAddressDest !=0) { String base; String dest; if (memBase.userLocation!=null && !"".equals(memBase.userLocation)) base=memBase.userLocation; else if (memBase.dasmLocation!=null && !"".equals(memBase.dasmLocation)) base=memBase.dasmLocation; else base=HexNum(ShortToExe(memBase.address), defaultMode); if (memDest.userLocation!=null && !"".equals(memDest.userLocation)) dest=memDest.userLocation; else if (memDest.dasmLocation!=null && !"".equals(memDest.dasmLocation)) dest=memDest.dasmLocation; else dest=HexNum(ShortToExe(memDest.address), defaultMode); if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return base+"-"+dest+"+"+memRel.userLocation+pos; else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return base+"-"+dest+"+"+memRel.dasmLocation+pos; else return base+"-"+dest+"+"+ HexNum(ShortToExe(memRel.address), defaultMode)+pos; } else { if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return memRel.userLocation+pos; else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return memRel.dasmLocation+pos; else return HexNum(ShortToExe(rel), defaultMode)+pos; } } /** * Get the location * * @param mem the memory location * @param memBase the base memory location * @param memDest the destination memory location * @param memRel the memory relative location * @return the location */ private String getLocation(MemoryDasm mem, MemoryDasm memBase, MemoryDasm memDest, MemoryDasm memRel) { boolean defaultMode=(aWord!=DW_WORD_H); if (mem.relatedAddressBase+mem.relatedAddressDest !=0) { String base; String dest; if (memBase.userLocation!=null && !"".equals(memBase.userLocation)) base=memBase.userLocation; else if (memBase.dasmLocation!=null && !"".equals(memBase.dasmLocation)) base=memBase.dasmLocation; else base=HexNum(ShortToExe(memBase.address), defaultMode); if (memDest.userLocation!=null && !"".equals(memDest.userLocation)) dest=memDest.userLocation; else if (memDest.dasmLocation!=null && !"".equals(memDest.dasmLocation)) dest=memDest.dasmLocation; else dest=HexNum(ShortToExe(memDest.address), defaultMode); if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return base+"-"+dest+"+"+memRel.userLocation; else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return base+"-"+dest+"+"+memRel.dasmLocation; else return base+"-"+dest+"+"+ HexNum(ShortToExe(memRel.address), defaultMode); } else { if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return memRel.userLocation; else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return memRel.dasmLocation; else return HexNum(ShortToExe(memRel.address), defaultMode); } } } /** * Word swapped declaration type * -> dc.s $yyxx * -> .dtyb $yyxx * -> [.mac] $yyxx */ public enum WordSwapped implements ActionType { DC_DOT_S_WORD_SWAPPED, // dc.s $yyxx DOT_DTYB, // .dtyb $yyxx MACRO1_WORD_SWAPPED, // [.mac] $yyxx (KickAssembler) MACRO2_WORD_SWAPPED, // [.mac] $yyxx (Acme) MACRO4_WORD_SWAPPED, // [.mac] $yyxx (TMPx / Tass64) MACRO5_WORD_SWAPPED, // [.amc] $yyxx (Glass) MACRO6_WORD_SWAPPED, // [macro] $yyxx (AS) ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; MemoryDasm memLow; MemoryDasm memHigh; MemoryDasm memRelLow; MemoryDasm memRelHigh; // we have a min of 1 or a max of 8 word swapped, so use the right call for macro int index=(int)(list.size()/2); int pos1=str.length(); // store initial position int start=pos1; // create starting command according to the kind of byte switch (aWordSwapped) { case DC_DOT_S_WORD_SWAPPED: str.append(getDataSpacesTabs()).append("dc.s "); break; case DOT_DTYB: str.append(getDataSpacesTabs()).append(".dtyb "); break; case MACRO1_WORD_SWAPPED: str.append(getDataSpacesTabs()).append("Swapped").append(index).append("("); // must close the ) break; case MACRO2_WORD_SWAPPED: str.append(getDataSpacesTabs()).append("+Swapped").append(index).append(" "); break; case MACRO4_WORD_SWAPPED: str.append(getDataSpacesTabs()).append("#Swapped").append(index).append(" "); break; case MACRO5_WORD_SWAPPED: case MACRO6_WORD_SWAPPED: str.append(getDataSpacesTabs()).append("Swapped").append(index).append(" "); break; } int pos2=str.length(); // store final position boolean isFirst=true; // true if this is the first output // we use byte, so check for his default mode boolean defaultMode=(aByte!=DB_BYTE_H); while (!list.isEmpty()) { // if only 1 byte left, use byte coding if (list.size()==1) { if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } aByte.flush(str); } else { memLow=list.pop(); memRelLow=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); memHigh=list.pop(); memRelHigh=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); if (( ((memLow.type==TYPE_MINOR || memLow.type==TYPE_PLUS_MINOR) && (memHigh.type==TYPE_MAJOR || memHigh.type==TYPE_PLUS_MAJOR)) || ((memLow.type==TYPE_MINOR || memLow.type==TYPE_MINUS_MINOR) && (memHigh.type==TYPE_MAJOR || memHigh.type==TYPE_MINUS_MAJOR)) ) && (memLow.related & 0xFFFF)==(memHigh.related & 0xFFFF)) { if (memRelLow.userLocation!=null && !"".equals(memRelLow.userLocation)) str.append(memRelLow.userLocation); else if (memRelLow.dasmLocation!=null && !"".equals(memRelLow.dasmLocation)) str.append(memRelLow.dasmLocation); else str.append(HexNum(ShortToExe(memRelLow.address), defaultMode)); isFirst=false; } else { // if cannot make a word with relative locations, force all to be of byte type if (memLow.type==TYPE_MINOR || memLow.type==TYPE_MAJOR || memLow.type==TYPE_PLUS_MAJOR || memLow.type==TYPE_PLUS_MINOR || memLow.type==TYPE_MINUS_MAJOR || memLow.type==TYPE_MINUS_MINOR || memHigh.type==TYPE_MINOR || memHigh.type==TYPE_MAJOR || memHigh.type==TYPE_PLUS_MAJOR || memHigh.type==TYPE_PLUS_MINOR || memHigh.type==TYPE_MINUS_MAJOR || memHigh.type==TYPE_MINUS_MINOR) { list.addFirst(memHigh); list.addFirst(memLow); listRel.addFirst(memRelHigh); listRel.addFirst(memRelLow); listRel2.addFirst(null); listRel2.addFirst(null); listBase.addFirst(null); listBase.addFirst(null); listDest.addFirst(null); listDest.addFirst(null); if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } aByte.flush(str); } else { str.append(HexNum(ByteToExe(Unsigned.done(memLow.copy))+ByteToExe(Unsigned.done(memHigh.copy)), defaultMode)); isFirst=false; } } carets.add(start, str.length(), memLow, Type.WORD_SWAPPED); if (list.size()>=2) str.append(", "); else { if (memHigh.dasmLocation==null && memHigh.userLocation==null) { str.append(getDataCSpacesTabs(str.length()-pos1-getDataSpacesTabs().length())); MemoryDasm tmp=lastMem; lastMem=memHigh; aComment.flush(str); lastMem=tmp; } else if (aWordSwapped==MACRO1_WORD_SWAPPED) str.append(")\n"); else str.append("\n"); start=str.length(); } } } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if (list.size()==option.maxSwappedAggregate*2) flush(str); if (mem.dasmLocation==null && mem.userLocation==null) { // look for comment inside String comment=lastMem.dasmComment; if (lastMem.userComment != null) comment=lastMem.userComment; if (!(comment==null || "".equals(comment))) flush(str); } } @Override public void setting(StringBuilder str) { String spaces=getDataSpacesTabs(); switch (aWordSwapped) { case MACRO1_WORD_SWAPPED: str.append(spaces).append(".macro Swapped1 (twobyte) {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Swapped2 (twobyte, twobyte2) {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Swapped3 (twobyte, twobyte2, twobyte3) {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append(" .byte twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Swapped4 (twobyte, twobyte2, twobyte3, twobyte4) {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append(" .byte twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(spaces).append(" .byte twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Swapped5 (twobyte, twobyte2, twobyte3, twobyte4, twobyte5) {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append(" .byte twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(spaces).append(" .byte twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(spaces).append(" .byte twobyte5 & 255, ( twobyte5 >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Swapped6 (twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6) {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append(" .byte twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(spaces).append(" .byte twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(spaces).append(" .byte twobyte5 & 255, ( twobyte5 >> 8) & 255\n") .append(spaces).append(" .byte twobyte6 & 255, ( twobyte6 >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Swapped7 (twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7) {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append(" .byte twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(spaces).append(" .byte twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(spaces).append(" .byte twobyte5 & 255, ( twobyte5 >> 8) & 255\n") .append(spaces).append(" .byte twobyte6 & 255, ( twobyte6 >> 8) & 255\n") .append(spaces).append(" .byte twobyte7 & 255, ( twobyte7 >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Swapped8 (twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7, twobyte8) {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append(" .byte twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(spaces).append(" .byte twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(spaces).append(" .byte twobyte5 & 255, ( twobyte5 >> 8) & 255\n") .append(spaces).append(" .byte twobyte6 & 255, ( twobyte6 >> 8) & 255\n") .append(spaces).append(" .byte twobyte7 & 255, ( twobyte7 >> 8) & 255\n") .append(spaces).append(" .byte twobyte8 & 255, ( twobyte8 >> 8) & 255\n") .append(spaces).append("}\n\n"); break; case MACRO2_WORD_SWAPPED: str.append(spaces).append("!macro Swapped1 twobyte {\n") .append(spaces).append(" !byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Swapped2 twobyte, twobyte2 {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Swapped3 twobyte, twobyte2, twobyte3 {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append(" .byte twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Swapped4 twobyte, twobyte2, twobyte3, twobyte4 {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append(" .byte twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(spaces).append(" .byte twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Swapped5 twobyte, twobyte2, twobyte3, twobyte4, twobyte5 {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append(" .byte twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(spaces).append(" .byte twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(spaces).append(" .byte twobyte5 & 255, ( twobyte5 >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Swapped6 twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6 {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append(" .byte twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(spaces).append(" .byte twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(spaces).append(" .byte twobyte5 & 255, ( twobyte5 >> 8) & 255\n") .append(spaces).append(" .byte twobyte6 & 255, ( twobyte6 >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Swapped7 twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7 {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append(" .byte twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(spaces).append(" .byte twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(spaces).append(" .byte twobyte5 & 255, ( twobyte5 >> 8) & 255\n") .append(spaces).append(" .byte twobyte6 & 255, ( twobyte6 >> 8) & 255\n") .append(spaces).append(" .byte twobyte7 & 255, ( twobyte7 >> 8) & 255\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Swapped8 twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7, twobyte8 {\n") .append(spaces).append(" .byte twobyte & 255, ( twobyte >> 8) & 255\n") .append(spaces).append(" .byte twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(spaces).append(" .byte twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(spaces).append(" .byte twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(spaces).append(" .byte twobyte5 & 255, ( twobyte5 >> 8) & 255\n") .append(spaces).append(" .byte twobyte6 & 255, ( twobyte6 >> 8) & 255\n") .append(spaces).append(" .byte twobyte7 & 255, ( twobyte7 >> 8) & 255\n") .append(spaces).append(" .byte twobyte8 & 255, ( twobyte8 >> 8) & 255\n") .append(spaces).append("}\n\n"); break; case MACRO4_WORD_SWAPPED: str.append( "Swapped1 .macro \n" + " .byte \\1 & 255, ( \\1 >> 8) & 255\n" + " .endm\n\n"+ "Swapped2 .macro \n" + " .byte \\1 & 255, ( \\1 >> 8) & 255\n" + " .byte \\2 & 255, ( \\2 >> 8) & 255\n" + " .endm\n\n"+ "Swapped3 .macro \n" + " .byte \\1 & 255, ( \\1 >> 8) & 255\n" + " .byte \\2 & 255, ( \\2 >> 8) & 255\n" + " .byte \\3 & 255, ( \\3 >> 8) & 255\n" + " .endm\n\n"+ "Swapped4 .macro \n" + " .byte \\1 & 255, ( \\1 >> 8) & 255\n" + " .byte \\2 & 255, ( \\2 >> 8) & 255\n" + " .byte \\3 & 255, ( \\3 >> 8) & 255\n" + " .byte \\4 & 255, ( \\4 >> 8) & 255\n" + " .endm\n\n"+ "Swapped5 .macro \n" + " .byte \\1 & 255, ( \\1 >> 8) & 255\n" + " .byte \\2 & 255, ( \\2 >> 8) & 255\n" + " .byte \\3 & 255, ( \\3 >> 8) & 255\n" + " .byte \\4 & 255, ( \\4 >> 8) & 255\n" + " .byte \\5 & 255, ( \\5 >> 8) & 255\n" + " .endm\n\n"+ "Swapped6 .macro \n" + " .byte \\1 & 255, ( \\1 >> 8) & 255\n" + " .byte \\2 & 255, ( \\2 >> 8) & 255\n" + " .byte \\3 & 255, ( \\3 >> 8) & 255\n" + " .byte \\4 & 255, ( \\4 >> 8) & 255\n" + " .byte \\5 & 255, ( \\5 >> 8) & 255\n" + " .byte \\6 & 255, ( \\6 >> 8) & 255\n" + " .endm\n\n"+ "Swapped7 .macro \n" + " .byte \\1 & 255, ( \\1 >> 8) & 255\n" + " .byte \\2 & 255, ( \\2 >> 8) & 255\n" + " .byte \\3 & 255, ( \\3 >> 8) & 255\n" + " .byte \\4 & 255, ( \\4 >> 8) & 255\n" + " .byte \\5 & 255, ( \\5 >> 8) & 255\n" + " .byte \\6 & 255, ( \\6 >> 8) & 255\n" + " .byte \\7 & 255, ( \\7 >> 8) & 255\n" + " .endm\n\n"+ "Swapped8 .macro \n" + " .byte \\1 & 255, ( \\1 >> 8) & 255\n" + " .byte \\2 & 255, ( \\2 >> 8) & 255\n" + " .byte \\3 & 255, ( \\3 >> 8) & 255\n" + " .byte \\4 & 255, ( \\4 >> 8) & 255\n" + " .byte \\5 & 255, ( \\5 >> 8) & 255\n" + " .byte \\6 & 255, ( \\6 >> 8) & 255\n" + " .byte \\7 & 255, ( \\7 >> 8) & 255\n" + " .byte \\8 & 255, ( \\8 >> 8) & 255\n" + " .endm\n\n" ); break; case MACRO5_WORD_SWAPPED: str.append(spaces).append("Swapped1: macro ?twobyte \n") .append(spaces).append(" db ?twobyte & 255, ( ?twobyte >> 8) & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Swapped2: macro ?twobyte, ?twobyte2 \n") .append(spaces).append(" db ?twobyte & 255, ( ?twobyte >> 8) & 255\n") .append(spaces).append(" db ?twobyte2 & 255, ( ?twobyte2 >> 8) & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Swapped3: macro ?twobyte, ?twobyte2, ?twobyte3 \n") .append(spaces).append(" db ?twobyte & 255, ( ?twobyte >> 8) & 255\n") .append(spaces).append(" db ?twobyte2 & 255, ( ?twobyte2 >> 8) & 255\n") .append(spaces).append(" db ?twobyte3 & 255, ( ?twobyte3 >> 8) & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Swapped4: macro ?twobyte, ?twobyte2, ?twobyte3, ?twobyte4 \n") .append(spaces).append(" db ?twobyte & 255, ( ?twobyte >> 8) & 255\n") .append(spaces).append(" db ?twobyte2 & 255, ( ?twobyte2 >> 8) & 255\n") .append(spaces).append(" db ?twobyte3 & 255, ( ?twobyte3 >> 8) & 255\n") .append(spaces).append(" db ?twobyte4 & 255, ( ?twobyte4 >> 8) & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Swapped5: macro ?twobyte, ?twobyte2, ?twobyte3, ?twobyte4, ?twobyte5 \n") .append(spaces).append(" db ?twobyte & 255, ( ?twobyte >> 8) & 255\n") .append(spaces).append(" db ?twobyte2 & 255, ( ?twobyte2 >> 8) & 255\n") .append(spaces).append(" db ?twobyte3 & 255, ( ?twobyte3 >> 8) & 255\n") .append(spaces).append(" db ?twobyte4 & 255, ( ?twobyte4 >> 8) & 255\n") .append(spaces).append(" db ?twobyte5 & 255, ( ?twobyte5 >> 8) & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Swapped6: macro ?twobyte, ?twobyte2, ?twobyte3, ?twobyte4, ?twobyte5, ?twobyte6 \n") .append(spaces).append(" db ?twobyte & 255, ( ?twobyte >> 8) & 255\n") .append(spaces).append(" db ?twobyte2 & 255, ( ?twobyte2 >> 8) & 255\n") .append(spaces).append(" db ?twobyte3 & 255, ( ?twobyte3 >> 8) & 255\n") .append(spaces).append(" db ?twobyte4 & 255, ( ?twobyte4 >> 8) & 255\n") .append(spaces).append(" db ?twobyte5 & 255, ( ?twobyte5 >> 8) & 255\n") .append(spaces).append(" db ?twobyte6 & 255, ( ?twobyte6 >> 8) & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Swapped7: macro ?twobyte, ?twobyte2, ?twobyte3, ?twobyte4, ?twobyte5, ?twobyte6, ?twobyte7 \n") .append(spaces).append(" db ?twobyte & 255, ( ?twobyte >> 8) & 255\n") .append(spaces).append(" db ?twobyte2 & 255, ( ?twobyte2 >> 8) & 255\n") .append(spaces).append(" db ?twobyte3 & 255, ( ?twobyte3 >> 8) & 255\n") .append(spaces).append(" db ?twobyte4 & 255, ( ?twobyte4 >> 8) & 255\n") .append(spaces).append(" db ?twobyte5 & 255, ( ?twobyte5 >> 8) & 255\n") .append(spaces).append(" db ?twobyte6 & 255, ( ?twobyte6 >> 8) & 255\n") .append(spaces).append(" db ?twobyte7 & 255, ( ?twobyte7 >> 8) & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Swapped8: macro ?twobyte, ?twobyte2, ?twobyte3, ?twobyte4, ?twobyte5, ?twobyte6, ?twobyte7, ?twobyte8 \n") .append(spaces).append(" db ?twobyte & 255, ( ?twobyte >> 8) & 255\n") .append(spaces).append(" db ?twobyte2 & 255, ( ?twobyte2 >> 8) & 255\n") .append(spaces).append(" db ?twobyte3 & 255, ( ?twobyte3 >> 8) & 255\n") .append(spaces).append(" db ?twobyte4 & 255, ( ?twobyte4 >> 8) & 255\n") .append(spaces).append(" db ?twobyte5 & 255, ( ?twobyte5 >> 8) & 255\n") .append(spaces).append(" db ?twobyte6 & 255, ( ?twobyte6 >> 8) & 255\n") .append(spaces).append(" db ?twobyte7 & 255, ( ?twobyte7 >> 8) & 255\n") .append(spaces).append(" db ?twobyte8 & 255, ( ?twobyte8 >> 8) & 255\n") .append(spaces).append("endm\n\n"); break; case MACRO6_WORD_SWAPPED: str.append("Swapped1: macro twobyte \n") .append(" db twobyte & 255, ( twobyte >> 8) & 255\n") .append(" endm\n\n") .append("Swapped2: macro twobyte, twobyte2 \n") .append(" db twobyte & 255, ( twobyte >> 8) & 255\n") .append(" db twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(" endm\n\n") .append("Swapped3: macro twobyte, twobyte2, ?twobyte3 \n") .append(" db twobyte & 255, ( twobyte >> 8) & 255\n") .append(" db twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(" db twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(" endm\n\n") .append("Swapped4: macro twobyte, twobyte2, twobyte3, twobyte4 \n") .append(" db twobyte & 255, ( twobyte >> 8) & 255\n") .append(" db twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(" db twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(" db twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(" endm\n\n") .append("Swapped5: macro twobyte, twobyte2, twobyte3, twobyte4, twobyte5 \n") .append(" db twobyte & 255, ( twobyte >> 8) & 255\n") .append(" db twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(" db twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(" db twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(" db twobyte5 & 255, ( twobyte5 >> 8) & 255\n") .append(" endm\n\n") .append("Swapped6: macro twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6 \n") .append(" db twobyte & 255, ( twobyte >> 8) & 255\n") .append(" db twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(" db twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(" db twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(" db twobyte5 & 255, ( twobyte5 >> 8) & 255\n") .append(" db twobyte6 & 255, ( twobyte6 >> 8) & 255\n") .append(" endm\n\n") .append("Swapped7: macro twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7 \n") .append(" db twobyte & 255, ( twobyte >> 8) & 255\n") .append(" db twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(" db twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(" db twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(" db twobyte5 & 255, ( twobyte5 >> 8) & 255\n") .append(" db twobyte6 & 255, ( twobyte6 >> 8) & 255\n") .append(" db twobyte7 & 255, ( twobyte7 >> 8) & 255\n") .append(" endm\n\n") .append("Swapped8: macro twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7, twobyte8 \n") .append(" db twobyte & 255, ( twobyte >> 8) & 255\n") .append(" db twobyte2 & 255, ( twobyte2 >> 8) & 255\n") .append(" db twobyte3 & 255, ( twobyte3 >> 8) & 255\n") .append(" db twobyte4 & 255, ( twobyte4 >> 8) & 255\n") .append(" db twobyte5 & 255, ( twobyte5 >> 8) & 255\n") .append(" db twobyte6 & 255, ( twobyte6 >> 8) & 255\n") .append(" db twobyte7 & 255, ( twobyte7 >> 8) & 255\n") .append(" db twobyte8 & 255, ( twobyte8 >> 8) & 255\n") .append(" endm\n\n"); break; } } } /** * Tribyte declaration type */ public enum Tribyte implements ActionType { MACRO_TRIBYTE, // [.mac] $xxyyzz (DASM) MACRO1_TRIBYTE, // [.mac] $xxyyzz (KickAssembler) MACRO3_TRIBYTE, // [.mac] $xxyyzz (CA65) MACRO4_TRIBYTE, // [.mac] $xxyyzz (TMPx) MACRO5_TRIBYTE, // [.mac] $xxyyzz (Glass) MACRO6_TRIBYTE, // [.mac] xxyyzzh (AS) DOT_LINT_TRIBYTE, // .lint $xxyyzz DOT_LONG_TRIBYTE, // .long $xxyyzz MARK_TWENTYFOUR_TRIBYTE // !24 $xxyyzz ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; if (list.size()<=2) { aByte.flush(str); return; } int initial=str.length(); int start=initial; MemoryDasm mem; Iterator<MemoryDasm> iter=list.iterator(); while (iter.hasNext()) { mem=iter.next(); // we cannot handle memory reference inside tribyte if (mem.type==TYPE_MINOR || mem.type==TYPE_MAJOR || mem.type==TYPE_PLUS_MAJOR || mem.type==TYPE_PLUS_MINOR) { // force all to be as byte even if this breaks layout aByte.flush(str); return; } } // we have a min of 1 or a max of 8 tribyte, so use the right call for macro int index=(int)(list.size()/3); // create starting command according to the kind of byte switch (aTribyte) { case MACRO_TRIBYTE: case MACRO3_TRIBYTE: str.append(getDataSpacesTabs()).append("Tribyte").append(index).append(" "); break; case MACRO1_TRIBYTE: str.append(getDataSpacesTabs()).append("Tribyte").append(index).append("("); // must close the ) break; case MACRO4_TRIBYTE: str.append(getDataSpacesTabs()).append("#Tribyte").append(index).append(" "); break; case MACRO5_TRIBYTE: case MACRO6_TRIBYTE: str.append(getDataSpacesTabs()).append("Tribyte").append(index).append(" "); break; case DOT_LINT_TRIBYTE: str.append(getDataSpacesTabs()).append((".lint ")); break; case DOT_LONG_TRIBYTE: str.append(getDataSpacesTabs()).append((".long ")); break; case MARK_TWENTYFOUR_TRIBYTE: str.append(getDataSpacesTabs()).append(("!24 ")); break; } MemoryDasm mem1; MemoryDasm mem2; MemoryDasm mem3; // we use byte, so check for his default mode boolean defaultMode=(aByte!=DB_BYTE_H); while (!list.isEmpty()) { // if only 1 or 2 bytes left, use byte coding if (list.size()<=2) aByte.flush(str); else { mem1=list.pop(); mem2=list.pop(); mem3=list.pop(); listRel.pop(); listRel.pop(); listRel.pop(); listRel2.pop(); listRel2.pop(); listRel2.pop(); listBase.pop(); listBase.pop(); listBase.pop(); listDest.pop(); listDest.pop(); listDest.pop(); if (aTribyte==DOT_LINT_TRIBYTE && mem1.copy<0) { str.append("-").append( HexNum(ByteToExe(Math.abs(mem1.copy))+ ByteToExe(Unsigned.done(mem2.copy))+ ByteToExe(Unsigned.done(mem3.copy)), defaultMode) ); } else { str.append( HexNum(ByteToExe(Math.abs(mem1.copy))+ ByteToExe(Unsigned.done(mem2.copy))+ ByteToExe(Unsigned.done(mem3.copy)), defaultMode) ); } carets.add(start, str.length(), mem1, Type.TRIBYTE); if (list.size()>=3) str.append(", "); else { if (mem3.dasmLocation==null && mem3.userLocation==null) { str.append(getDataCSpacesTabs(str.length()-initial-getDataSpacesTabs().length())); MemoryDasm tmp=lastMem; lastMem=mem3; aComment.flush(str); lastMem=tmp; } else if (aTribyte==MACRO1_TRIBYTE) str.append(")\n"); else str.append("\n"); } start=str.length(); } } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if (list.size()==option.maxTribyteAggregate*3) flush(str); if (mem.dasmLocation==null && mem.userLocation==null) { // look for comment inside String comment=lastMem.dasmComment; if (lastMem.userComment != null) comment=lastMem.userComment; if (!(comment==null || "".equals(comment))) flush(str); } } /** * Setting up the action type if this is the case * * @param str the output stream */ @Override public void setting(StringBuilder str) { String spaces=getDataSpacesTabs(); switch (aTribyte) { case MACRO_TRIBYTE: str.append(spaces).append(".mac Tribyte1 \n") .append(spaces).append(" .byte {1} >> 16, ( {1} >> 8) & 255, {1} & 255\n") .append(spaces).append(".endm \n\n") .append(spaces).append(".mac Tribyte2 \n") .append(spaces).append(" .byte {1} >> 16, ( {1} >> 8) & 255, {1} & 255\n") .append(spaces).append(" .byte {2} >> 16, ( {2} >> 8) & 255, {2} & 255\n") .append(spaces).append(".endm \n\n") .append(spaces).append(".mac Tribyte3 \n") .append(spaces).append(" .byte {1} >> 16, ( {1} >> 8) & 255, {1} & 255\n") .append(spaces).append(" .byte {2} >> 16, ( {2} >> 8) & 255, {2} & 255\n") .append(spaces).append(" .byte {3} >> 16, ( {3} >> 8) & 255, {3} & 255\n") .append(spaces).append(".endm \n\n") .append(spaces).append(".mac Tribyte4 \n") .append(spaces).append(" .byte {1} >> 16, ( {1} >> 8) & 255, {1} & 255\n") .append(spaces).append(" .byte {2} >> 16, ( {2} >> 8) & 255, {2} & 255\n") .append(spaces).append(" .byte {3} >> 16, ( {3} >> 8) & 255, {3} & 255\n") .append(spaces).append(" .byte {4} >> 16, ( {4} >> 8) & 255, {4} & 255\n") .append(spaces).append(" .endm \n\n") .append(spaces).append(".mac Tribyte5 \n") .append(spaces).append(" .byte {1} >> 16, ( {1} >> 8) & 255, {1} & 255\n") .append(spaces).append(" .byte {2} >> 16, ( {2} >> 8) & 255, {2} & 255\n") .append(spaces).append(" .byte {3} >> 16, ( {3} >> 8) & 255, {3} & 255\n") .append(spaces).append(" .byte {4} >> 16, ( {4} >> 8) & 255, {4} & 255\n") .append(spaces).append(" .byte {5} >> 16, ( {5} >> 8) & 255, {5} & 255\n") .append(spaces).append(".endm \n\n") .append(spaces).append(".mac Tribyte6 \n") .append(spaces).append(" .byte {1} >> 16, ( {1} >> 8) & 255, {1} & 255\n") .append(spaces).append(" .byte {2} >> 16, ( {2} >> 8) & 255, {2} & 255\n") .append(spaces).append(" .byte {3} >> 16, ( {3} >> 8) & 255, {3} & 255\n") .append(spaces).append(" .byte {4} >> 16, ( {4} >> 8) & 255, {4} & 255\n") .append(spaces).append(" .byte {5} >> 16, ( {5} >> 8) & 255, {5} & 255\n") .append(spaces).append(" .byte {6} >> 16, ( {6} >> 8) & 255, {6} & 255\n") .append(spaces).append(".endm \n\n") .append(spaces).append(".mac Tribyte7 \n") .append(spaces).append(" .byte {1} >> 16, ( {1} >> 8) & 255, {1} & 255\n") .append(spaces).append(" .byte {2} >> 16, ( {2} >> 8) & 255, {2} & 255\n") .append(spaces).append(" .byte {3} >> 16, ( {3} >> 8) & 255, {3} & 255\n") .append(spaces).append(" .byte {4} >> 16, ( {4} >> 8) & 255, {4} & 255\n") .append(spaces).append(" .byte {5} >> 16, ( {5} >> 8) & 255, {5} & 255\n") .append(spaces).append(" .byte {6} >> 16, ( {6} >> 8) & 255, {6} & 255\n") .append(spaces).append(" .byte {7} >> 16, ( {7} >> 8) & 255, {7} & 255\n") .append(spaces).append(".endm \n\n") .append(spaces).append(".mac Tribyte8 \n") .append(spaces).append(" .byte {1} >> 16, ( {1} >> 8) & 255, {1} & 255\n") .append(spaces).append(" .byte {2} >> 16, ( {2} >> 8) & 255, {2} & 255\n") .append(spaces).append(" .byte {3} >> 16, ( {3} >> 8) & 255, {3} & 255\n") .append(spaces).append(" .byte {4} >> 16, ( {4} >> 8) & 255, {4} & 255\n") .append(spaces).append(" .byte {5} >> 16, ( {5} >> 8) & 255, {5} & 255\n") .append(spaces).append(" .byte {6} >> 16, ( {6} >> 8) & 255, {6} & 255\n") .append(spaces).append(" .byte {7} >> 16, ( {7} >> 8) & 255, {7} & 255\n") .append(spaces).append(" .byte {8} >> 16, ( {8} >> 8) & 255, {8} & 255\n") .append(spaces).append(".endm \n\n"); break; case MACRO1_TRIBYTE: str.append(spaces).append(".macro Tribyte1 (tribyte) {\n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Tribyte2 (tribyte, tribyte2) {\n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Tribyte3 (tribyte, tribyte2, tribyte3) {\n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(" .byte tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Tribyte4 (tribyte, tribyte2, tribyte3, tribyte4) {\n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(" .byte tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(spaces).append(" .byte tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Tribyte5 (tribyte, tribyte2, tribyte3, tribyte4, tribyte5) {\n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(" .byte tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(spaces).append(" .byte tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(spaces).append(" .byte tribyte5 >> 16, ( tribyte5 >> 8) & 255, tribyte5 & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Tribyte6 (tribyte, tribyte2, tribyte3, tribyte4, tribyte5, tribyte6) {\n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(" .byte tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(spaces).append(" .byte tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(spaces).append(" .byte tribyte5 >> 16, ( tribyte5 >> 8) & 255, tribyte5 & 255\n") .append(spaces).append(" .byte tribyte6 >> 16, ( tribyte6 >> 8) & 255, tribyte6 & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Tribyte7 (tribyte, tribyte2, tribyte3, tribyte4, tribyte5, tribyte6, tribyte7) {\n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(" .byte tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(spaces).append(" .byte tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(spaces).append(" .byte tribyte5 >> 16, ( tribyte5 >> 8) & 255, tribyte5 & 255\n") .append(spaces).append(" .byte tribyte6 >> 16, ( tribyte6 >> 8) & 255, tribyte6 & 255\n") .append(spaces).append(" .byte tribyte7 >> 16, ( tribyte7 >> 8) & 255, tribyte7 & 255\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Tribyte8 (tribyte, tribyte2, tribyte3, tribyte4, tribyte5, tribyte6, tribyte7, tribyte8) {\n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(" .byte tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(spaces).append(" .byte tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(spaces).append(" .byte tribyte5 >> 16, ( tribyte5 >> 8) & 255, tribyte5 & 255\n") .append(spaces).append(" .byte tribyte6 >> 16, ( tribyte6 >> 8) & 255, tribyte6 & 255\n") .append(spaces).append(" .byte tribyte7 >> 16, ( tribyte7 >> 8) & 255, tribyte7 & 255\n") .append(spaces).append(" .byte tribyte8 >> 16, ( tribyte8 >> 8) & 255, tribyte8 & 255\n") .append(spaces).append("}\n\n"); break; case MACRO3_TRIBYTE: str.append(spaces).append(".macro Tribyte1 tribyte \n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Tribyte2 tribyte, tribyte2 \n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Tribyte3 tribyte, tribyte2, tribyte3 \n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(" .byte tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Tribyte4 tribyte, tribyte2, tribyte3, tribyte4 \n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(" .byte tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(spaces).append(" .byte tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Tribyte5 tribyte, tribyte2, tribyte3, tribyte4, tribyte5 \n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(" .byte tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(spaces).append(" .byte tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(spaces).append(" .byte tribyte5 >> 16, ( tribyte5 >> 8) & 255, tribyte5 & 255\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Tribyte6 tribyte, tribyte2, tribyte3, tribyte4, tribyte5, tribyte6 \n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(" .byte tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(spaces).append(" .byte tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(spaces).append(" .byte tribyte5 >> 16, ( tribyte5 >> 8) & 255, tribyte5 & 255\n") .append(spaces).append(" .byte tribyte6 >> 16, ( tribyte6 >> 8) & 255, tribyte6 & 255\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Tribyte7 tribyte, tribyte2, tribyte3, tribyte4, tribyte5, tribyte6, tribyte7 \n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(" .byte tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(spaces).append(" .byte tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(spaces).append(" .byte tribyte5 >> 16, ( tribyte5 >> 8) & 255, tribyte5 & 255\n") .append(spaces).append(" .byte tribyte6 >> 16, ( tribyte6 >> 8) & 255, tribyte6 & 255\n") .append(spaces).append(" .byte tribyte7 >> 16, ( tribyte7 >> 8) & 255, tribyte7 & 255\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Tribyte8 tribyte, tribyte2, tribyte3, tribyte4, tribyte5, tribyte6, tribyte7, tribyte8 \n") .append(spaces).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(spaces).append(" .byte tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(spaces).append(" .byte tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(spaces).append(" .byte tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(spaces).append(" .byte tribyte5 >> 16, ( tribyte5 >> 8) & 255, tribyte5 & 255\n") .append(spaces).append(" .byte tribyte7 >> 16, ( tribyte7 >> 8) & 255, tribyte7 & 255\n") .append(spaces).append(" .byte tribyte8 >> 16, ( tribyte8 >> 8) & 255, tribyte8 & 255\n") .append(spaces).append(".endmacro\n\n"); break; case MACRO4_TRIBYTE: str.append( "Tribyte1 .macro \n" + " .byte \\1 >> 16, ( \\1 >> 8) & 255, \\1 & 255\n" + " .endm\n\n"+ "Tribyte2 .macro \n" + " .byte \\1 >> 16, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 16, ( \\2 >> 8) & 255, \\2 & 255\n" + " .endm\n\n"+ "Tribyte3 .macro \n" + " .byte \\1 >> 16, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 16, ( \\2 >> 8) & 255, \\2 & 255\n" + " .byte \\3 >> 16, ( \\3 >> 8) & 255, \\3 & 255\n" + " .endm\n\n"+ "Tribyte4 .macro \n" + " .byte \\1 >> 16, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 16, ( \\2 >> 8) & 255, \\2 & 255\n" + " .byte \\3 >> 16, ( \\3 >> 8) & 255, \\3 & 255\n" + " .byte \\4 >> 16, ( \\4 >> 8) & 255, \\4 & 255\n" + " .endm\n\n"+ "Tribyte5 .macro \n" + " .byte \\1 >> 16, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 16, ( \\2 >> 8) & 255, \\2 & 255\n" + " .byte \\3 >> 16, ( \\3 >> 8) & 255, \\3 & 255\n" + " .byte \\4 >> 16, ( \\4 >> 8) & 255, \\4 & 255\n" + " .byte \\5 >> 16, ( \\5 >> 8) & 255, \\5 & 255\n" + " .endm\n\n"+ "Tribyte6 .macro \n" + " .byte \\1 >> 16, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 16, ( \\2 >> 8) & 255, \\2 & 255\n" + " .byte \\3 >> 16, ( \\3 >> 8) & 255, \\3 & 255\n" + " .byte \\4 >> 16, ( \\4 >> 8) & 255, \\4 & 255\n" + " .byte \\5 >> 16, ( \\5 >> 8) & 255, \\5 & 255\n" + " .byte \\6 >> 16, ( \\6 >> 8) & 255, \\6 & 255\n" + " .endm\n\n"+ "Tribyte7 .macro \n" + " .byte \\1 >> 16, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 16, ( \\2 >> 8) & 255, \\2 & 255\n" + " .byte \\3 >> 16, ( \\3 >> 8) & 255, \\3 & 255\n" + " .byte \\4 >> 16, ( \\4 >> 8) & 255, \\4 & 255\n" + " .byte \\5 >> 16, ( \\5 >> 8) & 255, \\5 & 255\n" + " .byte \\6 >> 16, ( \\6 >> 8) & 255, \\6 & 255\n" + " .byte \\7 >> 16, ( \\7 >> 8) & 255, \\7 & 255\n" + " .endm\n\n"+ "Tribyte8 .macro \n" + " .byte \\1 >> 16, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 16, ( \\2 >> 8) & 255, \\2 & 255\n" + " .byte \\3 >> 16, ( \\3 >> 8) & 255, \\3 & 255\n" + " .byte \\4 >> 16, ( \\4 >> 8) & 255, \\4 & 255\n" + " .byte \\5 >> 16, ( \\5 >> 8) & 255, \\5 & 255\n" + " .byte \\6 >> 16, ( \\6 >> 8) & 255, \\6 & 255\n" + " .byte \\7 >> 16, ( \\7 >> 8) & 255, \\7 & 255\n" + " .byte \\8 >> 16, ( \\8 >> 8) & 255, \\8 & 255\n" + " .endm\n\n" ); break; case MACRO5_TRIBYTE: str.append(spaces).append("Tribyte1: macro ?tribyte \n") .append(spaces).append(" db ?tribyte >> 16, ( ?tribyte >> 8) & 255, ?tribyte & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Tribyte2: macro ?tribyte, ?tribyte2 \n") .append(spaces).append(" db ?tribyte >> 16, ( ?tribyte >> 8) & 255, ?tribyte & 255\n") .append(spaces).append(" db ?tribyte2 >> 16, ( ?tribyte2 >> 8) & 255, ?tribyte2 & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Tribyte3: macro ?tribyte, ?tribyte2, ?tribyte3 \n") .append(spaces).append(" db ?tribyte >> 16, ( ?tribyte >> 8) & 255, ?tribyte & 255\n") .append(spaces).append(" db ?tribyte2 >> 16, ( ?tribyte2 >> 8) & 255, ?tribyte2 & 255\n") .append(spaces).append(" db ?tribyte3 >> 16, ( ?tribyte3 >> 8) & 255, ?tribyte3 & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Tribyte4: macro ?tribyte, ?tribyte2, ?tribyte3, ?tribyte4 \n") .append(spaces).append(" db ?tribyte >> 16, ( ?tribyte >> 8) & 255, ?tribyte & 255\n") .append(spaces).append(" db ?tribyte2 >> 16, ( ?tribyte2 >> 8) & 255, ?tribyte2 & 255\n") .append(spaces).append(" db ?tribyte3 >> 16, ( ?tribyte3 >> 8) & 255, ?tribyte3 & 255\n") .append(spaces).append(" db ?tribyte4 >> 16, ( ?tribyte4 >> 8) & 255, ?tribyte4 & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Tribyte5: macro ?tribyte, ?tribyte2, ?tribyte3, ?tribyte4, ?tribyte5 \n") .append(spaces).append(" db ?tribyte >> 16, ( ?tribyte >> 8) & 255, ?tribyte & 255\n") .append(spaces).append(" db ?tribyte2 >> 16, ( ?tribyte2 >> 8) & 255, ?tribyte2 & 255\n") .append(spaces).append(" db ?tribyte3 >> 16, ( ?tribyte3 >> 8) & 255, ?tribyte3 & 255\n") .append(spaces).append(" db ?tribyte4 >> 16, ( ?tribyte4 >> 8) & 255, ?tribyte4 & 255\n") .append(spaces).append(" db ?tribyte5 >> 16, ( ?tribyte5 >> 8) & 255, ?tribyte5 & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Tribyte6: macro ?tribyte, ?tribyte2, ?tribyte3, ?tribyte4, ?tribyte5, ?tribyte6 \n") .append(spaces).append(" db ?tribyte >> 16, ( ?tribyte >> 8) & 255, ?tribyte & 255\n") .append(spaces).append(" db ?tribyte2 >> 16, ( ?tribyte2 >> 8) & 255, ?tribyte2 & 255\n") .append(spaces).append(" db ?tribyte3 >> 16, ( ?tribyte3 >> 8) & 255, ?tribyte3 & 255\n") .append(spaces).append(" db ?tribyte4 >> 16, ( ?tribyte4 >> 8) & 255, ?tribyte4 & 255\n") .append(spaces).append(" db ?tribyte5 >> 16, ( ?tribyte5 >> 8) & 255, ?tribyte5 & 255\n") .append(spaces).append(" db ?tribyte6 >> 16, ( ?tribyte6 >> 8) & 255, ?tribyte6 & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Tribyte7: macro ?tribyte, ?tribyte2, ?tribyte3, ?tribyte4, ?tribyte5, ?tribyte6, ?tribyte7 \n") .append(spaces).append(" db ?tribyte >> 16, ( ?tribyte >> 8) & 255, ?tribyte & 255\n") .append(spaces).append(" db ?tribyte2 >> 16, ( ?tribyte2 >> 8) & 255, ?tribyte2 & 255\n") .append(spaces).append(" db ?tribyte3 >> 16, ( ?tribyte3 >> 8) & 255, ?tribyte3 & 255\n") .append(spaces).append(" db ?tribyte4 >> 16, ( ?tribyte4 >> 8) & 255, ?tribyte4 & 255\n") .append(spaces).append(" db ?tribyte5 >> 16, ( ?tribyte5 >> 8) & 255, ?tribyte5 & 255\n") .append(spaces).append(" db ?tribyte6 >> 16, ( ?tribyte6 >> 8) & 255, ?tribyte6 & 255\n") .append(spaces).append(" db ?tribyte7 >> 16, ( ?tribyte7 >> 8) & 255, ?tribyte7 & 255\n") .append(spaces).append("endm\n\n") .append(spaces).append("Tribyte8: macro ?tribyte, ?tribyte2, ?tribyte3, ?tribyte4, ?tribyte5, ?tribyte6, ?tribyte7, ?tribyte8 \n") .append(spaces).append(" db ?tribyte >> 16, ( ?tribyte >> 8) & 255, ?tribyte & 255\n") .append(spaces).append(" db ?tribyte2 >> 16, ( ?tribyte2 >> 8) & 255, ?tribyte2 & 255\n") .append(spaces).append(" db ?tribyte3 >> 16, ( ?tribyte3 >> 8) & 255, ?tribyte3 & 255\n") .append(spaces).append(" db ?tribyte4 >> 16, ( ?tribyte4 >> 8) & 255, ?tribyte4 & 255\n") .append(spaces).append(" db ?tribyte5 >> 16, ( ?tribyte5 >> 8) & 255, ?tribyte5 & 255\n") .append(spaces).append(" db ?tribyte7 >> 16, ( ?tribyte7 >> 8) & 255, ?tribyte7 & 255\n") .append(spaces).append(" db ?tribyte8 >> 16, ( ?tribyte8 >> 8) & 255, ?tribyte8 & 255\n") .append(spaces).append("endm\n\n"); break; case MACRO6_TRIBYTE: str.append("Tribyte1: macro tribyte \n") .append(" db tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(" endm\n\n") .append("Tribyte2: macro tribyte, tribyte2 \n") .append(" db tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(" db tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(" endm\n\n") .append("Tribyte3: macro tribyte, tribyte2, tribyte3 \n") .append(" db tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(" db tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(" db tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(" endm\n\n") .append("Tribyte4: macro tribyte, tribyte2, tribyte3, tribyte4 \n") .append(" db tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(" db tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(" db tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(" db tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(" endm\n\n") .append("Tribyte5: macro tribyte, tribyte2, tribyte3, tribyte4, tribyte5 \n") .append(" db tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(" db tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(" db tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(" db tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(" db tribyte5 >> 16, ( tribyte5 >> 8) & 255, tribyte5 & 255\n") .append(" endm\n\n") .append("Tribyte6: macro tribyte, tribyte2, tribyte3, tribyte4, tribyte5, tribyte6 \n") .append(" db tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(" db tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(" db tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(" db tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(" db tribyte5 >> 16, ( tribyte5 >> 8) & 255, tribyte5 & 255\n") .append(" db tribyte6 >> 16, ( tribyte6 >> 8) & 255, tribyte6 & 255\n") .append(" endm\n\n") .append("Tribyte7: macro tribyte, tribyte2, tribyte3, tribyte4, tribyte5, tribyte6, tribyte7 \n") .append(" db tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(" db tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(" db tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(" db tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(" db tribyte5 >> 16, ( tribyte5 >> 8) & 255, tribyte5 & 255\n") .append(" db tribyte6 >> 16, ( tribyte6 >> 8) & 255, tribyte6 & 255\n") .append(" db tribyte7 >> 16, ( tribyte7 >> 8) & 255, tribyte7 & 255\n") .append(" endm\n\n") .append("Tribyte8: macro tribyte, tribyte2, tribyte3, tribyte4, tribyte5, tribyte6, tribyte7, tribyte8 \n") .append(" db tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(" db tribyte2 >> 16, ( tribyte2 >> 8) & 255, tribyte2 & 255\n") .append(" db tribyte3 >> 16, ( tribyte3 >> 8) & 255, tribyte3 & 255\n") .append(" db tribyte4 >> 16, ( tribyte4 >> 8) & 255, tribyte4 & 255\n") .append(" db tribyte5 >> 16, ( tribyte5 >> 8) & 255, tribyte5 & 255\n") .append(" db tribyte7 >> 16, ( tribyte7 >> 8) & 255, tribyte7 & 255\n") .append(" db tribyte8 >> 16, ( tribyte8 >> 8) & 255, tribyte8 & 255\n") .append(" endm\n\n"); break; } }; } /** * Long declaration type */ public enum Long implements ActionType { LONG, // long $xxyyzzkk DOT_LONG, // .long $xxyyzzkk DOT_DW_LONG, // .dw $xxyyzzkk DOT_DC_L_LONG, // .dc.l $xxyyzzkk DOT_DWORD_LONG, // .dword $xxyyzzkk DOT_DLINT_LONG, // .dlint $xxyyzzkk DD_LONG, // dd $xxyyzzkk DD_LONG_H, // dd xxyyzzkkh MARK_THIRTYTWO_LONG, // !32 $xxyyzzkk MACRO4_LONG // [.mac] $xxyyzzkk (TMPx) ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; if (list.size()<=3) { aByte.flush(str); return; } int initial=str.length(); int start=initial; MemoryDasm mem; Iterator<MemoryDasm> iter=list.iterator(); while (iter.hasNext()) { mem=iter.next(); // we cannot handle memory reference inside long if (mem.type==TYPE_MINOR || mem.type==TYPE_MAJOR || mem.type==TYPE_PLUS_MAJOR || mem.type==TYPE_PLUS_MINOR) { // force all to be as byte even if this breaks layout aByte.flush(str); return; } } switch (aLong) { case LONG: str.append(getDataSpacesTabs()).append("long "); break; case DOT_LONG: str.append(getDataSpacesTabs()).append(".long "); break; case DOT_DC_L_LONG: str.append(getDataSpacesTabs()).append(".dc.l "); break; case DOT_DWORD_LONG: str.append(getDataSpacesTabs()).append(".dword "); break; case DOT_DW_LONG: str.append(getDataSpacesTabs()).append(".dw "); break; case DOT_DLINT_LONG: str.append(getDataSpacesTabs()).append(".dlint "); break; case DD_LONG: case DD_LONG_H: str.append(getDataSpacesTabs()).append("dd "); break; case MARK_THIRTYTWO_LONG: str.append(getDataSpacesTabs()).append("!32 "); break; case MACRO4_LONG: // we have a min of 1 or a max of 8 tribyte, so use the right call for macro int index=(int)(list.size()/4); str.append(getDataSpacesTabs()).append("#Long").append(index).append(" "); break; } MemoryDasm mem1; MemoryDasm mem2; MemoryDasm mem3; MemoryDasm mem4; while (!list.isEmpty()) { // if only 1..3 bytes left, use byte coding if (list.size()<=3) aByte.flush(str); else { mem1=list.pop(); mem2=list.pop(); mem3=list.pop(); mem4=list.pop(); listRel.pop(); listRel.pop(); listRel.pop(); listRel.pop(); listRel2.pop(); listRel2.pop(); listRel2.pop(); listRel2.pop(); listBase.pop(); listBase.pop(); listBase.pop(); listBase.pop(); listDest.pop(); listDest.pop(); listDest.pop(); listDest.pop(); boolean defaultMode=(aLong!=DD_LONG_H); if (aLong==DOT_DLINT_LONG && mem1.copy<0) { str.append("-").append( HexNum( ByteToExe(Math.abs(mem1.copy))+ ByteToExe(Unsigned.done(mem2.copy))+ ByteToExe(Unsigned.done(mem3.copy))+ ByteToExe(Unsigned.done(mem4.copy)), defaultMode) ); } else { str.append( HexNum( ByteToExe(Math.abs(mem1.copy))+ ByteToExe(Unsigned.done(mem2.copy))+ ByteToExe(Unsigned.done(mem3.copy))+ ByteToExe(Unsigned.done(mem4.copy)), defaultMode) ); } carets.add(start, str.length(), mem1, Type.LONG); if (list.size()>=4) str.append(", "); else { if (mem4.dasmLocation==null && mem4.userLocation==null) { str.append(getDataCSpacesTabs(str.length()-initial-getDataSpacesTabs().length())); MemoryDasm tmp=lastMem; lastMem=mem4; aComment.flush(str); lastMem=tmp; } else str.append("\n"); } start=str.length(); } } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if (list.size()==option.maxLongAggregate*4) flush(str); if (mem.dasmLocation==null && mem.userLocation==null) { // look for comment inside String comment=lastMem.dasmComment; if (lastMem.userComment != null) comment=lastMem.userComment; if (!(comment==null || "".equals(comment))) flush(str); } } /** * Setting up the action type if this is the case * * @param str the output stream */ @Override public void setting(StringBuilder str) { switch (aLong) { case MACRO4_LONG: str.append( "Long1 .macro \n" + " .byte \\1 >> 24, (\\1 >> 16) & 255, ( \\1 >> 8) & 255, \\1 & 255\n" + " .endm\n\n"+ "Long2 .macro \n" + " .byte \\1 >> 24, (\\1 >> 16) & 255, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 24, (\\2 >> 16) & 255, ( \\2 >> 8) & 255, \\2 & 255\n" + " .endm\n\n"+ "Long3 .macro \n" + " .byte \\1 >> 24, (\\1 >> 16) & 255, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 24, (\\2 >> 16) & 255, ( \\2 >> 8) & 255, \\2 & 255\n" + " .byte \\3 >> 24, (\\3 >> 16) & 255, ( \\3 >> 8) & 255, \\3 & 255\n" + " .endm\n\n"+ "Long4 .macro \n" + " .byte \\1 >> 24, (\\1 >> 16) & 255, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 24, (\\2 >> 16) & 255, ( \\2 >> 8) & 255, \\2 & 255\n" + " .byte \\3 >> 24, (\\3 >> 16) & 255, ( \\3 >> 8) & 255, \\3 & 255\n" + " .byte \\4 >> 24, (\\4 >> 16) & 255, ( \\4 >> 8) & 255, \\4 & 255\n" + " .endm\n\n"+ "Long5 .macro \n" + " .byte \\1 >> 24, (\\1 >> 16) & 255, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 24, (\\2 >> 16) & 255, ( \\2 >> 8) & 255, \\2 & 255\n" + " .byte \\3 >> 24, (\\3 >> 16) & 255, ( \\3 >> 8) & 255, \\3 & 255\n" + " .byte \\4 >> 24, (\\4 >> 16) & 255, ( \\4 >> 8) & 255, \\4 & 255\n" + " .byte \\5 >> 24, (\\5 >> 16) & 255, ( \\5 >> 8) & 255, \\5 & 255\n" + " .endm\n\n"+ "Long6 .macro \n" + " .byte \\1 >> 24, (\\1 >> 16) & 255, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 24, (\\2 >> 16) & 255, ( \\2 >> 8) & 255, \\2 & 255\n" + " .byte \\3 >> 24, (\\3 >> 16) & 255, ( \\3 >> 8) & 255, \\3 & 255\n" + " .byte \\4 >> 24, (\\4 >> 16) & 255, ( \\4 >> 8) & 255, \\4 & 255\n" + " .byte \\5 >> 24, (\\5 >> 16) & 255, ( \\5 >> 8) & 255, \\5 & 255\n" + " .byte \\6 >> 24, (\\6 >> 16) & 255, ( \\6 >> 8) & 255, \\6 & 255\n" + " .endm\n\n"+ "Long7 .macro \n" + " .byte \\1 >> 24, (\\1 >> 16) & 255, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 24, (\\2 >> 16) & 255, ( \\2 >> 8) & 255, \\2 & 255\n" + " .byte \\3 >> 24, (\\3 >> 16) & 255, ( \\3 >> 8) & 255, \\3 & 255\n" + " .byte \\4 >> 24, (\\4 >> 16) & 255, ( \\4 >> 8) & 255, \\4 & 255\n" + " .byte \\5 >> 24, (\\5 >> 16) & 255, ( \\5 >> 8) & 255, \\5 & 255\n" + " .byte \\6 >> 24, (\\6 >> 16) & 255, ( \\6 >> 8) & 255, \\6 & 255\n" + " .byte \\7 >> 24, (\\7 >> 16) & 255, ( \\7 >> 8) & 255, \\7 & 255\n" + " .endm\n\n"+ "Long8 .macro \n" + " .byte \\1 >> 24, (\\1 >> 16) & 255, ( \\1 >> 8) & 255, \\1 & 255\n" + " .byte \\2 >> 24, (\\2 >> 16) & 255, ( \\2 >> 8) & 255, \\2 & 255\n" + " .byte \\3 >> 24, (\\3 >> 16) & 255, ( \\3 >> 8) & 255, \\3 & 255\n" + " .byte \\4 >> 24, (\\4 >> 16) & 255, ( \\4 >> 8) & 255, \\4 & 255\n" + " .byte \\5 >> 24, (\\5 >> 16) & 255, ( \\5 >> 8) & 255, \\5 & 255\n" + " .byte \\6 >> 24, (\\6 >> 16) & 255, ( \\6 >> 8) & 255, \\6 & 255\n" + " .byte \\7 >> 24, (\\7 >> 16) & 255, ( \\7 >> 8) & 255, \\7 & 255\n" + " .byte \\8 >> 24, (\\8 >> 16) & 255, ( \\8 >> 8) & 255, \\8 & 255\n" + " .endm\n\n" ); break; } } } /** * Address declaration type * -> .word $xxyy * -> .wo $xxyy * -> word $xxyy * -> dc.w $xxyy * -> .addr $xxyy * -> !word $xxyy * -> !16 $xxyy */ public enum Address implements ActionType { DOT_WORD_ADDR, // .word $xxyy DOT_WO_WORD_ADDR, // .wo $xxyy WORD_ADDR, // word $xxyy DOT_ADDR_ADDR, // .addr $xxyy DC_W_ADDR, // dc.w $xxyy DW_ADDR, // dw $xxyy DW_ADDR_H, // dw xxyyh MARK_WORD_ADDR, // !word $xxyy SIXTEEN_WORD_ADDR; // !16 $xxyy// !16 $xxyy @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; MemoryDasm memLow; MemoryDasm memHigh; MemoryDasm memRelLow; MemoryDasm memRelHigh; int pos1=str.length(); // store initial position int start=pos1; // create starting command according to the kind of byte switch (aAddress) { case DOT_WORD_ADDR: str.append(getDataSpacesTabs()).append((".word ")); break; case DOT_WO_WORD_ADDR: str.append(getDataSpacesTabs()).append((".wo ")); break; case WORD_ADDR: str.append(getDataSpacesTabs()).append(("word ")); break; case DC_W_ADDR: str.append(getDataSpacesTabs()).append(("dc.w ")); break; case DW_ADDR: case DW_ADDR_H: str.append(getDataSpacesTabs()).append(("dw ")); break; case DOT_ADDR_ADDR: str.append(getDataSpacesTabs()).append((".addr ")); break; case MARK_WORD_ADDR: str.append(getDataSpacesTabs()).append(("!word ")); break; case SIXTEEN_WORD_ADDR: str.append(getDataSpacesTabs()).append(("!16 ")); break; } int pos2=str.length(); // store final position boolean isFirst=true; // true if this is the first output boolean defaultMode=(aAddress!=DW_ADDR_H); while (!list.isEmpty()) { // if only 1 byte left, use byte coding if (list.size()==1) { if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } aByte.flush(str); } else { memLow=list.pop(); memRelLow=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); memHigh=list.pop(); memRelHigh=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); if ((memLow.type==TYPE_MINOR || memLow.type==TYPE_PLUS_MINOR) && (memHigh.type==TYPE_MAJOR || memHigh.type==TYPE_PLUS_MAJOR) && (memLow.related & 0xFFFF)==(memHigh.related & 0xFFFF)) { // add a automatic label onto references byte if (memRelLow.dasmLocation==null || "".equals(memRelLow.dasmLocation)) { memRelLow.dasmLocation="W"+ShortToExe(memRelLow.address); } if (memRelLow.userLocation!=null && !"".equals(memRelLow.userLocation)) str.append(memRelLow.userLocation); else if (memRelLow.dasmLocation!=null && !"".equals(memRelLow.dasmLocation)) str.append(memRelLow.dasmLocation); else str.append(HexNum(ShortToExe(memRelLow.address), defaultMode)); isFirst=false; } else { // if cannot make a word with relative locations, force all to be of byte type if (memLow.type==TYPE_MINOR || memLow.type==TYPE_MAJOR || memLow.type==TYPE_PLUS_MAJOR || memLow.type==TYPE_PLUS_MINOR || memHigh.type==TYPE_MINOR || memHigh.type==TYPE_MAJOR || memHigh.type==TYPE_PLUS_MAJOR || memHigh.type==TYPE_PLUS_MINOR) { list.addFirst(memHigh); list.addFirst(memLow); listRel.addFirst(memRelHigh); listRel.addFirst(memRelLow); listRel2.addFirst(null); listRel2.addFirst(null); listBase.addFirst(null); listBase.addFirst(null); listDest.addFirst(null); listDest.addFirst(null); if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } aByte.flush(str); } else { // look fopr constant if (memLow.index!=-1 && memHigh.index!=-1 && memLow.index==memHigh.index) { String res=constant.table[memLow.index][(memLow.copy & 0xFF) + ((memHigh.copy & 0xFF)<<8)]; if (res!=null && !"".equals(res)) str.append(res); else str.append(HexNum(ByteToExe(Unsigned.done(memHigh.copy))+ByteToExe(Unsigned.done(memLow.copy)), defaultMode)); } else str.append(HexNum(ByteToExe(Unsigned.done(memHigh.copy))+ByteToExe(Unsigned.done(memLow.copy)), defaultMode)); isFirst=false; } } carets.add(start, str.length(), memLow, Type.ADDRESS); if (list.size()>=2) str.append(", "); else { if (memHigh.dasmLocation==null && memHigh.userLocation==null) { str.append(getDataCSpacesTabs(str.length()-pos1-getDataSpacesTabs().length())); MemoryDasm tmp=lastMem; lastMem=memHigh; aComment.flush(str); lastMem=tmp; } else str.append("\n"); } start=str.length(); } } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if (list.size()==option.maxAddressAggregate*2) flush(str); if (mem.dasmLocation==null && mem.userLocation==null) { // look for comment inside String comment=lastMem.dasmComment; if (lastMem.userComment != null) comment=lastMem.userComment; if (!(comment==null || "".equals(comment))) flush(str); } } } /** * Mono sprite declaration type * * -> [byte] $xx. * -> [byte] %b.. * -> [.mac] %xx.. * -> [.mac] %b.. * -> [.macro] %xx.. * -> [.macro] %b.. */ public enum MonoSprite implements ActionType { BYTE_HEX, // [byte] $xx.. BYTE_BIN, // [byte] %b.. TWENTYFOUR_HEX,// !24 $xx.. TWENTYFOUR_BIN,// !24 %b.. MACRO_HEX, // [.mac] %xx.. (Dasm) MACRO_BIN, // [.mac] %b.. (Dasm) MACRO1_HEX, // [.macro] %xx.. (Kick assembler) MACRO1_BIN, // [.macro] %b.. (Kick assembler) MACRO2_HEX, // [.macro] %xx.. (Acme) MACRO2_BIN, // [.macro] %b.. (Acme) MACRO3_HEX, // [.macro] %xx.. (CA65) MACRO3_BIN, // [.macro] %b.. (CA65) MACRO4_HEX, // [.macro] %xx.. (TMPx) MACRO4_BIN, // [.macro] %b.. (TMPx) MACRO5_HEX, // [.macro] %xx.. (Glass) MACRO5_BIN, // [.macro] %b.. (Glass) ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; // we must receive a list of 3 or 1 final byte (if 2, uses as bytes) if (list.size()>=3) { MemoryDasm mem1=list.pop(); MemoryDasm mem2=list.pop(); MemoryDasm mem3=list.pop(); StringBuilder tmp; String tmpS; // add a dasm comment with pixels mem3.dasmComment=BinToMono(Integer.toBinaryString((mem1.copy & 0xFF) + 0x100).substring(1))+ BinToMono(Integer.toBinaryString((mem2.copy & 0xFF) + 0x100).substring(1))+ BinToMono(Integer.toBinaryString((mem3.copy & 0xFF) + 0x100).substring(1)); lastMem=mem3; int initial=str.length(); int start=initial; // now we have one row of 3 bytes switch (aMonoSprite) { case BYTE_HEX: mem1=mem1.clone(); mem2=mem2.clone(); mem3=mem3.clone(); mem1.dataType=DataType.BYTE_HEX; mem2.dataType=DataType.BYTE_HEX; mem3.dataType=DataType.BYTE_HEX; list.push(mem3); list.push(mem2); list.push(mem1); tmp=new StringBuilder(); aByte.flush(tmp); tmpS=tmp.toString(); str.append(tmpS.substring(0, tmpS.length()-1)).append(" "); break; case BYTE_BIN: mem1=mem1.clone(); mem2=mem2.clone(); mem3=mem3.clone(); mem1.dataType=DataType.BYTE_BIN; mem2.dataType=DataType.BYTE_BIN; mem3.dataType=DataType.BYTE_BIN; list.push(mem3); list.push(mem2); list.push(mem1); tmp=new StringBuilder(); aByte.flush(tmp); tmpS=tmp.toString(); str.append(tmpS.substring(0, tmpS.length()-1)).append(" "); break; case TWENTYFOUR_HEX: str.append(getDataSpacesTabs()).append("!24 $") .append(ByteToExe(Unsigned.done(mem1.copy))) .append(ByteToExe(Unsigned.done(mem2.copy))) .append(ByteToExe(Unsigned.done(mem3.copy))) .append(" "); emptyPop(); break; case TWENTYFOUR_BIN: str.append(getDataSpacesTabs()).append("!24 %") .append(Integer.toBinaryString((mem1.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem2.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem3.copy & 0xFF) + 0x100).substring(1)) .append(" "); emptyPop(); break; case MACRO_HEX: case MACRO3_HEX: case MACRO5_HEX: str.append(getDataSpacesTabs()) .append("MonoSpriteLine $") .append(ByteToExe(Unsigned.done(mem1.copy))) .append(ByteToExe(Unsigned.done(mem2.copy))) .append(ByteToExe(Unsigned.done(mem3.copy))) .append(" "); emptyPop(); break; case MACRO_BIN: case MACRO3_BIN: case MACRO5_BIN: str.append(getDataSpacesTabs()) .append("MonoSpriteLine %") .append(Integer.toBinaryString((mem1.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem2.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem3.copy & 0xFF) + 0x100).substring(1)) .append(" "); emptyPop(); break; case MACRO1_HEX: str.append(getDataSpacesTabs()) .append((option.kickColonMacro ? ":":"")) .append("MonoSpriteLine($") .append(ByteToExe(Unsigned.done(mem1.copy))) .append(ByteToExe(Unsigned.done(mem2.copy))) .append(ByteToExe(Unsigned.done(mem3.copy))) .append(") "); emptyPop(); break; case MACRO1_BIN: str.append(getDataSpacesTabs()) .append((option.kickColonMacro ? ":":"")) .append("MonoSpriteLine(%") .append(Integer.toBinaryString((mem1.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem2.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem3.copy & 0xFF) + 0x100).substring(1)) .append(") "); emptyPop(); break; case MACRO2_HEX: str.append(getDataSpacesTabs()).append("+MonoSpriteLine $") .append(ByteToExe(Unsigned.done(mem1.copy))) .append(ByteToExe(Unsigned.done(mem2.copy))) .append(ByteToExe(Unsigned.done(mem3.copy))) .append(" "); emptyPop(); break; case MACRO2_BIN: str.append(getDataSpacesTabs()).append("+MonoSpriteLine %") .append(Integer.toBinaryString((mem1.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem2.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem3.copy & 0xFF) + 0x100).substring(1)) .append(" "); emptyPop(); break; case MACRO4_HEX: str.append(getDataSpacesTabs()).append("#MonoSpriteLine $") .append(ByteToExe(Unsigned.done(mem1.copy))) .append(ByteToExe(Unsigned.done(mem2.copy))) .append(ByteToExe(Unsigned.done(mem3.copy))) .append(" "); emptyPop(); break; case MACRO4_BIN: str.append(getDataSpacesTabs()).append("#MonoSpriteLine %") .append(Integer.toBinaryString((mem1.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem2.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem3.copy & 0xFF) + 0x100).substring(1)) .append(" "); emptyPop(); break; } carets.add(start, str.length(), mem1, Type.MONO_SPRITE); ///start=str.length(); str.append(getDataCSpacesTabs(str.length()-initial-getDataSpacesTabs().length())); // flush comment only for macro as byte flush it itself if (aMonoSprite!=BYTE_HEX && aMonoSprite!=BYTE_BIN) aComment.flush(str); else str.append("\n"); } else { // force to be as byte aByte.flush(str); } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { if ((sizeMonoSpriteBlock % 3)==0) flush(str); else if (sizeMonoSpriteBlock>=64) { flush(str); sizeMonoSpriteBlock=0; } } /** * Empty pop to have stack corrected */ private void emptyPop() { listRel.pop(); listRel.pop(); listRel.pop(); listRel2.pop(); listRel2.pop(); listRel2.pop(); listBase.pop(); listBase.pop(); listBase.pop(); listDest.pop(); listDest.pop(); listDest.pop(); } /** * Setting up the action type if this is the case * * @param str the output stream */ @Override public void setting(StringBuilder str) { switch (aMonoSprite) { case MACRO_HEX: case MACRO_BIN: str.append(getDataSpacesTabs()).append(".mac MonoSpriteLine \n") .append(getDataSpacesTabs()).append(" .byte {1} >> 16, ( {1} >> 8) & 255, {1} & 255\n") .append(getDataSpacesTabs()).append(".endm \n\n"); break; case MACRO1_HEX: case MACRO1_BIN: str.append(getDataSpacesTabs()).append(".macro MonoSpriteLine (tribyte) {\n") .append(getDataSpacesTabs()).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(getDataSpacesTabs()).append("}\n\n"); break; case MACRO2_HEX: case MACRO2_BIN: str.append(getDataSpacesTabs()).append("!macro MonoSpriteLine tribyte {\n") .append(getDataSpacesTabs()).append(" !byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(getDataSpacesTabs()).append("}\n\n"); break; case MACRO3_HEX: case MACRO3_BIN: str.append(getDataSpacesTabs()).append(".macro MonoSpriteLine tribyte \n") .append(getDataSpacesTabs()).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(getDataSpacesTabs()).append(".endmacro\n\n"); break; case MACRO4_HEX: case MACRO4_BIN: str.append( "MonoSpriteLine .macro \n" + " .byte \\1 >> 16, ( \\1 >> 8) & 255, \\1 & 255\n" + " .endm\n\n" ); break; case MACRO5_HEX: case MACRO5_BIN: str.append(getDataSpacesTabs()).append("MonoSpriteLine: macro ?tribyte \n") .append(getDataSpacesTabs()).append(" db ?tribyte >> 16, ( ?tribyte >> 8) & 255, ?tribyte & 255\n") .append(getDataSpacesTabs()).append("endm\n\n"); break; } }; } /** * Multicolor sprite declaration type * * -> [byte] $xx. * -> [byte] %b.. * -> !24 $xx.. * -> !24 %b.. * -> [.mac] %xx.. * -> [.mac] %b.. * -> [.macro] %b.. * -> [.macro] %xx.. */ public enum MultiSprite implements ActionType { BYTE_HEX, // [byte] $xx.. BYTE_BIN, // [byte] %b.. TWENTYFOUR_HEX,// !24 $xx.. TWENTYFOUR_BIN,// !24 %b.. MACRO_HEX, // [.mac] %xx.. (Dasm) MACRO_BIN, // [.mac] %b.. (Dasm) MACRO1_HEX, // [.macro] %xx.. (Kick assembler) MACRO1_BIN, // [.macro] %b.. (Kick assembler) MACRO2_HEX, // [.macro] %xx.. (Acme) MACRO2_BIN, // [.macro] %b.. (Acme) MACRO3_HEX, // [.macro] %xx.. (CA65) MACRO3_BIN, // [.macro] %b.. (CA65) MACRO4_HEX, // [.macro] %xx.. (TMPx) MACRO4_BIN, // [.macro] %b.. (TMPx) MACRO5_HEX, // [.macro] %xx.. (Glass) MACRO5_BIN, // [.macro] %b.. (Glass) ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; // we must receive a list of 3 or 1 final byte (if 2, uses as bytes) if (list.size()>=3) { MemoryDasm mem1=list.pop(); MemoryDasm mem2=list.pop(); MemoryDasm mem3=list.pop(); StringBuilder tmp; String tmpS; // add a dasm comment with pixels mem3.dasmComment=BinToMulti(Integer.toBinaryString((mem1.copy & 0xFF) + 0x100).substring(1))+ BinToMulti(Integer.toBinaryString((mem2.copy & 0xFF) + 0x100).substring(1))+ BinToMulti(Integer.toBinaryString((mem3.copy & 0xFF) + 0x100).substring(1)); lastMem=mem3; int initial=str.length(); int start=initial; // now we have one row of 3 bytes switch (aMultiSprite) { case BYTE_HEX: mem1=mem1.clone(); mem2=mem2.clone(); mem3=mem3.clone(); mem1.dataType=DataType.BYTE_HEX; mem2.dataType=DataType.BYTE_HEX; mem3.dataType=DataType.BYTE_HEX; list.push(mem3); list.push(mem2); list.push(mem1); tmp=new StringBuilder(); aByte.flush(tmp); tmpS=tmp.toString(); str.append(tmpS.substring(0, tmpS.length()-1)).append(" "); break; case BYTE_BIN: mem1=mem1.clone(); mem2=mem2.clone(); mem3=mem3.clone(); mem1.dataType=DataType.BYTE_BIN; mem2.dataType=DataType.BYTE_BIN; mem3.dataType=DataType.BYTE_BIN; list.push(mem3); list.push(mem2); list.push(mem1); tmp=new StringBuilder(); aByte.flush(tmp); tmpS=tmp.toString(); str.append(tmpS.substring(0, tmpS.length()-1)).append(" "); break; case TWENTYFOUR_HEX: str.append(getDataSpacesTabs()).append("!24 $") .append(ByteToExe(Unsigned.done(mem1.copy))) .append(ByteToExe(Unsigned.done(mem2.copy))) .append(ByteToExe(Unsigned.done(mem3.copy))) .append(" "); emptyPop(); break; case TWENTYFOUR_BIN: str.append(getDataSpacesTabs()).append("!24 %") .append(Integer.toBinaryString((mem1.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem2.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem3.copy & 0xFF) + 0x100).substring(1)) .append(" "); emptyPop(); break; case MACRO_HEX: case MACRO3_HEX: case MACRO5_HEX: str.append(getDataSpacesTabs()).append("MultiSpriteLine $") .append(ByteToExe(Unsigned.done(mem1.copy))) .append(ByteToExe(Unsigned.done(mem2.copy))) .append(ByteToExe(Unsigned.done(mem3.copy))) .append(" "); emptyPop(); break; case MACRO_BIN: case MACRO3_BIN: case MACRO5_BIN: str.append(getDataSpacesTabs()).append("MultiSpriteLine %") .append(Integer.toBinaryString((mem1.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem2.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem3.copy & 0xFF) + 0x100).substring(1)) .append(" "); emptyPop(); break; case MACRO1_HEX: str.append(getDataSpacesTabs()) .append((option.kickColonMacro ? ":":"")) .append("MultiSpriteLine($") .append(ByteToExe(Unsigned.done(mem1.copy))) .append(ByteToExe(Unsigned.done(mem2.copy))) .append(ByteToExe(Unsigned.done(mem3.copy))) .append(") "); emptyPop(); break; case MACRO1_BIN: str.append(getDataSpacesTabs()) .append((option.kickColonMacro ? ":":"")) .append("MultiSpriteLine(%") .append(Integer.toBinaryString((mem1.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem2.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem3.copy & 0xFF) + 0x100).substring(1)) .append(") "); emptyPop(); break; case MACRO2_HEX: str.append(getDataSpacesTabs()).append("+MultiSpriteLine $") .append(ByteToExe(Unsigned.done(mem1.copy))) .append(ByteToExe(Unsigned.done(mem2.copy))) .append(ByteToExe(Unsigned.done(mem3.copy))) .append(" "); emptyPop(); break; case MACRO2_BIN: str.append(getDataSpacesTabs()).append("+MultiSpriteLine %") .append(Integer.toBinaryString((mem1.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem2.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem3.copy & 0xFF) + 0x100).substring(1)) .append(" "); emptyPop(); break; case MACRO4_HEX: str.append(getDataSpacesTabs()).append("#MultiSpriteLine $") .append(ByteToExe(Unsigned.done(mem1.copy))) .append(ByteToExe(Unsigned.done(mem2.copy))) .append(ByteToExe(Unsigned.done(mem3.copy))) .append(" "); emptyPop(); break; case MACRO4_BIN: str.append(getDataSpacesTabs()).append("#MultiSpriteLine %") .append(Integer.toBinaryString((mem1.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem2.copy & 0xFF) + 0x100).substring(1)) .append(Integer.toBinaryString((mem3.copy & 0xFF) + 0x100).substring(1)) .append(" "); emptyPop(); break; } carets.add(start, str.length(), mem1, Type.MULTI_SPRITE); str.append(getDataCSpacesTabs(str.length()-initial-getDataSpacesTabs().length())); // flush comment only for macro as byte flush it itself if (aMultiSprite!=BYTE_HEX && aMultiSprite!=BYTE_BIN) aComment.flush(str); else str.append("\n"); //start=str.length(); } else { // force to be as byte aByte.flush(str); } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { if ((sizeMultiSpriteBlock % 3)==0) flush(str); else if (sizeMultiSpriteBlock>=64) { flush(str); sizeMultiSpriteBlock=0; } } /** * Empty pop to have stack corrected */ private void emptyPop() { listRel.pop(); listRel.pop(); listRel.pop(); listRel2.pop(); listRel2.pop(); listRel2.pop(); listBase.pop(); listBase.pop(); listBase.pop(); listDest.pop(); listDest.pop(); listDest.pop(); } /** * Setting up the action type if this is the case * * @param str the output stream */ @Override public void setting(StringBuilder str) { switch (aMultiSprite) { case MACRO_HEX: case MACRO_BIN: str.append(getDataSpacesTabs()).append(".mac MultiSpriteLine \n") .append(getDataSpacesTabs()).append(" .byte {1} >> 16, ( {1} >> 8) & 255, {1} & 255\n") .append(getDataSpacesTabs()).append(".endm \n\n"); break; case MACRO1_HEX: case MACRO1_BIN: str.append(getDataSpacesTabs()).append(".macro MultiSpriteLine (tribyte) {\n") .append(getDataSpacesTabs()).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(getDataSpacesTabs()).append("}\n\n"); break; case MACRO2_HEX: case MACRO2_BIN: str.append(getDataSpacesTabs()).append("!macro MultiSpriteLine tribyte {\n") .append(getDataSpacesTabs()).append(" !byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(getDataSpacesTabs()).append("}\n\n"); break; case MACRO3_HEX: case MACRO3_BIN: str.append(getDataSpacesTabs()).append(".macro MultiSpriteLine tribyte \n") .append(getDataSpacesTabs()).append(" .byte tribyte >> 16, ( tribyte >> 8) & 255, tribyte & 255\n") .append(getDataSpacesTabs()).append(".endmacro\n\n"); case MACRO4_HEX: case MACRO4_BIN: str.append( "MultiSpriteLine .macro \n" + " .byte \\1 >> 16, ( \\1 >> 8) & 255, \\1 & 255\n" + " .endm\n\n" ); break; case MACRO5_HEX: case MACRO5_BIN: str.append(getDataSpacesTabs()).append("MultiSpriteLine: macro ?tribyte \n") .append(getDataSpacesTabs()).append(" db ?tribyte >> 16, ( ?tribyte >> 8) & 255, ?tribyte & 255\n") .append(getDataSpacesTabs()).append("endm\n\n"); break; } }; } /** * Text declaration type * -> .byte "xxx" * -> .byt "xxx" * -> byte "xxx" * -> dc "xxx" * -> dc.b "xxx" * -> .byt "xxx" * -> !text "xxx" * -> .text "xxx" * -> !tx "xxx" * -> !raw "xxx" */ public enum Text implements ActionType { DOT_BYTE_TEXT, // .byte "xxx" DOT_BYT_TEXT, // .byt "xxx" BYTE_TEXT, // byte "xxx" DB_BYTE_TEXT, // db "xxx" DC_BYTE_TEXT, // dc "xxx" DC_B_BYTE_TEXT, // dc.b "xxx" DOT_BYT_BYTE_TEXT, // .byt "xxx" MARK_TEXT, // !text "xxx" MARK_TX_TEXT, // !tx "xxx" MARK_RAW_TEXT, // !raw "xxx" DOT_TEXT // .text "xxx" ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; boolean isString=false; boolean isFirst=true; boolean isSpecial=false; int position=0; int pos1=str.length(); int start=pos1; switch (aText) { case DOT_BYTE_TEXT: str.append(getDataSpacesTabs()).append((".byte ")); break; case DOT_BYT_TEXT: str.append(getDataSpacesTabs()).append((".byt ")); break; case DB_BYTE_TEXT: str.append(getDataSpacesTabs()).append(("db ")); break; case BYTE_TEXT: str.append(getDataSpacesTabs()).append(("byte ")); break; case DC_BYTE_TEXT: str.append(getDataSpacesTabs()).append(("dc ")); break; case DC_B_BYTE_TEXT: str.append(getDataSpacesTabs()).append(("dc.b ")); break; case MARK_TEXT: str.append(getDataSpacesTabs()).append(("!text ")); break; case MARK_TX_TEXT: str.append(getDataSpacesTabs()).append(("!tx ")); break; case MARK_RAW_TEXT: str.append(getDataSpacesTabs()).append(("!raw ")); break; case DOT_TEXT: str.append(getDataSpacesTabs()).append((".text ")); break; } int pos2=str.length(); MemoryDasm mem; MemoryDasm memRel; while (!list.isEmpty()) { // accodate each bytes in the format choosed mem=list.pop(); memRel=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); // not all char can be converted in string int val=(mem.copy & 0xFF); switch (option.assembler) { case DASM: if ( (!option.allowUtf && ((val<0x20 || val==0x22 || (val>127)))) || (option.allowUtf && ((val==0x00) || (val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case TMPX: if ( (!option.allowUtf && ((val<0x08) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x08) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { // sorry, we force to be bytes as tmpx did not supports byte in line of text if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } else if (isString) { str.append("\"\n"); isString=false; } list.push(mem); listRel.push(memRel); listRel2.push(null); listBase.push(null); listDest.push(null); aByte.flush(str); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case CA65: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case ACME: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ( (val==0x00) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } if (val==0x5C) str.append("\\"); str.append((char)val); } break; case KICK: if (isFirst) { position=str.length(); str.append("@\""); isString=true; isFirst=false; } if ( (!option.allowUtf && ((val<=0x1F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val>=0xA0))) || (option.allowUtf && ((val<=0x02) || (val==0x0A) || (val==0x0C) || (val==0x0D) || (val==0x0E) || (val==0x0F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val==0xA0) || (val==0xA3))) ) { str.append("\\$").append(ByteToExe(val)); isSpecial=true; } else if (val==0x22) { str.append("\\\""); isSpecial=true; } else if (val==0x5C) { str.append("\\\\"); isSpecial=true; } else str.append((char)val); break; case TASS64: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case GLASS: // don't use allowUTF if ( (val!=0x00 && val!=0x07 && val!=0x09 && val!=0x0A && val!=0x0C && val!=0x0D && val!=0x1B && val!=0x27) && ((( val<0x20 || (val>127)))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } switch (val) { case 0x00: str.append("\\0"); break; case 0x07: str.append("\\a"); break; case 0x09: str.append("\\t"); break; case 0x0A: str.append("\\n"); break; case 0x0C: str.append("\\f"); break; case 0x0D: str.append("\\r"); break; case 0x1B: str.append("\\e"); break; case 0x27: str.append("\\'"); break; case 0x22: str.append("\\\""); break; case 0x5C: str.append("\\\\"); break; default: str.append((char)val); break; } } break; } carets.add(start, str.length(), mem, Type.TEXT); if (list.isEmpty()) { if (isString) str.append("\"\n"); else str.append("\n"); if (option.assembler==Assembler.Name.KICK && !isSpecial) str.setCharAt(position, ' '); } start=str.length(); } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if (list.size()==option.maxTextAggregate) flush(str); } } /** * Text with number of chars */ public enum NumText implements ActionType { DOT_PTEXT_NUMTEXT, // -> .ptext "xxx" DOT_TEXT_NUMTEXT, // -> .text "xxx" DOT_TEXT_P_NUMTEXT, // -> .text n"xxx" DOT_BYTE_NUMTEXT, // -> .byte "xxx" DOT_BYT_NUMTEXT, // -> .byt "xxx" DB_BYTE_NUMTEXT, // -> db "xxx" MARK_TEXT_NUMTEXT, // -> !text "xxx" MARK_TX_NUMTEXT, // -> !tx "xxx" MARK_RAW_NUMTEXT, // -> !raw "xxx" BYTE_NUMTEXT, // -> byte "xxx" DC_NUMTEXT, // -> dc "xxx" DC_DOT_B_NUMTEXT // -> dc.b "xxx" ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; boolean isString=false; boolean isFirst=true; int pos1=str.length(); int start=pos1; switch (aNumText) { case DOT_PTEXT_NUMTEXT: str.append(getDataSpacesTabs()).append((".ptext ")); break; case DOT_TEXT_NUMTEXT: str.append(getDataSpacesTabs()).append((".text ")); break; case DOT_TEXT_P_NUMTEXT: str.append(getDataSpacesTabs()).append((".text p")); break; case DOT_BYTE_NUMTEXT: str.append(getDataSpacesTabs()).append((".byte ")); break; case DOT_BYT_NUMTEXT: str.append(getDataSpacesTabs()).append((".byt ")); break; case DB_BYTE_NUMTEXT: str.append(getDataSpacesTabs()).append(("db ")); break; case MARK_TEXT_NUMTEXT: str.append(getDataSpacesTabs()).append(("!text ")); break; case MARK_TX_NUMTEXT: str.append(getDataSpacesTabs()).append(("!tx ")); break; case MARK_RAW_NUMTEXT: str.append(getDataSpacesTabs()).append(("!raw ")); break; case BYTE_NUMTEXT: str.append(getDataSpacesTabs()).append(("byte ")); break; case DC_NUMTEXT: str.append(getDataSpacesTabs()).append(("dc ")); break; case DC_DOT_B_NUMTEXT: str.append(getDataSpacesTabs()).append(("dc.b ")); break; } int pos2=str.length(); MemoryDasm mem; MemoryDasm memRel; if (option.assembler==Assembler.Name.TMPX || option.assembler==Assembler.Name.TASS64) { // this byte is calculated by instruction list.pop(); listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); } while (!list.isEmpty()) { // accodate each bytes in the format choosed mem=list.pop(); memRel=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); // not all char can be converted in string int val=(mem.copy & 0xFF); switch (option.assembler) { case DASM: if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else { if ( (!option.allowUtf && (val<0x20 || val==0x22 || (val>127))) || (option.allowUtf && ((val==0x00) || (val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } } break; case TMPX: if ( (!option.allowUtf && ((val<0x08) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x08) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { // sorry, we force to be bytes as tmpx did not supports byte in line of text if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } else if (isString) { str.append("\"\n"); isString=false; } list.push(mem); listRel.push(memRel); listRel2.push(null); listBase.push(null); listDest.push(null); aByte.flush(str); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case CA65: if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else { if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } } break; case ACME: if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else { if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ( (val==0x00) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } if (val==0x5C) str.append("\\"); str.append((char)val); } } break; case KICK: if (isFirst) { str.append("@\"\\$").append(ByteToExe(Unsigned.done(mem.copy))); isString=true; isFirst=false; } else { if ( (!option.allowUtf && ((val<=0x1F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val>=0xA0))) || (option.allowUtf && ((val<=0x02) || (val==0x0A) || (val==0x0C) || (val==0x0D) || (val==0x0E) || (val==0x0F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val==0xA0) || (val==0xA3))) ) { str.append("\\$").append(ByteToExe(val)); } else if (val==0x22) str.append("\\\""); else if (val==0x5C) str.append("\\\\"); else str.append((char)val); } break; case TASS64: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case GLASS: // don't use allowUTF if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else { if ( (val!=0x00 && val!=0x07 && val!=0x09 && val!=0x0A && val!=0x0C && val!=0x0D && val!=0x1B && val!=0x27) && ((( val<0x20 || (val>127)))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } switch (val) { case 0x00: str.append("\\0"); break; case 0x07: str.append("\\a"); break; case 0x09: str.append("\\t"); break; case 0x0A: str.append("\\n"); break; case 0x0C: str.append("\\f"); break; case 0x0D: str.append("\\r"); break; case 0x1B: str.append("\\e"); break; case 0x27: str.append("\\'"); break; case 0x22: str.append("\\\""); break; case 0x5C: str.append("\\\\"); break; default: str.append((char)val); break; } } } break; } carets.add(start, str.length(), mem, Type.NUM_TEXT); if (list.isEmpty()) { if (isString) str.append("\"\n"); else str.append("\n"); } start=str.length(); } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { if (numText==null) numText=mem; // look if it is time to aggregate data if (list.size()==numText.copy+1) { flush(str); numText=null; } } } /** * Text terminated with zero */ public enum ZeroText implements ActionType { DOT_NULL_ZEROTEXT, // -> .null "xxx" DOT_TEXT_ZEROTEXT, // -> -text "xxx" DOT_TEXT_N_ZEROTEXT, // -> -text n"xxx" DOT_BYTE_ZEROTEXT, // -> .byte "xxx" DOT_ASCIIZ_ZEROTEXT, // -> .asciiz "xxx" DB_BYTE_ZEROTEXT, // -> db "xxx" BYTE_ZEROTEXT, // -> byte "xxx" MARK_TEXT_ZEROTEXT, // -> !text "xxx" MARK_TX_ZEROTEXT, // -> !tx "xxx" MARK_RAW_ZEROTEXT, // -> !raw "xxx" DC_BYTE_ZEROTEXT, // -> dc "xxx" DC_B_BYTE_ZEROTEXT // -> dc.b "xxx" ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; boolean isString=false; boolean isFirst=true; boolean isSpecial=false; int position=0; int pos1=str.length(); int start=pos1; switch (aZeroText) { case DOT_NULL_ZEROTEXT: str.append(getDataSpacesTabs()).append((".null ")); break; case DOT_TEXT_ZEROTEXT: str.append(getDataSpacesTabs()).append((".text ")); break; case DOT_TEXT_N_ZEROTEXT: str.append(getDataSpacesTabs()).append((".text n")); break; case DOT_BYTE_ZEROTEXT: str.append(getDataSpacesTabs()).append((".byte ")); break; case DOT_ASCIIZ_ZEROTEXT: str.append(getDataSpacesTabs()).append((".asciiz ")); break; case DB_BYTE_ZEROTEXT: str.append(getDataSpacesTabs()).append(("db ")); break; case MARK_TEXT_ZEROTEXT: str.append(getDataSpacesTabs()).append(("!text ")); break; case MARK_TX_ZEROTEXT: str.append(getDataSpacesTabs()).append(("!tx ")); break; case MARK_RAW_ZEROTEXT: str.append(getDataSpacesTabs()).append(("!raw ")); break; case BYTE_ZEROTEXT: str.append(getDataSpacesTabs()).append(("byte ")); break; case DC_BYTE_ZEROTEXT: str.append(getDataSpacesTabs()).append(("dc ")); break; case DC_B_BYTE_ZEROTEXT: str.append(getDataSpacesTabs()).append(("dc.b ")); break; } int pos2=str.length(); MemoryDasm mem; MemoryDasm memRel; while (!list.isEmpty()) { // accodate each bytes in the format choosed mem=list.pop(); memRel=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); // not all char can be converted in string int val=(mem.copy & 0xFF); switch (option.assembler) { case DASM: if ( (!option.allowUtf && (val<0x20 || val==0x22 || (val>127))) || (option.allowUtf && ((val==0x00) || (val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case TMPX: if ( (!option.allowUtf && (val<0x08) || ((val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x08) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { // sorry, we force to be bytes as tmpx did not supports byte in line of text if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } else if (isString) { str.append("\"\n"); isString=false; } list.push(mem); listRel.push(memRel); listRel2.push(null); listBase.push(null); listDest.push(null); aByte.flush(str); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } if (list.size()==1) { // terminating 0 is ommitted list.pop(); listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); } break; case CA65: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } if (list.size()==1) { // terminating 0 is ommitted list.pop(); listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); } break; case ACME: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ( (val==0x00) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } if (val==0x5C) str.append("\\"); str.append((char)val); } if (list.size()==1) { // terminating 0 is ommitted list.pop(); listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); } break; case KICK: if (isFirst) { position=str.length(); str.append("@\""); isString=true; isFirst=false; } if ( (!option.allowUtf && ((val<=0x1F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val>=0xA0))) || (option.allowUtf && ((val<=0x02) || (val==0x0A) || (val==0x0C) || (val==0x0D) || (val==0x0E) || (val==0x0F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val==0xA0) || (val==0xA3))) ) { str.append("\\$").append(ByteToExe(val)); isSpecial=true; } else if (val==0x22) { str.append("\\\""); isSpecial=true; } else if (val==0x5C) { str.append("\\\\"); isSpecial=true; } else str.append((char)val); break; case TASS64: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } if (list.size()==1) { // terminating 0 is ommitted list.pop(); listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); } break; case GLASS: // don't use allowUTF if ( (val!=0x00 && val!=0x07 && val!=0x09 && val!=0x0A && val!=0x0C && val!=0x0D && val!=0x1B && val!=0x27) && ((( val<0x20 || (val>127)))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } switch (val) { case 0x00: str.append("\\0"); break; case 0x07: str.append("\\a"); break; case 0x09: str.append("\\t"); break; case 0x0A: str.append("\\n"); break; case 0x0C: str.append("\\f"); break; case 0x0D: str.append("\\r"); break; case 0x1B: str.append("\\e"); break; case 0x27: str.append("\\'"); break; case 0x22: str.append("\\\""); break; case 0x5C: str.append("\\\\"); break; default: str.append((char)val); break; } } break; } carets.add(start, str.length(), mem, Type.ZERO_TEXT); if (list.isEmpty()) { if (isString) str.append("\"\n"); else str.append("\n"); if (option.assembler==Assembler.Name.KICK && !isSpecial) str.setCharAt(position, ' '); } start=str.length(); } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if (mem.copy==0) flush(str); } } /** * Text terminated with high bit 1 */ public enum HighText implements ActionType { DOT_BYTE_HIGHTEXT, // -> .byte "xxx" DOT_BYT_HIGHTEXT, // -> .byt "xxx" DOT_TEXT_HIGHTEXT, // -> .text "xxx" DOT_TEXT_S_HIGHTEXT, // -> .text s"xxx" DB_BYTE_HIGHTEXT, // -> db "xxx" BYTE_HIGHTEXT, // -> byte "xxx" MARK_TEXT_HIGHTEXT, // -> !text "xxx" MARK_TX_HIGHTEXT, // -> !tx "xxx" MARK_RAW_HIGHTEXT, // -> !raw "xxx" DC_BYTE_HIGHTEXT, // -> dc "xxx" DC_B_BYTE_HIGHTEXT, // -> dc.b "xxx" DOT_SHIFT_HIGHTEXT // -> .shift "xxx" ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; boolean isString=false; boolean isFirst=true; int pos1=str.length(); int start=pos1; switch (aHighText) { case DOT_SHIFT_HIGHTEXT: str.append(getDataSpacesTabs()).append((".shift ")); break; case DOT_TEXT_HIGHTEXT: str.append(getDataSpacesTabs()).append((".text ")); break; case DOT_TEXT_S_HIGHTEXT: str.append(getDataSpacesTabs()).append((".text s")); break; case DOT_BYTE_HIGHTEXT: str.append(getDataSpacesTabs()).append((".byte ")); break; case DOT_BYT_HIGHTEXT: str.append(getDataSpacesTabs()).append((".byt ")); break; case DB_BYTE_HIGHTEXT: str.append(getDataSpacesTabs()).append(("db ")); break; case MARK_TEXT_HIGHTEXT: str.append(getDataSpacesTabs()).append(("!text ")); break; case MARK_TX_HIGHTEXT: str.append(getDataSpacesTabs()).append(("!tx ")); break; case MARK_RAW_HIGHTEXT: str.append(getDataSpacesTabs()).append(("!raw ")); break; case BYTE_HIGHTEXT: str.append(getDataSpacesTabs()).append(("byte ")); break; case DC_BYTE_HIGHTEXT: str.append(getDataSpacesTabs()).append(("dc ")); break; case DC_B_BYTE_HIGHTEXT: str.append(getDataSpacesTabs()).append(("dc.b ")); break; } int pos2=str.length(); MemoryDasm mem; MemoryDasm memRel; while (!list.isEmpty()) { // accodate each bytes in the format choosed mem=list.pop(); memRel=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); // not all char can be converted in string int val=(mem.copy & 0xFF); switch (option.assembler) { case DASM: if ( (!option.allowUtf && (val<0x20 || val==0x22 || (val>127))) || (option.allowUtf && ((val==0x00) || (val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case TMPX: if (list.size()==1) { // terminating has 1 converted to 0 mem=list.pop(); listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); str.append((char)(mem.copy & 0x7F)); } if ( (!option.allowUtf && ((val<0x08) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x08) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { // sorry, we force to be bytes as tmpx did not supports byte in line of text if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } else if (isString) { str.append("\"\n"); isString=false; } list.push(mem); listRel.push(memRel); listRel2.push(null); listBase.push(null); listDest.push(null); aByte.flush(str); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case CA65: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case ACME: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ( (val==0x00) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } if (val==0x5C) str.append("\\"); str.append((char)val); } break; case KICK: if (isFirst) { str.append("@\""); isString=true; isFirst=false; } if ( (!option.allowUtf && ((val<=0x1F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val>=0xA0))) || (option.allowUtf && ((val<=0x02) || (val==0x0A) || (val==0x0C) || (val==0x0D) || (val==0x0E) || (val==0x0F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val==0xA0) || (val==0xA3))) ) { str.append("\\$").append(ByteToExe(val)); } else if (val==0x22) { str.append("\\\""); } else if (val==0x5C) { str.append("\\\\"); } else str.append((char)val); break; case TASS64: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } if (list.size()==1) { // terminating has 1 converted to 0 mem=list.pop(); listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); str.append((char)(mem.copy & 0x7F)); } break; case GLASS: // don't use allowUTF if ( (val!=0x00 && val!=0x07 && val!=0x09 && val!=0x0A && val!=0x0C && val!=0x0D && val!=0x1B && val!=0x27) && ((( val<0x20 || (val>127)))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } switch (val) { case 0x00: str.append("\\0"); break; case 0x07: str.append("\\a"); break; case 0x09: str.append("\\t"); break; case 0x0A: str.append("\\n"); break; case 0x0C: str.append("\\f"); break; case 0x0D: str.append("\\r"); break; case 0x1B: str.append("\\e"); break; case 0x27: str.append("\\'"); break; case 0x22: str.append("\\\""); break; case 0x5C: str.append("\\\\"); break; default: str.append((char)val); break; } } break; } carets.add(start, str.length(), mem, Type.HIGH_TEXT); if (list.isEmpty()) { if (isString) str.append("\"\n"); else str.append("\n"); } start=str.length(); } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if ((mem.copy & 0X80) !=0) flush(str); } } /** * Text left shifted */ public enum ShiftText implements ActionType { DOT_BYTE_SHIFTTEXT, // -> .byte "xxx" DOT_BYT_SHIFTTEXT, // -> .byt "xxx" DOT_TEXT_SHIFTTEXT, // -> .text "xxx" DOT_TEXT_L_SHIFTTEXT, // -> .text l"xxx" DB_BYTE_SHIFTTEXT, // -> db "xxx" BYTE_SHIFTTEXT, // -> byte "xxx" MARK_TEXT_SHIFTTEXT, // -> !text "xxx" MARK_TX_SHIFTTEXT, // -> !tx "xxx" MARK_RAW_SHIFTTEXT, // -> !raw "xxx" DC_BYTE_SHIFTTEXT, // -> dc "xxx" DC_B_BYTE_SHIFTTEXT, // -> dc.b "xxx" DOT_SHIFTL_SHIFTTEXT // -> .shiftl "xxx" ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; boolean isString=false; boolean isFirst=true; boolean isSpecial=false; int position=0; int pos1=str.length(); int start=pos1; switch (aShiftText) { case DOT_BYTE_SHIFTTEXT: str.append(getDataSpacesTabs()).append((".byte ")); break; case DOT_BYT_SHIFTTEXT: str.append(getDataSpacesTabs()).append((".byt ")); break; case BYTE_SHIFTTEXT: str.append(getDataSpacesTabs()).append(("byte ")); break; case DC_BYTE_SHIFTTEXT: str.append(getDataSpacesTabs()).append(("dc ")); break; case DC_B_BYTE_SHIFTTEXT: str.append(getDataSpacesTabs()).append(("dc.b ")); break; case DB_BYTE_SHIFTTEXT: str.append(getDataSpacesTabs()).append(("db ")); break; case MARK_TEXT_SHIFTTEXT: str.append(getDataSpacesTabs()).append(("!text ")); break; case MARK_TX_SHIFTTEXT: str.append(getDataSpacesTabs()).append(("!tx ")); break; case MARK_RAW_SHIFTTEXT: str.append(getDataSpacesTabs()).append(("!raw ")); break; case DOT_TEXT_SHIFTTEXT: str.append(getDataSpacesTabs()).append((".text ")); break; case DOT_TEXT_L_SHIFTTEXT: str.append(getDataSpacesTabs()).append((".text l")); break; case DOT_SHIFTL_SHIFTTEXT: str.append(getDataSpacesTabs()).append((".shiftl ")); break; } int pos2=str.length(); MemoryDasm mem; MemoryDasm memRel; while (!list.isEmpty()) { // accodate each bytes in the format choosed mem=list.pop(); memRel=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); // not all char can be converted in string int val=(mem.copy & 0xFF); switch (option.assembler) { case DASM: if ( (!option.allowUtf && (val<0x20 || val==0x22 || (val>127))) || (option.allowUtf && ((val==0x00) || (val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case TMPX: val>>=1; if ( (!option.allowUtf && ((val<0x08) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x08) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { // sorry, we force to be bytes as tmpx did not supports byte in line of text if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } else if (isString) { str.append("\"\n"); isString=false; } list.push(mem); listRel.push(memRel); listRel2.push(null); listBase.push(null); listDest.push(null); aByte.flush(str); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case CA65: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case ACME: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ( (val==0x00) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } if (val==0x5C) str.append("\\"); str.append((char)val); } break; case KICK: if (isFirst) { position=str.length(); str.append("@\""); isString=true; isFirst=false; } if ( (!option.allowUtf && ((val<=0x1F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val>=0xA0))) || (option.allowUtf && ((val<=0x02) || (val==0x0A) || (val==0x0C) || (val==0x0D) || (val==0x0E) || (val==0x0F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val==0xA0) || (val==0xA3))) ) { str.append("\\$").append(ByteToExe(val)); isSpecial=true; } else if (val==0x22) { str.append("\\\""); isSpecial=true; } else if (val==0x5C) { str.append("\\\\"); isSpecial=true; } else str.append((char)val); break; case TASS64: val>>=1; if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case GLASS: // don't use allowUTF if ( (val!=0x00 && val!=0x07 && val!=0x09 && val!=0x0A && val!=0x0C && val!=0x0D && val!=0x1B && val!=0x27) && ((( val<0x20 || (val>127)))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } switch (val) { case 0x00: str.append("\\0"); break; case 0x07: str.append("\\a"); break; case 0x09: str.append("\\t"); break; case 0x0A: str.append("\\n"); break; case 0x0C: str.append("\\f"); break; case 0x0D: str.append("\\r"); break; case 0x1B: str.append("\\e"); break; case 0x27: str.append("\\'"); break; case 0x22: str.append("\\\""); break; case 0x5C: str.append("\\\\"); break; default: str.append((char)val); break; } } break; } carets.add(start, str.length(), mem, Type.SHIFT_TEXT); if (list.isEmpty()) { if (isString) str.append("\"\n"); else str.append("\n"); if (option.assembler==Assembler.Name.KICK && !isSpecial) str.setCharAt(position, ' '); } start=str.length(); } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if (list.size()==option.maxTextAggregate) flush(str); } } /** * Text to screen code */ public enum ScreenText implements ActionType { DOT_BYTE_SCREENTEXT, // -> .byte "xxx" DOT_BYT_SCREENTEXT, // -> .byt "xxx" DOT_TEXT_SCREENTEXT, // -> .text "xxx" DOT_SCREEN_SCREENTEXT, // -> .screen "xxx" DB_BYTE_SCREENTEXT, // -> db "xxx" BYTE_SCREENTEXT, // -> byte "xxx" MARK_SCR_SCREENTEXT, // -> !scr "xxx" DC_BYTE_SCREENTEXT, // -> dc "xxx" DC_B_BYTE_SCREENTEXT // -> dc.b "xxx" ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; boolean isString=false; boolean isFirst=true; boolean isSpecial=false; int position=0; int pos1=str.length(); int start=pos1; switch (aScreenText) { case DOT_BYTE_SCREENTEXT: str.append(getDataSpacesTabs()).append((".byte ")); break; case DOT_BYT_SCREENTEXT: str.append(getDataSpacesTabs()).append((".byt ")); break; case BYTE_SCREENTEXT: str.append(getDataSpacesTabs()).append(("byte ")); break; case DC_BYTE_SCREENTEXT: str.append(getDataSpacesTabs()).append(("dc ")); break; case DC_B_BYTE_SCREENTEXT: str.append(getDataSpacesTabs()).append(("dc.b ")); break; case DB_BYTE_SCREENTEXT: str.append(getDataSpacesTabs()).append(("db ")); break; case MARK_SCR_SCREENTEXT: str.append(getDataSpacesTabs()).append(("!scr ")); break; case DOT_TEXT_SCREENTEXT: str.append(getDataSpacesTabs()).append((".text ")); break; case DOT_SCREEN_SCREENTEXT: str.append(getDataSpacesTabs()).append((".screen ")); break; } int pos2=str.length(); MemoryDasm mem; MemoryDasm memRel; while (!list.isEmpty()) { // accodate each bytes in the format choosed mem=list.pop(); memRel=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); // not all char can be converted in string int val=(mem.copy & 0xFF); switch (option.assembler) { case DASM: if ( (!option.allowUtf && (val<0x20 || val==0x22 || (val>127))) || (option.allowUtf && ((val==0x00) || (val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case TMPX: if ( (val==0x22) || (val>127) ) { // sorry, we force to be bytes as tmpx did not supports byte in line of text if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } else if (isString) { str.append("\"\n"); isString=false; } list.push(mem); listRel.push(memRel); listRel2.push(null); listBase.push(null); listDest.push(null); aByte.flush(str); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)(mem.copy & 0xFF)); } if (val==0) str.append('@'); else if (val<=0x1A) str.append((char)(val+96)); else if (val<=0x1F) str.append((char)(val+64)); else if (val==64) str.append('`'); else str.append((char)val); break; case CA65: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case ACME: if ( (val==0x22) || (val>127) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } if (val==0x5C) str.append("\\"); if (val==0) str.append('@'); else if (val<=0x1A) str.append((char)(val+96)); else if (val<=0x1F) str.append((char)(val+64)); else if (val==64) str.append('`'); else str.append((char)val); } break; case KICK: if (isFirst) { position=str.length(); str.append("@\""); isString=true; isFirst=false; } if ( (!option.allowUtf && ((val<=0x1F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val>=0xA0))) || (option.allowUtf && ((val<=0x02) || (val==0x0A) || (val==0x0C) || (val==0x0D) || (val==0x0E) || (val==0x0F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val==0xA0) || (val==0xA3))) ) { str.append("\\$").append(ByteToExe(val)); isSpecial=true; } else if (val==0x22) { str.append("\\\""); isSpecial=true; } else if (val==0x5C) { str.append("\\\\"); isSpecial=true; } else str.append((char)val); break; case TASS64: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case GLASS: // don't use allowUTF if ( (val!=0x00 && val!=0x07 && val!=0x09 && val!=0x0A && val!=0x0C && val!=0x0D && val!=0x1B && val!=0x27) && ((( val<0x20 || (val>127)))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } switch (val) { case 0x00: str.append("\\0"); break; case 0x07: str.append("\\a"); break; case 0x09: str.append("\\t"); break; case 0x0A: str.append("\\n"); break; case 0x0C: str.append("\\f"); break; case 0x0D: str.append("\\r"); break; case 0x1B: str.append("\\e"); break; case 0x27: str.append("\\'"); break; case 0x22: str.append("\\\""); break; case 0x5C: str.append("\\\\"); break; default: str.append((char)val); break; } } break; } carets.add(start, str.length(), mem, Type.SCREEN_TEXT); if (list.isEmpty()) { if (isString) str.append("\"\n"); else str.append("\n"); if (option.assembler==Assembler.Name.KICK && !isSpecial) str.setCharAt(position, ' '); } start=str.length(); } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if (list.size()==option.maxTextAggregate) flush(str); } } /** * Text to pewtascii code */ public enum PetasciiText implements ActionType { DOT_BYTE_PETASCIITEXT, // -> .byte "xxx" DOT_BYT_PETASCIITEXT, // -> .byt "xxx" DOT_TEXT_PETASCIITEXT, // -> .text "xxx" DB_BYTE_PETASCIITEXT, // -> db "xxx" BYTE_PETASCIITEXT, // -> byte "xxx" MARK_PET_PETASCIITEXT, // -> !pet "xxx" DC_BYTE_PETASCIITEXT, // -> dc "xxx" DC_B_BYTE_PETASCIITEXT // -> dc.b "xxx" ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; boolean isString=false; boolean isFirst=true; boolean isSpecial=false; int position=0; int pos1=str.length(); int start=pos1; switch (aPetasciiText) { case DOT_BYTE_PETASCIITEXT: str.append(getDataSpacesTabs()).append((".byte ")); break; case DOT_BYT_PETASCIITEXT: str.append(getDataSpacesTabs()).append((".byt ")); break; case BYTE_PETASCIITEXT: str.append(getDataSpacesTabs()).append(("byte ")); break; case DC_BYTE_PETASCIITEXT: str.append(getDataSpacesTabs()).append(("dc ")); break; case DC_B_BYTE_PETASCIITEXT: str.append(getDataSpacesTabs()).append(("dc.b ")); break; case DB_BYTE_PETASCIITEXT: str.append(getDataSpacesTabs()).append(("db ")); break; case MARK_PET_PETASCIITEXT: str.append(getDataSpacesTabs()).append(("!pet ")); break; case DOT_TEXT_PETASCIITEXT: str.append(getDataSpacesTabs()).append((".text ")); break; } int pos2=str.length(); MemoryDasm mem; MemoryDasm memRel; while (!list.isEmpty()) { // accodate each bytes in the format choosed mem=list.pop(); memRel=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); // not all char can be converted in string int val=(mem.copy & 0xFF); switch (option.assembler) { case DASM: if ( (!option.allowUtf && (val<0x20 || val==0x22 || (val>127))) || (option.allowUtf && ((val==0x00) || (val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case TMPX: if ( (!option.allowUtf && ((val<0x08) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x08) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { // sorry, we force to be bytes as tmpx did not supports byte in line of text if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } else if (isString) { str.append("\"\n"); isString=false; } list.push(mem); listRel.push(memRel); listRel2.push(null); listBase.push(null); listDest.push(null); aByte.flush(str); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case CA65: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case ACME: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ( (val==0x00) || (val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } if (val==0x5C) str.append("\\"); if (val>=0xC1 && val<=0xDA) str.append((char)(val & 0x7F)); else if (val>=0x41 && val<=0x5A) str.append((char)(val+32)); else str.append((char)val); } break; case KICK: if (isFirst) { position=str.length(); str.append("@\""); isString=true; isFirst=false; } if ( (!option.allowUtf && ((val<=0x1F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val>=0xA0))) || (option.allowUtf && ((val<=0x02) || (val==0x0A) || (val==0x0C) || (val==0x0D) || (val==0x0E) || (val==0x0F) || (val==0x40) || (val==0x5B) || (val==0x5D) || (val>=0x61 && val<=0x7A) || (val==0x7F) || (val==0xA0) || (val==0xA3))) ) { str.append("\\$").append(ByteToExe(val)); isSpecial=true; } else if (val==0x22) { str.append("\\\""); isSpecial=true; } else if (val==0x5C) { str.append("\\\\"); isSpecial=true; } else str.append((char)val); break; case TASS64: if ( (!option.allowUtf && ((val<=0x1F) || (val==0x22) || (val>127))) || (option.allowUtf && ((val==0x0A) || (val==0x0D) || (val==0x22) || (val>127))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } str.append((char)val); } break; case GLASS: // don't use allowUTF if ( (val!=0x00 && val!=0x07 && val!=0x09 && val!=0x0A && val!=0x0C && val!=0x0D && val!=0x1B && val!=0x27) && ((( val<0x20 || (val>127)))) ) { if (isString) { str.append("\""); isString=false; } if (isFirst) { str.append("$").append(ByteToExe(val)); isFirst=false; } else str.append(", $").append(ByteToExe(val)); } else { if (isFirst) { isFirst=false; isString=true; str.append("\""); } else if (!isString) { str.append(", \""); isString=true; } switch (val) { case 0x00: str.append("\\0"); break; case 0x07: str.append("\\a"); break; case 0x09: str.append("\\t"); break; case 0x0A: str.append("\\n"); break; case 0x0C: str.append("\\f"); break; case 0x0D: str.append("\\r"); break; case 0x1B: str.append("\\e"); break; case 0x27: str.append("\\'"); break; case 0x22: str.append("\\\""); break; case 0x5C: str.append("\\\\"); break; default: str.append((char)val); break; } } break; } carets.add(start, str.length(), mem, Type.PETASCII_TEXT); if (list.isEmpty()) { if (isString) str.append("\"\n"); else str.append("\n"); if (option.assembler==Assembler.Name.KICK && !isSpecial) str.setCharAt(position, ' '); } start=str.length(); } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if (list.size()==option.maxTextAggregate) flush(str); } } /** * Stack Word */ public enum StackWord implements ActionType { DOT_RTA_STACKWORD, // -> .rta $xxyy MACRO_STACKWORD, // -> [.mac] $xxyy (DASM) MACRO1_STACKWORD, // -> [.mac] $xxyy (KickAssembler) MACRO2_STACKWORD, // -> [.mac] $xxyy (Acme) MACRO3_STACKWORD, // -> [.mac] $xxyy (CA65) MACRO4_STACKWORD, // -> [.mac] $xxyy (Glass) MACRO5_STACKWORD // -> [.mac] xxyyz (AS) ; @Override public void flush(StringBuilder str) { if (list.isEmpty()) return; MemoryDasm memLow; MemoryDasm memHigh; MemoryDasm memRelLow; MemoryDasm memRelHigh; int pos1=str.length(); // store initial position int start=pos1; int index=(int)(list.size()/2); // create starting command according to the kind of byte switch (aStackWord) { case DOT_RTA_STACKWORD: str.append(getDataSpacesTabs()).append((".rta ")); break; case MACRO_STACKWORD: case MACRO3_STACKWORD: case MACRO4_STACKWORD: case MACRO5_STACKWORD: str.append(getDataSpacesTabs()).append("Stack").append(index).append(" "); break; case MACRO1_STACKWORD: str.append(getDataSpacesTabs()).append("Stack").append(index).append("("); // must close the ) break; case MACRO2_STACKWORD: str.append(getDataSpacesTabs()).append("+Stack").append(index).append(" "); break; } int pos2=str.length(); // store final position boolean isFirst=true; // true if this is the first output // we use word, so check for his default mode boolean defaultMode=(aWord!=DW_WORD_H); while (!list.isEmpty()) { // if only 1 byte left, use byte coding if (list.size()==1) { if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } aByte.flush(str); } else { memLow=list.pop(); memRelLow=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); memHigh=list.pop(); memRelHigh=listRel.pop(); listRel2.pop(); listBase.pop(); listDest.pop(); if (memLow.type==TYPE_MINOR && memHigh.type==TYPE_MAJOR && memLow.related==memHigh.related) { if (memRelLow.userLocation!=null && !"".equals(memRelLow.userLocation)) str.append(memRelLow.userLocation).append("+1"); else if (memRelLow.dasmLocation!=null && !"".equals(memRelLow.dasmLocation)) str.append(memRelLow.dasmLocation).append("+1"); else str.append(HexNum(ShortToExe(memRelLow.address+1), defaultMode)); isFirst=false; } else { // if cannot make a word with relative locations, force all to be of byte type if (memLow.type==TYPE_MINOR || memLow.type==TYPE_MAJOR || memLow.type==TYPE_PLUS_MAJOR || memLow.type==TYPE_PLUS_MINOR || memHigh.type==TYPE_MINOR || memHigh.type==TYPE_MAJOR || memHigh.type==TYPE_PLUS_MAJOR || memHigh.type==TYPE_PLUS_MINOR) { list.addFirst(memHigh); list.addFirst(memLow); listRel.addFirst(memRelHigh); listRel.addFirst(memRelLow); listRel2.addFirst(null); listRel2.addFirst(null); listBase.push(null); listDest.push(null); if (isFirst) { str.replace(pos1, pos2, ""); isFirst=false; } aByte.flush(str); } else { str.append( HexNum(ByteToExe(Unsigned.done(memHigh.copy))+ByteToExe((Unsigned.done(memLow.copy)+1)& 0xFF), defaultMode) ); isFirst=false; } } carets.add(start, str.length(), memLow, Type.STACK_WORD); if (list.size()>=2) str.append(", "); else if (aStackWord==MACRO1_STACKWORD) str.append(")\n"); else str.append("\n"); start=str.length(); } } } /** * Put a value to the stream * * @param str the otput stream * @param mem the memory dasm * @param option the option to use */ @Override public void putValue(StringBuilder str, MemoryDasm mem, Option option) { // look if it is time to aggregate data if (list.size()==option.maxStackWordAggregate*2) flush(str); } @Override public void setting(StringBuilder str) { String spaces=getDataSpacesTabs(); switch (aStackWord) { case MACRO_STACKWORD: str.append(spaces).append(".mac Stack1 \n") .append(spaces).append(" .word {1}-1 \n") .append(spaces).append(".endm \n\n") .append(spaces).append(".mac Stack2 \n") .append(spaces).append(" .word {1}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1 \n") .append(spaces).append(".endm \n\n") .append(spaces).append(".mac Stack3 \n") .append(spaces).append(" .word {1}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1 \n") .append(spaces).append(".endm \n\n") .append(spaces).append(".mac Stack4 \n") .append(spaces).append(" .word {1}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1 \n") .append(spaces).append(" .endm \n\n") .append(spaces).append(".mac Stack5 \n") .append(spaces).append(" .word {1}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1, {5}-1 \n") .append(spaces).append(".endm \n\n") .append(spaces).append(".mac Stack6 \n") .append(spaces).append(" .word {1}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1, {5}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1, {5}-1, {6}-1 \n") .append(spaces).append(".endm \n\n") .append(spaces).append(".mac Stack7 \n") .append(spaces).append(" .word {1}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1, {5}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1, {5}-1, {6}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1, {5}-1, {6}-1, {7}-1 \n") .append(spaces).append(".endm \n\n") .append(spaces).append(".mac Stack8 \n") .append(spaces).append(" .word {1}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1, {5}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1, {5}-1, {6}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1, {5}-1, {6}-1, {7}-1 \n") .append(spaces).append(" .word {1}-1, {2}-1, {3}-1, {4}-1, {5}-1, {6}-1, {7}-1, {8}-1 \n") .append(spaces).append(".endm \n\n"); break; case MACRO1_STACKWORD: str.append(spaces).append(".macro Stack1 (twobyte) {\n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Stack2 (twobyte, twobyte2) {\n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Stack3 (twobyte, twobyte2, twobyte3) {\n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Stack4 (twobyte, twobyte2, twobyte3, twobyte4) {\n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Stack5 (twobyte, twobyte2, twobyte3, twobyte4, twobyte5) {\n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Stack6 (twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6) {\n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Stack7 (twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7) {\n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1, twobyte7-1\n") .append(spaces).append("}\n\n") .append(spaces).append(".macro Stack8 (twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7, twobyte8) {\n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1, twobyte7-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1, twobyte7-1, twobyte8-1\n") .append(spaces).append("}\n\n"); break; case MACRO2_STACKWORD: str.append(spaces).append("!macro Stack1 twobyte {\n") .append(spaces).append(" !word twobyte-1\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Stack2 twobyte, twobyte2 {\n") .append(spaces).append(" !word twobyte-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Stack3 twobyte, twobyte2, twobyte3 {\n") .append(spaces).append(" !word twobyte-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Stack4 twobyte, twobyte2, twobyte3, twobyte4 {\n") .append(spaces).append(" !word twobyte-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Stack5 twobyte, twobyte2, twobyte3, twobyte4, twobyte5 {\n") .append(spaces).append(" !word twobyte-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Stack6 twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6 {\n") .append(spaces).append(" !word twobyte-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Stack7 twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7 {\n") .append(spaces).append(" !word twobyte-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1, twobyte7-1\n") .append(spaces).append("}\n\n") .append(spaces).append("!macro Stack8 twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7, twobyte8 {\n") .append(spaces).append(" !word twobyte-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1, twobyte7-1\n") .append(spaces).append(" !word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1, twobyte7-1, twobyte8-1\n") .append(spaces).append("}\n\n"); break; case MACRO3_STACKWORD: str.append(spaces).append(".macro Stack1 twobyte \n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Stack2 twobyte, twobyte2 \n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Stack3 twobyte, twobyte2, twobyte3 \n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Stack4 twobyte, twobyte2, twobyte3, twobyte4 \n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Stack5 twobyte, twobyte2, twobyte3, twobyte4, twobyte5\n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Stack6 twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6\n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Stack7 twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7\n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1, twobyte7-1\n") .append(spaces).append(".endmacro\n\n") .append(spaces).append(".macro Stack8 twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7, twobyte8\n") .append(spaces).append(" .word twobyte-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1, twobyte7-1\n") .append(spaces).append(" .word twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1, twobyte7-1, twobyte8-1\n") .append(spaces).append(".endmacro\n\n"); break; case MACRO4_STACKWORD: str.append(spaces).append("Stack1: macro ?twobyte \n") .append(spaces).append(" db ?twobyte-1\n") .append(spaces).append("endm\n\n") .append(spaces).append("Stack2: macro ?twobyte, ?twobyte2 \n") .append(spaces).append(" db ?twobyte-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1\n") .append(spaces).append("endm\n\n") .append(spaces).append("Stack3: macro ?twobyte, ?twobyte2, ?twobyte3 \n") .append(spaces).append(" db ?twobyte-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1\n") .append(spaces).append("endm\n\n") .append(spaces).append("Stack4: macro ?twobyte, ?twobyte2, ?twobyte3, ?twobyte4 \n") .append(spaces).append(" db ?twobyte-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1\n") .append(spaces).append("endm\n\n") .append(spaces).append("Stack5: macro ?twobyte, ?twobyte2, ?twobyte3, ?twobyte4, ?twobyte5\n") .append(spaces).append(" db ?twobyte-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1, ?twobyte5-1\n") .append(spaces).append("endm\n\n") .append(spaces).append("Stack6: macro ?twobyte, ?twobyte2, ?twobyte3, ?twobyte4, ?twobyte5, ?twobyte6\n") .append(spaces).append(" db ?twobyte-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1, ?twobyte5-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1, ?twobyte5-1, ?twobyte6-1\n") .append(spaces).append("endm\n\n") .append(spaces).append("Stack7: macro ?twobyte, ?twobyte2, ?twobyte3, ?twobyte4, ?twobyte5, ?twobyte6, ?twobyte7\n") .append(spaces).append(" db ?twobyte-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1, ?twobyte5-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1, ?twobyte5-1, ?twobyte6-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1, ?twobyte5-1, ?twobyte6-1, ?twobyte7-1\n") .append(spaces).append("endm\n\n") .append(spaces).append("Stack8: macro ?twobyte, ?twobyte2, ?twobyte3, ?twobyte4, ?twobyte5, ?twobyte6, ?twobyte7, ?twobyte8\n") .append(spaces).append(" db ?twobyte-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1, ?twobyte5-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1, ?twobyte5-1, ?twobyte6-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1, ?twobyte5-1, ?twobyte6-1, ?twobyte7-1\n") .append(spaces).append(" db ?twobyte-1, ?twobyte2-1, ?twobyte3-1, ?twobyte4-1, ?twobyte5-1, ?twobyte6-1, ?twobyte7-1, ?twobyte8-1\n") .append(spaces).append("endm\n\n"); break; case MACRO5_STACKWORD: str.append("Stack1: macro twobyte \n") .append(" db twobyte-1\n") .append(" endm\n\n") .append("Stack2: macro twobyte, twobyte2 \n") .append(" db twobyte-1\n") .append(" db twobyte-1, twobyte2-1\n") .append(" endm\n\n") .append("Stack3: macro twobyte, twobyte2, twobyte3 \n") .append(" db twobyte-1\n") .append(" db twobyte-1, twobyte2-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1\n") .append(" endm\n\n") .append("Stack4: macro twobyte, twobyte2, twobyte3, twobyte4 \n") .append(" db twobyte-1\n") .append(" db twobyte-1, twobyte2-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(" endm\n\n") .append("Stack5: macro twobyte, twobyte2, twobyte3, twobyte4, twobyte5\n") .append(" db twobyte-1\n") .append(" db twobyte-1, twobyte2-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(" endm\n\n") .append("Stack6: macro twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6\n") .append(" db twobyte-1\n") .append(" db twobyte-1, twobyte2-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1\n") .append(" endm\n\n") .append("Stack7: macro twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7\n") .append(" db twobyte-1\n") .append(" db twobyte-1, twobyte2-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1, twobyte7-1\n") .append(" endm\n\n") .append("Stack8: macro twobyte, twobyte2, twobyte3, twobyte4, twobyte5, twobyte6, twobyte7, twobyte8\n") .append(" db twobyte-1\n") .append(" db twobyte-1, twobyte2-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1, twobyte7-1\n") .append(" db twobyte-1, twobyte2-1, twobyte3-1, twobyte4-1, twobyte5-1, twobyte6-1, twobyte7-1, twobyte8-1\n") .append(" endm\n\n"); break; } } } /** Fifo list of memory locations */ protected static LinkedList<MemoryDasm> list=new LinkedList(); /** Fifo list of related memory locations */ protected static LinkedList<MemoryDasm> listRel=new LinkedList(); /** Fifo list of related memory locations of second kind */ protected static LinkedList<MemoryDasm> listRel2=new LinkedList(); /** Fifo list of memory locations base */ protected static LinkedList<MemoryDasm> listBase=new LinkedList(); /** Fifo list of memory locations destination */ protected static LinkedList<MemoryDasm> listDest=new LinkedList(); /** Option to use */ protected static Option option; /** Last used memory dasm */ protected static MemoryDasm lastMem=null; /** Last program counter */ protected static int lastPC=0; /** Assembler starting to use */ protected static Assembler.Starting aStarting; /** Assembler origin to use */ protected static Assembler.Origin aOrigin; /** Assembler label to use */ protected static Assembler.Label aLabel; /** Assembler block comment to use */ protected static Assembler.BlockComment aBlockComment; /** Assembler comment to use */ protected static Assembler.Comment aComment; /** Assembler byte type */ protected static Assembler.Byte aByte; /** Assembler word type */ protected static Assembler.Word aWord; /** Assembler word swapped type */ protected static Assembler.WordSwapped aWordSwapped; /** Assembler tribyte type */ protected static Assembler.Tribyte aTribyte; /** Assembler long type */ protected static Assembler.Long aLong; /** Assembler address type */ protected static Assembler.Address aAddress; /** Assembler stack word type */ protected static Assembler.StackWord aStackWord; /** Assembler mono color sprite type */ protected static Assembler.MonoSprite aMonoSprite; /** Assembler multi color sprite type */ protected static Assembler.MultiSprite aMultiSprite; /** Assembler text type */ protected static Assembler.Text aText; /** Assembler text with num char type */ protected static Assembler.NumText aNumText; /** Assembler zero text type */ protected static Assembler.ZeroText aZeroText; /** Assembler high text type */ protected static Assembler.HighText aHighText; /** Assembler left shift text type */ protected static Assembler.ShiftText aShiftText; /** Assembler text to screen code type */ protected static Assembler.ScreenText aScreenText; /** Assembler text to petascii code type */ protected static Assembler.PetasciiText aPetasciiText; /** Memory constant */ protected static Constant constant; /** Carets to use */ protected static Carets carets; /** Memory dasm for block macro comments **/ protected static MemoryDasm[] memory; /** Actual type being processed */ ActionType actualType=null; /** True if this ia a block of monoscromatic sprite */ boolean isMonoSpriteBlock=false; /** Actual size of monocromatic sprite block */ protected static int sizeMonoSpriteBlock=0; /** True if this is a block of multicolor sprite */ boolean isMultiSpriteBlock=false; /** Actual size of multicolor sprite block */ protected static int sizeMultiSpriteBlock=0; /** Memory dasm with num or chars */ protected static MemoryDasm numText; /** * Set the option to use * * @param option the option to use * @param aStarting the starting type to use * @param aOrigin the origin type to use * @param aLabel the label type to use * @param aComment the comment type to use * @param aBlockComment the comment type to use * @param aByte the byte type to use * @param aWord the word type to use * @param aWordSwapped the word swapped type to use * @param aTribyte the tribyte type to use * @param aLong the long type to use * @param aAddress the address type to use * @param aStackWord the stack word type to use * @param aMonoSprite the mono sprite type to use * @param aMultiSprite the multi sprite type to use * @param aText the text type to use * @param aNumText the text with number of char before * @param aZeroText the text with 0 terminated char * @param aHighText the text with high 1 terminated bit * @param aShiftText the text left shifted * @param aScreenText the text to screen code * @param aPetasciiText the text to petascii code * @param constant the constants to use * @param carets the carets to use * @param memory all memory for macro block comments */ public void setOption(Option option, Assembler.Starting aStarting, Assembler.Origin aOrigin, Assembler.Label aLabel, Assembler.Comment aComment, Assembler.BlockComment aBlockComment, Assembler.Byte aByte, Assembler.Word aWord, Assembler.WordSwapped aWordSwapped, Assembler.Tribyte aTribyte, Assembler.Long aLong, Assembler.Address aAddress, Assembler.StackWord aStackWord, Assembler.MonoSprite aMonoSprite, Assembler.MultiSprite aMultiSprite, Assembler.Text aText, Assembler.NumText aNumText, Assembler.ZeroText aZeroText, Assembler.HighText aHighText, Assembler.ShiftText aShiftText, Assembler.ScreenText aScreenText, Assembler.PetasciiText aPetasciiText, Constant constant, Carets carets, MemoryDasm[] memory ) { Assembler.aStarting=aStarting; Assembler.option=option; Assembler.aOrigin=aOrigin; Assembler.aLabel=aLabel; Assembler.aComment=aComment; Assembler.aBlockComment=aBlockComment; Assembler.aByte=aByte; Assembler.aWord=aWord; Assembler.aWordSwapped=aWordSwapped; Assembler.aTribyte=aTribyte; Assembler.aLong=aLong; Assembler.aAddress=aAddress; Assembler.aStackWord=aStackWord; Assembler.aMonoSprite=aMonoSprite; Assembler.aMultiSprite=aMultiSprite; Assembler.aText=aText; Assembler.aNumText=aNumText; Assembler.aZeroText=aZeroText; Assembler.aHighText=aHighText; Assembler.aShiftText=aShiftText; Assembler.aScreenText=aScreenText; Assembler.aPetasciiText=aPetasciiText; isMonoSpriteBlock=false; sizeMonoSpriteBlock=0; isMultiSpriteBlock=false; sizeMultiSpriteBlock=0; this.constant=constant; this.carets=carets; this.memory=memory; // clear up all list that can be still not empty from previous usage list.clear(); listRel.clear(); listRel2.clear(); listBase.clear(); listDest.clear(); aByte.clearBasic(); } /** * Get current carets * * @return current cattets */ public Carets getCarets() { return carets; } /** * Put the value into the buffer and manage * * @param str the string builder where put result * @param mem the memory being processed * @param memRel eventual memory related * @param memRel2 eventual memory related of second kind * @param memBase evental memory base * @param memDest eventual memory destination */ public void putValue(StringBuilder str, MemoryDasm mem, MemoryDasm memRel, MemoryDasm memRel2, MemoryDasm memBase, MemoryDasm memDest) { ActionType type=actualType; lastMem=mem; // if there is a block comments use it if (mem.userBlockComment!=null && !"".equals(mem.userBlockComment)) { flush(str); type=actualType; actualType=aBlockComment; flush(str); actualType=type; } // if this is a label then the type will change if (!(lastMem.type==TYPE_PLUS || lastMem.type==TYPE_MINUS || lastMem.type==TYPE_PLUS_MAJOR || lastMem.type==TYPE_PLUS_MINOR)) { if (mem.userLocation!=null && !"".equals(mem.userLocation)) type=aLabel; else if (mem.dasmLocation!=null && !"".equals(mem.dasmLocation)) type=aLabel; } // test if it change type if (type!=actualType) { flush(str); // write back previous data // we can have only one label in a memory row, so process it if this is the case if (type==aLabel) { int size=str.length(); type.flush(str); // write back the label // check if there is a comment for the label if (lastMem.userComment!=null) { size=str.length()-size; // get number of chars used str.append(getDataCSpacesTabs(size-getDataSpacesTabs().length())); type=aComment; type.flush(str); } else str.append("\n"); // close label by going in a new line } actualType=getType(mem); } else { type=getType(mem); if (type!=actualType) { flush(str); // write back previous data actualType=type; } } list.add(mem); listRel.add(memRel); listRel2.add(memRel2); listBase.add(memBase); listDest.add(memDest); actualType.putValue(str, mem, option); } /** * Put the starting string * * @param str the stream for output */ public void setStarting(StringBuilder str) { aStarting.flush(str); } /** * Put the origin of PC * * @param str the stream for output * @param pc the program counter to set */ public void setOrg(StringBuilder str, int pc) { lastPC=pc; aOrigin.flush(str); } /** * Put constants values * * @param str the stream for output * @param constant the constants to use */ public void setConstant(StringBuilder str, Constant constant) { boolean already; String val; String comment; int pos1; for (int i=0; i<Constant.COLS; i++) { already=false; for (int j=0; j<Constant.ROWS; j++) { val=constant.table[i][j]; comment=constant.comment[i][j]; if (val!=null && !"".equals(val) && constant.isConstant(val)) { if (!already) { // show block comment for the connstant type MemoryDasm mem=new MemoryDasm(); mem.userBlockComment=" \nConstants of type "+i; setBlockComment(str, mem); already=true; } pos1=str.length(); switch (option.assembler) { case KICK: str.append(".const "+val+" = "+"$"+ByteToExe(j)); break; case GLASS: str.append(val+" equ $"+ByteToExe(j)); break; default: str.append(val+" = "+"$"+ByteToExe(j)); break; } // append the constant comment if present MemoryDasm mem=new MemoryDasm(); if (comment!=null && !"".equals(comment)) { mem.userComment=comment; } // gives the right spaces str.append(getDataCSpacesTabs(str.length()-pos1-getDataSpacesTabs().length())); setComment(str, mem); } } } str.append("\n"); } /** * Put macros if they are used based onto assembler and user option * * @param str the stream for output * @param memory the actual memory */ public void setMacro(StringBuilder str, MemoryDasm[] memory) { boolean hasMonoSprite=false; boolean hasMultiSprite=false; boolean hasWordSwapped=false; boolean hasTribyte=false; boolean hasLong=false; boolean hasStack=false; for (MemoryDasm mem:memory) { if (mem.dataType==DataType.MONO_SPRITE) hasMonoSprite=true; if (mem.dataType==DataType.MULTI_SPRITE) hasMultiSprite=true; if (mem.dataType==DataType.SWAPPED) hasWordSwapped=true; if (mem.dataType==DataType.TRIBYTE) hasTribyte=true; if (mem.dataType==DataType.LONG) hasLong=true; if (mem.dataType==DataType.STACK) hasStack=true; } if (hasMonoSprite) aMonoSprite.setting(str); if (hasMultiSprite) aMultiSprite.setting(str); if (hasWordSwapped) aWordSwapped.setting(str); if (hasTribyte) aTribyte.setting(str); if (hasLong) aLong.setting(str); if (hasStack) aStackWord.setting(str); } /** * Set bytes of a relative memory location (it deletes anything that threre are in queue) * * @param str the output stream * @param address the relative address * @param label the label of address */ public void setByteRel(StringBuilder str, int address, String label) { MemoryDasm lowMem=new MemoryDasm(); MemoryDasm highMem=new MemoryDasm(); MemoryDasm lowMemRel=new MemoryDasm(); MemoryDasm highMemRel=new MemoryDasm(); list.clear(); listRel.clear(); listRel2.clear(); listBase.clear(); listDest.clear(); lowMem.type=TYPE_MINOR; lowMem.related=address; highMem.type=TYPE_MAJOR; highMem.related=address; list.add(lowMem); list.add(highMem); lowMemRel.dasmLocation=label; highMemRel.dasmLocation=label; listRel.add(lowMemRel); listRel.add(highMemRel); listRel2.add(null); listRel2.add(null); listBase.add(null); listBase.add(null); listDest.add(null); listDest.add(null); actualType=aByte; flush(str); actualType=null; } /** * Set bytes of a relative memory location (it deletes anything that threre are in queue) in reverse order * * @param str the output stream * @param address the relative address * @param label the label of address */ public void setByteRelRev(StringBuilder str, int address, String label) { MemoryDasm lowMem=new MemoryDasm(); MemoryDasm highMem=new MemoryDasm(); MemoryDasm lowMemRel=new MemoryDasm(); MemoryDasm highMemRel=new MemoryDasm(); list.clear(); listRel.clear(); listRel2.clear(); listBase.clear(); listDest.clear(); lowMem.type=TYPE_MINOR; lowMem.related=address; highMem.type=TYPE_MAJOR; highMem.related=address; list.add(highMem); list.add(lowMem); lowMemRel.dasmLocation=label; highMemRel.dasmLocation=label; listRel.add(highMemRel); listRel.add(lowMemRel); listRel2.add(null); listRel2.add(null); listBase.add(null); listBase.add(null); listDest.add(null); listDest.add(null); actualType=aByte; flush(str); actualType=null; } /** * Set a word and put to ouptput stream (it deletes anything that threre are in queue) * * @param str the output stream * @param low the low byte * @param high the hight byte * @param comment eventual comment to add */ public void setWord(StringBuilder str, byte low, byte high, String comment) { MemoryDasm lowMem=new MemoryDasm(); MemoryDasm highMem=new MemoryDasm(); lowMem.copy=low; lowMem.dataType=DataType.WORD; lowMem.type='W'; lowMem.related=-1; highMem.copy=high; highMem.dataType=DataType.WORD; highMem.type='W'; highMem.related=-1; list.clear(); listRel.clear(); listRel2.clear(); listBase.clear(); listDest.clear(); list.add(lowMem); listRel.add(null); listRel2.add(null); list.add(highMem); listRel.add(null); listRel2.add(null); listBase.add(null); listBase.add(null); listDest.add(null); listDest.add(null); //int size=0; if (comment!=null) { highMem.userComment=comment; lastMem=highMem; //size=str.length(); } actualType=aWord; flush(str); actualType=null; // if (comment!=null) { // str.deleteCharAt(str.length()-1); // remove \n // size=str.length()-size; // get number of chars used // str.append(SPACES.substring(0, SPACES.length()-size)); // aComment.flush(str); // } } /** * Set a byte and put to ouptput stream (it deletes anything that there are in queue) * * @param str the output stream * @param low the byte * @param comment eventual comment to add */ public void setByte(StringBuilder str, byte low, String comment) { MemoryDasm lowMem=new MemoryDasm(); lowMem.copy=low; lowMem.dataType=DataType.BYTE_HEX; lowMem.type='B'; lowMem.related=-1; list.clear(); listRel.clear(); listRel2.clear(); listBase.clear(); listDest.clear(); list.add(lowMem); listRel.add(null); listRel2.add(null); listBase.add(null); listDest.add(null); if (comment!=null) { lowMem.userComment=comment; lastMem=lowMem; } actualType=aWord; flush(str); actualType=null; } /** * Set a text and put to ouptput stream (it deletes anything that threre are in queue) * * @param str the output stream * @param text the text to add */ public void setText(StringBuilder str, String text) { MemoryDasm mem; list.clear(); listRel.clear(); listRel2.clear(); listBase.clear(); listDest.clear(); for (char val: text.toCharArray()) { mem=new MemoryDasm(); mem.copy=(byte)val; mem.dataType=DataType.TEXT; list.add(mem); listRel.add(null); listRel2.add(null); listBase.push(null); listDest.push(null); } actualType=aText; flush(str); actualType=null; } /** * Set the comment if present * * @param str the stream to use * @param mem the memory with comment */ public void setComment(StringBuilder str, MemoryDasm mem) { lastMem=mem; aComment.flush(str); } /** * Set the label if present * * @param str the stream to use * @param mem the memory with comment */ public void setLabel(StringBuilder str, MemoryDasm mem) { lastMem=mem; aLabel.flush(str); } /** * Set the block comment if present * * @param str the stream to use * @param mem the memory with block comment */ public void setBlockComment(StringBuilder str, MemoryDasm mem) { lastMem=mem; aBlockComment.flush(str); } /** * Flush the actual data to the output stream * * @param str the output stream */ public void flush(StringBuilder str) { if (actualType!=null) actualType.flush(str); } /** * Get the type for this location * @param mem the memory to analize * @return the location type */ private ActionType getType(MemoryDasm mem) { if (!mem.isData) { isMonoSpriteBlock=false; isMultiSpriteBlock=false; return null; } switch (mem.dataType) { case BYTE_HEX: case BYTE_DEC: case BYTE_BIN: case BYTE_CHAR: isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aByte; case WORD: isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aWord; case SWAPPED: isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aWordSwapped; case TRIBYTE: isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aTribyte; case LONG: isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aLong; case ADDRESS: isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aAddress; case STACK: isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aStackWord; case MONO_SPRITE: if (!isMonoSpriteBlock) sizeMonoSpriteBlock=0; isMonoSpriteBlock=true; isMultiSpriteBlock=false; sizeMonoSpriteBlock++; numText=null; return aMonoSprite; case MULTI_SPRITE: if (!isMultiSpriteBlock) sizeMultiSpriteBlock=0; isMultiSpriteBlock=true; isMonoSpriteBlock=false; sizeMultiSpriteBlock++; numText=null; return aMultiSprite; case TEXT: isMonoSpriteBlock=false; isMultiSpriteBlock=false; return aText; case NUM_TEXT: isMonoSpriteBlock=false; isMultiSpriteBlock=false; return aNumText; case ZERO_TEXT: isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aZeroText; case HIGH_TEXT: isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aHighText; case SHIFT_TEXT: isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aShiftText; case SCREEN_TEXT: isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aScreenText; case PETASCII_TEXT: isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aPetasciiText; } // default is of Byte type isMonoSpriteBlock=false; isMultiSpriteBlock=false; numText=null; return aByte; } /** * Add constants to the source * * @param memory the memories * @return the constants */ protected String addConstants(MemoryDasm[] memory) { String label; String tmp; StringBuilder result=new StringBuilder(); for (MemoryDasm mem : memory) { if (mem.isInside && !mem.isGarbage) continue; // for garbage inside, only if there is a user label makes it outs if (mem.isGarbage && mem.userLocation!=null && !"".equals(mem.userLocation)) { // look for block comment if (mem.userBlockComment!=null && !"".equals(mem.userBlockComment)) { setBlockComment(result, mem); } label=mem.userLocation; int start=result.length(); if (option.assembler==Assembler.Name.KICK) { if (mem.address<=0xFF) tmp=".label "+label+" = $"+ByteToExe(mem.address); else tmp=".label "+label+" = $"+ShortToExe(mem.address); } else { if (mem.address<=0xFF) tmp=label+" = $"+ByteToExe(mem.address); else tmp=label+" = $"+ShortToExe(mem.address); } result.append(tmp).append(getInstrCSpacesTabs(tmp.length())); getCarets().add(start, result.length(), mem, Carets.Type.LABEL); setComment(result, mem); continue; } // look for block comment if (mem.userBlockComment!=null && !"".equals(mem.userBlockComment)) { setBlockComment(result, mem); } // look for constant label=null; if (mem.userLocation!=null && !"".equals(mem.userLocation)) label=mem.userLocation; else if (mem.dasmLocation!=null && !"".equals(mem.dasmLocation)) label=mem.dasmLocation; if (label!=null) { int start=result.length(); if (option.assembler==Assembler.Name.KICK) { if (mem.address<=0xFF) tmp=".label "+label+" = $"+ByteToExe(mem.address); else tmp=".label "+label+" = $"+ShortToExe(mem.address); } else { if (mem.address<=0xFF) tmp=label+" = $"+ByteToExe(mem.address); else tmp=label+" = $"+ShortToExe(mem.address); } result.append(tmp).append(getInstrCSpacesTabs(tmp.length())); getCarets().add(start, result.length(), mem, Carets.Type.LABEL); setComment(result, mem); } } return result.append("\n").toString(); } }
313,103
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
SidFreq.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/SidFreq.java
/* * @(#)SidFreq.java 2019/12/30 * * ICE Team free software group * * This file is part of JIIT64 Java Ice Team Tracker 64 * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ package sw_emulator.software; import sw_emulator.math.Unsigned; /** * Modified version of SidFreq by XSidPlay2 * * @author ice */ public class SidFreq { /** A4 index in table */ static final int A4=57; /** A4 index in oct note table table */ static final int OCT_NOTE_A4 = A4+16; /** Table size for ocatve/note */ static final int OCT_NOTE_TABLE = 128-6; /** Table size for ocatve/note */ static final int SCALE_NOTE_A4 = 33; /** Table size */ static final int TABLE = 96-6; /** All table size */ static final int ALL = 96; /** Short table size */ static final int SHORT=72; /** Short2 table size */ static final int SHORT2=65; /** Scale table size */ static final int SCALE_TABLE=56; /** Error for note difference */ static final int ERROR=6; /** Buffer of data */ byte[] inB; /** Memory flags */ MemoryDasm[] memory; /** Start in buffer */ int start; /** End in buffer */ int end; /** Offset to add for having memory address */ int offset; /** Label for low frequency */ String lowLabel; /** Label for high frequency */ String highLabel; /** Mark memory */ boolean markMemory; /** Create label */ boolean createLabel; /** Create comment */ boolean createComment; /** Actual index (-1=no find) */ int actIndex=-1; /** Instance of the class as singleton */ public static final SidFreq instance=new SidFreq(); /** * Private constructor */ private SidFreq() { } /** * Reset the engine as we catch more elements */ public void reset() { actIndex=-1; } /** * Identify the frequency of the music * * @param inB the memory buffer * @param memory the memory dasm * @param start start address in buffer * @param end end address in buffer * @param offset offset to add for having memory address * @param lowLabel label for low frequency * @param highLabel label for high frequency * @param markMemory mark the memory * @param createLabel create the label * @param createComment crete the comment * @param linearTable allow linear table search * @param combinedTable allow combined table search * @param inverseLinearTable allow inverse linear table search * @param linearOctNoteTable allow linear octave/note table search * @param hiOct13Table allow high octave (13) table search * @param linearScaleTable allow linear scale table search * @param shortLinearTable allow short lineat table search * @param shortCombinedTable * @param hiOctCombinedTable * @param hiOctCombinedInvertedTable * @param loOctCombinedTable * @param hiOct12Table */ public void identifyFreq(byte[] inB, MemoryDasm[] memory, int start, int end, int offset, String lowLabel, String highLabel, boolean markMemory, boolean createLabel, boolean createComment, boolean linearTable, boolean combinedTable, boolean inverseLinearTable, boolean linearOctNoteTable, boolean hiOct13Table, boolean linearScaleTable, boolean shortLinearTable, boolean shortCombinedTable, boolean hiOctCombinedTable, boolean hiOctCombinedInvertedTable, boolean loOctCombinedTable, boolean hiOct12Table ) { this.inB=inB; this.memory=memory; this.start=start; this.end=end; this.offset= offset; this.lowLabel=lowLabel; this.highLabel=highLabel; this.markMemory=markMemory; this.createLabel=createLabel; this.createComment=createComment; try { // search for linear table if allowed if (linearTable) { while (linearTable()) {} this.start=start; } // search for combined table if allowed if (combinedTable) { while (combinedTable()) {} this.start=start; } // search for inverse linear table if allowed if (inverseLinearTable) { while (linearInverseTable()) { this.end=this.start; this.start=Math.min(0, start-TABLE); } } this.start=start; // search for octave/note table if allowed if (linearOctNoteTable) { while (linearOctNoteTable()) {} this.start=start; } // search for octave note (13) table if allowed if (hiOct13Table) { while (highOctave()) {} this.start=start; } // serch for linear scale table if allowed if (linearScaleTable) { while (linearScaleTable()) {} this.start=start; } // for short table looks only if there are no solution before if (actIndex<0 && shortLinearTable) shortLinearTable(); if (actIndex<0 && shortCombinedTable) shortCombinedTable(); if (actIndex<0 && hiOctCombinedTable) highOctaveCombined(); if (actIndex<0 && hiOctCombinedInvertedTable) highOctaveCombinedInv(); if (actIndex<0 && loOctCombinedTable) lowOctaveCombined(); if (actIndex<0 && hiOct12Table) highOctave12(); } catch (Exception e) { // catch errors to avoid blocking the program System.err.println(e); } } /////////////////////////// /** * Search for tables in linear way (low / high or high / low) that has * scale format (only CDEFGAB) * * @return true if the table is fount */ private boolean linearScaleTable() { int i; int sid; int high=-1; int low=-1; // check for high frequency table for (i=start; i<end-SCALE_TABLE; i++) { if (searchScaleHigh(i)) { high=i; break; } } // look if high table was fount if (high==-1) return false; // check for low frequency table (first part) if (high>SCALE_TABLE) { for (i=start; i<=high-SCALE_TABLE; i++) { if (searchScaleLow(high, i)) { low=i; break; } } } // check for high frequency table (second part) if ((low==-1) && (high<end-SCALE_TABLE*2)) { for (i=high+SCALE_TABLE; i<end-SCALE_TABLE; i++) { if (searchScaleLow(high, i)) { low=i; break; } } } // look if low table was fount if (low==-1) return false; if (checkGarbage(high, low)) return false; // get the A4 note sid=Unsigned.done(inB[high+SCALE_NOTE_A4])*256+Unsigned.done(inB[low+SCALE_NOTE_A4]); addData(high, low, sid); markMemory(high, high+SCALE_TABLE, 1); markMemory(low, low+SCALE_TABLE, 1); return true; } /** * Search for tables in linear way (low / high or high / low) * * @return true if the table is fount */ private boolean linearTable() { int i; int sid; int high=-1; int low=-1; // check for high frequency table for (int ii=start; ii<end-TABLE; ii++) { if (searchHigh(ii)) { high=ii; // check for low frequency table (first part) if (high>TABLE) { for (i=start; i<=high-TABLE; i++) { if (searchLow(high, i)) { low=i; break; } } } // check for high frequency table (second part) if ((low==-1) && (high<end-TABLE*2)) { for (i=high+TABLE; i<end-TABLE; i++) { if (searchLow(high, i)) { low=i; break; } } } if (low!=-1) break; // exit loop as frequency is fount // look if low table was fount if (inB[high]==0) { // This looked like a mastercomposer, then check if next is good instead if (++high>end-TABLE) return false; if (!searchHigh(high)) return false; // check for low frequency table (first part) if (high>TABLE) { for (i=start; i<=high-TABLE; i++) { if (searchLow(high, i)) { low=i; break; } } } // check for high frequency table (second part) if ((low==-1) && (high<end-TABLE*2)) { for (i=high+TABLE; i<end-TABLE; i++) { if (searchLow(high, i)) { low=i; break; } } } } if (low!=-1) break; } } // look if high and low table was fount if (high==-1 || low==-1) return false; if (checkGarbage(high, low)) return false; // get the A4 note sid=Unsigned.done(inB[high+A4])*256+Unsigned.done(inB[low+A4]); addData(high, low, sid); markMemory(high, high+TABLE+6, 1); markMemory(low, low+TABLE+6, 1); System.out.println("SIDFREQ: LinearTable"); return true; } //////////////////////////// /** * Search for tables in linear way (low / high or high / low) in octave/note * format * * @return true if the table is fount */ private boolean linearOctNoteTable() { int i; int sid; int high=-1; int low=-1; // check for high frequency table for (i=start; i<end-OCT_NOTE_TABLE; i++) { if (searchOctNoteHigh(i)) { high=i; break; } } // look if high table was fount if (high==-1) return false; // check for low frequency table (first part) if (high>OCT_NOTE_TABLE) { for (i=start; i<=high-OCT_NOTE_TABLE-6; i++) { if (searchOctNoteLow(high, i)) { low=i; break; } } } // check for high frequency table (second part) if ((low==-1) && (high<end-OCT_NOTE_TABLE*2)) { for (i=high+OCT_NOTE_TABLE+6; i<end-OCT_NOTE_TABLE-6; i++) { if (searchOctNoteLow(high, i)) { low=i; break; } } } // look if low table was fount if (low==-1) return false; if (checkGarbage(high, low)) return false; // get the A4 note sid=Unsigned.done(inB[high+OCT_NOTE_A4])*256+Unsigned.done(inB[low+OCT_NOTE_A4]); addData(high, low, sid); markMemory(high, high+OCT_NOTE_TABLE+6, 1); markMemory(low, low+OCT_NOTE_TABLE+6, 1); System.out.println("SIDFREQ: LinearOctNoteTable"); return true; } /** * Search for tables in combined way (low + high or high + low) * * @return true if the table is fount */ private boolean combinedTable() { int sid; int i, j; int high=-1; int low=-1; // check for high frequency table for (i=start; i<end-TABLE*2; i++) { if (searchHigh2(i)) { high=i; low=-1; // check for low frequency table for (j=start; j<end-TABLE*2; j++) { if (j!=high) { if (searchLow2(high, j)) { low=j; break; } } } if (low!=-1) break; } } // look if table was fount if (high==-1 || low==-1) return false; if (checkGarbage(high, low)) return false; // get the A4 note sid=Unsigned.done(inB[high+A4*2])*256+Unsigned.done(inB[low+A4*2]); addData(high, low, sid); markMemory(high, high+(TABLE+6)*2, 2); markMemory(low, low+(TABLE+6)*2, 2); System.out.println("SIDFREQ: CombinedTable"); return true; } /** * Search for short tables in combined way (low + high or high + low) * * @return true if the table is fount */ private boolean shortCombinedTable() { int sid; int i; int high=-1; int low=-1; // check for high frequency table for (i=start; i<end-SHORT2*2; i++) { if (searchShortHigh2(i)) { high=i; break; } } // look if high table was fount if (high==-1) return false; // check for low frequency table for (i=start; i<end-SHORT2*2; i++) { if (i!=high) { if (searchShortLow2(high, i)) { low=i; break; } } } // look if low table was fount if (low==-1) return false; if (checkGarbage(high, low)) return false; // get the A4 note sid=Unsigned.done(inB[high+A4*2])*256+Unsigned.done(inB[low+A4*2]); addData(high, low, sid); markMemory(high, high+SHORT2*2, 2); markMemory(low, low+SHORT2*2, 2); return true; } /** * Search for short tables in linear way (low / high or high / low) * * @return true if the table is fount */ private boolean shortLinearTable() { int sid; int i; int high=-1; int low=-1; // check for high frequency table for (i=start; i<end-SHORT; i++) { if (searchShortHigh(i)) { high=i; break; } } // look if high table was fount if (high==-1) return false; // check for low frequency table (first part) if (high>SHORT) { for (i=start; i<=high-SHORT; i++) { if (searchShortLow(high, i)) { low=i; break; } } } // check for high frequency table (second part) if ((low==-1) && (high<end-SHORT*2)) { for (i=high+SHORT; i<end-SHORT; i++) { if (searchShortLow(high, i)) { low=i; break; } } } // look if low table was fount if (low==-1) return false; if (checkGarbage(high, low)) return false; // get the A4 note sid=Unsigned.done(inB[high+A4])*256+Unsigned.done(inB[low+A4]); addData(high, low, sid); markMemory(high, high+SHORT+6, 1); markMemory(low, low+SHORT+6, 1); return true; } /////////////////////// /** * Search for the high frequency table in linear way * * @param index the index where to start the test * @return true if there is a high frequency table in that position */ private boolean searchHigh(int index) { int i; int actual=1; // it must start with three 1 or at least with 0 1 1 1 if ( ( ((int)inB[index+0]!=1) || ((int)inB[index+1]!=1) || ((int)inB[index+2]!=1) ) && ( ((int)inB[index+0]!=0) || ((int)inB[index+1]!=1) || ((int)inB[index+2]!=1) || ((int)inB[index+3]!=1)) ) return false; // search for increasing numbers for (i=index+3; i<index+TABLE; i++) { if ((int)(inB[i]& 0xFF)<actual) { System.err.println(""+actual+" "+(int)(inB[i]& 0xFF)); // catch a very big error on Vibrants/JO note table at 424Hz if (actual==7 && (int)(inB[i]& 0xFF)==3 && (int)(inB[i-2]& 0xFF)==3) actual=((int)inB[i]& 0xFF); else return false; } else actual=((int)inB[i]& 0xFF); } return true; } /** * Search for the short high frequency table in linear way * * @param index the index where to start the test * @return true if there is a high frequency table in that position */ private boolean searchShortHigh(int index) { int i; int actual=1; // it must start with three 1 or at least with 0 1 1 1 if ( ((int)inB[index+0]!=1) || ((int)inB[index+1]!=1) || ((int)inB[index+2]!=1)) return false; // search for increasing numbers for (i=index+3; i<index+SHORT; i++) { if ((int)(inB[i]& 0xFF)<actual) return false; else actual=(int)(inB[i]& 0xFF); } return true; } /** * Search for the high frequency table in *2 way * * @param index the index where to start the test * @return true if there is a high frequency table in that position */ private boolean searchHigh2(int index) { int i; int actual=1; // it must start with three 1 if ( ((int)(inB[index+0]& 0xFF)!=1) || ((int)(inB[index+2]& 0xFF)!=1) || ((int)(inB[index+4]& 0xFF)!=1)) return false; // search for increasing numbers for (i=index+6; i<index+TABLE*2; i++, i++) { if ((int)(inB[i]& 0xFF)<actual) return false; else actual=(int)(inB[i]& 0xFF); } return true; } /** * Search for the high frequency table in *2 way * * @param index the index where to start the test * @return true if there is a high frequency table in that position */ private boolean searchShortHigh2(int index) { int i; int actual=1; // it must start with three 1 if ( ((int)(inB[index+0]& 0xFF)!=1) || ((int)(inB[index+2]& 0xFF)!=1) || ((int)(inB[index+4]& 0xFF)!=1)) return false; // search for increasing numbers for (i=index+6; i<index+SHORT2*2; i++, i++) { if ((int)(inB[i]& 0xFF)<actual) return false; else actual=(int)(inB[i]& 0xFF); } return true; } /** * Search for the scale high frequency table in linear way * * @param index the index where to start the test * @return true if there is a high frequency table in that position */ private boolean searchScaleHigh(int index) { int i; int actual=1; // it must start with three 1 if ( ((int)inB[index+0]!=1) || ((int)inB[index+1]!=1) || ((int)inB[index+2]!=1)) return false; // search for increasing numbers for (i=index+3; i<index+SCALE_TABLE; i++) { if ((int)(inB[i]& 0xFF)<actual) return false; else actual=(int)(inB[i]& 0xFF); } return true; } /** * Search for the high frequency table in linear way for octave/note format * * @param index the index where to start the test * @return true if there is a high frequency table in that position */ private boolean searchOctNoteHigh(int index) { int oct; int actual=1; // it must start with three 1 if ( ((int)inB[index+0]!=1) || ((int)inB[index+1]!=1) || ((int)inB[index+2]!=1)) return false; for (oct=0; oct<8; oct++) { if ((int)inB[index+oct*16+12]!=0 || (int)inB[index+oct*16+13]!=0 || (int)inB[index+oct*16+14]!=0 || (int)inB[index+oct*16+15]!=0) return false; if ((int)(inB[index+oct*16] &0xff)<actual || (int)(inB[index+oct*16+1] &0xff)<(int)(inB[index+oct*16] &0xff) || (int)(inB[index+oct*16+2] &0xff)<(int)(inB[index+oct*16+1] &0xff) || (int)(inB[index+oct*16+3] &0xff)<(int)(inB[index+oct*16+2] &0xff) || (int)(inB[index+oct*16+4] &0xff)<(int)(inB[index+oct*16+3] &0xff) || (int)(inB[index+oct*16+5] &0xff)<(int)(inB[index+oct*16+4] &0xff) || (int)(inB[index+oct*16+6] &0xff)<(int)(inB[index+oct*16+5] &0xff) || (int)(inB[index+oct*16+7] &0xff)<(int)(inB[index+oct*16+6] &0xff) || (int)(inB[index+oct*16+8] &0xff)<(int)(inB[index+oct*16+7] &0xff) || (int)(inB[index+oct*16+9] &0xff)<(int)(inB[index+oct*16+8] &0xff) || (int)(inB[index+oct*16+10] &0xff)<(int)(inB[index+oct*16+9] &0xff) || (int)(inB[index+oct*16+11] &0xff)<(int)(inB[index+oct*16+10] &0xff)) return false; actual=(int)(inB[index+oct*16+11] &0xff); } return true; } /** * Search for a low frequency table in linear way for octave/note * * @param high the position of high table * @param index the index where to search for low table * @return true if there is a low frequency table in that position */ private boolean searchOctNoteLow(int high, int index){ int i; int note1, note2, note3, note4, note5, note6, note7; int diff; // scan all notes for (i=0; i<12; i++) { note1=(int)(inB[high+i]& 0xFF)*256+(int)(inB[index+i]& 0xFF); note2=(int)(inB[high+i+16]& 0xFF)*256+(int)(inB[index+i+16]& 0xFF); note3=(int)(inB[high+i+16*2]& 0xFF)*256+(int)(inB[index+i+16*2]& 0xFF); note4=(int)(inB[high+i+16*3]& 0xFF)*256+(int)(inB[index+i+16*3]& 0xFF); note5=(int)(inB[high+i+16*4]& 0xFF)*256+(int)(inB[index+i+16*4]& 0xFF); note6=(int)(inB[high+i+16*5]& 0xFF)*256+(int)(inB[index+i+16*5]& 0xFF); note7=(int)(inB[high+i+16*6]& 0xFF)*256+(int)(inB[index+i+16*6]& 0xFF); diff=0; diff+=Math.abs(note1*2 - note2); if (i<11) diff+=Math.abs(note2*2 - note3); if (i<11) diff+=Math.abs(note3*2 - note4); if (i<11) diff+=Math.abs(note4*2 - note5); if (i<11) diff+=Math.abs(note5*2 - note6); if (i<11) diff+=Math.abs(note6*2 - note7); if (diff>ERROR+3) return false; } return true; } /** * Search for a low frequency table in linear way * * @param high the position of high table * @param index the index where to search for low table * @return true if there is a low frequency table in that position */ private boolean searchLow(int high, int index){ int i; int note1, note2, note3, note4, note5, note6, note7; int diff; boolean errSoundTracker=false; boolean errGrooPsygon=false; boolean errVibrantsJO=false; // only accept Mastercomposer 0-ff initial value if (inB[high]==0 && inB[index]!= -1) return false; // scan all notes for (i=0; i<12; i++) { note1=(int)(inB[high+i]& 0xFF)*256+(int)(inB[index+i]& 0xFF); note2=(int)(inB[high+i+12]& 0xFF)*256+(int)(inB[index+i+12]& 0xFF); note3=(int)(inB[high+i+12*2]& 0xFF)*256+(int)(inB[index+i+12*2]& 0xFF); note4=(int)(inB[high+i+12*3]& 0xFF)*256+(int)(inB[index+i+12*3]& 0xFF); note5=(int)(inB[high+i+12*4]& 0xFF)*256+(int)(inB[index+i+12*4]& 0xFF); note6=(int)(inB[high+i+12*5]& 0xFF)*256+(int)(inB[index+i+12*5]& 0xFF); note7=(int)(inB[high+i+12*6]& 0xFF)*256+(int)(inB[index+i+12*6]& 0xFF); diff=0; diff+=Math.abs(note1*2 - note2); if (i<11) diff+=Math.abs(note2*2 - note3); if (i<11) diff+=Math.abs(note3*2 - note4); if (i<11) diff+=Math.abs(note4*2 - note5); if (i<11) diff+=Math.abs(note5*2 - note6); if (i<11) diff+=Math.abs(note6*2 - note7); if (i>0) System.err.println(high+" "+index+" "+i+" "+diff); // catch error into Vibrants/JO note table at 416Hz if (i==0 && diff==212) continue; // catch error into Master Composer at: if (i==0) { switch (diff) { case 19: // 415Hz case 26: // 423Hz case 29: // 424Hz case 30: // 424Hz case 34: // 427Hz case 39: // 415Hz case 35: // 437Hz case 44: // 434Hz case 48: // 439Hz case 51: // 441Hz case 64: // 450Hz case 65: // 452Hz continue; } } // catch errors in Odie tiny (table 440Hz) if (i==1 && diff==10) continue; // catch 2 errors in Kenneth Arnold player (table 424Hz) if (i==1 && diff==8) continue; if (i==6 && diff==40) continue; // catch an error on MUSICIANS/P/PseudoGrafx/Fonttime.sid (short table seems 476Hz) if (i==2 && diff==25) continue; // catch 3 errors into Sound Tracher 64 at 459Hz if (i==2 && diff==48) { errSoundTracker=true; continue;} if (errSoundTracker) { if (i==9 && diff==302) continue; if (i==10 && diff==514) continue; } // catch an error onto TFX note table 449Hz if (i==3 && diff==25) continue; // catch 4 errors into Vibrants/JO note table at 416Hz if (i==3 && diff==118) {errVibrantsJO=true; continue;} if (errVibrantsJO) { if (i==4 && diff==153) continue; if (i==5 && diff==193) continue; if (i==7 && diff==110) continue; } // catch 3 errors onto Groo/Psygon at 434Hz if (i==3 && diff==48) {errGrooPsygon=true; continue;} if (errGrooPsygon) { if (i==10 && diff==302) continue; if (i==11 && diff==512) continue; } // catch an error onto TFX 2.7 note table (table 424Hz: E0 is 0147 instead of 0151) // catch an error onto TFX 2.9 note table (table 449Hz: D#0 is 0147 instead of 0151) // catch an error into DMC note table (table 424Hz: E0 is 0147 instead of 0151) if (i==4 && diff==25) continue; // catch 1 error into Vibrants/JO note table at 440Hz if (i==4 && diff==127) continue; // catch a big error on Music Mixer notes table (table 440Hz: F#4 - values 18E0 instead of 189C) if (i==6 && diff==206) continue; // catch a error on System 6581 note table at 424Hz if (i==7 && diff==29) continue; // catch a very big error (originated in high table) on Vibrants/JO note table at 424Hz if (i==8 && diff==3074) continue; // catch an erro in Bytemare Music Editor (table 440Hz) if (i==8 && diff==25) continue; // catch ha error on DEMOS/M-R/Max_Mix.sid (table 440Hz; A2 - values 0744 instead of 0751) if (i==9 && diff==42) continue; // catch an error on Barry Leich (table 424Hz) if (i==11 && diff==20) continue; // catch errors onto Mon/Futurecomposer (table: 424Hz; B1 - values 03E0 instead of 03F4) if (i==11 && diff==25) continue; if (diff>ERROR) return false; } return true; } /** * Search for a low frequency short table in linear way * * @param high the position of high table * @param index the index where to search for low table * @return true if there is a low frequency table in that position */ private boolean searchShortLow(int high, int index){ int i; int note1, note2, note3, note4, note5, note6, note7; int diff; // scan all notes for (i=0; i<12; i++) { note1=(int)(inB[high+i]& 0xFF)*256+(int)(inB[index+i]& 0xFF); note2=(int)(inB[high+i+12]& 0xFF)*256+(int)(inB[index+i+12]& 0xFF); note3=(int)(inB[high+i+12*2]& 0xFF)*256+(int)(inB[index+i+12*2]& 0xFF); note4=(int)(inB[high+i+12*3]& 0xFF)*256+(int)(inB[index+i+12*3]& 0xFF); note5=(int)(inB[high+i+12*4]& 0xFF)*256+(int)(inB[index+i+12*4]& 0xFF); diff=0; diff+=Math.abs(note1*2 - note2); diff+=Math.abs(note2*2 - note3); diff+=Math.abs(note3*2 - note4); diff+=Math.abs(note4*2 - note5); // catch errors onto Martin Galway player (table: 442Hz) if (i==3 && diff==31) continue; // table 434Hz if (i==8 && diff==87) continue; if (i==10 && diff==33) continue; // catch errors in Master Composer if (i==2 && diff==31) continue; // catch an error into DMC note table if (i==4 && diff==24) continue; if (i==5 && diff==204) continue; if (diff>ERROR) return false; } return true; } /** * Search for a low frequency table in *2 way * * @param high the position of high table * @param index the index where to search for low table * @return true if there is a low frequency table in that position */ private boolean searchLow2(int high, int index) { int i; int note1, note2, note3, note4, note5, note6, note7; int diff; boolean errVibrantsJO=false; // scan all notes for (i=0; i<12; i++) { note1=(int)(inB[high+i*2]& 0xFF)*256+(int)(inB[index+i*2]& 0xFF); note2=(int)(inB[high+i*2+24]& 0xFF)*256+(int)(inB[index+i*2+24]& 0xFF); note3=(int)(inB[high+i*2+24*2]& 0xFF)*256+(int)(inB[index+i*2+24*2]& 0xFF); note4=(int)(inB[high+i*2+24*3]& 0xFF)*256+(int)(inB[index+i*2+24*3]& 0xFF); note5=(int)(inB[high+i*2+24*4]& 0xFF)*256+(int)(inB[index+i*2+24*4]& 0xFF); note6=(int)(inB[high+i*2+24*5]& 0xFF)*256+(int)(inB[index+i*2+24*5]& 0xFF); note7=(int)(inB[high+i*2+24*6]& 0xFF)*256+(int)(inB[index+i*2+24*6]& 0xFF); diff=0; diff+=Math.abs(note1*2 - note2); diff+=Math.abs(note2*2 - note3); diff+=Math.abs(note3*2 - note4); if (i<11) diff+=Math.abs(note4*2 - note5); if (i<11) diff+=Math.abs(note5*2 - note6); if (i<11) diff+=Math.abs(note6*2 - note7); // catch 4 errors into Vibrants/JO note table at 434Hz if (i==3 && diff==48) { errVibrantsJO=true; continue; } if (errVibrantsJO) { if (i==8 && diff==81) continue; if (i==9 && diff==264) continue; if (i==10 && diff==302) continue; } // catch and error in Megasound if (i==3 && diff==16) continue; // catch and error in Megasound if (i==3 && diff==19) continue; if (diff>ERROR) return false; } return true; } /** * Search for a low frequency table in *2 way * * @param high the position of high table * @param index the index where to search for low table * @return true if there is a low frequency table in that position */ private boolean searchShortLow2(int high, int index) { int i; int note1, note2, note3, note4, note5, note6, note7; int diff; // scan all notes for (i=0; i<12; i++) { note1=(int)(inB[high+i*2]& 0xFF)*256+(int)(inB[index+i*2]& 0xFF); note2=(int)(inB[high+i*2+24]& 0xFF)*256+(int)(inB[index+i*2+24]& 0xFF); note3=(int)(inB[high+i*2+24*2]& 0xFF)*256+(int)(inB[index+i*2+24*2]& 0xFF); note4=(int)(inB[high+i*2+24*3]& 0xFF)*256+(int)(inB[index+i*2+24*3]& 0xFF); note5=(int)(inB[high+i*2+24*4]& 0xFF)*256+(int)(inB[index+i*2+24*4]& 0xFF); diff=0; diff+=Math.abs(note1*2 - note2); diff+=Math.abs(note2*2 - note3); diff+=Math.abs(note3*2 - note4); diff+=Math.abs(note4*2 - note5); // catch an error into Vibrants/JO note table at 434Hz if (i==3 && diff==31) continue; // catch an error into Vibrants/JO note table at 434Hz if (i==4 && diff==363) continue; if (diff>ERROR) return false; } return true; } /** * Search for a low frequency scale table in linear way * * @param high the position of high table * @param index the index where to search for low table * @return true if there is a low frequency table in that position */ private boolean searchScaleLow(int high, int index){ int i; int note1, note2, note3, note4, note5, note6, note7; int diff; // scan all notes for (i=0; i<8; i++) { note1=(int)(inB[high+i]& 0xFF)*256+(int)(inB[index+i]& 0xFF); note2=(int)(inB[high+i+7]& 0xFF)*256+(int)(inB[index+i+7]& 0xFF); note3=(int)(inB[high+i+7*2]& 0xFF)*256+(int)(inB[index+i+7*2]& 0xFF); note4=(int)(inB[high+i+7*3]& 0xFF)*256+(int)(inB[index+i+7*3]& 0xFF); note5=(int)(inB[high+i+7*4]& 0xFF)*256+(int)(inB[index+i+7*4]& 0xFF); diff=0; diff+=Math.abs(note1*2 - note2); diff+=Math.abs(note2*2 - note3); diff+=Math.abs(note3*2 - note4); diff+=Math.abs(note4*2 - note5); if (diff>ERROR) return false; } return true; } /** * Add the collected data to memory dasm * * @param high the high position * @param low the low position * @param sid the sid A4 word freq */ private void addData(int high, int low, int sid) { actIndex++; String off=""; if (actIndex>0) off=""+actIndex; if (createLabel) { memory[high+offset].userLocation=highLabel+off; memory[low+offset].userLocation=lowLabel+off; } int freqNTSC=(int)Math.round(sid*0.0609592795372); int freqPAL=(int)Math.round(sid*0.0587253570557); if (createComment) { memory[low+offset].userComment="A4="+freqPAL+" HZ (PAL) | A4="+freqNTSC+" HZ (NTSC)"; memory[high+offset].userComment="A4="+freqPAL+" HZ (PAL) | A4="+freqNTSC+" HZ (NTSC)"; } // modify start for another analisys start=Math.max(high, low)+TABLE; } /** * Mark the memory as data * * @param start the position to start * @param end the end position * @param step the step to use */ private void markMemory(int start, int end, int step) { // skip if option say that if (!markMemory) return; for (int i=start; i<end; i+=step) { if (!memory[i+offset].isCode && !memory[i+offset].isData) memory[i+offset].isData=true; } } /** * Looks for an high octave table * * @return true if it is find */ private boolean highOctave() { final double STEP=Math.pow(2, 1/12); int[] freq=new int[12]; for (int i=start; i<end-13*2; i++) { if ((int)inB[i]==0 && (int)inB[i+13]==0) { freq[0]=(int)(inB[i+1]& 0xFF)+(int)(inB[i+14]& 0xFF)*256; if (freq[0]==0) continue; freq[1]=(int)(inB[i+2]& 0xFF)+(int)(inB[i+15]& 0xFF)*256; if (freq[1]==0 || freq[1]<=freq[0] || Math.abs(freq[1]/freq[0]-STEP)>0.00001) continue; freq[2]=(int)(inB[i+3]& 0xFF)+(int)(inB[i+16]& 0xFF)*256; if (freq[2]==0 || freq[2]<=freq[1] || Math.abs(freq[2]/freq[1]-STEP)>0.00001) continue; freq[3]=(int)(inB[i+4]& 0xFF)+(int)(inB[i+17]& 0xFF)*256; if (freq[3]==0 || freq[3]<=freq[2] || Math.abs(freq[3]/freq[2]-STEP)>0.00001) continue; freq[4]=(int)(inB[i+5]& 0xFF)+(int)(inB[i+18]& 0xFF)*256; if (freq[4]==0 || freq[4]<=freq[3] || Math.abs(freq[4]/freq[3]-STEP)>0.00001) continue; freq[5]=(int)(inB[i+6]& 0xFF)+(int)(inB[i+19]& 0xFF)*256; if (freq[5]==0 || freq[5]<=freq[4] || Math.abs(freq[5]/freq[4]-STEP)>0.00001) continue; freq[6]=(int)(inB[i+7]& 0xFF)+(int)(inB[i+20]& 0xFF)*256; if (freq[6]==0 || freq[6]<=freq[5] || Math.abs(freq[6]/freq[5]-STEP)>0.00001) continue; freq[7]=(int)(inB[i+8]& 0xFF)+(int)(inB[i+21]& 0xFF)*256; if (freq[7]==0 || freq[7]<=freq[6] || Math.abs(freq[7]/freq[6]-STEP)>0.00001) continue; freq[8]=(int)(inB[i+9]& 0xFF)+(int)(inB[i+22]& 0xFF)*256; if (freq[8]==0 || freq[8]<=freq[7] || Math.abs(freq[8]/freq[7]-STEP)>0.00001) continue; freq[9]=(int)(inB[i+10]& 0xFF)+(int)(inB[i+23]& 0xFF)*256; if (freq[9]==0 || freq[9]<=freq[8] || Math.abs(freq[9]/freq[8]-STEP)>0.00001) continue; freq[10]=(int)(inB[i+11]& 0xFF)+(int)(inB[i+24]& 0xFF)*256; if (freq[10]==0 || freq[10]<=freq[9] || Math.abs(freq[10]/freq[9]-STEP)>0.00001) continue; freq[11]=(int)(inB[i+12]& 0xFF)+(int)(inB[i+25]& 0xFF)*256; if (freq[11]==0 || freq[11]<=freq[10] || Math.abs(freq[11]/freq[10]-STEP)>0.00001) continue; if (freq[11]<62000) continue; if (!checkGarbage(i, i+26)) { addData(i+13, i, freq[9]/8); markMemory(i+13, i+26, 1); markMemory(i, i+13, 1); System.out.println("SIDFREQ: HighOctave"); } } } return false; } /** * Looks for an high octave table * * @return true if it is find */ private boolean highOctave12() { final double STEP=Math.pow(2, 1/12); int[] freq=new int[12]; for (int i=start; i<end-12*2; i++) { freq[0]=(int)(inB[i]& 0xFF)+(int)(inB[i+12]& 0xFF)*256; if (freq[0]==0) continue; freq[1]=(int)(inB[i+1]& 0xFF)+(int)(inB[i+13]& 0xFF)*256; if (freq[1]==0 || freq[1]<=freq[0] || Math.abs(freq[1]/freq[0]-STEP)>0.00001) continue; freq[2]=(int)(inB[i+2]& 0xFF)+(int)(inB[i+14]& 0xFF)*256; if (freq[2]==0 || freq[2]<=freq[1] || Math.abs(freq[2]/freq[1]-STEP)>0.00001) continue; freq[3]=(int)(inB[i+3]& 0xFF)+(int)(inB[i+15]& 0xFF)*256; if (freq[3]==0 || freq[3]<=freq[2] || Math.abs(freq[3]/freq[2]-STEP)>0.00001) continue; freq[4]=(int)(inB[i+4]& 0xFF)+(int)(inB[i+16]& 0xFF)*256; if (freq[4]==0 || freq[4]<=freq[3] || Math.abs(freq[4]/freq[3]-STEP)>0.00001) continue; freq[5]=(int)(inB[i+5]& 0xFF)+(int)(inB[i+17]& 0xFF)*256; if (freq[5]==0 || freq[5]<=freq[4] || Math.abs(freq[5]/freq[4]-STEP)>0.00001) continue; freq[6]=(int)(inB[i+6]& 0xFF)+(int)(inB[i+18]& 0xFF)*256; if (freq[6]==0 || freq[6]<=freq[5] || Math.abs(freq[6]/freq[5]-STEP)>0.00001) continue; freq[7]=(int)(inB[i+7]& 0xFF)+(int)(inB[i+19]& 0xFF)*256; if (freq[7]==0 || freq[7]<=freq[6] || Math.abs(freq[7]/freq[6]-STEP)>0.00001) continue; freq[8]=(int)(inB[i+8]& 0xFF)+(int)(inB[i+20]& 0xFF)*256; if (freq[8]==0 || freq[8]<=freq[7] || Math.abs(freq[8]/freq[7]-STEP)>0.00001) continue; freq[9]=(int)(inB[i+9]& 0xFF)+(int)(inB[i+21]& 0xFF)*256; if (freq[9]==0 || freq[9]<=freq[8] || Math.abs(freq[9]/freq[8]-STEP)>0.00001) continue; freq[10]=(int)(inB[i+10]& 0xFF)+(int)(inB[i+22]& 0xFF)*256; if (freq[10]==0 || freq[10]<=freq[9] || Math.abs(freq[10]/freq[9]-STEP)>0.00001) continue; freq[11]=(int)(inB[i+11]& 0xFF)+(int)(inB[i+23]& 0xFF)*256; if (freq[11]==0 || freq[11]<=freq[10] || Math.abs(freq[11]/freq[10]-STEP)>0.00001) continue; if (freq[11]<62000) continue; /** if (inB[i]==0 && inB[i+1]==-1 && inB[i+2]==0 && inB[i+3]==-1 && inB[i+4]==0 && inB[i+5]==-1 && inB[i+6]==0 && inB[i+7]==-1 && inB[i+8]==0 && inB[i+9]==-1 && inB[i+10]==0 && inB[i+11]==-1) continue; // avoid strange low behavior */ if (!checkGarbage(i, i+23)) { addData(i+12, i, freq[9]/8); markMemory(i+12, i+23, 1); markMemory(i, i+12, 1); System.out.println("SIDFREQ: HighOctave12"); return true; // we force to find only the first } } return false; } /** * Looks for an high octave table in low/high format * * @return true if it is find */ private boolean highOctaveCombined() { final double STEP=Math.pow(2, 1/12); int[] freq=new int[12]; for (int i=start; i<end-13*2; i++) { freq[0]=(int)(inB[i]& 0xFF)+(int)(inB[i+1]& 0xFF)*256; if (freq[0]==0) continue; freq[1]=(int)(inB[i+2]& 0xFF)+(int)(inB[i+3]& 0xFF)*256; if (freq[1]==0 || freq[1]<=freq[0] || Math.abs(freq[1]/freq[0]-STEP)>0.00001) continue; freq[2]=(int)(inB[i+4]& 0xFF)+(int)(inB[i+5]& 0xFF)*256; if (freq[2]==0 || freq[2]<=freq[1] || Math.abs(freq[2]/freq[1]-STEP)>0.00001) continue; freq[3]=(int)(inB[i+6]& 0xFF)+(int)(inB[i+7]& 0xFF)*256; if (freq[3]==0 || freq[3]<=freq[2] || Math.abs(freq[3]/freq[2]-STEP)>0.00001) continue; freq[4]=(int)(inB[i+8]& 0xFF)+(int)(inB[i+9]& 0xFF)*256; if (freq[4]==0 || freq[4]<=freq[3] || Math.abs(freq[4]/freq[3]-STEP)>0.00001) continue; freq[5]=(int)(inB[i+10]& 0xFF)+(int)(inB[i+11]& 0xFF)*256; if (freq[5]==0 || freq[5]<=freq[4] || Math.abs(freq[5]/freq[4]-STEP)>0.00001) continue; freq[6]=(int)(inB[i+12]& 0xFF)+(int)(inB[i+13]& 0xFF)*256; if (freq[6]==0 || freq[6]<=freq[5] || Math.abs(freq[6]/freq[5]-STEP)>0.00001) continue; freq[7]=(int)(inB[i+14]& 0xFF)+(int)(inB[i+15]& 0xFF)*256; if (freq[7]==0 || freq[7]<=freq[6] || Math.abs(freq[7]/freq[6]-STEP)>0.00001) continue; freq[8]=(int)(inB[i+16]& 0xFF)+(int)(inB[i+17]& 0xFF)*256; if (freq[8]==0 || freq[8]<=freq[7] || Math.abs(freq[8]/freq[7]-STEP)>0.00001) continue; freq[9]=(int)(inB[i+18]& 0xFF)+(int)(inB[i+19]& 0xFF)*256; if (freq[9]==0 || freq[9]<=freq[8] || Math.abs(freq[9]/freq[8]-STEP)>0.00001) continue; freq[10]=(int)(inB[i+20]& 0xFF)+(int)(inB[i+21]& 0xFF)*256; if (freq[10]==0 || freq[10]<=freq[9] || Math.abs(freq[10]/freq[9]-STEP)>0.00001) continue; freq[11]=(int)(inB[i+22]& 0xFF)+(int)(inB[i+23]& 0xFF)*256; if (freq[11]==0 || freq[11]<=freq[10] || Math.abs(freq[11]/freq[10]-STEP)>0.00001) continue; if (freq[11]<62000) continue; if (!checkGarbage(i, i+26)) { addData(i+1, i, freq[9]/8); markMemory(i+13, i+26, 1); markMemory(i, i+13, 1); System.out.println("SIDFREQ: HighOctaveCombined"); return true; // we force to find only the first } } return false; } /** * Looks for an high octave table in high/low format * * @return true if it is find */ private boolean highOctaveCombinedInv() { final double STEP=Math.pow(2, 1/12); int[] freq=new int[12]; for (int i=start; i<end-13*2; i++) { freq[0]=(int)(inB[i]& 0xFF)*256+(int)(inB[i+1]& 0xFF); if (freq[0]==0) continue; freq[1]=(int)(inB[i+2]& 0xFF)*256+(int)(inB[i+3]& 0xFF); if (freq[1]==0 || freq[1]<=freq[0] || Math.abs(freq[1]/freq[0]-STEP)>0.00001) continue; freq[2]=(int)(inB[i+4]& 0xFF)*256+(int)(inB[i+5]& 0xFF); if (freq[2]==0 || freq[2]<=freq[1] || Math.abs(freq[2]/freq[1]-STEP)>0.00001) continue; freq[3]=(int)(inB[i+6]& 0xFF)*256+(int)(inB[i+7]& 0xFF); if (freq[3]==0 || freq[3]<=freq[2] || Math.abs(freq[3]/freq[2]-STEP)>0.00001) continue; freq[4]=(int)(inB[i+8]& 0xFF)*256+(int)(inB[i+9]& 0xFF); if (freq[4]==0 || freq[4]<=freq[3] || Math.abs(freq[4]/freq[3]-STEP)>0.00001) continue; freq[5]=(int)(inB[i+10]& 0xFF)*256+(int)(inB[i+11]& 0xFF); if (freq[5]==0 || freq[5]<=freq[4] || Math.abs(freq[5]/freq[4]-STEP)>0.00001) continue; freq[6]=(int)(inB[i+12]& 0xFF)*256+(int)(inB[i+13]& 0xFF); if (freq[6]==0 || freq[6]<=freq[5] || Math.abs(freq[6]/freq[5]-STEP)>0.00001) continue; freq[7]=(int)(inB[i+14]& 0xFF)*256+(int)(inB[i+15]& 0xFF); if (freq[7]==0 || freq[7]<=freq[6] || Math.abs(freq[7]/freq[6]-STEP)>0.00001) continue; freq[8]=(int)(inB[i+16]& 0xFF)*256+(int)(inB[i+17]& 0xFF); if (freq[8]==0 || freq[8]<=freq[7] || Math.abs(freq[8]/freq[7]-STEP)>0.00001) continue; freq[9]=(int)(inB[i+18]& 0xFF)*256+(int)(inB[i+19]& 0xFF); if (freq[9]==0 || freq[9]<=freq[8] || Math.abs(freq[9]/freq[8]-STEP)>0.00001) continue; freq[10]=(int)(inB[i+20]& 0xFF)*256+(int)(inB[i+21]& 0xFF); if (freq[10]==0 || freq[10]<=freq[9] || Math.abs(freq[10]/freq[9]-STEP)>0.00001) continue; freq[11]=(int)(inB[i+22]& 0xFF)*256+(int)(inB[i+23]& 0xFF); if (freq[11]==0 || freq[11]<=freq[10] || Math.abs(freq[11]/freq[10]-STEP)>0.00001) continue; if (freq[11]<62000) continue; if (!checkGarbage(i, i+26)) { addData(i+1, i, freq[9]/8); markMemory(i+13, i+26, 1); markMemory(i, i+13, 1); System.out.println("SIDFREQ: HighOctaveCombinedInv"); return true; // we force to find only the first } } return false; } /** * Looks for an high octave table * * @return true if it is find */ private boolean lowOctaveCombined() { final double STEP=Math.pow(2, 1/12); int[] freq=new int[12]; for (int i=start; i<end-13*2; i++) { freq[0]=(int)(inB[i]& 0xFF)+(int)(inB[i+1]& 0xFF)*256; if (freq[0]==0) continue; freq[1]=(int)(inB[i+2]& 0xFF)+(int)(inB[i+3]& 0xFF)*256; if (freq[1]==0 || freq[1]<=freq[0] || Math.abs(freq[1]/freq[0]-STEP)>0.00001) continue; freq[2]=(int)(inB[i+4]& 0xFF)+(int)(inB[i+5]& 0xFF)*256; if (freq[2]==0 || freq[2]<=freq[1] || Math.abs(freq[2]/freq[1]-STEP)>0.00001) continue; freq[3]=(int)(inB[i+6]& 0xFF)+(int)(inB[i+7]& 0xFF)*256; if (freq[3]==0 || freq[3]<=freq[2] || Math.abs(freq[3]/freq[2]-STEP)>0.00001) continue; freq[4]=(int)(inB[i+8]& 0xFF)+(int)(inB[i+9]& 0xFF)*256; if (freq[4]==0 || freq[4]<=freq[3] || Math.abs(freq[4]/freq[3]-STEP)>0.00001) continue; freq[5]=(int)(inB[i+10]& 0xFF)+(int)(inB[i+11]& 0xFF)*256; if (freq[5]==0 || freq[5]<=freq[4] || Math.abs(freq[5]/freq[4]-STEP)>0.00001) continue; freq[6]=(int)(inB[i+12]& 0xFF)+(int)(inB[i+13]& 0xFF)*256; if (freq[6]==0 || freq[6]<=freq[5] || Math.abs(freq[6]/freq[5]-STEP)>0.00001) continue; freq[7]=(int)(inB[i+14]& 0xFF)+(int)(inB[i+15]& 0xFF)*256; if (freq[7]==0 || freq[7]<=freq[6] || Math.abs(freq[7]/freq[6]-STEP)>0.00001) continue; freq[8]=(int)(inB[i+16]& 0xFF)+(int)(inB[i+17]& 0xFF)*256; if (freq[8]==0 || freq[8]<=freq[7] || Math.abs(freq[8]/freq[7]-STEP)>0.00001) continue; freq[9]=(int)(inB[i+18]& 0xFF)+(int)(inB[i+19]& 0xFF)*256; if (freq[9]==0 || freq[9]<=freq[8] || Math.abs(freq[9]/freq[8]-STEP)>0.00001) continue; freq[10]=(int)(inB[i+20]& 0xFF)+(int)(inB[i+21]& 0xFF)*256; if (freq[10]==0 || freq[10]<=freq[9] || Math.abs(freq[10]/freq[9]-STEP)>0.00001) continue; freq[11]=(int)(inB[i+22]& 0xFF)+(int)(inB[i+23]& 0xFF)*256; if (freq[11]==0 || freq[11]<=freq[10] || Math.abs(freq[11]/freq[10]-STEP)>0.00001) continue; if (freq[11]>600) continue; if (!checkGarbage(i, i+26)) { addData(i+1, i, freq[9]*16); markMemory(i+13, i+26, 1); markMemory(i, i+13, 1); System.out.println("SIDFREQ: LowOctaveCombined"); return true; // we force to find only the first } } return false; } /** * Search for tables in linear way (low / high or high / low) with inverse direction * * @return true if the table is fount */ private boolean linearInverseTable() { int i; int sid; int high=-1; int low=-1; // check for high frequency table for (i=end-1; i>=start+ALL; i--) { if (searchInverseHigh(i)) { high=i; break; } } // look if high table was fount if (high==-1) return false; // check for low frequency table (first part) if (high>ALL) { for (i=start+ALL; i<high; i++) { if (searchInverseLow(high, i)) { low=i; break; } } // check for high frequency table (second part) if ((low==-1) && (high<end-ALL)) { for (i=high+ALL; i<end; i++) { if (searchInverseLow(high, i)) { low=i; break; } } } // look if low table was fount if (low==-1) return false; } // get the A4 note sid=Unsigned.done(inB[high-A4])*256+Unsigned.done(inB[low-A4]); if (!checkGarbage(low-ALL+1, low) && !checkGarbage(high-ALL+1, high)) { addData(high-ALL+1, low-ALL+1, sid); markMemory(high-ALL+1, high, 1); markMemory(low-ALL+1, low, 1); System.out.println("SIDFREQ: LinearInverseTable"); } return true; } /** * Search for the high frequency inverse table in linear way * * @param index the index where to start the test * @return true if there is a high frequency table in that position */ private boolean searchInverseHigh(int index) { int i; int actual=1; // it must start with three 1 if ( ((int)inB[index-0]!=1) || ((int)inB[index-1]!=1) || ((int)inB[index-2]!=1)) return false; // search for increasing numbers for (i=index-3; i>index-ALL; i--) { if ((int)(inB[i]& 0xFF)<actual) return false; else actual=((int)inB[i]& 0xFF); } return true; } /** * Search for a low frequency inverse table in linear way * * @param high the position of high table * @param index the index where to search for low table * @return true if there is a low frequency table in that position */ private boolean searchInverseLow(int high, int index){ int i; int note1, note2, note3, note4, note5, note6, note7; int diff; // scan all notes for (i=0; i<12; i++) { note1=(int)(inB[high-i]& 0xFF)*256+(int)(inB[index-i]& 0xFF); note2=(int)(inB[high-i-12]& 0xFF)*256+(int)(inB[index-i-12]& 0xFF); note3=(int)(inB[high-i-12*2]& 0xFF)*256+(int)(inB[index-i-12*2]& 0xFF); note4=(int)(inB[high-i-12*3]& 0xFF)*256+(int)(inB[index-i-12*3]& 0xFF); note5=(int)(inB[high-i-12*4]& 0xFF)*256+(int)(inB[index-i-12*4]& 0xFF); note6=(int)(inB[high-i-12*5]& 0xFF)*256+(int)(inB[index-i-12*5]& 0xFF); note7=(int)(inB[high-i-12*6]& 0xFF)*256+(int)(inB[index-i-12*6]& 0xFF); diff=0; diff+=Math.abs(note1*2 - note2); if (i<11) diff+=Math.abs(note2*2 - note3); if (i<11) diff+=Math.abs(note3*2 - note4); if (i<11) diff+=Math.abs(note4*2 - note5); if (i<11) diff+=Math.abs(note5*2 - note6); if (i<11) diff+=Math.abs(note6*2 - note7); if (diff>ERROR) return false; } return true; } /** * Check if the find table is in garbage area * * @param high the high pointer * @param low the low pointer * @return true if it is garbage area */ private boolean checkGarbage(int high, int low) { if (memory[high+offset].isGarbage || memory[low+offset].isGarbage) return true; return false; } }
50,774
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
BasicDetokenize.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/BasicDetokenize.java
/** * @(#)DataTypejava 2020/10/18 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software; import java.util.ArrayList; import java.util.Hashtable; /** * Detokenize Basic program into a readable string * * @author stefano_tognon */ public class BasicDetokenize { /** List with data to detokenize */ ArrayList<Integer> list=new ArrayList(); /** * Type of Basic to detokenize */ public enum BasicType { NONE("None", false, false, false), BASIC_V2_0("Basic v2.0 (C64/VIC20/PET)", false, false, false) { @Override protected void init() { for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_V3_5("Basic v3.5 (C16)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_V3_5) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_V4_0("Basic v4.0 (PET/CBM2)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_V4_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_V7_0("Basic v7.0 (C128)", false, true, true) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_V7_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_SIMON("Basic v2.0 with Simons' Basic (C64)", true, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_SIMON) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_ANDRE_FACHAT("Basic v2.0 with @Basic (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_ANDRE_FACHAT) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_SPEECH("Basic v2.0 with Speech Basic v2.7 (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_SPEECH) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_FINAL_CART3("Basic v2.0 with Final Cartridge III (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_FINAL_CART3) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_ULTRABASIC("Basic v2.0 with Ultrabasic-64 (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_ULTRABASIC) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_GRAPHICS("Basic v2.0 with Graphics Basic (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_GRAPHICS) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_WS("Basic v2.0 with WS Basic (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_WS) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_PEGASUS("Basic v2.0 with Pegasus Basic v4.0 (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_PEGASUS) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_XBASIC("Basic v2.0 with Xbasic (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_XBASIC) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_DRAGO("Basic v2.0 with Drago Basic v2.2 (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_DRAGO) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_REU("Basic v2.0 with REU-Basic (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_REU) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_LIGHTNING("Basic v2.0 with Basic Lightning (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_LIGHTNING) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_MAGIC("Basic v2.0 with Magic Basic (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_MAGIC) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_BLARG("Basic v2.0 with Blarg (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_BLARG) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_WS_FINAL("Basic v2.0 with WS Basic final (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_WS_FINAL) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_GAME("Basic v2.0 with Game Basic (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_GAME) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_BASEX("Basic v2.0 with Basex (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_BASEX) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_SUPER("Basic v2.0 with Super Basic (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_SUPER) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_EXPANDED("Basic v2.0 with Expanded Basic (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_EXPANDED) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_SUPER_EXPANDER_CHIP("Basic v2.0 with Super Expander Chip (C64)", false, false, true) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_SUPER_EXPANDER_CHIP) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_WARSAW("Basic v2.0 with Warsaw Basic (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_WARSAW) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_DBS("Basic v2.0 with Supergrafik 64 (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_DBS) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_KIPPER("Basic v2.0 with Kipper Basic (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_KIPPER) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_BAILS("Basic v2.0 with Basic on Bails (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_BAILS) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_EVE("Basic v2.0 with Eve Basic (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_EVE) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_TOOL("Basic v2.0 with The Tool 64 (C64)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_TOOL) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_SUPER_EXPANDER("Basic v2.0 with Super Expander (VIC20)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_SUPER_EXPANDER) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_TURTLE("Basic v2.0 with Turtle Basic v1.0 (VIC20)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_TURTLE) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_EASY("Basic v2.0 with Easy Basic (VIC20)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_EASY) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_V4("Basic v2.0 with Basic v4.0 extension (VIC20)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_V4) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_V5("Basic v2.0 with Basic v4.5 extension (VIC20)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_V5) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_EXPANDED_V20("Basic v2.0 with Expanded Basic (VIC20)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_EXPANDED_V20) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_HANDY("Basic v2.0 with Handy Basic v1.0 (VIC20)", false, false, false) { @Override protected void init() { // copy back the Basic V2.0 for (Object[] couple : BASIC_TOKENS_V2_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_HANDY) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }, BASIC_V8("Basic v8 Walrusoft' (C128)", false, true, true) { @Override protected void init() { // copy back the Basic V7.0 for (Object[] couple : BASIC_TOKENS_V7_0) { hashBasic.put((Integer) couple[0], (String) couple[1]); } for (Object[] couple : BASIC_TOKENS_V8) { hashBasic.put((Integer) couple[0], (String) couple[1]); } } }; /** Opcode 64 used */ boolean op64; /** Opcode CE used */ boolean opCE; /** Opdocde FE used*/ boolean opFE; /** Name of the Basic */ String name; /** Hashtable with opcode and tokens*/ Hashtable<Integer, String> hashBasic=new Hashtable(); private BasicType(String name, boolean op64, boolean opCE, boolean opFE) { this.name=name; this.op64 = op64; this.opCE = opCE; this.opFE = opFE; init(); } /** * Empty initialization */ protected void init() { } public String getName() { return name; } /** * Give the actual hashtable for basic tokens * * @return the hash table with tokens */ public Hashtable<Integer, String> getHashBasic() { return hashBasic; } } public BasicDetokenize() { } /** BASIC V2.0 tokens */ private static final Object[][] BASIC_TOKENS_V2_0= { {0x80, "END"}, {0x81, "FOR"}, {0x82, "NEXT"}, {0x83, "DATA"}, {0x84, "INPUT#"}, {0x85, "INPUT"}, {0x86, "DIM"}, {0x87, "READ"}, {0x88, "LET"}, {0x89, "GOTO"}, {0x8A, "RUN"}, {0x8B, "IF"}, {0x8C, "RESTORE"}, {0x8D, "GOSUB"}, {0x8E, "RETURN"}, {0x8F, "REM"}, {0x90, "STOP"}, {0x91, "ON"}, {0x92, "WAIT"}, {0x93, "LOAD"}, {0x94, "SAVE"}, {0x95, "VERIFY"}, {0x96, "DEF"}, {0x97, "POKE"}, {0x98, "PRINT#"} , {0x99, "PRINT"}, {0x9A, "CONT"}, {0x9B, "LIST"}, {0x9C, "CLR"}, {0x9D, "CMD"}, {0x9E, "SYS"}, {0x9F, "OPEN"}, {0xA0, "CLOSE"}, {0xA1, "GET"}, {0xA2, "NEW"}, {0xA3, "TAB("}, {0xA4, "TO"}, {0xA5, "FN"}, {0xA6, "SPC("}, {0xA7, "THEN"}, {0xA8, "NOT"}, {0xA9, "STEP"}, {0xAA, "+"}, {0xAB, "-"}, {0xAC, "*"}, {0xAD, "/"}, {0xAE, "^"}, {0xAF, "AND"}, {0xB0, "OR"}, {0xB1, ">"}, {0xB2, "="}, {0xB3, "<"}, {0xB4, "SGN"}, {0xB5, "INT"}, {0xB6, "ABS"}, {0xB7, "USR"}, {0xB8, "FRE"}, {0xB9, "POS"}, {0xBA, "SQR"}, {0xBB, "RND"}, {0xBC, "LOG"}, {0xBD, "EXP"}, {0xBE, "COS"}, {0xBF, "SIN"}, {0xC0, "TAN"}, {0xC1, "ATN"}, {0xC2, "PEEK"}, {0xC3, "LEN"}, {0xC4, "STR$"}, {0xC5, "VAL"}, {0xC6, "ASC"}, {0xC7, "CHR$"}, {0xC8, "LEFT$"}, {0xC9, "RIGHT$"}, {0xCA, "MID$"}, {0xCB, "GO"} }; /** BASIC V3.5 tokens */ private static final Object[][] BASIC_TOKENS_V3_5={ {0xCC, "RGR"}, {0xCD, "RCLR"}, {0xCE, "RLUM"}, {0xCF, "JOY"}, {0xD0, "RDOT"}, {0xD1, "DEC"}, {0xD2, "HEX$"}, {0xD3, "ERR$"}, {0xD4, "INSTR"}, {0xD5, "ELSE"}, {0xD6, "RESUME"}, {0xD7, "TRAP"}, {0xD8, "TRON"}, {0xD9, "TROFF"}, {0xDA, "SOUND"}, {0xDB, "VOL"}, {0xDC, "AUTO"}, {0xDD, "PUDEF"}, {0xDE, "GRAPHICS"}, {0xDF, "PAINT"}, {0xE0, "CHAR"}, {0xE1, "BOX"}, {0xE2, "CIRCLE"}, {0xE3, "GSHAPE"}, {0xE4, "SSHAPE"}, {0xE5, "DRAW"}, {0xE6, "LOCATE"}, {0xE7, "COLOR"}, {0xE8, "SCNCLR"}, {0xE9, "SCALE"}, {0xEA, "HELP"}, {0xEB, "DO"}, {0xEC, "LOOP"}, {0xED, "EXIT"}, {0xEE, "DIRECTORY"},{0xEF, "DSAVE"}, {0xF0, "DLOAD"}, {0xF1, "HEADER"}, {0xF2, "SCRATCH"}, {0xF3, "COLLECT"}, {0xF4, "COPY"}, {0xF5, "RENAME"}, {0xF6, "BACKUP"}, {0xF7, "DELETE"}, {0xF8, "RENUMBER"}, {0xF9, "KEY"}, {0xFA, "MONITOR"}, {0xFB, "USING"}, {0xFC, "UNTIL"}, {0xFD, "WHILE"} }; /** BASIC V4.0 tokens */ private static final Object[][] BASIC_TOKENS_V4_0={ {0xCC, "CONCAT"}, {0xCD, "DOPEN"}, {0xCE, "DCLOSE"}, {0xCF, "RECORD"}, {0xD0, "HEADER"}, {0xD1, "COLLECT"}, {0xD2, "BACKUP"}, {0xD3, "COPY"}, {0xD4, "APPEND"}, {0xD5, "DSAVE"}, {0xD6, "DLOAD"}, {0xD7, "CATALOG"}, {0xD8, "RENAME"}, {0xD9, "SCRATCH"}, {0xDA, "DIRECTORY"} }; /** BASIC V7.0 tokens */ private static final Object[][] BASIC_TOKENS_V7_0={ {0xCC, "RGR"}, {0xCD, "RCLR"}, {0xCE02, "POT"}, {0xCE03, "BUMP"}, {0xCE04, "PEN"}, {0xCE05, "RSPPOS"}, {0xCE06, "RSPRITE"}, {0xCE07, "RSPCOLOR"}, {0xCE08, "XOR"}, {0xCE09, "RWINDOW"},{0xCE0A, "POINTER"}, {0xCF, "JOY"}, {0xD0, "RDOT"}, {0xD1, "DEC"}, {0xD2, "HEX$"}, {0xD3, "ERR$"}, {0xD4, "INSTR"}, {0xD5, "ELSE"}, {0xD6, "RESUME"}, {0xD7, "TRAP"}, {0xD8, "TRON"}, {0xD9, "TROFF"}, {0xDA, "SOUND"}, {0xDB, "VOL"}, {0xDC, "AUTO"}, {0xDD, "PUDEF"}, {0xDE, "GRAPHICS"}, {0xDF, "PAINT"}, {0xE0, "CHAR"}, {0xE1, "BOX"}, {0xE2, "CIRCLE"}, {0xE3, "GSHAPE"}, {0xE4, "SSHAPE"}, {0xE5, "DRAW"}, {0xE6, "LOCATE"}, {0xE7, "COLOR"}, {0xE8, "SCNCLR"}, {0xE9, "SCALE"}, {0xEA, "HELP"}, {0xEB, "DO"}, {0xEC, "LOOP"}, {0xED, "EXIT"}, {0xEE, "DIRECTORY"}, {0xEF, "DSAVE"}, {0xF0, "DLOAD"}, {0xF1, "HEADER"}, {0xF2, "SCRATCH"}, {0xF3, "COLLECT"}, {0xF4, "COPY"}, {0xF5, "RENAME"}, {0xF6, "BACKUP"}, {0xF7, "DELETE"}, {0xF8, "RENUMBER"}, {0xF9, "KEY"}, {0xFA, "MONITOR"}, {0xFB, "USING"}, {0xFC, "UNTIL"}, {0xFD, "WHILE"}, {0xFE02, "BANK"}, {0xFE03, "FILTER"}, {0xFE04, "PLAY"}, {0xFE05, "TEMPO"}, {0xFE06, "MOVSPR"}, {0xFE07, "SPRITE"}, {0xFE08, "SPRCOLOR"},{0xFE09, "RREG"}, {0xFE0A, "ENVELOPE"},{0xFE0B, "SLEEP"}, {0xFE0C, "CATALOG"}, {0xFE0D, "DOPEN"}, {0xFE0E, "APPEND"}, {0xFE0F, "DCLOSE"}, {0xFE10, "BSAVE"}, {0xFE11, "BLOAD"}, {0xFE12, "RECORD"}, {0xFE13, "CONCAT"}, {0xFE14, "DVERIFY"}, {0xFE15, "DCLEAR"}, {0xFE16, "SPRSAVE"}, {0xFE17, "COLLISION"}, {0xFE18, "BEGIN"}, {0xFE19, "BEND"}, {0xFE1A, "WINDOW"}, {0xFE1B, "BOOT"}, {0xFE1C, "WIDTH"}, {0xFE1D, "SPRDEF"}, {0xFE1E, "QUIT"}, {0xFE1F, "STASH"}, {0xFE21, "FETCH"}, {0xFE23, "SWAP"}, {0xFE24, "OFF"}, {0xFE25, "FAST"}, {0xFE26, "SLOW"} }; /** BASIC Simon tokens */ private static final Object[][] BASIC_TOKENS_SIMON={ {0x6400, ""}, {0x6401, "HIRES"}, {0x6402, "PLOT"}, {0x6403, "LINE"}, {0x6404, "BLOCK"}, {0x6405, "FCHR"}, {0x6406, "FCOL"}, {0x6407, "FILL"}, {0x6408, "REC"}, {0x6409, "ROT"}, {0x640A, "DRAW"}, {0x640B, "CHAR"}, {0x640C, "HI COL"}, {0x640D, "INV"}, {0x640E, "FRAC"}, {0x640F, "MOVE"}, {0x6410, "PLACE"}, {0x6411, "UPB"}, {0x6412, "UPW"}, {0x6413, "LEFTW"}, {0x6414, "LEFTB"}, {0x6415, "DOWNB"}, {0x6416, "DOWNW"}, {0x6417, "RIGHTB"}, {0x6418, "RIGHTW"}, {0x6419, "MULTI"}, {0x641A, "COLOUR"}, {0x641B, "MMOB"}, {0x641C, "BFLASH"}, {0x641D, "MOB SET"}, {0x641E, "MUSIC"}, {0x641F, "FLASH"}, {0x6420, "REPAT"}, {0x6421, "PLAY"}, {0x6422, ">>"}, {0x6423, "CENTRE"}, {0x6424, "ENVELOPE"},{0x6425, "CGOTO"}, {0x6426, "WAVE"}, {0x6427, "FETCH"}, {0x6428, "AT("}, {0x6429, "UNTIL"}, {0x642A, ">>"}, {0x642B, ">>"}, {0x642C, "USE"}, {0x642D, ">>"}, {0x642E, "GLOBAL"}, {0x642F, ">>"}, {0x6430, "RESET"}, {0x6431, "PROC"}, {0x6432, "CALL"}, {0x6433, "EXEC"}, {0x6434, "END PROC"},{0x6435, "EXIT"}, {0x6436, "END LOOP"},{0x6437, "ON KEY"}, {0x6438, "DISABLE"}, {0x6439, "RESUME"}, {0x643A, "LOOP"}, {0x643B, "DELAY"}, {0x643C, ">>"}, {0x643D, ">>"}, {0x643E, ">>"}, {0x643F, ">>"}, {0x6440, "SECURE"}, {0x6441, "DISAPA"}, {0x6442, "CIRCLE"}, {0x6443, "ON ERROR"}, {0x6444, "NO ERROR"},{0x6445, "LOCAL"}, {0x6446, "RCOMP"}, {0x6447, "ELSE"}, {0x6448, "RETRACE"}, {0x6449, "TRACE"}, {0x644A, "DIR"}, {0x644B, "PAGE"}, {0x644C, "DUMP"}, {0x644D, "FIND"}, {0x644E, "OPTION"}, {0x644F, "AUTO"}, {0x6450, "OLD"}, {0x6451, "JOY"}, {0x6452, "MOD"}, {0x6453, "DIV"}, {0x6454, ">>"}, {0x6455, "DUP"}, {0x6456, "INKEY"}, {0x6457, "INST"}, {0x6458, "TEST"}, {0x6459, "LIN"}, {0x645A, "EXOR"}, {0x645B, "INSERT"}, {0x645C, "POT"}, {0x645D, "PENX"}, {0x645E, ">>"}, {0x645F, "PENY"}, {0x6460, "SOUND"}, {0x6461, "GRAPHICS"},{0x6462, "DESIGN"}, {0x6463, "RLOCMOB"}, {0x6464, "CMOB"}, {0x6465, "BCKGNDS"}, {0x6466, "PAUSE"}, {0x6467, "NRM"}, {0x6468, "MOB OFF"}, {0x6469, "OFF"}, {0x646A, "ANGL"}, {0x646B, "ARC"}, {0x646C, "COLD"}, {0x646D, "SCRSV"}, {0x646E, "SCRLD"}, {0x646F, "TEXT"}, {0x6470, "CSET"}, {0x6471, "VOL"}, {0x6472, "DISK"}, {0x6473, "HRDCPY"}, {0x6474, "KEY"}, {0x6475, "PAINT"}, {0x6476, "LOW COL"}, {0x6477, "COPY"}, {0x6478, "MERGE"}, {0x6479, "RENUMBER"},{0x647A, "MEM"}, {0x647B, "DETECT"}, {0x647C, "CHECK"}, {0x647D, "DISPLAY"}, {0x647E, "ERR"}, {0x647F, "OUT"} }; /** BASIC Andre Fachat tokens */ private static final Object[][] BASIC_TOKENS_ANDRE_FACHAT={ {0xCC, "TRACE"}, {0xCD, "DELETE"}, {0xCE, "AUTO"}, {0xCF, "OLD"}, {0xD0, "DUMP"}, {0xD1, "FIND"}, {0xD2, "RENUMBER"}, {0xD3, "DLOAD"}, {0xD4, "DSAVE"}, {0xD5, "DVERIFY"}, {0xD6, "DIRECTORY"},{0xD7, "CATALOG"}, {0xD8, "SCRATCH"}, {0xD9, "COLLECT"}, {0xDA, "RENAME"}, {0xDB, "COPY"}, {0xDC, "BACKUP"}, {0xDD, "DISK"}, {0xDE, "HEADER"}, {0xDF, "APPEND"}, {0xE0, "MERGE"}, {0xE1, "MLOAD"}, {0xE2, "MVERIFY"}, {0xE3, "MSAVE"}, {0xE4, "KEY"}, {0xE5, "BASIC"}, {0xE6, "RESET"}, {0xE7, "EXIT"}, {0xE8, "ENTER"}, {0xE9, "DOKE"}, {0xEA, "SET"}, {0xEB, "HELP"}, {0xEC, "SCREEN"}, {0xED, "LOMEM"}, {0xEE, "HIMEM"}, {0xEF, "COLOUR"}, {0xF0, "TYPE"}, {0xF1, "TIME"}, {0xF2, "DEEK"}, {0xF3, "HEX$"}, {0xF4, "BIN$"}, {0xF5, "OFF"}, {0xF6, "ALARM"} }; /** BASIC speech v2.7 tokens */ private static final Object[][] BASIC_TOKENS_SPEECH={ {0xCC, "RESET"}, {0xCD, "BASIC"}, {0xCE, "HELP"}, {0xCF, "KEY"}, {0xD0, "HIMEM"}, {0xD1, "DISK"}, {0xD2, "DIR"}, {0xD3, "BLOAD"}, {0xD4, "BSAVE"}, {0xD5, "MAP"}, {0xD6, "MEM"}, {0xD7, "PAUSE"}, {0xD8, "BLOCK"}, {0xD9, "HEAR"}, {0xDA, "RECORD"}, {0xDB, "PLAY"}, {0xDC, "VOLDER"}, {0xDD, "COLDEF"}, {0xDE, "HEX"}, {0xDF, "DEZ"}, {0xE0, "SCREEN"}, {0xE1, "EXEC"}, {0xE2, "MON"}, {0xE3, "<-"}, {0xE4, "FROM"}, {0xE5, "SPEED"}, {0xE6, "OFF"} }; /** BASIC Final Cartiridge III tokens */ private static final Object[][] BASIC_TOKENS_FINAL_CART3={ {0xCC, "OFF"}, {0xCD, "AUTO"}, {0xCE, "DEL"}, {0xCF, "RENUM"}, {0xD0, "?ERROR?"}, {0xD1, "FIND"}, {0xD2, "OLD"}, {0xD3, "DLOAD"}, {0xD4, "DVERIFY"}, {0xD5, "DSAVE"}, {0xD6, "APPEND"}, {0xD7, "DAPPEND"}, {0xD8, "DOS"}, {0xD9, "KILL"}, {0xDA, "MOM"}, {0xDB, "PDIR"}, {0xDC, "PLIST"}, {0xDD, "BAR"}, {0xDE, "DESKTOP"}, {0xDF, "DUMP"}, {0xE0, "ARRAY"}, {0xE1, "MEM"}, {0xE2, "TRACE"}, {0xE3, "REPLACE"}, {0xE4, "ORDER"}, {0xE5, "PACK"}, {0xE6, "UNPACK"}, {0xE7, "MREAD"}, {0xE8, "MWRITE"} }; /** BASIC Ultrabasic tokens */ private static final Object[][] BASIC_TOKENS_ULTRABASIC={ {0xCC, "DOT"}, {0xCD, "DRAW"}, {0xCE, "BOX"}, {0xCF, "TIC"}, {0xD0, "COPY"}, {0xD1, "SPRITE"}, {0xD2, "OFF"}, {0xD3, "MODE"}, {0xD4, "NORM"}, {0xD5, "GRAPH"}, {0xD6, "DUMP"}, {0xD7, "GREAD"}, {0xD8, "CHAR"}, {0xD9, "PLACE"}, {0xDA, "MULTI"}, {0xDB, "HIRES"}, {0xDC, "HEX"}, {0xDD, "BIT"}, {0xDE, "COLORS"}, {0xDF, "PIXEL"}, {0xE0, "FILL"}, {0xE1, "CIRCLE"}, {0xE2, "BLOCK"}, {0xE3, "SDATA"}, {0xE4, "VOL"}, {0xE5, "GEN"}, {0xE6, "SCROLL"}, {0xE7, "BCOLL"}, {0xE8, "JOY"}, {0xE9, "PADDLE"}, {0xEA, "PEN"}, {0xEB, "SOUND"}, {0xEC, "TUNE"}, {0xED, "TDATA"}, {0xEE, "SET"}, {0xEF, "TURNTO"}, {0xF0, "TURN"}, {0xF1, "TUP"}, {0xF2, "TDOWN"}, {0xF3, "TCOLOR"}, {0xF4, "TURTLE"}, {0xF5, "MOVE"}, {0xF6, "BYE"}, {0xF7, "ROTATE"}, {0xF8, "TPOS"}, {0xF9, "CTR"}, {0xFA, "SCTR"}, {0xFB, "["}, {0xFC, "]"}, {0xFD, "HARD"}, {0xFE, "EXIT"} }; /** BASIC Graphics tokens */ private static final Object[][] BASIC_TOKENS_GRAPHICS={ {0xCC, "BACKGROUND"}, {0xCD, "BORDER"}, {0xCE, "DIR"}, {0xCF, "DISK"}, {0xD0, "FILL"}, {0xD1, "KEY"}, {0xD2, "CIRCLE"}, {0xD3, "PROCEDURE"}, {0xD4, "DOT"}, {0xD5, "FIND"}, {0xD6, "CHANGE"}, {0xD7, "REN"}, {0xD8, "ELSE"}, {0xD9, "COPY"}, {0xDA, "SCROLL"}, {0xDB, "ROLL"}, {0xDC, "BOX"}, {0xDD, "SCALE"}, {0xDE, "DO"}, {0xDF, "LINE"}, {0xE0, "SPRITE"}, {0xE1, "COLOR"}, {0xE2, "HIRES"}, {0xE3, "CLEAR"}, {0xE4, "TEXT"}, {0xE5, "WINDOW"}, {0xE6, "OFF"}, {0xE7, "AT"}, {0xE8, "SHAPE"}, {0xE9, "XYSIZE"}, {0xEA, "SPEED"}, {0xEB, "FROM"}, {0xEC, "SETORIGIN"}, {0xED, "ANIMATE"}, {0xEE, "MULTI"}, {0xEF, "EZE"}, {0xF0, "MOVE"}, {0xF1, "UNDER"}, {0xF2, "EDIT"}, {0xF3, "RESET"}, {0xF4, "XPOS"}, {0xF5, "GPRINT"}, {0xF6, "VOICE"}, {0xF7, "ADSR"}, {0xF8, "WAVE"}, {0xF9, "NE"}, {0xFA, "VOLUME"}, {0xFB, "PLAY"}, {0xFC, "YPOS"}, {0xFD, "SOUND"}, {0xFE, "JOY"} }; /** BASIC WS tokens */ private static final Object[][] BASIC_TOKENS_WS={ {0xCC, "COPY"}, {0xCD, "OLD"}, {0xCE, "PORT"}, {0xCF, "DOKE"}, {0xD0, "VPOKE"}, {0xD1, "FILL"}, {0xD2, "ERROR"}, {0xD3, "SEND"}, {0xD4, "CALL"}, {0xD5, "BIT"}, {0xD6, "DIR"}, {0xD7, "BLOAD"}, {0xD8, "BSAVE"}, {0xD9, "FIND"}, {0xDA, "SPEED"}, {0xDB, "PITCH"}, {0xDC, "SAY"}, {0xDD, "FAST"}, {0xDE, "SLOW"}, {0xDF, "TALK"}, {0xE0, "SHUTUP"}, {0xE1, "STASH"}, {0xE2, "FETCH"}, {0xE3, "SWAP"}, {0xE4, "OFF"}, {0xE5, "SCREEN"}, {0xE6, "DEVICE"}, {0xE7, "OBJECT"}, {0xE8, "VSTASH"}, {0xE9, "VFETCH"}, {0xEA, "QUIET"}, {0xEB, "COLOR"}, {0xEC, "CLS"}, {0xED, "CURPOS"}, {0xEE, "MONITOR"}, {0xEF, "SUBEND"}, {0xF0, "DO"}, {0xF1, "LOOP"}, {0xF2, "EXIT"}, {0xF3, "DEEK"}, {0xF4, "RSC"}, {0xF5, "RSM"}, {0xF6, "DEC"}, {0xF7, "HEX$"}, {0xF8, "HI"}, {0xF9, "LO"}, {0xFA, "DS$"}, {0xFB, "LINE"}, {0xFC, "VPEEK"}, {0xFD, "ROW"}, {0xFE, "JOY"} }; /** BASIC Pegasus v4.0 tokens */ private static final Object[][] BASIC_TOKENS_PEGASUS={ {0xCC, "OFF"}, {0xCD, "ASC("}, {0xCE, "SIN("}, {0xCF, "COS("}, {0xD0, "TAN("}, {0xD1, "ATN("}, {0xD2, "DEG("}, {0xD3, "RAD("}, {0xD4, "FRAC("}, {0xD5, "MOD("}, {0xD6, "ROUND("}, {0xD7, "DEC("}, {0xD8, "BIN("}, {0xD9, "DEEK("}, {0xDA, "INSTR("}, {0xDB, "JOY("}, {0xDC, "POT("}, {0xDD, "SCREEN("}, {0xDE, "TEST("}, {0xDF, "USING("}, {0xE0, "DS$"}, {0xE1, "HEX$"}, {0xE2, "BIN$"}, {0xE3, "SPACE$"}, {0xE4, "UCASE$"}, {0xE5, "STRING$"}, {0xE6, "INPUT$"}, {0xE7, "TIME$"}, {0xE8, "SPRITEX("}, {0xE9, "SPRITEY("}, {0xEA, "TURTLEX("}, {0xEB, "TURTLEY("}, {0xEC, "TURTLEANG"} }; /** BASIC Xbasic tokens */ private static final Object[][] BASIC_TOKENS_XBASIC={ {0xCC, "SPRAT"}, {0xCD, "BRDR"}, {0xCE, "SCREEN"}, {0xCF, "QUIT"}, {0xD0, "SPRMULT"}, {0xD1, "MOVE"}, {0xD2, "SPRITE"}, {0xD3, "ASPRITE"}, {0xD4, "DSPRITE"}, {0xD5, "SID"}, {0xD6, "ENVELOPE"}, {0xD7, "GATE"}, {0xD8, "FRQ"}, {0xD9, "WAVE"}, {0xDA, "VOL"}, {0xDB, "FCUT"}, {0xDC, "FMODE"}, {0xDD, "FILTER"}, {0xDE, "FRSN"}, {0xDF, "CSET"}, {0xE0, "MULTI"}, {0xE1, "EXTND"}, {0xE2, "LOCALE"}, {0xE3, "CENTER"}, {0xE4, "HIRES"}, {0xE5, "LINE"}, {0xE6, "HPRNT"}, {0xE7, "PLOT"}, {0xE8, "TEXT"}, {0xE9, "CLEAR"}, {0xEA, "COLR"}, {0xEB, "STICK"}, {0xEC, "BTN"} }; /** BASIC Drago v2.2 tokens */ private static final Object[][] BASIC_TOKENS_DRAGO={ {0xCC, "PUNKT"}, {0xCD, "LINIA"}, {0xCE, "RYSUJ"}, {0xCF, "PARAM"}, {0xD0, "KUNTUR"}, {0xD1, "ANIM"}, {0xD2, "KOLOR"}, {0xD3, "PUWID"}, {0xD4, "RYSELIP"}, {0xD5, "KOGUMA"}, {0xD6, "FIUT"}, {0xD7, "FIGURA"}, {0xD8, "FIGUMA"} }; /** BASIC Reu tokens */ private static final Object[][] BASIC_TOKENS_REU={ {0xCC, "PUSH"}, {0xCD, "PULL"}, {0xCE, "FLIP"}, {0xCF, "REC"}, {0xD0, "STASH"}, {0xD1, "FETCH"}, {0xD2, "SWAP"}, {0xD3, "REU"}, {0xD4, "SIZE"}, {0xD5, "DIR"}, {0xD6, "@"}, {0xD7, "KILL"}, {0xD8, "ROM"}, {0xD9, "RAM"}, {0xDA, "MOVE"} }; /** BASIC Lightning tokens */ private static final Object[][] BASIC_TOKENS_LIGHTNING={ {0xCC, "ELSE"}, {0xCD, "HEX$"}, {0xCE, "DDEK"}, {0xCF, "TRUE"}, {0xD0, "IMPORT"}, {0xD1, "CFN"}, {0xD2, "SIZE"}, {0xD3, "FALSE"}, {0xD4, "VER$"}, {0xD5, "LPX"}, {0xD6, "LPY"}, {0xD7, "COMMON%"}, {0xD8, "CROW"}, {0xD9, "CCOL"}, {0xDA, "ATR"}, {0xDB, "INC"}, {0xDC, "NUM"}, {0xDD, "ROW2"}, {0xDE, "COL2"}, {0xDF, "SPN2"}, {0xE0, "HGT"}, {0xE1, "WID"}, {0xE2, "ROW"}, {0xE3, "COL"}, {0xE4, "SPN"}, {0xE5, "TASK"}, {0xE6, "HALT"}, {0xE7, "REPEAT"}, {0xE8, "UNTIL"}, {0xE9, "WHILE"}, {0xEA, "WEND"}, {0xEB, "CIF"}, {0xEC, "CELSE"}, {0xED, "CEND"}, {0xEE, "LABEL"}, {0xEF, "DOKE"}, {0xF0, "EXIT"}, {0xF1, "ALLOCATE"}, {0xF2, "DASABLE"}, {0xF3, "PULL"}, {0xF4, "DLOAD"}, {0xF5, "DSAVE"}, {0xF6, "VAR"}, {0xF7, "LOCAL"}, {0xF8, "PROCEND"}, {0xF9, "PROC"}, {0xFA, "CASEND"}, {0xFB, "OF"}, {0xFC, "CASE"}, {0xFD, "RPT"}, {0xFE, "SETATR"} }; /** BASIC Magic tokens */ private static final Object[][] BASIC_TOKENS_MAGIC={ {0xCC, "ASSEMBLER"}, {0xCD, "AUTO"}, {0xCE, "CDRIVE"}, {0xCF, "CAT"}, {0xD0, "DAPPEND"}, {0xD1, "DELETE"}, {0xD2, "DEZ"}, {0xD3, "DIR"}, {0xD4, "DLOAD"}, {0xD5, "DSAVE"}, {0xD6, "DVERIFY"}, {0xD7, "CONFIG"}, {0xD8, "FIND"}, {0xD9, " "}, {0xDA, " "}, {0xDB, "HELP"}, {0xDC, "HEX"}, {0xDD, "JUMP"}, {0xDE, "LLIST"}, {0xDF, "LPRINT"}, {0xE0, "OFF"}, {0xE1, "OLD"}, {0xE2, "RENUM"}, {0xE3, "CRUN"}, {0xE4, "SEND"}, {0xE5, "STATUS"}, {0xE6, "HIRES"}, {0xE7, "MULTI"}, {0xE8, "CLEAR"}, {0xE9, "PLOT"}, {0xEA, "INVERT"}, {0xEB, "LINE"}, {0xEC, "TEXT"}, {0xED, "GRAPHIK"}, {0xEE, "PAGE"}, {0xEF, "BOX"}, {0xF0, "DRAW"}, {0xF1, "MIX"}, {0xF2, "COPY"}, {0xF3, "CIRCLE"}, {0xF4, "GSAVE"}, {0xF5, "GLOAD"}, {0xF6, "FRAME"}, {0xF7, "HPRINT"}, {0xF8, "VPRINT"}, {0xF9, "BLOCK"}, {0xFA, "FILL"}, {0xFB, " "}, {0xFC, "REPLACE"}, {0xFD, "LRUN"} }; /** BASIC Blarg tokens */ private static final Object[][] BASIC_TOKENS_BLARG={ {0xE0, "PLOT"}, {0xE1, "LINE"}, {0xE2, "CIRCLE"}, {0xE3, "GRON"}, {0xE4, "GROFF"}, {0xE5, "MODE"}, {0xE6, "ORIGIN"}, {0xE7, "cLEAR"}, {0xE8, "BUFFER"}, {0xE9, "SWAP"}, {0xEA, "COLOr"} }; /** BASIC WS Final tokens */ private static final Object[][] BASIC_TOKENS_WS_FINAL={ {0xCC, "COPY"}, {0xCD, "BANJ"}, {0xCE, "OLD"}, {0xCF, "DOKE"}, {0xD0, "DISPLAY"}, {0xD1, "FILL"}, {0xD2, "ERROR"}, {0xD3, "SEND"}, {0xD4, "CALL"}, {0xD5, "BIT"}, {0xD6, "DIR"}, {0xD7, "BLOAD"}, {0xD8, "BSAVE"}, {0xD9, "FIND"}, {0xDA, "SPEED"}, {0xDB, "PITCH"}, {0xDC, "SAY"}, {0xDD, "FAST"}, {0xDE, "SLOW"}, {0xDF, "TALK"}, {0xE0, "SHUTUP"}, {0xE1, "STASH"}, {0xE2, "FETCH"}, {0xE3, "SWAP"}, {0xE4, "OFF"}, {0xE5, "MODE"}, {0xE6, "DEVICE"}, {0xE7, "OBJECT"}, {0xE8, "VSTASH"}, {0xE9, "VFETCH"}, {0xEA, "LATCH"}, {0xEB, "COLOR"}, {0xEC, "CLS"}, {0xED, "CURPOS"}, {0xEE, "MONITOR"}, {0xEF, "SUBEND"}, {0xF0, "DO"}, {0xF1, "LOOP"}, {0xF2, "EXIT"}, {0xF3, "DEEK"}, {0xF4, "COL"}, {0xF5, "RSM"}, {0xF6, "DEC"}, {0xF7, "HEX$"}, {0xF8, "HI"}, {0xF9, "LO"}, {0xFA, "DS$"}, {0xFB, "LINE"}, {0xFC, "BNK"}, {0xFD, "YPOS"}, {0xFE, "JOY"} }; /** BASIC Game tokens */ private static final Object[][] BASIC_TOKENS_GAME={ {0xCC, "WINDOW"}, {0xCD, "BFILE"}, {0xCE, "UPPER"}, {0xCF, "LOWER"}, {0xD0, "CLS"}, {0xD1, "SCREEN"}, {0xD2, "PARSE"}, {0xD3, "PROC"}, {0xD4, "ELSE"}, {0xD5, "SCRATCH"}, {0xD6, "REPLACE"}, {0xD7, "DEVICE"}, {0xD8, "DIR"}, {0xD9, "REPEAT"}, {0xDA, "UNTIL"}, {0xDB, "DISK"}, {0xDC, "FETCH#"}, {0xDD, "PUT#"}, {0xDE, "PROMPT"}, {0xDF, "POP"}, {0xE0, "HELP"}, {0xE1, "EXIT"}, {0xE2, "DISABLE"}, {0xE3, "ENTER"}, {0xE4, "RESET"}, {0xE5, "WARM"}, {0xE6, "NUM"}, {0xE7, "TYPE"}, {0xE8, "TEXT$"} }; /** BASIC Basex tokens */ private static final Object[][] BASIC_TOKENS_BASEX={ {0xCC, "APPEND"}, {0xCD, "AUTO"}, {0xCE, "BAR"}, {0xCF, "CIRCLE"}, {0xD0, "CLG"}, {0xD1, "CLS"}, {0xD2, "CSR"}, {0xD3, "DELETE"}, {0xD4, "DISK"}, {0xD5, "DRAW"}, {0xD6, "EDGE"}, {0xD7, "ENVELOPE"}, {0xD8, "FILL"}, {0xD9, "KEY"}, {0xDA, "MOB"}, {0xDB, "MODE"}, {0xDC, "MOVE"}, {0xDD, "OLD"}, {0xDE, "PIC"}, {0xDF, "DUMP"}, {0xE0, "PLOT"}, {0xE1, "RENUMBER"}, {0xE2, "REPEAT"}, {0xE3, "SCROLL"}, {0xE4, "SOUND"}, {0xE5, "WHILE"}, {0xE6, "UNTIL"}, {0xE7, "VOICE"}, {0xE8, "ASS"}, {0xE9, "DIS"}, {0xEA, "MEM"} }; /** BASIC Super tokens */ private static final Object[][] BASIC_TOKENS_SUPER={ {0xDB, "VOLUME"}, {0xDC, "RESET"}, {0xDD, "MEM"}, {0xDE, "TRACE"}, {0xDF, "BASIC"}, {0xE0, "RESUME"}, {0xE1, "LETTER"}, {0xE2, "HELP"}, {0xE3, "COKE"}, {0xE4, "GROUND"}, {0xE5, "MATRIX"}, {0xE6, "DISPOSE"}, {0xE7, "PRINT@"}, {0xE8, "HIMEM"}, {0xE9, "HARDCOPY"}, {0xEA, "INPUTFORM"}, {0xEB, "LOCK"}, {0xEC, "SWAP"}, {0xED, "USING"}, {0xEE, "SEC"}, {0xEF, "ELSE"}, {0xF0, "ERROR"}, {0xF1, "ROUND"}, {0xF2, "DEEK"}, {0xF3, "STRING$"}, {0xF4, "POINT"}, {0xF5, "INSTR"}, {0xF6, "CEEK"}, {0xF7, "MIN"}, {0xF8, "MAX"}, {0xF9, "VARPTR"}, {0xFA, "FRAC"}, {0xFB, "ODD"}, {0xFC, "DEC"}, {0xFD, "HEX$"}, {0xFE, "EVAL"} }; /** BASIC Expanded tokens */ private static final Object[][] BASIC_TOKENS_EXPANDED={ {0xCC, "HIRES"}, {0xCD, "NORM"}, {0xCE, "GRAPH"}, {0xCF, "SET"}, {0xD0, "LINE"}, {0xD1, "CIRCLE"}, {0xD2, "FILL"}, {0xD3, "MODE"}, {0xD4, "CLS"}, {0xD5, "TEXT"}, {0xD6, "COLOR"}, {0xD7, "GSAVE"}, {0xD8, "GLOAD"}, {0xD9, "INVERSE"}, {0xDA, "FRAME"}, {0xDB, "MOVE"}, {0xDC, "USING"}, {0xDD, "RENUMBER"}, {0xDE, "DELETE"}, {0xDF, "BOX"}, {0xE0, "MOBDEF"}, {0xE1, "SPRITE"}, {0xE2, "MOBSET"}, {0xE3, "MODSIZE"}, {0xE4, "MOBCOLOR"}, {0xE5, "MOBMULTI"}, {0xE6, "MOBMOVE"}, {0xE7, "DOKE"}, {0xE8, "ALLCLOSE"}, {0xE9, "OLD"}, {0xEA, "AUTO"}, {0xEB, "VOLUME"}, {0xEC, "ENVELOPE"}, {0xED, "WAVE"}, {0xEE, "PLAY"}, {0xEF, "CASE ERROR"}, {0xF0, "RESUME"}, {0xF1, "NO ERROR"}, {0xF2, "FIND"}, {0xF3, "INKEY"}, {0xF4, "MERGE"}, {0xF5, "HARDCOPY"} }; /** BASIC Super Expander Chip tokens */ private static final Object[][] BASIC_TOKENS_SUPER_EXPANDER_CHIP={ {0xFE00, "KEY"}, {0xFE01, "COLOR"}, {0xFE02, "GRAPHIC"}, {0xFE03, "SCNCLR"}, {0xFE04, "LOCATE"}, {0xFE05, "SCALE"}, {0xFE06, "BOX"}, {0xFE07, "CIRCLE"}, {0xFE08, "CHAT"}, {0xFE09, "DRAW"}, {0xFE0A, "GSHAPE"}, {0xFE0B, "PAINT"}, {0xFE0C, "SSHAPE"}, {0xFE0D, "TUNE"}, {0xFE0E, "FILTER"}, {0xFE0F, "SPRDEF"}, {0xFE10, "TEMPO"}, {0xFE11, "MOVSPR"}, {0xFE12, "SPRCOL"}, {0xFE13, "SPRITE"}, {0xFE14, "COLINT"}, {0xFE15, "SPSAV"}, {0xFE16, "RDUMP"}, {0xFE17, "RCLR"}, {0xFE18, "RDOT"}, {0xFE19, "RGR"}, {0xFE1A, "RJOY"}, {0xFE1B, "RPEN"}, {0xFE1C, "RPOT"}, {0xFE1D, "RSPCOL"}, {0xFE1E, "RSPPOS"}, {0xFE1F, "RSPR"} }; /** BASIC Warsaw tokens */ private static final Object[][] BASIC_TOKENS_WARSAW={ {0xDB, "HISAVE"}, {0xDC, "SLINE"}, {0xDD, "MEM"}, {0xDE, "TRACE"}, {0xDF, "BEEP"}, {0xE0, "RESUME"}, {0xE1, "LETTER"}, {0xE2, "HELP"}, {0xE3, "*****"}, {0xE4, "GROUND"}, {0xE5, "REVERS"}, {0xE6, "DISPOSE"}, {0xE7, "PRINT@"}, {0xE8, "HIMEM"}, {0xE9, "*****"}, {0xEA, "LINE"}, {0xEB, "PROC"}, {0xEC, "AXIS"}, {0xED, "USING"}, {0xEE, "SEC"}, {0xEF, "ELSE"}, {0xF0, "RROR"}, {0xF1, "ROUND"}, {0xF2, "****"}, {0xF3, "*******"}, {0xF4, "*****"}, {0xF5, "*****"}, {0xF6, "POUND"}, {0xF7, "MIN"}, {0xF8, "MAX"}, {0xF9, "******"}, {0xFA, "FRAC"}, {0xFB, "ODD"}, {0xFC, "***"}, {0xFD, "HEEK"}, {0xFE, "EVAL"} }; /** BASIC Data Becker Supergrafik tokens */ private static final Object[][] BASIC_TOKENS_DBS={ {0xD7, "DIRECTORY"}, {0xD8, "SPOWER"}, {0xD9, "GCOMB"}, {0xDA, "DTASET"}, {0xDB, "MERGE"}, {0xDC, "RENUM"}, {0xDD, "KEY"}, {0xDE, "TRANS"}, {0xDF, ""}, {0xE0, "TUNE"}, {0xE1, "SOUND"}, {0xE2, "VOLUME="}, {0xE3, "FILTER"}, {0xE4, "SREAD"}, {0xE5, "DEFINE"}, {0xE6, "SET"}, {0xE7, "SWAIT"}, {0xE8, "SMODE"}, {0xE9, "GMODE"}, {0xEA, "GCLEAR"}, {0xEB, "GMOVE"}, {0xEC, "PLOT"}, {0xED, "DRAW"}, {0xEE, "FILL"}, {0xEF, "FRAME"}, {0xF0, "INVERS"}, {0xF1, "TEXT"}, {0xF2, "CIRCLE"}, {0xF3, "PADDLE"}, {0xF4, "SCALE="}, {0xF5, "COLOR="}, {0xF6, "SCOL="}, {0xF7, "PCOL="}, {0xF8, "GSAVE"}, {0xF9, "GLOAD"}, {0xFA, "HCOPY"}, {0xFB, "IRETURN"}, {0xFC, "IF#"}, {0xFD, "PAINT"}, {0xFE, "EVAL"} }; /** BASIC Kipper tokens */ private static final Object[][] BASIC_TOKENS_KIPPER={ {0xE1, "IPCFG"}, {0xE2, "DHCP"}, {0xE3, "PING"}, {0xE4, "MYIP"}, {0xE5, "NETMASK"}, {0xE6, "GSTEWAY"}, {0xE7, "DNS"}, {0xE8, "TFTP"}, {0xE9, "TFGET"}, {0xEA, "TFPUT"}, {0xEB, "NETCAT"}, {0xEC, "TCPCONNECT"}, {0xED, "POLL"}, {0xEE, "TCPLISTEN"}, {0xEF, "TCPSEND"}, {0xF0, "TCPCLOSE"}, {0xF1, "TCPBLAT"}, {0xF2, "MAC"} }; /** BASIC Bails tokens */ private static final Object[][] BASIC_TOKENS_BAILS={ {0xE1, "IPCFG"}, {0xE2, "DHCP"}, {0xE3, "PING"}, {0xE4, "MYIP"}, {0xE5, "NETMASK"}, {0xE6, "GATEWAY"}, {0xE7, "DNS"}, {0xE8, "HOOK"}, {0xE9, "YIELD"}, {0xEA, "XSEND"}, {0xEB, "!"}, {0xEC, "HTTPD"}, {0xED, "TYPE"}, {0xEE, "STATUS"}, {0xEF, "FLUSH"}, {0xF0, "MAC"} }; /** BASIC Eve tokens */ private static final Object[][] BASIC_TOKENS_EVE={ {0xCC, "ELSE"}, {0xCD, "PAGE"}, {0xCE, "PAPER"}, {0xCF, "INK"}, {0xD0, "LOCATE"}, {0xD1, "ERASE"}, {0xD2, "GRAPHIC"}, {0xD3, "SCALE"}, {0xD4, "PEN"}, {0xD5, "POINT"}, {0xD6, "LINE"}, {0xD7, "PAINT"}, {0xD8, "WRITE"}, {0xD9, "DRAW"}, {0xDA, "IMAGE"}, {0xDB, "SPRITE"}, {0xDC, "SPRPIC"}, {0xDD, "SPRCOL"}, {0xDE, "SPRLOC"}, {0xDF, "SPRMULTI"}, {0xE0, "TONE"}, {0xE1, "ENVELOPE"}, {0xE2, "WAVE"}, {0xE3, "VOL"}, {0xE4, "FILTER"}, {0xE5, "DOS"}, {0xE6, "DVC"}, {0xE7, "DIR"}, {0xE8, "CAT"}, {0xE9, "RECORD#"}, {0xEA, "SWAP"}, {0xEB, "EXIT"}, {0xEC, "DO"}, {0xED, "LOOP"}, {0xEE, "WHILE"}, {0xEF, "UNTIL"}, {0xF0, "CUR"}, {0xF1, "BIN$"}, {0xF2, "MAK$"}, {0xF3, "INPUT$"}, {0xF4, "FMT$"}, {0xF5, "INFIX$"}, {0xF6, "INSTR"}, {0xF7, "DS$"}, {0xF8, "DS"}, {0xF9, "SD"}, }; /** BASIC Tool tokens */ private static final Object[][] BASIC_TOKENS_TOOL={ {0xDB, " "}, {0xDC, "SORT"}, {0xDD, "EXTRACT"}, {0xDE, "CARGET"}, {0xDF, " "}, {0xE0, " "}, {0xE1, "SCREEN"}, {0xE2, "GRAPHIC"}, {0xE3, "TEXT"}, {0xE4, "AUTO"}, {0xE5, "FIND"}, {0xE6, "DUMP"}, {0xE7, "ERROR"}, {0xE8, "RENU"}, {0xE9, "DELETE"}, {0xEA, "PLOT"}, {0xEB, "POINT"}, {0xEC, "DRAW"}, {0xED, "MOVE"}, {0xEE, "COLOR"}, {0xEF, "ELSE"}, {0xF0, "DISPLAY"}, {0xF1, "TRACE"}, {0xF2, "OFF"}, {0xF3, "HCOPY"}, {0xF4, "JOY"} }; /** BASIC Super Expander tokens */ private static final Object[][] BASIC_TOKENS_SUPER_EXPANDER={ {0xCC, "KEY"}, {0xCD, "GRAPHIC"}, {0xCE, "SCNCLR"}, {0xCF, "CIRCLE"}, {0xD0, "DRAW"}, {0xD1, "REGION"}, {0xD2, "COLOR"}, {0xD3, "POINT"}, {0xD4, "SOUND"}, {0xD5, "CHAR"}, {0xD6, "PAINT"}, {0xD7, "RPOT"}, {0xD8, "RPEN"}, {0xD9, "RSND"}, {0xDA, "RCOLOR"}, {0xDB, "RGB"}, {0xDC, "RJOY"}, {0xDD, "RDOT"} }; /** BASIC Turtle tokens */ private static final Object[][] BASIC_TOKENS_TURTLE={ {0xCC, "GRAPHIC"}, {0xCD, "OLD"}, {0xCE, "TURN"}, {0xCF, "PEN"}, {0xD0, "DRAW"}, {0xD1, "MOVE"}, {0xD2, "POINT"}, {0xD3, "KILL"}, {0xD4, "WRITE"}, {0xD5, "REPEAT"}, {0xD6, "SCREEN"}, {0xD7, "DOKE"}, {0xD8, "RELOC"}, {0xD9, "FILL"}, {0xDA, "RTIME"}, {0xDB, "BASE"}, {0xDC, "PAUSE"}, {0xDD, "POP"}, {0xDE, "COLOR"}, {0xDF, "MERGE"}, {0xE0, "CHAR"}, {0xE1, "TAKE"}, {0xE2, "SOUND"}, {0xE3, "VOL"}, {0xE4, "PUT"}, {0xE5, "PLACE"}, {0xE6, "CLS"}, {0xE7, "ACCEPT"}, {0xE8, "RESET"}, {0xE9, "GRAB"}, {0xEA, "RDOT"}, {0xEB, "PLR$"}, {0xEC, "DEEK"}, {0xED, "JOY"} }; /** BASIC Easy tokens */ private static final Object[][] BASIC_TOKENS_EASY={ {0xCC, "DELETE"}, {0xCD, "OLD"}, {0xCE, "RENUMBER"}, {0xCF, "DUMP"}, {0xD0, "MERGE"}, {0xD1, "PLOT"}, {0xD2, "TRACE"}, {0xD3, "KILL"}, {0xD4, "HELP"}, {0xD5, "DLOAD"}, {0xD6, "DSAVE"}, {0xD7, "DVERIFY"}, {0xD8, "APPEND"}, {0xD9, "SCREEN"}, {0xDA, "DIRECTORY"}, {0xDB, "KEY"}, {0xDC, "SEND"}, {0xDD, "POP"}, {0xDE, "OFF"}, {0xDF, "POUT"}, {0xE0, "HEADER"}, {0xE1, "FIND"}, {0xE2, "AUTO"}, {0xE3, "PPRINT"}, {0xE4, "ACCEPT"}, {0xE5, "RESET"}, {0xE6, "SCRATCH"}, {0xE7, "COLOR"}, {0xE8, "TAKE"}, {0xE9, "PAUSE"}, {0xEA, "BASE"}, {0xEB, "COPYCHR"}, {0xEC, "CHAR"}, {0xED, "CLK"}, {0xEE, "CLS"}, {0xEF, "FILL"}, {0xF0, "RETIME"}, {0xF1, "SOUND"}, {0xF2, "POFF"}, {0xF3, "PLIST"}, {0xF4, "PUT"}, {0xF5, "VOLUME"}, {0xF6, "JOY"}, {0xF7, "MSB"}, {0xF8, "LSB"}, {0xF9, "VECTOR"}, {0xFA, "RKEY"}, {0xFB, "DEC"}, {0xFC, "HEX$"}, {0xFD, "GRAB"}, {0xFE, "DS$"} }; /** BASIC V4 tokens */ private static final Object[][] BASIC_TOKENS_V4={ {0xCC, "CONCAT"}, {0xCD, "DOPEN"}, {0xCE, "DCLOSE"}, {0xCF, "RECORD"}, {0xD0, "HEADER"}, {0xD1, "COLLECT"}, {0xD2, "BACKUP"}, {0xD3, "COPY"}, {0xD4, "APPEND"}, {0xD5, "DSAVE"}, {0xD6, "DLOAD"}, {0xD7, "CATALOG"}, {0xD8, "RENAME"}, {0xD9, "SCRATCH"}, {0xDA, "DIRECTORY"}, {0xDB, "IEEE"}, {0xDC, "SERIAL"}, {0xDD, "PARALLEL"}, {0xDE, "MONITOR"}, {0xDF, "MODEM"} }; /** BASIC V5 tokens */ private static final Object[][] BASIC_TOKENS_V5={ {0xCC, "CONCAT"}, {0xCD, "DOPEN"}, {0xCE, "DCLOSE"}, {0xCF, "RECORD"}, {0xD0, "HEADER"}, {0xD1, "COLLECT"}, {0xD2, "BACKUP"}, {0xD3, "COPY"}, {0xD4, "APPEND"}, {0xD5, "DSAVE"}, {0xD6, "DLOAD"}, {0xD7, "CATALOG"}, {0xD8, "RENAME"}, {0xD9, "SCRATCH"}, {0xDA, "DIRECTORY"}, {0xDB, "DVERIFY"}, {0xDC, "MONITOR"}, {0xDD, "REPEAT"}, {0xDE, "BELL"}, {0xDF, "COMMANDS"}, {0xE0, "RENEW"}, {0xE1, "'"}, {0xE2, "KEY"}, {0xE3, "AUTO"}, {0xE4, "OFF"}, {0xE5, ""}, {0xE6, "MERGE"}, {0xE7, "COLOR"}, {0xE8, "MEM"}, {0xE9, "ENTER"}, {0xEA, "DELETE"}, {0xEB, "FIND"}, {0xEC, "NUMBER"}, {0xED, "ELSE"}, {0xEE, "CALL"}, {0xEF, "GRAPHICS"}, {0xF0, "ALPHA"}, {0xF1, "DMERGE"} }; /** BASIC Expanded tokens */ private static final Object[][] BASIC_TOKENS_EXPANDED_V20={ {0xCC, "RESET"}, {0xCD, "SOUND"}, {0xCE, "SLOW"}, {0xCF, "COM"}, {0xD0, "MEM"}, {0xD1, "STAR("}, {0xD2, "KEY"}, {0xD3, "OFF"}, {0xD4, "COL("}, {0xD5, "PLOT("}, {0xD6, "POP("}, {0xD7, "CHOL("}, {0xD8, "CUROL("}, {0xD9, "BEEP("}, {0xDA, "PAUS("}, {0xDB, "MSAV("}, {0xDC, "REG("}, {0xDD, "DPEK("}, {0xDE, "PDL"}, {0xDF, "JOY"}, {0xE0, "DPOK"}, {0xE1, "DO"}, {0xE2, "UNTIL"}, {0xE3, "OLD"} }; /** BASIC Handy tokens */ private static final Object[][] BASIC_TOKENS_HANDY={ {0xCC, "MOVE"}, {0xCD, "POP"}, {0xCE, "ELSE"}, {0xCF, "VOLUME"}, {0xD0, "PAUSE"}, {0xD1, "BASE"}, {0xD2, "RESET"}, {0xD3, "COPYCHR"}, {0xD4, "COLOR"}, {0xD5, "SOUND"}, {0xD6, "FILL"}, {0xD7, "BEEP"}, {0xD8, "PUT"}, {0xD9, "TAKE"}, {0xDA, "ACCEPT"}, {0xDB, "KILL"}, {0xDC, "RTIME"}, {0xDD, "CLS"}, {0xDE, "OLD"}, {0xDF, "RKEY"}, {0xE0, "JOY"}, {0xE1, "GRAB"} }; /** BASIC V8 Walrusoft tokens */ private static final Object[][] BASIC_TOKENS_V8={ {0xFE2F, "GROW"}, {0xFE30, "ARC"}, {0xFE31, "LINE"}, {0xFE32, "DRWMODA"}, {0xFE33, "DRWMODB"}, {0xFE34, "PATTERN"}, {0xFE35, "BUFFER"}, {0xFE36, "STRUCT"}, {0xFE37, "SDAT"}, {0xFE38, "TEXT"}, {0xFE39, "SCROLL"}, {0xFE3A, "WALRUS"}, {0xFE3B, "FONT"}, {0xFE3C, "SCRDEF"}, {0xFE3D, "PIXEL"}, {0xFE3E, "MOUSE"}, {0xFE3F, "DOT"}, {0xFE40, "SEND"}, {0xFE41, "HCOPY"}, {0xFE42, "LOGO"}, {0xFE43, "CBRUSH"}, {0xFE44, "ANGLE"}, {0xFE45, "SCALE"}, {0xFE46, "ORIGIN"}, {0xFE47, "VIEW"}, {0xFE48, "STORE"}, {0xFE49, "DISPLAY"}, {0xFE4A, "SCREEN"}, {0xFE4B, "CLEAR"}, {0xFE4C, "MODE"}, {0xFE4D, "BRUSHPATRN"}, {0xFE4E, "SPHERE"}, {0xFE4F, "CYLNDR"}, {0xFE50, "TOROID"}, {0xFE51, "SPOOL"}, {0xFE52, "DIR$"}, {0xFE53, "SCLIP"}, {0xFE54, "STYLE"}, {0xFE55, "LSTRUCT"}, {0xFE56, "SSTRUCT"}, {0xFE57, "PTR"}, {0xFE58, "FLASH"}, {0xFE59, "ZOOM"}, {0xFE5A, "MOVSPR"}, }; /** Cbm keys 0xA0..0xDF */ private static final String CBMKEYS[] = { "SHIFT-SPACE", "CBM-K", "CBM-I", "CBM-T", "CBM-@", "CBM-G", "CBM-+", "CBM-M", "CBM-POUND", "SHIFT-POUND", "CBM-N", "CBM-Q", "CBM-D", "CBM-Z", "CBM-S", "CBM-P", "CBM-A", "CBM-E", "CBM-R", "CBM-W", "CBM-H", "CBM-J", "CBM-L", "CBM-Y", "CBM-U", "CBM-O", "SHIFT-@", "CBM-F", "CBM-C", "CBM-X", "CBM-V", "CBM-B", "SHIFT-*", "SHIFT-A", "SHIFT-B", "SHIFT-C", "SHIFT-D", "SHIFT-E", "SHIFT-F", "SHIFT-G", "SHIFT-H", "SHIFT-I", "SHIFT-J", "SHIFT-K", "SHIFT-L", "SHIFT-M", "SHIFT-N", "SHIFT-O", "SHIFT-P", "SHIFT-Q", "SHIFT-R", "SHIFT-S", "SHIFT-T", "SHIFT-U", "SHIFT-V", "SHIFT-W", "SHIFT-X", "SHIFT-Y", "SHIFT-Z", "SHIFT-+", "CBM--", "SHIFT--", "SHIFT-^", "CBM-*" }; /** * Decode the given char to printable string * * @param val the val to decode * @param basicType the Basic type * @return the return string */ private String decodeChar(int val, BasicType basicType) { switch (val) { case 0x03: return "{stop}"; case 0x05: return "{white}"; case 0x0A: case 0x0D: // CBM Carriage return return "\\n"; case 0x0E: return "{lower case}"; case 0x11: return "{down}"; case 0x12: return "{rvon}"; case 0x13: return "{home}"; case 0x14: return "{del}"; case 0x1C: return "{red}"; case 0x1D: return "{right}"; case 0x1E: return "{green}"; case 0x1F: return "{blue}"; case 0x40: return "@"; case 0x5B: return "["; case 0x5C: return "\\"; case 0x5D: return "]"; case 0x5E: return "^"; case 0x5F: return "_"; case 0x85: return "{F1}"; case 0x86: return "{F3}"; case 0x87: return "{F5}"; case 0x88: return "{F7}"; case 0x89: return "{F2}"; case 0x8A: return "{F4}"; case 0x8B: return "{F6}"; case 0x8C: if (basicType==BasicType.BASIC_V3_5) return "{esc}"; else return "{F8}"; case 0x8D: return "{shift return}"; case 0x8E: return "{uppercase}"; case 0x90: return "{black}"; case 0x91: return "{up}"; case 0x93: return "{clr}"; case 0x94: return "{inst}"; case 0x95: return "{brown}"; case 0x96: if (basicType==BasicType.BASIC_V3_5) return "{yellow-green}"; else return "{pink}"; case 0x97: if (basicType==BasicType.BASIC_V3_5) return "{pink}"; else return "{dark grey}"; case 0x98: if (basicType==BasicType.BASIC_V3_5) return "{blue-green}"; else return "{medium gray}"; case 0x99: if (basicType==BasicType.BASIC_V3_5) return "{light blue}"; else return "{light green}"; case 0x9A: if (basicType==BasicType.BASIC_V3_5) return "{dark blue}"; else return "{light blue}"; case 0x9B: if (basicType==BasicType.BASIC_V3_5) return "{light green}"; else return "{light gray}"; case 0x9C: return "{purple}"; case 0x9d: return "{left}"; case 0x9E: return "{yellow}"; case 0x9F: return "{cyan}"; case 0x7E: case 0xDE: case 0xFF: return ""+(char)(0x7E); // pi greco } if (val>=0xA0 && val<=0xE0) return "{"+CBMKEYS[val-0xA0]+"}"; return ""+(char)val; } /** * Decode the token to the given BASIC, or the normal char * * @param val the token to convert * @param prevVal the previous token (or 0) * @param basicType the type of BASIC * @param quote true if this is inside a quoted string * @return the converted token if present or the printable char */ private String decodeToken(int val, int prevVal, BasicType basicType, boolean quote) { String res=""+decodeChar(val, basicType); // to modify for printable char if (quote) return ""+res; // skip if is first opcode is of some double bytes opcode if (val==0x64 && basicType.op64) return ""; if (val==0xCE && basicType.opCE) return ""; if (val==0xFE && basicType.opFE) return ""; // use old opcode if it is of two bytes opcode if (prevVal==0x64 && basicType.op64) val=0x6400+val; if (prevVal==0xCE && basicType.opCE) val=0xCE00+val; if (prevVal==0xFE && basicType.opFE) val=0xFE00+val; Hashtable<Integer, String> hash=basicType.getHashBasic(); if (hash.containsKey(val)) return hash.get(val); return ""+res; } /** * Return a detokenized BASIC commands as readable string * * @param basicType the type of BASIC to decode * @return the readable BASIC string */ public String detokenizedCommand(BasicType basicType) { if (list==null || list.isEmpty()) return ""; // avoid bad usage String result=""; try { // address of next BASIC command int nextAddress=list.get(0)+list.get(1)*256; if (nextAddress==0) { list.clear(); return "<- end of BASIC program ->"; } // BASIC line of this instruction int line=list.get(2)+list.get(3)*256; result+=line+" "; int val; int prevVal=0; boolean quote=false; // true when we are quotating a string // process all bytes for (int i=4; i<list.size(); i++) { val=list.get(i); // ending of command if (val==0) break; if (val=='"') quote=!quote; result+=decodeToken(val, prevVal, basicType, quote); prevVal=val; } } catch (Exception e) { // avoid malformed given data that break the program System.err.println(e); } list.clear(); return result; } /** * Clear actual list */ public void clear() { list.clear(); } /** * Add a value into the list * * @param val the value to add */ public void add(byte val) { list.add(val & 0xFF); } /** * Get the actual size of the list * * @return the list size */ public int size() { return list.size(); } /** * True if the command flow is complete * * @return true if it is completed */ public boolean isComplete() { int size=list.size(); if (size<=1) return false; if (size==2 && list.get(0)==0x00 && list.get(1)==0x00) return true; if (size<=4) return false; if (list.get(size-1)==0x00) return true; return false; } }
60,826
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
Disassembly.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/Disassembly.java
/** * @(#)Disassembly 2019/12/15 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.Locale; import sw_emulator.math.Unsigned; import sw_emulator.software.cpu.CpuDasm; import sw_emulator.software.cpu.I8048Dasm; import sw_emulator.software.cpu.M6510Dasm; import sw_emulator.software.machine.AtariDasm; import sw_emulator.software.machine.C64MusDasm; import sw_emulator.software.machine.C64SidDasm; import sw_emulator.swing.Shared; import sw_emulator.swing.main.Block; import sw_emulator.swing.main.Carets; import sw_emulator.swing.main.Constant; import sw_emulator.swing.main.CpuFamily; import static sw_emulator.swing.main.CpuFamily.I8048; import sw_emulator.swing.main.FileType; import sw_emulator.swing.main.MPR; import sw_emulator.swing.main.Option; import sw_emulator.swing.main.Patch; import sw_emulator.swing.main.Relocate; import sw_emulator.swing.main.TargetType; /** * Disassembly the given buffer of data * * @author ice */ public class Disassembly { /** Source of disassembly */ public String source; /** Raw disassembly */ public String disassembly; /** Carets for source area */ public Carets caretsSource=new Carets(); /** Carets for previuw area */ public Carets caretsPreview=new Carets(); /** Actual carets being used */ private Carets actualCarets; /** Buffer of data to disassemble */ private byte[] inB; /** Eventual multiple program */ private MPR mpr; /** Eventual CRT chip */ private int chip; /** Eventual raw binary starting address */ private int binAddress; /** The type of file */ private FileType fileType; /** The option for disassembler */ private Option option; /** The relocates for disassembly */ private Relocate[] relocates; /** The patches for disassembly */ private Patch[] patches; /** Blocks of memory to disassemble */ public ArrayList<Block> blocks; /** Constants */ public Constant constant; /** Memory dasm */ public MemoryDasm[] memory; /** The assembler to use */ protected Assembler assembler=new Assembler(); /** Assembler starting to use */ protected Assembler.Starting aStarting; /** Assembler origin to use */ protected Assembler.Origin aOrigin; /** Assembler label to use */ protected Assembler.Label aLabel; /** Assembler block comment to use */ protected Assembler.BlockComment aBlockComment; /** Assembler line comment to use */ protected Assembler.Comment aComment; /** Assembler byte type */ protected Assembler.Byte aByte; /** Assembler word type */ protected Assembler.Word aWord; /** Assembler word swapped type */ protected Assembler.WordSwapped aWordSwapped; /** Assembler tribyte type */ protected Assembler.Tribyte aTribyte; /** Assembler long type */ protected Assembler.Long aLong; /** Assembler address type */ protected Assembler.Address aAddress; /** Assembler stack word type */ protected Assembler.StackWord aStackWord; /** Assembler mono color sprite type */ protected static Assembler.MonoSprite aMonoSprite; /** Asembler multi color sprite type */ protected static Assembler.MultiSprite aMultiSprite; /** Asembler text type */ protected static Assembler.Text aText; /** Asembler text with number of chars type */ protected static Assembler.NumText aNumText; /** Asembler text zero terminated type */ protected static Assembler.ZeroText aZeroText; /** Asembler text terminated with high bit 1 */ protected static Assembler.HighText aHighText; /** Asembler text left shifted */ protected static Assembler.ShiftText aShiftText; /** Asembler text to screen code */ protected static Assembler.ScreenText aScreenText; /** Asembler text to screen code */ protected static Assembler.PetasciiText aPetasciiText; /** Reuse a string builder to avoid too much GC */ private final StringBuilder builder=new StringBuilder(); /** * Disassemble the given data * * @param fileType the file type * @param inB the buffer * @param option for disassembler * @param memory the memory for dasm * @param constant the constants to use * @param mpr eventual MPR blocks to use * @param relocates eventual relocates to use * @param patches eventual patches to apply * @param chip eventual CRT chip * @param binAddress eventual raw binary starting address * @param targetType target machine type * @param asSource true if disassembly output should be as a source file */ public void dissassembly(FileType fileType, byte[] inB, Option option, MemoryDasm[] memory, Constant constant, MPR mpr, Relocate[] relocates, Patch[] patches, int chip, int binAddress, TargetType targetType, boolean asSource) { this.inB=inB; this.fileType=fileType; this.option=option; this.mpr=mpr; this.chip=chip; this.binAddress=binAddress; this.constant=constant; this.relocates=relocates; this.patches=patches; this.memory=memory; // clear previus carets identification and associate the actual caret to use if (asSource) actualCarets=caretsSource; else actualCarets=caretsPreview; actualCarets.clear(); // avoid to process null data if (inB==null) { source=""; disassembly=""; return; } blocks=new ArrayList(); switch (fileType) { case CRT: disassemblyCRT(asSource, targetType); break; case MUS: disassemblyMUS(asSource); break; case SID: disassemblySID(asSource, targetType); break; case NSF: disassemblyNSF(asSource, targetType); break; case SAP: disassemblySAP(asSource, targetType); break; case PRG: disassemblyPRG(asSource, targetType); break; case MPR: disassemblyMPR(asSource, targetType); break; case VSF: disassemblyVSF(asSource, targetType); break; case AY: disassemblyAY(asSource, targetType); break; case BIN: disassemblyBIN(asSource, targetType); break; case UND: source=""; disassembly=""; break; } } /** * Disassembly a MUS file * * @param asSource true if output should be as a source file */ private void disassemblyMUS(boolean asSource) { int ind1; // Mus file voice 1 address int ind2; // Mus file voice 2 address int ind3; // Mus file voice 3 address int txtA; // Mus file txt address int v1Length; // length of voice 1 data int v2Length; // length of voice 2 data int v3Length; // length of voice 3 data int musPC; // PC value of start of mus program C64MusDasm mus=new C64MusDasm(); builder.setLength(0); musPC=Unsigned.done(inB[0])+Unsigned.done(inB[1])*256; v1Length=Unsigned.done(inB[2])+Unsigned.done(inB[3])*256; v2Length=Unsigned.done(inB[4])+Unsigned.done(inB[5])*256; v3Length=Unsigned.done(inB[6])+Unsigned.done(inB[7])*256; // calculate pointer to voice data ind1=8; ind2=ind1+v1Length; ind3=ind2+v2Length; txtA=v1Length+v2Length+v3Length+8; builder.append(fileType.getDescription(inB)); builder.append("\n"); builder.append(fileType.getDescription(inB)).append("\n"); builder.append("VOICE 1 MUSIC DATA: \n\n"); builder.append(mus.cdasm(inB, ind1, ind2-1, ind1+musPC)); builder.append("\nVOICE 2 MUSIC DATA: \n\n"); builder.append(mus.cdasm(inB, ind2, ind3-1, ind2+musPC)); builder.append("\nVOICE 3 MUSIC DATA: \n\n"); builder.append(mus.cdasm(inB, ind3, txtA-1, ind3+musPC)); disassembly=builder.toString(); source=""; } /** * Disassembly a SID file * * @param asSource true if output should be as a source file * @param targetType the target machine */ private void disassemblySID(boolean asSource, TargetType targetType) { int psidDOff; // psid data offeset int psidLAddr; // psid load address int psidIAddr; // psid init address int psidPAddr; // psid play address int sidPos; // Position in buffer of start of atari program int sidPC; // PC value of start of atari program Block block; setupAssembler(targetType.cpuFamily); C64SidDasm sid=new C64SidDasm(); sid.setMemory(memory); sid.setConstant(constant); sid.setOption(option, assembler); sid.setMode(option.illegalOpcodeMode); psidLAddr=Unsigned.done(inB[9])+Unsigned.done(inB[8])*256; psidIAddr=Unsigned.done(inB[11])+Unsigned.done(inB[10])*256; psidPAddr=Unsigned.done(inB[13])+Unsigned.done(inB[12])*256; if (option.createPSID && !option.notMarkPSID) { if (psidIAddr!=0) memory[psidIAddr].userLocation=option.psidInitSongsLabel; if (psidPAddr!=0) memory[psidPAddr].userLocation=option.psidPlaySoundsLabel; } psidDOff=Unsigned.done(inB[0x07])+Unsigned.done(inB[0x06])*256; block=new Block(); //calculate address for disassembler if (psidLAddr==0) { sidPC=Unsigned.done(inB[psidDOff])+Unsigned.done(inB[psidDOff+1])*256; sidPos=psidDOff+2; block.startAddress=sidPC; block.endAddress=sidPC+inB.length-sidPos-1; } else { sidPos=psidDOff; sidPC=psidLAddr; block.startAddress=sidPC; block.endAddress=sidPC+inB.length-sidPos-1; } block.startBuffer=sidPos; block.endBuffer=sidPos+(block.endAddress-block.startAddress); block.inB=inB.clone(); blocks.add(block); builder.setLength(0); if (asSource) { sid.upperCase=option.opcodeUpperCaseSource; MemoryDasm mem=new MemoryDasm(); mem.userBlockComment=getAssemblerDescription(); assembler.setBlockComment(builder, mem); assembler.setConstant(builder, constant); assembler.setStarting(builder); assembler.setMacro(builder, memory); if (option.createPSID) { // calculate org for header int header=sidPC; // look if there are relocate before that position if (relocates!=null) { for (Relocate relocate : relocates) { if (relocate.toStart < header) { header = relocate.toStart; } } } header-=sidPos; if (inB[0]=='P') mem.userBlockComment="*********************\n PSID header"; else mem.userBlockComment="*********************\n RSID header"; assembler.setBlockComment(builder, mem); assembler.setOrg(builder, header); // create header of PSID if (inB[0]=='P') assembler.setText(builder, "PSID"); else assembler.setText(builder, "RSID"); assembler.setWord(builder, inB[0x04], inB[0x05], "version"); assembler.setWord(builder, inB[0x06], inB[0x07], "data offset"); assembler.setWord(builder, inB[0x08], inB[0x09], "load address in CBM format"); if (option.notMarkPSID) { assembler.setWord(builder, inB[0xA], inB[0xB], "init songs"); assembler.setWord(builder, inB[0xC], inB[0xD], "play sound"); } else { if (psidIAddr!=0) assembler.setByteRelRev(builder, psidIAddr, option.psidInitSongsLabel); else assembler.setWord(builder, (byte)0, (byte)0, "init songs"); if (psidPAddr!=0) assembler.setByteRelRev(builder, psidPAddr, option.psidPlaySoundsLabel); else assembler.setWord(builder, (byte)0, (byte)0, "play sound"); } assembler.setWord(builder, inB[0x0E], inB[0x0F], "songs"); assembler.setWord(builder, inB[0x10], inB[0x11], "default song"); assembler.setWord(builder, inB[0x12], inB[0x13], "speed"); assembler.setWord(builder, inB[0x14], inB[0x15], "speed"); addString(builder, 0x16, 0x36); addString(builder, 0x36, 0x56); addString(builder, 0x56, 0x76); // test if version > 1 if (inB[0x07]>0x76) { assembler.setWord(builder, inB[0x76], inB[0x77], "word flag"); assembler.setWord(builder, inB[0x78], inB[0x79], "start and page length"); assembler.setWord(builder, inB[0x7A], inB[0x7B], "second and third SID address"); } builder.append("\n"); } if (psidLAddr==0) { if (option.createPSID) assembler.setWord(builder, inB[0x7C], inB[0x7D], "read load address"); psidLAddr=Unsigned.done(inB[0x7C])+Unsigned.done(inB[0x7D])*256; // modify this value as used for org starting } mem.userBlockComment="*********************\n"; assembler.setBlockComment(builder, mem); builder.append("\n"); } else { sid.upperCase=option.opcodeUpperCasePreview; builder.append(fileType.getDescription(inB)); builder.append("\n"); } // add blocks from relocate addRelocate(blocks); addBlockForPatch(); disassemblyBlocks(asSource, sid, builder); if (asSource) source=builder.toString(); else disassembly=builder.toString(); } /** * Disassembly a NSF file * * @param asSource true if output should be as a source file * @param targetType the target machine */ private void disassemblyNSF(boolean asSource, TargetType targetType) { int nsfDOff; // psid data offeset int nsfLAddr; // psid load address int nsfIAddr; // psid init address int nsfPAddr; // psid play address int nsfPos; // Position in buffer of start of atari program int nsfPC; // PC value of start of atari program Block block; setupAssembler(targetType.cpuFamily); C64SidDasm sid=new C64SidDasm(); sid.setMemory(memory); sid.setConstant(constant); sid.setOption(option, assembler); sid.setMode(option.illegalOpcodeMode); nsfLAddr=Unsigned.done(inB[8])+Unsigned.done(inB[9])*256; nsfIAddr=Unsigned.done(inB[10])+Unsigned.done(inB[11])*256; nsfPAddr=Unsigned.done(inB[12])+Unsigned.done(inB[13])*256; if (option.createPSID && !option.notMarkPSID) { if (nsfIAddr!=0) memory[nsfIAddr].userLocation=option.psidInitSongsLabel; if (nsfPAddr!=0) memory[nsfPAddr].userLocation=option.psidPlaySoundsLabel; } nsfDOff=0x80; // fixed point block=new Block(); //calculate address for disassembler nsfPos=nsfDOff; nsfPC=nsfLAddr; block.startAddress=nsfPC; block.endAddress=nsfPC+inB.length-nsfPos-1; block.startBuffer=nsfPos; block.endBuffer=nsfPos+(block.endAddress-block.startAddress); block.inB=inB.clone(); blocks.add(block); builder.setLength(0); if (asSource) { sid.upperCase=option.opcodeUpperCaseSource; MemoryDasm mem=new MemoryDasm(); mem.userBlockComment=getAssemblerDescription(); assembler.setBlockComment(builder, mem); assembler.setConstant(builder, constant); assembler.setStarting(builder); assembler.setMacro(builder, memory); // calculate org for header int header=nsfPC; // look if there are relocate before that position if (relocates!=null) { for (int i=0; i<relocates.length; i++) { if (relocates[i].toStart<header) header=relocates[i].toStart; } } header-=nsfPos; if (option.createPSID) { assembler.setOrg(builder, header); // create header of PSID assembler.setText(builder, "NESM"); assembler.setWord(builder, inB[0x04], inB[0x05], "version"); assembler.setByte(builder, inB[0x06], "songs"); assembler.setByte(builder, inB[0x07], "default song"); assembler.setWord(builder, inB[0x08], inB[0x09], "load address"); if (option.notMarkPSID) { assembler.setWord(builder, inB[0xA], inB[0xB], "init songs"); assembler.setWord(builder, inB[0xC], inB[0xD], "play sound"); } else { if (nsfIAddr!=0) assembler.setByteRelRev(builder, nsfIAddr, option.psidInitSongsLabel); else assembler.setWord(builder, (byte)0, (byte)0, "init songs"); if (nsfPAddr!=0) assembler.setByteRelRev(builder, nsfPAddr, option.psidPlaySoundsLabel); else assembler.setWord(builder, (byte)0, (byte)0, "play sound"); } addString(builder, 0x0E, 0x2E); addString(builder, 0x2E, 0x4E); addString(builder, 0x4E, 0x6E); assembler.setWord(builder, inB[0x6E], inB[0x6F], "speed NTSC"); assembler.setByte(builder, inB[0x70], null); assembler.setByte(builder, inB[0x71], null); assembler.setByte(builder, inB[0x72], null); assembler.setByte(builder, inB[0x73], null); assembler.setByte(builder, inB[0x74], null); assembler.setByte(builder, inB[0x75], null); assembler.setByte(builder, inB[0x76], null); assembler.setByte(builder, inB[0x77], "Bankswitch init"); assembler.setWord(builder, inB[0x78], inB[0x79], "speed PAL"); assembler.setByte(builder, inB[0x7A], "PAL/NTSC bits"); assembler.setByte(builder, inB[0x7B], "Extra sound chips"); assembler.setByte(builder, inB[0x7C], "Expansion 1"); assembler.setByte(builder, inB[0x7D], "Expansion 2"); assembler.setByte(builder, inB[0x7E], "Expansion 3"); assembler.setByte(builder, inB[0x7F], "Expansion 4"); builder.append("\n"); } builder.append("\n"); } else { sid.upperCase=option.opcodeUpperCasePreview; builder.append(fileType.getDescription(inB)); builder.append("\n"); } // add blocks from relocate addRelocate(blocks); addBlockForPatch(); disassemblyBlocks(asSource, sid, builder); if (asSource) source=builder.toString(); else disassembly=builder.toString(); } /** * Add string with 0 teminate to the given buffer as source * * @param tmp the buffer to use * @param start start address * @param end end address */ private void addString(StringBuilder tmp, int start, int end) { String str=""; for (int i=start; i<end; i++) { str+=(char)inB[i]; } assembler.setText(tmp, str); } /** * Disassembly a BIN file * * @param asSource true if output should be as a source file * @param targetType the target machine type */ private void disassemblyBIN(boolean asSource, TargetType targetType) { CpuDasm bin; Block block; setupAssembler(targetType.cpuFamily); bin=targetType.getDasm(); bin.setMemory(memory); bin.setConstant(constant); bin.setOption(option, assembler); if (bin instanceof M6510Dasm) ((M6510Dasm)bin).setMode(option.illegalOpcodeMode); block=new Block(); block.startAddress=binAddress; block.startBuffer=0; block.endAddress=inB.length-1-block.startBuffer+block.startAddress; block.endBuffer=inB.length-1; block.inB=inB.clone(); blocks.add(block); builder.setLength(0); if (asSource) { bin.upperCase=option.opcodeUpperCaseSource; MemoryDasm mem=new MemoryDasm(); mem.userBlockComment=getAssemblerDescription(); assembler.setBlockComment(builder, mem); assembler.setConstant(builder, constant); assembler.setStarting(builder); assembler.setMacro(builder, memory); } else { bin.upperCase=option.opcodeUpperCasePreview; builder.append(fileType.getDescription(inB)); builder.append("\n"); } // add blocks from relocate addRelocate(blocks); addBlockForPatch(); // add startup for DASM if this is the case if (asSource && option.assembler==Assembler.Name.DASM && option.dasmF3Comp) { int start=Math.max(0, getMinAddress()); assembler.setOrg(builder, start); assembler.setWord(builder, (byte)(start & 0xFF), (byte)(start>>8), null); builder.append("\n"); } disassemblyBlocks(asSource, bin, builder); if (asSource) source=builder.toString(); else disassembly=builder.toString(); } /** * Disassembly a PRG file * * @param asSource true if output should be as a source file * @param targetType the target machine type */ private void disassemblyPRG(boolean asSource, TargetType targetType) { CpuDasm prg; Block block; setupAssembler(targetType.cpuFamily); prg=targetType.getDasm(); prg.setMemory(memory); prg.setConstant(constant); prg.setOption(option, assembler); if (prg instanceof M6510Dasm) ((M6510Dasm)prg).setMode(option.illegalOpcodeMode); block=new Block(); block.startAddress=Unsigned.done(inB[0])+Unsigned.done(inB[1])*256; block.startBuffer=2; block.endAddress=inB.length-1-block.startBuffer+block.startAddress; block.endBuffer=inB.length-1; block.inB=inB.clone(); blocks.add(block); builder.setLength(0); if (asSource) { prg.upperCase=option.opcodeUpperCaseSource; MemoryDasm mem=new MemoryDasm(); mem.userBlockComment=getAssemblerDescription(); assembler.setBlockComment(builder, mem); assembler.setConstant(builder, constant); assembler.setStarting(builder); assembler.setMacro(builder, memory); } else { prg.upperCase=option.opcodeUpperCasePreview; builder.append(fileType.getDescription(inB)); builder.append("\n"); } // add blocks from relocate addRelocate(blocks); addBlockForPatch(); // add startup for DASM if this is the case if (asSource && option.assembler==Assembler.Name.DASM && option.dasmF3Comp) { int start=Math.max(0, getMinAddress()); assembler.setOrg(builder, start-2); assembler.setWord(builder, (byte)(start & 0xFF), (byte)(start>>8), null); builder.append("\n"); } disassemblyBlocks(asSource, prg, builder); if (asSource) source=builder.toString(); else disassembly=builder.toString(); } /** * Disassembly a CRT file * * @param asSource true if output should be as a source file * @param targetType the target machine type */ private void disassemblyCRT(boolean asSource, TargetType targetType) { CpuDasm prg; Block block; setupAssembler(targetType.cpuFamily); prg=targetType.getDasm(); prg.setMemory(memory); prg.setConstant(constant); prg.setOption(option, assembler); if (prg instanceof M6510Dasm) ((M6510Dasm)prg).setMode(option.illegalOpcodeMode); // get start and end address for the selected chip int header=Math.max( ((inB[0x10]&0xFF)<<24)+((inB[0x11]&0xFF)<<16)+ ((inB[0x12]&0xFF)<<8)+(inB[0x13]&0xFF), 0x40); int pos=header; int index=0; if (chip!=0) { try { for (int i=0; i<chip; i++) { pos=pos+((inB[pos+0x4]&0xFF)<<24) +((inB[pos+0x5]&0xFF)<<16) +((inB[pos+0x6]&0xFF)<<8) +(inB[pos+0x7]&0xFF); if (pos>=inB.length) { pos=header; break; } } } catch (Exception e) { pos=header; // force to use the chip 0 } } // pos= position of starting of CHIP area inside buffer block=new Block(); block.startAddress=((inB[pos+0xC]&0xFF)<<8)+(inB[pos+0xD]&0xFF); block.startBuffer=pos+0x10; block.endAddress=block.startAddress+((inB[pos+0xE]&0xFF)<<8)+(inB[pos+0xF]&0xFF)-1; block.endBuffer=block.startBuffer+((inB[pos+0xE]&0xFF)<<8)+(inB[pos+0xF]&0xFF)-1; block.inB=inB.clone(); blocks.add(block); builder.setLength(0); if (asSource) { prg.upperCase=option.opcodeUpperCaseSource; MemoryDasm mem=new MemoryDasm(); mem.userBlockComment=getAssemblerDescription(); assembler.setBlockComment(builder, mem); assembler.setConstant(builder, constant); assembler.setStarting(builder); assembler.setMacro(builder, memory); } else { prg.upperCase=option.opcodeUpperCasePreview; builder.append(fileType.getDescription(inB)) .append("\nCHIP=").append(chip).append("\n"); } // add blocks from relocate addRelocate(blocks); addBlockForPatch(); // add startup for DASM if this is the case if (asSource && option.assembler==Assembler.Name.DASM && option.dasmF3Comp) { int start=Math.max(0, getMinAddress()); assembler.setOrg(builder, start-2); assembler.setWord(builder, (byte)(start & 0xFF), (byte)(start>>8), null); builder.append("\n"); } disassemblyBlocks(asSource, prg, builder); if (asSource) source=builder.toString(); else disassembly=builder.toString(); } /** * Disassembly a VSF file * * @param asSource true if output should be as a source file * @param targetType the target machine type */ private void disassemblyVSF(boolean asSource, TargetType targetType) { CpuDasm prg; Block block; setupAssembler(targetType.cpuFamily); prg=targetType.getDasm(); prg.setMemory(memory); prg.setConstant(constant); prg.setOption(option, assembler); if (prg instanceof M6510Dasm) ((M6510Dasm)prg).setMode(option.illegalOpcodeMode); int pos; if (((inB[37] & 0xff) == 0x56) && ((inB[38] & 0xff) == 0x49) && ((inB[39] & 0xff) == 0x43) && ((inB[40] & 0xff) == 0x45) ) pos=58; else pos=37; int actPos; int size=0; boolean find=false; while (pos<inB.length-21) { size=((inB[pos+21] & 0xff)<<24)+ ((inB[pos+20] & 0xff)<<16)+ ((inB[pos+19] & 0xff)<<8)+ (inB[pos+18] & 0xff); actPos=pos; pos+=size; if ((inB[actPos]& 0xff) != 0x43) continue; if ((inB[actPos+1]& 0xff) != 0x36) continue; if ((inB[actPos+2]& 0xff) != 0x34) continue; if ((inB[actPos+3]& 0xff) != 0x4D) continue; if ((inB[actPos+4]& 0xff) != 0x45) continue; if ((inB[actPos+5]& 0xff) != 0x4D) continue; pos=actPos; find=true; break; } if (!find) { if (asSource) source=""; else disassembly=""; return; } // calculate start/end address block=new Block(); block.startAddress=0; block.startBuffer=pos+26; block.endAddress=65535; block.endBuffer=block.startBuffer+block.endAddress; block.inB=inB.clone(); blocks.add(block); builder.setLength(0); if (asSource) { prg.upperCase=option.opcodeUpperCaseSource; MemoryDasm mem=new MemoryDasm(); mem.userBlockComment=getAssemblerDescription(); assembler.setBlockComment(builder, mem); assembler.setConstant(builder, constant); assembler.setStarting(builder); assembler.setMacro(builder, memory); } else { prg.upperCase=option.opcodeUpperCasePreview; builder.append(fileType.getDescription(inB)); builder.append("\n"); } // add blocks from relocate addRelocate(blocks); addBlockForPatch(); // add startup for DASM if this is the case if (asSource && option.assembler==Assembler.Name.DASM && option.dasmF3Comp) { int start=Math.max(0, getMinAddress()); assembler.setOrg(builder, start-2); assembler.setWord(builder, (byte)(start & 0xFF), (byte)(start>>8), null); builder.append("\n"); } disassemblyBlocks(asSource, prg, builder); if (asSource) source=builder.toString(); else disassembly=builder.toString(); } /** * Disassembly a MPR file * * @param asSource true if output should be as a source file * @param targetType the target machine type */ private void disassemblyMPR(boolean asSource, TargetType targetType) { CpuDasm prg; Block block; setupAssembler(targetType.cpuFamily); prg=targetType.getDasm(); prg.setMemory(memory); prg.setConstant(constant); prg.setOption(option, assembler); if (prg instanceof M6510Dasm) ((M6510Dasm)prg).setMode(option.illegalOpcodeMode); if (mpr==null) return; builder.setLength(0); if (asSource) { prg.upperCase=option.opcodeUpperCaseSource; MemoryDasm mem=new MemoryDasm(); mem.userBlockComment=getAssemblerDescription(); assembler.setBlockComment(builder, mem); assembler.setConstant(builder, constant); assembler.setStarting(builder); assembler.setMacro(builder, memory); } else { prg.upperCase=option.opcodeUpperCasePreview; builder.append(fileType.getDescription(this.inB)); builder.append("\n"); } // generate the blocks for (byte[] inB: mpr.blocks) { block=new Block(); block.inB=inB.clone(); block.startAddress=Unsigned.done(inB[0])+Unsigned.done(inB[1])*256; block.startBuffer=2; block.endAddress=inB.length-1-block.startBuffer+block.startAddress; block.endBuffer=inB.length-1; blocks.add(block); } // add blocks from relocate addRelocate(blocks); addBlockForPatch(); // add startup for DASM if this is the case if (asSource && option.assembler==Assembler.Name.DASM && option.dasmF3Comp) { int start=Math.max(0, getMinAddress()); assembler.setOrg(builder, start-2); assembler.setWord(builder, (byte)(start & 0xFF), (byte)(start>>8), null); builder.append("\n"); } disassemblyBlocks(asSource, prg, builder); if (asSource) source=builder.toString(); else disassembly=builder.toString(); } /** * Disassembly an AY file * * @param asSource true if output should be as a source file * @param targetType the target machine type */ private void disassemblyAY(boolean asSource, TargetType targetType) { int posStruct, posData, posPoint, posAddr, posBlock; int address, length; CpuDasm prg; Block block; setupAssembler(targetType.cpuFamily); prg=targetType.getDasm(); prg.setMemory(memory); prg.setConstant(constant); prg.setOption(option, assembler); if (prg instanceof M6510Dasm) ((M6510Dasm)prg).setMode(option.illegalOpcodeMode); builder.setLength(0); if (asSource) { prg.upperCase=option.opcodeUpperCaseSource; MemoryDasm mem=new MemoryDasm(); mem.userBlockComment=getAssemblerDescription(); assembler.setBlockComment(builder, mem); assembler.setConstant(builder, constant); assembler.setStarting(builder); assembler.setMacro(builder, memory); } else { prg.upperCase=option.opcodeUpperCasePreview; builder.append(fileType.getDescription(inB)); builder.append("\n"); } try { posStruct=((inB[18] & 0xFF)<<8)+(inB[19] & 0xFF)+18; int tunes=(inB[16] & 0xFF)+1; for (int i=0; i<tunes; i++) { posData=((inB[posStruct+i*4+2] & 0xFF)<<8)+(inB[posStruct+i*4+3] & 0xFF)+posStruct+i*4+2; posPoint=((inB[posData+10] & 0xFF)<<8)+(inB[posData+11] & 0xFF)+posData+10; posAddr=((inB[posData+12] & 0xFF)<<8)+(inB[posData+13] & 0xFF)+posData+12; // blocks are 0 terminating, suppose to have max 256 of them for (int j=0; j<256; j++) { address=((inB[posAddr+j*6] & 0xFF)<<8)+(inB[posAddr+j*6+1] & 0xFF); if (address==0) break; length=((inB[posAddr+j*6+2] & 0xFF)<<8)+(inB[posAddr+j*6+3] & 0xFF); posBlock=((inB[posAddr+j*6+4] & 0xFF)<<8)+(inB[posAddr+j*6+5] & 0xFF)+posAddr+j*6+4; block=new Block(); block.startAddress=address; block.endAddress=address+length-1; block.startBuffer=posBlock; block.endBuffer=posBlock+length-1; block.inB=inB; // check if this block is already in boolean find=false; for (Block b: blocks) { if (b.startAddress==block.startAddress && b.endAddress==block.endAddress && b.startBuffer==block.startBuffer && b.endBuffer==block.endBuffer) { find=true; break; } } if (!find) blocks.add(block); } } } catch (Exception e) { System.err.println(e); } // add blocks from relocate addRelocate(blocks); addBlockForPatch(); disassemblyBlocks(asSource, prg, builder); if (asSource) source=builder.toString(); else disassembly=builder.toString(); } /** * Disassembly a SAP file * * @param asSource true if output should be as a source file * @param targetType the target machine */ private void disassemblySAP(boolean asSource, TargetType targetType) { Block block; setupAssembler(targetType.cpuFamily); AtariDasm atari=new AtariDasm(); atari.setMemory(memory); atari.setConstant(constant); atari.setOption(option, assembler); atari.setMode(option.illegalOpcodeMode); int sapIAddr=0; int sapPAddr=0; int addr=0; // search for init for (int i=0; i<inB.length-14; i++) { if (inB[i]=='I' && inB[i+1]=='N' && inB[i+2]=='I' && inB[i+3]=='T' && inB[i+4]==' ' && inB[i+9]==0x0D && inB [i+10]==0x0A) { try { sapIAddr=Integer.parseInt(""+(char)inB[i+5]+(char)inB[i+6]+(char)inB[i+7]+(char)inB[i+8], 16); } catch (NumberFormatException e) { continue; } addr=i; // remember for later use break; } } // search for play address for (int i=addr; i<inB.length-16; i++) { if (inB[i]=='P' && inB[i+1]=='L' && inB[i+2]=='A' && inB[i+3]=='Y' && inB[i+4]=='E' && inB[i+5]=='R' && inB[i+6]==' ' && inB[i+11]==0x0D && inB [i+12]==0x0A) { try { sapPAddr=Integer.parseInt(""+(char)inB[i+7]+(char)inB[i+8]+(char)inB[i+9]+(char)inB[i+10], 16); } catch (NumberFormatException e) { continue; } addr=i; // remember for later use break; } } if (option.createSAP && !option.notMarkSAP) { if (sapIAddr!=0) memory[sapIAddr].userLocation=option.psidInitSongsLabel; if (sapPAddr!=0) memory[sapPAddr].userLocation=option.psidPlaySoundsLabel; } // go until binary header fount while (addr<inB.length-4) { if (inB[addr]==0x0d && inB[addr+1]==0x0a && inB[addr+2]==-1 && inB[addr+3]==-1) break; addr++; } addr+=4; block=new Block(); block.startAddress=Unsigned.done(inB[addr])+Unsigned.done(inB[addr+1])*256; block.startBuffer=addr+4; block.endAddress=Unsigned.done(inB[addr+2])+Unsigned.done(inB[addr+3])*256; block.endBuffer=inB.length-1; block.inB=inB.clone(); blocks.add(block); builder.setLength(0); if (asSource) { atari.upperCase=option.opcodeUpperCaseSource; MemoryDasm mem=new MemoryDasm(); mem.userBlockComment=getAssemblerDescription(); assembler.setBlockComment(builder, mem); assembler.setConstant(builder, constant); assembler.setStarting(builder); assembler.setMacro(builder, memory); if (option.createSAP) { // calculate org for header int header=block.startAddress; // look if there are relocate before that position if (relocates!=null) { for (Relocate relocate : relocates) { if (relocate.toStart < header) { header = relocate.toStart; } } } header-=addr+4; mem.userBlockComment="*********************\n SAP header"; assembler.setBlockComment(builder, mem); assembler.setOrg(builder, header); // we have string until addr-2 that there are 2 bytes int init=0; int last=0; while (last<addr-3) { if (inB[last]!=0x0D || inB[last+1]!=0x0A) { last++; continue; } addString(builder, init, last+2); init=last+2; last=init; } assembler.setWord(builder, inB[last], inB[last+1], "Binary area"); assembler.setWord(builder, inB[addr], inB[addr+1], "Start addess"); assembler.setWord(builder, inB[addr+2], inB[addr+3], "End addess"); builder.append("\n"); mem.userBlockComment="*********************\n"; assembler.setBlockComment(builder, mem); } } else { atari.upperCase=option.opcodeUpperCasePreview; builder.append(fileType.getDescription(inB)); builder.append("\n"); } // add blocks from relocate addRelocate(blocks); addBlockForPatch(); disassemblyBlocks(asSource, atari, builder); if (asSource) source=builder.toString(); else disassembly=builder.toString(); } /** * Get the min starting address inside the blovks * * @return the min starting address */ private int getMinAddress() { int min=0xffff; for (Block block: blocks) { if (block.startAddress<min) min=block.startAddress; } return min; } /** * Disassembly the blocks we have * * @param asSource true if the disassembly is as source * @param tmp the buffer for output */ private void disassemblyBlocks(boolean asSource, CpuDasm prg, StringBuilder tmp) { Block block; // sort by asc memory address Collections.sort(blocks, (Block block2, Block block1) -> block2.startAddress-block1.startAddress); if (option.useSidFreq) SidFreq.instance.reset(); actualCarets.setOffset(tmp.length()); tmp.append(assembler.addConstants(memory)); Iterator<Block> iter=blocks.iterator(); while (iter.hasNext()) { block=iter.next(); applyPatches(block); markInside(block.inB, block.startAddress, block.endAddress, block.startBuffer); // search for SID frequency table if (option.useSidFreq) { SidFreq.instance.identifyFreq(block.inB, memory, block.startBuffer, block.endBuffer, block.startAddress-block.startBuffer, option.sidFreqLoLabel, option.sidFreqHiLabel, option.sidFreqMarkMem, option.sidFreqCreateLabel, option.sidFreqCreateComment, option.sidFreqLinearTable, option.sidFreqCombinedTable, option.sidFreqInverseLinearTable, option.sidFreqLinearOctNoteTable, option.sidFreqHiOct13Table, option.sidFreqLinearScaleTable, option.sidFreqShortLinearTable, option.sidFreqShortCombinedTable, option.sidFreqHiOctCombinedTable, option.sidFreqHiOctCombinedInvertedTable, option.sidFreqLoOctCombinedTable, option.sidFreqHiOct12Table ); } String player=""; if (option.showSidId) { int[] buf=new int[block.endAddress-block.startAddress+1]; int j=0; for (int i=block.startBuffer; i<=block.startBuffer+block.endAddress-block.startAddress; i++) { buf[j]=(char)block.inB[i] & 0xFF; j++; } player=SidId.instance.identifyBuffer(buf, buf.length); } // add an offset due to previous strings added if (asSource) { assembler.setOrg(tmp, block.startAddress); if (!"".equals(player)) { MemoryDasm mem=new MemoryDasm(); mem.userBlockComment=" \n"+ "*********************\n"+ " PLAYER: "+player+"\n"+ "*********************\n"+ " \n"; assembler.setBlockComment(builder, mem); } actualCarets.setOffset(tmp.length()); tmp.append(prg.csdasm(block.inB, block.startBuffer, block.endBuffer, block.startAddress)); } else { actualCarets.setOffset(tmp.length()); tmp.append(prg.cdasm(block.inB, block.startBuffer, block.endBuffer, block.startAddress)); } } } /** * Apply patches in this memory block * * @param block the block where to apply patched */ private void applyPatches(Block block) { if (patches==null) return; for (Patch patch: patches) { if (block.startAddress<=patch.address && patch.address<=block.endAddress) { block.inB[patch.address-block.startAddress+block.startBuffer]=(byte)patch.value; } } } /** * Add blocks for patch outside the existing blocks */ private void addBlockForPatch() { if (patches==null) return; boolean fount; for (Patch patch: patches) { fount=false; for (Block block: blocks) { if (block.isInside(patch.address)) { fount=true; break; } } if (!fount) { Block block=new Block(); block.inB=new byte[1]; block.inB[0]=(byte)patch.value; block.startBuffer=0; block.endBuffer=0; block.startAddress=patch.address; block.endAddress=patch.address; blocks.add(block); } } } /** * Convert a unsigned short (containing in a int) to Exe upper case 4 chars * * @param value the short value to convert * @return the exe string rapresentation of byte */ protected String ShortToExe(int value) { int tmp=value; if (value<0) return "????"; String ret=Integer.toHexString(tmp); int len=ret.length(); switch (len) { case 1: ret="000"+ret; break; case 2: ret="00"+ret; break; case 3: ret="0"+ret; break; } return ret.toUpperCase(Locale.ENGLISH); } /** * Add relocate blocks * * @param list the list where to add blocks */ private void addRelocate(ArrayList<Block> list) { if (relocates==null) return; byte[] inB; int size; Block block; for (Relocate relocate:relocates) { size=relocate.fromEnd-relocate.fromStart+1; inB=new byte[size]; for (int i=0; i<size; i++) { inB[i]=memory[relocate.fromStart+i].copy; } block=new Block(); block.inB=inB; block.startAddress=relocate.toStart; block.endAddress=relocate.toEnd; block.startBuffer=0; block.endBuffer=size-1; list.add((block)); } } /** * Mark the memory as inside * * @param inB the buffer to use * @param start the start of internal * @param end the end of internal * @param offset in buffer of start position */ private void markInside(byte[] inB, int start, int end, int offset) { for (int i=start; i<=end; i++) { memory[i].isInside=true; memory[i].copy=inB[i-start+offset]; } } /** * Set up the assembler */ private void setupAssembler(CpuFamily cpuFamily) { switch (option.assembler) { case DASM: aStarting=option.dasmStarting; aOrigin=option.dasmOrigin; aLabel=option.dasmLabel; aComment=option.dasmComment; aBlockComment=option.dasmBlockComment; aByte=option.dasmByte; aWord=option.dasmWord; aWordSwapped=option.dasmWordSwapped; aTribyte=option.dasmTribyte; aLong=option.dasmLong; aAddress=option.dasmAddress; aStackWord=option.dasmStackWord; aMonoSprite=option.dasmMonoSprite; aMultiSprite=option.dasmMultiSprite; aText=option.dasmText; aNumText=option.dasmNumText; aZeroText=option.dasmZeroText; aHighText=option.dasmHighText; aShiftText=option.dasmShiftText; aScreenText=option.dasmScreenText; aPetasciiText=option.dasmPetasciiText; break; case TMPX: aStarting=option.tmpxStarting; aOrigin=option.tmpxOrigin; aLabel=option.tmpxLabel; aComment=option.tmpxComment; aBlockComment=option.tmpxBlockComment; aByte=option.tmpxByte; aWord=option.tmpxWord; aWordSwapped=option.tmpxWordSwapped; aTribyte=option.tmpxTribyte; aLong=option.tmpxLong; aAddress=option.tmpxAddress; aStackWord=option.tmpxStackWord; aMonoSprite=option.tmpxMonoSprite; aMultiSprite=option.tmpxMultiSprite; aText=option.tmpxText; aNumText=option.tmpxNumText; aZeroText=option.tmpxZeroText; aHighText=option.tmpxHighText; aShiftText=option.tmpxShiftText; aScreenText=option.tmpxScreenText; aPetasciiText=option.tmpxPetasciiText; break; case CA65: aStarting=option.ca65Starting; aOrigin=option.ca65Origin; aLabel=option.ca65Label; aComment=option.ca65Comment; aBlockComment=option.ca65BlockComment; aByte=option.ca65Byte; aWord=option.ca65Word; aWordSwapped=option.ca65WordSwapped; aTribyte=option.ca65Tribyte; aLong=option.ca65Long; aAddress=option.ca65Address; aStackWord=option.ca65StackWord; aMonoSprite=option.ca65MonoSprite; aMultiSprite=option.ca65MultiSprite; aText=option.ca65Text; aNumText=option.ca65NumText; aZeroText=option.ca65ZeroText; aHighText=option.ca65HighText; aShiftText=option.ca65ShiftText; aScreenText=option.ca65ScreenText; aPetasciiText=option.ca65PetasciiText; break; case ACME: aStarting=option.acmeStarting; aOrigin=option.acmeOrigin; aLabel=option.acmeLabel; aComment=option.acmeComment; aBlockComment=option.acmeBlockComment; aByte=option.acmeByte; aWord=option.acmeWord; aWordSwapped=option.acmeWordSwapped; aTribyte=option.acmeTribyte; aLong=option.acmeLong; aAddress=option.acmeAddress; aStackWord=option.acmeStackWord; aMonoSprite=option.acmeMonoSprite; aMultiSprite=option.acmeMultiSprite; aText=option.acmeText; aNumText=option.acmeNumText; aZeroText=option.acmeZeroText; aHighText=option.acmeHighText; aShiftText=option.acmeShiftText; aScreenText=option.acmeScreenText; aPetasciiText=option.acmePetasciiText; break; case KICK: aStarting=option.kickStarting; aOrigin=option.kickOrigin; aComment=option.kickComment; aBlockComment=option.kickBlockComment; aLabel=option.kickLabel; aByte=option.kickByte; aWord=option.kickWord; aWordSwapped=option.kickWordSwapped; aTribyte=option.kickTribyte; aLong=option.kickLong; aAddress=option.kickAddress; aStackWord=option.kickStackWord; aMonoSprite=option.kickMonoSprite; aMultiSprite=option.kickMultiSprite; aText=option.kickText; aNumText=option.kickNumText; aZeroText=option.kickZeroText; aHighText=option.kickHighText; aShiftText=option.kickShiftText; aScreenText=option.kickScreenText; aPetasciiText=option.kickPetasciiText; break; case TASS64: aStarting=option.tass64Starting; aOrigin=option.tass64Origin; aComment=option.tass64Comment; aBlockComment=option.tass64BlockComment; aLabel=option.tass64Label; aByte=option.tass64Byte; aWord=option.tass64Word; aWordSwapped=option.tass64WordSwapped; aTribyte=option.tass64Tribyte; aLong=option.tass64Long; aAddress=option.tass64Address; aStackWord=option.tass64StackWord; aMonoSprite=option.tass64MonoSprite; aMultiSprite=option.tass64MultiSprite; aText=option.tass64Text; aNumText=option.tass64NumText; aZeroText=option.tass64ZeroText; aHighText=option.tass64HighText; aShiftText=option.tass64ShiftText; aScreenText=option.tass64ScreenText; aPetasciiText=option.tass64PetasciiText; break; case GLASS: aStarting=option.glassStarting; aOrigin=option.glassOrigin; aLabel=option.glassLabel; aComment=option.glassComment; aBlockComment=option.glassBlockComment; aByte=option.glassByte; aWord=option.glassWord; aWordSwapped=option.glassWordSwapped; aTribyte=option.glassTribyte; aLong=option.glassLong; aAddress=option.glassAddress; aStackWord=option.glassStackWord; aMonoSprite=option.glassMonoSprite; aMultiSprite=option.glassMultiSprite; aText=option.glassText; aNumText=option.glassNumText; aZeroText=option.glassZeroText; aHighText=option.glassHighText; aShiftText=option.glassShiftText; aScreenText=option.glassScreenText; aPetasciiText=option.glassPetasciiText; break; case AS: if (cpuFamily==I8048) { aStarting=option.asiStarting; aOrigin=option.asiOrigin; aLabel=option.asiLabel; aComment=option.asiComment; aBlockComment=option.asiBlockComment; aByte=option.asiByte; aWord=option.asiWord; aWordSwapped=option.asiWordSwapped; aTribyte=option.asiTribyte; aLong=option.asiLong; aAddress=option.asiAddress; aStackWord=option.asiStackWord; aMonoSprite=option.asiMonoSprite; aMultiSprite=option.asiMultiSprite; aText=option.asiText; aNumText=option.asiNumText; aZeroText=option.asiZeroText; aHighText=option.asiHighText; aShiftText=option.asiShiftText; aScreenText=option.asiScreenText; aPetasciiText=option.asiPetasciiText; } else { aStarting=option.asmStarting; aOrigin=option.asmOrigin; aLabel=option.asmLabel; aComment=option.asmComment; aBlockComment=option.asmBlockComment; aByte=option.asmByte; aWord=option.asmWord; aWordSwapped=option.asmWordSwapped; aTribyte=option.asmTribyte; aLong=option.asmLong; aAddress=option.asmAddress; aStackWord=option.asmStackWord; aMonoSprite=option.asmMonoSprite; aMultiSprite=option.asmMultiSprite; aText=option.asmText; aNumText=option.asmNumText; aZeroText=option.asmZeroText; aHighText=option.asmHighText; aShiftText=option.asmShiftText; aScreenText=option.asmScreenText; aPetasciiText=option.asmPetasciiText; } break; } assembler.setOption(option, aStarting, aOrigin, aLabel, aComment, aBlockComment, aByte, aWord, aWordSwapped, aTribyte, aLong, aAddress, aStackWord, aMonoSprite, aMultiSprite, aText, aNumText, aZeroText, aHighText, aShiftText, aScreenText, aPetasciiText, constant, actualCarets, memory); } /** * Get the assembler description * * @return the assembler description */ public String getAssemblerDescription() { switch (option.heather) { case Option.HEATHER_STANDARD: return "****************************\n"+ " JC64dis version "+Shared.VERSION+"\n"+ " \n"+ " Source in "+option.assembler.getName()+" format\n"+ "****************************\n"; case Option.HEATHER_NONE: return null; case Option.HEATHER_CUSTOM: return option.custom; } return null; } }
54,271
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
SidId.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/SidId.java
/* * @(#)SidId.java 2023/06/12 * * ICE Team free software group * * This file is part of JIIT64 Java Ice Team Tracker 64 * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ package sw_emulator.software; import java.io.BufferedReader; import java.io.FileReader; import java.util.ArrayList; /** * Store the information about a SID Id signature (patterns) */ class SidIdRecord { String name; ArrayList<int[]> list; } /** * SidId from XSidplay2 * * @author ice00 */ public class SidId { static final int END = -1; static final int ANY = -2; static final int AND = -3; static final int NAME = -4; static final int MAX_SIGSIZE = 4096; /** Instance of the class as singleton */ public static final SidId instance=new SidId(); /** Version of the algorithm */ public static final String VERSION = "SIDId V1.09 by Cadaver (C) 2012"; /** list of Sid IDs */ ArrayList<SidIdRecord> sidIdList=new ArrayList(); /** Last players identified */ String lastPlayers; /** * Private constructor */ private SidId() { } /** * Get the number of players recognized * * @return the number of players recognized */ public int getNumberOfPlayers() { return sidIdList.size(); } /** * Get the number of patterns used * * @return the number of patterns used */ public int getNumberOfPatterns() { int n = 0; for (SidIdRecord rec : sidIdList) { n += rec.list.size(); } return n; } /** * Read the patterns id file * * @param name the name (with path) of the file to read * @return true if read is ok */ public boolean readConfig(String name) throws Exception { //String tokenstr; String[] tokens; String line; int[] temp; int sigsize = 0; BufferedReader in; try { in = new BufferedReader(new FileReader(name)); sidIdList.clear(); // clear the list as we can read a config more time while (in.ready()) { int len; temp=new int[MAX_SIGSIZE]; line = in.readLine(); tokens = line.split(" "); for (String tokenstr : tokens) { len = tokenstr.length(); if (len > 0) { int token = NAME; // suppose this is a NAME declaration switch (tokenstr) { case "??": token = ANY; break; case "end": case "END": token = END; break; case "and": case "AND": token = AND; break; } if ((len == 2) && (isHex(tokenstr.charAt(0)) && (isHex(tokenstr.charAt(1))))) { token = getHex(tokenstr.charAt(0)) * 16 + getHex(tokenstr.charAt(1)); } switch (token) { // name declaration case NAME: SidIdRecord newid = new SidIdRecord(); newid.list=new ArrayList(); newid.name = tokenstr;///strdup(tokenstr); sidIdList.add(newid); sigsize = 0; break; case END: if (sigsize >= MAX_SIGSIZE) { throw new Exception("Maximum signature size exceeded!\n"); } temp[sigsize++] = END; if (sigsize > 1) { int c; int[] newbytes = new int[sigsize]; if (newbytes==null) { throw new Exception("Out of memory!\n"); } for (c = 0; c < sigsize; c++) { newbytes[c] = temp[c]; } if (sidIdList.isEmpty()) { throw new Exception("No playername defined before signature!\n"); } sidIdList.get(sidIdList.size()-1).list.add(newbytes); } sigsize = 0; break; default: if (sigsize >= MAX_SIGSIZE) { throw new Exception("Maximum signature size exceeded!\n"); } temp[sigsize++] = token; break; } } else { break; } } } in.close(); } catch (Exception e) { System.err.println(e); return false; } return true; } /** * Identify the IDs of the given buffer * * @param buffer the buffed with the data to identify * @param length length of the buffer * @return the identified engines as string */ public String identifyBuffer(int[] buffer, int length) { lastPlayers=""; // scan all the engines for (SidIdRecord list : sidIdList) { for (int[] bytes: list.list) { if (identifyBytes(bytes, buffer, length)) { lastPlayers+=list.name+" "; break; } } } return lastPlayers; } /** * Identify the bytes of ID and buffer according to the pattern rules * * @param bytes the ID bytes pattern * @param buffer the SID file buffer * @param length length of the buffer * @return true if ID is matching */ public boolean identifyBytes(int[] bytes, int[] buffer, int length) { int c = 0, d = 0, rc = 0, rd = 0; while (c < length) { if (d == rd) { if (buffer[c] == bytes[d]) { rc = c+1; d++; } c++; } else { if (bytes[d] == END) return true; if (bytes[d] == AND) { d++; while (c < length) { if (buffer[c] == bytes[d]) { rc = c+1; rd = d; break; } c++; } if (c >= length) return false; } if ((bytes[d] != ANY) && (buffer[c] != bytes[d])) { c = rc; d = rd; } else { c++; d++; } } } if (bytes[d] == END) return true; return false; } /** * Determine if the passed char is an exe number * * @param c the char to test * @return true if the char is an hex number */ private boolean isHex(char c) { if ((c >= '0') && (c <= '9')) return true; if ((c >= 'a') && (c <= 'f')) return true; if ((c >= 'A') && (c <= 'F')) return true; return false; } /** * Get the decimal number of the passed exe number char * * @param c the char to use * @return the decimal number of the hex char passed */ private int getHex(char c) { if ((c >= '0') && (c <= '9')) return c - '0'; if ((c >= 'a') && (c <= 'f')) return c - 'a' + 10; if ((c >= 'A') && (c <= 'F')) return c - 'A' + 10; return -1; } }
7,810
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
Compiler.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/asm/Compiler.java
/** * @(#)compiler 2020/12/19 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.asm; import java.io.File; import java.io.FileWriter; import java.io.PrintStream; import java.lang.reflect.Method; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.security.Permission; import sw_emulator.swing.main.Option; /** * Compiler: call real compilers * All compiler are ported into Java via NestedVM unless a Java version is available * * @author ice */ public class Compiler { /** Option */ Option option; /** * Set the compiler to use * * @param option the option to use */ public void setOption(Option option) { this.option=option; } /** * Compile the input file to the output file * * @param input the input file * @param output the output file * @return the io message from the appplication */ public String compile(File input, File output) { if (option==null) return "Internal erro: no option selected"; String res=""; switch (option.assembler) { case DASM: res=dasmCompile(input, output); break; case TMPX: res=tmpxCompile(input, output); break; case ACME: res=acmeCompile(input, output); break; case CA65: res=ca65Compile(input, output); break; case TASS64: res=tass64Compile(input, output); break; case KICK: res=kickCompile(input, output); break; case GLASS: res=glassCompile(input, output); break; } return res; } /** * Compile the input file to the output file with Dasm * * @param input the input file * @param output the output file * @return the io message from the appplication */ public String dasmCompile(File input, File output) { PrintStream orgStream; PrintStream fileStream; orgStream = System.out; String result="No result obtained!!"; String[] args=new String[4]; args[0]=" "; args[1]=input.getAbsolutePath(); args[2]="-o"+output.getAbsolutePath(); if (option.dasmF3Comp) args[3]="-f3"; else args[3]="-f1"; try { fileStream = new PrintStream(option.tmpPath+File.separator+"tmp.tmp"); System.setOut(fileStream); //System.setErr(fileStream); Class cl = Class.forName("sw_emulator.software.asm.Dasm"); Method mMain = cl.getMethod("run", new Class[]{String[].class}); mMain.invoke(cl.newInstance(), new Object[]{args}); } catch (Exception e) { System.err.println(e); } System.setOut(orgStream); System.setErr(orgStream); try { result = new String(Files.readAllBytes(Paths.get(option.tmpPath+File.separator+"tmp.tmp")), StandardCharsets.UTF_8); } catch (Exception e) { System.err.println(e); } return result; } /** * Compile the input file to the output file with Kick Assembler * * @param input the input file * @param output the output file * @return the io message from the appplication */ public String kickCompile(File input, File output) { PrintStream orgStream = System.out; PrintStream fileStream; String result="No result obtained!!"; String[] args=new String[3]; args[0]=input.getAbsolutePath(); args[1]="-o"; args[2]=output.getAbsolutePath(); try { fileStream = new PrintStream(option.tmpPath+File.separator+"tmp.tmp"); System.setOut(fileStream); // install security manager to avoid System.exit() call from lib SecurityManager previousSecurityManager = System.getSecurityManager(); final SecurityManager securityManager = new SecurityManager() { @Override public void checkPermission(final Permission permission) { if (permission.getName() != null && permission.getName().startsWith("exitVM")) { throw new SecurityException(); } } }; System.setSecurityManager(securityManager); try { kickass.KickAssembler.main(args); } catch (SecurityException e) { // Say hi to your favorite creator of closed source software that includes System.exit() in his code. } finally { System.setSecurityManager(previousSecurityManager); } } catch (Exception e) { System.err.println(e); } System.setOut(orgStream); try { result = new String(Files.readAllBytes(Paths.get(option.tmpPath+File.separator+"tmp.tmp")), StandardCharsets.UTF_8); // remove the extra error message int pos=result.indexOf("org.ibex.nestedvm.Runtime$ExecutionException:"); if (pos>0) result=result.substring(0, pos); if ("".equals(result)) result="Compilation done"; } catch (Exception e) { System.err.println(e); } return result; } /** * Compile the input file to the output file with TmpX * * @param input the input file * @param output the output file * @return the io message from the appplication */ public String tmpxCompile(File input, File output) { return "TMPX native compiler not available. Sorry"; } /** * Compile the input file to the output file with Acme * * @param input the input file * @param output the output file * @return the io message from the appplication */ public String acmeCompile(File input, File output) { PrintStream orgStream; PrintStream fileStream; orgStream = System.out; String result="No result obtained!!"; String[] args=new String[4]; args[0]=""; args[1]="-o"; args[2]=output.getAbsolutePath(); args[3]=input.getAbsolutePath(); try { fileStream = new PrintStream(option.tmpPath+File.separator+"tmp.tmp"); System.setOut(fileStream); System.setErr(fileStream); Class cl = Class.forName("sw_emulator.software.asm.Acme"); Method mMain = cl.getMethod("run", new Class[]{String[].class}); mMain.invoke(cl.newInstance(), new Object[]{args}); } catch (Exception e) { System.err.println(e); } System.setOut(orgStream); System.setErr(orgStream); try { result = new String(Files.readAllBytes(Paths.get(option.tmpPath+File.separator+"tmp.tmp")), StandardCharsets.UTF_8); // remove the extra error message int pos=result.indexOf("org.ibex.nestedvm.Runtime$ExecutionException:"); if (pos>0) result=result.substring(0, pos); if ("".equals(result)) result="Compilation done"; } catch (Exception e) { System.err.println(e); } return result; } /** * Compile the input file to the output file with Tass64 * * @param input the input file * @param output the output file * @return the io message from the appplication */ public String tass64Compile(File input, File output) { PrintStream orgStream; PrintStream fileStream; orgStream = System.out; String result="No result obtained!!"; String[] args=new String[3]; args[0]=""; args[1]="-o"+output.getAbsolutePath(); args[2]=input.getAbsolutePath(); try { fileStream = new PrintStream(option.tmpPath+File.separator+"tmp.tmp"); System.setOut(fileStream); System.setErr(fileStream); Class cl = Class.forName("sw_emulator.software.asm.Tass64"); Method mMain = cl.getMethod("run", new Class[]{String[].class}); mMain.invoke(cl.newInstance(), new Object[]{args}); } catch (Exception e) { System.err.println(e); } System.setOut(orgStream); System.setErr(orgStream); try { result = new String(Files.readAllBytes(Paths.get(option.tmpPath+File.separator+"tmp.tmp")), StandardCharsets.UTF_8); // remove the extra error message int pos=result.indexOf("org.ibex.nestedvm.Runtime$ExecutionException:"); if (pos>0) result=result.substring(0, pos); } catch (Exception e) { System.err.println(e); } return result; } /** * Compile the input file to the output file with Ca65 * * @param input the input file * @param output the output file * @return the io message from the appplication */ public String ca65Compile(File input, File output) { PrintStream orgStream; PrintStream fileStream; File tmp=new File(output.getAbsolutePath()+".tmp"); orgStream = System.out; String result="No result obtained!!"; String[] args=new String[3]; args[0]=""; args[1]=input.getAbsolutePath(); args[2]="-o"+tmp.getAbsolutePath(); try { fileStream = new PrintStream(option.tmpPath+File.separator+"tmp.tmp"); System.setOut(fileStream); System.setErr(fileStream); Class cl = Class.forName("sw_emulator.software.asm.Ca65"); Method mMain = cl.getMethod("run", new Class[]{String[].class}); mMain.invoke(cl.newInstance(), new Object[]{args}); } catch (Exception e) { System.err.println(e); } try { FileWriter myWriter = new FileWriter(option.tmpPath+File.separator+"c64-asm.cfg"); myWriter.write( "FEATURES {\n" + " STARTADDRESS: default = $0801;\n" + "}\n" + "SYMBOLS {\n" + "}\n" + "MEMORY {\n" + " ZP: file = \"\", start = $0002, size = $00FE, define = yes;\n" + " MAIN: file = %O, start = %S, size = $D000 - %S;\n" + "}\n" + "SEGMENTS {\n" + " ZEROPAGE: load = ZP, type = zp, optional = yes;\n" + " EXEHDR: load = MAIN, type = ro, optional = yes;\n" + " CODE: load = MAIN, type = rw;\n" + " RODATA: load = MAIN, type = ro, optional = yes;\n" + " DATA: load = MAIN, type = rw, optional = yes;\n" + " BSS: load = MAIN, type = bss, optional = yes, define = yes;\n" + "}" ); myWriter.close(); } catch (Exception e) { System.err.println(e); } args=new String[4]; args[0]=""; args[1]="-o"+output.getAbsolutePath(); args[2]="-C"+option.tmpPath+File.separator+"c64-asm.cfg"; args[3]=tmp.getAbsolutePath(); try { fileStream = new PrintStream(option.tmpPath+File.separator+"tmp.tmp"); System.setOut(fileStream); System.setErr(fileStream); Class cl = Class.forName("sw_emulator.software.asm.Ld65"); Method mMain = cl.getMethod("run", new Class[]{String[].class}); mMain.invoke(cl.newInstance(), new Object[]{args}); } catch (Exception e) { System.err.println(e); } System.setOut(orgStream); System.setErr(orgStream); try { result = new String(Files.readAllBytes(Paths.get(option.tmpPath+File.separator+"tmp.tmp")), StandardCharsets.UTF_8); // remove the extra error message int pos=result.indexOf("org.ibex.nestedvm.Runtime$ExecutionException:"); if (pos>0) result=result.substring(0, pos); if (pos==0) result="Compilation done"; } catch (Exception e) { System.err.println(e); } return result; } /** * Compile the input file to the output file with Glass * * @param input the input file * @param output the output file * @return the io message from the appplication */ public String glassCompile(File input, File output) { PrintStream orgStream = System.out; PrintStream fileStream; String result="No result obtained!!"; String[] args=new String[2]; args[0]=input.getAbsolutePath(); args[1]=output.getAbsolutePath(); try { fileStream = new PrintStream(option.tmpPath+File.separator+"tmp.tmp"); System.setOut(fileStream); // install security manager to avoid System.exit() call from lib SecurityManager previousSecurityManager = System.getSecurityManager(); final SecurityManager securityManager = new SecurityManager() { @Override public void checkPermission(final Permission permission) { if (permission.getName() != null && permission.getName().startsWith("exitVM")) { throw new SecurityException(); } } }; System.setSecurityManager(securityManager); try { nl.grauw.glass.Assembler.main(args); } catch (SecurityException e) { // Say hi to your favorite creator of closed source software that includes System.exit() in his code. } finally { System.setSecurityManager(previousSecurityManager); } result="Compilation done"; } catch (Exception e) { System.err.println(e); result=e.getMessage(); } System.setOut(orgStream); return result; } }
14,023
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
FileCartridge.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/cartridge/FileCartridge.java
/** * @(#)FileCartridge.java 2000/06/30 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.cartridge; import sw_emulator.hardware.cartridge.Cartridge; import sw_emulator.hardware.cartridge.GameCartridge; import sw_emulator.hardware.io.CartridgeIO; import sw_emulator.hardware.bus.Bus; import sw_emulator.util.Monitor; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; /** * Determine the cartridge type from a file. * Actually only CCS cartridge file format is supported. * * @author Ice * @version 1.00 30/06/2000 */ public class FileCartridge { // negative value means error public static final int E_FNF = -2; // file not found public static final int E_SE = -3; // security exception public static final int E_FTB = -4; // file too big public static final int E_IO = -5; // i/o error public static final int E_LBR = -6; // less byte read public static final int E_ICS = -7; // invalid cartridge signature public static final int E_NCV = -8; // not supported cartridge version public static final int E_IHL = -9; // invalid header lenght public static final int E_UCT = -10; // unknown cartridge type public static final int E_ANS = -11; // actually not supported public static final int E_ISD = -12; // invalid signal data public static final int E_CNF = -13; // chip not found public static final int E_CNE = -14; // chip not expected /** * CCS Cartridge signature: "C64 CARTRIDGE " */ public static final byte[] SIGNATURE={0x43, 0x36, 0x34, 0x20, 0x43, 0x41, 0x52, 0x54, 0x52, 0x49, 0x44, 0x47, 0x45, 0x20, 0x20, 0x20}; /** * Name of the fine */ protected String fileName; /** * The name of the cartridge */ protected String cartName; /** * Image of the file */ protected byte[] fileImage; /** * Roml data buffer */ protected byte[] roml=new byte[8192]; /** * Romh data buffer */ protected byte[] romh=new byte[8192]; /** * A monitor where synchronizer with clock */ protected Monitor clock; /** * The external bus */ protected Bus bus; /** * The cartridge IO */ protected CartridgeIO io; /** * Construct a file cartridge * * @param io the cartridge expansion port io * @param clock a monitor where synchronized with a clock * @param bus the external bus */ public FileCartridge(CartridgeIO io, Monitor clock, Bus bus) { this.io=io; this.clock=clock; this.bus=bus; } /** * Set the name of file to use for cartridge images * * @param fileName name of the file */ public void setFileName(String fileName) { this.fileName=fileName; } /** * Read the cartridge image file * * @return the error code */ public int readFile() { int result; // result of reading FileInputStream file; // the file try { file=new FileInputStream(fileName); } catch (FileNotFoundException e) { return E_FNF; } catch (SecurityException e1) { return E_SE; } try { if (file.available()>32*1024) return E_FTB; fileImage=new byte[file.available()]; result=file.read(fileImage); if (result!=fileImage.length) return E_LBR; } catch (IOException e) { return E_IO; } return 0; } /** * Determine the type of cartridge * * return the cartridge type */ public int determineCart() { int i; //cycle variables int exrom; // exrom signal int game; // game signal int offs; // offset of chip image // look for cartridge signature for (i=0; i<16; i++) if (fileImage[i]!=SIGNATURE[i]) return E_ICS; // invalid cartridge signature // look for cartridge version if (fileImage[0x14]*256+fileImage[0x15]!=0x100) return E_NCV; // not supported cartridge version // look for correct header lenght if ((fileImage[0x10]!=0)|| (fileImage[0x11]!=0)|| (fileImage[0x12]!=0)|| (fileImage[0x13]!=0x40)) ///20 (?) return E_IHL; // invalid header length cartName=""; // reset the name // get the cartridge name for (i=0x20; i<0x40; i++) { cartName+=(char)fileImage[i]; } // get exrom and game signal exrom=fileImage[0x18]; game=fileImage[0x19]; // look for valid signals if (!((game==0 || game==1) && (exrom==0 || exrom==1))) return E_ISD; // invalid signal data // determine cartridge type switch (fileImage[0x16]*256+fileImage[0x17]) { case 0x00: // normal cartridge offs=0x40; // offeset of chip image if (((char)fileImage[offs+0]!='C')|| ((char)fileImage[offs+1]!='H')|| ((char)fileImage[offs+2]!='I')|| ((char)fileImage[offs+3]!='P')) return E_CNF; // chip not found switch (game<<1+exrom) { case 00: //look for ROM chip if (fileImage[offs+8]*256+fileImage[offs+9]!=0) return E_CNE; // RAM chip not expected //... not yet implemented // now we suppose 16Kb expected!!! // copy first ROM (8000h) for (i=0; i<8192; i++) { roml[i]=fileImage[i+offs+0x10]; } // copy second ROM (A000h) for (i=0; i<8192; i++) { romh[i]=fileImage[i+offs+0x10+8192]; } break; } break; case 0x01: // action replay return E_ANS; // actually not supported case 0x02: // KCS power cartridge return E_ANS; // actually not supported default: return E_UCT; // unknown cartridge type } return 0; } /** * Get the cartridge correctly initilized * * @param type the type of cartridge to return */ public Cartridge getCartridge(int type) { type=0; // debug switch (type) { case 00: return new GameCartridge(io, clock, bus, roml, romh); default: return new Cartridge(io, clock, bus); } } }
7,363
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
PulseSawtooth.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/sidid/PulseSawtooth.java
package sw_emulator.software.sidid; /** * * @author stefano_tognon */ public class PulseSawtooth { public static final char PulseSawtooth [] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x0C, 0x1C, 0x3F, 0x1E, 0x3F, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x5F, 0x0C, 0x5F, 0x5F, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x40, 0x40, 0x6F, 0x40, 0x6F, 0x6F, 0x6F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x70, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x70, 0x40, 0x60, 0x60, 0x77, 0x60, 0x77, 0x77, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x00, 0x40, 0x40, 0x60, 0x40, 0x60, 0x60, 0x79, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x60, 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, 0x60, 0x78, 0x40, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 0x60, 0x70, 0x70, 0x78, 0x70, 0x79, 0x7B, 0x7B, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x70, 0x60, 0x60, 0x60, 0x70, 0x60, 0x70, 0x70, 0x7C, 0x60, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x7C, 0x70, 0x78, 0x78, 0x7C, 0x78, 0x7C, 0x7C, 0x7D, 0x70, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x7C, 0x78, 0x7C, 0x7C, 0x7E, 0x7C, 0x7E, 0x7E, 0x7E, 0x7C, 0x7C, 0x7C, 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x7E, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x8E, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x8F, 0x80, 0x80, 0x80, 0x9F, 0x80, 0x9F, 0x9F, 0x9F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x84, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x87, 0x80, 0x80, 0x80, 0x87, 0x80, 0x8F, 0xAF, 0xAF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x83, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xA0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xA0, 0x80, 0x80, 0x80, 0xA0, 0x80, 0xA3, 0xB7, 0xB7, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xB1, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xB0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xB0, 0x80, 0xA0, 0xA0, 0xB0, 0xA0, 0xB8, 0xB9, 0xBB, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xA0, 0x80, 0x80, 0x80, 0xA0, 0x80, 0xA0, 0xA0, 0xB8, 0x80, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xB8, 0xA0, 0xB0, 0xB0, 0xB8, 0xB0, 0xBC, 0xBC, 0xBD, 0xA0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB8, 0xB8, 0xBC, 0xB0, 0xB8, 0xB8, 0xBC, 0xB8, 0xBC, 0xBE, 0xBE, 0xB8, 0xBC, 0xBC, 0xBE, 0xBC, 0xBE, 0xBE, 0xBF, 0xBE, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC7, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC3, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x80, 0x80, 0x80, 0xC0, 0x80, 0xC0, 0xC0, 0xC1, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC7, 0xC0, 0xC0, 0xC0, 0xC7, 0xC0, 0xCF, 0xCF, 0xCF, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC3, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x80, 0x80, 0x80, 0xC0, 0x80, 0xC0, 0xC0, 0xC0, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC1, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC1, 0xC7, 0xD7, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xD0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xD0, 0xC0, 0xC0, 0xC0, 0xD0, 0xC0, 0xD0, 0xD8, 0xDB, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xD8, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xD8, 0xC0, 0xC0, 0xC0, 0xD8, 0xD0, 0xD8, 0xD8, 0xDD, 0xC0, 0xC0, 0xC0, 0xD0, 0xC0, 0xD0, 0xD0, 0xDC, 0xD0, 0xD8, 0xD8, 0xDC, 0xD8, 0xDC, 0xDC, 0xDE, 0xD8, 0xDC, 0xDC, 0xDE, 0xDC, 0xDE, 0xDE, 0xDF, 0xDE, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE3, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xC0, 0xC0, 0xC0, 0xE0, 0xC0, 0xE0, 0xE0, 0xE1, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xC0, 0xC0, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE1, 0xE3, 0xE7, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xC0, 0xC0, 0xC0, 0xE0, 0xC0, 0xE0, 0xE0, 0xE0, 0xC0, 0xC0, 0xC0, 0xE0, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xEB, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE8, 0xE0, 0xE8, 0xE8, 0xED, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xEC, 0xE0, 0xE0, 0xE0, 0xEC, 0xE8, 0xEC, 0xEC, 0xEE, 0xE8, 0xE8, 0xE8, 0xEC, 0xEC, 0xEE, 0xEE, 0xEF, 0xEC, 0xEF, 0xEF, 0xEF, 0xEF, 0xEF, 0xEF, 0xEF, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xF0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xF0, 0xE0, 0xE0, 0xE0, 0xF0, 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF3, 0xE0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF5, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF4, 0xF4, 0xF6, 0xF0, 0xF0, 0xF0, 0xF4, 0xF0, 0xF4, 0xF6, 0xF7, 0xF4, 0xF6, 0xF6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF8, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF8, 0xF8, 0xF8, 0xF0, 0xF0, 0xF0, 0xF8, 0xF0, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF9, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xFA, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xFB, 0xF8, 0xFA, 0xFA, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xF8, 0xF8, 0xF8, 0xFC, 0xF8, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFD, 0xFC, 0xFC, 0xFC, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFC, 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; }
25,383
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
Memory.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/sidid/Memory.java
/** * @(#)Memory.java 2023/04/07 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.sidid; import java.io.File; import java.io.FileOutputStream; /** *Sidld memory * * @author ice */ public class Memory { public final int MEM_NONE = 0x00; public final int MEM_READ = 0x01; public final int MEM_WRITE = 0x02; public final int MEM_EXECUTE = 0x04; public final int MEM_READ_FIRST = 0x10; public final int MEM_WRITE_FIRST = 0x20; public final int MEM_EXECUTE_FIRST = 0x40; public final int MEM_SAMPLE = 0x80; // never used anymore /** Memory of C64 */ byte[] memory=new byte[0x10000]; /** Use static access to reduce patching of file */ public static Memory instance=new Memory(); private Memory() { } /** * Clear the actual data */ public void clear() { memory=new byte[0x10000]; } /** * Set previous memory address as executed * * @param address the address */ public void setExecuteMinus(int address) { if (--address>=0) { memory[address] |= MEM_EXECUTE; if ((memory[address] & (MEM_READ_FIRST | MEM_WRITE_FIRST | MEM_EXECUTE_FIRST))==0) memory[address] |= MEM_EXECUTE_FIRST; } } /** * Set this memory address as executed * * @param address the address */ public void setExecute(int address) { memory[address] |= MEM_EXECUTE; if ((memory[address] & (MEM_READ_FIRST | MEM_WRITE_FIRST | MEM_EXECUTE_FIRST))==0) memory[address] |= MEM_EXECUTE_FIRST; } /** * Set this memory address as read * * @param address the address */ public void setRead(int address) { memory[address] |= MEM_READ; if ((memory[address] & (MEM_READ_FIRST | MEM_WRITE_FIRST | MEM_EXECUTE_FIRST))==0) memory[address] |= MEM_READ_FIRST; } /** * Set this memory address as write * * @param address the address */ public void setWrite(int address) { memory[address] |= MEM_WRITE; if ((memory[address] & (MEM_READ_FIRST | MEM_WRITE_FIRST | MEM_EXECUTE_FIRST))==0) memory[address] |= MEM_WRITE_FIRST; } /** * Close and so write file of data * * @param name the name of tune * @param tune the tune number */ public void close(String name, int tune) { byte[] heather={0x53, 0x49, 0x44, 0x4c, 0x44, 0x20, 0x52, 0x41, 0x4d, 0x20, 0x46, 0x4c, 0x41, 0x47, 0x53, 0x20}; try { File outputFile = new File(name+"_"+tune+".bin"); FileOutputStream outputStream = new FileOutputStream(outputFile); outputStream.write(heather); outputStream.write(memory); outputStream.flush(); outputStream.close(); } catch (Exception e) { System.err.println(e); } } }
3,648
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
CRSID.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/sidid/CRSID.java
/** * @(#)cRSID.java 2023/03/19 * * ICE Team free software group * * This file is part of JIIT64 Java Ice Team Tracker 64 * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ package sw_emulator.software.sidid; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled.SourceDataLine; /** * CRSID class of CRSID original by Hermit * * @author ice00 */ public class CRSID extends Thread { C64 c64; public static final char PowersOf2[] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; //private final int BUFFER_SIZE = 16384; private final int SAMPLE_RATE = 44100; private final int SAMPLE_SIZE_IN_BITS = 16; private final int CHANNELS = 2; private final boolean SIGNED = true; private final boolean BIG_ENDIAN = false; private boolean playing=false; private boolean paused=false; //AudioFormat format; //DataLine.Info info; SourceDataLine line; public CRSID() { init(44100); start(); } public void init(int samplerate) { c64=new C64(samplerate); c64.highQualitySID=true; c64.stereo=0; c64.selectedSIDmodel=0; c64.playbackSpeed=1; //default model and mode selections c64.mainVolume=255; //if ( cRSID_initSound (C64, samplerate,buflen) == NULL) return NULL; } public void initSIDtune(PSID psid, int subtune) { //subtune: 1..255 int InitTimeout; if (subtune == 0) { subtune = 1; } else if (subtune > psid.subtuneAmount) { subtune = psid.subtuneAmount; } c64.subTune = subtune; c64.secondCnt = c64.playTime = /*c64.Paused =*/ 0; Memory.instance.clear(); c64.setC64(psid); c64.initC64(); //cRSID_writeMemC64(C64,0xD418,0xF); //set C64 hardware and initC64 (reset) it //determine initC64-address: c64.initAddress = ((psid.initAddressH) << 8) + (psid.initAddressL); //get info from BASIC-startupcode for some tunes if (c64.ramBank[1] == 0x37) { //are there SIDs with routine under IO area? some PSIDs don't set bank-registers themselves if ((0xA000 <= c64.initAddress && c64.initAddress < 0xC000) || (c64.loadAddress < 0xC000 && c64.endAddress >= 0xA000)) { c64.ramBank[1] = 0x36; } else if (c64.initAddress >= 0xE000 || c64.endAddress >= 0xE000) { c64.ramBank[1] = 0x35; } } c64.cpu.initCPU(c64.initAddress); //prepare initC64-routine call c64.cpu.A = subtune - 1; if (!c64.realSIDmode) { //call initC64-routine: for (InitTimeout = 10000000; InitTimeout > 0; InitTimeout--) { if ((c64.cpu.emulateCPU()&0xFF) >= 0xFE) { break; } } //give error when timed out? } //determine timing-source, if CIA, replace frameCycles previouisly set to VIC-timing if (subtune > 32) { c64.timerSource = psid.subtuneTimeSources[0] & 0x80; //subtunes above 32 should use subtune32's timing } else { c64.timerSource = psid.subtuneTimeSources[(32 - subtune) >> 3] & PowersOf2[(subtune - 1) & 7]; } if (c64.timerSource!=0 || c64.ioBankWR[0xDC05] != 0x40 || c64.ioBankWR[0xDC04] != 0x24) { //CIA1-timing (probably multispeed tune) c64.frameCycles = ((c64.ioBankWR[0xDC04] + (c64.ioBankWR[0xDC05] << 8))); //<< 4) / C64->ClockRatio; c64.timerSource = 1; //if initC64-routine changed DC04 or DC05, assume CIA-timing } //determine playaddress: c64.playAddress = (psid.playAddressH << 8) + psid.playAddressL; if (c64.playAddress!=0) { //normal play-address called with JSR if (c64.ramBank[1] == 0x37) { //are there SIDs with routine under IO area? if (0xA000 <= c64.playAddress && c64.playAddress < 0xC000) { c64.ramBank[1] = 0x36; } } else if (c64.playAddress >= 0xE000) { c64.ramBank[1] = 0x35; //player under KERNAL (e.g. Crystal Kingdom Dizzy) } } else { //IRQ-playaddress for multispeed-tunes set by initC64-routine (some tunes turn off KERNAL ROM but doesn't set irq-vector!) c64.playAddress = (c64.ramBank[1] & 3) < 2 ? c64.readMemC64(0xFFFE) + (c64.readMemC64(0xFFFF) << 8) //for PSID : c64.readMemC64(0x314) + (c64.readMemC64( 0x315) << 8); if (c64.playAddress == 0) { //if 0, still try with RSID-mode fallback c64.cpu.initCPU(c64.playAddress); //point CPU to play-routine c64.finished = true; c64.returned = 1; return; } } if (!c64.realSIDmode) { //prepare (PSID) play-routine playback: c64.cpu.initCPU(c64.playAddress); //point CPU to play-routine c64.frameCycleCnt = 0; c64.finished = true; c64.sampleCycleCnt = 0; //C64->CIAisSet=0; } else { c64.finished = false; c64.returned = 0; } } /** * Genewrate a sample * * @return the stereo sample */ public Output generateSample() { //call this from custom buffer-filler Output output; int PSIDdigi; output = c64.emulateC64(); if (c64.psidDigiMode) { PSIDdigi = c64.playPSIDdigi(); output.L += PSIDdigi; output.R += PSIDdigi; } if (output.L >= 32767) { output.L = 32767; } else if (output.L <= -32768) { output.L = -32768; //saturation logic on overflow } if (output.R >= 32767) { output.R = 32767; } else if (output.R <= -32768) { output.R = -32768; //saturation logic on overflow } return output; } /** * Genrate the sound from emulation * * @param buf the buffer to fill with sound */ public void generateSound(byte[] buf) { Output output=null; for (int i = 0; i < buf.length; i += 4) { for (int j = 0; j < c64.playbackSpeed; ++j) { output = generateSample(); } output.L = output.L * c64.mainVolume / 256; output.R = output.R * c64.mainVolume / 256; buf[i + 0] = (byte)(output.L & 0xFF); buf[i + 1] = (byte)(output.L >> 8); buf[i + 2] = (byte)(output.R & 0xFF); buf[i + 3] = (byte)(output.R >> 8); } } /** * Play the given sid file * * @param filename the file to play * @param subtune the tune to play * @return the SID handler */ public PSID playSIDfile(String filename, int subtune) { PSID psid=new PSID(); psid.loadSIDtune(c64,filename); initSIDtune(psid, subtune); playing = true; paused = false; c64.playbackSpeed=1; return psid; } @Override public void run() { try { while(true) { byte[] buffer = new byte[/*Shared.option.getBufferSize()*/ 16384 * CHANNELS]; c64.highQualitySID=true; //Shared.option.isCrsidHighQuality(); AudioFormat format = new AudioFormat(SAMPLE_RATE, SAMPLE_SIZE_IN_BITS, CHANNELS, SIGNED, BIG_ENDIAN); DataLine.Info info = new DataLine.Info(SourceDataLine.class, format); line = (SourceDataLine) AudioSystem.getLine(info); line.open(format); line.start(); while (playing) { if (paused) { Thread.sleep(100); continue; } generateSound(buffer); line.write(buffer, 0, buffer.length); } while (!playing) { Thread.sleep(100); continue; } } } catch (Exception e) { e.printStackTrace(); } finally { if (line != null) { line.drain(); line.close(); } } } /** * Fast play (or if already fast, goews normal */ public synchronized void fPlay() { if (c64.playbackSpeed>1) c64.playbackSpeed=1; else c64.playbackSpeed = 4; } /** * Pause the play of tune */ public synchronized void pausePlaying() { //c64.Paused^=1; //if(c64.Paused) paused=true; //else pause=false; paused=!paused; } /** * Stop the play of tune */ public synchronized void stopPlaying() { playing = false; } /** * Played time in second * * @return the played time */ public int time() { return c64.playTime; } /** * Set the voice to mute/unmute * * @param voice the voice * @param mute the mute state */ public void setVoiceMute(int voice, boolean mute) { switch (voice) { case 0: c64.sid[0].muteVoice1=mute; c64.sid[1].muteVoice1=mute; c64.sid[2].muteVoice1=mute; c64.sid[3].muteVoice1=mute; break; case 1: c64.sid[0].muteVoice2=mute; c64.sid[1].muteVoice2=mute; c64.sid[2].muteVoice2=mute; c64.sid[3].muteVoice2=mute; break; case 2: c64.sid[0].muteVoice3=mute; c64.sid[1].muteVoice3=mute; c64.sid[2].muteVoice3=mute; c64.sid[3].muteVoice3=mute; break ; } } public static void main(String args[]) { CRSID cr=new CRSID(); cr.init(44100); cr.playSIDfile(args[0], 1); // "/home/ice/hvsids/MUSICIANS/B/Bjerregaard_Johannes/Sweet.sid",1); //args[0], 1); //"/home/ice/hvsids/MUSICIANS/B/Bjerregaard_Johannes/Sweet.sid", 1); } }
10,196
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
SID.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/sidid/SID.java
/** * @(#)SID.java 2023/03/19 * * ICE Team free software group * * This file is part of JIIT64 Java Ice Team Tracker 64 * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ package sw_emulator.software.sidid; import static sw_emulator.software.sidid.PulseSawTriangle.PulseSawTriangle; import static sw_emulator.software.sidid.PulseSawtooth.PulseSawtooth; import static sw_emulator.software.sidid.PulseTriangle.PulseTriangle; import static sw_emulator.software.sidid.SawTriangle.SawTriangle; class SIDwavOutput { int nonFilted; int filterInput; }; /** * SID emulation of cRSID original by Hermit * * @author ice00 */ public class SID { //SID-chip data: /** Reference to the containing c64 */ C64 c64; /** values: 8580 / 6581 */ int chipModel; /** 1:left, 2:right, 3:both(middle)*/ int channel; /** SID-baseaddress location in c64-memory (IO) */ int baseAddress; /** SID-baseaddress location in host's memory */ int[] basePtr; //ADSR-related: int[] adsrState=new int[15]; int[] rateCounter=new int[15]; int[] envelopeCounter=new int[15]; int[] exponentCounter=new int[15]; //Wave-related: int[] phaseAccu=new int[15]; //28bit precision instead of 24bit int[] prevPhaseAccu=new int[15]; //(integerized ClockRatio fractionals, WebSID has similar solution) boolean syncSourceMSBrise; int ringSourceMSB; int[] noiseLFSR=new int[15]; int[] prevWavGenOut=new int[15]; int[] prevWavData=new int[15]; //Filter-related: int prevLowPass; int prevBandPass; //Output-stage: int nonFiltedSample; int filterInputSample; int prevNonFiltedSample; int prevFilterInputSample; int prevVolume; //lowpass-filtered version of Volume-band register int output; //not attenuated (range:0..0xFFFFF depending on sid's main-volume) int level; //filtered version, good for VU-meter display boolean muteVoice1 = false; boolean muteVoice2 = false; boolean muteVoice3 = false; public static final int GATE_BITVAL=0x01; public static final int ATTACK_BITVAL=0x80; public static final int DECAYSUSTAIN_BITVAL=0x40; public static final int HOLDZEROn_BITVAL=0x10; public static final int NOISE_BITVAL=0x80; public static final int PULSE_BITVAL=0x40; public static final int SAW_BITVAL=0x20; public static final int TRI_BITVAL=0x10; public static final int OFF3_BITVAL=0x80; public static final int TEST_BITVAL=0x08; public static final int RING_BITVAL=0x04; public static final int SYNC_BITVAL=0x02; public static final int HIGHPASS_BITVAL=0x40; public static final int BANDPASS_BITVAL=0x20; public static final int LOWPASS_BITVAL=0x10; public static final int CHANNELS=3+1; public static final int VOLUME_MAX=0xF; public static final int D418_DIGI_VOLUME=2; public static final int[] ADSRprescalePeriods = { 9, 32, 63, 95, 149, 220, 267, 313, 392, 977, 1954, 3126, 3907, 11720, 19532, 31251 }; public static final byte[] ADSRexponentPeriods = { 1, 30, 30, 30, 30, 30, 30, 16, 16, 16, 16, 16, 16, 16, 16, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, //pos0:1 pos6:30 pos14:16 pos26:8 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, //pos54:4 //pos93:2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; public static final byte FilterSwitchVal[] = {1,1,1,1,1,1,1,2,2,2,2,2,2,2,4}; //SID-output tables public static final int Resonances8580[] = { //generated by curvegen.c // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0x16A0,0x14BF,0x1306,0x1172,0x1000,0x0EAC,0x0D74,0x0C56,0x0B50,0x0A5F,0x0983,0x08B9,0x0800,0x0756,0x06BA,0x062B //0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE8, 0xD5, 0xC5, 0xB3, 0xA4, 0x97, 0x8A, 0x80, 0x77, 0x6E, 0x66 <- calculated then refined manually to sound best }; public static final int Resonances6581[] = { //generated by curvegen.c // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0x168F,0x168F,0x168F,0x168F,0x168F,0x168F,0x1555,0x1249,0x1000,0x0E38,0x0CCC,0x0BA2,0x0AAA,0x09D8,0x0924,0x0888 //0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xF9, 0xF6, 0xF2, 0xEC, 0xE4, 0xCD, 0xBA, 0xAB, 0x9E, 0x92, 0x86 <- calculated then refined manually to sound best }; public static final int CutoffMul8580_44100Hz[] = { //generated by curvegen.c 0x006,0x00A,0x00D,0x011,0x014,0x018,0x01B,0x01F,0x022,0x026,0x029,0x02D,0x030,0x034,0x037,0x03B, 0x03E,0x041,0x045,0x048,0x04C,0x04F,0x053,0x056,0x059,0x05D,0x060,0x064,0x067,0x06B,0x06E,0x071, 0x075,0x078,0x07C,0x07F,0x082,0x086,0x089,0x08D,0x090,0x093,0x097,0x09A,0x09D,0x0A1,0x0A4,0x0A7, 0x0AB,0x0AE,0x0B2,0x0B5,0x0B8,0x0BC,0x0BF,0x0C2,0x0C6,0x0C9,0x0CC,0x0D0,0x0D3,0x0D6,0x0D9,0x0DD, 0x0E0,0x0E3,0x0E7,0x0EA,0x0ED,0x0F1,0x0F4,0x0F7,0x0FA,0x0FE,0x101,0x104,0x108,0x10B,0x10E,0x111, 0x115,0x118,0x11B,0x11E,0x122,0x125,0x128,0x12B,0x12F,0x132,0x135,0x138,0x13C,0x13F,0x142,0x145, 0x149,0x14C,0x14F,0x152,0x155,0x159,0x15C,0x15F,0x162,0x165,0x169,0x16C,0x16F,0x172,0x175,0x178, 0x17C,0x17F,0x182,0x185,0x188,0x18B,0x18F,0x192,0x195,0x198,0x19B,0x19E,0x1A2,0x1A5,0x1A8,0x1AB, 0x1AE,0x1B1,0x1B4,0x1B7,0x1BB,0x1BE,0x1C1,0x1C4,0x1C7,0x1CA,0x1CD,0x1D0,0x1D3,0x1D7,0x1DA,0x1DD, 0x1E0,0x1E3,0x1E6,0x1E9,0x1EC,0x1EF,0x1F2,0x1F5,0x1F9,0x1FC,0x1FF,0x202,0x205,0x208,0x20B,0x20E, 0x211,0x214,0x217,0x21A,0x21D,0x220,0x223,0x226,0x229,0x22C,0x22F,0x232,0x235,0x238,0x23B,0x23E, 0x006,0x00A,0x00D,0x011,0x014,0x018,0x01B,0x01F,0x022,0x026,0x029,0x02D,0x030,0x034,0x037,0x03B, 0x03E,0x041,0x045,0x048,0x04C,0x04F,0x053,0x056,0x059,0x05D,0x060,0x064,0x067,0x06B,0x06E,0x071, 0x075,0x078,0x07C,0x07F,0x082,0x086,0x089,0x08D,0x090,0x093,0x097,0x09A,0x09D,0x0A1,0x0A4,0x0A7, 0x0AB,0x0AE,0x0B2,0x0B5,0x0B8,0x0BC,0x0BF,0x0C2,0x0C6,0x0C9,0x0CC,0x0D0,0x0D3,0x0D6,0x0D9,0x0DD, 0x0E0,0x0E3,0x0E7,0x0EA,0x0ED,0x0F1,0x0F4,0x0F7,0x0FA,0x0FE,0x101,0x104,0x108,0x10B,0x10E,0x111, 0x241,0x244,0x247,0x24A,0x24D,0x250,0x253,0x256,0x259,0x25C,0x25F,0x262,0x265,0x268,0x26B,0x26E, 0x271,0x274,0x277,0x27A,0x27D,0x280,0x283,0x286,0x289,0x28C,0x28F,0x292,0x295,0x297,0x29A,0x29D, 0x2A0,0x2A3,0x2A6,0x2A9,0x2AC,0x2AF,0x2B2,0x2B5,0x2B8,0x2BB,0x2BD,0x2C0,0x2C3,0x2C6,0x2C9,0x2CC, 0x2CF,0x2D2,0x2D5,0x2D7,0x2DA,0x2DD,0x2E0,0x2E3,0x2E6,0x2E9,0x2EB,0x2EE,0x2F1,0x2F4,0x2F7,0x2FA, 0x2FD,0x2FF,0x302,0x305,0x308,0x30B,0x30E,0x310,0x313,0x316,0x319,0x31C,0x31F,0x321,0x324,0x327, 0x32A,0x32D,0x32F,0x332,0x335,0x338,0x33B,0x33D,0x340,0x343,0x346,0x349,0x34B,0x34E,0x351,0x354, 0x356,0x359,0x35C,0x35F,0x362,0x364,0x367,0x36A,0x36D,0x36F,0x372,0x375,0x378,0x37A,0x37D,0x380, 0x382,0x385,0x388,0x38B,0x38D,0x390,0x393,0x396,0x398,0x39B,0x39E,0x3A0,0x3A3,0x3A6,0x3A8,0x3AB, 0x3AE,0x3B1,0x3B3,0x3B6,0x3B9,0x3BB,0x3BE,0x3C1,0x3C3,0x3C6,0x3C9,0x3CB,0x3CE,0x3D1,0x3D3,0x3D6, 0x3D9,0x3DB,0x3DE,0x3E1,0x3E3,0x3E6,0x3E9,0x3EB,0x3EE,0x3F1,0x3F3,0x3F6,0x3F8,0x3FB,0x3FE,0x400, 0x403,0x406,0x408,0x40B,0x40D,0x410,0x413,0x415,0x418,0x41A,0x41D,0x420,0x422,0x425,0x427,0x42A, 0x42D,0x42F,0x432,0x434,0x437,0x439,0x43C,0x43F,0x441,0x444,0x446,0x449,0x44B,0x44E,0x451,0x453, 0x456,0x458,0x45B,0x45D,0x460,0x462,0x465,0x467,0x46A,0x46D,0x46F,0x472,0x474,0x477,0x479,0x47C, 0x47E,0x481,0x483,0x486,0x488,0x48B,0x48D,0x490,0x492,0x495,0x497,0x49A,0x49C,0x49F,0x4A1,0x4A4, 0x4A6,0x4A9,0x4AB,0x4AE,0x4B0,0x4B3,0x4B5,0x4B8,0x4BA,0x4BC,0x4BF,0x4C1,0x4C4,0x4C6,0x4C9,0x4CB, 0x4CE,0x4D0,0x4D3,0x4D5,0x4D7,0x4DA,0x4DC,0x4DF,0x4E1,0x4E4,0x4E6,0x4E8,0x4EB,0x4ED,0x4F0,0x4F2, 0x4F5,0x4F7,0x4F9,0x4FC,0x4FE,0x501,0x503,0x505,0x508,0x50A,0x50D,0x50F,0x511,0x514,0x516,0x519, 0x51B,0x51D,0x520,0x522,0x524,0x527,0x529,0x52C,0x52E,0x530,0x533,0x535,0x537,0x53A,0x53C,0x53E, 0x541,0x543,0x546,0x548,0x54A,0x54D,0x54F,0x551,0x554,0x556,0x558,0x55B,0x55D,0x55F,0x562,0x564, 0x566,0x568,0x56B,0x56D,0x56F,0x572,0x574,0x576,0x579,0x57B,0x57D,0x580,0x582,0x584,0x586,0x589, 0x58B,0x58D,0x590,0x592,0x594,0x596,0x599,0x59B,0x59D,0x5A0,0x5A2,0x5A4,0x5A6,0x5A9,0x5AB,0x5AD, 0x5AF,0x5B2,0x5B4,0x5B6,0x5B8,0x5BB,0x5BD,0x5BF,0x5C1,0x5C4,0x5C6,0x5C8,0x5CA,0x5CD,0x5CF,0x5D1, 0x5D3,0x5D5,0x5D8,0x5DA,0x5DC,0x5DE,0x5E1,0x5E3,0x5E5,0x5E7,0x5E9,0x5EC,0x5EE,0x5F0,0x5F2,0x5F4, 0x5F7,0x5F9,0x5FB,0x5FD,0x5FF,0x602,0x604,0x606,0x608,0x60A,0x60C,0x60F,0x611,0x613,0x615,0x617, 0x619,0x61C,0x61E,0x620,0x622,0x624,0x626,0x629,0x62B,0x62D,0x62F,0x631,0x633,0x635,0x638,0x63A, 0x63C,0x63E,0x640,0x642,0x644,0x646,0x649,0x64B,0x64D,0x64F,0x651,0x653,0x655,0x657,0x65A,0x65C, 0x65E,0x660,0x662,0x664,0x666,0x668,0x66A,0x66C,0x66F,0x671,0x673,0x675,0x677,0x679,0x67B,0x67D, 0x67F,0x681,0x683,0x685,0x688,0x68A,0x68C,0x68E,0x690,0x692,0x694,0x696,0x698,0x69A,0x69C,0x69E, 0x6A0,0x6A2,0x6A4,0x6A6,0x6A8,0x6AB,0x6AD,0x6AF,0x6B1,0x6B3,0x6B5,0x6B7,0x6B9,0x6BB,0x6BD,0x6BF, 0x6C1,0x6C3,0x6C5,0x6C7,0x6C9,0x6CB,0x6CD,0x6CF,0x6D1,0x6D3,0x6D5,0x6D7,0x6D9,0x6DB,0x6DD,0x6DF, 0x6E1,0x6E3,0x6E5,0x6E7,0x6E9,0x6EB,0x6ED,0x6EF,0x6F1,0x6F3,0x6F5,0x6F7,0x6F9,0x6FB,0x6FD,0x6FF, 0x701,0x703,0x705,0x707,0x709,0x70B,0x70C,0x70E,0x710,0x712,0x714,0x716,0x718,0x71A,0x71C,0x71E, 0x720,0x722,0x724,0x726,0x728,0x72A,0x72C,0x72E,0x72F,0x731,0x733,0x735,0x737,0x739,0x73B,0x73D, 0x73F,0x741,0x743,0x745,0x746,0x748,0x74A,0x74C,0x74E,0x750,0x752,0x754,0x756,0x758,0x759,0x75B, 0x75D,0x75F,0x761,0x763,0x765,0x767,0x769,0x76A,0x76C,0x76E,0x770,0x772,0x774,0x776,0x778,0x779, 0x77B,0x77D,0x77F,0x781,0x783,0x785,0x786,0x788,0x78A,0x78C,0x78E,0x790,0x791,0x793,0x795,0x797, 0x799,0x79B,0x79D,0x79E,0x7A0,0x7A2,0x7A4,0x7A6,0x7A7,0x7A9,0x7AB,0x7AD,0x7AF,0x7B1,0x7B2,0x7B4, 0x7B6,0x7B8,0x7BA,0x7BB,0x7BD,0x7BF,0x7C1,0x7C3,0x7C4,0x7C6,0x7C8,0x7CA,0x7CC,0x7CD,0x7CF,0x7D1, 0x7D3,0x7D5,0x7D6,0x7D8,0x7DA,0x7DC,0x7DE,0x7DF,0x7E1,0x7E3,0x7E5,0x7E6,0x7E8,0x7EA,0x7EC,0x7ED, 0x7EF,0x7F1,0x7F3,0x7F5,0x7F6,0x7F8,0x7FA,0x7FC,0x7FD,0x7FF,0x801,0x803,0x804,0x806,0x808,0x80A, 0x80B,0x80D,0x80F,0x810,0x812,0x814,0x816,0x817,0x819,0x81B,0x81D,0x81E,0x820,0x822,0x823,0x825, 0x827,0x829,0x82A,0x82C,0x82E,0x82F,0x831,0x833,0x835,0x836,0x838,0x83A,0x83B,0x83D,0x83F,0x841, 0x842,0x844,0x846,0x847,0x849,0x84B,0x84C,0x84E,0x850,0x851,0x853,0x855,0x856,0x858,0x85A,0x85B, 0x85D,0x85F,0x860,0x862,0x864,0x865,0x867,0x869,0x86A,0x86C,0x86E,0x86F,0x871,0x873,0x874,0x876, 0x878,0x879,0x87B,0x87D,0x87E,0x880,0x881,0x883,0x885,0x886,0x888,0x88A,0x88B,0x88D,0x88F,0x890, 0x892,0x893,0x895,0x897,0x898,0x89A,0x89C,0x89D,0x89F,0x8A0,0x8A2,0x8A4,0x8A5,0x8A7,0x8A8,0x8AA, 0x8AC,0x8AD,0x8AF,0x8B0,0x8B2,0x8B4,0x8B5,0x8B7,0x8B8,0x8BA,0x8BC,0x8BD,0x8BF,0x8C0,0x8C2,0x8C4, 0x8C5,0x8C7,0x8C8,0x8CA,0x8CB,0x8CD,0x8CF,0x8D0,0x8D2,0x8D3,0x8D5,0x8D6,0x8D8,0x8DA,0x8DB,0x8DD, 0x8DE,0x8E0,0x8E1,0x8E3,0x8E4,0x8E6,0x8E8,0x8E9,0x8EB,0x8EC,0x8EE,0x8EF,0x8F1,0x8F2,0x8F4,0x8F5, 0x8F7,0x8F9,0x8FA,0x8FC,0x8FD,0x8FF,0x900,0x902,0x903,0x905,0x906,0x908,0x909,0x90B,0x90C,0x90E, 0x90F,0x911,0x912,0x914,0x916,0x917,0x919,0x91A,0x91C,0x91D,0x91F,0x920,0x922,0x923,0x925,0x926, 0x928,0x929,0x92B,0x92C,0x92E,0x92F,0x931,0x932,0x934,0x935,0x936,0x938,0x939,0x93B,0x93C,0x93E, 0x93F,0x941,0x942,0x944,0x945,0x947,0x948,0x94A,0x94B,0x94D,0x94E,0x950,0x951,0x952,0x954,0x955, 0x957,0x958,0x95A,0x95B,0x95D,0x95E,0x960,0x961,0x962,0x964,0x965,0x967,0x968,0x96A,0x96B,0x96D, 0x96E,0x96F,0x971,0x972,0x974,0x975,0x977,0x978,0x979,0x97B,0x97C,0x97E,0x97F,0x981,0x982,0x983, 0x985,0x986,0x988,0x989,0x98A,0x98C,0x98D,0x98F,0x990,0x992,0x993,0x994,0x996,0x997,0x999,0x99A, 0x99B,0x99D,0x99E,0x9A0,0x9A1,0x9A2,0x9A4,0x9A5,0x9A6,0x9A8,0x9A9,0x9AB,0x9AC,0x9AD,0x9AF,0x9B0, 0x9B2,0x9B3,0x9B4,0x9B6,0x9B7,0x9B8,0x9BA,0x9BB,0x9BD,0x9BE,0x9BF,0x9C1,0x9C2,0x9C3,0x9C5,0x9C6, 0x9C7,0x9C9,0x9CA,0x9CC,0x9CD,0x9CE,0x9D0,0x9D1,0x9D2,0x9D4,0x9D5,0x9D6,0x9D8,0x9D9,0x9DA,0x9DC, 0x9DD,0x9DE,0x9E0,0x9E1,0x9E2,0x9E4,0x9E5,0x9E6,0x9E8,0x9E9,0x9EA,0x9EC,0x9ED,0x9EE,0x9F0,0x9F1, 0x9F2,0x9F4,0x9F5,0x9F6,0x9F8,0x9F9,0x9FA,0x9FC,0x9FD,0x9FE,0xA00,0xA01,0xA02,0xA04,0xA05,0xA06, 0xA07,0xA09,0xA0A,0xA0B,0xA0D,0xA0E,0xA0F,0xA11,0xA12,0xA13,0xA14,0xA16,0xA17,0xA18,0xA1A,0xA1B, 0xA1C,0xA1D,0xA1F,0xA20,0xA21,0xA23,0xA24,0xA25,0xA26,0xA28,0xA29,0xA2A,0xA2C,0xA2D,0xA2E,0xA2F, 0xA31,0xA32,0xA33,0xA34,0xA36,0xA37,0xA38,0xA3A,0xA3B,0xA3C,0xA3D,0xA3F,0xA40,0xA41,0xA42,0xA44, 0xA45,0xA46,0xA47,0xA49,0xA4A,0xA4B,0xA4C,0xA4E,0xA4F,0xA50,0xA51,0xA53,0xA54,0xA55,0xA56,0xA58, 0xA59,0xA5A,0xA5B,0xA5C,0xA5E,0xA5F,0xA60,0xA61,0xA63,0xA64,0xA65,0xA66,0xA67,0xA69,0xA6A,0xA6B, 0xA6C,0xA6E,0xA6F,0xA70,0xA71,0xA72,0xA74,0xA75,0xA76,0xA77,0xA79,0xA7A,0xA7B,0xA7C,0xA7D,0xA7F, 0xA80,0xA81,0xA82,0xA83,0xA85,0xA86,0xA87,0xA88,0xA89,0xA8B,0xA8C,0xA8D,0xA8E,0xA8F,0xA91,0xA92, 0xA93,0xA94,0xA95,0xA96,0xA98,0xA99,0xA9A,0xA9B,0xA9C,0xA9E,0xA9F,0xAA0,0xAA1,0xAA2,0xAA3,0xAA5, 0xAA6,0xAA7,0xAA8,0xAA9,0xAAA,0xAAC,0xAAD,0xAAE,0xAAF,0xAB0,0xAB1,0xAB3,0xAB4,0xAB5,0xAB6,0xAB7, 0xAB8,0xAB9,0xABB,0xABC,0xABD,0xABE,0xABF,0xAC0,0xAC2,0xAC3,0xAC4,0xAC5,0xAC6,0xAC7,0xAC8,0xACA, 0xACB,0xACC,0xACD,0xACE,0xACF,0xAD0,0xAD1,0xAD3,0xAD4,0xAD5,0xAD6,0xAD7,0xAD8,0xAD9,0xADB,0xADC, 0xADD,0xADE,0xADF,0xAE0,0xAE1,0xAE2,0xAE3,0xAE5,0xAE6,0xAE7,0xAE8,0xAE9,0xAEA,0xAEB,0xAEC,0xAEE, 0xAEF,0xAF0,0xAF1,0xAF2,0xAF3,0xAF4,0xAF5,0xAF6,0xAF7,0xAF9,0xAFA,0xAFB,0xAFC,0xAFD,0xAFE,0xAFF, 0xB00,0xB01,0xB02,0xB04,0xB05,0xB06,0xB07,0xB08,0xB09,0xB0A,0xB0B,0xB0C,0xB0D,0xB0E,0xB0F,0xB11, 0xB12,0xB13,0xB14,0xB15,0xB16,0xB17,0xB18,0xB19,0xB1A,0xB1B,0xB1C,0xB1D,0xB1E,0xB20,0xB21,0xB22, 0xB23,0xB24,0xB25,0xB26,0xB27,0xB28,0xB29,0xB2A,0xB2B,0xB2C,0xB2D,0xB2E,0xB2F,0xB30,0xB32,0xB33, 0xB34,0xB35,0xB36,0xB37,0xB38,0xB39,0xB3A,0xB3B,0xB3C,0xB3D,0xB3E,0xB3F,0xB40,0xB41,0xB42,0xB43, 0xB44,0xB45,0xB46,0xB47,0xB48,0xB49,0xB4B,0xB4C,0xB4D,0xB4E,0xB4F,0xB50,0xB51,0xB52,0xB53,0xB54, 0xB55,0xB56,0xB57,0xB58,0xB59,0xB5A,0xB5B,0xB5C,0xB5D,0xB5E,0xB5F,0xB60,0xB61,0xB62,0xB63,0xB64, 0xB65,0xB66,0xB67,0xB68,0xB69,0xB6A,0xB6B,0xB6C,0xB6D,0xB6E,0xB6F,0xB70,0xB71,0xB72,0xB73,0xB74, 0xB75,0xB76,0xB77,0xB78,0xB79,0xB7A,0xB7B,0xB7C,0xB7D,0xB7E,0xB7F,0xB80,0xB81,0xB82,0xB83,0xB84, 0xB85,0xB86,0xB87,0xB88,0xB89,0xB8A,0xB8B,0xB8C,0xB8D,0xB8E,0xB8F,0xB8F,0xB90,0xB91,0xB92,0xB93, 0xB94,0xB95,0xB96,0xB97,0xB98,0xB99,0xB9A,0xB9B,0xB9C,0xB9D,0xB9E,0xB9F,0xBA0,0xBA1,0xBA2,0xBA3, 0xBA4,0xBA5,0xBA6,0xBA7,0xBA7,0xBA8,0xBA9,0xBAA,0xBAB,0xBAC,0xBAD,0xBAE,0xBAF,0xBB0,0xBB1,0xBB2, 0xBB3,0xBB4,0xBB5,0xBB6,0xBB7,0xBB8,0xBB8,0xBB9,0xBBA,0xBBB,0xBBC,0xBBD,0xBBE,0xBBF,0xBC0,0xBC1, 0xBC2,0xBC3,0xBC4,0xBC5,0xBC5,0xBC6,0xBC7,0xBC8,0xBC9,0xBCA,0xBCB,0xBCC,0xBCD,0xBCE,0xBCF,0xBD0, 0xBD1,0xBD1,0xBD2,0xBD3,0xBD4,0xBD5,0xBD6,0xBD7,0xBD8,0xBD9,0xBDA,0xBDB,0xBDB,0xBDC,0xBDD,0xBDE, 0xBDF,0xBE0,0xBE1,0xBE2,0xBE3,0xBE4,0xBE4,0xBE5,0xBE6,0xBE7,0xBE8,0xBE9,0xBEA,0xBEB,0xBEC,0xBED, 0xBED,0xBEE,0xBEF,0xBF0,0xBF1,0xBF2,0xBF3,0xBF4,0xBF5,0xBF5,0xBF6,0xBF7,0xBF8,0xBF9,0xBFA,0xBFB, 0xBFC,0xBFC,0xBFD,0xBFE,0xBFF,0xC00,0xC01,0xC02,0xC03,0xC03,0xC04,0xC05,0xC06,0xC07,0xC08,0xC09, 0xC0A,0xC0A,0xC0B,0xC0C,0xC0D,0xC0E,0xC0F,0xC10,0xC10,0xC11,0xC12,0xC13,0xC14,0xC15,0xC16,0xC16, 0xC17,0xC18,0xC19,0xC1A,0xC1B,0xC1C,0xC1C,0xC1D,0xC1E,0xC1F,0xC20,0xC21,0xC21,0xC22,0xC23,0xC24, 0xC25,0xC26,0xC27,0xC27,0xC28,0xC29,0xC2A,0xC2B,0xC2C,0xC2C,0xC2D,0xC2E,0xC2F,0xC30,0xC31,0xC31, 0xC32,0xC33,0xC34,0xC35,0xC36,0xC36,0xC37,0xC38,0xC39,0xC3A,0xC3B,0xC3B,0xC3C,0xC3D,0xC3E,0xC3F, 0xC3F,0xC40,0xC41,0xC42,0xC43,0xC44,0xC44,0xC45,0xC46,0xC47,0xC48,0xC48,0xC49,0xC4A,0xC4B,0xC4C, 0xC4D,0xC4D,0xC4E,0xC4F,0xC50,0xC51,0xC51,0xC52,0xC53,0xC54,0xC55,0xC55,0xC56,0xC57,0xC58,0xC59, 0xC59,0xC5A,0xC5B,0xC5C,0xC5D,0xC5D,0xC5E,0xC5F,0xC60,0xC61,0xC61,0xC62,0xC63,0xC64,0xC64,0xC65, 0xC66,0xC67,0xC68,0xC68,0xC69,0xC6A,0xC6B,0xC6C,0xC6C,0xC6D,0xC6E,0xC6F,0xC6F,0xC70,0xC71,0xC72, 0xC73,0xC73,0xC74,0xC75,0xC76,0xC76,0xC77,0xC78,0xC79,0xC7A,0xC7A,0xC7B,0xC7C,0xC7D,0xC7D,0xC7E, 0xC7F,0xC80,0xC80,0xC81,0xC82,0xC83,0xC83,0xC84,0xC85,0xC86,0xC87,0xC87,0xC88,0xC89,0xC8A,0xC8A, 0xC8B,0xC8C,0xC8D,0xC8D,0xC8E,0xC8F,0xC90,0xC90,0xC91,0xC92,0xC93,0xC93,0xC94,0xC95,0xC96,0xC96, 0xC97,0xC98,0xC99,0xC99,0xC9A,0xC9B,0xC9C,0xC9C,0xC9D,0xC9E,0xC9F,0xC9F,0xCA0,0xCA1,0xCA1,0xCA2, 0xCA3,0xCA4,0xCA4,0xCA5,0xCA6,0xCA7,0xCA7,0xCA8,0xCA9,0xCAA,0xCAA,0xCAB,0xCAC,0xCAC,0xCAD,0xCAE, 0xCAF,0xCAF,0xCB0,0xCB1,0xCB2,0xCB2,0xCB3,0xCB4,0xCB4,0xCB5,0xCB6,0xCB7,0xCB7,0xCB8,0xCB9,0xCB9, 0xCBA,0xCBB,0xCBC,0xCBC,0xCBD,0xCBE,0xCBE,0xCBF,0xCC0,0xCC1,0xCC1,0xCC2,0xCC3,0xCC3,0xCC4,0xCC5, 0xCC6,0xCC6,0xCC7,0xCC8,0xCC8,0xCC9,0xCCA,0xCCA,0xCCB,0xCCC,0xCCD,0xCCD,0xCCE,0xCCF,0xCCF,0xCD0, 0xCD1,0xCD1,0xCD2,0xCD3,0xCD4,0xCD4,0xCD5,0xCD6,0xCD6,0xCD7,0xCD8,0xCD8,0xCD9,0xCDA,0xCDA,0xCDB, 0xCDC,0xCDC,0xCDD,0xCDE,0xCDF,0xCDF,0xCE0,0xCE1,0xCE1,0xCE2,0xCE3,0xCE3,0xCE4,0xCE5,0xCE5,0xCE6, 0xCE7,0xCE7,0xCE8,0xCE9,0xCE9,0xCEA,0xCEB,0xCEB,0xCEC,0xCED,0xCED,0xCEE,0xCEF,0xCEF,0xCF0,0xCF1, 0xCF1,0xCF2,0xCF3,0xCF3,0xCF4,0xCF5,0xCF5,0xCF6,0xCF7,0xCF7,0xCF8,0xCF9,0xCF9,0xCFA,0xCFB,0xCFB, 0xCFC,0xCFD,0xCFD,0xCFE,0xCFF,0xCFF,0xD00,0xD01,0xD01,0xD02,0xD03,0xD03,0xD04,0xD05,0xD05,0xD06, 0xD07,0xD07,0xD08,0xD09,0xD09,0xD0A,0xD0A,0xD0B,0xD0C,0xD0C,0xD0D,0xD0E,0xD0E,0xD0F,0xD10,0xD10, 0xD11,0xD12,0xD12,0xD13,0xD13,0xD14,0xD15,0xD15,0xD16,0xD17,0xD17,0xD18,0xD19,0xD19,0xD1A,0xD1A, 0xD1B,0xD1C,0xD1C,0xD1D,0xD1E,0xD1E,0xD1F,0xD1F,0xD20,0xD21,0xD21,0xD22,0xD23,0xD23,0xD24,0xD25, 0xD25,0xD26,0xD26,0xD27,0xD28,0xD28,0xD29,0xD29,0xD2A,0xD2B,0xD2B,0xD2C,0xD2D,0xD2D,0xD2E,0xD2E, 0xD2F,0xD30,0xD30,0xD31,0xD32,0xD32,0xD33,0xD33,0xD34,0xD35,0xD35,0xD36,0xD36,0xD37,0xD38,0xD38 }; public static final int CutoffMul6581_44100Hz[] = { //generated by curvegen.c 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x081, 0x086, 0x08B, 0x08F, 0x094, 0x099, 0x09D, 0x0A2, 0x0A6, 0x0AB, 0x0B0, 0x0B4, 0x0B9, 0x0BE, 0x0C2, 0x0C7, 0x0CB, 0x0D0, 0x0D5, 0x0D9, 0x0DE, 0x0E2, 0x0E7, 0x0EB, 0x0F0, 0x0F5, 0x0F9, 0x0FE, 0x102, 0x107, 0x10B, 0x110, 0x114, 0x119, 0x11D, 0x122, 0x126, 0x12B, 0x12F, 0x134, 0x138, 0x13D, 0x141, 0x146, 0x14A, 0x14F, 0x153, 0x157, 0x15C, 0x160, 0x165, 0x169, 0x16E, 0x172, 0x176, 0x17B, 0x17F, 0x183, 0x188, 0x18C, 0x191, 0x195, 0x199, 0x19E, 0x1A2, 0x1A6, 0x1AB, 0x1AF, 0x1B3, 0x1B8, 0x1BC, 0x1C0, 0x1C5, 0x1C9, 0x1CD, 0x1D2, 0x1D6, 0x1DA, 0x1DE, 0x1E3, 0x1E7, 0x1EB, 0x1EF, 0x1F4, 0x1F8, 0x1FC, 0x200, 0x205, 0x209, 0x20D, 0x211, 0x215, 0x21A, 0x21E, 0x222, 0x226, 0x22A, 0x22F, 0x233, 0x237, 0x23B, 0x23F, 0x243, 0x248, 0x24C, 0x250, 0x254, 0x258, 0x25C, 0x260, 0x265, 0x269, 0x26D, 0x271, 0x275, 0x279, 0x27D, 0x281, 0x285, 0x289, 0x28D, 0x292, 0x296, 0x29A, 0x29E, 0x2A2, 0x2A6, 0x2AA, 0x2AE, 0x2B2, 0x2B6, 0x2BA, 0x2BE, 0x2C2, 0x2C6, 0x2CA, 0x2CE, 0x2D2, 0x2D6, 0x2DA, 0x2DE, 0x2E2, 0x2E6, 0x2EA, 0x2EE, 0x2F2, 0x2F6, 0x2FA, 0x2FD, 0x301, 0x305, 0x309, 0x30D, 0x311, 0x315, 0x319, 0x31D, 0x321, 0x325, 0x328, 0x32C, 0x330, 0x334, 0x338, 0x33C, 0x340, 0x344, 0x347, 0x34B, 0x34F, 0x353, 0x357, 0x35B, 0x35E, 0x362, 0x366, 0x36A, 0x36E, 0x371, 0x375, 0x379, 0x37D, 0x381, 0x384, 0x388, 0x38C, 0x390, 0x393, 0x397, 0x39B, 0x39F, 0x3A2, 0x3A6, 0x3AA, 0x3AE, 0x3B1, 0x3B5, 0x3B9, 0x3BD, 0x3C0, 0x3C4, 0x3C8, 0x3CB, 0x3CF, 0x3D3, 0x3D6, 0x3DA, 0x3DE, 0x3E1, 0x3E5, 0x3E9, 0x3EC, 0x3F0, 0x3F4, 0x3F7, 0x3FB, 0x3FF, 0x402, 0x406, 0x409, 0x40D, 0x411, 0x414, 0x418, 0x41B, 0x41F, 0x423, 0x426, 0x42A, 0x42D, 0x431, 0x435, 0x438, 0x43C, 0x43F, 0x443, 0x446, 0x44A, 0x44D, 0x451, 0x455, 0x458, 0x45C, 0x45F, 0x463, 0x466, 0x46A, 0x46D, 0x471, 0x474, 0x478, 0x47B, 0x47F, 0x482, 0x486, 0x489, 0x48C, 0x490, 0x493, 0x497, 0x49A, 0x49E, 0x4A1, 0x4A5, 0x4A8, 0x4AB, 0x4AF, 0x4B2, 0x4B6, 0x4B9, 0x4BD, 0x4C0, 0x4C3, 0x4C7, 0x4CA, 0x4CE, 0x4D1, 0x4D4, 0x4D8, 0x4DB, 0x4DE, 0x4E2, 0x4E5, 0x4E8, 0x4EC, 0x4EF, 0x4F3, 0x4F6, 0x4F9, 0x4FD, 0x500, 0x503, 0x507, 0x50A, 0x50D, 0x510, 0x514, 0x517, 0x51A, 0x51E, 0x521, 0x524, 0x528, 0x52B, 0x52E, 0x531, 0x535, 0x538, 0x53B, 0x53E, 0x542, 0x545, 0x548, 0x54B, 0x54F, 0x552, 0x555, 0x558, 0x55B, 0x55F, 0x562, 0x565, 0x568, 0x56C, 0x56F, 0x572, 0x575, 0x578, 0x57B, 0x57F, 0x582, 0x585, 0x588, 0x58B, 0x58F, 0x592, 0x595, 0x598, 0x59B, 0x59E, 0x5A1, 0x5A5, 0x5A8, 0x5AB, 0x5AE, 0x5B1, 0x5B4, 0x5B7, 0x5BA, 0x5BD, 0x5C1, 0x5C4, 0x5C7, 0x5CA, 0x5CD, 0x5D0, 0x5D3, 0x5D6, 0x5D9, 0x5DC, 0x5DF, 0x5E2, 0x5E5, 0x5E9, 0x5EC, 0x5EF, 0x5F2, 0x5F5, 0x5F8, 0x5FB, 0x5FE, 0x601, 0x604, 0x607, 0x60A, 0x60D, 0x610, 0x613, 0x616, 0x619, 0x61C, 0x61F, 0x622, 0x625, 0x628, 0x62B, 0x62E, 0x631, 0x634, 0x637, 0x63A, 0x63D, 0x640, 0x643, 0x645, 0x648, 0x64B, 0x64E, 0x651, 0x654, 0x657, 0x65A, 0x65D, 0x660, 0x663, 0x666, 0x669, 0x66B, 0x66E, 0x671, 0x674, 0x677, 0x67A, 0x67D, 0x680, 0x682, 0x685, 0x688, 0x68B, 0x68E, 0x691, 0x694, 0x696, 0x699, 0x69C, 0x69F, 0x6A2, 0x6A5, 0x6A7, 0x6AA, 0x6AD, 0x6B0, 0x6B3, 0x6B6, 0x6B8, 0x6BB, 0x6BE, 0x6C1, 0x6C4, 0x6C6, 0x6C9, 0x6CC, 0x6CF, 0x6D2, 0x6D4, 0x6D7, 0x6DA, 0x6DD, 0x6DF, 0x6E2, 0x6E5, 0x6E8, 0x6EA, 0x6ED, 0x6F0, 0x6F3, 0x6F5, 0x6F8, 0x6FB, 0x6FE, 0x700, 0x703, 0x706, 0x708, 0x70B, 0x70E, 0x711, 0x713, 0x716, 0x719, 0x71B, 0x71E, 0x721, 0x723, 0x726, 0x729, 0x72B, 0x72E, 0x731, 0x733, 0x736, 0x739, 0x73B, 0x73E, 0x741, 0x743, 0x746, 0x749, 0x74B, 0x74E, 0x750, 0x753, 0x756, 0x758, 0x75B, 0x75E, 0x760, 0x763, 0x765, 0x768, 0x76B, 0x76D, 0x770, 0x772, 0x775, 0x778, 0x77A, 0x77D, 0x77F, 0x782, 0x784, 0x787, 0x78A, 0x78C, 0x78F, 0x791, 0x794, 0x796, 0x799, 0x79B, 0x79E, 0x7A0, 0x7A3, 0x7A5, 0x7A8, 0x7AB, 0x7AD, 0x7B0, 0x7B2, 0x7B5, 0x7B7, 0x7BA, 0x7BC, 0x7BF, 0x7C1, 0x7C4, 0x7C6, 0x7C9, 0x7CB, 0x7CE, 0x7D0, 0x7D2, 0x7D5, 0x7D7, 0x7DA, 0x7DC, 0x7DF, 0x7E1, 0x7E4, 0x7E6, 0x7E9, 0x7EB, 0x7ED, 0x7F0, 0x7F2, 0x7F5, 0x7F7, 0x7FA, 0x7FC, 0x7FF, 0x801, 0x803, 0x806, 0x808, 0x80B, 0x80D, 0x80F, 0x812, 0x814, 0x817, 0x819, 0x81B, 0x81E, 0x820, 0x823, 0x825, 0x827, 0x82A, 0x82C, 0x82E, 0x831, 0x833, 0x835, 0x838, 0x83A, 0x83D, 0x83F, 0x841, 0x844, 0x846, 0x848, 0x84B, 0x84D, 0x84F, 0x852, 0x854, 0x856, 0x858, 0x85B, 0x85D, 0x85F, 0x862, 0x864, 0x866, 0x869, 0x86B, 0x86D, 0x86F, 0x872, 0x874, 0x876, 0x879, 0x87B, 0x87D, 0x87F, 0x882, 0x884, 0x886, 0x888, 0x88B, 0x88D, 0x88F, 0x892, 0x894, 0x896, 0x898, 0x89A, 0x89D, 0x89F, 0x8A1, 0x8A3, 0x8A6, 0x8A8, 0x8AA, 0x8AC, 0x8AE, 0x8B1, 0x8B3, 0x8B5, 0x8B7, 0x8BA, 0x8BC, 0x8BE, 0x8C0, 0x8C2, 0x8C4, 0x8C7, 0x8C9, 0x8CB, 0x8CD, 0x8CF, 0x8D2, 0x8D4, 0x8D6, 0x8D8, 0x8DA, 0x8DC, 0x8DF, 0x8E1, 0x8E3, 0x8E5, 0x8E7, 0x8E9, 0x8EB, 0x8EE, 0x8F0, 0x8F2, 0x8F4, 0x8F6, 0x8F8, 0x8FA, 0x8FC, 0x8FF, 0x901, 0x903, 0x905, 0x907, 0x909, 0x90B, 0x90D, 0x90F, 0x912, 0x914, 0x916, 0x918, 0x91A, 0x91C, 0x91E, 0x920, 0x922, 0x924, 0x926, 0x928, 0x92B, 0x92D, 0x92F, 0x931, 0x933, 0x935, 0x937, 0x939, 0x93B, 0x93D, 0x93F, 0x941, 0x943, 0x945, 0x947, 0x949, 0x94B, 0x94D, 0x94F, 0x951, 0x953, 0x955, 0x957, 0x959, 0x95B, 0x95D, 0x95F, 0x961, 0x963, 0x965, 0x967, 0x969, 0x96B, 0x96D, 0x96F, 0x971, 0x973, 0x975, 0x977, 0x979, 0x97B, 0x97D, 0x97F, 0x981, 0x983, 0x985, 0x987, 0x989, 0x98B, 0x98D, 0x98F, 0x991, 0x993, 0x995, 0x997, 0x999, 0x99B, 0x99C, 0x99E, 0x9A0, 0x9A2, 0x9A4, 0x9A6, 0x9A8, 0x9AA, 0x9AC, 0x9AE, 0x9B0, 0x9B2, 0x9B3, 0x9B5, 0x9B7, 0x9B9, 0x9BB, 0x9BD, 0x9BF, 0x9C1, 0x9C3, 0x9C5, 0x9C6, 0x9C8, 0x9CA, 0x9CC, 0x9CE, 0x9D0, 0x9D2, 0x9D4, 0x9D5, 0x9D7, 0x9D9, 0x9DB, 0x9DD, 0x9DF, 0x9E1, 0x9E2, 0x9E4, 0x9E6, 0x9E8, 0x9EA, 0x9EC, 0x9ED, 0x9EF, 0x9F1, 0x9F3, 0x9F5, 0x9F7, 0x9F8, 0x9FA, 0x9FC, 0x9FE, 0xA00, 0xA02, 0xA03, 0xA05, 0xA07, 0xA09, 0xA0B, 0xA0C, 0xA0E, 0xA10, 0xA12, 0xA14, 0xA15, 0xA17, 0xA19, 0xA1B, 0xA1C, 0xA1E, 0xA20, 0xA22, 0xA24, 0xA25, 0xA27, 0xA29, 0xA2B, 0xA2C, 0xA2E, 0xA30, 0xA32, 0xA33, 0xA35, 0xA37, 0xA39, 0xA3A, 0xA3C, 0xA3E, 0xA40, 0xA41, 0xA43, 0xA45, 0xA47, 0xA48, 0xA4A, 0xA4C, 0xA4E, 0xA4F, 0xA51, 0xA53, 0xA54, 0xA56, 0xA58, 0xA5A, 0xA5B, 0xA5D, 0xA5F, 0xA60, 0xA62, 0xA64, 0xA65, 0xA67, 0xA69, 0xA6B, 0xA6C, 0xA6E, 0xA70, 0xA71, 0xA73, 0xA75, 0xA76, 0xA78, 0xA7A, 0xA7B, 0xA7D, 0xA7F, 0xA80, 0xA82, 0xA84, 0xA85, 0xA87, 0xA89, 0xA8A, 0xA8C, 0xA8E, 0xA8F, 0xA91, 0xA92, 0xA94, 0xA96, 0xA97, 0xA99, 0xA9B, 0xA9C, 0xA9E, 0xAA0, 0xAA1, 0xAA3, 0xAA4, 0xAA6, 0xAA8, 0xAA9, 0xAAB, 0xAAC, 0xAAE, 0xAB0, 0xAB1, 0xAB3, 0xAB5, 0xAB6, 0xAB8, 0xAB9, 0xABB, 0xABC, 0xABE, 0xAC0, 0xAC1, 0xAC3, 0xAC4, 0xAC6, 0xAC8, 0xAC9, 0xACB, 0xACC, 0xACE, 0xACF, 0xAD1, 0xAD3, 0xAD4, 0xAD6, 0xAD7, 0xAD9, 0xADA, 0xADC, 0xADE, 0xADF, 0xAE1, 0xAE2, 0xAE4, 0xAE5, 0xAE7, 0xAE8, 0xAEA, 0xAEB, 0xAED, 0xAEE, 0xAF0, 0xAF2, 0xAF3, 0xAF5, 0xAF6, 0xAF8, 0xAF9, 0xAFB, 0xAFC, 0xAFE, 0xAFF, 0xB01, 0xB02, 0xB04, 0xB05, 0xB07, 0xB08, 0xB0A, 0xB0B, 0xB0D, 0xB0E, 0xB10, 0xB11, 0xB13, 0xB14, 0xB16, 0xB17, 0xB19, 0xB1A, 0xB1C, 0xB1D, 0xB1F, 0xB20, 0xB22, 0xB23, 0xB24, 0xB26, 0xB27, 0xB29, 0xB2A, 0xB2C, 0xB2D, 0xB2F, 0xB30, 0xB32, 0xB33, 0xB35, 0xB36, 0xB37, 0xB39, 0xB3A, 0xB3C, 0xB3D, 0xB3F, 0xB40, 0xB42, 0xB43, 0xB44, 0xB46, 0xB47, 0xB49, 0xB4A, 0xB4C, 0xB4D, 0xB4E, 0xB50, 0xB51, 0xB53, 0xB54, 0xB55, 0xB57, 0xB58, 0xB5A, 0xB5B, 0xB5C, 0xB5E, 0xB5F, 0xB61, 0xB62, 0xB63, 0xB65, 0xB66, 0xB68, 0xB69, 0xB6A, 0xB6C, 0xB6D, 0xB6F, 0xB70, 0xB71, 0xB73, 0xB74, 0xB75, 0xB77, 0xB78, 0xB7A, 0xB7B, 0xB7C, 0xB7E, 0xB7F, 0xB80, 0xB82, 0xB83, 0xB84, 0xB86, 0xB87, 0xB89, 0xB8A, 0xB8B, 0xB8D, 0xB8E, 0xB8F, 0xB91, 0xB92, 0xB93, 0xB95, 0xB96, 0xB97, 0xB99, 0xB9A, 0xB9B, 0xB9D, 0xB9E, 0xB9F, 0xBA1, 0xBA2, 0xBA3, 0xBA5, 0xBA6, 0xBA7, 0xBA8, 0xBAA, 0xBAB, 0xBAC, 0xBAE, 0xBAF, 0xBB0, 0xBB2, 0xBB3, 0xBB4, 0xBB6, 0xBB7, 0xBB8, 0xBB9, 0xBBB, 0xBBC, 0xBBD, 0xBBF, 0xBC0, 0xBC1, 0xBC2, 0xBC4, 0xBC5, 0xBC6, 0xBC8, 0xBC9, 0xBCA, 0xBCB, 0xBCD, 0xBCE, 0xBCF, 0xBD0, 0xBD2, 0xBD3, 0xBD4, 0xBD5, 0xBD7, 0xBD8, 0xBD9, 0xBDB, 0xBDC, 0xBDD, 0xBDE, 0xBE0, 0xBE1, 0xBE2, 0xBE3, 0xBE4, 0xBE6, 0xBE7, 0xBE8, 0xBE9, 0xBEB, 0xBEC, 0xBED, 0xBEE, 0xBF0, 0xBF1, 0xBF2, 0xBF3, 0xBF5, 0xBF6, 0xBF7, 0xBF8, 0xBF9, 0xBFB, 0xBFC, 0xBFD, 0xBFE, 0xBFF, 0xC01, 0xC02, 0xC03, 0xC04, 0xC05, 0xC07, 0xC08, 0xC09, 0xC0A, 0xC0B, 0xC0D, 0xC0E, 0xC0F, 0xC10, 0xC11, 0xC13, 0xC14, 0xC15, 0xC16, 0xC17, 0xC19, 0xC1A, 0xC1B, 0xC1C, 0xC1D, 0xC1E, 0xC20, 0xC21, 0xC22, 0xC23, 0xC24, 0xC25, 0xC27, 0xC28, 0xC29, 0xC2A, 0xC2B, 0xC2C, 0xC2E, 0xC2F, 0xC30, 0xC31, 0xC32, 0xC33, 0xC34, 0xC36, 0xC37, 0xC38, 0xC39, 0xC3A, 0xC3B, 0xC3C, 0xC3E, 0xC3F, 0xC40, 0xC41, 0xC42, 0xC43, 0xC44, 0xC46, 0xC47, 0xC48, 0xC49, 0xC4A, 0xC4B, 0xC4C, 0xC4D, 0xC4F, 0xC50, 0xC51, 0xC52, 0xC53, 0xC54, 0xC55, 0xC56, 0xC57, 0xC59, 0xC5A, 0xC5B, 0xC5C, 0xC5D, 0xC5E, 0xC5F, 0xC60, 0xC61, 0xC62, 0xC63, 0xC65, 0xC66, 0xC67, 0xC68, 0xC69, 0xC6A, 0xC6B, 0xC6C, 0xC6D, 0xC6E, 0xC6F, 0xC71, 0xC72, 0xC73, 0xC74, 0xC75, 0xC76, 0xC77, 0xC78, 0xC79, 0xC7A, 0xC7B, 0xC7C, 0xC7D, 0xC7E, 0xC7F, 0xC81, 0xC82, 0xC83, 0xC84, 0xC85, 0xC86, 0xC87, 0xC88, 0xC89, 0xC8A, 0xC8B, 0xC8C, 0xC8D, 0xC8E, 0xC8F, 0xC90, 0xC91, 0xC92, 0xC93, 0xC94, 0xC95, 0xC96, 0xC97, 0xC99, 0xC9A, 0xC9B, 0xC9C, 0xC9D, 0xC9E, 0xC9F, 0xCA0, 0xCA1, 0xCA2, 0xCA3, 0xCA4, 0xCA5, 0xCA6, 0xCA7, 0xCA8, 0xCA9, 0xCAA, 0xCAB, 0xCAC, 0xCAD, 0xCAE, 0xCAF, 0xCB0, 0xCB1, 0xCB2, 0xCB3, 0xCB4, 0xCB5, 0xCB6, 0xCB7, 0xCB8, 0xCB9, 0xCBA, 0xCBB, 0xCBC, 0xCBD, 0xCBE, 0xCBF, 0xCC0, 0xCC1, 0xCC2, 0xCC3, 0xCC4, 0xCC5, 0xCC6, 0xCC7, 0xCC8, 0xCC9, 0xCCA, 0xCCA, 0xCCB, 0xCCC, 0xCCD, 0xCCE, 0xCCF, 0xCD0, 0xCD1, 0xCD2, 0xCD3, 0xCD4, 0xCD5, 0xCD6, 0xCD7, 0xCD8, 0xCD9, 0xCDA, 0xCDB, 0xCDC, 0xCDD, 0xCDE, 0xCDF, 0xCE0, 0xCE0, 0xCE1, 0xCE2, 0xCE3, 0xCE4, 0xCE5, 0xCE6, 0xCE7, 0xCE8, 0xCE9, 0xCEA, 0xCEB, 0xCEC, 0xCED, 0xCEE, 0xCEF, 0xCEF, 0xCF0, 0xCF1, 0xCF2, 0xCF3, 0xCF4, 0xCF5, 0xCF6, 0xCF7, 0xCF8, 0xCF9, 0xCFA, 0xCFA, 0xCFB, 0xCFC, 0xCFD, 0xCFE, 0xCFF, 0xD00, 0xD01, 0xD02, 0xD03, 0xD04, 0xD04, 0xD05, 0xD06, 0xD07, 0xD08, 0xD09, 0xD0A, 0xD0B, 0xD0C, 0xD0D, 0xD0D, 0xD0E, 0xD0F, 0xD10, 0xD11, 0xD12, 0xD13, 0xD14, 0xD15, 0xD15, 0xD16, 0xD17, 0xD18, 0xD19, 0xD1A, 0xD1B, 0xD1C, 0xD1C, 0xD1D, 0xD1E, 0xD1F, 0xD20, 0xD21, 0xD22, 0xD23, 0xD23, 0xD24, 0xD25, 0xD26, 0xD27, 0xD28, 0xD29, 0xD29, 0xD2A, 0xD2B, 0xD2C, 0xD2D, 0xD2E, 0xD2F, 0xD2F, 0xD30, 0xD31, 0xD32, 0xD33, 0xD34, 0xD34, 0xD35, 0xD36, 0xD37, 0xD38, 0xD39, 0xD3A, 0xD3A, 0xD3B, 0xD3C, 0xD3D, 0xD3E, 0xD3F, 0xD3F, 0xD40, 0xD41, 0xD42, 0xD43, 0xD44, 0xD44, 0xD45, 0xD46, 0xD47, 0xD48, 0xD48, 0xD49, 0xD4A, 0xD4B, 0xD4C, 0xD4D, 0xD4D, 0xD4E, 0xD4F, 0xD50, 0xD51, 0xD51, 0xD52, 0xD53, 0xD54, 0xD55, 0xD55, 0xD56, 0xD57, 0xD58, 0xD59, 0xD5A, 0xD5A, 0xD5B, 0xD5C, 0xD5D, 0xD5D, 0xD5E, 0xD5F, 0xD60, 0xD61, 0xD61, 0xD62, 0xD63, 0xD64, 0xD65, 0xD65, 0xD66, 0xD67, 0xD68, 0xD69, 0xD69, 0xD6A, 0xD6B, 0xD6C, 0xD6C, 0xD6D, 0xD6E, 0xD6F, 0xD70, 0xD70, 0xD71, 0xD72, 0xD73, 0xD73, 0xD74, 0xD75, 0xD76, 0xD77, 0xD77, 0xD78, 0xD79, 0xD7A, 0xD7A, 0xD7B, 0xD7C, 0xD7D, 0xD7D, 0xD7E, 0xD7F, 0xD80, 0xD80, 0xD81, 0xD82, 0xD83, 0xD83, 0xD84, 0xD85, 0xD86, 0xD86, 0xD87, 0xD88, 0xD89, 0xD89, 0xD8A, 0xD8B, 0xD8C, 0xD8C, 0xD8D, 0xD8E, 0xD8F, 0xD8F, 0xD90, 0xD91, 0xD92, 0xD92, 0xD93, 0xD94, 0xD94, 0xD95, 0xD96, 0xD97, 0xD97, 0xD98, 0xD99, 0xD9A, 0xD9A, 0xD9B, 0xD9C, 0xD9C, 0xD9D, 0xD9E, 0xD9F, 0xD9F, 0xDA0, 0xDA1, 0xDA1, 0xDA2, 0xDA3, 0xDA4, 0xDA4, 0xDA5, 0xDA6, 0xDA6, 0xDA7, 0xDA8, 0xDA9, 0xDA9, 0xDAA, 0xDAB, 0xDAB, 0xDAC, 0xDAD, 0xDAE, 0xDAE, 0xDAF, 0xDB0, 0xDB0, 0xDB1, 0xDB2, 0xDB2, 0xDB3, 0xDB4, 0xDB5, 0xDB5, 0xDB6, 0xDB7, 0xDB7, 0xDB8, 0xDB9, 0xDB9, 0xDBA, 0xDBB, 0xDBB, 0xDBC, 0xDBD, 0xDBD, 0xDBE, 0xDBF, 0xDC0, 0xDC0, 0xDC1, 0xDC2, 0xDC2, 0xDC3, 0xDC4, 0xDC4, 0xDC5, 0xDC6, 0xDC6, 0xDC7, 0xDC8, 0xDC8, 0xDC9, 0xDCA, 0xDCA, 0xDCB, 0xDCC, 0xDCC, 0xDCD, 0xDCE, 0xDCE, 0xDCF, 0xDD0, 0xDD0, 0xDD1, 0xDD2, 0xDD2, 0xDD3, 0xDD4, 0xDD4, 0xDD5, 0xDD6, 0xDD6, 0xDD7, 0xDD8, 0xDD8, 0xDD9, 0xDD9, 0xDDA, 0xDDB, 0xDDB, 0xDDC, 0xDDD, 0xDDD, 0xDDE, 0xDDF, 0xDDF, 0xDE0, 0xDE1, 0xDE1, 0xDE2, 0xDE2, 0xDE3, 0xDE4, 0xDE4, 0xDE5, 0xDE6, 0xDE6, 0xDE7, 0xDE8, 0xDE8, 0xDE9, 0xDE9, 0xDEA, 0xDEB, 0xDEB, 0xDEC, 0xDED, 0xDED, 0xDEE, 0xDEE, 0xDEF, 0xDF0, 0xDF0, 0xDF1, 0xDF2, 0xDF2, 0xDF3, 0xDF3, 0xDF4, 0xDF5, 0xDF5, 0xDF6, 0xDF7, 0xDF7, 0xDF8, 0xDF8, 0xDF9, 0xDFA, 0xDFA, 0xDFB, 0xDFB, 0xDFC, 0xDFD, 0xDFD, 0xDFE, 0xDFE, 0xDFF, 0xE00, 0xE00, 0xE01, 0xE02, 0xE02, 0xE03, 0xE03, 0xE04, 0xE05, 0xE05, 0xE06, 0xE06, 0xE07, 0xE08, 0xE08, 0xE09, 0xE09, 0xE0A, 0xE0A, 0xE0B, 0xE0C, 0xE0C, 0xE0D, 0xE0D, 0xE0E, 0xE0F, 0xE0F, 0xE10, 0xE10, 0xE11, 0xE12, 0xE12, 0xE13, 0xE13, 0xE14, 0xE14, 0xE15, 0xE16, 0xE16, 0xE17, 0xE17, 0xE18, 0xE18, 0xE19, 0xE1A, 0xE1A, 0xE1B, 0xE1B, 0xE1C, 0xE1C, 0xE1D, 0xE1E, 0xE1E, 0xE1F, 0xE1F, 0xE20, 0xE20, 0xE21, 0xE22, 0xE22, 0xE23, 0xE23, 0xE24, 0xE24, 0xE25, 0xE26, 0xE26, 0xE27, 0xE27, 0xE28, 0xE28, 0xE29, 0xE29, 0xE2A, 0xE2B, 0xE2B, 0xE2C, 0xE2C, 0xE2D, 0xE2D, 0xE2E, 0xE2E, 0xE2F, 0xE30, 0xE30, 0xE31, 0xE31, 0xE32, 0xE32, 0xE33, 0xE33, 0xE34, 0xE34, 0xE35, 0xE36, 0xE36, 0xE37, 0xE37, 0xE38, 0xE38, 0xE39, 0xE39, 0xE3A, 0xE3A, 0xE3B, 0xE3B, 0xE3C, 0xE3C, 0xE3D, 0xE3E, 0xE3E, 0xE3F, 0xE3F, 0xE40, 0xE40, 0xE41, 0xE41, 0xE42, 0xE42, 0xE43, 0xE43, 0xE44, 0xE44 }; //SID-tables: combined waveform,etc. (Keep them static because they're included locally inside the wave-generator function.) public static final int ADSR_DAC_6581[] = { 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x09, 0x09, 0x0B, 0x0B, 0x0D, 0x0D, 0x0F, 0x10, 0x12, 0x11, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x1A, 0x1A, 0x1C, 0x1C, 0x1E, 0x1E, 0x20, 0x21, 0x23, //used at output of ADSR envelope generator 0x21, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x2A, 0x2A, 0x2C, 0x2C, 0x2E, 0x2E, 0x30, 0x31, 0x33, //(not used for wave-generator because of 8bit-only resolution) 0x32, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3B, 0x3B, 0x3D, 0x3D, 0x3F, 0x3F, 0x41, 0x42, 0x44, 0x40, 0x42, 0x42, 0x44, 0x44, 0x46, 0x47, 0x49, 0x49, 0x4A, 0x4B, 0x4D, 0x4D, 0x4F, 0x50, 0x52, 0x51, 0x53, 0x53, 0x55, 0x55, 0x57, 0x58, 0x5A, 0x5A, 0x5B, 0x5C, 0x5E, 0x5E, 0x60, 0x61, 0x63, 0x61, 0x62, 0x63, 0x65, 0x65, 0x67, 0x68, 0x6A, 0x69, 0x6B, 0x6C, 0x6E, 0x6E, 0x70, 0x71, 0x73, 0x72, 0x73, 0x74, 0x76, 0x76, 0x78, 0x79, 0x7B, 0x7A, 0x7C, 0x7D, 0x7F, 0x7F, 0x81, 0x82, 0x84, 0x7B, 0x7D, 0x7E, 0x80, 0x80, 0x82, 0x83, 0x85, 0x84, 0x86, 0x87, 0x89, 0x89, 0x8B, 0x8C, 0x8D, 0x8C, 0x8E, 0x8F, 0x91, 0x91, 0x93, 0x94, 0x96, 0x95, 0x97, 0x98, 0x9A, 0x9A, 0x9C, 0x9D, 0x9E, 0x9C, 0x9E, 0x9F, 0xA1, 0xA1, 0xA3, 0xA4, 0xA5, 0xA5, 0xA7, 0xA8, 0xAA, 0xAA, 0xAC, 0xAC, 0xAE, 0xAD, 0xAF, 0xB0, 0xB2, 0xB2, 0xB4, 0xB5, 0xB6, 0xB6, 0xB8, 0xB9, 0xBB, 0xBB, 0xBD, 0xBD, 0xBF, 0xBB, 0xBD, 0xBE, 0xC0, 0xC0, 0xC2, 0xC2, 0xC4, 0xC4, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCD, 0xCC, 0xCE, 0xCF, 0xD1, 0xD1, 0xD3, 0xD3, 0xD5, 0xD5, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDE, 0xDC, 0xDE, 0xDF, 0xE1, 0xE1, 0xE3, 0xE3, 0xE5, 0xE5, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xEE, 0xED, 0xEF, 0xF0, 0xF2, 0xF2, 0xF4, 0xF4, 0xF6, 0xF6, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFF }; /** * Construct the SID * * @param c64 the reference to C64 * @param model the model of the SID * @param channel the channel for wav output * @param baseAddress base address of SID im memory */ public SID(C64 c64, int model, int channel, int baseAddress) { this.c64 = c64; chipModel = model; this.channel = channel; this.baseAddress=baseAddress; if (baseAddress >= 0xD400 && (baseAddress < 0xD800 || (0xDE00 <= baseAddress && baseAddress <= 0xDFE0))) { //check valid address, avoid Color-RAM this.baseAddress = baseAddress; basePtr = c64.ioBankWR; } else { this.baseAddress = 0x0000; basePtr = null; } initChip(); } /** * Init SID chip */ void initChip() { for (int channel = 0; channel < 21; channel += 7) { adsrState[channel] = 0; rateCounter[channel] = 0; envelopeCounter[channel] = 0; exponentCounter[channel] = 0; phaseAccu[channel] = 0; prevPhaseAccu[channel] = 0; noiseLFSR[channel] = 0x7FFFFF; prevWavGenOut[channel] = 0; prevWavData[channel] = 0; } syncSourceMSBrise = false; ringSourceMSB = 0; prevLowPass = prevBandPass = prevVolume = 0; } /** * Emulate the ADSR * * @param cycles the processor cycles */ public void emulateADSRs(int cycles) { int prevGate, AD, SR; int prescalePeriod; for (int channel = 0; channel < 21; channel += 7) { AD = basePtr[5+channel+baseAddress]; SR = basePtr[6+channel+baseAddress]; //ADSRstatePtr = adsrState[channel]; //RateCounterPtr = rateCounter[channel]; //EnvelopeCounterPtr = envelopeCounter[channel]; //ExponentCounterPtr = exponentCounter[channel]; prevGate = (adsrState[channel] & GATE_BITVAL); if (prevGate != (basePtr[4+channel+baseAddress] & GATE_BITVAL)) { //gatebit-change? if ((prevGate != 0)) { adsrState[channel] &= ~(GATE_BITVAL | ATTACK_BITVAL | DECAYSUSTAIN_BITVAL); //falling edge } else { adsrState[channel] = (GATE_BITVAL | ATTACK_BITVAL | DECAYSUSTAIN_BITVAL | HOLDZEROn_BITVAL); //rising edge } } if ((adsrState[channel] & ATTACK_BITVAL) != 0) { prescalePeriod = ADSRprescalePeriods[AD >> 4]; } else if ((adsrState[channel] & DECAYSUSTAIN_BITVAL) != 0) { prescalePeriod = ADSRprescalePeriods[AD & 0x0F]; } else { prescalePeriod = ADSRprescalePeriods[SR & 0x0F]; } rateCounter[channel] += cycles; if (rateCounter[channel] >= 0x8000) { rateCounter[channel] -= 0x8000; //*RateCounterPtr &= 0x7FFF; //can wrap around (ADSR delay-bug: short 1st frame) } //ratecounter shot (matches rateperiod) (in genuine sid ratecounter is LFSR) if (prescalePeriod <= rateCounter[channel] && rateCounter[channel] < prescalePeriod + cycles) { rateCounter[channel] -= prescalePeriod; //reset rate-counter on period-match if ((adsrState[channel] & ATTACK_BITVAL) != 0 || ++(exponentCounter[channel]) == ADSRexponentPeriods[envelopeCounter[channel]]) { exponentCounter[channel] = 0; if ((adsrState[channel] & HOLDZEROn_BITVAL) != 0) { if ((adsrState[channel] & ATTACK_BITVAL) != 0) { ++(envelopeCounter[channel]); envelopeCounter[channel]&=0xFF; if (envelopeCounter[channel] == 0xFF) { adsrState[channel] &= ~ATTACK_BITVAL; } } else if (!((adsrState[channel] & DECAYSUSTAIN_BITVAL) != 0) || envelopeCounter[channel] != (SR & 0xF0) + (SR >> 4)) { --envelopeCounter[channel]; //resid adds 1 cycle delay, we omit that mechanism here envelopeCounter[channel]&=0xFF; if (envelopeCounter[channel] == 0) { adsrState[channel] &= ~HOLDZEROn_BITVAL; } } } } } } } /** * Emulate the waveforms * * @return the output wave value */ public int emulateWaves () { int WF, envelope, filterSwitchReso, volumeBand; int utmp, phaseAccuStep, MSB, wavGenOut, PW; int tmp, steepness, pulsePeak; boolean testBit; boolean feedback; wavGenOut=0; //// nonFiltedSample = filterInputSample = 0; filterSwitchReso = basePtr[0x17+baseAddress]; volumeBand=basePtr[0x18+baseAddress]; //Waveform-generator //(phase accumulator and waveform-selector) for (int channel = 0; channel < 21; channel += 7) { WF = basePtr[4 + channel + baseAddress]; testBit = (WF & TEST_BITVAL) != 0; //PhaseAccuPtr = phaseAccu[channel]; phaseAccuStep = ((basePtr[1 + channel + baseAddress] << 8) + basePtr[0 + channel + baseAddress]) * c64.sampleClockRatio; if (testBit || (((WF & SYNC_BITVAL) != 0) && syncSourceMSBrise)) { phaseAccu[channel] = 0; } else { //stepping phase-accumulator (oscillator) phaseAccu[channel] += phaseAccuStep; if (phaseAccu[channel] >= 0x10000000) { phaseAccu[channel] -= 0x10000000; } } phaseAccu[channel] &= 0xFFFFFFF; MSB = phaseAccu[channel] & 0x8000000; syncSourceMSBrise = (MSB > (prevPhaseAccu[channel] & 0x8000000)); if ((WF & NOISE_BITVAL) != 0) { //noise waveform tmp = noiseLFSR[channel]; //clock LFSR all time if clockrate exceeds observable at given samplerate (last term): if (((phaseAccu[channel] & 0x1000000) != (prevPhaseAccu[channel] & 0x1000000)) || phaseAccuStep >= 0x1000000) { feedback = ((tmp & 0x400000) ^ ((tmp & 0x20000) << 5)) != 0; tmp = ((tmp << 1) | (feedback ? 1 : 0) | (testBit ? 1 : 0)) & 0x7FFFFF; //TEST-bit turns all bits in noise LFSR to 1 (on real sid slowly, in approx. 8000 microseconds ~ 300 samples) noiseLFSR[channel] = tmp; } //we simply zero output when other waveform is mixed with noise. On real sid LFSR continuously gets filled by zero and locks up. ($C1 waveform with pw<8 can keep it for a while.) wavGenOut = (WF & 0x70) != 0 ? 0 : ((tmp & 0x100000) >> 5) | ((tmp & 0x40000) >> 4) | ((tmp & 0x4000) >> 1) | ((tmp & 0x800) << 1) | ((tmp & 0x200) << 2) | ((tmp & 0x20) << 5) | ((tmp & 0x04) << 7) | ((tmp & 0x01) << 8); } else if ((WF & PULSE_BITVAL) != 0) { //simple pulse PW = (((basePtr[3 + channel + baseAddress] & 0xF) << 8) + basePtr[2 + channel + baseAddress]) << 4; //PW=0000..FFF0 from sid-register utmp = (int) (phaseAccuStep >> 13); if (0 < PW && PW < utmp) { PW = utmp; //Too thin pulsewidth? Correct... } utmp ^= 0xFFFF; if (PW > utmp) { PW = utmp; //Too thin pulsewidth? Correct it to a value representable at the current samplerate } utmp = phaseAccu[channel] >> 12; if ((WF & 0xF0) == PULSE_BITVAL) { //simple pulse, most often used waveform, make it sound as clean as possible (by making it trapezoid) steepness = (phaseAccuStep >= 4096) ? 0xFFFFFFF / phaseAccuStep : 0xFFFF; //rising/falling-edge steepness (add/sub at samples) if (testBit) { wavGenOut = 0xFFFF; } else if (utmp < PW) { //rising edge (interpolation) pulsePeak = (0xFFFF - PW) * steepness; //very thin pulses don't make a full swing between 0 and max but make a little spike if (pulsePeak > 0xFFFF) { pulsePeak = 0xFFFF; //but adequately thick trapezoid pulses reach the maximum level } tmp = pulsePeak - (PW - utmp) * steepness; //draw the slope from the peak wavGenOut = (tmp < 0) ? 0 : tmp; //but stop at 0-level } else { //falling edge (interpolation) pulsePeak = PW * steepness; //very thin pulses don't make a full swing between 0 and max but make a little spike if (pulsePeak > 0xFFFF) { pulsePeak = 0xFFFF; //adequately thick trapezoid pulses reach the maximum level } tmp = (0xFFFF - utmp) * steepness - pulsePeak; //draw the slope from the peak wavGenOut = (tmp >= 0) ? 0xFFFF : tmp; //but stop at max-level } } else { //combined pulse wavGenOut = (utmp >= PW || testBit) ? 0xFFFF : 0; if ((WF & TRI_BITVAL) != 0) { if ((WF & SAW_BITVAL) != 0) { //pulse+saw+triangle (waveform nearly identical to tri+saw) if (wavGenOut != 0) { wavGenOut = combinedWF(PulseSawTriangle, utmp); } } else { //pulse+triangle tmp = phaseAccu[channel] ^ ((WF & RING_BITVAL) != 0 ? ringSourceMSB : 0); if (wavGenOut != 0) { wavGenOut = combinedWF(PulseTriangle, tmp >> 12); } } } else if ((WF & SAW_BITVAL) != 0) { //pulse+saw if (wavGenOut != 0) { wavGenOut = combinedWF(PulseSawtooth, utmp); } } } } else if ((WF & SAW_BITVAL) != 0) { //sawtooth wavGenOut = phaseAccu[channel] >> 12; //saw (this row would be enough for simple but aliased-at-high-pitch saw) if ((WF & TRI_BITVAL) != 0) { wavGenOut = combinedWF(SawTriangle, wavGenOut); //saw+triangle } else { //simple cleaned (bandlimited) saw steepness = (phaseAccuStep >> 4) / 288; if (steepness == 0) { steepness = 1; //avoid division by zero in next steps } wavGenOut += (wavGenOut * steepness) >> 16; //1st half (rising edge) of asymmetric triangle-like saw waveform if (wavGenOut > 0xFFFF) { wavGenOut = 0xFFFF - (((wavGenOut - 0x10000) << 16) / steepness); //2nd half (falling edge, reciprocal steepness) } } } else if ((WF & TRI_BITVAL) != 0) { //triangle (this waveform has no harsh edges, so it doesn't suffer from strong aliasing at high pitches) tmp = phaseAccu[channel] ^ ((WF & RING_BITVAL) != 0 ? ringSourceMSB : 0); wavGenOut = (tmp ^ ((tmp & 0x8000000) != 0 ? 0xFFFFFFF : 0)) >> 11; } wavGenOut &= 0xFFFF; if ((WF & 0xF0) != 0) { prevWavGenOut[channel] = wavGenOut; //emulate waveform 00 floating wave-DAC (utilized by SounDemon digis) } else { wavGenOut = prevWavGenOut[channel]; //(on real sid waveform00 decays, we just simply keep the value to avoid clicks) } prevPhaseAccu[channel] = phaseAccu[channel]; ringSourceMSB = MSB; // check if one voice is to be muted if ((muteVoice1 && channel==0) || (muteVoice2 && channel==7) || (muteVoice3 && channel==14) ) continue; //routing the channel signal to either the filter or the unfiltered master output depending on filter-switch sid-registers envelope = chipModel == 8580 ? envelopeCounter[channel] : ADSR_DAC_6581[envelopeCounter[channel]]; if ((filterSwitchReso & FilterSwitchVal[channel]) != 0) { filterInputSample += (((int) wavGenOut - 0x8000) * envelope) >> 8; } else if (channel != 14 || !((volumeBand & OFF3_BITVAL) != 0)) { nonFiltedSample += (((int) wavGenOut - 0x8000) * envelope) >> 8; } } //update readable SID1-registers (some sid tunes might use 3rd channel ENV3/OSC3 value as control) c64.ioBankRD[baseAddress + 0x1B] = (wavGenOut >> 8); //OSC3, ENV3 (some players rely on it, unfortunately even for timing) c64.ioBankRD[baseAddress + 0x1C] = envelopeCounter[14]; //Envelope return emulateSIDoutputStage(); } SIDwavOutput emulateHQwaves (int cycles) { SIDwavOutput sidWavOutput=new SIDwavOutput(); int WF, Envelope, FilterSwitchReso, VolumeBand; int utmp, phaseAccuStep, MSB, WavGenOut, PW; int tmp; boolean feedback; boolean testBit; //static int filterInput, cutoff, resonance; //, filterOutput, nonFilted, output; WavGenOut=0; //// sidWavOutput.filterInput = sidWavOutput.nonFilted = 0; FilterSwitchReso = basePtr[0x17+baseAddress]; VolumeBand = basePtr[0x18+baseAddress]; for (int channel = 0; channel < 21; channel += 7) { WF = basePtr[4+channel+baseAddress]; testBit = (WF & TEST_BITVAL)!=0; //PhaseAccuPtr = phaseAccu[channel]; phaseAccuStep = ((basePtr[1+channel+baseAddress] << 8) + basePtr[0+channel+baseAddress]) * cycles; if (testBit || (((WF & SYNC_BITVAL)!=0) && syncSourceMSBrise)) { phaseAccu[channel] = 0; } else { //stepping phase-accumulator (oscillator) phaseAccu[channel] += phaseAccuStep; if ( phaseAccu[channel] >= 0x1000000) { phaseAccu[channel] -= 0x1000000; } } phaseAccu[channel] &= 0xFFFFFF; MSB = phaseAccu[channel] & 0x800000; syncSourceMSBrise = (MSB > (prevPhaseAccu[channel] & 0x800000)); if ((WF & NOISE_BITVAL)!=0) { //noise waveform tmp = noiseLFSR[channel]; //clock LFSR all time if clockrate exceeds observable at given samplerate (last term): if ((( phaseAccu[channel] & 0x100000) != (prevPhaseAccu[channel] & 0x100000))) { feedback = (((tmp & 0x400000) ^ ((tmp & 0x20000) << 5)) != 0); tmp = ((tmp << 1) | (feedback?1:0) | (testBit?1:0)) & 0x7FFFFF; //TEST-bit turns all bits in noise LFSR to 1 (on real SID slowly, in approx. 8000 microseconds ~ 300 samples) noiseLFSR[channel] = tmp; } //we simply zero output when other waveform is mixed with noise. On real SID LFSR continuously gets filled by zero and locks up. ($C1 waveform with pw<8 can keep it for a while.) WavGenOut = (WF & 0x70)!=0 ? 0 : ((tmp & 0x100000) >> 5) | ((tmp & 0x40000) >> 4) | ((tmp & 0x4000) >> 1) | ((tmp & 0x800) << 1) | ((tmp & 0x200) << 2) | ((tmp & 0x20) << 5) | ((tmp & 0x04) << 7) | ((tmp & 0x01) << 8); } else if ((WF & PULSE_BITVAL)!=0) { //simple pulse or pulse+combined PW = (((basePtr[3+channel+baseAddress] & 0xF) << 8) + basePtr[2+channel+baseAddress]) << 4; //PW=0000..FFF0 from SID-register utmp = phaseAccu[channel] >> 8; WavGenOut = (utmp >= PW || testBit) ? 0xFFFF : 0; if ((WF & 0xF0) != PULSE_BITVAL) { //combined pulse if ((WF & TRI_BITVAL)!=0) { if ((WF & SAW_BITVAL)!=0) { //pulse+saw+triangle (waveform nearly identical to tri+saw) if (WavGenOut != 0) { WavGenOut = HQcombinedWF(PulseSawTriangle, utmp); } } else { //pulse+triangle tmp = phaseAccu[channel] ^ ((WF & RING_BITVAL)!=0 ? ringSourceMSB : 0); if (WavGenOut != 0) { WavGenOut = HQcombinedWF(PulseTriangle, tmp >> 8); } } } else if ((WF & SAW_BITVAL) != 0) { //pulse+saw if (WavGenOut != 0) { WavGenOut = HQcombinedWF(PulseSawtooth, utmp); } } } } else if ((WF & SAW_BITVAL)!=0) { //sawtooth WavGenOut = phaseAccu[channel] >> 8; if ((WF & TRI_BITVAL)!=0) { WavGenOut = HQcombinedWF(SawTriangle, WavGenOut); //saw+triangle } } else if ((WF & TRI_BITVAL)!=0) { //triangle (this waveform has no harsh edges, so it doesn't suffer from strong aliasing at high pitches) tmp = phaseAccu[channel] ^ ((WF & RING_BITVAL)!=0 ? ringSourceMSB : 0); WavGenOut = (tmp ^ ((tmp & 0x800000) != 0 ? 0xFFFFFF : 0)) >> 7; } WavGenOut &= 0xFFFF; if ((WF & 0xF0) != 0) { prevWavGenOut[channel] = WavGenOut; //emulate waveform 00 floating wave-DAC (utilized by SounDemon digis) } else { WavGenOut = prevWavGenOut[channel]; //(on real SID waveform00 decays, we just simply keep the value to avoid clicks) } prevPhaseAccu[channel] = phaseAccu[channel]; ringSourceMSB = MSB; // check if one voice is to be muted if ((muteVoice1 && channel==0) || (muteVoice2 && channel==7) || (muteVoice3 && channel==14) ) continue; //routing the channel signal to either the filter or the unfiltered master output depending on filter-switch SID-registers Envelope = (chipModel == 8580) ? envelopeCounter[channel] : ADSR_DAC_6581[envelopeCounter[channel]]; if ((FilterSwitchReso & FilterSwitchVal[channel])!=0) { sidWavOutput.filterInput += (((int) WavGenOut - 0x8000) * Envelope) >> 8; } else if (channel != 14 || !((VolumeBand & OFF3_BITVAL)!=0)) { sidWavOutput.nonFilted += (((int) WavGenOut - 0x8000) * Envelope) >> 8; } } //update readable SID1-registers (some SID tunes might use 3rd channel ENV3/OSC3 value as control) c64.ioBankRD[baseAddress + 0x1B] = (WavGenOut >> 8); //OSC3, ENV3 (some players rely on it, unfortunately even for timing) c64.ioBankRD[baseAddress + 0x1C] = envelopeCounter[14]; //Envelope //SIDwavOutput.nonFilted=nonFilted; SIDwavOutput.filterInput=filterInput; //SID->FilterInputCycle=filterInput; //SID->NonFiltedCycle=nonFilted; return sidWavOutput; //NonFilted; //+filterInput; //WavGenOut; //(*PhaseAccuPtr)>>8; } /** * Emulate SID output stage * * @return the output value */ public int emulateSIDoutputStage () { int mainVolume; int filterSwitchReso, VolumeBand; int tmp, nonFilted, filterInput, cutoff, resonance, filterOutput, output; filterSwitchReso = basePtr[0x17+baseAddress]; VolumeBand=basePtr[0x18+baseAddress]; cutoff = (basePtr[0x16+baseAddress]<< 3) + (basePtr[0x15+baseAddress] & 7); resonance = filterSwitchReso >> 4; nonFilted=nonFiltedSample; filterInput=filterInputSample; //Filter if (chipModel == 8580) { cutoff = CutoffMul8580_44100Hz[cutoff]; resonance = Resonances8580[resonance]; } else { //6581 cutoff += (filterInput*105)>>16; if (cutoff>0x7FF) cutoff=0x7FF; else if (cutoff<0) cutoff=0; //MOSFET-VCR control-voltage calculation cutoff = CutoffMul6581_44100Hz[cutoff]; //(resistance-modulation aka 6581 filter distortion) emulation resonance = Resonances6581[resonance]; } filterOutput=0; tmp = filterInput + ((prevBandPass * resonance)>>12) + prevLowPass; if ((VolumeBand & HIGHPASS_BITVAL)!=0) filterOutput -= tmp; tmp = prevBandPass - ( (tmp * cutoff) >> 12 ); prevBandPass = tmp; if ((VolumeBand & BANDPASS_BITVAL)!=0) filterOutput -= tmp; tmp = prevLowPass + ( (tmp * cutoff) >> 12 ); prevLowPass = tmp; if ((VolumeBand & LOWPASS_BITVAL)!=0) filterOutput += tmp; //Output-mixing stage //For $D418 volume-register digi playback: an AC / DC separation for $D418 value at low (20Hz or so) cutoff-frequency, //sending AC (highpass) value to a 4th 'digi' channel mixed to the master output, and set ONLY the DC (lowpass) value to the volume-control. //This solved 2 issues: Thanks to the lowpass filtering of the volume-control, sid tunes where digi is played together with normal sid channels, //won't sound distorted anymore, and the volume-clicks disappear when setting sid-volume. (This is useful for fade-in/out tunes like Hades Nebula, where clicking ruins the intro.) if (c64.realSIDmode) { tmp = (int) ( (VolumeBand&0xF) << 12 ); nonFilted += (tmp - prevVolume) * D418_DIGI_VOLUME; //highpass is digi, adding it to output must be before digifilter-code prevVolume += (tmp - prevVolume) >> 10; //arithmetic shift amount determines digi lowpass-frequency mainVolume = prevVolume >> 12; //lowpass is main volume } else mainVolume = VolumeBand & 0xF; this.output = ((nonFilted+filterOutput) * mainVolume); output = this.output / ( (CHANNELS*VOLUME_MAX) + c64.attenuation ); return output; // master output of a sid } /** * Combine the Waveform * * @param WFarray the waveform data * @param oscval the oscillator value * @return the waveform output */ private int combinedWF(char[] WFarray, int oscval) { int pitch; int filt; if (chipModel==6581 && WFarray!=PulseTriangle) oscval &= 0x7FFF; pitch = basePtr[1+channel+baseAddress]!=0 ? basePtr[1+channel+baseAddress] : 1; //avoid division by zero filt = 0x7777 + (0x8888/pitch); prevWavData[channel] = ( WFarray[oscval>>4]*filt + prevWavData[channel]*(0xFFFF-filt) ) >> 16; return prevWavData[channel] << 8; } /** * Combine the Waveform in High Quality * * @param WFarray the waveform data * @param oscval the oscillator value * @return the waveform output */ private int HQcombinedWF(char[] WFarray, int oscval) { if (chipModel==6581 && WFarray!=PulseTriangle) oscval &= 0x7FFF; return WFarray[oscval>>4]<<8; } }
57,751
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
PSID.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/sidid/PSID.java
/** * @(#)PSID64.java 2023/03/19 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ package sw_emulator.software.sidid; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; /** * PSID file of cSID original by Hermit * * @author ice */ public class PSID { String magicString; //$00 - "PSID" or "RSID" (RSID must provide Reset-circumstances & CIA/VIC-interrupts) int versionH00; //$04 int version; //$05 - 1 for PSID v1, 2..4 for PSID v2..4 or RSID v2..4 (3/4 has 2SID/3SID support), 0x4E for 4SID (WebSID-format) int headerSizeH00; //$06 int headerSize; //$07 - $76 for v1, $7C for v2..4, with WebSID-format: $7E for 2SID, $80 for 3SID, $82 for 4SID (depends on number of SIDs) int loadAddressH, loadAddressL; //$08 - if 0 it's a PRG and its loadaddress is used (RSID: 0, PRG-loadaddress>=$07E8) int initAddressH, initAddressL; //$0A - if 0 it's taken from load-address (but should be set) (RSID: don't point to ROM, 0 if BASICflag set) int playAddressH, playAddressL; //$0C - if 0 play-routine-call is set by the initializer (always true for RSID) int subtuneAmountH00; //$0E int subtuneAmount; //$0F - 1..256 int defaultSubtuneH00; //$10 int defaultSubtune; //$11 - 1..256 (optional, defaults to 1) int[] subtuneTimeSources=new int[4]; //$12 - 0:Vsync / 1:CIA1 (for PSID) (LSB is subtune1, MSB above 32) , always 0 for RSID String title; //$16 - strings are using 1252 codepage String author; //$36 String releaseInfo; //$56 //SID v2 additions: (if SID2/SID3 model is set to unknown, they're set to the same model as SID1) int modelFormatStandardH; //$76 - bit9&8/7&6/5&4: SID3/2/1 model (00:?,01:6581,10:8580,11:both) (4SID:bit6=SID1-channel), bit3&2:videoStandard.. int modelFormatStandard; //$77 ..(01:PAL,10:NTSC,11:both), bit1:(0:C64,1:PlaySIDsamples/RSID_BASICflag), bit0:(0:builtin-player,1:MUS) int relocStartPage; //$78 - v2NG specific, if 0 the SID doesn't write outside its data-range, if $FF there's no place for driver int relocFreePages; //$79 - size of area from relocStartPage for driver-relocation (RSID: must not contain ROM or 0..$3FF) int sid2baseAddress; //$7A - (SID2BASE-$d000)/16 //SIDv3-relevant, only $42..$FE values are valid ($d420..$DFE0), else no SID2 int sid2flagsH; //$7A: address of SID2 in WebSID-format too (same format as sid2baseAddress in HVSC format) int sid3baseAddress; //$7B - (SID3BASE-$d000)/16 //SIDv4-relevant, only $42..$FE values are valid ($d420..$DFE0), else no SID3 int sid2flagsL; //$7B: flags for WebSID-format, bit6: output-channel (0(default):left, 1:right, ?:both?), bit5..4:SIDmodel(00:setting,01:6581,10:8580,11:both) // my own (implemented in SID-Wizard too) proposal for channel-info: bit7 should be 'middle' channel-flag (overriding bit6 left/right) //WebSID-format (with 4 and more SIDs -support) additional fields: for each extra SID there's an 'nSIDflags' byte-pair int sid3flagsH, sid3flagsL; //$7C,$7D: the same address/flag-layout for SID3 as with SID2 int sid4flagsH; int sid4baseAddress; //$7E int sid4flagsL; //$7F: the same address/flag-layout for SID4 as with SID2 //... repeated for more SIDs, and end the list with $00,$00 (this determines the amount of SIDs) public static final int CRSID_CHANNEL_LEFT=1; public static final int CRSID_CHANNEL_RIGHT=2; public static final int CRSID_CHANNEL_BOTH=3; public static final int CRSID_SIDCOUNT_MAX=4; public static final int CRSID_CIACOUNT=2; public static final int CRSID_FILEVERSION_WEBSID=0x4E; public static final int CRSID_FILESIZE_MAX=1000000; public static final String MagicStringPSID="PSID"; public C64 init(int samplerate, int buflen) { C64 c64=new C64(samplerate); c64.highQualitySID=true; c64.stereo=0; c64.selectedSIDmodel=0; c64.playbackSpeed=1; //default model and mode selections c64.mainVolume=255; //if ( cRSID_initSound (C64, samplerate,buflen) == NULL) return NULL; return c64; } public void processSIDfile(C64 c64, byte[] filedata, int filesize) { int i; int sidDataOffset; magicString=""+(char)filedata[0]+(char)filedata[1]+(char)filedata[2]+(char)filedata[3]; versionH00=filedata[4] & 0xFF; version=filedata[5] & 0xFF; headerSizeH00=filedata[6] & 0xFF; headerSize=filedata[7] & 0xFF; loadAddressH=filedata[8] & 0xFF; loadAddressL=filedata[9] & 0xFF; initAddressH=filedata[0xA] & 0xFF; initAddressL=filedata[0xB] & 0xFF; playAddressH=filedata[0xC] & 0xFF; playAddressL=filedata[0xD] & 0xFF; subtuneAmountH00=filedata[0xE] & 0xFF; subtuneAmount=filedata[0xF] & 0xFF; defaultSubtuneH00=filedata[0x10] & 0xFF; defaultSubtune=filedata[0x11] & 0xFF; subtuneTimeSources[0]=filedata[0x12] & 0xFF; subtuneTimeSources[1]=filedata[0x13] & 0xFF; subtuneTimeSources[2]=filedata[0x14] & 0xFF; subtuneTimeSources[3]=filedata[0x15] & 0xFF; title=""; for (i=0x16; i<0x16+32; i++) { title+=(char)filedata[i]; } author=""; for (i=0x36; i<0x36+32; i++) { author+=(char)filedata[i]; } releaseInfo=""; for (i=0x56; i<0x56+32; i++) { releaseInfo+=(char)filedata[i]; } modelFormatStandardH=filedata[0x76] & 0xFF; modelFormatStandard=filedata[0x77] & 0xFF; relocStartPage=filedata[0x78] & 0xFF; relocFreePages=filedata[0x79] & 0xFF; sid2baseAddress=filedata[0x7A] & 0xFF; sid2flagsH=filedata[0x7A] & 0xFF; sid3baseAddress=filedata[0x7B] & 0xFF; sid2flagsL=filedata[0x7B] & 0xFF; sid3flagsH=filedata[0x7C] & 0xFF; sid3flagsL=filedata[0x7D] & 0xFF; sid4flagsH=filedata[0x7E] & 0xFF; sid4baseAddress=filedata[0x7E] & 0xFF; sid4flagsL=filedata[0x7F] & 0xFF; for (i = 0x0000; i < 0xA000; ++i) { c64.ramBank[i] = 0; //fresh start (maybe some bugged SIDs want 0 at certain RAM-locations) } for (i = 0xC000; i < 0xD000; ++i) { c64.ramBank[i] = 0; } if (magicString.charAt(0) != 'P' && magicString.charAt(0) != 'R') { return; } for (i = 1; i <MagicStringPSID.length() - 1; ++i) { if (magicString.charAt(i) != MagicStringPSID.charAt(i)) { return; } } c64.realSIDmode = (magicString.charAt(0) == 'R'); if (loadAddressH == 0 && loadAddressH == 0) { //load-address taken from first 2 bytes of the C64 PRG c64.loadAddress = ((filedata[headerSize + 1] & 0xff) << 8) + ((filedata[headerSize + 0]&0xFF)); sidDataOffset = headerSize + 2; } else { //load-adress taken from SID-header c64.loadAddress = (loadAddressH << 8) + (loadAddressL); sidDataOffset = headerSize; } for (i = sidDataOffset; i < filesize; ++i) { c64.ramBank[c64.loadAddress + (i - sidDataOffset)] = filedata[i] &0xFF; } i = c64.loadAddress + (filesize - sidDataOffset); c64.endAddress = (i < 0x10000) ? i : 0xFFFF; c64.psidDigiMode = (!c64.realSIDmode && ((modelFormatStandard & 2)!=0)); } /** * Load the sid file * * @param filename the file to read * @return the file or null */ byte[] loadSIDfile (String filename) { byte[] data; try { data=Files.readAllBytes(Path.of(filename)); } catch (IOException ex) { System.err.println(ex); data=null; } return data; } /** * Load and process the sid file * * @param c64 the emulator * @param filename the file name */ public void loadSIDtune(C64 c64, String filename) { byte[] SIDfileData=null; //use memset? SIDfileData=loadSIDfile(filename); processSIDfile(c64, SIDfileData, SIDfileData.length ); } /** * Get the max tune into the SID * * @return the max tune number */ public int getMaxTune() { return subtuneAmount; } }
9,121
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
PulseTriangle.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/sidid/PulseTriangle.java
package sw_emulator.software.sidid; /** * * @author stefano_tognon */ public class PulseTriangle { public static final char PulseTriangle [] = { //can be substituted by PulseSaw with mirroring the upper half (like with triangle-waveform) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x3C, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x5E, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x40, 0x60, 0x60, 0x6F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x60, 0x40, 0x40, 0x60, 0x60, 0x60, 0x60, 0x70, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, 0x60, 0x70, 0x60, 0x60, 0x60, 0x70, 0x70, 0x70, 0x78, 0x7B, 0x60, 0x60, 0x60, 0x70, 0x60, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x78, 0x78, 0x78, 0x78, 0x7C, 0x78, 0x78, 0x78, 0x7C, 0x78, 0x7C, 0x7C, 0x7E, 0x7C, 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x8E, 0x9F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xAF, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xA0, 0xA0, 0xA0, 0xA0, 0xB7, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xA0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xB0, 0xA0, 0xB0, 0xB0, 0xBB, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xB0, 0xB0, 0xA0, 0xB0, 0xB0, 0xB8, 0xB0, 0xB8, 0xB8, 0xBC, 0xB0, 0xB8, 0xB8, 0xB8, 0xB8, 0xBC, 0xBC, 0xBE, 0xBC, 0xBC, 0xBE, 0xBF, 0xBE, 0xBF, 0xBF, 0xBF, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x80, 0x80, 0xC0, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xCF, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xD7, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xD0, 0xD0, 0xD9, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xD0, 0xC0, 0xD0, 0xD0, 0xD0, 0xD0, 0xD8, 0xD8, 0xDC, 0xD0, 0xD0, 0xD8, 0xD8, 0xD8, 0xDC, 0xDC, 0xDE, 0xDC, 0xDC, 0xDE, 0xDF, 0xDE, 0xDF, 0xDF, 0xDF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xC0, 0xE0, 0xE0, 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xC0, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE7, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE8, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE8, 0xEC, 0xE0, 0xE0, 0xE0, 0xE8, 0xE8, 0xE8, 0xEC, 0xEE, 0xEC, 0xEC, 0xEC, 0xEE, 0xEE, 0xEF, 0xEF, 0xEF, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF4, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF4, 0xF0, 0xF4, 0xF4, 0xF6, 0xF6, 0xF7, 0xF7, 0xF7, 0xF0, 0xF0, 0xF0, 0xF8, 0xF0, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xFA, 0xFA, 0xFB, 0xFB, 0xFB, 0xF8, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFD, 0xFD, 0xFD, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFC, 0xFD, 0xFD, 0xFD, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xF8, 0xFB, 0xFB, 0xFB, 0xFA, 0xFA, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF7, 0xF7, 0xF7, 0xF6, 0xF6, 0xF4, 0xF4, 0xF0, 0xF4, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF4, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xEF, 0xEF, 0xEF, 0xEE, 0xEE, 0xEC, 0xEC, 0xE8, 0xEE, 0xEC, 0xE8, 0xE8, 0xE8, 0xE0, 0xE0, 0xE0, 0xEC, 0xE8, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE8, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE7, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xE0, 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xDF, 0xDF, 0xDF, 0xDE, 0xDF, 0xDE, 0xDC, 0xDC, 0xDE, 0xDC, 0xDC, 0xD8, 0xD8, 0xD8, 0xD0, 0xD0, 0xDC, 0xD8, 0xD8, 0xD0, 0xD0, 0xD0, 0xD0, 0xC0, 0xD0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xD9, 0xD0, 0xD0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xD7, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0xC0, 0xC0, 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0xCF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0xC0, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x80, 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xBF, 0xBF, 0xBF, 0xBE, 0xBF, 0xBE, 0xBC, 0xBC, 0xBE, 0xBC, 0xBC, 0xB8, 0xB8, 0xB8, 0xB8, 0xB0, 0xBC, 0xB8, 0xB8, 0xB0, 0xB8, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xBB, 0xB0, 0xB0, 0xA0, 0xB0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0x80, 0x80, 0x80, 0x80, 0x80, 0xA0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xB7, 0xB0, 0xA0, 0xA0, 0xA0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xAF, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x9E, 0x88, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7E, 0x7E, 0x7C, 0x7E, 0x7C, 0x7C, 0x78, 0x7C, 0x78, 0x78, 0x78, 0x7C, 0x78, 0x78, 0x78, 0x78, 0x70, 0x70, 0x70, 0x78, 0x70, 0x70, 0x60, 0x70, 0x60, 0x60, 0x60, 0x7B, 0x78, 0x70, 0x70, 0x70, 0x60, 0x60, 0x60, 0x70, 0x60, 0x60, 0x60, 0x60, 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, 0x77, 0x70, 0x60, 0x60, 0x60, 0x60, 0x40, 0x40, 0x60, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6F, 0x64, 0x60, 0x40, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x5E, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x3F, 0x3E, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; }
25,476
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
PulseSawTriangle.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/sidid/PulseSawTriangle.java
package sw_emulator.software.sidid; /** * * @author stefano_tognon */ public class PulseSawTriangle { public static final char PulseSawTriangle [] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x70, 0x60, 0x20, 0x70, 0x70, 0x70, 0x70, 0x70, 0x78, 0x78, 0x78, 0x7C, 0x7C, 0x7E, 0x7E, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1E, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x8C, 0x9F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xCF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE3, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; }
25,391
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
CPU.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/sidid/CPU.java
/** * @(#)cRSID.java 2023/03/19 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ package sw_emulator.software.sidid; /** * Emulate the CPU of cRSID originl by Hermit * * @author ice00 */ public class CPU { /** Reference to the containing c64 */ C64 c64; int PC; int A, SP; int X, Y, ST; //STATUS-flags: N V - B D I Z C int prevNMI; //used for nmi leading edge byte cycles; int samePage; int IR; //, ST, X, Y; //int A, SP, int T; //int PC, int addr, prevPC; public static final int N=0x80; public static final int V=0x40; public static final int B=0x10; public static final int D=0x08; public static final int I=0x04; public static final int Z=0x02; public static final int C=0x01; public static final short[] FlagSwitches={0x01,0x21,0x04,0x24,0x00,0x40,0x08,0x28}; public static final short[] BranchFlags={0x80,0x40,0x01,0x02}; /** * Construct the cpu * * @param c64 the c64 reference */ public CPU(C64 c64) { this.c64=c64; } /** * Init the cpu chip * * @param mempos the starting position */ public void initCPU(int mempos) { PC = mempos; A = 0; X = 0; Y = 0; ST = 0x04; SP = 0xFF; prevNMI = 0; } /** * Read a byte from address * * @param address tjhe address * @return the value */ private int rd(int address) { int value; value = c64.readMemC64(address); if (c64.realSIDmode) { if ( (c64.ramBank[1] & 3)!=0 ) { if (address==0xDC0D) { c64.cia[0].acknowledgeCIAIRQ(); } else if (address==0xDD0D) { c64.cia[1].acknowledgeCIAIRQ(); } } } Memory.instance.setRead(address); return value; } /** * Write data to an address * * @param address the address * @param data the data to wrote */ private void wr(int address, int data) { c64.writeMemC64(address, data); if ( c64.realSIDmode && (c64.ramBank[1] & 3)!=0 ) { if (address==0xD019) { c64.vic.acknowledgeVICrasterIRQ(); } } Memory.instance.setWrite(address); } /** * Write data to an address (PSID-hack specific memory-write) * * @param address the address * @param data the data to wrote */ private void wr2(int address, int data) { int tmp; c64.writeMemC64(address, data); if ( (c64.ramBank[1] & 3 )!=0) { if (c64.realSIDmode) { if (address==0xDC0D) c64.cia[0].writeCIAIRQmask(data ); else if (address==0xDD0D) c64.cia[1].writeCIAIRQmask(data ); else if (address==0xDD0C) c64.ioBankRD[address]=data; //mirror WR to RD (e.g. Wonderland_XIII_tune_1.sid) else if(address==0xD019 && (data&1)!=0) { //only writing 1 to $d019 bit0 would acknowledge c64.vic.acknowledgeVICrasterIRQ(); } } else { switch (address) { case 0xDC05: case 0xDC04: if ((c64.timerSource )!=0) { //dynamic cia-setting (Galway/Rubicon workaround) c64.frameCycles = ( (c64.ioBankWR[0xDC04] + (c64.ioBankWR[0xDC05]<<8)) ); //<< 4) / c64->sampleClockRatio; } break; case 0xDC08: c64.ioBankRD[0xDC08] = data; break; //refresh TOD-clock case 0xDC09: c64.ioBankRD[0xDC09] = data; break; //refresh TOD-clock case 0xD012: //dynamic VIC irq-rasterline setting (Microprose Soccer V1 workaround) if (c64.prevRasterLine>=0) { //was $d012 set before? (or set only once?) if (c64.ioBankWR[0xD012] != c64.prevRasterLine) { tmp = c64.ioBankWR[0xD012] - c64.prevRasterLine; if (tmp<0) tmp += c64.vic.rasterLines; c64.frameCycleCnt = c64.frameCycles - tmp * c64.vic.rasterRowCycles; } } c64.prevRasterLine = c64.ioBankWR[0xD012]; break; } } } Memory.instance.setWrite(address); } /** * Addressing mode immediate */ private void addrModeImmediate () { ++PC; addr=PC; cycles=2; Memory.instance.setExecute(PC); } /** * Addressing mode zero page */ private void addrModeZeropage () { ++PC; addr=rd(PC); cycles=3; Memory.instance.setExecuteMinus(PC); Memory.instance.setExecute(PC); } /** * Addressing mode absolute */ private void addrModeAbsolute () { ++PC; addr = rd(PC); ++PC; addr += rd(PC)<<8; cycles=4; Memory.instance.setExecuteMinus(PC); Memory.instance.setExecute(PC); } /** * Addressing mode zero page X indexed * * zp,x (with zeropage-wraparound of 6502) */ private void addrModeZeropageXindexed () { ++PC; addr = (rd(PC) + X) & 0xFF; cycles=4; Memory.instance.setExecute(PC); } /** * Addressign mode zero page Y indexed * * zp,y (with zeropage-wraparound of 6502) */ private void addrModeZeropageYindexed () { ++PC; addr = (rd(PC) + Y) & 0xFF; cycles=4; Memory.instance.setExecute(PC); } /** * Addressing mode X indexed * * abs,x (only STA is 5 cycles, others are 4 if page not crossed, RMW:7) */ private void addrModeXindexed () { ++PC; addr = rd(PC) + X; ++PC; samePage = (addr <= 0xFF) ? 1:0; addr += rd(PC)<<8; cycles=5; Memory.instance.setExecuteMinus(PC); Memory.instance.setExecute(PC); } /** * Addressing mode Y indexed * * abs,y (only STA is 5 cycles, others are 4 if page not crossed, RMW:7) */ private void addrModeYindexed () { ++PC; addr = rd(PC) + Y; ++PC; samePage = (addr <= 0xFF) ? 1:0; addr += rd(PC)<<8; cycles=5; Memory.instance.setExecuteMinus(PC); Memory.instance.setExecute(PC); } /** * Addressing mode indirect Y indexed * * (zp),y (only STA is 6 cycles, others are 5 if page not crossed, RMW:8) */ private void addrModeIndirectYindexed() { ++PC; addr = rd(rd(PC)) + Y; samePage = (addr <= 0xFF) ? 1:0; addr += rd( (rd(PC)+1)&0xFF ) << 8; cycles=6; Memory.instance.setExecute(PC); } /** * Addressing mode X indexed indirect * * (zp,x) */ private void addrModeXindexedIndirect() { ++PC; addr = ( rd(rd(PC)+X)&0xFF ) + ( ( rd(rd(PC)+X+1)&0xFF ) << 8 ); cycles=6; Memory.instance.setExecute(PC); } /** * Clear Carry-flag */ private void clrC () { ST &= ~C; } /** * Set the Carry-flag * * @param expr boolean value for the carry */ private void setC (boolean expr) { setC(expr ? 1:0); } /** * Set Carry-flag if expression is not zero * * @param expr the expression to evaluate */ private void setC (int expr) { ST &= ~C; ST |= (expr!=0) ? 1:0; } /** * Cleat the N/Z/C flags */ private void clrNZC() { ST &= ~(N | Z | C); } /** * Clear the N/V/Z/C flags */ private void clrNVZC() { ST &= ~(N | V | Z | C); } /** * Set Negative-flag and Zero-flag based on result in Accumulator */ private void setNZbyA() { ST &= ~(N|Z); ST |= (((!(A!=0))?1:0)<<1) | (A&N); } /** * Set NZ flags */ private void setNZbyT() { T&=0xFF; ST &= ~(N|Z); ST |= (((!(T!=0))?1:0)<<1) | (T&N); } /** * Set Negative-flag and Zero-flag based on result in X-register */ private void setNZbyX() { ST &= ~(N|Z); ST |= (((!(X!=0))?1:0) <<1) | (X&N); } /** * Set Negative-flag and Zero-flag based on result in Y-register */ private void setNZbyY() { ST &= ~(N|Z); ST |= (((!(Y!=0))?1:0)<<1) | (Y&N); } /** * Set Negative-flag and Zero-flag based on result at Memory-Address */ private void setNZbyM() { ST &= ~(N | Z); ST |= ( ((!(rd(addr)!=0))?1:0) << 1) | (rd(addr) & N); } /** * Set NZC after increase/addition */ private void setNZCbyAdd() { ST &= ~(N | Z | C); ST |= (A & N) | ((A > 255)?1:0); A &= 0xFF; ST |= ((!(A!=0))?1:0) << 1; } /** * Calculate V-flag from A and T (previous A) and input2 (Memory) * * @param M thr value to use */ private void setVbyAdd(int M) { ST &= ~V; ST |= ((~(T ^ M)) & (T ^ A) & N) >> 1; } // /** * Set NZC and modify caller * * @param obj the object to test * @return the new value to give to object */ private int setNZCbySub(int obj) { ST &= ~(N | Z | C); ST |= (obj & N) | ((obj >= 0) ? 1 : 0); obj &= 0xFF; ST |= (((!(obj != 0)) ? 1 : 0) << 1); return obj; } /** * Push a value into the stack * * @param value the value to push */ private void push(int value) { c64.ramBank[0x100 + SP] = value; --SP; SP &= 0xFF; } /** * Pop a value from the stack * * @return the value */ private int pop() { ++SP; SP &= 0xFF; return c64.ramBank[0x100 + SP]; } /** * The cpu emulation for sid/PRG playback (ToDo: cia/VIC-irq/nmi/RESET vectors, BCD-mode) * * @return the break type */ public byte emulateCPU() { // loadReg(); prevPC = PC; IR = rd(PC); cycles = 2; samePage = 0; //'cycles': ensure smallest 6510 runtime (for implied/register instructions) Memory.instance.setExecute(PC); /*System.err.println("PC="+Integer.toHexString(PC)+" "+ "IR="+Integer.toHexString(IR)+" "+ "A="+Integer.toHexString(A)+" "+ "X="+Integer.toHexString(X)+" "+ "Y="+Integer.toHexString(Y)+" "+ "SP="+Integer.toHexString(SP)+" "+ "ST="+Integer.toHexString(ST) );*/ if ((IR & 1) != 0) { //nybble2: 1/5/9/D:accu.instructions, 3/7/B/F:illegal opcodes switch ((IR & 0x1F) >> 1) { //value-forming to cause jump-table //PC wraparound not handled inside to save codespace case 0: case 1: addrModeXindexedIndirect(); break; //(zp,x) case 2: case 3: addrModeZeropage(); break; case 4: case 5: addrModeImmediate(); break; case 6: case 7: addrModeAbsolute(); break; case 8: case 9: addrModeIndirectYindexed(); break; //(zp),y (5..6 cycles, 8 for R-M-W) case 0xA: addrModeZeropageXindexed(); break; //zp,x case 0xB: if ((IR & 0xC0) != 0x80) { addrModeZeropageXindexed(); //zp,x for illegal opcodes } else { addrModeZeropageYindexed(); //zp,y for LAX/SAX illegal opcodes } break; case 0xC: case 0xD: addrModeYindexed(); break; case 0xE: addrModeXindexed(); break; case 0xF: if ((IR & 0xC0) != 0x80) { addrModeXindexed(); //abs,x for illegal opcodes } else { addrModeYindexed(); //abs,y for LAX/SAX illegal opcodes } break; } addr &= 0xFFFF; switch ((IR & 0xE0) >> 5) { //value-forming to cause gapless case-values and faster jump-table creation from switch-case case 0: if ((IR & 0x1F) != 0xB) { //ORA / SLO(ASO)=ASL+ORA if ((IR & 3) == 3) { clrNZC(); setC(rd(addr) >= N); wr(addr, (rd(addr) << 1)&0xFF); cycles += 2; } //for SLO else { cycles -= samePage; } A |= rd(addr); setNZbyA(); //ORA } else { A &= rd(addr); setNZbyA(); setC(A >= N); } //ANC (AND+Carry=bit7) break; case 1: if ((IR & 0x1F) != 0xB) { //AND / RLA (ROL+AND) if ((IR & 3) == 3) { //for RLA T = (rd(addr) << 1) + (ST & C); clrNZC(); setC(T > 255); T &= 0xFF; wr(addr, T); cycles += 2; } else { cycles -= samePage; } A &= rd(addr); setNZbyA(); //AND } else { A &= rd(addr); setNZbyA(); setC(A >= N); } //ANC (AND+Carry=bit7) break; case 2: if ((IR & 0x1F) != 0xB) { //EOR / SRE(LSE)=LSR+EOR if ((IR & 3) == 3) { clrNZC(); setC(rd(addr) & 1); wr(addr, (rd(addr) >> 1)&0xFF); cycles += 2; } //for SRE else { cycles -= samePage; } A ^= rd(addr); setNZbyA(); //EOR } else { A &= rd(addr); setC(A & 1); A >>= 1; A &= 0xFF; setNZbyA(); } //ALR(ASR)=(AND+LSR) break; case 3: if ((IR & 0x1F) != 0xB) { //RRA (ROR+ADC) / ADC if ((IR & 3) == 3) { //for RRA T = (rd(addr) >> 1) + ((ST & C) << 7); T&=0xFF; clrNZC(); setC(T & 1); wr(addr, T); cycles += 2; } else { cycles -= samePage; } T = A; A += rd(addr) + (ST & C); //BCD? if ((ST & D) != 0 && (A & 0xF) > 9) { A += 0x10; A &= 0xF0; } setNZCbyAdd(); setVbyAdd(rd(addr)); //ADC } else { // ARR (AND+ROR, bit0 not going to C, but C and bit7 get exchanged.) A &= rd(addr); T += rd(addr) + (ST & C); clrNVZC(); setC(T > 255); setVbyAdd(rd(addr)); //V-flag set by intermediate ADC mechanism: (A&mem)+mem T = A; A = (A >> 1) + ((ST & C) << 7); A&=0xFF; setC(T >= N); setNZbyA(); } break; case 4: switch (IR & 0x1F) { //XAA (TXA+AND), highly unstable on real 6502! case 0xB: A = X & rd(addr); setNZbyA(); break; //TAS(SHS) (SP=A&X, mem=S&H} - unstable on real 6502 case 0x1B: SP = A & X; wr(addr, (SP & ((addr >> 8) + 1))&0xFF); break; //STA / SAX (at times same as AHX/SHX/SHY) (illegal) default: wr2(addr, (A & (((IR & 3) == 3) ? X : 0xFF))); break; } break; case 5: //LDA / LAX (illegal, used by my 1 rasterline player) (LAX #imm is unstable on c64) if ((IR & 0x1F) != 0x1B) { A = rd(addr); if ((IR & 3) == 3) { X = A; } } else { //LAS(LAR) A = X = SP = rd(addr) & SP; } setNZbyA(); cycles -= samePage; break; case 6: // CMP / DCP(DEC+CMP) if ((IR & 0x1F) != 0xB) { //DCP if ((IR & 3) == 3) { wr(addr, (rd(addr) - 1)&0xFF); cycles += 2; } else { cycles -= samePage; } T = A - rd(addr); } else { //SBX(AXS) //SBX (AXS) (CMP+DEX at the same time) X = T = (A & X) - rd(addr); } T=setNZCbySub(T); break; case 7: //ISC(ISB)=INC+SBC / SBC if ((IR & 3) == 3 && (IR & 0x1F) != 0xB) { wr(addr, (rd(addr) + 1)&0xFF); cycles += 2; } else { cycles -= samePage; } T = A; A -= rd(addr) + (!((ST & C)!=0)?1:0); A=setNZCbySub(A); setVbyAdd((~rd(addr))); break; } } else if ((IR & 2) != 0) { //nybble2: 2:illegal/LDX, 6:A/X/INC/DEC, A:Accu-shift/reg.transfer/NOP, E:shift/X/INC/DEC switch (IR & 0x1F) { //Addressing modes case 2: addrModeImmediate(); break; case 6: addrModeZeropage(); break; case 0xE: addrModeAbsolute(); break; case 0x16: if ((IR & 0xC0) != 0x80) { addrModeZeropageXindexed(); //zp,x } else { addrModeZeropageYindexed(); //zp,y } break; case 0x1E: if ((IR & 0xC0) != 0x80) { addrModeXindexed(); //abs,x } else { addrModeYindexed(); //abs,y } break; } addr &= 0xFFFF; switch ((IR & 0xE0) >> 5) { case 0: clrC(); case 1: if ((IR & 0xF) == 0xA) { A = (A << 1) + (ST & C); A&=0xFF; setNZCbyAdd(); } //ASL/ROL (Accu) else { T = (rd(addr) << 1) + (ST & C); T&=0xFF; setC(T > 255); setNZbyT(); wr(addr, T); cycles += 2; } //RMW (Read-Write-Modify) break; case 2: clrC(); case 3: if ((IR & 0xF) == 0xA) { T = A; A = (A >> 1) + ((ST & C) << 7); setC(T & 1); A &= 0xFF; setNZbyA(); } //LSR/ROR (Accu) else { T = (rd(addr) >> 1) + ((ST & C) << 7); T&=0xFF; setC(rd(addr) & 1); setNZbyT(); wr(addr, T); cycles += 2; } //memory (RMW) break; case 4: if ((IR & 4) != 0) { wr2(addr, X); } //STX else if ((IR & 0x10) != 0) { SP = X; //TXS } else { A = X; setNZbyA(); } //TXA break; case 5: if ((IR & 0xF) != 0xA) { X = rd(addr); cycles -= samePage; } //LDX else if ((IR & 0x10) != 0) { X = SP; //TSX } else { X = A; //TAX } setNZbyX(); break; case 6: //DEC if ((IR & 4) != 0) { wr(addr, (rd(addr) - 1)&0xFF); setNZbyM(); cycles += 2; } else { //DEX --X; X&=0xFF; setNZbyX(); } break; case 7: if ((IR & 4) != 0) { wr(addr, (rd(addr) + 1)&0xFF); setNZbyM(); cycles += 2; } //INC/NOP break; } } else if ((IR & 0xC) == 8) { //nybble2: 8:register/statusflag if ((IR & 0x10) != 0) { if (IR == 0x98) { A = Y; setNZbyA(); } //TYA else { //CLC/SEC/CLI/SEI/CLV/CLD/SED if ((FlagSwitches[IR >> 5] & 0x20) != 0) { ST |= (FlagSwitches[IR >> 5] & 0xDF); } else { ST &= ~(FlagSwitches[IR >> 5] & 0xDF); } } } else { switch ((IR & 0xF0) >> 5) { case 0: push(ST); cycles = 3; break; //PHP case 1: ST = pop(); cycles = 4; break; //PLP case 2: push(A); cycles = 3; break; //PHA case 3: A = pop(); setNZbyA(); cycles = 4; break; //PLA case 4: --Y; Y&=0xFF; setNZbyY(); break; //DEY case 5: Y = A; setNZbyY(); break; //TAY case 6: ++Y; Y&=0xFF; setNZbyY(); break; //INY case 7: ++X; X&=0xFF; setNZbyX(); break; //INX } } } else { //nybble2: 0: control/branch/Y/compare 4: Y/compare C:Y/compare/JMP if ((IR & 0x1F) == 0x10) { //BPL/BMI/BVC/BVS/BCC/BCS/BNE/BEQ relative branch ++PC; Memory.instance.setExecute(PC); T = rd(PC); if ((T & 0x80) != 0) { T -= 0x100; } if ((IR & 0x20) != 0) { if ((ST & BranchFlags[IR >> 6])!=0) { PC += T; cycles = 3; } } else { if (!((ST & BranchFlags[IR >> 6])!=0)) { PC += T; cycles = 3; } //plus 1 cycle if page is crossed? } } else { //nybble2: 0:Y/control/Y/compare 4:Y/compare C:Y/compare/JMP switch (IR & 0x1F) { //Addressing modes case 0: addrModeImmediate(); break; //imm. (or abs.low for JSR/BRK) case 4: addrModeZeropage(); break; case 0xC: addrModeAbsolute(); break; case 0x14: addrModeZeropageXindexed(); break; //zp,x case 0x1C: addrModeXindexed(); break; //abs,x } addr &= 0xFFFF; switch ((IR & 0xE0) >> 5) { case 0: if (!((IR & 4) != 0)) { //BRK / NOP-absolute/abs,x/zp/zp,x push((PC + 2 - 1) >> 8); push((PC + 2 - 1) & 0xFF); push(ST | B); ST |= I; //BRK PC = rd(0xFFFE) + (rd(0xFFFF) << 8) - 1; cycles = 7; } else if (IR == 0x1C) { cycles -= samePage; //NOP abs,x } break; case 1: if ((IR & 0xF) != 0) { //BIT / NOP-abs,x/zp,x if (!((IR & 0x10) != 0)) { ST &= 0x3D; ST |= (rd(addr) & 0xC0) | ( ((! ((A & rd(addr))!=0 )) ? 1:0) << 1); } //BIT else if (IR == 0x3C) { cycles -= samePage; //NOP abs,x } } else { //JSR push((PC + 2 - 1) >> 8); push((PC + 2 - 1) & 0xFF); PC = rd(addr) + rd(addr + 1) * 256 - 1; Memory.instance.setExecute(addr); Memory.instance.setExecute(addr+1); cycles = 6; } break; case 2: if ((IR & 0xF) != 0) { //JMP / NOP-abs,x/zp/zp,x if (IR == 0x4C) { //JMP PC = addr - 1; cycles = 3; rd(addr + 1); //a read from jump-address highbyte is used in some tunes with jmp DD0C (e.g. Wonderland_XIII_tune_1.sid) //if (addr==prevPC) {storeReg(); c64->returned=1; return 0xFF;} //turn self-jump mainloop (after initC64) into idle time } else if (IR == 0x5C) { cycles -= samePage; //NOP abs,x } } else { //RTI ST = pop(); T = pop(); PC = (pop() << 8) + T - 1; cycles = 6; if (c64.returned != 0 && SP >= 0xFF) { ++PC; ///storeReg(); return (byte)0xFE; } } break; case 3: if ((IR & 0xF) != 0) { //JMP() (indirect) / NOP-abs,x/zp/zp,x if (IR == 0x6C) { //JMP() (indirect) PC = rd((addr & 0xFF00) + ((addr + 1) & 0xFF)); //(with highbyte-wraparound bug) PC = (PC << 8) + rd(addr) - 1; cycles = 5; } else if (IR == 0x7C) { cycles -= samePage; //NOP abs,x } } else { //RTS if (SP >= 0xFF) { ///storeReg(); c64.returned = 1; return (byte)0xFF; } //Init returns, provide idle-time between IRQs T = pop(); PC = (pop() << 8) + T; cycles = 6; } break; case 4: if ((IR & 4) != 0) { wr2(addr, Y); } //STY / NOP #imm break; case 5: Y = rd(addr); setNZbyY(); cycles -= samePage; //LDY break; case 6: if (!((IR & 0x10) != 0)) { //CPY / NOP abs,x/zp,x T = Y - rd(addr); T=setNZCbySub(T); //CPY } else if (IR == 0xDC) { cycles -= samePage; //NOP abs,x } break; case 7: if (!((IR & 0x10) != 0)) { //CPX / NOP abs,x/zp,x T = X - rd(addr); T=setNZCbySub(T); //CPX } else if (IR == 0xFC) { cycles -= samePage; //NOP abs,x } break; } } } ++PC; //PC&=0xFFFF; ///storeReg(); if (!c64.realSIDmode) { //substitute KERNAL irq-return in PSID (e.g. Microprose Soccer) if ((c64.ramBank[1] & 3) > 1 && prevPC < 0xE000 && (PC == 0xEA31 || PC == 0xEA81 || PC == 0xEA7E)) { return (byte)0xFE; } } return cycles; } /** * handle entering into irq and nmi interrupt * * @return if irq happened */ public boolean handleCPUinterrupts () { if (c64.nmi > prevNMI) { //if irq and nmi at the same time, nmi is serviced first push(PC>>8); push(PC&0xFF); push(ST); ST |= I; PC = c64.readMemC64(0xFFFA) + (c64.readMemC64(0xFFFB)<<8); //NMI-vector prevNMI = c64.nmi; return true; } else if ( (c64.irq!=0) && !((ST&I)!=0) ) { push(PC>>8); push(PC&0xFF); push(ST); ST |= I; PC = c64.readMemC64(0xFFFE) + (c64.readMemC64(0xFFFF)<<8); //maskable irq-vector prevNMI = c64.nmi; return true; } prevNMI = c64.nmi; //prepare for nmi edge-detection return false; } }
27,920
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
CIA.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/sidid/CIA.java
/** * @(#)CIA.java 2023/03/19 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ package sw_emulator.software.sidid; /** * Emulate the CIA of cRSID original by Hermit * * @author stefano_tognon */ public class CIA { /** reference to the containing C64 */ C64 c64; /** Old or new CIA? (have 1 cycle difference in cases) */ int chipModel; /** CIA-baseaddress location in C64-memory (IO) */ int baseAddress; /** CIA-baseaddress location in host's memory for writing */ int[] basePtrWR; /** CIA-baseaddress location in host's memory for reading */ int[] basePtrRD; public static final int PORTA=0; public static final int PORTB=1; public static final int DDRA=2; public static final int DDRB=3; //Write:Set Timer-latch, Read: read Timer public static final int TIMERAL=4; public static final int TIMERAH=5; public static final int TIMERBL=6; public static final int TIMERBH=7; public static final int TOD_TENTHSECONDS=8; public static final int TOD_SECONDS=9; public static final int TOD_MINUTES=0xA; public static final int TOD_HOURS=0xB; public static final int SERIAL_DATA=0xC; public static final int INTERRUPTS=0xD; public static final int CONTROLA=0xE; public static final int CONTROLB=0xF; //(Read or Write operation determines which one:) public static final int INTERRUPT_HAPPENED=0x80; public static final int SET_OR_CLEAR_FLAGS=0x80; //flags/masks of interrupt-sources public static final int FLAGn=0x10; public static final int SERIALPORT=0x08; public static final int ALARM=0x04; public static final int TIMERB=0x02; public static final int TIMERA=0x01; public static final int ENABLE_TIMERA=0x01; public static final int PORTB6_TIMERA=0x02; public static final int TOGGLED_PORTB6=0x04; public static final int ONESHOT_TIMERA=0x08; public static final int FORCELOADA_STROBE=0x10; public static final int TIMERA_FROM_CNT=0x20; public static final int SERIALPORT_IS_OUTPUT=0x40; public static final int TIMEOFDAY_50Hz=0x80; public static final int ENABLE_TIMERB=0x01; public static final int PORTB7_TIMERB=0x02; public static final int TOGGLED_PORTB7=0x04; public static final int ONESHOT_TIMERB=0x08; public static final int FORCELOADB_STROBE=0x10; public static final int TIMERB_FROM_CPUCLK=0x00; public static final int TIMERB_FROM_CNT=0x20; public static final int TIMERB_FROM_TIMERA=0x40; public static final int TIMERB_FROM_TIMERA_AND_CNT = 0x60; public static final int TIMEOFDAY_WRITE_SETS_ALARM = 0x80; /** * Construct the CIA * * @param c64 the C64 reference * @param baseAddress the base address in memory */ public CIA(C64 c64, int baseAddress) { this.c64 = c64; this.baseAddress = baseAddress; chipModel = 0; basePtrWR = c64.ioBankWR; basePtrRD = c64.ioBankRD; initChip(); } /** * Init the CIA chip */ public void initChip() { for (int i=baseAddress; i<baseAddress+0x10; ++i) { basePtrWR[i] = basePtrRD[i] = 0x00; } } /** * Emulate the CIA * * @param cycles the processor cycles * @return if IRQ happened */ public byte emulateCIA (byte cycles) { int tmp; //TimerA if ((basePtrWR[CONTROLA+baseAddress] & FORCELOADA_STROBE)!=0) { //force latch into counter (strobe-input) basePtrRD[TIMERAH+baseAddress] = basePtrWR[TIMERAH+baseAddress]; basePtrRD[TIMERAL+baseAddress] = basePtrWR[TIMERAL+baseAddress]; } else if ( (basePtrWR[CONTROLA+baseAddress] & (ENABLE_TIMERA|TIMERA_FROM_CNT)) == ENABLE_TIMERA ) { //Enabled, counts Phi2 tmp = ( (basePtrRD[TIMERAH+baseAddress]<<8) + basePtrRD[TIMERAL+baseAddress] ) - cycles; //count timer if (tmp <= 0) { //Timer counted down tmp += (basePtrWR[TIMERAH+baseAddress]<<8) + basePtrWR[TIMERAL+baseAddress]; //reload timer if ((basePtrWR[CONTROLA+baseAddress] & ONESHOT_TIMERA)!=0) { //disable if one-shot basePtrWR[CONTROLA+baseAddress] &= ~ENABLE_TIMERA; } basePtrRD[INTERRUPTS+baseAddress] |= TIMERA; if ((basePtrWR[INTERRUPTS+baseAddress] & TIMERA)!=0) { //generate interrupt if mask allows basePtrRD[INTERRUPTS+baseAddress] |= INTERRUPT_HAPPENED; } } basePtrRD[TIMERAH+baseAddress] = (tmp >> 8); basePtrRD[TIMERAL+baseAddress] = (tmp & 0xFF); } basePtrWR[CONTROLA+baseAddress] &= ~FORCELOADA_STROBE; //strobe is edge-sensitive basePtrRD[CONTROLA+baseAddress] = basePtrWR[CONTROLA+baseAddress]; //control-registers are readable //TimerB if ((basePtrWR[CONTROLB+baseAddress] & FORCELOADB_STROBE)!=0) { //force latch into counter (strobe-input) basePtrRD[TIMERBH+baseAddress] = basePtrWR[TIMERBH+baseAddress]; basePtrRD[TIMERBL+baseAddress] = basePtrWR[TIMERBL+baseAddress]; } //what about clocking TimerB by TimerA? (maybe not used in any music) else if ( (basePtrWR[CONTROLB+baseAddress] & (ENABLE_TIMERB|TIMERB_FROM_TIMERA)) == ENABLE_TIMERB ) { //Enabled, counts Phi2 tmp = ( (basePtrRD[TIMERBH+baseAddress]<<8) + basePtrRD[TIMERBL+baseAddress] ) - cycles;//count timer if (tmp <= 0) { //Timer counted down tmp += (basePtrWR[TIMERBH+baseAddress]<<8) + basePtrWR[TIMERBL+baseAddress]; //reload timer if ((basePtrWR[CONTROLB+baseAddress] & ONESHOT_TIMERB)!=0) { //disable if one-shot basePtrWR[CONTROLB+baseAddress] &= ~ENABLE_TIMERB; } basePtrRD[INTERRUPTS+baseAddress] |= TIMERB; if ((basePtrWR[INTERRUPTS+baseAddress] & TIMERB)!=0) { //generate interrupt if mask allows basePtrRD[INTERRUPTS+baseAddress] |= INTERRUPT_HAPPENED; } } basePtrRD[TIMERBH+baseAddress] = (tmp >> 8); basePtrRD[TIMERBL+baseAddress] = (tmp & 0xFF); } basePtrWR[CONTROLB+baseAddress] &= ~FORCELOADB_STROBE; //strobe is edge-sensitive basePtrRD[CONTROLB+baseAddress] = basePtrWR[CONTROLB+baseAddress]; //control-registers are readable return (byte)(basePtrRD[INTERRUPTS+baseAddress] & INTERRUPT_HAPPENED); } /** * Write CIA IRQ mask * * @param value the mask value to use */ public void writeCIAIRQmask (int value) { if ((value&0x80)!=0) basePtrWR[0xD+baseAddress] |= (value&0x1F); else basePtrWR[0xD+baseAddress] &= ~(value&0x1F); } /** * Acknowledge CIA IRQ */ public void acknowledgeCIAIRQ () { //reading a CIA interrupt-register clears its read-part and IRQ-flag basePtrRD[0xD+baseAddress] = 0x00; } }
7,687
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
VIC.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/sidid/VIC.java
/** * @(#)VIC.java 2023/03/19 * * ICE Team free software group * * This file is part of JIIT64 Java Ice Team Tracker 64 * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ package sw_emulator.software.sidid; /** * Emulate the VIC of cRSID original by Hermit * * @author ice00 */ public class VIC { /** Reference to the containing C64 */ C64 c64; /** Timing differences between models */ int chipModel; /** VIC-baseaddress location in C64-memory (IO)*/ int baseAddress; /** VIC-baseaddress location in host's memory for writing */ int[] basePtrWR; /** VIC-baseaddress location in host's memory for reading */ int[] basePtrRD; int rasterLines; int rasterRowCycles; int rowCycleCnt; public static final int CONTROL = 0x11; public static final int RASTERROWL = 0x12; public static final int SPRITE_ENABLE=0x15; public static final int INTERRUPT = 0x19; public static final int INTERRUPT_ENABLE = 0x1A; public static final int RASTERROWMSB = 0x80; public static final int DISPLAY_ENABLE = 0x10; public static final int ROWS = 0x08; public static final int YSCROLL_MASK = 0x07; public static final int VIC_IRQ = 0x80; public static final int RASTERROW_MATCH_IRQ = 0x01; /** * Construct the VIC * * @param C64 the C64 reference * @param baseAddress the base address in memory */ public VIC (C64 C64, int baseAddress) { this.c64 = C64; this.baseAddress = baseAddress; chipModel = 0; basePtrWR = C64.ioBankWR; basePtrRD = C64.ioBankRD; initChip(); } /** * Init the VIC chip */ void initChip () { for (int i=baseAddress; i<baseAddress+0x3F; ++i) { basePtrWR[i] = basePtrRD[i] = 0x00; } rowCycleCnt=0; } /** * Emulate the VIC * * @param cycles the processor cycles * @return if irq happened */ public byte emulateVIC (byte cycles) { int rasterRow; rowCycleCnt += cycles; if (rowCycleCnt >= rasterRowCycles) { rowCycleCnt -= rasterRowCycles; rasterRow = ( (basePtrRD[CONTROL+baseAddress]&RASTERROWMSB) << 1 ) + basePtrRD[RASTERROWL+baseAddress]; ++rasterRow; if (rasterRow >= rasterLines) rasterRow = 0; basePtrRD[CONTROL+baseAddress] = ( basePtrRD[CONTROL+baseAddress] & ~RASTERROWMSB ) | ((rasterRow&0x100)>>1); basePtrRD[RASTERROWL+baseAddress] = rasterRow & 0xFF; if ((basePtrWR[INTERRUPT_ENABLE+baseAddress] & RASTERROW_MATCH_IRQ)!=0) { if ( rasterRow == ( (basePtrWR[CONTROL+baseAddress]&RASTERROWMSB) << 1 ) + basePtrWR[RASTERROWL+baseAddress] ) { basePtrRD[INTERRUPT+baseAddress] |= VIC_IRQ | RASTERROW_MATCH_IRQ; } } } return (byte)(basePtrRD[INTERRUPT+baseAddress] & VIC_IRQ); } /** * Acknowledge VIC raster irq */ public void acknowledgeVICrasterIRQ () { //An 1 is to be written into the irq-flag (bit0) of $d019 to clear it and deassert irq signal //if (VIC->basePtrWR[INTERRUPT] & RASTERROW_MATCH_IRQ) { //acknowledge raster-interrupt by writing to $d019 bit0? //But oftentimes INC/LSR/etc. RMW commands are used to acknowledge VIC irq, they work on real //CPU because it writes the unmodified original value itself to memory before writing the modified there basePtrWR[INTERRUPT+baseAddress] &= ~RASTERROW_MATCH_IRQ; //prepare for next acknowledge-detection basePtrRD[INTERRUPT+baseAddress] &= ~(VIC_IRQ | RASTERROW_MATCH_IRQ); //remove irq flag and state } }
4,363
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
SawTriangle.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/sidid/SawTriangle.java
package sw_emulator.software.sidid; /** * * @author stefano_tognon */ public class SawTriangle { public static final char SawTriangle [] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3E, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x83, 0x83, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x87, 0x87, 0x87, 0x8F, 0xC0, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0xE0, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE3, 0xE3, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF1, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; }
25,379
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
C64.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/sidid/C64.java
/** * @(#)C64.java 2023/03/19 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ package sw_emulator.software.sidid; class Output { int L; int R; }; /** * C64 class of cRSID original by Hermit * * @author ice00 */ public class C64 { //platform-related: int sampleRate; //int bufferSize; boolean highQualitySID; char sidChipCount; char stereo; char playbackSpeed; //char Paused; //C64-machine related: int videoStandard; //0:NTSC, 1:PAL (based on the sid-header field) int cpuFrequency; int sampleClockRatio; //ratio of cpu-clock and samplerate int selectedSIDmodel; char mainVolume; //SID-file related: private PSID psid; //union { // cRSID_SIDheader* SIDheader; // char* SIDfileData; int attenuation; boolean realSIDmode; boolean psidDigiMode; int subTune; int loadAddress; int initAddress; int playAddress; int endAddress; int timerSource; //for current subtune, 0:VIC, 1:cia (as in sid-header) //PSID-playback related: //char SoundStarted; //char CIAisSet; //for dynamic cia setting from player-routine (RealSID substitution) int frameCycles; int frameCycleCnt; //this is a substitution in PSID-mode for cia/VIC counters int prevRasterLine; int sampleCycleCnt; int overSampleCycleCnt; int tenthSecondCnt; int secondCnt; int playTime; boolean finished; char returned; char irq; //collected irq line from devices char nmi; //collected nmi line from devices int periodCounter=0; int sampleAddress=0; //Hardware-elements: CPU cpu; SID[] sid=new SID[4]; //CRSID_SIDCOUNT_MAX+1]; CIA[] cia=new CIA[2]; //CRSID_CIACOUNT+1]; VIC vic; //Overlapping system memories, which one is read/written in an address region depends on cpu-port bankselect-bits) //Address $00 and $01 - data-direction and data-register of port built into cpu (used as bank-selection) (overriding RAM on c64) int[] ramBank=new int[0x10100]; //$0000..$FFFF RAM (and RAM under IO/ROM/CPUport) int[] ioBankWR=new int[0x10100]; //$D000..$DFFF IO-RAM (registers) to write (VIC/SID/CIA/ColorRAM/IOexpansion) int[] ioBankRD=new int[0x10100]; //$D000..$DFFF IO-RAM (registers) to read from (VIC/SID/CIA/ColorRAM/IOexpansion) int[] romBanks=new int[0x10100]; //$1000..$1FFF/$9000..$9FFF (CHARGEN), $A000..$BFFF (BASIC), $E000..$FFFF (KERNAL) short ROM_IRQreturnCode[] = {0xAD,0x0D,0xDC,0x68,0xA8,0x68,0xAA,0x68,0x40}; //CIA1-acknowledge irq-return short ROM_NMIstartCode[] = {0x78,0x6c,0x18,0x03,0x40}; //SEI and jmp($0318) short ROM_IRQBRKstartCode[] = { //Full irq-return (handling BRK with the same RAM vector as irq) 0x48,0x8A,0x48,0x98,0x48,0xBA,0xBD,0x04,0x01,0x29,0x10,0xEA,0xEA,0xEA,0xEA,0xEA,0x6C,0x14,0x03 }; public static final int C64_PAL_CPUCLK=985248; public static final int C64_NTSC_CPUCLK=1022727; public static final int DEFAULT_SAMPLERATE=44100; public static final int C64_PAL_SCANLINES = 312; public static final int C64_NTSC_SCANLINES = 263; public static final int C64_PAL_SCANLINE_CYCLES = 63; public static final int C64_NTSC_SCANLINE_CYCLES = 65; public static final int CPUspeeds[] = { C64_NTSC_CPUCLK, C64_PAL_CPUCLK }; public static final int ScanLines[] = { C64_NTSC_SCANLINES, C64_PAL_SCANLINES }; public static final int ScanLineCycles[] = { C64_NTSC_SCANLINE_CYCLES, C64_PAL_SCANLINE_CYCLES }; public static final int Attenuations[]={0,26,43,137}; //increase for 2SID (to 43) and 3SID (to 137) public static final int DIGI_VOLUME = 1200; public static final int OVERSAMPLING_RATIO=7; public static final int OVERSAMPLING_CYCLES = ((C64_PAL_CPUCLK/DEFAULT_SAMPLERATE)/OVERSAMPLING_RATIO); public C64(int samplerate) { //init a basic PAL c64 instance if (samplerate!=0) { sampleRate = samplerate; } else { sampleRate = samplerate = DEFAULT_SAMPLERATE; } sampleClockRatio = (C64_PAL_CPUCLK << 4) / samplerate; //shifting (multiplication) enhances sampleClockRatio precision attenuation = 26; sidChipCount = 1; //default c64 setup with only 1 sid and 2 CIAs and 1 VIC cpu=new CPU(this); sid[0]=new SID(this, 8580, PSID.CRSID_CHANNEL_BOTH, 0xD400); cia[0]=new CIA(this, 0xDC00); cia[1]=new CIA(this, 0xDD00); vic=new VIC(this, 0xD000); setROMcontent(); initC64(); } /** * set hardware-parameters (Models, SIDs) for playback of loaded SID-tune */ void setC64(PSID psid) { int sidModel; int sidChipCount; int sidChannel; this.psid=psid; videoStandard = (((psid.modelFormatStandard & 0x0C) >> 2) != 2) ? 1:0; if (sampleRate == 0) { sampleRate = 44100; } cpuFrequency = CPUspeeds[videoStandard]; sampleClockRatio = (cpuFrequency << 4) / sampleRate; //shifting (multiplication) enhances sampleClockRatio precision vic.rasterLines = ScanLines[videoStandard]; vic.rasterRowCycles = ScanLineCycles[videoStandard]; frameCycles = vic.rasterLines * vic.rasterRowCycles; ///SampleRate / PAL_FRAMERATE; //1x speed tune with VIC Vertical-blank timing prevRasterLine = -1; //so if $d012 is set once only don't disturb frameCycleCnt sidModel = ((psid.modelFormatStandard & 0x30) >= 0x20) ? 8580 : 6581; sid[0].chipModel = (selectedSIDmodel!=0) ? selectedSIDmodel : sidModel; if (psid.version != PSID.CRSID_FILEVERSION_WEBSID) { sid[0].channel = PSID.CRSID_CHANNEL_LEFT; sidModel = psid.modelFormatStandard & 0xC0; if (sidModel!=0) { sidModel = (sidModel >= 0x80) ? 8580 : 6581; } else { sidModel = sid[0].chipModel; } if (selectedSIDmodel!=0) { sidModel = selectedSIDmodel; } sid[1]=new SID(this, sidModel, PSID.CRSID_CHANNEL_RIGHT, 0xD000 + psid.sid2baseAddress * 16); sidModel = psid.modelFormatStandardH & 0x03; if (sidModel!=0) { sidModel = (sidModel >= 0x02) ? 8580 : 6581; } else { sidModel = sid[0].chipModel; } if (selectedSIDmodel!=0) { sidModel = selectedSIDmodel; } sid[2]=new SID(this, sidModel, PSID.CRSID_CHANNEL_BOTH, 0xD000 + psid.sid3baseAddress * 16); sid[3]=new SID(this, sidModel, 0, 0); //ensure disabling SID4 in non-WebSID format } else { sid[0].channel = ((psid.modelFormatStandardH & 0x40)!=0) ? PSID.CRSID_CHANNEL_RIGHT : PSID.CRSID_CHANNEL_LEFT; if ((psid.modelFormatStandardH & 0x80)!=0) { sid[0].channel = PSID.CRSID_CHANNEL_BOTH; //my own proposal for 'middle' channel } sidModel = psid.sid2flagsL & 0x30; sidChannel = ((psid.sid2flagsL & 0x40)!=0) ? PSID.CRSID_CHANNEL_RIGHT : PSID.CRSID_CHANNEL_LEFT; if ((psid.sid2flagsL & 0x80)!=0) { sidChannel = PSID.CRSID_CHANNEL_BOTH; } if (sidModel!=0) { sidModel = (sidModel >= 0x20) ? 8580 : 6581; } else { sidModel = sid[0].chipModel; } if (selectedSIDmodel!=0) { sidModel = selectedSIDmodel; } sid[1]=new SID(this, sidModel, sidChannel, 0xD000 + psid.sid2baseAddress * 16); sidModel = psid.sid3flagsL & 0x30; sidChannel = ((psid.sid3flagsL & 0x40)!=0) ? PSID.CRSID_CHANNEL_RIGHT : PSID.CRSID_CHANNEL_LEFT; if ((psid.sid3flagsL & 0x80)!=0) { sidChannel = PSID.CRSID_CHANNEL_BOTH; } if (sidModel!=0) { sidModel = (sidModel >= 0x20) ? 8580 : 6581; } else { sidModel = sid[0].chipModel; } if (selectedSIDmodel!=0) { sidModel = selectedSIDmodel; } sid[2]=new SID(this, sidModel, sidChannel, 0xD000 + psid.sid3flagsH * 16); sidModel = psid.sid4flagsL & 0x30; sidChannel = ((psid.sid4flagsL & 0x40)!=0) ? PSID.CRSID_CHANNEL_RIGHT : PSID.CRSID_CHANNEL_LEFT; if ((psid.sid4flagsL & 0x80)!=0) { sidChannel = PSID.CRSID_CHANNEL_BOTH; } if (sidModel!=0) { sidModel = (sidModel >= 0x20) ? 8580 : 6581; } else { sidModel = sid[0].chipModel; } if (selectedSIDmodel!=0) { sidModel = selectedSIDmodel; } sid[3]=new SID(this, sidModel, sidChannel, 0xD000 + psid.sid4baseAddress * 16); } sidChipCount = 1 + ((sid[1].baseAddress > 0)?1:0) + ((sid[2].baseAddress > 0)?1:0) + ((sid[3].baseAddress > 0)?1:0); if (sidChipCount == 1) sid[0].channel = PSID.CRSID_CHANNEL_BOTH; attenuation = Attenuations[sidChipCount]; } /** * C64 Reset */ void initC64() { sid[0].initChip(); cia[0].initChip(); cia[1].initChip(); initMem(); cpu.initCPU((readMemC64(0xFFFD) << 8) + readMemC64(0xFFFC)); irq = nmi = 0; if (highQualitySID) { sid[0].nonFiltedSample = sid[0].filterInputSample = 0; sid[1].nonFiltedSample = sid[1].filterInputSample = 0; sid[2].nonFiltedSample = sid[2].filterInputSample = 0; sid[3].nonFiltedSample = sid[3].filterInputSample = 0; sid[0].prevNonFiltedSample = sid[0].prevFilterInputSample = 0; sid[1].prevNonFiltedSample = sid[1].prevFilterInputSample = 0; sid[2].prevNonFiltedSample = sid[2].prevFilterInputSample = 0; sid[3].prevNonFiltedSample = sid[3].prevFilterInputSample = 0; } sampleCycleCnt = overSampleCycleCnt = 0; } public Output emulateC64() { byte InstructionCycles; int HQsampleCount=0; int Tmp; Output output=new Output(); SIDwavOutput sidWavOutput; //Cycle-based part of emulations: while (sampleCycleCnt <= sampleClockRatio) { if (!realSIDmode) { if (frameCycleCnt >= frameCycles) { frameCycleCnt -= frameCycles; if (finished) { //some tunes (e.g. Barbarian, A-Maze-Ing) doesn't always finish in 1 frame cpu.initCPU(playAddress); //(PSID docs say bank-register should always be set for each call's region) finished = false; //SampleCycleCnt=0; //PSID workaround for some tunes (e.g. Galdrumway): if (timerSource == 0) { ioBankRD[0xD019] = (byte)0x81; //always simulate to player-calls that VIC-irq happened } else { ioBankRD[0xDC0D] = (byte)0x83; //always simulate to player-calls that CIA TIMERA/TIMERB-irq happened } } } if (!finished) { InstructionCycles = cpu.emulateCPU(); if ((InstructionCycles & 0xFF) >= 0xFE) { InstructionCycles = 6; finished = true; } } else { InstructionCycles = 7; //idle between player-calls } frameCycleCnt += InstructionCycles; ioBankRD[0xDC04] += InstructionCycles; //very simple CIA1 TimerA simulation for PSID (e.g. Delta-Mix_E-Load_loader) } else { //RealSID emulations: if (cpu.handleCPUinterrupts()) { finished = false; InstructionCycles = 7; } else if (!finished) { InstructionCycles = cpu.emulateCPU(); if ((InstructionCycles & 0xFF) >= 0xFE) { InstructionCycles = 6; finished = true; } } else { InstructionCycles = 7; //idle between irq-calls } irq = nmi = 0; //prepare for collecting irq sources irq |= cia[0].emulateCIA(InstructionCycles); nmi |= cia[1].emulateCIA(InstructionCycles); irq |= vic.emulateVIC(InstructionCycles); } sampleCycleCnt += (InstructionCycles << 4); sid[0].emulateADSRs(InstructionCycles); if (sid[1].baseAddress != 0) { sid[1].emulateADSRs(InstructionCycles); } if (sid[2].baseAddress != 0) { sid[2].emulateADSRs(InstructionCycles); } if (sid[3].baseAddress != 0) { sid[3].emulateADSRs(InstructionCycles); } } sampleCycleCnt -= sampleClockRatio; if (highQualitySID) { //oversampled waveform-generation HQsampleCount = 0; sid[0].nonFiltedSample = sid[0].filterInputSample = 0; sid[1].nonFiltedSample = sid[1].filterInputSample = 0; sid[2].nonFiltedSample = sid[2].filterInputSample = 0; sid[3].nonFiltedSample = sid[3].filterInputSample = 0; while (overSampleCycleCnt <= sampleClockRatio) { sidWavOutput = sid[0].emulateHQwaves(OVERSAMPLING_CYCLES); sid[0].nonFiltedSample += sidWavOutput.nonFilted; sid[0].filterInputSample += sidWavOutput.filterInput; if (sid[1].baseAddress != 0) { sidWavOutput = sid[1].emulateHQwaves(OVERSAMPLING_CYCLES); sid[1].nonFiltedSample += sidWavOutput.nonFilted; sid[1].filterInputSample += sidWavOutput.filterInput; } if (sid[2].baseAddress != 0) { sidWavOutput = sid[2].emulateHQwaves(OVERSAMPLING_CYCLES); sid[2].nonFiltedSample += sidWavOutput.nonFilted; sid[2].filterInputSample += sidWavOutput.filterInput; } if (sid[3].baseAddress != 0) { sidWavOutput = sid[3].emulateHQwaves(OVERSAMPLING_CYCLES); sid[3].nonFiltedSample += sidWavOutput.nonFilted; sid[3].filterInputSample += sidWavOutput.filterInput; } ++HQsampleCount; overSampleCycleCnt += (OVERSAMPLING_CYCLES << 4); } overSampleCycleCnt -= sampleClockRatio; } //Samplerate-based part of emulations: if (!realSIDmode) { //some PSID tunes use CIA TOD-clock (e.g. Kawasaki Synthesizer Demo) --tenthSecondCnt; if (tenthSecondCnt <= 0) { tenthSecondCnt = sampleRate / 10; ++(ioBankRD[0xDC08]); if (ioBankRD[0xDC08] >= 10) { ioBankRD[0xDC08] = 0; ++(ioBankRD[0xDC09]); //if(c64->ioBankRD[0xDC09]% } } } if (secondCnt < sampleRate) ++secondCnt; else { secondCnt = 0; if(playTime<3600) ++playTime; } if (!highQualitySID) { if (stereo == 0 || sidChipCount == 1) { output.L = output.R = sid[0].emulateWaves(); if (sid[1].baseAddress != 0) { output.L = output.R += sid[1].emulateWaves(); } if (sid[2].baseAddress != 0) { output.L = output.R += sid[2].emulateWaves(); } if (sid[3].baseAddress != 0) { output.L = output.R += sid[3].emulateWaves(); } } else { Tmp = sid[0].emulateWaves(); switch (sid[0].channel) { case PSID.CRSID_CHANNEL_LEFT: output.L = Tmp * 2; output.R = 0; break; case PSID.CRSID_CHANNEL_RIGHT: output.R = Tmp * 2; output.L = 0; break; default: output.L = output.R = Tmp; break; } if (sid[1].baseAddress != 0) { Tmp = sid[1].emulateWaves(); switch (sid[1].channel) { case PSID.CRSID_CHANNEL_LEFT: output.L += Tmp * 2; break; case PSID.CRSID_CHANNEL_RIGHT: output.R += Tmp * 2; break; default: output.L += Tmp; output.R += Tmp; break; } } if (sid[2].baseAddress != 0) { Tmp = sid[2].emulateWaves(); switch (sid[2].channel) { case PSID.CRSID_CHANNEL_LEFT: output.L += Tmp * 2; break; case PSID.CRSID_CHANNEL_RIGHT: output.R += Tmp * 2; break; default: output.L += Tmp; output.R += Tmp; break; } } if (sid[3].baseAddress != 0) { Tmp = sid[3].emulateWaves(); switch (sid[3].channel) { case PSID.CRSID_CHANNEL_LEFT: output.L += Tmp * 2; break; case PSID.CRSID_CHANNEL_RIGHT: output.R += Tmp * 2; break; default: output.L += Tmp; output.R += Tmp; break; } } } } else { //SID output-stages and mono/stereo handling for High-Quality SID-emulation sid[0].nonFiltedSample /= HQsampleCount; sid[0].filterInputSample /= HQsampleCount; if (sid[1].baseAddress != 0) { sid[1].nonFiltedSample /= HQsampleCount; sid[1].filterInputSample /= HQsampleCount; } if (sid[2].baseAddress != 0) { sid[2].nonFiltedSample /= HQsampleCount; sid[2].filterInputSample /= HQsampleCount; } if (sid[3].baseAddress != 0) { sid[3].nonFiltedSample /= HQsampleCount; sid[3].filterInputSample /= HQsampleCount; } if (stereo == 0 || sidChipCount == 1) { output.L = output.R = sid[0].emulateSIDoutputStage(); if (sid[1].baseAddress != 0) { output.L += sid[1].emulateSIDoutputStage(); } if (sid[2].baseAddress != 0) { output.L += sid[2].emulateSIDoutputStage(); } if (sid[3].baseAddress != 0) { output.L += sid[3].emulateSIDoutputStage(); } output.R = output.L; } else { Tmp = sid[0].emulateSIDoutputStage(); switch (sid[0].channel) { case PSID.CRSID_CHANNEL_LEFT: output.L = Tmp * 2; output.R = 0; break; case PSID.CRSID_CHANNEL_RIGHT: output.R = Tmp * 2; output.L = 0; break; default: output.L = output.R = Tmp; break; } if (sid[1].baseAddress != 0) { Tmp = sid[1].emulateSIDoutputStage(); switch (sid[1].channel) { case PSID.CRSID_CHANNEL_LEFT: output.L += Tmp * 2; break; case PSID.CRSID_CHANNEL_RIGHT: output.R += Tmp * 2; break; default: output.L += Tmp; output.R += Tmp; break; } } if (sid[2].baseAddress != 0) { Tmp = sid[2].emulateSIDoutputStage(); switch (sid[2].channel) { case PSID.CRSID_CHANNEL_LEFT: output.L += Tmp * 2; break; case PSID.CRSID_CHANNEL_RIGHT: output.R += Tmp * 2; break; default: output.L += Tmp; output.R += Tmp; break; } } if (sid[3].baseAddress != 0) { Tmp = sid[3].emulateSIDoutputStage(); switch (sid[3].channel) { case PSID.CRSID_CHANNEL_LEFT: output.L += Tmp * 2; break; case PSID.CRSID_CHANNEL_RIGHT: output.R += Tmp * 2; break; default: output.L += Tmp; output.R += Tmp; break; } } } } //average level (for VU-meter) sid[0].level += ((Math.abs(sid[0].output) >> 4) - sid[0].level) / 1024; if (sid[1].baseAddress != 0) { sid[1].level += ((Math.abs(sid[1].output) >> 4) - sid[1].level) / 1024; } if (sid[2].baseAddress != 0) { sid[2].level += ((Math.abs(sid[2].output) >> 4) - sid[2].level) / 1024; } if (sid[3].baseAddress != 0) sid[3].level += ((Math.abs(sid[3].output) >> 4) - sid[3].level) / 1024; /* output = sid[0].emulateWaves(); if (sid[1].baseAddress != 0) { output += sid[1].emulateWaves(); } if (sid[2].baseAddress != 0) { output += sid[2].emulateWaves(); } */ return output; } /** * Play digi * * @return the output value */ public int playPSIDdigi() { int shifts; int ratePeriod; boolean playbackEnabled = false; int nybbleCounter = 0; int repeatCounter = 0; int output = 0; if (ioBankWR[0xD41D]!=0) { playbackEnabled = (ioBankWR[0xD41D] >= 0xFE); periodCounter = 0; nybbleCounter = 0; sampleAddress = ioBankWR[0xD41E] + (ioBankWR[0xD41F] << 8); repeatCounter = ioBankWR[0xD43F]; } ioBankWR[0xD41D] = 0; if (playbackEnabled) { ratePeriod = ioBankWR[0xD45D] + (ioBankWR[0xD45E] << 8); if (ratePeriod!=0) { periodCounter += cpuFrequency / ratePeriod; } if (periodCounter >= sampleRate) { periodCounter -= sampleRate; if (sampleAddress < ioBankWR[0xD43D] + (ioBankWR[0xD43E] << 8)) { if (nybbleCounter!=0) { shifts = ioBankWR[0xD47D]!=0 ? 4 : 0; ++sampleAddress; } else { shifts = ioBankWR[0xD47D]!=0 ? 0 : 4; } output = (((ramBank[sampleAddress] >> shifts) & 0xF) - 8) * DIGI_VOLUME; //* (c64->ioBankWR[0xD418]&0xF); nybbleCounter ^= 1; } else if (repeatCounter!=0) { sampleAddress = ioBankWR[0xD47F] + (ioBankWR[0xD47E] << 8); repeatCounter--; } } } return output; } /** * Fill KERNAL/BASIC-ROM areas with content needed for SID-playback */ public void setROMcontent() { int i; for (i = 0xA000; i < 0x10000; ++i) { romBanks[i] = 0x60; //RTS (at least return if some unsupported call is made to ROM) } //for (i=0; i<sizeof(KERNAL); ++i) romBanks[0xE000+i] = KERNAL[i]; for (i = 0xEA31; i < 0xEA7E; ++i) { romBanks[i] = 0xEA; //NOP (full irq-return leading to simple irq-return without other tasks) } for (i = 0; i < 9; ++i) { romBanks[0xEA7E + i] = ROM_IRQreturnCode[i]; } for (i = 0; i < 4; ++i) { romBanks[0xFE43 + i] = ROM_NMIstartCode[i]; } for (i = 0; i < 19; ++i) { romBanks[0xFF48 + i] = ROM_IRQBRKstartCode[i]; } romBanks[0xFFFB] = 0xFE; romBanks[0xFFFA] = 0x43; //ROM nmi-vector romBanks[0xFFFF] = 0xFF; romBanks[0xFFFE] = 0x48; //ROM irq-vector //copy KERNAL & BASIC ROM contents into the RAM under them? (So PSIDs that don't select bank correctly will work better.) for (i = 0xA000; i < 0x10000; ++i) { ramBank[i] = romBanks[i]; } } /** * Set default values that normally KERNEL ensures after startup/reset (only SID-playback related) */ public void initMem() { int i; //data required by both PSID and RSID (according to HVSC SID_file_format.txt): writeMemC64(0x02A6, videoStandard); //$02A6 should be pre-set to: 0:NTSC / 1:PAL writeMemC64(0x0001, 0x37); //initialize bank-reg. (ROM-banks and IO enabled) //if (romBanks[0xE000]==0) { //wasn't a KERNAL-ROM loaded? (e.g. PSID) writeMemC64(0x00CB, 0x40); //Some tunes might check for keypress here (e.g. Master Blaster Intro) //if(realSIDmode) { writeMemC64(0x0315, 0xEA); writeMemC64(0x0314, 0x31); //IRQ writeMemC64(0x0319, 0xEA/*0xFE*/); writeMemC64(0x0318, 0x81/*0x47*/); //NMI //} for (i = 0xD000; i < 0xD7FF; ++i) { ioBankRD[i] = ioBankWR[i] = 0; //initialize the whole IO area for a known base-state } if (realSIDmode) { ioBankWR[0xD012] = 0x37; ioBankWR[0xD011] = 0x8B; } //else ioBankWR[0xD012] = 0; //IObankWR[0xD019] = 0; //PSID: rasterrow: any value <= $FF, irq:enable later if there is VIC-timingsource ioBankRD[0xDC00] = 0x10; ioBankRD[0xDC01] = 0xFF; //Imitate CIA1 keyboard/joy port, some tunes check if buttons are not pressed if (videoStandard!=0) { ioBankWR[0xDC04] = 0x24; ioBankWR[0xDC05] = 0x40; } //initialize CIAs else { ioBankWR[0xDC04] = 0x95; ioBankWR[0xDC05] = 0x42; } if (realSIDmode) { ioBankWR[0xDC0D] = 0x81; //Reset-default, but for PSID CIA1 TimerA irq should be enabled anyway if SID is CIA-timed } ioBankWR[0xDC0E] = 0x01; //some tunes (and PSID doc) expect already running CIA (Reset-default) ioBankWR[0xDC0F] = 0x00; //All counters other than CIA1 TimerA should be disabled and set to 0xFF for PSID: ioBankWR[0xDD00] = ioBankRD[0xDD00] = 0x03; //VICbank-selector default ioBankWR[0xDD04] = ioBankWR[0xDD05] = 0xFF; //IObankWR[0xDD0E] = IObank[0xDD0F] = 0x00; } /** * Write data in C64 memory * * @param address the address of mempry * @param data the data to store */ public void writeMemC64(int address, int data) { if (address < 0xD000 || 0xE000 <= address) { ramBank[address]=data; return; } else if ((ramBank[1] & 3)!=0) { //handle SID-mirrors! (CJ in the USA workaround (writing above $d420, except SID2/SID3/PSIDdigi)) if (0xD420 <= address && address < 0xD800) { //CIA/VIC mirrors needed? if (!(psidDigiMode && (0xD418 <= address) && (address < 0xD500)) && !(sid[1].baseAddress <= address && address < sid[1].baseAddress + 0x20) && !(sid[2].baseAddress <= address && address < sid[2].baseAddress + 0x20) && !(sid[3].baseAddress <= address && address < sid[3].baseAddress + 0x20)) { //write to $D400..D41F if not in SID2/SID3 address-space ioBankWR[0xD400 + (address & 0x1F)]=data; return; } else { ioBankWR[address]=data; return; } } else { ioBankWR[address]=data; return; } } ramBank[address]=data; } /** * Read data from C64 memory * * @param address the address of memory * @return the read data */ public int readMemC64(int address) { if (address < 0xA000) { return ramBank[address]; } else if (0xD000 <= address && address < 0xE000 && ((ramBank[1] & 3)!=0)) { if (0xD400 <= address && address < 0xD419) { //emulate peculiar SID-read (e.g. Lift Off) return ioBankWR[address]; } return ioBankRD[address]; } else if ((address < 0xC000 && (ramBank[1] & 3) == 3) || (0xE000 <= address && ((ramBank[1] & 2))!=0)) { return romBanks[address]; } return ramBank[address]; } }
27,496
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
MemoryFlags.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/memory/MemoryFlags.java
/** * @(#)MemoryFlags.java 2003/10/13 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.memory; import sw_emulator.software.memory.memoryState; import java.io.FileInputStream; import java.io.BufferedInputStream; import java.io.FileNotFoundException; import java.io.IOException; /** * Define a memory state of one program. * The state is given by flags like in Sidln program. * * @author Ice * @version 1.00 13/10/2003 */ public class MemoryFlags implements memoryState { /** the memory with the sidln flags */ byte[] memory; /** * Construct a memory flags status with the passed names of files * * @param names the names of the files */ public MemoryFlags(String[] names) { if (names==null) { // all memory is of execution memory=getExecMemory(0, 65535); } else { // memory is from files memory=realAllBinFile(names); } } /** * Construct a memory area with given value * * @param memory thew mmeory to use */ public MemoryFlags(byte[] memory) { this.memory=memory; } /** * Get the memory state likes that all memory locations are of cpu instructions * * @param startAddress the starting address of the memory to return * @param endAddress the ending address of memory to return * @return the state of memory as a array of SIDLN flags from * <code>startAddress</code> and <code>endAddress</code> */ protected byte[] getExecMemory(int startAddress, int endAddress) { if (endAddress<startAddress) return null; byte[] res=new byte[endAddress-startAddress]; for (int i=0; i<endAddress-startAddress; i++) { res[i]=memoryState.MEM_EXECUTE; } return res; } /** * Get the memory state as an array of SIDLN flags * * @param startAddress the starting address of the memory to return * @param endAddress the ending address of memory to return * @return the state of memory as a array of SIDLN flags from * <code>startAddress</code> and <code>endAddress</code> */ @Override public byte[] getMemoryState(int startAddress, int endAddress) { if (endAddress<startAddress) return null; int size; byte[] res=new byte[size=endAddress-startAddress]; for (int i=0; i<size; i++) { // copy the needed portion res[i]=memory[startAddress+i]; } return res; } /** * Read a BIN raw image of SIDLN flags * * @param name the name of the file to open * @return the memory read from file */ protected byte[] readBinFile(String name) { int result=0; // result of reading byte int done=0; // number of bytes done byte[] memory=new byte[65536]; byte[] header=new byte[16]; BufferedInputStream file; System.out.println("Reading file: "+name); // see if the file is present try { file=new BufferedInputStream(new FileInputStream(name)); } catch (FileNotFoundException e) { System.out.println("Input file not found: abort"+e); return null; } catch (SecurityException e1) { System.out.println("Security exception in open the input file: abort\n"); return null; } // reading the header of file try { for (;;) { result=file.read(header, done, header.length-done); done+=result; if (done>=header.length) break; if (result<=0) { System.out.println("Not all the bytes readed from "+name); return null; } } } catch (IOException e) { System.err.println(e); return null; } String sHeader=new String(header); if (!sHeader.equals("SIDLD RAM FLAGS ")) { System.out.println("Not a valid SIDLN ram image found"); } done=0; // reading the body of file try { for (;;) { result=file.read(memory, done, memory.length-done); done+=result; if (done>=memory.length) break; if (result<=0) { System.out.println("Not all the bytes readed from "+name); return null; } } file.close(); } catch (IOException e) { System.err.println(e); return null; } return memory; } /** * Read all the passed raw bin files and compact all the information * * @param names the names of the files * @return the conpacted memory state of all files */ protected byte[] realAllBinFile(String[] names) { byte[] memory=new byte[65536]; byte[] res; for (int i=0; i<names.length; i++) { res=readBinFile(names[i]); memory=orMemory(res,memory); } return memory; } /** * Make the or of two memory map * * @param mem1 the firt mempry map * @param mem2 the second memory map * @return the resulting memory map */ public byte[] orMemory(byte[] mem1, byte[] mem2) { byte[] res=new byte[65536]; for (int i=0; i<res.length; i++) { res[i]=(byte)(mem1[i] | mem2[i]); } return res; } }
5,939
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
memoryState.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/memory/memoryState.java
/** * @(#)memoryState.java 2003/10/13 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.memory; /** * The interface <code>memoryState</code> represents the internal * state of a memory. * * Some definitions are taken from Sidln source * * @author Ice * @version 1.00 13/10/2003 */ public interface memoryState { public final int MEM_NONE = 0x00; public final int MEM_READ = 0x01; public final int MEM_WRITE = 0x02; public final int MEM_EXECUTE = 0x04; public final int MEM_READ_FIRST = 0x10; public final int MEM_WRITE_FIRST = 0x20; public final int MEM_EXECUTE_FIRST = 0x40; public final int MEM_SAMPLE = 0x80; /** * Get the memory state as an array of SIDLN flags * * @param startAddress the starting address of the memory to return * @param endAddress the ending address of memory to return * @return the state of memory as a array of SIDLN flags from * <code>startAddress</code> and <code>endAddress</code> */ public byte[] getMemoryState(int startAddress, int endAddress); }
1,930
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
Patch.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/memory/Patch.java
/** * @(#)Patch.java 1999/10/18 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.memory; import sw_emulator.hardware.memory.Memory; import java.lang.ArrayIndexOutOfBoundsException; /** * Define a memory patch. * A patch is a memory address and some lists of patch bytes (one list for each * available patch for that address). * * @author Ice * @version 1.00 18/10/1999 */ public class Patch { /** * Memory address where insert the pacth */ protected int address; /** * The patch values */ protected byte[][] values; /** * Construct a memory patch. * The passed <code>values</code> is an array of array where first is the * number of patches available and the others are the byte values. * * @param address memory address where insert the patch * @param values the patch values */ public Patch(int address, byte[][] values) { this.address=address; this.values=values; } /** * Use the patch. * To the passed <code>memory</code> will be insert the pacth. * * @param number the number of the patch * @param memory the memory where insert the patch */ public void usePatch(int number, Memory memory) { int i; try { for (i=0; i<values[number].length; i++) { memory.change(address, values[number][i]); } } catch (ArrayIndexOutOfBoundsException e) {} } }
2,213
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
KernalPatcher.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/memory/KernalPatcher.java
/** * @(#)KernalPatcher.java 1999/10/18 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.memory; import sw_emulator.hardware.memory.ROM; /** * Patch the kernal of C64 for many purpose: * Change kernal revision: R1, R2, R3, SX-64 or DX-64, 4096 aka Pet64 aka * Educator 64 * * Note: all the changes that this class makes is done to the passed Rom image. * * @author Ice * @version 1.00 18/10/1999 */ public class KernalPatcher { /** * A reference to the actual kernal ROM image */ protected ROM kernal; private Patch revE119=new Patch(0xE119, new byte[][]{ {(byte)0xC9, (byte)0xFF}, {(byte)0xAD, (byte)0xE4}, {(byte)0xAD, (byte)0xE4}, {(byte)0xAD, (byte)0xE4}, {(byte)0xAD, (byte)0xE4} }); private Patch revE42D=new Patch(0xE42D, new byte[][]{ {0x20, 0x1E, (byte)0xAB}, {0x20, 0x1E, (byte)0xAB}, {0x20, 0x1E, (byte)0xAB}, {0x20, 0x1E, (byte)0xAB}, {0x4C, 0x41, (byte)0xE4} }); private Patch revE477=new Patch(0xE477, new byte[][]{ {0x20, 0x20, 0x2A, 0x2A, 0x2A, 0x2A, 0x20, 0x43, 0x4F, 0x4D, 0x4D, 0x4F, 0x44, 0x4F, 0x52, 0x45, 0x20, 0x36, 0x34, 0x20, 0x42, 0x41, 0x53, 0x49, 0x43, 0x20, 0x56, 0x32, 0x20, 0x2A, 0x2A, 0x2A, 0x2A, 0x0D, 0x0D, 0x20, 0x36, 0x34, 0x4B, 0x20, 0x52, 0x41, 0x4D, 0x20, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4D, 0x20, 0x20, 0x00, 0x2B}, {0x20, 0x20, 0x2A, 0x2A, 0x2A, 0x2A, 0x20, 0x43, 0x4F, 0x4D, 0x4D, 0x4F, 0x44, 0x4F, 0x52, 0x45, 0x20, 0x36, 0x34, 0x20, 0x42, 0x41, 0x53, 0x49, 0x43, 0x20, 0x56, 0x32, 0x20, 0x2A, 0x2A, 0x2A, 0x2A, 0x0D, 0x0D, 0x20, 0x36, 0x34, 0x4B, 0x20, 0x52, 0x41, 0x4D, 0x20, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4D, 0x20, 0x20, 0x00, 0x5C}, {0x20, 0x20, 0x2A, 0x2A, 0x2A, 0x2A, 0x20, 0x43, 0x4F, 0x4D, 0x4D, 0x4F, 0x44, 0x4F, 0x52, 0x45, 0x20, 0x36, 0x34, 0x20, 0x42, 0x41, 0x53, 0x49, 0x43, 0x20, 0x56, 0x32, 0x20, 0x2A, 0x2A, 0x2A, 0x2A, 0x0D, 0x0D, 0x20, 0x36, 0x34, 0x4B, 0x20, 0x52, 0x41, 0x4D, 0x20, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4D, 0x20, 0x20, 0x00, (byte)0x81}, {0x20, 0x20, 0x20, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x20, 0x20, 0x53, 0x58, 0x2D, 0x36, 0x34, 0x20, 0x42, 0x41, 0x53, 0x49, 0x43, 0x20, 0x56, 0x32, 0x2E, 0x30, 0x20, 0x20, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x0D, 0x0D, 0x20, 0x36, 0x34, 0x4B, 0x20, 0x52, 0x41, 0x4D, 0x20, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4D, 0x20, 0x20, 0x00, (byte)0xB3}, {0x2A, 0x2A, 0x2A, 0x2A, 0x20, 0x43, 0x4F, 0x4D, 0x4D, 0x4F, 0x44, 0x4F, 0x52, 0x45, 0x20, 0x34, 0x30, 0x36, 0x34, 0x20, 0x20, 0x42, 0x41, 0x53, 0x49, 0x43, 0x20, 0x56, 0x32, 0x2E, 0x30, 0x20, 0x2A, 0x2A, 0x2A, 0x2A, 0x0D, 0x0D, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63} }); private Patch revE4AD=new Patch(0xE4AD, new byte[][]{ {(byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA}, {0x48, 0x20, (byte)0xC9, (byte)0xFF, (byte)0xAA, 0x68, (byte)0x90, 0x01, (byte)0x8A, 0x60}, {0x48, 0x20, (byte)0xC9, (byte)0xFF, (byte)0xAA, 0x68, (byte)0x90, 0x01, (byte)0x8A, 0x60}, {0x48, 0x20, (byte)0xC9, (byte)0xFF, (byte)0xAA, 0x68, (byte)0x90, 0x01, (byte)0x8A, 0x60}, {0x48, 0x20, (byte)0xC9, (byte)0xFF, (byte)0xAA, 0x68, (byte)0x90, 0x01, (byte)0x8A, 0x60}, }); private Patch revE4C8=new Patch(0xE4C8, new byte[][]{ {(byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA}, {(byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAD, 0x21, (byte)0xD0, (byte)0x91, (byte)0xF3, 0x60, 0x69, 0x02, (byte)0xA4, (byte)0x91, (byte)0xC8, (byte)0xD0, 0x04, (byte)0xC5, (byte)0xA1, (byte)0xD0, (byte)0xF7, 0x60, 0x19, 0x26, 0x44, 0x19, 0x1A, 0x11, (byte)0xE8, 0x0D, 0x70, 0x0C, 0x06, 0x06, (byte)0xD1, 0x02, 0x37, 0x01, (byte)0xAE, 0x00, 0x69, 0x00}, {(byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0x85, (byte)0xA9, (byte)0xA9, 0x01, (byte)0x85, (byte)0xAB, 0x60, (byte)0xAD, (byte)0x86, 0x02, (byte)0x91, (byte)0xF3, 0x60, 0x69, 0x02, (byte)0xA4, (byte)0x91, (byte)0xC8, (byte)0xD0, 0x04, (byte)0xC5, (byte)0xA1, (byte)0xD0, (byte)0xF7, 0x60, 0x19, 0x26, 0x44, 0x19, 0x1A, 0x11, (byte)0xE8, 0x0D, 0x70, 0x0C, 0x06, 0x06, (byte)0xD1, 0x02, 0x37, 0x01, (byte)0xAE, 0x00, 0x69, 0x00}, {(byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0x85, (byte)0xA9, (byte)0xA9, 0x01, (byte)0x85, (byte)0xAB, 0x60, (byte)0xAD, (byte)0x86, 0x02, (byte)0x91, (byte)0xF3, 0x60, 0x69, 0x02, (byte)0xA4, (byte)0x91, (byte)0xC8, (byte)0xD0, 0x04, (byte)0xC5, (byte)0xA1, (byte)0xD0, (byte)0xF7, 0x60, 0x19, 0x26, 0x44, 0x19, 0x1A, 0x11, (byte)0xE8, 0x0D, 0x70, 0x0C, 0x06, 0x06, (byte)0xD1, 0x02, 0x37, 0x01, (byte)0xAE, 0x00, 0x69, 0x00}, {0x2C, (byte)0x86, 0x02, 0x30, 0x0A, (byte)0xA9, 0x00, (byte)0xA2, 0x0E, (byte)0x9D, 0x20, (byte)0xD0, (byte)0xCA, 0x10, (byte)0xFA, 0x4C, (byte)0x87, (byte)0xEA, (byte)0xAD, 0x21, (byte)0xD0, (byte)0x91, (byte)0xF3, 0x60, 0x69, 0x02, (byte)0xA4, (byte)0x91, (byte)0xC8, (byte)0xD0, 0x04, (byte)0xC5, (byte)0xA1, (byte)0xD0, (byte)0xF7, 0x60, 0x19, 0x26, 0x44, 0x19, 0x1A, 0x11, (byte)0xE8, 0x0D, 0x70, 0x0C, 0x06, 0x06, (byte)0xD1, 0x02, 0x37, 0x01, (byte)0xAE, 0x00, 0x69, 0x00} }); private Patch revE535=new Patch(0xE535, new byte[][]{ {0x0E}, {0x0E}, {0x0E}, {0x06}, {0x01} }); private Patch revE57C=new Patch(0xE57C, new byte[][]{ {(byte)0xB5, (byte)0xD9, 0x29, 0x03, 0x0D, (byte)0x88, 0x02, (byte)0x85, (byte)0xD2, (byte)0xBD, (byte)0xF0, (byte)0xEC, (byte)0x85, (byte)0xD1, (byte)0xA9, 0x27, (byte)0xE8, (byte)0xB4, (byte)0xD9, 0x30, 0x06, 0x18, 0x69, 0x28, (byte)0xE8, 0x10, (byte)0xF6, (byte)0x85, (byte)0xD5, 0x60}, {(byte)0xB5, (byte)0xD9, 0x29, 0x03, 0x0D, (byte)0x88, 0x02, (byte)0x85, (byte)0xD2, (byte)0xBD, (byte)0xF0, (byte)0xEC, (byte)0x85, (byte)0xD1, (byte)0xA9, 0x27, (byte)0xE8, (byte)0xB4, (byte)0xD9, 0x30, 0x06, 0x18, 0x69, 0x28, (byte)0xE8, 0x10, (byte)0xF6, (byte)0x85, (byte)0xD5, 0x60}, {0x20, (byte)0xF0, (byte)0xE9, (byte)0xA9, 0x27, (byte)0xE8, (byte)0xB4, (byte)0xD9, 0x30, 0x06, 0x18, 0x69, 0x28, (byte)0xE8, 0x10, (byte)0xF6, (byte)0x85, (byte)0xD5, 0x4C, 0x24, (byte)0xEA, (byte)0xE4, (byte)0xC9, (byte)0xF0, 0x03, 0x4C, (byte)0xED, (byte)0xE6, 0x60, (byte)0xEA}, {0x20, (byte)0xF0, (byte)0xE9, (byte)0xA9, 0x27, (byte)0xE8, (byte)0xB4, (byte)0xD9, 0x30, 0x06, 0x18, 0x69, 0x28, (byte)0xE8, 0x10, (byte)0xF6, (byte)0x85, (byte)0xD5, 0x4C, 0x24, (byte)0xEA, (byte)0xE4, (byte)0xC9, (byte)0xF0, 0x03, 0x4C, (byte)0xED, (byte)0xE6, 0x60, (byte)0xEA}, {0x20, (byte)0xF0, (byte)0xE9, (byte)0xA9, 0x27, (byte)0xE8, (byte)0xB4, (byte)0xD9, 0x30, 0x06, 0x18, 0x69, 0x28, (byte)0xE8, 0x10, (byte)0xF6, (byte)0x85, (byte)0xD5, 0x4C, 0x24, (byte)0xEA, (byte)0xE4, (byte)0xC9, (byte)0xF0, 0x03, 0x4C, (byte)0xED, (byte)0xE6, 0x60, (byte)0xEA} }); private Patch revE5EF=new Patch(0xE5EF, new byte[][]{ {0x09}, {0x09}, {0x09}, {0x0F}, {0x09} }); private Patch revE5F4=new Patch(0xE5F4, new byte[][]{ {(byte)0xE6, (byte)0xEC}, {(byte)0xE6, (byte)0xEC}, {(byte)0xE6, (byte)0xEC}, {(byte)0xD7, (byte)0xF0}, {(byte)0xE6, (byte)0xEC} }); private Patch revE622=new Patch(0xE622, new byte[][]{ {(byte)0xED, (byte)0xE6}, {(byte)0xED, (byte)0xE6}, {(byte)0x91, (byte)0xE5}, {(byte)0x91, (byte)0xE5}, {(byte)0x91, (byte)0xE5} }); private Patch revEA07=new Patch(0xEA07, new byte[][]{ {(byte)0xA9, 0x20, (byte)0x91, (byte)0xD1, (byte)0xA9, 0x01, (byte)0x91, (byte)0xF3, (byte)0x88, 0x10, (byte)0xF5, 0x60}, {(byte)0xA9, 0x20, (byte)0x91, (byte)0xD1, 0x20, (byte)0xDA, (byte)0xE4, (byte)0xEA, (byte)0x88, 0x10, (byte)0xF5, 0x60}, {0x20, (byte)0xDA, (byte)0xE4, (byte)0xA9, 0x20, (byte)0x91, (byte)0xD1, (byte)0x88, 0x10, (byte)0xF6, 0x60, (byte)0xEA}, {0x20, (byte)0xDA, (byte)0xE4, (byte)0xA9, 0x20, (byte)0x91, (byte)0xD1, (byte)0x88, 0x10, (byte)0xF6, 0x60, (byte)0xEA}, {(byte)0xA9, 0x20, (byte)0x91, (byte)0xD1, 0x20, (byte)0xDA, (byte)0xE4, (byte)0xEA, (byte)0x88, 0x10, (byte)0xF5, 0x60} }); private Patch revECCA=new Patch(0xECCA, new byte[][]{ {0x1B, 0x00}, {(byte)0x9B, 0x37}, {(byte)0x9B, 0x37}, {(byte)0x9B, 0x37}, {(byte)0x9B, 0x37} }); private Patch revECD2=new Patch(0xECD2, new byte[][]{ {0x00}, {0x0F}, {0x0F}, {0x0F}, {0x0F} }); private Patch revECD9=new Patch(0xECD9, new byte[][]{ {0x0E, 0x06, 0x01, 0x02, 0x03, 0x04, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, {0x0E, 0x06, 0x01, 0x02, 0x03, 0x04, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, {0x0E, 0x06, 0x01, 0x02, 0x03, 0x04, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, {0x03, 0x01, 0x01, 0x02, 0x03, 0x04, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }); private Patch revEF94=new Patch(0xEF94, new byte[][]{ {(byte)0x85, (byte)0xA9, 0x60}, {(byte)0x85, (byte)0xA9, 0x60}, {0x4C, (byte)0xD3, (byte)0xE4}, {0x4C, (byte)0xD4, (byte)0xE4}, {(byte)0x85, (byte)0xA9, 0x60} }); private Patch revF0D8=new Patch(0xF0D8, new byte[][]{ {0x0D, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x50, 0x4C, 0x41, 0x59, 0x20, 0x4F, 0x4E, 0x20}, {0x0D, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x50, 0x4C, 0x41, 0x59, 0x20, 0x4F, 0x4E, 0x20}, {0x0D, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x50, 0x4C, 0x41, 0x59, 0x20, 0x4F, 0x4E, 0x20}, {0x4C, 0x4F, 0x41, 0x44, 0x22, 0x3A, 0x2A, 0x22, 0x2C, 0x38, 0x0D, 0x52, 0x55, 0x4E, 0x0D}, {0x0D, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x50, 0x4C, 0x41, 0x59, 0x20, 0x4F, 0x4E, 0x20} }); private Patch revF387=new Patch(0xF387, new byte[][]{ {0x03}, {0x03}, {0x03}, {0x08}, {0x03} }); private Patch revF428=new Patch(0xF428, new byte[][]{ {(byte)0xD0, 0x0B, (byte)0xAD, (byte)0x95, 0x02, 0x0A, (byte)0xA8, (byte)0xAD, (byte)0x96, 0x02, 0x4C, 0x3F, (byte)0xF4, 0x0A, (byte)0xAA, (byte)0xBD, (byte)0xC0, (byte)0xFE, 0x0A, (byte)0xA8, (byte)0xBD, (byte)0xC1, (byte)0xFE, 0x2A, 0x48, (byte)0x98, 0x69, (byte)0xC8, (byte)0x8D, (byte)0x99, 0x02, 0x68, 0x69, 0x00, (byte)0x8D, (byte)0x9A, 0x02}, {(byte)0xF0, 0x1C, 0x0A, (byte)0xAA, (byte)0xAD, (byte)0xA6, 0x02, (byte)0xD0, 0x09, (byte)0xBC, (byte)0xC1, (byte)0xFE, (byte)0xBD, (byte)0xC0, (byte)0xFE, 0x4C, 0x40, (byte)0xF4, (byte)0xBC, (byte)0xEB, (byte)0xE4, (byte)0xBD, (byte)0xEA, (byte)0xE4, (byte)0x8C, (byte)0x96, 0x02, (byte)0x8D, (byte)0x95, 0x02, (byte)0xAD, (byte)0x95, 0x02, 0x0A, 0x20, 0x2E, (byte)0xFF}, {(byte)0xF0, 0x1C, 0x0A, (byte)0xAA, (byte)0xAD, (byte)0xA6, 0x02, (byte)0xD0, 0x09, (byte)0xBC, (byte)0xC1, (byte)0xFE, (byte)0xBD, (byte)0xC0, (byte)0xFE, 0x4C, 0x40, (byte)0xF4, (byte)0xBC, (byte)0xEB, (byte)0xE4, (byte)0xBD, (byte)0xEA, (byte)0xE4, (byte)0x8C, (byte)0x96, 0x02, (byte)0x8D, (byte)0x95, 0x02, (byte)0xAD, (byte)0x95, 0x02, 0x0A, 0x20, 0x2E, (byte)0xFF}, {(byte)0xF0, 0x1C, 0x0A, (byte)0xAA, (byte)0xAD, (byte)0xA6, 0x02, (byte)0xD0, 0x09, (byte)0xBC, (byte)0xC1, (byte)0xFE, (byte)0xBD, (byte)0xC0, (byte)0xFE, 0x4C, 0x40, (byte)0xF4, (byte)0xBC, (byte)0xEB, (byte)0xE4, (byte)0xBD, (byte)0xEA, (byte)0xE4, (byte)0x8C, (byte)0x96, 0x02, (byte)0x8D, (byte)0x95, 0x02, (byte)0xAD, (byte)0x95, 0x02, 0x0A, 0x20, 0x2E, (byte)0xFF}, {(byte)0xF0, 0x1C, 0x0A, (byte)0xAA, (byte)0xAD, (byte)0xA6, 0x02, (byte)0xD0, 0x09, (byte)0xBC, (byte)0xC1, (byte)0xFE, (byte)0xBD, (byte)0xC0, (byte)0xFE, 0x4C, 0x40, (byte)0xF4, (byte)0xBC, (byte)0xEB, (byte)0xE4, (byte)0xBD, (byte)0xEA, (byte)0xE4, (byte)0x8C, (byte)0x96, 0x02, (byte)0x8D, (byte)0x95, 0x02, (byte)0xAD, (byte)0x95, 0x02, 0x0A, 0x20, 0x2E, (byte)0xFF} }); private Patch revF459=new Patch(0xF459, new byte[][]{ {0x4C}, {0x20}, {0x20}, {0x20}, {0x20} }); private Patch revF4B7=new Patch(0xF4B7, new byte[][]{ {0x7B}, {0x7B}, {0x7B}, {(byte)0xF7}, {0x7B} }); private Patch revF5F9=new Patch(0xF5F9, new byte[][]{ {0x5F}, {0x5F}, {0x5F}, {(byte)0xF7}, {0x5F} }); private Patch revF81F=new Patch(0xF81F, new byte[][]{ {0x2F}, {0x2F}, {0x2F}, {0x2B} }); private Patch revF762=new Patch(0xF762, new byte[][]{ {(byte)0x91, (byte)0xC9, (byte)0xFF, (byte)0xF0, (byte)0xFA}, {(byte)0xA1, 0x20, (byte)0xE0, (byte)0xE4, (byte)0xEA}, {(byte)0xA1, 0x20, (byte)0xE0, (byte)0xE4, (byte)0xEA}, {(byte)0xA1, 0x20, (byte)0xE0, (byte)0xE4, (byte)0xEA}, {(byte)0xA1, 0x20, (byte)0xE0, (byte)0xE4, (byte)0xEA} }); private Patch revF81C=new Patch(0xF81C, new byte[][]{ {0x2F}, {0x2F}, {0x2F}, {0x2F}, {0x2B}, }); private Patch revF82C=new Patch(0xF82C, new byte[][]{ {0x2F}, {0x2F}, {0x2F}, {0x2F}, {0x2B}, }); private Patch revFCFC=new Patch(0xFCFC, new byte[][]{ {0x18, (byte)0xE5}, {0x5B, (byte)0xFF}, {0x5B, (byte)0xFF}, {0x5B, (byte)0xFF}, {0x5B, (byte)0xFF} }); private Patch revFDDD=new Patch(0xFDDD, new byte[][]{ {(byte)0xA9, 0x1B, (byte)0x8D, 0x04, (byte)0xDC, (byte)0xA9, 0x41, (byte)0x8D, 0x05, (byte)0xDC, (byte)0xA9, (byte)0x81, (byte)0x8D, 0x0D, (byte)0xDC, (byte)0xAD, 0x0E, (byte)0xDC, 0x29, (byte)0x80, 0x09, 0x11, (byte)0x8D, 0x0E, (byte)0xDC, 0x4C, (byte)0x8E, (byte)0xEE}, {(byte)0xAD, (byte)0xA6, 0x02, (byte)0xF0, 0x0A, (byte)0xA9, 0x25, (byte)0x8D, 0x04, (byte)0xDC, (byte)0xA9, 0x40, 0x4C, (byte)0xF3, (byte)0xFD, (byte)0xA9, (byte)0x95, (byte)0x8D, 0x04, (byte)0xDC, (byte)0xA9, 0x42, (byte)0x8D, 0x05, (byte)0xDC, 0x4C, 0x6E, (byte)0xFF}, {(byte)0xAD, (byte)0xA6, 0x02, (byte)0xF0, 0x0A, (byte)0xA9, 0x25, (byte)0x8D, 0x04, (byte)0xDC, (byte)0xA9, 0x40, 0x4C, (byte)0xF3, (byte)0xFD, (byte)0xA9, (byte)0x95, (byte)0x8D, 0x04, (byte)0xDC, (byte)0xA9, 0x42, (byte)0x8D, 0x05, (byte)0xDC, 0x4C, 0x6E, (byte)0xFF}, {(byte)0xAD, (byte)0xA6, 0x02, (byte)0xF0, 0x0A, (byte)0xA9, 0x25, (byte)0x8D, 0x04, (byte)0xDC, (byte)0xA9, 0x40, 0x4C, (byte)0xF3, (byte)0xFD, (byte)0xA9, (byte)0x95, (byte)0x8D, 0x04, (byte)0xDC, (byte)0xA9, 0x42, (byte)0x8D, 0x05, (byte)0xDC, 0x4C, 0x6E, (byte)0xFF}, {(byte)0xAD, (byte)0xA6, 0x02, (byte)0xF0, 0x0A, (byte)0xA9, 0x25, (byte)0x8D, 0x04, (byte)0xDC, (byte)0xA9, 0x40, 0x4C, (byte)0xF3, (byte)0xFD, (byte)0xA9, (byte)0x95, (byte)0x8D, 0x04, (byte)0xDC, (byte)0xA9, 0x42, (byte)0x8D, 0x05, (byte)0xDC, 0x4C, 0x6E, (byte)0xFF} }); private Patch revFEC2=new Patch(0xFEC2, new byte[][]{ {(byte)0xAC, 0x26, (byte)0xA7, 0x19, 0x5D, 0x11, 0x1F, 0x0E, (byte)0xA1, 0x0C, 0x1F, 0x06, (byte)0xDD, 0x02, 0x3D, 0x01, (byte)0xB2, 0x00, 0x6C}, {(byte)0xC1, 0x27, 0x3E, 0x1A, (byte)0xC5, 0x11, 0x74, 0x0E, (byte)0xED, 0x0C, 0x45, 0x06, (byte)0xF0, 0x02, 0x46, 0x01, (byte)0xB8, 0x00, 0x71}, {(byte)0xC1, 0x27, 0x3E, 0x1A, (byte)0xC5, 0x11, 0x74, 0x0E, (byte)0xED, 0x0C, 0x45, 0x06, (byte)0xF0, 0x02, 0x46, 0x01, (byte)0xB8, 0x00, 0x71}, {(byte)0xC1, 0x27, 0x3E, 0x1A, (byte)0xC5, 0x11, 0x74, 0x0E, (byte)0xED, 0x0C, 0x45, 0x06, (byte)0xF0, 0x02, 0x46, 0x01, (byte)0xB8, 0x00, 0x71}, {(byte)0xC1, 0x27, 0x3E, 0x1A, (byte)0xC5, 0x11, 0x74, 0x0E, (byte)0xED, 0x0C, 0x45, 0x06, (byte)0xF0, 0x02, 0x46, 0x01, (byte)0xB8, 0x00, 0x71} }); private Patch revFF08=new Patch(0xFF08, new byte[][]{ {(byte)0x93, 0x02, 0x29, 0x0F, (byte)0xD0, 0x0C, (byte)0xAD, (byte)0x95, 0x02, (byte)0x8D, 0x06, (byte)0xDD, (byte)0xAD, (byte)0x96, 0x02, 0x4C, 0x25, (byte)0xFF, 0x0A, (byte)0xAA, (byte)0xBD, (byte)0xC0, (byte)0xFE, (byte)0x8D, 0x06, (byte)0xDD, (byte)0xBD, (byte)0xC1, (byte)0xFE, (byte)0x8D, 0x07, (byte)0xDD, (byte)0xA9, 0x11, (byte)0x8D, 0x0F, (byte)0xDD, (byte)0xA9, 0x12, 0x4D, (byte)0xA1, 0x02, (byte)0x8D, (byte)0xA1, 0x02, (byte)0xA9, (byte)0xFF, (byte)0x8D, 0x06, (byte)0xDD, (byte)0x8D, 0x07, (byte)0xDD, (byte)0xAE, (byte)0x98, 0x02, (byte)0x86, (byte)0xA8, 0x60}, {(byte)0x95, 0x02, (byte)0x8D, 0x06, (byte)0xDD, (byte)0xAD, (byte)0x96, 0x02, (byte)0x8D, 0x07, (byte)0xDD, (byte)0xA9, 0x11, (byte)0x8D, 0x0F, (byte)0xDD, (byte)0xA9, 0x12, 0x4D, (byte)0xA1, 0x02, (byte)0x8D, (byte)0xA1, 0x02, (byte)0xA9, (byte)0xFF, (byte)0x8D, 0x06, (byte)0xDD, (byte)0x8D, 0x07, (byte)0xDD, (byte)0xAE, (byte)0x98, 0x02, (byte)0x86, (byte)0xA8, 0x60, (byte)0xAA, (byte)0xAD, (byte)0x96, 0x02, 0x2A, (byte)0xA8, (byte)0x8A, 0x69, (byte)0xC8, (byte)0x8D, (byte)0x99, 0x02, (byte)0x98, 0x69, 0x00, (byte)0x8D, (byte)0x9A, 0x02, 0x60, (byte)0xEA, (byte)0xEA}, {(byte)0x95, 0x02, (byte)0x8D, 0x06, (byte)0xDD, (byte)0xAD, (byte)0x96, 0x02, (byte)0x8D, 0x07, (byte)0xDD, (byte)0xA9, 0x11, (byte)0x8D, 0x0F, (byte)0xDD, (byte)0xA9, 0x12, 0x4D, (byte)0xA1, 0x02, (byte)0x8D, (byte)0xA1, 0x02, (byte)0xA9, (byte)0xFF, (byte)0x8D, 0x06, (byte)0xDD, (byte)0x8D, 0x07, (byte)0xDD, (byte)0xAE, (byte)0x98, 0x02, (byte)0x86, (byte)0xA8, 0x60, (byte)0xAA, (byte)0xAD, (byte)0x96, 0x02, 0x2A, (byte)0xA8, (byte)0x8A, 0x69, (byte)0xC8, (byte)0x8D, (byte)0x99, 0x02, (byte)0x98, 0x69, 0x00, (byte)0x8D, (byte)0x9A, 0x02, 0x60, (byte)0xEA, (byte)0xEA}, {(byte)0x95, 0x02, (byte)0x8D, 0x06, (byte)0xDD, (byte)0xAD, (byte)0x96, 0x02, (byte)0x8D, 0x07, (byte)0xDD, (byte)0xA9, 0x11, (byte)0x8D, 0x0F, (byte)0xDD, (byte)0xA9, 0x12, 0x4D, (byte)0xA1, 0x02, (byte)0x8D, (byte)0xA1, 0x02, (byte)0xA9, (byte)0xFF, (byte)0x8D, 0x06, (byte)0xDD, (byte)0x8D, 0x07, (byte)0xDD, (byte)0xAE, (byte)0x98, 0x02, (byte)0x86, (byte)0xA8, 0x60, (byte)0xAA, (byte)0xAD, (byte)0x96, 0x02, 0x2A, (byte)0xA8, (byte)0x8A, 0x69, (byte)0xC8, (byte)0x8D, (byte)0x99, 0x02, (byte)0x98, 0x69, 0x00, (byte)0x8D, (byte)0x9A, 0x02, 0x60, (byte)0xEA, (byte)0xEA}, {(byte)0x95, 0x02, (byte)0x8D, 0x06, (byte)0xDD, (byte)0xAD, (byte)0x96, 0x02, (byte)0x8D, 0x07, (byte)0xDD, (byte)0xA9, 0x11, (byte)0x8D, 0x0F, (byte)0xDD, (byte)0xA9, 0x12, 0x4D, (byte)0xA1, 0x02, (byte)0x8D, (byte)0xA1, 0x02, (byte)0xA9, (byte)0xFF, (byte)0x8D, 0x06, (byte)0xDD, (byte)0x8D, 0x07, (byte)0xDD, (byte)0xAE, (byte)0x98, 0x02, (byte)0x86, (byte)0xA8, 0x60, (byte)0xAA, (byte)0xAD, (byte)0x96, 0x02, 0x2A, (byte)0xA8, (byte)0x8A, 0x69, (byte)0xC8, (byte)0x8D, (byte)0x99, 0x02, (byte)0x98, 0x69, 0x00, (byte)0x8D, (byte)0x9A, 0x02, 0x60, (byte)0xEA, (byte)0xEA} }); private Patch revFF5B=new Patch(0xFF5B, new byte[][]{ {(byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA, (byte)0xAA}, {0x20, 0x18, (byte)0xE5, (byte)0xAD, 0x12, (byte)0xD0, (byte)0xD0, (byte)0xFB, (byte)0xAD, 0x19, (byte)0xD0, 0x29, 0x01, (byte)0x8D, (byte)0xA6, 0x02, 0x4C, (byte)0xDD, (byte)0xFD, (byte)0xA9, (byte)0x81, (byte)0x8D, 0x0D, (byte)0xDC, (byte)0xAD, 0x0E, (byte)0xDC, 0x29, (byte)0x80, 0x09, 0x11, (byte)0x8D, 0x0E, (byte)0xDC, 0x4C, (byte)0x8E, (byte)0xEE}, {0x20, 0x18, (byte)0xE5, (byte)0xAD, 0x12, (byte)0xD0, (byte)0xD0, (byte)0xFB, (byte)0xAD, 0x19, (byte)0xD0, 0x29, 0x01, (byte)0x8D, (byte)0xA6, 0x02, 0x4C, (byte)0xDD, (byte)0xFD, (byte)0xA9, (byte)0x81, (byte)0x8D, 0x0D, (byte)0xDC, (byte)0xAD, 0x0E, (byte)0xDC, 0x29, (byte)0x80, 0x09, 0x11, (byte)0x8D, 0x0E, (byte)0xDC, 0x4C, (byte)0x8E, (byte)0xEE}, {0x20, 0x18, (byte)0xE5, (byte)0xAD, 0x12, (byte)0xD0, (byte)0xD0, (byte)0xFB, (byte)0xAD, 0x19, (byte)0xD0, 0x29, 0x01, (byte)0x8D, (byte)0xA6, 0x02, 0x4C, (byte)0xDD, (byte)0xFD, (byte)0xA9, (byte)0x81, (byte)0x8D, 0x0D, (byte)0xDC, (byte)0xAD, 0x0E, (byte)0xDC, 0x29, (byte)0x80, 0x09, 0x11, (byte)0x8D, 0x0E, (byte)0xDC, 0x4C, (byte)0x8E, (byte)0xEE}, {0x20, 0x18, (byte)0xE5, (byte)0xAD, 0x12, (byte)0xD0, (byte)0xD0, (byte)0xFB, (byte)0xAD, 0x19, (byte)0xD0, 0x29, 0x01, (byte)0x8D, (byte)0xA6, 0x02, 0x4C, (byte)0xDD, (byte)0xFD, (byte)0xA9, (byte)0x81, (byte)0x8D, 0x0D, (byte)0xDC, (byte)0xAD, 0x0E, (byte)0xDC, 0x29, (byte)0x80, 0x09, 0x11, (byte)0x8D, 0x0E, (byte)0xDC, 0x4C, (byte)0x8E, (byte)0xEE} }); private Patch revFF80=new Patch(0xFF80, new byte[][]{ {(byte)0xAA}, {0x00}, {0x03}, {0x43}, {0x64} }); private Patch revFF82=new Patch(0xFF82, new byte[][]{ {0x18, (byte)0xE5}, {0x5B, (byte)0xFF}, {0x5B, (byte)0xFF}, {0x5B, (byte)0xFF}, {0x5B, (byte)0xFF} }); private Patch revFFF8=new Patch(0xFFF8, new byte[][]{ {0x42, 0x59}, {0x42, 0x59}, {0x42, 0x59}, {0x42, 0x59}, {0x00, 0x00} }); /** * Construct the kernal patcher with the actual ROM image. * * @param kernal the actual ROM image */ public KernalPatcher(ROM kernal) { this.kernal=kernal; } /** * Use a Kernal revision. * Available revision are: * <code>index</code>=0 Kernal R1 (rev $AA) * <code>index</code>=1 Kernal R2 (rev $00) * <code>index</code>=2 Kernal R3 (rev $03) * <code>index</code>=3 Kernal SX-64/DX-64 (rev $43) * <code>index</code>=4 Kernal 4096 aka Pet 64 aka Educator 64 (rev $64) * * @param index the index for choosing revision */ public void useRevision(byte index) { revE119.usePatch(index, kernal); revE42D.usePatch(index, kernal); revE477.usePatch(index, kernal); revE4AD.usePatch(index, kernal); revE4C8.usePatch(index, kernal); revE535.usePatch(index, kernal); revE57C.usePatch(index, kernal); revE5EF.usePatch(index, kernal); revE5F4.usePatch(index, kernal); revE622.usePatch(index, kernal); revEA07.usePatch(index, kernal); revECCA.usePatch(index, kernal); revECD2.usePatch(index, kernal); revECD9.usePatch(index, kernal); revEF94.usePatch(index, kernal); revF0D8.usePatch(index, kernal); revF387.usePatch(index, kernal); revF428.usePatch(index, kernal); revF459.usePatch(index, kernal); revF4B7.usePatch(index, kernal); revF5F9.usePatch(index, kernal); revF762.usePatch(index, kernal); revF81C.usePatch(index, kernal); revF81F.usePatch(index, kernal); revF82C.usePatch(index, kernal); revFCFC.usePatch(index, kernal); revFDDD.usePatch(index, kernal); revFEC2.usePatch(index, kernal); revFF08.usePatch(index, kernal); revFF80.usePatch(index, kernal); revFF82.usePatch(index, kernal); revFFF8.usePatch(index, kernal); } }
27,666
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
Z80Dasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/cpu/Z80Dasm.java
/** * @(#)Z80Dasm.java 2022/02/03 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.cpu; import sw_emulator.math.Unsigned; import sw_emulator.software.MemoryDasm; import sw_emulator.swing.main.Carets.Type; /** * Disasseble the Z80 code instructions * This class implements the </code>disassembler</code> interface, so it must * disassemble one instruction and comment it. * * @author ice */ public class Z80Dasm extends CpuDasm implements disassembler { // extra table public static final byte T_CB =-1; public static final byte T_DD =-2; public static final byte T_ED =-3; public static final byte T_FD =-4; public static final byte T_DDCB=-5; public static final byte T_FDCB=-6; // legal instruction public static final byte M_ADC =0; public static final byte M_ADD =1; public static final byte M_AND =2; public static final byte M_BIT =3; public static final byte M_CALL=4; public static final byte M_CCF =5; public static final byte M_CP =6; public static final byte M_CPD =7; public static final byte M_CPDR=8; public static final byte M_CPI =9; public static final byte M_CPIR=10; public static final byte M_CPL =11; public static final byte M_DAA =12; public static final byte M_DEC =13; public static final byte M_DI =14; public static final byte M_DJNZ=15; public static final byte M_EI =16; public static final byte M_EX =17; public static final byte M_EXX =18; public static final byte M_HALT=19; public static final byte M_IM =20; public static final byte M_IN =21; public static final byte M_INC =22; public static final byte M_IND =23; public static final byte M_INDR=24; public static final byte M_INI =25; public static final byte M_INIR=26; public static final byte M_JP =27; public static final byte M_JR =28; public static final byte M_LD =29; public static final byte M_LDD =30; public static final byte M_LDDR=31; public static final byte M_LDI =32; public static final byte M_LDIR=33; public static final byte M_NEG =34; public static final byte M_NOP =35; public static final byte M_OR =36; public static final byte M_OTDR=37; public static final byte M_OTIR=38; public static final byte M_OUT =39; public static final byte M_OUTD=40; public static final byte M_OUTI=41; public static final byte M_POP =42; public static final byte M_PUSH=43; public static final byte M_RES =44; public static final byte M_RET =45; public static final byte M_RETI=46; public static final byte M_RETN=47; public static final byte M_RL =48; public static final byte M_RLA =49; public static final byte M_RLC =50; public static final byte M_RLCA=51; public static final byte M_RLD =52; public static final byte M_RR =53; public static final byte M_RRA =54; public static final byte M_RRC =55; public static final byte M_RRCA=56; public static final byte M_RRD =57; public static final byte M_RST =58; public static final byte M_SBC =59; public static final byte M_SCF =60; public static final byte M_SET =61; public static final byte M_SLA =62; public static final byte M_SLI =63; public static final byte M_SRA =64; public static final byte M_SRL =65; public static final byte M_STOP=66; public static final byte M_SUB =67; public static final byte M_XOR =68; // extra public static final byte M_NUL =69; public static final byte M_SLL =70; // addressing mode public static final int A_NUL =0; // nothing else public static final int A_REG_A =1; // register A public static final int A_REG_B =2; // register B public static final int A_REG_C =3; // register C public static final int A_REG_D =4; // register D public static final int A_REG_E =5; // register E public static final int A_REG_H =6; // register H public static final int A_REG_L =7; // register L public static final int A_BC_NN =8; // BC absolute nn public static final int A_DE_NN =9; // DE absolute nn public static final int A_HL_NN =10; // HL absolute nn public static final int A_SP_NN =11; // SP absolute nn public static final int A_IX_NN =12; // IX absolute nn public static final int A_IY_NN =13; // IY absolute nn public static final int A__BC_A =14; // (BC) indirect A public static final int A__DE_A =15; // (DE) indirect A public static final int A__HL_A =16; // (HL) indirect A public static final int A__IXN_A =17; // (IX+N) indirect A public static final int A__IYN_A =18; // (IY+N) indirect A public static final int A__NN_A =19; // (NN) indirect A public static final int A_REG_BC =20; // registers BC public static final int A_REG_DE =21; // registers DE public static final int A_REG_HL =22; // registers HL public static final int A_REG_SP =23; // registers SP public static final int A_A_N =24; // A reg with N public static final int A_B_N =25; // B reg with N public static final int A_C_N =26; // C reg with N public static final int A_D_N =27; // D reg with N public static final int A_E_N =28; // E reg with N public static final int A_H_N =29; // H reg with N public static final int A_L_N =30; // L reg with N public static final int A_AF_AF =31; // AF with shadow AF' public static final int A_HL_BC =32; // HL reg BC public static final int A_HL_DE =33; // HL reg DE public static final int A_HL_HL =34; // HL reg HL public static final int A_HL_SP =35; // HL reg SP public static final int A_IX_BC =36; // IX reg BC public static final int A_IX_DE =37; // IX reg DE public static final int A_IX_HL =38; // IX reg HL public static final int A_IX_SP =39; // IX reg SP public static final int A_IY_BC =40; // IY reg BC public static final int A_IY_DE =41; // IY reg DE public static final int A_IY_HL =42; // IY reg HL public static final int A_IY_SP =43; // IY reg SP public static final int A_A__BC =44; // A indirect (BC) public static final int A_A__DE =45; // A indirect (DE) public static final int A_A__HL =46; // A indirect (HL) public static final int A_A__IXN =47; // A indirect (IX+N) public static final int A_A__IYN =48; // A indirect (IY+N) public static final int A_REL =49; // relative public static final int A_REL_NZ =50; // relative NZ public static final int A_REL_Z =51; // relative Z public static final int A_REL_NC =52; // relative NC public static final int A_REL_C =53; // relative C public static final int A__NN_BC =54; // (NN) ind absolute BC public static final int A__NN_DE =55; // (NN) ind absolute DE public static final int A__NN_HL =56; // (NN) absolute HL public static final int A__NN_SP =57; // (NN) ind absolute SP public static final int A__NN_IX =58; // (NN) ind absolute IX public static final int A__NN_IY =59; // (NN) ind absolute IY public static final int A_BC__NN =60; // BC ind absolute (NN) public static final int A_DE__NN =61; // DE ind absolute (NN) public static final int A_HL__NN =62; // HL ind absolute (NN) public static final int A_SP__NN =63; // SP ind absolute (NN) public static final int A_IX__NN =64; // IX ind absolute (NN) public static final int A_IY__NN =65; // IY ind absolute (NN) public static final int A__HL =66; // ind (HL) public static final int A__HL_N =67; // ind (HL) imm N public static final int A_A__NN =68; // A ind (NN) public static final int A_A_A =69; // A reg A public static final int A_A_B =70; // A reg B public static final int A_A_C =71; // A reg C public static final int A_A_D =72; // A reg D public static final int A_A_E =73; // A reg E public static final int A_A_H =74; // A reg A public static final int A_A_L =75; // A reg L public static final int A_A_I =76; // A reg I public static final int A_A_R =77; // A reg R public static final int A_B_A =78; // B reg A public static final int A_B_B =79; // B reg B public static final int A_B_C =80; // B reg C public static final int A_B_D =81; // B reg D public static final int A_B_E =82; // B reg E public static final int A_B_H =83; // B reg A public static final int A_B_L =84; // B reg L public static final int A_C_A =85; // C reg A public static final int A_C_B =86; // C reg B public static final int A_C_C =87; // C reg C public static final int A_C_D =88; // C reg D public static final int A_C_E =89; // C reg E public static final int A_C_H =90; // C reg A public static final int A_C_L =91; // C reg L public static final int A_D_A =92; // D reg A public static final int A_D_B =93; // D reg B public static final int A_D_C =94; // D reg C public static final int A_D_D =95; // D reg D public static final int A_D_E =96; // D reg E public static final int A_D_H =97; // D reg A public static final int A_D_L =98; // D reg L public static final int A_E_A =99; // E reg A public static final int A_E_B =100; // E reg B public static final int A_E_C =101; // E reg C public static final int A_E_D =102; // E reg D public static final int A_E_E =103; // E reg E public static final int A_E_H =104; // E reg A public static final int A_E_L =105; // E reg L public static final int A_H_A =106; // H reg A public static final int A_H_B =107; // H reg B public static final int A_H_C =108; // H reg C public static final int A_H_D =109; // H reg D public static final int A_H_E =110; // H reg E public static final int A_H_H =111; // H reg A public static final int A_H_L =112; // H reg L public static final int A_L_A =113; // L reg A public static final int A_L_B =114; // L reg B public static final int A_L_C =115; // L reg C public static final int A_L_D =116; // L reg D public static final int A_L_E =117; // L reg E public static final int A_L_H =118; // L reg A public static final int A_L_L =119; // L reg L public static final int A_I_A =120; // I reg A public static final int A_R_A =121; // R reg A public static final int A_B__HL =122; // B indirect (HL) public static final int A_B__IXN =123; // B indirect (IX+N) public static final int A_B__IYN =124; // B indirect (IY+N) public static final int A_C__HL =125; // C indirect (HL) public static final int A_C__IXN =126; // C indirect (IX+N) public static final int A_C__IYN =127; // C indirect (IY+N) public static final int A_D__HL =128; // D indirect (HL) public static final int A_D__IXN =129; // D indirect (IX+N) public static final int A_D__IYN =130; // D indirect (IY+N) public static final int A_E__HL =131; // E indirect (HL) public static final int A_E__IXN =132; // E indirect (IX+N) public static final int A_E__IYN =133; // E indirect (IY+N) public static final int A_H__HL =134; // H indirect (HL) public static final int A_H__IXN =135; // H indirect (IX+N) public static final int A_H__IYN =136; // H indirect (IY+N) public static final int A_L__HL =137; // L indirect (HL) public static final int A_L__IXN =138; // L indirect (IX+N) public static final int A_L__IYN =139; // L indirect (IY+N) public static final int A__HL_B =140; // (HL) indirect B public static final int A__HL_C =141; // (HL) indirect C public static final int A__HL_D =142; // (HL) indirect D public static final int A__HL_E =143; // (HL) indirect E public static final int A__HL_H =144; // (HL) indirect H public static final int A__HL_I =145; // (HL) indirect I public static final int A__HL_L =146; // (HL) indirect L public static final int A_00 =147; // 00h public static final int A_08 =148; // 08h public static final int A_10 =149; // 10h public static final int A_18 =150; // 18h public static final int A_20 =151; // 20h public static final int A_28 =152; // 28h public static final int A_30 =153; // 30h public static final int A_38 =154; // 38h public static final int A_NZ =155; // NZ cond public static final int A_Z =156; // Z cond public static final int A_NC =157; // NC cond public static final int A_C =158; // C cond public static final int A_PO =159; // PO cond public static final int A_P =160; // P cond public static final int A_PE =161; // PE cond public static final int A_M =162; // PE cond public static final int A_N =163; // immediate N public static final int A_NN =164; // absolute NN public static final int A_REG_AF =165; // reg AF public static final int A__N_A =166; // (N) immediate A public static final int A_A__N =167; // A immediate (N) public static final int A_SP_HL =168; // SP reg HL public static final int A_DE_HL =169; // DE reg HL public static final int A__SP_HL =170; // (SP) ind HL public static final int A_NZ_NN =171; // NZ cond NN public static final int A_Z_NN =172; // Z cond NN public static final int A_NC_NN =173; // NC cond NN public static final int A_C_NN =174; // C cond NN public static final int A_PO_NN =175; // PO cond NN public static final int A_P_NN =176; // P cond NN public static final int A_PE_NN =177; // PE cond NN public static final int A_M_NN =178; // PE cond NN public static final int A_A__C =179; // A reg ind (C) public static final int A_B__C =180; // B reg ind (C) public static final int A_C__C =181; // C reg ind (C) public static final int A_D__C =182; // D reg ind (C) public static final int A_E__C =183; // E reg ind (C) public static final int A_H__C =184; // H reg ind (C) public static final int A_L__C =185; // L reg ind (C) public static final int A___C =186; // ind (C) public static final int A__C_A =187; // ind C reg A public static final int A__C_B =188; // ind C reg B public static final int A__C_C =189; // ind C reg C public static final int A__C_D =190; // ind C reg D public static final int A__C_E =191; // ind C reg E public static final int A__C_H =192; // ind C reg H public static final int A__C_L =193; // ind C reg L public static final int A___C_0 =194; // ind C 0 public static final int A_0 =195; // 0 public static final int A_1 =196; // 1 public static final int A_2 =197; // 2 public static final int A_0_A =198; // 0 reg A public static final int A_0_B =199; // 0 reg B public static final int A_0_C =200; // 0 reg C public static final int A_0_D =201; // 0 reg D public static final int A_0_E =202; // 0 reg E public static final int A_0_H =203; // 0 reg H public static final int A_0_L =204; // 0 reg L public static final int A_0__HL =205; // 0 ind (HL) public static final int A_1_A =206; // 1 reg A public static final int A_1_B =207; // 1 reg B public static final int A_1_C =208; // 1 reg C public static final int A_1_D =209; // 1 reg D public static final int A_1_E =210; // 1 reg E public static final int A_1_H =211; // 1 reg H public static final int A_1_L =212; // 1 reg L public static final int A_1__HL =213; // 1 ind (HL) public static final int A_2_A =214; // 2 reg A public static final int A_2_B =215; // 2 reg B public static final int A_2_C =216; // 2 reg C public static final int A_2_D =217; // 2 reg D public static final int A_2_E =218; // 2 reg E public static final int A_2_H =219; // 2 reg H public static final int A_2_L =220; // 2 reg L public static final int A_2__HL =221; // 2 ind (HL) public static final int A_3_A =222; // 3 reg A public static final int A_3_B =223; // 3 reg B public static final int A_3_C =224; // 3 reg C public static final int A_3_D =225; // 3 reg D public static final int A_3_E =226; // 3 reg E public static final int A_3_H =227; // 3 reg H public static final int A_3_L =228; // 3 reg L public static final int A_3__HL =229; // 3 ind (HL) public static final int A_4_A =230; // 4 reg A public static final int A_4_B =231; // 4 reg B public static final int A_4_C =232; // 4 reg C public static final int A_4_D =233; // 4 reg D public static final int A_4_E =234; // 4 reg E public static final int A_4_H =235; // 4 reg H public static final int A_4_L =236; // 4 reg L public static final int A_4__HL =237; // 4 ind (HL) public static final int A_5_A =238; // 5 reg A public static final int A_5_B =239; // 5 reg B public static final int A_5_C =240; // 5 reg C public static final int A_5_D =241; // 5 reg D public static final int A_5_E =242; // 5 reg E public static final int A_5_H =243; // 5 reg H public static final int A_5_L =244; // 5 reg L public static final int A_5__HL =245; // 5 ind (HL) public static final int A_6_A =246; // 6 reg A public static final int A_6_B =247; // 6 reg B public static final int A_6_C =248; // 6 reg C public static final int A_6_D =249; // 6 reg D public static final int A_6_E =250; // 6 reg E public static final int A_6_H =251; // 6 reg H public static final int A_6_L =252; // 6 reg L public static final int A_6__HL =253; // 6 ind (HL) public static final int A_7_A =254; // 7 reg A public static final int A_7_B =255; // 7 reg B public static final int A_7_C =256; // 7 reg C public static final int A_7_D =257; // 7 reg D public static final int A_7_E =258; // 7 reg E public static final int A_7_H =259; // 7 reg H public static final int A_7_L =260; // 7 reg L public static final int A_7__HL =261; // 7 ind (HL) public static final int A_REG_IX =262; // reg IX public static final int A_REG_IY =263; // reg IY public static final int A_REG_IXH=264; // reg IXH public static final int A_REG_IXL=265; // reg IXL public static final int A_REG_IYH=266; // reg IYH public static final int A_REG_IYL=267; //reg IYL public static final int A_IX_IX =268; // IX reg IX public static final int A_IY_IY =269; // IY reg IY public static final int A__IX_N =270; // ind (IX+N) public static final int A__IY_N =271; // ind (IX+N) public static final int A__IX_N_A=272; // ind (IX+N),A public static final int A__IX_N_B=273; // ind (IX+N),B public static final int A__IX_N_C=274; // ind (IX+N),C public static final int A__IX_N_D=275; // ind (IX+N),D public static final int A__IX_N_E=276; // ind (IX+N),E public static final int A__IX_N_H=277; // ind (IX+N),H public static final int A__IX_N_L=278; // ind (IX+N),L public static final int A__IY_N_A=279; // ind (IY+N),A public static final int A__IY_N_B=280; // ind (IY+N),B public static final int A__IY_N_C=281; // ind (IY+N),C public static final int A__IY_N_D=282; // ind (IY+N),D public static final int A__IY_N_E=283; // ind (IY+N),E public static final int A__IY_N_H=284; // ind (IY+N),H public static final int A__IY_N_L=285; // ind (IY+N),L public static final int A_SP_IX =286; // SP reg IX public static final int A_SP_IY =287; // SP reg IY public static final int A__IX =288; // ind (IX) public static final int A__IY =289; // ind (IY) public static final int A__SP_IX =290; // (SP) ind IX public static final int A__SP_IY =291; // (SP) ind IY public static final int A_IXH_A = 292; // IXH reg A public static final int A_IXH_B = 293; // IXH reg B public static final int A_IXH_C = 294; // IXH reg C public static final int A_IXH_D = 295; // IXH reg D public static final int A_IXH_E = 296; // IXH reg E public static final int A_IXH_H = 297; // IXH reg H public static final int A_IXH_L = 298; // IXH reg L public static final int A_IYH_A = 299; // IYH reg A public static final int A_IYH_B = 300; // IYH reg B public static final int A_IYH_C = 301; // IYH reg C public static final int A_IYH_D = 302; // IYH reg D public static final int A_IYH_E = 303; // IYH reg E public static final int A_IYH_H = 304; // IYH reg H public static final int A_IYH_L = 305; // IYH reg L public static final int A_A_IXH = 306; // A reg IXH public static final int A_B_IXH = 307; // B reg IXH public static final int A_C_IXH = 308; // C reg IXH public static final int A_D_IXH = 309; // D reg IXH public static final int A_E_IXH = 310; // E reg IXH public static final int A_A_IXL = 311; // A reg IXL public static final int A_B_IXL = 312; // B reg IXL public static final int A_C_IXL = 313; // C reg IXL public static final int A_D_IXL = 314; // D reg IXL public static final int A_E_IXL = 315; // E reg IXL public static final int A_IXL_A = 316; // IXL reg A public static final int A_IXL_B = 317; // IXL reg B public static final int A_IXL_C = 318; // IXL reg C public static final int A_IXL_D = 319; // IXL reg D public static final int A_IXL_E = 320; // IXL reg E public static final int A_IXL_L = 321; // IXL reg L public static final int A_IXH_IXH=322; // IXH reg IXH public static final int A_IXH_IXL=323; // IXH reg IXL public static final int A_IXL_IXH=324; // IXL reg IXH public static final int A_IXL_IXL=325; // IXL reg IXL public static final int A__IX_N_N=326; // ind (IX+N),N public static final int A__IY_N_N=327; // ind (IX+N),N public static final int A_C__IX_N=328; // C ind (IX+N) public static final int A_D__IX_N=329; // D ind (IX+N) public static final int A_E__IX_N=330; // E ind (IX+N) public static final int A_H__IX_N=331; // H ind (IX+N) public static final int A_L__IX_N=332; // L ind (IX+N) public static final int A_IYL_A = 333; // IYL reg A public static final int A_IYL_B = 334; // IYL reg B public static final int A_IYL_C = 335; // IYL reg C public static final int A_IYL_D = 336; // IYL reg D public static final int A_IYL_E = 337; // IYL reg E public static final int A_IYL_L = 338; // IYL reg L public static final int A_A_IYH = 339; // A reg IYH public static final int A_B_IYH = 340; // B reg IYH public static final int A_C_IYH = 341; // C reg IYH public static final int A_D_IYH = 342; // D reg IYH public static final int A_E_IYH = 343; // E reg IYH public static final int A_A_IYL = 344; // A reg IYL public static final int A_B_IYL = 345; // B reg IYL public static final int A_C_IYL = 346; // C reg IYL public static final int A_D_IYL = 347; // D reg IYL public static final int A_E_IYL = 348; // E reg IYL public static final int A_IYH_IYH=349; // IYH reg IYH public static final int A_IYH_IYL=350; // IYH reg IYL public static final int A_IYL_IYH=351; // IYL reg IYH public static final int A_IYL_IYL=352; // IYL reg IYL public static final int A_A__IY_N=353; // A ind (IY+N) public static final int A_B__IY_N=354; // B ind (IY+N) public static final int A_C__IY_N=355; // C ind (IY+N) public static final int A_D__IY_N=356; // D ind (IY+N) public static final int A_E__IY_N=357; // E ind (IY+N) public static final int A_H__IY_N=358; // H ind (IY+N) public static final int A_L__IY_N=359; // L ind (IY+N) public static final int A_IXH_N =360; // IXH,N public static final int A_IXL_N =361; // IXL,N public static final int A_IYH_N =362; // IYH,N public static final int A_IYL_N =363; // IYL,N public static final int A_0__IX_N=364; // 0,(IX+N) public static final int A_1__IX_N=365; // 1,(IX+N) public static final int A_2__IX_N=366; // 2,(IX+N) public static final int A_3__IX_N=367; // 3,(IX+N) public static final int A_4__IX_N=368; // 4,(IX+N) public static final int A_5__IX_N=369; // 5,(IX+N) public static final int A_6__IX_N=370; // 6,(IX+N) public static final int A_7__IX_N=371; // 7,(IX+N) public static final int A_0__IY_N=372; // 0,(IY+N) public static final int A_1__IY_N=373; // 1,(IY+N) public static final int A_2__IY_N=374; // 2,(IY+N) public static final int A_3__IY_N=375; // 3,(IY+N) public static final int A_4__IY_N=376; // 4,(IY+N) public static final int A_5__IY_N=377; // 5,(Iy+N) public static final int A_6__IY_N=378; // 6,(IY+N) public static final int A_7__IY_N=379; // 7,(IY+N) public static final int A_0__IX_N_A=380; // 0,(IX+N),A public static final int A_0__IX_N_B=381; // 0,(IX+N),B public static final int A_0__IX_N_C=382; // 0,(IX+N),C public static final int A_0__IX_N_D=383; // 0,(IX+N),D public static final int A_0__IX_N_E=384; // 0,(IX+N),E public static final int A_0__IX_N_H=385; // 0,(IX+N),H public static final int A_0__IX_N_L=386; // 0,(IX+N),L public static final int A_1__IX_N_A=387; // 1,(IX+N),A public static final int A_1__IX_N_B=388; // 1,(IX+N),B public static final int A_1__IX_N_C=389; // 1,(IX+N),C public static final int A_1__IX_N_D=390; // 1,(IX+N),D public static final int A_1__IX_N_E=391; // 1,(IX+N),E public static final int A_1__IX_N_H=392; // 1,(IX+N),H public static final int A_1__IX_N_L=393; // 1,(IX+N),L public static final int A_2__IX_N_A=394; // 2,(IX+N),A public static final int A_2__IX_N_B=395; // 2,(IX+N),B public static final int A_2__IX_N_C=396; // 2,(IX+N),C public static final int A_2__IX_N_D=397; // 2,(IX+N),D public static final int A_2__IX_N_E=398; // 2,(IX+N),E public static final int A_2__IX_N_H=399; // 2,(IX+N),H public static final int A_2__IX_N_L=400; // 2,(IX+N),L public static final int A_3__IX_N_A=401; // 3,(IX+N),A public static final int A_3__IX_N_B=402; // 3,(IX+N),B public static final int A_3__IX_N_C=403; // 3,(IX+N),C public static final int A_3__IX_N_D=404; // 3,(IX+N),D public static final int A_3__IX_N_E=405; // 3,(IX+N),E public static final int A_3__IX_N_H=406; // 3,(IX+N),H public static final int A_3__IX_N_L=407; // 3,(IX+N),L public static final int A_4__IX_N_A=408; // 4,(IX+N),A public static final int A_4__IX_N_B=409; // 4,(IX+N),B public static final int A_4__IX_N_C=410; // 4,(IX+N),C public static final int A_4__IX_N_D=411; // 4,(IX+N),D public static final int A_4__IX_N_E=412; // 4,(IX+N),E public static final int A_4__IX_N_H=413; // 4,(IX+N),H public static final int A_4__IX_N_L=414; // 4,(IX+N),L public static final int A_5__IX_N_A=415; // 5,(IX+N),A public static final int A_5__IX_N_B=416; // 5,(IX+N),B public static final int A_5__IX_N_C=417; // 5,(IX+N),C public static final int A_5__IX_N_D=418; // 5,(IX+N),D public static final int A_5__IX_N_E=419; // 5,(IX+N),E public static final int A_5__IX_N_H=420; // 5,(IX+N),H public static final int A_5__IX_N_L=421; // 5,(IX+N),L public static final int A_6__IX_N_A=422; // 6,(IX+N),A public static final int A_6__IX_N_B=423; // 6,(IX+N),B public static final int A_6__IX_N_C=424; // 6,(IX+N),C public static final int A_6__IX_N_D=425; // 6,(IX+N),D public static final int A_6__IX_N_E=426; // 6,(IX+N),E public static final int A_6__IX_N_H=427; // 6,(IX+N),H public static final int A_6__IX_N_L=428; // 6,(IX+N),L public static final int A_7__IX_N_A=429; // 7,(IX+N),A public static final int A_7__IX_N_B=430; // 7,(IX+N),B public static final int A_7__IX_N_C=431; // 7,(IX+N),C public static final int A_7__IX_N_D=432; // 7,(IX+N),D public static final int A_7__IX_N_E=433; // 7,(IX+N),E public static final int A_7__IX_N_H=434; // 7,(IX+N),H public static final int A_7__IX_N_L=435; // 7,(IX+N),L public static final int A_0__IY_N_A=436; // 0,(IY+N),A public static final int A_0__IY_N_B=437; // 0,(IY+N),B public static final int A_0__IY_N_C=438; // 0,(IY+N),C public static final int A_0__IY_N_D=439; // 0,(IY+N),D public static final int A_0__IY_N_E=440; // 0,(IY+N),E public static final int A_0__IY_N_H=441; // 0,(IY+N),H public static final int A_0__IY_N_L=442; // 0,(IY+N),L public static final int A_1__IY_N_A=443; // 1,(IY+N),A public static final int A_1__IY_N_B=444; // 1,(IY+N),B public static final int A_1__IY_N_C=445; // 1,(IY+N),C public static final int A_1__IY_N_D=446; // 1,(IY+N),D public static final int A_1__IY_N_E=447; // 1,(IY+N),E public static final int A_1__IY_N_H=448; // 1,(IY+N),H public static final int A_1__IY_N_L=449; // 1,(IY+N),L public static final int A_2__IY_N_A=450; // 2,(IY+N),A public static final int A_2__IY_N_B=451; // 2,(IY+N),B public static final int A_2__IY_N_C=452; // 2,(IY+N),C public static final int A_2__IY_N_D=453; // 2,(IY+N),D public static final int A_2__IY_N_E=454; // 2,(IY+N),E public static final int A_2__IY_N_H=455; // 2,(IY+N),H public static final int A_2__IY_N_L=456; // 2,(IY+N),L public static final int A_3__IY_N_A=457; // 3,(IY+N),A public static final int A_3__IY_N_B=458; // 3,(IY+N),B public static final int A_3__IY_N_C=459; // 3,(IY+N),C public static final int A_3__IY_N_D=460; // 3,(IY+N),D public static final int A_3__IY_N_E=461; // 3,(IY+N),E public static final int A_3__IY_N_H=462; // 3,(IY+N),H public static final int A_3__IY_N_L=463; // 3,(IY+N),L public static final int A_4__IY_N_A=464; // 4,(IY+N),A public static final int A_4__IY_N_B=465; // 4,(IY+N),B public static final int A_4__IY_N_C=466; // 4,(IY+N),C public static final int A_4__IY_N_D=467; // 4,(IY+N),D public static final int A_4__IY_N_E=468; // 4,(IY+N),E public static final int A_4__IY_N_H=469; // 4,(IY+N),H public static final int A_4__IY_N_L=470; // 4,(IY+N),L public static final int A_5__IY_N_A=471; // 5,(IY+N),A public static final int A_5__IY_N_B=472; // 5,(IY+N),B public static final int A_5__IY_N_C=473; // 5,(IY+N),C public static final int A_5__IY_N_D=474; // 5,(IY+N),D public static final int A_5__IY_N_E=475; // 5,(IY+N),E public static final int A_5__IY_N_H=476; // 5,(IY+N),H public static final int A_5__IY_N_L=477; // 5,(IY+N),L public static final int A_6__IY_N_A=478; // 6,(IY+N),A public static final int A_6__IY_N_B=479; // 6,(IY+N),B public static final int A_6__IY_N_C=480; // 6,(IY+N),C public static final int A_6__IY_N_D=481; // 6,(IY+N),D public static final int A_6__IY_N_E=482; // 6,(IY+N),E public static final int A_6__IY_N_H=483; // 6,(IY+N),H public static final int A_6__IY_N_L=484; // 6,(IY+N),L public static final int A_7__IY_N_A=485; // 7,(IY+N),A public static final int A_7__IY_N_B=486; // 7,(IY+N),B public static final int A_7__IY_N_C=487; // 7,(IY+N),C public static final int A_7__IY_N_D=488; // 7,(IY+N),D public static final int A_7__IY_N_E=489; // 7,(IY+N),E public static final int A_7__IY_N_H=490; // 7,(IY+N),H public static final int A_7__IY_N_L=491; // 7,(IY+N),L /** Contains the mnemonics of instructions */ public static final String[] mnemonics={ // legal instruction first: "ADC", "ADD", "AND", "BIT", "CALL", "CCF", "CP", "CPD", "CPDR", "CPI", "CPIR", "CPL", "DAA", "DEC", "DI", "DJNZ", "EI", "EX", "EXX", "HALT", "IM", "IN", "INC", "IND", "INDR", "INI", "INIR", "JP", "JR", "LD", "LDD", "LDDR", "LDI", "LDIR", "NEG", "NOP", "OR", "OTDR", "OTIR", "OUT", "OUTD", "OUTI", "POP", "PUSH", "RES", "RET", "RETI", "RETN", "RL", "RLA", "RLC", "RLCA", "RLD", "RR", "RRA", "RRC", "RRCA", "RRD", "RST", "SBC", "SCF", "SET", "SLA", "SLI", "SRA", "SRL", "STOP", "SUB", "XOR", "???", "SLL" }; /** Contains the mnemonics reference for the instruction */ public static final byte[] tableMnemonics={ M_NOP, M_LD, M_LD, M_INC, M_INC, M_DEC, M_LD, M_RLCA, // 00 M_EX, M_ADD, M_LD, M_DEC, M_INC, M_DEC, M_LD, M_RRCA, M_DJNZ, M_LD, M_LD, M_INC, M_INC, M_DEC, M_LD, M_RLA, M_JR, M_ADD, M_LD, M_DEC, M_INC, M_DEC, M_LD, M_RRA, M_JR, M_LD, M_LD, M_INC, M_INC, M_DEC, M_LD, M_DAA, // 20 M_JR, M_ADD, M_LD, M_DEC, M_INC, M_DEC, M_LD, M_CPL, M_JR, M_LD, M_LD, M_INC, M_INC, M_DEC, M_LD, M_SCF, M_JR, M_ADD, M_LD, M_DEC, M_INC, M_DEC, M_LD, M_CCF, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, // 40 M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, // 60 M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_HALT,M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_ADD, M_ADD, M_ADD, M_ADD, M_ADD, M_ADD, M_ADD, M_ADD, // 80 M_ADC, M_ADC, M_ADC, M_ADC, M_ADC, M_ADC, M_ADC, M_ADC, M_SUB, M_SUB, M_SUB, M_SUB, M_SUB, M_SUB, M_SUB, M_SUB, M_SBC, M_SBC, M_SBC, M_SBC, M_SBC, M_SBC, M_SBC, M_SBC, M_AND, M_AND, M_AND, M_AND, M_AND, M_AND, M_AND, M_AND, // A0 M_XOR, M_XOR, M_XOR, M_XOR, M_XOR, M_XOR, M_XOR, M_XOR, M_OR, M_OR, M_OR, M_OR, M_OR, M_OR, M_OR, M_OR, M_CP, M_CP, M_CP, M_CP, M_CP, M_CP, M_CP, M_CP, M_RET, M_POP, M_JP, M_JP, M_CALL, M_PUSH,M_ADD, M_RST, // C0 M_RET, M_RET, M_JP, T_CB, M_CALL, M_CALL,M_ADC, M_RST, M_RET, M_POP, M_JP, M_OUT, M_CALL, M_PUSH,M_SUB, M_RST, M_RET, M_EXX, M_JP, M_IN, M_CALL, T_DD, M_SBC, M_RST, M_RET, M_POP, M_JP, M_EX, M_CALL, M_PUSH,M_AND, M_RST, // E0 M_RET, M_JP, M_JP, M_EX, M_CALL, T_ED, M_XOR, M_RST, M_RET, M_POP, M_JP, M_DI, M_CALL, M_PUSH,M_OR, M_RST, M_RET, M_LD, M_JP, M_EI, M_CALL, T_FD, M_CP, M_RST }; /** Contains the modes for the instruction */ public static final int[] tableModes={ A_NUL, A_BC_NN, A__BC_A, A_REG_BC, A_REG_B, A_REG_B, A_B_N, A_NUL, // 00 A_AF_AF, A_HL_BC, A_A__BC, A_REG_BC, A_REG_C, A_REG_C, A_C_N, A_NUL, A_REL, A_DE_NN, A__DE_A, A_REG_DE, A_REG_D, A_REG_D, A_D_N, A_NUL, A_REL, A_HL_DE, A_A__DE, A_REG_DE, A_REG_E, A_REG_E, A_E_N, A_NUL, A_REL_NZ,A_HL_NN, A__NN_HL,A_REG_HL, A_REG_H, A_REG_H, A_H_N, A_NUL, // 20 A_REL_Z, A_HL_HL, A_HL__NN,A_REG_HL, A_REG_L, A_REG_L, A_L_N, A_NUL, A_REL_NC,A_SP_NN, A__NN_A, A_REG_SP, A__HL, A__HL, A__HL_N,A_NUL, A_REL_C, A_HL_SP, A_A__NN, A_REG_SP, A_REG_A, A_REG_A, A_A_N, A_NUL, A_B_B, A_B_C, A_B_D, A_B_E, A_B_H, A_B_L, A_B__HL, A_B_A, // 40 A_C_D, A_C_C, A_C_D, A_C_E, A_C_H, A_C_L, A_C__HL, A_C_A, A_D_B, A_D_C, A_D_D, A_D_E, A_D_H, A_D_L, A_D__HL, A_D_A, A_E_B, A_E_C, A_E_D, A_E_E, A_E_H, A_E_L, A_E__HL, A_E_A, A_H_B, A_H_C, A_H_D, A_H_E, A_H_H, A_H_L, A_H__HL, A_H_A, // 60 A_L_B, A_L_C, A_L_D, A_L_E, A_L_H, A_L_L, A_L__HL, A_L_A, A__HL_B, A__HL_C, A__HL_D, A__HL_E, A__HL_H, A__HL_L, A_NUL, A__HL_A, A_A_B, A_A_C, A_A_D, A_A_E, A_A_H, A_A_L, A_A__HL, A_A_A, A_A_B, A_A_C, A_A_D, A_A_E, A_A_H, A_A_L, A_A__HL, A_A_A, // 80 A_A_B, A_A_C, A_A_D, A_A_E, A_A_H, A_A_L, A_A__HL, A_A_A, A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A, A_A_B, A_A_C, A_A_D, A_A_E, A_A_H, A_A_L, A_A__HL, A_A_A, A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A,//A0 A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A, A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A, A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A, A_NZ, A_REG_BC,A_NZ_NN, A_NN, A_NZ_NN, A_REG_BC,A_A_N, A_00, // C0 A_Z, A_NUL, A_Z_NN, 0, A_Z_NN, A_NN, A_A_N, A_08, A_NC, A_REG_DE,A_NC_NN, A__N_A, A_NC_NN, A_REG_DE,A_N, A_10, A_C, A_NUL, A_C_NN, A_A__N, A_C_NN, 0, A_A_N, A_18, A_PO, A_REG_HL,A_PO_NN, A__SP_HL, A_PO_NN, A_REG_HL,A_N, A_20, //E0 A_PE, A__HL, A_PE_NN, A_DE_HL, A_PE_NN, 0, A_N, A_28, A_P, A_REG_AF,A_P_NN, A_NUL, A_P_NN, A_REG_AF,A_N, A_30, A_M, A_SP_HL, A_M_NN, A_NUL, A_M_NN, 0, A_N, A_38 }; /** Contains the bytes used for the instruction */ public static final byte[] tableSize={ 1, 3, 1, 1, 1, 1, 2, 1, // 00 1, 1, 1, 1, 1, 1, 2, 1, 2, 3, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 3, 3, 1, 1, 1, 2, 1, // 20 2, 1, 3, 1, 1, 1, 2, 1, 2, 3, 3, 1, 1, 1, 2, 1, 2, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 40 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 60 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 80 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 1, 2, 1, // C0 1, 1, 3, 0, 3, 3, 2, 1, 1, 1, 3, 2, 3, 1, 2, 1, 1, 1, 3, 2, 3, 0, 2, 1, 1, 1, 3, 1, 3, 1, 2, 1, // E0 1, 1, 3, 1, 3, 0, 2, 1, 1, 1, 3, 1, 3, 1, 2, 1, 1, 1, 3, 1, 3, 0, 2, 1 }; /** Contains the mnemonics reference for the instruction */ public static final byte[] tableMnemonicsED={ M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, // 00 M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, // 20 M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_IN, M_OUT, M_SBC, M_LD, M_NEG,M_RETN, M_IM, M_LD, // 40 M_IN, M_OUT, M_ADC, M_LD, M_NEG,M_RETI, M_IM, M_LD, M_IN, M_OUT, M_SBC, M_LD, M_NEG,M_RETN, M_IM, M_LD, M_IN, M_OUT, M_ADC, M_LD, M_NEG,M_RETN, M_IM, M_LD, M_IN, M_OUT, M_SBC, M_LD, M_NEG,M_RETN, M_IM, M_RRD, // 60 M_IN, M_OUT, M_ADC, M_LD, M_NEG,M_RETN, M_IM, M_RLD, M_IN, M_OUT, M_SBC, M_LD, M_NEG,M_RETN, M_IM, M_NUL, M_IN, M_OUT, M_ADC, M_LD, M_NEG,M_RETN, M_IM, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, // 80 M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_LDI, M_CPI, M_INI, M_OUTI,M_NUL,M_NUL, M_NUL, M_NUL, // A0 M_LDD, M_CPD, M_IND, M_OUTD,M_NUL,M_NUL, M_NUL, M_NUL, M_LDIR,M_CPIR,M_INIR,M_OTIR,M_NUL,M_NUL, M_NUL, M_NUL, M_LDDR,M_CPDR,M_INDR,M_OTDR,M_NUL,M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, // C0 M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, // E0 M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL }; /** Contains the mnemonics reference for the instruction */ public static final int[] tableModesED={ A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, // 00 A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, // 20 A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_B__C,A__C_A,A_HL_BC,A__NN_BC,A_NUL, A_NUL, A_0, A_I_A, // 40 A_C__C,A__C_C,A_HL_BC,A_BC__NN,A_NUL, A_NUL, A_0, A_R_A, A_D__C,A__C_D,A_HL_DE,A__NN_DE,A_NUL, A_NUL, A_1, A_A_I, A_E__C,A__C_E,A_HL_DE,A_DE__NN,A_NUL, A_NUL, A_2, A_A_R, A_H__C,A__C_H,A_HL_HL,A__NN_HL,A_NUL, A_NUL, A_0, A_NUL, // 60 A_L__C,A__C_L,A_HL_HL,A_HL__NN,A_NUL, A_NUL, A_0, A_NUL, A___C, A___C_0,A_HL_SP,A__NN_SP,A_NUL,A_NUL, A_1, A_NUL, A_A__C,A__C_A,A_HL_SP,A_SP__NN, A_NUL,A_NUL, A_2, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, // 80 A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, // A0 A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, // C0 A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, // E0 A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL }; /** Contains the bytes used for the instruction */ public static final byte[] tableSizeED={ 2, 2, 2, 2, 2, 2, 2, 2, // 00 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 20 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, // 40 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, // 60 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 80 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // A0 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C0 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // E0 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }; /** Contains the mnemonics reference for the instruction */ public static final byte[] tableMnemonicsCB={ M_RLC, M_RLC, M_RLC, M_RLC, M_RLC, M_RLC, M_RLC, M_RLC, // 00 M_RRC, M_RRC, M_RRC, M_RRC, M_RRC, M_RRC, M_RRC, M_RRC, M_RL, M_RL, M_RL, M_RL, M_RL, M_RL, M_RL, M_RL, M_RR, M_RR, M_RR, M_RR, M_RR, M_RR, M_RR, M_RR, M_SLA, M_SLA, M_SLA, M_SLA, M_SLA, M_SLA, M_SLA, M_SLA, // 20 M_SRA, M_SRA, M_SRA, M_SRA, M_SRA, M_SRA, M_SRA, M_SRA, M_SLL, M_SLL, M_SLL, M_SLL, M_SLL, M_SLL, M_SLL, M_SLL, M_SRL, M_SRL, M_SRL, M_SRL, M_SRL, M_SRL, M_SRL, M_SRL, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, // 40 M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, // 60 M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, // 80 M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, // A0 M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, // C0 M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, // E0 M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET }; /** Contains the mnemonics reference for the instruction */ public static final int[] tableModesCB={ A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A, // 00 A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A, A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A, A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A, A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A, // 20 A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A, A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A, A_REG_B, A_REG_C, A_REG_D, A_REG_E, A_REG_H, A_REG_L, A__HL, A_REG_A, A_0_B, A_0_C, A_0_D, A_0_E, A_0_H, A_0_L, A_0__HL,A_0_A, // 40 A_1_B, A_1_C, A_1_D, A_1_E, A_1_H, A_1_L, A_1__HL,A_1_A, A_2_B, A_2_C, A_2_D, A_2_E, A_2_H, A_2_L, A_2__HL,A_2_A, A_3_B, A_3_C, A_3_D, A_3_E, A_3_H, A_3_L, A_3__HL,A_3_A, A_4_B, A_4_C, A_4_D, A_4_E, A_4_H, A_4_L, A_4__HL,A_4_A, // 60 A_5_B, A_5_C, A_5_D, A_5_E, A_5_H, A_5_L, A_5__HL,A_5_A, A_6_B, A_6_C, A_6_D, A_6_E, A_6_H, A_6_L, A_6__HL,A_6_A, A_7_B, A_7_C, A_7_D, A_7_E, A_7_H, A_7_L, A_7__HL,A_7_A, A_0_B, A_0_C, A_0_D, A_0_E, A_0_H, A_0_L, A_0__HL,A_0_A, // 80 A_1_B, A_1_C, A_1_D, A_1_E, A_1_H, A_1_L, A_1__HL,A_1_A, A_2_B, A_2_C, A_2_D, A_2_E, A_2_H, A_2_L, A_2__HL,A_2_A, A_3_B, A_3_C, A_3_D, A_3_E, A_3_H, A_3_L, A_3__HL,A_3_A, A_4_B, A_4_C, A_4_D, A_4_E, A_4_H, A_4_L, A_4__HL,A_4_A, // A0 A_5_B, A_5_C, A_5_D, A_5_E, A_5_H, A_5_L, A_5__HL,A_5_A, A_6_B, A_6_C, A_6_D, A_6_E, A_6_H, A_6_L, A_6__HL,A_6_A, A_7_B, A_7_C, A_7_D, A_7_E, A_7_H, A_7_L, A_7__HL,A_7_A, A_0_B, A_0_C, A_0_D, A_0_E, A_0_H, A_0_L, A_0__HL,A_0_A, // C0 A_1_B, A_1_C, A_1_D, A_1_E, A_1_H, A_1_L, A_1__HL,A_1_A, A_2_B, A_2_C, A_2_D, A_2_E, A_2_H, A_2_L, A_2__HL,A_2_A, A_3_B, A_3_C, A_3_D, A_3_E, A_3_H, A_3_L, A_3__HL,A_3_A, A_4_B, A_4_C, A_4_D, A_4_E, A_4_H, A_4_L, A_4__HL,A_4_A, // E0 A_5_B, A_5_C, A_5_D, A_5_E, A_5_H, A_5_L, A_5__HL,A_5_A, A_6_B, A_6_C, A_6_D, A_6_E, A_6_H, A_6_L, A_6__HL,A_6_A, A_7_B, A_7_C, A_7_D, A_7_E, A_7_H, A_7_L, A_7__HL,A_7_A }; /** Contains the bytes used for the instruction */ public static final byte[] tableSizeCB={ 2, 2, 2, 2, 2, 2, 2, 2, // 00 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 20 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 40 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 60 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 80 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // A0 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C0 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // E0 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }; /** Contains the mnemonics reference for the instruction */ public static final byte[] tableMnemonicsDD={ M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, // 00 M_NUL, M_ADD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_ADD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_LD, M_INC, M_INC, M_DEC, M_LD, M_NUL, // 20 M_NUL, M_ADD, M_LD, M_DEC, M_INC, M_DEC, M_LD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_INC, M_DEC, M_LD, M_NUL, M_NUL, M_ADD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_LD, M_LD, M_NUL, // 40 M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_LD, M_LD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_LD, M_LD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, // 60 M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_NUL, M_LD, M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_LD, M_LD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_ADD, M_ADD, M_ADD, M_NUL, // 80 M_NUL, M_NUL, M_NUL, M_NUL, M_ADC, M_ADC, M_ADC, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_SUB, M_SUB, M_SUB, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_SBC, M_SBC, M_SBC, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_AND, M_AND, M_AND, M_NUL, // A0 M_NUL, M_NUL, M_NUL, M_NUL, M_XOR, M_XOR, M_XOR, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_OR, M_OR, M_OR, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_CP, M_CP, M_CP, M_CP, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, // C0 M_NUL, M_NUL, M_NUL, T_DDCB,M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_POP, M_NUL, M_EX, M_NUL, M_PUSH,M_NUL, M_NUL, // E0 M_NUL, M_JP, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL }; /** Contains the mnemonics reference for the instruction */ public static final int[] tableModesDD={ A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, // 00 A_NUL, A_IX_BC,A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_IX_DE,A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_IX_NN,A__NN_IX,A_REG_IX,A_REG_IXH,A_REG_IXH,A_IXH_N,A_NUL, // 20 A_NUL, A_IX_IX,A_IX__NN,A_REG_IX,A_REG_IXL,A_REG_IXL,A_IXL_N,A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A__IX_N, A__IX_N, A__IX_N_N, A_NUL, A_NUL, A_IX_SP,A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_B_IXH, A_B_IXL, A_B__IXN, A_NUL, // 40 A_NUL, A_NUL, A_NUL, A_NUL, A_C_IXH, A_C_IXL, A_C__IXN, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_D_IXH, A_D_IXL, A_D__IXN, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_E_IXH, A_E_IXL, A_E__IXN, A_NUL, A_IXH_B,A_IXH_C,A_IXH_D,A_IXH_E, A_IXH_IXH, A_IXH_L, A_H__IX_N, A_IXH_A,//60 A_IXL_B,A_IXL_C,A_IXL_D,A_IXL_E, A_IXL_IXH, A_IXL_L, A_L__IX_N, A_IXL_A, A__IX_N_B,A__IX_N_C,A__IX_N_D,A__IX_N_E,A__IX_N_H,A__IX_N_L, A_NUL,A__IX_N_A, A_NUL, A_NUL, A_NUL, A_NUL, A_A_IXH, A_A_IXL, A_A__IXN, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_A_IXH, A_A_IXL, A_A__IXN, A_NUL, // 80 A_NUL, A_NUL, A_NUL, A_NUL, A_A_IXH, A_A_IXL, A_A__IXN, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_REG_IXH, A_REG_IXL, A__IX_N, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_A_IXH, A_A_IXL, A_A__IXN, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_REG_IXH, A_REG_IXL, A__IX_N, A_NUL, // A0 A_NUL, A_NUL, A_NUL, A_NUL, A_REG_IXH, A_REG_IXL, A__IX_N, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_REG_IXH, A_REG_IXL, A__IX_N, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_REG_IXH, A_REG_IXL, A__IX_N, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, // C0 A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_REG_IX,A_NUL, A__SP_IX,A_REG_IX, A_NUL, A_NUL, A_NUL, // E0 A_NUL, A__IX, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_SP_IX, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL }; /** Contains the bytes used for the instruction */ public static final byte[] tableSizeDD={ 2, 2, 2, 2, 2, 2, 2, 2, // 00 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 2, 2, 2, 3, 2, // 20 2, 2, 4, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 3, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, // 40 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, // 60 2, 2, 2, 2, 2, 2, 3, 2, 3, 3, 3, 3, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, // 80 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, // A0 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C0 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // E0 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }; /** Contains the mnemonics reference for the instruction */ public static final byte[] tableMnemonicsFD={ M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, // 00 M_NUL, M_ADD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_ADD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_LD, M_INC, M_INC, M_DEC, M_LD, M_NUL, // 20 M_NUL, M_ADD, M_LD, M_DEC, M_INC, M_DEC, M_LD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_INC, M_DEC, M_LD, M_NUL, M_NUL, M_ADD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_LD, M_LD, M_NUL, // 40 M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_LD, M_LD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_LD, M_LD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, // 60 M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_LD, M_NUL, M_LD, M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_LD, M_LD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_ADD, M_ADD, M_ADD, M_NUL, // 80 M_NUL, M_NUL, M_NUL, M_NUL, M_ADC, M_ADC, M_ADC, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_SUB, M_SUB, M_SUB, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_SBC, M_SBC, M_SBC, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_AND, M_AND, M_AND, M_NUL, // A0 M_NUL, M_NUL, M_NUL, M_NUL, M_XOR, M_XOR, M_XOR, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_OR, M_OR, M_OR, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_CP, M_CP, M_CP, M_CP, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, // C0 M_NUL, M_NUL, M_NUL, T_FDCB,M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_POP, M_NUL, M_EX, M_NUL, M_PUSH,M_NUL, M_NUL, // E0 M_NUL, M_JP, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_LD, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL, M_NUL }; /** Contains the mnemonics reference for the instruction */ public static final int[] tableModesFD={ A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, // 00 A_NUL, A_IY_BC,A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_IY_DE,A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_IY_NN,A__NN_IY,A_REG_IY,A_REG_IYH,A_REG_IYH,A_IYH_N, A_NUL, // 20 A_NUL, A_IY_IY,A_IY__NN,A_REG_IY,A_REG_IYL,A_REG_IYL,A_IYL_N, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A__IY_N, A__IY_N, A__IY_N_N, A_NUL, A_NUL, A_IY_SP,A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_B_IYH, A_B_IYL, A_B__IY_N, A_NUL, // 40 A_NUL, A_NUL, A_NUL, A_NUL, A_C_IYH, A_C_IYL, A_C__IY_N, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_D_IYH, A_D_IYL, A_D__IY_N, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_E_IYH, A_E_IYL, A_E__IY_N, A_NUL, A_IYH_B,A_IYH_C,A_IYH_D,A_IYH_E, A_IYH_IYH, A_IYH_L, A_H__IY_N, A_IYH_A,//60 A_IYL_B,A_IYL_C,A_IYL_D,A_IYL_E, A_IYL_IYH, A_IYL_L, A_L__IY_N, A_IYL_A, A__IY_N_B,A__IY_N_C,A__IY_N_D,A__IY_N_E,A__IY_N_H,A__IY_N_L, A_NUL,A__IY_N_A, A_NUL, A_NUL, A_NUL, A_NUL, A_A_IYH, A_A_IYL, A_A__IY_N,A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_A_IYH, A_A_IYL, A_A__IY_N,A_NUL, // 80 A_NUL, A_NUL, A_NUL, A_NUL, A_A_IYH, A_A_IYL, A_A__IY_N,A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_REG_IYH, A_REG_IYL, A__IY_N, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_A_IYH, A_A_IYL, A_A__IY_N, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_REG_IYH, A_REG_IYL, A__IY_N, A_NUL, // A0 A_NUL, A_NUL, A_NUL, A_NUL, A_REG_IYH, A_REG_IYL, A__IY_N, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_REG_IYH, A_REG_IYL, A__IY_N, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_REG_IYH, A_REG_IYL, A__IY_N, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, // C0 A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_REG_IY,A_NUL, A__SP_IY,A_REG_IY, A_NUL, A_NUL, A_NUL, // E0 A_NUL, A__IY, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_SP_IY, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL, A_NUL }; /** Contains the bytes used for the instruction */ public static final byte[] tableSizeFD={ 2, 2, 2, 2, 2, 2, 2, 2, // 00 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 2, 2, 2, 3, 2, // 20 2, 2, 4, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 3, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, // 40 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, // 60 2, 2, 2, 2, 2, 2, 3, 2, 3, 3, 3, 3, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, // 80 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, // A0 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C0 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // E0 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }; /** Contains the mnemonics reference for the instruction */ public static final byte[] tableMnemonicsDDCB={ M_RLC, M_RLC, M_RLC, M_RLC, M_RLC, M_RLC, M_RLC, M_RLC, // 00 M_RRC, M_RRC, M_RRC, M_RRC, M_RRC, M_RRC, M_RRC, M_RRC, M_RL, M_RL, M_RL, M_RL, M_RL, M_RL, M_RL, M_RL, M_RR, M_RR, M_RR, M_RR, M_RR, M_RR, M_RR, M_RR, M_SLA, M_SLA, M_SLA, M_SLA, M_SLA, M_SLA, M_SLA, M_SLA, // 20 M_SRA, M_SRA, M_SRA, M_SRA, M_SRA, M_SRA, M_SRA, M_SRA, M_SLL, M_SLL, M_SLL, M_SLL, M_SLL, M_SLL, M_SLL, M_SLL, M_SRL, M_SRL, M_SRL, M_SRL, M_SRL, M_SRL, M_SRL, M_SRL, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, // 40 M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, // 60 M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, // 80 M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, // A0 M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, // C0 M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, // E0 M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET }; /** Contains the mnemonics reference for the instruction */ public static final int[] tableModesDDCB={ A__IX_N_B, A__IX_N_C, A__IX_N_D, A__IX_N_E, A__IX_N_H, A__IX_N_L, A__IX_N, A__IX_N_A, // 00 A__IX_N_B, A__IX_N_C, A__IX_N_D, A__IX_N_E, A__IX_N_H, A__IX_N_L, A__IX_N, A__IX_N_A, A__IX_N_B, A__IX_N_C, A__IX_N_D, A__IX_N_E, A__IX_N_H, A__IX_N_L, A__IX_N, A__IX_N_A, A__IX_N_B, A__IX_N_C, A__IX_N_D, A__IX_N_E, A__IX_N_H, A__IX_N_L, A__IX_N, A__IX_N_A, A__IX_N_B, A__IX_N_C, A__IX_N_D, A__IX_N_E, A__IX_N_H, A__IX_N_L, A__IX_N, A__IX_N_A, // 20 A__IX_N_B, A__IX_N_C, A__IX_N_D, A__IX_N_E, A__IX_N_H, A__IX_N_L, A__IX_N, A__IX_N_A, A__IX_N_B, A__IX_N_C, A__IX_N_D, A__IX_N_E, A__IX_N_H, A__IX_N_L, A__IX_N, A__IX_N_A, A__IX_N_B, A__IX_N_C, A__IX_N_D, A__IX_N_E, A__IX_N_H, A__IX_N_L, A__IX_N, A__IX_N_A, A_0__IX_N, A_0__IX_N, A_0__IX_N, A_0__IX_N, A_0__IX_N, A_0__IX_N, A_0__IX_N, A_0__IX_N, // 40 A_1__IX_N, A_1__IX_N, A_1__IX_N, A_1__IX_N, A_1__IX_N, A_1__IX_N, A_1__IX_N, A_1__IX_N, A_2__IX_N, A_2__IX_N, A_2__IX_N, A_2__IX_N, A_2__IX_N, A_2__IX_N, A_2__IX_N, A_2__IX_N, A_3__IX_N, A_3__IX_N, A_3__IX_N, A_3__IX_N, A_3__IX_N, A_3__IX_N, A_3__IX_N, A_3__IX_N, A_4__IX_N, A_4__IX_N, A_4__IX_N, A_4__IX_N, A_4__IX_N, A_4__IX_N, A_4__IX_N, A_4__IX_N, // 60 A_5__IX_N, A_5__IX_N, A_5__IX_N, A_5__IX_N, A_5__IX_N, A_5__IX_N, A_5__IX_N, A_5__IX_N, A_6__IX_N, A_6__IX_N, A_6__IX_N, A_6__IX_N, A_6__IX_N, A_6__IX_N, A_6__IX_N, A_6__IX_N, A_7__IX_N, A_7__IX_N, A_7__IX_N, A_7__IX_N, A_7__IX_N, A_7__IX_N, A_7__IX_N, A_7__IX_N, A_0__IX_N_B,A_0__IX_N_C,A_0__IX_N_D,A_0__IX_N_E,A_0__IX_N_H,A_0__IX_N_L,A_0__IX_N, A_0__IX_N_A,// 80 A_1__IX_N_B,A_1__IX_N_C,A_1__IX_N_D,A_1__IX_N_E,A_1__IX_N_H,A_1__IX_N_L,A_1__IX_N, A_1__IX_N_A, A_2__IX_N_B,A_2__IX_N_C,A_2__IX_N_D,A_2__IX_N_E,A_2__IX_N_H,A_2__IX_N_L,A_2__IX_N, A_2__IX_N_A, A_3__IX_N_B,A_3__IX_N_C,A_3__IX_N_D,A_3__IX_N_E,A_3__IX_N_H,A_3__IX_N_L,A_3__IX_N, A_3__IX_N_A, A_4__IX_N_B,A_4__IX_N_C,A_4__IX_N_D,A_4__IX_N_E,A_4__IX_N_H,A_4__IX_N_L,A_4__IX_N, A_4__IX_N_A, // A0 A_5__IX_N_B,A_5__IX_N_C,A_5__IX_N_D,A_5__IX_N_E,A_5__IX_N_H,A_5__IX_N_L,A_5__IX_N, A_5__IX_N_A, A_6__IX_N_B,A_6__IX_N_C,A_6__IX_N_D,A_6__IX_N_E,A_6__IX_N_H,A_6__IX_N_L,A_6__IX_N, A_6__IX_N_A, A_7__IX_N_B,A_7__IX_N_C,A_7__IX_N_D,A_7__IX_N_E,A_7__IX_N_H,A_7__IX_N_L,A_7__IX_N, A_7__IX_N_A, A_0__IX_N_B,A_0__IX_N_C,A_0__IX_N_D,A_0__IX_N_E,A_0__IX_N_H,A_0__IX_N_L,A_0__IX_N, A_0__IX_N_A, // C0 A_1__IX_N_B,A_1__IX_N_C,A_1__IX_N_D,A_1__IX_N_E,A_1__IX_N_H,A_1__IX_N_L,A_1__IX_N, A_1__IX_N_A, A_2__IX_N_B,A_2__IX_N_C,A_2__IX_N_D,A_2__IX_N_E,A_2__IX_N_H,A_2__IX_N_L,A_2__IX_N, A_2__IX_N_A, A_3__IX_N_B,A_3__IX_N_C,A_3__IX_N_D,A_3__IX_N_E,A_3__IX_N_H,A_3__IX_N_L,A_3__IX_N, A_3__IX_N_A, A_4__IX_N_B,A_4__IX_N_C,A_4__IX_N_D,A_4__IX_N_E,A_4__IX_N_H,A_4__IX_N_L,A_4__IX_N, A_4__IX_N_A, // E0 A_5__IX_N_B,A_5__IX_N_C,A_5__IX_N_D,A_5__IX_N_E,A_5__IX_N_H,A_5__IX_N_L,A_5__IX_N, A_5__IX_N_A, A_6__IX_N_B,A_6__IX_N_C,A_6__IX_N_D,A_6__IX_N_E,A_6__IX_N_H,A_6__IX_N_L,A_6__IX_N, A_6__IX_N_A, A_7__IX_N_B,A_7__IX_N_C,A_7__IX_N_D,A_7__IX_N_E,A_7__IX_N_H,A_7__IX_N_L,A_7__IX_N, A_7__IX_N_A }; /** Contains the bytes used for the instruction */ public static final byte[] tableSizeDDCB={ 4, 4, 4, 4, 4, 4, 4, 4, // 00 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 20 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 40 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 60 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 80 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // A0 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // C0 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // E0 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2 }; /** Contains the mnemonics reference for the instruction */ public static final byte[] tableMnemonicsFDCB={ M_RLC, M_RLC, M_RLC, M_RLC, M_RLC, M_RLC, M_RLC, M_RLC, // 00 M_RRC, M_RRC, M_RRC, M_RRC, M_RRC, M_RRC, M_RRC, M_RRC, M_RL, M_RL, M_RL, M_RL, M_RL, M_RL, M_RL, M_RL, M_RR, M_RR, M_RR, M_RR, M_RR, M_RR, M_RR, M_RR, M_SLA, M_SLA, M_SLA, M_SLA, M_SLA, M_SLA, M_SLA, M_SLA, // 20 M_SRA, M_SRA, M_SRA, M_SRA, M_SRA, M_SRA, M_SRA, M_SRA, M_SLL, M_SLL, M_SLL, M_SLL, M_SLL, M_SLL, M_SLL, M_SLL, M_SRL, M_SRL, M_SRL, M_SRL, M_SRL, M_SRL, M_SRL, M_SRL, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, // 40 M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, // 60 M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_BIT, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, // 80 M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, // A0 M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_RES, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, // C0 M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, // E0 M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET, M_SET }; /** Contains the mnemonics reference for the instruction */ public static final int[] tableModesFDCB={ A__IY_N_B, A__IY_N_C, A__IY_N_D, A__IY_N_E, A__IY_N_H, A__IY_N_L, A__IY_N, A__IY_N_A, // 00 A__IY_N_B, A__IY_N_C, A__IY_N_D, A__IY_N_E, A__IY_N_H, A__IY_N_L, A__IY_N, A__IY_N_A, A__IY_N_B, A__IY_N_C, A__IY_N_D, A__IY_N_E, A__IY_N_H, A__IY_N_L, A__IY_N, A__IY_N_A, A__IY_N_B, A__IY_N_C, A__IY_N_D, A__IY_N_E, A__IY_N_H, A__IY_N_L, A__IY_N, A__IY_N_A, A__IY_N_B, A__IY_N_C, A__IY_N_D, A__IY_N_E, A__IY_N_H, A__IY_N_L, A__IY_N, A__IY_N_A, // 20 A__IY_N_B, A__IY_N_C, A__IY_N_D, A__IY_N_E, A__IY_N_H, A__IY_N_L, A__IY_N, A__IY_N_A, A__IY_N_B, A__IY_N_C, A__IY_N_D, A__IY_N_E, A__IY_N_H, A__IY_N_L, A__IY_N, A__IY_N_A, A__IY_N_B, A__IY_N_C, A__IY_N_D, A__IY_N_E, A__IY_N_H, A__IY_N_L, A__IY_N, A__IY_N_A, A_0__IY_N, A_0__IY_N, A_0__IY_N, A_0__IY_N, A_0__IY_N, A_0__IY_N, A_0__IY_N, A_0__IY_N, // 40 A_1__IY_N, A_1__IY_N, A_1__IY_N, A_1__IY_N, A_1__IY_N, A_1__IY_N, A_1__IY_N, A_1__IY_N, A_2__IY_N, A_2__IY_N, A_2__IY_N, A_2__IY_N, A_2__IY_N, A_2__IY_N, A_2__IY_N, A_2__IY_N, A_3__IY_N, A_3__IY_N, A_3__IY_N, A_3__IY_N, A_3__IY_N, A_3__IY_N, A_3__IY_N, A_3__IY_N, A_4__IY_N, A_4__IY_N, A_4__IY_N, A_4__IY_N, A_4__IY_N, A_4__IY_N, A_4__IY_N, A_4__IY_N, // 60 A_5__IY_N, A_5__IY_N, A_5__IY_N, A_5__IY_N, A_5__IY_N, A_5__IY_N, A_5__IY_N, A_5__IY_N, A_6__IY_N, A_6__IY_N, A_6__IY_N, A_6__IY_N, A_6__IY_N, A_6__IY_N, A_6__IY_N, A_6__IY_N, A_7__IY_N, A_7__IY_N, A_7__IY_N, A_7__IY_N, A_7__IY_N, A_7__IY_N, A_7__IY_N, A_7__IY_N, A_0__IY_N_B,A_0__IY_N_C,A_0__IY_N_D,A_0__IY_N_E,A_0__IY_N_H,A_0__IY_N_L,A_0__IY_N, A_0__IY_N_A,// 80 A_1__IY_N_B,A_1__IY_N_C,A_1__IY_N_D,A_1__IY_N_E,A_1__IY_N_H,A_1__IY_N_L,A_1__IY_N, A_1__IY_N_A, A_2__IY_N_B,A_2__IY_N_C,A_2__IY_N_D,A_2__IY_N_E,A_2__IY_N_H,A_2__IY_N_L,A_2__IY_N, A_2__IY_N_A, A_3__IY_N_B,A_3__IY_N_C,A_3__IY_N_D,A_3__IY_N_E,A_3__IY_N_H,A_3__IY_N_L,A_3__IY_N, A_3__IY_N_A, A_4__IY_N_B,A_4__IY_N_C,A_4__IY_N_D,A_4__IY_N_E,A_4__IY_N_H,A_4__IY_N_L,A_4__IY_N, A_4__IY_N_A, // A0 A_5__IY_N_B,A_5__IY_N_C,A_5__IY_N_D,A_5__IY_N_E,A_5__IY_N_H,A_5__IY_N_L,A_5__IY_N, A_5__IY_N_A, A_6__IY_N_B,A_6__IY_N_C,A_6__IY_N_D,A_6__IY_N_E,A_6__IY_N_H,A_6__IY_N_L,A_6__IY_N, A_6__IY_N_A, A_7__IY_N_B,A_7__IY_N_C,A_7__IY_N_D,A_7__IY_N_E,A_7__IY_N_H,A_7__IY_N_L,A_7__IY_N, A_7__IY_N_A, A_0__IY_N_B,A_0__IY_N_C,A_0__IY_N_D,A_0__IY_N_E,A_0__IY_N_H,A_0__IY_N_L,A_0__IY_N, A_0__IY_N_A, // C0 A_1__IY_N_B,A_1__IY_N_C,A_1__IY_N_D,A_1__IY_N_E,A_1__IY_N_H,A_1__IY_N_L,A_1__IY_N, A_1__IY_N_A, A_2__IY_N_B,A_2__IY_N_C,A_2__IY_N_D,A_2__IY_N_E,A_2__IY_N_H,A_2__IY_N_L,A_2__IY_N, A_2__IY_N_A, A_3__IY_N_B,A_3__IY_N_C,A_3__IY_N_D,A_3__IY_N_E,A_3__IY_N_H,A_3__IY_N_L,A_3__IY_N, A_3__IY_N_A, A_4__IY_N_B,A_4__IY_N_C,A_4__IY_N_D,A_4__IY_N_E,A_4__IY_N_H,A_4__IY_N_L,A_4__IY_N, A_4__IY_N_A, // E0 A_5__IY_N_B,A_5__IY_N_C,A_5__IY_N_D,A_5__IY_N_E,A_5__IY_N_H,A_5__IY_N_L,A_5__IY_N, A_5__IY_N_A, A_6__IY_N_B,A_6__IY_N_C,A_6__IY_N_D,A_6__IY_N_E,A_6__IY_N_H,A_6__IY_N_L,A_6__IY_N, A_6__IY_N_A, A_7__IY_N_B,A_7__IY_N_C,A_7__IY_N_D,A_7__IY_N_E,A_7__IY_N_H,A_7__IY_N_L,A_7__IY_N, A_7__IY_N_A }; /** Contains the bytes used for the instruction */ public static final byte[] tableSizeFDCB={ 4, 4, 4, 4, 4, 4, 4, 4, // 00 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 20 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 40 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 60 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 80 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // A0 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // C0 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // E0 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2 }; @Override public String dasm(byte[] buffer, int pos, long pc) { String result=""; // result disassemble string int steps=0; int op=Unsigned.done(buffer[pos++]); // instruction opcode iType=(int)tableMnemonics[op]; // store the type for creating comment switch (iType) { case T_CB: op=Unsigned.done(buffer[pos++]); iType=(int)tableMnemonicsCB[op]; aType=tableModesCB[op]; steps=tableSizeCB[op]; break; case T_DD: op=Unsigned.done(buffer[pos++]); iType=(int)tableMnemonicsDD[op]; aType=tableModesDD[op]; steps=tableSizeDD[op]; if (iType==T_DDCB) { // there are an extra table op=Unsigned.done(buffer[pos+1]); pos++; iType=(int)tableMnemonicsDDCB[op]; aType=tableModesDDCB[op]; steps=tableSizeDDCB[op]; } break; case T_ED: op=Unsigned.done(buffer[pos++]); iType=(int)tableMnemonicsED[op]; aType=tableModesED[op]; steps=tableSizeED[op]; break; case T_FD: op=Unsigned.done(buffer[pos++]); iType=(int)tableMnemonicsFD[op]; aType=tableModesFD[op]; steps=tableSizeFD[op]; if (iType==T_FDCB) { op=Unsigned.done(buffer[pos+1]); pos++; iType=(int)tableMnemonicsFDCB[op]; aType=tableModesFDCB[op]; steps=tableSizeFDCB[op]; } break; default: aType=tableModes[op]; steps=tableSize[op]; break; } if (upperCase) result=mnemonics[iType]; else result=mnemonics[iType].toLowerCase(); String nn=getSpacesTabsOp(); switch (result.length()) { case 2: result+=nn; break; case 3: if (option.numSpacesOp>1) result+=nn.substring(1,nn.length()); else result+=nn; break; case 4: if (option.numSpacesOp>2) result+=nn.substring(2,nn.length()); else if (option.numSpacesOp>1) result+=nn.substring(1,nn.length()); else result+=nn; break; } switch (aType) { case A_NUL: // nothing break; case A_REG_A: // register A result+=(upperCase? "A": "a"); break; case A_REG_B: // register B result+=(upperCase? "B": "b"); break; case A_REG_C: // register C result+=(upperCase? "C": "c"); break; case A_REG_D: // register D result+=(upperCase? "D": "d"); break; case A_REG_E: // register E result+=(upperCase? "E": "e"); break; case A_REG_H: // register H result+=(upperCase? "H": "h"); break; case A_BC_NN: // BC absolute nn this.pos=pos; result+=getRegXXNN(buffer, (upperCase? "BC": "bc")); pos=this.pos; break; case A_DE_NN: // DE absolute nn this.pos=pos; result+=getRegXXNN(buffer, (upperCase? "DE": "de")); pos=this.pos; break; case A_HL_NN: // HL absolute nn this.pos=pos; result+=getRegXXNN(buffer, (upperCase? "HL": "hl")); pos=this.pos; break; case A_SP_NN: // SP absolute nn this.pos=pos; result+=getRegXXNN(buffer, (upperCase? "SP": "sp")); pos=this.pos; break; case A_IX_NN: // IX absolute nn this.pos=pos; result+=getRegXXNN(buffer, (upperCase? "IX": "ix")); pos=this.pos; break; case A_IY_NN: // IY absolute nn this.pos=pos; result+=getRegXXNN(buffer, (upperCase? "IY": "iy")); pos=this.pos; break; case A__BC_A: // (BC) indirect A result+=(upperCase? "(BC),A": "(bc),a"); break; case A__DE_A: // (DE) indirect A result+=(upperCase? "(DE),A": "(de),a"); break; case A__HL_A: // (HL) indirect A result+=(upperCase? "(HL),A": "(hl),a"); break; case A__HL_B: // (HL) indirect B result+=(upperCase? "(HL),B": "(hl),b"); break; case A__HL_C: // (HL) indirect C result+=(upperCase? "(HL),C": "(hl),c"); break; case A__HL_D: // (HL) indirect D result+=(upperCase? "(HL),D": "(hl),d"); break; case A__HL_E: // (HL) indirect E result+=(upperCase? "(HL),E": "(hl),e"); break; case A__HL_H: // (HL) indirect H result+=(upperCase? "(HL),H": "(hl),h"); break; case A__HL_L: // (HL) indirect L result+=(upperCase? "(HL),L": "(hl),l"); break; case A__IXN_A: // (IX+N) indirect A if (pos<buffer.length) addr=Unsigned.done(buffer[pos++]); else addr=-1; result+=(upperCase? "(IX+)": "(ix+")+getLabelZero(addr)+(upperCase? "),A": "),a"); break; case A__IYN_A: // (IY+N) indirect A if (pos<buffer.length) addr=Unsigned.done(buffer[pos++]); else addr=-1; result+=(upperCase? "(IY+)": "(iy+")+getLabelZero(addr)+(upperCase? "),A": "),a"); break; case A__NN_A: // (NN) indirect A if (pos<buffer.length-1) addr=((Unsigned.done(buffer[pos+1])<<8) | Unsigned.done(buffer[pos++])); else addr=-1; pos++; result+="("+getLabel(addr)+(upperCase? "),A": "),a"); setLabel(addr); setLabelPlus(pc,1); setLabelPlus(pc,2); break; case A_REG_BC: // registers BC result+=(upperCase? "BC": "bc"); break; case A_REG_DE: // registers DE result+=(upperCase? "DE": "de"); break; case A_REG_HL: // registers HL result+=(upperCase? "HL": "hl"); break; case A_REG_SP: // registers SP result+=(upperCase? "SP": "sp"); break; case A_REG_AF: // register AF result+=(upperCase? "AF": "af"); break; case A_A_N: // A reg with N this.pos=pos; result+=getRegXN(buffer, (upperCase? "A": "a")); pos=this.pos; break; case A_B_N: // B reg with N this.pos=pos; result+=getRegXN(buffer, (upperCase? "B": "b")); pos=this.pos; break; case A_C_N: // C reg with N this.pos=pos; result+=getRegXN(buffer, (upperCase? "C": "c")); pos=this.pos; break; case A_D_N: // D reg with N this.pos=pos; result+=getRegXN(buffer, (upperCase? "D": "d")); pos=this.pos; break; case A_E_N: // E reg with N this.pos=pos; result+=getRegXN(buffer, (upperCase? "E": "e")); pos=this.pos; break; case A_H_N: // H reg with N this.pos=pos; result+=getRegXN(buffer, (upperCase? "H": "h")); pos=this.pos; break; case A_L_N: // L reg with N this.pos=pos; result+=getRegXN(buffer, (upperCase? "L": "l")); pos=this.pos; break; case A_IXH_N: // IXH,N this.pos=pos; result+=getRegXN(buffer, (upperCase? "IXH": "ixh")); pos=this.pos; break; case A_IXL_N: // IXL,N this.pos=pos; result+=getRegXN(buffer, (upperCase? "IXL": "ixl")); pos=this.pos; break; case A_IYH_N: // IYH,N this.pos=pos; result+=getRegXN(buffer, (upperCase? "IYH": "iyh")); pos=this.pos; break; case A_IYL_N: // IYL,N this.pos=pos; result+=getRegXN(buffer, (upperCase? "IYL": "iyl")); pos=this.pos; break; case A_AF_AF: result+=(upperCase? "AF,AF'": "af,af'"); break; case A_REL: // relative if (pos<buffer.length) addr=pc+buffer[pos++]+2; else addr=-1; result+=getLabel(addr); setLabel(addr); break; case A_REL_NZ: // relative NZ if (pos<buffer.length) addr=pc+buffer[pos++]+2; else addr=-1; result+=(upperCase? "NZ,": "nz,")+getLabel(addr); setLabel(addr); break; case A_REL_Z: // relative Z if (pos<buffer.length) addr=pc+buffer[pos++]+2; else addr=-1; result+=(upperCase? "Z,": "z,")+getLabel(addr); setLabel(addr); break; case A_REL_NC: // relative NC if (pos<buffer.length) addr=pc+buffer[pos++]+2; else addr=-1; result+=(upperCase? "NC,": "nc,")+getLabel(addr); setLabel(addr); break; case A_REL_C: // relative C if (pos<buffer.length) addr=pc+buffer[pos++]+2; else addr=-1; result+=(upperCase? "C,": "c,")+getLabel(addr); setLabel(addr); break; case A_IXH_A: // IXH reg A result+=(upperCase? "IXH,A": "ixh,a"); break; case A_IXH_B: // IXH reg B result+=(upperCase? "IXH,B": "ixh,b"); break; case A_IXH_C: // IXH reg C result+=(upperCase? "IXH,C": "ixh,c"); break; case A_IXH_D: // IXH reg D result+=(upperCase? "IXH,D": "ixh,d"); break; case A_IXH_E: // IXH reg E result+=(upperCase? "IXH,E": "ixh,e"); break; case A_IXH_H: // IXH reg H result+=(upperCase? "IXH,H": "ixh,h"); break; case A_IXH_L: // IXH reg L result+=(upperCase? "IXH,L": "ixh,l"); break; case A_IYH_A: // IYH reg A result+=(upperCase? "IYH,A": "iyh,a"); break; case A_IYH_B: // IYH reg B result+=(upperCase? "IYH,B": "iyh,b"); break; case A_IYH_C: // IYH reg C result+=(upperCase? "IYH,C": "iyh,c"); break; case A_IYH_D: // IYH reg D result+=(upperCase? "IYH,D": "iyh,d"); break; case A_IYH_E: // IYH reg E result+=(upperCase? "IYH,E": "iyh,e"); break; case A_IYH_H: // IYH reg H result+=(upperCase? "IYH,H": "iyh,h"); break; case A_IYH_L: // IYH reg L result+=(upperCase? "IYH,L": "iyh,l"); break; case A_A_IXH: // A reg IXH result+=(upperCase? "A,IXH": "a,ixh"); break; case A_B_IXH: // B reg IXH result+=(upperCase? "B,IXH": "b,ixh"); break; case A_C_IXH: // C reg IXH result+=(upperCase? "C,IXH": "c,ixh"); break; case A_D_IXH: // D reg IXH result+=(upperCase? "D,IXH": "d,ixh"); break; case A_E_IXH: // E reg IXH result+=(upperCase? "E,IXH": "e,ixh"); break; case A_A_IXL: // A reg IXL result+=(upperCase? "A,IXL": "a,ixl"); break; case A_B_IXL: // B reg IXL result+=(upperCase? "B,IXL": "b,ixl"); break; case A_C_IXL: // C reg IXL result+=(upperCase? "C,IXL": "c,ixl"); break; case A_D_IXL: // D reg IXL result+=(upperCase? "D,IXL": "d,ixl"); break; case A_E_IXL: // E reg IXL result+=(upperCase? "E,IXL": "e,ixl"); break; case A_A_IYH: // A reg IYH result+=(upperCase? "A,IYH": "a,iyh"); break; case A_B_IYH: // B reg IYH result+=(upperCase? "B,IYH": "b,iyh"); break; case A_C_IYH: // C reg IYH result+=(upperCase? "C,IYH": "c,iyh"); break; case A_D_IYH: // D reg IYH result+=(upperCase? "D,IYH": "d,iyh"); break; case A_E_IYH: // E reg IYH result+=(upperCase? "E,IYH": "e,iyh"); break; case A_A_IYL: // A reg IYL result+=(upperCase? "A,IYL": "a,iyl"); break; case A_B_IYL: // B reg IYL result+=(upperCase? "B,IYL": "b,iyl"); break; case A_C_IYL: // C reg IYL result+=(upperCase? "C,IYL": "c,iyl"); break; case A_D_IYL: // D reg IYL result+=(upperCase? "D,IYL": "d,iyl"); break; case A_E_IYL: // E reg IYL result+=(upperCase? "E,IYL": "e,iyl"); break; case A_IXL_A: // IXL reg A result+=(upperCase? "IXL, A": "ixl, a"); break; case A_IXL_B: // IXL reg B result+=(upperCase? "IXL, B": "ixl, b"); break; case A_IXL_C: // IXL reg C result+=(upperCase? "IXL, C": "ixl, c"); break; case A_IXL_D: // IXL reg D result+=(upperCase? "IXL, D": "ixl, d"); break; case A_IXL_E: // IXL reg E result+=(upperCase? "IXL, E": "ixl, e"); break; case A_IXL_L: // IXL reg L result+=(upperCase? "IXL, L": "ixl, l"); break; case A_IYL_A: // IXL reg A result+=(upperCase? "IYL, A": "iyl, a"); break; case A_IYL_B: // IXL reg B result+=(upperCase? "IYL, B": "iyl, b"); break; case A_IYL_C: // IXL reg C result+=(upperCase? "IYL, C": "iyl, c"); break; case A_IYL_D: // IXL reg D result+=(upperCase? "IYL, D": "iyl, d"); break; case A_IYL_E: // IXL reg E result+=(upperCase? "IYL, E": "iyl, e"); break; case A_IYL_L: // IXL reg L result+=(upperCase? "IYL, L": "iyl, l"); break; case A_IXH_IXH: // IXH reg IXH result+=(upperCase? "IXH, IXH": "ixh, ixh"); break; case A_IXH_IXL: // IXH reg IXL result+=(upperCase? "IXH, IXL": "ixh, ixl"); break; case A_IXL_IXH: // IXL reg IXH result+=(upperCase? "IXL, IXH": "ixl, ixh"); break; case A_IXL_IXL: // IXL reg IXL result+=(upperCase? "IXL, IXL": "ixl, ixl"); break; case A_IYH_IYH: // IYH reg IYH result+=(upperCase? "IYH, IYH": "iyh, iyh"); break; case A_IYH_IYL: // IYH reg IYL result+=(upperCase? "IYH, IYL": "iyh, iyl"); break; case A_IYL_IYH: // IYL reg IYH result+=(upperCase? "IYL, IYH": "iyl, iyh"); break; case A_IYL_IYL: // IYL reg IYL result+=(upperCase? "IYL, IYL": "iyl, iyl"); break; case A_HL_BC: // HL reg BC result+=(upperCase? "HL,BC": "hl,bc"); break; case A_HL_DE: // HL reg DE result+=(upperCase? "HL,DE": "hl,de"); break; case A_HL_HL: // HL reg HL result+=(upperCase? "HL,HL": "hl,hl"); break; case A_HL_SP: // HL reg SP result+=(upperCase? "HL,SP": "hl,sp"); break; case A_IX_BC: // IX reg BC result+=(upperCase? "IX,BC": "ix,bc"); break; case A_IX_DE: // IX reg DE result+=(upperCase? "IX,DE": "ix,de"); break; case A_IX_HL: // IX reg HL result+=(upperCase? "IX,HL": "ix,hl"); break; case A_IX_SP: // IX reg SP result+=(upperCase? "IX,SP": "ix,sp"); break; case A_IY_BC: // IY reg BC result+=(upperCase? "IY,BC": "iy,bc"); break; case A_IY_DE: // IY reg DE result+=(upperCase? "IY,DE": "iy,de"); break; case A_IY_HL: // IY reg HL result+=(upperCase? "IY,HL": "iy,hl"); break; case A_IY_SP: // IY reg SP result+=(upperCase? "IY,SP": "iy,sp"); break; case A_SP_HL: // SP reg HL result+=(upperCase? "SP,HL": "sp,hl"); break; case A_DE_HL: // DE reg HL result+=(upperCase? "DE,HL": "de,hl"); break; case A_IX_IX: // IX reg IX result+=(upperCase? "IX,IX": "ix,ix"); break; case A_IY_IY: // IY reg IY result+=(upperCase? "IY,IY": "iy,iy"); break; case A_SP_IX: // SP reg IX result+=(upperCase? "SP,IX": "sp,ix"); break; case A_SP_IY: // SP reg IY result+=(upperCase? "SP,IY": "sp,iy"); break; case A__SP_HL: // (SP) ind HL result+=(upperCase? "(SP),HL": "(sp),hl"); break; case A__SP_IX: // (SP) ind IX result+=(upperCase? "(SP),IX": "(sp),ix"); break; case A__SP_IY: // (SP) ind IY result+=(upperCase? "(SP),IY": "(sp),iy"); break; case A_A__BC: // A indirect (BC) result+=(upperCase? "A,(BC)": "a,(bc)"); break; case A_A__DE: // A indirect (DE) result+=(upperCase? "A,(DE)": "a,(de)"); break; case A_A__HL: // A indirect (HL) result+=(upperCase? "A,(HL)": "a,(hl)"); break; case A_A__IXN: // A indirect (IX+N) this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "A": "a"), (upperCase? "IX": "ix")); pos=this.pos; break; case A_A__IYN: // A indirect (IY+N) case A_A__IY_N: this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "A": "a"), (upperCase? "IY": "iy")); pos=this.pos; break; case A_B__HL: // B indirect (HL) result+=(upperCase? "B,(HL)": "b,(hl)"); break; case A_B__IXN: // B indirect (IX+N) this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "B": "b"), (upperCase? "IX": "ix")); pos=this.pos; break; case A_B__IYN: // B indirect (IY+N) case A_B__IY_N: this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "B": "b"), (upperCase? "IY": "iy")); pos=this.pos; break; case A_C__HL: // C indirect (HL) result+=(upperCase? "C,(HL)": "c,(hl)"); break; case A_C__IXN: // C indirect (IX+N) case A_C__IX_N: this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "C": "c"), (upperCase? "IX": "ix")); pos=this.pos; break; case A_C__IYN: // C indirect (IY+N) case A_C__IY_N: this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "C": "c"), (upperCase? "IY": "iy")); pos=this.pos; break; case A_D__HL: // D indirect (HL) result+=(upperCase? "D,(HL)": "d,(hl)"); break; case A_D__IXN: // D indirect (IX+N) case A_D__IX_N: this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "D": "d"), (upperCase? "IX": "ix")); pos=this.pos; break; case A_D__IYN: // D indirect (IY+N) case A_D__IY_N: this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "D": "d"), (upperCase? "IY": "iy")); pos=this.pos; break; case A_E__HL: // E indirect (HL) result+=(upperCase? "E,(HL)": "e,(hl)"); break; case A_E__IXN: // E indirect (IX+N) case A_E__IX_N: this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "E": "e"), (upperCase? "IX": "ix")); pos=this.pos; break; case A_E__IYN: // E indirect (IY+N) case A_E__IY_N: this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "E": "e"), (upperCase? "IY": "iy")); pos=this.pos; break; case A_H__HL: // H indirect (HL) result+=(upperCase? "H,(HL)": "h,(hl)"); break; case A_H__IXN: // H indirect (IX+N) case A_H__IX_N: this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "H": "h"), (upperCase? "IX": "ix")); pos=this.pos; break; case A_H__IYN: // H indirect (IY+N) case A_H__IY_N: this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "H": "h"), (upperCase? "IY": "iy")); pos=this.pos; break; case A_L__HL: // L indirect (HL) result+=(upperCase? "L,(HL)": "l,(hl)"); break; case A_L__IXN: // L indirect (IX+N) case A_L__IX_N: this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "L": "l"), (upperCase? "IX": "ix")); pos=this.pos; break; case A_L__IYN: // L indirect (IY+N) case A_L__IY_N: this.pos=pos; result+=getRefXIndXXN(buffer, (upperCase? "L": "l"), (upperCase? "IY": "iy")); pos=this.pos; break; case A_0__IX_N: // 0 ind (IX+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "0", (upperCase? "IX": "ix")); pos=this.pos; break; case A_0__IY_N: // 0 ind (IY+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "0", (upperCase? "IY": "iy")); pos=this.pos; break; case A_1__IX_N: // 1 ind (IX+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "1", (upperCase? "IX": "ix")); pos=this.pos; break; case A_1__IY_N: // 1 ind (IY+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "1", (upperCase? "IY": "iy")); pos=this.pos; break; case A_2__IX_N: // 2 ind (IX+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "2", (upperCase? "IX": "ix")); pos=this.pos; break; case A_2__IY_N: // 2 ind (IY+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "0", (upperCase? "IY": "iy")); pos=this.pos; break; case A_3__IX_N: // 3 ind (IX+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "3", (upperCase? "IX": "ix")); pos=this.pos; break; case A_3__IY_N: // 3 ind (IY+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "3", (upperCase? "IY": "iy")); pos=this.pos; break; case A_4__IX_N: // 4 ind (IX+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "4", (upperCase? "IX": "ix")); pos=this.pos; break; case A_4__IY_N: // 4 ind (IY+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "4", (upperCase? "IY": "iy")); pos=this.pos; break; case A_5__IX_N: // 5 ind (IX+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "5", (upperCase? "IX": "ix")); pos=this.pos; break; case A_5__IY_N: // 5 ind (IY+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "5", (upperCase? "IY": "iy")); pos=this.pos; break; case A_6__IX_N: // 6 ind (IX+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "6", (upperCase? "IX": "ix")); pos=this.pos; break; case A_6__IY_N: // 6 ind (IY+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "6", (upperCase? "IY": "iy")); pos=this.pos; break; case A_7__IX_N: // 7 ind (IX+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "7", (upperCase? "IX": "ix")); pos=this.pos; break; case A_7__IY_N: // 7 ind (IY+N) this.pos=pos; result+=getRefXInd2XXN(buffer, "7", (upperCase? "IY": "iy")); pos=this.pos; break; case A__NN_BC: // (NN) ind absolute BC this.pos=pos; result+=getIndNNregX(buffer, (upperCase? "BC": "bc")); pos=this.pos; break; case A__NN_DE: // (NN) ind absolute DE this.pos=pos; result+=getIndNNregX(buffer, (upperCase? "DE": "de")); pos=this.pos; break; case A__NN_HL: // (NN) ind absolute HL this.pos=pos; result+=getIndNNregX(buffer, (upperCase? "HL": "hl")); pos=this.pos; break; case A__NN_SP: // (NN) ind absolute SP this.pos=pos; result+=getIndNNregX(buffer, (upperCase? "SP": "sp")); pos=this.pos; break; case A__NN_IX: // (NN) absolute IX this.pos=pos; result+=getIndNNregX(buffer, (upperCase? "IX": "ix")); pos=this.pos; break; case A__NN_IY: // (NN) absolute IY this.pos=pos; result+=getIndNNregX(buffer, (upperCase? "IY": "iy")); pos=this.pos; break; case A_BC__NN: // BC ind absolute (NN) this.pos=pos; result+=getRegXXIndNN(buffer, (upperCase? "BC": "bc")); pos=this.pos; break; case A_DE__NN: // DE ind absolute (NN) this.pos=pos; result+=getRegXXIndNN(buffer, (upperCase? "DE": "de")); pos=this.pos; break; case A_HL__NN: // HL ind absolute (NN) this.pos=pos; result+=getRegXXIndNN(buffer, (upperCase? "HL": "hl")); pos=this.pos; break; case A_SP__NN: // SP ind absolute (NN) this.pos=pos; result+=getRegXXIndNN(buffer, (upperCase? "SP": "sp")); pos=this.pos; break; case A_IX__NN: // IX ind absolute (NN) this.pos=pos; result+=getRegXXIndNN(buffer, (upperCase? "IX": "ix")); pos=this.pos; break; case A_IY__NN: // IY ind absolute (NN) this.pos=pos; result+=getRegXXIndNN(buffer, (upperCase? "IY": "iy")); pos=this.pos; break; case A__HL: // ind (HL) result+=(upperCase? "(HL)": "(hl)"); break; case A__IX: // ind (IX) result+=(upperCase? "(IX)": "(ix)"); break; case A__IY: // ind (IY) result+=(upperCase? "(IY)": "(iy)"); break; case A__HL_N: // ind (HL) imm N if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+=(upperCase? "(HL),": "(hl), ")+getLabelImm(pc+1, value); break; case A_A__NN: // A ind (NN) if (pos<buffer.length-1) addr=((Unsigned.done(buffer[pos+1])<<8) | Unsigned.done(buffer[pos++])); else addr=-1; pos++; result+=(upperCase? "A,(": "a,(")+getLabel(addr)+")"; setLabel(addr); setLabelPlus(pc,1); setLabelPlus(pc,2); break; case A__IX_N_N: // ind (IX+N),N if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+="("+(upperCase? "IX": "ix")+"+"+getLabelImm(pc+1, value)+"),"; if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+=getLabelImm(pc+2, value); break; case A__IY_N_N: // ind (IY+N),N if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+="("+(upperCase? "IY": "iy")+"+"+getLabelImm(pc+1, value)+"),"; if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+=getLabelImm(pc+2, value); break; case A_A_A: // A reg A result+=(upperCase? "A,A": "a,a"); break; case A_A_B: // A reg B result+=(upperCase? "A,B": "a,b"); break; case A_A_C: // A reg C result+=(upperCase? "A,C": "a,c"); break; case A_A_D: // A reg D result+=(upperCase? "A,D": "a,d"); break; case A_A_E: // A reg E result+=(upperCase? "A,E": "a,e"); break; case A_A_H: // A reg H result+=(upperCase? "A,H": "a,h"); break; case A_A_L: // A reg L result+=(upperCase? "A,L": "a,l"); break; case A_A_I: // A reg I result+=(upperCase? "A,I": "a,i"); break; case A_A_R: // A reg R result+=(upperCase? "A,R": "a,r"); break; case A_B_A: // B reg A result+=(upperCase? "B,A": "b,a"); break; case A_B_B: // B reg B result+=(upperCase? "B,B": "b,b"); break; case A_B_C: // B reg C result+=(upperCase? "B,C": "b,c"); break; case A_B_D: // B reg D result+=(upperCase? "B,D": "b,d"); break; case A_B_E: // B reg E result+=(upperCase? "B,E": "b,e"); break; case A_B_H: // B reg H result+=(upperCase? "B,H": "b,h"); break; case A_B_L: // B reg L result+=(upperCase? "B,L": "b,l"); break; case A_C_A: // C reg A result+=(upperCase? "C,A": "c,a"); break; case A_C_B: // C reg B result+=(upperCase? "C,B": "c,b"); break; case A_C_C: // C reg C result+=(upperCase? "C,C": "c,c"); break; case A_C_D: // C reg D result+=(upperCase? "C,D": "c,d"); break; case A_C_E: // C reg E result+=(upperCase? "C,E": "c,e"); break; case A_C_H: // C reg H result+=(upperCase? "C,H": "c,h"); break; case A_C_L: // C reg L result+=(upperCase? "C,L": "c,l"); break; case A_D_A: // C reg A result+=(upperCase? "D,A": "d,a"); break; case A_D_B: // C reg B result+=(upperCase? "D,B": "d,b"); break; case A_D_C: // C reg C result+=(upperCase? "D,C": "d,c"); break; case A_D_D: // C reg D result+=(upperCase? "D,D": "d,d"); break; case A_D_E: // C reg E result+=(upperCase? "D,E": "d,e"); break; case A_D_H: // C reg H result+=(upperCase? "D,H": "d,h"); break; case A_D_L: // C reg L result+=(upperCase? "D,L": "d,l"); break; case A_E_A: // E reg A result+=(upperCase? "E,A": "e,a"); break; case A_E_B: // E reg B result+=(upperCase? "E,B": "e,b"); break; case A_E_C: // E reg C result+=(upperCase? "E,C": "e,c"); break; case A_E_D: // E reg D result+=(upperCase? "E,D": "e,d"); break; case A_E_E: // E reg E result+=(upperCase? "E,E": "e,e"); break; case A_E_H: // E reg H result+=(upperCase? "E,H": "e,h"); break; case A_E_L: // E reg L result+=(upperCase? "E,L": "e,l"); break; case A_H_A: // E reg A result+=(upperCase? "H,A": "h,a"); break; case A_H_B: // H reg B result+=(upperCase? "H,B": "h,b"); break; case A_H_C: // H reg C result+=(upperCase? "H,C": "h,c"); break; case A_H_D: // H reg D result+=(upperCase? "H,D": "h,d"); break; case A_H_E: // H reg E result+=(upperCase? "H,E": "h,e"); break; case A_H_H: // H reg H result+=(upperCase? "H,H": "h,h"); break; case A_H_L: // H reg L result+=(upperCase? "H,L": "h,l"); break; case A_L_A: // L reg A result+=(upperCase? "L,A": "l,a"); break; case A_L_B: // L reg B result+=(upperCase? "L,B": "l,b"); break; case A_L_C: // L reg C result+=(upperCase? "L,C": "l,c"); break; case A_L_D: // L reg D result+=(upperCase? "L,D": "l,d"); break; case A_L_E: // L reg E result+=(upperCase? "L,E": "l,e"); break; case A_L_H: // L reg H result+=(upperCase? "L,H": "l,h"); break; case A_L_L: // L reg L result+=(upperCase? "L,L": "l,l"); break; case A_I_A: // I reg A result+=(upperCase? "I,A": "i,a"); break; case A_R_A: // R reg A result+=(upperCase? "R,A": "r,a"); break; case A_00: // 00h result+="$00"; break; case A_08: // 08h result+="$08"; break; case A_10: // 10h result+="$10"; break; case A_18: // 18h result+="$18"; break; case A_20: // 20h result+="$20"; break; case A_28: // 28h result+="$28"; break; case A_30: // 30h result+="$30"; break; case A_38: // 38h result+="$38"; break; case A_Z: // Z cond result+="Z"; break; case A_NZ: // NZ cond result+="NZ"; break; case A_NC: // NC cond result+="NC"; break; case A_C: // C cond result+="C"; break; case A_PO: // PO cond result+="PO"; break; case A_P: // P cond result+="P"; break; case A_PE: // PE cond result+="PE"; break; case A_M: // M cond result+="M"; break; case A_N: if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+=getLabelImm(pc+1, value); break; case A_NN: // absolute NN if (pos<buffer.length-1) addr=((Unsigned.done(buffer[pos+1])<<8) | Unsigned.done(buffer[pos++])); else addr=-1; pos++; result+=getLabel(addr); setLabel(addr); setLabelPlus(pc,1); setLabelPlus(pc,2); break; case A__N_A: // (N) immediate A if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+="("+getLabelImm(pc+1, value)+"),"+(upperCase? "A": "a"); break; case A_A__N: // A immediate (N) if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+=(upperCase? "A": "a")+",("+getLabelImm(pc+1, value)+")"; break; case A_NZ_NN: // NZ cond NN this.pos=pos; result+=getRegXXNN(buffer,(upperCase? "NZ": "nz")); pos=this.pos; break; case A_Z_NN: // Z cond NN this.pos=pos; result+=getRegXXNN(buffer,(upperCase? "Z": "z")); pos=this.pos; break; case A_NC_NN: // NC cond NN this.pos=pos; result+=getRegXXNN(buffer,(upperCase? "NC": "nc")); pos=this.pos; break; case A_C_NN: // C cond NN this.pos=pos; result+=getRegXXNN(buffer,(upperCase? "C": "C")); pos=this.pos; break; case A_PO_NN: // PO cond NN this.pos=pos; result+=getRegXXNN(buffer,(upperCase? "PO": "po")); pos=this.pos; break; case A_P_NN: // P cond NN this.pos=pos; result+=getRegXXNN(buffer,(upperCase? "P": "p")); pos=this.pos; break; case A_PE_NN: // PE cond NN this.pos=pos; result+=getRegXXNN(buffer,(upperCase? "PE": "pe")); pos=this.pos; break; case A_M_NN: // M cond NN this.pos=pos; result+=getRegXXNN(buffer,(upperCase? "M": "m")); pos=this.pos; break; case A_A__C: // A reg ind (C) result+=(upperCase? "A,(C)": "a,(c)"); break; case A_B__C: // B reg ind (C) result+=(upperCase? "B,(C)": "b,(c)"); break; case A_C__C: // C reg ind (C) result+=(upperCase? "C,(C)": "c,(c)"); break; case A_D__C: // D reg ind (C) result+=(upperCase? "D,(C)": "d,(c)"); break; case A_E__C: // E reg ind (C) result+=(upperCase? "E,(C)": "e,(c)"); break; case A_H__C: // H reg ind (C) result+=(upperCase? "H,(C)": "h,(c)"); break; case A_L__C: // L reg ind (C) result+=(upperCase? "L,(C)": "l,(c)"); break; case A___C: // ind (C) result+=(upperCase? "(C)": "(c)"); break; case A__C_A: // ind (C) reg A result+=(upperCase? "(C),A": "(c),a"); break; case A__C_B: // ind (C) reg B result+=(upperCase? "(C),B": "(c),b"); break; case A__C_C: // ind (C) reg C result+=(upperCase? "(C),C": "(c),c"); break; case A__C_D: // ind (C) reg D result+=(upperCase? "(C),D": "(c),d"); break; case A__C_E: // ind (C) reg E result+=(upperCase? "(C),E": "(c),e"); break; case A__C_H: // ind (C) reg H result+=(upperCase? "(C),H": "(c),h"); break; case A__C_L: // ind (C) reg L result+=(upperCase? "(C),L": "(c),l"); break; case A___C_0: // ind C 0 result+=(upperCase? "(C),0": "(c),0"); break; case A_0: // 0 result+="0"; break; case A_1: // 1 result+="1"; break; case A_2: // 2 result+="2"; break; case A_0_A: // 0 reg A result+="0,"+(upperCase? "A": "a"); break; case A_0_B: // 0 reg B result+="0,"+(upperCase? "B": "b"); break; case A_0_C: // 0 reg C result+="0,"+(upperCase? "C": "c"); break; case A_0_D: // 0 reg D result+="0,"+(upperCase? "D": "d"); break; case A_0_E: // 0 reg E result+="0,"+(upperCase? "E": "e"); break; case A_0_H: // 0 reg H result+="0,"+(upperCase? "H": "h"); break; case A_0_L: // 0 reg L result+="0,"+(upperCase? "L": "l"); break; case A_0__HL: // 0 ind (HL) result+="0,"+(upperCase? "(HL)": "(hl)"); break; case A_1_A: // 1 reg A result+="1,"+(upperCase? "A": "a"); break; case A_1_B: // 1 reg B result+="1,"+(upperCase? "B": "b"); break; case A_1_C: // 1 reg C result+="1,"+(upperCase? "C": "c"); break; case A_1_D: // 1 reg D result+="1,"+(upperCase? "D": "d"); break; case A_1_E: // 1 reg E result+="1,"+(upperCase? "E": "e"); break; case A_1_H: // 1 reg H result+="1,"+(upperCase? "H": "h"); break; case A_1_L: // 1 reg L result+="1,"+(upperCase? "L": "l"); break; case A_1__HL: // 1 ind (HL) result+="1,"+(upperCase? "(HL)": "(hl)"); break; case A_2_A: // 2 reg A result+="2,"+(upperCase? "A": "a"); break; case A_2_B: // 2 reg B result+="2,"+(upperCase? "B": "b"); break; case A_2_C: // 2 reg C result+="2,"+(upperCase? "C": "c"); break; case A_2_D: // 2 reg D result+="2,"+(upperCase? "D": "d"); break; case A_2_E: // 2 reg E result+="2,"+(upperCase? "E": "e"); break; case A_2_H: // 2 reg H result+="2,"+(upperCase? "H": "h"); break; case A_2_L: // 2 reg L result+="2,"+(upperCase? "L": "l"); break; case A_2__HL: // 2 ind (HL) result+="2,"+(upperCase? "(HL)": "(hl)"); break; case A_3_A: // 3 reg A result+="3,"+(upperCase? "A": "a"); break; case A_3_B: // 3 reg B result+="3,"+(upperCase? "B": "b"); break; case A_3_C: // 3 reg C result+="3,"+(upperCase? "C": "c"); break; case A_3_D: // 3 reg D result+="3,"+(upperCase? "D": "d"); break; case A_3_E: // 3 reg E result+="3,"+(upperCase? "E": "e"); break; case A_3_H: // 3 reg H result+="3,"+(upperCase? "H": "h"); break; case A_3_L: // 3 reg L result+="3,"+(upperCase? "L": "l"); break; case A_3__HL: // 3 ind (HL) result+="3,"+(upperCase? "(HL)": "(hl)"); break; case A_4_A: // 4 reg A result+="4,"+(upperCase? "A": "a"); break; case A_4_B: // 4 reg B result+="4,"+(upperCase? "B": "b"); break; case A_4_C: // 4 reg C result+="4,"+(upperCase? "C": "c"); break; case A_4_D: // 4 reg D result+="4,"+(upperCase? "D": "d"); break; case A_4_E: // 4 reg E result+="4,"+(upperCase? "E": "e"); break; case A_4_H: // 4 reg H result+="4,"+(upperCase? "H": "h"); break; case A_4_L: // 4 reg L result+="4,"+(upperCase? "L": "l"); break; case A_4__HL: // 4 ind (HL) result+="4,"+(upperCase? "(HL)": "(hl)"); break; case A_5_A: // 5 reg A result+="5,"+(upperCase? "A": "a"); break; case A_5_B: // 5 reg B result+="5,"+(upperCase? "B": "b"); break; case A_5_C: // 5 reg C result+="5,"+(upperCase? "C": "c"); break; case A_5_D: // 5 reg D result+="5,"+(upperCase? "D": "d"); break; case A_5_E: // 5 reg E result+="5,"+(upperCase? "E": "e"); break; case A_5_H: // 5 reg H result+="5,"+(upperCase? "H": "h"); break; case A_5_L: // 5 reg L result+="5,"+(upperCase? "L": "l"); break; case A_5__HL: // 5 ind (HL) result+="5,"+(upperCase? "(HL)": "(hl)"); break; case A_6_A: // 6 reg A result+="6,"+(upperCase? "A": "a"); break; case A_6_B: // 6 reg B result+="6,"+(upperCase? "B": "b"); break; case A_6_C: // 6 reg C result+="6,"+(upperCase? "C": "c"); break; case A_6_D: // 6 reg D result+="6,"+(upperCase? "D": "d"); break; case A_6_E: // 6 reg E result+="6,"+(upperCase? "E": "e"); break; case A_6_H: // 6 reg H result+="6,"+(upperCase? "H": "h"); break; case A_6_L: // 6 reg L result+="6,"+(upperCase? "L": "l"); break; case A_6__HL: // 6 ind (HL) result+="6,"+(upperCase? "(HL)": "(hl)"); break; case A_7_A: // 7 reg A result+="7,"+(upperCase? "A": "a"); break; case A_7_B: // 7 reg B result+="7,"+(upperCase? "B": "b"); break; case A_7_C: // 7 reg C result+="7,"+(upperCase? "C": "c"); break; case A_7_D: // 7 reg D result+="7,"+(upperCase? "D": "d"); break; case A_7_E: // 7 reg E result+="7,"+(upperCase? "E": "e"); break; case A_7_H: // 7 reg H result+="7,"+(upperCase? "H": "h"); break; case A_7_L: // 7 reg L result+="7,"+(upperCase? "L": "l"); break; case A_7__HL: // 7 ind (HL) result+="7,"+(upperCase? "(HL)": "(hl)"); break; case A_REG_IX: // reg IX result+=(upperCase? "IX": "ix"); break; case A_REG_IY: // reg IY result+=(upperCase? "IY": "iy"); break; case A_REG_IXH: // reg IXH result+=(upperCase? "IXH": "ixh"); break; case A_REG_IXL: // reg IXL result+=(upperCase? "IXL": "ixl"); break; case A_REG_IYH: // reg IYH result+=(upperCase? "IYH": "iyh"); break; case A_REG_IYL: //reg IYL result+=(upperCase? "IYL": "iyl"); break; case A__IX_N: // ind (IX+N) this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IX": "ix")); pos=this.pos; break; case A__IY_N: // ind (IY+N) this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IY": "iy")); pos=this.pos; break; case A__IX_N_A: // ind (IX+N),A this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IX": "ix"), (upperCase? "A": "a")); pos=this.pos; break; case A__IX_N_B: // ind (IX+N),B this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IX": "ix"), (upperCase? "B": "b")); pos=this.pos; break; case A__IX_N_C: // ind (IX+N),C this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IX": "ix"), (upperCase? "C": "c")); pos=this.pos; break; case A__IX_N_D: // ind (IX+N),D this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IX": "ix"), (upperCase? "D": "d")); pos=this.pos; break; case A__IX_N_E: // ind (IX+N),E this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IX": "ix"), (upperCase? "E": "e")); pos=this.pos; break; case A__IX_N_H: // ind (IX+N),H this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IX": "ix"), (upperCase? "H": "h")); pos=this.pos; break; case A__IX_N_L: // ind (IX+N),L this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IX": "ix"), (upperCase? "L": "l")); pos=this.pos; break; case A__IY_N_A: // ind (IY+N),A this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IY": "iy"), (upperCase? "A": "a")); pos=this.pos; break; case A__IY_N_B: // ind (IY+N),B this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IY": "iy"), (upperCase? "B": "b")); pos=this.pos; break; case A__IY_N_C: // ind (IY+N),C this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IY": "iy"), (upperCase? "C": "c")); pos=this.pos; break; case A__IY_N_D: // ind (IY+N),D this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IY": "iy"), (upperCase? "D": "d")); pos=this.pos; break; case A__IY_N_E: // ind (IY+N),E this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IY": "iy"), (upperCase? "E": "e")); pos=this.pos; break; case A__IY_N_H: // ind (IY+N),H this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IY": "iy"), (upperCase? "H": "h")); pos=this.pos; break; case A__IY_N_L: // ind (IY+N),L this.pos=pos; result+=getRegIndXN(buffer, (upperCase? "IY": "iy"), (upperCase? "L": "l")); pos=this.pos; break; case A_0__IX_N_A: // 0,(IX+N),A this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IX": "ix"), (upperCase? "A": "a")); pos=this.pos; break; case A_0__IX_N_B: // 0,(IX+N),B this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IX": "ix"), (upperCase? "B": "b")); pos=this.pos; break; case A_0__IX_N_C: // 0,(IX+N),C this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IX": "ix"), (upperCase? "C": "c")); pos=this.pos; break; case A_0__IX_N_D: // 0,(IX+N),D this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IX": "ix"), (upperCase? "D": "d")); pos=this.pos; break; case A_0__IX_N_E: // 0,(IX+N),E this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IX": "ix"), (upperCase? "E": "e")); pos=this.pos; break; case A_0__IX_N_H: // 0,(IX+N),H this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IX": "ix"), (upperCase? "H": "h")); pos=this.pos; break; case A_0__IX_N_L: // 0,(IX+N),L this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IX": "ix"), (upperCase? "L": "l")); pos=this.pos; break; case A_1__IX_N_A: // 1,(IX+N),A this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IX": "ix"), (upperCase? "A": "a")); pos=this.pos; break; case A_1__IX_N_B: // 1,(IX+N),B this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IX": "ix"), (upperCase? "B": "b")); pos=this.pos; break; case A_1__IX_N_C: // 1,(IX+N),C this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IX": "ix"), (upperCase? "C": "c")); pos=this.pos; break; case A_1__IX_N_D: // 1,(IX+N),D this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IX": "ix"), (upperCase? "D": "d")); pos=this.pos; break; case A_1__IX_N_E: // 1,(IX+N),E this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IX": "ix"), (upperCase? "E": "e")); pos=this.pos; break; case A_1__IX_N_H: // 1,(IX+N),H this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IX": "ix"), (upperCase? "H": "h")); pos=this.pos; break; case A_1__IX_N_L: // 1,(IX+N),L this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IX": "ix"), (upperCase? "L": "l")); pos=this.pos; break; case A_2__IX_N_A: // 2,(IX+N),A this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IX": "ix"), (upperCase? "A": "a")); pos=this.pos; break; case A_2__IX_N_B: // 2,(IX+N),B this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IX": "ix"), (upperCase? "B": "b")); pos=this.pos; break; case A_2__IX_N_C: // 2,(IX+N),C this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IX": "ix"), (upperCase? "C": "c")); pos=this.pos; break; case A_2__IX_N_D: // 2,(IX+N),D this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IX": "ix"), (upperCase? "D": "d")); pos=this.pos; break; case A_2__IX_N_E: // 2,(IX+N),E this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IX": "ix"), (upperCase? "E": "e")); pos=this.pos; break; case A_2__IX_N_H: // 2,(IX+N),H this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IX": "ix"), (upperCase? "H": "h")); pos=this.pos; break; case A_2__IX_N_L: // 2,(IX+N),L this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IX": "ix"), (upperCase? "L": "l")); pos=this.pos; break; case A_3__IX_N_A: // 3,(IX+N),A this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IX": "ix"), (upperCase? "A": "a")); pos=this.pos; break; case A_3__IX_N_B: // 3,(IX+N),B this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IX": "ix"), (upperCase? "B": "b")); pos=this.pos; break; case A_3__IX_N_C: // 3,(IX+N),C this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IX": "ix"), (upperCase? "C": "c")); pos=this.pos; break; case A_3__IX_N_D: // 3,(IX+N),D this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IX": "ix"), (upperCase? "D": "d")); pos=this.pos; break; case A_3__IX_N_E: // 3,(IX+N),E this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IX": "ix"), (upperCase? "E": "e")); pos=this.pos; break; case A_3__IX_N_H: // 3,(IX+N),H this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IX": "ix"), (upperCase? "H": "h")); pos=this.pos; break; case A_3__IX_N_L: // 3,(IX+N),L this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IX": "ix"), (upperCase? "L": "l")); pos=this.pos; break; case A_4__IX_N_A: // 4,(IX+N),A this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IX": "ix"), (upperCase? "A": "a")); pos=this.pos; break; case A_4__IX_N_B: // 4,(IX+N),B this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IX": "ix"), (upperCase? "B": "b")); pos=this.pos; break; case A_4__IX_N_C: // 4,(IX+N),C this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IX": "ix"), (upperCase? "C": "c")); pos=this.pos; break; case A_4__IX_N_D: // 4,(IX+N),D this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IX": "ix"), (upperCase? "D": "d")); pos=this.pos; break; case A_4__IX_N_E: // 4,(IX+N),E this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IX": "ix"), (upperCase? "E": "e")); pos=this.pos; break; case A_4__IX_N_H: // 4,(IX+N),H this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IX": "ix"), (upperCase? "H": "h")); pos=this.pos; break; case A_4__IX_N_L: // 4,(IX+N),L this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IX": "ix"), (upperCase? "L": "l")); pos=this.pos; break; case A_5__IX_N_A: // 5,(IX+N),A this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IX": "ix"), (upperCase? "A": "a")); pos=this.pos; break; case A_5__IX_N_B: // 5,(IX+N),B this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IX": "ix"), (upperCase? "B": "b")); pos=this.pos; break; case A_5__IX_N_C: // 5,(IX+N),C this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IX": "ix"), (upperCase? "C": "c")); pos=this.pos; break; case A_5__IX_N_D: // 5,(IX+N),D this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IX": "ix"), (upperCase? "D": "d")); pos=this.pos; break; case A_5__IX_N_E: // 5,(IX+N),E this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IX": "ix"), (upperCase? "E": "e")); pos=this.pos; break; case A_5__IX_N_H: // 5,(IX+N),H this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IX": "ix"), (upperCase? "H": "h")); pos=this.pos; break; case A_5__IX_N_L: // 5,(IX+N),L this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IX": "ix"), (upperCase? "L": "l")); pos=this.pos; break; case A_6__IX_N_A: // 6,(IX+N),A this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IX": "ix"), (upperCase? "A": "a")); pos=this.pos; break; case A_6__IX_N_B: // 6,(IX+N),B this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IX": "ix"), (upperCase? "B": "b")); pos=this.pos; break; case A_6__IX_N_C: // 6,(IX+N),C this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IX": "ix"), (upperCase? "C": "c")); pos=this.pos; break; case A_6__IX_N_D: // 6,(IX+N),D this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IX": "ix"), (upperCase? "D": "d")); pos=this.pos; break; case A_6__IX_N_E: // 6,(IX+N),E this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IX": "ix"), (upperCase? "E": "e")); pos=this.pos; break; case A_6__IX_N_H: // 6,(IX+N),H this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IX": "ix"), (upperCase? "H": "h")); pos=this.pos; break; case A_6__IX_N_L: // 6,(IX+N),L this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IX": "ix"), (upperCase? "L": "l")); pos=this.pos; break; case A_7__IX_N_A: // 7,(IX+N),A this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IX": "ix"), (upperCase? "A": "a")); pos=this.pos; break; case A_7__IX_N_B: // 7,(IX+N),B this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IX": "ix"), (upperCase? "B": "b")); pos=this.pos; break; case A_7__IX_N_C: // 7,(IX+N),C this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IX": "ix"), (upperCase? "C": "c")); pos=this.pos; break; case A_7__IX_N_D: // 7,(IX+N),D this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IX": "ix"), (upperCase? "D": "d")); pos=this.pos; break; case A_7__IX_N_E: // 7,(IX+N),E this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IX": "ix"), (upperCase? "E": "e")); pos=this.pos; break; case A_7__IX_N_H: // 7,(IX+N),H this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IX": "ix"), (upperCase? "H": "h")); pos=this.pos; break; case A_7__IX_N_L: // 7,(IX+N),L this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IX": "ix"), (upperCase? "L": "l")); pos=this.pos; break; case A_0__IY_N_A: // 0,(IY+N),A this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IY": "iy"), (upperCase? "A": "a")); pos=this.pos; break; case A_0__IY_N_B: // 0,(IY+N),B this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IY": "iy"), (upperCase? "B": "b")); pos=this.pos; break; case A_0__IY_N_C: // 0,(IY+N),C this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IY": "iy"), (upperCase? "C": "c")); pos=this.pos; break; case A_0__IY_N_D: // 0,(IY+N),D this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IY": "iy"), (upperCase? "D": "d")); pos=this.pos; break; case A_0__IY_N_E: // 0,(IY+N),E this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IY": "iy"), (upperCase? "E": "e")); pos=this.pos; break; case A_0__IY_N_H: // 0,(IY+N),H this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IY": "iy"), (upperCase? "H": "h")); pos=this.pos; break; case A_0__IY_N_L: // 0,(IY+N),L this.pos=pos; result+=getReg2IndXN(buffer, "0", (upperCase? "IY": "iy"), (upperCase? "L": "l")); pos=this.pos; break; case A_1__IY_N_A: // 1,(IY+N),A this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IY": "iy"), (upperCase? "A": "a")); pos=this.pos; break; case A_1__IY_N_B: // 1,(IY+N),B this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IY": "iy"), (upperCase? "B": "b")); pos=this.pos; break; case A_1__IY_N_C: // 1,(IY+N),C this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IY": "iy"), (upperCase? "C": "c")); pos=this.pos; break; case A_1__IY_N_D: // 1,(IY+N),D this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IY": "iy"), (upperCase? "D": "d")); pos=this.pos; break; case A_1__IY_N_E: // 1,(IY+N),E this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IY": "iy"), (upperCase? "E": "e")); pos=this.pos; break; case A_1__IY_N_H: // 1,(IY+N),H this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IY": "iy"), (upperCase? "H": "h")); pos=this.pos; break; case A_1__IY_N_L: // 1,(IY+N),L this.pos=pos; result+=getReg2IndXN(buffer, "1", (upperCase? "IY": "iy"), (upperCase? "L": "l")); pos=this.pos; break; case A_2__IY_N_A: // 2,(IY+N),A this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IY": "iy"), (upperCase? "A": "a")); pos=this.pos; break; case A_2__IY_N_B: // 2,(IY+N),B this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IY": "iy"), (upperCase? "B": "b")); pos=this.pos; break; case A_2__IY_N_C: // 2,(IY+N),C this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IY": "iy"), (upperCase? "C": "c")); pos=this.pos; break; case A_2__IY_N_D: // 2,(IY+N),D this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IY": "iy"), (upperCase? "D": "d")); pos=this.pos; break; case A_2__IY_N_E: // 2,(IY+N),E this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IY": "iy"), (upperCase? "E": "e")); pos=this.pos; break; case A_2__IY_N_H: // 2,(IY+N),H this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IY": "iy"), (upperCase? "H": "h")); pos=this.pos; break; case A_2__IY_N_L: // 2,(IY+N),L this.pos=pos; result+=getReg2IndXN(buffer, "2", (upperCase? "IY": "iy"), (upperCase? "L": "l")); pos=this.pos; break; case A_3__IY_N_A: // 3,(IY+N),A this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IY": "iy"), (upperCase? "A": "a")); pos=this.pos; break; case A_3__IY_N_B: // 3,(IY+N),B this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IY": "iy"), (upperCase? "B": "b")); pos=this.pos; break; case A_3__IY_N_C: // 3,(IY+N),C this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IY": "iy"), (upperCase? "C": "c")); pos=this.pos; break; case A_3__IY_N_D: // 3,(IY+N),D this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IY": "iy"), (upperCase? "D": "d")); pos=this.pos; break; case A_3__IY_N_E: // 3,(IY+N),E this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IY": "iy"), (upperCase? "E": "e")); pos=this.pos; break; case A_3__IY_N_H: // 3,(IY+N),H this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IY": "iy"), (upperCase? "H": "h")); pos=this.pos; break; case A_3__IY_N_L: // 3,(IY+N),L this.pos=pos; result+=getReg2IndXN(buffer, "3", (upperCase? "IY": "iy"), (upperCase? "L": "l")); pos=this.pos; break; case A_4__IY_N_A: // 4,(IY+N),A this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IY": "iy"), (upperCase? "A": "a")); pos=this.pos; break; case A_4__IY_N_B: // 4,(IY+N),B this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IY": "iy"), (upperCase? "B": "b")); pos=this.pos; break; case A_4__IY_N_C: // 4,(IY+N),C this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IY": "iy"), (upperCase? "C": "c")); pos=this.pos; break; case A_4__IY_N_D: // 4,(IY+N),D this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IY": "iy"), (upperCase? "D": "d")); pos=this.pos; break; case A_4__IY_N_E: // 4,(IY+N),E this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IY": "iy"), (upperCase? "E": "e")); pos=this.pos; break; case A_4__IY_N_H: // 4,(IY+N),H this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IY": "iy"), (upperCase? "H": "h")); pos=this.pos; break; case A_4__IY_N_L: // 4,(IY+N),L this.pos=pos; result+=getReg2IndXN(buffer, "4", (upperCase? "IY": "iy"), (upperCase? "L": "l")); pos=this.pos; break; case A_5__IY_N_A: // 5,(IY+N),A this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IY": "iy"), (upperCase? "A": "a")); pos=this.pos; break; case A_5__IY_N_B: // 5,(IY+N),B this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IY": "iy"), (upperCase? "B": "b")); pos=this.pos; break; case A_5__IY_N_C: // 5,(IY+N),C this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IY": "iy"), (upperCase? "C": "c")); pos=this.pos; break; case A_5__IY_N_D: // 5,(IY+N),D this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IY": "iy"), (upperCase? "D": "d")); pos=this.pos; break; case A_5__IY_N_E: // 5,(IY+N),E this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IY": "iy"), (upperCase? "E": "e")); pos=this.pos; break; case A_5__IY_N_H: // 5,(IY+N),H this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IY": "iy"), (upperCase? "H": "h")); pos=this.pos; break; case A_5__IY_N_L: // 5,(IY+N),L this.pos=pos; result+=getReg2IndXN(buffer, "5", (upperCase? "IY": "iy"), (upperCase? "L": "l")); pos=this.pos; break; case A_6__IY_N_A: // 6,(IY+N),A this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IY": "iy"), (upperCase? "A": "a")); pos=this.pos; break; case A_6__IY_N_B: // 6,(IY+N),B this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IY": "iy"), (upperCase? "B": "b")); pos=this.pos; break; case A_6__IY_N_C: // 6,(IY+N),C this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IY": "iy"), (upperCase? "C": "c")); pos=this.pos; break; case A_6__IY_N_D: // 6,(IY+N),D this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IY": "iy"), (upperCase? "D": "d")); pos=this.pos; break; case A_6__IY_N_E: // 6,(IY+N),E this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IY": "iy"), (upperCase? "E": "e")); pos=this.pos; break; case A_6__IY_N_H: // 6,(IY+N),H this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IY": "iy"), (upperCase? "H": "h")); pos=this.pos; break; case A_6__IY_N_L: // 6,(IY+N),L this.pos=pos; result+=getReg2IndXN(buffer, "6", (upperCase? "IY": "iy"), (upperCase? "L": "l")); pos=this.pos; break; case A_7__IY_N_A: // 7,(IY+N),A this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IY": "iy"), (upperCase? "A": "a")); pos=this.pos; break; case A_7__IY_N_B: // 7,(IY+N),B this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IY": "iy"), (upperCase? "B": "b")); pos=this.pos; break; case A_7__IY_N_C: // 7,(IY+N),C this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IY": "iy"), (upperCase? "C": "c")); pos=this.pos; break; case A_7__IY_N_D: // 7,(IY+N),D this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IY": "iy"), (upperCase? "D": "d")); pos=this.pos; break; case A_7__IY_N_E: // 7,(IY+N),E this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IY": "iy"), (upperCase? "E": "e")); pos=this.pos; break; case A_7__IY_N_H: // 7,(IY+N),H this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IY": "iy"), (upperCase? "H": "h")); pos=this.pos; break; case A_7__IY_N_L: // 7,(IY+N),L this.pos=pos; result+=getReg2IndXN(buffer, "7", (upperCase? "IY": "iy"), (upperCase? "L": "l")); pos=this.pos; break; } // add eventaul relative address of instructions switch (steps) { case 4: setLabelPlus(pc,3); case 3: setLabelPlus(pc,2); case 2: setLabelPlus(pc,1); } this.pc=pc+steps; this.pos=pos; return result; } @Override public String dcom(int iType, int aType, long addr, long value) { return ""; } /** * Get the instruction register indirect over byte * * @param buffer the buffer to use * @param reg the reg to use * @return the instruction */ private String getRegIndXN(byte[] buffer, String reg) { if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=-1; return "("+reg+"+"+getLabelImm(pc+1, value)+")"; } /** * Get the instruction register 2 indirect over byte * * @param buffer the buffer to use * @param reg the reg to use * @param reg2 the reg2 to use * @param reg3 the reg3 to use * @return the instruction */ private String getReg2IndXN(byte[] buffer, String reg, String reg2, String reg3) { if (pos<buffer.length) value=Unsigned.done(buffer[pos-1]); else value=-1; pos++; return reg+"("+reg2+"+"+getLabelImm(pc+1, value)+"),"+reg3; } /** * Get the instruction register indirect over byte * * @param buffer the buffer to use * @param reg the reg to use * @param reg2 the reg2 to use * @return the instruction */ private String getRegIndXN(byte[] buffer, String reg, String reg2) { if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=-1; return "("+reg+"+"+getLabelImm(pc+1, value)+"),"+reg2; } /** * Get the instruction register over byte * * @param buffer the buffer to use * @param reg the reg to use * @return the instruction */ private String getRegXN(byte[] buffer, String reg) { if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=-1; return reg+","+getLabelImm(pc+1, value); } /** * Get the instruction registers over word * * @param buffer the buffer to use * @param reg the regs to use * @return the instruction */ private String getRegXXNN(byte[] buffer, String reg) { if (pos<buffer.length-1) addr=((Unsigned.done(buffer[pos+1])<<8) | Unsigned.done(buffer[pos++])); else addr=-1; pos++; setLabel(addr); //setLabelPlus(pc,1); //setLabelPlus(pc,2); return reg+","+getLabel(addr); } /** * Get the instruction registers ind over word * * @param buffer the buffer to use * @param reg the regs to use * @return the instruction */ private String getRegXXIndNN(byte[] buffer, String reg) { if (pos<buffer.length-1) addr=((Unsigned.done(buffer[pos+1])<<8) | Unsigned.done(buffer[pos++])); else addr=-1; pos++; setLabel(addr); //setLabelPlus(pc,1); //setLabelPlus(pc,2); return reg+",("+getLabel(addr)+")"; } /** * Get the instruction word over register * * @param buffer the bufffer to use * @param reg the reg to use * @return the instruction */ private String getNNregX(byte[] buffer, String reg) { if (pos<buffer.length-1) addr=((Unsigned.done(buffer[pos+1])<<8) | Unsigned.done(buffer[pos++])); else addr=-1; pos++; setLabel(addr); //setLabelPlus(pc,1); //setLabelPlus(pc,2); return getLabel(addr)+","+reg; } /** * Get the instruction indirect word over register * * @param buffer the bufffer to use * @param reg the reg to use * @return the instruction */ private String getIndNNregX(byte[] buffer, String reg) { if (pos<buffer.length-1) addr=((Unsigned.done(buffer[pos+1])<<8) | Unsigned.done(buffer[pos++])); else addr=-1; pos++; setLabel(addr); //setLabelPlus(pc,1); //setLabelPlus(pc,2); return "("+getLabel(addr)+"),"+reg; } /** * Get the instruction * * @param buffer the bufffer to use * @param reg the reg to use * @param reg2 the reg ind to use * @return the instruction */ private String getRefXIndXXN(byte[] buffer, String reg, String reg2) { if (pos<buffer.length) addr=Unsigned.done(buffer[pos++]); else addr=-1; return reg+",("+reg2+"+"+getLabelZero(addr)+")"; } /** * Get the instruction * * @param buffer the bufffer to use * @param reg the reg to use * @param reg2 the reg ind to use * @return the instruction */ private String getRefXInd2XXN(byte[] buffer, String reg, String reg2) { if (pos<buffer.length) addr=Unsigned.done(buffer[pos-1]); else addr=-1; pos++; return reg+",("+reg2+"+"+getLabelZero(addr)+")"; } /** * Comment and Disassemble a region of the buffer * * @param buffer the buffer containing the code * @param start the start position in buffer * @param end the end position in buffer * @param pc the programn counter for start position * @return a string rapresentation of disassemble with comment */ @Override public String cdasm(byte[] buffer, int start, int end, long pc) { String tmp; // local temp string String tmp2; // local temp string MemoryDasm mem; // memory dasm MemoryDasm memRel; // memory related MemoryDasm memRel2; // memory related of second kind int actualOffset; // actual offset int pos=start; // actual position in buffer boolean isCode=true; // true if we are decoding an instruction boolean wasGarbage=false; // true if we were decoding garbage result.setLength(0); //result.append(addConstants()); this.pos=pos; this.pc=pc; while (pos<=end | pos<start) { // verify also that don't circle in the buffer mem=memory[(int)pc]; isCode=((mem.isCode || (!mem.isData && option.useAsCode)) && !mem.isGarbage); if (isCode) { assembler.flush(result); // must put the org if we start from an garbage area if (wasGarbage) { wasGarbage=false; assembler.setOrg(result, (int)pc); } // add block if user declare it if (mem.userBlockComment!=null && !"".equals(mem.userBlockComment)) { assembler.setBlockComment(result, mem); } // add the label if it was declared by dasm or user //if (mem.userLocation!=null && !"".equals(mem.userLocation)) result.append(mem.userLocation).append(":\n"); //else if (mem.dasmLocation!=null && !"".equals(mem.dasmLocation)) result.append(mem.dasmLocation).append(":\n"); if ((mem.userLocation!=null && !"".equals(mem.userLocation)) || (mem.dasmLocation!=null && !"".equals(mem.dasmLocation))) { assembler.setLabel(result, mem); result.append("\n"); } // this is an instruction actualOffset=assembler.getCarets().getOffset(); // rember actual offset assembler.getCarets().setOffset(result.length()+actualOffset+21); // use new offset tmp=dasm(buffer); // this is an instruction assembler.getCarets().setOffset(actualOffset); // set old offset tmp2=ShortToExe((int)pc)+" "+ByteToExe(Unsigned.done(buffer[pos])); if (this.pc-pc==2) { if (pos+1<buffer.length) tmp2+=" "+ByteToExe(Unsigned.done(buffer[pos+1])); else tmp2+=" ??"; } if (this.pc-pc==3) { if (pos+2<buffer.length) tmp2+=" "+ByteToExe(Unsigned.done(buffer[pos+1]))+ " "+ByteToExe(Unsigned.done(buffer[pos+2])); else tmp2+=" ?????"; } if (this.pc-pc==4) { if (pos+3<buffer.length) tmp2+=" "+ByteToExe(Unsigned.done(buffer[pos+1]))+ " "+ByteToExe(Unsigned.done(buffer[pos+2]))+ " "+ByteToExe(Unsigned.done(buffer[pos+3])); else tmp2+=" ???????"; } for (int i=tmp2.length(); i<21; i++) // insert spaces tmp2+=" "; tmp=tmp2+tmp; tmp2=""; for (int i=tmp.length(); i<43; i++) // insert spaces tmp2+=" "; result.append(tmp).append(tmp2); tmp2=dcom(); // if there is a user comment, then use it if (mem.userComment!=null) result.append(" ").append(mem.userComment).append("\n"); else result.append(" ").append(tmp2).append("\n"); // always add a carriage return after a RTS, RTI or JMP if (iType==M_RET || iType==M_RETI || iType==M_RETN) result.append("\n"); if (pc>=0) { // rememeber this dasm automatic comment if (!"".equals(tmp2)) mem.dasmComment=tmp2; else mem.dasmComment=null; } pos=this.pos; pc=this.pc; } else if (mem.isGarbage) { assembler.flush(result); wasGarbage=true; pos++; pc++; this.pos=pos; this.pc=pc; } else { // must put the org if we start from an garbage area if (wasGarbage) { wasGarbage=false; assembler.setOrg(result, (int)pc); } memRel=mem.related!=-1 ? memory[mem.related & 0xFFFF]: null; if (memRel!=null) memRel2=memRel.related!=-1 ? memory[memRel.related & 0xFFFF]: null; else memRel2=null; assembler.putValue(result, mem, memRel, memRel2, memory[mem.relatedAddressBase], memory[mem.relatedAddressDest]); pos++; pc++; this.pos=pos; this.pc=pc; } } assembler.flush(result); return result.toString(); } /** * Comment and Disassemble a region of the buffer as source * * @param buffer the buffer containing the code * @param start the start position in buffer * @param end the end position in buffer * @param pc the programn counter for start position * @return a string rapresentation of disasemble with comment */ @Override public String csdasm(byte[] buffer, int start, int end, long pc) { String tmp; // local temp string String tmp2; // local temp string MemoryDasm mem; // memory dasm MemoryDasm memRel; // memory related MemoryDasm memRel2; // memory related of second kind int actualOffset; // actual offset int pos=start; // actual position in buffer boolean isCode=true; // true if we are decoding an instruction boolean wasGarbage=false; // true if we were decoding garbage int pStart; result.setLength(0); //result.append(addConstants()); this.pos=pos; this.pc=pc; while (pos<=end | pos<start) { // verify also that don't circle in the buffer mem=memory[(int)pc]; isCode=((mem.isCode || (!mem.isData && option.useAsCode)) && !mem.isGarbage); if (isCode) { assembler.flush(result); // must put the org if we start from an garbage area if (wasGarbage) { wasGarbage=false; assembler.setOrg(result, (int)pc); } // add block if user declare it if (mem.userBlockComment!=null && !"".equals(mem.userBlockComment)) { assembler.setBlockComment(result, mem); } if ((mem.userLocation!=null && !"".equals(mem.userLocation)) || (mem.dasmLocation!=null && !"".equals(mem.dasmLocation))) { assembler.setLabel(result, mem); if (option.labelOnSepLine) result.append("\n"); } pStart=result.length(); // this is an instruction actualOffset=assembler.getCarets().getOffset(); // rember actual offset assembler.getCarets().setOffset(result.length()+actualOffset); // use new offset tmp=dasm(buffer); // this is an instruction assembler.getCarets().setOffset(actualOffset); // set old offset result.append(getInstrSpacesTabs(mem)).append(tmp).append(getInstrCSpacesTabs(tmp.length())); assembler.getCarets().add(pStart, result.length(), mem, Type.INSTR); tmp2=dcom(); // if there is a user comment, then use it assembler.setComment(result, mem); // always add a carriage return after a RTS, RTI or JMP if (iType==M_RET || iType==M_RETI || iType==M_RETN) result.append("\n"); if (pc>=0) { // rememeber this dasm automatic comment if (!"".equals(tmp2)) mem.dasmComment=tmp2; else mem.dasmComment=null; } pos=this.pos; pc=this.pc; } else if (mem.isGarbage) { assembler.flush(result); wasGarbage=true; pos++; pc++; this.pos=pos; this.pc=pc; } else { // must put the org if we start from an garbage area if (wasGarbage) { wasGarbage=false; assembler.setOrg(result, (int)pc); } memRel=mem.related!=-1 ? memory[mem.related & 0xFFFF]: null; if (memRel!=null) memRel2=memRel.related!=-1 ? memory[memRel.related & 0xFFFF]: null; else memRel2=null; assembler.putValue(result, mem, memRel, memRel2, memory[mem.relatedAddressBase], memory[mem.relatedAddressDest]); pos++; pc++; this.pos=pos; this.pc=pc; } } assembler.flush(result); return result.toString(); } /** * Return a comment string for the last instruction * * @return a comment string */ public String dcom() { switch (iType) { case M_SLL: return "Undocument instruction"; } return ""; } }
160,799
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
disassembler.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/cpu/disassembler.java
/** * @(#)disassembler.java 1999/08/20 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.cpu; import java.lang.String; /** * The interface <code>disassembler</code> represents an object that can * disassembler a code for one CPU microprocessor. * To do this the method <code>dasm</code> is provided. * The <code>dcom</code> is also provided for giving comment to the instruction * being disassembled (it may be used for comment many specific location for one * hardware architecture that use that cpu). * * @author Ice * @version 1.00 20/08/1999 */ public interface disassembler { /** * Return the mnemonic assembler instruction rapresent by passed code bytes. * * @param buffer the buffer containg the data * @param pos the actual position in the buffer * @param pc the program counter value associated to the bytes being address * by the <code>pos</code> in the buffer * @return a string menemonic rapresentation of instruction */ public String dasm(byte[] buffer, int pos, long pc); /** * Return a comment string for the passed instruction * * @param iType the type of instruction * @param aType the type of addressing used by instruction * @param addr the address value (if needed by this istruction type) * @param value the operation value (if needed by this instruction) * @return a comment string */ public String dcom(int iType, int aType, long addr, long value); /** * Comment and Disassemble a region of the buffer * * @param buffer the buffer containing the code * @param start the start position in buffer * @param end the end position in buffer * @param pc the programn counter for start position * @return a string rapresentation of disassemble with comment */ public String cdasm(byte[] buffer, int start, int end, long pc); /** * Comment and Disassemble a region of the buffer as source * * @param buffer the buffer containing the code * @param start the start position in buffer * @param end the end position in buffer * @param pc the programn counter for start position * @return a string rapresentation of disasemble with comment */ public String csdasm(byte[] buffer, int start, int end, long pc); }
3,104
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
M6510Dasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/cpu/M6510Dasm.java
/** * @(#)M6510Dasm.java 1999/08/20 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.cpu; import sw_emulator.math.Unsigned; import sw_emulator.software.MemoryDasm; import sw_emulator.swing.main.Carets.Type; /** * Disasseble the M6510 code instructions * This class implements the </code>disassembler</code> interface, so it must * disassemble one instruction and comment it. * * Note that the instruction comment are provided only for giving information * about undocument instruction. * Also some methods are provided for changing the name of undocument * instructions, because their names are not standard. * Finally, bytes declaration is performed using SIDLN memory states. * * @author Ice * @version 1.02 16/10/2003 */ public class M6510Dasm extends CpuDasm implements disassembler { // mode of undocument command are called public static final byte MODE1=1; // mode use by John west and Marko M"akel"a public static final byte MODE2=2; // mode use by Juergen Buchmueller public static final byte MODE3=3; // mode use by Adam Vardy // legal instruction public static final byte M_ADC=0; public static final byte M_AND=1; public static final byte M_ASL=2; public static final byte M_BCC=3; public static final byte M_BCS=4; public static final byte M_BEQ=5; public static final byte M_BIT=6; public static final byte M_BMI=7; public static final byte M_BNE=8; public static final byte M_BPL=9; public static final byte M_BRK=10; public static final byte M_BVC=11; public static final byte M_BVS=12; public static final byte M_CLC=13; public static final byte M_CLD=14; public static final byte M_CLI=15; public static final byte M_CLV=16; public static final byte M_CMP=17; public static final byte M_CPX=18; public static final byte M_CPY=19; public static final byte M_DEC=20; public static final byte M_DEX=21; public static final byte M_DEY=22; public static final byte M_EOR=23; public static final byte M_INC=24; public static final byte M_INX=25; public static final byte M_INY=26; public static final byte M_JMP=27; public static final byte M_JSR=28; public static final byte M_LDA=29; public static final byte M_LDX=30; public static final byte M_LDY=31; public static final byte M_LSR=32; public static final byte M_NOP=33; public static final byte M_ORA=34; public static final byte M_PHA=35; public static final byte M_PHP=36; public static final byte M_PLA=37; public static final byte M_PLP=38; public static final byte M_ROL=39; public static final byte M_ROR=40; public static final byte M_RTI=41; public static final byte M_RTS=42; public static final byte M_SBC=43; public static final byte M_SEC=44; public static final byte M_SED=45; public static final byte M_SEI=46; public static final byte M_STA=47; public static final byte M_STX=48; public static final byte M_STY=49; public static final byte M_TAX=50; public static final byte M_TAY=51; public static final byte M_TSX=52; public static final byte M_TXA=53; public static final byte M_TXS=54; public static final byte M_TYA=55; // undocument instruction public static final byte M_ANC=56; public static final byte M_ANE=57; public static final byte M_ARR=58; public static final byte M_ASR=59; public static final byte M_DCP=60; public static final byte M_ISB=61; public static final byte M_JAM=62; public static final byte M_LAS=63; public static final byte M_LAX=64; public static final byte M_LXA=65; public static final byte M_NOP0=66; public static final byte M_NOP1=67; public static final byte M_NOP2=68; public static final byte M_RLA=69; public static final byte M_RRA=70; public static final byte M_SAX=71; public static final byte M_SBX=72; public static final byte M_SHA=73; public static final byte M_SHX=74; public static final byte M_SHY=75; public static final byte M_SHS=76; public static final byte M_SLO=77; public static final byte M_SRE=78; public static final byte M_USBC=79; // addressing mode public static final byte A_NUL=0; // nothing else public static final byte A_ACC=1; // accumulator public static final byte A_IMP=2; // implicit public static final byte A_IMM=3; // immediate public static final byte A_ZPG=4; // zero page public static final byte A_ZPX=5; // zero page x public static final byte A_ZPY=6; // zero page y public static final byte A_ABS=7; // absolute public static final byte A_ABX=8; // absolute x public static final byte A_ABY=9; // absolute y public static final byte A_REL=10; // relative public static final byte A_IND=11; // indirect public static final byte A_IDX=12; // indirect x public static final byte A_IDY=13; // indirect y /** Contains the mnemonics of instructions */ public static final String[] mnemonics={ // legal instruction first: "ADC", "AND", "ASL", "BCC", "BCS", "BEQ", "BIT", "BMI", "BNE", "BPL", "BRK", "BVC", "BVS", "CLC", "CLD", "CLI", "CLV", "CMP", "CPX", "CPY", "DEC", "DEX", "DEY", "EOR", "INC", "INX", "INY", "JMP", "JSR", "LDA", "LDX", "LDY", "LSR", "NOP", "ORA", "PHA", "PHP", "PLA", "PLP", "ROL", "ROR", "RTI", "RTS", "SBC", "SEC", "SED", "SEI", "STA", "STX", "STY", "TAX", "TAY", "TSX", "TXA", "TXS", "TYA", // undocument instruction "ANC", "ANE", "ARR", "ASR", "DCP", "ISB", "JAM", "LAS", "LAX", "LXA", "NOOP", "NOOP", "NOOP", "RLA", "RRA", "SAX", "SBX", "SHA", "SHX", "SHY", "SHS", "SLO", "SRE", "USBC" }; /** Contains the mnemonics reference for the instruction */ public static final byte[] tableMnemonics={ M_BRK, M_ORA, M_JAM, M_SLO, M_NOP1,M_ORA, M_ASL, M_SLO, // 00 M_PHP, M_ORA, M_ASL, M_ANC, M_NOP2,M_ORA, M_ASL, M_SLO, M_BPL, M_ORA, M_JAM, M_SLO, M_NOP1,M_ORA, M_ASL, M_SLO, M_CLC, M_ORA, M_NOP0,M_SLO, M_NOP2,M_ORA, M_ASL, M_SLO, M_JSR, M_AND, M_JAM, M_RLA, M_BIT, M_AND, M_ROL, M_RLA, // 20 M_PLP, M_AND, M_ROL, M_ANC, M_BIT, M_AND, M_ROL, M_RLA, M_BMI, M_AND, M_JAM, M_RLA, M_NOP1,M_AND, M_ROL, M_RLA, M_SEC, M_AND, M_NOP0,M_RLA, M_NOP2,M_AND, M_ROL, M_RLA, M_RTI, M_EOR, M_JAM, M_SRE, M_NOP1,M_EOR, M_LSR, M_SRE, // 40 M_PHA, M_EOR, M_LSR, M_ASR, M_JMP, M_EOR, M_LSR, M_SRE, M_BVC, M_EOR, M_JAM, M_SRE, M_NOP1,M_EOR, M_LSR, M_SRE, M_CLI, M_EOR, M_NOP0,M_SRE, M_NOP2,M_EOR, M_LSR, M_SRE, M_RTS, M_ADC, M_JAM, M_RRA, M_NOP1,M_ADC, M_ROR, M_RRA, // 60 M_PLA, M_ADC, M_ROR, M_ARR, M_JMP, M_ADC, M_ROR, M_RRA, M_BVS, M_ADC, M_JAM, M_RRA, M_NOP1,M_ADC, M_ROR, M_RRA, M_SEI, M_ADC, M_NOP0,M_RRA, M_NOP2,M_ADC, M_ROR, M_RRA, M_NOP1,M_STA, M_NOP1,M_SAX, M_STY, M_STA, M_STX, M_SAX, // 80 M_DEY, M_NOP1,M_TXA, M_ANE, M_STY, M_STA, M_STX, M_SAX, M_BCC, M_STA, M_JAM, M_SHA, M_STY, M_STA, M_STX, M_SAX, M_TYA, M_STA, M_TXS, M_SHS, M_SHY, M_STA, M_SHX, M_SHA, M_LDY, M_LDA, M_LDX, M_LAX, M_LDY, M_LDA, M_LDX, M_LAX, // A0 M_TAY, M_LDA, M_TAX, M_LXA, M_LDY, M_LDA, M_LDX, M_LAX, M_BCS, M_LDA, M_JAM, M_LAX, M_LDY, M_LDA, M_LDX, M_LAX, M_CLV, M_LDA, M_TSX, M_LAS, M_LDY, M_LDA, M_LDX, M_LAX, M_CPY, M_CMP, M_NOP1,M_DCP, M_CPY, M_CMP, M_DEC, M_DCP, // C0 M_INY, M_CMP, M_DEX, M_SBX, M_CPY, M_CMP, M_DEC, M_DCP, M_BNE, M_CMP, M_JAM, M_DCP, M_NOP1,M_CMP, M_DEC, M_DCP, M_CLD, M_CMP, M_NOP0,M_DCP, M_NOP2,M_CMP, M_DEC, M_DCP, M_CPX, M_SBC, M_NOP1,M_ISB, M_CPX, M_SBC, M_INC, M_ISB, // E0 M_INX, M_SBC, M_NOP, M_USBC,M_CPX, M_SBC, M_INC, M_ISB, M_BEQ, M_SBC, M_JAM, M_ISB, M_NOP1,M_SBC, M_INC, M_ISB, M_SED, M_SBC, M_NOP0,M_ISB, M_NOP2,M_SBC, M_INC, M_ISB }; /** Contains the modes for the instruction */ public static final byte[] tableModes={ A_IMP, A_IDX, A_NUL, A_IDX, A_ZPG, A_ZPG, A_ZPG, A_ZPG, // 00 A_IMP, A_IMM, A_ACC, A_IMM, A_ABS, A_ABS, A_ABS, A_ABS, A_REL, A_IDY, A_NUL, A_IDY, A_ZPX, A_ZPX, A_ZPX, A_ZPX, A_IMP, A_ABY, A_IMP, A_ABY, A_ABX, A_ABX, A_ABX, A_ABX, A_ABS, A_IDX, A_NUL, A_IDX, A_ZPG, A_ZPG, A_ZPG, A_ZPG, // 20 A_IMP, A_IMM, A_ACC, A_IMM, A_ABS, A_ABS, A_ABS, A_ABS, A_REL, A_IDY, A_NUL, A_IDY, A_ZPX, A_ZPX, A_ZPX, A_ZPX, A_IMP, A_ABY, A_IMP, A_ABY, A_ABX, A_ABX, A_ABX, A_ABX, A_IMP, A_IDX, A_NUL, A_IDX, A_ZPG, A_ZPG, A_ZPG, A_ZPG, // 40 A_IMP, A_IMM, A_ACC, A_IMM, A_ABS, A_ABS, A_ABS, A_ABS, A_REL, A_IDY, A_NUL, A_IDY, A_ZPX, A_ZPX, A_ZPX, A_ZPX, A_IMP, A_ABY, A_IMP, A_ABY, A_ABX, A_ABX, A_ABX, A_ABX, A_IMP, A_IDX, A_NUL, A_IDX, A_ZPG, A_ZPG, A_ZPG, A_ZPG, // 60 A_IMP, A_IMM, A_ACC, A_IMM, A_IND, A_ABS, A_ABS, A_ABS, A_REL, A_IDY, A_NUL, A_IDY, A_ZPX, A_ZPX, A_ZPX, A_ZPX, A_IMP, A_ABY, A_IMP, A_ABY, A_ABX, A_ABX, A_ABX, A_ABX, A_IMM, A_IDX, A_IMM, A_IDX, A_ZPG, A_ZPG, A_ZPG, A_ZPG, // 80 A_IMP, A_IMM, A_IMP, A_IMM, A_ABS, A_ABS, A_ABS, A_ABS, A_REL, A_IDY, A_NUL, A_IDY, A_ZPX, A_ZPX, A_ZPY, A_ZPY, A_IMP, A_ABY, A_IMP, A_ABY, A_ABX, A_ABX, A_ABY, A_ABY, A_IMM, A_IDX, A_IMM, A_IDX, A_ZPG, A_ZPG, A_ZPG, A_ZPG, // A0 A_IMP, A_IMM, A_IMP, A_IMM, A_ABS, A_ABS, A_ABS, A_ABS, A_REL, A_IDY, A_NUL, A_IDY, A_ZPX, A_ZPX, A_ZPY, A_ZPY, A_IMP, A_ABY, A_IMP, A_ABY, A_ABX, A_ABX, A_ABY, A_ABY, A_IMM, A_IDX, A_IMM, A_IDX, A_ZPG, A_ZPG, A_ZPG, A_ZPG, // C0 A_IMP, A_IMM, A_IMP, A_IMM, A_ABS, A_ABS, A_ABS, A_ABS, A_REL, A_IDY, A_NUL, A_IDY, A_ZPX, A_ZPX, A_ZPX, A_ZPX, A_IMP, A_ABY, A_IMP, A_ABY, A_ABX, A_ABX, A_ABX, A_ABX, A_IMM, A_IDX, A_IMM, A_IDX, A_ZPG, A_ZPG, A_ZPG, A_ZPG, // E0 A_IMP, A_IMM, A_IMP, A_IMM, A_ABS, A_ABS, A_ABS, A_ABS, A_REL, A_IDY, A_NUL, A_IDY, A_ZPX, A_ZPX, A_ZPX, A_ZPX, A_IMP, A_ABY, A_IMP, A_ABY, A_ABX, A_ABX, A_ABX, A_ABX }; /** Contains the bytes used for the instruction */ public static final byte[] tableSize={ 1, 2, 1, 2, 2, 2, 2, 2, // 00 1, 2, 1, 2, 3, 3, 3, 3, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3, 1, 3, 3, 3, 3, 3, 3, 2, 1, 2, 2, 2, 2, 2, // 20 1, 2, 1, 2, 3, 3, 3, 3, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3, 1, 3, 3, 3, 3, 3, 1, 2, 1, 2, 2, 2, 2, 2, // 40 1, 2, 1, 2, 3, 3, 3, 3, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3, 1, 3, 3, 3, 3, 3, 1, 2, 1, 2, 2, 2, 2, 2, // 60 1, 2, 1, 1, 3, 3, 3, 3, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3, 1, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, // 80 1, 2, 1, 2, 3, 3, 3, 3, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3, 1, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, // A0 1, 2, 1, 2, 3, 3, 3, 3, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3, 1, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, // C0 1, 2, 1, 2, 3, 3, 3, 3, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3, 1, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, // E0 1, 2, 1, 2, 3, 3, 3, 3, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3, 1, 3, 3, 3, 3, 3 }; /** * Return the mnemonic assembler instruction rapresent by passed code bytes. * * @param buffer the buffer containg the data * @param pos the actual position in the buffer * @param pc the program counter value associated to the bytes being address * by the <code>pos</code> in the buffer * @return a string menemonic rapresentation of instruction */ @Override public String dasm(byte[] buffer, int pos, long pc) { int pStart; // start position for caret String result=""; // result disassemble string int op=Unsigned.done(buffer[pos++]); // instruction opcode iType=(int)tableMnemonics[op]; // store the type for creating comment switch (iType) { case M_SLO: case M_NOP0: case M_NOP1: case M_NOP2: case M_RLA: case M_SRE: case M_RRA: case M_SAX: case M_LAX: case M_DCP: case M_ISB: case M_USBC: case M_ANC: case M_ASR: case M_ARR: case M_ANE: case M_SHA: case M_SHS: case M_SHY: case M_SHX: case M_SBX: case M_LXA: case M_LAS: case M_JAM: if (option.noUndocumented) { memory[(int)pc].isData=true; memory[(int)pc].isCode=false; int size=tableSize[op]; if (size>1 && pc<0xFFFF) { memory[(int)pc+1].isData=true; memory[(int)pc+1].isCode=false; } if (size>2 && pc<0xFFFF) { memory[(int)pc+2].isData=true; memory[(int)pc+2].isCode=false; } } break; } if (upperCase) result=mnemonics[iType]; else result=mnemonics[iType].toLowerCase(); // we now force NOOP to use the same spaces of 3 chars opcode with >1 space String nn=getSpacesTabsOp(); if (result.length()==4 && option.numSpacesOp>1) result+=nn.substring(1,nn.length()); else result+=nn; aType=tableModes[op]; switch (aType) { case A_NUL: // nothing pc++; break; case A_ACC: // accumulator ///result+="A"; pc++; break; case A_IMP: // implicit pc++; break; case A_IMM: // immediate if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+="#"+getLabelImm(pc+1, value); setLabelPlus(pc,1); pc+=2; break; case A_ZPG: // zero page if (pos<buffer.length) addr=Unsigned.done(buffer[pos++]); else addr=-1; pStart=result.length(); result+=getLabelZero(addr); assembler.getCarets().add(pStart, result.length(), this.memory[(int)pc], Type.LABEL_REL); setLabelPlus(pc,1); pc+=2; break; case A_ZPX: // zero page x if (pos<buffer.length) addr=Unsigned.done(buffer[pos++]); else addr=-1; pStart=result.length(); result+=getLabelZero(addr)+(upperCase? ",X": ",x"); assembler.getCarets().add(pStart, result.length(), this.memory[(int)pc], Type.LABEL_REL); setLabelPlus(pc,1); pc+=2; break; case A_ZPY: // zero page y if (pos<buffer.length) addr=Unsigned.done(buffer[pos++]); else addr=-1; pStart=result.length(); result+=getLabelZero(addr)+(upperCase? ",Y": ",y"); assembler.getCarets().add(pStart, result.length(), this.memory[(int)pc], Type.LABEL_REL); setLabelPlus(pc,1); pc+=2; break; case A_ABS: // absolute if (pos<buffer.length-1) addr=((Unsigned.done(buffer[pos+1])<<8) | Unsigned.done(buffer[pos++])); else addr=-1; pStart=result.length(); result+=getLabel(addr); assembler.getCarets().add(pStart, result.length(), this.memory[(int)pc], Type.LABEL_REL); setLabel(addr); setLabelPlus(pc,1); setLabelPlus(pc,2); //setLabelMinus(pc,1); //setLabelMinus(pc,2); pos++; pc+=3; break; case A_ABX: // absolute x if (pos<buffer.length-1) addr=((Unsigned.done(buffer[pos+1])<<8) | Unsigned.done(buffer[pos++])); else addr=-1; pStart=result.length(); result+=getLabel(addr)+(upperCase? ",X": ",x"); assembler.getCarets().add(pStart, result.length(), this.memory[(int)pc], Type.LABEL_REL); setLabel(addr); setLabelPlus(pc,1); setLabelPlus(pc,2); //setLabelMinus(pc,1); //setLabelMinus(pc,2); pos++; pc+=3; break; case A_ABY: // absolute y if (pos<buffer.length-1) addr=((Unsigned.done(buffer[pos+1])<<8) | Unsigned.done(buffer[pos++])); else addr=-1; pos++; pStart=result.length(); result+=getLabel(addr)+(upperCase? ",Y": ",y"); assembler.getCarets().add(pStart, result.length(), this.memory[(int)pc], Type.LABEL_REL); setLabel(addr); setLabelPlus(pc,1); setLabelPlus(pc,2); //setLabelMinus(pc,1); //setLabelMinus(pc,2); pc+=3; break; case A_REL: // relative if (pos<buffer.length) addr=pc+buffer[pos++]+2; else addr=-1; result+=getLabel(addr); setLabel(addr); setLabelPlus(pc,1); pc+=2; break; case A_IND: // indirect if (pos<buffer.length-1) addr=((Unsigned.done(buffer[pos+1])<<8) | Unsigned.done(buffer[pos++])); else addr=-1; pos++; pStart=result.length(); result+="("+getLabel(addr)+")"; assembler.getCarets().add(pStart, result.length(), this.memory[(int)pc], Type.LABEL_REL); setLabel(addr); setLabelPlus(pc,1); setLabelPlus(pc,2); pc+=3; break; case A_IDX: // indirect x if (pos<buffer.length) addr=Unsigned.done(buffer[pos++]); else addr=-1; pStart=result.length(); result+="("+getLabelZero(addr)+(upperCase? ",X)": ",x)"); assembler.getCarets().add(pStart, result.length(), this.memory[(int)pc], Type.LABEL_REL); setLabelPlus(pc,1); pc+=2; break; case A_IDY: // indirect y if (pos<buffer.length) addr=Unsigned.done(buffer[pos++]); else addr=-1; pStart=result.length(); result+="("+getLabelZero(addr)+(upperCase? "),Y": "),y"); assembler.getCarets().add(pStart, result.length(), this.memory[(int)pc], Type.LABEL_REL); setLabelPlus(pc,1); pc+=2; break; } this.pc=pc; this.pos=pos; return result; } /** * Comment and Disassemble a region of the buffer * * @param buffer the buffer containing the code * @param start the start position in buffer * @param end the end position in buffer * @param pc the programn counter for start position * @return a string rapresentation of disassemble with comment */ @Override public String cdasm(byte[] buffer, int start, int end, long pc) { String tmp; // local temp string String tmp2; // local temp string MemoryDasm mem; // memory dasm MemoryDasm memRel; // memory related MemoryDasm memRel2; // memory related of second kind int actualOffset; // actual offset for caret action int pos=start; // actual position in buffer boolean isCode=true; // true if we are decoding an instruction boolean wasGarbage=false; // true if we were decoding garbage result.setLength(0); // result.append(addConstants()); this.pos=pos; this.pc=pc; while (pos<=end | pos<start) { // verify also that don't circle in the buffer mem=memory[(int)pc]; isCode=((mem.isCode || (!mem.isData && option.useAsCode)) && !mem.isGarbage); if (isCode) { assembler.flush(result); // must put the org if we start from an garbage area if (wasGarbage) { wasGarbage=false; assembler.setOrg(result, (int)pc); } // add block if user declare it if (mem.userBlockComment!=null && !"".equals(mem.userBlockComment)) { assembler.setBlockComment(result, mem); } // add the label if it was declared by dasm or user //if (mem.userLocation!=null && !"".equals(mem.userLocation)) result.append(mem.userLocation).append(":\n"); //else if (mem.dasmLocation!=null && !"".equals(mem.dasmLocation)) result.append(mem.dasmLocation).append(":\n"); if ((mem.userLocation!=null && !"".equals(mem.userLocation)) || (mem.dasmLocation!=null && !"".equals(mem.dasmLocation))) { assembler.setLabel(result, mem); result.append("\n"); } actualOffset=assembler.getCarets().getOffset(); // rember actual offset assembler.getCarets().setOffset(result.length()+actualOffset+17); // use new offset tmp=dasm(buffer); // this is an instruction assembler.getCarets().setOffset(actualOffset); // set old offset tmp2=ShortToExe((int)pc)+" "+ByteToExe(Unsigned.done(buffer[pos])); if (this.pc-pc==2) { if (pos+1<buffer.length) tmp2+=" "+ByteToExe(Unsigned.done(buffer[pos+1])); else tmp2+=" ??"; } if (this.pc-pc==3) { if (pos+2<buffer.length) tmp2+=" "+ByteToExe(Unsigned.done(buffer[pos+1]))+ " "+ByteToExe(Unsigned.done(buffer[pos+2])); else tmp2+=" ?????"; } for (int i=tmp2.length(); i<17; i++) // insert spaces tmp2+=" "; tmp=tmp2+tmp; tmp2=""; for (int i=tmp.length(); i<43; i++) // insert spaces tmp2+=" "; result.append(tmp).append(tmp2); tmp2=dcom(); // if there is a user comment, then use it if (mem.userComment!=null) result.append(" ").append(mem.userComment).append("\n"); else result.append(" ").append(tmp2).append("\n"); // always add a carriage return after a RTS, RTI or JMP if (iType==M_JMP || iType==M_RTS || iType==M_RTI) result.append("\n"); if (pc>=0) { // rememeber this dasm automatic comment if (!"".equals(tmp2)) mem.dasmComment=tmp2; else mem.dasmComment=null; } pos=this.pos; pc=this.pc; } else if (mem.isGarbage) { assembler.flush(result); wasGarbage=true; pos++; pc++; this.pos=pos; this.pc=pc; } else { // must put the org if we start from an garbage area if (wasGarbage) { wasGarbage=false; assembler.setOrg(result, (int)pc); } memRel=mem.related!=-1 ? memory[mem.related & 0xFFFF]: null; if (memRel!=null) memRel2=memRel.related!=-1 ? memory[memRel.related & 0xFFFF]: null; else memRel2=null; assembler.putValue(result, mem, memRel, memRel2, memory[mem.relatedAddressBase], memory[mem.relatedAddressDest]); pos++; pc++; this.pos=pos; this.pc=pc; } } assembler.flush(result); return result.toString(); } /** * Comment and Disassemble a region of the buffer as source * * @param buffer the buffer containing the code * @param start the start position in buffer * @param end the end position in buffer * @param pc the programn counter for start position * @return a string rapresentation of disasemble with comment */ @Override public String csdasm(byte[] buffer, int start, int end, long pc) { String tmp; // local temp string String tmp2; // local temp string MemoryDasm mem; // memory dasm MemoryDasm memRel; // memory related MemoryDasm memRel2; // memory related of second kind int actualOffset; // actual offset int pos=start; // actual position in buffer boolean isCode=true; // true if we are decoding an instruction boolean wasGarbage=false; // true if we were decoding garbage int pStart; result.setLength(0); // result.append(addConstants()); this.pos=pos; this.pc=pc; while (pos<=end | pos<start) { // verify also that don't circle in the buffer mem=memory[(int)pc]; isCode=((mem.isCode || (!mem.isData && option.useAsCode)) && !mem.isGarbage); if (isCode) { assembler.flush(result); // must put the org if we start from an garbage area if (wasGarbage) { wasGarbage=false; assembler.setOrg(result, (int)pc); } // add block if user declare it if (mem.userBlockComment!=null && !"".equals(mem.userBlockComment)) { assembler.setBlockComment(result, mem); } if ((mem.userLocation!=null && !"".equals(mem.userLocation)) || (mem.dasmLocation!=null && !"".equals(mem.dasmLocation))) { assembler.setLabel(result, mem); if (option.labelOnSepLine) result.append("\n"); } pStart=result.length(); result.append(getInstrSpacesTabs(mem)); // this is an instruction actualOffset=assembler.getCarets().getOffset(); // rember actual offset assembler.getCarets().setOffset(result.length()+actualOffset); // use new offset tmp=dasm(buffer); // this is an instruction assembler.getCarets().setOffset(actualOffset); // set old offset result.append(tmp).append(getInstrCSpacesTabs(tmp.length())); assembler.getCarets().add(pStart, result.length(), mem, Type.INSTR); tmp2=dcom(); // if there is a user comment, then use it assembler.setComment(result, mem); // always add a carriage return after a RTS, RTI or JMP if (iType==M_JMP || iType==M_RTS || iType==M_RTI) result.append("\n"); if (pc>=0) { // rememeber this dasm automatic comment if (!"".equals(tmp2)) mem.dasmComment=tmp2; else mem.dasmComment=null; } pos=this.pos; pc=this.pc; } else if (mem.isGarbage) { assembler.flush(result); wasGarbage=true; pos++; pc++; this.pos=pos; this.pc=pc; } else { // must put the org if we start from an garbage area if (wasGarbage) { wasGarbage=false; assembler.setOrg(result, (int)pc); } memRel=mem.related!=-1 ? memory[mem.related & 0xFFFF]: null; if (memRel!=null) memRel2=memRel.related!=-1 ? memory[memRel.related & 0xFFFF]: null; else memRel2=null; assembler.putValue(result, mem, memRel, memRel2, memory[mem.relatedAddressBase], memory[mem.relatedAddressDest]); pos++; pc++; this.pos=pos; this.pc=pc; } } assembler.flush(result); return result.toString(); } /** * Return a comment string for the passed instruction * * @param iType the type of instruction * @param aType the type of addressing used by the instruction * @param addr the address value (if needed by this istruction type) * @param value the operation value (if needed by this instruction) * @return a comment string */ @Override public String dcom(int iType, int aType, long addr, long value) { switch (iType) { case M_SLO: case M_NOP0: case M_NOP1: case M_NOP2: case M_RLA: case M_SRE: case M_RRA: case M_SAX: case M_LAX: case M_DCP: case M_ISB: case M_USBC: return "Undocument command"; case M_ANC: case M_ASR: case M_ARR: case M_ANE: case M_SHA: case M_SHS: case M_SHY: case M_SHX: case M_SBX: case M_LXA: case M_LAS: return "Unusual operation"; case M_JAM: return "Illegal instruction"; } return ""; } /** * Return a comment string for the last instruction * * @return a comment string */ public String dcom() { return dcom(iType, aType, addr, value); } /** * Set the mode of using mnemonics in the disassembler * Available modes are <code>MODE1</code>, </code>MODE2</code>, * <code>MODE3</code>. * * @param mode the type of mode to use */ public void setMode(byte mode) { switch (mode) { case MODE1: mnemonics[M_ANE]="ANE"; mnemonics[M_ASR]="ASR"; mnemonics[M_DCP]="DCP"; mnemonics[M_ISB]="ISB"; mnemonics[M_JAM]="JAM"; mnemonics[M_LAS]="LAS"; mnemonics[M_LXA]="LXA"; mnemonics[M_NOP0]="NOOP"; mnemonics[M_NOP1]="NOOP"; mnemonics[M_NOP2]="NOOP"; mnemonics[M_SAX]="SAX"; mnemonics[M_SBX]="SBX"; mnemonics[M_SHA]="SHA"; mnemonics[M_SHX]="SHX"; mnemonics[M_SHY]="SHY"; mnemonics[M_SHS]="SHS"; mnemonics[M_SLO]="SLO"; mnemonics[M_SRE]="SRE"; break; case MODE2: mnemonics[M_ANE]="AXA"; mnemonics[M_ASR]="ASR"; mnemonics[M_DCP]="DCP"; mnemonics[M_ISB]="ISC"; mnemonics[M_JAM]="JAM"; mnemonics[M_LAS]="AST"; mnemonics[M_LXA]="LXA"; mnemonics[M_NOP0]="NOP"; mnemonics[M_NOP1]="DOP"; mnemonics[M_NOP2]="TOP"; mnemonics[M_SAX]="SAX"; mnemonics[M_SBX]="ASX"; mnemonics[M_SHA]="SAH"; mnemonics[M_SHX]="SXH"; mnemonics[M_SHY]="SYH"; mnemonics[M_SHS]="SSH"; mnemonics[M_SLO]="SLO"; mnemonics[M_SRE]="SRE"; break; case MODE3: mnemonics[M_ANE]="XAA"; mnemonics[M_ASR]="ALR"; mnemonics[M_DCP]="DCM"; mnemonics[M_ISB]="INS"; mnemonics[M_JAM]="HLT"; mnemonics[M_LAS]="LAS"; mnemonics[M_LXA]="OAL"; mnemonics[M_NOP0]="NOP"; mnemonics[M_NOP1]="SKB"; mnemonics[M_NOP2]="SKW"; mnemonics[M_SAX]="AXS"; mnemonics[M_SBX]="SAX"; // name conflict with other modes mnemonics[M_SHA]="AXA"; mnemonics[M_SHX]="XAS"; mnemonics[M_SHY]="SAY"; mnemonics[M_SHS]="TAS"; mnemonics[M_SLO]="ASO"; mnemonics[M_SRE]="LSE"; } } }
31,911
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
CpuDasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/cpu/CpuDasm.java
/** * @(#)CpuDasm.java 2022/02/04 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.cpu; import java.util.Locale; import sw_emulator.software.Assembler; import sw_emulator.software.MemoryDasm; import static sw_emulator.software.MemoryDasm.TYPE_MAJOR; import static sw_emulator.software.MemoryDasm.TYPE_MINOR; import static sw_emulator.software.MemoryDasm.TYPE_MINUS; import static sw_emulator.software.MemoryDasm.TYPE_MINUS_MAJOR; import static sw_emulator.software.MemoryDasm.TYPE_MINUS_MINOR; import static sw_emulator.software.MemoryDasm.TYPE_PLUS; import static sw_emulator.software.MemoryDasm.TYPE_PLUS_MAJOR; import static sw_emulator.software.MemoryDasm.TYPE_PLUS_MINOR; import static sw_emulator.software.cpu.M6510Dasm.A_NUL; import static sw_emulator.software.cpu.M6510Dasm.M_JAM; import sw_emulator.swing.main.Constant; import sw_emulator.swing.main.Option; /** * Generic base Cpu disassembler * * @author ice */ public class CpuDasm implements disassembler { /** Type of instruction (used to create comment) */ protected int iType=M_JAM; /** Type of addressing used by instruction (used to create comment) */ protected int aType=A_NUL; /** Value of address (used to create comment) */ protected long addr=0; /** Value of operation (used to create comment) */ protected long value=0; /** Last position pointer in buffer */ protected int pos=0; /** Last program counter value */ protected long pc=0; /** Memory dasm to use */ MemoryDasm[] memory; /** Assembler manager */ protected Assembler assembler=new Assembler(); /** Option to use */ protected Option option; /** Constant to use */ protected Constant constant; /** Actual case to use for text */ public boolean upperCase=true; /** Default mode for Hex ($)*/ protected boolean defaultMode=true; /** String builder global to reduce GC call */ final StringBuilder result=new StringBuilder (""); /** * Set the memory dasm to use * * @param memory the memory dasm */ public void setMemory(MemoryDasm[] memory) { this.memory=memory; } /** * Set the constant to use * * @param constant the constants */ public void setConstant(Constant constant) { this.constant=constant; } /** * Set the option to use * * @param option the option to use * @param assembler the assembler to use */ public void setOption(Option option, Assembler assembler) { this.option=option; this.assembler=assembler; } /** * Convert a unsigned byte (containing in a int) to Exe upper case 2 chars * * @param value the byte value to convert * @return the exe string rapresentation of byte */ protected String ByteToExe(int value) { int tmp=value; if (value<0) return "??"; String ret=Integer.toHexString(tmp); if (ret.length()==1) ret="0"+ret; return ret.toUpperCase(Locale.ENGLISH); } /** * Convert a unsigned short (containing in a int) to Exe upper case 4 chars * * @param value the short value to convert * @return the exe string rapresentation of byte */ protected String ShortToExe(int value) { int tmp=value; if (value<0) return "????"; String ret=Integer.toHexString(tmp); int len=ret.length(); switch (len) { case 1: ret="000"+ret; break; case 2: ret="00"+ret; break; case 3: ret="0"+ret; break; } return ret.toUpperCase(Locale.ENGLISH); } /** * Return the hex number string with appropriate prefix/suffix ($ of h) * * @param value the string value of the hex number * @param defaultMode the mode $ as default * @return the hex string with prefix */ protected static String HexNum(String value, boolean defaultMode) { if (defaultMode) return "$"+value; else return value+"h"; } /** * Get notmalized type (<,>) * * @param type * @return the normalized type */ private char getNormType(char type) { switch (type) { case TYPE_PLUS_MINOR: case TYPE_MINUS_MINOR: case TYPE_MINOR: return TYPE_MINOR; case TYPE_PLUS_MAJOR: case TYPE_MINUS_MAJOR: case TYPE_MAJOR: return TYPE_MAJOR; default: return type; } } /** * Get the label of immediate value * * @param addr the address of the value * @param value in that location * @return the label of location */ protected String getLabelImm(long addr, long value) { if (addr<0 || addr>0xffff) return HexNum("??", defaultMode); char type=memory[(int)addr].type; // this is a data declaration if (type==TYPE_MINOR || type==TYPE_MAJOR || type==TYPE_PLUS_MAJOR || type==TYPE_PLUS_MINOR || type==TYPE_MINUS_MAJOR || type==TYPE_MINUS_MINOR) { MemoryDasm memRel; // the byte is a reference if (type==TYPE_PLUS_MAJOR || type==TYPE_PLUS_MINOR || type==TYPE_MINUS_MAJOR || type==TYPE_MINUS_MINOR) memRel=memory[memory[(int)addr].related & 0xFFFF]; else memRel=memory[memory[(int)addr].related & 0xFFFF]; if (memRel.userLocation!=null && !"".equals(memRel.userLocation)) return getNormType(type)+memRel.userLocation; else if (memRel.dasmLocation!=null && !"".equals(memRel.dasmLocation)) return getNormType(type)+memRel.dasmLocation; else { switch (memRel.type) { case TYPE_PLUS: /// this is a memory in table label int pos=memRel.address-memRel.related; MemoryDasm mem2=memory[memRel.related]; if (mem2.userLocation!=null && !"".equals(mem2.userLocation)) return getNormType(type)+mem2.userLocation+"+"+pos; if (mem2.dasmLocation!=null && !"".equals(mem2.dasmLocation)) return getNormType(type)+mem2.dasmLocation+"+"+pos; return getNormType(type)+HexNum(ByteToExe((int)memRel.related), defaultMode)+"+"+pos; case TYPE_MINUS: /// this is a memory in table label pos=memRel.address-memRel.related; mem2=memory[memRel.related]; if (mem2.userLocation!=null && !"".equals(mem2.userLocation)) return getNormType(type)+mem2.userLocation+pos; if (mem2.dasmLocation!=null && !"".equals(mem2.dasmLocation)) return getNormType(type)+mem2.dasmLocation+pos; return getNormType(type)+HexNum(ByteToExe((int)memRel.related), defaultMode)+pos; default: return getNormType(memory[(int)addr].type)+HexNum(ShortToExe(memRel.address), defaultMode); } } } else { if (memory[(int)addr].index!=-1) { String res=constant.table[memory[(int)addr].index][(int)value]; if (res!=null && !"".equals(res)) return res; } return HexNum(ByteToExe((int)value), defaultMode); } } /** * Get the label or memory location ($) of zero page * * @param addr the address of the label * @return the label or memory location ($) */ protected String getLabelZero(long addr) { if (addr<0 || addr>0xffff) return HexNum("??", defaultMode); MemoryDasm mem=memory[(int)addr]; if (mem.type==TYPE_PLUS) { /// this is a memory in table label int pos=mem.address-mem.related; MemoryDasm mem2=memory[mem.related]; if (mem2.userLocation!=null && !"".equals(mem2.userLocation)) return mem2.userLocation+"+"+pos; if (mem2.dasmLocation!=null && !"".equals(mem2.dasmLocation)) return mem2.dasmLocation+"+"+pos; return HexNum(ByteToExe((int)mem.related), defaultMode)+"+"+pos; } if (mem.type==TYPE_PLUS_MAJOR || mem.type==TYPE_PLUS_MINOR) { /// this is a memory in table label int rel=mem.related>>16; int pos=mem.address-rel; MemoryDasm mem2=memory[rel]; if (mem2.userLocation!=null && !"".equals(mem2.userLocation)) return mem2.userLocation+"+"+pos; if (mem2.dasmLocation!=null && !"".equals(mem2.dasmLocation)) return mem2.dasmLocation+"+"+pos; return HexNum(ByteToExe(rel), defaultMode)+"+"+pos; } if (mem.type==TYPE_MINUS_MAJOR || mem.type==TYPE_MINUS_MINOR) { /// this is a memory in table label int rel=mem.related>>16; int pos=mem.address-rel; MemoryDasm mem2=memory[rel]; if (mem2.userLocation!=null && !"".equals(mem2.userLocation)) return mem2.userLocation+pos; if (mem2.dasmLocation!=null && !"".equals(mem2.dasmLocation)) return mem2.dasmLocation+pos; return HexNum(ByteToExe(rel), defaultMode)+pos; } if (mem.type==TYPE_MINUS) { /// this is a memory in table label int pos=mem.address-mem.related; MemoryDasm mem2=memory[mem.related]; if (mem2.userLocation!=null && !"".equals(mem2.userLocation)) return mem2.userLocation+pos; if (mem2.dasmLocation!=null && !"".equals(mem2.dasmLocation)) return mem2.dasmLocation+pos; return HexNum(ByteToExe((int)mem.related), defaultMode)+pos; } if (mem.userLocation!=null && !"".equals(mem.userLocation)) return mem.userLocation; if (mem.dasmLocation!=null && !"".equals(mem.dasmLocation)) return mem.dasmLocation; return HexNum(ByteToExe((int)addr), defaultMode); } /** * Get the label or memory location ($) * * @param addr the address of the label * @return the label or memory location ($) */ protected String getLabel(long addr) { if (addr<0 || addr>0xffff) return HexNum("????", defaultMode); MemoryDasm mem=memory[(int)addr]; try { if (mem.type==TYPE_PLUS) { /// this is a memory in table label int pos=mem.address-mem.related; MemoryDasm mem2=memory[mem.related]; if (mem2.userLocation!=null && !"".equals(mem2.userLocation)) return mem2.userLocation+"+"+pos; if (mem2.dasmLocation!=null && !"".equals(mem2.dasmLocation)) return mem2.dasmLocation+"+"+pos; return HexNum(ShortToExe((int)mem.related), defaultMode)+"+"+pos; } if (mem.type==TYPE_PLUS_MAJOR || mem.type==TYPE_PLUS_MINOR) { /// this is a memory in table label int rel=(mem.related>>16)&0xFFFF; int pos=mem.address-rel; MemoryDasm mem2=memory[rel]; if (mem2.userLocation!=null && !"".equals(mem2.userLocation)) return mem2.userLocation+"+"+pos; if (mem2.dasmLocation!=null && !"".equals(mem2.dasmLocation)) return mem2.dasmLocation+"+"+pos; return HexNum(ShortToExe(rel), defaultMode)+"+"+pos; } if (mem.type==TYPE_MINUS_MAJOR || mem.type==TYPE_MINUS_MINOR) { /// this is a memory in table label int rel=(mem.related>>16)&0xFFFF; int pos=mem.address-rel; MemoryDasm mem2=memory[rel]; if (mem2.userLocation!=null && !"".equals(mem2.userLocation)) return mem2.userLocation+pos; if (mem2.dasmLocation!=null && !"".equals(mem2.dasmLocation)) return mem2.dasmLocation+pos; return HexNum(ShortToExe(rel), defaultMode)+pos; } if (mem.type==TYPE_MINUS) { /// this is a memory in table label int pos=mem.address-mem.related; MemoryDasm mem2=memory[mem.related]; if (mem2.userLocation!=null && !"".equals(mem2.userLocation)) return mem2.userLocation+pos; if (mem2.dasmLocation!=null && !"".equals(mem2.dasmLocation)) return mem2.dasmLocation+pos; return HexNum(ShortToExe((int)mem.related), defaultMode)+pos; } } catch (Exception e) { return HexNum("xxxx", defaultMode); } if (mem.userLocation!=null && !"".equals(mem.userLocation)) return mem.userLocation; if (mem.dasmLocation!=null && !"".equals(mem.dasmLocation)) return mem.dasmLocation; return HexNum(ShortToExe((int)addr), defaultMode); } /** * Set the dasm label * * @param addr the address to add as label */ protected void setLabel(long addr) { if (addr<0 || addr>0xffff) return; MemoryDasm mem=memory[(int)addr]; if (mem.isInside && !mem.isGarbage) { switch (mem.type) { case TYPE_PLUS: case TYPE_MINUS: memory[mem.related].dasmLocation="W"+ShortToExe(mem.related); break; case TYPE_PLUS_MAJOR: case TYPE_PLUS_MINOR: case TYPE_MINUS_MAJOR: case TYPE_MINUS_MINOR: memory[mem.related & 0xFFFF].dasmLocation="W"+ShortToExe(mem.related & 0xFFFF); break; default: mem.dasmLocation="W"+ShortToExe((int)addr); // create dasm location only if there is not a related one break; } } } /** * Set the label for plus relative address if this is the case * * @param addr tha address where to point * @param offset the offset to add */ protected void setLabelPlus(long addr, int offset) { if (addr<0 || addr+offset>0xffff) return; MemoryDasm mem=memory[(int)addr+offset]; if (mem.isInside) { // set as relative + unless it is already set (even by user) if (mem.dasmLocation!=null && (mem.type!=TYPE_PLUS) && (mem.type!=TYPE_MINUS)) { mem.type=TYPE_PLUS; mem.related=(int)addr; setLabel(addr); } } } /** * Set the label for minus relative address if this is the case * * @param addr tha address where to point * @param offset the offset to sub */ protected void setLabelMinus(long addr, int offset) { if (addr<0 || addr+offset>0xffff) return; MemoryDasm mem=memory[(int)addr-offset]; if (mem.isInside && mem.type!=TYPE_PLUS) { if (mem.dasmLocation!=null) { mem.type=TYPE_MINUS; mem.related=(int)addr; setLabel(addr); } } } private static final String SPACES=" "; private static final String TABS="\t\t\t\t\t\t\t\t\t\t"; /** * Return spaces/tabs to use in start of instruction * * @param mem the memory of this line * @return the spaces/tabs */ protected String getInstrSpacesTabs(MemoryDasm mem) { if (!option.labelOnSepLine) { int num=0; if (mem.userLocation!=null && !"".equals(mem.userLocation)) num=mem.userLocation.length()+1; else if (mem.dasmLocation!=null && !"".equals(mem.dasmLocation)) num=mem.dasmLocation.length()+1; return SPACES.substring(0, (option.maxLabelLength-num<0 ? 1: option.maxLabelLength-num))+SPACES.substring(0, option.numInstrSpaces)+TABS.substring(0, option.numInstrTabs); } else return SPACES.substring(0, option.numInstrSpaces)+TABS.substring(0, option.numInstrTabs); } /** * Return spaces/tabs to use in comment after instruction * * @param skip amount to skip * @return the spaces/tabs */ protected String getInstrCSpacesTabs(int skip) { return SPACES.substring(0, (option.numInstrCSpaces-skip<0 ? 1:option.numInstrCSpaces-skip))+TABS.substring(0, option.numInstrCTabs); } /** * Return spaces/tabs to use for separate opcode from operand * * @return the spaces/tabs */ protected String getSpacesTabsOp() { return SPACES.substring(0, (option.numSpacesOp))+TABS.substring(0, option.numTabsOp); } /** * Return the mnemonic assembler instruction rapresent by passed code bytes, * using last position an program counter. * * @param buffer the buffer containg the data * @return a string menemonic rapresentation of instruction */ public String dasm(byte[] buffer) { return dasm(buffer, pos, pc); } @Override public String dasm(byte[] buffer, int pos, long pc) { return ""; } @Override public String dcom(int iType, int aType, long addr, long value) { return ""; } @Override public String cdasm(byte[] buffer, int start, int end, long pc) { return ""; } @Override public String csdasm(byte[] buffer, int start, int end, long pc) { return ""; } }
17,275
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
I8048Dasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/cpu/I8048Dasm.java
/** * @(#)I8048Dasm.java 2024/04/11 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.cpu; import sw_emulator.math.Unsigned; import sw_emulator.software.MemoryDasm; import sw_emulator.swing.main.Carets.Type; /** * Disasseble the I8048 code instructions * This class implements the <code>disassembler</code> interface, so it must * disassemble one instruction and comment it. * * @author Ice * @version 1.00 11/04/2024 */ public class I8048Dasm extends CpuDasm implements disassembler { public I8048Dasm() { defaultMode=false; // mode for Hex as h } // legal instruction public static final byte M_ADD = 0; public static final byte M_ADDC = 1; public static final byte M_ANL = 2; public static final byte M_ANLD = 3; public static final byte M_CALL = 4; public static final byte M_CLR = 5; public static final byte M_CPL = 6; public static final byte M_DA = 7; public static final byte M_DEC = 8; public static final byte M_DIS = 9; public static final byte M_DJNZ = 10; public static final byte M_EN = 11; public static final byte M_ENT0 = 12; public static final byte M_INC = 13; public static final byte M_IN = 14; public static final byte M_INS = 15; public static final byte M_JB0 = 16; public static final byte M_JB1 = 17; public static final byte M_JB2 = 18; public static final byte M_JB3 = 19; public static final byte M_JB4 = 20; public static final byte M_JB5 = 21; public static final byte M_JB6 = 22; public static final byte M_JB7 = 23; public static final byte M_JC = 24; public static final byte M_JF0 = 25; public static final byte M_JF1 = 26; public static final byte M_JMPP = 27; public static final byte M_JMP = 28; public static final byte M_JNC = 29; public static final byte M_JNI = 30; public static final byte M_JNT0 = 31; public static final byte M_JNT1 = 32; public static final byte M_JNZ = 33; public static final byte M_JTF = 34; public static final byte M_JT0 = 35; public static final byte M_JT1 = 36; public static final byte M_JZ = 37; public static final byte M_MOVD = 38; public static final byte M_MOVX = 39; public static final byte M_MOVP3 = 40; public static final byte M_MOVP = 41; public static final byte M_MOV = 42; public static final byte M_NOP = 43; public static final byte M_ORL = 44; public static final byte M_ORLD = 45; public static final byte M_OUTL = 46; public static final byte M_RETL = 47; public static final byte M_RETR = 48; public static final byte M_RET = 49; public static final byte M_RL = 50; public static final byte M_RLC = 51; public static final byte M_RR = 52; public static final byte M_RRC = 53; public static final byte M_SEL = 54; public static final byte M_STRT = 55; public static final byte M_STOP = 56; public static final byte M_SWAP = 57; public static final byte M_XCHD = 58; public static final byte M_XCH = 59; public static final byte M_XRL = 60; // no instruction public static final byte M_JAM=61; // undocument instruction public static final byte M_ID1=62; // addressing mode public static final byte A_NUL =0; // nothing else public static final byte A_ACC =1; // accumulator public static final byte A_ACCR =2; // accumulator/register public static final byte A_ACCD =3; // accumulator/data public static final byte A_ACCI =4; // accumulator/immediate public static final byte A_BUSI =5; // bus/immediate public static final byte A_PORI =6; // port/immediate public static final byte A_PORA =7; // port/accumulator public static final byte A_CADR =8; // address public static final byte A_CAR =9; // carry public static final byte A_FLG0 =10; // flag 0 public static final byte A_FLG1 =11; // flag 1 public static final byte A_REG =12; // register public static final byte A_INT =13; // interrupt public static final byte A_TIM =14; // timer/counter interrupt public static final byte A_ACCP =15; // accumulator/port public static final byte A_DREG =16; // data register public static final byte A_ACCB =17; // accumulator/bus public static final byte A_REL =18; // relative public static final byte A_INDA =19; // indirect accumulator public static final byte A_APSW =20; // accumulator/psw public static final byte A_ACCT =21; // accumulator/timer public static final byte A_PSWA =22; // psw/accumulator public static final byte A_RACC =23; // register/accumulator public static final byte A_REGI =24; // register/immediate public static final byte A_DACC =25; // data register/accumulator public static final byte A_RDAI =26; // data register/immediate public static final byte A_TACC =27; // timer/accumulator public static final byte A_APOR =28; // accumulator/port public static final byte A_ACCA =29; // accumulator/accumulator public static final byte A_ACDA =30; // accumulator/data public static final byte A_BUSA =31; // bus/accumulator public static final byte A_MB0 =32; // MB0 public static final byte A_MB1 =33; // MB1 public static final byte A_RB0 =34; // SB0 public static final byte A_RB1 =35; // SB1 public static final byte A_TCNT =36; // timer public static final byte A_CNT =37; // event counter public static final byte A_T =38; // timer public static final byte A_CLK =39; // clock public static final byte A_REGA =40; // reg/address /** Contains the mnemonics of instructions */ public static final String[] mnemonics = { "ADD ", "ADDC ", "ANL ", "ANLD ", "CALL ", "CLR ", "CPL ", "DA ", "DEC ", "DIS ", "DJNZ ", "EN ", "ENT0 ", "INC ", "IN ", "INS ", "JB0 ", "JB1 ", "JB2 ", "JB3 ", "JB4 ", "JB5 ", "JB6 ", "JB7 ", "JC ", "JF0 ", "JF1 ", "JMPP ", "JMP ", "JNC ", "JNI ", "JNT0 ", "JNT1 ", "JNZ ", "JTF ", "JT0 ", "JT1 ", "JZ ", "MOVD ", "MOVX ", "MOVP3", "MOVP ", "MOV ", "NOP ", "ORL ", "ORLD ", "OUTL ", "RETL ", "RETR ", "RET ", "RL ", "RLC ", "RR ", "RRC ", "SEL ", "STRT ", "STOP ", "SWAP ", "XCHD ", "XCH ", "XRL ", "??? ", "ID1 " }; /** Contains the mnemonics reference for the instruction */ public static final byte[] tableMnemonics={ M_NOP, M_ID1, M_OUTL, M_ADD, M_JMP, M_EN, M_JAM, M_DEC, // 0 M_INS, M_IN, M_IN, M_JAM, M_MOVD, M_MOVD, M_MOVD, M_MOVD, M_INC, M_INC, M_JB0, M_ADDC, M_CALL, M_DIS, M_JTF, M_INC, // 10 M_INC, M_INC, M_INC, M_INC, M_INC, M_INC, M_INC, M_INC, M_XCH, M_XCH, M_JAM, M_MOV, M_JMP, M_EN, M_JNT0, M_CLR, // 20 M_XCH, M_XCH, M_XCH, M_XCH, M_XCH, M_XCH, M_XCH, M_XCH, M_XCHD, M_XCHD, M_JB1, M_JAM, M_CALL, M_DIS, M_JT0, M_CPL, // 30 M_JAM, M_OUTL, M_OUTL, M_JAM, M_MOVD, M_MOVD, M_MOVD, M_MOVD, M_ORL, M_ORL, M_MOV, M_ORL, M_JMP, M_STRT, M_JNT1, M_SWAP, // 40 M_ORL, M_ORL, M_ORL, M_ORL, M_ORL, M_ORL, M_ORL, M_ORL, M_ANL, M_ANL, M_JB2, M_ANL, M_CALL, M_STRT, M_JT1, M_DA, // 50 M_ANL, M_ANL, M_ANL, M_ANL, M_ANL, M_ANL, M_ANL, M_ANL, M_ADD, M_ADD, M_MOV, M_JAM, M_JMP, M_STOP, M_JAM, M_RRC, // 60 M_ADD, M_ADD, M_ADD, M_ADD, M_ADD, M_ADD, M_ADD, M_ADD, M_ADDC, M_ADDC, M_JB3, M_JAM, M_CALL, M_ENT0, M_JF1, M_RR, // 70 M_ADDC, M_ADDC, M_ADDC, M_ADDC, M_ADDC, M_ADDC, M_ADDC, M_ADDC, M_MOVX, M_MOVX, M_JAM, M_RET, M_JMP, M_CLR, M_JNI, M_JAM, // 80 M_ORL, M_ORL, M_ORL, M_JAM, M_ORLD, M_ORLD, M_ORLD, M_ORLD, M_MOVX, M_MOVX, M_JB4, M_RETR, M_CALL, M_CPL, M_JNZ, M_CLR, // 90 M_ANL, M_ANL, M_ANL, M_JAM, M_ANLD, M_ANLD, M_ANLD, M_ANLD, M_MOV, M_MOV, M_JAM, M_MOVP, M_JMP, M_CLR, M_JAM, M_CPL, // A0 M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_JB5, M_JMPP, M_CALL, M_CPL, M_JF0, M_JAM, // B0 M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_JAM, M_JAM, M_JAM, M_JAM, M_JMP, M_SEL, M_JZ, M_MOV, // C0 M_DEC, M_DEC, M_DEC, M_DEC, M_DEC, M_DEC, M_DEC, M_DEC, M_XRL, M_XRL, M_JB6, M_XRL, M_CALL, M_SEL, M_JAM, M_MOV, // D0 M_XRL, M_XRL, M_XRL, M_XRL, M_XRL, M_XRL, M_XRL, M_XRL, M_JAM, M_JAM, M_JAM, M_MOVP3,M_JMP, M_SEL, M_JNC, M_RL, // E0 M_DJNZ, M_DJNZ, M_DJNZ, M_DJNZ, M_DJNZ, M_DJNZ, M_DJNZ, M_DJNZ, M_MOV, M_MOV, M_JB7, M_JAM, M_CALL, M_SEL, M_JC, M_RLC, // F0 M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_MOV, M_MOV }; /** Contains the modes for the instruction */ public static final byte[] tableModes={ A_NUL, A_NUL, A_BUSA, A_ACCI, A_CADR, A_INT, A_NUL, A_ACC, // 0 A_ACCB, A_ACCP, A_ACCP, A_NUL, A_APOR, A_APOR, A_APOR, A_APOR, A_DREG, A_DREG, A_REL, A_ACCI, A_CADR, A_INT, A_REL, A_ACC, // 10 A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, A_ACCD, A_ACCD, A_NUL, A_ACCI, A_CADR, A_TIM, A_REL, A_ACC, // 20 A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCD, A_ACCD, A_REL, A_NUL, A_CADR, A_TIM, A_REL, A_ACC, // 30 A_NUL, A_PORA, A_PORA, A_NUL, A_PORA, A_PORA, A_PORA, A_PORA, A_ACDA, A_ACDA, A_ACCT, A_ACCI, A_CADR, A_CNT, A_REL, A_ACC, // 40 A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCD, A_ACCD, A_REL, A_ACCI, A_CADR, A_T, A_REL, A_ACC, // 50 A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCD, A_ACCD, A_TACC, A_NUL, A_CADR, A_TCNT, A_NUL, A_ACC, // 60 A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCD, A_ACCD, A_REL, A_NUL, A_CADR, A_CLK, A_REL, A_ACC, // 70 A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACDA, A_ACDA, A_NUL, A_NUL, A_CADR, A_FLG0, A_REL, A_NUL, // 80 A_BUSI, A_PORI, A_PORI, A_NUL, A_PORA, A_PORA, A_PORA, A_PORA, A_DACC, A_DACC, A_REL, A_NUL, A_CADR, A_FLG0, A_REL, A_CAR, // 90 A_BUSI, A_PORI, A_PORI, A_NUL, A_PORA, A_PORA, A_PORA, A_PORA, A_DACC, A_DACC, A_NUL, A_ACCA, A_CADR, A_FLG1, A_NUL, A_CAR, // A0 A_RACC, A_RACC, A_RACC, A_RACC, A_RACC, A_RACC, A_RACC, A_RACC, A_RDAI, A_RDAI, A_REL, A_INDA, A_CADR, A_FLG1, A_REL, A_NUL, // B0 A_REGI, A_REGI, A_REGI, A_REGI, A_REGI, A_REGI, A_REGI, A_REGI, A_NUL, A_NUL, A_NUL, A_NUL, A_CADR, A_RB0, A_REL, A_APSW, // C0 A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, A_ACCD, A_ACCD, A_REL, A_ACCI, A_CADR, A_RB1, A_NUL, A_PSWA, // D0 A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_NUL, A_NUL, A_NUL, A_ACCA, A_CADR, A_MB0, A_REL, A_ACC, // E0 A_REGA, A_REGA, A_REGA, A_REGA, A_REGA, A_REGA, A_REGA, A_REGA, A_ACCD, A_ACCD, A_REL, A_NUL, A_CADR, A_MB1, A_REL, A_ACC, // F0 A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR, A_ACCR }; /** Contains the bytes used for the instruction */ public static final byte[] tableSize={ 1, 1, 1, 2, 2, 1, 1, 1, // 00 - 07 1, 1, 1, 1, 1, 1, 1, 1, // 08 - 0f 1, 1, 2, 2, 2, 1, 2, 1, // 10 - 17 1, 1, 1, 1, 1, 1, 1, 1, // 18 - 1f 1, 1, 1, 2, 2, 1, 2, 1, // 20 - 27 1, 1, 1, 1, 1, 1, 1, 1, // 28 - 2f 1, 1, 2, 1, 2, 1, 2, 1, // 30 - 37 1, 1, 1, 1, 1, 1, 1, 1, // 38 - 3f 1, 1, 1, 2, 2, 1, 2, 1, // 40 - 47 1, 1, 1, 1, 1, 1, 1, 1, // 48 - 4f 1, 1, 2, 2, 2, 1, 2, 1, // 50 - 57 1, 1, 1, 1, 1, 1, 1, 1, // 58 - 5f 1, 1, 1, 1, 2, 1, 1, 1, // 60 - 67 1, 1, 1, 1, 1, 1, 1, 1, // 68 - 6f 1, 1, 2, 1, 2, 1, 2, 1, // 70 - 77 1, 1, 1, 1, 1, 1, 1, 1, // 78 - 7f 1, 1, 1, 1, 2, 1, 2, 1, // 80 - 87 2, 2, 2, 1, 1, 1, 1, 1, // 88 - 8f 1, 1, 2, 1, 2, 1, 2, 1, // 90 - 97 2, 2, 2, 1, 1, 1, 1, 1, // 98 - 9f 1, 1, 1, 1, 2, 1, 1, 1, // a0 - a7 1, 1, 1, 1, 1, 1, 1, 1, // a8 - af 2, 2, 2, 1, 2, 1, 2, 1, // b0 - b7 2, 2, 2, 2, 2, 2, 2, 2, // b8 - bf 1, 1, 1, 1, 2, 1, 2, 1, // c0 - c7 1, 1, 1, 1, 1, 1, 1, 1, // c8 - cf 1, 1, 2, 2, 2, 1, 1, 1, // d0 - d7 1, 1, 1, 1, 1, 1, 1, 1, // d8 - df 1, 1, 1, 1, 2, 1, 2, 1, // e0 - e7 2, 2, 2, 2, 2, 2, 2, 2, // e8 - ef 1, 1, 2, 1, 2, 1, 2, 1, // f0 - f7 1, 1, 1, 1, 1, 1, 1, 1 // f8 - ff }; /** * Return the mnemonic assembler instruction rapresent by passed code bytes. * * @param buffer the buffer containg the data * @param pos the actual position in the buffer * @param pc the program counter value associated to the bytes being address * by the <code>pos</code> in the buffer * @return a string menemonic rapresentation of instruction */ @Override public String dasm(byte[] buffer, int pos, long pc) { int pStart; // start position for caret String result=""; // result disassemble string int op=Unsigned.done(buffer[pos++]); // instruction opcode iType=(int)tableMnemonics[op]; // store the type for creating comment if (upperCase) result=mnemonics[iType]; else result=mnemonics[iType].toLowerCase(); String nn=getSpacesTabsOp(); result+=nn; aType=tableModes[op]; switch (aType) { case A_NUL: // nothing pc++; break; case A_ACC: // accumulator result+="A"; pc++; break; case A_CAR: // carry result+="C"; pc++; break; case A_INT: // interrupt result+="I"; pc++; break; case A_TIM: // timer/counter interrupt result+="TCNTI"; pc++; break; case A_TCNT: // timer result+="TCNT"; pc++; break; case A_CNT: // event counter result+="CNT"; pc++; break; case A_T: // timer result+="T"; pc++; break; case A_FLG0: // flag 0 result+="F0"; pc++; break; case A_FLG1: // flag 1 result+="F1"; pc++; break; case A_INDA: // indirect accumulator result+="@A"; pc++; break; case A_ACCR: // accumulator/register result+="A,R"+(op&0x07); pc++; break; case A_RACC: // register/accumulator result+="R"+(op&0x07)+",A"; pc++; break; case A_ACCD: // accumulator/data result+="A,@R"+(op&0x01); pc++; break; case A_ACCP: // accumulator/port result+="A,P"+(op&0x03); pc++; break; case A_APSW: // accumulator/psw result+="A,PSW"; pc++; break; case A_PSWA: // psw/accumulator result+="PSW,A"; pc++; break; case A_ACCT: // accumulator/timer result+="A,T"; pc++; break; case A_TACC: // timer/accumulator result+="T,A"; pc++; break; case A_ACCI: // accumulator/immediate if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+="A,#"+getLabelImm(pc+1, value); setLabelPlus(pc,1); pc+=2; break; case A_RDAI: // register/immediate if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+="@R"+(op&0x01)+",#"+getLabelImm(pc+1, value); setLabelPlus(pc,1); pc+=2; break; case A_BUSI: // bus/immediate if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+="BUS,#"+getLabelImm(pc+1, value); setLabelPlus(pc,1); pc+=2; break; case A_PORI: // port/immediate if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+="P"+(op&0x03)+",#"+getLabelImm(pc+1, value); setLabelPlus(pc,1); pc+=2; break; case A_REGI: // register/immediate if (pos<buffer.length) value=Unsigned.done(buffer[pos++]); else value=0; result+="R"+(op&0x03)+",#"+getLabelImm(pc+1, value); setLabelPlus(pc,1); pc+=2; break; case A_PORA: // port/accumulator result+="P"+(op&0x07)+",A"; pc++; break; case A_APOR: // accumulator/port result+="A,P"+(op&0x07); pc++; break; case A_REG: // register result+="R"+(op&0x07); pc++; break; case A_DREG: // data register result+="@R"+(op&0x01); pc++; break; case A_ACDA: // accumulator/data register result+="A,@R"+(op&0x01); pc++; break; case A_DACC: // data register/accumulator result+="@R"+(op&0x01)+",A"; pc++; break; case A_ACCB: // accumulator/bus result+="A,BUS"; pc++; break; case A_BUSA: // accumulator/bus result+="BUS,A"; pc++; break; case A_ACCA: // accumulator/accumulator result+="A,@A"; pc++; break; case A_REL: // relative if (pos<buffer.length) addr=(pc & 0xFF00)+(buffer[pos++] & 0xFF); else addr=-1; result+=getLabel(addr); setLabel(addr); setLabelPlus(pc,1); pc+=2; break; case A_CADR: // address if (pos<buffer.length) addr=((op & 0xE0)<<3)+(buffer[pos++] & 0xFF); else addr=-1; result+=getLabel(addr); setLabel(addr); setLabelPlus(pc,1); pc+=2; break; case A_REGA: // register address if (pos<buffer.length) addr=(pc & 0xFF00)+(buffer[pos++] & 0xFF); else addr=-1; result+="R"+(op&0x07)+","+getLabel(addr); setLabel(addr); setLabelPlus(pc,1); pc+=2; break; case A_MB0: // MB0 result+="MB0"; pc++; break; case A_MB1: // MB1 result+="MB1"; pc++; break; case A_RB0: // RB0 result+="RB0"; pc++; break; case A_RB1: // RB1 result+="RB1"; pc++; break; case A_CLK: // clock result+="CLK"; pc++; break; } this.pc=pc; this.pos=pos; return result; } /** * Return the mnemonic assembler instruction rapresent by passed code bytes, * using last position an program counter. * * @param buffer the buffer containg the data * @return a string menemonic rapresentation of instruction */ public String dasm(byte[] buffer) { return dasm(buffer, pos, pc); } /** * Comment and Disassemble a region of the buffer * * @param buffer the buffer containing the code * @param start the start position in buffer * @param end the end position in buffer * @param pc the programn counter for start position * @return a string rapresentation of disassemble with comment */ @Override public String cdasm(byte[] buffer, int start, int end, long pc) { String tmp; // local temp string String tmp2; // local temp string MemoryDasm mem; // memory dasm MemoryDasm memRel; // memory related MemoryDasm memRel2; // memory related of second kind int actualOffset; // actual offset for caret action int pos=start; // actual position in buffer boolean isCode=true; // true if we are decoding an instruction boolean wasGarbage=false; // true if we were decoding garbage result.setLength(0); // result.append(addConstants()); this.pos=pos; this.pc=pc; while (pos<=end | pos<start) { // verify also that don't circle in the buffer mem=memory[(int)pc]; isCode=((mem.isCode || (!mem.isData && option.useAsCode)) && !mem.isGarbage); if (isCode) { assembler.flush(result); // must put the org if we start from an garbage area if (wasGarbage) { wasGarbage=false; assembler.setOrg(result, (int)pc); } // add block if user declare it if (mem.userBlockComment!=null && !"".equals(mem.userBlockComment)) { assembler.setBlockComment(result, mem); } // add the label if it was declared by dasm or user //if (mem.userLocation!=null && !"".equals(mem.userLocation)) result.append(mem.userLocation).append(":\n"); //else if (mem.dasmLocation!=null && !"".equals(mem.dasmLocation)) result.append(mem.dasmLocation).append(":\n"); if ((mem.userLocation!=null && !"".equals(mem.userLocation)) || (mem.dasmLocation!=null && !"".equals(mem.dasmLocation))) { assembler.setLabel(result, mem); result.append("\n"); } actualOffset=assembler.getCarets().getOffset(); // rember actual offset assembler.getCarets().setOffset(result.length()+actualOffset+17); // use new offset tmp=dasm(buffer); // this is an instruction assembler.getCarets().setOffset(actualOffset); // set old offset tmp2=ShortToExe((int)pc)+" "+ByteToExe(Unsigned.done(buffer[pos])); if (this.pc-pc==2) { if (pos+1<buffer.length) tmp2+=" "+ByteToExe(Unsigned.done(buffer[pos+1])); else tmp2+=" ??"; } if (this.pc-pc==3) { if (pos+2<buffer.length) tmp2+=" "+ByteToExe(Unsigned.done(buffer[pos+1]))+ " "+ByteToExe(Unsigned.done(buffer[pos+2])); else tmp2+=" ?????"; } for (int i=tmp2.length(); i<17; i++) // insert spaces tmp2+=" "; tmp=tmp2+tmp; tmp2=""; for (int i=tmp.length(); i<43; i++) // insert spaces tmp2+=" "; result.append(tmp).append(tmp2); tmp2=dcom(); // if there is a user comment, then use it if (mem.userComment!=null) result.append(" ").append(mem.userComment).append("\n"); else result.append(" ").append(tmp2).append("\n"); // always add a carriage return after a RET, RETL, RETR or JMP if (iType==M_JMP || iType==M_RET || iType==M_RETL || iType==M_RETR) result.append("\n"); if (pc>=0) { // rememeber this dasm automatic comment if (!"".equals(tmp2)) mem.dasmComment=tmp2; else mem.dasmComment=null; } pos=this.pos; pc=this.pc; } else if (mem.isGarbage) { assembler.flush(result); wasGarbage=true; pos++; pc++; this.pos=pos; this.pc=pc; } else { // must put the org if we start from an garbage area if (wasGarbage) { wasGarbage=false; assembler.setOrg(result, (int)pc); } memRel=mem.related!=-1 ? memory[mem.related & 0xFFFF]: null; if (memRel!=null) memRel2=memRel.related!=-1 ? memory[memRel.related & 0xFFFF]: null; else memRel2=null; assembler.putValue(result, mem, memRel, memRel2, memory[mem.relatedAddressBase], memory[mem.relatedAddressDest]); pos++; pc++; this.pos=pos; this.pc=pc; } } assembler.flush(result); return result.toString(); } /** * Comment and Disassemble a region of the buffer as source * * @param buffer the buffer containing the code * @param start the start position in buffer * @param end the end position in buffer * @param pc the programn counter for start position * @return a string rapresentation of disasemble with comment */ @Override public String csdasm(byte[] buffer, int start, int end, long pc) { String tmp; // local temp string String tmp2; // local temp string MemoryDasm mem; // memory dasm MemoryDasm memRel; // memory related MemoryDasm memRel2; // memory related of second kind int actualOffset; // actual offset int pos=start; // actual position in buffer boolean isCode=true; // true if we are decoding an instruction boolean wasGarbage=false; // true if we were decoding garbage int pStart; result.setLength(0); // result.append(addConstants()); this.pos=pos; this.pc=pc; while (pos<=end | pos<start) { // verify also that don't circle in the buffer mem=memory[(int)pc]; isCode=((mem.isCode || (!mem.isData && option.useAsCode)) && !mem.isGarbage); if (isCode) { assembler.flush(result); // must put the org if we start from an garbage area if (wasGarbage) { wasGarbage=false; assembler.setOrg(result, (int)pc); } // add block if user declare it if (mem.userBlockComment!=null && !"".equals(mem.userBlockComment)) { assembler.setBlockComment(result, mem); } if ((mem.userLocation!=null && !"".equals(mem.userLocation)) || (mem.dasmLocation!=null && !"".equals(mem.dasmLocation))) { assembler.setLabel(result, mem); if (option.labelOnSepLine) result.append("\n"); } pStart=result.length(); result.append(getInstrSpacesTabs(mem)); // this is an instruction actualOffset=assembler.getCarets().getOffset(); // rember actual offset assembler.getCarets().setOffset(result.length()+actualOffset); // use new offset tmp=dasm(buffer); // this is an instruction assembler.getCarets().setOffset(actualOffset); // set old offset result.append(tmp).append(getInstrCSpacesTabs(tmp.length())); assembler.getCarets().add(pStart, result.length(), mem, Type.INSTR); tmp2=dcom(); // if there is a user comment, then use it assembler.setComment(result, mem); // always add a carriage return after a RET, RETL, RETR or JMP if (iType==M_JMP || iType==M_RET || iType==M_RETL || iType==M_RETR) result.append("\n"); if (pc>=0) { // rememeber this dasm automatic comment if (!"".equals(tmp2)) mem.dasmComment=tmp2; else mem.dasmComment=null; } pos=this.pos; pc=this.pc; } else if (mem.isGarbage) { assembler.flush(result); wasGarbage=true; pos++; pc++; this.pos=pos; this.pc=pc; } else { // must put the org if we start from an garbage area if (wasGarbage) { wasGarbage=false; assembler.setOrg(result, (int)pc); } memRel=mem.related!=-1 ? memory[mem.related & 0xFFFF]: null; if (memRel!=null) memRel2=memRel.related!=-1 ? memory[memRel.related & 0xFFFF]: null; else memRel2=null; assembler.putValue(result, mem, memRel, memRel2, memory[mem.relatedAddressBase], memory[mem.relatedAddressDest]); pos++; pc++; this.pos=pos; this.pc=pc; } } assembler.flush(result); return result.toString(); } /** * Return a comment string for the passed instruction * * @param iType the type of instruction * @param aType the type of addressing used by the instruction * @param addr the address value (if needed by this istruction type) * @param value the operation value (if needed by this instruction) * @return a comment string */ @Override public String dcom(int iType, int aType, long addr, long value) { switch (iType) { case M_JAM: return "Illegal instruction"; case M_ID1: return "Undocument instruction"; default: return ""; } } /** * Return a comment string for the last instruction * * @return a comment string */ public String dcom() { return dcom(iType, aType, addr, value); } }
31,814
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
UserEvent.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/device/UserEvent.java
/** * @(#)UserEvent.java 2000/05/02 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.device; import sw_emulator.hardware.device.Keyboard; import sw_emulator.hardware.io.Joystick; import java.awt.event.KeyListener; import java.awt.event.KeyEvent; public class UserEvent implements KeyListener { /** * A bridge between Java & JC64 IO: * This class converts an user input to a signal for the emulator. * * @author Michele Caira [email protected] * @version 1.0 */ /** * A reference to a C64 keyboard. */ protected Keyboard keyboard; /** * Java still doesn't allow to controll PC-joysticks, * so we must emulate it by the keyboard. */ protected Joystick joystick1; protected Joystick joystick2; private int JOY1_UP; private int JOY1_DOWN; private int JOY1_LEFT; private int JOY1_RIGHT; private int JOY1_FIRE; private int JOY2_UP; private int JOY2_DOWN; private int JOY2_LEFT; private int JOY2_RIGHT; private int JOY2_FIRE; /** * @param keyboard The C64 keyboard we wanna emulate. */ public UserEvent(Keyboard keyboard) { this.keyboard=keyboard; } /** * Connect joystick1 to the keyboard. * * @param joystick1 The reference to the C64 joystick in port 1. */ public final void connectJoystick1(Joystick joystick1) { this.joystick1=joystick1; setJoystick1DefaultKeySet(); } /** * Connect joystick2 to the keyboard. * * @param joystick2 The reference to the C64 joystick in port 2. */ public final void connectJoystick2(Joystick joystick2) { this.joystick2=joystick2; setJoystick2DefaultKeySet(); } /** * Set a keyset for emulating joystick1. * * @param keyset1 The user keyset. */ public void setJoystick1KeySet(int[] keyset1) { JOY1_UP = keyset1[0]; JOY1_DOWN = keyset1[1]; JOY1_LEFT = keyset1[2]; JOY1_RIGHT= keyset1[3]; JOY1_FIRE = keyset1[4]; } /** * Set a keyset for emulating joystick2. * * @param keyset2 The user keyset. */ public final void setJoystick2KeySet(int[] keyset2) { JOY2_UP = keyset2[0]; JOY2_DOWN = keyset2[1]; JOY2_LEFT = keyset2[2]; JOY2_RIGHT= keyset2[3]; JOY2_FIRE = keyset2[4]; } /** * Set a standard keyset for emulating joystick1. */ public final void setJoystick1DefaultKeySet() { JOY1_UP = KeyEvent.VK_NUMPAD8; JOY1_DOWN = KeyEvent.VK_NUMPAD2; JOY1_LEFT = KeyEvent.VK_NUMPAD4; JOY1_RIGHT= KeyEvent.VK_NUMPAD6; JOY1_FIRE = KeyEvent.VK_SHIFT; } /** * Set a standard keyset for emulating joystick2. */ public final void setJoystick2DefaultKeySet() { JOY2_UP = KeyEvent.VK_W; JOY2_DOWN = KeyEvent.VK_S; JOY2_LEFT = KeyEvent.VK_A; JOY2_RIGHT= KeyEvent.VK_D; JOY2_FIRE = KeyEvent.VK_F; } public void keyPressed(KeyEvent e) { int keycode=e.getKeyCode(); switch(keycode) { case KeyEvent.VK_A: keyboard.pressKey(1,2); break; case KeyEvent.VK_B: keyboard.pressKey(0,0); // break; case KeyEvent.VK_C: keyboard.pressKey(2,4); break; case KeyEvent.VK_D: keyboard.pressKey(2,2); break; case KeyEvent.VK_E: keyboard.pressKey(1,6); break; case KeyEvent.VK_F: keyboard.pressKey(2,5); break; case KeyEvent.VK_G: keyboard.pressKey(3,2); break; case KeyEvent.VK_H: keyboard.pressKey(3,5); break; case KeyEvent.VK_I: keyboard.pressKey(4,1); break; case KeyEvent.VK_J: keyboard.pressKey(4,2); break; case KeyEvent.VK_K: keyboard.pressKey(4,5); break; case KeyEvent.VK_L: keyboard.pressKey(5,2); break; case KeyEvent.VK_M: keyboard.pressKey(4,4); break; case KeyEvent.VK_N: keyboard.pressKey(4,7); break; case KeyEvent.VK_O: keyboard.pressKey(1,6); break; case KeyEvent.VK_P: keyboard.pressKey(5,1); break; case KeyEvent.VK_Q: keyboard.pressKey(0,0); // break; case KeyEvent.VK_R: keyboard.pressKey(2,1); break; case KeyEvent.VK_S: keyboard.pressKey(1,5); break; case KeyEvent.VK_T: keyboard.pressKey(2,6); break; case KeyEvent.VK_U: keyboard.pressKey(3,6); break; case KeyEvent.VK_V: keyboard.pressKey(3,7); break; case KeyEvent.VK_W: keyboard.pressKey(1,1); break; case KeyEvent.VK_X: keyboard.pressKey(2,7); break; case KeyEvent.VK_Y: keyboard.pressKey(3,1); break; case KeyEvent.VK_Z: keyboard.pressKey(1,4); break; case KeyEvent.VK_0: keyboard.pressKey(4,3); break; case KeyEvent.VK_1: keyboard.pressKey(0,0); break; case KeyEvent.VK_2: keyboard.pressKey(0,3); break; case KeyEvent.VK_3: keyboard.pressKey(1,0); break; case KeyEvent.VK_4: keyboard.pressKey(1,3); break; case KeyEvent.VK_5: keyboard.pressKey(2,0); break; case KeyEvent.VK_6: keyboard.pressKey(2,3); break; case KeyEvent.VK_7: keyboard.pressKey(3,0); break; case KeyEvent.VK_8: keyboard.pressKey(3,3); break; case KeyEvent.VK_9: keyboard.pressKey(4,0); break; case KeyEvent.VK_F1: case KeyEvent.VK_F2: keyboard.pressKey(7,4); break; case KeyEvent.VK_F3: case KeyEvent.VK_F4: keyboard.pressKey(7,5); break; case KeyEvent.VK_F5: case KeyEvent.VK_F6: keyboard.pressKey(7,6); break; case KeyEvent.VK_F7: case KeyEvent.VK_F8: keyboard.pressKey(7,3); break; case KeyEvent.VK_EQUALS: keyboard.pressKey(6,5); break; case KeyEvent.VK_ADD: keyboard.pressKey(5,0); break; // case KeyEvent.VK_SEPARATOR: case KeyEvent.VK_SUBTRACT: keyboard.pressKey(5,7); break; case KeyEvent.VK_DIVIDE: case KeyEvent.VK_SLASH: break; case KeyEvent.VK_MULTIPLY: // case KeyEvent.VK_ASTERICS: keyboard.pressKey(6,1); break; case KeyEvent.VK_CANCEL: keyboard.pressKey(7,0); break; case KeyEvent.VK_SPACE: keyboard.pressKey(0,4); break; case KeyEvent.VK_ENTER: keyboard.pressKey(7,1); break; case KeyEvent.VK_COMMA: keyboard.pressKey(5,7); break; } } public void keyTyped(KeyEvent e) { int keycode=e.getKeyCode(); /** * Joystick1 menage. */ if(joystick1!=null) { if(keycode==JOY1_UP) { joystick1.setJoy0(); } else if(keycode==JOY1_UP) { joystick1.setJoy1(); } else if(keycode==JOY1_LEFT) { joystick1.setJoy2(); } else if(keycode==JOY1_RIGHT) { joystick1.setJoy3(); } else if(keycode==JOY1_FIRE) { joystick1.setJoyBut(); } } /** * Joystick2 menage. */ if(joystick2!=null) { if(keycode==JOY2_UP) { joystick2.setJoy0(); } else if(keycode==JOY2_UP) { joystick2.setJoy1(); } else if(keycode==JOY2_LEFT) { joystick2.setJoy2(); } else if(keycode==JOY2_RIGHT) { joystick2.setJoy3(); } else if(keycode==JOY2_FIRE) { joystick2.setJoyBut(); } } } public void keyReleased(KeyEvent e) { int keycode=e.getKeyCode(); switch(keycode) { case KeyEvent.VK_A: keyboard.releaseKey(1,2); break; case KeyEvent.VK_B: keyboard.releaseKey(0,0); // break; case KeyEvent.VK_C: keyboard.releaseKey(2,4); break; case KeyEvent.VK_D: keyboard.releaseKey(2,2); break; case KeyEvent.VK_E: keyboard.releaseKey(1,6); break; case KeyEvent.VK_F: keyboard.releaseKey(2,5); break; case KeyEvent.VK_G: keyboard.releaseKey(3,2); break; case KeyEvent.VK_H: keyboard.releaseKey(3,5); break; case KeyEvent.VK_I: keyboard.releaseKey(4,1); break; case KeyEvent.VK_J: keyboard.releaseKey(4,2); break; case KeyEvent.VK_K: keyboard.releaseKey(4,5); break; case KeyEvent.VK_L: keyboard.releaseKey(5,2); break; case KeyEvent.VK_M: keyboard.releaseKey(4,4); break; case KeyEvent.VK_N: keyboard.releaseKey(4,7); break; case KeyEvent.VK_O: keyboard.releaseKey(1,6); break; case KeyEvent.VK_P: keyboard.releaseKey(5,1); break; case KeyEvent.VK_Q: keyboard.releaseKey(0,0); // break; case KeyEvent.VK_R: keyboard.releaseKey(2,1); break; case KeyEvent.VK_S: keyboard.releaseKey(1,5); break; case KeyEvent.VK_T: keyboard.releaseKey(2,6); break; case KeyEvent.VK_U: keyboard.releaseKey(3,6); break; case KeyEvent.VK_V: keyboard.releaseKey(3,7); break; case KeyEvent.VK_W: keyboard.releaseKey(1,1); break; case KeyEvent.VK_X: keyboard.releaseKey(2,7); break; case KeyEvent.VK_Y: keyboard.releaseKey(3,1); break; case KeyEvent.VK_Z: keyboard.releaseKey(1,4); break; case KeyEvent.VK_0: keyboard.releaseKey(4,3); break; case KeyEvent.VK_1: keyboard.releaseKey(0,0); break; case KeyEvent.VK_2: keyboard.releaseKey(0,3); break; case KeyEvent.VK_3: keyboard.releaseKey(1,0); break; case KeyEvent.VK_4: keyboard.releaseKey(1,3); break; case KeyEvent.VK_5: keyboard.releaseKey(2,0); break; case KeyEvent.VK_6: keyboard.releaseKey(2,3); break; case KeyEvent.VK_7: keyboard.releaseKey(3,0); break; case KeyEvent.VK_8: keyboard.releaseKey(3,3); break; case KeyEvent.VK_9: keyboard.releaseKey(4,0); break; case KeyEvent.VK_F1: case KeyEvent.VK_F2: keyboard.releaseKey(7,4); break; case KeyEvent.VK_F3: case KeyEvent.VK_F4: keyboard.releaseKey(7,5); break; case KeyEvent.VK_F5: case KeyEvent.VK_F6: keyboard.releaseKey(7,6); break; case KeyEvent.VK_F7: case KeyEvent.VK_F8: keyboard.releaseKey(7,3); break; case KeyEvent.VK_EQUALS: keyboard.releaseKey(6,5); break; case KeyEvent.VK_ADD: keyboard.releaseKey(5,0); break; // case KeyEvent.VK_SEPARATOR: case KeyEvent.VK_SUBTRACT: keyboard.releaseKey(5,7); break; case KeyEvent.VK_DIVIDE: case KeyEvent.VK_SLASH: break; case KeyEvent.VK_MULTIPLY: // case KeyEvent.VK_ASTERICS: keyboard.releaseKey(6,1); break; case KeyEvent.VK_CANCEL: keyboard.releaseKey(7,0); break; case KeyEvent.VK_SPACE: keyboard.releaseKey(0,4); break; case KeyEvent.VK_ENTER: keyboard.releaseKey(7,1); break; case KeyEvent.VK_COMMA: keyboard.releaseKey(5,7); break; } /** * Joystick1 menage. */ if(joystick1!=null) { if(keycode==JOY1_UP) { joystick1.resetJoy0(); } else if(keycode==JOY1_UP) { joystick1.resetJoy1(); } else if(keycode==JOY1_LEFT) { joystick1.resetJoy2(); } else if(keycode==JOY1_RIGHT) { joystick1.resetJoy3(); } else if(keycode==JOY1_FIRE) { joystick1.resetJoyBut(); } } /** * Joystick2 menage. */ if(joystick2!=null) { if(keycode==JOY2_UP) { joystick2.resetJoy0(); } else if(keycode==JOY2_UP) { joystick2.resetJoy1(); } else if(keycode==JOY2_LEFT) { joystick2.resetJoy2(); } else if(keycode==JOY2_RIGHT) { joystick2.resetJoy3(); } else if(keycode==JOY2_FIRE) { joystick2.resetJoyBut(); } } } }//UserEvent
15,879
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
C64SidDasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/machine/C64SidDasm.java
/** * @(#)C64SidDasm.java 2001/05/05 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.machine; /** * Comment the memory locations of C64 for the disassembler, but give the comment * for SID extended register, like in PSID file format * It performs also a multy language comments. * * @author Ice * @version 1.00 05/05/2001 */ public class C64SidDasm extends C64Dasm { /** * Return a comment string for the passed instruction. * Here we comment only the SID extended register * * @param iType the type of instruction * @param aType the type of addressing used by the instruction * @param addr the address value (if needed by this istruction type) * @param value the operation value (if needed by this instruction) * @return a comment string */ @Override public String dcom(int iType, int aType, long addr, long value) { byte language=option.commentLanguage; switch (aType) { case A_ZPG: case A_ZPX: case A_ZPY: case A_ABS: case A_ABX: case A_ABY: case A_REL: case A_IND: case A_IDX: case A_IDY: switch (language) { case LANG_ITALIAN: switch ((int)addr) { case 0xD41D: return "START/STOP campionamento - toni Galway-Noise"; case 0xD41E: return "Indirizzo basso ToneData (Galway-Noise) o SampleData"; case 0xD41F: return "Indirizzo alto ToneData (Galway-Noise) o SampleData"; case 0xD43D: return "Tonelength (Galway-Noise) o fine ind. basso SampleData"; case 0xD43E: return "Volume del Noise (Galway-Noise) o fine ind. alto SampleData"; case 0xD43F: return "Periodo di ogni ToneData o numero campioni da ripetere"; case 0xD45D: return "Periodo per il valore 0 di ToneData o per byte bassi campioni"; case 0xD45E: return "Periodo per byte alti campioni"; case 0xD45F: return "Numero di byte da aggiungere dopo aver letto un nibble"; case 0xD47D: return "Ordine dei campioni"; case 0xD47E: return "Indirizzo basso campioni da ripetere"; case 0xD47F: return "Indirizzo alto campioni da ripetere"; } default: switch ((int)addr) { case 0xD41D: return "Sample START/STOP - Galway-Noise tones"; case 0xD41E: return "ToneData address lowbyte (Galway-Noise) or SampleData"; case 0xD41F: return "ToneData address highbyte (Galway-Noise) or SampleData"; case 0xD43D: return "Tonelength (Galway-Noise) or SampleData end addr. low"; case 0xD43E: return "Volume of Noise (Galway-Noise) or SampleData end addr. high"; case 0xD43F: return "Period for each ToneData or Nr times of Repeat Cont. sample"; case 0xD45D: return "Period for value 0 of ToneData or Period for samples lowbyte"; case 0xD45E: return "Period for samples highbyte"; case 0xD45F: return "Nr of bytes to add after Reading one nibble"; case 0xD47D: return "Sampleorder"; case 0xD47E: return "SampleData repeataddress low"; case 0xD47F: return "SampleData repeataddress high"; } } break; } return super.dcom(iType, aType, addr, value); } }
4,184
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
OdysseyDasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/machine/OdysseyDasm.java
/** * @(#)OdysseyDasm.java 2024/04/17 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.machine; import sw_emulator.software.cpu.CpuDasm; import sw_emulator.software.cpu.I8048Dasm; import static sw_emulator.software.cpu.I8048Dasm.A_CADR; import static sw_emulator.software.cpu.I8048Dasm.A_REGA; import static sw_emulator.software.cpu.I8048Dasm.A_REL; /** * Comment the memory location of Odyssey/Videopack for the disassembler * It performs also a multy language comments. * * @author ice */ public class OdysseyDasm extends I8048Dasm { // Available language public static final byte LANG_ENGLISH=1; public static final byte LANG_ITALIAN=2; /** * Return a comment string for the passed instruction * * @param iType the type of instruction * @param aType the type of addressing used by the instruction * @param addr the address value (if needed by this istruction type) * @param value the operation value (if needed by this instruction) * @return a comment string */ @Override public String dcom(int iType, int aType, long addr, long value) { byte language=option.commentLanguage; switch (aType) { case A_CADR: case A_REL: case A_REGA: switch (language) { case LANG_ITALIAN: switch ((int)addr) { case 0x00: return "Avvio a freddo"; case 0x03: return "Interruzione esterna T0"; case 0x07: return "Interruzione Timer/Orologio"; case 0x09: return "Routine di interruzione VBlank 1"; case 0x1A: return "Routine di interruzione VBlank 2 (Collisione & Orologio)"; case 0x44: return "Routine di interruzione VBlank 3 (Melodia)"; case 0x89: return "Codice di controllo per la copia da RAM a VDC durante VBlank"; case 0xA3: return "Codice di copia"; case 0xB0: return "Routine della tastiera"; case 0xE7: return "Imposta l'accesso a VDC"; case 0xEC: return "Imposta l'accesso alla RAM"; case 0xF1: return "Reset"; case 0x11C: return "Spegni il display"; case 0x127: return "Accendi il display"; case 0x132: return "Abilita la copia dei dati al prossimo VSYNC"; case 0x13D: return "Ottieni un tasto premuto"; case 0x14B: return "Traduzione carattere/colore"; case 0x16B: return "Cancella tutti i caratteri"; case 0x176: return "Attendi un'interruzione"; case 0x17C: return "Visualizza caratteri BCD a 2 cifre"; case 0x1A2: return "Avvia la melodia"; case 0x1B0: return "Contatore su/giù"; case 0x23A: return "Imposta i caratteri del punteggio quadruplo"; case 0x261: return "Traduci e copia carattere e colore"; case 0x26A: return "Test del bit"; case 0x280: return "Cancella il bit"; case 0x28A: return "Imposta il bit"; case 0x293: return "[Sconosciuto]"; case 0x2C3: return "Seleziona il gioco"; case 0x300: return "Dati di frequenza"; case 0x34A: return "Dati della melodia"; case 0x376: return "Fine della routine di ingresso della tastiera"; case 0x37E: return "Gestori di interruzioni varie per ROM bancate"; case 0x38F: return "Leggi il joystick"; case 0x3B1: return "[Sconosciuto]"; case 0x3CF: return "[Sconosciuto]"; case 0x3EA: return "Scrittura del carattere"; case 0x400: return "Riavvio"; case 0x402: return "Interruzione VBlank (Esterna)"; case 0x404: return "Interruzione Timer/Orologio"; case 0x406: return "Vettore Routine VBlank (se $402 = JMP $009)"; case 0x408: return "Fine della Selezione del Gioco, A = Selezione"; case 0x40A: return "Continuazione di VBlank (se $406 = JMP $01A)"; } default: switch ((int)addr) { case 0x00: return "Cold Boot"; case 0x03: return "External T0 Interrupt"; case 0x07: return "Timer/Clock Interrupt"; case 0x09: return "VBlank Interrupt Routine 1"; case 0x1A: return "VBlank Interrupt Routine 2 (Collision & Clock)"; case 0x44: return "VBlank Interrupt Routine 3 (Tune)"; case 0x89: return "RAM to VDC VBlank Copying Check Code"; case 0xA3: return "Copying Code"; case 0xB0: return "Keyboard Routine"; case 0xE7: return "Set up VDC Access"; case 0xEC: return "Set up RAM Access"; case 0xF1: return "Reset"; case 0x11C: return "Display Off"; case 0x127: return "Display On"; case 0x132: return "Enable Data Copy next VSYNC"; case 0x13D: return "Get Keystroke"; case 0x14B: return "Character/Colour Translation"; case 0x16B: return "Clear all Characters"; case 0x176: return "Wait for Interrupt"; case 0x17C: return "Display 2 digit BCD Characters"; case 0x1A2: return "Start Tune"; case 0x1B0: return "Up/Down Counter"; case 0x23A: return "Set up Quad Score Characters"; case 0x261: return "Translate & Copy Character & Colour"; case 0x26A: return "Bit test"; case 0x280: return "Bit clear"; case 0x28A: return "Bit set"; case 0x293: return "[Unknown]"; case 0x2C3: return "Select Game"; case 0x300: return "Frequency Data"; case 0x34A: return "Tune Data"; case 0x376: return "Keyboard In routine (end)"; case 0x37E: return "Miscellaneous Interrupt Handlers for Banked Roms"; case 0x38F: return "Read Joystick"; case 0x3B1: return "[Unknown]"; case 0x3CF: return "[Unknown]"; case 0x3EA: return "Character Write"; case 0x400: return "Restart"; case 0x402: return "VBlank (External) Interrupt"; case 0x404: return "Timer/Clock Interrupt"; case 0x406: return "VBlank Routine Vector (if $402 = JMP $009)"; case 0x408: return "End of Select Game, A = Selection"; case 0x40A: return "Continuation of VBlank (if $406 = JMP $01A)"; } } } return super.dcom(iType, aType, addr, value); } }
7,651
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
C64Dasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/machine/C64Dasm.java
/** * @(#)C64Dasm.java 1999/08/21 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.machine; import sw_emulator.software.cpu.M6510Dasm; /** * Comment the memory location of C64 for the disassembler * It performs also a multy language comments. * * @author Ice * @version 1.00 21/08/1999 */ public class C64Dasm extends M6510Dasm { // Available language public static final byte LANG_ENGLISH=1; public static final byte LANG_ITALIAN=2; /** * Return a comment string for the passed instruction * * @param iType the type of instruction * @param aType the type of addressing used by the instruction * @param addr the address value (if needed by this istruction type) * @param value the operation value (if needed by this instruction) * @return a comment string */ @Override public String dcom(int iType, int aType, long addr, long value) { byte language=option.commentLanguage; switch (aType) { case A_ZPG: case A_ZPX: case A_ZPY: case A_ABS: case A_ABX: case A_ABY: case A_REL: case A_IND: case A_IDX: case A_IDY: // do not get comment if appropriate option is not selected if ((int)addr<=0xFF && !option.commentC64ZeroPage) return ""; if ((int)addr>=0x100 && (int)addr<=0x1FF && !option.commentC64StackArea) return ""; if ((int)addr>=0x200 && (int)addr<=0x2FF && !option.commentC64_200Area) return ""; if ((int)addr>=0x300 && (int)addr<=0x3FF && !option.commentC64_300Area) return ""; if ((int)addr>=0x400 && (int)addr<=0x7FF && !option.commentC64ScreenArea) return ""; if ((int)addr>=0x800 && (int)addr<=0x9FFF && !option.commentC64BasicFreeArea) return ""; if ((int)addr>=0xA000 && (int)addr<=0xBFFF && !option.commentC64BasicRom) return ""; if ((int)addr>=0xC000 && (int)addr<=0xCFFF && !option.commentC64FreeRam) return ""; if ((int)addr>=0xD000 && (int)addr<=0xD3FF && !option.commentC64VicII) return ""; if ((int)addr>=0xD400 && (int)addr<=0xD7FF && !option.commentC64Sid) return ""; if ((int)addr>=0xD800 && (int)addr<=0xDBFF && !option.commentC64ColorArea) return ""; if ((int)addr>=0xDC00 && (int)addr<=0xDCFF && !option.commentC64Cia1) return ""; if ((int)addr>=0xDD00 && (int)addr<=0xDEFF && !option.commentC64Cia2) return ""; if ((int)addr>=0xE000 && (int)addr<=0xFFFF && !option.commentC64KernalRom) return ""; switch (language) { case LANG_ITALIAN: switch ((int)addr) { case 0x01: return "Registro I/O 6510"; case 0x03: case 0x04: return "Vettore salti: Conversione reale-intero"; case 0x05: case 0x06: return "Vettore salti: Conversione intero-reale"; case 0x07: return "Carattere di ricerca"; case 0x08: return "Flag: Cerca le virgolette alla fine di una stringa"; case 0x09: return "Colonna di schermo dopo l'ultimo TAB"; case 0x0A: return "Flag: 0=LOAD, 1=VERIFY"; case 0x0B: return "Puntatore buffer di input/numero indici"; case 0x0C: return "Flag: dimensione default per DIM"; case 0x0D: return "Tipo di dato: case 0xFF=Stringa, case 0x00=Numerico"; case 0x0E: return "Tipo di dato: case 0x80=Intero, case 0x00=Reale"; case 0x0F: return "Flag per DATA/LIST"; case 0x10: return "Flag: Riferimento indice/Chiamata di funzione utente"; case 0x11: return "Flag: case 0x00=INPUT, case 0x40=GET, case 0x98=READ"; case 0x12: return "Flag: Simbolo TAN/Risultato di un confronto"; case 0x13: return "Flag: richista di INPUT"; case 0x14: case 0x15: return "Transiente: Valore intero"; case 0x16: return "Puntatore: Stack stringhe transienti"; case 0x17: case 0x18: return "Ultimo indirizzo stringhe transienti"; case 0x19: case 0x20: case 0x21: return "Stack stringhe transienti"; case 0x22: case 0x23: case 0x24: case 0x25: return "Area puntatori programmi di utilità"; case 0x26: case 0x27: case 0x28: case 0x29: case 0x2A: return "Prodotto di moltiplicazione reale"; case 0x2B: case 0x2C: return "Puntatore: inizio del programma BASIC"; case 0x2D: case 0x2E: return "Puntatore: inizio variabili del BASIC"; case 0x2F: case 0x30: return "Puntatore: inzio degli array del BASIC"; case 0x31: case 0x32: return "Puntatore: fine degli array del BASIC"; case 0x33: case 0x34: return "Puntatore: inizio delle stringhe del BASIC"; case 0x35: case 0x36: return "Puntatore: stringhe per programmi ausiliari"; case 0x37: case 0x38: return "Puntatore: fine della memoria BASIC"; case 0x39: case 0x3A: return "Numero di linea corrente del BASIC"; case 0x3B: case 0x3C: return "Numero di linea precedente del BASIC"; case 0x3D: case 0x3E: return "Puntatore: istruzione BASIC per CONT"; case 0x3F: case 0x40: return "Numero di linea DATA corrente"; case 0x41: case 0x42: return "Puntatore: indirizzo elemento corrente di DATA"; case 0x43: case 0x44: return "Vettore: routine di INPUT"; case 0x45: case 0x46: return "Nome variabile corrente del BASIC"; case 0x47: case 0x48: return "Puntatore: dato variabile corrente del BASIC"; case 0x49: case 0x4A: return "Puntatore: variabile per il FOR..NEXT"; case 0x4B: case 0x4C: return "Puntatore BASIC per la scratch area"; case 0x4D: return "Accumulatore per la comparazione dei simboli"; case 0x54: case 0x55: case 0x56: return "Vettore di fusione jump"; case 0x61: return "Accumulatore floating point #1: Esponente"; case 0x62: case 0x63: case 0x64: case 0x65: return "Accumulatore floating point #1: Mantissa"; case 0x66: return "Accumulatore floating point #1: Segno"; case 0x67: return "Puntatore: costante di valutazione delle serie"; case 0x68: return "Accumulatore floating point #1: Cifra di overflow"; case 0x69: return "Accumulatore floating point #2: Esponente"; case 0x6A: case 0x6B: case 0x6C: case 0x6D: return "Accumulatore floating point #2: Mantissa"; case 0x6E: return "Accumulatore floating point #2: Segno"; case 0x6F: return "Risultato confronto segno di #1 con #2"; case 0x70: return "Byte basso #1 (arrotondamento)"; case 0x71: case 0x72: return "Puntatore: buffer cassetta"; case 0x8B: case 0x8C: case 0x8D: case 0x8E: case 0x8F: return "Valore reale del seme di RND"; case 0x90: return "Statusbyte ST dell'I/O KERNAL"; case 0x91: return "Flag: tasto STOP/ tasto RVS"; case 0x92: return "Costante (timeout) di misura del tempo per nastro"; case 0x93: return "Flag: 0=LOAD, 1=VERIFY"; case 0x94: return "Flag: Bus seriale - Carattere bufferizzato in out"; case 0x95: return "Carattere bufferizzato per bus seriale"; case 0x96: return "Numero (EOT) di sincronismo cassetta"; case 0x97: return "Memoria di registro"; case 0x98: return "Numero file aperti/Indice della tabella dei file"; case 0x99: return "Dispositivo di input (default=0)"; case 0x9A: return "Dispositivo di output (CMD=3)"; case 0x9B: return "Parità carattere nastro"; case 0x9C: return "Flag: Ricevuto byte da nastro"; case 0x9D: return "Flag: 80=modo diretto 00=modo programma"; case 0x9E: return "Registro errore passo 1 del nastro"; case 0x9F: return "Registro errore passo 2 del nastro"; case 0xA0: case 0xA1: case 0xA2: return "Clock in tempo reale HMS (1/60 sec)"; case 0xA3: return "Contatore seriale di Bit: Flag EOI"; case 0xA4: return "Ciclo del contatore"; case 0xA5: return "Contatore a ritroso sincronismo Write cassetta"; case 0xA6: return "Puntatore: Buffer di I/O del nastro"; case 0xA7: return "Bit di input RS-232/Cassetta transiente"; case 0xA8: return "Contatore bit input RS-232/Cassetta transiente"; case 0xA9: return "Indicatore RS-232: Controllo dei bit di partenza"; case 0xAA: return "Buffer per byte input RS-232/Cassetta transiente"; case 0xAB: return "Parità input RS-232/Contatore corto cassetta"; case 0xAC: case 0xAD: return "Puntatore: Buffer nastro/Scorrimento schermo"; case 0xAE: case 0xAF: return "Indirizzi di fine nastro/Fine programma"; case 0xB0: case 0xB1: return "Costanti di misura del tempo per nastro"; case 0xB2: case 0xB3: return "Puntatore: inizio buffer per nastro"; case 0xB4: return "Contatore bit output RS-232/Temporizzatore nastro"; case 0xB5: return "Prossimo bit RS-232 da mandare/EOT del nastro"; case 0xB6: return "Buffer del byte di output dell'RS-232"; case 0xB7: return "Lunghezza del nome file corrente"; case 0xB8: return "Numero file logico corrente"; case 0xB9: return "Indirizzo secondario corrente"; case 0xBA: return "Numero del dispositivo corrente"; case 0xBB: case 0xBC: return "Puntatore: nome del file corrente"; case 0xBD: return "Parità output dell'RS-232/Cassetta transiente"; case 0xBE: return "Contatore blocco Read/Write cassetta"; case 0xBF: return "Buffer parola seriale"; case 0xC0: return "Arresto motore del nastro"; case 0xC1: case 0xC2: return "Indirizzo partenza dell'I/O"; case 0xC3: case 0xC4: return "Carico nastro transiente"; case 0xC5: return "Tasto corrente premuto: CHRcase 0x(n) 0=nessun tasto"; case 0xC6: return "Numero di caratteri nel buffer tastiera"; case 0xC7: return "Flag: Stampa caratteri inversi: 1=si 0=non usato"; case 0xC8: return "Puntatore: fine linea logica per INPUT"; case 0xC9: case 0xCA: return "Posizione (X,Y) del cursore"; case 0xCB: return "Flag: stampa i caratteri con SHIFT abassato"; case 0xCC: return "Abilitatore lampeggio: 0=lampeggio"; case 0xCD: return "Timer: conto alla rovescia per cursore bistabile"; case 0xCE: return "Carattere sotto il cursore"; case 0xCF: return "Flag: Ultima impostazione cursore (lampeggio/fisso)"; case 0xD0: return "Flag: INPUT o GET da tastiera"; case 0xD1: case 0xD2: return "Puntatore: indirizzo linea di schermo corrente"; case 0xD3: return "Colonna del cursore sulla linea corrente"; case 0xD4: return "Flag: Editor modo \"quote\", case 0x00=NO"; case 0xD5: return "Lunghezza linea di schermo fisica"; case 0xD6: return "Numero linea dove il cursore risiede"; case 0xD7: return "Ultimo tasto/checksum/buffer"; case 0xD8: return "Flag: Modo Inserimento"; case 0xF1: return "Linee di schermo non vere"; case 0xF2: return "Label delle linee di schermo"; case 0xF3: case 0xF4: return "Puntatore: locazione corrente RAM colore schermo"; case 0xF5: case 0xF6: return "Vettore: Tavola di decodificazione della tastiera"; case 0xF7: case 0xF8: return "Puntatore al buffer di input dell'RS-232"; case 0xF9: case 0xFA: return "Puntatore al buffer di output dell'RS-232"; case 0xFB: case 0xFE: return "Libera Pagina 0 per progammi Utente"; case 0xFF: return "Area dati transiente del BASIC"; case 0x281: case 0x282: return "Puntatore: Base della memoria per Sistema Operativo"; case 0x283: case 0x284: return "Puntatore: Cima della memoria per Sistema Operativo"; case 0x285: return "Flag KERNAL: supero Tempo dell'IEEE"; case 0x286: return "Codice colore del carattere corrente"; case 0x287: return "Colore di fondo sotto il cursore"; case 0x288: return "Cima della memoria schermo (pagina)"; case 0x289: return "Misura del buffer della tastiera"; case 0x28A: return "Flag: ripete il tasto battuto, case 0x80=tutti i tasti"; case 0x28B: return "Ripete il contatore velocità"; case 0x28C: return "Ripete il contatore ritardo"; case 0x28D: return "Flag: Tasto SHIFT/CTRL/Commodore"; case 0x28E: return "Ultima configurazione SHIFT della tastiera"; case 0x28F: case 0x290: return "Vettore: Preparazione tabella tastiera"; case 0x291: return "Flag: modo SHIFT: 00=Disabilita case 0x80=abilita"; case 0x292: return "Flag: scorrimento automatico verso il basso: 0=ON"; case 0x293: return "RS-232: Immagine del registro di controllo del 6551"; case 0x294: return "RS-232: Immagine del registro di comando del 6551"; case 0x295: case 0x296: return "BPS RS-232 USA non standard (Tempo/2-100)"; case 0x297: return "RS-232: Immagine del registro di stato del 6551"; case 0x298: return "Numero di bit dell'RS-232 rimasti da inviare"; case 0x299: case 0x29A: return "Baud Rate dell'RS-232"; case 0x29B: return "Indice RS-232 per termine buffer input"; case 0x29C: return "Inizio del buffer di input RS-232 (pagina)"; case 0x29D: return "Inizio del buffer di output RS-232 (pagina)"; case 0x29E: return "Indice RS-232 per termine buffer output"; case 0x29F: case 0x2A0: return "Contiene il vettore IRQ durante l'I/O del nastro"; case 0x2A1: return "Abilita l'RS-232"; case 0x2A2: return "Lettura di TOD durante I/O cassetta"; case 0x2A3: return "Memorizzazione transiente per lettura cassetta"; case 0x2A4: return "Indicatore di IRQ transiente per lettura cassetta"; case 0x2A5: return "Transiente per indice di linea"; case 0x2A6: return "Indicatore PAL/NTSC, 0=NTSC, 1=PAL"; case 0x300: case 0x301: return "Vettore: Stampa i messaggi di errore del BASIC"; case 0x302: case 0x303: return "Vettore: Partenza a caldo del BASIC"; case 0x304: case 0x305: return "Vettore: Testo BASIC \"tokenizzato\""; case 0x306: case 0x307: return "Vettore: Lista del testo BASIC"; case 0x308: case 0x309: return "Vettore: Invio caratteri BASIC"; case 0x30A: case 0x30B: return "Vettore: Valutazione \"token\" del BASIC"; case 0x30C: return "Memorizzazione del registro A del 6502"; case 0x30D: return "Memorizzazione del registro X del 6502"; case 0x30E: return "Memorizzazione del registro Y del 6502"; case 0x30F: return "Memorizzazione del registro P del 6502"; case 0x310: return "Istruzione di salto della funzione USR"; case 0x311: case 0x312: return "Byte basso/alto dell'istruzione di USR"; case 0x313: return "Non usato"; case 0x314: case 0x315: return "Vettore: Hardware Interrupt (IRQ)"; case 0x316: case 0x317: return "Vettore: Break Interrupt"; case 0x318: case 0x319: return "Vettore: Non maskerable Interrupt (NMI)"; case 0x31A: case 0x31B: return "Vettore routine OPEN del KERNAL"; case 0x31C: case 0x31D: return "Vettore routine CLOSE del KERNAL"; case 0x31E: case 0x31F: return "Vettore routine CHKIN del KERNAL"; case 0x320: case 0x321: return "Vettore routine CHKOUT del KERNAL"; case 0x322: case 0x323: return "Vettore routine CLRCHN del KERNAL"; case 0x324: case 0x325: return "Vettore routine CHRIN del KERNAL"; case 0x326: case 0x327: return "Vettore routine CHROUT del KERNAL"; case 0x328: case 0x329: return "Vettore routine STOP del KERNAL"; case 0x32A: case 0x32B: return "Vettore routine GETIN del KERNAL"; case 0x32C: case 0x32D: return "Vettore routine CLALL del KERNAL"; case 0x32E: case 0x32F: return "Vettore definito dall'utente"; case 0x330: case 0x331: return "Vettore routine LOAD del KERNAL"; case 0x332: case 0x333: return "Vettore routine SAVE del KERNAL"; case 0xA000: return "Vettore Routine: imposta vet. Basic e stampa inizio"; case 0xA002: return "Vettore Routine: chiude canali, partenza a caldo"; case 0xA003: case 0xA004: case 0xA005: case 0xA006: case 0xA007: case 0xA008: case 0xA009: case 0xA00A: case 0xA00B: return "Testo: \"cbmbasic\""; case 0xA00C: return "BASIC: Indirizzi delle funzioni -1 (END, FOR, NEXT, ... 35 indirizzi di 2 byte ciascuno)"; case 0xA052: return "BASIC: Indirizzi delle funzioni (SGN, INT, ABS, ... 23 indirizzi di 2 byte ciascuno)"; case 0xA080: return "BASIC: Codici gerarchia e indirizzi operatori -1 (10-volte 1+2 Bytes)"; case 0xA09E: return "BASIC: parole chiave come stringhe in PETSCII; Bit 7 dell'ultimo carattere è settato"; case 0xA129: return "Routine: Parole chiave senza indirizzi di azioni - TAB(, TO, SPC(, ...; Bit 7 dell'ultimo carattere è settato"; case 0xA140: return "Routine: Parole chiave degli operandi + - * etc.; e anche AND, OR come stringhe. Bit 7 dell'ultimo carattere è settato"; case 0xA14D: return "Routine: Parole chiavi delle funzioni (SGN, INT, ABS, etc.) dove il 7-mo bit dell'ultimo carattere è settato"; case 0xA19E: return "BASIC: Error messages (TOO MANY FILES, FILE OPEN, ... ); 29 messages where bit 7 of the last character is set"; case 0xA328: return "Routine: Tabella puntatori ai messaggi errore"; case 0xA364: return "BASIC: Messaggi dell'interprete (OK, ERROR IN, READY, BREAK)"; case 0xA38A: return "Routine: Cerca nello stack per FOR-NEXT e GOSUB"; case 0xA3B8: return "Routine: Chiamata all'inserimento di linee Basic. Verifica se c'è spazio disponibile. Dopo esegue $A3BF"; case 0xA3BF: return "Routine: Sposta bytes"; case 0xA3FB: return "Routine: Verifica per spazio nello stack"; case 0xA408: return "Routine: Verifica overflow area Array"; case 0xA435: return "Routine: Stampa errore (OUT OF MEMORY)"; case 0xA437: return "Routine: Stampa i messaggi di errore del BASIC"; case 0xA43A: return "Routine: Default stampa messaggi errore BASIC"; case 0xA469: return "Routine: Stampa stringa (YA),+ 'IN'+numero linea"; case 0xA474: return "Routine: Stampa READY,partenza a caldo"; case 0xA480: return "Routine: Ciclo attesa input; usa vettori in ($0302) per saltare all'avvio basic a $A483"; case 0xA483: return "Routine: Partenza a caldo del BASIC"; case 0xA560: return "Routine: Legge 89 caratteri di input di comando BASIC"; case 0xA579: return "Routine: Testo BASIC \"tokenizzato\" (da case 0x0304)"; case 0xA57C: return "Routine: Testo BASIC \"tokenizzato\""; case 0xA613: return "Routine: Calcola indirizzo partenza da una linea programma"; case 0xA642: return "Routine: Istruzione NEW"; case 0xA65E: return "Routine: Istruzione CLR"; case 0xA68E: return "Routine: Setta puntatore programma alla partenza BASIC (carica $7A, $7B con $2B-1, $2C-1)"; case 0xA69C: return "Routine: Istruzione LIST"; case 0xA717: return "Routine: Converte codice BASIC in testo; usa vettori (0306) per $A71A"; case 0xA71A: return "Routine: Lista del testo BASIC"; case 0xA742: return "Routine: Istruzione FOR"; case 0xA7AE: return "Routine: Ciclo interprete, setta prossima istruzione da eseguire"; case 0xA7C4: return "Routine: Verifica per termine programma"; case 0xA7E4: return "Routine: Invio caratteri BASIC"; case 0xA81D: return "Routine: Istruzione RESTORE"; case 0xA82F: return "Routine: Istruzione STOP"; case 0xA831: return "Routine: Istruzione END"; case 0xA857: return "Routine: Istruzione CONT"; case 0xA871: return "Routine: Istruzione RUN"; case 0xA883: return "Routine: Istruzione GOSUB"; case 0xA8A0: return "Routine: Istruzione GOTO"; case 0xA8D2: return "Routine: Istruzione RETURN"; case 0xA8F8: return "Routine: Istruzione DATA"; case 0xA906: return "Routine: Cerca caratere ':' sulla stringa (posizione)"; case 0xA909: return "Routine: Cerca caratere 0 sulla stringa (posizione)"; case 0xA928: return "Routine: Istruzione IF"; case 0xA93B: return "Routine: Istruzione REM"; case 0xA94B: return "Routine: Istruzione ON"; case 0xA96B: return "Routine: Ottiene il numero dicimale (0...63999, di solito un numero riga) dal testo basic in $14/$15"; case 0xA9A5: return "Routine: Istruzione LET"; case 0xA9C4: return "Routine: Assegna valore a intero"; case 0xA9D6: return "Routine: Assegna valore a float"; case 0xA9D9: return "Routine: Assegna valore a stringa"; case 0xA9E3: return "Routine: Assegna alla variabile di sistema TI$"; case 0xAA1D: return "Routine: Verifica per numeri nella stringa, e se ci sono, continue con $AA27"; case 0xAA27: return "Routine: Aggiunge una cifra PETSCII della stringa nel numero float"; case 0xAA2C: return "Routine: Assegna valore alla variabile stringa (LET per stringhe)"; case 0xAA80: return "Routine: Istruzione PRINT#"; case 0xAA86: return "Routine: Istruzione CMD"; case 0xAAA0: return "Routine: Istruzione PRINT"; case 0xAAB8: return "Routine: Stampa la variabile; I numeri sono convertiti prima in stirnga"; case 0xAACA: return "Routine: Mette un terminatore (0) sulla stringa letta"; case 0xAAD7: return "Routine: Stampa effetto return e/o avanzamento"; case 0xAAF8: return "Routine: TAB( (C=1) e SPC( (C=0)"; case 0xAB1E: return "Routine: Stampa la stringa (YA) finchè c'è 0 o è stata trovata la quota"; case 0xAB3B: return "Routine: Stampa cursore (o spazio se non è sullo schermo)"; case 0xAB3F: return "Routine: Stampa una carattere spazio"; case 0xAB42: return "Routine: Immette tasto DX nel canale+ errori e char"; case 0xAB45: return "Routine: Immette '?' nel canale+ errori e char"; case 0xAB47: return "Routine: Immette un carat. nel canale+ errori e char"; case 0xAB4D: return "Routine: Stampa messaggio errore per comandi IO (INPUT / GET / READ)"; case 0xAB7B: return "Routine: Istruzione GET"; case 0xABA5: return "Routine: Istruzione INPUT#"; case 0xABBF: return "Routine: Istruzione INPUT"; case 0xABEA: return "Routine: Ottiene la linea nel buffer"; case 0xABF9: return "Routine: Mostra prompt input"; case 0xAC06: return "Routine: Istruzione READ"; case 0xAC35: return "Routine: Istruzione input per GET"; case 0xACFC: return "BASIC: Messaggi ?EXTRA IGNORED e ?REDO FROM START, seguiti da $0D (CR) e terminatore stringa $00"; case 0xAD1E: return "Routine: Istruzione NEXT"; case 0xAD61: return "Routine: Verifica per loop valido"; case 0xAD8A: return "Routine: FRMNUM: Ottiene l'espressione (FRMEVL) e verifica se numerica"; case 0xAD8D: return "Routine: Verifica se dato (A) di tipo Numerico+ errore"; case 0xAD8F: return "Routine: Verifica se dato (A) di tipo Stringa+ errore"; case 0xAE83: return "Routine: EVAL: Ottiene il prossimo elemento espressione; usa verrori ($030A) per saltare a $AE86"; case 0xAE86: return "Routine: Valutazione \"token\" del BASIC"; case 0xAEA8: return "Routine: Valore per costante PI in formato 5 bytes float"; case 0xAEF1: return "Routine: Valuta l'espressione dentro parentesi"; case 0xAEF7: return "Routine: Verifica se c'è ')' nel char corrente (Syntax)"; case 0xAEFA: return "Routine: Verifica se c'è '(' nel char corrente (Syntax)"; case 0xAEFD: return "Routine: Verifica se c'è ',' nel char corrente (Syntax)"; case 0xAEFF: return "Routine: Verifica se A è nel char corrente (Syntax)"; case 0xAF08: return "Routine: Stampa errore (SYNTAX)"; case 0xAF0D: return "Routine: Calcola NOT"; case 0xAF14: return "Routine: Verifica per variabili riservate. Imposta il flag carry, se FAC punta alla ROM. Questo indica l'uso di una delle variabili riservate TI$, TI, ST"; case 0xAF28: return "Routine: Ottiene la variabile: Cerna nelle lista variabili per una chiamata in $45, $46"; case 0xAF48: return "Routine: Legge il contatore orologio e genera la stringa, che contiene TI$"; case 0xAFA7: return "Routine: Funzione calcolo; Determina il tipo di funzione e la valuta"; case 0xAFB1: return "Routine: Cerca per parentesi aperta, ottiene l'espressione (FRMEVL), cerca per virgole, gottiene la stringa"; case 0xAFD1: return "Routine: Analizza funzione numerica"; case 0xAFE6: return "Routine: Comandi OR e AND, distinti dal flag$0B (= $FF per OR, $00 per AND)"; case 0xB016: return "Routine: Comparazione (<, =, > )"; case 0xB01B: return "Routine: Comparazione numerica"; case 0xB02E: return "Routine: Comparazione stringhe"; case 0xB081: return "Routine: Istruzione DIM"; case 0xB08B: return "Routine: Verifica se c'è una variabile"; case 0xB090: return "Routine: Verifica se c'è una variabile per DIM"; case 0xB092: return "Routine: Verifica se c'è una variabile (A=par)"; case 0xB113: return "Routine: Verifica se il carattere in A è da 'A'..'Z'"; case 0xB11D: return "Routine: Crea variable"; case 0xB194: return "Routine: Calcola puntatore del primo elemento array"; case 0xB1A5: return "Routine: Costante -32768 come float (5 bytes)"; case 0xB1AA: return "Routine: Conversione Floating Point -> Intero"; case 0xB1B2: return "Routine: Ottine l'intero positivo dal testo BASIC"; case 0xB1BF: return "Routine: Converte Floating Point in intero"; case 0xB1D1: return "Routine: Ottiene variabile array dal testo BASIC"; case 0xB218: return "Routine: Cerca per il nome array al puntatore $45, $46)"; case 0xB245: return "Routine: Stampa errore (BAD SUBSCRIPT)"; case 0xB248: return "Routine: Stampa errore (ILLEGAL QUANTITY)"; case 0xB24D: return "Routine: Stampa errore (?REDIM'D ARRAY )"; case 0xB261: return "Routine: Crea variabile array"; case 0xB30E: return "Routine: Calcola indirizzo dell'elemento array, setta puntatore ($47)"; case 0xB34C: return "Routine: Calcola la distanza da un dato elemento array in uno a ($47) e stampa il risultato in X/Y"; case 0xB37D: return "Routine: Funzione FRE"; case 0xB391: return "Routine: Conversione Intero->Floating Point"; case 0xB39E: return "Routine: Funzione POS"; case 0xB3A2: return "Routine: Converte il byte in Y in Floating Point"; case 0xB3A6: return "Routine: Verifica per il modo diretto: il valore $FF nel flag $3A indica modo diretto"; case 0xB3AE: return "Routine: Scrive il messaggio di errore (?UNDEF'D FUNCTION)"; case 0xB3B3: return "Routine: Istruzione DEF"; case 0xB465: return "Routine: Funzione STR$"; case 0xB475: return "Routine: Crea spazio per inserire nelle stringhe"; case 0xB487: return "Routine: Orriene la stringa, pointer in YA"; case 0xB4CA: return "Routine: Memorizza puntatore stringa nello stack"; case 0xB4F4: return "Routine: Riserva lo spazio per stringa, lunghezza in A"; case 0xB526: return "Routine: Garbage Collection"; case 0xB606: return "Routine: Ricerca n variabili e arrays per stringhe che devono essere salvate dal prossimo Garbace Collection"; case 0xB63D: return "Routine: Concatena due stringhe"; case 0xB67A: return "Routine: Muove le stringe nell'area riservata"; case 0xB6A3: return "Routine: Gestiuone stringa FRESTR"; case 0xB6DB: return "Routine: Riumuove puntatore stringa dallo stack"; case 0xB6EC: return "Routine: Funzione CHR$"; case 0xB700: return "Routine: Funzione LEFT$"; case 0xB72C: return "Routine: Funzione RIGTH$"; case 0xB737: return "Routine: Funzione MOD$"; case 0xB761: return "Routine: Parametri stringa dallo stack (ottiene puntatori per descrittori stringh e le scrive in $50, $51 e la lunghezza in A e X)"; case 0xB77C: return "Routine: Funzione LEN"; case 0xB782: return "Routine: Get string parameter (length in Y), switch to numeric"; case 0xB78B: return "Routine: Funzione ASC"; case 0xB79B: return "Routine: Holt Byte: Read and evaluate expression from BASIC text; the 1 byte value is then stored in X and in FAC+4"; case 0xB7AD: return "Routine: Funzione VAL"; case 0xB7EB: return "Routine: GETADR and GETBYT: Get 16-bit integer (to $14, $15) and an 8 bit value (X)-parameter for WAIT and POKE"; case 0xB7F7: return "Routine: Converts FAC in 2-byte integer to $14, $15 and YA"; case 0xB80D: return "Routine: Funzione PEEK"; case 0xB824: return "Routine: Istruzione POKE"; case 0xB82D: return "Routine: Istruzione WAIT"; case 0xB849: return "Routine: Arrotondamento Floating Point FAC=FAC+0,5"; case 0xB850: return "Routine: Sottrae Floating Point FAC=CONSTANT(YA)-FAC"; case 0xB853: return "Routine: Sottrae Floating Point FAC=ARG-FAC"; case 0xB862: return "Routine: Alinea eponente del Floating Point e ARG per l'addizione"; case 0xB867: return "Routine: Somma Floating Point FAC=CONSTANT(YA)+FAC"; case 0xB86A: return "Routine: Somma Floating Point FAC=ARG+FAC"; case 0xB947: return "Routine: Inverte la mantissa del Floating Point"; case 0xB97E: return "Routine: Stampa errore (OVERFLOW)"; case 0xB983: return "Routine: Moltiplica con un byte"; case 0xB9BC: return "BASIC: Costante 1.00 (tabelle costanti in Mfltp-format per LOG)"; case 0xB9C1: return "BASIC: Costante 03 (grado del polinomio)"; case 0xB9C2: return "BASIC: Costante 0.434255942 (primo coefficiente)"; case 0xB9C7: return "BASIC: Costante 0.576584541 (secondo coefficiente)"; case 0xB9CC: return "BASIC: Costante 0.961800759 (terzo coefficiente)"; case 0xB9D1: return "BASIC: Costante 2.885390073 (quarto coefficiente)"; case 0xB9D6: return "BASIC: Costante 0.707106781 = 1/SQR(2)"; case 0xB9DB: return "BASIC: Costante 1.41421356 = SQR(2)"; case 0xB9E0: return "BASIC: Costante -0.5"; case 0xB9E5: return "BASIC: Costante 0.693147181 = LOG(2)"; case 0xB9EA: return "Routine: Funzione LOG"; case 0xBA28: return "Routine: Moltiplicazione Floating Point FAC=constante (YA)*FAC"; case 0xBA30: return "Routine: Moltiplicazione Floating Point FAC=ARG*FAC"; case 0xBA59: return "Routine: Moltiplicazione Floating Point con un byte e memorizza risultato in $26 .. $2A"; case 0xBA8C: return "Routine: ARG=constante (YA)"; case 0xBAB7: return "Routine: Verifica Floating Point e ARG "; case 0xBAE2: return "Routine: Moltiplica Floating Point FAC=FAC*10"; case 0xBAF9: return "BASIC: Costante 10 in Flpt"; case 0xBAFE: return "Routine: Divisione Floating Point FAC=FAC/10"; case 0xBB0F: return "Routine: Divisione Floating Point FAC=constante (YA)/FAC"; case 0xBB14: return "Routine: Divisione Floating Point FAC=ARG/FAC"; case 0xBB8A: return "Routine: Stampa DIVISION BY ZERO"; case 0xBBA2: return "Routine: Trasferisce costante (YA) in Floating Point"; case 0xBBC7: return "Routine: Floating Point in accu #4 ($5C fino a $60) "; case 0xBBCA: return "Routine: Floating Point in accu #3 ($57 fino a $5B)"; case 0xBBD0: return "Routine: Floating Point to variaile (nell'indirizzo puntato da $49)"; case 0xBBFC: return "Routine: ARG in Floating Point"; case 0xBC0C: return "Routine: Floating Point (arrotondato) in ARG"; case 0xBC1B: return "Routine: Arrotonda Floating Point"; case 0xBC2B: return "Routine: Determina (segno) se numero =0 (ZF) o +/- (CF)"; case 0xBC39: return "Routine: Funzione SGN"; case 0xBC58: return "Routine: Funzione ABS"; case 0xBC5B: return "Routine: confronta costante (YA) con Floating Point: A=0 se uguali, A=1 se FAC più grande, A=$FF se FAC più piccolo"; case 0xBC9B: return "Routine: converte Floating Point in intero a 4-byte"; case 0xBCCC: return "Routine: Funzione INT"; case 0xBDB3: return "BASIC: Costante 9999999.9"; case 0xBDB8: return "BASIC: Costante 99999999"; case 0xBDBD: return "BASIC: Costante 1000000000"; case 0xBDC2: return "Routine: Stampa 'IN' + linea basic"; case 0xBDCD: return "Routine: Stampa stringa corrispondente intero (AX)"; case 0xBDDA: return "Routine: Stampa stringa (YA=pointer)"; case 0xBDDD: return "Routine: Converte Floating Point in stringa PETSCII che inizia (YA) con $0100 e termina con $00"; case 0xBE68: return "Routine: Converte TI in stinga PETSCII che inzia con $0100 e termina con $00"; case 0xBF11: return "BASIC: Costante 0.5"; case 0xBF16: return "BASIC: Tabella costanti per convertire gli interi inPETSCII"; case 0xBF3A: return "BASIC: Tabella costanti per convertire TI in TI$"; case 0xBF71: return "Routine: Funzione SQR"; case 0xBF78: return "Routine: funzione potenza Floating Point = ARG elevato a una constante (AY)"; case 0xBF7B: return "Routine: funzione potenza Floating Point = ARG elevato a FAC"; case 0xBFB4: return "Routine: rende nergativo Floating Point"; case 0xBFBF: return "BASIC: Costante 1.44269504 = 1/LOG(2)"; case 0xBFC4: return "BASIC: Costante 07: 7 = Gradeo del polinomio"; case 0xBFC5: return "BASIC: Costante 2.149875 E-5"; case 0xBFCA: return "BASIC: Costante 1.435231 E-4"; case 0xBFCF: return "BASIC: Costante 1.342263 E-3"; case 0xBFD9: return "BASIC: Costante 9.641017 E-3"; case 0xBFDE: return "BASIC: Costante 2.402263 E-4"; case 0xBFE3: return "BASIC: Costante 6.931471 E-1"; case 0xBFE8: return "BASIC: Costante 1.00"; case 0xBFED: return "Routine: Funzione EXP"; case 0xD000: return "Posizione X sprite 0"; case 0xD001: return "Posizione Y sprite 0"; case 0xD002: return "Posizione X sprite 1"; case 0xD003: return "Posizione Y sprite 1"; case 0xD004: return "Posizione X sprite 2"; case 0xD005: return "Posizione Y sprite 2"; case 0xD006: return "Posizione X sprite 3"; case 0xD007: return "Posizione Y sprite 3"; case 0xD008: return "Posizione X sprite 4"; case 0xD009: return "Posizione Y sprite 4"; case 0xD00A: return "Posizione X sprite 5"; case 0xD00B: return "Posizione Y sprite 5"; case 0xD00C: return "Posizione X sprite 6"; case 0xD00D: return "Posizione Y sprite 6"; case 0xD00E: return "Posizione X sprite 7"; case 0xD00F: return "Posizione Y sprite 7"; case 0xD010: return "Posizione X MSB sprites 0..7"; case 0xD011: return "Registro di controllo del VIC"; case 0xD012: return "Lettura/Scrittura del valore di quadro per IRQ"; case 0xD013: return "Posizione X del \"latch\" penna ottica"; case 0xD014: return "Posizione Y del \"latch\" penna ottica"; case 0xD015: return "Abilitatore Sprites"; case 0xD016: return "Registro di controllo del VIC"; case 0xD017: return "Espansione (2X) verticale (Y) sprite 0..7"; case 0xD018: return "Registro di controllo della memoria del VIC"; case 0xD019: return "Registro indicatore di interruzione"; case 0xD01A: return "Registro maschera IRQ"; case 0xD01B: return "Priorità di schermo sprite-fondo"; case 0xD01C: return "Seleziona il modo multicolore per sprite 0..7"; case 0xD01D: return "Espansione (2X) orrizzontale (X) sprite 0..7"; case 0xD01E: return "Scoperta contatto fra due animazioni"; case 0xD01F: return "Scoperta di contatto animazione-fondo"; case 0xD020: return "Colore del bordo"; case 0xD021: return "Colore di fondo 0"; case 0xD022: return "Colore di fondo 1"; case 0xD023: return "Colore di fondo 2"; case 0xD024: return "Colore di fondo 3"; case 0xD025: return "Registro 0 animazione multicolore"; case 0xD026: return "Registro 1 animazione multicolore"; case 0xD027: return "Colore sprite 0"; case 0xD028: return "Colore sprite 1"; case 0xD029: return "Colore sprite 2"; case 0xD02A: return "Colore sprite 3"; case 0xD02B: return "Colore sprite 4"; case 0xD02C: return "Colore sprite 5"; case 0xD02D: return "Colore sprite 6"; case 0xD02E: return "Colore sprite 7"; case 0xD400: return "Voce 1: Controllo frequenza (byte basso)"; case 0xD401: return "Voce 1: Controllo frequenza (byte alto)"; case 0xD402: return "Voce 1: Ampiezza forma d'onda pulsazione (byte basso)"; case 0xD403: return "Voce 1: Ampiezza forma d'onda pulsazione (semibyte alto)"; case 0xD404: return "Voce 1: Registri di controllo"; case 0xD405: return "Generatore 1 invilutto: Attack/Decay"; case 0xD406: return "Generatore 1 invilutto: Sustain/Release"; case 0xD407: return "Voce 2: Controllo frequenza (byte basso)"; case 0xD408: return "Voce 2: Controllo frequenza (byte alto)"; case 0xD409: return "Voce 2: Ampiezza forma d'onda pulsazione (byte basso)"; case 0xD40A: return "Voce 2: Ampiezza forma d'onda pulsazione (semibyte alto)"; case 0xD40B: return "Voce 2: Registri di controllo"; case 0xD40C: return "Generatore 2 inviluppo: Attack/Decay"; case 0xD40D: return "Generatore 2 inviluppo: Sustain/Release"; case 0xD40E: return "Voce 3: Controllo frequenza (byte basso)"; case 0xD40F: return "Voce 3: Controllo frequenza (byte alto)"; case 0xD410: return "Voce 3: Ampiezza forma d'onda pulsazione (byte basso)"; case 0xD411: return "Voce 3: Ampiezza forma d'onda pulsazione (semibyte alto)"; case 0xD412: return "Voce 3: Registri di controllo"; case 0xD413: return "Generatore 3 inviluppo: Attack/Decay"; case 0xD414: return "Generatore 3 inviluppo: Sustain/Release"; case 0xD415: return "Frequenza di taglio del filtro: semibyte basso (bit 2-0)"; case 0xD416: return "Frequenza di taglio del filtro: semibyte alto"; case 0xD417: return "Controllo risonanza filtro/Controllo ingresso voce"; case 0xD418: return "Seleziona modo e volume del filtro"; case 0xD419: return "Convertitore analogico/digitale: Paddle 1"; case 0xD41A: return "Convertitore analogico/digitale: Paddle 2"; case 0xD41B: return "Generatore numeri casuali oscillatore 3"; case 0xD41C: return "Uscita generatore dell'inviluppo"; case 0xDC00: return "Porta dati A #1: tastiera, joystick, paddle, penna ottica"; case 0xDC01: return "Porta dati B #1: tastiera, joystick, paddle"; case 0xDC02: return "Registro direzione dati porta A #1"; case 0xDC03: return "Registro direzione dati porta B #1"; case 0xDC04: return "Timer A #1: Byte basso"; case 0xDC05: return "Timer A #1: Byte alto"; case 0xDC06: return "Timer B #1: Byte basso"; case 0xDC07: return "Timer B #1: Byte alto"; case 0xDC08: return "Clock tempo del giorno #1: Decimi di secondo"; case 0xDC09: return "Clock tempo del giorno #1: Secondi"; case 0xDC0A: return "Clock tempo del giorno #1: Minuti"; case 0xDC0B: return "Clock tempo del giorno #1: Ore+[indicatore AM/PM]"; case 0xDC0C: return "Buffer dati I/O seriale sincrono #1"; case 0xDC0D: return "Registro controllo interruzioni CIA #1"; case 0xDC0E: return "Registro A di controllo del CIA #1"; case 0xDC0F: return "Registro B di controllo del CIA #1"; case 0xDD00: return "Porta dati A #2: bus seriale, RS-232, memoria VIC"; case 0xDD01: return "Porta dati B #2: porta utente, RS-232"; case 0xDD02: return "Registro direzione dati porta A #2"; case 0xDD03: return "Registro direzione dati porta B #2"; case 0xDD04: return "Timer A #2: Byte basso"; case 0xDD05: return "Timer A #2: Byte alto"; case 0xDD06: return "Timer B #2: Byte basso"; case 0xDD07: return "Timer B #2: Byte alto"; case 0xDD08: return "Clock tempo del giorno #2: Decimi di secondo"; case 0xDD09: return "Clock tempo del giorno #2: Secondi"; case 0xDD0A: return "Clock tempo del giorno #2: Minuti"; case 0xDD0B: return "Clock tempo del giorno #2: Ore+[indicatore AM/PM]"; case 0xDD0C: return "Buffer dati I/O seriale sincrono #2"; case 0xDD0D: return "Registro controllo interruzioni CIA #2"; case 0xDD0E: return "Registro A di controllo del CIA #2"; case 0xDD0F: return "Registro B di controllo del CIA #2"; case 0xE097: return "Routine: Funzione RND"; case 0xE10C: return "Routine: Immette un carattere nel canale + errori BASIC"; case 0xE112: return "Routine: Accetta un carattere dal canale+ errori BASIC"; case 0xE118: return "Routine: Apre il canale di output + errori BASIC"; case 0xE11E: return "Routine: Apre il canale di input + errori BASIC"; case 0xE124: return "Routine: Prende il carat. dal buffer tast.+ errori BASIC"; case 0xE12A: return "Routine: Istruzione SYS"; case 0xE147: return "Routine: Salva stato corrente 6502"; case 0xE156: return "Routine: Istruzione SAVE"; case 0xE165: return "Routine: Istruzione VERIFY"; case 0xE168: return "Routine: Istruzione LOAD"; case 0xE1C7: return "Routine: Istruzione CLOSE"; case 0xE1D4: return "Routine: Istruzione OPEN assumendo Datasette=default"; case 0xE1DD: return "Routine: Istruzione OPEN"; case 0xE206: return "Routine: Legge prossimo carattere, se=0 => PLA,PLA"; case 0xE20E: return "Routine: Verifica se c'� ',' e legge prossimo (Syntax)"; case 0xE211: return "Routine: Legge prossimo carattere, se =0 =>syntax error"; case 0xE264: return "Routine: Funzione COS"; case 0xE26B: return "Routine: Funzione SIN"; case 0xE2B4: return "Routine: Funzione TAN"; case 0xE30E: return "Routine: Funzione ATN"; case 0xE37B: return "Routine (di case 0xA002): chiude canali, partenza a caldo"; case 0xE386: return "Routine: Stampa READY+ partenza a caldo (da case 0x300)"; case 0xE38B: return "Routine: Stampa i messaggi di errore del BASIC"; case 0xE394: return "Routine (di case 0xA000): imposta vet. Basic e stampa inizio"; case 0xE3A2: return "Routine che viene copiata in case 0x73..case 0x8A"; case 0xE3BF: return "Routine: imposta istruz. USR e memoria per BASIC"; case 0xE422: return "Routine: Stampa messaggi iniziali + set della memoria"; case 0xE453: return "Routine: imposta vettori per BASIC (case 0x300..case 0x309)"; case 0xE4AD: return "Routine: Apre il canale di output + errori"; case 0xE4D3: return "Routine: Aggiorna controllo bit partenza/parità"; case 0xE4DA: return "Routine: Pone il colore al carattere corrente"; case 0xE4E0: return "Routine: Attende alcuni secondi o pressione tasto"; case 0xE500: return "Routine IOBASE del KERNAL"; case 0xE505: return "Routine SCREEN del KERNAL"; case 0xE50A: return "Routine PLOT del KERNAL"; case 0xE518: return "Routine: Predispone editor/cancella schermo"; case 0xE544: return "Routine: Cancella schermo"; case 0xE566: return "Routine: Riporta cursore in altro a sinistra"; case 0xE56C: return "Routine: Goto X=linea, Y=col. del cursore"; case 0xE5A0: return "Routine: Setta registri VIC6567 e dispositivi"; case 0xE5BA: return "Routine: Legge carattere dal buffer tastiera"; case 0xE632: return "Routine: Preleva un carattere dalla tastiera (CRT-Video)"; case 0xE68A: return "Routine: Attiva/Disattiva Editor modo \"quote\""; case 0xE716: return "Routine: Invia un carattere sullo schermo"; case 0xE87C: return "Routine: Aggiorna schermo come per RETURN"; case 0xE891: return "Routine: Aggiorna schermo/editor perchè premuto RETURN"; case 0xE8CD: return "Routine: Cerca (e cambia) codici Ascii colori"; case 0xE8EA: return "Routine: Scorrimento schermo verso l'alto per nuova riga"; case 0xE9F0: return "Routine: Calcola indirizzo di linea schermo corrente"; case 0xE9FF: return "Routine: Stampa messaggi iniziali + set della memoria"; case 0xEA13: return "Routine: Stampa carattere sul cursore (con parametri)"; case 0xEA24: return "Routine: Calcola puntatore locazione RAM colore"; case 0xEA31: return "Default hardware interrupt (IRQ)"; case 0xEA87: return "Routine SCNKEY del KERNAL"; case 0xEC44: return "Routine: Controlla passaggio negativo/maiuscolo/SHIFT"; case 0xED09: return "Routine TALK del KERNAL"; case 0xED0C: return "Routine LISTEN del KERNAL"; case 0xED40: return "Routine: Invia un byte nel bus seriale"; case 0xEDB9: return "Routine SECOND del KERNAL"; case 0xEDC7: return "Routine TKSA del KERNAL"; case 0xEDDD: return "Routine CIOUT del KERNAL"; case 0xEDEF: return "Routine UNTLK del KERNAL"; case 0xEDFE: return "Routine UNLSN del KERNAL"; case 0xEE13: return "Routine ACPTR del KERNAL"; case 0xEE85: return "Routine: Azzera uscita pulsazione clock bus seriale"; case 0xEE8E: return "Routine: Setta uscita pulsazione clock bus seriale"; case 0xEE97: return "Routine: Azzera uscita dati bus seriale"; case 0xEEA0: return "Routine: Setta uscita dati bus seriale"; case 0xEEA9: return "Routine: Legge nel C ingresso dati bus seriale"; case 0xEEB3: return "Routine: Ritardo di 931 cicli di clock"; case 0xF00D: return "Routine: Immagine registro di stato 6551 = case 0x40"; case 0xF086: return "Routine: prende carattere dal RS-232"; case 0xF0A4: return "Routine: Controlla per disabilitazione RS-232"; case 0xF12B: case 0xF12C: case 0xF12D: case 0xF12E: case 0xF12F: return "Routine: Stampa stringa relativa all'I/O"; case 0xF13E: return "Routine GETIN del KERNAL"; case 0xF14E: return "Routine: Prende carattere dal RS-232/Memoria registro"; case 0xF157: return "Routine CHRIN del KERNAL"; case 0xF199: return "Routine: Preleva carattere dal nastro"; case 0xF1AD: return "Routine: Preleva carattere dal bus seriale"; case 0xF1B8: return "Routine: Prende char dal RS-232/Immagine registro"; case 0xF1CA: return "Routine CHROUT del KERNAL"; case 0xF1DD: return "Routine: Invia un carattere su nastro (usa buffer)"; case 0xF20E: return "Routine CHKIN del KERNAL"; case 0xF250: return "Routine CHKOUT del KERNAL"; case 0xF291: return "Routine CLOSE del KERNAL"; case 0xF2EE: return "Routine: Indirizza dispositivo/Riorganizza tabella"; case 0xF2F1: return "Routine: Riorganizza tabella file per chiusura"; case 0xF2F2: return "Routine: Riorganizza tabella file per chiusura (A=par.)"; case 0xF30F: return "Routine: Cerca indice tabella (X) del file (X=n°file)"; case 0xF314: return "Routine: Cerca indice tabella (X) del file (A=n°file)"; case 0xF31F: return "Routine: Rende il file all'indirizzo X attivo"; case 0xF32F: return "Routine CLALL del KERNAL"; case 0xF333: return "Routine CLRCHN del KERNAL"; case 0xF34A: return "Routine OPEN del KERNAL"; case 0xF3D5: return "Routine: Invia il nome del file sul bus seriale"; case 0xF47D: return "Routine: Fissa Cima memoria per Sistema Operativo (C=0)"; case 0xF49E: return "Routine LOAD del KERNAL"; case 0xF4A5: return "Default routine LOAD del KERNAL"; case 0xF5AF: return "Routine: Stampa SEARCHING FOR nome file"; case 0xF5C1: return "Routine: Stampa nome file corrente"; case 0xF5D2: return "Routine: Stampa stringa LOADING/VERIFING"; case 0xF5DD: return "Routine SAVE del KERNAL"; case 0xF5ED: return "Default routine SAVE del KERNAL"; case 0xF633: return "Routine: Indirizza il dispositivo con il comando (C=1)"; case 0xF642: return "Routine: Indirizza il dispositivo con il comando"; case 0xF654: return "Routine: Imposta il bus seriale a non-ricevente"; case 0xF68F: return "Routine: Stampa SAVING nome file"; case 0xF69B: return "Routine UDTIM del KERNAL"; case 0xF6BC: return "Routine: Verifica pressione tasti STOP/RVS"; case 0xF6DD: return "Routine RDTIM del KERNAL"; case 0xF6EA: return "Routine SETTIM del KERNAL"; case 0xF6FB: return "Routine: Chiude tutti canali I/O e Stampa I/O ERROR 1"; case 0xF6FE: return "Routine: Chiude tutti canali I/O e Stampa I/O ERROR 2"; case 0xF701: return "Routine: Chiude tutti canali I/O e Stampa I/O ERROR 3"; case 0xF704: return "Routine: Chiude tutti canali I/O e Stampa I/O ERROR 4"; case 0xF707: return "Routine: Chiude tutti canali I/O e Stampa I/O ERROR 5"; case 0xF70A: return "Routine: Chiude tutti canali I/O e Stampa I/O ERROR 6"; case 0xF70D: return "Routine: Chiude tutti canali I/O e Stampa I/O ERROR 7"; case 0xF710: return "Routine: Chiude tutti canali I/O e Stampa I/O ERROR 8"; case 0xF713: return "Routine: Chiude tutti canali I/O e Stampa I/O ERROR 9"; case 0xF72C: return "Routine: Cerca/verifica valido file intestazione nastro"; case 0xF76A: return "Routine: Scrive Header per il file (indirizzi+nome)"; case 0xF7D0: return "Routine: Carica in XY il puntatore inizio buffer nastro"; case 0xF7EA: return "Routine: Confronta nome file trovato con quello cercato"; case 0xF7D7: return "Routine: Prepara indirizzi partenza I/O, fine nastro"; case 0xF80D: return "Routine: Carica in XY puntatore corrente buffer nastro"; case 0xF817: return "Routine: Attesa (stampa) di PRESS PLAY cassetta"; case 0xF82E: return "Routine: Lettura interruttore cassetta (Z=presente)"; case 0xF838: return "Routine: Attesa (stampa) di PRESS RECORD & PLAY cassetta"; case 0xF841: return "Routine: Legge blocco dati da nastro"; case 0xF84A: return "Routine: Legge blocco dati da nastro (no indirizzi)"; case 0xF864: return "Routine: Scrive blocco dati su nastro+ inizializzazione"; case 0xF867: return "Routine: Scrive blocco dati su nastro (tipo #14)"; case 0xF86B: return "Routine: Scrive blocco dati su nastro"; case 0xF8D0: return "Routine: Verifica per spegnere motore (e normali IRQ)"; case 0xF92C: return "Routine IRQ cassetta per LOAD"; case 0xFB8E: return "Routine: Setta ^Buffer nastro a ^Ind. partenza I/O"; case 0xFB97: return "Routine: Inizializza/Azzera variabili per cassetta"; case 0xFBA6: return "Routine: Predispone TimerB #1 in base al bit di out"; case 0xFBAD: return "Routine: Attiva Timer B #1(176c) e inverte uscita tape"; case 0xFBAF: return "Routine: Attiva Timer B #1(A=par) e inverte uscita tape"; case 0xFBB1: return "Routine: Attiva Timer B #1(AX=par) e inverte uscita tape"; case 0xFC57: return "Routine: Cambia vettore IRQ a FC6A"; case 0xFC93: return "Routine: Spegne motore, disabilita int. CIA #1"; case 0xFCB8: return "Routine: Spegne motore, disab. int. CIA #1, esce int."; case 0xFCBD: return "Routine: Cambia vettore IRQ per l'I/O"; case 0xFCCA: return "Routine: Spegne motore registratore"; case 0xFCD1: return "Routine: Controlla se ^Buffer nastro=ind. fine nastro"; case 0xFCDB: return "Routine: Avanza punt. Buffer nastro/Scor. schermo"; case 0xFCE2: return "Routine: Startup"; case 0xFD02: return "Routine: Cerca presenza cartuccia"; case 0xFD15: return "Routine RESTOR del KERNAL"; case 0xFD1A: return "Routine VECTOR del KERNAL"; case 0xFD50: return "Routine RAMTAS del KERNAL"; case 0xFDAE: return "Routine IOINIT del KERNAL"; case 0xFFDD: return "Routine: Predispone Timer A #1 a 16,7msec, Int. e PB6"; case 0xFDF9: return "Routine SETNAME del KERNAL"; case 0xFE00: return "Routine SETLFS del KERNAL"; case 0xFE07: return "Routine READST del KERNAL"; case 0xFE18: return "Routine SETMSG del KERNAL"; case 0xFE1C: return "Routine: Cambia (attiva) stato ST dell'I/O KERNAL"; case 0xFE21: return "Routine SETTMO del KERNAL"; case 0xFE25: return "Routine MEMTOP del KERNAL"; case 0xFE27: return "Routine: XY= Cima della memoria per Sistema Operativo"; case 0xFE2D: return "Routine: Fissa Cima memoria per Sistema Operativo"; case 0xFE34: return "Routine MEMBOT del KERNAL"; case 0xFE43: return "Routine: Non Maskerable Interrupt (NMI)"; case 0xFE47: return "Default Non maskerable Interrupt (NMI)"; case 0xFEBC: return "Ripristina registri processore e esce da interrupt"; case 0xFEC2: case 0xFEC3: case 0xFEC4: return "Costanti per sistema NTSC"; case 0xFF2E: return "Routine: Aggiorna Baud Rate dell'RS-232"; case 0xFF43: return "Routine: Esegue NMI Interrupt Routine (^return in stack)"; case 0xFF48: return "Masckerable Interrupt (IRQ) Routine"; case 0xFF5B: return "Routine CINT del KERNAL"; case 0xFF6E: return "Routine: Abilita Int. Timer #1 e uscita PB6"; case 0xFF81: return "Routine: Inizializza l'editor di schermo"; case 0xFF84: return "Routine: Inizializza l'I/O"; case 0xFF87: return "Routine: Inizializza RAM/ crea buffer nastro/schermo case 0x0400"; case 0xFF8A: return "Routine: Ripristina il vettore di default di I/O"; case 0xFF8D: return "Routine: Legge/Imposta il vettore di I/O"; case 0xFF90: return "Routine: Controlla i messaggi del KERNAL"; case 0xFF93: return "Routine: Invia l'indirizzo secondario dopo RICEZIONE"; case 0xFF96: return "Routine: Invia l'indirizzo secondario dopo TRASMISSIONE"; case 0xFF99: return "Routine: Legge/Imposta la cima della memoria"; case 0xFF9C: return "Routine: Legge/Imposta la base della memoria"; case 0xFF9F: return "Routine: Fa la scansione della tastiera"; case 0xFFA2: return "Routine: Imposta il supero tempo sul bus seriale"; case 0xFFA5: return "Routine: Accetta un byte dalla porta seriale"; case 0xFFA8: return "Routine: Trasferisce un byte alla porta seriale"; case 0xFFAB: return "Routine: Imposta il bus seriale a NON-TRASMITTENTE"; case 0xFFAE: return "Routine: Imposta il bus seriale a NON-RICEVENTE"; case 0xFFB1: return "Routine: Dispone a RICEVERE i dispositivi sul bus seriale"; case 0xFFB4: return "Routine: Imposta a TRASMITTENTE il dispositivo bus seriale"; case 0xFFB7: return "Routine: Legge la parola di stato I/O"; case 0xFFBA: return "Routine: Imposta indirizzi primario, secondario, logico"; case 0xFFBD: return "Routine: Imposta il nome del file"; case 0xFFC0: return "Routine: Apre un file logico"; case 0xFFC3: return "Routine: Chiude un file logico specifico"; case 0xFFC6: return "Routine: Apre il canale di input"; case 0xFFC9: return "Routine: Apre il canale di output"; case 0xFFCC: return "Routine: Chiude i canali di input e di output"; case 0xFFCF: return "Routine: Accetta un carattere dal canale"; case 0xFFD2: return "Routine: Immette un carattere nel canale"; case 0xFFD5: return "Routine: Carica la RAM da un dispositivo"; case 0xFFD8: return "Routine: Salva la RAM su un dispositivo"; case 0xFFDB: return "Routine: Imposta il clock del tempo"; case 0xFFDE: return "Routine: Legge il Clock del tempo"; case 0xFFE1: return "Routine: Termina la scansione della tastiera"; case 0xFFE4: return "Routine: Prende il carattere dal buffer tastiera"; case 0xFFE7: return "Routine: Chiude tutti i canali ed i files"; case 0xFFEA: return "Routine: Incrementa il clock del tempo"; case 0xFFED: return "Routine: Ritorna il sistema di coordinate (X,Y) schermo"; case 0xFFF0: return "Routine: Legge/Imposta la posizione (X,Y) del cursore"; case 0xFFF3: return "Routine: Ritorna l'indirizzo di base degli I/O"; case 0xFFFA: return "Non Maskerable Interrupt (NMI) vector"; case 0xFFFC: return "Startup vector"; case 0xFFFE: return "Masckerable Interrupt (IRQ) vector"; default: if ((addr>=0x4E) && (addr<=0x53)) return "Scratch area"; if ((addr>=0x57) && (addr<=0x60)) return "Scratch per operazioni numeriche"; if ((addr>=0x73) && (addr<=0x8A)) return "CHRGET (immette un carattere) subroutine"; if ((addr>=0xD9) && (addr<=0xF0)) return "Tavola delle linea di schermo/Editor transiente"; if ((addr>=0x100) && (addr<=0x10A)) return "CPU stack/Errore nastro/area conversione floating"; if ((addr>=0x10B) && (addr<=0x13E)) return "CPU stack/Errore di nastro"; if ((addr>=0x13F) && (addr<=0x1FF)) return "CPU stack"; if ((addr>=0x200) && (addr<=0x258)) return "Buffer di INPUT del BASIC"; if ((addr>=0x259) && (addr<=0x262)) return "Tabella KERNAL: Numero file logici attivi"; if ((addr>=0x263) && (addr<=0x26C)) return "Tabella KERNAL: Numero dispositivo per ogni file"; if ((addr>=0x26D) && (addr<=0x276)) return "Tabella KERNAL: Indirizzo secondario di ogni file"; if ((addr>=0x277) && (addr<=0x280)) return "Coda del buffer della tastiera (FIFO)"; if ((addr>=0x2A7) && (addr<=0x2FF)) return "Non usato"; if ((addr>=0x334) && (addr<=0x33B)) return "Non usato"; if ((addr>=0x33C) && (addr<=0x3FB)) return "Buffer di I/O del nastro"; if ((addr>=0x3FC) && (addr<=0x3FF)) return "Non usato"; if ((addr>=0x400) && (addr<=0x7E7)) return "Matrice video (25*40)"; if ((addr>=0x7E8) && (addr<=0x7FF)) return "Puntatore ai dati animazione"; if ((addr>=0x800) && (addr<=0x7FFF)) return "Spazio normale programmi BASIC"; if ((addr>=0x8000) && (addr<=0x9FFF)) return "Spazio normale programmi BASIC/ROM cartuccia"; if ((addr>=0xA000) && (addr<=0xBFFF)) return "ROM BASIC"; if ((addr>=0xD500) && (addr<=0xD7FF)) return "IMMAGINI del SID"; if ((addr>=0xD800) && (addr<=0xDBFF)) return "RAM colore"; if ((addr>=0xE4EC) && (addr<=0xE4FE)) return "Costanti per sistema PAL"; break; } default: switch ((int)addr) { case 0x01: return "6510 I/O register"; case 0x03: case 0x04: return "Jump Vector: real-integer conversion"; case 0x05: case 0x06: return "Jump Vector: integer-real conversion"; case 0x07: return "Search char"; case 0x08: return "Flag: search the quotation marks at the end of one string"; case 0x09: return "Screen column after last TAB"; case 0x0A: return "Flag: 0=LOAD, 1=VERIFY"; case 0x0B: return "Buffer pointer of input/number index"; case 0x0C: return "Flag: default dimension for DIM"; case 0x0D: return "Data type: case 0xFF=Stringa, case 0x00=Numerico"; case 0x0E: return "Data type: case 0x80=Intero, case 0x00=Reale"; case 0x0F: return "Flag for DATA/LIST"; case 0x10: return "Flag: Index/Call reference of user function"; case 0x11: return "Flag: case 0x00=INPUT, case 0x40=GET, case 0x98=READ"; case 0x12: return "Flag: TAN/Result symbol of one comparison"; case 0x13: return "Flag: INPUT request"; case 0x14: case 0x15: return "Transient: integer value"; case 0x16: return "Pointer: transient strings stack"; case 0x17: case 0x18: return "Last transient strings address"; case 0x19: case 0x20: case 0x21: return "Transient strings stack"; case 0x22: case 0x23: case 0x24: case 0x25: return "Utility programs pointers area"; case 0x26: case 0x27: case 0x28: case 0x29: case 0x2A: return "Real product"; case 0x2B: case 0x2C: return "Pointer: BASIC starting programs"; case 0x2D: case 0x2E: return "Pointer: BASIC starting variables"; case 0x2F: case 0x30: return "Pointer: BASIC starting arrays"; case 0x31: case 0x32: return "Pointer: BASIC ending arrays"; case 0x33: case 0x34: return "Pointer: BASIC starting strings"; case 0x35: case 0x36: return "Pointer: strings for auxiliari programs"; case 0x37: case 0x38: return "Pointer: BASIC ending memory"; case 0x39: case 0x3A: return "BASIC current line number"; case 0x3B: case 0x3C: return "BASIC precedent line number"; case 0x3D: case 0x3E: return "Pointer: BASIC instruction for CONT"; case 0x3F: case 0x40: return "DATA current line number"; case 0x41: case 0x42: return "Pointer: DATA current element address"; case 0x43: case 0x44: return "Vector: INPUT routine"; case 0x45: case 0x46: return "BASIC current variable name"; case 0x47: case 0x48: return "Pointer: BASIC current variable data"; case 0x49: case 0x4A: return "Pointer: variable for the FOR..NEXT"; case 0x4B: case 0x4C: return "Scratch area BASIC pointer"; case 0x4D: return "Accumulator for the simbols compare"; case 0x54: case 0x55: case 0x56: return "Vector of jump fusion"; case 0x61: return "Floating point accumulator #1: Exponent"; case 0x62: case 0x63: case 0x64: case 0x65: return "Floating point accumulator #1: Mantissa"; //? case 0x66: return "Floating point accumulator #1: Sign"; case 0x67: return "Pointer: costant of series valutation"; case 0x68: return "Floating point accumulator #1: Overflow numeral"; case 0x69: return "Floating point accumulator #2: Exponent"; case 0x6A: case 0x6B: case 0x6C: case 0x6D: return "Floating point accumulator #2: Mantissa"; //? case 0x6E: return "Floating point accumulator #2: Sign"; case 0x6F: return "Sign comparison result of #1 with #2"; case 0x70: return "Lo Byte #1 (rounding)"; case 0x71: case 0x72: return "Pointer: cassette buffer"; case 0x8B: case 0x8C: case 0x8D: case 0x8E: case 0x8F: return "Real value of the RND seed"; case 0x90: return "Statusbyte ST of I/O KERNAL"; case 0x91: return "Flag: key STOP/ key RVS"; case 0x92: return "Constant (timeout) of time misure for tape"; case 0x93: return "Flag: 0=LOAD, 1=VERIFY"; case 0x94: return "Flag: Serail Bus - Bufferized char in out"; case 0x95: return "Bufferized cahr for serial bus"; case 0x96: return "Number (EOT) of cassette sincronism"; case 0x97: return "Memory of register"; case 0x98: return "Open files number/Index of files table"; case 0x99: return "Input device (default=0)"; case 0x9A: return "Output device (CMD=3)"; case 0x9B: return "Parity tape char"; case 0x9C: return "Flag: Byte received from tape"; case 0x9D: return "Flag: 80=direct mode 00=program mode"; case 0x9E: return "Tape pass 1 error register"; case 0x9F: return "Tape pass 2 error register"; case 0xA0: case 0xA1: case 0xA2: return "Real time clock HMS (1/60 sec)"; case 0xA3: return "Serial counter of bits: Flag EOI"; case 0xA4: return "Cicly of counter"; case 0xA5: return "Bashful counter of Write cassette sincronization"; case 0xA6: return "Pointer: I/O Buffer of tape"; case 0xA7: return "Input bit of RS-232/Transient cassette"; case 0xA8: return "RS-232 input bits counter/Transient cassette"; case 0xA9: return "RS-232 indicator: Control of starting bit"; case 0xAA: return "Buffer for RS-232 input byte/Transient cassette"; case 0xAB: return "RS-232 input parity/Cassette short counter"; case 0xAC: case 0xAD: return "Pointer: Tape buffer/Screen scrolling"; case 0xAE: case 0xAF: return "Addresses of Tape end/Program end"; case 0xB0: case 0xB1: return "Constant of tape time misure"; case 0xB2: case 0xB3: return "Pointer: starting tape buffer"; case 0xB4: return "RS-232 output bits counter/Tape timer"; case 0xB5: return "Next RS-232 bit to send/tape EOT"; case 0xB6: return "Buffer of RS-232 output byte"; case 0xB7: return "Length of current file name"; case 0xB8: return "Current logical file number"; case 0xB9: return "Current secondary address"; case 0xBA: return "Current device number"; case 0xBB: case 0xBC: return "Pointer: current file name"; case 0xBD: return "RS-232 output parity/Transient cassette"; case 0xBE: return "Read/Write cassette block counter"; case 0xBF: return "Serial word Buffer"; case 0xC0: return "Stop motor of tape"; case 0xC1: case 0xC2: return "I/O starting address"; case 0xC3: case 0xC4: return "Transient tape load"; case 0xC5: return "Key current handled: CHRcase 0x(n) 0=no key"; case 0xC6: return "Number of char in keyboard buffer"; case 0xC7: return "Flag: Write inverse chars: 1=yes 0=not used"; case 0xC8: return "Pointer: end of logical line for INPUT"; case 0xC9: case 0xCA: return "Position (X,Y) of cursor"; case 0xCB: return "Flag: write chars with SHIFT pressed"; case 0xCC: return "Flash state: 0=flashing"; case 0xCD: return "Timer: countdown for cursor changing"; case 0xCE: return "Char under the cursor"; case 0xCF: return "Flag: Last cursore state (Flash/fixed)"; case 0xD0: return "Flag: INPUT or GET from keyboard"; case 0xD1: case 0xD2: return "Pointer: current screen line address"; case 0xD3: return "Column of cursor on the current line"; case 0xD4: return "Flag: Editor mode \"quotation\", case 0x00=NO"; case 0xD5: return "Fisical screen line length"; case 0xD6: return "Cursor line number"; case 0xD7: return "Last key/checksum/buffer"; case 0xD8: return "Flag: Insert mode"; case 0xF1: return "Screen lines not thru"; case 0xF2: return "Label of screen lines"; case 0xF3: case 0xF4: return "Pointer: screen color RAM current location"; case 0xF5: case 0xF6: return "Vector: keyboard decode table"; case 0xF7: case 0xF8: return "RS-232 input buffer pointer"; case 0xF9: case 0xFA: return "RS-232 output buffer pointer"; case 0xFB: case 0xFE: return "Free 0 page for user program"; case 0xFF: return "Transient data area of BASIC"; case 0x281: case 0x282: return "Pointer: Memory base for Operative System"; case 0x283: case 0x284: return "Pointer: Memory top for Operative System"; case 0x285: return "Flag KERNAL: IEEE time exceed"; case 0x286: return "Current char color code"; case 0x287: return "Background color under the cursor"; case 0x288: return "Top of memory screen (page)"; case 0x289: return "Keyboard buffer misure"; case 0x28A: return "Flag: repeat pressed key, case 0x80=all keys"; case 0x28B: return "Repeat velocity counter"; case 0x28C: return "Repeat delay counter"; case 0x28D: return "Flag: Key SHIFT/CTRL/Commodore"; case 0x28E: return "Last keyboard configuration"; case 0x28F: case 0x290: return "Vector: keyboard table preparation"; case 0x291: return "Flag: mode SHIFT: 00=Disable case 0x80=Enable"; case 0x292: return "Flag: automatic shift to bottom: 0=ON"; case 0x293: return "RS-232: Control register image of 6551"; case 0x294: return "RS-232: Command register image of 6551"; case 0x295: case 0x296: return "BPS RS-232 USA not standard (Time/2-100)"; case 0x297: return "RS-232: State register image of 6551"; case 0x298: return "RS-232 bits number stayed from varied"; case 0x299: case 0x29A: return "RS-232 Baud Rate"; case 0x29B: return "RS-232 index for input buffer end"; case 0x29C: return "RS-232 input buffer beginning (page)"; case 0x29D: return "RS-232 output buffer beginning (page)"; case 0x29E: return "RS-232 index for output buffer ending"; case 0x29F: case 0x2A0: return "Contain IRQ vector during tape I/O"; case 0x2A1: return "Enable the RS-232"; case 0x2A2: return "TOD reading during I/O cassette"; case 0x2A3: return "Transient memorization for cassette reading"; case 0x2A4: return "Indicator of transient IRQ for cassette reading"; case 0x2A5: return "Transient for line index"; case 0x2A6: return "Indicator PAL/NTSC, 0=NTSC, 1=PAL"; case 0x300: case 0x301: return "Vector: Write BASIC error messages"; case 0x302: case 0x303: return "Vector: BASIC start up"; case 0x304: case 0x305: return "Vector: BASIC text\"tokenized\""; case 0x306: case 0x307: return "Vector: BASIC text list"; case 0x308: case 0x309: return "Vector: BASIC chars sending"; case 0x30A: case 0x30B: return "Vector: BASIC \"token\" valutation"; case 0x30C: return "6502 A register memorization"; case 0x30D: return "6502 X register memorization"; case 0x30E: return "6502 Y register memorization"; case 0x30F: return "6502 P register memorization"; case 0x310: return "Jump instruction of USB function"; case 0x311: case 0x312: return "Lo/Hi Byte of USB instruction"; case 0x313: return "Not used"; case 0x314: case 0x315: return "Vector: Hardware Interrupt (IRQ)"; case 0x316: case 0x317: return "Vector: Break Interrupt"; case 0x318: case 0x319: return "Vector: Not maskerable Interrupt (NMI)"; case 0x31A: case 0x31B: return "KERNAL OPEN routine vector"; case 0x31C: case 0x31D: return "KERNAL CLOSE routine vector"; case 0x31E: case 0x31F: return "KERNAL CHKIN routine vector"; case 0x320: case 0x321: return "KERNAL CHKOUT routine vector"; case 0x322: case 0x323: return "KERNAL CLRCHN routine vector"; case 0x324: case 0x325: return "KERNAL CHRIN routine vector"; case 0x326: case 0x327: return "KERNAL CHROUT routine vector"; case 0x328: case 0x329: return "KERNAL STOP routine vector"; case 0x32A: case 0x32B: return "KERNAL GETIN routine vector"; case 0x32C: case 0x32D: return "KERNAL CLALL routine vector"; case 0x32E: case 0x32F: return "User defined vector"; case 0x330: case 0x331: return "KERNAL LOAD routine vector"; case 0x332: case 0x333: return "KERNAL SAVE routine vector"; case 0xA000: return "Routine Vector: set BASIC vector and start write"; case 0xA002: return "Routine Vector: close canal, start up"; case 0xA003: case 0xA004: case 0xA005: case 0xA006: case 0xA007: case 0xA008: case 0xA009: case 0xA00A: case 0xA00B: return "Text: \"cbmbasic\""; case 0xA00C: return "BASIC: Addresses of the BASIC-commands -1 (END, FOR, NEXT, ... 35 addresses of 2 byte each)"; case 0xA052: return "BASIC: Addresses of the BASIC-Functions (SGN, INT, ABS, ... 23 addresses of 2 byte each)"; case 0xA080: return "BASIC: Hierarchy-codes and addresses of the operators -1 (10-times 1+2 Bytes)"; case 0xA09E: return "BASIC key words as string in PETSCII; Bit 7 of the last character is set"; case 0xA129: return "Routine: Keywords which have no action addresses - TAB(, TO, SPC(, ...; Bit 7 of the last character is set"; case 0xA140: return "Routine: Keywords of the operands + - * etc.; also AND, OR as strings. Bit 7 of the last character is set"; case 0xA14D: return "Routine: Keywords of the functions (SGN, INT, ABS, etc.) where bit 7 of the last character is set"; case 0xA19E: return "BASIC: Error messages (TOO MANY FILES, FILE OPEN, ... ); 29 messages where bit 7 of the last character is set"; case 0xA328: return "Routine: Pointer-table to the error messages"; case 0xA364: return "Routine: Messages of the interpreter (OK, ERROR IN, READY, BREAK)"; case 0xA38A: return "Routine: Routine to search stack for FOR-NEXT and GOSUB"; case 0xA3B8: return "Routine: Called at Basic line insertion. Checks, if enough space available. After completion, $A3BF is executed"; case 0xA3BF: return "Routine: Move bytes routine"; case 0xA3FB: return "Routine: Check for space on stack"; case 0xA408: return "Routine: Array area overflow check"; case 0xA435: return "Routine: Write error (OUT OF MEMORY)"; case 0xA437: return "Routine: Write BASIC error messages"; case 0xA43A: return "Routine: Default write BASIC error message"; case 0xA469: return "Routine: Write string (YA),+ 'IN'+line number"; case 0xA474: return "Routine: Write READY, start up"; case 0xA480: return "Routine: Input waiting loop; uses vector in ($0302) to jump to basic warm start at $A483"; case 0xA483: return "Routine: BASIC start up"; case 0xA49C: return "Routine: Delete or Insert program lines and tokenize them"; case 0xA533: return "Routine: Relink BASIC program"; case 0xA560: return "Routine: Read 89 input chars of BASIC command"; case 0xA579: return "Routine: BASIC Text \"tokenized\" (from case 0x0304)"; case 0xA57C: return "Routine: BASIC Text \"tokenized\""; case 0xA613: return "Routine: Calculate start adress of a program line"; case 0xA642: return "Routine: NEW instruction"; case 0xA65E: return "Routine: CLR instruction"; case 0xA68E: return "Routine: Set program pointer to BASIC-start (loads $7A, $7B with $2B-1, $2C-1)"; case 0xA69C: return "Routine: LIST instruction"; case 0xA717: return "Routine: Convert BASIC code to clear text; uses vector (0306) to jump to $A71A"; case 0xA71A: return "Routine: BASIC text line"; case 0xA742: return "Routine: FOR instruction"; case 0xA7AE: return "Routine: Interpreter loop, set up next statement for execution"; case 0xA7C4: return "Routine: Check for program end"; case 0xA7E4: return "Routine: Send BASIC chars"; case 0xA81D: return "Routine: RESTORE instruction"; case 0xA82F: return "Routine: STOP instruction"; case 0xA831: return "Routine: END instruction"; case 0xA857: return "Routine: CONT instruction"; case 0xA871: return "Routine: RUN instruction"; case 0xA883: return "Routine: GOSUB instruction"; case 0xA8A0: return "Routine: GOTO instruction"; case 0xA8D2: return "Routine: RETURN instruction"; case 0xA8F8: return "Routine: DATA instruction"; case 0xA906: return "Routine: Search ':' char in string (position)"; case 0xA909: return "Routine: Search 0 char in string (position)"; case 0xA928: return "Routine: IF instruction"; case 0xA93B: return "Routine: REM instruction"; case 0xA94B: return "Routine: ON instruction"; case 0xA96B: return "Routine: Get decimal number (0...63999, usually a line number) from basic text into $14/$15"; case 0xA9A5: return "Routine: LET instruction"; case 0xA9C4: return "Routine: Value assignment of integer"; case 0xA9D6: return "Routine: Value assignment of float"; case 0xA9D9: return "Routine: Value assignment of string"; case 0xA9E3: return "Routine: Assigns system variable TI$"; case 0xAA1D: return "Routine: Check for digit in string, if so, continue with $AA27"; case 0xAA27: return "Routine: Add PETSCII digit in string to float accumulator"; case 0xAA2C: return "Routine: Value assignment to string variable (LET for strings)"; case 0xAA80: return "Routine: PRINT# instruction"; case 0xAA86: return "Routine: CMD instruction"; case 0xAAA0: return "Routine: PRINT instruction"; case 0xAAB8: return "Routine: Outputs variable; Numbers will be converted into string first"; case 0xAACA: return "Routine: Put a (0) ending to the readed string"; case 0xAAD7: return "Routine: Write return effect and/or advancement"; case 0xAAF8: return "Routine: TAB( (C=1) and SPC( (C=0)"; case 0xAB1E: return "Routine: Output string, which is indicated by YA, until 0 byte or quote is found"; case 0xAB42: return "Routine: Introduces DX key in canal+ errors and char"; case 0xAB45: return "Routine: Introduces '?' in canal+ errors and char"; case 0xAB3B: return "Routine: Output of cursor right (or space if Output not on screen)"; case 0xAB3F: return "Routine: Output of a space character"; case 0xAB47: return "Routine: Introduces a char in canal+ errors and char"; case 0xAB4D: return "Routine: Output error messages of read commands (INPUT / GET / READ)"; case 0xAB7B: return "Routine: GET instruction"; case 0xABA5: return "Routine: INPUT# instruction"; case 0xABBF: return "Routine: INPUT instruction"; case 0xABEA: return "Routine: Get line into buffer"; case 0xABF9: return "Routine: Display input prompt"; case 0xAC06: return "Routine: READ instruction"; case 0xAC35: return "Routine: Input routine for GET"; case 0xACFC: return "BASIC: Messages ?EXTRA IGNORED and ?REDO FROM START, both followed by $0D (CR) and end of string $00"; case 0xAD1E: return "Routine: NEXT instruction"; case 0xAD61: return "Routine: Check for valid loop"; case 0xAD8A: return "Routine: FRMNUM: Get expression (FRMEVL) and check, if numeric"; case 0xAD8D: return "Routine: Verify if (A) data of Numerical type + error"; case 0xAD8F: return "Routine: Verify if (A) data of String type + error"; case 0xAD9E: return "Routine: FRMEVL: Analyzes any formula expression and shows syntax errors. Set type flag $0D (Number: $00, string $FF). Set integer flag $0E (float: $00, integer: $80) puts values in FAC"; case 0xAE83: return "Routine: EVAL: Get next element of an expression; uses vector ($030A) to jump to $AE86"; case 0xAE86: return "Routine: BASIC \"token\" evaluation"; case 0xAEA8: return "Routine: Value for constant PI in 5 bytes float format"; case 0xAEF1: return "Routine: Evaluates expression within brackets"; case 0xAEF7: return "Routine: Verify if there's ')' in current char (Syntax)"; case 0xAEFA: return "Routine: Verify if there's '(' in current char (Syntax)"; case 0xAEFD: return "Routine: Verify if there's ',' in current char (Syntax)"; case 0xAEFF: return "Routine: Verify if A is in current char (Syntax)"; case 0xAF08: return "Routine: Write (SYNTAX) error"; case 0xAF0D: return "Routine: Calculates NOT"; case 0xAF14: return "Routine: Check for reserved variables. Set carry flag, if FAC points to ROM. This indicates the use of one of the reserved variables TI$, TI, ST"; case 0xAF28: return "Routine: Get variable: Searches the variable list for one of the variables named in $45, $46"; case 0xAF48: return "Routine: Reads clock counter and generate string, which contains TI$"; case 0xAFA7: return "Routine: Calculate function; Determine type of function and evaluates it"; case 0xAFB1: return "Routine: Check for open bracket, get expression (FRMEVL), checks for comms, get string"; case 0xAFD1: return "Routine: Analyze numeric function"; case 0xAFE6: return "Routine: commands OR and AND, distinguished by flag $0B (= $FF at OR, $00 at AND)"; case 0xB016: return "Routine: Comparison (<, =, > )"; case 0xB01B: return "Routine: Numeric comparison"; case 0xB02E: return "Routine: String comparison"; case 0xB081: return "Routine: DIM instruction"; case 0xB08B: return "Routine: Verify if there's a variable"; case 0xB090: return "Routine: Verify if there's a variable for DIM"; case 0xB092: return "Routine: Verify if there's a variable (A=par)"; case 0xB113: return "Routine: Verify if the char in A is in 'A'..'Z'"; case 0xB11D: return "Routine: Create variable"; case 0xB194: return "Routine: Calculate pointer to first element of array"; case 0xB1A5: return "Routine: Constant -32768 as float (5 bytes)"; case 0xB1AA: return "Routine: Floating Point -> Integer conversion"; case 0xB1B2: return "Routine: Get positive integer from BASIC text"; case 0xB1BF: return "Routine: Convert FAC to integer"; case 0xB1D1: return "Routine: Get array variable from BASIC text"; case 0xB218: return "Routine: Search for array name in pointer ($45, $46)"; case 0xB245: return "Routine: Write error message (BAD SUBSCRIPT)"; case 0xB248: return "Routine: Write error message (ILLEGAL QUANTITY)"; case 0xB24D: return "Routine: Write error message (?REDIM'D ARRAY)"; case 0xB261: return "Routine: Create array variable"; case 0xB30E: return "Routine: Calculate address of a array element, set pointer ($47)"; case 0xB34C: return "Routine: Calculate distance of given array element to the one which ($47) points to and write the result to X/Y"; case 0xB37D: return "Routine: FRE function"; case 0xB391: return "Routine: Intger->Floating Point conversion"; case 0xB39E: return "Routine: POS function"; case 0xB3A2: return "Routine: Convert the byte in Y to Floating Point"; case 0xB3A6: return "Routine: Check for direct mode: value $FF in flag $3A indicates direct mode"; case 0xB3AE: return "Routine: Output error message (?UNDEF'D FUNCTION)"; case 0xB3B3: return "Routine: DEF instruction"; case 0xB465: return "Routine: STR$ function"; case 0xB475: return "Routine: Make space for inserting into string"; case 0xB487: return "Routine: Get string, pointer in YA"; case 0xB4CA: return "Routine: Store string pointer in descriptor stack"; case 0xB4F4: return "Routine: Reserve space for string, length in A"; case 0xB526: return "Routine: Garbage Collection"; case 0xB606: return "Routine: Searches n variables and arrays for string which has to be saved by the next Garbace Collection"; case 0xB63D: return "Routine: Concatenates two strings"; case 0xB67A: return "Routine: Move String to reserved area"; case 0xB6A3: return "Routine: String management FRESTR"; case 0xB6DB: return "Routine: Remove string pointer from descriptor stack"; case 0xB6EC: return "Routine: CHR$ function"; case 0xB700: return "Routine: LEFT$ function"; case 0xB72C: return "Routine: RIGTH$ function"; case 0xB737: return "Routine: MOD$ function"; case 0xB77C: return "Routine: LEN function"; case 0xB782: return "Routine: Get string parameter (length in Y), switch to numeric"; case 0xB78B: return "Routine: ASC function"; case 0xB79B: return "Routine: Holt Byte: Read and evaluate expression from BASIC text; the 1 byte value is then stored in X and in FAC+4"; case 0xB7AD: return "Routine: VAL function"; case 0xB7EB: return "Routine: GETADR and GETBYT: Get 16-bit integer (to $14, $15) and an 8 bit value (X)-parameter for WAIT and POKE"; case 0xB7F7: return "Routine: Converts FAC in 2-byte integer to $14, $15 and YA"; case 0xB80D: return "Routine: PEEK function"; case 0xB824: return "Routine: POKE instruction"; case 0xB82D: return "Routine: WAIT instruction"; case 0xB849: return "Routine: Rounding Floating Point FAC=FAC+0,5"; case 0xB850: return "Routine: Subtract Floating Point FAC=CONSTANT(YA)-FAC"; case 0xB853: return "Routine: Subtract Floating Point FAC=ARG-FAC"; case 0xB862: return "Routine: Align exponent of Floating Point and ARG for addition"; case 0xB867: return "Routine: Sum Floating Point FAC=CONSTANT(YA)+FAC"; case 0xB86A: return "Routine: Sum Floating Point FAC=ARG+FAC"; case 0xB947: return "Routine: Invert mantissa of Floating Point"; case 0xB97E: return "Routine: Write (OVERFLOW) error"; case 0xB983: return "Routine: Multiplies with one byte"; case 0xB9BC: return "BASIC: Constant 1.00 (table of constants in Mfltp-format for LOG)"; case 0xB9C1: return "BASIC: Constant 03 (grade of polynome)"; case 0xB9C2: return "BASIC: Constant 0.434255942 (1st coefficient)"; case 0xB9C7: return "BASIC: Constant 0.576584541 (2nd coefficient)"; case 0xB9CC: return "BASIC: Constant 0.961800759 (3rd coefficient)"; case 0xB9D1: return "BASIC: Constant 2.885390073 (4th coefficient)"; case 0xB9D6: return "BASIC: Constant 0.707106781 = 1/SQR(2)"; case 0xB9DB: return "BASIC: Constant 1.41421356 = SQR(2)"; case 0xB9E0: return "BASIC: Constant -0.5"; case 0xB9E5: return "BASIC: Constant 0.693147181 = LOG(2)"; case 0xB9EA: return "Routine: LOG function"; case 0xBA28: return "Routine: Multiplies Floating Point FAC=constant (YA)*FAC"; case 0xBA30: return "Routine: Multiplies Floating Point FAC=ARG*FAC"; case 0xBA59: return "Routine: Multiplies Floating Point with one byte and stores result to $26 .. $2A"; case 0xBA8C: return "Routine: ARG=constant (YA)"; case 0xBAB7: return "Routine: Checks Floating Point and ARG "; case 0xBAE2: return "Routine: Multiplication Floating Point FAC=FAC*10"; case 0xBAF9: return "BASIC: Constant 10 in Flpt"; case 0xBAFE: return "Routine: Division Floating Point FAC=FAC/10"; case 0xBB0F: return "Routine: Division Floating Point FAC=constant (YA)/FAC"; case 0xBB14: return "Routine: Division Floating Point FAC=ARG/FAC"; case 0xBB8A: return "Routine: Write DIVISION BY ZERO"; case 0xBBA2: return "Routine: Transfer constant (YA) to Floating Point"; case 0xBBC7: return "Routine: Floating Point to accu #4 ($5C to $60) "; case 0xBBCA: return "Routine: Floating Point to accu #3 ($57 to $5B)"; case 0xBBD0: return "Routine: Floating Point to variable (the adress, where $49 points to)"; case 0xBBFC: return "Routine: ARG to Floating Point"; case 0xBC0C: return "Routine: Floating Point (rounded) to ARG"; case 0xBC1B: return "Routine: Rounds Floating Point"; case 0xBC2B: return "Routine: Determine (sign) if number =0 (ZF) o +/- (CF)"; case 0xBC39: return "Routine: SGN function"; case 0xBC58: return "Routine: ABS function"; case 0xBC5B: return "Routine: Compare constant (YA) with Floating Point: A=0 if equal, A=1 if FAC greater, A=$FF if FAC smaller"; case 0xBC9B: return "Routine: Convert Floating Point to 4-byte integer"; case 0xBCCC: return "Routine: INT function"; case 0xBDB3: return "BASIC: Constant 9999999.9"; case 0xBDB8: return "BASIC: Constant 99999999"; case 0xBDBD: return "BASIC: Constant 1000000000"; case 0xBDC2: return "Routine: Write 'IN' + basic line"; case 0xBDCD: return "Routine: Write (AX) integer correspondenting string"; case 0xBDDA: return "Routine: Write (YA=pointer) string"; case 0xBDDD: return "Routine: Convert Floating Point to PETSCII string which starts (YA) with $0100 and ends with $00"; case 0xBE68: return "Routine: Convert TI to PETSCII string which starts with $0100 and ends with $00"; case 0xBF11: return "BASIC: Constant 0.5"; case 0xBF16: return "BASIC: Constant tables for integer PETSCII conversion"; case 0xBF3A: return "BASIC: Constant tables to convert TI to TI$"; case 0xBF71: return "Routine: SQR function"; case 0xBF78: return "Routine: Power function Floating Point = ARG to the power of constant (YA)"; case 0xBF7B: return "Routine: Power function Floating Point = ARG to the power of FAC"; case 0xBFB4: return "Routine: Makes Floating Point negative"; case 0xBFBF: return "BASIC: Constant 1.44269504 = 1/LOG(2)"; case 0xBFC4: return "BASIC: Constant 07: 7 = Grade of polynome"; case 0xBFC5: return "BASIC: Constant 2.149875 E-5"; case 0xBFCA: return "BASIC: Constant 1.435231 E-4"; case 0xBFCF: return "BASIC: Constant 1.342263 E-3"; case 0xBFD9: return "BASIC: Constant 9.641017 E-3"; case 0xBFDE: return "BASIC: Constant 2.402263 E-4"; case 0xBFE3: return "BASIC: Constant 6.931471 E-1"; case 0xBFE8: return "BASIC: Constant 1.00"; case 0xBFED: return "Routine: EXP function"; case 0xD000: return "Position X sprite 0"; case 0xD001: return "Position Y sprite 0"; case 0xD002: return "Position X sprite 1"; case 0xD003: return "Position Y sprite 1"; case 0xD004: return "Position X sprite 2"; case 0xD005: return "Position Y sprite 2"; case 0xD006: return "Position X sprite 3"; case 0xD007: return "Position Y sprite 3"; case 0xD008: return "Position X sprite 4"; case 0xD009: return "Position Y sprite 4"; case 0xD00A: return "Position X sprite 5"; case 0xD00B: return "Position Y sprite 5"; case 0xD00C: return "Position X sprite 6"; case 0xD00D: return "Position Y sprite 6"; case 0xD00E: return "Position X sprite 7"; case 0xD00F: return "Position Y sprite 7"; case 0xD010: return "Position X MSB sprites 0..7"; case 0xD011: return "VIC control register"; case 0xD012: return "Reading/Writing IRQ balance value"; case 0xD013: return "Positin X of optic pencil \"latch\""; case 0xD014: return "Positin Y of optic pencil \"latch\""; case 0xD015: return "Sprites Abilitator"; case 0xD016: return "VIC control register"; case 0xD017: return "(2X) vertical expansion (Y) sprite 0..7"; case 0xD018: return "VIC memory control register"; case 0xD019: return "Interrupt indicator register"; case 0xD01A: return "IRQ mask register"; case 0xD01B: return "Sprite-background screen priority"; case 0xD01C: return "Set multicolor mode for sprite 0..7"; case 0xD01D: return "(2X) horizontal expansion (X) sprite 0..7"; case 0xD01E: return "Animations contact"; case 0xD01F: return "Animation/background contact"; case 0xD020: return "Border color"; case 0xD021: return "Background 0 color"; case 0xD022: return "Background 1 color"; case 0xD023: return "Background 2 color"; case 0xD024: return "Background 3 color"; case 0xD025: return "Multicolor animation 0 register"; case 0xD026: return "Multicolor animation 1 register"; case 0xD027: return "Color sprite 0"; case 0xD028: return "Color sprite 1"; case 0xD029: return "Color sprite 2"; case 0xD02A: return "Color sprite 3"; case 0xD02B: return "Color sprite 4"; case 0xD02C: return "Color sprite 5"; case 0xD02D: return "Color sprite 6"; case 0xD02E: return "Color sprite 7"; case 0xD400: return "Voice 1: Frequency control (lo byte)"; case 0xD401: return "Voice 1: Frequency control (hi byte)"; case 0xD402: return "Voice 1: Wave form pulsation amplitude (lo byte)"; case 0xD403: return "Voice 1: Wave form pulsation amplitude (hi byte)"; case 0xD404: return "Voice 1: Control registers"; case 0xD405: return "Generator 1: Attack/Decay"; case 0xD406: return "Generator 1: Sustain/Release"; case 0xD407: return "Voice 2: Frequency control (lo byte)"; case 0xD408: return "Voice 2: Frequency control (hi byte)"; case 0xD409: return "Voice 2: Wave form pulsation amplitude (lo byte)"; case 0xD40A: return "Voice 2: Wave form pulsation amplitude (hi byte)"; case 0xD40B: return "Voice 2: Control registers"; case 0xD40C: return "Generator 2: Attack/Decay"; case 0xD40D: return "Generator 2: Sustain/Release"; case 0xD40E: return "Voice 3: Frequency control (lo byte)"; case 0xD40F: return "Voice 3: Frequency control (hi byte)"; case 0xD410: return "Voice 3: Wave form pulsation amplitude (lo byte)"; case 0xD411: return "Voice 3: Wave form pulsation amplitude (hi byte)"; case 0xD412: return "Voice 3: Control registers"; case 0xD413: return "Generator 3: Attack/Decay"; case 0xD414: return "Generator 3: Sustain/Release"; case 0xD415: return "Filter cut frequency: lo byte (bit 2-0)"; case 0xD416: return "Filter cut frequency: hi byte"; case 0xD417: return "Filter resonance control/voice input control"; case 0xD418: return "Select volume and filter mode"; case 0xD419: return "Analog/digital converter: Paddle 1"; case 0xD41A: return "Analog/digital converter: Paddle 2"; case 0xD41B: return "Random numbers generator oscillator 3"; case 0xD41C: return "Generator output"; case 0xDC00: return "Data port A #1: keyboard, joystick, paddle, optical pencil"; case 0xDC01: return "Data port B #1: keyboard, joystick, paddle"; case 0xDC02: return "Data direction register port A #1"; case 0xDC03: return "Data direction register port B #1"; case 0xDC04: return "Timer A #1: Lo Byte"; case 0xDC05: return "Timer A #1: Hi Byte"; case 0xDC06: return "Timer B #1: Lo Byte"; case 0xDC07: return "Timer B #1: Hi Byte"; case 0xDC08: return "Day time clock #1: 1/10 second"; case 0xDC09: return "Day time clock #1: Second"; case 0xDC0A: return "Day time clock #1: Minutes"; case 0xDC0B: return "Day time clock #1: Hour+[indicator AM/PM]"; case 0xDC0C: return "Serial I/O data buffer synchronous #1"; case 0xDC0D: return "Interrupt control register CIA #1"; case 0xDC0E: return "Control register A of CIA #1"; case 0xDC0F: return "Control register B of CIA #1"; case 0xDD00: return "Data port A #2: serial bus, RS-232, VIC memory"; case 0xDD01: return "Data port B #2: user port, RS-232"; case 0xDD02: return "Data direction register port A #2"; case 0xDD03: return "Data direction register port A #2"; case 0xDD04: return "Timer A #2: Lo Byte"; case 0xDD05: return "Timer A #2: Hi Byte"; case 0xDD06: return "Timer B #2: Lo Byte"; case 0xDD07: return "Timer B #2: HI Byte"; case 0xDD08: return "Day time clock #2: 1/10 second"; case 0xDD09: return "Day time clock #2: seconds"; case 0xDD0A: return "Day time clock #2: minutes"; case 0xDD0B: return "Day time clock #2: Hour+[indicator AM/PM]"; case 0xDD0C: return "Serial I/O data buffer synchronous #2"; case 0xDD0D: return "Interrupt control register CIA #2"; case 0xDD0E: return "Control register A of CIA #2"; case 0xDD0F: return "Control register B of CIA #2"; case 0xE097: return "Routine: RND function"; case 0xE10C: return "Routine: Send char in canal + BASIC errors"; case 0xE112: return "Routine: Receive a char from canal+ BASIC errors"; case 0xE118: return "Routine: Open the output canal + BASIC errors"; case 0xE11E: return "Routine: Open the input canal + BASIC errors"; case 0xE124: return "Routine: Take the char from keyboard buffer + BASIC errors"; case 0xE12A: return "Routine: SYS instruction"; case 0xE147: return "Routine: Save the current 6502 state"; case 0xE156: return "Routine: SAVE instruction"; case 0xE165: return "Routine: VERIFY instruction"; case 0xE168: return "Routine: LOAD instruction"; case 0xE1C7: return "Routine: CLOSE instruction"; case 0xE1D4: return "Routine: OPEN instruction with Datasette=default"; case 0xE1DD: return "Routine: OPEN instruction"; case 0xE206: return "Routine: Read next char, if=0 => PLA,PLA"; case 0xE20E: return "Routine: Verify if there's ',' and read next (Syntax)"; case 0xE211: return "Routine: Read next char, if =0 =>syntax error"; case 0xE264: return "Routine: COS function"; case 0xE26B: return "Routine: SIN function"; case 0xE2B4: return "Routine: TAN function"; case 0xE30E: return "Routine: ATN function"; case 0xE37B: return "Routine (from case 0xA002): close canals, start up"; case 0xE386: return "Routine: Write READY+ start up (from case 0x300)"; case 0xE38B: return "Routine: Write BASIC error messages"; case 0xE394: return "Routine (from case 0xA000): set BASIC vectors and write starting"; case 0xE3A2: return "Routine copied in case 0x73..0x8A"; case 0xE3BF: return "Routine: Set USR instruction and memory for BASIC"; case 0xE422: return "Routine: Write starting messages + set of memory"; case 0xE453: return "Routine: Set BASIC vectors (case 0x300..case 0x309)"; case 0xE4AD: return "Routine: Open output canal + errors"; case 0xE4D3: return "Routine: Update starting/parity control bit"; case 0xE4DA: return "Routine: Give color to actual char"; case 0xE4E0: return "Routine: Wait some seconds or key pressed"; case 0xE500: return "Routine IOBASE of KERNAL"; case 0xE505: return "Routine SCREEN of KERNAL"; case 0xE50A: return "Routine PLOT of KERNAL"; case 0xE518: return "Routine: Predispose editor/screen delete"; case 0xE544: return "Routine: Screen delete"; case 0xE566: return "Routine: Transfer the cursor at top left"; case 0xE56C: return "Routine: Goto X=line, Y=col. of cursore"; case 0xE5A0: return "Routine: Set VIC6567 registers and devices"; case 0xE5BA: return "Routine: Read char from keyboard buffer"; case 0xE632: return "Routine: Withdraw a char from keyboard (CRT-Video)"; case 0xE68A: return "Routine: Enable/Disable Editor mode \"quota\""; case 0xE716: return "Routine: Send a char to the screen"; case 0xE87C: return "Routine: Update screen as for RETURN"; case 0xE891: return "Routine: Update screen/editor becouse RETURN is pressed"; case 0xE8CD: return "Routine: Search (and change) Ascii color codes"; case 0xE8EA: return "Routine: Screen shifting throw top for new line"; case 0xE9F0: return "Routine: Calculate the address of current screen line"; case 0xE9FF: return "Routine: Write starting message + set of memory"; case 0xEA13: return "Routine: Write char to the cursor (with parameters)"; case 0xEA24: return "Routine: Calculate pointer to color RAM location"; case 0xEA31: return "Default hardware interrupt (IRQ)"; case 0xEA87: return "Routine SCNKEY of KERNAL"; case 0xEC44: return "Routine: Control switching negative/uppercase/SHIFT"; case 0xED09: return "Routine TALK of KERNAL"; case 0xED0C: return "Routine LISTEN of KERNAL"; case 0xED40: return "Routine: Send a byte to serial bus"; case 0xEDB9: return "Routine SECOND of KERNAL"; case 0xEDC7: return "Routine TKSA of KERNAL"; case 0xEDDD: return "Routine CIOUT of KERNAL"; case 0xEDEF: return "Routine UNTLK of KERNAL"; case 0xEDFE: return "Routine UNLSN of KERNAL"; case 0xEE13: return "Routine ACPTR of KERNAL"; case 0xEE85: return "Routine: Reset serial bus clock pulse output"; case 0xEE8E: return "Routine: Set serial bus clock pulse output"; case 0xEE97: return "Routine: Reset serial bus data output"; case 0xEEA0: return "Routine: Set serial bus data output"; case 0xEEA9: return "Routine: Read in C serial bus data input"; case 0xEEB3: return "Routine: 931 clock cicle delay"; case 0xF00D: return "Routine: 6551 state register image = case 0x40"; case 0xF086: return "Routine: Take char from RS-232"; case 0xF0A4: return "Routine: control for RS-232 disabilitation"; case 0xF12B: case 0xF12C: case 0xF12D: case 0xF12E: case 0xF12F: return "Routine: Write strings of I/O"; case 0xF13E: return "Routine GETIN of KERNAL"; case 0xF14E: return "Routine: Take char from RS-232/Register memory"; case 0xF157: return "Routine CHRIN of KERNAL"; case 0xF199: return "Routine: Withdraws char from tape"; case 0xF1AD: return "Routine: Withdraws char from serial bus"; case 0xF1B8: return "Routine: Take char from RS-232/Register image"; case 0xF1CA: return "Routine CHROUT of KERNAL"; case 0xF1DD: return "Routine: Send a char to tape (use buffer)"; case 0xF20E: return "Routine CHKIN of KERNAL"; case 0xF250: return "Routine CHKOUT of KERNAL"; case 0xF291: return "Routine CLOSE of KERNAL"; case 0xF2EE: return "Routine: device addresses/Table reorganizes"; case 0xF2F1: return "Routine: Table reorganizes for file closing"; case 0xF2F2: return "Routine: Table reorganizes for file closing (A=par.)"; case 0xF30F: return "Routine: Searches table index (X) of file (X=n°file)"; case 0xF314: return "Routine: Searches table index (X) of file (A=n°file)"; case 0xF31F: return "Routine: Makes the file at X addrress active"; case 0xF32F: return "Routine CLALL of KERNAL"; case 0xF333: return "Routine CLRCHN of KERNAL"; case 0xF34A: return "Routine OPEN of KERNAL"; case 0xF3D5: return "Routine: Sends file name on serial bus"; case 0xF47D: return "Routine: Fixes top memori of Operative System (C=0)"; case 0xF49E: return "Routine LOAD of KERNAL"; case 0xF4A5: return "Default routine LOAD of KERNAL"; case 0xF5AF: return "Routine: Write SEARCHING FOR file name"; case 0xF5C1: return "Routine: Write current file name"; case 0xF5D2: return "Routine: Write LOADING/VERIFING string"; case 0xF5DD: return "Routine SAVE of KERNAL"; case 0xF5ED: return "Default routine SAVE of KERNAL"; case 0xF633: return "Routine: Addresses the device with the command (C=1)"; case 0xF642: return "Routine: Addresses the device with the command"; case 0xF654: return "Routine: Sets the serial bus to not-receiving"; case 0xF68F: return "Routine: Write SAVING file name"; case 0xF69B: return "Routine UDTIM of KERNAL"; case 0xF6BC: return "Routine: Verifies pressure STOP/RVS keys"; case 0xF6DD: return "Routine RDTIM of KERNAL"; case 0xF6EA: return "Routine SETTIM of KERNAL"; case 0xF6FB: return "Routine: Close all I/O canals and Write I/O ERROR 1"; case 0xF6FE: return "Routine: Close all I/O canals and Write I/O ERROR 2"; case 0xF701: return "Routine: Close all I/O canals and Write I/O ERROR 3"; case 0xF704: return "Routine: Close all I/O canals and Write I/O ERROR 4"; case 0xF707: return "Routine: Close all I/O canals and Write I/O ERROR 5"; case 0xF70A: return "Routine: Close all I/O canals and Write I/O ERROR 6"; case 0xF70D: return "Routine: Close all I/O canals and Write I/O ERROR 7"; case 0xF710: return "Routine: Close all I/O canals and Write I/O ERROR 8"; case 0xF713: return "Routine: Close all I/O canals and Write I/O ERROR 9"; case 0xF72C: return "Routine: Search/verify valid tape header file"; case 0xF76A: return "Routine: Writes the Header for the file (address+name)"; case 0xF7D0: return "Routine: Loads in XY the pointer of tape buffer start"; case 0xF7EA: return "Routine: Compares name found file with that searched"; case 0xF7D7: return "Routine: Prepares I/O starting addresses, tape end"; case 0xF80D: return "Routine: Loads in XY the current tape buffer pointer"; case 0xF817: return "Routine: Wait (write) of cassette PRESS PLAY"; case 0xF82E: return "Routine: Reads cassette switch (Z=present)"; case 0xF838: return "Routine: Wait (write) of cassette PRESS RECORD & PLAY"; case 0xF841: return "Routine: Reads blocks data from tape"; case 0xF84A: return "Routine: Reads blocks data from tape (no addresses)"; case 0xF864: return "Routine: Writes blocks data from tape+ initialization"; case 0xF867: return "Routine: Writes blocks data from tape (type #14)"; case 0xF86B: return "Routine: Writes blocks data from tape"; case 0xF8D0: return "Routine: Verifies for switch off motor (and normal IRQ)"; case 0xF92C: return "Routine IRQ cassette for LOAD"; case 0xFB8E: return "Routine: Sets tape ^Buffer at ^I/O starting address"; case 0xFB97: return "Routine: Initialize/reset variables for cassette"; case 0xFBA6: return "Routine: Sets TimerB #1 in base of out bit"; case 0xFBAD: return "Routine: Starts Timer B #1(176c) and reverses tape output"; case 0xFBAF: return "Routine: Starts Timer B #1(A=par) and reverses tape output"; case 0xFBB1: return "Routine: Starts Timer B #1(AX=par) and reverses tape output"; case 0xFC57: return "Routine: Changes IRQ vector to FC6A"; case 0xFC93: return "Routine: Stop motor, disable int. CIA #1"; case 0xFCB8: return "Routine: Stop motor, disable int. CIA #1, int. goes out"; case 0xFCBD: return "Routine: Change IRQ vector for I/O"; case 0xFCCA: return "Routine: Stop cassette motor"; case 0xFCD1: return "Routine: Controls if tape ^Buffer =tape ending address"; case 0xFCDB: return "Routine: Advances ^ tape Buffer/Screen shifting"; case 0xFCE2: return "Routine: Startup"; case 0xFD02: return "Routine: Search for cartridge presence"; case 0xFD15: return "Routine RESTOR of KERNAL"; case 0xFD1A: return "Routine VECTOR of KERNAL"; case 0xFD50: return "Routine RAMTAS of KERNAL"; case 0xFDAE: return "Routine IOINIT of KERNAL"; case 0xFFDD: return "Routine: Set Timer A #1 at 16,7msec, Int. e PB6"; case 0xFDF9: return "Routine SETNAME of KERNAL"; case 0xFE00: return "Routine SETLFS of KERNAL"; case 0xFE07: return "Routine READST of KERNAL"; case 0xFE18: return "Routine SETMSG of KERNAL"; case 0xFE1C: return "Routine: Set (change) ST state of I/O KERNAL"; case 0xFE21: return "Routine SETTMO of KERNAL"; case 0xFE25: return "Routine MEMTOP of KERNAL"; case 0xFE27: return "Routine: XY= top of Operative System memory"; case 0xFE2D: return "Routine: Sets top of Operative System memory"; case 0xFE34: return "Routine MEMBOT of KERNAL"; case 0xFE43: return "Routine: Non Maskerable Interrupt (NMI)"; case 0xFE47: return "Default Non maskerable Interrupt (NMI)"; case 0xFEBC: return "Restores cpu registers and goes out from interrupt"; case 0xFEC2: case 0xFEC3: case 0xFEC4: return "NTSC system costants"; case 0xFF2E: return "Routine: Update RS-232 Baud Rate"; case 0xFF43: return "Routine: Execute NMI Interrupt Routine (^return in stack)"; case 0xFF48: return "Masckerable Interrupt (IRQ) Routine"; case 0xFF5B: return "Routine CINT of KERNAL"; case 0xFF6E: return "Routine: Set Int. Timer #1 and PB6 output"; case 0xFF81: return "Routine: Initialize screen editor"; case 0xFF84: return "Routine: I/O initialization"; case 0xFF87: return "Routine: Initializes RAM/ creates tape buffer /Screen case 0x0400"; case 0xFF8A: return "Routine: Reset default I/O vector"; case 0xFF8D: return "Routine: Read/Set I/O vector"; case 0xFF90: return "Routine: Control KERNAL messages"; case 0xFF93: return "Routine: Send secondary address after Receive"; case 0xFF96: return "Routine: Send secondary address after Trasmit"; case 0xFF99: return "Routine: Read/Set top memory"; case 0xFF9C: return "Routine: Read/Set base mamory"; case 0xFF9F: return "Routine: Done the keyboard scan"; case 0xFFA2: return "Routine: Set the time out of serial bus"; case 0xFFA5: return "Routine: Acept a byte from serial port"; case 0xFFA8: return "Routine: Send a byte to serial port"; case 0xFFAB: return "Routine: Set serial bus to Not-trasmit"; case 0xFFAE: return "Routine: Set serial bus to Not-Receive"; case 0xFFB1: return "Routine: Set to Receive the devices to the serial bus"; case 0xFFB4: return "Routine: Set to Trasmit the serial bus device"; case 0xFFB7: return "Routine: Read the I/O state word"; case 0xFFBA: return "Routine: Set primary, secondary and logical addresses"; case 0xFFBD: return "Routine: Set file name"; case 0xFFC0: return "Routine: Open a logical file"; case 0xFFC3: return "Routine: Close a specified logical file"; case 0xFFC6: return "Routine: Open an input canal"; case 0xFFC9: return "Routine: Open an output canal"; case 0xFFCC: return "Routine: Close the input and output channel"; case 0xFFCF: return "Routine: Acept a char in the channel"; case 0xFFD2: return "Routine: Send a char in the channel"; case 0xFFD5: return "Routine: Load the Ram from a device"; case 0xFFD8: return "Routine: Save the Ram to a device"; case 0xFFDB: return "Routine: Set time clock"; case 0xFFDE: return "Routine: Read time clock"; case 0xFFE1: return "Routine: Terminate the keyboard scan"; case 0xFFE4: return "Routine: Take the char from keyboard buffer"; case 0xFFE7: return "Routine: Close all canals and files"; case 0xFFEA: return "Routine: Increment time clock"; case 0xFFED: return "Routine: Return (X,Y) screen coordinate"; case 0xFFF0: return "Routine: Read/Set (X,Y) cursor position"; case 0xFFF3: return "Routine: Return the base address of I/O"; case 0xFFFA: return "Not Maskerable Interrupt (NMI) vector"; case 0xFFFC: return "Startup vector"; case 0xFFFE: return "Masckerable Interrupt (IRQ) vector"; default: if ((addr>=0x4E) && (addr<=0x53)) return "Scratch area"; if ((addr>=0x57) && (addr<=0x60)) return "Scratch for numeric operation"; if ((addr>=0x73) && (addr<=0x8A)) return "CHRGET (Introduce a char) subroutine"; if ((addr>=0xD9) && (addr<=0xF0)) return "Table of screen line/Transient editor"; if ((addr>=0x100) && (addr<=0x10A)) return "CPU stack/Tape error/Floating conversion area"; if ((addr>=0x10B) && (addr<=0x13E)) return "CPU stack/Tape error"; if ((addr>=0x13F) && (addr<=0x1FF)) return "CPU stack"; if ((addr>=0x200) && (addr<=0x258)) return "INPUT buffer of BASIC"; if ((addr>=0x259) && (addr<=0x262)) return "KERNAL table: Number of active logical files"; if ((addr>=0x263) && (addr<=0x26C)) return "KERNAL table: Number of device for each files"; if ((addr>=0x26D) && (addr<=0x276)) return "KERNAL table: Secondary address for each files"; if ((addr>=0x277) && (addr<=0x280)) return "Keyboard buffer queue (FIFO)"; if ((addr>=0x2A7) && (addr<=0x2FF)) return "Not used"; if ((addr>=0x334) && (addr<=0x33B)) return "Not used"; if ((addr>=0x33C) && (addr<=0x3FB)) return "Tape I/O buffer"; if ((addr>=0x3FC) && (addr<=0x3FF)) return "Not used"; if ((addr>=0x400) && (addr<=0x7E7)) return "Video matrix (25*40)"; if ((addr>=0x7E8) && (addr<=0x7FF)) return "Pointer to data sprites"; if ((addr>=0x800) && (addr<=0x7FFF)) return "Normal space for BASIC programs"; if ((addr>=0x8000) && (addr<=0x9FFF)) return "Normal space for BASIC programs/ROM cartridge"; if ((addr>=0xA000) && (addr<=0xBFFF)) return "BASIC ROM"; if ((addr>=0xD500) && (addr<=0xD7FF)) return "SID images"; if ((addr>=0xD800) && (addr<=0xDBFF)) return "Color RAM"; if ((addr>=0xE4EC) && (addr<=0xE4FE)) return "PAL system costant"; break; } } break; } return super.dcom(iType, aType, addr, value); } }
126,319
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
C128Dasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/machine/C128Dasm.java
/** * @(#)C128Dasm.java 2020/10/11 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.machine; import sw_emulator.software.cpu.M6510Dasm; /** * Comment the memory location of C128 for the disassembler * It performs also a multy language comments. * * @author ice */ public class C128Dasm extends M6510Dasm { // Available language public static final byte LANG_ENGLISH=1; public static final byte LANG_ITALIAN=2; /** * Return a comment string for the passed instruction * * @param iType the type of instruction * @param aType the type of addressing used by the instruction * @param addr the address value (if needed by this istruction type) * @param value the operation value (if needed by this instruction) * @return a comment string */ @Override public String dcom(int iType, int aType, long addr, long value) { byte language=option.commentLanguage; switch (aType) { case A_ZPG: case A_ZPX: case A_ZPY: case A_ABS: case A_ABX: case A_ABY: case A_REL: case A_IND: case A_IDX: case A_IDY: // do not get comment if appropriate option is not selected if ((int)addr<=0xFF && !option.commentC128ZeroPage) return ""; if ((int)addr>=0x100 && (int)addr<=0x1FF && !option.commentC128StackArea) return ""; if ((int)addr>=0x200 && (int)addr<=0x2FF && !option.commentC128_200Area) return ""; if ((int)addr>=0x300 && (int)addr<=0x3FF && !option.commentC128_300Area) return ""; if ((int)addr>=0x400 && (int)addr<=0x7EF && !option.commentC128ScreenArea) return ""; if ((int)addr>=0x7F0 && (int)addr<=0x12FF && !option.commentC128UserBasic) return ""; if ((int)addr>=0x1300 && (int)addr<=0xBFFF && !option.commentC128AppProgArea) return ""; if ((int)addr>=0x1C00 && (int)addr<=0x1FFF && !option.commentC128VideoColor) return ""; if ((int)addr>=0x2000 && (int)addr<=0x3FFF && !option.commentC128ScreenMem) return ""; if ((int)addr>=0x4000 && (int)addr<=0xCFFF && !option.commentC128BasicRom) return ""; if ((int)addr>=0xD000 && (int)addr<=0xD3FF && !option.commentC128VicII) return ""; if ((int)addr>=0xD400 && (int)addr<=0xD4FF && !option.commentC128Sid) return ""; if ((int)addr>=0xD500 && (int)addr<=0xD50B && !option.commentC128MMU) return ""; if ((int)addr>=0xD600 && (int)addr<=0xD624 && !option.commentC128VDC) return ""; if ((int)addr>=0xD800 && (int)addr<=0xDBFF && !option.commentC128Color) return ""; if ((int)addr>=0xDC00 && (int)addr<=0xDCFF && !option.commentC128Cia1) return ""; if ((int)addr>=0xDD00 && (int)addr<=0xDEFF && !option.commentC128Cia2) return ""; if ((int)addr>=0xDF00 && (int)addr<=0xDF0A && !option.commentC128DMA) return ""; if ((int)addr>=0xE000 && (int)addr<=0xFFFF && !option.commentC128KernalRom) return ""; // do not get comment if appropriate option is not selected switch (language) { case LANG_ITALIAN: switch ((int)addr) { case 0x00: return "Direzione registro I/o dati del 6510"; case 0x01: return "Porta I/o dati del 6510"; case 0x02: return "Il token \"SEARCH\" cerca, numero di banco, salta all'indirizzo SYS"; case 0x03: case 0x04: return "Indirizzo SYS, PC registro MLM"; case 0x05: return "I registri SYS e MLM salvano SR"; case 0x06: return "I registri SYS e MLM salvano AC"; case 0x07: return "I registri SYS e MLM salvano XR"; case 0x08: return "I registri SYS e MLM salvano YR"; case 0x09: return "I registri SYS e MLM salvano SP"; case 0x0A: return "Flag di virgolette di scansione"; case 0x0B: return "Salva colonna TAB"; case 0x0C: return "Flag: 0=LOAD, 1=VERIFY"; case 0x0D: return "Puntatore del buffer di input/numero di pedici"; case 0x0E: return "Flag DIM predefinito"; case 0x0F: return "Tipo dato: FF=stringa, 00=numerico"; case 0x10: return "tipo dato: 80=intero, 00=virgola mobile"; case 0x11: return "Scansione DATI/Citazione LISTA/flag di memoria"; case 0x12: return "Flag pedice/FNxx"; case 0x13: return "Flag: 0=INPUT, $40=GET, $98=READ"; case 0x14: return "Segno ATN/Flag di valutazione di confronto"; case 0x15: return "Flag del prompt I/O corrente"; case 0x16: case 0x17: return "Valore intero"; case 0x18: return "Puntatore: stack di stringhe temporaneo"; case 0x19: return "Ultimo indirizzo stringa temporanea"; case 0x1B: return "Stack per stringhe temporanee"; case 0x24: case 0x25: case 0x26: case 0x27: return "Area del puntatore di utilità"; case 0x28: case 0x29: case 0x2A: case 0x2B: case 0x2C: return "Area di prodotto per la moltiplicazione"; case 0x2D: case 0x2E: return "Puntatore: Inizio del BASIC (banco 0) [1C01]"; case 0x2F: case 0x30: return "Puntatore: inizio delle variabili (banco 1) [0400]"; case 0x31: case 0x32: return "Puntatore: inizio degli array"; case 0x33: case 0x34: return "Puntatore: fine degli array"; case 0x35: case 0x36: return "Memorizzazione della stringa del puntatore (spostandosi verso il basso)"; case 0x37: case 0x38: return "Puntatore a stringa di utilità"; case 0x39: case 0x3A: return "Puntatore: limite di memoria (banco 1) [FF00]"; case 0x3B: case 0x3C: return "Numero di riga BASIC corrente"; case 0x3D: case 0x3E: return "Puntatore di testo: punto di riferimento BASIC (chrget)"; case 0x3F: case 0x40: return "Puntatore di utilità"; case 0x41: case 0x42: return "Numero di riga DATI corrente"; case 0x43: case 0x44: return "Indirizzo DATA corrente"; case 0x45: case 0x46: return "Vettore di input"; case 0x47: case 0x48: return "Nome della variabile corrente"; case 0x49: case 0x4A: return "Indirizzo variabile corrente"; case 0x4B: case 0x4C: return "Puntatore variabile per FOR/NEXT"; case 0x4D: case 0x4E: return "Salva Y, Salva operando, salva puntatore BASIC"; case 0x4F: return "Accumulatore di simboli di confronto"; case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: return "Area di lavoro varie, puntatori e così via"; case 0x56: case 0x57: case 0x58: return "Vettore salto per le funzioni"; case 0x60: case 0x61: case 0x62: return "Indirizzo MLM 0"; case 0x63: return "Indirizzo MLM 1/Accumulatore #1 esponente"; case 0x64: case 0x65: return "Indirizzo MLM 1/Accumulatore #1 mantissa"; case 0x66: case 0x67: return "Indirizzo MLM 2/Accumulatore #1 mantissa"; case 0x68: return "Indirizzo MLM 2/Accumulatore #1 segno"; case 0x69: return "Puntatore della costante di valutazione della serie"; case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: return "Esponente dell'accumulatore #2 e così via"; case 0x70: return "Comparazione segno accumulatore #1 con #2"; case 0x71: return "Accumulatore #1 in ordine inferiore (arrotondamento)"; case 0x72: case 0x73: return "Lunghezza buffer cassetta/Puntatore serie"; case 0x74: case 0x75: return "Incremento automatico del numero di riga"; case 0x76: return "Flag grafico: FF = Grafica allocata, 00 = Non allocata"; case 0x77: return "Numero sorgente colore"; case 0x78: case 0x79: return "Contatori temporanei"; case 0x7A: case 0x7B: case 0x7C: return "Descrittore DS$"; case 0x7D: case 0x7E: return "Puntatore allo pseudo-stack BASIC"; case 0x7F: return "Flag: 0=modo diretto"; case 0x80: case 0x81: return "DOS, flag di lavoro USING"; case 0x82: return "Salva il puntatore dello stack per gli errori"; case 0x83: return "Sorgente colore grafico"; case 0x84: return "Multicolore 1 (1)"; case 0x85: return "Multicolore 2 (2)"; case 0x86: return "Colore grafico in primo piano (13)"; case 0x87: case 0x88: return "Fattori di scala grafici X"; case 0x89: case 0x8A: return "Fattori di scala grafici Y"; case 0x8B: return "Smetti di dipingere se non stesso sfondo/colore"; case 0x8C: case 0x8D: case 0x8E: case 0x8F: return "Valori grafici di lavoro"; case 0x90: return "Parola di stato ST"; case 0x91: return "Selettore a chiave 1A: flag STOP e RVS"; case 0x92: return "Costante di tempo per il nastro ($80)"; case 0x93: return "Valore del lavoro, monitor, LOAD/SAVE: 0=LOAD, 1=VERIFY"; case 0x94: return "Uscita seriale, flag di carattere differito"; case 0x95: return "Carattere differito seriale"; case 0x96: return "Valore di lavoro della cassetta"; case 0x97: return "Registro salvataggio"; case 0x98: return "Quanti file aperti"; case 0x99: return "Dispositivo di input, normalmente 0"; case 0x9A: return "Dispositivo CMD di uscita, normalmente 3"; case 0x9B: case 0x9C: return "Parità nastro, flag di ricezione in uscita"; case 0x9D: return "Messaggi I/O: 192=tutti, 128=comandi, 64=errori, 0=zero"; case 0x9E: case 0x9F: return "Puntatori di errore del nastro"; case 0xA0: case 0xA1: case 0xA2: return "Orologio Jiffy HML"; case 0xA3: case 0xA4: return "Area dati temporanea"; case 0xA5: case 0xA6: return "Byte di lavoro I/O (nastro)"; case 0xA7: return "Memorizzazione bit di ingresso RS-232, conteggio cortocircuito cassetta"; case 0xA8: return "Conteggio bit RS-232, errore di lettura cassetta"; case 0xA9: return "Flag RS-232 per controllo bit di avvio, zero lettura cassetta"; case 0xAA: return "Buffer byte RS-232, modalità lettura cassetta"; case 0xAB: return "Archiviazione con parità RS-232, Cnt breve cassetta"; case 0xAC: case 0xAD: return "Puntatore per il buffer del nastro e lo scorrimento dello schermo"; case 0xAE: case 0xAF: return "Indirizzo di fine nastro/Fine programma"; case 0xB0: case 0xB1: return "Costanti di temporizzazione del nastro"; case 0xB2: case 0xB3: return "Puntatore: inizio del buffer del nastro"; case 0xB4: return "Conteggio bit RS-232"; case 0xB5: return "Bit successivo RS-232 da inviare"; case 0xB6: return "Buffer byte RS-232"; case 0xB7: return "Numero di caratteri nel nome del file"; case 0xB8: return "File logico corrente"; case 0xB9: return "Indirizzo secondario attuale"; case 0xBA: return "Dispositivo corrente"; case 0xBB: case 0xBC: return "Puntatore al nome del file"; case 0xBD: return "Buffer di parità RS-232 TRNS"; case 0xBE: return "Conteggio blocchi lettura cassetta"; case 0xBF: return "Buffer di parole seriale"; case 0xC0: return "Interruttore manuale/controllato della cassetta (aggiornato durante IRQ)"; case 0xC1: case 0xC2: return "Indirizzo iniziale I/O"; case 0xC3: case 0xC4: return "Tempo di caricamento cassetta (2 byte)"; case 0xC5: return "Dati di lettura/scrittura su nastro"; case 0xC6: case 0xC7: return "Banchi: dati I / O, nome file"; case 0xC8: case 0xC9: return "Indirizzi del buffer di ingresso RS-232 [0c00]"; case 0xCA: case 0xCB: return "Indirizzi del buffer di uscita RS-232 [0d00]"; case 0xCC: case 0xCD: return "Puntatore di decodifica della tastiera (banco 15) [fa80]"; case 0xCE: case 0xCF: return "Stampa puntatore di lavoro stringa"; case 0xD0: return "Numero di caratteri nel buffer della tastiera"; case 0xD1: return "Numero di caratteri programmati in attesa"; case 0xD2: return "Indice dei caratteri chiave programmati"; case 0xD3: return "Flag di spostamento dei tasti"; case 0xD4: return "Codice chiave corrente: 88=nessuna chiave"; case 0xD5: return "Codice chiave precedente: 88=nessuna chiave"; case 0xD6: return "Input da schermo/da tastiera"; case 0xD7: return "40/80 colonne: 0=schermo a 40 colonne"; case 0xD8: return "Codice della modalità grafica"; case 0xD9: return "Base di caratteri: 0=ROM, 4=RAM"; case 0xDA: return "Puntatori per MOVLIN/Temporanea per For TAB & rutine LINE WRAP"; case 0xDB: return "Un altro posto temporaneo per salvare un reg."; case 0xDC: case 0xDD: case 0xDE: case 0xDF: return "Area di lavoro di Misc Editor"; case 0xE0: case 0xE1: return "Puntatore alla riga/cursore dello schermo"; case 0xE2: case 0xE3: return "Puntatore della linea di colore"; case 0xE4: return "Margine inferiore dello schermo corrente"; case 0xE5: return "Margine superiore dello schermo corrente"; case 0xE6: return "Margine sinistro della schermata corrente"; case 0xE7: return "Margine destro dello schermo corrente"; case 0xE8: case 0xE9: return "Log del cursore di input (riga, colonna)"; case 0xEA: return "Fine riga per il puntatore di input"; case 0xEB: return "Riga in cui risiede il cursore"; case 0xEC: return "Posizione del cursore sulla riga dello schermo"; case 0xED: return "Righe massime dello schermo (24)"; case 0xEE: return "Colonne massime dello schermo (39)"; case 0xEF: return "Carattere I/O corrente"; case 0xF0: return "Carattere precedente stampato"; case 0xF1: return "Colore del carattere"; case 0xF2: return "Salvataggio temporaneo del colore"; case 0xF3: return "Contrassegno inverso dello schermo"; case 0xF4: return "Flag di virgolette (Editor), 0=cursore diretto, altrimenti programmato"; case 0xF5: return "Numero di INSERT in sospeso"; case 0xF6: return "255=inserimento automatico abilitato"; case 0xF7: return "Blocco modalità testo (SHFT-C =): 0=abilitato, 128=disabilitato"; case 0xF8: return "Scorrimento: 0=abilitato, 128=disabilitato"; case 0xF9: return "Campanello (CTRL-G): 0=abilitato, 128=disabilitato"; case 0xFA: case 0xFB: case 0xFC: case 0xFD: case 0xFE: return "Non usato"; case 0xFF: return "Basic Scratch"; case 0x110: return "Contatore loop DOS"; case 0x111: return "Nome file DOS 1 lunghezza"; case 0x112: return "Unità disco DOS 1"; case 0x113: return "Nome file DOS 2 lunghezza"; case 0x114: return "Unità disco DOS 2"; case 0x115: return "Nome file DOS 2 indirizzo"; case 0x116: case 0x117: return "Indirizzo iniziale BLOAD/BSAVE"; case 0x118: case 0x119: return "BLOAD/BSAVE Indirizzo finale"; case 0x11B: return "Indirizzo logico DOS [00]"; case 0x11C: return "Indirizzo fisico DOS [08]"; case 0x11D: return "Indirizzo secondario DOS [6F]"; case 0x11E: return "Lunghezza record DOS"; case 0x120: return "ID disco DOS"; case 0x122: return "DOS DSK ID FLG SPACE Udato da PRINT USING"; case 0x123: return "Puntatore per inizio N."; case 0x124: return "Puntatore per fine N."; case 0x125: return "Segno del dollaro"; case 0x126: return "Flag virgola, PLAY: VOXTUM flag"; case 0x127: return "Contatore"; case 0x128: return "Segno eponente"; case 0x129: return "Puntatore all'esponente"; case 0x12A: return "Numero di cifre prima della virgola decimale"; case 0x12B: return "Flag giustifica"; case 0x12C: return "N. di posizioni prima della virgola decimale (campo)"; case 0x12D: return "Numero di posizioni dopo il punto decimale (campo)"; case 0x12E: return "+/- Flag (Campo)"; case 0x12F: return "Flag esponente (campo)"; case 0x130: return "Interruttore"; case 0x131: return "Contatore di caratteri (campo)"; case 0x132: return "Segno numero"; case 0x133: return "Blank/Star Flag"; case 0x134: return "Puntatore all'inizio del campo"; case 0x135: return "Lunghezza del formato"; case 0x136: return "Puntatore a fine campo"; case 0x2FC: case 0x2FD: return "Funzione esegue hook"; case 0x300: case 0x301: return "Collegamento messaggio di errore [4D3F]"; case 0x302: case 0x303: return "Collegamento BASIC per avviamento a caldo [4DC6]"; case 0x304: case 0x305: return "Collegamento ai token BASIC Crunch [430D]"; case 0x306: case 0x307: return "Link ai token di stampa [5151]"; case 0x308: case 0x309: return "Avvia un nuovo collegamento al codice BASIC [4AA2]"; case 0x30A: case 0x30B: return "Ottieni collegamento elemento aritmetico [78DA]"; case 0x30C: case 0x30D: return "Crunch FE Hook [4321]"; case 0x30E: case 0x30F: return "Elenco FE Hook [51CD]"; case 0x310: case 0x311: return "Esegue FE Hook [4BA9]"; case 0x312: case 0x313: return "Non usato"; case 0x314: case 0x315: return "Vettoree IRQ [FA65]"; case 0x316: case 0x317: return "Vettore Break Interrupt [B003]"; case 0x318: case 0x319: return "Vettore NMI Interrupt [FA40]"; case 0x31A: case 0x31B: return "Vettore OPEN [EFBD]"; case 0x31C: case 0x31D: return "Vettore CLOSE [F188]"; case 0x31E: case 0x31F: return "Imposta vettore di input [F106]"; case 0x320: case 0x321: return "Imposta vettore di output [F14C]"; case 0x322: case 0x323: return "Ripristina vettore I/O [F226]"; case 0x324: case 0x325: return "Vettore di input [EF06]"; case 0x326: case 0x327: return "Vettore di output [EF79]"; case 0x328: case 0x329: return "Tasto STOP di prova [F66E]"; case 0x32A: case 0x32B: return "Vettore GET [EEEB]"; case 0x32C: case 0x32D: return "Vettore Abort I/O [F222]"; case 0x32E: case 0x32F: return "Collegamento al monitor del linguaggio macchina [B006]"; case 0x330: case 0x331: return "Collegamento LOAD [F26C]"; case 0x332: case 0x333: return "Collegamento SAVE [F54E]"; case 0x334: case 0x335: return "Collegamento del codice di controllo della stampa [C7B9]"; case 0x336: case 0x337: return "Stampa collegamento ad alto codice ASCII [C805]"; case 0x338: case 0x339: return "Stampa collegamento sequenza ESC [C9C1]"; case 0x33A: case 0x33B: return "Collegamento Keyscan [C5E1]"; case 0x33C: case 0x33D: return "Memorizza chiave [C6AD]"; case 0x33E: case 0x33F: return "Puntatore alla tabella di decodifica KBD: non spostato [FA80/FD29]"; case 0x340: case 0x341: return "Puntatore alla tabella di decodifica KBD: spostato [FAD9/FD82]"; case 0x342: case 0x343: return "Puntatore alla tabella di decodifica KBD: Commodore [FB32/FDDB]"; case 0x344: case 0x345: return "Puntatore alla tabella di decodifica KBD: controllo [FB8B/FE34] 1)"; case 0x346: case 0x347: return "Puntatore alla tabella di decodifica KBD: Alt[FA80/FD29]"; case 0x348: case 0x349: return "Puntatore alla tabella di decodifica KBD: Ascii/DIN [FB4E/FD29]"; case 0x35E: case 0x35F: case 0x360: case 0x362: return "Bitmap di linee a capo"; case 0x386: return "Ingresso CHRGOT"; case 0x3D2: case 0x3D3: case 0x3D4: return "Costante numerica per BASIC"; case 0x3D5: return "Banco corrente per SYS, POKE, PEEK"; case 0x3D6: case 0x3D7: case 0x3D8: case 0x3D9: return "Valori di lavoro INSTR"; case 0x3DA: return "Puntatore banca per stringa / numero CONVERT RTN"; case 0x3DB: case 0x3DC: case 0x3DE: return "Sprite: byte di lavoro per SSHAPE"; case 0x3DF: return "Overflow FAC#1"; case 0x3E0: case 0x3E1: return "Sprite: byte di lavoro per SPRSAV"; case 0x3E2: return "Colore di primo piano/sfondo grafico Nybbles"; case 0x3E3: return "Primo piano grafico / Multicolor 1 colore Nybbles"; case 0xA00: case 0xA01: return "Vettore per riavviare il sistema (BASIC a caldo) [4003]"; case 0xA02: return "Byte di stato inizializzazione caldo/freddo KERNEL"; case 0xA03: return "Flag di sistema PAL/NTSC"; case 0xA04: return "Flags RESET rispetto allo stato NMI per init'n rtns"; case 0xA05: case 0xA06: return "Puntatore alla fine della memoria disponibile nel banco di sistema"; case 0xA07: case 0xA08: return "Puntatore al'inizio della memoria disponibile nel banco di sistema"; case 0xA09: return "Il gestore del nastro conserva l'IRQ indiretto qui"; case 0xA0B: return "Rilevamento TOD durante le operazioni sul nastro"; case 0xA0C: return "Registro interruzioni CIA 1"; case 0xA0D: return "Timer CIA 1 abilitato"; case 0xA0F: return "Abilita RS-232"; case 0xA10: return "Registro di controllo RS-232"; case 0xA11: return "Registro dei comandi RS-232"; case 0xA12: return "Velocità di trasmissione utente RS-232"; case 0xA14: return "Registro di stato RS-232"; case 0xA15: return "Numero RS-232 di bit da inviare"; case 0xA16: return "Velocità di trasmissione RS-232 a tempo bit completo (creato da OPEN)"; case 0xA18: return "Puntatore di ricezione RS-232"; case 0xA19: return "Puntatore di ingresso RS-232"; case 0xA1A: return "Puntatore di trasmissione RS-232"; case 0xA1B: return "Puntatore di invio RS-232"; case 0xA1C: return "Flag interno/esterno seriale veloce"; case 0xA1D: return "Decremento del registro Jiffie"; case 0xA1E: case 0xA1F: return "Conto alla rovescia per sospensione, FFFF = disabilita"; case 0xA20: return "Dimensione buffer della tastiera(10)"; case 0xA21: return "Flag di blocco dello schermo"; case 0xA22: return "Ripetizione chiave: 128=tutti, 64=nessuno"; case 0xA23: return "Tempi di ripetizione dei tasti"; case 0xA24: return "Pausa ripetizione tasti"; case 0xA25: return "Attivazione/disattivazione grafica/testo"; case 0xA26: return "Modalità cursore a 40 colori/Modalità cursore VIC (lampeggiante, fisso)"; case 0xA27: return "Disabilitazione cursore VIC"; case 0xA28: return "Contatore di lampeggi del cursore VIC"; case 0xA29: return "Carattere del cursore VIC prima di lampeggiare"; case 0xA2A: return "Valori di lampeggio a 40 colonne / Colore cursore VIC prima di lampeggiare"; case 0xA2B: return "Modalità cursore a 80 colori/Modalità cursore VDC (se abilitata)"; case 0xA2C: return "Video a 40 colonne $D018 Immagine/Schermo di testo VIC/Puntatore base caratteri"; case 0xA2D: return "Puntatore base VIC Bit-Map"; case 0xA2E: return "Schermo di pagine a 80 colonne/base dello schermo di testo VDC "; case 0xA2F: return "Base attributo 80 pagine schermo / colore / VDC"; case 0xA30: return "Puntatore temporaneo all'ultima riga per LOOP4"; case 0xA31: return "Temporaneo per routine a 80 colonne"; case 0xA32: return "Temporaneo per routine a 80 colonne"; case 0xA33: return "Colore cursore VDC prima di lampeggiare"; case 0xA34: return "Valore raster a schermo diviso VIC"; case 0xA35: return "Salva .X durante le operazioni sul banco"; case 0xA36: return "Contatore per sistemi PAL (regolazione Jiffie)"; case 0xA37: return "Risparmia velocità di sistema durante le operazioni su nastro e seriale"; case 0xA38: return "Salva abilitazioni Sprite durante operazioni su nastro e seriali"; case 0xA39: return "Salva stato di cancellazione durante le operazioni su nastro"; case 0xA3A: return "Flag impostato dall'utente per riservare il pieno controllo di VIC"; case 0xA3B: return "Byte alto: SA dello schermo VIC (usa W/VMI per spostare scrn)"; case 0xA3C: case 0xA3D: return "8563 Riempimento blocco"; case 0xA80: return "Buffer di confronto (32 byte)"; case 0xAA0: case 0xAA1: return "MLM"; case 0xAAB: return "ASM/DIS"; case 0xAAC: return "Per assembler"; case 0xAAF: case 0xAB0: return "Byte temporaneo utilizzato dappertutto"; case 0xAB1: return "Byte temporaneo utilizzato per assembler"; case 0xAB2: return "Salva .X qui durante le chiamate indirette di subroutine"; case 0xAB3: return "Indicatore di direzione per \"TRASFERIMENTO\""; case 0xAB4: case 0xAB5: return "Conversione del numero di analisi"; case 0xAB7: return "Conversione del numero di analisi"; case 0xAC0: return "Tasto funzione contatore/corrente PAT Banca ROM in fase di polling"; case 0xAC1: case 0xAC2: case 0xAC3: case 0xAC4: return "Tabella degli indirizzi fisici della ROM (ID DELLE CARTE LOGGATE)"; case 0xAC5: return "Flag: KBD/Riservato agli editor di schermi esterni"; case 0x1131: return "Posizione X attuale"; case 0x1133: return "Posizione Y attuale"; case 0x1135: return "Destinazione coordinata X"; case 0x1137: return "Destinazione coordinata Y"; case 0x1139: return "Variabili del disegno al tratto"; case 0x1149: return "Segno di angolo"; case 0x114A: return "Seno del valore dell'angolo"; case 0x114C: return "Coseno del valore dell'angolo"; case 0x114E: return "Temporanea per routine di distanza angolare"; case 0x1150: return "CIRCLE centro, coordinata X, BOX POINT 1 Coordinata X"; case 0x1152: return "CIRCLE centro, coordinata Y, BOX POINT 1 Coordinata Y"; case 0x1153: return "Lunghezza della stringa"; case 0x1154: return "Raggio X, angolo di rotazione BOX"; case 0x1155: return "posizione della stringa in contatore"; case 0x1156: return "Raggio Y"; case 0x1157: return "Nuovo byte di stringa o bit map"; case 0x1158: return "CIRCLE Angolo di rotazione/Segnaposto"; case 0x1159: return "SHAPE lunghezza della colonna"; case 0x115A: return "BOX: lunghezza di un lato"; case 0x115B: return "SHAPE Lunghezza riga"; case 0x115C: return "Inizio angolo arco"; case 0x115D: return "Temporaneo per la lunghezza della colonna"; case 0x115E: return "Fine dell'angolo dell'arco, contatore della colonna del carattere"; case 0x115F: return "Salva il descrittore di stringa SHAPE"; case 0x1160: return "Raggio X * COS (angolo di rotazione)"; case 0x1161: return "Indice di bit in byte"; case 0x1162: return "Raggio Y * SIN (angolo di rotazione)"; case 0x1164: return "Raggio X * SIN (angolo di rotazione)"; case 0x1166: return "E raggio * COS (angolo di rotazione)"; case 0x1168: return "BYTE ALTO: INDIRIZZO DI CHARROM Per \"CHAR\" CMD."; case 0x1169: return "Temporaneo per GSHAPE"; case 0x116A: return "Flag della modalità SCALE"; case 0x116B: return "Bandiera a doppia larghezza"; case 0x116C: return "Flag riempimento casella"; case 0x116D: return "Temporaneo per maschera bit"; case 0x116F: return "Modalità traccia: FF=attiva"; case 0x1170: case 0x1171: case 0x1172: case 0x1173: return "Rinumerazione dei puntatori"; case 0x1174: case 0x1175: case 0x1176: return "Puntatori lavoro directory/Archiviazione grafica temporanea"; case 0x1177: return "Puntatori di lavoro della directory"; case 0x117A: case 0x117B: return "Vettore virgola modibile/fisso [849F]"; case 0x117C: case 0x117D: return "Vettore fisso/virgola mobile [793C]"; case 0x11E6: return "Posizioni Sprite X-High"; case 0x11E7: case 0x11E8: return "Maschere bumb sprite (sprite-sfondo)"; case 0x11E9: case 0x11EA: return "Valori Light Pen, X e Y"; case 0x11EB: return "Pagina CHRGEN ROM, modalità testo [D8]"; case 0x11EC: return "Pagina CHRGEN ROM, modalità grafica [D0]"; case 0x11ED: return "Indirizzo secondario per RECORD"; case 0x1200: case 0x1201: return "Linea BASIC precedente"; case 0x1202: case 0x1203: return "Puntatore: istruzione BASIC per CONTINUE"; case 0x1204: return "STAMPA UTILIZZANDO il simbolo di riempimento"; case 0x1205: return "STAMPA UTILIZZANDO il simbolo della virgola"; case 0x1206: return "STAMPA UTILIZZANDO D.P. Simbolo"; case 0x1207: return "Stampa utilizzando il simbolo monetario"; case 0x1208: return "Utilizzato dalla routine di cattura degli errori - ultimo numero di errore"; case 0x1209: case 0x120A: return "Numero riga dell'ultimo errore. FFFF se nessun errore"; case 0x120B: case 0x120C: return "Indirizzo TRAP, FFFF = nessuno"; case 0x120D: return "Mantieni trap numero di Tempor."; case 0x1210: case 0x1211: return "Fine del Basic, banco 0"; case 0x1212: case 0x1213: return "Limite del programma BASIC [FF00]"; case 0x1214: case 0x1215: case 0x1216: case 0x1217: return "puntatori lavoro DO"; case 0x1218: case 0x1219: case 0x121A: return "Salto del programma USR [7D28]"; case 0x121B: case 0x121C: case 0x121D: case 0x121E: case 0x121F: return "Valore seme RND"; case 0x1220: return "Gradi per segmento CIRCLE"; case 0x1221: return "Stato di ripristino \"Freddo\" o \"Caldo\""; case 0x1222: return "Tempo del suono"; case 0x1223: case 0x1224: return "Durata nota rimanente LO/HI, Voce 1"; case 0x1225: case 0x1226: return "Durata nota rimanente LO/HI, Voce 2"; case 0x1227: case 0x1228: return "Durata nota rimanente LO/HI, Voce 3"; case 0x1229: case 0x122A: return "Lunghezza nota LO/HI"; case 0x122B: return "Ottava"; case 0x122C: return "Flag: 01 = diesis, FF = bemolle"; case 0x122D: case 0x122E: return "Intonazione"; case 0x122F: return "Sequencer musicale (numero voce)"; case 0x1230: return "Onda"; case 0x1233: return "Flag: riproduci nota punteggiata"; case 0x1234: case 0x1235: case 0x1236: case 0x1237: return "Nota immagine"; case 0x1271: case 0x1272: case 0x1273: case 0x1274: return "Nota: xx, xx, volume"; case 0x1275: return "Immagine volume precedente"; case 0x1276: case 0x1277: case 0x1278: return "Tabella delle attività IRQ di collisione"; case 0x127F: return "Maschera di collisione"; case 0x1280: return "Valore del lavoro di collisione"; case 0x1281: return "SUONO Voce"; case 0x1282: return "SUONO Tempo LO"; case 0x1285: case 0x1286: case 0x1287: return "SUONO Tempo HI"; case 0x1288: case 0x1289: case 0x128A: return "SUONO Max LO"; case 0x128B: return "SUONO Max HI"; case 0x128E: return "SUONO Min LO"; case 0x1291: return "SUONO Min HI"; case 0x1294: return "SUONO direzione"; case 0x1297: return "SUONO passo LO"; case 0x129A: return "SOUND passo HI"; case 0x129B: return "SUONO Frequenza LO"; case 0x12A0: return "SUONO Frequenza HI"; case 0x12A3: return "Temp Tempo LO"; case 0x12A4: return "Temp Tempo HI"; case 0x12A5: return "Temp Max LO"; case 0x12A6: return "Temp Max HI"; case 0x12A7: return "Temp Min LO"; case 0x12A8: return "Temp Min HI"; case 0x12A9: return "Temp Direzione"; case 0x12AA: return "Temp passo LO"; case 0x12AB: return "Temp passo HI"; case 0x12AC: return "Temp Frequenza LO"; case 0x12AD: return "Temp Frequenza HI"; case 0x12AE: return "Temp impulso LO"; case 0x12AF: return "Temp impulso HI"; case 0x12B0: return "Temp forma d'onda"; case 0x12B1: case 0x12B2: return "Valori di lavoro PEN/POT"; case 0x12B7: case 0x12FA: case 0x12FB: return "Utilizzato DA SPRDEF e SAVSPR"; case 0x12FC: return "Numero sprite/Utilizzato DA SPRDEF e SAVSPR"; case 0x12FD: return "Usato da BASIC IRQ per bloccare tutte le chiamate IRQ tranne una"; case 0x4000: case 0x4001: case 0x4002: return "INGRESSO FREDDO"; case 0x4003: case 0x4004: case 0x4005: return "INGRESSO CALDO"; case 0x4006: case 0x4007: case 0x4008: return "INGRESSO IRQ"; case 0x4009: return "Riavvio di base"; case 0x4023: return "Avviamento a freddo di base"; case 0x4045: return "Costanti di base del set-up"; case 0x4112: return "Carillon"; case 0x417A: return "Imposta registri preconfig"; case 0x4189: return "Registra per $D501"; case 0x418D: return "Iniziare le schede di movimento dello sprite"; case 0x419B: return "Stampa messaggio di avvio"; case 0x41BB: return "Messaggio di avvio"; case 0x4251: return "Imposta collegamenti di base"; case 0x4267: return "Collegamenti di base per $0300"; case 0x4279: return "Chrget per $0380"; case 0x42CE: return "Ottieni da ($50) banco 1"; case 0x42D3: return "Ottieni da ($3f) banco 1"; case 0x42D8: return "Ottieni da ($52) banco 1"; case 0x42DD: return "Ottieni da ($5c) banco 0"; case 0x42E2: return "Ottieni da ($5c) banco 1"; case 0x42E7: return "Ottieni da ($66) banco 1"; case 0x42EC: return "Ottieni da ($61) banco 0"; case 0x4271: return "Ottieni da ($70) banco 0"; case 0x42F6: return "Ottieni da ($70) banco 1"; case 0x42FB: return "Ottieni da ($50) banco 1"; case 0x4300: return "Ottieni da ($61) banco 1"; case 0x4305: return "Ottieni da ($24) banco 0"; case 0x430A: return "Gettoni Crunch"; case 0x43CC: return "Sposta in basso il buffer di input"; case 0x43E2: return "Controlla la corrispondenza delle parole chiave"; case 0x4417: return "Parole chiave: senza prefisso"; case 0x4609: return "Parole chiave - Prefisso FE"; case 0x46C9: return "Parole chiave - Prefisso CE"; case 0x46FC: return "Vettori di azione"; case 0x47D8: return "Vettori di funzioni"; case 0x4828: return "Vettori defunti"; case 0x4846: return "Comandi non implementati"; case 0x484B: return "Messaggio di errore"; case 0x4A82: return "Trova messaggio"; case 0x4A9F: return "Inizia un nuovo codice di base"; case 0x4B34: return "Aggiorna puntatore continua"; case 0x4B3F: return "Dichiarazione di esecuzione/corsa"; case 0x4BCB: return "Esegui [stop]"; case 0x4BCD: return "Esegui [fine]"; case 0x4BF7: return "Imposta riferimento FN"; case 0x4C86: return "Valuta <o>"; case 0x4C89: return "Valuta <e>"; case 0x4CB6: return "Valuta <compare>"; case 0x4D2A: return "Stampa \"pronta\""; case 0x4D2D: return "'ready.'"; case 0x4D37: return "Errore o Pronto"; case 0x4DCA: return "Stampa 'out of memory'"; case 0x4D3C: return "Errore"; case 0x4DAF: return "Break entry"; case 0x4DC3: return "Pronto per la base"; case 0x4DE2: return "Gestisci nuova linea"; case 0x4FAF: return "Ricatena le linee"; case 0x4F82: return "Reimposta Fine base"; case 0x4F93: return "Ricevi la linea di ingresso"; case 0x4FAA: return "Cerca pila B per corrispondenza"; case 0x4FFE: return "Sposta la pila B in basso"; case 0x5017: return "Controlla lo spazio di memoria"; case 0x5047: return "Copia il puntatore della pila B"; case 0x5050: return "Imposta puntatore pila B"; case 0x5059: return "Sposta la pila B in alto"; case 0x5064: return "Trova la linea di base"; case 0x50A0: return "Ottieni numero di punto fisso"; case 0x50E2: return "Esegui [elenco]"; case 0x5123: return "Elenca subroutine"; case 0x51D6: return "Esegui [nuovo]"; case 0x51F3: return "Imposta Run"; case 0x51F8: return "Esegui [clr]"; case 0x5238: return "Cancella pila e area di lavoro"; case 0x5250: return "Caratteri Pudef"; case 0x5254: return "Puntatore di testo di backup"; case 0x5262: return "Esegui [return]"; case 0x528F: return "Esegui [data/bend]"; case 0x529D: return "Esegui [rem]"; case 0x52A2: return "Scansione all'istruzione successiva"; case 0x52A5: return "Scansione alla riga successiva"; case 0x52C5: return "Esegui [if]"; case 0x5320: return "Cerca/Salta Inizio/Piega"; case 0x537C: return "Salta costante stringa"; case 0x5391: return "Esegui [else]"; case 0x53A3: return "Esegui [on]"; case 0x53C6: return "Esegui [let]"; case 0x54F6: return "Controlla la posizione della stringa"; case 0x553A: return "Esegui [print#]"; case 0x5540: return "Esegui [cmd]"; case 0x555A: return "Esegui [print]"; case 0x5600: return "Formato di stampa carattere"; case 0x5607: return "-stampa '<cursore a destra>'-"; case 0x5604: return "-stampa spazio-"; case 0x560A: return "-stampa '?'-"; case 0x5612: return "Esegue [get]"; case 0x5635: return "Ottiene tasto"; case 0x5648: return "Esegui [input#]"; case 0x5662: return "Esegui [input]"; case 0x569C: return "Prompt e input"; case 0x56A9: return "Esegui [read]"; case 0x57F4: return "Esegui [next]"; case 0x587B: return "Esegui [dim]"; case 0x5885: return "Esegui [sys]"; case 0x58B4: return "Esegui [tron]"; case 0x58B7: return "Esegui [troff]"; case 0x58BD: return "Esegui [rreg]"; case 0x5901: return "Assegna <mid$>"; case 0x5975: return "Esegui [auto]"; case 0x5986: return "Esegui [help]"; case 0x59AC: return "Inserisci indicatore di aiuto"; case 0x59CF: return "Esegui [gosub]"; case 0x59DB: return "Esegui [goto]"; case 0x5A15: return "Dichiarazione indefinita"; case 0x5A1D: return "Mettere Sub in pila B"; case 0x5A3D: return "Esegui [go]"; case 0x5A60: return "Esegui [cont]"; case 0x5A9B: return "Esegui [run]"; case 0x5ACA: return "Esegui [restore]"; case 0x5AF0: return "Parole chiave da rinumerare"; case 0x5AF8: return "Esegui [renumber]"; case 0x5BAE: return "Rinumera-Continua"; case 0x5BFB: return "Rinumera scansione"; case 0x5D19: return "Converti numero di riga"; case 0x5D68: return "Ottieni rinumerazione inizio"; case 0x5D75: return "Contare le linee"; case 0x5D89: return "Aggiungi rinumerazione inc"; case 0x5D99: return "Scansiona avanti"; case 0x5DA7: return "Imposta movimento blocco"; case 0x5DC6: return "Blocco spostarsi verso il basso"; case 0x5DDF: return "Blocco spostarsi verso l'alto"; case 0x5DEE: return "Controlla il limite di blocco"; case 0x5DF9: return "Esegue [for]"; case 0x5E87: return "Esegue [delete]"; case 0x5EFB: return "Ottieni intervallo di numeri di riga"; case 0x5F34: return "Esegui [pudef]"; case 0x5F4D: return "Esegui [trap]"; case 0x5F62: return "Esegui [resume]"; case 0x5FB7: return "Ripristina il punto trappola"; case 0x5FD8: return "Sintassi di uscita"; case 0x5FDB: return "Stampa 'can't resume'"; case 0x5FE0: return "Esegui [do]"; case 0x6039: return "Esegui [exit]"; case 0x608A: return "Esegui [loop]"; case 0x60B4: return "Stampa 'loop not found'"; case 0x60B7: return "Stampa 'loop without do'"; case 0x60DB: return "valuta mentre/fino all'argomento"; case 0x60E1: return "Definisci chiave programmata"; case 0x610A: return "Esegui [key]"; case 0x619D: return "'+chr$('"; case 0x61A8: return "Esegui [paint]"; case 0x627C: return "Controllare la divisione della pittura"; case 0x62B7: return "Esegui [box]"; case 0x63F5: return "Autori"; case 0x642B: return "Esegui [sshape]"; case 0x658D: return "Esegui [gshape]"; case 0x668E: return "Esegui [circle]"; case 0x6750: return "Disegna un cerchio"; case 0x6797: return "Esegui [draw]"; case 0x67D7: return "Esegui [char]"; case 0x6955: return "Esegui [locate]"; case 0x6960: return "Esegui [scale]"; case 0x69D8: return "Costanti del fattore di scala"; case 0x69e2: return "Esegui [color]"; case 0x6A4C: return "Codici colore"; case 0x6A5C: return "Registra colori correnti"; case 0x6A79: return "Esegui [scnclr]"; case 0x6B06: return "Riempi la pagina della memoria"; case 0x6B17: return "Imposta il colore dello schermo"; case 0x6B5A: return "Esegui [graphic]"; case 0x6BC9: return "Esegui [bank]"; case 0x6BD7: return "Esegui [sleep]"; case 0x6C09: return "Moltiplica il tempo di sonno"; case 0x6C2D: return "Esegui [wait]"; case 0x6C4F: return "Esegui [sprite]"; case 0x6CB3: return "Maschere bit"; case 0x6CC6: return "Esegui [movspr]"; case 0x6DD9: return "Sprite motion table offsets"; case 0x6DE1: return "Esegui [play]"; case 0x6E02: return "Analizza il personaggio di gioco"; case 0x6E66: return "-Filtro"; case 0x6E9D: return "-Voce"; case 0x6EA8: return "-Ottava"; case 0x6EB2: return "Imposta suono SID"; case 0x6EDD: return "-Volume"; case 0x6EFD: return "Errore di riproduzione"; case 0x6F03: return "Nota punteggiata"; case 0x6F07: return "Carattere lunghezza nota"; case 0x6F1E: return "Note A-G"; case 0x6F52: return "...votxum..."; case 0x6F69: return "Acuta"; case 0x6F6C: return "Piatta"; case 0x6F78: return "Pausa"; case 0x6FD7: return "Esegui [tempo]"; case 0x6FE4: return "Voce per due"; case 0x6FE7: return "Caratteri di lunghezza"; case 0x6FEC: return "caratteri di comando"; case 0x6FF2: return "Indici per i simboli delle note"; case 0x6FF9: return "Tono LO -- NTSC"; case 0x7005: return "Tono HI -- NTSC"; case 0x7011: return "Modelli di busta A/D"; case 0x702F: return "Sequenza di suoneria"; case 0x7039: return "Offset voce SID"; case 0x703C: return "Scala del volume SID"; case 0x7046: return "Esegui [filter]"; case 0x70C1: return "Esegui [envelope]"; case 0x7164: return "Esegui [collision]"; case 0x7190: return "Esegui [sprcolor]"; case 0x71B6: return "Esegui [width]"; case 0x71C5: return "Esegui [vol]"; case 0x71EC: return "Esegui [sound]"; case 0x72CC: return "Esegui [window]"; case 0x7335: return "Esegui [boot]"; case 0x7372: return "Esegui [sprdef]"; case 0x7452: return "-Esegui [home]"; case 0x7497: return "-Esegui [1234]"; case 0x74F4: return "-Esegui []"; case 0x74FE: return "-Esegui [shift-return]"; case 0x7506: return "-Esegui [m]"; case 0x751C: return "-Esegui [y]"; case 0x751F: return "-Esegui [x]"; case 0x7530: return "-Esegui [clr]"; case 0x753F: return "-Esegui [right]"; case 0x7542: return "-Esegui [left]"; case 0x7564: return "-Esegui [up]"; case 0x7567: return "-Esegui [down]"; case 0x7576: return "-Esegui [a]"; case 0x7581: return "-Esegui [return]"; case 0x7588: return "Esegui [c]"; case 0x767F: return "Comandi SPRDEF"; case 0x7691: return "Vettori di comando SPRDEF HI/LO"; case 0x76B5: return "Comandi colore SPRDEF"; case 0x76EC: return "Esegui [sprsav]"; case 0x77B3: return "Esegui [fast]"; case 0x77C4: return "Esegui [slow]"; case 0x77D7: return "Digita controllo di corrispondenza"; case 0x77DA: return "Conferma numerico"; case 0x77DD: return "Conferma stringa"; case 0x77E7: return "Stampa 'type mismatch'"; case 0x77EA: return "Stampa 'formula too complex'"; case 0x77EF: return "Valuta l'espressione"; case 0x78D7: return "Valuta oggetto"; case 0x78FE: return "Costante PI"; case 0x7903: return "Continua l'espressione"; case 0x7930: return "Valuta <equal>"; case 0x793C: return "Fisso-Flottante"; case 0x7950: return "Valutare all'interno delle parentesi"; case 0x7956: return "-Controlla la parentesi destra"; case 0x7959: return "-Controlla la parentesi sinistra"; case 0x795C: return "-Controlla virgola"; case 0x796C: return "Errore di sintassi"; case 0x7978: return "Cerca variabile"; case 0x7A85: return "Decomprimere RAM1 in FAC # 1"; case 0x7AAF: return "Individua variabile"; case 0x7B3C: return "Seleziona alfabetico"; case 0x7B46: return "Crea variabile"; case 0x7CAB: return "Imposta array"; case 0x7D25: return "Stampa 'bad subscript'"; case 0x7D28: return "Stampa 'illegal quantity'"; case 0x7E3E: return "Calcola la dimensione dell'array"; case 0x7E71: return "Subroutine puntatore array"; case 0x7E82: return "Imposta patch banco per [carattere]"; case 0x7E88: return "Imposta la patch bancoper il collegamento di stampa schermo"; case 0x7E8E: return "Patch per rinumerazione scansione"; case 0x7E94: return "Patch per [elimina]"; case 0x7EA6: return "Patch per Note A-G"; case 0x7EB9: return "Tono LO -- PAL"; case 0x7EC5: return "Tono HI -- PAL"; case 0x7ED1: return "Patch dello stack di stringhe per errore"; case 0x7ED9: return "Non usato"; case 0x7FC0: return "Banner di copyright"; case 0x7FFC: return "Checksum (?)"; case 0x8000: return "Valutare <fre>"; case 0x8020: return "Decrittografa messaggio"; case 0x803A: return "-Libero in banco 1"; case 0x804A: return "Valutare <val>"; case 0x8052: return "Stringa in virgola mobile"; case 0x8076: return "Valutare <dec>"; case 0x80C5: return "Valutare <peek>"; case 0x80E5: return "Esegui [poke]"; case 0x80F6: return "Valutare <err$>"; case 0x8139: return "Scambiare x con y"; case 0x8142: return "Valutare <hex$>"; case 0x816B: return "Byte in esadecimale"; case 0x8182: return "Valutare <rgr>"; case 0x818C: return "Ottieni la modalità grafica"; case 0x819B: return "Valutare <rclr>"; case 0x81F3: return "Codici colore CRTC"; case 0x8203: return "Valutare <joy>"; case 0x8242: return "Valori del joystick"; case 0x824D: return "Valutare <pot>"; case 0x82AE: return "Valutare <pen>"; case 0x82FA: return "Valutare <pointer>"; case 0x831E: return "Valutare <rsprite>"; case 0x835B: return "Numeri di registro VIC Sprite"; case 0x8361: return "Valutare <rspcolor>"; case 0x837C: return "Valutare <bump>"; case 0x8397: return "Valutare <rspos>"; case 0x83E1: return "Valutare <xor>"; case 0x8407: return "Valutare <rwindow>"; case 0x8434: return "Valutare <rnd>"; case 0x8490: return "Moltiplicatore Rnd"; case 0x849A: return "Valore 32768"; case 0x849F: return "Virgola mobile-numero fisso senza segno"; case 0x84A7: return "Valutare il numero fisso"; case 0x84AD: return "Virgola mobile-numero fisso con segno"; case 0x84C9: return "Virgola mobile (.y, .a)"; case 0x84D0: return "Valutare <pos>"; case 0x84D4: return "Byte in virgola mobile"; case 0x84D9: return "Controlla direttamente"; case 0x84DD: return "Stampa 'illegal direct'"; case 0x84E0: return "Stampa 'undef'd function'"; case 0x84E5: return "Imposta 16 bit numero fisso-virgola mobile"; case 0x84F0: return "Controlla direttamente"; case 0x84F5: return "Stampa 'direct mode only'"; case 0x84FA: return "Esegui [def]"; case 0x8528: return "Controlla la sintassi FN"; case 0x853B: return "Esegui [fn]"; case 0x85AE: return "Valutare <str$>"; case 0x85BF: return "Valutare <chr$>"; case 0x85D6: return "Valutare <left$>"; case 0x860A: return "Valutare <right$>"; case 0x861C: return "Valutare <mid$>"; case 0x864D: return "Pull dei parametri della stringa"; case 0x8668: return "Valutare <len>"; case 0x866E: return "Esci dalla modalità stringa"; case 0x8677: return "Valutare <asc>"; case 0x8688: return "Calcola il vettore della stringa"; case 0x869A: return "Imposta stringa"; case 0x874E: return "Costruisci una stringa in memoria"; case 0x877B: return "Valuta stringa"; case 0x87E0: return "Pulisci stack descrittore"; case 0x87F1: return "Parametro byte di input"; case 0x87F4: return "-valutare il parametro byte"; case 0x8803: return "Parametri per Poke/Wait"; case 0x880F: return "Immettere il valore virgola mobile/numero fisso successivo"; case 0x8812: return "-Immettere il valore virgola mobile/numero fisso successivo"; case 0x8815: return "Virgola mobile/numero fisso"; case 0x882E: return "Sottrai dalla memoria"; case 0x8831: return "Valuta <subtract>"; case 0x8845: return "Aggiungi memoria"; case 0x8848: return "Valutare <add>"; case 0x88D6: return "azzerare entrambi gli accumulatori"; case 0x8917: return "Trim FAC#1 a sinistra"; case 0x8926: return "Negare FAC#1"; case 0x894E: return "Arrotondare in eccesso FAC#1"; case 0x895D: return "Stampa 'overflow'"; case 0x899C: return "Serie di log: 1.00"; case 0x89A1: return "Serie di log: #03 (contatore)"; case 0x89A2: return "Serie di log: 0.434255942"; case 0x89A7: return "Serie di log: 0.57658454"; case 0x89AC: return "Serie di log: 0.961800759"; case 0x89B1: return "Serie di log: 2.885390073"; case 0x89B6: return "Serie di log: 0.707106781 SQR(0.5)"; case 0x89BB: return "Serie di log: 1.41421356 SRQ(2)"; case 0x89C0: return "Serie di log: -0.5"; case 0x89C5: return "Serie di log: 0.693147181 LOG(2)"; case 0x89CA: return "Valuta <log>"; case 0x8A0E: return "Aggiungi 0.5"; case 0x8A12: return "Aggiungi memoria a A/Y"; case 0x8A18: return "Sottrae memoria a A/Y"; case 0x8A1E: return "Dividi per memoria"; case 0x8A24: return "Moltiplica per memoria"; case 0x8A27: return "Valuta <multiply>"; case 0x8A89: return "Unpack ROM in FAC#2"; case 0x8AB4: return "Unpack RAM1 in FAC#2"; case 0x8AEC: return "Testare entrambi gli accumulatori"; case 0x8B09: return "Overflow/Underflow"; case 0x8B17: return "Moltiplicare per 10"; case 0x8B2E: return "+10"; case 0x8B33: return "Stampa 'division by zero'"; case 0x8B38: return "Dividi per 10"; case 0x8B49: return "Dividi in memoria"; case 0x8B4C: return "Valuta <divide>"; case 0x8BD4: return "Unpack ROM in FAC#1"; case 0x8BF9: return "Insersci FAC#1 in $5e"; case 0x8BFC: return "Insersci FAC#1 in $59"; case 0x8C00: return "Insersci FAC#1 in RAM1"; case 0x8C28: return "FAC#2 in FAC#1"; case 0x8C38: return "FAC#1 in FAC#2"; case 0x8C47: return "Arrotonda FAC#1"; case 0x8C57: return "Ottieni il segno"; case 0x8C65: return "Valuta <sgn>"; case 0x8C68: return "Byte Fisso-Virgola mobile"; case 0x8C75: return "Fisso-Virgola mobile"; case 0x8C84: return "Valuta <abs>"; case 0x8C87: return "Confronta FAC#1 con la memoria"; case 0x8CC7: return "Virgola mobile-Fisso"; case 0x8CFB: return "valuta <int>"; case 0x8D22: return "Stringa in FAC#1"; case 0x8DB0: return "Ottieni cifra Ascii"; case 0x8E17: return "Costanti di conversione delle stringhe: 99999999.9"; case 0x8E1C: return "Costanti di conversione delle stringhe: 999999999"; case 0x8E21: return "Costanti di conversione delle stringhe: 1000000000"; case 0x8E26: return "Stampa 'in...'"; case 0x8E32: return "Stampa intero"; case 0x8E42: return "Virgola mobile in Ascii"; case 0x8F76: return "+0.5"; case 0x8F7B: return "Costanti decimali"; case 0x8F9F: return "Costanti TI"; case 0x8FB7: return "Valuta <sqr>"; case 0x8FBE: return "Elevarsi al Memory Power"; case 0x8FC1: return "Valuta <power>"; case 0x8FFA: return "Valuta <negate>"; case 0x9005: return "Serie Exp: 1.44269504 (1/LOG to base 2 e)"; case 0x900A: return "Serie Exp: #07 (counter)"; case 0x900B: return "Serie Exp: 2.149875 E-5"; case 0x9010: return "Serie Exp: 1.435231 E-4"; case 0x9015: return "Serie Exp: 1.342263 E-3"; case 0x901A: return "Serie Exp: 9.6414017 E-3"; case 0x901F: return "Serie Exp: 5.550513 E-2"; case 0x9024: return "Serie Exp: 2.402263 E-4"; case 0x9029: return "Serie Exp: 6.931471 E-1"; case 0x902E: return "Serie Exp: 1.00"; case 0x9033: return "Valuta <exp>"; case 0x90D0: return "Messaggio di errore I/O"; case 0x90D8: return "Basic 'open'"; case 0x90DF: return "Basic 'chrout'"; case 0x90E5: return "Basic 'input'"; case 0x90EB: return "Reindirizza output"; case 0x90FD: return "Reindirizza input"; case 0x9112: return "Esegue [save]"; case 0x9129: return "Esegue [verify]"; case 0x912C: return "Esegue [load]"; case 0x918D: return "Esegue [open]"; case 0x919A: return "Esegue [close]"; case 0x91AE: return "Ottieni parametri di caricamento/salvataggio"; case 0x91DD: return "Ottieni valore byte successivo"; case 0x91E3: return "Ottieni carattere o interrompi"; case 0x91EB: return "Vai al parametro successivo"; case 0x91F6: return "Ottieni parametri di apertura/chiusura"; case 0x9243: return "Rilascia stringa I/O"; case 0x9251: return "Chiamata 'status'"; case 0x9257: return "Chiamata 'setlfs'"; case 0x925D: return "Chiamata 'setnam'"; case 0x9263: return "Chiamata 'getin'"; case 0x9269: return "Chiamata 'chrout'"; case 0x926F: return "Chiamata 'clrchn'"; case 0x9275: return "Chiamata 'close'"; case 0x927B: return "Chiamata 'clall'"; case 0x9281: return "Stampa il testo seguente"; case 0x9287: return "Imposta Carica/Salva banco"; case 0x928D: return "Chiamata 'plot'"; case 0x9293: return "Chiamata 'test stop'"; case 0x9299: return "Fai spazio per la stringa"; case 0x92EA: return "Garbage Collection"; case 0x9409: return "Valuta <cos>"; case 0x9410: return "Valuta <sin>"; case 0x9459: return "Valuta <tan>"; case 0x9485: return "Serie Trig: 1.570796327 pi/2"; case 0x948A: return "Serie Trig: 6.28318531 pi*2"; case 0x948F: return "Serie Trig: 0.25"; case 0x9494: return "Serie Trig: #05 (counter)"; case 0x9495: return "Serie Trig: -14.3813907"; case 0x949A: return "Serie Trig: 42.0077971"; case 0x949F: return "Serie Trig: -76.7041703"; case 0x94A4: return "Serie Trig: 81.6052237"; case 0x94A9: return "Serie Trig: -41.3417021"; case 0x94AE: return "Serie Trig: 6.28318531"; case 0x94B3: return "Valuta <atn>"; case 0x94E3: return "Serie ATN: #0b (counter)"; case 0x94E4: return "Serie ATN: -0.000684793912"; case 0x94E9: return "Serie ATN: 0.00485094216"; case 0x94EE: return "Serie ATN: -0.161117018"; case 0x94F3: return "Serie ATN: 0.034209638"; case 0x94F8: return "Serie ATN: -0.0542791328"; case 0x94FD: return "Serie ATN: 0.0724571965"; case 0x9502: return "Serie ATN: -0.0898023954"; case 0x9507: return "Serie ATN: 0.110932413"; case 0x950C: return "Serie ATN: -0.142839808"; case 0x9511: return "Serie ATN: 0.19999912"; case 0x9516: return "Serie ATN: -0.333333316"; case 0x951B: return "Serie ATN: 1.00"; case 0x9520: return "Stampa utilizzando"; case 0x99C1: return "Valuta <instr>"; case 0x9B0C: return "Valuta <rdot>"; case 0x9B30: return "Disegnare la linea"; case 0x9BFB: return "Stampa Pixel"; case 0x9C49: return "Esamina Pixel"; case 0x9C70: return "Imposta cella colore ad alta risoluzione"; case 0x9CCA: return "Linee di matrice video Hi"; case 0x9CE3: return "Pixel di posizione"; case 0x9D1C: return "Maschere bit"; case 0x9D24: return "calcolare riga/colonna ad alta risoluzione"; case 0x9D67: return "Calcola le coordinate grafiche"; case 0x9D6D: return "Aggiungi coordinate grafiche"; case 0x9D7C: return "Sottrai coordinate grafiche"; case 0x9D8F: return "Leggi la posizione X corrente su A/Y"; case 0x9DF2: return "Ripristina pixel del cursore"; case 0x9E06: return "Controllare il parametro virgola mobile/fisso opzionale"; case 0x9E1C: return "Immettere il parametro byte facoltativo/controllare il parametro byte nell'elenco"; case 0x9E2F: return "Comando di analisi grafica"; case 0x9E32: return "Ottieni parametro origine colore"; case 0x9F25: return "Maschere Pixel multicolore"; case 0x9F29: return "Converti parole Hi"; case 0x9F3D: return "Converti parole Lo"; case 0x9F4F: return "Alloca l'area grafica 9K per graphic/definizione sprite"; case 0xA022: return "Sposta Basic in $1c01"; case 0xA07E: return "Eseguire [catalog/directory]"; case 0xA11D: return "Eseguire [dopen]"; case 0xA134: return "Eseguire [append]"; case 0xA157: return "Trova SA di ricambio"; case 0xA16F: return "Eseguire [dclose]"; case 0xA18C: return "Eseguire [dsave]"; case 0xA1A4: return "Eseguire [dverify]"; case 0xA1A7: return "Eseguire [dload]"; case 0xA1C8: return "Eseguire [bsave]"; case 0xA218: return "Eseguire [bload]"; case 0xA267: return "Eseguire [header]"; case 0xA2A1: return "Eseguire [scratch]"; case 0xA2D7: return "Eseguire [record]"; case 0xA322: return "Eseguire [dclear]"; case 0xA32F: return "Eseguire [collect]"; case 0xA346: return "Eseguire [copy]"; case 0xA362: return "Eseguire [concat]"; case 0xA36E: return "Eseguire [rename]"; case 0xA37C: return "Eseguire [backup]"; case 0xA3B8: return "Unità disco DOS predefinita(U8 D0)"; case 0xA3BC: return "Indirizzo logico DOS"; case 0xA3BD: return "Indirizzo fisico DOS"; case 0xA3BE: return "Indirizzo secondario DOS"; case 0xA3BF: return "Analizza i comandi DOS"; case 0xA5E7: return "Stampa 'missing file name'"; case 0xA5EA: return "Stampa 'illegal device number'"; case 0xA5ED: return "Stampa 'string too long'"; case 0xA627: return "Maschere di comando DOS "; case 0xA667: return "Imposta i parametri DOS"; case 0xA7E1: return "Stampa 'are you sure'"; case 0xA7E8: return "'are you sure?'"; case 0xA80D: return "Stringa di rilascio"; case 0xA82A: return "'key 0,'"; case 0xA845: return "Imposta banco 15"; case 0xA84D: return "IRQ Work"; case 0xAA1F: return "Eseguire [stash]"; case 0xAA24: return "Eseguire [fetch]"; case 0xAA29: return "Eseguire [swap]"; case 0xAA6E: return "Patch per la stampa utilizzando"; case 0xAA81: return "Inutilizzato"; case 0xAE64: return "Messaggio crittografato"; case 0xAF00: case 0xAF01: case 0xAF02: return "Converti virgola mobile al numero intero"; case 0xAF03: case 0xAF04: case 0xAF05: return "Converti numero intero a virgole mobile"; case 0xAF06: case 0xAF07: case 0xAF08: return "Converti virgola mobile a stringa ASCII"; case 0xAF09: case 0xAF0A: case 0xAF0B: return "Converti stringa ASCII a virgola mobile"; case 0xAF0C: case 0xAF0D: case 0xAF0E: return "Converti a virgola mobile ad indirizzo"; case 0xAF0F: case 0xAF10: case 0xAF11: return "Converti da indirizzo a virgola mobile"; case 0xAF12: case 0xAF13: case 0xAF14: return "MEM - FACC"; case 0xAF15: case 0xAF16: case 0xAF17: return "ARG - FACC"; case 0xAF18: case 0xAF19: case 0xAF1A: return "MEM + FACC"; case 0xAF1B: case 0xAF1C: case 0xAF1D: return "ARG - FACC"; case 0xAF1E: case 0xAF1F: case 0xAF20: return "MEM * FACC"; case 0xAF21: case 0xAF22: case 0xAF23: return "ARG * FACC"; case 0xAF24: case 0xAF25: case 0xAF26: return "MEM / FACC"; case 0xAF27: case 0xAF28: case 0xAF29: return "ARG / FACC"; case 0xAF2A: case 0xAF2B: case 0xAF2C: return "Compute Natural LOG Of FACC"; case 0xAF2D: case 0xAF2E: case 0xAF2F: return "Eseguire BASIC INT su FACC"; case 0xAF30: case 0xAF31: case 0xAF32: return "Calcola la radice quadrata di FACC"; case 0xAF33: case 0xAF34: case 0xAF35: return "Nega FACC"; case 0xAF36: case 0xAF37: case 0xAF38: return "Elevare ARG alla potenza da memoria"; case 0xAF39: case 0xAF3A: case 0xAF3B: return "Elevare ARG alla potenza da FACC"; case 0xAF3C: case 0xAF3D: case 0xAF3E: return "Calcola EXP da FACC"; case 0xAF3F: case 0xAF40: case 0xAF41: return "Calcola COS da FACC"; case 0xAF42: case 0xAF43: case 0xAF44: return "Calcola SIN da FACC"; case 0xAF45: case 0xAF46: case 0xAF47: return "Calcola TAN da FACC"; case 0xAF48: case 0xAF49: case 0xAF4A: return "Calcola ATN da FACC"; case 0xAF4B: case 0xAF4C: case 0xAF4D: return "Arrotonda FACC"; case 0xAF4E: case 0xAF4F: case 0xAF50: return "Valore assoluto di FACC"; case 0xAF51: case 0xAF52: case 0xAF53: return "Segno di prova di FACC"; case 0xAF54: case 0xAF55: case 0xAF56: return "Confronta FACC con Memory"; case 0xAF57: case 0xAF58: case 0xAF59: return "Genera un numero random a virgola mobile"; case 0xAF5A: case 0xAF5B: case 0xAF5C: return "Muove RAM MEM in ARG"; case 0xAF5D: case 0xAF5E: case 0xAF5F: return "Muove ROM MEM in ARG"; case 0xAF60: case 0xAF61: case 0xAF62: return "Muove RAM MEM in FACC"; case 0xAF63: case 0xAF64: case 0xAF65: return "Muove ROM MEM in FACC"; case 0xAF66: case 0xAF67: case 0xAF68: return "Muove FACC in MEM"; case 0xAF69: case 0xAF6A: case 0xAF6B: return "Muove ARG in FACC"; case 0xAF6C: case 0xAF6D: case 0xAF6E: return "Muove FACC in ARG"; case 0xAFA8: return "Non usato"; case 0xB000: case 0xB001: case 0xB002: return "MONITOR ingresso chiamata"; case 0xB003: case 0xB004: case 0xB005: return "MONITOR ingresso pausa"; case 0xB006: case 0xB007: case 0xB008: return "Voce del parser del comando MONITOR"; case 0xB009: return "Stampa 'break'"; case 0xB00C: return "'break'"; case 0xB021: return "Stampa 'call' entry"; case 0xB03A: return "Stampa 'monitor'"; case 0xB03D: return "'monitor'"; case 0xB050: return "Eseguire [r]/Stampa 'pc sr ac xr yr sp'"; case 0xB053: return "'pc sr ac xr yr sp'"; case 0xB08D: return "Ottieni comando"; case 0xB0BC: return "Errore"; case 0xB0BF: return "'?'"; case 0xB0E3: return "Eseguire [x]"; case 0xB0E6: return "Comandi"; case 0xB0FC: return "Vettori"; case 0xB11A: return "Leggi la memoriadal banco"; case 0xB12A: return "Scrivi la memoria nel banco"; case 0xB13D: return "Confornta la memoria nel baco"; case 0xB152: return "Eseguire [m]"; case 0xB194: return "Eseguire [:]"; case 0xB1AB: return "Eseguire [>]"; case 0xB1C9: return "Stampa 'esc-o-up'"; case 0xB1CC: return "'esc-o-up'"; case 0xB1D6: return "Eseguire [g]"; case 0xB1DF: return "Eseguire [j]"; case 0xB1E8: return "Visualizza memoria"; case 0xB20B: return "Stampa ':<rvs-on>'"; case 0xB20E: return "':<rvs-on>'"; case 0xB231: return "Eseguire [c]"; case 0xB234: return "Eseguire [t]"; case 0xB2C3: return "Aggiungi 1 al Op 3"; case 0xB2C6: return "Fai il prossimo indirizzo"; case 0xB2CE: return "Eseguire [h]"; case 0xB337: return "Eseguire [lsv]"; case 0xB3C4: return "Stampa 'error'"; case 0xB3DB: return "Eseguire [f]"; case 0xB406: return "Eseguire [a]"; case 0xB533: return "Stampa 'space<esc-q>'"; case 0xB57C: return "Controlla 2 A-Match"; case 0xB57F: return "Controlla A-Match"; case 0xB58B: return "Prova il codice operativo successivo"; case 0xB599: return "Eseguire [d]"; case 0xB5AE: return "Stampa '<cr><esc-q>'"; case 0xB5B1: return "'<cr><esc-q>'"; case 0xB5D4: return "Mostra Istruzione"; case 0xB5F2: return "Stampa '<3 spaces>'"; case 0xB5F5: return "'<3 spaces>'"; case 0xB659: return "Classifica per codice"; case 0xB6A1: return "Ottieni caratteri mnemonici"; case 0xB6C3: return "Modalità tabelle"; case 0xB715: return "Modalità caratteri"; case 0xB721: return "Mnemonici compattati"; case 0xB7A5: return "Parametro di input"; case 0xB7CE: return "Leggere il valore"; case 0xB88A: return "Basi numeriche"; case 0xB88E: return "Bit di base"; case 0xB892: return "Visualizza indirizzo a 5 cifre"; case 0xB8A5: return "Visualizza byte a 2 cifre"; case 0xB8A8: return "Stampa spazio"; case 0xB8AD: return "Stampa cursore in alto"; case 0xB8B4: return "Nuova linea"; case 0xB8B9: return "Nuova linea vuota"; case 0xB8C2: return "Uscita byte di due cifre"; case 0xB8D2: return "Da byte a 2 Ascii"; case 0xB8E7: return "Ottieni caratteri di input"; case 0xB8E9: return "Caratteri di input"; case 0xB901: return "Copia Add0 in Add2"; case 0xB90E: return "Calcola Add2 - Add0"; case 0xB922: return "Sottrae Add0"; case 0xB93C: return "Sottrae Add1"; case 0xB950: return "Incrementa puntatore"; case 0xB960: return "Decrementa puntatore"; case 0xB874: return "Copia nell'area di registrazione"; case 0xB983: return "Calcola passo/area"; case 0xB9B1: return "Eseguire [$+&%]"; case 0xBA07: return "Converte in decimale"; case 0xBA47: return "Indirizzo di trasferimento"; case 0xBA5D: return "Indirizzo di uscita"; case 0xBA90: return "Eseguire [@]"; case 0xBB72: return "Non usato"; case 0xBFC0: return "Banner del copyright"; case 0xBFFC: return "Checksum (?)"; case 0xC000: case 0xC001: case 0xC002: return "Inizializza editor e schermo"; case 0xC003: case 0xC004: case 0xC005: return "Carattere visualizzato in .A, colore"; case 0xC006: case 0xC007: case 0xC008: return "Ottieni la chiave dal buffer IRQ"; case 0xC009: case 0xC00A: case 0xC00B: return "In A"; case 0xC00C: case 0xC00D: case 0xC00E: return "Stampa carattere in .A"; case 0xC00F: case 0xC010: case 0xC011: return "Ottieni numero di righe dello schermo, colonne in X e Y"; case 0xC012: case 0xC013: case 0xC014: return "Scansiona la subroutine della tastiera"; case 0xC015: case 0xC016: case 0xC017: return "Gestire la chiave di ripetizione e memorizzare la chiave decodificata"; case 0xC018: case 0xC019: case 0xC01A: return "Leggi o imposta la posizione CRSR in X, Y"; case 0xC01B: case 0xC01C: case 0xC01D: return "Spostare la subroutine del cursore 8563"; case 0xC01E: case 0xC01F: case 0xC020: return "Eseguire la funzione ESC utilizzando il carattere in .A"; case 0xC021: case 0xC022: case 0xC023: return "Ridefinire una funzione programmabile"; case 0xC024: case 0xC025: case 0xC026: return "Voce IRQ"; case 0xC027: case 0xC028: case 0xC029: return "Inizializza il set di caratteri a 80 colonne"; case 0xC02A: case 0xC02B: case 0xC02C: return "Cambia variabili locali dell'editor (con modifica 40/80)"; case 0xC02D: case 0xC02E: case 0xC02F: return "Imposta in alto a sinistra o in basso a destra della finestra"; case 0xC033: return "Indirizzo schermo basso"; case 0xC04C: return "Indirizzo schermo alto"; case 0xC065: return "Vettori di collegamento I / O"; case 0xC06F: return "Vettori di spostamento della tastiera"; case 0xC07B: return "Inizializza schermo"; case 0xC142: return "Ripristina finestra"; case 0xC150: return "Cursore home"; case 0xC156: return "Vai al bordo sinistro"; case 0xC15C: return "Imposta una nuova linea"; case 0xC17C: return "Esegui il colore dello schermo"; case 0xC194: return "(IRQ) Schermo diviso"; case 0xC234: return "Ottieni una chiave"; case 0xC258: return "Editor della riga dello schermo"; case 0xC29B: return "Input dallo schermo"; case 0xC2BC: return "Leggi il carattere dello schermo"; case 0xC2FF: return "Verificare la presenza di citazioni"; case 0xC30C: return "Stampa schermo avvolgente"; case 0xC320: return "Ascii in codice schermo"; case 0xC33E: return "Controlla l'intervallo del cursore"; case 0xC363: return "Fai una nuova linea"; case 0xC37C: return "Inserisci una linea"; case 0xC3A6: return "Schermata di scorrimento"; case 0xC3DC: return "Elimina una riga"; case 0xC40D: return "Sposta riga dello schermo"; case 0xC4A5: return "Cancella una linea"; case 0xC53C: return "Imposta il contatore a 80 colonne su 1"; case 0xC53E: return "Imposta contatore a 80 colonne"; case 0xC55D: return "Subroutine di scansione della tastiera"; case 0xC651: return "Ritiro e ripetizione dei tasti"; case 0xC6DD: return "Codici chiave per chiavi programmate"; case 0xC6E7: return "Lampeggia il cursore a 40 colonne"; case 0xC72D: return "Stampa su schermo"; case 0xC77D: return "Esc-o (escape)"; case 0xC78C: return "Caratteri di controllo"; case 0xC79A: return "Controllare i vettori dei caratteri"; case 0xC7B6: return "Stampa carattere di controllo"; case 0xC802: return "Stampa caratteri Hi-Bit"; case 0xC854: return "Chr$ (29) Cursore verso destra"; case 0xC85A: return "Chr$(17) Cursore verso il basso"; case 0xC875: return "Chr$(157) Cursore a sinistra"; case 0xC880: return "Chr$(14) Modalità testo"; case 0xC8A6: return "Chr$(11) Bloccare"; case 0xC8AC: return "Chr$(12) Sbloccare"; case 0xC8B3: return "Chr$(19) Home"; case 0xC8BF: return "Chr$(146) Pulisce modo inversione"; case 0xC8C2: return "Chr$(18) Inversione"; case 0xC8C7: return "Chr$(2) Sottolineare On"; case 0xC8CE: return "Chr$(130) Sottolineare Off"; case 0xC8D5: return "Chr$(15) Lampeggiare On"; case 0xC8DC: return "Chr$(143) Lampeggiare Off"; case 0xC8E3: return "Spazio sullo schermo aperto"; case 0xC91B: return "Chr$(20) Cancellazione"; case 0xC932: return "Ripristina cursore"; case 0xC94F: return "Chr$(9) Tab"; case 0xC961: return "Chr$(24) Tab Toggle"; case 0xC96C: return "Trova collonna Tab"; case 0xC980: return "Esc-z cancella tutte le schede"; case 0xC983: return "Esc-y imposta schede predefinite"; case 0xC98E: return "Chr$(7) Campana"; case 0xC9B1: return "Chr$(10) Avanzamento riga"; case 0xC9BE: return "Analizza sequenza Esc"; case 0xC9DE: return "Vettori di sequenza Esc"; case 0xCA14: return "Esc-t in alto"; case 0xCA16: return "Esc-b in basso"; case 0xCA1B: return "Imposta parte finestra"; case 0xCA24: return "Esci dalla finestra"; case 0xC052: return "Esc-d Elimina riga"; case 0xC076: return "Esc-q Cancella fine"; case 0xC08B: return "Esc-p Cancella inizio"; case 0xCA9F: return "Esc-@ Cancella il resto dello schermo"; case 0xCABC: return "Esc-v Scorrere verso l'alto"; case 0xCACA: return "Esc-w Scorrere verso il basso"; case 0xCAE2: return "Esc-l Scorrere On"; case 0xCAE5: return "Esc-m Scorrere Off"; case 0xCAEA: return "Esc-c Annulla inserimento automatico"; case 0xCAED: return "Esc-a Inserimento automatico"; case 0xCAF2: return "Esc-s Blocca cursore"; case 0xCAFE: return "Esc-u Sottolinea il cursore"; case 0xCB0B: return "Esc-e Cursore non lampeggiante"; case 0xCB21: return "Esc-f Cursore lampeggiante"; case 0xCB37: return "Esc-g Abilita campanello"; case 0xCB3A: return "Esc-h Disabilita campanello"; case 0xCB3F: return "Esc-r Schermo inverso"; case 0xCB48: return "Esc-n Schermo normale"; case 0xCB52: return "Esc-k Fine linea"; case 0xCB58: return "Ottieni carattere/colore schermo"; case 0xCB74: return "Controllare la riga di posizione sullo schermo"; case 0xCB81: return "Estendi/Ritaglia la linea dello schermo"; case 0xCB9F: return "Imposta maschere di linea"; case 0xCBB1: return "Esc-j Inizio riga"; case 0xCBC3: return "Trova Fine linea"; case 0xCBED: return "Sposta il cursore a destra"; case 0xCC00: return "Sposta il cursore a sinistra"; case 0xCC1E: return "Salva il cursore"; case 0xCC27: return "Stampa spazio"; case 0xCC2F: return "Stampa carattere"; case 0xCC32: return "Stampa colore di riempimento"; case 0xCC34: return "Metti il carattere sullo schermo"; case 0xCC5B: return "Ottieni righe/colonne"; case 0xCC6A: return "Leggi/Imposta cursore"; case 0xCCA2: return "Definisci tasto funzione"; case 0xCD2D: return "Colonna Esc-x switch 40/80"; case 0xCD57: return "Posizione cursore a 80 colori"; case 0xCD6F: return "Imposta il colore dello schermo"; case 0xCD9F: return "Attiva il cursore"; case 0xCDCA: return "Imposta registro CRTC 31"; case 0xCDCC: return "Imposta registro CRTC"; case 0xCDD8: return "Leggi il registro CRTC 31"; case 0xCDDA: return "Leggi il registro CRTC"; case 0xCDE6: return "Imposta CRTC su indirizzo schermo"; case 0xCDF9: return "Imposta CRTC sull'indirizzo del colore"; case 0xCE0C: return "Imposta 80 set di caratteri per colonne"; case 0xCE4C: return "Codici colore Ascii"; case 0xCE5C: return "Codici colore del sistema"; case 0xCE6C: return "Maschere bit"; case 0xCE74: return "Valori iniziali di 40 colonne ($e0)"; case 0xCE8E: return "Valori iniziali di 80 colonne ($0a40)"; case 0xCE8A: return "Lunghezze dei tasti di programmazione"; case 0xCEB2: return "Definizioni chiave del programma"; case 0xCEF5: return "Non usato"; case 0xD000: return "Posizione X sprite 0"; case 0xD001: return "Posizione Y sprite 0"; case 0xD002: return "Posizione X sprite 1"; case 0xD003: return "Posizione Y sprite 1"; case 0xD004: return "Posizione X sprite 2"; case 0xD005: return "Posizione Y sprite 2"; case 0xD006: return "Posizione X sprite 3"; case 0xD007: return "Posizione Y sprite 3"; case 0xD008: return "Posizione X sprite 4"; case 0xD009: return "Posizione Y sprite 4"; case 0xD00A: return "Posizione X sprite 5"; case 0xD00B: return "Posizione Y sprite 5"; case 0xD00C: return "Posizione X sprite 6"; case 0xD00D: return "Posizione Y sprite 6"; case 0xD00E: return "Posizione X sprite 7"; case 0xD00F: return "Posizione Y sprite 7"; case 0xD010: return "Posizione X MSB sprites 0..7"; case 0xD011: return "VIC registro controllo"; case 0xD012: return "Lettura/scrittura del valore di bilanciamento IRQ"; case 0xD013: return "Posizione X della penna ottica \"latch\""; case 0xD014: return "Posizione Y della penna ottica \"latch\""; case 0xD015: return "Abilitatore di Sprites"; case 0xD016: return "VIC registro controllo"; case 0xD017: return "(2X) vertical expansion (Y) sprite 0..7"; case 0xD018: return "VIC registro controllo memoria"; case 0xD019: return "Registro indicatore di interruzione"; case 0xD01A: return "Registro maschera IRQ"; case 0xD01B: return "Priorità dello schermo con sfondo sprite"; case 0xD01C: return "Set multicolor mode for sprite 0..7"; case 0xD01D: return "(2X) espansione orizzontale (X) sprite 0..7"; case 0xD01E: return "Contatto animazioni"; case 0xD01F: return "Animazione/contatto in background"; case 0xD020: return "Colore del bordo"; case 0xD021: return "Colore di sfondo 0"; case 0xD022: return "Colore di sfondo 1"; case 0xD023: return "Colore di sfondo 2"; case 0xD024: return "Colore di sfondo 3"; case 0xD025: return "Registro animazione 0 multicolore"; case 0xD026: return "Registro animazione 1 multicolore"; case 0xD027: return "Colore sprite 0"; case 0xD028: return "Colore sprite 1"; case 0xD029: return "Colore sprite 2"; case 0xD02A: return "Colore sprite 3"; case 0xD02B: return "Colore sprite 4"; case 0xD02C: return "Colore sprite 5"; case 0xD02D: return "Colore sprite 6"; case 0xD02E: return "Colore sprite 7"; case 0xD400: return "Voce 1: controllo della frequenza (byte alto)"; case 0xD401: return "Voce 1: controllo della frequenza (byte basso)"; case 0xD402: return "Voce 1: ampiezza della pulsazione della forma d'onda (byte basso)"; case 0xD403: return "Voce 1: ampiezza della pulsazione della forma d'onda (byte alto)"; case 0xD404: return "Voce 1: registri di controllo"; case 0xD405: return "Generatore 1: attacco/decadimento"; case 0xD406: return "Generatore 1: Sustain/Release"; case 0xD407: return "Voce 2: controllo della frequenza (byte basso)"; case 0xD408: return "Voce 2: controllo della frequenza (byte alto)"; case 0xD409: return "Voce 2: ampiezza della pulsazione della forma d'onda (byte basso)"; case 0xD40A: return "Voce 2: ampiezza della pulsazione della forma d'onda (byte alto)"; case 0xD40B: return "Voice 2: registri di controllo"; case 0xD40C: return "Generatore 2: attacco/decadimento"; case 0xD40D: return "Generatore 2: Sustain/Release"; case 0xD40E: return "Voce 3: controllo della frequenza (byte basso)"; case 0xD40F: return "Voce 3: controllo della frequenza (byte alto)"; case 0xD410: return "Voce 3: ampiezza della pulsazione della forma d'onda (byte basso)"; case 0xD411: return "Voce 3: ampiezza della pulsazione della forma d'onda (byte alto)"; case 0xD412: return "Voice3: registri di controllo"; case 0xD413: return "Generatore 3: attacco/decadimento"; case 0xD414: return "Generatore 3: Sustain/Release"; case 0xD415: return "Frequenza di taglio del filtro: byte basso (bit 2-0)"; case 0xD416: return "Frequenza di taglio del filtro: byte alto"; case 0xD417: return "Controllo della risonanza del filtro/controllo dell'input vocale"; case 0xD418: return "Seleziona volume e modalità filtro"; case 0xD419: return "Convertitore analogico/digitale: Paddle 1"; case 0xD41A: return "Convertitore analogico/digitale: Paddle 1"; case 0xD41B: return "Generatore di numeri casuali voce 3"; case 0xD41C: return "Uscita del generatore"; case 0xD500: return "Registro di configurazione (CR)"; case 0xD501: return "Registri di preconfigurazione"; case 0xD505: return "Registro delle modalità"; case 0xD506: return "Registro di configurazione RAM (RCR)"; case 0xD507: return "Puntatore a pagina zero basso"; case 0xD508: return "Puntatore a pagina zero alto"; case 0xD509: return "Puntatore della pagina dello stack basso"; case 0xD50A: return "Puntatore della pagina dello stack alto"; case 0xD50B: return "Registro delle versioni MMU"; case 0xD600: return "VDC 8563: Totale orizzontale"; case 0xD601: return "VDC 8563: Visualizzazione orizzontale"; case 0xD602: return "VDC 8563: Posizione di sincronizzazione orizzontale"; case 0xD603: return "VDC 8563: Larghezza sincronizzazione verticale / orizzontale"; case 0xD604: return "VDC 8563: Totale verticale"; case 0xD605: return "VDC 8563: Regolazione fine totale verticale"; case 0xD606: return "VDC 8563: Verticale visualizzato"; case 0xD607: return "VDC 8563: Posizione di sincronizzazione verticale"; case 0xD608: return "VDC 8563: Modalità interlacciata"; case 0xD609: return "VDC 8563: Carattere verticale totale"; case 0xD60A: return "VDC 8563: Modalità cursore/avvia scansione"; case 0xD60B: return "VDC 8563: Cursore fine scansione"; case 0xD60C: return "VDC 8563: Visualizza indirizzo di partenza (Alto)"; case 0xD60D: return "VDC 8563: Visualizza indirizzo di partenza (Basso)"; case 0xD60E: return "VDC 8563: Posizione del cursore (Alto)"; case 0xD60F: return "VDC 8563: Posizione del cursore (Basso)"; case 0xD610: return "VDC 8563: Penna luminosa verticale"; case 0xD611: return "VDC 8563: Penna luminosa orizzontale"; case 0xD612: return "VDC 8563: Aggiorna indirizzo (Alto)"; case 0xD613: return "VDC 8563: Aggiorna indirizzo (Basso)"; case 0xD614: return "VDC 8563: Indirizzo di inizio attributo (Alto)"; case 0xD615: return "VDC 8563: Indirizzo di inizio attributo (Basso)"; case 0xD616: return "VDC 8563: Hz Chr Pxl Ttl/IChar Spc "; case 0xD617: return "VDC 8563: VCarattere verticale Pxl Spc"; case 0xD618: return "VDC 8563: Blcco/Rvs Scr/V. Scroll"; case 0xD619: return "VDC 8563: Modo differente Sw/H. Scroll"; case 0xD61A: return "VDC 8563: Colore primo piano/sfondo"; case 0xD61B: return "VDC 8563: Incremento riga/indirizzo"; case 0xD61C: return "VDC 8563: Set di caratteri Indirizzo/RAM"; case 0xD61D: return "VDC 8563: Sottolinea la linea di scansione"; case 0xD61E: return "VDC 8563: Conteggio parole (-1)"; case 0xD61F: return "VDC 8563: Dati"; case 0xD620: return "VDC 8563: Origine della copia in blocco (alto)"; case 0xD621: return "VDC 8563: Origine della copia in blocco (basso)"; case 0xD622: return "VDC 8563: Inizio abilitazione display"; case 0xD623: return "VDC 8563: Fine abilitazione display"; case 0xD624: return "VDC 8563: Frequenza di aggiornamento DRAM"; case 0xDC00: return "Porta dati A # 1: tastiera, joystick, paddle, penna ottica"; case 0xDC01: return "Porta dati B # 1: tastiera, joystick, paddle"; case 0xDC02: return "Porta del registro di direzione dei dati A #1"; case 0xDC03: return "Porta del registro di direzione dei dati B #1"; case 0xDC04: return "Timer A #1: Byte basso"; case 0xDC05: return "Timer A #1: Byte alto"; case 0xDC06: return "Timer B #1: Byte basso"; case 0xDC07: return "Timer B #1: Byte alto"; case 0xDC08: return "Orologio diurno #1: 1/10 di secondo"; case 0xDC09: return "Orologio diurno #1: secondi"; case 0xDC0A: return "Orologio diurno #1: minuti"; case 0xDC0B: return "Orologio diurno #1: ora + [indicatore AM / PM]"; case 0xDC0C: return "Buffer dati di I / O seriale sincrono #1"; case 0xDC0D: return "Registro di controllo degli interrupt CIA #1"; case 0xDC0E: return "Registro di controllo A della CIA #1"; case 0xDC0F: return "Registro di controllo B della CIA #1"; case 0xDD00: return "Porta dati A #2: bus seriale, RS-232, memoria VIC"; case 0xDD01: return "Porta dati B #2: porta utente, RS-232"; case 0xDD02: return "Porta registro direzione dati A #2"; case 0xDD03: return "Porta registro direzione dati A #2"; case 0xDD04: return "Timer A #2: Byte basso"; case 0xDD05: return "Timer A #2: Byte alto"; case 0xDD06: return "Timer B #2: Byte basso"; case 0xDD07: return "Timer B #2: Byte alto"; case 0xDD08: return "Orologio diurno #2: 1/10 di secondo"; case 0xDD09: return "Orologio diurno #2: secondi"; case 0xDD0A: return "Orologio diurno #2: minuti"; case 0xDD0B: return "Orologio diurno #2: ora + [indicatore AM / PM]"; case 0xDD0C: return "Buffer dati di I / O seriale sincrono #2"; case 0xDD0D: return "Registro di controllo degli interrupt CIA #2"; case 0xDD0E: return "Registro di controllo A della CIA #2"; case 0xDD0F: return "Registro di controllo B della CIA #2"; case 0xDF00: return "8726 Controller DMA: stato"; case 0xDF01: return "8726 Controller DMA: commando"; case 0xDF02: return "8726 Controller DMA: indirizzo basso dell'host"; case 0xDF03: return "8726 Controller DMA: indirizzo alto dell'host"; case 0xDF04: return "8726 Controller DMA: indirizzo di espansione basso"; case 0xDF05: return "8726 Controller DMA: indirizzo di espansione alto"; case 0xDF06: return "8726 Controller DMA: banco espansione"; case 0xDF07: return "8726 Controller DMA: lunghezza di trasferimento basso"; case 0xDF08: return "8726 Controller DMA: lunghezza di trasferimento alto"; case 0xDF09: return "8726 Controller DMA: registro maschera interruzioni"; case 0xDF0A: return "8726 Controller DMA: verisone, memoria massima"; case 0xE000: return "Codice reset"; case 0xE04B: return "Byte di configurazione MMU"; case 0xE056: return "-restor-"; case 0xE05B: return "-vector-"; case 0xE073: return "Vettori per $0314"; case 0xE093: return "-ramtas-"; case 0xE0CD: return "Codice di spostamento per banchi RAM elevati"; case 0xE105: return "Maschere banco RAM"; case 0xE109: return "-init-"; case 0xE1DC: return "Configurazione dei registri CRTC"; case 0xE1F0: return "Verifica il reset speciale"; case 0xE242: return "Resetta in 64/128"; case 0xE24B: return "cambia nel modo 64"; case 0xE263: return "Codice in $02"; case 0xE26B: return "Scansiona tutte le ROM"; case 0xE2BC: return "Indirizzi ROM alti"; case 0xE2C0: return "Banchi ROM"; case 0xE2C4: return "Stampa maschera 'cbm'"; case 0xE2C7: return "Imposta il VIC 8564"; case 0xE2F8: return "Imposta coppie CRTC 8563"; case 0xE33B: return "-talk-"; case 0xE33E: return "-listen-"; case 0xE38C: return "Spedisci dati nel bas seriale"; case 0xE439: return "-acptr-"; case 0xE4D2: return "-second-"; case 0xE4E0: return "-tksa-"; case 0xE503: return "ciout- Stampa seriale"; case 0xE515: return "-untlk-"; case 0xE526: return "-unlsn-"; case 0xE535: return "Resetta ATN"; case 0xE545: return "Imposta orologio alto"; case 0xE54E: return "Imposta orologio basso"; case 0xE557: return "Imposta dati alti"; case 0xE560: return "Imposta dati bassi"; case 0xE569: return "Leggi linee seriali"; case 0xE573: return "Stabilizza i tempi"; case 0xE59F: return "Ripristina i tempi"; case 0xE5BC: return "Preparati per la risposta"; case 0xE5C3: return "Disattivazione veloce del disco"; case 0xE5D6: return "Disco veloce attivato"; case 0xE5FB: return "Disco veloce on/off"; case 0xE5FF: return "(NMI) Trasmissione RS-232"; case 0xE64A: return "RS-232 Handshake"; case 0xE68E: return "Imposta conteggio bit RS-232"; case 0xE69D: return "(NMI) Ricezione RS-232"; case 0xE75F: return "Invia a RS-232"; case 0xE795: return "Collega l'ingresso RS-232"; case 0xE7CE: return "Ottieni da RS-232"; case 0xE7EC: return "Interblocco RS-232/seriale"; case 0xE805: return "(NMI) I/O di controllo RS-232"; case 0xE850: return "Tabella dei tempi RS-232-NTSC"; case 0xE864: return "Tabella dei tempi RS-232-PAL"; case 0xE878: return "(NMI) Tempo di ricezione RS-232"; case 0xE8A9: return "(NMI) Tempo di trasmissione RS-232"; case 0xE8D0: return "Trova qualsiasi intestazione del nastro"; case 0xE919: return "Scrivi intestazione nastro"; case 0xE980: return "Ottieni indirizzo buffer"; case 0xE987: return "Ottieni indirizzo iniziale e finale del buffer del nastro"; case 0xE99A: return "Trova intestazione specifica"; case 0xE9BE: return "Puntatore del nastro bump"; case 0xE9C8: return "Stampa 'press play on tape'"; case 0xE9DF: return "Controlla lo stato del nastro"; case 0xE9E9: return "Stampa 'press record ...'"; case 0xE9F2: return "Avvia la lettura del nastro"; case 0xEA15: return "Avvia scrittura su nastro"; case 0xEA26: return "Codice nastro comune"; case 0xEA7D: return "Aspetta il nastro"; case 0xEA8F: return "Controllare l'arresto del nastro"; case 0xEAA1: return "Imposta tempo di lettura"; case 0xEAEB: return "(IRQ) Leggi i bit del nastro"; case 0xEC1F: return "Memorizza i caratteri del nastro"; case 0xED51: return "Reimposta puntatore"; case 0xED5A: return "Nuovo set di caratteri"; case 0xED69: return "Scrivi transizione su nastro"; case 0xED8B: return "Scrivi dati su nastro"; case 0xED90: return "(IRQ) Scrittura su nastro"; case 0xEE2E: return "(IRQ) Leader dal nastro"; case 0xEE57: return "Avvolgere I/O nastro"; case 0xEE9B: return "Cambia IRQ Vector"; case 0xEEA8: return "Vettori IRQ"; case 0xEEB0: return "Ferma il motore del nastro"; case 0xEEB7: return "Controlla l'indirizzo finale"; case 0xEEC1: return "Indirizzo a sbalzo"; case 0xEEC8: return "(IRQ) interruzione chiara"; case 0xEED0: return "Controllo del motore del nastro"; case 0xEEEB: return "-getin-"; case 0xEF06: return "-chrin-"; case 0xEF48: return "Ottieni il carattere dal nastro"; case 0xEF79: return "-chrout-"; case 0xEFBD: return "-open-"; case 0xF0B0: return "Imposta CIA su RS-232"; case 0xF0CB: return "controllare l'apertura seriale"; case 0xF106: return "-chkin-"; case 0xF14C: return "-chkout-"; case 0xF188: return "-close-"; case 0xF1E4: return "Cancella il file"; case 0xF202: return "Cerca file"; case 0xF212: return "Imposta parametri file"; case 0xF222: return "-clall-"; case 0xF226: return "-clrchn-"; case 0xF23D: return "Cancella percorso I/O"; case 0xF265: return "-load-"; case 0xF27B: return "Carico seriale"; case 0xF32A: return "Caricamento del nastro"; case 0xF3A1: return "Caricamento del disco"; case 0xF3EA: return "carico burst"; case 0xF48C: return "Chiudi seriale"; case 0xF4BA: return "Ottieni byte seriale"; case 0xF4C5: return "Ricevi byte seriale"; case 0xF503: return "Attiva/disattiva la linea dell'orologio"; case 0xF50C: return "Stampa la reimpostazione del disco \"u0\""; case 0xF50F: return "Stampa 'searching'"; case 0xF521: return "Invia nome file"; case 0xF533: return "Stampa 'loading'"; case 0xF53E: return "-save-"; case 0xF5B5: return "Termina ingresso seriale"; case 0xF5BC: return "Stampa 'saving'"; case 0xF5C8: return "Salva su nastro"; case 0xF5F8: return "-udtim-"; case 0xF63D: return "Guarda per RUN o Shift"; case 0xF65E: return "-rdtim-"; case 0xF665: return "-settim-"; case 0xF66E: return "-stop-"; case 0xF67C: return "Stampa 'too many files'"; case 0xF67F: return "Stampa 'file open'"; case 0xF682: return "Stampa 'file not open'"; case 0xF685: return "Stampa 'file not found'"; case 0xF688: return "Stampa 'device not present'"; case 0xF68B: return "Stampa 'not input file'"; case 0xF68E: return "Stampa 'not output file'"; case 0xF691: return "Stampa 'missing file name'"; case 0xF694: return "Stampa 'illegal device no'"; case 0xF697: return "Errore #0"; case 0xF6B0: return "Messagi"; case 0xF71E: return "Stampa se diretta"; case 0xF722: return "Stampa messaggio I/O"; case 0xF731: return "-setnam-"; case 0xF738: return "-setlfs-"; case 0xF73F: return "Imposta Carica/Salva banco"; case 0xF744: return "-rdst-"; case 0xF757: return "Imposta bit di stato"; case 0xF75C: return "-setmsg-"; case 0xF75F: return "Imposta timeout seriale"; case 0xF763: return "-memtop-"; case 0xF772: return "-membot-"; case 0xF781: return "-iobase-"; case 0xF786: return "Cerca SA"; case 0xF79D: return "Cerca e configura file"; case 0xF7A5: return "Attiva DMA"; case 0xF7AE: return "Ottieni un carattere dalla memoria"; case 0xF7BC: return "Memorizza byte caricato"; case 0xF7C9: return "Leggi byte da salvare"; case 0xF7D0: return "Ottieni un carattere dalla banca della memoria"; case 0xF7DA: return "Memorizza carattere nel banco di memoria"; case 0xF7E3: return "Confronta il carattere con il banco di memoria"; case 0xF7F0: return "Valori di configurazione del banco MMU"; case 0xF800: return "Subroutines a $02a2-$02fb"; case 0xF85A: return "Codice DMA a $03f0"; case 0xF867: return "Seleziona avvio automatico ROM"; case 0xF890: return "Controlla il disco di avvio"; case 0xF908: return "Stampa 'booting'"; case 0xF92C: return "Stampa '...'"; case 0xF98B: return "Avvio del disco di riavvolgimento"; case 0xF9B3: return "Leggi il blocco di avvio successivo"; case 0xF9FB: return "Fino a 2 cifre decimali"; case 0xFA08: return "Stringa di comando di lettura del blocco"; case 0xFa17: return "Stampa un messaggio"; case 0xFA40: return "Sequenza NMI"; case 0xFA65: return "(IRQ) Ingresso normale"; case 0xFA80: return "Matrice della tastiera non spostata"; case 0xFAD9: return "Matrice della tastiera spostata"; case 0xFB32: return "Matrice della tastiera C-Key"; case 0xFB8B: return "Controllo della matrice della tastiera"; case 0xFBE4: return "Tastiera matrice blocco maiuscole"; case 0xFC62: return "Patch per la configurazione dei registri CRTC"; case 0xFC6F: return "Non usato"; case 0xFC87: return "Inizializza tabelle di traduzione KBD"; case 0xFCC6: return "Patch per tastiera DIN per la selezione dei tasti"; case 0xFD29: return "Matrice della tastiera DIN non spostata"; case 0xFD82: return "Matrice della tastiera DIN spostata"; case 0xFDDB: return "C-Key a matrice della tastiera DIN"; case 0xFE34: return "Vettori di spostamento della tastiera DIN"; case 0xFE8C: return "Non usato"; case 0xFEFF: return "Byte di patch"; case 0xFEF0: return "Registro di configurazione MMU"; case 0xFF01: return "MMU LCR: Banco 0"; case 0xFF02: return "MMU LCR: Banco 1"; case 0xFF03: return "MMU LCR: Banco 14"; case 0xFF04: return "MMU LCR: Banco 14 su RAM 1"; case 0xFF05: return "Voce di trasferimento NMI"; case 0xFF17: return "Immissione trasferimento IRQ"; case 0xFF33: return "Ritorno dall'interruzione"; case 0xFF3D: return "Reimposta voce di trasferimento"; case 0xFF47: case 0xFF48: case 0xFF49: return "Configurazione della porta seriale veloce per I/O"; case 0xFF4A: case 0xFF4B: case 0xFF4C: return "Chiudi tutti i file logici per un dispositivo"; case 0xFF4D: case 0xFF4E: case 0xFF4F: return "Riconfigura il sistema come C64 (senza ritorno)"; case 0xFF50: case 0xFF51: case 0xFF52: return "Avvia richiesta DMA alla RAM esterna"; case 0xFF53: case 0xFF54: case 0xFF55: return "Avvia il programma di caricamento da disco"; case 0xFF56: case 0xFF57: case 0xFF58: return "Richiama l'avvio a freddo di tutte le schede funzione"; case 0xFF59: case 0xFF5A: case 0xFF5B: return "Tabelle di ricerca per LA data"; case 0xFF5C: case 0xFF5D: case 0xFF5E: return "Cerca tabelle per un dato SA"; case 0xFF5F: case 0xFF60: case 0xFF61: return "Passa da 40 a 80 colonne (Editor)"; case 0xFF62: case 0xFF63: case 0xFF64: return "Init 80-Col caratteri RAM (Editor)"; case 0xFF65: case 0xFF66: case 0xFF67: return "Tasto funzione programma (editor)"; case 0xFF68: case 0xFF69: case 0xFF6A: return "Imposta banco per operazioni I / O"; case 0xFF6B: case 0xFF6C: case 0xFF6D: return "Ricerca dati MMU per data banca"; case 0xFF6E: case 0xFF6F: case 0xFF70: return "JSR a qualsiasi banco, RTS a banco chiamante"; case 0xFF71: case 0xFF72: case 0xFF73: return "JMP a qualsiasi banco"; case 0xFF74: case 0xFF75: case 0xFF76: return "LDA (FETVEC), Y da qualsiasi banco"; case 0xFF77: case 0xFF78: case 0xFF79: return "STA (STAVEC), Y a qualsiasi banco"; case 0xFF7A: case 0xFF7B: case 0xFF7C: return "CMP (CMPVEC), Y a qualsiasi banca"; case 0xFF7D: case 0xFF7E: case 0xFF7F: return "Stampa utilità immediata"; case 0xFF80: return "Numero di rilascio del KERNEL"; case 0xFF81: case 0xFF82: case 0xFF83: return "Editor e display iniziali"; case 0xFF84: case 0xFF85: case 0xFF86: return "Dispositivi I/O iniziali (porte, timer, ecc.)"; case 0xFF87: case 0xFF88: case 0xFF89: return "Inizializza RAM e buffer per il sistema"; case 0xFF8A: case 0xFF8B: case 0xFF8C: return "Ripristina i vettori nel sistema iniziale"; case 0xFF8D: case 0xFF8E: case 0xFF8F: return "Cambia vettori per USER"; case 0xFF90: case 0xFF91: case 0xFF92: return "Controllo messaggi O.S."; case 0xFF93: case 0xFF94: case 0xFF95: return "Invia SA dopo ASCOLTO"; case 0xFF96: case 0xFF97: case 0xFF98: return "Invia SA dopo TALK"; case 0xFF99: case 0xFF9A: case 0xFF9B: return "Imposta/leggi la parte superiore della RAM di sistema"; case 0xFF9C: case 0xFF9D: case 0xFF9E: return "Imposta/leggi la parte inferiore della RAM di sistema"; case 0xFF9F: case 0xFFA0: case 0xFFA1: return "Scansione tastiera (editor)"; case 0xFFA2: case 0xFFA3: case 0xFFA4: return "Imposta timeout in IEEE (riservato)"; case 0xFFA5: case 0xFFA6: case 0xFFA7: return "Handshake byte serial ingresso"; case 0xFFA8: case 0xFFA9: case 0xFFAA: return "Handshake byte seriale uscita"; case 0xFFAB: case 0xFFAC: case 0xFFAD: return "Invia UNTALK in serie"; case 0xFFAE: case 0xFFAF: case 0xFFB0: return "Invia UNLISTEN in Serial"; case 0xFFB1: case 0xFFB2: case 0xFFB3: return "Invia LISTEN in Serial"; case 0xFFB4: case 0xFFB5: case 0xFFB6: return "invia TALK in Serial"; case 0xFFB7: case 0xFFB8: case 0xFFB9: return "Restituisci byte di stato I/O"; case 0xFFBA: case 0xFFBB: case 0xFFBC: return "Impostare LA, FA, SA"; case 0xFFBD: case 0xFFBE: case 0xFFBF: return "Imposta lunghezza e indirizzo nome file"; case 0xFFC0: case 0xFFC1: case 0xFFC2: return "OPEN file logico"; case 0xFFC3: case 0xFFC4: case 0xFFC5: return "CLOSE file logico"; case 0xFFC6: case 0xFFC7: case 0xFFC8: return "Imposta canale in"; case 0xFFC9: case 0xFFCA: case 0xFFCB: return "Imposta uscita canale"; case 0xFFCC: case 0xFFCD: case 0xFFCE: return "Ripristina il canale I/O predefinito"; case 0xFFCF: case 0xFFD0: case 0xFFD1: return "INPUT dal canale"; case 0xFFD2: case 0xFFD3: case 0xFFD4: return "OUTPUT al canale"; case 0xFFD5: case 0xFFD6: case 0xFFD7: return "CARICA da file"; case 0xFFD8: case 0xFFD9: case 0xFFDA: return "SALVA su file"; case 0xFFDB: case 0xFFDC: case 0xFFDD: return "Imposta orologio interno"; case 0xFFDE: case 0xFFDF: case 0xFFE0: return "Leggi orologio interno"; case 0xFFE1: case 0xFFE2: case 0xFFE3: return "Scansione tasto STOP"; case 0xFFE4: case 0xFFE5: case 0xFFE6: return "Leggere i dati memorizzati nel buffer"; case 0xFFE7: case 0xFFE8: case 0xFFE9: return "Chiudi tutti i file e i canali"; case 0xFFEA: case 0xFFEB: case 0xFFEC: return "Incrementa l'orologio interno"; case 0xFFED: case 0xFFEE: case 0xFFEF: return "Restituisci dimensioni finestra schermo (Editor)"; case 0xFFF0: case 0xFFF1: case 0xFFF2: return "Leggi/Imposta X, Y Cursor Coord (Editor)"; case 0xFFF3: case 0xFFF4: case 0xFFF5: return "Ritorno base I/O"; case 0xFFF8: case 0xFFF9: return "Vettore del sistema operativo (RAM1)"; case 0xFFFA: case 0xFFFB: return "Processore NMI Vector"; case 0xFFFC: case 0xFFFD: return "Processore RESET Vector"; case 0xFFFE: case 0xFFFF: return "Processore IRQ/BRK Vector"; default: if ((addr>=0x19) && (addr<=0x23)) return "Stack per stringhe temporanee"; if ((addr>=0x59) && (addr<=0x62)) return "Area di lavoro numerica varia"; if ((addr>=0x100) && (addr<=0x10F)) return "Errori di lettura del nastro, area in cui creare il nome del file (16 byte)"; if ((addr>=0x100) && (addr<=0x1FF)) return "Stack di sistema"; if ((addr>=0x200) && (addr<=0x2A1)) return "Buffer di input BASIC e Monitor"; if ((addr>=0x2A2) && (addr<=0x2AE)) return "Subroutine Bank Peek (RAM Kernal)"; if ((addr>=0x2AF) && (addr<=0x2BD)) return "Subroutine Bank Poke"; if ((addr>=0x2BE) && (addr<=0x2CC)) return "SubroutineBank Compare"; if ((addr>=0x2CD) && (addr<=0x2E2)) return "JSR a un'altro banco"; if ((addr>=0x2E3) && (addr<=0x2FB)) return "JMP a un'altra banco"; if ((addr>=0x34A) && (addr<=0x353)) return "Buffer tastiera IRQ (10 byte) FF = Nessuna chiave"; if ((addr>=0x354) && (addr<=0x35D)) return "Bitmap dei punti di tabulazione (10 byte)"; if ((addr>=0x362) && (addr<=0x36B)) return "Tabella dei numeri di file logici"; if ((addr>=0x36C) && (addr<=0x375)) return "Tabella numero dispositivo"; if ((addr>=0x376) && (addr<=0x37F)) return "Tabella degli indirizzi secondari"; if ((addr>=0x380) && (addr<=0x39E)) return "Subroutine CHRGET"; if ((addr>=0x39F) && (addr<=0x3AA)) return "Recupera da RAM banco 0"; if ((addr>=0x3AB) && (addr<=0x3B6)) return "Recupera da RAM banco 1"; if ((addr>=0x3B7) && (addr<=0x3BF)) return "Indice1 Recupero indiretto dal banco RAM 1"; if ((addr>=0x3C0) && (addr<=0x3C8)) return "Indice2 Recupero indiretto dal banco RAM 0"; if ((addr>=0x3C9) && (addr<=0x3D1)) return "Txtptr Scarica da RAM Banco 0"; if ((addr>=0x3F0) && (addr<=0x3F6)) return "Codice collegamento DMA"; if ((addr>=0x400) && (addr<=0x7E7)) return "Schermata di testo a 40 colonne VIC"; if ((addr>=0x7E8) && (addr<=0x7fF)) return "Puntatori di identità sprite per modalità testo"; if ((addr>=0x800) && (addr<=0x9FF)) return "Pseudo Stack BASIC (indirizzi e comandi gosub e loop)"; if ((addr>=0xA40) && (addr<=0xA5A)) return "40/80 Scambio puntatore (a E0-FA)"; if ((addr>=0xA60) && (addr<=0xA6D)) return "40/80 Scambio di dati (0354-0361)"; if ((addr>=0xB00) && (addr<=0xBBF)) return "Buffer per cassette"; if ((addr>=0xC00) && (addr<=0xDFF)) return "Ingresso RS-232, buffer di uscita"; if ((addr>=0xE00) && (addr<=0xFFF)) return "Sprite di sistema (56-63)"; if ((addr>=0x1000) && (addr<=0x1009)) return "Lunghezze chiave programmate"; if ((addr>=0x100A) && (addr<=0x10FF)) return "Definizioni chiave programmate"; if ((addr>=0x1100) && (addr<=0x1130)) return "Area di gestione temporanea dei comandi DOS"; if ((addr>=0x1131) && (addr<=0x116E)) return "Area di lavoro grafica"; if ((addr>=0x1178) && (addr<=0x1197)) return "Graphics Index"; if ((addr>=0x117E) && (addr<=0x11D5)) return "Tabelle di movimento sprite (8 x 11 byte)"; if ((addr>=0x11D6) && (addr<=0x11E5)) return "Posizioni X / Y dello sprite"; if ((addr>=0x11EE) && (addr<=0x11FF)) return "Non usato"; if ((addr>=0x1239) && (addr<=0x123E)) return "Modello di inviluppo corrente"; if ((addr>=0x123F) && (addr<=0x1270)) return "AD(SR) Modello"; if ((addr>=0x1249) && (addr<=0x1252)) return "(AD)SR Modello"; if ((addr>=0x1253) && (addr<=0x125C)) return "Modello di forma d'onda"; if ((addr>=0x125D) && (addr<=0x1266)) return "Modello basso di larghezza di impulso"; if ((addr>=0x1267) && (addr<=0x1270)) return "modello alto di larghezza di impulso"; if ((addr>=0x1279) && (addr<=0x127E)) return "Tabelle degli indirizzi IRQ di collisione"; if ((addr>=0x1300) && (addr<=0x17FF)) return "Area del programma applicativo"; if ((addr>=0x1800) && (addr<=0x1BFF)) return "Area del programma applicativo / riservata per le funzioni dei tasti"; if ((addr>=0x1C00) && (addr<=0x1FF7)) return "Matrice di colori video per la modalità grafica"; if ((addr>=0x1FF8) && (addr<=0x1FFF)) return "Puntatori di identità sprite per la modalità grafica"; if ((addr>=0x2000) && (addr<=0x3FFF)) return "Memoria dello schermo per la modalità grafica"; if ((addr>=0xD800) && (addr<=0xDBFF)) return "RAM colore (Nybbles)"; } default: switch ((int)addr) { case 0x00: return "6510 Data I/O direction register"; case 0x01: return "6510 Data I/O port"; case 0x02: return "Token 'SEARCH' looks for, Bank Number, Jump to SYS Address"; case 0x03: case 0x04: return "SYS address, MLM register PC"; case 0x05: return "SYS and MLM register save SR "; case 0x06: return "SYS and MLM register save AC"; case 0x07: return "SYS and MLM register save XR"; case 0x08: return "SYS and MLM register save YR"; case 0x09: return "SYS and MLM register save SP"; case 0x0A: return "Scan-quotes flag"; case 0x0B: return "TAB column save"; case 0x0C: return "Flag: 0=LOAD, 1=VERIFY"; case 0x0D: return "Input buffer pointer/number of subscripts"; case 0x0E: return "Default DIM flag"; case 0x0F: return "Data Type: FF=string, 00=numeric"; case 0x10: return "Data Type: 80=integer, 00=floating point"; case 0x11: return "DATA scan/LIST quote/memory flag"; case 0x12: return "Subscript/FNxx flag"; case 0x13: return "Flag: 0=INPUT, $40=GET, $98=READ"; case 0x14: return "ATN sign / Comparison evaluation flag"; case 0x15: return "Current I/O prompt flag"; case 0x16: case 0x17: return "Integer value"; case 0x18: return "Pointer: temporary string stack"; case 0x19: return "Last Temp String Address"; case 0x1B: return "Stack For Temp Strings"; case 0x24: case 0x25: case 0x26: case 0x27: return "Utility pointer area"; case 0x28: case 0x29: case 0x2A: case 0x2B: case 0x2C: return "Product area for multiplication"; case 0x2D: case 0x2E: return "Pointer: Start-of-BASIC (bank 0) [1C01]"; case 0x2F: case 0x30: return "Pointer: Start-of-variables (bank 1) [0400]"; case 0x31: case 0x32: return "Pointer: Start-of-arrays"; case 0x33: case 0x34: return "Pointer: End-of-arrays"; case 0x35: case 0x36: return "Pointer string-storage (moving down)"; case 0x37: case 0x38: return "Utility string pointer"; case 0x39: case 0x3A: return "Pointer: Limit-of-memory (bank 1) [FF00]"; case 0x3B: case 0x3C: return "Current BASIC line number"; case 0x3D: case 0x3E: return "Textpointer: BASIC work point (chrget)"; case 0x3F: case 0x40: return "Utility Pointer"; case 0x41: case 0x42: return "Current DATA line number"; case 0x43: case 0x44: return "Current DATA address"; case 0x45: case 0x46: return "Input vector"; case 0x47: case 0x48: return "Current variable name"; case 0x49: case 0x4A: return "Current variable address"; case 0x4B: case 0x4C: return "Variable pointer for FOR/NEXT"; case 0x4D: case 0x4E: return "Y-save, op-save, BASIC pointer save"; case 0x4F: return "Comparison symbol accumulator"; case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: return "Miscellaneous work area, pointers, and so on"; case 0x56: case 0x57: case 0x58: return "Jump vector for functions"; case 0x60: case 0x61: case 0x62: return "MLM Address 0"; case 0x63: return "MLM Address 1/Accum #1 exponent"; case 0x64: case 0x65: return "MLM Address 1/Accum #1 mantissa"; case 0x66: case 0x67: return "MLM Address 2/Accum #1 mantissa"; case 0x68: return "MLM Address 2/Accum #1 sign"; case 0x69: return "Series evaluation constant pointer"; case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: return "Accum #2 exponent, and so on"; case 0x70: return "Sign comparison Acc #1 versus #2"; case 0x71: return "Accum #1 lo-order (rounding)"; case 0x72: case 0x73: return "Cassette buffer len / Series pointer"; case 0x74: case 0x75: return "Auto line number increment"; case 0x76: return "Graphics flag: FF = Graphics allocated, 00 = Not allocated"; case 0x77: return "Color source number"; case 0x78: case 0x79: return "Temporary counters"; case 0x7A: case 0x7B: case 0x7C: return "DS$ descriptor"; case 0x7D: case 0x7E: return "BASIC pseudo-stack pointer"; case 0x7F: return "Flag: 0=direct mode"; case 0x80: case 0x81: return "DOS, USING work flags"; case 0x82: return "Stack pointer save for errors"; case 0x83: return "Graphic color source"; case 0x84: return "Multicolor 1 (1)"; case 0x85: return "Multicolor 2 (2)"; case 0x86: return "Graphic foreground color (13)"; case 0x87: case 0x88: return "Graphic scale factors X"; case 0x89: case 0x8A: return "Graphic scale factors Y"; case 0x8B: return "Stoppaint if not Background/Not same color"; case 0x8C: case 0x8D: case 0x8E: case 0x8F: return "Graphic work values"; case 0x90: return "Status word ST"; case 0x91: return "Keyswitch 1A: STOP and RVS flags"; case 0x92: return "Timing constant for tape ($80)"; case 0x93: return "Work value, monitor, LOAD/SAVE: 0=LOAD, 1=VERIFY"; case 0x94: return "Serial output, deferred character flag"; case 0x95: return "Serial deferred character"; case 0x96: return "Cassette work value"; case 0x97: return "Register save"; case 0x98: return "How many open files"; case 0x99: return "Input device, normally 0"; case 0x9A: return "Output CMD device, normally 3"; case 0x9B: case 0x9C: return "Tape parity, output-received flag"; case 0x9D: return "I/O messages: 192=all, 128=commands, 64=errors, 0=nil"; case 0x9E: case 0x9F: return "Tape error pointers"; case 0xA0: case 0xA1: case 0xA2: return "Jiffy clock HML"; case 0xA3: case 0xA4: return "Temp data area"; case 0xA5: case 0xA6: return "I/O work bytes (tape)"; case 0xA7: return "RS-232 Input Bit Storage, Cassette Short Count"; case 0xA8: return "RS-232 Bit Count In, Cassette Read Error"; case 0xA9: return "RS-232 Flag For Start Bit Check, Cassette Reading Zeroes"; case 0xAA: return "RS-232 Byte Buffer, Cassette Read Mode"; case 0xAB: return "RS-232 Parity Storage, Cassette Short Cnt"; case 0xAC: case 0xAD: return "Pointer for tape buffer and screen scrolling"; case 0xAE: case 0xAF: return "Tape end address / End of program"; case 0xB0: case 0xB1: return "Tape timing constants"; case 0xB2: case 0xB3: return "Pointer: Start of tape buffer"; case 0xB4: return "RS-232 Bit Count"; case 0xB5: return "RS-232 Next Bit To Be Sent"; case 0xB6: return "RS-232 Byte Buffer"; case 0xB7: return "Number of characters in file name"; case 0xB8: return "Current logical file"; case 0xB9: return "Current secondary address"; case 0xBA: return "Current device"; case 0xBB: case 0xBC: return "Pointer to file name"; case 0xBD: return "RS-232 TRNS Parity Buffer"; case 0xBE: return "Cassette Read Block Count"; case 0xBF: return "Serial Word Buffer"; case 0xC0: return "Cassette Manual/Cntrolled Switch (Updated during IRQ)"; case 0xC1: case 0xC2: return "I/O Start Address"; case 0xC3: case 0xC4: return "Cassette LOAD Temps (2 bytes)"; case 0xC5: return "Tape Read/Write Data"; case 0xC6: case 0xC7: return "BANKS: I/O data, filename"; case 0xC8: case 0xC9: return "RS-232 input buffer addresses [0c00]"; case 0xCA: case 0xCB: return "RS-232 output buffer addresses [0d00]"; case 0xCC: case 0xCD: return "Keyboard decode pointer (bank 15) [fa80]"; case 0xCE: case 0xCF: return "Print string work pointer"; case 0xD0: return "Number of characters in keyboard buffer"; case 0xD1: return "Number of programmed chars waiting"; case 0xD2: return "Programmed key character index"; case 0xD3: return "Key shift flag"; case 0xD4: return "Current key code: 88=no key"; case 0xD5: return "Previous key code: 88=no key"; case 0xD6: return "Input from screen/from keyboard"; case 0xD7: return "40/80 columns: 0=40 column screen"; case 0xD8: return "Graphics mode code"; case 0xD9: return "Character base: 0=ROM, 4=RAM"; case 0xDA: return "Pointers For MOVLIN/Temporary For TAB & LINE WRAP Routines"; case 0xDB: return "Another Temporary Place To Save A Reg."; case 0xDC: case 0xDD: case 0xDE: case 0xDF: return "Misc Editor work area"; case 0xE0: case 0xE1: return "Pointer to screen line/cursor"; case 0xE2: case 0xE3: return "Color line pointer"; case 0xE4: return "Current screen bottom margin"; case 0xE5: return "Current screen top margin"; case 0xE6: return "Current screen left margin"; case 0xE7: return "Current screen right margin"; case 0xE8: case 0xE9: return "Input cursor log (row, column)"; case 0xEA: return "End-of-line for input pointer"; case 0xEB: return "Row where cursor lives"; case 0xEC: return "Position of cursor on screen line"; case 0xED: return "Maximum screen lines (24)"; case 0xEE: return "Maximum screen columns (39)"; case 0xEF: return "Current I/O character"; case 0xF0: return "Previous character printed"; case 0xF1: return "Character color"; case 0xF2: return "Temporary color save"; case 0xF3: return "Screen reverse flag"; case 0xF4: return "Quotes flag (Editor), 0=direct cursor, else programmed"; case 0xF5: return "Number of INSERTs outstanding"; case 0xF6: return "255 = Auto Insert enabled"; case 0xF7: return "Text mode lockout (SHFT-C=): 0=enabled, 128=disabled"; case 0xF8: return "Scrolling: 0 = enabled, 128 = disabled"; case 0xF9: return "Bell (CTRL-G): 0= enable, 128 = disable"; case 0xFA: case 0xFB: case 0xFC: case 0xFD: case 0xFE: return "Not used"; case 0xFF: return "Basic Scratch"; case 0x110: return "DOS Loop Counter"; case 0x111: return "DOS Filename 1 Len"; case 0x112: return "DOS Disk Drive 1"; case 0x113: return "DOS Filename 2 Len"; case 0x114: return "DOS Disk Drive 2"; case 0x115: return "DOS Filename 2 Addr"; case 0x116: case 0x117: return "BLOAD/BSAVE Starting Address"; case 0x118: case 0x119: return "BLOAD/BSAVE Ending Address"; case 0x11B: return "DOS Logical Addr [00]"; case 0x11C: return "DOS Phys Addr [08]"; case 0x11D: return "DOS Sec. Addr [6F]"; case 0x11E: return "DOS Record Length"; case 0x120: return "DOS Disk ID"; case 0x122: return "DOS DSK ID FLG SPACE Used by PRINT USING"; case 0x123: return "Pointer to Begin. NO."; case 0x124: return "Pointer to End NO."; case 0x125: return "Dollar Flag"; case 0x126: return "Comma Flag, PLAY: VOXTUM flag"; case 0x127: return "Counter"; case 0x128: return "Sign Exponent"; case 0x129: return "Pointer to Exponent"; case 0x12A: return "# Of Digits Before Decimal Point"; case 0x12B: return "Justify Flag"; case 0x12C: return "# Of Pos Before Decimal Point (Field)"; case 0x12D: return "# Of Pos After Decimal Point (Field)"; case 0x12E: return "+/- Flag (Field)"; case 0x12F: return "Exponent Flag (Field)"; case 0x130: return "Switch"; case 0x131: return "Char Counter (Field)"; case 0x132: return "Sign No"; case 0x133: return "Blank/Star Flag"; case 0x134: return "Pointer to Begin of Field"; case 0x135: return "Length of Format"; case 0x136: return "Pointer to End Of Field"; case 0x2FC: case 0x2FD: return "Function Execute Hook"; case 0x300: case 0x301: return "Error Message Link [4D3F]"; case 0x302: case 0x303: return "BASIC Warm Start Link [4DC6]"; case 0x304: case 0x305: return "Crunch BASIC Tokens Link [430D]"; case 0x306: case 0x307: return "Print Tokens Link [5151]"; case 0x308: case 0x309: return "Start New BASIC Code Link [4AA2]"; case 0x30A: case 0x30B: return "Get Arithmetic Element Link [78DA]"; case 0x30C: case 0x30D: return "Crunch FE Hook [4321]"; case 0x30E: case 0x30F: return "List FE Hook [51CD]"; case 0x310: case 0x311: return "Execute FE Hook [4BA9]"; case 0x312: case 0x313: return "Unused"; case 0x314: case 0x315: return "IRQ Vector [FA65]"; case 0x316: case 0x317: return "Break Interrupt Vector [B003]"; case 0x318: case 0x319: return "NMI Interrupt Vector[FA40]"; case 0x31A: case 0x31B: return "OPEN Vector [EFBD]"; case 0x31C: case 0x31D: return "CLOSE Vector [F188]"; case 0x31E: case 0x31F: return "Set Input Vector [F106]"; case 0x320: case 0x321: return "Set Output Vector [F14C]"; case 0x322: case 0x323: return "Restore I/O Vector [F226]"; case 0x324: case 0x325: return "Input Vector [EF06]"; case 0x326: case 0x327: return "Output Vector [EF79]"; case 0x328: case 0x329: return "Test STOP Key [F66E]"; case 0x32A: case 0x32B: return "GET Vector [EEEB]"; case 0x32C: case 0x32D: return "Abort I/O Vector [F222]"; case 0x32E: case 0x32F: return "Machine Lang Monitor Link [B006]"; case 0x330: case 0x331: return "LOAD Link [F26C]"; case 0x332: case 0x333: return "SAVE Link [F54E]"; case 0x334: case 0x335: return "Print Control Code Link [C7B9]"; case 0x336: case 0x337: return "Print High ASCII Code Link [C805]"; case 0x338: case 0x339: return "Print ESC Sequence Link [C9C1]"; case 0x33A: case 0x33B: return "Keyscan Link [C5E1]"; case 0x33C: case 0x33D: return "Store Key [C6AD]"; case 0x33E: case 0x33F: return "Pointer to KBD Decoding Table: Unshifted [FA80/FD29]"; case 0x340: case 0x341: return "Pointer to KBD Decoding Table: Shifted [FAD9/FD82]"; case 0x342: case 0x343: return "Pointer to KBD Decoding Table: Commodore [FB32/FDDB]"; case 0x344: case 0x345: return "Pointer to KBD Decoding Table: Control [FB8B/FE34] 1)"; case 0x346: case 0x347: return "Pointer to KBD Decoding Table: Alt [FA80/FD29]"; case 0x348: case 0x349: return "Pointer to KBD Decoding Table: Ascii/DIN [FB4E/FD29]"; case 0x35E: case 0x35F: case 0x360: case 0x362: return "Bitmap Of Line Wraps"; case 0x386: return "CHRGOT Entry"; case 0x3D2: case 0x3D3: case 0x3D4: return "Numeric Constant For BASIC"; case 0x3D5: return "Current Bank For SYS, POKE, PEEK"; case 0x3D6: case 0x3D7: case 0x3D8: case 0x3D9: return "INSTR Work Values"; case 0x3DA: return "Bank Pointer For String/Number CONVERT RTN"; case 0x3DB: case 0x3DC: case 0x3DE: return "Sprite: Work bytes for SSHAPE"; case 0x3DF: return "FAC#1 Overflow"; case 0x3E0: case 0x3E1: return "Sprite: Work bytes for SPRSAV"; case 0x3E2: return "Graphic Foreground/ Background Color Nybbles"; case 0x3E3: return "Graphic Foreground/ Multicolor 1 Color Nybbles"; case 0xA00: case 0xA01: return "Vector to Restart System (BASIC Warm) [4003]"; case 0xA02: return "KERNAL Warm/Cold Init'n Status Byte"; case 0xA03: return "PAL/NTSC System Flag"; case 0xA04: return "Flags RESET vs. NMI Status for init'n rtns"; case 0xA05: case 0xA06: return "Ptr to Bottom of Avail. Memory in System Bank"; case 0xA07: case 0xA08: return "Ptr to Top of Available Memory in System Bank"; case 0xA09: return "Tape Handler preserves IRQ Indirect here"; case 0xA0B: return "TOD Sense during tape operations"; case 0xA0C: return "CIA 1 Interrupt Log"; case 0xA0D: return "CIA 1 Timer Enabled"; case 0xA0F: return "RS-232 Enables"; case 0xA10: return "RS-232 Control Register"; case 0xA11: return "RS-232 Command Register"; case 0xA12: return "RS-232 User Baud Rate"; case 0xA14: return "RS-232 Status Register"; case 0xA15: return "RS-232 Number of Bits To Send"; case 0xA16: return "RS-232 Baud Rate Full Bit Time (Created by OPEN)"; case 0xA18: return "RS-232 Receive Pointer"; case 0xA19: return "RS-232 Input Pointer"; case 0xA1A: return "RS-232 Transmit Pointer"; case 0xA1B: return "RS-232 Send Pointer"; case 0xA1C: return "Fast Serial Internal/External Flag"; case 0xA1D: return "Decrementing Jiffie Register"; case 0xA1E: case 0xA1F: return "Sleep Countdown, FFFF = disable"; case 0xA20: return "Keyboard Buffer Size (10)"; case 0xA21: return "Screen Freeze Flag"; case 0xA22: return "Key Repeat: 128 = all, 64 = none"; case 0xA23: return "Key Repeat Timing"; case 0xA24: return "Key Repeat Pause"; case 0xA25: return "Graphics / Text Toggle Latch"; case 0xA26: return "40-Col Cursor Mode/VIC Cursor Mode (Blinking, Solid)"; case 0xA27: return "VIC Cursor Disable"; case 0xA28: return "VIC Cursor Blink Counter"; case 0xA29: return "VIC Cursor Character Before Blink"; case 0xA2A: return "40-Col Blink Values/VIC Cursor Color Before Blink"; case 0xA2B: return "80-Col Cursor Mode/VDC Cursor Mode (when enabled)"; case 0xA2C: return "40-Col Video $D018 Image/VIC Text Screen/Character Base Pointer"; case 0xA2D: return "VIC Bit-Map Base Pointer"; case 0xA2E: return "80-Col Pages-Screen/VDC Text Screen Base "; case 0xA2F: return "80-Col Pages-Screen/Color/VDC Attribute Base"; case 0xA30: return "Temporary Pointer to Last Line For LOOP4"; case 0xA31: return "Temporary For 80-Col Routines"; case 0xA32: return "Temporary For 80-Col Routines"; case 0xA33: return "VDC Cursor Color Before Blink"; case 0xA34: return "VIC Split Screen Raster Value"; case 0xA35: return "Save .X During Bank Operations"; case 0xA36: return "Counter for PAL Systems (Jiffie adjustment)"; case 0xA37: return "Save System Speed During Tape and Serial Ops"; case 0xA38: return "Save Sprite Enables During Tape and Serial Ops"; case 0xA39: return "Save Blanking Status During Tape Ops"; case 0xA3A: return "Flag set by user to resrv full control of VIC"; case 0xA3B: return "Hi byte:SA Of VIC Scrn (Use W/VMI to move scrn)"; case 0xA3C: case 0xA3D: return "8563 Block Fill"; case 0xA80: return "Compare Buffer (32 bytes)"; case 0xAA0: case 0xAA1: return "MLM"; case 0xAAB: return "ASM/DIS"; case 0xAAC: return "For Assembler"; case 0xAAF: case 0xAB0: return "Byte Temp used all over"; case 0xAB1: return "Byte Temp for Assembler"; case 0xAB2: return "Save .X here during Indirect Subroutine Calls"; case 0xAB3: return "Direction Indicator For 'TRANSFER'"; case 0xAB4: case 0xAB5: return "Parse Number Conversion"; case 0xAB7: return "Parse Number Conversion"; case 0xAC0: return "PAT Counter/Current Function Key ROM Bank Being Polled"; case 0xAC1: case 0xAC2: case 0xAC3: case 0xAC4: return "ROM Physical Address Table (IDS OF LOGGED-IN CARDS)"; case 0xAC5: return "Flag: KBD/Reserved For Foreign Screen Editors"; case 0x1131: return "Current X Position"; case 0x1133: return "Current Y Position"; case 0x1135: return "X-Coordinate Destination"; case 0x1137: return "Y-Coordinate Destination"; case 0x1139: return "Line Drawing Variables"; case 0x1149: return "Sign Of Angle"; case 0x114A: return "Sine Of Value Of Angle"; case 0x114C: return "Cosine of Value of Angle"; case 0x114E: return "Temps For Angle Distance Routines"; case 0x1150: return "CIRCLE Center, X Coordinate, BOX POINT 1 X-Coord."; case 0x1152: return "CIRCLE Center, Y Coordinate, BOX POINT 1 Y-Coord."; case 0x1153: return "String Len"; case 0x1154: return "X Radius, BOX Rotation Angle"; case 0x1155: return "String Pos'n Counter"; case 0x1156: return "Y Radius"; case 0x1157: return "New String or Bit Map Byte"; case 0x1158: return "CIRCLE Rotation Angle/Placeholder"; case 0x1159: return "SHAPE Column Length"; case 0x115A: return "BOX: Length of a side"; case 0x115B: return "SHAPE Row Length"; case 0x115C: return "Arc Angle Start"; case 0x115D: return "Temp For Column Length"; case 0x115E: return "Arc Angle End, Char's Col. Counter"; case 0x115F: return "Save SHAPE String Descriptor"; case 0x1160: return "X Radius * COS(Rotation Angle)"; case 0x1161: return "Bit Index Into Byte"; case 0x1162: return "Y Radius * SIN(Rotation Angle)"; case 0x1164: return "X Radius * SIN(Rotation Angle)"; case 0x1166: return "Y Radius * COS(Rotation Angle)"; case 0x1168: return "HIGH BYTE: ADDR OF CHARROM For 'CHAR' CMD."; case 0x1169: return "Temp For GSHAPE"; case 0x116A: return "SCALE Mode Flag"; case 0x116B: return "Double Width Flag"; case 0x116C: return "Box Fill Flag"; case 0x116D: return "Temp For Bit Mask"; case 0x116F: return "Trace Mode: FF = on"; case 0x1170: case 0x1171: case 0x1172: case 0x1173: return "Renumbering Pointers"; case 0x1174: case 0x1175: case 0x1176: return "Directory Work Pointers/Graphic Temp Storage"; case 0x1177: return "Directory Work Pointers"; case 0x117A: case 0x117B: return "Float-fixed Vector [849F]"; case 0x117C: case 0x117D: return "Fixed-float Vector [793C]"; case 0x11E6: return "Sprite X-High Positions"; case 0x11E7: case 0x11E8: return "Sprite Bumb Masks (sprite - backgnd)"; case 0x11E9: case 0x11EA: return "Light Pen Values, X and Y"; case 0x11EB: return "CHRGEN ROM Page, Text Mode [D8]"; case 0x11EC: return "CHRGEN ROM Page, Graphics Mode [D0]"; case 0x11ED: return "Secondary Address For RECORD"; case 0x1200: case 0x1201: return "Previous BASIC Line"; case 0x1202: case 0x1203: return "Pointer: BASIC Statement for CONTINUE"; case 0x1204: return "PRINT USING Fill Symbol"; case 0x1205: return "PRINT USING Comma Symbol"; case 0x1206: return "PRINT USING D.P. Symbol"; case 0x1207: return "Print Using Monetary Symbol"; case 0x1208: return "Used by Error Trapping Routine - Last Err No"; case 0x1209: case 0x120A: return "Line # of Last Error. FFFF if No Error"; case 0x120B: case 0x120C: return "TRAP Address, FFFF=none"; case 0x120D: return "Hold Trap # of Tempor."; case 0x1210: case 0x1211: return "End of Basic, Bank 0"; case 0x1212: case 0x1213: return "Basic Program Limit [FF00]"; case 0x1214: case 0x1215: case 0x1216: case 0x1217: return "DO Work Pointers"; case 0x1218: case 0x1219: case 0x121A: return "USR Program Jump [7D28]"; case 0x121B: case 0x121C: case 0x121D: case 0x121E: case 0x121F: return "RND Seed Value"; case 0x1220: return "Degrees Per CIRCLE Segment"; case 0x1221: return "'Cold' or 'Warm' Reset Status"; case 0x1222: return "Sound Tempo"; case 0x1223: case 0x1224: return "Remaining Note Length LO/HI, Voice 1"; case 0x1225: case 0x1226: return "Remaining Note Length LO/HI, Voice 2"; case 0x1227: case 0x1228: return "Remaining Note Length LO/HI, Voice 3"; case 0x1229: case 0x122A: return "Note Length LO/HI"; case 0x122B: return "Octave"; case 0x122C: return "Flag: 01 = Sharp, FF = Flat"; case 0x122D: case 0x122E: return "Pitch"; case 0x122F: return "Music Sequencer (Voice Number)"; case 0x1230: return "Wave"; case 0x1233: return "Flag: Play Dotted Note"; case 0x1234: case 0x1235: case 0x1236: case 0x1237: return "Note Image"; case 0x1271: case 0x1272: case 0x1273: case 0x1274: return "Note: xx, xx, volume"; case 0x1275: return "Previous Volume Image"; case 0x1276: case 0x1277: case 0x1278: return "Collision IRQ Task Table"; case 0x127F: return "Collision Mask"; case 0x1280: return "Collision Work Value"; case 0x1281: return "SOUND Voice"; case 0x1282: return "SOUND Time LO"; case 0x1285: case 0x1286: case 0x1287: return "SOUND Time HI"; case 0x1288: case 0x1289: case 0x128A: return "SOUND Max LO"; case 0x128B: return "SOUND Max HI"; case 0x128E: return "SOUND Min LO"; case 0x1291: return "SOUND Min HI"; case 0x1294: return "SOUND Direction"; case 0x1297: return "SOUND Step LO"; case 0x129A: return "SOUND Step HI"; case 0x129B: return "SOUND Freq LO"; case 0x12A0: return "SOUND Freq HI"; case 0x12A3: return "Temp Time LO"; case 0x12A4: return "Temp Time HI"; case 0x12A5: return "Temp Max LO"; case 0x12A6: return "Temp Max HI"; case 0x12A7: return "Temp Min LO"; case 0x12A8: return "Temp Min HI"; case 0x12A9: return "Temp Direction"; case 0x12AA: return "Temp Step LO"; case 0x12AB: return "Temp Step HI"; case 0x12AC: return "Temp Freq LO"; case 0x12AD: return "Temp Freq HI"; case 0x12AE: return "Temp Pulse LO"; case 0x12AF: return "Temp Pulse HI"; case 0x12B0: return "Temp Waveform"; case 0x12B1: case 0x12B2: return "PEN/POT Work Values"; case 0x12B7: case 0x12FA: case 0x12FB: return "Used BY SPRDEF & SAVSPR"; case 0x12FC: return "Sprite Number/Used BY SPRDEF & SAVSPR"; case 0x12FD: return "Used by BASIC IRQ to block all but one IRQ call"; case 0x4000: case 0x4001: case 0x4002: return "COLD ENTRY"; case 0x4003: case 0x4004: case 0x4005: return "WARM ENTRY"; case 0x4006: case 0x4007: case 0x4008: return "IRQ ENTRY"; case 0x4009: return "Basic Restart"; case 0x4023: return "Basic Cold Start"; case 0x4045: return "Set-Up Basic Constants"; case 0x4112: return "Chime"; case 0x417A: return "Set Preconfig Registers"; case 0x4189: return "Registers For $D501"; case 0x418D: return "Init Sprite Movement Tabs"; case 0x419B: return "Print Startup Message"; case 0x41BB: return "Startup Message"; case 0x4251: return "Set Basic Links"; case 0x4267: return "Basic Links for $0300"; case 0x4279: return "Chrget For $0380"; case 0x42CE: return "Get From ($50) Bank1"; case 0x42D3: return "Get From ($3f) Bank1"; case 0x42D8: return "Get From ($52) Bank1"; case 0x42DD: return "Get From ($5c) Bank0"; case 0x42E2: return "Get From ($5c) Bank1"; case 0x42E7: return "Get From ($66) Bank1"; case 0x42EC: return "Get From ($61) Bank0"; case 0x4271: return "Get From ($70) Bank0"; case 0x42F6: return "Get From ($70) Bank1"; case 0x42FB: return "Get From ($50) Bank1"; case 0x4300: return "Get From ($61) Bank1"; case 0x4305: return "Get From ($24) Bank0"; case 0x430A: return "Crunch Tokens"; case 0x43CC: return "Move Down Input Buffer"; case 0x43E2: return "Check Keyword Match"; case 0x4417: return "Keywords - Non prefixed"; case 0x4609: return "Keywords - Prefix FE"; case 0x46C9: return "Keywords - Prefix CE"; case 0x46FC: return "Action Vectors"; case 0x47D8: return "Function Vectors"; case 0x4828: return "Defunct Vectors"; case 0x4846: return "Unimplemented Commands"; case 0x484B: return "Error Messages"; case 0x4A82: return "Find Message"; case 0x4A9F: return "Start New Basic Code"; case 0x4B34: return "Update Continue Pointer"; case 0x4B3F: return "Execute/Trace Statement"; case 0x4BCB: return "Perform [stop]"; case 0x4BCD: return "Perform [end]"; case 0x4BF7: return "Setup FN Reference"; case 0x4C86: return "Evaluate <or>"; case 0x4C89: return "Evaluate <and>"; case 0x4CB6: return "Evaluate <compare>"; case 0x4D2A: return "Print 'ready'"; case 0x4D2D: return "'ready.'"; case 0x4D37: return "Error or Ready"; case 0x4DCA: return "Print 'out of memory'"; case 0x4D3C: return "Error"; case 0x4DAF: return "Break Entry"; case 0x4DC3: return "Ready For Basic"; case 0x4DE2: return "Handle New Line"; case 0x4FAF: return "Rechain Lines"; case 0x4F82: return "Reset End-of-Basic"; case 0x4F93: return "Receive Input Line"; case 0x4FAA: return "Search B-Stack For Match"; case 0x4FFE: return "Move B-Stack Down"; case 0x5017: return "Check Memory Space"; case 0x5047: return "Copy B-Stack Pointer"; case 0x5050: return "Set B-Stack Pointer"; case 0x5059: return "Move B-Stack Up"; case 0x5064: return "Find Basic Line"; case 0x50A0: return "Get Fixed Pt Number"; case 0x50E2: return "Perform [list]"; case 0x5123: return "List Subroutine"; case 0x51D6: return "Perform [new]"; case 0x51F3: return "Set Up Run"; case 0x51F8: return "Perform [clr]"; case 0x5238: return "Clear Stack & Work Area"; case 0x5250: return "Pudef Characters"; case 0x5254: return "Back Up Text Pointer"; case 0x5262: return "Perform [return]"; case 0x528F: return "Perform [data/bend]"; case 0x529D: return "Perform [rem]"; case 0x52A2: return "Scan To Next Statement"; case 0x52A5: return "Scan To Next Line"; case 0x52C5: return "Perform [if]"; case 0x5320: return "Search/Skip Begin/Bend"; case 0x537C: return "Skip String Constant"; case 0x5391: return "Perform [else]"; case 0x53A3: return "Perform [on]"; case 0x53C6: return "Perform [let]"; case 0x54F6: return "Check String Location"; case 0x553A: return "Perform [print#]"; case 0x5540: return "Perform [cmd]"; case 0x555A: return "Perform [print]"; case 0x5600: return "Print Format Char"; case 0x5607: return "-print '<cursor right>'-"; case 0x5604: return "-print space-"; case 0x560A: return "-print '?'-"; case 0x5612: return "Perform [get]"; case 0x5635: return "Getkey"; case 0x5648: return "Perform [input#]"; case 0x5662: return "Perform [input]"; case 0x569C: return "Prompt & Input"; case 0x56A9: return "Perform [read]"; case 0x57F4: return "Perform [next]"; case 0x587B: return "Perform [dim]"; case 0x5885: return "Perform [sys]"; case 0x58B4: return "Perform [tron]"; case 0x58B7: return "Perform [troff]"; case 0x58BD: return "Perform [rreg]"; case 0x5901: return "Assign <mid$>"; case 0x5975: return "Perform [auto]"; case 0x5986: return "Perform [help]"; case 0x59AC: return "Insert Help Marker"; case 0x59CF: return "Perform [gosub]"; case 0x59DB: return "Perform [goto]"; case 0x5A15: return "Undef'd Statement"; case 0x5A1D: return "Put Sub To B-Stack"; case 0x5A3D: return "Perform [go]"; case 0x5A60: return "Perform [cont]"; case 0x5A9B: return "Perform [run]"; case 0x5ACA: return "Perform [restore]"; case 0x5AF0: return "Keywords To Renumber"; case 0x5AF8: return "Perform [renumber]"; case 0x5BAE: return "Renumber-Continued"; case 0x5BFB: return "Renumber Scan"; case 0x5D19: return "Convert Line Number"; case 0x5D68: return "Get Renumber Start"; case 0x5D75: return "Count Off Lines"; case 0x5D89: return "Add Renumber Inc"; case 0x5D99: return "Scan Ahead"; case 0x5DA7: return "Set Up Block Move"; case 0x5DC6: return "Block Move Down"; case 0x5DDF: return "Block Move Up"; case 0x5DEE: return "Check Block Limit"; case 0x5DF9: return "Perform [for]"; case 0x5E87: return "Perform [delete]"; case 0x5EFB: return "Get Line Number Range"; case 0x5F34: return "Perform [pudef]"; case 0x5F4D: return "Perform [trap]"; case 0x5F62: return "Perform [resume]"; case 0x5FB7: return "Reinstate Trap Point"; case 0x5FD8: return "Syntax Exit"; case 0x5FDB: return "Print 'can't resume'"; case 0x5FE0: return "Perform [do]"; case 0x6039: return "Perform [exit]"; case 0x608A: return "Perform [loop]"; case 0x60B4: return "Print 'loop not found'"; case 0x60B7: return "Print 'loop without do'"; case 0x60DB: return "Eval While/Until Argument"; case 0x60E1: return "Define Programmed Key"; case 0x610A: return "Perform [key]"; case 0x619D: return "'+chr$('"; case 0x61A8: return "Perform [paint]"; case 0x627C: return "Check Painting Split"; case 0x62B7: return "Perform [box]"; case 0x63F5: return "Authors"; case 0x642B: return "Perform [sshape]"; case 0x658D: return "Perform [gshape]"; case 0x668E: return "Perform [circle]"; case 0x6750: return "Draw Circle"; case 0x6797: return "Perform [draw]"; case 0x67D7: return "Perform [char]"; case 0x6955: return "Perform [locate]"; case 0x6960: return "Perform [scale]"; case 0x69D8: return "Scale Factor Constants"; case 0x69e2: return "Perform [color]"; case 0x6A4C: return "Color Codes"; case 0x6A5C: return "Log Current Colors"; case 0x6A79: return "Perform [scnclr]"; case 0x6B06: return "Fill Memory Page"; case 0x6B17: return "Set Screen Color"; case 0x6B5A: return "Perform [graphic]"; case 0x6BC9: return "Perform [bank]"; case 0x6BD7: return "Perform [sleep]"; case 0x6C09: return "Multiply Sleep Time"; case 0x6C2D: return "Perform [wait]"; case 0x6C4F: return "Perform [sprite]"; case 0x6CB3: return "Bit Masks"; case 0x6CC6: return "Perform [movspr]"; case 0x6DD9: return "Sprite Motion Table Offsets"; case 0x6DE1: return "Perform [play]"; case 0x6E02: return "Analyze Play Character"; case 0x6E66: return "-Filter"; case 0x6E9D: return "-Voice"; case 0x6EA8: return "-Octave"; case 0x6EB2: return "Set SID Sound"; case 0x6EDD: return "-Volume"; case 0x6EFD: return "Play Error"; case 0x6F03: return "Dotted Note"; case 0x6F07: return "Note Length Char"; case 0x6F1E: return "Note A-G"; case 0x6F52: return "...votxum..."; case 0x6F69: return "Sharp"; case 0x6F6C: return "Flat"; case 0x6F78: return "Rest"; case 0x6FD7: return "Perform [tempo]"; case 0x6FE4: return "Voice Times Two "; case 0x6FE7: return "Length Characters"; case 0x6FEC: return "Command Characters "; case 0x6FF2: return "Indexes for Note Symbols "; case 0x6FF9: return "Pitch LO -- NTSC"; case 0x7005: return "Pitch HI -- NTSC"; case 0x7011: return "Envelope A/D Patterns"; case 0x702F: return "Chime Seq"; case 0x7039: return "SID Voice Offsets"; case 0x703C: return "SID Volume Scale"; case 0x7046: return "Perform [filter]"; case 0x70C1: return "Perform [envelope]"; case 0x7164: return "Perform [collision]"; case 0x7190: return "Perform [sprcolor]"; case 0x71B6: return "Perform [width]"; case 0x71C5: return "Perform [vol]"; case 0x71EC: return "Perform [sound]"; case 0x72CC: return "Perform [window]"; case 0x7335: return "Perform [boot]"; case 0x7372: return "Perform [sprdef]"; case 0x7452: return "-Perform [home]"; case 0x7497: return "-Perform [1234]"; case 0x74F4: return "-Perform []"; case 0x74FE: return "-Perform [shift-return]"; case 0x7506: return "-Perform [m]"; case 0x751C: return "-Perform [y]"; case 0x751F: return "-Perform [x]"; case 0x7530: return "-Perform [clr]"; case 0x753F: return "-Perform [right]"; case 0x7542: return "-Perform [left]"; case 0x7564: return "-Perform [up]"; case 0x7567: return "-Perform [down]"; case 0x7576: return "-Perform [a]"; case 0x7581: return "-Perform [return]"; case 0x7588: return "Perform [c]"; case 0x767F: return "SPRDEF Commands"; case 0x7691: return "SPRDEF Command Vectors HI/LO"; case 0x76B5: return "SPRDEF Color Commands"; case 0x76EC: return "Perform [sprsav]"; case 0x77B3: return "Perform [fast]"; case 0x77C4: return "Perform [slow]"; case 0x77D7: return "Type Match Check"; case 0x77DA: return "Confirm Numeric"; case 0x77DD: return "Confirm String"; case 0x77E7: return "Print 'type mismatch'"; case 0x77EA: return "Print 'formula too complex'"; case 0x77EF: return "Evaluate Expression"; case 0x78D7: return "Evaluate Item"; case 0x78FE: return "Constant PI"; case 0x7903: return "Continue Expression"; case 0x7930: return "Evaluate <equal>"; case 0x793C: return "Fixed-Float"; case 0x7950: return "Eval Within Parens"; case 0x7956: return "-Check Right Parenthesis"; case 0x7959: return "-Check Left Parenthesis"; case 0x795C: return "-Check Comma"; case 0x796C: return "Syntax Error"; case 0x7978: return "Search For Variable"; case 0x7A85: return "Unpack RAM1 to FAC#1"; case 0x7AAF: return "Locate Variable"; case 0x7B3C: return "Check Alphabetic"; case 0x7B46: return "Create Variable"; case 0x7CAB: return "Set Up Array"; case 0x7D25: return "Print 'bad subscript'"; case 0x7D28: return "Print 'illegal quantity'"; case 0x7E3E: return "Compute Array Size"; case 0x7E71: return "Array Pointer Subroutine"; case 0x7E82: return "Set Bank patch for [char]"; case 0x7E88: return "Set Bank patch for Screen Print Link"; case 0x7E8E: return "Patch for Renumber Scan"; case 0x7E94: return "Patch for [delete]"; case 0x7EA6: return "Patch for Note A-G"; case 0x7EB9: return "Pitch LO -- PAL"; case 0x7EC5: return "Pitch HI -- PAL"; case 0x7ED1: return "String Stack patch for Error"; case 0x7ED9: return "Unused"; case 0x7FC0: return "Copyright Banner"; case 0x7FFC: return "Checksum (?)"; case 0x8000: return "Evaluate <fre>"; case 0x8020: return "Decrypt Message"; case 0x803A: return "-Free in Bank 1"; case 0x804A: return "Evaluate <val>"; case 0x8052: return "String to Float"; case 0x8076: return "Evaluate <dec>"; case 0x80C5: return "Evaluate <peek>"; case 0x80E5: return "Perform [poke]"; case 0x80F6: return "Evaluate <err$>"; case 0x8139: return "Swap x With y"; case 0x8142: return "Evaluate <hex$>"; case 0x816B: return "Byte to Hex"; case 0x8182: return "Evaluate <rgr>"; case 0x818C: return "Get Graphics Mode"; case 0x819B: return "Evaluate <rclr>"; case 0x81F3: return "CRTC Color Codes"; case 0x8203: return "Evaluate <joy>"; case 0x8242: return "Joystick Values"; case 0x824D: return "Evaluate <pot>"; case 0x82AE: return "Evaluate <pen>"; case 0x82FA: return "Evaluate <pointer>"; case 0x831E: return "Evaluate <rsprite>"; case 0x835B: return "VIC Sprite Register Numbers "; case 0x8361: return "Evaluate <rspcolor>"; case 0x837C: return "Evaluate <bump>"; case 0x8397: return "Evaluate <rspos>"; case 0x83E1: return "Evaluate <xor>"; case 0x8407: return "Evaluate <rwindow>"; case 0x8434: return "Evaluate <rnd>"; case 0x8490: return "Rnd Multiplier"; case 0x849A: return "Value 32768"; case 0x849F: return "Float-Fixed Unsigned"; case 0x84A7: return "Evaluate Fixed Number"; case 0x84AD: return "Float-Fixed Signed"; case 0x84C9: return "Float (.y, .a)"; case 0x84D0: return "Evaluate <pos>"; case 0x84D4: return "Byte To Float"; case 0x84D9: return "Check Direct"; case 0x84DD: return "Print 'illegal direct'"; case 0x84E0: return "Print 'undef'd function'"; case 0x84E5: return "Set Up 16 Bit Fix-Float"; case 0x84F0: return "Check Direct"; case 0x84F5: return "Print 'direct mode only'"; case 0x84FA: return "Perform [def]"; case 0x8528: return "Check FN Syntax"; case 0x853B: return "Perform [fn]"; case 0x85AE: return "Evaluate <str$>"; case 0x85BF: return "Evaluate <chr$>"; case 0x85D6: return "Evaluate <left$>"; case 0x860A: return "Evaluate <right$>"; case 0x861C: return "Evaluate <mid$>"; case 0x864D: return "Pull String Parameters"; case 0x8668: return "Evaluate <len>"; case 0x866E: return "Exit String Mode"; case 0x8677: return "Evaluate <asc>"; case 0x8688: return "Calc String Vector"; case 0x869A: return "Set Up String"; case 0x874E: return "Build String to Memory"; case 0x877B: return "Evaluate String"; case 0x87E0: return "Clean Descriptor Stack"; case 0x87F1: return "Input Byte Parameter"; case 0x87F4: return "-Eval Byte Parameter"; case 0x8803: return "Params For Poke/Wait"; case 0x880F: return "Input Next Float/Fixed Value"; case 0x8812: return "-Input Float/Fixed Value"; case 0x8815: return "Float/Fixed"; case 0x882E: return "Subtract From Memory"; case 0x8831: return "Evaluate <subtract>"; case 0x8845: return "Add Memory"; case 0x8848: return "Evaluate <add>"; case 0x88D6: return "Zero Both Accuymulators"; case 0x8917: return "Trim FAC#1 Left"; case 0x8926: return "Negate FAC#1"; case 0x894E: return "Round Up FAC#1"; case 0x895D: return "Print 'overflow'"; case 0x899C: return "Log Series: 1.00"; case 0x89A1: return "Log Series: #03 (counter)"; case 0x89A2: return "Log Series: 0.434255942"; case 0x89A7: return "Log Series: 0.57658454"; case 0x89AC: return "Log Series: 0.961800759"; case 0x89B1: return "Log Series: 2.885390073"; case 0x89B6: return "Log Series: 0.707106781 SQR(0.5)"; case 0x89BB: return "Log Series: 1.41421356 SRQ(2)"; case 0x89C0: return "Log Series: -0.5"; case 0x89C5: return "Log Series: 0.693147181 LOG(2)"; case 0x89CA: return "Evaluate <log>"; case 0x8A0E: return "Add 0.5"; case 0x8A12: return "Add Memory At A/Y"; case 0x8A18: return "Subtract Memory At A/Y"; case 0x8A1E: return "Divide By Memory"; case 0x8A24: return "Multiply By Memory"; case 0x8A27: return "Evaluate <multiply>"; case 0x8A89: return "Unpack ROM to FAC#2"; case 0x8AB4: return "Unpack RAM1 to FAC#2"; case 0x8AEC: return "Test Both Accumulators"; case 0x8B09: return "Overflow/Underflow"; case 0x8B17: return "Multiply By 10"; case 0x8B2E: return "+10"; case 0x8B33: return "Print 'division by zero'"; case 0x8B38: return "Divide By 10"; case 0x8B49: return "Divide Into Memory"; case 0x8B4C: return "Evaluate <divide>"; case 0x8BD4: return "Unpack ROM to FAC#1"; case 0x8BF9: return "Pack FAC#1 to $5e"; case 0x8BFC: return "Pack FAC#1 to $59"; case 0x8C00: return "Pack FAC#1 to RAM1"; case 0x8C28: return "FAC#2 to FAC#1"; case 0x8C38: return "FAC#1 to FAC#2"; case 0x8C47: return "Round FAC#1"; case 0x8C57: return "Get Sign"; case 0x8C65: return "Evaluate <sgn>"; case 0x8C68: return "Byte Fixed-Float"; case 0x8C75: return "Fixed-Float"; case 0x8C84: return "Evaluate <abs>"; case 0x8C87: return "Compare FAC#1 to Memory"; case 0x8CC7: return "Float-Fixed"; case 0x8CFB: return "Evaluate <int>"; case 0x8D22: return "String to FAC#1"; case 0x8DB0: return "Get Ascii Digit"; case 0x8E17: return "String Conversion Constants: 99999999.9"; case 0x8E1C: return "String Conversion Constants: 999999999"; case 0x8E21: return "String Conversion Constants: 1000000000"; case 0x8E26: return "Print 'in...'"; case 0x8E32: return "Print Integer"; case 0x8E42: return "Float to Ascii"; case 0x8F76: return "+0.5"; case 0x8F7B: return "Decimal Constants"; case 0x8F9F: return "TI Constants"; case 0x8FB7: return "Evaluate <sqr>"; case 0x8FBE: return "Raise to Memory Power"; case 0x8FC1: return "Evaluate <power>"; case 0x8FFA: return "Evaluate <negate>"; case 0x9005: return "Exp Series: 1.44269504 (1/LOG to base 2 e)"; case 0x900A: return "Exp Series: #07 (counter)"; case 0x900B: return "Exp Series: 2.149875 E-5"; case 0x9010: return "Exp Series: 1.435231 E-4"; case 0x9015: return "Exp Series: 1.342263 E-3"; case 0x901A: return "Exp Series: 9.6414017 E-3"; case 0x901F: return "Exp Series: 5.550513 E-2"; case 0x9024: return "Exp Series: 2.402263 E-4"; case 0x9029: return "Exp Series: 6.931471 E-1"; case 0x902E: return "Exp Series: 1.00"; case 0x9033: return "Evaluate <exp>"; case 0x90D0: return "I/O Error Message"; case 0x90D8: return "Basic 'open'"; case 0x90DF: return "Basic 'chrout'"; case 0x90E5: return "Basic 'input'"; case 0x90EB: return "Redirect Output"; case 0x90FD: return "Redirect Input"; case 0x9112: return "Perform [save]"; case 0x9129: return "Perform [verify]"; case 0x912C: return "Perform [load]"; case 0x918D: return "Perform [open]"; case 0x919A: return "Perform [close]"; case 0x91AE: return "Get Load/Save Parameters"; case 0x91DD: return "Get Next Byte Value"; case 0x91E3: return "Get Character or Abort"; case 0x91EB: return "Move to Next Parameter"; case 0x91F6: return "Get Open/Close Parameters"; case 0x9243: return "Release I/O String"; case 0x9251: return "Call 'status'"; case 0x9257: return "Call 'setlfs'"; case 0x925D: return "Call 'setnam'"; case 0x9263: return "Call 'getin'"; case 0x9269: return "Call 'chrout'"; case 0x926F: return "Call 'clrchn'"; case 0x9275: return "Call 'close'"; case 0x927B: return "Call 'clall'"; case 0x9281: return "Print Following Text"; case 0x9287: return "Set Load/Save Bank"; case 0x928D: return "Call 'plot'"; case 0x9293: return "Call 'test stop'"; case 0x9299: return "Make Room For String"; case 0x92EA: return "Garbage Collection"; case 0x9409: return "Evaluate <cos>"; case 0x9410: return "Evaluate <sin>"; case 0x9459: return "Evaluate <tan>"; case 0x9485: return "Trig Series: 1.570796327 pi/2"; case 0x948A: return "Trig Series: 6.28318531 pi*2"; case 0x948F: return "Trig Series: 0.25"; case 0x9494: return "Trig Series: #05 (counter)"; case 0x9495: return "Trig Series: -14.3813907"; case 0x949A: return "Trig Series: 42.0077971"; case 0x949F: return "Trig Series: -76.7041703"; case 0x94A4: return "Trig Series: 81.6052237"; case 0x94A9: return "Trig Series: -41.3417021"; case 0x94AE: return "Trig Series: 6.28318531"; case 0x94B3: return "Evaluate <atn>"; case 0x94E3: return "ATN Series: #0b (counter)"; case 0x94E4: return "ATN Series: -0.000684793912"; case 0x94E9: return "ATN Series: 0.00485094216"; case 0x94EE: return "ATN Series: -0.161117018"; case 0x94F3: return "ATN Series: 0.034209638"; case 0x94F8: return "ATN Series: -0.0542791328"; case 0x94FD: return "ATN Series: 0.0724571965"; case 0x9502: return "ATN Series: -0.0898023954"; case 0x9507: return "ATN Series: 0.110932413"; case 0x950C: return "ATN Series: -0.142839808"; case 0x9511: return "ATN Series: 0.19999912"; case 0x9516: return "ATN Series: -0.333333316"; case 0x951B: return "ATN Series: 1.00"; case 0x9520: return "Print Using"; case 0x99C1: return "Evaluate <instr>"; case 0x9B0C: return "Evaluate <rdot>"; case 0x9B30: return "Draw Line"; case 0x9BFB: return "Plot Pixel"; case 0x9C49: return "Examine Pixel"; case 0x9C70: return "Set Hi-Res Color Cell"; case 0x9CCA: return "Video Matrix Lines Hi"; case 0x9CE3: return "Position Pixel"; case 0x9D1C: return "Bit Masks "; case 0x9D24: return "Calc Hi-Res Row/Column"; case 0x9D67: return "Calculate Graphics Coordinates"; case 0x9D6D: return "Add Graphics Coordinate"; case 0x9D7C: return "Subtract Graphics Coordinate"; case 0x9D8F: return "Read Current X Position to A/Y"; case 0x9DF2: return "Restore Pixel Cursor"; case 0x9E06: return "Check Optional Float/Fixed Parameter"; case 0x9E1C: return "Input Optional Byte Parameter/-Check Byte Parameter in List"; case 0x9E2F: return "Parse Graphics Command"; case 0x9E32: return "Get Color Source Param"; case 0x9F25: return "Multicolor Pixel Masks"; case 0x9F29: return "Conv Words Hi"; case 0x9F3D: return "Conv Words Lo"; case 0x9F4F: return "Allocate 9K Graphics Area for graphic/sprdef"; case 0xA022: return "Move Basic to $1c01"; case 0xA07E: return "Perform [catalog/directory]"; case 0xA11D: return "Perform [dopen]"; case 0xA134: return "Perform [append]"; case 0xA157: return "Find Spare SA"; case 0xA16F: return "Perform [dclose]"; case 0xA18C: return "Perform [dsave]"; case 0xA1A4: return "Perform [dverify]"; case 0xA1A7: return "Perform [dload]"; case 0xA1C8: return "Perform [bsave]"; case 0xA218: return "Perform [bload]"; case 0xA267: return "Perform [header]"; case 0xA2A1: return "Perform [scratch]"; case 0xA2D7: return "Perform [record]"; case 0xA322: return "Perform [dclear]"; case 0xA32F: return "Perform [collect]"; case 0xA346: return "Perform [copy]"; case 0xA362: return "Perform [concat]"; case 0xA36E: return "Perform [rename]"; case 0xA37C: return "Perform [backup]"; case 0xA3B8: return "Default DOS Disk Unit (U8 D0)"; case 0xA3BC: return "DOS Logical Address"; case 0xA3BD: return "DOS Physical Address"; case 0xA3BE: return "DOS Secondary Address"; case 0xA3BF: return "Parse DOS Commands"; case 0xA5E7: return "Print 'missing file name'"; case 0xA5EA: return "Print 'illegal device number'"; case 0xA5ED: return "Print 'string too long'"; case 0xA627: return "DOS Command Masks "; case 0xA667: return "Set DOS Parameters"; case 0xA7E1: return "Print 'are you sure'"; case 0xA7E8: return "'are you sure?'"; case 0xA80D: return "Release String"; case 0xA82A: return "'key 0,'"; case 0xA845: return "Set Bank 15"; case 0xA84D: return "IRQ Work"; case 0xAA1F: return "Perform [stash]"; case 0xAA24: return "Perform [fetch]"; case 0xAA29: return "Perform [swap]"; case 0xAA6E: return "Patch for Print Using"; case 0xAA81: return "Unused"; case 0xAE64: return "Encrypted Message"; case 0xAF00: case 0xAF01: case 0xAF02: return "Convert F.P. to Integer"; case 0xAF03: case 0xAF04: case 0xAF05: return "Convert Integer to F.P."; case 0xAF06: case 0xAF07: case 0xAF08: return "Convert F.P. to ASCII String"; case 0xAF09: case 0xAF0A: case 0xAF0B: return "Convert ASCII String to F.P."; case 0xAF0C: case 0xAF0D: case 0xAF0E: return "Convert F.P. to an Address"; case 0xAF0F: case 0xAF10: case 0xAF11: return "Convert Address to F.P."; case 0xAF12: case 0xAF13: case 0xAF14: return "MEM - FACC"; case 0xAF15: case 0xAF16: case 0xAF17: return "ARG - FACC"; case 0xAF18: case 0xAF19: case 0xAF1A: return "MEM + FACC"; case 0xAF1B: case 0xAF1C: case 0xAF1D: return "ARG - FACC"; case 0xAF1E: case 0xAF1F: case 0xAF20: return "MEM * FACC"; case 0xAF21: case 0xAF22: case 0xAF23: return "ARG * FACC"; case 0xAF24: case 0xAF25: case 0xAF26: return "MEM / FACC"; case 0xAF27: case 0xAF28: case 0xAF29: return "ARG / FACC"; case 0xAF2A: case 0xAF2B: case 0xAF2C: return "Compute Natural LOG Of FACC"; case 0xAF2D: case 0xAF2E: case 0xAF2F: return "Perform BASIC INT On FACC"; case 0xAF30: case 0xAF31: case 0xAF32: return "Compute Square Root OF FACC"; case 0xAF33: case 0xAF34: case 0xAF35: return "Negate FACC"; case 0xAF36: case 0xAF37: case 0xAF38: return "Raise ARG to The Mem Power"; case 0xAF39: case 0xAF3A: case 0xAF3B: return "Raise ARG to The FACC Power"; case 0xAF3C: case 0xAF3D: case 0xAF3E: return "Compute EXP Of FACC"; case 0xAF3F: case 0xAF40: case 0xAF41: return "Compute COS Of FACC"; case 0xAF42: case 0xAF43: case 0xAF44: return "Compute SIN Of FACC"; case 0xAF45: case 0xAF46: case 0xAF47: return "Compute TAN Of FACC"; case 0xAF48: case 0xAF49: case 0xAF4A: return "Compute ATN Of FACC"; case 0xAF4B: case 0xAF4C: case 0xAF4D: return "Round FACC"; case 0xAF4E: case 0xAF4F: case 0xAF50: return "Absolute Value Of FACC"; case 0xAF51: case 0xAF52: case 0xAF53: return "Test Sign Of FACC"; case 0xAF54: case 0xAF55: case 0xAF56: return "Compare FACC With Memory"; case 0xAF57: case 0xAF58: case 0xAF59: return "Generate Random F.P. Number"; case 0xAF5A: case 0xAF5B: case 0xAF5C: return "Move RAM MEM to ARG"; case 0xAF5D: case 0xAF5E: case 0xAF5F: return "Move ROM MEM to ARG"; case 0xAF60: case 0xAF61: case 0xAF62: return "Move RAM MEM to FACC"; case 0xAF63: case 0xAF64: case 0xAF65: return "Move ROM MEM to FACC"; case 0xAF66: case 0xAF67: case 0xAF68: return "Move FACC to MEM"; case 0xAF69: case 0xAF6A: case 0xAF6B: return "Move ARG to FACC"; case 0xAF6C: case 0xAF6D: case 0xAF6E: return "Move FACC to ARG"; case 0xAFA8: return "Unused"; case 0xB000: case 0xB001: case 0xB002: return "MONITOR Call Entry"; case 0xB003: case 0xB004: case 0xB005: return "MONITOR Break Entry"; case 0xB006: case 0xB007: case 0xB008: return "MONITOR Command Parser Entry"; case 0xB009: return "Print 'break'"; case 0xB00C: return "'break'"; case 0xB021: return "Print 'call' entry"; case 0xB03A: return "Print 'monitor'"; case 0xB03D: return "'monitor'"; case 0xB050: return "Perform [r]/Print 'pc sr ac xr yr sp'"; case 0xB053: return "'pc sr ac xr yr sp'"; case 0xB08D: return "Get Command"; case 0xB0BC: return "Error"; case 0xB0BF: return "'?'"; case 0xB0E3: return "Perform [x]"; case 0xB0E6: return "Commands"; case 0xB0FC: return "Vectors"; case 0xB11A: return "Read Banked Memory"; case 0xB12A: return "Write Banked Memory"; case 0xB13D: return "Compare Banked Memory"; case 0xB152: return "Perform [m]"; case 0xB194: return "Perform [:]"; case 0xB1AB: return "Perform [>]"; case 0xB1C9: return "Print 'esc-o-up'"; case 0xB1CC: return "'esc-o-up'"; case 0xB1D6: return "Perform [g]"; case 0xB1DF: return "Perform [j]"; case 0xB1E8: return "Display Memory"; case 0xB20B: return "Print ':<rvs-on>'"; case 0xB20E: return "':<rvs-on>'"; case 0xB231: return "Perform [c]"; case 0xB234: return "Perform [t]"; case 0xB2C3: return "Add 1 to Op 3"; case 0xB2C6: return "Do Next Address"; case 0xB2CE: return "Perform [h]"; case 0xB337: return "Perform [lsv]"; case 0xB3C4: return "Print 'error'"; case 0xB3DB: return "Perform [f]"; case 0xB406: return "Perform [a]"; case 0xB533: return "Print 'space<esc-q>'"; case 0xB57C: return "Check 2 A-Matches"; case 0xB57F: return "Check A-Match"; case 0xB58B: return "Try Next Op Code"; case 0xB599: return "Perform [d]"; case 0xB5AE: return "Print '<cr><esc-q>'"; case 0xB5B1: return "'<cr><esc-q>'"; case 0xB5D4: return "Display Instruction"; case 0xB5F2: return "Print '<3 spaces>'"; case 0xB5F5: return "'<3 spaces>'"; case 0xB659: return "Classify Op Code"; case 0xB6A1: return "Get Mnemonic Char"; case 0xB6C3: return "Mode Tables"; case 0xB715: return "Mode Characters"; case 0xB721: return "Compacted Mnemonics"; case 0xB7A5: return "Input Parameter"; case 0xB7CE: return "Read Value"; case 0xB88A: return "Number Bases"; case 0xB88E: return "Base Bits"; case 0xB892: return "Display 5-Digit Address"; case 0xB8A5: return "Display 2-digit Byte"; case 0xB8A8: return "Print Space"; case 0xB8AD: return "Print Cursor-Up"; case 0xB8B4: return "New Line"; case 0xB8B9: return "Blank New Line"; case 0xB8C2: return "Output 2-Digit Byte"; case 0xB8D2: return "Byte to 2 Ascii"; case 0xB8E7: return "Get Input Char"; case 0xB8E9: return "Get Character"; case 0xB901: return "Copy Add0 to Add2"; case 0xB90E: return "Calculate Add2 - Add0"; case 0xB922: return "Subtract Add0"; case 0xB93C: return "Subtract Add1"; case 0xB950: return "Increment Pointer"; case 0xB960: return "Decrement Pointer"; case 0xB874: return "Copy to Register Area"; case 0xB983: return "Calculate Step/Area"; case 0xB9B1: return "Perform [$+&%]"; case 0xBA07: return "Convert to Decimal"; case 0xBA47: return "Transfer Address"; case 0xBA5D: return "Output Address"; case 0xBA90: return "Perform [@]"; case 0xBB72: return "Unused"; case 0xBFC0: return "Copyright Banner"; case 0xBFFC: return "Checksum (?)"; case 0xC000: case 0xC001: case 0xC002: return "Initialize Editor & Screen"; case 0xC003: case 0xC004: case 0xC005: return "Display Charac in .A, Color"; case 0xC006: case 0xC007: case 0xC008: return "Get Key From IRQ Buffer"; case 0xC009: case 0xC00A: case 0xC00B: return "Into A"; case 0xC00C: case 0xC00D: case 0xC00E: return "Print Character In .A"; case 0xC00F: case 0xC010: case 0xC011: return "Get # of Scrn Rows, Cols Into X & Y"; case 0xC012: case 0xC013: case 0xC014: return "Scan Keyboard Subroutine"; case 0xC015: case 0xC016: case 0xC017: return "Handle Repeat Key & Store Decoded Key"; case 0xC018: case 0xC019: case 0xC01A: return "Read Or Set CRSR Position In X, Y"; case 0xC01B: case 0xC01C: case 0xC01D: return "Move 8563 Cursor Subroutine"; case 0xC01E: case 0xC01F: case 0xC020: return "Execute ESC Function using chr in .A"; case 0xC021: case 0xC022: case 0xC023: return "Redefine A Programmable Func'n Key"; case 0xC024: case 0xC025: case 0xC026: return "IRQ Entry"; case 0xC027: case 0xC028: case 0xC029: return "Initialize 80-Column Character Set"; case 0xC02A: case 0xC02B: case 0xC02C: return "Swap Editor Locals (in 40/80 change)"; case 0xC02D: case 0xC02E: case 0xC02F: return "Set Top-Left or Bot-Right of Window"; case 0xC033: return "Screen Address Low"; case 0xC04C: return "Screen Address High"; case 0xC065: return "I/O Link Vectors"; case 0xC06F: return "Keyboard Shift Vectors"; case 0xC07B: return "Initialize Screen"; case 0xC142: return "Reset Window"; case 0xC150: return "Home Cursor"; case 0xC156: return "Goto Left Border"; case 0xC15C: return "Set Up New Line"; case 0xC17C: return "Do Screen Color"; case 0xC194: return "(IRQ) Split Screen"; case 0xC234: return "Get a Key"; case 0xC258: return "Screen Line Editor"; case 0xC29B: return "Input From Screen"; case 0xC2BC: return "Read Screen Char"; case 0xC2FF: return "Check For Quotes"; case 0xC30C: return "Wrap Up Screen Print"; case 0xC320: return "Ascii to Screen Code"; case 0xC33E: return "Check Cursor Range"; case 0xC363: return "Do New Line"; case 0xC37C: return "Insert a Line"; case 0xC3A6: return "Scroll Screen"; case 0xC3DC: return "Delete a Line"; case 0xC40D: return "Move Screen Line"; case 0xC4A5: return "Clear a Line"; case 0xC53C: return "Set 80-Column Counter to 1"; case 0xC53E: return "Set 80-Column Counter"; case 0xC55D: return "Keyboard Scan Subroutine"; case 0xC651: return "Key Pickup & Repeat"; case 0xC6DD: return "Keycodes for Programmed Keys"; case 0xC6E7: return "Flash 40 Column Cursor"; case 0xC72D: return "Print to Screen"; case 0xC77D: return "Esc-o (escape)"; case 0xC78C: return "Control Characters"; case 0xC79A: return "Control Character Vectors"; case 0xC7B6: return "Print Control Char"; case 0xC802: return "Print Hi-Bit Char"; case 0xC854: return "Chr$(29) Cursor Right"; case 0xC85A: return "Chr$(17) Cursor Down"; case 0xC875: return "Chr$(157) Cursor Left"; case 0xC880: return "Chr$(14) Text Mode"; case 0xC8A6: return "Chr$(11) Lock"; case 0xC8AC: return "Chr$(12) Unlock"; case 0xC8B3: return "Chr$(19) Home"; case 0xC8BF: return "Chr$(146) Clear Rvs Mode"; case 0xC8C2: return "Chr$(18) Reverse"; case 0xC8C7: return "Chr$(2) Underline On"; case 0xC8CE: return "Chr$(130) Underline Off"; case 0xC8D5: return "Chr$(15) Flash On"; case 0xC8DC: return "Chr$(143) Flash Off"; case 0xC8E3: return "Open Screen Space"; case 0xC91B: return "Chr$(20) Delete"; case 0xC932: return "Restore Cursor"; case 0xC94F: return "Chr$(9) Tab"; case 0xC961: return "Chr$(24) Tab Toggle"; case 0xC96C: return "Find Tab Column"; case 0xC980: return "Esc-z Clear All Tabs"; case 0xC983: return "Esc-y Set Default Tabs"; case 0xC98E: return "Chr$(7) Bell"; case 0xC9B1: return "Chr$(10) Linefeed"; case 0xC9BE: return "Analyze Esc Sequence"; case 0xC9DE: return "Esc Sequence Vectors"; case 0xCA14: return "Esc-t Top"; case 0xCA16: return "Esc-b Bottom"; case 0xCA1B: return "Set Window Part"; case 0xCA24: return "Exit Window"; case 0xC052: return "Esc-d Delete Line"; case 0xC076: return "Esc-q Erase End"; case 0xC08B: return "Esc-p Erase Begin"; case 0xCA9F: return "Esc-@ Clear Remainder of Screen"; case 0xCABC: return "Esc-v Scroll Up"; case 0xCACA: return "Esc-w Scroll Down"; case 0xCAE2: return "Esc-l Scroll On"; case 0xCAE5: return "Esc-m Scroll Off"; case 0xCAEA: return "Esc-c Cancel Auto Insert"; case 0xCAED: return "Esc-a Auto Insert"; case 0xCAF2: return "Esc-s Block Cursor"; case 0xCAFE: return "Esc-u Underline Cursor"; case 0xCB0B: return "Esc-e Cursor Non Flash"; case 0xCB21: return "Esc-f Cursor Flash"; case 0xCB37: return "Esc-g Bell Enable"; case 0xCB3A: return "Esc-h Bell Disable"; case 0xCB3F: return "Esc-r Screen Reverse"; case 0xCB48: return "Esc-n Screen Normal"; case 0xCB52: return "Esc-k End-of-Line"; case 0xCB58: return "Get Screen Char/Color"; case 0xCB74: return "Check Screen Line of Location"; case 0xCB81: return "Extend/Trim Screen Line"; case 0xCB9F: return "Set Up Line Masks"; case 0xCBB1: return "Esc-j Start-of-Line"; case 0xCBC3: return "Find End-of-Line"; case 0xCBED: return "Move Cursor Right"; case 0xCC00: return "Move Cursor Left"; case 0xCC1E: return "Save Cursor"; case 0xCC27: return "Print Space"; case 0xCC2F: return "Print Character"; case 0xCC32: return "Print Fill Color"; case 0xCC34: return "Put Char to Screen"; case 0xCC5B: return "Get Rows/Columns"; case 0xCC6A: return "Read/Set Cursor"; case 0xCCA2: return "Define Function Key"; case 0xCD2D: return "Esc-x Switch 40/80 Col"; case 0xCD57: return "Position 80-col Cursor"; case 0xCD6F: return "Set Screen Color"; case 0xCD9F: return "Turn Cursor On"; case 0xCDCA: return "Set CRTC Register 31"; case 0xCDCC: return "Set CRTC Register"; case 0xCDD8: return "Read CRTC Register 31"; case 0xCDDA: return "Read CRTC Register"; case 0xCDE6: return "Set CRTC to Screen Address"; case 0xCDF9: return "Set CRTC to Color Address"; case 0xCE0C: return "Set Up 80 Column Char Set"; case 0xCE4C: return "Ascii Color Codes"; case 0xCE5C: return "System Color Codes"; case 0xCE6C: return "Bit Masks"; case 0xCE74: return "40-col Init Values ($e0)"; case 0xCE8E: return "80-col Init Values ($0a40)"; case 0xCE8A: return "Prog Key Lengths"; case 0xCEB2: return "Prog Key Definitions"; case 0xCEF5: return "Unused"; case 0xD000: return "Position X sprite 0"; case 0xD001: return "Position Y sprite 0"; case 0xD002: return "Position X sprite 1"; case 0xD003: return "Position Y sprite 1"; case 0xD004: return "Position X sprite 2"; case 0xD005: return "Position Y sprite 2"; case 0xD006: return "Position X sprite 3"; case 0xD007: return "Position Y sprite 3"; case 0xD008: return "Position X sprite 4"; case 0xD009: return "Position Y sprite 4"; case 0xD00A: return "Position X sprite 5"; case 0xD00B: return "Position Y sprite 5"; case 0xD00C: return "Position X sprite 6"; case 0xD00D: return "Position Y sprite 6"; case 0xD00E: return "Position X sprite 7"; case 0xD00F: return "Position Y sprite 7"; case 0xD010: return "Position X MSB sprites 0..7"; case 0xD011: return "VIC control register"; case 0xD012: return "Reading/Writing IRQ balance value"; case 0xD013: return "Position X of optic pencil \"latch\""; case 0xD014: return "Position Y of optic pencil \"latch\""; case 0xD015: return "Sprites Abilitator"; case 0xD016: return "VIC control register"; case 0xD017: return "(2X) vertical expansion (Y) sprite 0..7"; case 0xD018: return "VIC memory control register"; case 0xD019: return "Interrupt indicator register"; case 0xD01A: return "IRQ mask register"; case 0xD01B: return "Sprite-background screen priority"; case 0xD01C: return "Set multicolor mode for sprite 0..7"; case 0xD01D: return "(2X) horizontal expansion (X) sprite 0..7"; case 0xD01E: return "Animations contact"; case 0xD01F: return "Animation/background contact"; case 0xD020: return "Border color"; case 0xD021: return "Background 0 color"; case 0xD022: return "Background 1 color"; case 0xD023: return "Background 2 color"; case 0xD024: return "Background 3 color"; case 0xD025: return "Multicolor animation 0 register"; case 0xD026: return "Multicolor animation 1 register"; case 0xD027: return "Color sprite 0"; case 0xD028: return "Color sprite 1"; case 0xD029: return "Color sprite 2"; case 0xD02A: return "Color sprite 3"; case 0xD02B: return "Color sprite 4"; case 0xD02C: return "Color sprite 5"; case 0xD02D: return "Color sprite 6"; case 0xD02E: return "Color sprite 7"; case 0xD400: return "Voice 1: Frequency control (lo byte)"; case 0xD401: return "Voice 1: Frequency control (hi byte)"; case 0xD402: return "Voice 1: Wave form pulsation amplitude (lo byte)"; case 0xD403: return "Voice 1: Wave form pulsation amplitude (hi byte)"; case 0xD404: return "Voice 1: Control registers"; case 0xD405: return "Generator 1: Attack/Decay"; case 0xD406: return "Generator 1: Sustain/Release"; case 0xD407: return "Voice 2: Frequency control (lo byte)"; case 0xD408: return "Voice 2: Frequency control (hi byte)"; case 0xD409: return "Voice 2: Wave form pulsation amplitude (lo byte)"; case 0xD40A: return "Voice 2: Wave form pulsation amplitude (hi byte)"; case 0xD40B: return "Voice 2: Control registers"; case 0xD40C: return "Generator 2: Attack/Decay"; case 0xD40D: return "Generator 2: Sustain/Release"; case 0xD40E: return "Voice 3: Frequency control (lo byte)"; case 0xD40F: return "Voice 3: Frequency control (hi byte)"; case 0xD410: return "Voice 3: Wave form pulsation amplitude (lo byte)"; case 0xD411: return "Voice 3: Wave form pulsation amplitude (hi byte)"; case 0xD412: return "Voice 3: Control registers"; case 0xD413: return "Generator 3: Attack/Decay"; case 0xD414: return "Generator 3: Sustain/Release"; case 0xD415: return "Filter cut frequency: lo byte (bit 2-0)"; case 0xD416: return "Filter cut frequency: hi byte"; case 0xD417: return "Filter resonance control/voice input control"; case 0xD418: return "Select volume and filter mode"; case 0xD419: return "Analog/digital converter: Paddle 1"; case 0xD41A: return "Analog/digital converter: Paddle 2"; case 0xD41B: return "Random numbers generator oscillator 3"; case 0xD41C: return "Generator output"; case 0xD500: return "Configuration Register (CR)"; case 0xD501: return "Preconfiguration Registers"; case 0xD505: return "Modality register"; case 0xD506: return "RAM Configuration Register (RCR)"; case 0xD507: return "Zero Page Pointer Lo"; case 0xD508: return "Zero Page Pointer Hi"; case 0xD509: return "Stack Page Pointer Lo"; case 0xD50A: return "Stack Page Pointer Hi"; case 0xD50B: return "MMU Version Register"; case 0xD600: return "VDC 8563: Horizontal Total"; case 0xD601: return "VDC 8563: Horizontal Displayed"; case 0xD602: return "VDC 8563: Horizontal Sync Position"; case 0xD603: return "VDC 8563: Vert/Horiz. Sync Width"; case 0xD604: return "VDC 8563: Vertical Total"; case 0xD605: return "VDC 8563: Vertical Total Fine Adju"; case 0xD606: return "VDC 8563: Vertical Displayed"; case 0xD607: return "VDC 8563: Vertical Sync Position"; case 0xD608: return "VDC 8563: Interlace Mode"; case 0xD609: return "VDC 8563: Character Total Vertical"; case 0xD60A: return "VDC 8563: Cursor Mode/ Start Scan"; case 0xD60B: return "VDC 8563: Cursor End Scan"; case 0xD60C: return "VDC 8563: Display Start Adrs (Hi)"; case 0xD60D: return "VDC 8563: Display Start Adrs (Lo)"; case 0xD60E: return "VDC 8563: Cursor Position (Hi)"; case 0xD60F: return "VDC 8563: Cursor Position (Lo)"; case 0xD610: return "VDC 8563: Light Pen Veritcal"; case 0xD611: return "VDC 8563: Light Pen Horizontal"; case 0xD612: return "VDC 8563: Update Address (Hi)"; case 0xD613: return "VDC 8563: Update Address (Lo)"; case 0xD614: return "VDC 8563: Attribute Start Adrs (Hi)"; case 0xD615: return "VDC 8563: Attribute Start Adrs (Lo)"; case 0xD616: return "VDC 8563: Hz Chr Pxl Ttl/IChar Spc "; case 0xD617: return "VDC 8563: Vert. Character Pxl Spc"; case 0xD618: return "VDC 8563: Block/Rvs Scr/V. Scroll"; case 0xD619: return "VDC 8563: Diff. Mode Sw/H. Scroll"; case 0xD61A: return "VDC 8563: ForeGround/BackGround Col"; case 0xD61B: return "VDC 8563: Row/Adrs. Incremen"; case 0xD61C: return "VDC 8563: Character Set Addrs/Ram"; case 0xD61D: return "VDC 8563: Underline Scan Line"; case 0xD61E: return "VDC 8563: Word Count (-1)"; case 0xD61F: return "VDC 8563: Data"; case 0xD620: return "VDC 8563: Block Copy Source (hi)"; case 0xD621: return "VDC 8563: Block Copy Source (lo)"; case 0xD622: return "VDC 8563: Display Enable Begin"; case 0xD623: return "VDC 8563: Display Enable End"; case 0xD624: return "VDC 8563: DRAM Refresh Rate"; case 0xDC00: return "Data port A #1: keyboard, joystick, paddle, optical pencil"; case 0xDC01: return "Data port B #1: keyboard, joystick, paddle"; case 0xDC02: return "Data direction register port A #1"; case 0xDC03: return "Data direction register port B #1"; case 0xDC04: return "Timer A #1: Lo Byte"; case 0xDC05: return "Timer A #1: Hi Byte"; case 0xDC06: return "Timer B #1: Lo Byte"; case 0xDC07: return "Timer B #1: Hi Byte"; case 0xDC08: return "Day time clock #1: 1/10 second"; case 0xDC09: return "Day time clock #1: Second"; case 0xDC0A: return "Day time clock #1: Minutes"; case 0xDC0B: return "Day time clock #1: Hour+[indicator AM/PM]"; case 0xDC0C: return "Serial I/O data buffer synchronous #1"; case 0xDC0D: return "Interrupt control register CIA #1"; case 0xDC0E: return "Control register A of CIA #1"; case 0xDC0F: return "Control register B of CIA #1"; case 0xDD00: return "Data port A #2: serial bus, RS-232, VIC memory"; case 0xDD01: return "Data port B #2: user port, RS-232"; case 0xDD02: return "Data direction register port A #2"; case 0xDD03: return "Data direction register port A #2"; case 0xDD04: return "Timer A #2: Lo Byte"; case 0xDD05: return "Timer A #2: Hi Byte"; case 0xDD06: return "Timer B #2: Lo Byte"; case 0xDD07: return "Timer B #2: HI Byte"; case 0xDD08: return "Day time clock #2: 1/10 second"; case 0xDD09: return "Day time clock #2: seconds"; case 0xDD0A: return "Day time clock #2: minutes"; case 0xDD0B: return "Day time clock #2: Hour+[indicator AM/PM]"; case 0xDD0C: return "Serial I/O data buffer synchronous #2"; case 0xDD0D: return "Interrupt control register CIA #2"; case 0xDD0E: return "Control register A of CIA #2"; case 0xDD0F: return "Control register B of CIA #2"; case 0xDF00: return "8726 DMA Controller: STATUS"; case 0xDF01: return "8726 DMA Controller: COMMAND"; case 0xDF02: return "8726 DMA Controller: HOST ADDRESS LOW"; case 0xDF03: return "8726 DMA Controller: HOST ADDRESS HIGH"; case 0xDF04: return "8726 DMA Controller: EXPANSION ADDRESS LOW"; case 0xDF05: return "8726 DMA Controller: EXPANSION ADDRESS HIGH"; case 0xDF06: return "8726 DMA Controller: EXPANSION BANK"; case 0xDF07: return "8726 DMA Controller: TRANSFER LENGTH LOW"; case 0xDF08: return "8726 DMA Controller: TRANSFER LENGTH HIGH"; case 0xDF09: return "8726 DMA Controller: INTERRUPT MASK REGISTER"; case 0xDF0A: return "8726 DMA Controller: VERSION, MAXIMUM MEMORY"; case 0xE000: return "Reset Code"; case 0xE04B: return "MMU Set Up Bytes"; case 0xE056: return "-restor-"; case 0xE05B: return "-vector-"; case 0xE073: return "Vectors to $0314"; case 0xE093: return "-ramtas-"; case 0xE0CD: return "Move Code For High RAM Banks"; case 0xE105: return "RAM Bank Masks"; case 0xE109: return "-init-"; case 0xE1DC: return "Set Up CRTC Registers"; case 0xE1F0: return "Check Special Reset"; case 0xE242: return "Reset to 64/128"; case 0xE24B: return "Switch to 64 Mode"; case 0xE263: return "Code to $02"; case 0xE26B: return "Scan All ROMs"; case 0xE2BC: return "ROM Addresses High"; case 0xE2C0: return "ROM Banks"; case 0xE2C4: return "Print 'cbm' Mask"; case 0xE2C7: return "VIC 8564 Set Up"; case 0xE2F8: return "CRTC 8563 Set Up Pairs"; case 0xE33B: return "-talk-"; case 0xE33E: return "-listen-"; case 0xE38C: return "Send Data On Serial Bus"; case 0xE439: return "-acptr-"; case 0xE4D2: return "-second-"; case 0xE4E0: return "-tksa-"; case 0xE503: return "ciout- Print Serial"; case 0xE515: return "-untlk-"; case 0xE526: return "-unlsn-"; case 0xE535: return "Reset ATN"; case 0xE545: return "Set Clock High"; case 0xE54E: return "Set Clock Low"; case 0xE557: return "Set Data High"; case 0xE560: return "Set Data Low"; case 0xE569: return "Read Serial Lines"; case 0xE573: return "Stabilize Timing"; case 0xE59F: return "Restore Timing"; case 0xE5BC: return "Prepare For Response"; case 0xE5C3: return "Fast Disk Off"; case 0xE5D6: return "Fast Disk On"; case 0xE5FB: return "Fast Disk On/Off"; case 0xE5FF: return "(NMI) Transmit RS-232"; case 0xE64A: return "RS-232 Handshake"; case 0xE68E: return "Set RS-232 Bit Count"; case 0xE69D: return "(NMI) RS-232 Receive"; case 0xE75F: return "Send To RS-232"; case 0xE795: return "Connect RS-232 Input"; case 0xE7CE: return "Get From RS-232"; case 0xE7EC: return "Interlock RS-232/Serial"; case 0xE805: return "(NMI) RS-232 Control I/O"; case 0xE850: return "RS-232 Timing Table -- NTSC"; case 0xE864: return "RS-232 Timing Table -- PAL"; case 0xE878: return "(NMI) RS-232 Receive Timing"; case 0xE8A9: return "(NMI) RS-232 Transmit Timing"; case 0xE8D0: return "Find Any Tape Header"; case 0xE919: return "Write Tape Header"; case 0xE980: return "Get Buffer Address"; case 0xE987: return "Get Tape Buffer Start & End Addrs"; case 0xE99A: return "Find Specific Header"; case 0xE9BE: return "Bump Tape Pointer"; case 0xE9C8: return "Print 'press play on tape'"; case 0xE9DF: return "Check Tape Status"; case 0xE9E9: return "Print 'press record ...'"; case 0xE9F2: return "Initiate Tape Read"; case 0xEA15: return "Initiate Tape Write"; case 0xEA26: return "Common Tape Code"; case 0xEA7D: return "Wait For Tape"; case 0xEA8F: return "Check Tape Stop"; case 0xEAA1: return "Set Read Timing"; case 0xEAEB: return "(IRQ) Read Tape Bits"; case 0xEC1F: return "Store Tape Chars"; case 0xED51: return "Reset Pointer"; case 0xED5A: return "New Char Set Up"; case 0xED69: return "Write Transition to Tape"; case 0xED8B: return "Write Data to Tape"; case 0xED90: return "(IRQ) Tape Write"; case 0xEE2E: return "(IRQ) Tape Leader"; case 0xEE57: return "Wind Up Tape I/O"; case 0xEE9B: return "Switch IRQ Vector"; case 0xEEA8: return "IRQ Vectors"; case 0xEEB0: return "Kill Tape Motor"; case 0xEEB7: return "Check End Address"; case 0xEEC1: return "Bump Address"; case 0xEEC8: return "(IRQ) Clear Break"; case 0xEED0: return "Control Tape Motor"; case 0xEEEB: return "-getin-"; case 0xEF06: return "-chrin-"; case 0xEF48: return "Get Char From Tape"; case 0xEF79: return "-chrout-"; case 0xEFBD: return "-open-"; case 0xF0B0: return "Set CIA to RS-232"; case 0xF0CB: return "Check Serial Open"; case 0xF106: return "-chkin-"; case 0xF14C: return "-chkout-"; case 0xF188: return "-close-"; case 0xF1E4: return "Delete File"; case 0xF202: return "Search For File"; case 0xF212: return "Set File Parameters"; case 0xF222: return "-clall-"; case 0xF226: return "-clrchn-"; case 0xF23D: return "Clear I/O Path"; case 0xF265: return "-load-"; case 0xF27B: return "Serial Load"; case 0xF32A: return "Tape Load"; case 0xF3A1: return "Disk Load"; case 0xF3EA: return "Burst Load"; case 0xF48C: return "Close Off Serial"; case 0xF4BA: return "Get Serial Byte"; case 0xF4C5: return "Receive Serial Byte"; case 0xF503: return "Toggle Clock Line"; case 0xF50C: return "Print 'u0' Disk Reset"; case 0xF50F: return "Print 'searching'"; case 0xF521: return "Send File Name"; case 0xF533: return "Print 'loading'"; case 0xF53E: return "-save-"; case 0xF5B5: return "Terminate Serial Input"; case 0xF5BC: return "Print 'saving'"; case 0xF5C8: return "Save to Tape"; case 0xF5F8: return "-udtim-"; case 0xF63D: return "Watch For RUN or Shift"; case 0xF65E: return "-rdtim-"; case 0xF665: return "-settim-"; case 0xF66E: return "-stop-"; case 0xF67C: return "Print 'too many files'"; case 0xF67F: return "Print 'file open'"; case 0xF682: return "Print 'file not open'"; case 0xF685: return "Print 'file not found'"; case 0xF688: return "Print 'device not present'"; case 0xF68B: return "Print 'not input file'"; case 0xF68E: return "Print 'not output file'"; case 0xF691: return "Print 'missing file name'"; case 0xF694: return "Print 'illegal device no'"; case 0xF697: return "Error #0"; case 0xF6B0: return "Messages"; case 0xF71E: return "Print If Direct"; case 0xF722: return "Print I/O Message"; case 0xF731: return "-setnam-"; case 0xF738: return "-setlfs-"; case 0xF73F: return "Set Load/Save Bank"; case 0xF744: return "-rdst-"; case 0xF757: return "Set Status Bit"; case 0xF75C: return "-setmsg-"; case 0xF75F: return "Set Serial Timeout"; case 0xF763: return "-memtop-"; case 0xF772: return "-membot-"; case 0xF781: return "-iobase-"; case 0xF786: return "Search For SA"; case 0xF79D: return "Search & Set Up File"; case 0xF7A5: return "Trigger DMA"; case 0xF7AE: return "Get Char From Memory"; case 0xF7BC: return "Store Loaded Byte"; case 0xF7C9: return "Read Byte to be Saved"; case 0xF7D0: return "Get Char From Memory Bank"; case 0xF7DA: return "Store Char to Memory Bank"; case 0xF7E3: return "Compare Char With Memory Bank"; case 0xF7F0: return "MMU Bank Configuration Values"; case 0xF800: return "Subroutines to $02a2-$02fb"; case 0xF85A: return "DMA Code to $03f0"; case 0xF867: return "Check Auto Start ROM"; case 0xF890: return "Check For Boot Disk"; case 0xF908: return "Print 'booting'"; case 0xF92C: return "Print '...'"; case 0xF98B: return "Wind Up Disk Boot"; case 0xF9B3: return "Read Next Boot Block"; case 0xF9FB: return "To 2-Digit Decimal"; case 0xFA08: return "Block Read Command String"; case 0xFa17: return "Print a Message"; case 0xFA40: return "NMI Sequence"; case 0xFA65: return "(IRQ) Normal Entry"; case 0xFA80: return "Keyboard Matrix Un-Shifted"; case 0xFAD9: return "Keyboard Matrix Shifted"; case 0xFB32: return "Keyboard Matrix C-Key"; case 0xFB8B: return "Keyboard Matrix Control"; case 0xFBE4: return "Keyboard Matrix Caps-Loc"; case 0xFC62: return "Patch for Set Up CRTC Registers"; case 0xFC6F: return "Unused"; case 0xFC87: return "Init KBD Translation Tables"; case 0xFCC6: return "DIN Keyboard patch for Key Pickup"; case 0xFD29: return "DIN Keyboard Matrix Un-Shifted"; case 0xFD82: return "DIN Keyboard Matrix Shifted"; case 0xFDDB: return "DIN Keyboard Matrix C-Key"; case 0xFE34: return "DIN Keyboard Shift Vectors"; case 0xFE8C: return "Unused"; case 0xFEFF: return "Patch byte"; case 0xFEF0: return "MMU Configuration Register"; case 0xFF01: return "MMU LCR: Bank 0"; case 0xFF02: return "MMU LCR: Bank 1"; case 0xFF03: return "MMU LCR: Bank 14"; case 0xFF04: return "MMU LCR: Bank 14 Over RAM 1"; case 0xFF05: return "NMI Transfer Entry"; case 0xFF17: return "IRQ Transfer Entry"; case 0xFF33: return "Return From Interrupt"; case 0xFF3D: return "Reset Transfer Entry"; case 0xFF47: case 0xFF48: case 0xFF49: return "Set up Fast Serial Port for I/O"; case 0xFF4A: case 0xFF4B: case 0xFF4C: return "Close All Logical Files for a device"; case 0xFF4D: case 0xFF4E: case 0xFF4F: return "Reconfigure System as a C64 (no return)"; case 0xFF50: case 0xFF51: case 0xFF52: return "Initiate DMA Request to External RAM"; case 0xFF53: case 0xFF54: case 0xFF55: return "Boot Load Program From Disk"; case 0xFF56: case 0xFF57: case 0xFF58: return "Call All Function Cards' Cold Start"; case 0xFF59: case 0xFF5A: case 0xFF5B: return "Search Tables For Given LA"; case 0xFF5C: case 0xFF5D: case 0xFF5E: return "Search Tables For Given SA"; case 0xFF5F: case 0xFF60: case 0xFF61: return "Switch Between 40 and 80 Columns (Editor)"; case 0xFF62: case 0xFF63: case 0xFF64: return "Init 80-Col Character RAM (Editor)"; case 0xFF65: case 0xFF66: case 0xFF67: return "Program Function Key (Editor)"; case 0xFF68: case 0xFF69: case 0xFF6A: return "SET Bank For I/O Operations"; case 0xFF6B: case 0xFF6C: case 0xFF6D: return "Lookup MMU Data For Given Bank"; case 0xFF6E: case 0xFF6F: case 0xFF70: return "JSR to Any Bank, RTS to Calling Bank"; case 0xFF71: case 0xFF72: case 0xFF73: return "JMP to Any Bank"; case 0xFF74: case 0xFF75: case 0xFF76: return "LDA (FETVEC),Y FROM Any Bank"; case 0xFF77: case 0xFF78: case 0xFF79: return "STA (STAVEC),Y to Any Bank"; case 0xFF7A: case 0xFF7B: case 0xFF7C: return "CMP (CMPVEC),Y to Any Bank"; case 0xFF7D: case 0xFF7E: case 0xFF7F: return "Print Immediate Utility"; case 0xFF80: return "Release Number Of KERNAL"; case 0xFF81: case 0xFF82: case 0xFF83: return "Init Editor & Display"; case 0xFF84: case 0xFF85: case 0xFF86: return "Init I/O Devices (ports, timers, etc.)"; case 0xFF87: case 0xFF88: case 0xFF89: return "Initialize RAM And Buffers For System"; case 0xFF8A: case 0xFF8B: case 0xFF8C: return "Restore Vectors to Initial System"; case 0xFF8D: case 0xFF8E: case 0xFF8F: return "Change Vectors For USER"; case 0xFF90: case 0xFF91: case 0xFF92: return "Control O.S. Message"; case 0xFF93: case 0xFF94: case 0xFF95: return "Send SA After LISTEN"; case 0xFF96: case 0xFF97: case 0xFF98: return "Send SA After TALK"; case 0xFF99: case 0xFF9A: case 0xFF9B: return "Set/Read Top Of System RAM"; case 0xFF9C: case 0xFF9D: case 0xFF9E: return "Set/Read Bottom Of System RAM"; case 0xFF9F: case 0xFFA0: case 0xFFA1: return "Scan Keyboard (Editor)"; case 0xFFA2: case 0xFFA3: case 0xFFA4: return "Set Timeout In IEEE (reserved)"; case 0xFFA5: case 0xFFA6: case 0xFFA7: return "Handshake Serial Byte In"; case 0xFFA8: case 0xFFA9: case 0xFFAA: return "Handshake Serial Byte Out"; case 0xFFAB: case 0xFFAC: case 0xFFAD: return "Send UNTALK Out Serial"; case 0xFFAE: case 0xFFAF: case 0xFFB0: return "Send UNLISTEN Out Serial"; case 0xFFB1: case 0xFFB2: case 0xFFB3: return "Send LISTEN Out Serial"; case 0xFFB4: case 0xFFB5: case 0xFFB6: return "Send TALK Out Serial"; case 0xFFB7: case 0xFFB8: case 0xFFB9: return "Return I/O Status Byte"; case 0xFFBA: case 0xFFBB: case 0xFFBC: return "Set LA, FA, SA"; case 0xFFBD: case 0xFFBE: case 0xFFBF: return "Set Length And File Name Address"; case 0xFFC0: case 0xFFC1: case 0xFFC2: return "OPEN Logical File"; case 0xFFC3: case 0xFFC4: case 0xFFC5: return "CLOSE Logical File"; case 0xFFC6: case 0xFFC7: case 0xFFC8: return "Set Channel In"; case 0xFFC9: case 0xFFCA: case 0xFFCB: return "Set Channel Out"; case 0xFFCC: case 0xFFCD: case 0xFFCE: return "Restore Default I/O Channel"; case 0xFFCF: case 0xFFD0: case 0xFFD1: return "INPUT From Channel"; case 0xFFD2: case 0xFFD3: case 0xFFD4: return "OUTPUT To Channel"; case 0xFFD5: case 0xFFD6: case 0xFFD7: return "LOAD From File"; case 0xFFD8: case 0xFFD9: case 0xFFDA: return "SAVE to File"; case 0xFFDB: case 0xFFDC: case 0xFFDD: return "Set Internal Clock"; case 0xFFDE: case 0xFFDF: case 0xFFE0: return "Read Internal Clock"; case 0xFFE1: case 0xFFE2: case 0xFFE3: return "Scan STOP Key"; case 0xFFE4: case 0xFFE5: case 0xFFE6: return "Read Buffered Data"; case 0xFFE7: case 0xFFE8: case 0xFFE9: return "Close All Files And Channels"; case 0xFFEA: case 0xFFEB: case 0xFFEC: return "Increment Internal Clock"; case 0xFFED: case 0xFFEE: case 0xFFEF: return "Return Screen Window Size (Editor)"; case 0xFFF0: case 0xFFF1: case 0xFFF2: return "Read/Set X,Y Cursor Coord (Editor)"; case 0xFFF3: case 0xFFF4: case 0xFFF5: return "Return I/O Base"; case 0xFFF8: case 0xFFF9: return "Operating System Vector (RAM1)"; case 0xFFFA: case 0xFFFB: return "Processor NMI Vector"; case 0xFFFC: case 0xFFFD: return "Processor RESET Vector"; case 0xFFFE: case 0xFFFF: return "Processor IRQ/BRK Vector"; default: if ((addr>=0x19) && (addr<=0x23)) return "Stack for temporary strings"; if ((addr>=0x59) && (addr<=0x62)) return "Miscellaneous numeric work area"; if ((addr>=0x100) && (addr<=0x10F)) return "Tape Read Errors, Area to build filename in (16 bytes)"; if ((addr>=0x100) && (addr<=0x1FF)) return "System Stack"; if ((addr>=0x200) && (addr<=0x2A1)) return "BASIC & Monitor input buffer"; if ((addr>=0x2A2) && (addr<=0x2AE)) return "Bank Peek Subroutine (Kernal RAM)"; if ((addr>=0x2AF) && (addr<=0x2BD)) return "Bank Poke Subroutine"; if ((addr>=0x2BE) && (addr<=0x2CC)) return "Bank Compare Subroutine"; if ((addr>=0x2CD) && (addr<=0x2E2)) return "JSR to Another Bank"; if ((addr>=0x2E3) && (addr<=0x2FB)) return "JMP to Another Bank"; if ((addr>=0x34A) && (addr<=0x353)) return "IRQ Keyboard Buffer (10 Bytes) FF = No key"; if ((addr>=0x354) && (addr<=0x35D)) return "Bitmap Of TAB Stops (10 Bytes)"; if ((addr>=0x362) && (addr<=0x36B)) return "Logical File Number Table"; if ((addr>=0x36C) && (addr<=0x375)) return "Device Number Table"; if ((addr>=0x376) && (addr<=0x37F)) return "Secondary Addresse Table"; if ((addr>=0x380) && (addr<=0x39E)) return "CHRGET Subroutine"; if ((addr>=0x39F) && (addr<=0x3AA)) return "Fetch From RAM Bank 0"; if ((addr>=0x3AB) && (addr<=0x3B6)) return "Fetch From RAM Bank 1"; if ((addr>=0x3B7) && (addr<=0x3BF)) return "Index1 Indirect Fetch From RAM Bank 1"; if ((addr>=0x3C0) && (addr<=0x3C8)) return "Index2 Indirect Fetch From RAM Bank 0"; if ((addr>=0x3C9) && (addr<=0x3D1)) return "Txtptr Fetch From RAM Bank 0"; if ((addr>=0x3F0) && (addr<=0x3F6)) return "DMA Link Code"; if ((addr>=0x400) && (addr<=0x7E7)) return "VIC 40-Column Text Screen"; if ((addr>=0x7E8) && (addr<=0x7fF)) return "Sprite Identity Pointers For Text Mode"; if ((addr>=0x800) && (addr<=0x9FF)) return "BASIC Pseudo Stack (gosub and loop addresses and commands)"; if ((addr>=0xA40) && (addr<=0xA5A)) return "40/80 Pointer Swap (to E0-FA)"; if ((addr>=0xA60) && (addr<=0xA6D)) return "40/80 Data Swap (0354-0361)"; if ((addr>=0xB00) && (addr<=0xBBF)) return "Cassette Buffer"; if ((addr>=0xC00) && (addr<=0xDFF)) return "RS-232 Input, Output Buffers"; if ((addr>=0xE00) && (addr<=0xFFF)) return "System Sprites (56-63)"; if ((addr>=0x1000) && (addr<=0x1009)) return "Programmed Key Lenghts"; if ((addr>=0x100A) && (addr<=0x10FF)) return "Programmed Key Definitions"; if ((addr>=0x1100) && (addr<=0x1130)) return "DOS Command Staging Area"; if ((addr>=0x1131) && (addr<=0x116E)) return "Graphics Work Area"; if ((addr>=0x1178) && (addr<=0x1197)) return "Graphics Index"; if ((addr>=0x117E) && (addr<=0x11D5)) return "Sprite Motion Tables (8 x 11 bytes)"; if ((addr>=0x11D6) && (addr<=0x11E5)) return "Sprite X/Y Positions"; if ((addr>=0x11EE) && (addr<=0x11FF)) return "Unused"; if ((addr>=0x1239) && (addr<=0x123E)) return "Current Envelope Pattern"; if ((addr>=0x123F) && (addr<=0x1270)) return "AD(SR) Pattern"; if ((addr>=0x1249) && (addr<=0x1252)) return "(AD)SR Pattern"; if ((addr>=0x1253) && (addr<=0x125C)) return "Waveform Pattern"; if ((addr>=0x125D) && (addr<=0x1266)) return "Pulse Width Lo Pattern"; if ((addr>=0x1267) && (addr<=0x1270)) return "Pulse Width Hi Pattern"; if ((addr>=0x1279) && (addr<=0x127E)) return "Collision IRQ Address Tables"; if ((addr>=0x1300) && (addr<=0x17FF)) return "Application Program Area"; if ((addr>=0x1800) && (addr<=0x1BFF)) return "Application Program Area/Reserved for Key Functions"; if ((addr>=0x1C00) && (addr<=0x1FF7)) return "Video Color Matrix For Graphics Mode"; if ((addr>=0x1FF8) && (addr<=0x1FFF)) return "Sprite Identity Pointers For Graphics Mode"; if ((addr>=0x2000) && (addr<=0x3FFF)) return "Screen Memory For Graphics Mode"; if ((addr>=0xD800) && (addr<=0xDBFF)) return "Color RAM (Nybbles)"; } } } return super.dcom(iType, aType, addr, value); } }
238,088
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
CVic20Dasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/machine/CVic20Dasm.java
/** * @(#)C128Dasm.java 2020/10/11 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.machine; import sw_emulator.software.cpu.M6510Dasm; import static sw_emulator.software.cpu.M6510Dasm.A_ABS; import static sw_emulator.software.cpu.M6510Dasm.A_ABX; import static sw_emulator.software.cpu.M6510Dasm.A_ABY; import static sw_emulator.software.cpu.M6510Dasm.A_IDX; import static sw_emulator.software.cpu.M6510Dasm.A_IDY; import static sw_emulator.software.cpu.M6510Dasm.A_IND; import static sw_emulator.software.cpu.M6510Dasm.A_REL; import static sw_emulator.software.cpu.M6510Dasm.A_ZPG; import static sw_emulator.software.cpu.M6510Dasm.A_ZPX; import static sw_emulator.software.cpu.M6510Dasm.A_ZPY; /** * Comment the memory location of Plus4 for the disassembler * It performs also a multy language comments. * * @author ice */ public class CVic20Dasm extends M6510Dasm { // Available language public static final byte LANG_ENGLISH=1; public static final byte LANG_ITALIAN=2; /** * Return a comment string for the passed instruction * * @param iType the type of instruction * @param aType the type of addressing used by the instruction * @param addr the address value (if needed by this istruction type) * @param value the operation value (if needed by this instruction) * @return a comment string */ @Override public String dcom(int iType, int aType, long addr, long value) { byte language=option.commentLanguage; switch (aType) { case A_ZPG: case A_ZPX: case A_ZPY: case A_ABS: case A_ABX: case A_ABY: case A_REL: case A_IND: case A_IDX: case A_IDY: // do not get comment if appropriate option is not selected if ((int)addr<=0xFF && !option.commentVic20ZeroPage) return ""; if ((int)addr>=0x100 && (int)addr<=0x1FF && !option.commentVic20StackArea) return ""; if ((int)addr>=0x200 && (int)addr<=0x2FF && !option.commentVic20_200Area) return ""; if ((int)addr>=0x300 && (int)addr<=0x3FF && !option.commentVic20_300Area) return ""; if ((int)addr>=0x400 && (int)addr<=0x7FF && !option.commentVic20_400Area) return ""; if ((int)addr>=0x1000 && (int)addr<=0x1DFF && !option.commentVic20UserBasic) return ""; if ((int)addr>=0x1E00 && (int)addr<=0x1FFF && !option.commentVic20Screen) return ""; if ((int)addr>=0x2000 && (int)addr<=0x3FFF && !option.commentVic20_8kExp1) return ""; if ((int)addr>=0x4000 && (int)addr<=0x5FFF && !option.commentVic20_8kExp2) return ""; if ((int)addr>=0x6000 && (int)addr<=0x7FFF && !option.commentVic20_8kExp2) return ""; if ((int)addr>=0x8000 && (int)addr<=0x8FFF && !option.commentVic20Character) return ""; if ((int)addr>=0x9000 && (int)addr<=0x900F && !option.commentVic20Vic) return ""; if ((int)addr>=0x9010 && (int)addr<=0x901F && !option.commentVic20Via1) return ""; if ((int)addr>=0x9030 && (int)addr<=0x903F && !option.commentVic20Via2) return ""; if ((int)addr>=0x9400 && (int)addr<=0x97FF && !option.commentVic20Color) return ""; if ((int)addr>=0x9800 && (int)addr<=0x9BFF && !option.commentVic20Block2) return ""; if ((int)addr>=0x9C00 && (int)addr<=0x9FFF && !option.commentVic20Block3) return ""; if ((int)addr>=0xA000 && (int)addr<=0xBFFF && !option.commentVic20Block4) return ""; if ((int)addr>=0xC000 && (int)addr<=0xDFFF && !option.commentVic20BasicRom) return ""; if ((int)addr>=0xE000 && (int)addr<=0xFFFF && !option.commentVic20KernalRom) return ""; switch (language) { case LANG_ITALIAN: switch ((int)addr) { case 0x00: return "Salto per USR"; case 0x01: case 0x02: return "Vettore per USR"; case 0x03: case 0x04: return "Vettore virgola mobile-interor"; case 0x05: case 0x06: return "Vettore intero-virgola mobile"; case 0x07: return "Cerca un carattere"; case 0x08: return "Flag di virgolette di scansione"; case 0x09: return "Salva colonna TAB"; case 0x0A: return "0=LOAD, 1=VERIFY"; case 0x0B: return "Puntatore del buffer di input/indice #"; case 0x0C: return "Flag DIM predefinito"; case 0x0D: return "Tipo: FF=stringa, 00=numero"; case 0x0E: return "Tipo: 80=intero, 00=virgola mobile"; case 0x0F: return "Scansione DATI/Citazione LIST/flag di memoria"; case 0x10: return "Flag pedice /FNx"; case 0x11: return "0 = INPUT;$40 = GET;$98 = READ"; case 0x12: return "Segno ATN/flag di valutazione di confronto"; case 0x13: return "Flag del prompt I/O corrente"; case 0x14: case 0x15: return "Valore intero"; case 0x16: return "Puntatore: stack di stringhe temporaneo"; case 0x17: case 0x18: return "Ultimo vettore di stringa temporanea"; case 0x19: case 0x1A: case 0x1B: case 0x1C: case 0x1D: case 0x1E: case 0x1F: case 0x20: case 0x21: return "Stack per stringhe temporanee"; case 0x22: case 0x23: case 0x24: case 0x25: return "Area del puntatore di utilità"; case 0x26: case 0x27: case 0x28: case 0x29: case 0x2A: return "Area di prodotto per la moltiplicazione"; case 0x2B: case 0x2C: return "Puntatore: inizio di BASIC"; case 0x2D: case 0x2E: return "Puntatore: inizio delle variabili"; case 0x2F: case 0x30: return "Puntatore: inizio degli array"; case 0x31: case 0x32: return "Puntatore: fine degli array"; case 0x33: case 0x34: return "Puntatore: memoria stringa (spostandosi verso il basso)"; case 0x35: case 0x36: return "Puntatore a stringa di utilità"; case 0x37: case 0x38: return "Puntatore: limite di memoria"; case 0x39: case 0x3A: return "Numero di riga BASIC corrente"; case 0x3B: case 0x3C: return "Numero di riga BASIC precedente"; case 0x3D: case 0x3E: return "Puntatore: dichiarazione di base per CONT"; case 0x3F: case 0x40: return "Numero di riga DATI corrente"; case 0x41: case 0x42: return "Indirizzo DATA corrente"; case 0x43: case 0x44: return "Vettore di input"; case 0x45: case 0x46: return "Nome della variabile corrente"; case 0x47: case 0x48: return "Indirizzo variabile corrente"; case 0x49: case 0x4A: return "Puntatore variabile per FOR/NEXT"; case 0x4B: case 0x4C: return "Y-save; op-save; Puntatore salvataggio BASIC"; case 0x4D: return "Accumulatore di simboli di confronto"; case 0x4E: case 0x4F: case 0x50: case 0x51: case 0x52: case 0x53: return "Area di lavoro varie, puntatori, ecc"; case 0x54: case 0x55: case 0x56: return "Salta il vettore per le funzioni"; case 0x57: case 0x58: case 0x59: case 0x5A: case 0x5B: case 0x5C: case 0x5D: case 0x5E: case 0x5F: case 0x60: return "Area di lavoro numerica misc"; case 0x61: return "Accum #1: esponente"; case 0x62: case 0x63: case 0x64: case 0x65: return "Accum #1: mantissa"; case 0x66: return "Accum #1: segno"; case 0x67: return "Puntatore della costante di valutazione della serie"; case 0x68: return "Accum #1 hi-order (overflow)"; case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: return "Accum #2: esponente, etc."; case 0x6F: return "Segno di confronto, Accum #1 contro #2"; case 0x70: return "Accum #1 lo-order (arrotondamento)"; case 0x71: case 0x72: return "Lunghezza buffer cassetta / Puntatore serie"; case 0x7A: case 0x7B: return "Puntatore di base (all'interno della subroutine)"; case 0x8B: case 0x8C: case 0x8D: case 0x8E: case 0x8F: return "RND valore seme"; case 0x90: return "Word di stato ST"; case 0x91: return "Selettore a chiave PIA: flag STOP e RVS"; case 0x92: return "Costante di tempo per il nastro"; case 0x93: return "Carica=0, Verifica=1"; case 0x94: return "Uscita seriale: flag di caratteri differiti"; case 0x95: return "Carattere differito seriale"; case 0x96: return "EOT nastro ricevuto"; case 0x97: return "Registrati salva"; case 0x98: return "Quanti file aperti"; case 0x99: return "Dispositivo di input (normalmente 0)"; case 0x9A: return "Dispositivo di uscita (CMD), normalmente 3"; case 0x9B: return "Parità dei caratteri del nastro"; case 0x9C: return "Flag di byte ricevuti"; case 0x9D: return "Diretto=$80/RUN=0 controllo dell'uscita"; case 0x9E: return "Registro errori passaggio nastro 1/buffer carattere"; case 0x9F: return "Registro errori passaggio 2 nastro corretto"; case 0xA0: case 0xA1: case 0xA2: return "Orologio Jiffy (HML)"; case 0xA3: return "Conteggio bit seriale/flag EOI"; case 0xA4: return "Conteggio ciclo"; case 0xA5: return "Conto alla rovescia, scrittura su nastro/conteggio bit"; case 0xA6: return "Puntatore: buffer del nastro"; case 0xA7: return "Scrittura nastro ldr count/Read pass/inbit"; case 0xA8: return "Scrittura nastro nuovo byte/Errore lettura/inbit"; case 0xA9: return "Scrittura bit di partenza/Lettura bit errore/stbit"; case 0xAA: return "Scansione nastro;Cnt;Ld;Fine/byte assy"; case 0xAB: return "Scrivere lunghezza lead/checksum Rd/parità"; case 0xAC: case 0xAD: return "Puntatore: buffer del nastro, scorrimento"; case 0xAE: case 0xAF: return "Indirizzi di fine nastro/Fine programma"; case 0xB0: case 0xB1: return "Costanti di temporizzazione del nastro"; case 0xB2: case 0xB3: return "Puntatore: inizio del buffer del nastro"; case 0xB4: return "Timer nastro (1=abilitato); bit cnt"; case 0xB5: return "Nastro EOT/RS-232 bit successivo da inviare"; case 0xB6: return "Lettura errore carattere/buffer outbyte"; case 0xB7: return "# caratteri nel nome del filee"; case 0xB8: return "File logico corrente"; case 0xB9: return "Indirizzo secondario attuale"; case 0xBA: return "Dispositivo corrente"; case 0xBB: case 0xBC: return "Puntatore: al nome del file"; case 0xBD: return "Scrivi la parola di spostamento/Leggi il carattere di input"; case 0xBE: return "# blocchi rimanenti da scrivere/leggere"; case 0xBF: return "Buffer di parole seriali"; case 0xC0: return "Blocco motore nastro"; case 0xC1: case 0xC2: return "Indirizzi iniziali di I/O"; case 0xC3: case 0xC4: return "Puntatore di configurazione KERNAL"; case 0xC5: return "Tasto corrente premuto"; case 0xC6: return "# caratteri nel buffer della tastiera"; case 0xC7: return "Contrassegno inverso dello schermo"; case 0xC8: return "Puntatore: fine riga per l'input"; case 0xC9: case 0xCA: return "Log del cursore di input (riga, colonna)"; case 0xCB: return "Quale chiave: 64 se nessuna chiave"; case 0xCC: return "Abilita cursore (0 = cursore lampeggiante)"; case 0xCD: return "Conto alla rovescia del tempo del cursore"; case 0xCE: return "Carattere sotto il cursore"; case 0xCF: return "Cursore in fase di lampeggio"; case 0xD0: return "Input da schermo/da tastiera"; case 0xD1: case 0xD2: return "Puntatore alla linea schermo"; case 0xD3: return "Posizione del cursore sulla linea superiore"; case 0xD4: return "0=cursore diretto, altrimenti programmato"; case 0xD5: return "Lunghezza della riga dello schermo corrente"; case 0xD6: return "Riga in cui risiede il cursore"; case 0xD7: return "Ultimo inkey/checksum/buffer"; case 0xD8: return "# di INSERT in sospeso"; case 0xF1: return "Collegamento schermo fittizio"; case 0xF2: return "Indicatore di riga sullo schermo"; case 0xF3: case 0xF4: return "Puntatore a colori dello schermo"; case 0xF5: case 0xF6: return "Puntatore da tastiera"; case 0xF7: case 0xF8: return "Puntatore RS-232 Rcv"; case 0xF9: case 0xFA: return "Puntatore RS-232 Tx"; case 0xFB: case 0xFC: case 0xFD: case 0xFE: return "Sistema operativo spazio libero pagina zero"; case 0xFF: return "Archiviazione di base"; case 0x281: case 0x282: return "Inizio della memoria per il sistema operativo"; case 0x283: case 0x284: return "Parte superiore della memoria per il sistema operativo"; case 0x285: return "Flag timeout bus seriale"; case 0x286: return "Codice colore corrente"; case 0x287: return "Colore sotto il cursore"; case 0x288: return "Pagina di memoria dello schermo"; case 0x289: return "Dimensione massima del buffer della tastiera"; case 0x28A: return "Ripetizione chiave (128 = ripeti tutte le chiavi)"; case 0x28B: return "Ripetere il contatore di velocità"; case 0x28C: return "Ripetere il contatore del ritardo"; case 0x28D: return "Flag Shift/Control della tastiera"; case 0x28E: return "Ultimo schema di spostamento della tastiera"; case 0x28F: case 0x290: return "Puntatore: decodifica logica"; case 0x291: return "Interruttore modalità cambio (0=abilitato, 128=bloccato)"; case 0x292: return "Flag di scorrimento automatico verso il basso (0 = attivato, <> 0 = disattivato)"; case 0x293: return "Registro di controllo RS-232"; case 0x294: return "Registro di comando RS-232"; case 0x295: case 0x296: return "Non standard (tempo bit / 2-100)"; case 0x297: return "Rgistro di stato RS-232"; case 0x298: return "Numero di bit da inviare"; case 0x299: case 0x29A: return "Baud rate (pieno) bit time"; case 0x29B: return "Puntatore di ricezione RS-232"; case 0x29C: return "Puntatore di ingresso RS-232"; case 0x29D: return "Puntatore di trasmissione RS-232"; case 0x29E: return "Puntatore di uscita RS-232"; case 0x29F: case 0x2A0: return "Mantiene IRQ durante le operazioni su nastro"; case 0x300: case 0x301: return "Error message linkCollegamento del messaggio di errore"; case 0x302: case 0x303: return "Collegamento base per avviamento a caldo"; case 0x304: case 0x305: return "Collegamento token Crunch Basic"; case 0x306: case 0x307: return "Link ai token di stampa"; case 0x308: case 0x309: return "Avvia un nuovo collegamento al codice di base"; case 0x30A: case 0x30B: return "Ottieni il collegamento agli elementi aritmetici"; case 0x30C: return "Memoria per registro 6502 .A"; case 0x30D: return "Memoria per registro 6502 .X"; case 0x30E: return "Memoria per registro 6502 .Y"; case 0x30F: return "Memoria per registro 6502 .SP"; case 0x314: case 0x315: return "Vettore di interrupt hardware (IRQ) [EABF]"; case 0x316: case 0x317: return "Vettore di interruzione Break [FED2]"; case 0x318: case 0x319: return "Vettore di interrupt NMI [FEAD]"; case 0x31A: case 0x31B: return "Vettore OPEN [F40A]"; case 0x31C: case 0x31D: return "Vettore CLOSE [F34A]"; case 0x31E: case 0x31F: return "Vettore Set-input [F2C7]"; case 0x320: case 0x321: return "Vettore Set-output [F309]"; case 0x322: case 0x323: return "Vettore Restore l/O [F3F3]"; case 0x324: case 0x325: return "Vettore INPUT [F20E]"; case 0x326: case 0x327: return "Vettore Output [F27A]"; case 0x328: case 0x329: return "Vettore Test-STOP [F770]"; case 0x32A: case 0x32B: return "Vettore GET [F1F5]"; case 0x32C: case 0x32D: return "Vettore Abort l/O [F3EF]"; case 0x32E: case 0x32F: return "Vettore utente (BRK predefinito) [FED2]"; case 0x330: case 0x331: return "Collegamento per caricare la RAM [F549]"; case 0x332: case 0x333: return "Collegamento per scrivere la RAM [F685]"; case 0x9000: return "Vic: bit 0-6 centratura orizzontale, bit 7 imposta la scansione interlacciata"; case 0x9001: return "Vic: centratura verticale"; case 0x9002: return "Vic: i bit 0-6 impostano il numero di colonne, il bit 7 fa parte dell'indirizzo della matrice video"; case 0x9003: return "Vic: i bit 1-6 impostano il numero di righe, il bit 0 imposta i caratteri 8x8 o 16x8"; case 0x9004: return "Vic: Linea del fascio televisivo raster"; case 0x9005: return "Vic: bit 0-3 inizio della memoria caratteri (predefinito = 0), bit 4-7 è il resto dell'indirizzo video (predefinito=F)"; case 0x9006: return "Vic: posizione orizzontale della penna luminosa"; case 0x9007: return "Vic: posizione verticale della penna luminosa"; case 0x9008: return "Vic: valore digitalizzato del paddle X"; case 0x9009: return "Vic: valore digitalizzato del paddle Y"; case 0x900A: return "Vic: frequenza per l'oscillatore 1 (basso) (on: 128-255)"; case 0x900B: return "Vic: frequenza per l'oscillatore 2 (medio) (on: 128-255)"; case 0x900C: return "Vic: frequenza per l'oscillatore 3 (alto) (on: 128-255)"; case 0x900D: return "Vic: frequenza sorgent rumore"; case 0x900E: return "Vic: il bit 0-3 imposta il volume di tutto il suono, i bit 4-7 sono informazioni ausiliarie sul colore"; case 0x900F: return "Vic: Registro del colore dello schermo e del bordo, bit 4-7 selezionare il colore di sfondo, bit 0-2 selezionare il colore del bordo, bit 3 seleziona la modalità invertita o normale"; case 0x9110: return "Via #1: Porta B registro uscita"; case 0x9111: return "Via #1: Porta A registero uscita"; case 0x9112: return "Via #1: Registro direzioni dati B"; case 0x9113: return "Via #1: Registro direzioni dati A"; case 0x9114: return "Via #1: Timer 1 byte basso"; case 0x9115: return "Via #1: Timer 1 byte alto e contatore"; case 0x9116: return "Via #1: Timer 1 byte basso"; case 0x9117: return "Via #1: Timer 1 byte alto"; case 0x9118: return "Via #1: Timer 2 byte basso"; case 0x9119: return "Via #1: Timer 2 byte alto"; case 0x911A: return "Via #1: Registro a scorrimento"; case 0x911B: return "Via #1: Registro di controllo ausiliario"; case 0x911C: return "Via #1: Registro di controllo periferico"; case 0x911D: return "Via #1: Registro flag di interruzione"; case 0x911E: return "Via #1: Registro di abilitazione interrupt"; case 0x911F: return "Via #1: Porta A (interruttore della cassetta Sense)"; case 0x9120: return "Via #2: Porta B registro uscita"; case 0x9121: return "Via #2: Porta A registro uscita"; case 0x9122: return "Via #2: Registro direzioni dati B"; case 0x9123: return "Via #2: Registro direzioni dati A"; case 0x9124: return "Via #2: Timer 1 latch byte basso"; case 0x9125: return "Via #2: Timer 1 latch byte alto"; case 0x9126: return "Via #2: Timer 1 contatore di byte basso"; case 0x9127: return "Via #2: Timer 1 contatore di byte alto"; case 0x9128: return "Via #2: Timer 2 byte basso"; case 0x9129: return "Via #2: Timer 2 byte alto"; case 0x912A: return "Via #2: Registro a scorrimento"; case 0x912B: return "Via #2: Registro di controllo ausiliario"; case 0x912C: return "Via #2: Registro di controllo periferico"; case 0x912D: return "Via #2: Registro flag di interruzione"; case 0x912E: return "Via #2: Registro di abilitazione interrupt"; case 0x912F: return "Via #2: Porat A registro usicita"; case 0xC000: case 0xC001: return "Vettori ripartenza BASIC"; case 0xC00C: case 0xC00D: return "Vettori comandi BASIC"; case 0xC052: case 0xC053: return "Vettori funzioni BASIC"; case 0xC080: case 0xC081: return "Vettori operatori BASIC"; case 0xC09E: return "Tabella delle parole chiave del comando BASIC"; case 0xC129: return "Tabella delle parole chiave BASIC Misc."; case 0xC140: return "Tabella delle parole chiave dell'operatore BASIC"; case 0xC14D: return "Tabella delle parole chiave della funzione BASIC"; case 0xC19E: return "Tabella dei messaggi di errore"; case 0xC328: case 0xC329: return "Puntatori dei messaggi di errore"; case 0xC364: return "Messaggi Misc.: ok"; case 0xC369: return "Messaggi Misc.: errore"; case 0xC38A: return "Trova la voce FOR/GOSUB nello Stack"; case 0xC3B8: return "Spazio aperto in memoria"; case 0xC3FB: return "Controlla la profondità dello stack"; case 0xC408: return "Controlla la sovrapposizione della memoria"; case 0xC435: return "Stampa errore ?OUT OF MEMORY"; case 0xC437: return "Routine errore"; case 0xC469: return "Break Entry"; case 0xC474: return "Ripartenza BASIC"; case 0xC480: return "Inserimento e identificazione della linea BASIC"; case 0xC49C: return "Inserimento e identificazione della linea BASIC"; case 0xC4A2: return "Inserisci testo BASIC"; case 0xC533: return "Linee Rechain"; case 0xC560: return "Riga di input nel buffer"; case 0xC579: return "Tokenizza il buffer di input"; case 0xC613: return "Cerca il numero di riga"; case 0xC642: return "Esegue [new]"; case 0xC65E: return "Esegue [clr]"; case 0xC68E: return "Resetta TXTPTR"; case 0xC69C: return "Esegue [list]"; case 0xC717: return "Gestire il carattere LIST"; case 0xC742: return "Esegue [for]"; case 0xC7AE: return "BASIC avvio a caldo"; case 0xC7C4: return "Controlla Fine programma"; case 0xC7E1: return "Preparati a eseguire l'istruzione"; case 0xC7ED: return "Eseguire la parola chiave BASIC"; case 0xC81D: return "Esegue [restore]"; case 0xC82C: return "Esegue [stop], [end], break"; case 0xC857: return "Esegue [cont]"; case 0xC871: return "Esegue [run]"; case 0xC883: return "Esegue [gosub]"; case 0xC8A0: return "Esegue [goto]"; case 0xC8D2: return "Esegue [return]"; case 0xC8F8: return "Esegue [data]"; case 0xC906: return "Cerca istruzione/riga successiva"; case 0xC928: return "Esegue [if]"; case 0xC93B: return "Esegue [rem]"; case 0xC94B: return "Esegue [on]"; case 0xC96B: return "Recupera il numero di riga dal BASIC"; case 0xC9A5: return "Esegue [let]"; case 0xC9C4: return "Assegna numero intero"; case 0xC9D6: return "Assegna virgola mobile"; case 0xC9D9: return "Assegna stringa"; case 0xC9E3: return "Assegna TI$"; case 0xCA2C: return "Aggiungi cifra a FAC#1"; case 0xCA80: return "Esegue [print]#"; case 0xCA86: return "Esegue [cmd]"; case 0xC99A: return "Stampa stringa dalla memoria"; case 0xCAA0: return "Esegue [print]"; case 0xCAB8: return "Variabile di output"; case 0xCAD7: return "Uscita CR/LF"; case 0xCAE8: return "Maneggia virgola, TAB(, SPC("; case 0xCB1E: return "Stringa di uscita"; case 0xCB3B: return "Carattere formato uscita"; case 0xCB4B: return "Gestisci dati non validi"; case 0xCB7B: return "Esegue [get]"; case 0xCBA5: return "Esegue [input#]"; case 0xCBBF: return "Esegue [input]"; case 0xCBEA: return "Leggere il buffer di ingresso"; case 0xCBF9: return "Prompt di ingresso"; case 0xCC06: return "Esegue [read]"; case 0xCC35: return "Routine di lettura per scopi generali"; case 0xCCFC: return "Messaggi di errore di ingresso"; case 0xCD1E: return "Esegue [next]"; case 0xCD61: return "Controllare il ciclo valido"; case 0xCD8A: return "Conferma risultato"; case 0xCD9E: return "Valuta l'espressione nel testo"; case 0xCE8E: return "Valuta un singolo termine"; case 0xCEA8: return "Constante - pi"; case 0xCEAD: return "Continua l'espressione"; case 0xCEF1: return "Espressione tra parentesi"; case 0xCEF7: return "Conferma carattere ')'"; case 0xCEFA: return "Conferma carattere '('"; case 0xCEFD: return "Conferma carattere vigola"; case 0xCF08: return "Scrive ?SYNTAX Error"; case 0xCF0D: return "Impostare la funzione NOT"; case 0xCF14: return "Identifica variabile riservata"; case 0xCF28: return "Cerca la variabile"; case 0xCF48: return "Converti TI in stringa ASCII"; case 0xCFA7: return "Identifica il tipo di funzione"; case 0xCFB1: return "Valuta la funzione stringa"; case 0xCFD1: return "Valuta la funzione numerica"; case 0xCFE6: return "Esegue [or], [and]"; case 0xD016: return "Esegue <, =, >"; case 0xD01B: return "Confronto numerico"; case 0xD02E: return "Confronto stringa"; case 0xD07E: return "Esegue [dim]"; case 0xD08B: return "Identifica variabile"; case 0xD0E7: return "Individua la variabile ordinaria"; case 0xD11D: return "Crea nuova variabile"; case 0xD128: return "Crea variabile"; case 0xD194: return "Alloca lo spazio del puntatore della matrice"; case 0xD1A5: return "Constante 32768 in Flpt"; case 0xD1AA: return "FAC#1 da intero a (AC/YR)"; case 0xD1B2: return "Valuta il testo per intero"; case 0xD1B7: return "FAC#1 da intero positivo"; case 0xD1D1: return "Ottieni parametri array"; case 0xD218: return "Cerca vettore"; case 0xD245: return "'?bad subscript error'"; case 0xD248: return "'?illegal quantity error'"; case 0xD261: return "Crea vettore"; case 0xD30E: return "Trova elemento nel vettore"; case 0xD34C: return "Numero di byte in pedice"; case 0xD37D: return "Esegue [fre]"; case 0xD391: return "Converte l'intero in (AC/YR) to virgola mobile"; case 0xD39E: return "Esegue [pos]"; case 0xD3A6: return "Conferma modalità programma"; case 0xD3E1: return "Verifica sintassi di FN"; case 0xD3F4: return "Esegue [fn]"; case 0xD465: return "Esegue [str$]"; case 0xD487: return "Imposta stringa"; case 0xD4D5: return "Salva descrittore stringa"; case 0xD4F4: return "Alloca spazio per la stringa"; case 0xD526: return "Garbage Collection"; case 0xD5BD: return "Cerca la prossima stringa"; case 0xD606: return "Raccoglie la stringa"; case 0xD63D: return "Concatena due stringhe"; case 0xD67A: return "Memorizza la strinha in RAM alta"; case 0xD6A3: return "Eseguire le operazioni di pulizia delle stringhe"; case 0xD6DB: return "Pulisci stack descrittore"; case 0xD6EC: return "Esegue [chr$]"; case 0xD700: return "Esegue [left$]"; case 0xD72C: return "Esegue [right$]"; case 0xD737: return "Esegue [mid$]"; case 0xD761: return "Parametri della stringa di pull"; case 0xD77C: return "Esegue [len]"; case 0xD782: return "Esci dalla modalità String"; case 0xD78B: return "Esegue [asc]"; case 0xD79B: return "Valuta il testo a 1 byte in XR"; case 0xD7AD: return "Esegue [val]"; case 0xD7B5: return "Converte stringa ASCII String in numero virgola mobile"; case 0xD7EB: return "Ottieni parametri per POKE/WAIT"; case 0xD7F7: return "Converte FAC#1 a intero in LINNUM"; case 0xD80D: return "Esegue [peek]"; case 0xD824: return "Esegue [poke]"; case 0xD82D: return "Esegue [wait]"; case 0xD849: return "Add 0.5 to FAC#1"; case 0xD850: return "Esegue sottrazione"; case 0xD862: return "Normalizza addizione"; case 0xD867: return "Esegue addizione"; case 0xD947: return "Complemento a 2 FAC#1"; case 0xD97E: return "Scrive ?OVERFLOW Error"; case 0xD983: return "Moltiplicazione per byte zero"; case 0xD9BC: return "Tabella di costanti numeri a virgola mobile"; case 0xD9EA: return "Esegue [log]"; case 0xDA28: return "Esegue moltiplicazione"; case 0xDA59: return "Moltiplica per un byte"; case 0xDA8C: return "Carica FAC#2 dalla memoria"; case 0xDAB7: return "Testare entrambi gli accumulatori"; case 0xDAD4: return "Overflow/Underflow"; case 0xDAE2: return "Moltiplica FAC#1 per 10"; case 0xDAF9: return "Costante 10 in numero virgola mobile"; case 0xDAFE: return "Divide FAC#1 per 10"; case 0xDB07: return "Divide FAC#2 per numero virgola mobile in (AC/YR)"; case 0xDB0F: return "Divide FAC#2 per FAC#1"; case 0xDBA2: return "Carica FAC#1 dalla memoria"; case 0xDBC7: return "Memorizza FAC#1 inmemoria"; case 0xDBC2: return "Copia FAC#2 in FAC#1"; case 0xDC0C: return "Copia FAC#1 in FAC#2"; case 0xDC1B: return "Arrotonda FAC#1"; case 0xDC2B: return "Controlla segno in FAC#1"; case 0xDC39: return "Esegue [sgn]"; case 0xDC58: return "Esegue [abs]"; case 0xDC5B: return "Compara FAC#1 con la memoria"; case 0xDC9B: return "Compara FAC#1 con intero"; case 0xDCCC: return "Esegue [int]"; case 0xDCF3: return "Converte stringa ASCII in un numero in FAC#1"; case 0xDDB3: return "Costanti conversione stringa"; case 0xDDC2: return "Scrive 'IN' e numero linea"; case 0xDDDD: return "Convette FAC#1 in stringa ASCII"; case 0xDE68: return "Converte TI in stringa"; case 0xDF11: return "Tabelle di costanti"; case 0xDF71: return "Esegue [sqr]"; case 0xDF7B: return "Esegue elevamento a potenza ($)"; case 0xDFB4: return "Nega FAC#1"; case 0xDFBF: return "Tabella di costanti"; case 0xDFED: return "Esegue [exp]"; case 0xE040: return "Valutazione della serie"; case 0xE08A: return "Costanti per RND"; case 0xE094: return "Esegue [rnd]"; case 0xE0F6: return "Gestire gli errori di I/O in BASIC"; case 0xE109: return "Carattere di uscita"; case 0xE10F: return "Carattere di ingresso"; case 0xE115: return "Predisposizione per output"; case 0xE11B: return "Predisposizione per input"; case 0xE121: return "Ottieni un carattere"; case 0xE127: return "Esegue [sys]"; case 0xE153: return "Esegue [save]"; case 0xE162: return "Esegue [verify/load]"; case 0xE1BB: return "Esegue [open]"; case 0xE1C4: return "Esegue [close]"; case 0xE1D1: return "Ottiene paramatri per LOAD/SAVE"; case 0xE1DB: return "Ottieni il parametro successivo di un byte"; case 0xE203: return "Verificare i parametri predefiniti"; case 0xE20B: return "Verificare per virgola"; case 0xE216: return "Ottieni parametri per OPEN/CLOSE"; case 0xE261: return "Esegue [cos]"; case 0xE268: return "Esegue [sin]"; case 0xE2B1: return "Esegue [tan]"; case 0xE2DD: return "Tabella delle costanti trigonometriche: 1.570796327=pi/2"; case 0xE2E2: return "Tabella delle costanti trigonometriche: 6.28318531=pi*2"; case 0xE2E7: return "Tabella delle costanti trigonometriche: 0.25"; case 0xE2EC: return "Tabella delle costanti trigonometriche: #05 (counter)"; case 0xE2ED: return "Tabella delle costanti trigonometriche: -14.3813907"; case 0xE2F2: return "Tabella delle costanti trigonometriche: 42.0077971"; case 0xE2F7: return "Tabella delle costanti trigonometriche: -76.7041703"; case 0xE2FC: return "Tabella delle costanti trigonometriche: 81.6052237"; case 0xE301: return "Tabella delle costanti trigonometriche: -41.3417021"; case 0xE306: return "Tabella delle costanti trigonometriche: 6.28318531"; case 0xE30B: return "Esegue [atn]"; case 0xE33B: return "Tabella delle costanti ATN: #0b (counter)"; case 0xE3EC: return "Tabella delle costanti ATN: -0.000684793912"; case 0xE341: return "Tabella delle costanti ATN: 0.00485094216"; case 0xE346: return "Tabella delle costanti ATN: -0.161117018"; case 0xE34B: return "Tabella delle costanti ATN: 0.034209638"; case 0xE350: return "Tabella delle costanti ATN: -0.0542791328"; case 0xE355: return "Tabella delle costanti ATN: 0.0724571965"; case 0xE35A: return "Tabella delle costanti ATN: -0.0898023954"; case 0xE35F: return "Tabella delle costanti ATN: 0.110932413"; case 0xE364: return "Tabella delle costanti ATN: -0.142839808"; case 0xE369: return "Tabella delle costanti ATN: 0.19999912"; case 0xE36E: return "Tabella delle costanti ATN: -0.333333316"; case 0xE373: return "Tabella delle costanti ATN: 1.00"; case 0xE378: return "BASIC Avviamento a freddo"; case 0xE387: return "CHRGET per pagina zero"; case 0xE39F: return "Seme RND per pagina zero 0.811635157"; case 0xE3A4: return "Initializza BASIC RAM"; case 0xE404: return "Messaggio di accensione in uscita"; case 0xE429: return "Messaggio di accensione: ' bytes free'"; case 0xE436: return "Messaggio di accensione: '**** cbm basic v2 ****'"; case 0xE44F: return "Tabella di vettori BASIC (per 0300)"; case 0xE45B: return "Inizializza i vettori"; case 0xE467: return "BASIC Riavvio a caldo [RUNSTOP-RESTORE]"; case 0xE47C: return "Byte inutilizzati per patch future"; case 0xE4A0: return "Uscita seriale 1"; case 0xE4A9: return "Uscita seriale 0"; case 0xE4B2: return "Ottieni dati seriali e clock ingresso"; case 0xE4BC: return "Ottieni la patch dell'indirizzo secondario per seriale LOAD/VERIFY"; case 0xE4C1: return "Patch di caricamento riposizionata per serialeLOAD/VERIFY"; case 0xE4CF: return "Patch di scrittura su nastro per CLOSE"; case 0xE4DA: return "Non usato"; case 0xE500: return "Restituire l'indirizzo di base I/O"; case 0xE505: return "Ritorna organizzazione dello schermo"; case 0xE50A: return "Leggi/Imposta la posizione X/Y del cursore"; case 0xE518: return "Inizializza l'I/O"; case 0xE55F: return "Pulisce lo schermo"; case 0xE581: return "Cursore in posizione base"; case 0xE587: return "Imposta i puntatori sullo schermo"; case 0xE5B5: return "Imposta valori predefiniti I/O (Entrata inutilizzata)"; case 0xE5BB: return "Imposta valori predefiniti I/O"; case 0xE5CF: return "Ottieni carattere dal buffer della tastiera"; case 0xE5E5: return "Input dalla tastiera"; case 0xE64F: return "Input dallo schermo o dalla tastiera"; case 0xE6B8: return "Test delle citazioni"; case 0xE6C5: return "Imposta stampa schermo"; case 0xEAEA: return "Avanza cursore"; case 0xE719: return "Ritira il cursore"; case 0xE72D: return "Torna alla riga precedente"; case 0xE742: return "Uscita sullo schermo"; case 0xE756: return "-unshifted characters-"; case 0xE800: return "-shifted characters-"; case 0xE8C3: return "Vai alla prossima riga"; case 0xE8D8: return "Uscita"; case 0xE8E8: return "Controllare il decremento della linea"; case 0xE8FA: return "Controllare l'incremento della linea"; case 0xE912: return "Setta il codice colore"; case 0xE921: return "Tabella codice colore"; case 0xE975: return "Scrolla lo schermo"; case 0xE9EE: return "Apre uno spazio nellpo schermo"; case 0xEA56: return "Muove una linea schermo"; case 0xEA6E: return "Sincronizza trasferimento colore"; case 0xEA7E: return "Imposta inizio riga"; case 0xEA8D: return "Pulisce la linea di schermo"; case 0xEAA1: return "Stampa sullo schermo"; case 0xEAB2: return "Sincronizza puntatore colore"; case 0xEABF: return "Punto di ingresso IRQ principale"; case 0xEB1E: return "Scansione tastiera"; case 0xEB71: return "Processa chiave immagine"; case 0xEC46: return "Puntatori alle tabelle di decodifica della tastiera "; case 0xEC5E: return "Tabella di decodifica della tastierae - Unshifted"; case 0xEC9F: return "Tabella di decodifica della tastiera - Shifted"; case 0xECE0: return "Tabella di decodifica della tastiera - Commodore"; case 0xED21: return "Controllo grafica/testo"; case 0xED69: return "Tabella di decodifica della tastiera"; case 0xEDA3: return "Tabella di decodifica della tastiera - controllo"; case 0xEDE4: return "Tabella di configurazione del chip video"; case 0xEDF4: return "Equivalente Shift-Run"; case 0xEDFD: return "Indirizzi riga schermo byte bassi"; case 0xEE14: return "Invia il comando TALK su Serial Bus"; case 0xEE17: return "Invia il comando LISTEN su Serial Bus"; case 0xEE49: return "Invia dati su bus seriale"; case 0xEEB4: return "Segnala errori: #80 - device not present"; case 0xEEB7: return "Segnala errori: #03 - write timeout"; case 0xEEC0: return "Invia l'indirizzo secondario di LISTEN"; case 0xEEC5: return "Pulisce ATN"; case 0xEECE: return "Invia l'indirizzo secondario di TALK"; case 0xEED3: return "Aspetta l'orologio"; case 0xEEE4: return "Invia seriale differito"; case 0xEEF6: return "Invia UNTALK su bus seriale"; case 0xEF04: return "Invia UNLISTEN su bus seriale"; case 0xEF19: return "Ricevi da bus seriale"; case 0xEE84: return "Orologio seriale acceso"; case 0xEF8D: return "Orologio seriale spento"; case 0xEF96: return "Ritardo di 1 ms"; case 0xEFA3: return "Invia RS-232"; case 0xEFEE: return "Invia un nuovo byte RS-232"; case 0xF016: return "Errore 'No DSR'"; case 0xF019: return "Errore 'No CTS'"; case 0xF021: return "Disabilita il timer"; case 0xF027: return "Calcola il conteggio dei bit"; case 0xF036: return "Riceve RS-232"; case 0xF05B: return "Imposta per ricevere"; case 0xF068: return "Elabora byte RS-232"; case 0xF0BC: return "Invia a RS-232"; case 0xF0ED: return "Invia al buffer RS-232"; case 0xF116: return "Ingresso da RS-232"; case 0xF14F: return "Ottieni da RS-232"; case 0xF160: return "Bus seriale inattivo"; case 0xF174: return "Tabella dei messaggi I/O del kernel: ' i/o error #'"; case 0xF1DF: return "Tabella dei messaggi I/O del kernel: 'ok'"; case 0xF1E2: return "Stampa messaggio se diretto"; case 0xF1E6: return "Stampa messaggio"; case 0xF1F5: return "Ottiene un byte"; case 0xF20E: return "Immettere un byte"; case 0xF250: return "Ottiene da Cassetta/Seriale/RS-232"; case 0xF27A: return "Emetti un carattere"; case 0xF2C7: return "Imposta dispositivo di input"; case 0xF30E: return "Imposta dispositivo di output"; case 0xF34A: return "Chiude file"; case 0xF3CF: return "Cerca file"; case 0xF3DF: return "Imposta i valori dei file"; case 0xF3EF: return "Annulla tutti i file"; case 0xF3F3: return "Ripristina l'I/O predefinito"; case 0xF40A: return "Apei file"; case 0xF495: return "Invia indirizzo secondario"; case 0xF4C7: return "Apri RS-232"; case 0xF542: return "Carica RAM dal dispositivo"; case 0xF549: return "-load-"; case 0xF55C: return "Carica file da bus seriale"; case 0xF5CA: return "Carica file da nastro"; case 0xF647: return "Stampa \"SEARCHING\""; case 0xF659: return "Stampa nome file"; case 0xF66A: return "Stampa \"LOADING/VERIFYING\""; case 0xF675: return "Scrive la RAM nel dispositivo"; case 0xF685: return "-save-"; case 0xF692: return "Scrive nel bus seriale"; case 0xF6F1: return "Scrive nella cassetta"; case 0xF728: return "Scrive \"SAVING\""; case 0xF734: return "Incrementa l'orologio in tempo reale"; case 0xF760: return "Leggi l'orologio in tempo reale"; case 0xF767: return "Imposta orologio in tempo reale"; case 0xF770: return "Verifica il tasto STOP"; case 0xF77E: return "Messaggi di errore I/O in uscita: 'too many files'"; case 0xF781: return "Messaggi di errore I/O in uscita: 'file open'"; case 0xF784: return "Messaggi di errore I/O in uscita: 'file not open'"; case 0xF787: return "Messaggi di errore I/O in uscita: 'file not found'"; case 0xF78A: return "Messaggi di errore I/O in uscita: 'device not present'"; case 0xF78D: return "Messaggi di errore I/O in uscita: 'not input file'"; case 0xF790: return "Messaggi di errore I/O in uscita: 'not output file'"; case 0xF793: return "Messaggi di errore I/O in uscita: 'missing filename'"; case 0xF796: return "Messaggi di errore I/O in uscita: 'illegal device number'"; case 0xF7AF: return "Trova qualsiasi intestazione del nastro"; case 0xF7E7: return "Scrivi intestazione nastro"; case 0xF84D: return "Ottieni indirizzo buffer"; case 0xF854: return "Imposta le statistiche del buffer/i puntatori finali"; case 0xF867: return "Trova intestazione nastro specifica"; case 0xF88A: return "Puntatore del nastro bump"; case 0xF894: return "Stampa \"PRESS PLAY ON TAPE\""; case 0xF8AB: return "Controlla lo stato del nastro"; case 0xF8B7: return "Stampa \"PRESS RECORD...\""; case 0xF8C0: return "Avvia la lettura del nastro"; case 0xF8E3: return "Avvia scrittura su nastro"; case 0xF8F4: return "Codice nastro comune"; case 0xF94B: return "Controllare l'arresto del nastro"; case 0xF95D: return "Imposta tempo di lettura"; case 0xF98E: return "Leggi bit di nastro"; case 0xFAAD: return "Memorizza i caratteri del nastro"; case 0xFBB2: return "Reimposta puntatore nastro"; case 0xFBDB: return "Nuova configurazione del personaggio"; case 0xFBEA: return "Invia tono su nastro"; case 0xFC06: return "Scrivi dati su nastro"; case 0xFC95: return "Scrivi Tape Leader"; case 0xFCCF: return "Ripristina IRQ normale"; case 0xFCF6: return "Imposta vettore IRQ"; case 0xFD08: return "Ferma il motore del nastro"; case 0xFD11: return "Seleziona il puntatore di lettura/scrittura"; case 0xFD1B: return "Puntatore di lettura/scrittura a sbalzo"; case 0xFD22: return "Ingresso RESET all'accensione"; case 0xFD3F: return "Verificare la presenza di una ROM"; case 0xFD4D: return "Maschera ROM 'a0CBM'"; case 0xFD52: return "Ripristina i vettori Kernal (at 0314)"; case 0xFD57: return "Cambia vettori per l'utente"; case 0xFD6D: case 0xFD6E: return "Vettori di ripristino del kernel"; case 0xFD8D: return "Inizializza le costanti di sistema"; case 0xFDF1: case 0xFDF2: return "Vettori IRQ per I/O su nastro"; case 0xFDF9: return "Inizializza I/O"; case 0xFE39: return "Abilita timer"; case 0xFE49: return "Imposta nome file"; case 0xFE50: return "Imposta i parametri del file logico"; case 0xFE57: return "Ottieni parola di stato I/O"; case 0xFE66: return "Controlla i messaggi del sistema operativo"; case 0xFE6F: return "Imposta timeout IEEE"; case 0xFE73: return "Imposta/leggi la parte superiore della memoria"; case 0xFE82: return "Imposta/Leggi il fondo della memoria"; case 0xFEA9: return "Voce di trasferimento NMI"; case 0xFED2: return "Avvio a caldo di base [BRK]"; case 0xFF56: return "Esci da Interruzione"; case 0xFF5B: return "Tabella dei tempi RS-232"; case 0xFF72: return "Immissione trasferimento IRQ"; case 0xFF8A: return "Tabella di salto del kernel: ripristino dei vettori"; case 0xFF8D: return "Tabella di salto del kernel: modifica dei vettori per l'utente"; case 0xFF90: return "Tabella di salto del kernel: controlla i messaggi del sistema operativo"; case 0xFF93: return "Tabella di salto del kernel: invia SA dopo l'ascolto"; case 0xFF96: return "Tabella di salto del kernel: invia SA dopo la conversazione"; case 0xFF99: return "Tabella di salto del kernel: imposta/Leggi RAM di sistema in alto"; case 0xFF9C: return "Tabella di salto del kernel: imposta/legge la parte inferiore della RAM di sistema"; case 0xFF9F: return "Tabella di salto del kernel: scansione della tastiera"; case 0xFFA2: return "Tabella di salto del kernel: impostare il timeout in IEEE"; case 0xFFA5: return "Tabella di salto del kernel: byte seriale handshake in ingresso"; case 0xFFA8: return "Tabella di salto del kernel: thandshake seriale byte in uscita"; case 0xFFAB: return "Tabella di salto del kernel: comando bus seriale UNTALK"; case 0xFFAE: return "Tabella di salto del kernel: comando bus seriale UNLISTEN"; case 0xFFB1: return "Tabella di salto del kernel: comando bus seriale LISTEN"; case 0xFFB4: return "Tabella di salto del kernel: comando bus seriale TALK"; case 0xFFB7: return "Tabella di salto del kernel: leggere la parola di stato I/O"; case 0xFFBA: return "Tabella di salto del kernel: imposta i parametri del file logico"; case 0xFFBD: return "Tabella di salto del kernel: imposta nome file"; case 0xFFC0: return "Tabella di salto del kernel: vettore apertura [F40A]"; case 0xFFC3: return "Tabella di salto del kernel: vettore chiusura [F34A]"; case 0xFFC6: return "Tabella di salto del kernel: imposta input [F2C7]"; case 0xFFC9: return "Tabella di salto del kernel: imposta output [F309]"; case 0xFFCC: return "Tabella di salto del kernel: ripristina vettore I/O [F353]"; case 0xFFCF: return "Tabella di salto del kernel: vettore input, chrin [F20E]"; case 0xFFD2: return "Tabella di salto del kernel: vettore output, chrout [F27A]"; case 0xFFD5: return "Tabella di salto del kernel: carica RAM dal dispositivo"; case 0xFFD8: return "Tabella di salto del kernel: scrive RAM dal dispositivo"; case 0xFFDB: return "Tabella di salto del kernel: imposta orologio in tempo reale"; case 0xFFDE: return "Tabella di salto del kernel: leggi l'orologio in tempo reale"; case 0xFFE1: return "Tabella di salto del kernel: vettore di arresto di prova [F770]"; case 0xFFE4: return "Tabella di salto del kernel: ottieni dalla tastiera [F1F5]"; case 0xFFE7: return "Tabella di salto del kernel: chiudi tutti i canali e i file [F3EF]"; case 0xFFEA: return "Tabella di salto del kernel: incrementa l'orologio in tempo reale"; case 0xFFED: return "Tabella di salto del kernel: torna organizzazione dello schermo"; case 0xFFF0: return "Tabella di salto del kernel: leggi/imposta la posizione X/Y del cursore"; case 0xFFF3: return "Tabella di salto del kernel: restituire l'indirizzo di base I/O"; case 0xFFFA: return "NMI"; case 0xFFFC: return "RESET"; case 0xFFFE: return "IRQ"; default: if ((addr>=0x73) && (addr<=0x8A)) return "CHRGET subroutine (get BASIC char)"; if ((addr>=0xD9) && (addr<=0xF0)) return "Screen line link table"; if ((addr>=0x100) && (addr<=0x10A)) return "Floating to ASCII work area"; if ((addr>=0x10B) && (addr<=0x013E)) return "Tape error log"; if ((addr>=0x100) && (addr<=0x1FF)) return "Processor stack area"; if ((addr>=0x200) && (addr<=0x258)) return "Basic input buffer"; if ((addr>=0x259) && (addr<=0x262)) return "Logical file table"; if ((addr>=0x263) && (addr<=0x26C)) return "Device # table"; if ((addr>=0x26D) && (addr<=0x276)) return "Secondary Address table"; if ((addr>=0x277) && (addr<=0x280)) return "Keyboard buffer"; if ((addr>=0x2A1) && (addr<=0x2FF)) return "Program indirects"; if ((addr>=0x33C) && (addr<=0x03FB)) return "Cassette buffer"; if ((addr>=0x400) && (addr<=0x0FFF)) return "3K expansion RAM area"; if ((addr>=0x1000) && (addr<=0x11FF)) return "User Basic area/Screen memory"; if ((addr>=0x1200) && (addr<=0x1DFF)) return "User Basic area"; if ((addr>=0x1E00) && (addr<=0x1FFF)) return "Screen memory"; if ((addr>=0x2000) && (addr<=0x3FFF)) return "8K expansion RAM/ROM block 1"; if ((addr>=0x4000) && (addr<=0x5FFF)) return "8K expansion RAM/ROM block 2"; if ((addr>=0x6000) && (addr<=0x7FFF)) return "8K expansion RAM/ROM block 3"; if ((addr>=0x8000) && (addr<=0x83FF)) return "4K Character generator ROM/Upper case and graphics"; if ((addr>=0x8400) && (addr<=0x87FF)) return "4K Character generator ROM/Reversed upper case and graphics"; if ((addr>=0x8800) && (addr<=0x8BFF)) return "4K Character generator ROM/Upper and lower case"; if ((addr>=0x8C00) && (addr<=0x8FFF)) return "4K Character generator ROM/Reversed upper and lower case"; if ((addr>=0x9400) && (addr<=0x95FF)) return "location of COLOR RAM with additional RAM at blk 1"; if ((addr>=0x9600) && (addr<=0x97FF)) return "Normal location of COLOR RAM"; if ((addr>=0x9800) && (addr<=0x9BFF)) return "I/O block 2"; if ((addr>=0x9C00) && (addr<=0x9FFF)) return "I/O block 3"; if ((addr>=0xA000) && (addr<=0xBFFF)) return "8K decoded block for expansion ROM"; } default: switch ((int)addr) { case 0x00: return "Jump for USR"; case 0x01: case 0x02: return "Vector for USR"; case 0x03: case 0x04: return "Float-Fixed vector"; case 0x05: case 0x06: return "Fixed-Float vector"; case 0x07: return "Search character"; case 0x08: return "Scan-quotes flag"; case 0x09: return "TAB column save"; case 0x0A: return "0=LOAD, 1=VERIFY"; case 0x0B: return "Input buffer pointer/# subscript"; case 0x0C: return "Default DIM flag"; case 0x0D: return "Type: FF=string, 00=numeric"; case 0x0E: return "Type: 80=integer, 00=floating point"; case 0x0F: return "DATA scan/LlST quote/memory flag"; case 0x10: return "Subscript/FNx flag"; case 0x11: return "0 = INPUT;$40 = GET;$98 = READ"; case 0x12: return "ATN sign/Comparison eval flag"; case 0x13: return "Current l/O prompt flag"; case 0x14: case 0x15: return "Integer value"; case 0x16: return "Pointer: temporary string stack"; case 0x17: case 0x18: return "Last temp string vector"; case 0x19: case 0x1A: case 0x1B: case 0x1C: case 0x1D: case 0x1E: case 0x1F: case 0x20: case 0x21: return "Stack for temporary strings"; case 0x22: case 0x23: case 0x24: case 0x25: return "Utility pointer area"; case 0x26: case 0x27: case 0x28: case 0x29: case 0x2A: return "Product area for multiplication"; case 0x2B: case 0x2C: return "Pointer: Start of Basic"; case 0x2D: case 0x2E: return "Pointer: Start of Variables"; case 0x2F: case 0x30: return "Pointer: Start of Arrays"; case 0x31: case 0x32: return "Pointer: End of Arrays"; case 0x33: case 0x34: return "Pointer: String storage (moving down)"; case 0x35: case 0x36: return "Utility string pointer"; case 0x37: case 0x38: return "Pointer: Limit of memory"; case 0x39: case 0x3A: return "Current Basic line number"; case 0x3B: case 0x3C: return "Previous Basic line number"; case 0x3D: case 0x3E: return "Pointer: Basic statement for CONT"; case 0x3F: case 0x40: return "Current DATA line number"; case 0x41: case 0x42: return "Current DATA address"; case 0x43: case 0x44: return "Input vector"; case 0x45: case 0x46: return "Current variable name"; case 0x47: case 0x48: return "Current variable address"; case 0x49: case 0x4A: return "Variable pointer for FOR/NEXT"; case 0x4B: case 0x4C: return "Y-save; op-save; Basic pointer save"; case 0x4D: return "Comparison symbol accumulator"; case 0x4E: case 0x4F: case 0x50: case 0x51: case 0x52: case 0x53: return "Misc work area, pointers, etc"; case 0x54: case 0x55: case 0x56: return "Jump vector for functions"; case 0x57: case 0x58: case 0x59: case 0x5A: case 0x5B: case 0x5C: case 0x5D: case 0x5E: case 0x5F: case 0x60: return "Misc numeric work area"; case 0x61: return "Accum#1: Exponent"; case 0x62: case 0x63: case 0x64: case 0x65: return "Accum#1: Mantissa"; case 0x66: return "Accum#1: Sign"; case 0x67: return "Series evaluation constant pointer"; case 0x68: return "Accum#1 hi-order (overflow)"; case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: return "Accum#2: Exponent, etc."; case 0x6F: return "Sign comparison, Acc#1 vs #2"; case 0x70: return "Accum#1 lo-order (rounding)"; case 0x71: case 0x72: return "Cassette buffer length/Series pointer"; case 0x7A: case 0x7B: return "Basic pointer (within subroutine)"; case 0x8B: case 0x8C: case 0x8D: case 0x8E: case 0x8F: return "RND seed value"; case 0x90: return "Status word ST"; case 0x91: return "Keyswitch PIA: STOP and RVS flags"; case 0x92: return "Timing constant for tape"; case 0x93: return "Load=0, Verify=1"; case 0x94: return "Serial output: deferred char flag"; case 0x95: return "Serial deferred character"; case 0x96: return "Tape EOT received"; case 0x97: return "Register save"; case 0x98: return "How many open files"; case 0x99: return "Input device (normally 0)"; case 0x9A: return "Output (CMD) device, normally 3"; case 0x9B: return "Tape character parity"; case 0x9C: return "Byte-received flag"; case 0x9D: return "Direct=$80/RUN=0 output control"; case 0x9E: return "Tape Pass 1 error log/char buffer"; case 0x9F: return "Tape Pass 2 error log corrected"; case 0xA0: case 0xA1: case 0xA2: return "Jiffy Clock (HML)"; case 0xA3: return "Serial bit count/EOI flag"; case 0xA4: return "Cycle count"; case 0xA5: return "Countdown, tape write/bit count"; case 0xA6: return "Pointer: tape buffer"; case 0xA7: return "Tape Write ldr count/Read pass/inbit"; case 0xA8: return "Tape Write new byte/Read error/inbit"; case 0xA9: return "Write start bit/Read bit err/stbit"; case 0xAA: return "Tape Scan;Cnt;Ld;End/byte assy"; case 0xAB: return " Write lead length/Rd checksum/parity"; case 0xAC: case 0xAD: return "Pointer: tape buffer, scrolling"; case 0xAE: case 0xAF: return "Tape end addresses/End of program"; case 0xB0: case 0xB1: return "Tape timing constants"; case 0xB2: case 0xB3: return "Pointer: start of tape buffer"; case 0xB4: return "Tape timer (1 =enable); bit cnt"; case 0xB5: return "Tape EOT/RS-232 next bit to send"; case 0xB6: return "Read character error/outbyte buffer"; case 0xB7: return "# characters in file name"; case 0xB8: return "Current logical file"; case 0xB9: return "Current secondary address"; case 0xBA: return "Current device"; case 0xBB: case 0xBC: return "Pointer: to file name"; case 0xBD: return "Write shift word/Read input char"; case 0xBE: return "# blocks remaining to Write/Read"; case 0xBF: return "Serial word buffer"; case 0xC0: return "Tape motor interlock"; case 0xC1: case 0xC2: return "I/O start addresses"; case 0xC3: case 0xC4: return "KERNAL setup pointer"; case 0xC5: return "Current key pressed"; case 0xC6: return "# chars in keyboard buffer"; case 0xC7: return "Screen reverse flag"; case 0xC8: return "Pointer: End-of-line for input"; case 0xC9: case 0xCA: return "Input cursor log (row, column)"; case 0xCB: return "Which key: 64 if no key"; case 0xCC: return "Cursor enable (0=flash cursor)"; case 0xCD: return "Cursor timing countdown"; case 0xCE: return "Character under cursor"; case 0xCF: return "Cursor in blink phase"; case 0xD0: return "Input from screen/from keyboard"; case 0xD1: case 0xD2: return "Pointer to screen line"; case 0xD3: return "Position of cursor on above line"; case 0xD4: return "0=direct cursor, else programmed"; case 0xD5: return "Current screen line length"; case 0xD6: return "Row where cursor lives"; case 0xD7: return "Last inkey/checksum/buffer"; case 0xD8: return "# of INSERTs outstanding"; case 0xF1: return "Dummy screen link"; case 0xF2: return "Screen row marker"; case 0xF3: case 0xF4: return "Screen color pointer"; case 0xF5: case 0xF6: return "Keyboard pointer"; case 0xF7: case 0xF8: return "RS-232 Rcv pointer"; case 0xF9: case 0xFA: return "RS-232 Tx pointer"; case 0xFB: case 0xFC: case 0xFD: case 0xFE: return "Operating system free zero page space"; case 0xFF: return "Basic storage"; case 0x281: case 0x282: return "Start of memory for op system"; case 0x283: case 0x284: return "Top of memory for op system"; case 0x285: return "Serial bus timeout flag"; case 0x286: return "Current color code"; case 0x287: return "Color under cursor"; case 0x288: return "Screen memory page"; case 0x289: return "Max size of keyboard buffer"; case 0x28A: return "Key repeat (128=repeat all keys)"; case 0x28B: return "Repeat speed counter"; case 0x28C: return "Repeat delay counter"; case 0x28D: return "Keyboard Shift/Control flag"; case 0x28E: return "Last keyboard shift pattern"; case 0x28F: case 0x290: return "Pointer: decode logic"; case 0x291: return "Shift mode switch (0=enabled, 128=locked)"; case 0x292: return "Autoscrolldownflag (0=on, <>0=off)"; case 0x293: return "RS-232 control register"; case 0x294: return "RS-232 command register"; case 0x295: case 0x296: return "Nonstandard (Bit time/2-100)"; case 0x297: return "RS-232 status register"; case 0x298: return "Number of bits to send"; case 0x299: case 0x29A: return "Baud rate (full) bit time"; case 0x29B: return "RS-232 receive pointer"; case 0x29C: return "RS-232 input pointer"; case 0x29D: return "RS-232 transmit pointer"; case 0x29E: return "RS-232 output pointer"; case 0x29F: case 0x2A0: return "Holds IRQ during tape operations"; case 0x300: case 0x301: return "Error message link"; case 0x302: case 0x303: return "Basic warm start link"; case 0x304: case 0x305: return "Crunch Basic tokens link"; case 0x306: case 0x307: return "Print tokens link"; case 0x308: case 0x309: return "Start new Basic code link"; case 0x30A: case 0x30B: return "Get arithmetic element link"; case 0x30C: return "Storage for 6502 .A register"; case 0x30D: return "Storage for 6502 .X register"; case 0x30E: return "Storage for 6502 .Y register"; case 0x30F: return "Storage for 6502 .P register"; case 0x314: case 0x315: return "Hardware (IRQ) interrupt vector [EABF]"; case 0x316: case 0x317: return "Break interrupt vector [FED2]"; case 0x318: case 0x319: return "NMI interrupt vector [FEAD]"; case 0x31A: case 0x31B: return "OPEN vector [F40A]"; case 0x31C: case 0x31D: return "CLOSE vector [F34A]"; case 0x31E: case 0x31F: return "Set-input vector [F2C7]"; case 0x320: case 0x321: return "Set-output vector [F309]"; case 0x322: case 0x323: return "Restore l/O vector [F3F3]"; case 0x324: case 0x325: return "INPUT vector [F20E]"; case 0x326: case 0x327: return "Output vector [F27A]"; case 0x328: case 0x329: return "Test-STOP vector [F770]"; case 0x32A: case 0x32B: return "GET vector [F1F5]"; case 0x32C: case 0x32D: return "Abort l/O vector [F3EF]"; case 0x32E: case 0x32F: return "User vector (default BRK) [FED2]"; case 0x330: case 0x331: return "Link to load RAM [F549]"; case 0x332: case 0x333: return "Link to save RAM [F685]"; case 0x9000: return "Vic: bits 0-6 horizontal centering, bit 7 sets interlace scan"; case 0x9001: return "Vic: vertical centering"; case 0x9002: return "Vic: bits 0-6 set # of columns, bit 7 is part of video matrix address"; case 0x9003: return "Vic: bits 1-6 set # of rows, bit 0 sets 8x8 or 16x8 chars"; case 0x9004: return "Vic: TV raster beam line"; case 0x9005: return "Vic: bits 0-3 start of character memory (default = 0), bits 4-7 is rest of video address (default= F)"; case 0x9006: return "Vic: horizontal position of light pen"; case 0x9007: return "Vic: vertical position of light pen"; case 0x9008: return "Vic: digitized value of paddle X"; case 0x9009: return "Vic: digitized value of paddle Y"; case 0x900A: return "Vic: frequency for oscillator 1 (low) (on: 128-255)"; case 0x900B: return "Vic: frequency for oscillator 2 (medium) (on: 128-255)"; case 0x900C: return "Vic: frequency for oscillator 3 (high) (on: 128-255)"; case 0x900D: return "Vic: frequency of noise source"; case 0x900E: return "Vic: bit 0-3 sets volume of all sound, bits 4-7 are auxiliary color information"; case 0x900F: return "Vic: Screen and border color register, bits 4-7 select background color, bits 0-2 select border color, bit 3 selects inverted or normal mode"; case 0x9110: return "Via #1: Port B output register"; case 0x9111: return "Via #1: Port A output register"; case 0x9112: return "Via #1: Data direction register B"; case 0x9113: return "Via #1: Data direction register A"; case 0x9114: return "Via #1: Timer 1 low byte"; case 0x9115: return "Via #1: Timer 1 high byte & counter"; case 0x9116: return "Via #1: Timer 1 low byte"; case 0x9117: return "Via #1: Timer 1 high byte"; case 0x9118: return "Via #1: Timer 2 low byte"; case 0x9119: return "Via #1: Timer 2 high byte"; case 0x911A: return "Via #1: Shift register"; case 0x911B: return "Via #1: Auxiliary control register"; case 0x911C: return "Via #1: Peripheral control register"; case 0x911D: return "Via #1: Interrupt flag register"; case 0x911E: return "Via #1: Interrupt enable register"; case 0x911F: return "Via #1: Port A (Sense cassette switch)"; case 0x9120: return "Via #2: Port B output register"; case 0x9121: return "Via #2: Port A output register"; case 0x9122: return "Via #2: Data direction register B"; case 0x9123: return "Via #2: Data direction register A"; case 0x9124: return "Via #2: Timer 1 low byte latch"; case 0x9125: return "Via #2: Timer 1 high byte latch"; case 0x9126: return "Via #2: Timer 1 low byte counter"; case 0x9127: return "Via #2: Timer 1 high byte counter"; case 0x9128: return "Via #2: Timer 2 low byte"; case 0x9129: return "Via #2: Timer 2 high byte"; case 0x912A: return "Via #2: Shift register"; case 0x912B: return "Via #2: Auxiliary control register"; case 0x912C: return "Via #2: Peripheral control register"; case 0x912D: return "Via #2: Interrupt flag register"; case 0x912E: return "Via #2: Interrupt enable register"; case 0x912F: return "Via #2: Port A output register"; case 0xC000: case 0xC001: return "Basic Restart Vectors"; case 0xC00C: case 0xC00D: return "BASIC Command Vectors"; case 0xC052: case 0xC053: return "BASIC Function Vectors"; case 0xC080: case 0xC081: return "BASIC Operator Vectors "; case 0xC09E: return "BASIC Command Keyword Table"; case 0xC129: return "BASIC Misc. Keyword Table"; case 0xC140: return "BASIC Operator Keyword Table"; case 0xC14D: return "BASIC Function Keyword Table"; case 0xC19E: return "Error Message Table"; case 0xC328: case 0xC329: return "Error Message Pointers"; case 0xC364: return "Misc. Messages: ok"; case 0xC369: return "Misc. Messages: error"; case 0xC38A: return "Find FOR/GOSUB Entry on Stack"; case 0xC3B8: return "Open Space in Memory"; case 0xC3FB: return "Check Stack Depth"; case 0xC408: return "Check Memory Overlap"; case 0xC435: return "Output ?OUT OF MEMORY Error"; case 0xC437: return "Error Routine"; case 0xC469: return "Break Entry"; case 0xC474: return "Restart BASIC"; case 0xC480: return "Input & Identify BASIC Line"; case 0xC49C: return "Get Line Number & Tokenise Text"; case 0xC4A2: return "Insert BASIC Text"; case 0xC533: return "Rechain Lines"; case 0xC560: return "Input Line Into Buffer"; case 0xC579: return "Tokenise Input Buffer"; case 0xC613: return "Search for Line Number"; case 0xC642: return "Perform [new]"; case 0xC65E: return "Perform [clr]"; case 0xC68E: return "Reset TXTPTR"; case 0xC69C: return "Perform [list]"; case 0xC717: return "Handle LIST Character"; case 0xC742: return "Perform [for]"; case 0xC7AE: return "BASIC Warm Start"; case 0xC7C4: return "Check End of Program"; case 0xC7E1: return "Prepare to execute statement"; case 0xC7ED: return "Perform BASIC Keyword"; case 0xC81D: return "Perform [restore]"; case 0xC82C: return "Perform [stop], [end], break"; case 0xC857: return "Perform [cont]"; case 0xC871: return "Perform [run]"; case 0xC883: return "Perform [gosub]"; case 0xC8A0: return "Perform [goto]"; case 0xC8D2: return "Perform [return]"; case 0xC8F8: return "Perform [data]"; case 0xC906: return "Search for Next Statement/Line"; case 0xC928: return "Perform [if]"; case 0xC93B: return "Perform [rem]"; case 0xC94B: return "Perform [on]"; case 0xC96B: return "Fetch linnum From BASIC"; case 0xC9A5: return "Perform [let]"; case 0xC9C4: return "Assign Integer"; case 0xC9D6: return "Assign Floating Point"; case 0xC9D9: return "Assign String"; case 0xC9E3: return "Assign TI$"; case 0xCA2C: return "Add Digit to FAC#1"; case 0xCA80: return "Perform [print]#"; case 0xCA86: return "Perform [cmd]"; case 0xC99A: return "Print String From Memory"; case 0xCAA0: return "Perform [print]"; case 0xCAB8: return "Output Variable"; case 0xCAD7: return "Output CR/LF"; case 0xCAE8: return "Handle comma, TAB(, SPC("; case 0xCB1E: return "Output String"; case 0xCB3B: return "Output Format Character"; case 0xCB4B: return "Handle Bad Data"; case 0xCB7B: return "Perform [get]"; case 0xCBA5: return "Perform [input#]"; case 0xCBBF: return "Perform [input]"; case 0xCBEA: return "Read Input Buffer"; case 0xCBF9: return "Do Input Prompt"; case 0xCC06: return "Perform [read]"; case 0xCC35: return "General Purpose Read Routine"; case 0xCCFC: return "Input Error Messages"; case 0xCD1E: return "Perform [next]"; case 0xCD61: return "Check Valid Loop"; case 0xCD8A: return "Confirm Result"; case 0xCD9E: return "Evaluate Expression in Text"; case 0xCE8E: return "Evaluate Single Term"; case 0xCEA8: return "Constant - pi"; case 0xCEAD: return "Continue Expression"; case 0xCEF1: return "Expression in Brackets"; case 0xCEF7: return "Confirm Character ')'"; case 0xCEFA: return "Confirm Character '('"; case 0xCEFD: return "Confirm Character comma"; case 0xCF08: return "Output ?SYNTAX Error"; case 0xCF0D: return "Set up NOT Function"; case 0xCF14: return "Identify Reserved Variable"; case 0xCF28: return "Search for Variable"; case 0xCF48: return "Convert TI to ASCII String"; case 0xCFA7: return "Identify Function Type"; case 0xCFB1: return "Evaluate String Function"; case 0xCFD1: return "Evaluate Numeric Function"; case 0xCFE6: return "Perform [or], [and]"; case 0xD016: return "Perform <, =, >"; case 0xD01B: return "Numeric Comparison"; case 0xD02E: return "String Comparison"; case 0xD07E: return "Perform [dim]"; case 0xD08B: return "Identify Variable"; case 0xD0E7: return "Locate Ordinary Variable"; case 0xD11D: return "Create New Variable"; case 0xD128: return "Create Variable"; case 0xD194: return "Allocate Array Pointer Space"; case 0xD1A5: return "Constant 32768 in Flpt"; case 0xD1AA: return "FAC#1 to Integer in (AC/YR)"; case 0xD1B2: return "Evaluate Text for Integer"; case 0xD1B7: return "FAC#1 to Positive Integer"; case 0xD1D1: return "Get Array Parameters"; case 0xD218: return "Find Array"; case 0xD245: return "'?bad subscript error'"; case 0xD248: return "'?illegal quantity error'"; case 0xD261: return "Create Array"; case 0xD30E: return "Locate Element in Array"; case 0xD34C: return "Number of Bytes in Subscript"; case 0xD37D: return "Perform [fre]"; case 0xD391: return "Convert Integer in (AC/YR) to Flpt"; case 0xD39E: return "Perform [pos]"; case 0xD3A6: return "Confirm Program Mode"; case 0xD3E1: return "Check Syntax of FN"; case 0xD3F4: return "Perform [fn]"; case 0xD465: return "Perform [str$]"; case 0xD487: return "Set Up String"; case 0xD4D5: return "Save String Descriptor"; case 0xD4F4: return "Allocate Space for String"; case 0xD526: return "Garbage Collection"; case 0xD5BD: return "Search for Next String"; case 0xD606: return "Collect a String"; case 0xD63D: return "Concatenate Two Strings"; case 0xD67A: return "Store String in High RAM"; case 0xD6A3: return "Perform String Housekeeping"; case 0xD6DB: return "Clean Descriptor Stack"; case 0xD6EC: return "Perform [chr$]"; case 0xD700: return "Perform [left$]"; case 0xD72C: return "Perform [right$]"; case 0xD737: return "Perform [mid$]"; case 0xD761: return "Pull sTring Parameters"; case 0xD77C: return "Perform [len]"; case 0xD782: return "Exit String Mode"; case 0xD78B: return "Perform [asc]"; case 0xD79B: return "Evaluate Text to 1 Byte in XR"; case 0xD7AD: return "Perform [val]"; case 0xD7B5: return "Convert ASCII String to Flpt"; case 0xD7EB: return "Get parameters for POKE/WAIT"; case 0xD7F7: return "Convert FAC#1 to Integer in LINNUM"; case 0xD80D: return "Perform [peek]"; case 0xD824: return "Perform [poke]"; case 0xD82D: return "Perform [wait]"; case 0xD849: return "Add 0.5 to FAC#1"; case 0xD850: return "Perform Subtraction"; case 0xD862: return "Normalise Addition"; case 0xD867: return "Perform Addition"; case 0xD947: return "2's Complement FAC#1"; case 0xD97E: return "Output ?OVERFLOW Error"; case 0xD983: return "Multiply by Zero Byte"; case 0xD9BC: return "Table of Flpt Constants"; case 0xD9EA: return "Perform [log]"; case 0xDA28: return "Perform Multiply"; case 0xDA59: return "Multiply by a Byte"; case 0xDA8C: return "Load FAC#2 From Memory"; case 0xDAB7: return "Test Both Accumulators"; case 0xDAD4: return "Overflow/Underflow"; case 0xDAE2: return "Multiply FAC#1 by 10"; case 0xDAF9: return "Constant 10 in Flpt"; case 0xDAFE: return "Divide FAC#1 by 10"; case 0xDB07: return "Divide FAC#2 by Flpt at (AC/YR)"; case 0xDB0F: return "Divide FAC#2 by FAC#1"; case 0xDBA2: return "Load FAC#1 From Memory"; case 0xDBC7: return "Store FAC#1 in Memory"; case 0xDBC2: return "Copy FAC#2 into FAC#1"; case 0xDC0C: return "Copy FAC#1 into FAC#2"; case 0xDC1B: return "Round FAC#1"; case 0xDC2B: return "Check Sign of FAC#1"; case 0xDC39: return "Perform [sgn]"; case 0xDC58: return "Perform [abs]"; case 0xDC5B: return "Compare FAC#1 With Memory"; case 0xDC9B: return "Convert FAC#1 to Integer"; case 0xDCCC: return "Perform [int]"; case 0xDCF3: return "Convert ASCII String to a Number in FAC#1"; case 0xDDB3: return "String Conversion Constants"; case 0xDDC2: return "Output 'IN' and Line Number"; case 0xDDDD: return "Convert FAC#1 to ASCII String"; case 0xDE68: return "Convert TI to String"; case 0xDF11: return "Table of Constants"; case 0xDF71: return "Perform [sqr]"; case 0xDF7B: return "Perform power ($)"; case 0xDFB4: return "Negate FAC#1"; case 0xDFBF: return "Table of Constants"; case 0xDFED: return "Perform [exp]"; case 0xE040: return "Series Evaluation"; case 0xE08A: return "Constants for RND"; case 0xE094: return "Perform [rnd]"; case 0xE0F6: return "Handle I/O Error in BASIC"; case 0xE109: return "Output Character"; case 0xE10F: return "Input Character"; case 0xE115: return "Set Up For Output"; case 0xE11B: return "Set Up For Input"; case 0xE121: return "Get One Character"; case 0xE127: return "Perform [sys]"; case 0xE153: return "Perform [save]"; case 0xE162: return "Perform [verify/load]"; case 0xE1BB: return "Perform [open]"; case 0xE1C4: return "Perform [close]"; case 0xE1D1: return "Get Parameters For LOAD/SAVE"; case 0xE1DB: return "Get Next One Byte Parameter"; case 0xE203: return "Check Default Parameters"; case 0xE20B: return "Check For Comma"; case 0xE216: return "Get Parameters For OPEN/CLOSE"; case 0xE261: return "Perform [cos]"; case 0xE268: return "Perform [sin]"; case 0xE2B1: return "Perform [tan]"; case 0xE2DD: return "Table of Trig Constants: 1.570796327=pi/2"; case 0xE2E2: return "Table of Trig Constants: 6.28318531=pi*2"; case 0xE2E7: return "Table of Trig Constants: 0.25"; case 0xE2EC: return "Table of Trig Constants: #05 (counter)"; case 0xE2ED: return "Table of Trig Constants: -14.3813907"; case 0xE2F2: return "Table of Trig Constants: 42.0077971"; case 0xE2F7: return "Table of Trig Constants: -76.7041703"; case 0xE2FC: return "Table of Trig Constants: 81.6052237"; case 0xE301: return "Table of Trig Constants: -41.3417021"; case 0xE306: return "Table of Trig Constants: 6.28318531"; case 0xE30B: return "Perform [atn]"; case 0xE33B: return "Table of ATN Constants: #0b (counter)"; case 0xE3EC: return "Table of ATN Constants: -0.000684793912"; case 0xE341: return "Table of ATN Constants: 0.00485094216"; case 0xE346: return "Table of ATN Constants: -0.161117018"; case 0xE34B: return "Table of ATN Constants: 0.034209638"; case 0xE350: return "Table of ATN Constants: -0.0542791328"; case 0xE355: return "Table of ATN Constants: 0.0724571965"; case 0xE35A: return "Table of ATN Constants: -0.0898023954"; case 0xE35F: return "Table of ATN Constants: 0.110932413"; case 0xE364: return "Table of ATN Constants: -0.142839808"; case 0xE369: return "Table of ATN Constants: 0.19999912"; case 0xE36E: return "Table of ATN Constants: -0.333333316"; case 0xE373: return "Table of ATN Constants: 1.00"; case 0xE378: return "BASIC Cold Start"; case 0xE387: return "CHRGET For Zero-page"; case 0xE39F: return "RND Seed For zero-page 0.811635157"; case 0xE3A4: return "Initialize BASIC RAM"; case 0xE404: return "Output Power-Up Message"; case 0xE429: return "Power-Up Message: ' bytes free'"; case 0xE436: return "Power-Up Message: '**** cbm basic v2 ****'"; case 0xE44F: return "Table of BASIC Vectors (for 0300)"; case 0xE45B: return "Initialize Vectors"; case 0xE467: return "BASIC Warm Restart [RUNSTOP-RESTORE]"; case 0xE47C: return "Unused Bytes For Future Patches"; case 0xE4A0: return "Serial Output 1"; case 0xE4A9: return "Serial Output 0"; case 0xE4B2: return "Get Serial Data And Clock In"; case 0xE4BC: return "Get Secondary Address patch for Serial LOAD/VERIFY"; case 0xE4C1: return "Relocated Load patch for Serial LOAD/VERIFY"; case 0xE4CF: return "Tape Write patch for CLOSE"; case 0xE4DA: return "Unused"; case 0xE500: return "Return I/O Base Address"; case 0xE505: return "Return Screen Organization"; case 0xE50A: return "Read/Set Cursor X/Y Position"; case 0xE518: return "Initialize I/O"; case 0xE55F: return "Clear Screen"; case 0xE581: return "Home Cursor"; case 0xE587: return "Set Screen Pointers"; case 0xE5B5: return "Set I/O Defaults (Unused Entry)"; case 0xE5BB: return "Set I/O Defaults"; case 0xE5CF: return "Get Character From Keyboard Buffer"; case 0xE5E5: return "Input From Keyboard"; case 0xE64F: return "Input From Screen or Keyboard"; case 0xE6B8: return "Quotes Test"; case 0xE6C5: return "Set Up Screen Print"; case 0xEAEA: return "Advance Cursor"; case 0xE719: return "Retreat Cursor"; case 0xE72D: return "Back on to Previous Line"; case 0xE742: return "Output to Screen"; case 0xE756: return "-unshifted characters-"; case 0xE800: return "-shifted characters-"; case 0xE8C3: return "Go to Next Line"; case 0xE8D8: return "Output "; case 0xE8E8: return "Check Line Decrement"; case 0xE8FA: return "Check Line Increment"; case 0xE912: return "Set Colour Code"; case 0xE921: return "Colour Code Table"; case 0xE975: return "Scroll Screen"; case 0xE9EE: return "Open A Space On The Screen"; case 0xEA56: return "Move A Screen Line"; case 0xEA6E: return "Syncronise Colour Transfer"; case 0xEA7E: return "Set Start of Line"; case 0xEA8D: return "Clear Screen Line"; case 0xEAA1: return "Print To Screen"; case 0xEAB2: return "Syncronise Colour Pointer"; case 0xEABF: return "Main IRQ Entry Point"; case 0xEB1E: return "Scan Keyboard"; case 0xEB71: return "Process Key Image"; case 0xEC46: return "Pointers to Keyboard decoding tables"; case 0xEC5E: return "Keyboard Decoding Table - Unshifted"; case 0xEC9F: return "Keyboard Decoding Table - Shifted"; case 0xECE0: return "Keyboard Decoding Table - Commodore"; case 0xED21: return "Graphics/Text Control"; case 0xED69: return "Keyboard Decoding Table"; case 0xEDA3: return "Keyboard Decoding Table - Control"; case 0xEDE4: return "Video Chip Set Up Table"; case 0xEDF4: return "Shift-Run Equivalent"; case 0xEDFD: return "Low Byte Screen Line Addresses"; case 0xEE14: return "Send TALK Command on Serial Bus"; case 0xEE17: return "Send LISTEN Command on Serial Bus"; case 0xEE49: return "Send Data On Serial Bus"; case 0xEEB4: return "Flag Errors: #80 - device not present"; case 0xEEB7: return "Flag Errors: #03 - write timeout"; case 0xEEC0: return "Send LISTEN Secondary Address"; case 0xEEC5: return "Clear ATN"; case 0xEECE: return "Send TALK Secondary Address"; case 0xEED3: return "Wait For Clock"; case 0xEEE4: return "Send Serial Deferred"; case 0xEEF6: return "Send UNTALK on Serial Bus"; case 0xEF04: return "Send UNLISTEN on Serial Bus"; case 0xEF19: return "Receive From Serial Bus"; case 0xEE84: return "Serial Clock On"; case 0xEF8D: return "Serial Clock Off"; case 0xEF96: return "Delay 1 ms"; case 0xEFA3: return "RS-232 Send"; case 0xEFEE: return "Send New RS-232 Byte"; case 0xF016: return "'No DSR' Error"; case 0xF019: return "'No CTS' Error"; case 0xF021: return "Disable Timer"; case 0xF027: return "Compute Bit Count"; case 0xF036: return "RS-232 Receive"; case 0xF05B: return "Set Up To Receive"; case 0xF068: return "Process RS-232 Byte"; case 0xF0BC: return "Submit to RS-232"; case 0xF0ED: return "Send to RS-232 Buffer"; case 0xF116: return "Input From RS-232"; case 0xF14F: return "Get From RS-232"; case 0xF160: return "Serial Bus Idle"; case 0xF174: return "Table of Kernal I/O Messages: ' i/o error #'"; case 0xF1DF: return "Table of Kernal I/O Messages: 'ok'"; case 0xF1E2: return "Print Message if Direct"; case 0xF1E6: return "Print Message"; case 0xF1F5: return "Get a byte"; case 0xF20E: return "Input a byte"; case 0xF250: return "Get From Tape / Serial / RS-232"; case 0xF27A: return "Output One Character"; case 0xF2C7: return "Set Input Device"; case 0xF30E: return "Set Output Device"; case 0xF34A: return "Close File"; case 0xF3CF: return "Find File"; case 0xF3DF: return "Set File values"; case 0xF3EF: return "Abort All Files"; case 0xF3F3: return "Restore Default I/O"; case 0xF40A: return "Open File"; case 0xF495: return "Send Secondary Address"; case 0xF4C7: return "Open RS-232"; case 0xF542: return "Load RAM From Device"; case 0xF549: return "-load-"; case 0xF55C: return "Load File From Serial Bus"; case 0xF5CA: return "Load File From Tape"; case 0xF647: return "Print \"SEARCHING\""; case 0xF659: return "Print Filename"; case 0xF66A: return "Print \"LOADING/VERIFYING\""; case 0xF675: return "Save RAM To Device"; case 0xF685: return "-save-"; case 0xF692: return "Save to Serial Bus"; case 0xF6F1: return "Save to Tape"; case 0xF728: return "Print \"SAVING\""; case 0xF734: return "Increment Real-Time Clock"; case 0xF760: return "Read Real-Time Clock"; case 0xF767: return "Set Real-Time Clock"; case 0xF770: return "Check STOP Key"; case 0xF77E: return "Output I/O Error Messages: 'too many files'"; case 0xF781: return "Output I/O Error Messages: 'file open'"; case 0xF784: return "Output I/O Error Messages: 'file not open'"; case 0xF787: return "Output I/O Error Messages: 'file not found'"; case 0xF78A: return "Output I/O Error Messages: 'device not present'"; case 0xF78D: return "Output I/O Error Messages: 'not input file'"; case 0xF790: return "Output I/O Error Messages: 'not output file'"; case 0xF793: return "Output I/O Error Messages: 'missing filename'"; case 0xF796: return "Output I/O Error Messages: 'illegal device number'"; case 0xF7AF: return "Find Any Tape Header"; case 0xF7E7: return "Write Tape Header"; case 0xF84D: return "Get Buffer Address"; case 0xF854: return "Set Buffer Stat/End Pointers"; case 0xF867: return "Find Specific Tape Header"; case 0xF88A: return "Bump Tape Pointer"; case 0xF894: return "Print \"PRESS PLAY ON TAPE\""; case 0xF8AB: return "Check Tape Status"; case 0xF8B7: return "Print \"PRESS RECORD...\""; case 0xF8C0: return "Initiate Tape Read"; case 0xF8E3: return "Initiate Tape Write"; case 0xF8F4: return "Common Tape Code"; case 0xF94B: return "Check Tape Stop"; case 0xF95D: return "Set Read Timing"; case 0xF98E: return "Read Tape Bits"; case 0xFAAD: return "Store Tape Characters"; case 0xFBB2: return "Reset Tape Pointer"; case 0xFBDB: return "New Character Setup"; case 0xFBEA: return "Send Tone to Tape"; case 0xFC06: return "Write Data to Tape"; case 0xFC95: return "Write Tape Leader"; case 0xFCCF: return "Restore Normal IRQ"; case 0xFCF6: return "Set IRQ Vector"; case 0xFD08: return "Kill Tape Motor"; case 0xFD11: return "Check Read / Write Pointer"; case 0xFD1B: return "Bump Read / Write Pointer"; case 0xFD22: return "Power-Up RESET Entry"; case 0xFD3F: return "Check For A-ROM"; case 0xFD4D: return "ROM Mask 'a0CBM'"; case 0xFD52: return "Restore Kernal Vectors (at 0314)"; case 0xFD57: return "Change Vectors For User"; case 0xFD6D: case 0xFD6E: return "Kernal Reset Vectors "; case 0xFD8D: return "Initialise System Constants"; case 0xFDF1: case 0xFDF2: return "IRQ Vectors For Tape I/O"; case 0xFDF9: return "Initialise I/O"; case 0xFE39: return "Enable Timer"; case 0xFE49: return "Set Filename"; case 0xFE50: return "Set Logical File Parameters"; case 0xFE57: return "Get I/O Status Word"; case 0xFE66: return "Control OS Messages"; case 0xFE6F: return "Set IEEE Timeout"; case 0xFE73: return "Set / Read Top of Memory"; case 0xFE82: return "Set / Read Bottom of Memory"; case 0xFEA9: return "NMI Transfer Entry"; case 0xFED2: return "Warm Start Basic [BRK]"; case 0xFF56: return "Exit Interrupt"; case 0xFF5B: return "RS-232 Timing Table"; case 0xFF72: return "IRQ Transfer Entry"; case 0xFF8A: return "Kernel Jump Table: Restore Vectors"; case 0xFF8D: return "Kernel Jump Table: Change Vectors For User"; case 0xFF90: return "Kernel Jump Table: Control OS Messages"; case 0xFF93: return "Kernel Jump Table: Send SA After Listen"; case 0xFF96: return "Kernel Jump Table: Send SA After Talk"; case 0xFF99: return "Kernel Jump Table: Set/Read System RAM Top"; case 0xFF9C: return "Kernel Jump Table: Set/Read System RAM Bottom"; case 0xFF9F: return "Kernel Jump Table: Scan Keyboard"; case 0xFFA2: return "Kernel Jump Table: Set Timeout In IEEE"; case 0xFFA5: return "Kernel Jump Table: Handshake Serial Byte In"; case 0xFFA8: return "Kernel Jump Table: Handshake Serial Byte Out"; case 0xFFAB: return "Kernel Jump Table: Command Serial Bus UNTALK"; case 0xFFAE: return "Kernel Jump Table: Command Serial Bus UNLISTEN"; case 0xFFB1: return "Kernel Jump Table: Command Serial Bus LISTEN"; case 0xFFB4: return "Kernel Jump Table: Command Serial Bus TALK"; case 0xFFB7: return "Kernel Jump Table: Read I/O Status Word"; case 0xFFBA: return "Kernel Jump Table: Set Logical File Parameters"; case 0xFFBD: return "Kernel Jump Table: Set Filename"; case 0xFFC0: return "Kernel Jump Table: Open Vector [F40A]"; case 0xFFC3: return "Kernel Jump Table: Close Vector [F34A]"; case 0xFFC6: return "Kernel Jump Table: Set Input [F2C7]"; case 0xFFC9: return "Kernel Jump Table: Set Output [F309]"; case 0xFFCC: return "Kernel Jump Table: Restore I/O Vector [F353]"; case 0xFFCF: return "Kernel Jump Table: Input Vector, chrin [F20E]"; case 0xFFD2: return "Kernel Jump Table: Output Vector, chrout [F27A]"; case 0xFFD5: return "Kernel Jump Table: Load RAM From Device"; case 0xFFD8: return "Kernel Jump Table: Save RAM To Device"; case 0xFFDB: return "Kernel Jump Table: Set Real-Time Clock"; case 0xFFDE: return "Kernel Jump Table: Read Real-Time Clock"; case 0xFFE1: return "Kernel Jump Table: Test-Stop Vector [F770]"; case 0xFFE4: return "Kernel Jump Table: Get From Keyboad [F1F5]"; case 0xFFE7: return "Kernel Jump Table: Close All Channels And Files [F3EF]"; case 0xFFEA: return "Kernel Jump Table: Increment Real-Time Clock"; case 0xFFED: return "Kernel Jump Table: Return Screen Organization"; case 0xFFF0: return "Kernel Jump Table: Read / Set Cursor X/Y Position"; case 0xFFF3: return "Kernel Jump Table: Return I/O Base Address"; case 0xFFFA: return "NMI"; case 0xFFFC: return "RESET"; case 0xFFFE: return "IRQ"; default: if ((addr>=0x73) && (addr<=0x8A)) return "CHRGET subroutine (get BASIC char)"; if ((addr>=0xD9) && (addr<=0xF0)) return "Screen line link table"; if ((addr>=0x100) && (addr<=0x10A)) return "Floating to ASCII work area"; if ((addr>=0x10B) && (addr<=0x013E)) return "Tape error log"; if ((addr>=0x100) && (addr<=0x1FF)) return "Processor stack area"; if ((addr>=0x200) && (addr<=0x258)) return "Basic input buffer"; if ((addr>=0x259) && (addr<=0x262)) return "Logical file table"; if ((addr>=0x263) && (addr<=0x26C)) return "Device # table"; if ((addr>=0x26D) && (addr<=0x276)) return "Secondary Address table"; if ((addr>=0x277) && (addr<=0x280)) return "Keyboard buffer"; if ((addr>=0x2A1) && (addr<=0x2FF)) return "Program indirects"; if ((addr>=0x33C) && (addr<=0x03FB)) return "Cassette buffer"; if ((addr>=0x400) && (addr<=0x0FFF)) return "3K expansion RAM area"; if ((addr>=0x1000) && (addr<=0x11FF)) return "User Basic area/Screen memory"; if ((addr>=0x1200) && (addr<=0x1DFF)) return "User Basic area"; if ((addr>=0x1E00) && (addr<=0x1FFF)) return "Screen memory"; if ((addr>=0x2000) && (addr<=0x3FFF)) return "8K expansion RAM/ROM block 1"; if ((addr>=0x4000) && (addr<=0x5FFF)) return "8K expansion RAM/ROM block 2"; if ((addr>=0x6000) && (addr<=0x7FFF)) return "8K expansion RAM/ROM block 3"; if ((addr>=0x8000) && (addr<=0x83FF)) return "4K Character generator ROM/Upper case and graphics"; if ((addr>=0x8400) && (addr<=0x87FF)) return "4K Character generator ROM/Reversed upper case and graphics"; if ((addr>=0x8800) && (addr<=0x8BFF)) return "4K Character generator ROM/Upper and lower case"; if ((addr>=0x8C00) && (addr<=0x8FFF)) return "4K Character generator ROM/Reversed upper and lower case"; if ((addr>=0x9400) && (addr<=0x95FF)) return "location of COLOR RAM with additional RAM at blk 1"; if ((addr>=0x9600) && (addr<=0x97FF)) return "Normal location of COLOR RAM"; if ((addr>=0x9800) && (addr<=0x9BFF)) return "I/O block 2"; if ((addr>=0x9C00) && (addr<=0x9FFF)) return "I/O block 3"; if ((addr>=0xA000) && (addr<=0xBFFF)) return "8K decoded block for expansion ROM"; } } } return super.dcom(iType, aType, addr, value); } }
105,374
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
C1541Dasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/machine/C1541Dasm.java
/** * @(#)C1541Dasm.java 2020/10/05 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.machine; import sw_emulator.software.cpu.M6510Dasm; /** * Comment the memory location of a 1541 drive for the disassembler * It performs also a multy language comments. * * @author Ice * @version 1.00 05/10/2020 */ public class C1541Dasm extends M6510Dasm { // Available language public static final byte LANG_ENGLISH=1; public static final byte LANG_ITALIAN=2; /** * Return a comment string for the passed instruction * * @param iType the type of instruction * @param aType the type of addressing used by the instruction * @param addr the address value (if needed by this istruction type) * @param value the operation value (if needed by this instruction) * @return a comment string */ @Override public String dcom(int iType, int aType, long addr, long value) { byte language=option.commentLanguage; switch (aType) { case A_ZPG: case A_ZPX: case A_ZPY: case A_ABS: case A_ABX: case A_ABY: case A_REL: case A_IND: case A_IDX: case A_IDY: // do not get comment if appropriate option is not selected if ((int)addr<=0xFF && !option.commentC1541ZeroPage) return ""; if ((int)addr>=0x100 && (int)addr<=0x1FF && !option.commentC1541StackArea) return ""; if ((int)addr>=0x200 && (int)addr<=0x2FF && !option.commentC1541_200Area) return ""; if ((int)addr>=0x300 && (int)addr<=0x3FF && !option.commentC1541Buffer0) return ""; if ((int)addr>=0x400 && (int)addr<=0x7FF && !option.commentC1541Buffer1) return ""; if ((int)addr>=0x500 && (int)addr<=0x5FF && !option.commentC1541Buffer2) return ""; if ((int)addr>=0x600 && (int)addr<=0x6FF && !option.commentC1541Buffer3) return ""; if ((int)addr>=0x700 && (int)addr<=0x7FF && !option.commentC1541Buffer4) return ""; if ((int)addr>=0x1800 && (int)addr<=0x180F && !option.commentC1541Via1) return ""; if ((int)addr>=0x1C00 && (int)addr<=0x1C0F && !option.commentC1541Via2) return ""; if ((int)addr>=0xC000 && (int)addr<=0xCFFF && !option.commentC1541Kernal) return ""; switch (language) { case LANG_ITALIAN: switch ((int)addr) { case 0x00: return "Buffer #0 registro di stato e comando"; case 0x01: return "Buffer #1 registro di stato e comando"; case 0x02: return "Buffer #2 registro di stato e comando"; case 0x03: return "Buffer #3 registro di stato e comando"; case 0x04: return "Buffer #4 registro di stato e comando"; case 0x05: return "Non usato (Registro di stato e commando del non esistente buffer #5)"; case 0x06: case 0x07: return "Buffer #0 registro di traccia e settore"; case 0x08: case 0x09: return "Buffer #1 registro di traccia e settore"; case 0x0A: case 0x0B: return "Buffer #2 registro di traccia e settore"; case 0x0C: case 0x0D: return "Buffer #3 registro di traccia e settore"; case 0x0E: case 0x0F: return "Buffer #4 registro di traccia e settore"; case 0x10: case 0x11: return "Non usato (Registro di traccia e settore del non esistente buffer #5"; case 0x12: case 0x13: return "Unità #0 settore ID intestazione atteso"; case 0x14: case 0x15: return "Non usato (Settore ID intestazione atteso della non esistente unità #1)"; case 0x16: case 0x17: return "ID intestazione dall'ultimo settore letto da disco"; case 0x18: case 0x19: return "Numero di traccia e settore dall'intestazione dell'ultimo settore letto da disco"; case 0x1A: return "Checksum dalla intestazione dell'ultimo settore letto da disco"; case 0x1B: return "Non usato"; case 0x1C: return "Unità #0 indicatore cambio disco"; case 0x1D: return "Non usato (Indicatore cambio disco della non esistente unità #1)"; case 0x1E: return "Stato precedente della fotocellula protezione scritttura dell'unità #0 (nel bit #4)"; case 0x1F: return "Non usato (Stato precedente della fotocellula protezione scritttura della cellula non esistente dell'unità #1)"; case 0x20: return "Unità #0 registro comandi interno del controller del disco"; case 0x21: return "Non usato (registro comandi interno del controller del disco della non esistente unità #1)"; case 0x22: return "Unità #0 numero corrente di traccia"; case 0x23: return "Commutatore velocità di comunicazione bus seriale"; case 0x24: case 0x25: case 0x26: case 0x27: case 0x28: case 0x29: case 0x2A: case 0x2B: return "Intestazione dell'ultima o successiva lettura del settore da scrivere su disco, nel formato codificato GCR"; case 0x2C: return "Non usato"; case 0x2D: return "Non usato"; case 0x2E: case 0x2F: return "Puntatore al byte corrente nel buffer durante codifica/decodifica GCR"; case 0x30: case 0x31: return "Puntatore all'inizio del buffer corrente"; case 0x32: case 0x33: return "Puntatore ai registri di settore e traccia del buffer corrente"; case 0x34: return "Contatore GCR-byte durante codifica/decodifica GRC"; case 0x35: return "Non usato"; case 0x36: return "Contatore byte durante codifica/decodifica GCR"; case 0x37: return "Non usato"; case 0x38: return "Byte della firma del blocco dati dell'ultima lettura del settore dal disco"; case 0x39: return "Valore atteso per la firma del blocco. Default: $08"; case 0x3A: return "Somma di controllo calcolata dei dati nel buffer"; case 0x3B: return "Non usato"; case 0x3C: return "Non usato"; case 0x3D: return "Numero di unità corrente del controller del disco"; case 0x3E: return "Numero di unità precedente del controller del disco. Valori"; case 0x3F: return "Numero di buffer corrente del controller del disco"; case 0x40: return "Numero di traccia corrente"; case 0x41: return "Numero di buffer da cercare"; case 0x42: return "Numero di tracce da spostare durante la ricerca"; case 0x43: return "Numero di settori sulla traccia corrente"; case 0x44: return "Densita dati (nei bits #5-#6). Registro temporaneo per comandi nel buffer"; case 0x45: return "Registro dei comandi del buffer del controller del disco"; case 0x46: return "Non usato"; case 0x47: return "Valore atteso del byte della firma dell'intestazione del blocco dati. Default: $07"; case 0x48: return "Contatore del ritardo rotazione su/giù del motore"; case 0x49: return "Valore originale del puntatore allo stack prima dell'esecuzione dell'interrupt del controller del disco"; case 0x4A: return "Numero di mezze traccie da spostare durante la ricerca"; case 0x4B: return "Riprova il contatore per la lettura dell'intestazione del settore. Area temporanea durante la ricerca"; case 0x4C: return "Sulla traccia corrente, la distanza del settore, che corrisponde al settore di un buffer ed è più vicina all'ultima letta dal disco"; case 0x4D: return "Sulla traccia corrente, il settore che si trova a due settori di distanza dall'ultimo letto dal disco"; case 0x4E: case 0x4F: return "Puntatore all'inizio del buffer ausiliario durante la codifica GCR (byte scambiati)"; case 0x50: return "Indicatore dei dati del buffer attualmente presenti in forma codificata GCR"; case 0x51: return "Numero traccia corrente durante la formattazione"; case 0x52: case 0x53: case 0x54: case 0x55: return "Area temporanea per byte dati durante la codifica/decodifica GRC"; case 0x56: case 0x57: case 0x58: case 0x59: case 0x5A: case 0x5B: case 0x5C: case 0x5D: return "Area temporanea per nybbles e byte GCR durante la codifica/decosifica GCR"; case 0x5E: return "Numero di mezze traccie per accelerare/decelerare durante la ricerca accelerata"; case 0x5F: return "Fattore di accellerazione/decelerazione durante la ricerca acellerata"; case 0x60: return "Contatore del ritardo dopo la ricerca (in modo che la testa smetta di vibrare), contatore a metà traccia per l'accelerazione/decelerazione durante la ricerca accelerata"; case 0x61: return "Contatore metà traccia per la massima velocità durante la ricerca accelerata"; case 0x62: case 0x63: return "Puntatore alla routine successiva da eseguire durante la ricerca"; case 0x64: return "Limite di distanza inferiore della ricerca accelerata, in mezze traccie. Default: $C8"; case 0x65: case 0x66: return "Rutine puntatore per partenza a freddo (comando \"UI\"). Default: $EB22."; case 0x67: return "Sconosciuto"; case 0x68: return "Interruttore di inizializzazione automatica del disco. Default $00"; case 0x69: return "Soft interleave (distanza, in settori, per allocare il settore successivo per i file). Default: $0A"; case 0x6A: return "Numero di tentativi sui comandi del disco. Default: $05"; case 0x6B: case 0x6C: return "Puntatore alla tabella comandi per \"Ux\". Default: $FFEA"; case 0x6D: case 0x6E: return "Puntatore temporaneo per operazioni BAM"; case 0x6F: case 0x70: return "Puntatore temporaneo per varie operazioni"; case 0x71: case 0x72: case 0x73: case 0x74: return "Sconosciuto"; case 0x75: case 0x76: return "Puntatore al byte corrente durante il test della memoria all'avvio. Indirizzo di esecuzione del comando corrente Ux"; case 0x77: return "Indicatore comando da accettaer LISTEN nel bus seriale (Numero dispositivo o $20)"; case 0x78: return "Indicatore comando da accettare TALK nel bus seriale (Numero dispositivo o $40)"; case 0x79: return "Indicatore comando LISTEN nel bus seriale"; case 0x7A: return "Indicatore comando TALK nel bus seriale"; case 0x7B: return "Sconosciuto"; case 0x7C: return "Indicatore arrivo ATN nel bus seriale"; case 0x7D: return "Indicatore comando End"; case 0x7E: return "Numero traccia del precedente file aperto (Usato quando di apre \"*\")"; case 0x7F: return "Unità corrente. Default: $00"; case 0x80: case 0x81: return "Traccia e numero settori per varie operazioni"; case 0x82: return "Numero canale corrente"; case 0x83: return "Indirizzo secondario corrente (solo bit #0-#3)"; case 0x84: return "Indirizzo secondario corrente"; case 0x85: return "Byte letti dal serial bus. Dati letti dal buffer o scritti nel buffer"; case 0x86: case 0x87: return "Puntatore al byte corrente nel buffer della directory"; case 0x88: case 0x89: return "Puntatore al byte e indirizzo esecuzione del comando utente \"&\""; case 0x8A: return "Sconosciuto"; case 0x8B: case 0x8C: case 0x8D: return "Area temporane per la divisione intera. (Utilizzato per calcolare il settore laterale dei file relativi)"; case 0x8E: case 0x8F: case 0x90: case 0x91: case 0x92: case 0x93: return "Sconosciuto"; case 0x94: case 0x95: return "Puntatore alla voce della rubrica corrente"; case 0x96: case 0x97: return "Non usato"; case 0x98: return "Contatore di bit durante l'ingresso/uscita del bus seriale"; case 0x99: case 0x9A: return "Puntatore al buffer #0. Default: $0300"; case 0x9B: case 0x9C: return "Puntatore al buffer #1. Default: $0400"; case 0x9D: case 0x9E: return "Puntatore al buffer #2. Default: $0500"; case 0x9F: case 0xA0: return "Puntatore al buffer #3. Default: $0600"; case 0xA1: case 0xA2: return "Puntatore al buffer #4. Default: $0700"; case 0xA3: case 0xA4: return "Puntatore al buffer di input. Default: $0200"; case 0xA5: case 0xA6: return "Puntatore al buffer di messaggio di errore. Default: $02D5"; case 0xA7: case 0xA8: case 0xA9: case 0xAA: case 0xAB: case 0xAC: case 0xAD: return "Numero di buffer primario assegnato ai canali"; case 0xAE: case 0xAF: case 0xB0: case 0xB1: case 0xB2: case 0xB3: case 0xB4: return "Numero di buffer secondario assegnato ai canali"; case 0xB5: case 0xB6: case 0xB7: case 0xB8: case 0xB9: case 0xBA: return "Lunghezza del file assegnato al canale, low byte. Per file relativi, numero di records, low byte"; case 0xBB: case 0xBC: case 0xBD: case 0xBE: case 0xBF: case 0xC0: return "Lunghezza del file assegnato al canale, high byte. Per file relativi, numero di records, high byte"; case 0xC1: case 0xC2: case 0xC3: case 0xC4: case 0xC5: case 0xC6: return "Offset del byte corrente nel buffer assegnato ai canali"; case 0xC7: case 0xC8: case 0xC9: case 0xCA: case 0xCB: case 0xCC: return "lunghezza disco del file relativo assegnato ai canali"; case 0xCD: case 0xCE: case 0xCF: case 0xD0: case 0xD1: case 0xD2: return "Numero di buffer contenente il settore laterale del file relativo assegnato ai canali"; case 0xD3: return "Contatore virgola durante il recupero dei numeri di unità dal comando"; case 0xD4: return "Offset del byte corrente nel record del file relativo"; case 0xD5: return "Numero del settore laterale appartenente al record del file relativo corrente"; case 0xD6: return "Offset del numero di traccia e del settore del record di file relativo corrente nel settore laterale"; case 0xD7: return "Offset del record nel settore dei dati del file relativo"; case 0xD8: case 0xD9: case 0xDA: case 0xDB: case 0xDC: return "Numero di settore della voce di directory dei file"; case 0xDD: case 0xDE: case 0xDF: case 0xE0: case 0xE1: return "Offset della voce della directory del file"; case 0xE2: case 0xE3: case 0xE4: case 0xE5: case 0xE6: return "Numero di unità di file"; case 0xE7: case 0xE8: case 0xE9: case 0xEA: case 0xEB: return "Tipo di file e contrassegni dei file"; case 0xEC: case 0xED: case 0xEE: case 0xEF: case 0xF0: case 0xF1: return "Numero di unità, tipo di file e flag dei file assegnati ai canali"; case 0xF2: case 0xF3: case 0xF4: case 0xF5: case 0xF6: case 0xF7: return "Flag Input/output dei canali"; case 0xF8: return "Indicatore fine file del canale corrente"; case 0xF9: return "Numero buffer corrente"; case 0xFA: case 0xFB: case 0xFE: return "Sconosciuto"; case 0xFF: return "Unità #0 indicatore errore input/output BAM"; case 0x100: return "Indicatore errore input/output BAM della non esistente unità #1"; case 0x101: return "Unità #0 codice versione BAM (Byte al offset #$02 nel sector 18;00) Atteso: $41,A"; case 0x102: return "Codice versione BAM della non esistente unità #1"; case 0x22A: return "Numero comando DOS"; case 0x23E: case 0x23F: case 0x240: case 0x241: case 0x242: return "Area temporanea per il prossimo byte che deve essere scritto nei buffer #0-#4 del serial bus"; case 0x243: return "Area temporanea per il prossimo byte che deve essere scritto dal buffer messaggi errore al serial bus"; case 0x244: case 0x245: case 0x246: case 0x247: case 0x248: return "Offset dell'ultimo byte di dati nei buffer #0-#4"; case 0x249: return "Offset dell'ultimo byte di dati nel buffer dei messaggi di errore"; case 0x24A: return "Tipo di file del file corrente"; case 0x24B: return "Lunghezza del nome del file corrente"; case 0x24C: return "Area temporanea per indirizzo secondario"; case 0x24D: return "Area temporanea per il comando del controller del disco"; case 0x24E: return "Numero di settori sulla traccia corrente"; case 0x24F: case 0x250: return "Registro di allocazione del buffer. Default: $FFE0"; case 0x251: return "Unità #0 indicatore di cambio BAM"; case 0x252: return "Indicatore di cambio BAM della unità non esistente unit #1"; case 0x253: return "Indicatore di file trovato durante la ricerca di un nome file nella directory"; case 0x254: return "Indicatore di directory dei canali LOAD"; case 0x255: return "Indicatore di fine comando"; case 0x256: return "Registro di assegnazione dei canali"; case 0x257: return "Area temporanea per numero di canale"; case 0x258: return "Registra la lunghezza del file relativo corrente"; case 0x259: case 0x25A: return "Traccia e numero di settore del primo settore laterale del file relativo corrente"; case 0x25B: case 0x25C: case 0x25D: case 0x25E: case 0x25F: return "Comandi originali del controller del disco dei buffer #0-#4"; case 0x260: case 0x261: case 0x262: case 0x263: case 0x264: case 0x265: return "Numero di settore della voce di directory dei file specificati nel comando"; case 0x266: case 0x267: case 0x268: case 0x269: case 0x26A: case 0x26B: return "Offset della voce di directory dei file specificati nel comando"; case 0x26C: return "Interruttore per la visualizzazione dei messaggi di avviso dei file relativi"; case 0x26D: return "Unità #0 bit LED"; case 0x26E: return "Numero di unità del file aperto in precedenza (utilizzato durante l'apertura \"*\")"; case 0x26F: return "Numero di settore del file aperto in precedenza (utilizzato durante l'apertura \"*\")"; case 0x270: return "Area temporanea per numero di canale"; case 0x271: return "Non usato"; case 0x272: case 0x273: return "Numero di riga BASIC per le voci inviate all'host durante il caricamento di \"$\""; case 0x274: return "Lunghezza del comando"; case 0x275: return "Primo carattere di comando. Carattere da cercare nel buffer di input"; case 0x276: return "Offset del primo carattere dopo il nome del file nel comando"; case 0x277: return "Area temporanea per numero di virgole in comando"; case 0x278: return "Numero di virgole o numeri di unità in comando"; case 0x279: return "Numero di virgole prima del segno di equazione nel comando. Numero del file corrente nel comando durante la ricerca dei file specificati nel comando"; case 0x27A: return "Scostamento del carattere prima dei due punti in comando"; case 0x27B: case 0x27C: case 0x27D: case 0x27E: case 0x27F: return "Offset dei nomi di file nel comando"; case 0x280: case 0x281: case 0x282: case 0x283: case 0x284: return "Traccia il numero di file specificato nel comando"; case 0x285: case 0x286: case 0x287: case 0x288: case 0x289: return "Numero di settore di file specificato nel comando. Per i comandi B-x, byte inferiore dei parametri"; case 0x28A: return "Numero di caratteri jolly trovati nel nome file corrente"; case 0x28B: return "Flag di sintassi dei comandi"; case 0x28C: return "Numero di unità da elaborare durante la lettura della directory"; case 0x28D: return "Numero di unità corrente durante la lettura della directory"; case 0x28E: return "Numero di unità precedente durante la lettura della directory"; case 0x28F: return "Indicatore per continuare a cercare nella directory"; case 0x290: return "Numero di settore della directory corrente"; case 0x291: return "Numero di settore della directory da leggere"; case 0x292: return "Offset della voce della directory corrente nel settore della directory"; case 0x293: return "Indicatore di fine directory"; case 0x294: return "Offset della voce della directory corrente nel settore della directory"; case 0x295: return "Numero di voci di directory rimanenti nel settore della directory meno 1"; case 0x296: return "Tipo di file del file cercato nella directory"; case 0x297: return "Modalità di apertura dei file"; case 0x298: return "Interruttore di visualizzazione dei messaggi per gli errori del disco"; case 0x299: return "Offset del byte corrente nella tabella di ricerca halftrack durante il tentativo di ripetere le operazioni del disco su mezze traccie adiacenti"; case 0x29A: return "Direzione di ricerca del semitraccia originale durante il tentativo di eseguire nuovamente le operazioni del disco su mezze traccie adiacenti"; case 0x29B: return "Unit #0 numero di traccia della voce BAM corrente"; case 0x29C: return "Numero di traccia della voce BAM corrente della unità non esistente #1"; case 0x29D: case 0x29E: return "Unit #0 numeri traccia di due voci BAM memorizzate nella cache"; case 0x29F: case 0x2A0: return "Numeri traccia di due voci BAM memorizzate nella cache della unità non esistente #1"; case 0x2A1: case 0x2A2: case 0x2A3: case 0x2A4: case 0x2A5: case 0x2A6: case 0x2A7: case 0x2A8: return "Unità #0 due voci BAM memorizzate nella cache"; case 0x2A9: case 0x2AA: case 0x2AB: case 0x2AC: case 0x2AD: case 0x2AE: case 0x2AF: case 0x2B0: return "Due voci BAM memorizzate nella cache della unità non esistente #1"; case 0x2F9: return "Aggiornamento del disco al cambio di BAM. Diverse operazioni relative a BAM prevedono valori diversi qui"; case 0x2FA: return "Unità #0 numero di blocchi liberi, byte basso"; case 0x2FB: return "Numero di blocchi liberi, byte basso, della unità non esistente #1"; case 0x2FC: return "Unità #0 numero di blocchi liberi, byte alto"; case 0x2FD: return "Numero di blocchi liberi, byte alto, della unità non esistente #1"; case 0x2FE: return "Unità #0 Direzione di ricerca mezze traccie adiacente"; case 0x2FF: return "Direzione di ricerca mezze traccie adiacente di unità non esistente #1"; case 0x1800: return "Via #1: Port B #1 bus seriale"; case 0x1801: return "Via #1: Port A #1 leggere per riconoscere l'interrupt generato da ATN IN che diventa alto"; case 0x1802: return "Via #1: Port B #1 registro direzioni dati. Default: $1A, %00011010"; case 0x1803: return "Via #1: Port A #1 registro direzioni dati. Default: $FF, %11111111."; case 0x1804: case 0x1805: return "Via #1: Timer #1 byte basso lettura o byte alto scrittura per avviare il timer o riavviare il timer in caso di underflow"; case 0x1806: case 0x1807: return "Via #1: Timer latch #1. Valore iniziale lettura/scrittura del timer da/a qui"; case 0x1808: case 0x1809: case 0x180A: return "Via #1: Non usato"; case 0x180B: return "Via #1: Registro controllo timer #1"; case 0x180C: return "Via #1: Non usato"; case 0x180D: return "Via #1: Registro stato interruzione #1"; case 0x180E: return "Via #1: Registro controllo interruzione #1"; case 0x180F: return "Via #1: Non usato"; case 0x1C00: return "Via #2: Port B #2"; case 0x1C01: return "Via #2: Port A #2 ultimo byte di dati letto da o da scrivere successivamente su disco"; case 0x1C02: return "Via #2: Port B #2 registro direzione dati"; case 0x1C03: return "Via #2: Port A #2 registro direzioni dati"; case 0x1C04: case 0x1C05: return "Via #2: Timer #2. Byte basso lettura o byte alto scrittura per avviare il timer o riavviare il timer in caso di underflow"; case 0x1C06: case 0x1C07: return "Via #2: Timer latch #2. Valore iniziale lettura/scrittura del timer da/a qui"; case 0x1C08: case 0x1C09: case 0x1C0A: return "Via #2: Non usato"; case 0x1C0B: return "Via #2: Registro controllo timer #2"; case 0x1C0C: return "Via #2: Registro controllo ausiliario #2"; case 0x1C0D: return "Via #2: Registro stato interruzione #2"; case 0x1C0E: return "Via #2: Registro controllo interruzione #2"; case 0x1C0F: return "Via #2: Non usato"; case 0xC100: return "Accende il LED per il drive corrente"; case 0xC118: return "Accende il LED"; case 0xC123: return "Pulisce stati di errore"; case 0xC12C: return "Prepara per il lampeggio del LED dopo un errore"; case 0xC146: return "Interpreta un comando dal computer"; case 0xC194: return "Prepara un messaggio di errore dopo l'esecuzione di un comando"; case 0xC1BD: return "Cancella il buffer di ingresso"; case 0xC1C8: return "Messaggio di errore in uscita (traccia e settore 0)"; case 0xC1D1: return "Verifica la linea di ingresso"; case 0xC1E5: return "Verifica ':' sulla linea di ingresso"; case 0xC1EE: return "Verifica linea di ingresso"; case 0xC268: return "Cerca un carattere nel buffer in ingresso"; case 0xC2B3: return "Verifica lunghezza linea"; case 0xC2DC: return "Pulisce gli stati per comando in ingresso"; case 0xC312: return "Preserva il numero dispositivo"; case 0xC33C: return "Ricerca per il numero dispositivo"; case 0xC368: return "Ottiene il numero dispositivo"; case 0xC38F: return "Inverti il numero dispositivo"; case 0xC398: return "Verifica il tipo file dato"; case 0xC3BD: return "Verifica il numero dispositivo dato"; case 0xC3CA: return "Verifica il numero dispositivo"; case 0xC440: return "Impostazioni per verifica dispositivo"; case 0xC44f: return "Ricerca per file nella directory"; case 0xC63D: return "Testa e inizializza il dispositivo"; case 0xC66E: return "Nome del file nel buffer directory"; case 0xC688: return "Copia il nome file nel buffer di lavoro"; case 0xC6A6: return "Cerca la fine del nome nel comando"; case 0xC7AC: return "Pulisce il buffer di uscita della directory"; case 0xC7B7: return "Crea intestazione con nome del file"; case 0xC806: return "Stampa 'blocks free.'"; case 0xC817: return "'Blocks free.'"; case 0xC823: return "Esegue [S] - Scratch command"; case 0xC87D: return "Cancella file"; case 0xC8B6: return "Cancella entrata directory"; case 0xC8C1: return "Esegue [D] - Backup command (Non usato)"; case 0xC8C6: return "Fomatta il disco"; case 0xC8F0: return "Esegua [C] - Copy command"; case 0xCA88: return "Esegue [R] - Rename command"; case 0xCACC: return "Verifica se il file è presente"; case 0xCAF8: return "Esegue [M] - Memory command"; case 0xCB20: return "M-R memoria letta"; case 0xCB50: return "M-W memoria scritta"; case 0xCB5C: return "Esegue [U] - User command"; case 0xCB84: return "Apre canale di accesso diretto, numero"; case 0xCC1B: return "Esegue [B] - Block/Buffer command"; case 0xCC5D: return "Comando di blocco \"AFRWEP\""; case 0xCC63: return "Vettore comando di blocco"; case 0xCC6F: return "Ottieni parametri dal comando di blocco"; case 0xCCF2: return "Valori decimali 1, 10, 100"; case 0xCCF5: return "B-F blocchi liberi"; case 0xCD03: return "B-A allocazione blocco"; case 0xCD36: return "Legge il blocco nel buffer"; case 0xCD3c: return "Ottiene il byte dal buffer"; case 0xCD42: return "Legge il blocco da disco"; case 0xCD56: return "B-R blocco letto"; case 0xCD5F: return "U1, blocco letto senza cambiare puntatore al buffer"; case 0xCD73: return "B-W blocco scritto"; case 0xCD97: return "U2, blocco scritto senza cambiare puntatore al buffer"; case 0xCDA3: return "B-E blocco eseguito"; case 0xCDBD: return "B-P puntatore blocco"; case 0xCDD2: return "Canale aperto"; case 0xCDF2: return "Verifica il numero buffer e il canale aperto"; case 0xCE0E: return "Setta il puntatore per file REL"; case 0xCE6E: return "Divide per 254"; case 0xCE71: return "Divide per 120"; case 0xCED9: return "Cancella spazio di archiviazione"; case 0xCEE2: return "Scorre a sinistra registro di 3-byte due volte"; case 0xCEE5: return "Scorre a sinistra registro di 3-byte una volta"; case 0xCEED: return "Somma registri di 3-byte"; case 0xCF8C: return "Cambio buffer"; case 0xCF9B: return "Scrive i dati nel buffer"; case 0xCFF1: return "Scrive il dato nel buffer"; case 0xD005: return "Esegue [I] - Initalise command"; case 0xD00e: return "Legge BAM da disco"; case 0xD042: return "Legge BAM"; case 0xD075: return "Calcola i blocchi liberi"; case 0xD0C3: return "Legge i blocchi"; case 0xD0C7: return "Scrive i blocchi"; case 0xD0EB: return "Apre i canali per leggere"; case 0xD107: return "Apre i canali per scrivere"; case 0xD125: return "Verifica per tipo file REL"; case 0xD12f: return "Ottiene numeri canale e buffer"; case 0xD137: return "Ottiene un bute dal buffer"; case 0xD156: return "Ottiene un byte e legge il prossimo blocco"; case 0xD19D: return "Scrive byte nel buffer e blocco"; case 0xD1C6: return "Incrementa il puntatore nel buffer"; case 0xD1D3: return "Ottiene in numero dispositivo"; case 0xD1DF: return "Cerca il canale e buffer di scrittura"; case 0xD1E2: return "Cerca il canale e buffer di scrittura"; case 0xD227: return "Chiude il canale"; case 0xD25A: return "Buffer libero"; case 0xD28E: return "Cerca buffer"; case 0xD307: return "Chiude tutti i canali"; case 0xD313: return "Chiude tutti i canali e gli altri dispositivi"; case 0xD37F: return "Cerca canale e alloca"; case 0xD39B: return "Ottiene il byte per uscita"; case 0xD44D: return "Legge prossimo blocco"; case 0xD460: return "Legge blocco"; case 0xD464: return "Scrive blocco"; case 0xD475: return "Alloca il budffee e legge il blocco"; case 0xD486: return "Alloca un nuovo blocco"; case 0xD48D: return "Scrive un blocco directory"; case 0xD4C8: return "Setta il puntatore al buffer"; case 0xD4DA: return "Chiude il canale interno"; case 0xD4E8: return "Setta il puntatore al buffer"; case 0xD4F6: return "Ottiene un byte dal buffer"; case 0xD506: return "Verifica numeri traccia e settore"; case 0xD552: return "Ottiene traccia e settori per il lavoro corrente"; case 0xD55F: return "Verifica per validi numeri settore e traccia"; case 0xD572: return "Errore DOS mismatch"; case 0xD586: return "Legge blocco"; case 0xD58A: return "Scrive blocco"; case 0xD599: return "Verifica esecuzione"; case 0xD5C6: return "Altri tentativi aggiuntivi per lettura con errori"; case 0xD676: return "Muove la testa di mezza traccia"; case 0xD693: return "Muove la testa di una traccia dentro e fuori"; case 0xD6A6: return "Tenta l'esecuzione comando molteplici volte"; case 0xD6D0: return "Trasmetti i parametri al controller del disco"; case 0xD6E4: return "Inserisci il file nella directory"; case 0xD7B4: return "Comando OPEN, indirizzo secondario 15"; case 0xD7C7: return "-Check '*' Last file"; case 0xD7F3: return "-Check '$' Directory"; case 0xD815: return "-Check '#' Channel"; case 0xD8F5: return "Apre il file con sovrascrittura (@)"; case 0xD9A0: return "Apre il file per la lettura"; case 0xD9E3: return "Apre il file per la scrittura"; case 0xDA09: return "Verifica il tipo file e modello controllo"; case 0xDA2A: return "Preparazione per accodamento"; case 0xDA55: return "Apre la directory"; case 0xDAC0: return "Routine Chiusura"; case 0xDB02: return "Chiusura file"; case 0xDB62: return "Scrive l'ultimo blocco"; case 0xDBA5: return "Voce directory"; case 0xDC46: return "Legge blocco, alloca buffer"; case 0xDCB6: return "Puntatore Reset"; case 0xDCDA: return "Costruisce un nuovo blocco"; case 0xDD8D: return "Scittura byte nel blocco del settore laterale"; case 0xDD95: return "Manipola le impostazioni"; case 0xDDAB: return "Codice comando verifica per scrittura"; case 0xDDF1: return "Scrive un blocco di un file REL"; case 0xDDFD: return "Scrivi byte della prossima traccia"; case 0xDE0C: return "Ottieni numeri di traccia e settore seguenti"; case 0xDE19: return "Segui la traccia per l'ultimo blocco"; case 0xDE2B: return "Puntatore del buffer a zero"; case 0xDE3B: return "Ottiene traccia e settore"; case 0xDE50: return "Scrive (?)"; case 0xDE57: return "R"; case 0xDE5E: return "W"; case 0xDE65: return "R"; case 0xDE73: return "R"; case 0xDE95: return "Ottieni la traccia e il settore seguenti dal buffer"; case 0xDEA5: return "Copia il contenuto del buffer"; case 0xDEC1: return "Cancella buffer Y"; case 0xDED2: return "Ottieni il numero del settore laterale"; case 0xDEDC: return "Imposta il puntatore del buffer sul settore laterale"; case 0xDEE9: return "Puntatore buffer per settore laterale"; case 0xDEF8: return "Ottieni il settore laterale e il puntatore del buffer"; case 0xDF1B: return "Leggi il settore laterale"; case 0xDF21: return "Scrivi settore laterale"; case 0xDF45: return "Imposta il puntatore del buffer nel settore laterale"; case 0xDF4C: return "Calcola il numero di blocchi in un file REL"; case 0xDF66: return "Verifica il settore laterale nel buffer"; case 0xDF93: return "Ottieni numero di buffer"; case 0xDFD0: return "Ottieni il record successivo nel file REL"; case 0xE03C: return "Scrivi blocco e leggi il blocco successivo"; case 0xE07C: return "Scrivi un byte in un record"; case 0xE0AB: return "Scrivi byte nel file REL"; case 0xE0F3: return "Riempi il record con 0"; case 0xE105: return "Scrivi il numero del buffer nella tabella"; case 0xE120: return "Ottieni byte dal file REL"; case 0xE1CB: return "Ottieni l'ultimo settore laterale"; case 0xE207: return "Eseguire [P] - Comando di posizione"; case 0xE2E2: return "Dividi i blocchi di dati in record"; case 0xE304: return "Imposta il puntatore al record successivo"; case 0xE31C: return "Espandi il settore laterale"; case 0xE44E: return "Scrivi settore laterale e assegna nuovo"; case 0xE4fC: return "Tabella dei messaggi di errore: 00, Ok"; case 0xE500: return "Tabella dei messaggi di errore: 20,21,22,23,24,27, Errore lettura"; case 0xE50B: return "Tabella dei messaggi di errore: 52, File troppo grande"; case 0xE517: return "Tabella dei messaggi di errore: 50, Record non presente"; case 0xE522: return "Tabella dei messaggi di errore: 51, Overflow in record"; case 0xE52F: return "Tabella dei messaggi di errore: 25,28, Errore scrittura"; case 0xE533: return "Tabella dei messaggi di errore: 26, Protezione scrittura attiva"; case 0xE540: return "Tabella dei messaggi di errore: 29, Mancata corrispondenza dell'ID disco"; case 0xE546: return "Tabella dei messaggi di errore: 30,31,32,33,34, Errore di sintassi"; case 0xE552: return "Tabella dei messaggi di errore: 60, Scrivi file aperto"; case 0xE556: return "Tabella dei messaggi di errore: 63, File esiste"; case 0xE55F: return "Tabella dei messaggi di errore: 64, Tipo di file non corrispondente"; case 0xE567: return "Tabella dei messaggi di errore: 65, No blocco"; case 0xE570: return "Tabella dei messaggi di errore: 66,67, Traccia o settore illegale"; case 0xE589: return "Tabella dei messaggi di errore: 61, File non aperto"; case 0xE58D: return "Tabella dei messaggi di errore: 39,62, File non trovato"; case 0xE592: return "Tabella dei messaggi di errore: 01, File ricreati"; case 0xE59F: return "Tabella dei messaggi di errore: 70, Nessun canale"; case 0xE5AA: return "Tabella dei messaggi di errore: 71, Errore disco"; case 0xE5AF: return "Tabella dei messaggi di errore: 72, Disco pieno"; case 0xE5B6: return "Tabella dei messaggi di errore: 73, Cbm dos v2.6 1541"; case 0xE5C8: return "Tabella dei messaggi di errore: 74, Lettore non pronto"; case 0xE5D5: return "Parole indicizzate: 09 Errore"; case 0xE5DB: return "Parole indicizzate: 0A Scrittura"; case 0xE5E1: return "Parole indicizzate: 03 File"; case 0xE5E6: return "Parole indicizzate: 04 Aperto"; case 0xE5EB: return "Parole indicizzate: 05 Non corrispondente"; case 0xE5F4: return "Parole indicizzate: 06 Nont"; case 0xE5F8: return "Parole indicizzate: 07 Trovato"; case 0xE5FE: return "Parole indicizzate: 08 Disco"; case 0xE603: return "Parole indicizzate: 0B Record"; case 0xE60A: return "Prepara il numero e il messaggio di errore"; case 0xE645: return "Stampa il messaggio di errore nel buffer degli errori"; case 0xE680: return "TALK"; case 0xE688: return "LISTEN"; case 0xE69B: return "Converte BIN in 2-Ascii (buffer dei messaggi di errore)"; case 0xE6AB: return "Converte BCD in 2-Ascii (buffer dei messaggi di errore)"; case 0xE6BC: return "Scrive OK nel buffer"; case 0xE6C1: return "Stampa l'errore sulla traccia 00,00 nel buffer degli errori"; case 0xE6C7: return "Stampa l'errore sulla traccia corrente nel buffer degli errori"; case 0xE706: return "Scrive la stringa del messaggio di errore nel buffer"; case 0xE754: return "Ottieni carattere e buffer"; case 0xE767: return "Ottieni un carattere del messaggio di errore"; case 0xE775: return "Puntatore di incremento"; case 0xE77F: return "Subroutine fittizia"; case 0xE780: return "Verifica avvio automatico - rimosso"; case 0xE7A3: return "Esegui [&] - File USR esegui comando"; case 0xE84B: return "Genera checksum"; case 0xE853: return "Routine IRQ per bus seriale"; case 0xE85B: return "Assistenza per il bus seriale"; case 0xE909: return "Spedice dati"; case 0xE99C: return "DATA OUT basso"; case 0xE9A5: return "DATA OUT alto"; case 0xE9AE: return "CLOCK OUT alto"; case 0xE9B7: return "CLOCK OUT basso"; case 0xE9C0: return "Legge prota IEEE"; case 0xE9C9: return "Ottieni byte di dati dal bus"; case 0xE9F2: return "Accetta byte con EOI"; case 0xEA2E: return "Accetta i dati dal bus seriale"; case 0xEA59: return "Testa per ATN"; case 0xEA6E: return "LED lampeggiante per difetti hardware, autotest"; case 0xEAA0: return "Routine di RESET all'accensione"; case 0xEBFF: return "Aspetta il ciclo"; case 0xEC9E: return "Carica cartella"; case 0xED59: return "Trasmetti linea directory"; case 0xED67: return "Ottieni elemento dal buffer"; case 0xED84: return "Esegue [V] - coamndo Validazione"; case 0xEDE5: return "Allocare blocchi di file in BAM"; case 0xEE0D: return "Eseguire [N] - Nuovo comando (Formatta)"; case 0xEEB7: return "Crea BAM"; case 0xEEF4: return "Scrive BAM se necessario"; case 0xEF3A: return "Imposta il puntatore del buffer per BAM"; case 0xEF4D: return "Ottieni il numero di blocchi gratuiti per dir"; case 0xEF5C: return "Contrassegna il blocco come libero"; case 0xEF88: return "Imposta flag per cambio BAM"; case 0xEF90: return "Contrassegna il blocco come allocato"; case 0xEFCF: return "Cancella bit per settore nella voce BAM"; case 0xEFE9: return "Potenza di 2"; case 0xEFF1: return "Scrivi BAM dopo la modifica"; case 0xF005: return "Cancella buffer BAM"; case 0xF0D1: return "Cancella BAM"; case 0xF10F: return "Ottieni il numero di buffer per BAM"; case 0xF119: return "Numero di buffer per BAM"; case 0xF11E: return "Trova e assegna blocchi liberi"; case 0xF1A9: return "Trova settore libero e alloca"; case 0xF1FA: return "Trova settori liberi nella traccia corrente"; case 0xF220: return "Verify number of free blocks in BAM"; case 0xF24B: return "Stabilisci il numero di settori per traccia"; case 0xF258: return "Subroutine fittizia"; case 0xF259: return "Inizializza il controller del disco"; case 0xF2B0: return "Routine IRQ per controller del disco"; case 0xF2F9: return "Trasporto della testina"; case 0xF36E: return "Eseguire il programma nel buffer"; case 0xF37C: return "Bump, trova la traccia 1 (vai alla fermata)"; case 0xF393: return "Inizializza il puntatore nel buffer"; case 0xF3b2: return "Leggi l'intestazione del blocco, verifica l'ID"; case 0xF410: return "Conserva l'intestazione del blocco"; case 0xF418: return "Lavoro restituisce valore 01 (OK) in coda"; case 0xF41B: return "Lavoro restituisce il valore 0B (READ ERROR) nella coda"; case 0xF41E: return "Lavoro Restituisce il valore 09 (READ ERROR) in coda"; case 0xF423: return "Ottimizzazione del lavoro"; case 0xF4CA: return "Verificare ulteriormente il codice di comando"; case 0xF4D1: return "Leggi settore"; case 0xF50A: return "Trova l'inizio del blocco dati"; case 0xF510: return "Leggi l'intestazione del blocco"; case 0xF556: return "Attendi SYNC"; case 0xF56E: return "Verificare ulteriormente il codice di comando"; case 0xF575: return "Scrivi il blocco dati su disco"; case 0xF5E9: return "Calcola la parità per il buffer di dati"; case 0xF5F2: return "Converti il buffer dei dati GCR in binario"; case 0xF691: return "Verificare ulteriormente il codice di comando"; case 0xF698: return "Confronta i dati scritti con i dati su disco"; case 0xF6CA: return "Codice di comando per il settore di ricerca"; case 0xF6D0: return "Converti 4 byte binari in 5 byte GCR"; case 0xF77F: return "Tabella nybble GCR (5 bit)"; case 0xF78F: return "Converte 260 byte in codice di gruppo da 325 byte"; case 0xF7E6: return "Converti 5 byte GCR in 4 byte binari"; case 0xF8A0: return "Tabella di conversione da GCR a binario - high nybble $ FF significa non valido"; case 0xF8C0: return "Tabella di conversione da GCR a binario: nybble basso $ FF significa non valido"; case 0xF8E0: return "Decodifica 69 byte GCR"; case 0xF934: return "Converti l'intestazione del blocco in codice GCR"; case 0xF969: return "Controller disco di immissione errore"; case 0xF97E: return "Accendere il motore di azionamento"; case 0xF98F: return "Spegnere il motore di azionamento"; case 0xF99C: return "Controller del disco del loop di lavoro"; case 0xFA05: return "Passa alla traccia successiva"; case 0xFA1C: return "Calcola il numero di passi della testina"; case 0xFA3B: return "Spostare il motore passo-passo a breve distanza"; case 0xFA4E: return "Carico testina"; case 0xFA7B: return "Prepara un movimento veloce della testina"; case 0xFA97: return "Movimento veloce della testina"; case 0xFAA5: return "Prepara un movimento lento della testina"; case 0xFAC7: return "formattazione"; case 0xFDA3: return "Scrivi SYNC 10240 volte, cancella traccia"; case 0xFDC3: return "Lettura/scrittura ($621/$622) volte"; case 0xFDD3: return "Contatore di tentativi di formattazione"; case 0xFDF5: return "Copia i dati dal buffer di overflow"; case 0xFE00: return "Passa alla lettura"; case 0xFE0E: return "Scrivi $55 10240 volte"; case 0xFE30: return "Converti l'intestazione nel buffer 0 in codice GCR"; case 0xFE67: return "Routine interruzione"; case 0xFE85: return "Traccia directory"; case 0xFE86: return "Inizio del bam"; case 0xFE87: return "Lunghezza del Bam per traccia"; case 0xFE88: return "Fine del Bam"; case 0xFE89: return "Tabella parole comandi"; case 0xFE95: return "Byte basso indirizzo comando"; case 0xFEA1: return "Byte alto indirizzo comando"; case 0xFEAD: return "Byte per controllo sintassi"; case 0xFEB2: return "Metodi controllo file \"RWAM\""; case 0xFEB6: return "Tipo File \"DSPUL\""; case 0xFEBB: return "Nomi dei tipi file: prima lettera \"DSPUR\""; case 0xFEC0: return "Nomi dei tipi file: seconda lettera \"EERSE\""; case 0xFEC5: return "Nomi dei tipi file: terza lettera \"LQGRL\""; case 0xFECA: return "Errore valore bit LED"; case 0xFECD: return "Machere per bit comando"; case 0xFED1: return "Numero di settori per traccia"; case 0xFED5: return "Costanti per formato disco"; case 0xFED6: return "4 track ranges"; case 0xFED7: return "Number of tracks"; case 0xFED8: return "Tracks on which sector numbers change"; case 0xFEDB: return "Control bytes for head postion"; case 0xFEE6: return "ROM checksum"; case 0xFEE7: return "From UI command $EB22, to reset"; case 0xFEEA: return "Patch for diagnostic routine from $EA7A"; case 0xFEF3: return "Delay loop for serial bus in 1541 mode, from $E97D"; case 0xFEFB: return "Patch for data output to serial bus, from $E980"; case 0xFF01: return "U9 vector, switch 1540/1541"; case 0xFF10: return "Patch for reset routine, from $EAA4"; case 0xFF20: return "Patch for listen to serial bus, from $E9DC"; case 0xFF2F: return "Non usato"; case 0xFFE6: return "Formatta [C8C6]"; case 0xFFE8: return "Spegni motore [F98F]"; case 0xFFEA: return "UA, U1 [CD5F]"; case 0xFFEC: return "UB, U2 [CD97]"; case 0xFFEE: return "UC, U3 [0500]"; case 0xFFF0: return "UD, U4 [0503]"; case 0xFFF2: return "UE, U5 [0506]"; case 0xFFF4: return "UF, U6 [0509]"; case 0xFFF6: return "UG, U7 [050C]"; case 0xFFF8: return "UH, U8 [050F]"; case 0xFFFA: return "UI, U9 [FF01]"; case 0xFFFC: return "RESET [EAA0]"; case 0xFFFE: return "IRQ [FE67]"; default: if ((addr>=0x0103) && (addr<=0x0145)) return "Stack attuale del processore"; if ((addr>=0x0146) && (addr<=0x01B9)) return "Non usato"; if ((addr>=0x01BA) && (addr<=0x01FF)) return "Buffer ausiliario per codifica/decodifica GCR"; if ((addr>=0x0200) && (addr<=0x0229)) return "Buffer di input: 42 bytes (Usati per accettare i comandi dall'host)"; if ((addr>=0x022B) && (addr<=0x023D)) return "Numero canale assegnato agli indirizzi secondari"; if ((addr>=0x02B1) && (addr<=0x02CB)) return "Buffer usato per costuire l'attuale voce (linea BASIC) mentre esegue LOAD \"$\""; if ((addr>=0x02CC) && (addr<=0x02D4)) return "Non usato"; if ((addr>=0x02D5) && (addr<=0x02F8)) return "Buffer messaggio di errore"; if ((addr>=0x0300) && (addr<=0x03FF)) return "Buffer #0"; if ((addr>=0x0400) && (addr<=0x04FF)) return "Buffer #1"; if ((addr>=0x0500) && (addr<=0x05FF)) return "Buffer #2"; if ((addr>=0x0600) && (addr<=0x06FF)) return "Buffer #3"; if ((addr>=0x0700) && (addr<=0x07FF)) return "Buffer #4"; break; } default: switch ((int)addr) { case 0x00: return "Buffer #0 command and status registers"; case 0x01: return "Buffer #1 command and status register"; case 0x02: return "Buffer #2 command and status register"; case 0x03: return "Buffer #3 command and status register"; case 0x04: return "Buffer #4 command and status register"; case 0x05: return "Unused (Command and status register of not existing buffer #5)"; case 0x06: case 0x07: return "Buffer #0 track and sector register"; case 0x08: case 0x09: return "Buffer #1 track and sector register"; case 0x0A: case 0x0B: return "Buffer #2 track and sector register"; case 0x0C: case 0x0D: return "Buffer #3 track and sector register"; case 0x0E: case 0x0F: return "Buffer #4 track and sector register"; case 0x10: case 0x11: return "Unused (Track and sector register of not existing buffer #5"; case 0x12: case 0x13: return "Unit #0 expected sector header ID"; case 0x14: case 0x15: return "Unused (Expected sector header ID of not existing unit #1)"; case 0x16: case 0x17: return "Header ID from header of sector last read from disk"; case 0x18: case 0x19: return "Track and sector number from header of sector last read from disk"; case 0x1A: return "Header checksum from header of sector last read from disk"; case 0x1B: return "Unused"; case 0x1C: return "Unit #0 disk change indicator"; case 0x1D: return "Unused (Disk change indicator of not existing unit #1)"; case 0x1E: return "Previous status of unit #0 write protect photocell (in bit #4)"; case 0x1F: return "Unused (Previous status of write protect photocell of not existing unit #1)"; case 0x20: return "Unit #0 disk controller internal command register"; case 0x21: return "Unused (Disk controller internal command register of not existing unit #1)"; case 0x22: return "Unit #0 current track number"; case 0x23: return "Serial bus communication speed switch"; case 0x24: case 0x25: case 0x26: case 0x27: case 0x28: case 0x29: case 0x2A: case 0x2B: return "Header of sector last read from or next to be written onto disk, in GCR-encoded form"; case 0x2C: return "Unused"; case 0x2D: return "Unused"; case 0x2E: case 0x2F: return "Pointer to current byte in buffer during GCR-encoding/decoding"; case 0x30: case 0x31: return "Pointer to beginning of current buffer"; case 0x32: case 0x33: return "Pointer to track and sector registers of current buffer"; case 0x34: return "GCR-byte counter during GCR-encoding/decoding"; case 0x35: return "Unused"; case 0x36: return "Byte counter during GCR-encoding/decoding"; case 0x37: return "Unused"; case 0x38: return "Data block signature byte of sector last read from disk"; case 0x39: return "Expected value of sector header signature byte. Default: $08"; case 0x3A: return "Computed checksum of data in buffer"; case 0x3B: return "Unused"; case 0x3C: return "Unused"; case 0x3D: return "Disk controller current unit number"; case 0x3E: return "Disk controller previous unit number. Values"; case 0x3F: return "Disk controller current buffer number"; case 0x40: return "Current track number"; case 0x41: return "Buffer number that needs seeking"; case 0x42: return "Number of tracks to move during seeking"; case 0x43: return "Number of sectors on current track"; case 0x44: return "Data density (in bits #5-#6). Temporary register for buffer command"; case 0x45: return "Disk controller buffer command register"; case 0x46: return "Unused"; case 0x47: return "Expected value of data block header signature byte. Default: $07"; case 0x48: return "Motor spin up/down delay counter"; case 0x49: return "Original value of stack pointer before execution of disk controller interrupt"; case 0x4A: return "Number of halftracks to move during seeking"; case 0x4B: return "Retry counter for reading sector header. Temporary area during seeking"; case 0x4C: return "On current track, the distance of the sector, that matches the sector of a buffer and is nearest to the one last read from disk"; case 0x4D: return "On current track, the sector that is two sectors away from the one last read from disk"; case 0x4E: case 0x4F: return "Pointer to beginning of auxiliary buffer during GCR-encoding (byte swapped)"; case 0x50: return "Indicator of buffer data currently being in GCR-encoded form"; case 0x51: return "Current track number during formatting"; case 0x52: case 0x53: case 0x54: case 0x55: return "Temporary area for data bytes during GCR-encoding/decoding"; case 0x56: case 0x57: case 0x58: case 0x59: case 0x5A: case 0x5B: case 0x5C: case 0x5D: return "Temporary area for data nybbles and GCR bytes during GCR-encoding/decoding"; case 0x5E: return "Number of halftracks to accelerate/decelerate through during accelerated seeking"; case 0x5F: return "Acceleration/deceleration factor during accelerated seeking"; case 0x60: return "Delay counter after seeking (So that head stops vibrating), halftrack counter for acceleration/deceleration during accelerated seeking"; case 0x61: return "Halftrack counter for full speed during accelerated seeking"; case 0x62: case 0x63: return "Pointer to routine next to be executed during seeking"; case 0x64: return "Lower distance limit of accelerated seeking, in halftracks. Default: $C8"; case 0x65: case 0x66: return "Pointer to warm reset (\"UI\" command) routine. Default: $EB22."; case 0x67: return "Unknown"; case 0x68: return "Automatic disk initialization switch. Default $00"; case 0x69: return "Soft interleave (Distance, in sectors, for allocating the next sector for files). Default: $0A"; case 0x6A: return "Number of retries on disk commands. Default: $05"; case 0x6B: case 0x6C: return "Pointer to \"Ux\" user command pointer table. Default: $FFEA"; case 0x6D: case 0x6E: return "Temporary pointer for BAM operations"; case 0x6F: case 0x70: return "Temporary pointer for various operations"; case 0x71: case 0x72: case 0x73: case 0x74: return "Unknown"; case 0x75: case 0x76: return "Pointer to current byte during memory test upon startup. Execution address of current Ux user command"; case 0x77: return "Serial bus LISTEN command to accept (Device number OR $20)"; case 0x78: return "Serial bus TALK command to accept (Device number OR $40)"; case 0x79: return "Serial bus LISTEN command indicator"; case 0x7A: return "Serial bus TALK command indicator"; case 0x7B: return "Unknown"; case 0x7C: return "Serial bus ATN arrival indicator"; case 0x7D: return "End of command indicator"; case 0x7E: return "Track number of previously opened file (Used when opening \"*\")"; case 0x7F: return "Current unit. Default: $00"; case 0x80: case 0x81: return "Track and sector number for various operations"; case 0x82: return "Current channel number"; case 0x83: return "Current secondary address (only bits #0-#3)"; case 0x84: return "Current secondary address"; case 0x85: return "Data byte read from serial bus. Data byte read from buffer or to be written into buffer"; case 0x86: case 0x87: return "Pointer to current byte in directory buffer"; case 0x88: case 0x89: return "Pointer to current byte or execution address of user code during \"&\" command"; case 0x8A: return "Unknown"; case 0x8B: case 0x8C: case 0x8D: return "Temporary area for integer division. (Used to compute the side sector of relative files)"; case 0x8E: case 0x8F: case 0x90: case 0x91: case 0x92: case 0x93: return "Unknown"; case 0x94: case 0x95: return "Pointer to current directory entry"; case 0x96: case 0x97: return "Unused"; case 0x98: return "Bit counter during serial bus input/output"; case 0x99: case 0x9A: return "Pointer to buffer #0. Default: $0300"; case 0x9B: case 0x9C: return "Pointer to buffer #1. Default: $0400"; case 0x9D: case 0x9E: return "Pointer to buffer #2. Default: $0500"; case 0x9F: case 0xA0: return "Pointer to buffer #3. Default: $0600"; case 0xA1: case 0xA2: return "Pointer to buffer #4. Default: $0700"; case 0xA3: case 0xA4: return "Pointer to input buffer. Default: $0200"; case 0xA5: case 0xA6: return "Pointer to error message buffer. Default: $02D5"; case 0xA7: case 0xA8: case 0xA9: case 0xAA: case 0xAB: case 0xAC: case 0xAD: return "Primary buffer number assigned to channels"; case 0xAE: case 0xAF: case 0xB0: case 0xB1: case 0xB2: case 0xB3: case 0xB4: return "Secondary buffer number assigned to channels"; case 0xB5: case 0xB6: case 0xB7: case 0xB8: case 0xB9: case 0xBA: return "Length of file assigned to channels, low byte. For relative files, number of records, low byte"; case 0xBB: case 0xBC: case 0xBD: case 0xBE: case 0xBF: case 0xC0: return "Length of file assigned to channels, high byte. For relative files, number of records, high byte"; case 0xC1: case 0xC2: case 0xC3: case 0xC4: case 0xC5: case 0xC6: return "Offset of current byte in buffer assigned to channels"; case 0xC7: case 0xC8: case 0xC9: case 0xCA: case 0xCB: case 0xCC: return "Record length of relative file assigned to channels"; case 0xCD: case 0xCE: case 0xCF: case 0xD0: case 0xD1: case 0xD2: return "Buffer number holding side sector of relative file assigned to channels"; case 0xD3: return "Comma counter during fetching unit numbers from command"; case 0xD4: return "Offset of current byte in relative file record"; case 0xD5: return "Side sector number belonging to current relative file record"; case 0xD6: return "Offset of track and sector number of current relative file record in side sector"; case 0xD7: return "Offset of record in relative file data sector"; case 0xD8: case 0xD9: case 0xDA: case 0xDB: case 0xDC: return "Sector number of directory entry of files"; case 0xDD: case 0xDE: case 0xDF: case 0xE0: case 0xE1: return "Offset of directory entry of file"; case 0xE2: case 0xE3: case 0xE4: case 0xE5: case 0xE6: return "Unit number of files"; case 0xE7: case 0xE8: case 0xE9: case 0xEA: case 0xEB: return "File type and flags of files"; case 0xEC: case 0xED: case 0xEE: case 0xEF: case 0xF0: case 0xF1: return "Unit number, file type and flags of files assigned to channels"; case 0xF2: case 0xF3: case 0xF4: case 0xF5: case 0xF6: case 0xF7: return "Input/output flags of channels"; case 0xF8: return "End of file indicator of current channel"; case 0xF9: return "Current buffer number"; case 0xFA: case 0xFB: case 0xFE: return "Unknown"; case 0xFF: return "Unit #0 BAM input/output error indicator"; case 0x100: return "BAM input/output error indicator of not existing unit #1"; case 0x101: return "Unit #0 BAM version code (Byte at offset #$02 in sector 18;00) Expected: $41,A"; case 0x102: return "BAM version code of not existing unit #1"; case 0x22A: return "DOS command number"; case 0x23E: case 0x23F: case 0x240: case 0x241: case 0x242: return "Temporary area of next data byte to be written from buffers #0-#4 to serial bus"; case 0x243: return "Temporary area of next data byte to be written from error message buffer to serial bus"; case 0x244: case 0x245: case 0x246: case 0x247: case 0x248: return "Offset of last data byte in buffers #0-#4"; case 0x249: return "Offset of last data byte in error message buffer"; case 0x24A: return "File type of current file"; case 0x24B: return "Length of name of current file"; case 0x24C: return "Temporary area for secondary address"; case 0x24D: return "Temporary area for disk controller command"; case 0x24E: return "Number of sectors on current track"; case 0x24F: case 0x250: return "Buffer allocation register. Default: $FFE0"; case 0x251: return "Unit #0 BAM change indicator"; case 0x252: return "BAM change indicator of not existing unit #1"; case 0x253: return "File found indicator during searching for a file name in directory."; case 0x254: return "LOAD channel directory indicator"; case 0x255: return "End of command indicator"; case 0x256: return "Channel allocation register"; case 0x257: return "Temporary area for channel number"; case 0x258: return "Record length of current relative file"; case 0x259: case 0x25A: return "Track and sector number of first side sector of current relative file"; case 0x25B: case 0x25C: case 0x25D: case 0x25E: case 0x25F: return "Original disk controller commands of buffers #0-#4"; case 0x260: case 0x261: case 0x262: case 0x263: case 0x264: case 0x265: return "Sector number of directory entry of files specified in command"; case 0x266: case 0x267: case 0x268: case 0x269: case 0x26A: case 0x26B: return "Offset of directory entry of files specified in command"; case 0x26C: return "Switch for displaying warning messages of relative files"; case 0x26D: return "Unit #0 LED bit"; case 0x26E: return "Unit number of previously opened file (Used when opening \"*\")"; case 0x26F: return "Sector number of previously opened file (Used when opening \"*\")"; case 0x270: return "Temporary area for channel number"; case 0x271: return "Unused"; case 0x272: case 0x273: return "BASIC line number for entries sent to host during LOAD'ing \"$\""; case 0x274: return "Length of command"; case 0x275: return "First character of command. Character to search for in input buffer"; case 0x276: return "Offset of first character after file name in command"; case 0x277: return "Temporary area for number of commas in command"; case 0x278: return "Number of commas or unit numbers in command"; case 0x279: return "Number of commas before equation mark in command. Number of current file in command during searching for files specified in command"; case 0x27A: return "Offset of character before colon in command"; case 0x27B: case 0x27C: case 0x27D: case 0x27E: case 0x27F: return "Offset of file names in command"; case 0x280: case 0x281: case 0x282: case 0x283: case 0x284: return "Track number of files specified in command"; case 0x285: case 0x286: case 0x287: case 0x288: case 0x289: return "Sector number of files specified in command. For B-x commands, lower byte of parameters"; case 0x28A: return "Number of wildcards found in current file name"; case 0x28B: return "Command syntax flags"; case 0x28C: return "Number of units to process during reading the directory"; case 0x28D: return "Current unit number during reading the directory"; case 0x28E: return "Previous unit number during reading the directory"; case 0x28F: return "Indicator to keep searching in the directory"; case 0x290: return "Current directory sector number"; case 0x291: return "Directory sector number to read"; case 0x292: return "Offset of current directory entry in directory sector"; case 0x293: return "End of directory indicator"; case 0x294: return "Offset of current directory entry in directory sector"; case 0x295: return "Number of remaining directory entries in directory sector minus 1"; case 0x296: return "File type of file being searched in directory"; case 0x297: return "File open mode"; case 0x298: return "Message display switch for disk errors"; case 0x299: return "Offset of current byte in halftrack seek table during retrying disk operations on adjacent halftracks"; case 0x29A: return "Direction of seeking back to original halftrack during retrying disk operations on adjacent halftracks"; case 0x29B: return "Unit #0 track number of current BAM entry"; case 0x29C: return "Track number of current BAM entry of not existing unit #1"; case 0x29D: case 0x29E: return "Unit #0 track numbers of two cached BAM entries"; case 0x29F: case 0x2A0: return "Track numbers of two cached BAM entries of not existing unit #1"; case 0x2A1: case 0x2A2: case 0x2A3: case 0x2A4: case 0x2A5: case 0x2A6: case 0x2A7: case 0x2A8: return "Unit #0 two cached BAM entries"; case 0x2A9: case 0x2AA: case 0x2AB: case 0x2AC: case 0x2AD: case 0x2AE: case 0x2AF: case 0x2B0: return "Two cached BAM entries of not existing unit #1"; case 0x2F9: return "Disk update upon BAM change switch. Different BAM-related operations expect different values here"; case 0x2FA: return "Unit #0 number of free blocks, low byte"; case 0x2FB: return "Number of free blocks, low byte, of not existing unit #1"; case 0x2FC: return "Unit #0 number of free blocks, high byte"; case 0x2FD: return "Number of free blocks, high byte, of not existing unit #1"; case 0x2FE: return "Unit #0 direction of seeking of adjacent halftrack"; case 0x2FF: return "Direction of seeking of adjacent halftrack of not existing unit #1"; case 0x1800: return "Via #1: Port B #1, serial bus"; case 0x1801: return "Via #2: Port A #1. Read to acknowledge interrupt generated by ATN IN going high"; case 0x1802: return "Via #2: Port B #1 data direction register. Default: $1A, %00011010"; case 0x1803: return "Via #2: Port A #1 data direction register. Default: $FF, %11111111."; case 0x1804: case 0x1805: return "Via #2: Timer #1. Read low byte or write high byte to start timer or restart timer upon underflow"; case 0x1806: case 0x1807: return "Via #2: Timer latch #1. Read/write starting value of timer from/to here"; case 0x1808: case 0x1809: case 0x180A: return "Via #2: Unused"; case 0x180B: return "Via #2: Timer control register #1"; case 0x180C: return "Via #2: Unused"; case 0x180D: return "Via #2: Interrupt status register #1"; case 0x180E: return "Via #2: Interrupt control register #1"; case 0x180F: return "Via #2: Unused"; case 0x1C00: return "Via #2: Port B #2"; case 0x1C01: return "Via #2: Port A #2. Data byte last read from or to be next written onto disk"; case 0x1C02: return "Via #2: Port B #2 data direction register"; case 0x1C03: return "Via #2: Port A #2 data direction register"; case 0x1C04: case 0x1C05: return "Via #2: Timer #2. Read low byte or write high byte to start timer or restart timer upon underflow"; case 0x1C06: case 0x1C07: return "Via #2: Timer latch #2. Read/write starting value of timer from/to here"; case 0x1C08: case 0x1C09: case 0x1C0A: return "Via #2: Unused"; case 0x1C0B: return "Via #2: Timer control register #2"; case 0x1C0C: return "Via #2: Auxiliary control register #2"; case 0x1C0D: return "Via #2: Interrupt status register #2"; case 0x1C0E: return "Via #2: Interrupt control register #2"; case 0x1C0F: return "Via #2: Unused"; case 0xC100: return "Turn LED on for current drive"; case 0xC118: return "Turn LED on"; case 0xC123: return "Clear error flags"; case 0xC12C: return "Prepare for LED flash after error"; case 0xC146: return "Interpret command from computer"; case 0xC194: return "Prepare error msg after executing command"; case 0xC1BD: return "Erase input buffer"; case 0xC1C8: return "Output error msg (track and sector 0)"; case 0xC1D1: return "Check input line"; case 0xC1E5: return "Check ':' on input line"; case 0xC1EE: return "Check input line"; case 0xC268: return "Search character in input buffer"; case 0xC2B3: return "Check line length"; case 0xC2DC: return "Clear flags for command input"; case 0xC312: return "Preserve drive number"; case 0xC33C: return "Search for drive number"; case 0xC368: return "Get drive number"; case 0xC38F: return "Reverse drive number"; case 0xC398: return "Check given file type"; case 0xC3BD: return "Check given drive number"; case 0xC3CA: return "Verify drive number"; case 0xC440: return "Flags for drive check"; case 0xC44f: return "Search for file in directory"; case 0xC63D: return "Test and initalise drive"; case 0xC66E: return "Name of file in directory buffer"; case 0xC688: return "Copy filename to work buffer"; case 0xC6A6: return "Search for end of name in command"; case 0xC7AC: return "Clear Directory Output Buffer"; case 0xC7B7: return "Create header with disk name"; case 0xC806: return "Print 'blocks free.'"; case 0xC817: return "'Blocks free.'"; case 0xC823: return "Perform [S] - Scratch command"; case 0xC87D: return "Erase file"; case 0xC8B6: return "Erase dir entry"; case 0xC8C1: return "Perform [D] - Backup command (Unused)"; case 0xC8C6: return "Format disk"; case 0xC8F0: return "Perform [C] - Copy command"; case 0xCA88: return "Perform [R] - Rename command"; case 0xCACC: return "Check if file present"; case 0xCAF8: return "Perform [M] - Memory command"; case 0xCB20: return "M-R memory read"; case 0xCB50: return "M-W memory write"; case 0xCB5C: return "Perform [U] - User command"; case 0xCB84: return "Open direct access channel, number"; case 0xCC1B: return "Perform [B] - Block/Buffer command"; case 0xCC5D: return "Block commands \"AFRWEP\""; case 0xCC63: return "Block command vectors"; case 0xCC6F: return "Get parameters form block commands"; case 0xCCF2: return "Decimal values 1, 10, 100"; case 0xCCF5: return "B-F block free"; case 0xCD03: return "B-A block allocate"; case 0xCD36: return "Read block to buffer"; case 0xCD3c: return "Get byte from buffer"; case 0xCD42: return "Read block from disk"; case 0xCD56: return "B-R block read"; case 0xCD5F: return "U1, Block read without changing buffer pointer"; case 0xCD73: return "B-W block write"; case 0xCD97: return "U2, Block write without changing buffer pointer"; case 0xCDA3: return "B-E block execute"; case 0xCDBD: return "B-P block pointer"; case 0xCDD2: return "Open channel"; case 0xCDF2: return "Check buffer number and open channel"; case 0xCE0E: return "Set pointer for REL file"; case 0xCE6E: return "Divide by 254"; case 0xCE71: return "Divide by 120"; case 0xCED9: return "Erase work storage"; case 0xCEE2: return "Left shift 3-byte register twice"; case 0xCEE5: return "Left shift 3-byte register once"; case 0xCEED: return "Add 3-byte registers"; case 0xCF8C: return "Change buffer"; case 0xCF9B: return "Write data in buffer"; case 0xCFF1: return "Write data byte in buffer"; case 0xD005: return "Perform [I] - Initalise command"; case 0xD00e: return "Read BAM from disk"; case 0xD042: return "Load BAM"; case 0xD075: return "Calculate blocks free"; case 0xD0C3: return "Read block"; case 0xD0C7: return "Write block"; case 0xD0EB: return "Open channel for reading"; case 0xD107: return "Open channel for writing"; case 0xD125: return "Check for file type REL"; case 0xD12f: return "Get buffer and channel numbers"; case 0xD137: return "Get a byte from buffer"; case 0xD156: return "Get byte and read next block"; case 0xD19D: return "Write byte in buffer and block"; case 0xD1C6: return "Increment buffer pointer"; case 0xD1D3: return "Get drive number"; case 0xD1DF: return "Find write channel and buffer"; case 0xD1E2: return "Find read channel and buffer"; case 0xD227: return "Close channel"; case 0xD25A: return "Free buffer"; case 0xD28E: return "Find buffer"; case 0xD307: return "Close all channels"; case 0xD313: return "Close all channels of other drives"; case 0xD37F: return "Find channel and allocate"; case 0xD39B: return "Get byte for output"; case 0xD44D: return "Read next block"; case 0xD460: return "Read block"; case 0xD464: return "Write block"; case 0xD475: return "Allocate buffer and read block"; case 0xD486: return "Allocate new block"; case 0xD48D: return "Write dir block"; case 0xD4C8: return "Set buffer pointer"; case 0xD4DA: return "Close internal channel"; case 0xD4E8: return "Set buffer pointer"; case 0xD4F6: return "Get byte from buffer"; case 0xD506: return "Check track and sector numbers"; case 0xD552: return "Get track and sector numbers for current job"; case 0xD55F: return "Check for vaild track and sector numbers"; case 0xD572: return "DOS mismatch error"; case 0xD586: return "Read block"; case 0xD58A: return "Write block"; case 0xD599: return "Verify execution"; case 0xD5C6: return "Additional attempts for read errors"; case 0xD676: return "Move head by half a track"; case 0xD693: return "Move head one track in or out"; case 0xD6A6: return "Attempt command execution multiple times"; case 0xD6D0: return "Transmit param to disk controller"; case 0xD6E4: return "Enter file in dir"; case 0xD7B4: return "OPEN command, secondary addr 15"; case 0xD7C7: return "-Check '*' Last file"; case 0xD7F3: return "-Check '$' Directory"; case 0xD815: return "-Check '#' Channel"; case 0xD8F5: return "Open a file with overwriting (@)"; case 0xD9A0: return "Open file for reading"; case 0xD9E3: return "Open file for writing"; case 0xDA09: return "Check file type and control mode"; case 0xDA2A: return "Preparation for append"; case 0xDA55: return "Open directory"; case 0xDAC0: return "Close routine"; case 0xDB02: return "Close file"; case 0xDB62: return "Write last block"; case 0xDBA5: return "Directory entry"; case 0xDC46: return "Read block, allocate buffer"; case 0xDCB6: return "Reset pointer"; case 0xDCDA: return "Construct a new block"; case 0xDD8D: return "Write byte in side-sector block"; case 0xDD95: return "Manipulate flags"; case 0xDDAB: return "Verify command code for writing"; case 0xDDF1: return "Write a block of a REL file"; case 0xDDFD: return "Write bytes for following track"; case 0xDE0C: return "Get following track and sector numbers"; case 0xDE19: return "Following track for last block"; case 0xDE2B: return "buffer pointer to zero"; case 0xDE3B: return "Get track and sector"; case 0xDE50: return "Write (?)"; case 0xDE57: return "R"; case 0xDE5E: return "W"; case 0xDE65: return "R"; case 0xDE73: return "R"; case 0xDE95: return "Get following track and sector from buffer"; case 0xDEA5: return "Copy buffer contents"; case 0xDEC1: return "Erase buffer Y"; case 0xDED2: return "Get side-sector number"; case 0xDEDC: return "Set buffer pointer to side-sector"; case 0xDEE9: return "Buffer pointer for side-sector"; case 0xDEF8: return "Get side sector and buffer pointer"; case 0xDF1B: return "Read side-sector"; case 0xDF21: return "Write side-sector"; case 0xDF45: return "Set buffer pointer in side-sector"; case 0xDF4C: return "Calculate number of blocks in a REL file"; case 0xDF66: return "Verify side-sector in buffer"; case 0xDF93: return "Get buffer number"; case 0xDFD0: return "Get next record iin REL file"; case 0xE03C: return "Write block and read next block"; case 0xE07C: return "Write a byte in a record"; case 0xE0AB: return "Write byte in REL file"; case 0xE0F3: return "Fill record with 0s"; case 0xE105: return "Write buffer number in table"; case 0xE120: return "Get byte from REL file"; case 0xE1CB: return "Get last side-sector"; case 0xE207: return "Perform [P] - Position command"; case 0xE2E2: return "Divide data blocks into records"; case 0xE304: return "Set pointer to next record"; case 0xE31C: return "Expand side-sector"; case 0xE44E: return "Write side-sector and allocate new"; case 0xE4fC: return "Table of error messages: 00, Ok"; case 0xE500: return "Table of error messages: 20,21,22,23,24,27, Read error"; case 0xE50B: return "Table of error messages: 52, File too large"; case 0xE517: return "Table of error messages: 50, Record not present"; case 0xE522: return "Table of error messages: 51, Overflow in record"; case 0xE52F: return "Table of error messages: 25,28, Write error"; case 0xE533: return "Table of error messages: 26, Write protect on"; case 0xE540: return "Table of error messages: 29, Disk id mismatch"; case 0xE546: return "Table of error messages: 30,31,32,33,34, Syntax error"; case 0xE552: return "Table of error messages: 60, Write file open"; case 0xE556: return "Table of error messages: 63, File exists"; case 0xE55F: return "Table of error messages: 64, File type mismatch"; case 0xE567: return "Table of error messages: 65, No block"; case 0xE570: return "Table of error messages: 66,67, Illegal track or sector"; case 0xE589: return "Table of error messages: 61, File not open"; case 0xE58D: return "Table of error messages: 39,62, File not found"; case 0xE592: return "Table of error messages: 01, Files scratched"; case 0xE59F: return "Table of error messages: 70, No channel"; case 0xE5AA: return "Table of error messages: 71, Dir error"; case 0xE5AF: return "Table of error messages: 72, Disk full"; case 0xE5B6: return "Table of error messages: 73, Cbm dos v2.6 1541"; case 0xE5C8: return "Table of error messages: 74, Drive not ready"; case 0xE5D5: return "Indexed words: 09 Error"; case 0xE5DB: return "Indexed words: 0A Write"; case 0xE5E1: return "Indexed words: 03 File"; case 0xE5E6: return "Indexed words: 04 Open"; case 0xE5EB: return "Indexed words: 05 Mismatch"; case 0xE5F4: return "Indexed words: 06 Not"; case 0xE5F8: return "Indexed words: 07 Found"; case 0xE5FE: return "Indexed words: 08 Disk"; case 0xE603: return "Indexed words: 0B Record"; case 0xE60A: return "Prepare error number and message"; case 0xE645: return "Print error message into error buffer"; case 0xE680: return "TALK"; case 0xE688: return "LISTEN"; case 0xE69B: return "Convert BIN to 2-Ascii (error message buffer)"; case 0xE6AB: return "Convert BCD to 2-Ascii (error message buffer)"; case 0xE6BC: return "Write OK in buffer"; case 0xE6C1: return "Print error on track 00,00 to error buffer"; case 0xE6C7: return "Print error on current track to error buffer"; case 0xE706: return "Write error message string to buffer"; case 0xE754: return "Get character and in buffer"; case 0xE767: return "Get a char of the error message"; case 0xE775: return "Increment pointer"; case 0xE77F: return "Dummy subroutine"; case 0xE780: return "Check for auto start - removed"; case 0xE7A3: return "Perform [&] - USR file execute command"; case 0xE84B: return "Generate checksum"; case 0xE853: return "IRQ routine for serial bus"; case 0xE85B: return "Service the serial bus"; case 0xE909: return "Send data"; case 0xE99C: return "DATA OUT lo"; case 0xE9A5: return "DATA OUT hi"; case 0xE9AE: return "CLOCK OUT hi"; case 0xE9B7: return "CLOCK OUT lo"; case 0xE9C0: return "Read IEEE port"; case 0xE9C9: return "Get data byte from bus"; case 0xE9F2: return "Accept byte with EOI"; case 0xEA2E: return "Accept data from serial bus"; case 0xEA59: return "Test for ATN"; case 0xEA6E: return "Flash LED for hardware defects, self-test"; case 0xEAA0: return "Power-up RESET routine"; case 0xEBFF: return "Wait loop"; case 0xEC9E: return "Load dir"; case 0xED59: return "Transmit dir line"; case 0xED67: return "Get byte from buffer"; case 0xED84: return "Perform [V] - Validate command"; case 0xEDE5: return "Allocate file blocks in BAM"; case 0xEE0D: return "Perform [N] - New (Format) command"; case 0xEEB7: return "Create BAM"; case 0xEEF4: return "Write BAM if needed"; case 0xEF3A: return "Set buffer pointer for BAM"; case 0xEF4D: return "Get number of free blocks for dir"; case 0xEF5C: return "Mark block as free"; case 0xEF88: return "Set flag for BAM changed"; case 0xEF90: return "Mark block as allocated"; case 0xEFCF: return "Erase bit for sector in BAM entry"; case 0xEFE9: return "Powers of 2"; case 0xEFF1: return "Write BAM after change"; case 0xF005: return "Erase BAM buffer"; case 0xF0D1: return "Crear BAM"; case 0xF10F: return "Get buffer number for BAM"; case 0xF119: return "Buffer number for BAM"; case 0xF11E: return "Find and allocate free block"; case 0xF1A9: return "Find free sector and allocate"; case 0xF1FA: return "Find free sectors in current track"; case 0xF220: return "Verify number of free blocks in BAM"; case 0xF24B: return "Establish number of sectors per track"; case 0xF258: return "Dummy subroutine"; case 0xF259: return "Initialise disk controller"; case 0xF2B0: return "IRQ routine for disk controller"; case 0xF2F9: return "Head transport"; case 0xF36E: return "Execute program in buffer"; case 0xF37C: return "Bump, find track 1 (head at stop)"; case 0xF393: return "Initialise pointer in buffer"; case 0xF3b2: return "Read block header, verify ID"; case 0xF410: return "Preserve block header"; case 0xF418: return "Work Return value 01 (OK) into queue"; case 0xF41B: return "Work Return value 0B (READ ERROR) into queue"; case 0xF41E: return "Work Return value 09 (READ ERROR) into queue"; case 0xF423: return "Job optimisation"; case 0xF4CA: return "Test command code further"; case 0xF4D1: return "Read sector"; case 0xF50A: return "Find start of data block"; case 0xF510: return "Read block header"; case 0xF556: return "Wait for SYNC"; case 0xF56E: return "Test command code further"; case 0xF575: return "Write data block to disk"; case 0xF5E9: return "Calculate parity for data buffer"; case 0xF5F2: return "Convert buffer of GCR data into binary"; case 0xF691: return "Test command code further"; case 0xF698: return "Compare written data with data on disk"; case 0xF6CA: return "Command code for find sector"; case 0xF6D0: return "Convert 4 binary bytes to 5 GCR bytes"; case 0xF77F: return "GCR (5-bit) nybble table"; case 0xF78F: return "Convert 260 bytes to 325 bytes group code"; case 0xF7E6: return "Convert 5 GCR bytes to 4 binary bytes"; case 0xF8A0: return "Conversion table GCR to binary - high nybble $FF means invalid"; case 0xF8C0: return "Conversion table GCR to binary - low nybble $FF means invalid"; case 0xF8E0: return "Decode 69 GCR bytes"; case 0xF934: return "Convert block header to GCR code"; case 0xF969: return "Error entry disk controller"; case 0xF97E: return "Turn drive motor on"; case 0xF98F: return "Turn drive motor off"; case 0xF99C: return "Job loop disk controller"; case 0xFA05: return "Move head to next track"; case 0xFA1C: return "Calculate number of head steps"; case 0xFA3B: return "Move stepper motor short distance"; case 0xFA4E: return "Load head"; case 0xFA7B: return "Prepare fast head movement"; case 0xFA97: return "Fast head movement"; case 0xFAA5: return "Prepare slow head movement"; case 0xFAC7: return "Formatting"; case 0xFDA3: return "Write SYNC 10240 times, erase track"; case 0xFDC3: return "Read/write ($621/$622) times"; case 0xFDD3: return "Attempt counter for formatting"; case 0xFDF5: return "Copy data from overflow buffer"; case 0xFE00: return "Switch to reading"; case 0xFE0E: return "Write $55 10240 times"; case 0xFE30: return "Convert header in buffer 0 to GCR code"; case 0xFE67: return "Interrupt routine"; case 0xFE85: return "Directory track"; case 0xFE86: return "Start of bam"; case 0xFE87: return "Length of bam per track"; case 0xFE88: return "End of bam"; case 0xFE89: return "Table of command words"; case 0xFE95: return "Low byte of command addresses"; case 0xFEA1: return "High byte of command addresses"; case 0xFEAD: return "Bytes for syntax check"; case 0xFEB2: return "File control methods \"RWAM\""; case 0xFEB6: return "File types \"DSPUL\""; case 0xFEBB: return "Names of file types: 1st letter \"DSPUR\""; case 0xFEC0: return "Names of file types: 2nd letter \"EERSE\""; case 0xFEC5: return "Names of file types: 3rd letter \"LQGRL\""; case 0xFECA: return "Error LED bit value"; case 0xFECD: return "Masks for bit command"; case 0xFED1: return "Number of sectors per track"; case 0xFED5: return "Constands for disk format"; case 0xFED6: return "4 track ranges"; case 0xFED7: return "Number of tracks"; case 0xFED8: return "Tracks on which sector numbers change"; case 0xFEDB: return "Control bytes for head postion"; case 0xFEE6: return "ROM checksum"; case 0xFEE7: return "From UI command $EB22, to reset"; case 0xFEEA: return "Patch for diagnostic routine from $EA7A"; case 0xFEF3: return "Delay loop for serial bus in 1541 mode, from $E97D"; case 0xFEFB: return "Patch for data output to serial bus, from $E980"; case 0xFF01: return "U9 vector, switch 1540/1541"; case 0xFF10: return "Patch for reset routine, from $EAA4"; case 0xFF20: return "Patch for listen to serial bus, from $E9DC"; case 0xFF2F: return "Unused"; case 0xFFE6: return "Format [C8C6]"; case 0xFFE8: return "Turn motor off [F98F]"; case 0xFFEA: return "UA, U1 [CD5F]"; case 0xFFEC: return "UB, U2 [CD97]"; case 0xFFEE: return "UC, U3 [0500]"; case 0xFFF0: return "UD, U4 [0503]"; case 0xFFF2: return "UE, U5 [0506]"; case 0xFFF4: return "UF, U6 [0509]"; case 0xFFF6: return "UG, U7 [050C]"; case 0xFFF8: return "UH, U8 [050F]"; case 0xFFFA: return "UI, U9 [FF01]"; case 0xFFFC: return "RESET [EAA0]"; case 0xFFFE: return "IRQ [FE67]"; default: if ((addr>=0x0103) && (addr<=0x0145)) return "Actual processor stack"; if ((addr>=0x0146) && (addr<=0x01B9)) return "Unused"; if ((addr>=0x01BA) && (addr<=0x01FF)) return "Auxiliary buffer for GCR-encoding/decoding"; if ((addr>=0x0200) && (addr<=0x0229)) return "Input buffer: 42 bytes (Used for accepting commands from host)"; if ((addr>=0x022B) && (addr<=0x023D)) return "Channel number assigned to secondary addresses"; if ((addr>=0x02B1) && (addr<=0x02CB)) return "Buffer for constructing current entry (BASIC line) while LOAD'ing \"$\""; if ((addr>=0x02CC) && (addr<=0x02D4)) return "Unused"; if ((addr>=0x02D5) && (addr<=0x02F8)) return "Error message buffer"; if ((addr>=0x0300) && (addr<=0x03FF)) return "Buffer #0"; if ((addr>=0x0400) && (addr<=0x04FF)) return "Buffer #1"; if ((addr>=0x0500) && (addr<=0x05FF)) return "Buffer #2"; if ((addr>=0x0600) && (addr<=0x06FF)) return "Buffer #3"; if ((addr>=0x0700) && (addr<=0x07FF)) return "Buffer #4"; break; } } break; } return super.dcom(iType, aType, addr, value); } }
103,144
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
CPlus4Dasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/machine/CPlus4Dasm.java
/** * @(#)C128Dasm.java 2020/10/11 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.machine; import sw_emulator.software.cpu.M6510Dasm; import static sw_emulator.software.cpu.M6510Dasm.A_ABS; import static sw_emulator.software.cpu.M6510Dasm.A_ABX; import static sw_emulator.software.cpu.M6510Dasm.A_ABY; import static sw_emulator.software.cpu.M6510Dasm.A_IDX; import static sw_emulator.software.cpu.M6510Dasm.A_IDY; import static sw_emulator.software.cpu.M6510Dasm.A_IND; import static sw_emulator.software.cpu.M6510Dasm.A_REL; import static sw_emulator.software.cpu.M6510Dasm.A_ZPG; import static sw_emulator.software.cpu.M6510Dasm.A_ZPX; import static sw_emulator.software.cpu.M6510Dasm.A_ZPY; /** * Comment the memory location of Plus4 for the disassembler * It performs also a multy language comments. * * @author ice */ public class CPlus4Dasm extends M6510Dasm { // Available language public static final byte LANG_ENGLISH=1; public static final byte LANG_ITALIAN=2; /** * Return a comment string for the passed instruction * * @param iType the type of instruction * @param aType the type of addressing used by the instruction * @param addr the address value (if needed by this istruction type) * @param value the operation value (if needed by this instruction) * @return a comment string */ @Override public String dcom(int iType, int aType, long addr, long value) { byte language=option.commentLanguage; switch (aType) { case A_ZPG: case A_ZPX: case A_ZPY: case A_ABS: case A_ABX: case A_ABY: case A_REL: case A_IND: case A_IDX: case A_IDY: // do not get comment if appropriate option is not selected if ((int)addr<=0xFF && !option.commentPlus4ZeroPage) return ""; if ((int)addr>=0x100 && (int)addr<=0x1FF && !option.commentPlus4StackArea) return ""; if ((int)addr>=0x200 && (int)addr<=0x2FF && !option.commentPlus4_200Area) return ""; if ((int)addr>=0x300 && (int)addr<=0x3FF && !option.commentPlus4_300Area) return ""; if ((int)addr>=0x400 && (int)addr<=0x4FF && !option.commentPlus4_400Area) return ""; if ((int)addr>=0x500 && (int)addr<=0x5FF && !option.commentPlus4_500Area) return ""; if ((int)addr>=0x600 && (int)addr<=0x6FF && !option.commentPlus4_600Area) return ""; if ((int)addr>=0x700 && (int)addr<=0x7FF && !option.commentPlus4_700Area) return ""; if ((int)addr>=0x800 && (int)addr<=0xBFF && !option.commentPlus4ColorArea) return ""; if ((int)addr>=0xC00 && (int)addr<=0xCFF && !option.commentPlus4VideoArea) return ""; if ((int)addr>=0x1000 && (int)addr<=0x17FF && !option.commentPlus4BasicRamP) return ""; if ((int)addr>=0x1800 && (int)addr<=0x1BFF && !option.commentPlus4Luminance) return ""; if ((int)addr>=0x1C00 && (int)addr<=0x1FFF && !option.commentPlus4ColorBitmap) return ""; if ((int)addr>=0x2000 && (int)addr<=0x3FFF && !option.commentPlus4GraphicData) return ""; if ((int)addr>=0x4000 && (int)addr<=0x7FFF && !option.commentPlus4BasicRamN) return ""; if ((int)addr>=0x8000 && (int)addr<=0xBFFF && !option.commentPlus4BasicRom) return ""; if ((int)addr>=0xC000 && (int)addr<=0xCFFF && !option.commentPlus4BasicExt) return ""; if ((int)addr>=0xD000 && (int)addr<=0xDFFF && !option.commentPlus4Caracter) return ""; if ((int)addr>=0xFD00 && (int)addr<=0xFD0F && !option.commentPlus4Acia) return ""; if ((int)addr>=0xFD10 && (int)addr<=0xFD1F && !option.commentPlus4_6529B_1) return ""; if ((int)addr>=0xFD30 && (int)addr<=0xFD3F && !option.commentPlus4_6529B_2) return ""; if ((int)addr>=0xFF00 && (int)addr<=0xFF1F && !option.commentPlus4Ted) return ""; if ((int)addr>=0xFF20 && (int)addr<=0xFFFF && !option.commentPlus4Kernal) return ""; switch (language) { case LANG_ITALIAN: switch ((int)addr) { case 0x00: return "7501 registro di direzione dati su chip"; case 0x01: return "7501 registro di ingresso/uscita a 8 bit su chip"; case 0x02: return "La \"ricerca\" del token cerca (stack di runtime)"; case 0x03: case 0x04: case 0x05: case 0x06: return "Temp (rinumerazione)"; case 0x07: return "Carattere di ricerca"; case 0x08: return "Flag: cerca le virgolette alla fine della stringa"; case 0x09: return "Colonna dello schermo dall'ultimo TAB"; case 0x0A: return "Flag: 0=carica 1=verifica"; case 0x0B: return "Puntatore del buffer di input/n. di sottoscrizioni"; case 0x0C: return "Flag: Dimensione matrice predefinita"; case 0x0D: return "Tipo di dati: $FF=stringa, $00=numerico"; case 0x0E: return "Tipo di dati: $80=numero intero, $00=virgola mobile"; case 0x0F: return "Flag: scansione DATA/quota LIST/garbage collection"; case 0x10: return "Flag: riferimento pedice/funzione utente coll"; case 0x11: return "Flag: $00=INPUT, $43=GET, $98=READ"; case 0x12: return "Contrassegna TAN siqn/risultato del confronto"; case 0x13: return "Flag: prompt INPUT"; case 0x14: case 0x15: return "Temp: valore intero"; case 0x16: return "Puntatore: stack di stringhe temporaneo"; case 0x17: case 0x18: return "Indirizzo dell'ultima stringa temporanea"; case 0x19: case 0x1A: case 0x1B: case 0x1C: case 0x1D: case 0x1E: case 0x1F: case 0x20: case 0x21: return "Stack per stringhe temporanee"; case 0x22: case 0x23: case 0x24: case 0x25: return "Area del puntatore di utilità"; case 0x2B: case 0x2C: return "Puntatore: inizio del testo BASIC"; case 0x2D: case 0x2E: return "Puntatore: inizio delle variabili BASIC"; case 0x2F: case 0x30: return "Puntatore: inizio degli array BASIC"; case 0x31: case 0x32: return "Puntatore: fine degli array BASIC (+1)"; case 0x33: case 0x34: return "Puntatore: fondo della memoria delle stringhe"; case 0x35: case 0x36: return "Puntatore a stringa di utilità"; case 0x37: case 0x38: return "Puntatore: indirizzo più alto utilizzato dal BASIC"; case 0x39: case 0x3A: return "Numero di riga BASIC corrente"; case 0x3F: case 0x40: return "Numero di riga DATI corrente"; case 0x41: case 0x42: return "Puntatore: indirizzo dell'elemento DATI corrente"; case 0x43: case 0x44: return "Vettore: routine INPUT"; case 0x45: case 0x46: return "Nome della variabile BASIC corrente"; case 0x47: case 0x48: return "Puntatore: dati della variabile BASIC corrente"; case 0x49: case 0x4A: return "Puntatore: variabile indice per FOR/NEXT"; case 0x61: return "Accumulatore a virgola mobile n. 1: esponente"; case 0x62: case 0x63: case 0x64: case 0x65: return "Accumulatore a virgola mobile n. 1: mantissa"; case 0x66: return "Accumulatore a virgola mobile n. 1: segno"; case 0x67: return "Puntatore: costante di valutazione della serie"; case 0x68: return "Accumulatore a virgola mobile n. 1: cifra di overflow"; case 0x69: return "Accumulatore a virgola mobile n. 2: esponente"; case 0x6A: case 0x6B: case 0x6C: case 0x6D: return "Accumulatore a virgola mobile n. 2: mantissa"; case 0x6E: return "Accumulatore a virgola mobile n. 2: segno"; case 0x6F: return "Risultato del confronto dei segni: accum. # 1 contro # 2"; case 0x70: return "Accumulatore a virgola mobile n. 1: ordine basso (arrotondamento)"; case 0x71: case 0x72: return "Puntatore: buffer della cassetta"; case 0x73: case 0x74: return "Valore di incremento per auto (0=off)"; case 0x75: return "Contrassegna se vengono assegnate 10.000 assunzioni"; case 0x78: return "Utilizzato come temp Eor carichi indiretti"; case 0x79: case 0x7A: case 0x7B: return "Descrittore per DSS"; case 0x7C: case 0x7D: return "Inizio dello stack del tempo di esecuzione"; case 0x7E: case 0x7F: return "Utilizzato temporaneamente dalla musica (tono e volume)"; case 0x83: return "Modalità grafica corrente"; case 0x84: return "Colore corrente selezionato"; case 0x85: return "Multi colore 1"; case 0x86: return "Colore di primo piano"; case 0x87: return "Numero massimo di colonne"; case 0x88: return "Numero massimo di righe"; case 0x89: return "Impostazione Paint-left"; case 0x8A: return "Impostazione Paint-Right"; case 0x8B: return "Smetti di dipingere se non BG (non dello stesso colore)"; case 0x90: return "Parola di stato I/O del kernel: ST"; case 0x91: return "Flag: tasto STOP/tasto RVS"; case 0x92: return "Temporaneo"; case 0x93: return "Flag: 0=caricamento, 1=verifica"; case 0x94: return "Flag: bus seriale - caratteri di uscita bufferizzati"; case 0x95: return "Carattere bufferizzato per bus seriale"; case 0x96: return "Temporaneo per Basin"; case 0x97: return "Numero di file/indice aperti nella tabella dei file"; case 0x98: return "Dispositivo di input predefinito (0)"; case 0x99: return "Dispositivo di output predefinito (CMD) (3)"; case 0x9A: return "Flag: $80=modalità diretta $00=programma"; case 0x9B: return "Registro errori passaggio 1 nastro"; case 0x9C: return "Registro errori passaggio 2 nastro"; case 0x9F: case 0xA0: case 0xA1: case 0xA2: return "Area dati temporanea"; case 0xA3: case 0xA4: case 0xA5: return "Orologio jiffy in tempo reale (circa) 1/60 sec"; case 0xA6: return "Utilizzo del bus seriale (EOI in uscita)"; case 0xA7: return "Byte da scrivere/leggere su/off nastro"; case 0xA8: return "Temp utilizzato dalla routine seriale"; case 0xAB: return "Lunghezza del nome file corrente"; case 0xAC: return "Numero logico corrente"; case 0xAD: return "Indirizzo secondario attuale"; case 0xAE: return "Numero del dispositivo corrente"; case 0xAF: case 0xB0: return "Puntatore: nome del file corrente"; case 0xB2: case 0xB3: return "Indirizzo iniziale I / O"; case 0xB4: case 0xB5: return "Caricare la base della ram"; case 0xB6: case 0xB7: return "Puntatore base alla base della cassetta"; case 0xBA: case 0xBB: return "Puntatore ai dati per le scritture su nastro"; case 0xBC: case 0xBD: return "Puntatore alla stringa immediata per i primm"; case 0xBE: case 0xBF: return "Puntatore a byte da recuperare in bank fetc"; case 0xC0: case 0xC1: return "Temp per lo scorrimento"; case 0xC2: return "Flag del campo RVS attivato"; case 0xC4: return "Posizione X all'inizio"; case 0xC6: return "Flag: modalità shift per la stampa"; case 0xC7: return "Caso 0xC7: ritorna \"Screen reverse flag\";"; case 0xC8: case 0xC9: return "Puntatore: indirizzo della riga dello schermo corrente"; case 0xCA: return "Colonna del cursore sulla riga corrente"; case 0xCB: return "Flag: editor in modalità quote, $00=no"; case 0xCC: return "Uso temporaneo dell'editor"; case 0xCD: return "Numero di riga fisica corrente del cursore"; case 0xCE: return "Area dati temporanea"; case 0xCF: return "Flag: modalità di inserimento,>0=numero INST"; case 0xE9: return "Tabella dei collegamenti della riga dello schermo /temporaneo dell'editor"; case 0xEA: case 0xEB: return "IP a colori dell'editor dello schermo"; case 0xEC: case 0xED: return "Tabella di scansione chiave indiretta"; case 0xEF: return "Indice alla coda della tastiera"; case 0xF0: return "Impostazione pausa"; case 0xF1: case 0xF2: return "Monitora lo spazio di archiviazione ZP"; case 0xF5: return "Temp per il calcolo del checksum"; case 0xF7: return "Quale passaggio stiamo facendo nella stringa"; case 0xF8: return "Tipo di blocco"; case 0xF9: return "(B.7=1)=> per scrittura, (B.6=1)=> per lettura"; case 0xFA: return "Salva registro X per un test rapido di tasto stop"; case 0xFB: return "Configurazione banca corrente"; case 0xFC: return "Carattere da inviare per una x-on(RS232)"; case 0xFD: return "Carattere da inviare per un x-off (RS232)"; case 0xFE: return "Uso temporaneo dell'editor"; case 0x110: return "Posizioni temporanee per salvataggio/ripristino A"; case 0x111: return "Posizioni temporanee per salvataggio/ripristino Y"; case 0x112: return "Posizioni temporanee per salvataggio/ripristino X"; case 0x25D: return "Contatore loop DOS"; case 0x26F: return "Unità disco DOS 1"; case 0x270: case 0x271: return "Indirizzo nome file DOS 1"; case 0x272: return "Lunghezza del nome file DOS 2"; case 0x273: return "Unità disco DOS 2"; case 0x274: case 0x275: return "Indirizzo nome file DOS 2"; case 0x276: return "Indirizzo logico DOS"; case 0x277: return "Indirizzo fisico DOS"; case 0x278: return "Indirizzo secondario DOS"; case 0x279: case 0x27A: return "Identificatore del disco DOS"; case 0x27B: return "Flag DOS DID"; case 0x27C: return "Buffer della stringa di output DOS"; case 0x2AD: case 0x2AE: return "Posizione x corrente"; case 0x2AF: case 0x2B0: return "Posizione y corrente"; case 0x2B1: case 0x2B2: return "Coordinata X destinazione"; case 0x2B3: case 0x2B4: return "Coordinata Y destinazione"; case 0x2C5: return "Segno di angolo"; case 0x2C6: case 0x2C7: return "Seno del valore dell'angolo"; case 0x2C8: case 0x2C9: return "Coseno del valore dell'angolo"; case 0x2CA: case 0x2CB: return "Temporanei per routine di distanza angolare"; case 0x2CC: return "Segnaposto"; case 0x2CD: return "Puntatore per l'inizio di no."; case 0x2CE: return "Puntatore per la fine di no."; case 0x2CF: return "Segno del dollaro"; case 0x2D0: return "Segno della virgola"; case 0x2D1: return "Contatore"; case 0x2D2: return "Esponente del segno"; case 0x2D3: return "Puntatore all'esponente"; case 0x2D4: return "Numero di cifre prima del punto decimale"; case 0x2D5: return "Giustifica bandiera"; case 0x2D6: return "Numero di posizione prima del punto decimale (campo)"; case 0x2D7: return "Numero di posizione dopo il punto decimale (campo)"; case 0x2D8: return "Segni +/- (campo)"; case 0x2D9: return "Segno esponente (campo)"; case 0x2DA: return "contatore colonna interruttore/caratteri"; case 0x2DB: return "Contatore di caratteri (campo)/contatore di righe di caratteri"; case 0x2DC: return "Segno n."; case 0x2DD: return "Bandiera vuota /a stella"; case 0x2DE: return "Puntatore all'inizio del campo"; case 0x2DF: case 0x2E0: return "Lunghezza del formato"; case 0x2F1: case 0x2F3: return "Puntatore alla routine: converte il virgola mobile in intero"; case 0x2F4: case 0x2F5: return "Puntatore alla routine: converte l'intero in virgola mobile"; case 0x2FE: case 0x2FF: return "Vettore per utenti di cartucce funzionali"; case 0x300: case 0x301: return "Errore indiretto (errore di output in .X)"; case 0x302: case 0x303: return "Principale indiretto (loop diretto di sistema)"; case 0x304: case 0x305: return "Crunch indiretto (routine di tokenizzazione)"; case 0x306: case 0x307: return "Elenco indiretto (elenco caratteri)"; case 0x308: case 0x309: return "Indiretto andato (invio del carattere)"; case 0x30A: case 0x30B: return "Valutazione indiretta (valutazione del simbolo)"; case 0x30C: case 0x30D: return "Escape token crunch"; case 0x314: case 0x315: return "Verrore Ram IRQ"; case 0x316: case 0x317: return "Vettore RAM dell'istruzione BRK"; case 0x318: case 0x319: return "Indiretti per il codice"; case 0x330: case 0x331: return "Savesp"; case 0x3F3: case 0x3F4: return "Lunghezza dei dati da scrivere su nastro"; case 0x3F5: case 0x3F6: return "Lunghezza dei dati da leggere dal nastro"; case 0x4A2: case 0x4A3: case 0x4A4: return "Costante numerica per Basic"; case 0x4E7: return "Stampa utilizzando il simbolo di riempimento [spazio]"; case 0x4E8: return "Stampa utilizzando il simbolo della virgola [;]"; case 0x4E9: return "Stampa utilizzando il simbolo del punto [.]"; case 0x4EA: return "Stampa utilizzando il simbolo monetario [$]"; case 0x4EB: case 0x4EC: case 0x4ED: case 0x4EE: return "Temp per l'istruzione"; case 0x4EF: return "Ultimo numero di errore"; case 0x4F0: case 0x4F1: return "Numero riga dell'ultimo errore"; case 0x4F2: case 0x4F3: return "Linea per andare all'errore"; case 0x4F4: return "Tieni il numero trap temporaneamente"; case 0x4FC: case 0x4FD: return "Tabella dei jiffies in sospeso (complemento a 2)"; case 0x508: return "stato di avvio \"freddo\" o \"caldo\""; case 0x531: case 0x532: return "Inizio della memoria [1000]"; case 0x533: case 0x534: return "Ritorna \\ \"Inizio della memoria [1000]\";"; case 0x535: return "Flag di timeout IEEE"; case 0x536: return "Fine file raggiunta=1, 0 altrimenti"; case 0x537: return "# di caratteri rimasti nel buffer (per R & W)"; case 0x538: return "# di caratteri validi totali nel buffer (R)"; case 0x539: return "Puntatore al carattere successivo nel buffer (per R & W)"; case 0x53A: return "Contiene il tipo di file di classe corrente"; case 0x53B: return "Byte attributo attivo"; case 0x53C: return "Carattere lampeggiante"; case 0x53D: return "Libero"; case 0x53E: return "OC Posizione base dello schermo (in alto) [0C]"; case 0x540: return "Flag di ripetizione dei tasti"; case 0x543: return "Shift flag byte"; case 0x544: return "Schema dell'ultimo pattern"; case 0x545: case 0x546: return "Indiretta per l'impostazione tabella della tastiera"; case 0x547: return "shift, C="; case 0x548: return "Flag di scorrimento automatico verso il basso (0 = attivato, 0 <> disattivato)"; case 0x54B: return "Monitoraggio dell'archiviazione non pagina zero"; case 0x55B: return "Utilizzato da varie routine di monitoraggio"; case 0x55D: return "Utilizzato per tasti programmabili"; case 0x5E7: return "Temp per la scrittura dei dati kennedy"; case 0x5E8: return "Seleziona per leggere o scrivere kennedy"; case 0x5E9: return "numero dispositivo kennedy"; case 0x5EA: return "Rennedy presente = $ ff, altrimenti = $ 00"; case 0x5EB: return "Temp per il tipo di apertura per kennedy"; case 0x5EC: case 0x5ED: case 0x5EE: case 0x5EF: return "Tabella degli indirizzi fisici"; case 0x5F0: case 0x5F1: return "Indirizzo di salto lungo"; case 0x5F2: return "Accumulatore per salto lungo"; case 0x5F3: return "Registro x salto lungo"; case 0x5F4: return "Registro di stato del salto lungo"; case 0x7B0: return "Byte da scrivere su nastro"; case 0x7B1: return "Temp per il calcolo della parità"; case 0x7B2: case 0x7B3: return "Temp per l'header di scrittura"; case 0x5B5: return "Indice locale per la routine READBYTE:"; case 0x5B6: return "Puntatore nello stack degli errori"; case 0x5B7: return "Numero di errori di primo passaggio"; case 0x7BE: return "Marcatore di pila per il recupero della chiave di arresto"; case 0x7BF: return "Marcatore di pila per il recupero della chiave a tendina"; case 0x7C0: case 0x7C1: case 0x7C2: case 0x7C3: return "I parametri sono passati a RDBLOK"; case 0x7C4: return "Salvataggio delle statistiche temporanee per RDBLOK"; case 0x7C5: return "Numero Consec shorts da trovare nell'intestazione"; case 0x7C6: return "Numero errori irreversibili nel conto alla rovescia RD"; case 0x7C7: return "Temp per il comando Verifica"; case 0x7C8: case 0x7C9: case 0x7CA: case 0x7CB: return "Pipe temp per T1"; case 0x7CC: return "Lettura propagazione errore"; case 0x7CD: return "Carattere utente da inviare"; case 0x7CE: return "0=vuoto; 1=pieno"; case 0x7CF: return "Carattere di sistema da inviare"; case 0x7D0: return "0=vuoto; 1=pieno"; case 0x7D1: return "Puntatore all'inizio della coda di input"; case 0x7D2: return "Puntatore in fondo alla coda di input"; case 0x7D3: return "Numero di caratteri nella coda di input"; case 0x7D4: return "Stato temporaneo per ACIA"; case 0x7D5: return "Temp per routine di input"; case 0x7D6: return "FLG per la pausa locale"; case 0x7D7: return "FLG per pausa remota"; case 0x7D8: return "FLG per indicare la presenza di ACIA"; case 0x7E5: return "Parte inferiore dello schermo (0 ... 24)"; case 0x7E6: return "Parte superiore dello schermo"; case 0x7E7: return "Schermo sinistro (0 ... 39)"; case 0x7E8: return "Schermo a destra"; case 0x7E9: return "Negativo = scorrere fuori"; case 0x7EA: return "Modalità di inserimento: FF=on, 00=off"; case 0x7F2: return "Registra per il comando SYS"; case 0x7F6: return "Indice di scansione delle chiavi"; case 0x7F7: return "Flag per disabilitare la pausa CTRL-S"; case 0x7F8: return "MSB per il monitoraggio recupera dalla ROM=0; RAM=1"; case 0x7F9: return "MSB per tabella colori/limite in RAM=0; ROM=1"; case 0x7FA: return "Maschera ROM per schermo diviso"; case 0x7FB: return "Maschera base VM per schermo diviso"; case 0x7FC: return "Semaforo blocco motore per cassetta"; case 0x7FD: return "tod PAL"; case 0xFCF1: case 0xFCF2: case 0xFCF3: return "Routine IRQ da JMP a cartuccia"; case 0xFCF4: case 0xFCF5: case 0xFCF6: return "Routine da JMP a PHOENIX"; case 0xFCF7: case 0xFCF8: case 0xFCF9: return "Routine da JMP a LONG FETCH"; case 0xFCFA: case 0xFCFB: case 0xFCFC: return "Routine da JMP a LONG JUMP"; case 0xFCFD: case 0xFCFE: case 0xFCFF: return "Routine da JMP a LONG IRQ"; case 0xFD00: return "6551 ACIA: porta DATA"; case 0xFD01: return "6551 ACIA: porta STATUS"; case 0xFD02: return "6551 ACIA: porta COMMAND"; case 0xFD03: return "6551 ACIA: porta CONTROL"; case 0xFD04: case 0xFD08: case 0xFD0C: return "6551 ACIA: copia"; case 0xFD10: return "6529B #1: porta utente PIO (P0-P7)"; case 0xFD30: return "6529B #2: tastiera PIO Connettore per matrice di tastiera"; case 0xFF00: return "TED: Timer 1 basso"; case 0xFF01: return "TED: Timer 1 alto"; case 0xFF02: return "TED: Timer 2 basso"; case 0xFF03: return "TED: Timer 2 alto"; case 0xFF04: return "TED: Timer 3 basso"; case 0xFF05: return "TED: Timer 3 alto"; case 0xFF06: return "TED: Test, ECM, BMM, Blank, Rows, Y2, Y1, Y0"; case 0xFF07: return "TED: RVS off PAL, Freeze, MCM, Columns, X2, X1, X0"; case 0xFF08: return "TED: Blocco tastiera"; case 0xFF09: return "TED: Interrupt"; case 0xFF0A: return "TED: Interrupt mask"; case 0xFF0B: return "TED: RC7, RC6, RC5, RC4, RC3, RC2, RC1, RC0"; case 0xFF0C: return "TED: C9, CUR8"; case 0xFF0D: return "TED: CUR7, CUR6, CUR5, CUR4, CUR3, CUR2, CUR1, CUR0"; case 0xFF0E: return "TED: Voce #1 frequenza, bits 0-7"; case 0xFF0F: return "TED: Voce #2 frequenza, bits 0-7"; case 0xFF10: return "TED: Voce #2 frequenza, bits 8 & 9"; case 0xFF11: return "TED: Bits 0-3: controllo volume"; case 0xFF12: return "TED: Bit 0-1 : voce #1 frequenza, bits 8 & 9"; case 0xFF13: return "TED: Bit 0 Stato dell'orologio"; case 0xFF14: return "TED: Bits 3-7 Matrice video/indirizzo base memoria colore"; case 0xFF15: return "TED: Registro dei colori di sfondo"; case 0xFF16: return "TED: Registro dei colori #1"; case 0xFF17: return "TED: Registro dei colori #2"; case 0xFF18: return "TED: Registro dei colori #3"; case 0xFF19: return "TED: Registro dei colori #4"; case 0xFF1A: return "TED: Ricarica bit map alto"; case 0xFF1B: return "TED: Ricarica della bit map basso"; case 0xFF1C: return "TED: Bit 0: Bit di linea verticale 8"; case 0xFF1D: return "TED: Bits 0-7: Bit di linea verticale 0-7"; case 0xFF1E: return "TED: Posizione orizzontale"; case 0xFF1F: return "TED: Lampeggiante, indirizzo secondario verticale"; case 0xFF3E: return "Selettore ROM"; case 0xFF3F: return "Selettore RAM"; case 0xFF49: case 0xFF4A: case 0xFF4B: return "JMP per definire la routine dei tasti funzione"; case 0xFF4C: case 0xFF4D: case 0xFF4E: return "JMP a routine PRINT"; case 0xFF4F: case 0xFF50: case 0xFF51: return "JMP a routine PRIMM"; case 0xFF52: case 0xFF53: case 0xFF54: return "JMP a routine ENTRY"; case 0xFF80: return "Versione del Kernel: (MSB: 0=NTSC ; 1=PAL)"; case 0xFF81: return "Inizializza l'editor dello schermo"; case 0xFF84: return "Inizializza i dispositivi I / O"; case 0xFF87: return "Test Ram"; case 0xFF8A: return "Ripristina i vettori ai valori iniziali"; case 0xFF8D: return "Cambia i vettori per l'utente"; case 0xFF90: return "Controllo messaggi O.S."; case 0xFF93: return "Spedisce SA dopo LISTEN"; case 0xFF96: return "spedisce SA dopo TALK"; case 0xFF99: return "Imposta/leggi la parte superiore della memoria"; case 0xFF9C: return "Imposta/legge la parte inferiore della memoria"; case 0xFF9F: return "Scansiona la tastiera"; case 0xFFA2: return "Imposta il timeout nel disco DMA"; case 0xFFA5: return "Bus seriale di handshake o byte disco DMA in ingresso"; case 0xFFA8: return "Bus seriale handshake o byte disco DMA in uscita"; case 0xFFAB: return "Invia UNTALK dal bus seriale o dal disco DMA"; case 0xFFAE: return "Invia UNLISTEN out bus seriale o disco DMA"; case 0xFFB1: return "Invia UNLISTEN out bus seriale o disco DMA"; case 0xFFB4: return "Invia TALK out bus seriale o disco DMA"; case 0xFFB7: return "Restituisce il byte STATO I/O"; case 0xFFBA: return "Impostare LA, FA, SA"; case 0xFFBD: return "Imposta lunghezza e indirizzo FN"; case 0xFFC0: return "Apri file logico"; case 0xFFC3: return "Chiudi il file logico"; case 0xFFC6: return "Apri canale in"; case 0xFFC9: return "Chiudi canale out"; case 0xFFCC: return "Chiudi canali I/O"; case 0xFFCF: return "Ingresso dal canale"; case 0xFFD2: return "Uscita al canale"; case 0xFFD5: return "Carica da file"; case 0xFFD8: return "Salva su file"; case 0xFFDB: return "Imposta l'orologio interno"; case 0xFFDE: return "Leggi l'orologio interno"; case 0xFFE1: return "Scansione tasto STOP"; case 0xFFE4: return "Ottieni il personaggio dalla coda"; case 0xFFE7: return "Chiudi tutti i file"; case 0xFFEA: return "Incremento dell'orologio"; case 0xFFED: return "Origine dello schermo"; case 0xFFF0: return "Leggi/Imposta le coordinate X, Y del cursore"; case 0xFFF3: return "Restituisce la posizione di inizio dell'I/O"; default: if ((addr>=0xD0) && (addr<=0xD7)) return "Area per l'utilizzo da parte del software vocale"; if ((addr>=0xD8) && (addr<=0xE8)) return "Area ad uso del software applicativo"; if ((addr>=0x113) && (addr<=0x122)) return "Tabella colori/luminanza in RAM"; if ((addr>=0x124) && (addr<=0x1FF)) return "Stack di sistema"; if ((addr>=0x200) && (addr<=0x258)) return "Buffer di input di base/monitor"; if ((addr>=0x259) && (addr<=0x25C)) return "Archiviazione di base"; if ((addr>=0x25E) && (addr<=0x26D)) return "Area per nome file"; if ((addr>=0x27D) && (addr<=0x2AC)) return "Area utilizzata per costruire la stringa DOS"; if ((addr>=0x333) && (addr<=0x3F2)) return "Buffer per cassetta"; if ((addr>=0x3F7) && (addr<=0x436)) return "Coda di input RS-232"; if ((addr>=0x494) && (addr<=0x4A1)) return "Subroutine di recupero della ROM condivisa"; if ((addr>=0x4A5) && (addr<=0x4AF)) return "Txtptr"; if ((addr>=0x4B0) && (addr<=0x4BA)) return "Index & Index1"; if ((addr>=0x4BB) && (addr<=0x4C5)) return "Index2"; if ((addr>=0x4C6) && (addr<=0x4D0)) return "Strng1"; if ((addr>=0x4D1) && (addr<=0x4DB)) return "Lowtr"; if ((addr>=0x4DC) && (addr<=0x4E6)) return "Facmo"; if ((addr>=0x509) && (addr<=0x512)) return "Numeri di file logici"; if ((addr>=0x513) && (addr<=0x51C)) return "Numeri di dispositivo principale"; if ((addr>=0x51D) && (addr<=0x526)) return "Indirizzi secondari"; if ((addr>=0x527) && (addr<=0x530)) return "Buffer della tastiera IRQ"; if ((addr>=0x55F) && (addr<=0x556)) return "Tabella di P.F. lunghezze"; if ((addr>=0x567) && (addr<=0x5E6)) return "P.F. Area di archiviazione delle chiavi"; if ((addr>=0x5F5) && (addr<=0x65D)) return "Aree RAM per il settore bancario"; if ((addr>=0x65E) && (addr<=0x6EB)) return "Area RAM per il parlato"; if ((addr>=0x6EC) && (addr<=0x7AF)) return "Stack di run-time BASIC"; if ((addr>=0x7B8) && (addr<=0x7BD)) return "Costante di tempo"; if ((addr>=0x7D9) && (addr<=0x7E4)) return "Routine indiretta scaricata"; if ((addr>=0x800) && (addr<=0xBFF)) return "Memoria colore (testo)"; if ((addr>=0xC00) && (addr<=0xCFF)) return "Matrice video (testo)"; if ((addr>=0x1000) && (addr<=0x17FF)) return "RAM BASIC (senza grafica)"; if ((addr>=0x1800) && (addr<=0x1BFF)) return "Luminanza per la schermata della mappa di bit"; if ((addr>=0x1C00) && (addr<=0x1FFF)) return "Colore per bit map"; if ((addr>=0x2000) && (addr<=0x3FFF)) return "Dati della schermata grafica"; if ((addr>=0x4000) && (addr<=0x7FFF)) return "BASIC RAM (con grafica)"; if ((addr>=0x8000) && (addr<=0xBFFF)) return "BASIC ROM"; if ((addr>=0xC000) && (addr<=0xCFFF)) return "Espansione BASIC"; if ((addr>=0xD000) && (addr<=0xD7FF)) return "Tabella dei caratteri"; if ((addr>=0xFD00) && (addr<=0xFD0F)) return "6551 ACIA"; if ((addr>=0xFD10) && (addr<=0xFD1F)) return "6529B #1"; if ((addr>=0xFD30) && (addr<=0xFD3F)) return "6529B #2"; } default: switch ((int)addr) { case 0x00: return "7501 on-chip data-direction register"; case 0x01: return "7501 on-chip 8-bit Input/Output register"; case 0x02: return "Token 'search' looks for (run-time stack)"; case 0x03: case 0x04: case 0x05: case 0x06: return "Temp (renumber)"; case 0x07: return "Search character"; case 0x08: return "Flag: scan for quote at end of string"; case 0x09: return "Screen column from last TAB"; case 0x0A: return "Flag: 0=load 1=verify"; case 0x0B: return "Input buffer pointer/No. of subsctipts"; case 0x0C: return "Flag: Default Array DIMension"; case 0x0D: return "Data type: $FF=string, $00=numeric"; case 0x0E: return "Data type: $80=integer, $00=floating"; case 0x0F: return "Flag: DATA scan/LIST quote/garbage coll"; case 0x10: return "Flag: subscript ref/user function coll"; case 0x11: return "Flag: $00=INPUT, $43=GET, $98=READ"; case 0x12: return "Flag TAN siqn/comparison result"; case 0x13: return "Flag: INPUT prompt"; case 0x14: case 0x15: return "Temp: integer value"; case 0x16: return "Pointer: temporary string stack"; case 0x17: case 0x18: return "Last temp string address"; case 0x19: case 0x1A: case 0x1B: case 0x1C: case 0x1D: case 0x1E: case 0x1F: case 0x20: case 0x21: return "Stack for temporary strings"; case 0x22: case 0x23: case 0x24: case 0x25: return "Utility pointer area"; case 0x2B: case 0x2C: return "Pointer: start of BASIC text"; case 0x2D: case 0x2E: return "Pointer: start of BASIC variables"; case 0x2F: case 0x30: return "Pointer: start of BASIC arrays"; case 0x31: case 0x32: return "Pointer: end of BASIC arrays (+1)"; case 0x33: case 0x34: return "Pointer: bottom of string storage"; case 0x35: case 0x36: return "Utility string pointer"; case 0x37: case 0x38: return "Pointer: highest address used by BASIC"; case 0x39: case 0x3A: return "Current BASIC line number"; case 0x3F: case 0x40: return "Current DATA line number"; case 0x41: case 0x42: return "Pointer: Current DATA item address"; case 0x43: case 0x44: return "Vector: INPUT routine"; case 0x45: case 0x46: return "Current BASIC variable name"; case 0x47: case 0x48: return "Pointer: Current BASIC variable data"; case 0x49: case 0x4A: return "Pointer: Index variable for FOR/NEXT"; case 0x61: return "Floating-point accumulator #1: exponent"; case 0x62: case 0x63: case 0x64: case 0x65: return "Floating accum. #1: mantissa"; case 0x66: return "Floating accum. #1: sign"; case 0x67: return "Pointer: series evaluation constant"; case 0x68: return "Floating accum. #1: overflow digit"; case 0x69: return "Floating-point accumulator #2: exponent"; case 0x6A: case 0x6B: case 0x6C: case 0x6D: return "Floating accum. #2: mantissa"; case 0x6E: return "Floating accum. #2: sign"; case 0x6F: return "Sign comparison result: accum. #1 vs #2"; case 0x70: return "Floating accum. #1. low-order (rounding)"; case 0x71: case 0x72: return "Pointer: cassette buffer"; case 0x73: case 0x74: return "Increment value for auto (0=off)"; case 0x75: return "Flag if 10K hires allocated"; case 0x78: return "Used as temp Eor indirect loads"; case 0x79: case 0x7A: case 0x7B: return "Descriptor for DSS"; case 0x7C: case 0x7D: return "Top of run time stack"; case 0x7E: case 0x7F: return "Temps used by music (tone & volume)"; case 0x83: return "Current graphic mode"; case 0x84: return "Current color selected"; case 0x85: return "Multicolor 1"; case 0x86: return "Foreground color"; case 0x87: return "Maximum # of columns"; case 0x88: return "Maximum # of rows"; case 0x89: return "Paint-left flag"; case 0x8A: return "Paint-Right flag"; case 0x8B: return "Stop paint if not BG (Not same Color)"; case 0x90: return "Kernal I/O status word: ST"; case 0x91: return "Flag: STOP key/RVS key"; case 0x92: return "Temp"; case 0x93: return "Flag: 0=load, 1=verify"; case 0x94: return "Flag: serial bus - output char buffered"; case 0x95: return "Buffered character for serial bus"; case 0x96: return "Temp for basin"; case 0x97: return "# of open files/index to file table"; case 0x98: return "Default input device (0)"; case 0x99: return "Default output (CMD) device (3)"; case 0x9A: return "Flag: $80=direct mode $00=program"; case 0x9B: return "Tape pass 1 error log"; case 0x9C: return "Tape pass 2 error log"; case 0x9F: case 0xA0: case 0xA1: case 0xA2: return "Temp data area"; case 0xA3: case 0xA4: case 0xA5: return "Real-time jiffy clock (approx) 1/60 sec"; case 0xA6: return "Serial bus usage (EOI on output)"; case 0xA7: return "Byte to be written/read on/off tape"; case 0xA8: return "Temp used by serial routine"; case 0xAB: return "Length of current file name"; case 0xAC: return "Current logical file number"; case 0xAD: return "Current secondary address"; case 0xAE: return "Current device number"; case 0xAF: case 0xB0: return "Pointer: current file name"; case 0xB2: case 0xB3: return "I/O start address"; case 0xB4: case 0xB5: return "Load ram base"; case 0xB6: case 0xB7: return "Base pointer to cassette base"; case 0xBA: case 0xBB: return "Pointer to data for tape writes"; case 0xBC: case 0xBD: return "Pointer to immediate string for primms"; case 0xBE: case 0xBF: return "Pointer to byte to be fetched in bank fetc"; case 0xC0: case 0xC1: return "Temp for scrolling"; case 0xC2: return "RVS field flag on"; case 0xC4: return "X position at start"; case 0xC6: return "Flag: shift mode for print"; case 0xC7: return "case 0xC7: return \"Screen reverse flag\";"; case 0xC8: case 0xC9: return "Pointer: current screen line address"; case 0xCA: return "Cursor column on current line"; case 0xCB: return "Flag: editor in quote mode, $00=no"; case 0xCC: return "Editor temp use"; case 0xCD: return "Current cursor physical line number"; case 0xCE: return "Temp data area"; case 0xCF: return "Flag: insert mode, >0 = # INSTs"; case 0xE9: return "Screen line link table/editor temps"; case 0xEA: case 0xEB: return "Screen editor color IP"; case 0xEC: case 0xED: return "Key scan table indirect"; case 0xEF: return "Index to keyboard queue"; case 0xF0: return "Pause flag"; case 0xF1: case 0xF2: return "Monitor ZP storage"; case 0xF5: return "Temp for checksum calculation"; case 0xF7: return "Which pass we are doing str"; case 0xF8: return "Type of block"; case 0xF9: return "(B.7 = 1)=> for wr, (B.6 = 1)=> for rd"; case 0xFA: return "Save xreg for quick stopkey test"; case 0xFB: return "Current bank configuration"; case 0xFC: return "Char to send for a x-on (RS232)"; case 0xFD: return "Char to send for a x-off (RS232)"; case 0xFE: return "Editor temporary use"; case 0x110: return "Temp Locations for save/restore A"; case 0x111: return "Temp Locations for save/restore Y"; case 0x112: return "Temp Locations for save/restore X"; case 0x25D: return "DOS loop counter"; case 0x26F: return "DOS disk drive 1"; case 0x270: case 0x271: return "DOS filename 1 addr"; case 0x272: return "DOS filename 2 length"; case 0x273: return "DOS disk drive 2"; case 0x274: case 0x275: return "DOS filename 2 addr"; case 0x276: return "DOS logical address"; case 0x277: return "DOS phys addr"; case 0x278: return "DOS secordary address"; case 0x279: case 0x27A: return "DOS disk identifier"; case 0x27B: return "DOS DID flag"; case 0x27C: return "DOS output string buffer"; case 0x2AD: case 0x2AE: return "Current x position"; case 0x2AF: case 0x2B0: return "Current y position"; case 0x2B1: case 0x2B2: return "X coordinate destination"; case 0x2B3: case 0x2B4: return "Y coordinate destination"; case 0x2C5: return "Sign of angle"; case 0x2C6: case 0x2C7: return "Sine of value of angle"; case 0x2C8: case 0x2C9: return "Cosine of value of angle"; case 0x2CA: case 0x2CB: return "Temps for angle distance routines"; case 0x2CC: return "Placeholder"; case 0x2CD: return "Pointer to begin no."; case 0x2CE: return "Pointer to end no."; case 0x2CF: return "Dollar flag"; case 0x2D0: return "Comma flag"; case 0x2D1: return "Counter"; case 0x2D2: return "Sign exponent"; case 0x2D3: return "Pointer to exponent"; case 0x2D4: return "# of digits before decimal point"; case 0x2D5: return "Justify flag"; case 0x2D6: return "# of pos before decimal point (field)"; case 0x2D7: return "# of pos after decimal point (field)"; case 0x2D8: return "+/- flag (field)"; case 0x2D9: return "Exponent flag (field)"; case 0x2DA: return "Switch/Characters column counter"; case 0x2DB: return "Char counter (field)/Characters row counter"; case 0x2DC: return "Sign no."; case 0x2DD: return "Blank/star flag"; case 0x2DE: return "Pointer to beginning of field"; case 0x2DF: case 0x2E0: return "Length of format"; case 0x2F1: case 0x2F3: return "Ptr to routine: convert float to integer"; case 0x2F4: case 0x2F5: return "Ptr to routine: convert integer to float"; case 0x2FE: case 0x2FF: return "Vector for function cartridge users"; case 0x300: case 0x301: return "Indirect Error (Output Error in .X)"; case 0x302: case 0x303: return "Indirect Main (System Direct Loop)"; case 0x304: case 0x305: return "Indirect Crunch (Tokenization Routine)"; case 0x306: case 0x307: return "Indirect List (Char List)"; case 0x308: case 0x309: return "Indirect Gone (Character Dispatch)"; case 0x30A: case 0x30B: return "Indirect Eval (Symbol Evaluation)"; case 0x30C: case 0x30D: return "Escape token crunch"; case 0x314: case 0x315: return "IRQ Ram Vector"; case 0x316: case 0x317: return "BRK Instr RAM Vector"; case 0x318: case 0x319: return "Indirects for Code"; case 0x330: case 0x331: return "Savesp"; case 0x3F3: case 0x3F4: return "Length of data to be written to tape"; case 0x3F5: case 0x3F6: return "Length of data to be read from tape"; case 0x4A2: case 0x4A3: case 0x4A4: return "Numeric constant for Basic"; case 0x4E7: return "Print using fill symbol [space]"; case 0x4E8: return "Print using comma symbol [;]"; case 0x4E9: return "Print using D.P. symbol [.]"; case 0x4EA: return "Print using monetary symbol [$]"; case 0x4EB: case 0x4EC: case 0x4ED: case 0x4EE: return "Temp for instr"; case 0x4EF: return "Last error number"; case 0x4F0: case 0x4F1: return "Line # of last error"; case 0x4F2: case 0x4F3: return "Line to go on error"; case 0x4F4: return "Hold trap no. temporarily"; case 0x4FC: case 0x4FD: return "Table of pending jiffies (2's comp)"; case 0x508: return "'cold' or 'warm' start status"; case 0x531: case 0x532: return "Start of memory [1000]"; case 0x533: case 0x534: return "return \"Start of memory [1000]\";"; case 0x535: return "IEEE timeout flag"; case 0x536: return "File end reached = 1, 0 otherwise"; case 0x537: return "# of chars left in buffer (for R & W)"; case 0x538: return "# of total valid chars in buffer (R)"; case 0x539: return "Ptr to next char in buffer (for R & W)"; case 0x53A: return "Contains type of current cass file"; case 0x53B: return "Active attribute byte"; case 0x53C: return "Character flash flag"; case 0x53D: return "Free"; case 0x53E: return "OC Base location of screen (top) [0C]"; case 0x540: return "Key repeat flag"; case 0x543: return "Shift flag byte"; case 0x544: return "Last shift pattern"; case 0x545: case 0x546: return "Indirect for keyboard table setup"; case 0x547: return "shift, C="; case 0x548: return "Auto scroll down flag (0=on,0<>off)"; case 0x54B: return "Monitor non-zpage storage"; case 0x55B: return "Used by various monitor routines"; case 0x55D: return "Used for programmable keys"; case 0x5E7: return "Temp for data write to kennedy"; case 0x5E8: return "Select for kennedy read or write"; case 0x5E9: return "Kennedy's dev #"; case 0x5EA: return "Rennedy present = $ff, else = $00"; case 0x5EB: return "Temp for type of open for kennedy"; case 0x5EC: case 0x5ED: case 0x5EE: case 0x5EF: return "Physical Address Table"; case 0x5F0: case 0x5F1: return "Long jump address"; case 0x5F2: return "Long jump accumulator"; case 0x5F3: return "Long jump x register"; case 0x5F4: return "Long jump status register"; case 0x7B0: return "Byte to be written on tape"; case 0x7B1: return "Temp for parity calc"; case 0x7B2: case 0x7B3: return "Temp for write-header"; case 0x5B5: return "Local index for READBYTE routine: "; case 0x5B6: return "Pointer into the error stack"; case 0x5B7: return "Number of first pass errors"; case 0x7BE: return "Stack marker for stopkey recover"; case 0x7BF: return "Stack marker for dropkey recover"; case 0x7C0: case 0x7C1: case 0x7C2: case 0x7C3: return "Params passed to RDBLOK"; case 0x7C4: return "Temp stat save for RDBLOK"; case 0x7C5: return "# consec shorts to find in header"; case 0x7C6: return "# Errors fatal in RD countdown"; case 0x7C7: return "Temp for Verify command"; case 0x7C8: case 0x7C9: case 0x7CA: case 0x7CB: return "Pipe temp for T1"; case 0x7CC: return "Read error propagate"; case 0x7CD: return "User chracter to send"; case 0x7CE: return "0 = empty ; 1 = full"; case 0x7CF: return "System character to send"; case 0x7D0: return "0 = empty ; 1 = full"; case 0x7D1: return "Pntr to front of input queue"; case 0x7D2: return "Pntr to rear of input queue"; case 0x7D3: return "# of chars in input queue"; case 0x7D4: return "Temp status for ACIA"; case 0x7D5: return "Temp for input routine"; case 0x7D6: return "FLG for local pause"; case 0x7D7: return "FLG for remote pause"; case 0x7D8: return "FLG to indicate presence of ACIA"; case 0x7E5: return "Screen bottom (0...24)"; case 0x7E6: return "Screen top"; case 0x7E7: return "Screen left (0...39)"; case 0x7E8: return "Screen right"; case 0x7E9: return "Negative = scroll out"; case 0x7EA: return "Insert mode: FF = on, 00 = off"; case 0x7F2: return "Registers for SYS command"; case 0x7F6: return "Key scan index"; case 0x7F7: return "Flag to disable CTRL-S pause"; case 0x7F8: return "MSB for monitor fetches from ROM=0;RAM=1"; case 0x7F9: return "MSB for color/lim table in RAM=0;ROM=1"; case 0x7FA: return "ROM mask for split screen"; case 0x7FB: return "VM base mask for split screen"; case 0x7FC: return "Motor lock semaphore for cassette"; case 0x7FD: return "PAL tod"; case 0xFCF1: case 0xFCF2: case 0xFCF3: return "JMP to cartridge IRQ routine"; case 0xFCF4: case 0xFCF5: case 0xFCF6: return "JMP to PHOENIX routine"; case 0xFCF7: case 0xFCF8: case 0xFCF9: return "JMP to LONG FETCH routine"; case 0xFCFA: case 0xFCFB: case 0xFCFC: return "JMP to LONG JUMP routine"; case 0xFCFD: case 0xFCFE: case 0xFCFF: return "JMP to LONG IRQ routine"; case 0xFD00: return "6551 ACIA: DATA port"; case 0xFD01: return "6551 ACIA: STATUS port"; case 0xFD02: return "6551 ACIA: COMMAND port"; case 0xFD03: return "6551 ACIA: CONTROL port"; case 0xFD04: case 0xFD08: case 0xFD0C: return "6551 ACIA: copy"; case 0xFD10: return "6529B #1: User Port PIO (P0-P7)"; case 0xFD30: return "6529B #2: Keyboard PIO Keyboard Matrix Connector"; case 0xFF00: return "TED: Timer 1 low"; case 0xFF01: return "TED: Timer 1 high"; case 0xFF02: return "TED: Timer 2 low"; case 0xFF03: return "TED: Timer 2 high"; case 0xFF04: return "TED: Timer 3 low"; case 0xFF05: return "TED: Timer 3 high"; case 0xFF06: return "TED: Test, ECM, BMM, Blank, Rows, Y2, Y1, Y0"; case 0xFF07: return "TED: RVS off PAL, Freeze, MCM, Columns, X2, X1, X0"; case 0xFF08: return "TED: Keyboard Latch"; case 0xFF09: return "TED: Interrupt"; case 0xFF0A: return "TED: Interrupt mask"; case 0xFF0B: return "TED: RC7, RC6, RC5, RC4, RC3, RC2, RC1, RC0"; case 0xFF0C: return "TED: C9, CUR8"; case 0xFF0D: return "TED: CUR7, CUR6, CUR5, CUR4, CUR3, CUR2, CUR1, CUR0"; case 0xFF0E: return "TED: Voice #1 frequency, bits 0-7"; case 0xFF0F: return "TED: Voice #2 frequency, bits 0-7"; case 0xFF10: return "TED: Voice #2 frequency, bits 8 & 9"; case 0xFF11: return "TED: Bits 0-3 : Volume control"; case 0xFF12: return "TED: Bit 0-1 : Voice #1 frequency, bits 8 & 9"; case 0xFF13: return "TED: Bit 0 Clock status"; case 0xFF14: return "TED: Bits 3-7 Video matrix/color memory base address"; case 0xFF15: return "TED: Background color register"; case 0xFF16: return "TED: Color register #1"; case 0xFF17: return "TED: Color register #2"; case 0xFF18: return "TED: Color registes #3"; case 0xFF19: return "TED: Color registes #4"; case 0xFF1A: return "TED: Bit map reload high"; case 0xFF1B: return "TED: Bit map reload low"; case 0xFF1C: return "TED: Bit 0 : Vertical line bit 8"; case 0xFF1D: return "TED: Bits 0-7 : Vertical line bits 0-7"; case 0xFF1E: return "TED: Horizontal position"; case 0xFF1F: return "TED: Blink, vertical sub address"; case 0xFF3E: return "ROM select"; case 0xFF3F: return "RAM select"; case 0xFF49: case 0xFF4A: case 0xFF4B: return "JMP to define function key routine"; case 0xFF4C: case 0xFF4D: case 0xFF4E: return "JMP to PRINT routine"; case 0xFF4F: case 0xFF50: case 0xFF51: return "JMP to PRIMM routine"; case 0xFF52: case 0xFF53: case 0xFF54: return "JMP to ENTRY routine"; case 0xFF80: return "Release of Kernel: (MSB: 0=NTSC ; 1=PAL)"; case 0xFF81: return "Initialize screen editor"; case 0xFF84: return "Initialize I/O devices"; case 0xFF87: return "Ram test"; case 0xFF8A: return "Restore vectors to initial values"; case 0xFF8D: return "Change vectors for user"; case 0xFF90: return "Control O.S. messages"; case 0xFF93: return "Send SA after LISTEN"; case 0xFF96: return "Send SA after TALK"; case 0xFF99: return "Set/Read top of memory"; case 0xFF9C: return "Set/Read bottom of memory"; case 0xFF9F: return "Scan keyboard"; case 0xFFA2: return "Set timeout in DMA disk"; case 0xFFA5: return "Handshake serial bus or DMA disk byte in"; case 0xFFA8: return "Handshake serial bus or DMA disk byte out"; case 0xFFAB: return "Send UNTALK out serial bus or DMA disk"; case 0xFFAE: return "Send UNLISTEN out serial bus or DMA disk"; case 0xFFB1: return "Send LISTEN out serial bus or DMA disk"; case 0xFFB4: return "Send TALK out serial bus or DMA disk"; case 0xFFB7: return "Return I/O STATUS byte"; case 0xFFBA: return "Set LA, FA, SA"; case 0xFFBD: return "Set length and FN address"; case 0xFFC0: return "Open logical file"; case 0xFFC3: return "Close logical file"; case 0xFFC6: return "Open channel in"; case 0xFFC9: return "open channel out"; case 0xFFCC: return "Close I/O channels"; case 0xFFCF: return "Input from channel"; case 0xFFD2: return "output to channel"; case 0xFFD5: return "Load from file"; case 0xFFD8: return "Save to file"; case 0xFFDB: return "Set internal clock"; case 0xFFDE: return "Read internal clock"; case 0xFFE1: return "Scan STOP key"; case 0xFFE4: return "Get character from queue"; case 0xFFE7: return "Close all files"; case 0xFFEA: return "Increment clock"; case 0xFFED: return "Screen org."; case 0xFFF0: return "Read/Set X,Y coord of cursor"; case 0xFFF3: return "Return location of start of I/O"; default: if ((addr>=0xD0) && (addr<=0xD7)) return "Area for use by speech software"; if ((addr>=0xD8) && (addr<=0xE8)) return "Area for use by application software"; if ((addr>=0x113) && (addr<=0x122)) return "Color/luminance table in RAM"; if ((addr>=0x124) && (addr<=0x1FF)) return "System stack"; if ((addr>=0x200) && (addr<=0x258)) return "Basic/monitor input buffer"; if ((addr>=0x259) && (addr<=0x25C)) return "Basic storage"; if ((addr>=0x25E) && (addr<=0x26D)) return "Area for filename"; if ((addr>=0x27D) && (addr<=0x2AC)) return "Area used to build DOS string"; if ((addr>=0x333) && (addr<=0x3F2)) return "Cassette tape buffer"; if ((addr>=0x3F7) && (addr<=0x436)) return "RS-232 input queue"; if ((addr>=0x494) && (addr<=0x4A1)) return "Shared ROM fetch sub"; if ((addr>=0x4A5) && (addr<=0x4AF)) return "Txtptr"; if ((addr>=0x4B0) && (addr<=0x4BA)) return "Index & Index1"; if ((addr>=0x4BB) && (addr<=0x4C5)) return "Index2"; if ((addr>=0x4C6) && (addr<=0x4D0)) return "Strng1"; if ((addr>=0x4D1) && (addr<=0x4DB)) return "Lowtr"; if ((addr>=0x4DC) && (addr<=0x4E6)) return "Facmo"; if ((addr>=0x509) && (addr<=0x512)) return "Logical file numbers"; if ((addr>=0x513) && (addr<=0x51C)) return "Primary device numbers"; if ((addr>=0x51D) && (addr<=0x526)) return "Secondary addresses"; if ((addr>=0x527) && (addr<=0x530)) return "IRQ keyboard buffer"; if ((addr>=0x55F) && (addr<=0x556)) return "Table of P.F. lengths"; if ((addr>=0x567) && (addr<=0x5E6)) return "P.F. Key storage area"; if ((addr>=0x5F5) && (addr<=0x65D)) return "RAM areas for banking"; if ((addr>=0x65E) && (addr<=0x6EB)) return "RAM area for speech"; if ((addr>=0x6EC) && (addr<=0x7AF)) return "BASIC run-time stack"; if ((addr>=0x7B8) && (addr<=0x7BD)) return "Time constant"; if ((addr>=0x7D9) && (addr<=0x7E4)) return "Indirect routine downloaded"; if ((addr>=0x800) && (addr<=0xBFF)) return "Color memory (Text)"; if ((addr>=0xC00) && (addr<=0xCFF)) return "Video matrix (Text)"; if ((addr>=0x1000) && (addr<=0x17FF)) return "BASIC RAM (without graphics)"; if ((addr>=0x1800) && (addr<=0x1BFF)) return "Luminance for bit map screen"; if ((addr>=0x1C00) && (addr<=0x1FFF)) return "Color for bit map"; if ((addr>=0x2000) && (addr<=0x3FFF)) return "Graphics screen data"; if ((addr>=0x4000) && (addr<=0x7FFF)) return "BASIC RAM (with graphics)"; if ((addr>=0x8000) && (addr<=0xBFFF)) return "BASIC ROM"; if ((addr>=0xC000) && (addr<=0xCFFF)) return "BASIC Expansion"; if ((addr>=0xD000) && (addr<=0xD7FF)) return "Character table"; if ((addr>=0xFD00) && (addr<=0xFD0F)) return "6551 ACIA"; if ((addr>=0xFD10) && (addr<=0xFD1F)) return "6529B #1"; if ((addr>=0xFD30) && (addr<=0xFD3F)) return "6529B #2"; } } } return super.dcom(iType, aType, addr, value); } }
65,585
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
AtariDasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/machine/AtariDasm.java
/** * @(#)AtariDasm.java 2022/12/08 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.machine; import sw_emulator.software.cpu.M6510Dasm; /** * Comment the memory location of Atari for the disassembler * It performs also a multy language comments. * * @author ice */ public class AtariDasm extends M6510Dasm { // Available language public static final byte LANG_ENGLISH=1; public static final byte LANG_ITALIAN=2; /** * Return a comment string for the passed instruction * * @param iType the type of instruction * @param aType the type of addressing used by the instruction * @param addr the address value (if needed by this istruction type) * @param value the operation value (if needed by this instruction) * @return a comment string */ @Override public String dcom(int iType, int aType, long addr, long value) { byte language=option.commentLanguage; switch (aType) { case A_ZPG: case A_ZPX: case A_ZPY: case A_ABS: case A_ABX: case A_ABY: case A_REL: case A_IND: case A_IDX: case A_IDY: // do not get comment if appropriate option is not selected if ((int)addr<=0xFF && !option.commentAtariZeroPage) return ""; if ((int)addr>=0x100 && (int)addr<=0x1FF && !option.commentAtariStackArea) return ""; if ((int)addr>=0x200 && (int)addr<=0x2FF && !option.commentAtari_200Area) return ""; if ((int)addr>=0x300 && (int)addr<=0x3FF && !option.commentAtari_300Area) return ""; if ((int)addr>=0x400 && (int)addr<=0x4FF && !option.commentAtari_400Area) return ""; if ((int)addr>=0x500 && (int)addr<=0x5FF && !option.commentAtari_500Area) return ""; if ((int)addr>=0x8000 && (int)addr<=0x9FFF && !option.commentAtariCartridgeB) return ""; if ((int)addr>=0xA000 && (int)addr<=0xBFFF && !option.commentAtariCartridgeA) return ""; if ((int)addr>=0xD000 && (int)addr<=0xD0FF && !option.commentAtariGtia) return ""; if ((int)addr>=0xD200 && (int)addr<=0xD2FF && !option.commentAtariPokey) return ""; if ((int)addr>=0xD300 && (int)addr<=0xD3FF && !option.commentAtariPia) return ""; if ((int)addr>=0xD400 && (int)addr<=0xD4FF && !option.commentAtariAntic) return ""; if ((int)addr>=0xD800 && (int)addr<=0xFFFF && !option.commentAtariKernalRom) return ""; switch (language) { case LANG_ITALIAN: switch ((int)addr) { case 0x0000: case 0x0001: return "Timer VBLANK"; case 0x0002: case 0x0003: return "Vettore inizializzazione cassetta"; case 0x0004: case 0x0005: return "Puntatore RAM per il test della memoria all'avvio"; case 0x0006: return "Registro temporaneo per dimensione RAM"; case 0x0007: return "Registro dati per test RAM"; case 0x0008: return "Flag partenza a caldo"; case 0x0009: return "Indicatore successo avvio"; case 0x000A: case 0x000B: return "Vettore partenza per programmi disco (o non cartuccia)"; case 0x000C: case 0x000D: return "Indirizzo inizializzazione per avvio da disco"; case 0x000E: case 0x000F: return "Limite memoria alto per applicazioni e puntatore alla fine del programma BASIC"; case 0x0010: return "Interruzioni POKEY"; case 0x0011: return "Zero significa tasto BREAK premuto"; case 0x0012: case 0x0013: case 0x0014: return "Orologio interno in tempo reale"; case 0x0015: case 0x0016: return "Registro indirizzo buffer indiretto"; case 0x0017: return "Commando per vettore CIO"; case 0x0018: case 0x0019: return "Puntatore gestore file su disco"; case 0x001A: case 0x001B: return "Puntatore utilità per disco"; case 0x001C: return "Timeout stampante"; case 0x001D: return "Puntatore buffer stampante"; case 0x001E: return "Dimensione buffer di stampa per un record del modo corrente"; case 0x001F: return "Registro temporaneo usanto dal gestore stampante"; case 0x0020: return "Numero indice gestore"; case 0x0021: return "Numero dispositivo o numero disco"; case 0x0022: return "Codice commando settato dall'utente"; case 0x0023: return "Stato dell'ultima azione IOCB ritornata dal dispositivo"; case 0x0024: case 0x0025: return "Indirizzo buffer per trasferimento dati o indirizzo del nome file"; case 0x0026: case 0x0027: return "Inserisce indirizzo byte della procedura settata dal sistema operativo"; case 0x0028: case 0x0029: return "Contatore lunghezza buffer usato dalle operazioni PUT e GET"; case 0x002A: return "Primo byte informazione ausiliaria"; case 0x002B: return "Variabili lavoro CIO"; case 0x002C: case 0x002D: return "Usato dai commandi BASIC NOTE e POINT per il trasferimento numeri settore del disco"; case 0x002E: return "Il byte che sta vedendo letto nel settore"; case 0x002F: return "Byte di riserva"; case 0x0030: return "Memoria interna dello stato"; case 0x0031: return "Checksum del frame di dati utilizzato da SIO"; case 0x0032: case 0x0033: return "Puntatore al buffer di dati"; case 0x0034: case 0x0035: return "Byte successivo dopo la fine del buffer di dati SIO e DCB"; case 0x0036: return "Numero di tentativi di frame di comando"; case 0x0037: return "Numero di tentativi del dispositivo"; case 0x0038: return "Flag di buffer dati pieno"; case 0x0039: return "Flag di completamento per ricevi"; case 0x003A: return "Flag di completamento per trasmetti"; case 0x003B: return "Contrassegno checksum inviato"; case 0x003C: return "Flag per no checksum dopo i dati"; case 0x003D: return "Puntatore buffer cassetta"; case 0x003E: return "Tipo di gap inter-record tra i record della cassetta"; case 0x003F: return "Flag per fine file in cassetta"; case 0x0040: return "Registro contenente numero segfnali acustici"; case 0x0041: return "Flag di I/O rumore utilizzato da SIO per segnalare il segnale acustico udito durante l'I/O del disco e della cassetta"; case 0x0042: return "Flag di regione di I/O critico"; case 0x0043: case 0x0044: return "Puntatore del buffer della pagina zero al nome file dell'utente per l'I/O del disco"; case 0x0045: case 0x0046: return "Page zero drive pointer"; case 0x0047: case 0x0048: return "Puntatore unità pagina zero"; case 0x0049: return "Numero di errore di I/O del disco"; case 0x004A: return "Flag di richiesta di avvio della cassetta all'avvio a freddo"; case 0x004B: return "Flag di avvio della cassetta"; case 0x004C: return "Stato del display e registro della tastiera utilizzati dal gestore del display"; case 0x004D: return "Timer e flag della modalità di attrazione"; case 0x004E: return "Maschera di attrazione oscura"; case 0x004F: return "Maschera di cambiamento di colore"; case 0x0050: case 0x0051: return "Registro temporaneo utilizzato dal gestore del display per spostare i dati da e verso lo schermo"; case 0x0052: return "Colonna del margine sinistro del testo"; case 0x0053: return "Margine destro della schermata di testo inizializzato a 39 ($ 27)"; case 0x0054: return "Grafica corrente o riga del cursore dello schermo di testo"; case 0x0055: case 0x0056: return "Grafica corrente o colonna del cursore in modalità testo"; case 0x0057: return "Modalità di visualizzazione/modalità schermo corrente"; case 0x0058: case 0x0059: return "L'indirizzo più basso della memoria dello schermo, corrispondente all'angolo in alto a sinistra dello schermo\""; case 0x005A: return "Riga del cursore grafica precedente"; case 0x005B: case 0x005C: return "Colonna del cursore grafica precedente"; case 0x005D: return "Mantiene il valore del carattere sotto il cursore"; case 0x005E: case 0x005F: return "Mantiene la posizione di memoria della posizione corrente del cursore"; case 0x0060: return "Punto (riga) a cui andranno DRAWTO e XIO 18 (FILL)"; case 0x0061: case 0x0062: return "Punto (colonna) a cui andranno DRAWTO e XIO 18 (FILL)"; case 0x0063: return "Posizione del cursore sulla colonna in una riga logica"; case 0x0064: case 0x0065: return "Archiviazione temporanea utilizzata dal gestore di visualizzazione per l'indirizzo dell'elenco di visualizzazione"; case 0x0066: case 0x0067: return "Stoccaggio temporaneo per open e display handler"; case 0x0068: case 0x0069: return "Archiviazione temporanea per i dati sotto il cursore e la linea in movimento sullo schermo"; case 0x006A: return "Dimensione RAM"; case 0x006B: return "Conteggio buffer"; case 0x006C: case 0x006D: return "Byte basso dell'editor (AM)"; case 0x006E: return "Maschera di bit utilizzata nelle routine di mappatura dei bit dal gestore di visualizzazione del sistema operativo"; case 0x006F: return "Giustificazione dei pixel"; case 0x0070: return "Accumulatore di righe"; case 0x0071: return "Accumulatore di colonna"; case 0x0072: case 0x0073: return "Controlla il tracciato dei punti di colonna"; case 0x0074: case 0x0075: return "Punto finale della linea da tracciare"; case 0x0076: return "Riga delta"; case 0x0077: case 0x0078: return "Colonna delta"; case 0x0079: return "Il valore di incremento o decremento della riga"; case 0x007A: return "Il valore di incremento o decremento della colonna"; case 0x007B: return "Controllo del cursore a schermo diviso"; case 0x007C: return "Mantieni il carattere prima del controllo e la logica di spostamento"; case 0x007D: return "Byte di archiviazione temporaneo utilizzato dal gestore di visualizzazione per il carattere sotto il cursore e il rilevamento di fine riga"; case 0x007E: case 0x007F: return "Numero di iterazioni necessarie per tracciare una linea"; case 0x0080: case 0x0081: return "Puntatore alla memoria insufficiente del BASIC"; case 0x0082: case 0x0083: return "Indirizzo iniziale della tabella dei nomi delle variabili"; case 0x0084: case 0x0085: return "Puntatore all'indirizzo finale della tabella dei nomi delle variabili più un byte"; case 0x0086: case 0x0087: return "Indirizzo per la tabella dei valori delle variabili"; case 0x0088: case 0x0089: return "L'indirizzo della tabella delle istruzioni"; case 0x008A: case 0x008B: return "Puntatore all'istruzione BASIC corrente"; case 0x008C: case 0x008D: return "L'indirizzo per la tabella delle stringhe e degli array e un puntatore alla fine del programma BASIC"; case 0x008E: case 0x008F: return "Indirizzo dello stack di runtime"; case 0x0090: case 0x0091: return "Puntatore all'inizio della memoria BASIC"; case 0x00BA: case 0x00BB: return "La riga in cui è stato interrotto un programma"; case 0x00C3: return "Il numero del codice di errore che ha causato l'arresto o il TRAP"; case 0x00C9: return "Il numero di colonne tra i punti TAB"; case 0x00D2: case 0x00D3: return "Riservato al BASIC o ad altri usi della cartuccia"; case 0x00D4: case 0x00D5: case 0x00D6: case 0x00D7: case 0x00D8: case 0x00D9: return "Registro in virgola mobile zero"; case 0x00DA: case 0x00DB: case 0x00DC: case 0x00DD: case 0x00DE: case 0x00DF: return "Registro extra in virgola mobile"; case 0x00E0: case 0x00E1: case 0x00E2: case 0x00E3: case 0x00E4: case 0x00E5: return "Registro in virgola mobile uno"; case 0x00E6: case 0x00E7: case 0x00E8: case 0x00E9: case 0x00EA: case 0x00EB: return "Registro in virgola mobile due"; case 0x00EC: return "Registro di riserva in virgola mobile"; case 0x00ED: return "Il valore di E (l'esponente)"; case 0x00EE: return "Il segno del numero in virgola mobile"; case 0x00EF: return "Il segno dell'esponente"; case 0x00F0: return "Il primo indicatore di caratteri"; case 0x00F1: return "Il numero di cifre a destra del decimale"; case 0x00F2: return "Indice carattere (input corrente)"; case 0x00F3: case 0x00F4: return "Immettere il puntatore del buffer di testo ASCII"; case 0x00F5: case 0x00F6: case 0x00F7: case 0x00F8: case 0x00F9: case 0x00FA: return "Registro provvisorio"; case 0x00FB: return "Flag radianti/gradi"; case 0x00FC: case 0x00FD: return "Punta al numero in virgola mobile dell'utente"; case 0x00FE: case 0x00FF: return "Puntatore al secondo numero in virgola mobile dell'utente"; case 0x0200: case 0x0201: return "Vettore per NMI Display List Interrupts (DLI)"; case 0x0202: case 0x0203: return "Vettore di linea procedente seriale (periferico)"; case 0x0204: case 0x0205: return "Vettore di interrupt seriale (periferico)"; case 0x0206: case 0x0207: return "Vettore di istruzioni di interruzione del software per il 6502 BRK"; case 0x0208: case 0x0209: return "Vettore di interruzione della tastiera POKEY"; case 0x020A: case 0x020B: return "Il bus I/O seriale POKEY riceve il vettore di interrupt pronto per i dati"; case 0x020C: case 0x020D: return "I/O seriale POKEY trasmette il vettore di interrupt pronto"; case 0x020E: case 0x020F: return "Il bus seriale POKEY trasmette un vettore di interrupt completo"; case 0x0210: case 0x0211: return "POKEY timer 1 vettore di interruzione"; case 0x0212: case 0x0213: return "POKEY timer 2 vettori per AUDF2"; case 0x0214: case 0x0215: return "POKEY timer 4 vettori per AUDF4"; case 0x0216: case 0x0217: return "Il vettore immediato IRQ (generale)"; case 0x0218: case 0x0219: return "Timer sistema 1"; case 0x021A: case 0x021B: return "Timer sistema 2"; case 0x021C: case 0x021D: return "Timer sistema 3"; case 0x021E: case 0x021F: return "Timer sistema 4"; case 0x0220: case 0x0221: return "Timer sistema 5"; case 0x0222: case 0x0223: return "VBLANK registro immediato"; case 0x0224: case 0x0225: return "Registro differito VBLANK"; case 0x0226: case 0x0227: return "Timer di sistema 1 indirizzo di salto"; case 0x0228: case 0x0229: return "Timer di sistema 2 indirizzo di salto"; case 0x022A: return "Timer di sistema flag 3"; case 0x022B: return "Timer di ripetizione software, controllato dalla routine del dispositivo IRQ"; case 0x022C: return "Timer di sistema flag 4"; case 0x022D: return "Registro temporaneo utilizzato dal SETVBL"; case 0x022E: return "Timer di sistema flag 5"; case 0x022F: return "Abilita l'accesso diretto alla memoria (DMA)"; case 0x0230: case 0x0231: return "Indirizzo iniziale dell'elenco di visualizzazione"; case 0x0232: return "Registro di controllo della porta seriale"; case 0x0233: return "Byte di riserva (nessun utilizzo del sistema operativo)"; case 0x0234: return "Valore orizzontale penna ottica: ombra per 54284 ($D40C)"; case 0x0235: return "Valore verticale penna ottica: ombra per 54285 ($D40D)"; case 0x0236: case 0x0237: return "Vettore di interruzione del tasto BREAK"; case 0x0238: case 0x0239: return "Byte di riserva"; case 0x023A: return "Indirizzo CFB (Command Frame Buffer) a quattro byte per un dispositivo"; case 0x023B: return "Il codice di comando del bus SIO"; case 0x023C: return "Comando byte ausiliario uno"; case 0x023D: return "Comando byte ausiliario due"; case 0x023E: return "Registro RAM temporaneo per SIO"; case 0x023F: return "Indicatore di errore SIO"; case 0x0240: return "Flag del disco letti dal primo byte del file di avvio (settore uno) del disco"; case 0x0241: return "Il numero di settori di avvio del disco letti dal primo record del disco"; case 0x0242: case 0x0243: return "L'indirizzo in cui verrà inserito il caricatore di avvio del disco"; case 0x0244: return "Flag partenza a freddo"; case 0x0245: return "Byte di riserva"; case 0x0246: return "Registro del timeout del disco"; case 0x026F: return "Registro di selezione prioritaria, shadow per 53275 ($D01B)"; case 0x0270: return "Il valore del joystick paddle 0"; case 0x0271: return "Il valore del joystick paddle 1"; case 0x0272: return "Il valore del joystick paddle 2"; case 0x0273: return "Il valore del joystick paddle 3"; case 0x0274: return "Il valore del joystick paddle 4"; case 0x0275: return "Il valore del joystick paddle 5"; case 0x0276: return "Il valore del joystick paddle 6"; case 0x0277: return "Il valore del joystick paddle 7"; case 0x0278: return "Il valore del joystick 0"; case 0x0279: return "Il valore del joystick 1"; case 0x027A: return "Il valore del joystick 2"; case 0x027B: return "Il valore del joystick 3"; case 0x027C: return "Paddle trigger 0"; case 0x027D: return "Paddle trigger 1"; case 0x027E: return "Paddle trigger 2"; case 0x027F: return "Paddle trigger 3"; case 0x0280: return "Paddle trigger 4"; case 0x0281: return "Paddle trigger 5"; case 0x0282: return "Paddle trigger 6"; case 0x0283: return "Paddle trigger 7"; case 0x0284: return "Stick trigger 0"; case 0x0285: return "Stick trigger 1"; case 0x0286: return "Stick trigger 2"; case 0x0287: return "Stick trigger 3"; case 0x0288: return "Registro di stato della cassetta"; case 0x0289: return "Memorizza la modalità di lettura o scrittura per il gestore di cassette"; case 0x028A: return "Dimensioni del buffer del record di dati della cassetta"; case 0x028B: case 0x028C: case 0x028D: case 0x028E: case 0x028F: return "Byte di riserva"; case 0x0290: return "Riga del cursore della finestra di testo"; case 0x0291: case 0x0292: return "Colonna del cursore della finestra di testo"; case 0x0293: return "Modo GRAPHICS per la finestra di testo nel split-screen corrente"; case 0x0294: case 0x0295: return "Indirizzo dell'angolo in alto a sinistra della finestra di testo"; case 0x0296: return "Split-screen: riga del cursore grafica precedente"; case 0x0297: case 0x0298: return "Split-screen: colonna del cursore grafica precedente"; case 0x0299: return "Split-screen: mantiene il valore del carattere sotto il cursore"; case 0x029A: case 0x029B: return "Split-screen: conserva la posizione di memoria della posizione corrente del cursore"; case 0x029C: return "Registro temporaneo (gestore di visualizzazione)"; case 0x029D: case 0x029E: case 0x029F: return "Registro provvisorio"; case 0x02A0: return "Maschera di posizione dei pixel"; case 0x02A1: return "Memoria temporanea per la maschera di bit"; case 0x02A2: return "Flag per Escape"; case 0x02B2: case 0x02B3: case 0x02B4: case 0x02B5: return "Mappa di bit di inizio linea logica"; case 0x02B6: return "Flag di caratteri inversi"; case 0x02B7: return "Flag di riempimento a destra per il comando DRAW"; case 0x02B8: return "Registro temporaneo per riga utilizzato da ROWCRS"; case 0x02B9: case 0x02BA: return "Registro temporaneo per la colonna utilizzata da COLCRS"; case 0x02BB: return "Flag scorrimento"; case 0x02BC: case 0x02BD: return "Registro temporaneo utilizzato solo nel comando DRAW"; case 0x02BE: return "Flag per i tasti shift e control"; case 0x02BF: return "Flag per il numero di righe di testo disponibili per la stampa"; case 0x02C0: return "Colore del player 0 e del missile 3 0"; case 0x02C1: return "Colore del player 1 e del missile 3 1"; case 0x02C2: return "Colore del player 2 e del missile 3 2"; case 0x02C3: return "Colore del player 3 e del missile 3"; case 0x02C4: return "Registro dei colori zero"; case 0x02C5: return "Registro dei colori uno"; case 0x02C6: return "Registro dei colori due"; case 0x02C7: return "Registro dei colori tre"; case 0x02C8: return "Registro dei colori per lo sfondo (BAK) e il bordo"; case 0x02D9: return "Tasso di ritardo automatico"; case 0x02DA: return "Il tasso di ripetizione"; case 0x02DB: return "Clic sulla tastiera disabilita il registro"; case 0x02DC: return "Aiuta la registrazione della chiave"; case 0x02DE: return "Puntatore del buffer di stampa"; case 0x02DF: return "Dimensioni del buffer di stampa"; case 0x02E0: case 0x02E1: return "Eseguire l'indirizzo letto dal settore del disco uno"; case 0x02E2: case 0x02E3: return "Indirizzo di inizializzazione letto dal disco"; case 0x02E4: return "Dimensione RAM, solo byte alto"; case 0x02E5: case 0x02E6: return "Puntatore all'inizio della memoria libera utilizzata sia dal BASIC che dal sistema operativo"; case 0x02E7: case 0x02E8: return "Puntatore alla parte inferiore della memoria libera"; case 0x02E9: return "Byte di riserva"; case 0x02EA: return "Stato di errore del dispositivo e byte di stato del comando"; case 0x02EB: return "Byte di stato del dispositivo"; case 0x02EC: return "Valore massimo di timeout del dispositivo in secondi"; case 0x02ED: return "Numero di byte nel buffer di output"; case 0x02EE: return "Velocità di trasmissione della cassetta bassa"; case 0x02EF: return "Velocità di trasmissione della cassetta alto"; case 0x02F0: return "Flag di inibizione del cursore"; case 0x02F1: return "Indicatore di ritardo tasto o contatore antirimbalzo tasto"; case 0x02F2: return "Codice dei caratteri della tastiera precedente"; case 0x02F3: return "Registro modalità carattere"; case 0x02F4: return "Registro base caratteri"; case 0x02F5: case 0x02F6: case 0x02F7: case 0x02F8: case 0x02F9: return "Byte di riserva"; case 0x02FA: return "Valore del codice interno per l'ultimo carattere letto o scritto"; case 0x02FB: return "Ultimo carattere ATASCII letto o scritto o il valore di un punto graficot"; case 0x02FC: return "Internal hardware value for the last key pressed"; case 0x02FD: return "Dati colore per l'area di riempimento nel comando XIO FILL"; case 0x02FE: return "Flag schermo"; case 0x02FF: return "Flag della schermata di visualizzazione di avvio/arresto"; case 0x0300: return "ID del bus seriale del dispositivo"; case 0x0301: return "Numero di unità del disco o del dispositivo"; case 0x0302: return "Il numero dell'operazione del disco o del dispositivo"; case 0x0303: return "Il codice di stato al ritorno all'utente"; case 0x0304: case 0x0305: return "Indirizzo del buffer di dati dell'origine o della destinazione dei dati da trasferire o delle informazioni sullo stato del dispositivo"; case 0x0306: return "Il valore di timeout per il gestore in unità di un secondo"; case 0x0307: return "Byte inutilizzato"; case 0x0308: case 0x0309: return "Il numero di byte trasferiti da o verso il buffer di dati"; case 0x030A: case 0x030B: return "Utilizzato per informazioni specifiche del dispositivo come il numero del settore del disco per l'operazione di lettura o scrittura"; case 0x030C: case 0x030D: return "Valore iniziale del timer della velocità di trasmissione"; case 0x030E: return "Flag di correzione dell'aggiunta per i calcoli della velocità di trasmissione che coinvolgono i registri del timer"; case 0x030F: return "Modalità cassetta quando impostata"; case 0x0310: case 0x0311: return "Valore finale del timer"; case 0x0312: case 0x0313: return "Registro di conservazione temporanea utilizzato da SIO"; case 0x0314: return "Registro della custodia temporanea"; case 0x0315: return "Ditto"; case 0x0316: return "Salva la porta di ingresso dati seriale utilizzata per rilevare e aggiornare dopo l'arrivo di ogni bit"; case 0x0317: return "Flag di timeout per la correzione della velocità di trasmissione"; case 0x0318: return "Registro del puntatore dello stack SIO"; case 0x0319: return "Titolare dello stato temporaneo per la posizione 48 ($30)"; case 0x03E8: return "Flag per i tasti funzione"; case 0x03E9: return "Flag di richiesta di avvio della cassetta partenza a freddo"; case 0x03EA: return "Flag di avvio della cassetta"; case 0x057E: return "LBUFF prefisso uno"; case 0x057F: return "LBUFF prefisso due"; case 0x05E0: return "Argomenti polinomiali"; // Right cartridge B: case 0x9FFA: return "Cartuccia B: indirizzo iniziale basso"; case 0x9FFB: return "Cartuccia B: indirizzo iniziale alto"; case 0x9FFC: return "Cartuccia B: presente?"; case 0x9FFD: return "Cartuccia B: byte di opzione"; case 0x9FFE: return "Cartuccia B: indirizzo di inizializzazione basso"; case 0x9FFF: return "Cartuccia B: indirizzo di inizializzazione alto"; // Left cartridge A: case 0xA8E2: return "Cartuccia A: mostra la revisione del BASIC"; case 0xBFFA: return "Cartuccia A: indirizzo iniziale basso"; case 0xBFFB: return "Cartuccia A: indirizzo iniziale alto"; case 0xBFFC: return "Cartuccia A: presente?"; case 0xBFFD: return "Cartuccia A: byte di opzione"; case 0xBFFE: return "Cartuccia A: indirizzo di inizializzazione basso"; case 0xBFFF: return "Cartuccia A: indirizzo di inizializzazione alto"; // gta case 0xD000: return "Collisione del missile 0 con il campo di gioco | Posizione orizzontale del player 0"; case 0xD001: return "Collisione del missile 1 con il campo di gioco | Posizione orizzontale del player 1"; case 0xD002: return "Collisione del missile 2 con il campo di gioco | Posizione orizzontale del player 2"; case 0xD003: return "Collisione del missile 3 con il campo di gioco | Posizione orizzontale del player 3"; case 0xD004: return "Collisione del Player 0 con il campo di gioco | Posizione orizzontale del missile 0"; case 0xD005: return "Collisione del Player 1 con il campo di gioco | Posizione orizzontale del missile 1"; case 0xD006: return "Collisione del Player 2 con il campo di gioco | Posizione orizzontale del missile 2"; case 0xD007: return "Collisione del Player 3 con il campo di gioco | Posizione orizzontale del missile 3"; case 0xD008: return "Collisione Missile 0 con Player | Player di dimensioni 0"; case 0xD009: return "Collisione Missile 1 con Player | Player di dimensioni 1"; case 0xD00A: return "Collisione Missile 2 con Player | Player di dimensioni 2"; case 0xD00B: return "Collisione Missile 3 con Player | Player di dimensioni 3"; case 0xD00C: return "Collisione Player 0 con Player x | Dimensione dei missili 0-3"; case 0xD00D: return "Collision Player 1 con Player | Graphics Shape for Player 0"; case 0xD00E: return "Collisione Player 2 con Player | Forma grafica per il giocatore 1"; case 0xD00F: return "Collisione Player 3 con Player | Forma grafica per il giocatore 2"; case 0xD010: return "Trigger 0 | Forma grafica per il giocatore 3"; case 0xD011: return "Trigger 1 | Forma grafica per Missile 0-3"; case 0xD012: return "Trigger Joystick 2 | Colore del giocatore e del missile 0"; case 0xD013: return "Trigger Joystick 3 | Colore del giocatore e del missile 1"; case 0xD014: return "Determina il sistema TV | Colore del giocatore e del missile 2"; case 0xD015: return "Colore del giocatore e del missile 3"; case 0xD016: return "Registro dei colori 0"; case 0xD017: return "Registro dei colori 1"; case 0xD018: return "Registro dei colori 2"; case 0xD019: return "Registro dei colori 3"; case 0xD01A: return "Registro dei colori di sfondo"; case 0xD01B: return "Registro di selezione prioritaria"; case 0xD01C: return "Ritardo verticale per PM"; case 0xD01D: return "Controlla PM e Trigger"; case 0xD01E: return "Cancella tutti i registri di collisione"; case 0xD01F: return "Tasti consolle e altoparlante interno (400/800)"; // pokey case 0xD200: return "Pot/paddle 0 | Frequenza del canale audio 1"; case 0xD201: return "Pot/paddle 1 | Controllo del canale audio 1"; case 0xD202: return "Pot/paddle 2 | Frequenza del canale audio 2"; case 0xD203: return "Pot/paddle 3 | Controllo del canale audio 2"; case 0xD204: return "Pot/paddle 4 | Frequenza del canale audio 3"; case 0xD205: return "Pot/paddle 5 | Controllo del canale audio 3"; case 0xD206: return "Pot/paddle 6 | Frequenza del canale audio 4"; case 0xD207: return "Pot/paddle 7 | Controllo del canale audio 4"; case 0xD208: return "Controllo audio | Stato del porto di Pot"; case 0xD20A: return "Generatore di numeri casuali | Ripristino registro stato seriale"; case 0xD20B: return "Inizia la sequenza di lettura POT"; case 0xD20C: return "Non usato"; case 0xD20D: return "Uscita dati porta seriale | Ingresso dati porta seriale"; case 0xD20E: return "Attiva richiesta di interruzione | Stato della richiesta di interruzione"; case 0xD20F: return "Controllo della porta seriale | Stato porta seriale"; // pia case 0xD300: return "Porta del joystick A"; case 0xD301: return "Porta del joystick B"; case 0xD302: return "Controllo della porta A"; case 0xD303: return "Controllo della porta B"; // antic case 0xD400: return "Controllo dell'accesso diretto alla memoria (DMA)"; case 0xD401: return "Visualizzazione del cursore e dei caratteri"; case 0xD402: case 0xD403: return "Indirizzo iniziale dell'elenco di visualizzazione"; case 0xD404: return "Scorrimento fine orizzontale"; case 0xD405: return "Scorrimento fine verticale"; case 0xD406: return "Non usato"; case 0xD407: return "Indirizzo database PM (MSB)"; case 0xD408: return "Non usato"; case 0xD409: return "Indirizzo del set di caratteri"; case 0xD40A: return "Arresta la CPU fino al raggiungimento della fine della linea di scansione"; case 0xD40B: return "Linea di scansione corrente/2"; case 0xD40C: return "Posizione orizzontale delle penne ottiche"; case 0xD40D: return "Posizione verticale delle penne ottiche"; case 0xD40E: return "Abilita interruzione non mascherabile"; case 0xD40F: return "Reset/Stato interruzione non mascherabile"; // OS ROM case 0xD800: return "Conversione da ASCII a numero in virgola mobile"; case 0xD8E6: return "Conversine da numero in virgola mobile ad ASCII"; case 0xD9AA: return "Conversione da intero a numero in virgola mobile"; case 0xD9D2: return "Conversione numero virgola mobile in intero"; case 0xDA44: return "Cancella FR0 da 212 a 217 ($d$-$DB)"; case 0xDA46: return "Azzera il numero in virgola mobile Clear da FR1, locazioni da 224 a 229 ($E0..$E5)"; case 0xDA60: return "Routine sottrazione in virgola mobile, il valore in FR0 meno il valore in FR1"; case 0xDA66: return "Routine addizione in virgola mobile; FR0 più FR1"; case 0xDADB: return "Routine moltiplicazione in virgola mobile; FR0 per FR1"; case 0xDB28: return "Routine divisione in virgola mobile; FR0 diviso FR1"; case 0xDD40: return "Valutazione polinomiale numero in virgola mobile"; case 0xDD89: return "Carica il numero FP in FR0 dai registri 6502 X,Y"; case 0xDD8D: return "Carica il numero FP in FR0 dalla routine utente, usando FLPTR a 252 ($FC)"; case 0xDD98: return "Caricare il numero FP in FR1 dai registri 6502 X,Y"; case 0xDD9C: return "Caricare il numero FP in FR1 dal programma utente, utilizzando FLPTR"; case 0xDDA7: return "Memorizza il numero FP nei registri 6502 X,Y da FR0"; case 0xDDAB: return "Memorizza il numero FP da FR0, utilizzando FLPTR"; case 0xDDB6: return "Spostare il numero FP da FR0 a FR1"; case 0xDDC0: return "Esponenziale in base e numero birgola mobile"; case 0xDDCC: return "Esponenziale in base numero virgola mobile"; case 0xDDCD: return "Logaritmo naturale numero in virgola mobile"; case 0xDED1: return "Logaritmo in base 10 numero in virgola mobile"; case 0xE400: return "Editor di schermo (E:) tabella dei punti di ingresso"; case 0xE410: return "Gestore display (schermo televisivo) (S:)"; case 0xE420: return "Tabella di salto per il driver della tastiera K:"; case 0xE430: return "Gestore della stampante (P:)"; case 0xE440: return "Gestore cassette (C:)"; case 0xE450: return "Vettore di inizializzazione del gestore del disco, inizializzato su 60906 ($EDEA)"; case 0xE453: return "Voce del gestore del disco (interfaccia); controlla lo stato del disco. Inizializzato a 60912 ($EDF0)"; case 0xE45C: return "Imposta timer di sistema e vettori di interruzione"; case 0xE45F: return "Entrata dei calcoli VBLANK della prima fase"; case 0xE462: return "Uscire dalla routine VBLANK"; case 0xE465: return "Inizializzazione dell'utilità SIO, solo uso del sistema operativo"; case 0xE468: return "Invia routine di abilitazione, solo uso del sistema operativo"; case 0xE46B: return "Inizializzazione del gestore di interrupt, solo uso del sistema operativo"; case 0xE46E: return "Inizializzazione dell'utility CIO, solo uso del sistema operativo"; case 0xE471: return "Ingresso modalità lavagna"; case 0xE474: return "Vettore partenza a caldo"; case 0xE477: return "Vettore partenza a freddo"; case 0xE47A: return "Legge i blocchi dal C:"; case 0xE47D: return "Canali aperti per C:"; case 0xE480: return "Vettore per il Self Test"; case 0xE7AE: case 0xE7D1: return "Routine VBLANK"; default: if ((addr>=0x100) && (addr<=0x1FF)) return "Stack CPU"; if ((addr>=0x247) && (addr<=0x26E)) return "Buffer della riga dei caratteri"; if ((addr>=0x2A3) && (addr<=0x2B1)) return "Mappa delle posizioni dei TAB stop"; if ((addr>=0x2C9) && (addr<=0x2DF)) return "Byte di riserva"; if ((addr>=0x31A) && (addr<=0x33F)) return "Tabella degli indirizzi del gestore"; if ((addr>=0x340) && (addr<=0x34F)) return "Blocco di controllo I/O (IOCB) zero"; if ((addr>=0x350) && (addr<=0x35F)) return "Blocco di controllo I/O (IOCB) one"; if ((addr>=0x360) && (addr<=0x36F)) return "Blocco di controllo I/O (IOCB) due"; if ((addr>=0x370) && (addr<=0x37F)) return "Blocco di controllo I/O (IOCB) tre"; if ((addr>=0x380) && (addr<=0x38F)) return "Blocco di controllo I/O (IOCB) quattro"; if ((addr>=0x390) && (addr<=0x39F)) return "Blocco di controllo I/O (IOCB) cinque"; if ((addr>=0x3A0) && (addr<=0x3AF)) return "Blocco di controllo I/O (IOCB) sei"; if ((addr>=0x3B0) && (addr<=0x3BF)) return "Blocco di controllo I/O (IOCB) sette"; if ((addr>=0x3C0) && (addr<=0x3E7)) return "Buffer stampante"; if ((addr>=0x3FD) && (addr<=0x47F)) return "Biffer cassetta"; if ((addr>=0x580) && (addr<=0x5E5)) return "Linea al buffer BASIC"; if ((addr>=0x5E6) && (addr<=0x5FF)) return "Uso del blocco per appunti in virgola mobile"; } case LANG_ENGLISH: switch ((int)addr) { case 0x0000: case 0x0001: return "VBLANK timer"; case 0x0002: case 0x0003: return "Cassette initialization vector"; case 0x0004: case 0x0005: return "RAM pointer for the memory test used on powerup"; case 0x0006: return "Temporary Register for RAM size"; case 0x0007: return "RAM test data register"; case 0x0008: return "Warmstart flag"; case 0x0009: return "Boot flag success indicator"; case 0x000A: case 0x000B: return "Start vector for disk (or non-cartridge) software"; case 0x000C: case 0x000D: return "Initialization address for the disk boot"; case 0x000E: case 0x000F: return "Applications memory high limit and pointer to the end of your BASIC program"; case 0x0010: return "POKEY interrupts"; case 0x0011: return "Zero means the BREAK key is pressed"; case 0x0012: case 0x0013: case 0x0014: return "Internal realtime clock"; case 0x0015: case 0x0016: return "Indirect buffer address register"; case 0x0017: return "Command for CIO vector"; case 0x0018: case 0x0019: return "Disk file manager pointer"; case 0x001A: case 0x001B: return "The disk utilities pointer"; case 0x001C: return "Printer timeout"; case 0x001D: return "Print buffer pointer"; case 0x001E: return "Print buffer size of printer record for current mode"; case 0x001F: return "Temporary register used by the printer handler"; case 0x0020: return "Handler index number"; case 0x0021: return "Device number or drive number"; case 0x0022: return "Command code byte set by the user"; case 0x0023: return "Status of the last IOCB action returned by the device"; case 0x0024: case 0x0025: return "Buffer address for data transfer or the address of the file name"; case 0x0026: case 0x0027: return "Put byte routine address set by the OS"; case 0x0028: case 0x0029: return "Buffer length byte count used for PUT and GET operations"; case 0x002A: return "Auxiliary information first byte"; case 0x002B: return "CIO working variables"; case 0x002C: case 0x002D: return "Used by BASIC NOTE and POINT commands for the transfer of disk sector numbers"; case 0x002E: return "The byte being accessed within the sector"; case 0x002F: return "Spare byte"; case 0x0030: return "Internal status storage"; case 0x0031: return "Data frame checksum used by SIO"; case 0x0032: case 0x0033: return "Pointer to the data buffer"; case 0x0034: case 0x0035: return "Next byte past the end of the SIO and DCB data buffer"; case 0x0036: return "Number of command frame retries"; case 0x0037: return "Number of device retries"; case 0x0038: return "Data buffer full flag"; case 0x0039: return "Receive done flag"; case 0x003A: return "Transmission done flag"; case 0x003B: return "Checksum sent flag"; case 0x003C: return "Flag for no checksum follows data"; case 0x003D: return "Cassette buffer pointer"; case 0x003E: return "Inter-record gap type between cassette records"; case 0x003F: return "Cassette end of file flag"; case 0x0040: return "Beep count retain register"; case 0x0041: return "Noisy I/O flag used by SIO to signal the beeping heard during disk and cassette I/O"; case 0x0042: return "Critical I/O region flag"; case 0x0043: case 0x0044: return "Page zero buffer pointer to the user filename for disk I/O"; case 0x0045: case 0x0046: return "Page zero drive pointer"; case 0x0047: case 0x0048: return "Zero page sector buffer pointer"; case 0x0049: return "Disk I/O error number"; case 0x004A: return "Cassette boot request flag on coldstart"; case 0x004B: return "Cassette boot flag"; case 0x004C: return "Display status and keyboard register used by the display handler"; case 0x004D: return "Attract mode timer and flag"; case 0x004E: return "Dark attract mask"; case 0x004F: return "Color shift mask"; case 0x0050: case 0x0051: return "Temporary register used by the display handler in moving data to and from screen"; case 0x0052: return "Column of the left margin of text"; case 0x0053: return "Right margin of the text screen initialized to 39 ($27)"; case 0x0054: return "Current graphics or text screen cursor row"; case 0x0055: case 0x0056: return "Current graphics or text mode cursor column"; case 0x0057: return "Display mode/current screen mode"; case 0x0058: case 0x0059: return "The lowest address of the screen memory, corresponding to the upper left corner of the screen"; case 0x005A: return "Previous graphics cursor row"; case 0x005B: case 0x005C: return "Previous graphics cursor column"; case 0x005D: return "Retains the value of the character under the cursor"; case 0x005E: case 0x005F: return "Retains the memory location of the current cursor location"; case 0x0060: return "Point (row) to which DRAWTO and XIO 18 (FILL) will go"; case 0x0061: case 0x0062: return "Point (column) to which DRAWTO and XIO 18 (FILL) will go"; case 0x0063: return "Position of the cursor at the column in a logical line"; case 0x0064: case 0x0065: return "Temporary storage used by the display handler for the Display List address"; case 0x0066: case 0x0067: return "Temporary storage for open and sisplay handler"; case 0x0068: case 0x0069: return "Temporary storage for data under the cursor and moving line on the screen"; case 0x006A: return "RAM size"; case 0x006B: return "Buffer count"; case 0x006C: case 0x006D: return "Editor low byte (AM)"; case 0x006E: return "Bit mask used in bit mapping routines by the OS display handler"; case 0x006F: return "Pixel justification"; case 0x0070: return "Row accumulator"; case 0x0071: return "Column accumulator"; case 0x0072: case 0x0073: return "Controls column point plotting"; case 0x0074: case 0x0075: return "End point of the line to be drawn"; case 0x0076: return "Delta row"; case 0x0077: case 0x0078: return "Delta column"; case 0x0079: return "The row increment or decrement value"; case 0x007A: return "The column increment or decrement value"; case 0x007B: return "Split-screen cursor control"; case 0x007C: return "Hold character before the control and shift logic"; case 0x007D: return "Temporary storage byte used by the display handler for the character under the cursor and end of line detection"; case 0x007E: case 0x007F: return "Number of iterations required to draw a line"; case 0x0080: case 0x0081: return "Pointer to BASIC's low memory"; case 0x0082: case 0x0083: return "Beginning address of the variable name table"; case 0x0084: case 0x0085: return "Pointer to the ending address of the variable name table plus one byte"; case 0x0086: case 0x0087: return "Address for the variable value table"; case 0x0088: case 0x0089: return "The address of the statement table"; case 0x008A: case 0x008B: return "Current BASIC statement pointer"; case 0x008C: case 0x008D: return "The address for the string and array table and a pointer to the end of your BASIC program"; case 0x008E: case 0x008F: return "Address of the runtime stack"; case 0x0090: case 0x0091: return "Pointer to the top of BASIC memory"; case 0x00BA: case 0x00BB: return "The line where a program was stopped"; case 0x00C3: return "The number of the error code that caused the stop or the TRAP"; case 0x00C9: return "The number of columns between TAB stops"; case 0x00D2: case 0x00D3: return "Reserved for BASIC or other cartridge use"; case 0x00D4: case 0x00D5: case 0x00D6: case 0x00D7: case 0x00D8: case 0x00D9: return "Floating point register zero"; case 0x00DA: case 0x00DB: case 0x00DC: case 0x00DD: case 0x00DE: case 0x00DF: return "Floating point extra register"; case 0x00E0: case 0x00E1: case 0x00E2: case 0x00E3: case 0x00E4: case 0x00E5: return "Floating point register one"; case 0x00E6: case 0x00E7: case 0x00E8: case 0x00E9: case 0x00EA: case 0x00EB: return "Floating point register two"; case 0x00EC: return "Floating point spare register"; case 0x00ED: return "The value of E (the exponent)"; case 0x00EE: return "The sign of the FP number"; case 0x00EF: return "The sign of the exponent"; case 0x00F0: return "The first character flag"; case 0x00F1: return "The number of digits to the right of the decimal"; case 0x00F2: return "Character (current input) index"; case 0x00F3: case 0x00F4: return "Input ASCII text buffer pointer"; case 0x00F5: case 0x00F6: case 0x00F7: case 0x00F8: case 0x00F9: case 0x00FA: return "Temporary register"; case 0x00FB: return "Radian/degree flag"; case 0x00FC: case 0x00FD: return "Points to the user's FP number"; case 0x00FE: case 0x00FF: return "Pointer to the user's second FP number"; case 0x0200: case 0x0201: return "Vector for NMI Display List Interrupts (DLI)"; case 0x0202: case 0x0203: return "Serial (peripheral) proceed line vector"; case 0x0204: case 0x0205: return "Serial (peripheral) interrupt vector"; case 0x0206: case 0x0207: return "Software break instruction vector for the 6502 BRK"; case 0x0208: case 0x0209: return "POKEY keyboard interrupt vector"; case 0x020A: case 0x020B: return "POKEY serial I/O bus receive data ready interrupt vector"; case 0x020C: case 0x020D: return "POKEY serial I/O transmit ready interrupt vector"; case 0x020E: case 0x020F: return "POKEY serial bus transmit complete interrupt vector"; case 0x0210: case 0x0211: return "POKEY timer one interrupt vector"; case 0x0212: case 0x0213: return "POKEY timer two vector for AUDF2"; case 0x0214: case 0x0215: return "POKEY timer four vector for AUDF4"; case 0x0216: case 0x0217: return "The IRQ immediate vector (general)"; case 0x0218: case 0x0219: return "System timer one value"; case 0x021A: case 0x021B: return "System timer two"; case 0x021C: case 0x021D: return "System timer three"; case 0x021E: case 0x021F: return "System timer four"; case 0x0220: case 0x0221: return "System timer five"; case 0x0222: case 0x0223: return "VBLANK immediate register"; case 0x0224: case 0x0225: return "VBLANK deferred register"; case 0x0226: case 0x0227: return "System timer one jump address"; case 0x0228: case 0x0229: return "System timer two jump address"; case 0x022A: return "System timer three flag"; case 0x022B: return "Software repeat timer, controlled by the IRQ device routine"; case 0x022C: return "System timer four flag"; case 0x022D: return "Temporary register used by the SETVBL"; case 0x022E: return "System timer five flag"; case 0x022F: return "Direct Memory Access (DMA) enable"; case 0x0230: case 0x0231: return "Starting address of the display list"; case 0x0232: return "Serial port control register"; case 0x0233: return "Spare byte (no OS use)"; case 0x0234: return "Light pen horizontal value shadow for 54284 ($D40C)"; case 0x0235: return "Light pen vertical value: shadow for 54285 ($D40D)"; case 0x0236: case 0x0237: return "BREAK key interrupt vector"; case 0x0238: case 0x0239: return "Spare byte"; case 0x023A: return "Four-byte command frame buffer (CFB) address for a device"; case 0x023B: return "The SIO bus command code"; case 0x023C: return "Command auxiliary byte one"; case 0x023D: return "Command auxiliary byte two"; case 0x023E: return "Temporary RAM register for SIO"; case 0x023F: return "SIO error flag"; case 0x0240: return "Disk flags read from the first byte of the boot file (sector one) of the disk"; case 0x0241: return "The number of disk boot sectors read from the first disk record"; case 0x0242: case 0x0243: return "The address for where the disk boot loader will be put"; case 0x0244: return "Coldstart flag"; case 0x0245: return "Spare byte"; case 0x0246: return "Disk time-out register"; case 0x026F: return "Priority selection register, shadow for 53275 ($D01B)"; case 0x0270: return "The value of paddle 0"; case 0x0271: return "The value of paddle 1"; case 0x0272: return "The value of paddle 2"; case 0x0273: return "The value of paddle 3"; case 0x0274: return "The value of paddle 4"; case 0x0275: return "The value of paddle 5"; case 0x0276: return "The value of paddle 6"; case 0x0277: return "The value of paddle 7"; case 0x0278: return "The value of joystick 0"; case 0x0279: return "The value of joystick 1"; case 0x027A: return "The value of joystick 2"; case 0x027B: return "The value of joystick 3"; case 0x027C: return "Paddle trigger 0"; case 0x027D: return "Paddle trigger 1"; case 0x027E: return "Paddle trigger 2"; case 0x027F: return "Paddle trigger 3"; case 0x0280: return "Paddle trigger 4"; case 0x0281: return "Paddle trigger 5"; case 0x0282: return "Paddle trigger 6"; case 0x0283: return "Paddle trigger 7"; case 0x0284: return "Stick trigger 0"; case 0x0285: return "Stick trigger 1"; case 0x0286: return "Stick trigger 2"; case 0x0287: return "Stick trigger 3"; case 0x0288: return "Cassette status register"; case 0x0289: return "Store either the read or the write mode for the cassette handler"; case 0x028A: return "Cassette data record buffer size"; case 0x028B: case 0x028C: case 0x028D: case 0x028E: case 0x028F: return "Spare byte"; case 0x0290: return "Text window cursor row"; case 0x0291: case 0x0292: return "Text window cursor column"; case 0x0293: return "Current split-screen text window GRAPHICS mode"; case 0x0294: case 0x0295: return "Address of the upper left corner of the text window"; case 0x0296: return "Split-screen: Previous graphics cursor row"; case 0x0297: case 0x0298: return "Split-screen: Previous graphics cursor column"; case 0x0299: return "Split-screen: Retains the value of the character under the cursor"; case 0x029A: case 0x029B: return "Split-screen: Retains the memory location of the current cursor location"; case 0x029C: return "Temporary register (display handler)"; case 0x029D: case 0x029E: case 0x029F: return "Temporary register"; case 0x02A0: return "Pixel location mask"; case 0x02A1: return "Temporary storage for the bit mask"; case 0x02A2: return "Escape flag"; case 0x02B2: case 0x02B3: case 0x02B4: case 0x02B5: return "Logical line start bit map"; case 0x02B6: return "Inverse character flag"; case 0x02B7: return "Right fill flag for the DRAW command"; case 0x02B8: return "Temporary register for row used by ROWCRS"; case 0x02B9: case 0x02BA: return "Temporary register for column used by COLCRS"; case 0x02BB: return "Scroll flag"; case 0x02BC: case 0x02BD: return "Temporary register used in the DRAW command only"; case 0x02BE: return "Flag for the shift and control keys"; case 0x02BF: return "Flag for the number of text rows available for printing"; case 0x02C0: return "Color of player 0 and missile 0"; case 0x02C1: return "Color of player 1 and missile 1"; case 0x02C2: return "Color of player 2 and missile 2"; case 0x02C3: return "Color of player 3 and missile 3"; case 0x02C4: return "Color register zero"; case 0x02C5: return "Color register one"; case 0x02C6: return "Color register two"; case 0x02C7: return "Color register three"; case 0x02C8: return "Color register for the background (BAK) and border"; case 0x02D9: return "Auto-delay rate"; case 0x02DA: return "The rate of the repeat"; case 0x02DB: return "Keyboard click disable register"; case 0x02DC: return "Help key register"; case 0x02DE: return "Print Buffer Pointer"; case 0x02DF: return "Print buffer size"; case 0x02E0: case 0x02E1: return "Run address read from the disk sector one"; case 0x02E2: case 0x02E3: return "Initialization address read from the disk"; case 0x02E4: return "RAM size, high byte only"; case 0x02E5: case 0x02E6: return "Pointer to the top of free memory used by both BASIC and OS"; case 0x02E7: case 0x02E8: return "Pointer to the bottom of free memory"; case 0x02E9: return "Spare byte"; case 0x02EA: return "Device error status and the command status byte"; case 0x02EB: return "Device status byte"; case 0x02EC: return "Maximum device time-out value in seconds"; case 0x02ED: return "Number of bytes in output buffer"; case 0x02EE: return "Cassette baud rate low"; case 0x02EF: return "Cassette baud rate high"; case 0x02F0: return "Cursor inhibit flag"; case 0x02F1: return "Key delay flag or key debounce counter"; case 0x02F2: return "Prior keyboard character code"; case 0x02F3: return "Character Mode Register"; case 0x02F4: return "Character Base Register"; case 0x02F5: case 0x02F6: case 0x02F7: case 0x02F8: case 0x02F9: return "Spare byte"; case 0x02FA: return "Internal code value for the most recent character read or written"; case 0x02FB: return "Last ATASCII character read or written or the value of a graphics point"; case 0x02FC: return "Internal hardware value for the last key pressed"; case 0x02FD: return "Color data for the fill region in the XIO FILL command"; case 0x02FE: return "Display flag"; case 0x02FF: return "Start/stop display screen flag"; case 0x0300: return "Device serial bus ID"; case 0x0301: return "Disk or device unit number"; case 0x0302: return "The number of the disk or device operation"; case 0x0303: return "The status code upon return to user"; case 0x0304: case 0x0305: return "Data buffer address of the source or destination of the data to be transferred or the device status information"; case 0x0306: return "The time-out value for the handler in one-second units"; case 0x0307: return "Unused byte"; case 0x0308: case 0x0309: return "The number of bytes transferred to or from the data buffer"; case 0x030A: case 0x030B: return "Used for device specific information such as the disk sector number for the read or write operation"; case 0x030C: case 0x030D: return "Initial baud rate timer value"; case 0x030E: return "Addition correction flag for the baud rate calculations involving the timer registers"; case 0x030F: return "Cassette mode when set"; case 0x0310: case 0x0311: return "Final timer value"; case 0x0312: case 0x0313: return "Temporary storage register used by SIO"; case 0x0314: return "Temporary storage register"; case 0x0315: return "Ditto"; case 0x0316: return "Save serial data-in port used to detect, and updated after, each bit arrival"; case 0x0317: return "Time-out flag for baud rate correction"; case 0x0318: return "SIO stack pointer register"; case 0x0319: return "Temporary status holder for location 48 ($30)"; case 0x03E8: return "Flag for function keys"; case 0x03E9: return "Cassette boot request flag on coldstart"; case 0x03EA: return "Cassette boot flag"; case 0x057E: return "LBUFF prefix one"; case 0x057F: return "LBUFF prefix two"; case 0x05E0: return "Polynominal arguments"; // Right cartridge B: case 0x9FFA: return "Cartridge B: start address low"; case 0x9FFB: return "Cartridge B: start address high"; case 0x9FFC: return "Cartridge B: present?"; case 0x9FFD: return "Cartridge B: option byte"; case 0x9FFE: return "Cartridge B: initialization address low"; case 0x9FFF: return "Cartridge B: initialization address high"; // Left cartridge A: case 0xA8E2: return "Cartridge A: shows revision of BASIC"; case 0xBFFA: return "Cartridge A: start address low"; case 0xBFFB: return "Cartridge A: start address high"; case 0xBFFC: return "Cartridge A: present?"; case 0xBFFD: return "Cartridge A: option byte"; case 0xBFFE: return "Cartridge A: initialization address low"; case 0xBFFF: return "Cartridge A: initialization address high"; // gta case 0xD000: return "Missile 0 collision with playfield | Horizontal position of player 0"; case 0xD001: return "Missile 1 collision with playfield | Horizontal position of player 1"; case 0xD002: return "Missile 2 collision with playfield | Horizontal position of player 2"; case 0xD003: return "Missile 3 collision with playfield | Horizontal position of player 3"; case 0xD004: return "Player 0 collision with playfield | Horizontal position of missile 0"; case 0xD005: return "Player 1 collision with playfield | Horizontal position of missile 1"; case 0xD006: return "Player 2 collision with playfield | Horizontal position of missile 2"; case 0xD007: return "Player 3 collision with playfield | Horizontal position of missile 3"; case 0xD008: return "Collision Missile 0 with Player | Size Player 0"; case 0xD009: return "Collision Missile 1 with Player | Size Player 1"; case 0xD00A: return "Collision Missile 2 with Player | Size Player 2"; case 0xD00B: return "Collision Missile 3 with Player | Size Player 3"; case 0xD00C: return "Collision Player 0 with Player x | Size of Missiles 0-3"; case 0xD00D: return "Collision Player 1 with Player | Graphics Shape for Player 0"; case 0xD00E: return "Collision Player 2 with Player | Graphics Shape for Player 1"; case 0xD00F: return "Collision Player 3 with Player | Graphics Shape for Player 2"; case 0xD010: return "Trigger 0 | Graphics Shape for Player 3"; case 0xD011: return "Trigger 1 | Graphics Shape for Missile 0-3"; case 0xD012: return "Trigger Joystick 2 | Color of Player and Missile 0"; case 0xD013: return "Trigger Joystick 3 | Color of Player and Missile 1"; case 0xD014: return "Determine TV System | Color of Player and Missile 2"; case 0xD015: return "Color of Player and Missile 3"; case 0xD016: return "Color Register 0"; case 0xD017: return "Color Register 1"; case 0xD018: return "Color Register 2"; case 0xD019: return "Color Register 3"; case 0xD01A: return "Background Color Register"; case 0xD01B: return "Priority Selection Register"; case 0xD01C: return "Vertical Delay for PM"; case 0xD01D: return "Controls PM and Triggers "; case 0xD01E: return "Clear all collision registers"; case 0xD01F: return "Console keys and internal speaker (400/800)"; // pokey case 0xD200: return "Pot/paddle 0 | Audio channel 1 frequency"; case 0xD201: return "Pot/paddle 1 | Audio channel 1 control"; case 0xD202: return "Pot/paddle 2 | Audio channel 2 frequency"; case 0xD203: return "Pot/paddle 3 | Audio channel 2 control"; case 0xD204: return "Pot/paddle 4 | Audio channel 3 frequency"; case 0xD205: return "Pot/paddle 5 | Audio channel 3 control"; case 0xD206: return "Pot/paddle 6 | Audio channel 4 frequency"; case 0xD207: return "Pot/paddle 7 | Audio channel 4 control"; case 0xD208: return "Audio control | Pot Port State"; case 0xD20A: return "Random number generator | Serial status register reset"; case 0xD20B: return "Start Pot reading sequence"; case 0xD20C: return "Unused"; case 0xD20D: return "Serial Port Data Output | Serial Port Data Input"; case 0xD20E: return "Interrupt Request Enable | Interrupt Request Status"; case 0xD20F: return "Serial Port Control | Serial Port Status"; // pia case 0xD300: return "Joystick port A"; case 0xD301: return "Joystick port B"; case 0xD302: return "Port A Control"; case 0xD303: return "Port B Control"; // antic case 0xD400: return "Direct Memory Access (DMA) Control"; case 0xD401: return "Cursor and character display"; case 0xD402: case 0xD403: return "Start Address of the Display List"; case 0xD404: return "Horizontal Fine Scrolling"; case 0xD405: return "Vertical Fine Scrolling"; case 0xD406: return "Unused"; case 0xD407: return "PM data base address (MSB)"; case 0xD408: return "Unused"; case 0xD409: return "Character set address"; case 0xD40A: return "Stops CPU until end of scanline is reached"; case 0xD40B: return "Current scanline/2"; case 0xD40C: return "Horizontal position of lightpens"; case 0xD40D: return "Vertical position of lightpens"; case 0xD40E: return "Non Maskable Interrupt Enable"; case 0xD40F: return "Non Maskable Interrupt Status/Reset"; // OS ROM case 0xD800: return "ASCII to Floating Point (FP) conversion"; case 0xD8E6: return "FP value to ASCII conversion"; case 0xD9AA: return "Integer to FP conversion"; case 0xD9D2: return "FP to integer conversion"; case 0xDA44: return "Clear FR0 at 212 to 217 ($d$-$DB)"; case 0xDA46: return "Clear the FP number from FR1, locations 224 to 229 ($E0 to $E5)"; case 0xDA60: return "FP subtract routine, the value in FR0 minus the value in FR1"; case 0xDA66: return "FP addition routine; FR0 plus FR1"; case 0xDADB: return "FP multiplication routine; FR0 times FR1"; case 0xDB28: return "FP division routine; FR0 divided by FR1"; case 0xDD40: return "FP polynomial evaluation"; case 0xDD89: return "Load the FP number into FR0 from the 6502 X,Y registers"; case 0xDD8D: return "Load the FP number into FR0 from user routine, using FLPTR at 252 ($FC)"; case 0xDD98: return "Load the FP number into FR1 from the 6502 X,Y registers"; case 0xDD9C: return "Load the FP number into FR1 from user program, using FLPTR"; case 0xDDA7: return "Store the FP number into the 6502 X,Y registers from FR0"; case 0xDDAB: return "Store the FP number from FR0, using FLPTR"; case 0xDDB6: return "Move the FP number from FR0 to FR1"; case 0xDDC0: return "FP base e exponentiation"; case 0xDDCC: return "FP base 10 exponentiation"; case 0xDDCD: return "FP natural logarithm"; case 0xDED1: return "FP base 10 logarithm"; case 0xE400: return "Screen editor (E:) entry point table"; case 0xE410: return "Display handler (television screen) (S:)"; case 0xE420: return "Jump Table for Keyboard driver K:"; case 0xE430: return "Printer handler (P:)"; case 0xE440: return "Cassette handler (C:)"; case 0xE450: return "Disk handler initialization vector, initialized to 60906 ($EDEA)"; case 0xE453: return "Disk handler (interface) entry; checks the disk status. Initialized to 60912 ($EDF0)"; case 0xE45C: return "Set system timers and interrupt vectors"; case 0xE45F: return "Stage one VBLANK calculations entry"; case 0xE462: return "Exit from the VBLANK routine"; case 0xE465: return "SIO utility initialisation, OS use only"; case 0xE468: return "Send enable routine, OS use only"; case 0xE46B: return "Interrupt handler initialisation, OS use only"; case 0xE46E: return "CIO utility initialisation, OS Use only"; case 0xE471: return "Blackbaord Mode Entry"; case 0xE474: return "Warm Start Vector"; case 0xE477: return "Cold Start Vector"; case 0xE47A: return "Reads block from C:"; case 0xE47D: return "Opens channel for C:"; case 0xE480: return "Vector for Self Test"; case 0xE7AE: case 0xE7D1: return "VBLANK routines"; default: if ((addr>=0x100) && (addr<=0x1FF)) return "CPU stack"; if ((addr>=0x247) && (addr<=0x26E)) return "Character line buffer"; if ((addr>=0x2A3) && (addr<=0x2B1)) return "Map of the TAB stop positions"; if ((addr>=0x2C9) && (addr<=0x2DF)) return "Spare byte"; if ((addr>=0x31A) && (addr<=0x33F)) return "Handler Address Table"; if ((addr>=0x340) && (addr<=0x34F)) return "I/O Control Block (IOCB) zero"; if ((addr>=0x350) && (addr<=0x35F)) return "I/O Control Block (IOCB) one"; if ((addr>=0x360) && (addr<=0x36F)) return "I/O Control Block (IOCB) two"; if ((addr>=0x370) && (addr<=0x37F)) return "I/O Control Block (IOCB) three"; if ((addr>=0x380) && (addr<=0x38F)) return "I/O Control Block (IOCB) four"; if ((addr>=0x390) && (addr<=0x39F)) return "I/O Control Block (IOCB) five"; if ((addr>=0x3A0) && (addr<=0x3AF)) return "I/O Control Block (IOCB) six"; if ((addr>=0x3B0) && (addr<=0x3BF)) return "I/O Control Block (IOCB) seven"; if ((addr>=0x3C0) && (addr<=0x3E7)) return "Printer buffer"; if ((addr>=0x3FD) && (addr<=0x47F)) return "Cassette buffer"; if ((addr>=0x580) && (addr<=0x5E5)) return "BASIC line Buffer"; if ((addr>=0x5E6) && (addr<=0x5FF)) return "Floating Point scratch pad use"; } } } return super.dcom(iType, aType, addr, value); } }
77,305
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
C64MusDasm.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/software/machine/C64MusDasm.java
/** * @(#)C64MusDasm.java 2001/07/14 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.software.machine; import sw_emulator.software.cpu.M6510Dasm; import sw_emulator.math.Unsigned; /** * Decode the voice music data as coded into 'mus' file used by sidplayer. * The generated code give so information about how a music is done. * It performs also a multy language comments. * * @author Ice * @version 1.00 14/07/2001 */ public class C64MusDasm extends M6510Dasm { /** * Return the mnemonic assembler instruction rapresent by passed code bytes. * Here we give not assembler instruction, but music notation like in mus * file. * * @param buffer the buffer containg the data * @param pos the actual position in the buffer * @param pc the program counter value associated to the bytes being address * by the <code>pos</code> in the buffer * @return a string menemonic rapresentation of instruction */ @Override public String dasm(byte[] buffer, int pos, long pc) { String result="???"; // result string int b1=Unsigned.done(buffer[pos]); // first command byte int b2=Unsigned.done(buffer[pos+1]); // second command byte // is this a music data command? if ((b1 & 0x03)==00) { // yes this is music notation // analize duration byte: // look for TIE String tied=""; if ((b1 & 0x40)==0x40) { tied="TIE"; } // look for LENGTH String length=""; switch (b1 & 0x1C) { case 0x08: length="WHOLE"; break; case 0x0C: length="HALF"; break; case 0x10: length="QUARTER"; break; case 0x14: length="EIGHTH"; break; case 0x18: length="16TH"; break; case 0x1C: length="32ND"; break; default: if ((b1 & 0x3C)==20) { length="64TH"; } else { length="???"; // unknown length } } // look for DOT String dot=""; switch (b1 & 0xA0) { case 0xA0: dot="DOUBLE DOTTED"; break; case 0x20: dot="DOTTED"; break; case 0x00: dot="" /**"NONE"*/; break; default: dot="???"; // unknown dot } result=length+" "+dot+" "+tied; // compose the duration string // look for OTHER if (b1==0) { result="ABSOLUTE SET"; } else { switch (b1 & 0xBF) { case 0x24: result="UTILITY-VOICE "+tied; break; case 0x04: result="UTILITY "+tied; break; } } // now look for note //look for octave char octave=' '; switch (b2 & 0x38) { case 0x38: octave='0'; break; case 0x30: octave='1'; break; case 0x28: octave='2'; break; case 0x20: octave='3'; break; case 0x18: octave='4'; break; case 0x10: octave='5'; break; case 0x08: octave='6'; break; case 0x00: octave='7'; break; } //look for note char note=' '; String type=""; switch (b2 & 0x07) { case 0x01: note='C'; type="##"; break; case 0x02: note='D'; type="##"; break; case 0x03: note='E'; type="bb"; break; case 0x04: note='F'; type="##"; break; case 0x05: note='G'; type="##"; break; case 0x06: note='A'; type="bb"; break; case 0x07: note='B'; type="bb"; break; } // look for type switch (b2 & 0xC0) { case 0x80: type=""; break; case 0x40: type="#"; break; case 0xC0: type="b"; break; // default use double that is already setted } if ((b2 & 0x07)==0x00) { result="REST"+" "+result; } else { result=note+type+"-"+octave+" "+result; } } else { switch (b1) { case 0x06: // look for tempo switch (b2) { case 0x00: result="TEMPO: SET 56"; break; case 0xF8: result="TEMPO: SET 58"; break; case 0xF0: result="TEMPO: SET 60"; break; case 0xE8: result="TEMPO: SET 62"; break; case 0xE0: result="TEMPO: SET 64"; break; case 0xD8: result="TEMPO: SET 66"; break; case 0xD0: result="TEMPO: SET 69"; break; case 0xC8: result="TEMPO: SET 72"; break; case 0xC0: result="TEMPO: SET 75"; break; case 0xB8: result="TEMPO: SET 78"; break; case 0xB0: result="TEMPO: SET 81"; break; case 0xA8: result="TEMPO: SET 85"; break; case 0xA0: result="TEMPO: SET 90"; break; case 0x98: result="TEMPO: SET 94"; break; case 0x90: result="TEMPO: SET 100"; break; case 0x88: result="TEMPO: SET 105"; break; case 0x80: result="TEMPO: SET 112"; break; case 0x78: result="TEMPO: SET 120"; break; case 0x70: result="TEMPO: SET 128"; break; case 0x68: result="TEMPO: SET 138"; break; case 0x60: result="TEMPO: SET 150"; break; case 0x58: result="TEMPO: SET 163"; break; case 0x50: result="TEMPO: SET 180"; break; case 0x48: result="TEMPO: SET 200"; break; case 0x40: result="TEMPO: SET 225"; break; case 0x38: result="TEMPO: SET 257"; break; case 0x30: result="TEMPO: SET 300"; break; case 0x28: result="TEMPO: SET 360"; break; case 0x20: result="TEMPO: SET 450"; break; case 0x18: result="TEMPO: SET 600"; break; case 0x10: result="TEMPO: SET 900"; break; case 0x08: result="TEMPO: SET 1800"; break; } break; case 0x16: // look for utility tempo result="TEMPO: UTILITY SET "+b2; break; case 0x01: // look for volume switch (b2) { case 0x0E: result="VOLUME: SET 0"; break; case 0x1E: result="VOLUME: SET 1"; break; case 0x2E: result="VOLUME: SET 2"; break; case 0x3E: result="VOLUME: SET 3"; break; case 0x4E: result="VOLUME: SET 4"; break; case 0x5E: result="VOLUME: SET 5"; break; case 0x6E: result="VOLUME: SET 6"; break; case 0x7E: result="VOLUME: SET 7"; break; case 0x8E: result="VOLUME: SET 8"; break; case 0x9E: result="VOLUME: SET 9"; break; case 0xAE: result="VOLUME: SET 10"; break; case 0xBE: result="VOLUME: SET 11"; break; case 0xCE: result="VOLUME: SET 12"; break; case 0xDE: result="VOLUME: SET 13"; break; case 0xEE: result="VOLUME: SET 14"; break; case 0xFE: result="VOLUME: SET 15"; break; case 0x03: result="VOLUME: BUMP 0=UP"; break; case 0x0B: result="VOLUME: BUMP 1=DOWN"; break; case 0x0F: result="REPEAT: TAIL 1"; break; case 0x02: result="PHRASE: CALL 0"; break; case 0x12: result="PHRASE: CALL 1"; break; case 0x22: result="PHRASE: CALL 2"; break; case 0x32: result="PHRASE: CALL 3"; break; case 0x42: result="PHRASE: CALL 4"; break; case 0x52: result="PHRASE: CALL 5"; break; case 0x62: result="PHRASE: CALL 6"; break; case 0x72: result="PHRASE: CALL 7"; break; case 0x82: result="PHRASE: CALL 8"; break; case 0x92: result="PHRASE: CALL 9"; break; case 0xA2: result="PHRASE: CALL 10"; break; case 0xB2: result="PHRASE: CALL 11"; break; case 0xC2: result="PHRASE: CALL 12"; break; case 0xD2: result="PHRASE: CALL 13"; break; case 0xE2: result="PHRASE: CALL 14"; break; case 0xF2: result="PHRASE: CALL 15"; break; case 0x8B: result="PHRASE: CALL 16"; break; case 0x9B: result="PHRASE: CALL 17"; break; case 0xAB: result="PHRASE: CALL 18"; break; case 0xBB: result="PHRASE: CALL 19"; break; case 0xCB: result="PHRASE: CALL 20"; break; case 0xDB: result="PHRASE: CALL 21"; break; case 0xEB: result="PHRASE: CALL 22"; break; case 0xFB: result="PHRASE: CALL 23"; break; case 0x06: result="PHRASE: DEFINE 0"; break; case 0x16: result="PHRASE: DEFINE 1"; break; case 0x26: result="PHRASE: DEFINE 2"; break; case 0x36: result="PHRASE: DEFINE 3"; break; case 0x46: result="PHRASE: DEFINE 4"; break; case 0x56: result="PHRASE: DEFINE 5"; break; case 0x66: result="PHRASE: DEFINE 6"; break; case 0x76: result="PHRASE: DEFINE 7"; break; case 0x86: result="PHRASE: DEFINE 8"; break; case 0x96: result="PHRASE: DEFINE 9"; break; case 0xA6: result="PHRASE: DEFINE 10"; break; case 0xB6: result="PHRASE: DEFINE 11"; break; case 0xC6: result="PHRASE: DEFINE 12"; break; case 0xD6: result="PHRASE: DEFINE 13"; break; case 0xE6: result="PHRASE: DEFINE 14"; break; case 0xF6: result="PHRASE: DEFINE 15"; break; case 0x83: result="PHRASE: DEFINE 16"; break; case 0x93: result="PHRASE: DEFINE 17"; break; case 0xA3: result="PHRASE: DEFINE 18"; break; case 0xB3: result="PHRASE: DEFINE 19"; break; case 0xC3: result="PHRASE: DEFINE 20"; break; case 0xD3: result="PHRASE: DEFINE 21"; break; case 0xE3: result="PHRASE: DEFINE 22"; break; case 0xF3: result="PHRASE: DEFINE 23"; break; case 0x2F: result="PHRASE: END 1"; break; case 0x04: result="ENVELOPE: ATTACK 0"; break; case 0x0C: result="ENVELOPE: ATTACK 1"; break; case 0x14: result="ENVELOPE: ATTACK 2"; break; case 0x1C: result="ENVELOPE: ATTACK 3"; break; case 0x24: result="ENVELOPE: ATTACK 4"; break; case 0x2C: result="ENVELOPE: ATTACK 5"; break; case 0x34: result="ENVELOPE: ATTACK 6"; break; case 0x3C: result="ENVELOPE: ATTACK 7"; break; case 0x44: result="ENVELOPE: ATTACK 8"; break; case 0x4C: result="ENVELOPE: ATTACK 9"; break; case 0x54: result="ENVELOPE: ATTACK 10"; break; case 0x5C: result="ENVELOPE: ATTACK 11"; break; case 0x64: result="ENVELOPE: ATTACK 12"; break; case 0x6C: result="ENVELOPE: ATTACK 13"; break; case 0x74: result="ENVELOPE: ATTACK 14"; break; case 0x7C: result="ENVELOPE: ATTACK 15" ; break; case 0x00: result="ENVELOPE: DECAY 0"; break; case 0x10: result="ENVELOPE: DECAY 1"; break; case 0x20: result="ENVELOPE: DECAY 2"; break; case 0x30: result="ENVELOPE: DECAY 3"; break; case 0x40: result="ENVELOPE: DECAY 4"; break; case 0x50: result="ENVELOPE: DECAY 5"; break; case 0x60: result="ENVELOPE: DECAY 6"; break; case 0x70: result="ENVELOPE: DECAY 7"; break; case 0x80: result="ENVELOPE: DECAY 8"; break; case 0x90: result="ENVELOPE: DECAY 9"; break; case 0xA0: result="ENVELOPE: DECAY 10"; break; case 0xB0: result="ENVELOPE: DECAY 11"; break; case 0xC0: result="ENVELOPE: DECAY 12"; break; case 0xD0: result="ENVELOPE: DECAY 13"; break; case 0xE0: result="ENVELOPE: DECAY 14"; break; case 0xF0: result="ENVELOPE: DECAY 15" ; break; case 0x84: result="ENVELOPE: SUSTAIN 0"; break; case 0x8C: result="ENVELOPE: SUSTAIN 1"; break; case 0x94: result="ENVELOPE: SUSTAIN 2"; break; case 0x9C: result="ENVELOPE: SUSTAIN 3"; break; case 0xA4: result="ENVELOPE: SUSTAIN 4"; break; case 0xAC: result="ENVELOPE: SUSTAIN 5"; break; case 0xB4: result="ENVELOPE: SUSTAIN 6"; break; case 0xBC: result="ENVELOPE: SUSTAIN 7"; break; case 0xC4: result="ENVELOPE: SUSTAIN 8"; break; case 0xCC: result="ENVELOPE: SUSTAIN 9"; break; case 0xD4: result="ENVELOPE: SUSTAIN 10"; break; case 0xDC: result="ENVELOPE: SUSTAIN 11"; break; case 0xE4: result="ENVELOPE: SUSTAIN 12"; break; case 0xEC: result="ENVELOPE: SUSTAIN 13"; break; case 0xF4: result="ENVELOPE: SUSTAIN 14"; break; case 0xFC: result="ENVELOPE: SUSTAIN 15" ; break; case 0x08: result="ENVELOPE: RELEASE 0"; break; case 0x18: result="ENVELOPE: RELEASE 1"; break; case 0x28: result="ENVELOPE: RELEASE 2"; break; case 0x38: result="ENVELOPE: RELEASE 3"; break; case 0x48: result="ENVELOPE: RELEASE 4"; break; case 0x58: result="ENVELOPE: RELEASE 5"; break; case 0x68: result="ENVELOPE: RELEASE 6"; break; case 0x78: result="ENVELOPE: RELEASE 7"; break; case 0x88: result="ENVELOPE: RELEASE 8"; break; case 0x98: result="ENVELOPE: RELEASE 9"; break; case 0xA8: result="ENVELOPE: RELEASE 10"; break; case 0xB8: result="ENVELOPE: RELEASE 11"; break; case 0xC8: result="ENVELOPE: RELEASE 12"; break; case 0xD8: result="ENVELOPE: RELEASE 13"; break; case 0xE8: result="ENVELOPE: RELEASE 14"; break; case 0xF8: result="ENVELOPE: RELEASE 15" ; break; case 0x07: result="WAVEFORM: SET 0=N (NOISE)"; break; case 0x27: result="WAVEFORM: SET 1=T (TRIANGE)"; break; case 0x47: result="WAVEFORM: SET 2=S (SAWTOOTH)"; break; case 0x67: result="WAVEFORM: SET 3=TS (TRIANGE+SAWTOOTH)"; break; case 0x87: result="WAVEFORM: SET 4=P (PULSE)"; break; case 0xA7: result="WAVEFORM: SET 5=TP (TRIANGE+PULSE)"; break; case 0xC7: result="WAVEFORM: SET 6=SP (SAWTOOTH+PULSE)"; break; case 0xE7: result="WAVEFORM: SET 7=TSP (PULSE+TRIANGLE+SAWTOOTH)"; break; case 0x33: result="WAVEFORM: SYNC 0=NO"; break; case 0x3B: result="WAVEFORM: SYNC 1=YES"; break; case 0x23: result="WAVEFORM: RING MODE 0=NO"; break; case 0x2B: result="WAVEFORM: RING MODE 1=YES"; break; case 0x73: result="FREQ: POR & VIBRATO 0=NO"; break; case 0x7B: result="FREQ: POR & VIBRATO 1=YES"; break; case 0x17: result="FILTER: MODE 0=N (NORMAL)"; break; case 0x37: result="FILTER: MODE 1=L (LOW PASS)"; break; case 0x57: result="FILTER: MODE 2=B (BAND PASS)"; break; case 0x77: result="FILTER: MODE 3=LB"; break; case 0x97: result="FILTER: MODE 4=H (HIGH PASS)"; break; case 0xB7: result="FILTER: MODE 5=LH"; break; case 0xD7: result="FILTER: MODE 6=BH"; break; case 0xF7: result="FILTER: MODE 7=LBH"; break; case 0x0A: result="FILTER: RESONANCE 0"; break; case 0x1A: result="FILTER: RESONANCE 1"; break; case 0x2A: result="FILTER: RESONANCE 2"; break; case 0x3A: result="FILTER: RESONANCE 3"; break; case 0x4A: result="FILTER: RESONANCE 4"; break; case 0x5A: result="FILTER: RESONANCE 5"; break; case 0x6A: result="FILTER: RESONANCE 6"; break; case 0x7A: result="FILTER: RESONANCE 7"; break; case 0x8A: result="FILTER: RESONANCE 8"; break; case 0x9A: result="FILTER: RESONANCE 9"; break; case 0xAA: result="FILTER: RESONANCE 10"; break; case 0xBA: result="FILTER: RESONANCE 11"; break; case 0xCA: result="FILTER: RESONANCE 12"; break; case 0xDA: result="FILTER: RESONANCE 13"; break; case 0xEA: result="FILTER: RESONANCE 14"; break; case 0xFA: result="FILTER: RESONANCE 15"; break; case 0x13: result="FILTER: THROUGH 0=NO"; break; case 0x1B: result="FILTER: THROUGH 0=YES"; break; case 0x43: result="FILTER: EXTERNAL 0=NO"; break; case 0x4B: result="FILTER: EXTERNAL 0=YES"; break; case 0x63: result="MODULATION: SOFTWARE LFO 0"; break; case 0x6B: result="MODULATION: SOFTWARE LFO 1"; break; case 0x01: result="MODULATION: LFO RATE UP 0"; break; case 0x09: result="MODULATION: LFO RATE UP 1"; break; case 0x11: result="MODULATION: LFO RATE UP 2"; break; case 0x19: result="MODULATION: LFO RATE UP 3"; break; case 0x21: result="MODULATION: LFO RATE UP 4"; break; case 0x29: result="MODULATION: LFO RATE UP 5"; break; case 0x31: result="MODULATION: LFO RATE UP 6"; break; case 0x39: result="MODULATION: LFO RATE UP 7"; break; case 0x41: result="MODULATION: LFO RATE UP 8"; break; case 0x49: result="MODULATION: LFO RATE UP 9"; break; case 0x51: result="MODULATION: LFO RATE UP 10"; break; case 0x59: result="MODULATION: LFO RATE UP 11"; break; case 0x61: result="MODULATION: LFO RATE UP 12"; break; case 0x69: result="MODULATION: LFO RATE UP 13"; break; case 0x71: result="MODULATION: LFO RATE UP 14"; break; case 0x79: result="MODULATION: LFO RATE UP 15"; break; case 0x81: result="MODULATION: LFO RATE UP 16"; break; case 0x89: result="MODULATION: LFO RATE UP 17"; break; case 0x91: result="MODULATION: LFO RATE UP 18"; break; case 0x99: result="MODULATION: LFO RATE UP 19"; break; case 0xA1: result="MODULATION: LFO RATE UP 20"; break; case 0xA9: result="MODULATION: LFO RATE UP 21"; break; case 0xB1: result="MODULATION: LFO RATE UP 22"; break; case 0xB9: result="MODULATION: LFO RATE UP 23"; break; case 0xC1: result="MODULATION: LFO RATE UP 24"; break; case 0xC9: result="MODULATION: LFO RATE UP 25"; break; case 0xD1: result="MODULATION: LFO RATE UP 26"; break; case 0xD9: result="MODULATION: LFO RATE UP 27"; break; case 0xE1: result="MODULATION: LFO RATE UP 28"; break; case 0xE9: result="MODULATION: LFO RATE UP 29"; break; case 0xF1: result="MODULATION: LFO RATE UP 30"; break; case 0xF9: result="MODULATION: LFO RATE UP 31"; break; case 0x05: result="MODULATION: LFO RATE DOWN 0"; break; case 0x0D: result="MODULATION: LFO RATE DOWN 1"; break; case 0x15: result="MODULATION: LFO RATE DOWN 2"; break; case 0x1D: result="MODULATION: LFO RATE DOWN 3"; break; case 0x25: result="MODULATION: LFO RATE DOWN 4"; break; case 0x2D: result="MODULATION: LFO RATE DOWN 5"; break; case 0x35: result="MODULATION: LFO RATE DOWN 6"; break; case 0x3D: result="MODULATION: LFO RATE DOWN 7"; break; case 0x45: result="MODULATION: LFO RATE DOWN 8"; break; case 0x4D: result="MODULATION: LFO RATE DOWN 9"; break; case 0x55: result="MODULATION: LFO RATE DOWN 10"; break; case 0x5D: result="MODULATION: LFO RATE DOWN 11"; break; case 0x65: result="MODULATION: LFO RATE DOWN 12"; break; case 0x6D: result="MODULATION: LFO RATE DOWN 13"; break; case 0x75: result="MODULATION: LFO RATE DOWN 14"; break; case 0x7D: result="MODULATION: LFO RATE DOWN 15"; break; case 0x85: result="MODULATION: LFO RATE DOWN 16"; break; case 0x8D: result="MODULATION: LFO RATE DOWN 17"; break; case 0x95: result="MODULATION: LFO RATE DOWN 18"; break; case 0x9D: result="MODULATION: LFO RATE DOWN 19"; break; case 0xA5: result="MODULATION: LFO RATE DOWN 20"; break; case 0xAD: result="MODULATION: LFO RATE DOWN 21"; break; case 0xB5: result="MODULATION: LFO RATE DOWN 22"; break; case 0xBD: result="MODULATION: LFO RATE DOWN 23"; break; case 0xC5: result="MODULATION: LFO RATE DOWN 24"; break; case 0xCD: result="MODULATION: LFO RATE DOWN 25"; break; case 0xD5: result="MODULATION: LFO RATE DOWN 26"; break; case 0xDD: result="MODULATION: LFO RATE DOWN 27"; break; case 0xE5: result="MODULATION: LFO RATE DOWN 28"; break; case 0xED: result="MODULATION: LFO RATE DOWN 29"; break; case 0xF5: result="MODULATION: LFO RATE DOWN 30"; break; case 0xFD: result="MODULATION: LFO RATE DOWN 31"; break; case 0x1F: result="MODULATION: SOURCE 0"; break; case 0x3F: result="MODULATION: SOURCE 1"; break; case 0x5F: result="MODULATION: SOURCE 2"; break; case 0x8F: result="MODULATION: DESTINATION 0"; break; case 0xAF: result="MODULATION: DESTINATION 1"; break; case 0xCF: result="MODULATION: DESTINATION 2"; break; case 0xFF: result="MODULATION: DESTINATION 3"; break; case 0x53: result="MISC: VOICE 3 OFF 0=NO"; break; case 0x5B: result="MISC: VOICE 3 OFF 0=YES"; break; case 0x4F: result="MISC: HALT 1"; break; } break; case 0x36: result="REPEAT: HEAD "+b2; break; case 0x26: result="ENVELOPE: RLS POINT "+b2; break; case 0x4E: result="ENVELOPE: HOLD TIME "+b2; break; case 0x56: result="WAVEFORM: PULSE SWEEP "+(byte)b2; break; case 0xC6: result="WAVEFORM: PULSE VIB DPT "+b2; if ((b2 & 0x80)!=0) result+= " ???"; break; case 0xD6: result="WAVEFORM: PULSE VIB RAT "+b2; if ((b2 & 0x80)!=0) result+= " ???"; break; case 0x76: result="FREQ: VIBRATO DEPTH "+b2; if ((b2 & 0x80)!=0) result+= " ???"; break; case 0x86: result="FREQ: VIBRATO RATE "+b2; if ((b2 & 0x80)!=0) result+= " ???"; break; case 0x96: result="FILTER: AUTO "+(byte)b2; break; case 0x0E: result="FILTER: CUTOFF "+b2; break; case 0x66: result="FILTER: SWEEP "+(byte)b2; break; case 0x6E: result="MODULATION: SCALE "+(byte)b2; if ((byte)b2>7 || (byte)b2<-7) result+= " ???"; break; case 0xE6: result="MODULATION: MAX VALUE "+b2; break; case 0x1E: result="MISC: MEASURE # "+b2; break; case 0x5E: result="MISC: MEASURE # "+(b2+256); break; case 0x9E: result="MISC: MEASURE # "+(b2+512); break; case 0xDE: result="MISC: MEASURE # "+(b2+768); break; case 0xF6: result="MISC: UTL-VOICE SET "+b2; break; case 0x46: result="MISC: FLAG "+b2; break; case 0xB6: result="MISC: AUXILIARY "+b2; break; case 0xA6: if ((b2 & 0x01)==0x00) { // positive transpose result="FREQ: TRANSPOSE +"+((7- (int)((b2 & 0x0E)>>1) )*12)+((int)((b2 & 0xF0)>>4)); } else { // negative transpose result="FREQ: TRANSPOSE -"+(((int)((b2 & 0x0E)>>1))*12)+((int)((b2 & 0xF0)>>4)); } break; case 0x2E: result="FREQ: RELATIVE TPS "+ ((int)(3-(b2 &0x07))+ (int)((b2 & 0xF8)>>3)); break; default: // look for all the other cases if ((b1 & 0x0F)==0x02) { result="WAVEFORM:PULSE WIDTH "+ ((int)((b1 & 0xF0)<<4)+b2); } if ((b1 & 0x03)==0x03) { result="FREQ: PORTAMENTO "+ ((int)((b1 & 0xFC)<<6)+b2); } if ((b1 & 0x1F)==0x1A) { result="FREQ: DETUNE "+(((int)((b1 & 0xE0)<<3)+b2)-2048); } if ((b1 & 0x1F)==0x0A) { result="FREQ: DETUNE "+((int)((b1 & 0xE0)<<3)+b2); } if ((b1 & 0x30)==0x30) { result="MISC: JIFFY LENGTH "+((int)((b1 & 0xC0)<<2)+b2-200); } } } this.pos+=2; this.pc+=2; return ShortToExe((int)pc)+" "+ByteToExe(b1)+" "+ByteToExe(b2)+ " "+result; } /** * Comment and Disassemble a region of the buffer * * @param buffer the buffer containing the code * @param start the start position in buffer * @param end the end position in buffer * @param pc the programn counter for start position * @return a string rapresentation of disasemble with comment */ @Override public String cdasm(byte[] buffer, int start, int end, long pc) { StringBuilder result=new StringBuilder (""); // resulting string String tmp; // local temp string String tmp2; // local temp string int pos=start; // actual position in buffer this.pos=pos; this.pc=pc; while (pos<end | pos<start) { // verify also that don't circle in the buffer tmp=dasm(buffer); pos=this.pos; pc=this.pc; result.append(tmp).append("\n"); } return result.toString(); } }
27,128
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
Unsigned.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/math/Unsigned.java
/** * @(#)Unsigned.java 1999/08/21 * * ICE Team Free Software Group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.math; /** * Calculate unsigned int of passed value * * @author Ice * @version 1.00 20/08/1999 */ public final class Unsigned { /** * Calculate the unsigned int of a byte * * @param value the byte value to convert * @return the unsigned int of the value */ public static final int done(byte value) { //int tmp=value; //if (tmp<0) tmp+=256; //return tmp; return (value & 0xFF); } /** * Calculate the unsigned int of a short * * @param value the byte value to convert * @return the unsigned int of the value */ public static final int done(short value) { //int tmp=value; //if (tmp<0) tmp+=65438; //return tmp; return (value & 0xFFFF); } }
1,637
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
Shared.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/swing/Shared.java
/** * @(#)Shared.java 2021/04/17 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.swing; import java.awt.Rectangle; import java.util.ArrayList; import java.util.Locale; import java.util.UUID; import javax.swing.JTable; import javax.swing.JViewport; import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; /** * Contains all shared object accessible by the application * * @author ice */ public class Shared { /** List of used frames. Each frame must register here */ public static final ArrayList framesList=new ArrayList(); /** List of used syntax highlight text area. Each ot if must regisetr here */ public static final ArrayList<RSyntaxTextArea> syntaxList=new ArrayList(); /** Version of the application */ public static final String VERSION="3.0"; /** Instance UUID */ public static final UUID uuid=UUID.randomUUID(); /** * Convert a unsigned short (containing in a int) to Exe upper case 4 chars * * @param value the short value to convert * @return the exe string rapresentation of byte */ public static String ShortToExe(int value) { int tmp=value; if (value<0) return "????"; String ret=Integer.toHexString(tmp); int len=ret.length(); switch (len) { case 1: ret="000"+ret; break; case 2: ret="00"+ret; break; case 3: ret="0"+ret; break; } return ret.toUpperCase(Locale.ENGLISH); } /** * Convert a unsigned byte (containing in a int) to Exe upper case 2 chars * * @param value the byte value to convert * @return the exe string rapresentation of byte */ public static String ByteToExe(int value) { int tmp=value; if (value<0) return "??"; String ret=Integer.toHexString(tmp); if (ret.length()==1) ret="0"+ret; return ret.toUpperCase(Locale.ENGLISH); } /** * Scroll cursor to center of view in table * * @param table th table to use * @param rowIndex the row that must be at center * @param vColIndex the column to use */ public static void scrollToCenter(JTable table, int rowIndex, int vColIndex) { if (!(table.getParent() instanceof JViewport)) { return; } JViewport viewport = (JViewport) table.getParent(); Rectangle rect = table.getCellRect(rowIndex, vColIndex, true); Rectangle viewRect = viewport.getViewRect(); rect.setLocation(rect.x - viewRect.x, rect.y - viewRect.y); int centerX = (viewRect.width - rect.width) / 2; int centerY = (viewRect.height - rect.height) / 2; if (rect.x < centerX) { centerX = -centerX; } if (rect.y < centerY) { centerY = -centerY; } rect.translate(centerX, centerY); viewport.scrollRectToVisible(rect); } }
3,729
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
JAboutDialog.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/swing/JAboutDialog.java
/** * @(#)JAboutDialog.java 2019/12/29 * * ICE Team free software group * * This file is part of JIIT64 Java Ice Team Tracker 64 * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.swing; /** * About dialog * * @author ice */ public class JAboutDialog extends javax.swing.JDialog { /** Creates new form JAboutDialog */ public JAboutDialog(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); Shared.framesList.add(this); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabelLogo = new javax.swing.JLabel(); jLabelTitle = new javax.swing.JLabel(); jLabelPresent = new javax.swing.JLabel(); jButtonClose = new javax.swing.JButton(); jLabelVersion = new javax.swing.JLabel(); jLabelYear = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("About"); setResizable(false); jLabelLogo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabelLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sw_emulator/swing/images/IceTeamLogo.png"))); // NOI18N jLabelTitle.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabelTitle.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sw_emulator/swing/images/jc64dis.png"))); // NOI18N jLabelPresent.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabelPresent.setText("Present"); jButtonClose.setText("Close"); jButtonClose.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonCloseActionPerformed(evt); } }); jLabelVersion.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabelVersion.setText("Version "+Shared.VERSION); jLabelVersion.setToolTipText(""); jLabelYear.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabelYear.setText("(c) 2024"); jLabelYear.setToolTipText(""); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabelTitle, javax.swing.GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE) .addComponent(jLabelLogo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabelPresent, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addGap(155, 155, 155) .addComponent(jButtonClose, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(166, 166, 166)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabelVersion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabelYear, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabelLogo) .addGap(13, 13, 13) .addComponent(jLabelPresent) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabelTitle) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabelVersion) .addGap(12, 12, 12) .addComponent(jLabelYear) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE) .addComponent(jButtonClose, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(6, 6, 6)) ); setSize(new java.awt.Dimension(453, 337)); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void jButtonCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCloseActionPerformed setVisible(false); }//GEN-LAST:event_jButtonCloseActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { JAboutDialog dialog = new JAboutDialog(new javax.swing.JFrame(), true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButtonClose; private javax.swing.JLabel jLabelLogo; private javax.swing.JLabel jLabelPresent; private javax.swing.JLabel jLabelTitle; private javax.swing.JLabel jLabelVersion; private javax.swing.JLabel jLabelYear; // End of variables declaration//GEN-END:variables }
7,210
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
JASPanel.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/swing/JASPanel.java
/** * @(#)JASPanel 2024/04/19 * * ICE Team free software group * * This file is part of C64 Java Software Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.swing; import sw_emulator.software.Assembler; import sw_emulator.swing.main.Option; /** * A panel for AS assembler option * * @author ice */ public class JASPanel extends javax.swing.JPanel { /** Option file to use */ Option option; /** * Creates new form JASPanel */ public JASPanel() { initComponents(); } /** * Set up the panel with the option * * @param option the option to use */ public void setUp(Option option) { this.option=option; } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabelASLabelDeclaration = new javax.swing.JLabel(); jRadioButtonASLabelName = new javax.swing.JRadioButton(); jScrollPaneASByte = new javax.swing.JScrollPane(); jTextPaneGlassLabelName = new javax.swing.JTextPane(); jLabelASByteDeclaration = new javax.swing.JLabel(); jRadioButtonASDbByte = new javax.swing.JRadioButton(); jScrollPaneASWord = new javax.swing.JScrollPane(); jTextPaneASDbByte = new javax.swing.JTextPane(); jLabelASWordDeclaration = new javax.swing.JLabel(); jRadioButtonASDwWord = new javax.swing.JRadioButton(); jScrollPaneASDotWord = new javax.swing.JScrollPane(); jTextPaneASDwWord = new javax.swing.JTextPane(); jLabelASCommentDeclaration = new javax.swing.JLabel(); jRadioButtonASSemicolonComment = new javax.swing.JRadioButton(); jScrollPaneASSemicolonComment = new javax.swing.JScrollPane(); jTextPaneASSemicolonComment = new javax.swing.JTextPane(); jLabelASBlockCommentDeclaration = new javax.swing.JLabel(); jRadioButtonASSemicolonBlockComment = new javax.swing.JRadioButton(); jScrollPaneASSemicolonBlockComment1 = new javax.swing.JScrollPane(); jTextPaneTmpxSemicolonBlockComment1 = new javax.swing.JTextPane(); jLabelASOriginDeclaration = new javax.swing.JLabel(); jRadioButtonASOrigin = new javax.swing.JRadioButton(); jScrollPaneASAsterixOrigin1 = new javax.swing.JScrollPane(); jTextPaneASOrigin = new javax.swing.JTextPane(); jLabelASStartingDeclaration = new javax.swing.JLabel(); jRadioButtonASStarting = new javax.swing.JRadioButton(); jScrollPaneASStarting = new javax.swing.JScrollPane(); jTextPaneASStarting = new javax.swing.JTextPane(); jLabelASMonoSpriteDeclaration = new javax.swing.JLabel(); jLabelASMultiSpriteDeclaration = new javax.swing.JLabel(); jRadioButtonASByteHexMonoSprite = new javax.swing.JRadioButton(); jRadioButtonASByteHexMultiSprite = new javax.swing.JRadioButton(); jScrollPaneASByteHexMultiSprite = new javax.swing.JScrollPane(); TmpxPaneGlassByteHexMultiSprite = new javax.swing.JTextPane(); jScrollPaneASByteHexMonoSprite = new javax.swing.JScrollPane(); jTextPaneGlassByteHexMonoSprite = new javax.swing.JTextPane(); jRadioButtonASByteBinMonoSprite = new javax.swing.JRadioButton(); jRadioButtonASByteBinMultiSprite = new javax.swing.JRadioButton(); jScrollPaneASByteBinMultiSprite = new javax.swing.JScrollPane(); jTextPaneGlassByteBinMultiSprite = new javax.swing.JTextPane(); jScrollPaneASByteBinMonoSprite = new javax.swing.JScrollPane(); jTextPaneGlassByteBinMonoSprite = new javax.swing.JTextPane(); jRadioButtonASMacroHexMonoSprite = new javax.swing.JRadioButton(); jRadioButtonASMacroHexMultiSprite = new javax.swing.JRadioButton(); jScrollPaneASMacroHexMultiSprite = new javax.swing.JScrollPane(); jTextPaneGlassMacroHexMultiSprite = new javax.swing.JTextPane(); jScrollPaneASMacroHexMonoSprite = new javax.swing.JScrollPane(); jTextPaneGlassMacroHexMonoSprite = new javax.swing.JTextPane(); jRadioButtonASMacroBinMonoSprite = new javax.swing.JRadioButton(); jRadioButtonASMacroBinMultiSprite = new javax.swing.JRadioButton(); jScrollPaneASMacroBinMultiSprite = new javax.swing.JScrollPane(); jTextPaneGlassMacroBinMultiSprite = new javax.swing.JTextPane(); jScrollPaneASMacroBinMonoSprite = new javax.swing.JScrollPane(); jTextPaneGlassMacroBinMonoSprite = new javax.swing.JTextPane(); jLabelASTribyteDeclaration = new javax.swing.JLabel(); jRadioButtonASMacroTribyte = new javax.swing.JRadioButton(); jScrollPaneASMacroTribyte = new javax.swing.JScrollPane(); jTextPaneGlassMacroTribyte = new javax.swing.JTextPane(); jLabelASLongDeclaration = new javax.swing.JLabel(); jRadioButtonASDdLong = new javax.swing.JRadioButton(); jScrollPaneASMacroLong = new javax.swing.JScrollPane(); jTextPaneGlassMacroLong = new javax.swing.JTextPane(); jLabelASWordSwappedDeclaration = new javax.swing.JLabel(); jRadioButtonASMacroWordSwapped = new javax.swing.JRadioButton(); jScrollPaneASMacroWordSwapped = new javax.swing.JScrollPane(); jTextPaneGlassMacroWordSwapped = new javax.swing.JTextPane(); jLabelASTextDeclaration = new javax.swing.JLabel(); jRadioButtonASDbText = new javax.swing.JRadioButton(); jScrollPaneASDotText = new javax.swing.JScrollPane(); jTextPaneGlassDbText = new javax.swing.JTextPane(); jLabelASNumTextDeclaration = new javax.swing.JLabel(); jRadioButtonASDbNumText = new javax.swing.JRadioButton(); jScrollPaneASDotTextNumText = new javax.swing.JScrollPane(); jTextPaneGlassDbNumText = new javax.swing.JTextPane(); jLabelASZeroTextDeclaration = new javax.swing.JLabel(); jRadioButtonASDbZeroText = new javax.swing.JRadioButton(); jScrollPaneASDotNullZeroText = new javax.swing.JScrollPane(); jTextPaneGlassDbZeroText = new javax.swing.JTextPane(); jLabelASAddressDeclaration = new javax.swing.JLabel(); jRadioButtonASDwAddress = new javax.swing.JRadioButton(); jScrollPaneASDotAddrAddress = new javax.swing.JScrollPane(); jTextPaneGlassDwAddress = new javax.swing.JTextPane(); jLabelTmpxASStackWordDeclaration = new javax.swing.JLabel(); jRadioButtonASMacroStackWord = new javax.swing.JRadioButton(); jScrollPaneASDotRtaStackWord = new javax.swing.JScrollPane(); jTextPaneGlassMacroStackWord = new javax.swing.JTextPane(); jLabelASHighTextDeclaration = new javax.swing.JLabel(); jRadioButtonASDbHighText = new javax.swing.JRadioButton(); jScrollPaneASDotShiftHighText = new javax.swing.JScrollPane(); jTextPaneGlassDbHighText = new javax.swing.JTextPane(); jLabelASShiftTextDeclaration = new javax.swing.JLabel(); jRadioButtonASDbShiftText = new javax.swing.JRadioButton(); jScrollPaneASDotShiftlShiftText = new javax.swing.JScrollPane(); jTextPaneGlassDbShiftText = new javax.swing.JTextPane(); jLabelASScreenTextDeclaration = new javax.swing.JLabel(); jRadioButtonASDbScreenText = new javax.swing.JRadioButton(); jScrollPaneASDotScreenText = new javax.swing.JScrollPane(); jTextPaneDbScreenText = new javax.swing.JTextPane(); jLabelASPetasciiTextDeclaration = new javax.swing.JLabel(); jRadioButtonASDbPetasciiText = new javax.swing.JRadioButton(); jScrollPaneASDotPetasciiText = new javax.swing.JScrollPane(); jTextPaneGlassDbPetasciiText = new javax.swing.JTextPane(); jRadioButtonASLabelNameColon = new javax.swing.JRadioButton(); jScrollPaneASLabelNameColon = new javax.swing.JScrollPane(); jTextPaneGlassLabelNameColon = new javax.swing.JTextPane(); jLabelASLabelDeclaration.setText("Label:"); jRadioButtonASLabelName.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASLabelNameItemStateChanged(evt); } }); jScrollPaneASByte.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASByte.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassLabelName.setEditable(false); jTextPaneGlassLabelName.setContentType("text/html"); // NOI18N jTextPaneGlassLabelName.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <font color='black'>zzzz</font>\n </p\n </body>\n</html>\n"); jScrollPaneASByte.setViewportView(jTextPaneGlassLabelName); jLabelASByteDeclaration.setText("Byte:"); jRadioButtonASDbByte.setSelected(true); jRadioButtonASDbByte.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASDbByteItemStateChanged(evt); } }); jScrollPaneASWord.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASWord.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneASDbByte.setEditable(false); jTextPaneASDbByte.setContentType("text/html"); // NOI18N jTextPaneASDbByte.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b> db</b> <font color='red'>$xx</font> | <b> db</b> <font color='red'>xxh</font><br>\n <b> db</b> <font color='blue'>dd</font> | <b> db</b> <font color='blue'>dd</font><br>\n <b> db</b> <font color='green'>%nn</font> | <b> db</b> <font color='green'>nnb</font><br>\n <b> db</b> <font color='purple'>'c'</font> | <b> db</b> <font color='purple'>'c'</font>\n </p>\n </body>\n</html>\n"); jScrollPaneASWord.setViewportView(jTextPaneASDbByte); jLabelASWordDeclaration.setText("Word:"); jRadioButtonASDwWord.setSelected(true); jRadioButtonASDwWord.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASDwWordItemStateChanged(evt); } }); jScrollPaneASDotWord.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASDotWord.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneASDwWord.setEditable(false); jTextPaneASDwWord.setContentType("text/html"); // NOI18N jTextPaneASDwWord.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b> dw</b> <font color='red'>$xxyy</font> | <b> dw</b> <font color='red'>xxyyh</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASDotWord.setViewportView(jTextPaneASDwWord); jLabelASCommentDeclaration.setText("Comment:"); jRadioButtonASSemicolonComment.setSelected(true); jRadioButtonASSemicolonComment.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASSemicolonCommentItemStateChanged(evt); } }); jScrollPaneASSemicolonComment.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASSemicolonComment.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneASSemicolonComment.setEditable(false); jTextPaneASSemicolonComment.setContentType("text/html"); // NOI18N jTextPaneASSemicolonComment.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>;</b> xxx\n </p>\n </body>\n</html>\n"); jScrollPaneASSemicolonComment.setViewportView(jTextPaneASSemicolonComment); jLabelASBlockCommentDeclaration.setText("Block Comment:"); jRadioButtonASSemicolonBlockComment.setSelected(true); jRadioButtonASSemicolonBlockComment.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASSemicolonBlockCommentItemStateChanged(evt); } }); jScrollPaneASSemicolonBlockComment1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASSemicolonBlockComment1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneTmpxSemicolonBlockComment1.setEditable(false); jTextPaneTmpxSemicolonBlockComment1.setContentType("text/html"); // NOI18N jTextPaneTmpxSemicolonBlockComment1.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>;</b> xxx\n </p>\n </body>\n</html>\n"); jScrollPaneASSemicolonBlockComment1.setViewportView(jTextPaneTmpxSemicolonBlockComment1); jLabelASOriginDeclaration.setText("Origin:"); jRadioButtonASOrigin.setSelected(true); jRadioButtonASOrigin.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASOriginItemStateChanged(evt); } }); jScrollPaneASAsterixOrigin1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASAsterixOrigin1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneASOrigin.setEditable(false); jTextPaneASOrigin.setContentType("text/html"); // NOI18N jTextPaneASOrigin.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>org</b> $xxyy | <b>org</b> xxyyh\n </p>\n </body>\n</html>\n\n"); jScrollPaneASAsterixOrigin1.setViewportView(jTextPaneASOrigin); jLabelASStartingDeclaration.setText("Starting:"); jRadioButtonASStarting.setSelected(true); jRadioButtonASStarting.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASStartingItemStateChanged(evt); } }); jScrollPaneASStarting.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASStarting.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneASStarting.setEditable(false); jTextPaneASStarting.setContentType("text/html"); // NOI18N jTextPaneASStarting.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>cpu</b> 6502 | <b> cpu</b> 8048\n </p>\n </body>\n</html>\n"); jScrollPaneASStarting.setViewportView(jTextPaneASStarting); jLabelASMonoSpriteDeclaration.setText("Monocolor sprite:"); jLabelASMultiSpriteDeclaration.setText("Multicolor sprite:"); jRadioButtonASByteHexMonoSprite.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASByteHexMonoSpriteItemStateChanged(evt); } }); jRadioButtonASByteHexMultiSprite.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASByteHexMultiSpriteItemStateChanged(evt); } }); jScrollPaneASByteHexMultiSprite.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASByteHexMultiSprite.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); TmpxPaneGlassByteHexMultiSprite.setEditable(false); TmpxPaneGlassByteHexMultiSprite.setContentType("text/html"); // NOI18N TmpxPaneGlassByteHexMultiSprite.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b> [byte]</b> <font color='red'>$xx..</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASByteHexMultiSprite.setViewportView(TmpxPaneGlassByteHexMultiSprite); jScrollPaneASByteHexMonoSprite.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASByteHexMonoSprite.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassByteHexMonoSprite.setEditable(false); jTextPaneGlassByteHexMonoSprite.setContentType("text/html"); // NOI18N jTextPaneGlassByteHexMonoSprite.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b> [byte]</b> <font color='red'>$xx..</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASByteHexMonoSprite.setViewportView(jTextPaneGlassByteHexMonoSprite); jRadioButtonASByteBinMonoSprite.setSelected(true); jRadioButtonASByteBinMonoSprite.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASByteBinMonoSpriteItemStateChanged(evt); } }); jRadioButtonASByteBinMultiSprite.setSelected(true); jRadioButtonASByteBinMultiSprite.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASByteBinMultiSpriteItemStateChanged(evt); } }); jScrollPaneASByteBinMultiSprite.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASByteBinMultiSprite.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassByteBinMultiSprite.setEditable(false); jTextPaneGlassByteBinMultiSprite.setContentType("text/html"); // NOI18N jTextPaneGlassByteBinMultiSprite.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>[byte]</b> <font color='red'>%b..</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASByteBinMultiSprite.setViewportView(jTextPaneGlassByteBinMultiSprite); jScrollPaneASByteBinMonoSprite.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASByteBinMonoSprite.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassByteBinMonoSprite.setEditable(false); jTextPaneGlassByteBinMonoSprite.setContentType("text/html"); // NOI18N jTextPaneGlassByteBinMonoSprite.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>[byte]</b> <font color='red'>%b..</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASByteBinMonoSprite.setViewportView(jTextPaneGlassByteBinMonoSprite); jRadioButtonASMacroHexMonoSprite.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASMacroHexMonoSpriteItemStateChanged(evt); } }); jRadioButtonASMacroHexMultiSprite.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASMacroHexMultiSpriteItemStateChanged(evt); } }); jScrollPaneASMacroHexMultiSprite.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASMacroHexMultiSprite.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassMacroHexMultiSprite.setEditable(false); jTextPaneGlassMacroHexMultiSprite.setContentType("text/html"); // NOI18N jTextPaneGlassMacroHexMultiSprite.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>[.mac] </b> <font color='red'>$xx..</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASMacroHexMultiSprite.setViewportView(jTextPaneGlassMacroHexMultiSprite); jScrollPaneASMacroHexMonoSprite.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASMacroHexMonoSprite.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassMacroHexMonoSprite.setEditable(false); jTextPaneGlassMacroHexMonoSprite.setContentType("text/html"); // NOI18N jTextPaneGlassMacroHexMonoSprite.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>[.mac] </b> <font color='red'>$xx..</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASMacroHexMonoSprite.setViewportView(jTextPaneGlassMacroHexMonoSprite); jRadioButtonASMacroBinMonoSprite.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASMacroBinMonoSpriteItemStateChanged(evt); } }); jRadioButtonASMacroBinMultiSprite.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASMacroBinMultiSpriteItemStateChanged(evt); } }); jScrollPaneASMacroBinMultiSprite.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASMacroBinMultiSprite.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassMacroBinMultiSprite.setEditable(false); jTextPaneGlassMacroBinMultiSprite.setContentType("text/html"); // NOI18N jTextPaneGlassMacroBinMultiSprite.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>[.mac] </b> <font color='red'>%b..</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASMacroBinMultiSprite.setViewportView(jTextPaneGlassMacroBinMultiSprite); jScrollPaneASMacroBinMonoSprite.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASMacroBinMonoSprite.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassMacroBinMonoSprite.setEditable(false); jTextPaneGlassMacroBinMonoSprite.setContentType("text/html"); // NOI18N jTextPaneGlassMacroBinMonoSprite.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>[.mac] </b> <font color='red'>%b..</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASMacroBinMonoSprite.setViewportView(jTextPaneGlassMacroBinMonoSprite); jLabelASTribyteDeclaration.setText("Tribyte:"); jRadioButtonASMacroTribyte.setSelected(true); jRadioButtonASMacroTribyte.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASMacroTribyteItemStateChanged(evt); } }); jScrollPaneASMacroTribyte.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASMacroTribyte.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassMacroTribyte.setEditable(false); jTextPaneGlassMacroTribyte.setContentType("text/html"); // NOI18N jTextPaneGlassMacroTribyte.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>[.mc]</b> <font color='red'>$xxyyzz</font> |<b> [.mc]</b> <font color='red'>xxyyzzh</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASMacroTribyte.setViewportView(jTextPaneGlassMacroTribyte); jLabelASLongDeclaration.setText("Long:"); jRadioButtonASDdLong.setSelected(true); jRadioButtonASDdLong.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASDdLongItemStateChanged(evt); } }); jScrollPaneASMacroLong.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASMacroLong.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassMacroLong.setEditable(false); jTextPaneGlassMacroLong.setContentType("text/html"); // NOI18N jTextPaneGlassMacroLong.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>dd</b> <font color='red'>$xx..kk</font> | <b>dd</b> <font color='red'>xx..kkh</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASMacroLong.setViewportView(jTextPaneGlassMacroLong); jLabelASWordSwappedDeclaration.setText("Word Swapped:"); jRadioButtonASMacroWordSwapped.setSelected(true); jRadioButtonASMacroWordSwapped.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASMacroWordSwappedItemStateChanged(evt); } }); jScrollPaneASMacroWordSwapped.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASMacroWordSwapped.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassMacroWordSwapped.setEditable(false); jTextPaneGlassMacroWordSwapped.setContentType("text/html"); // NOI18N jTextPaneGlassMacroWordSwapped.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>[.mac]</b> <font color='red'>$yyxx</font> | <b>[.mac]</b> <font color='red'>yyxxh</font><br>\n </p>\n </body>\n</html>\n"); jScrollPaneASMacroWordSwapped.setViewportView(jTextPaneGlassMacroWordSwapped); jLabelASTextDeclaration.setText("Text:"); jRadioButtonASDbText.setSelected(true); jRadioButtonASDbText.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASDbTextItemStateChanged(evt); } }); jScrollPaneASDotText.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASDotText.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassDbText.setEditable(false); jTextPaneGlassDbText.setContentType("text/html"); // NOI18N jTextPaneGlassDbText.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b> db</b> <font color='red'>\"xxx\"</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASDotText.setViewportView(jTextPaneGlassDbText); jLabelASNumTextDeclaration.setText("Text #num chars:"); jRadioButtonASDbNumText.setSelected(true); jRadioButtonASDbNumText.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASDbNumTextItemStateChanged(evt); } }); jScrollPaneASDotTextNumText.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASDotTextNumText.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassDbNumText.setEditable(false); jTextPaneGlassDbNumText.setContentType("text/html"); // NOI18N jTextPaneGlassDbNumText.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b> db</b> <font color='red'>\"xxx\"</font><br>\n\n </p>\n </body>\n</html>\n"); jTextPaneGlassDbNumText.setPreferredSize(new java.awt.Dimension(66, 20)); jScrollPaneASDotTextNumText.setViewportView(jTextPaneGlassDbNumText); jLabelASZeroTextDeclaration.setText("Text 0 terminated:"); jRadioButtonASDbZeroText.setSelected(true); jRadioButtonASDbZeroText.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASDbZeroTextItemStateChanged(evt); } }); jScrollPaneASDotNullZeroText.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASDotNullZeroText.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassDbZeroText.setEditable(false); jTextPaneGlassDbZeroText.setContentType("text/html"); // NOI18N jTextPaneGlassDbZeroText.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b> db</b> <font color='red'>\"xxx\"</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASDotNullZeroText.setViewportView(jTextPaneGlassDbZeroText); jLabelASAddressDeclaration.setText("Address:"); jRadioButtonASDwAddress.setSelected(true); jRadioButtonASDwAddress.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASDwAddressItemStateChanged(evt); } }); jScrollPaneASDotAddrAddress.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASDotAddrAddress.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassDwAddress.setEditable(false); jTextPaneGlassDwAddress.setContentType("text/html"); // NOI18N jTextPaneGlassDwAddress.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b> dw</b> <font color='red'>$xxyy</font>| <b> dw</b> <font color='red'>xxyyh</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASDotAddrAddress.setViewportView(jTextPaneGlassDwAddress); jLabelTmpxASStackWordDeclaration.setText("Stack Word:"); jRadioButtonASMacroStackWord.setSelected(true); jRadioButtonASMacroStackWord.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASMacroStackWordItemStateChanged(evt); } }); jScrollPaneASDotRtaStackWord.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASDotRtaStackWord.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassMacroStackWord.setEditable(false); jTextPaneGlassMacroStackWord.setContentType("text/html"); // NOI18N jTextPaneGlassMacroStackWord.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>[.mac]</b> <font color='red'>$xxyy</font> | <b>[.mac]</b> <font color='red'>xxyyh</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASDotRtaStackWord.setViewportView(jTextPaneGlassMacroStackWord); jLabelASHighTextDeclaration.setText("Text '1' terminated:"); jRadioButtonASDbHighText.setSelected(true); jRadioButtonASDbHighText.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASDbHighTextItemStateChanged(evt); } }); jScrollPaneASDotShiftHighText.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASDotShiftHighText.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassDbHighText.setEditable(false); jTextPaneGlassDbHighText.setContentType("text/html"); // NOI18N jTextPaneGlassDbHighText.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b> db</b> <font color='red'>\"xxx\"</font><br>\n\n </p>\n </body>\n</html>\n"); jTextPaneGlassDbHighText.setPreferredSize(new java.awt.Dimension(66, 20)); jScrollPaneASDotShiftHighText.setViewportView(jTextPaneGlassDbHighText); jLabelASShiftTextDeclaration.setText("Text left shifted:"); jRadioButtonASDbShiftText.setSelected(true); jRadioButtonASDbShiftText.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASDbShiftTextItemStateChanged(evt); } }); jScrollPaneASDotShiftlShiftText.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASDotShiftlShiftText.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassDbShiftText.setEditable(false); jTextPaneGlassDbShiftText.setContentType("text/html"); // NOI18N jTextPaneGlassDbShiftText.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b> db</b> <font color='red'>\"xxx\"</font><br>\n\n </p>\n </body>\n</html>\n"); jTextPaneGlassDbShiftText.setPreferredSize(new java.awt.Dimension(66, 20)); jScrollPaneASDotShiftlShiftText.setViewportView(jTextPaneGlassDbShiftText); jLabelASScreenTextDeclaration.setText("Text to screen code:"); jRadioButtonASDbScreenText.setSelected(true); jRadioButtonASDbScreenText.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASDbScreenTextItemStateChanged(evt); } }); jScrollPaneASDotScreenText.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASDotScreenText.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneDbScreenText.setEditable(false); jTextPaneDbScreenText.setContentType("text/html"); // NOI18N jTextPaneDbScreenText.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b> db</b> <font color='red'>\"xxx\"</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASDotScreenText.setViewportView(jTextPaneDbScreenText); jLabelASPetasciiTextDeclaration.setText("Text to petascii code:"); jRadioButtonASDbPetasciiText.setSelected(true); jRadioButtonASDbPetasciiText.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASDbPetasciiTextItemStateChanged(evt); } }); jScrollPaneASDotPetasciiText.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASDotPetasciiText.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassDbPetasciiText.setEditable(false); jTextPaneGlassDbPetasciiText.setContentType("text/html"); // NOI18N jTextPaneGlassDbPetasciiText.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b> db</b> <font color='red'>\"xxx\"</font><br>\n\n </p>\n </body>\n</html>\n"); jScrollPaneASDotPetasciiText.setViewportView(jTextPaneGlassDbPetasciiText); jRadioButtonASLabelNameColon.setSelected(true); jRadioButtonASLabelNameColon.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jRadioButtonASLabelNameColonItemStateChanged(evt); } }); jScrollPaneASLabelNameColon.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPaneASLabelNameColon.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); jTextPaneGlassLabelNameColon.setEditable(false); jTextPaneGlassLabelNameColon.setContentType("text/html"); // NOI18N jTextPaneGlassLabelNameColon.setText("<html>\n <head>\n\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <font color='black'>zzzz</font><b>:</b>\n </p>\n </body>\n</html>\n"); jScrollPaneASLabelNameColon.setViewportView(jTextPaneGlassLabelNameColon); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(12, 12, 12) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabelASStartingDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabelASOriginDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabelASCommentDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabelASBlockCommentDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabelASHighTextDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabelASShiftTextDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabelASScreenTextDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabelASLabelDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelASByteDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelASWordDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelASWordSwappedDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelASTribyteDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelASLongDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelASAddressDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelTmpxASStackWordDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelASMultiSpriteDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelASTextDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelASNumTextDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelASZeroTextDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelASPetasciiTextDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) .addComponent(jLabelASMonoSpriteDeclaration, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jRadioButtonASStarting) .addComponent(jRadioButtonASOrigin) .addComponent(jRadioButtonASSemicolonComment) .addComponent(jRadioButtonASSemicolonBlockComment) .addComponent(jRadioButtonASLabelName) .addComponent(jRadioButtonASDbByte) .addComponent(jRadioButtonASDwWord) .addComponent(jRadioButtonASMacroWordSwapped) .addComponent(jRadioButtonASMacroTribyte) .addComponent(jRadioButtonASDdLong) .addComponent(jRadioButtonASDwAddress) .addComponent(jRadioButtonASMacroStackWord) .addComponent(jRadioButtonASByteHexMonoSprite) .addComponent(jRadioButtonASByteHexMultiSprite) .addComponent(jRadioButtonASDbText) .addComponent(jRadioButtonASDbNumText) .addComponent(jRadioButtonASDbZeroText) .addComponent(jRadioButtonASDbHighText) .addComponent(jRadioButtonASDbShiftText) .addComponent(jRadioButtonASDbScreenText) .addComponent(jRadioButtonASDbPetasciiText)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPaneASDotPetasciiText) .addComponent(jScrollPaneASDotScreenText) .addComponent(jScrollPaneASDotShiftlShiftText) .addComponent(jScrollPaneASDotShiftHighText) .addComponent(jScrollPaneASDotNullZeroText) .addComponent(jScrollPaneASDotTextNumText) .addComponent(jScrollPaneASDotText) .addComponent(jScrollPaneASByteHexMultiSprite) .addComponent(jScrollPaneASByteHexMonoSprite) .addComponent(jScrollPaneASDotRtaStackWord) .addComponent(jScrollPaneASDotAddrAddress) .addComponent(jScrollPaneASMacroLong) .addComponent(jScrollPaneASMacroTribyte, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE) .addComponent(jScrollPaneASMacroWordSwapped, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE) .addComponent(jScrollPaneASDotWord) .addComponent(jScrollPaneASWord) .addComponent(jScrollPaneASByte) .addComponent(jScrollPaneASSemicolonBlockComment1) .addComponent(jScrollPaneASSemicolonComment) .addComponent(jScrollPaneASAsterixOrigin1, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE) .addComponent(jScrollPaneASStarting)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jRadioButtonASLabelNameColon) .addComponent(jRadioButtonASByteBinMonoSprite) .addComponent(jRadioButtonASByteBinMultiSprite)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addGap(6, 6, 6) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPaneASByteBinMultiSprite, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE) .addComponent(jScrollPaneASByteBinMonoSprite, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE))) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPaneASLabelNameColon))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addComponent(jRadioButtonASMacroHexMonoSprite) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPaneASMacroHexMonoSprite, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jRadioButtonASMacroHexMultiSprite) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPaneASMacroHexMultiSprite))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addComponent(jRadioButtonASMacroBinMonoSprite) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPaneASMacroBinMonoSprite, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jRadioButtonASMacroBinMultiSprite) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPaneASMacroBinMultiSprite))) .addContainerGap(29, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(11, 11, 11) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASStartingDeclaration) .addComponent(jRadioButtonASStarting) .addComponent(jScrollPaneASStarting, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(11, 11, 11) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASOriginDeclaration) .addComponent(jRadioButtonASOrigin) .addComponent(jScrollPaneASAsterixOrigin1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASCommentDeclaration) .addComponent(jRadioButtonASSemicolonComment) .addComponent(jScrollPaneASSemicolonComment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(12, 12, 12) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASBlockCommentDeclaration, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButtonASSemicolonBlockComment) .addComponent(jScrollPaneASSemicolonBlockComment1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASLabelDeclaration) .addComponent(jRadioButtonASLabelName) .addComponent(jScrollPaneASByte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButtonASLabelNameColon) .addComponent(jScrollPaneASLabelNameColon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASByteDeclaration) .addComponent(jRadioButtonASDbByte) .addComponent(jScrollPaneASWord, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASWordDeclaration) .addComponent(jRadioButtonASDwWord) .addComponent(jScrollPaneASDotWord, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASWordSwappedDeclaration, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButtonASMacroWordSwapped) .addComponent(jScrollPaneASMacroWordSwapped, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASTribyteDeclaration, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButtonASMacroTribyte) .addComponent(jScrollPaneASMacroTribyte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(4, 4, 4) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASLongDeclaration, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButtonASDdLong) .addComponent(jScrollPaneASMacroLong, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASAddressDeclaration) .addComponent(jRadioButtonASDwAddress) .addComponent(jScrollPaneASDotAddrAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelTmpxASStackWordDeclaration) .addComponent(jRadioButtonASMacroStackWord) .addComponent(jScrollPaneASDotRtaStackWord, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabelASMonoSpriteDeclaration) .addComponent(jRadioButtonASByteHexMonoSprite) .addComponent(jScrollPaneASByteHexMonoSprite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButtonASByteBinMonoSprite) .addComponent(jScrollPaneASByteBinMonoSprite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButtonASMacroHexMonoSprite) .addComponent(jScrollPaneASMacroHexMonoSprite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButtonASMacroBinMonoSprite) .addComponent(jScrollPaneASMacroBinMonoSprite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabelASMultiSpriteDeclaration) .addComponent(jRadioButtonASByteHexMultiSprite) .addComponent(jScrollPaneASByteHexMultiSprite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButtonASByteBinMultiSprite) .addComponent(jScrollPaneASByteBinMultiSprite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButtonASMacroHexMultiSprite) .addComponent(jScrollPaneASMacroHexMultiSprite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButtonASMacroBinMultiSprite) .addComponent(jScrollPaneASMacroBinMultiSprite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASTextDeclaration) .addComponent(jRadioButtonASDbText) .addComponent(jScrollPaneASDotText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASNumTextDeclaration) .addComponent(jRadioButtonASDbNumText) .addComponent(jScrollPaneASDotTextNumText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASZeroTextDeclaration) .addComponent(jRadioButtonASDbZeroText) .addComponent(jScrollPaneASDotNullZeroText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASHighTextDeclaration) .addComponent(jRadioButtonASDbHighText) .addComponent(jScrollPaneASDotShiftHighText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASShiftTextDeclaration) .addComponent(jRadioButtonASDbShiftText) .addComponent(jScrollPaneASDotShiftlShiftText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASScreenTextDeclaration) .addComponent(jRadioButtonASDbScreenText) .addComponent(jScrollPaneASDotScreenText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabelASPetasciiTextDeclaration) .addComponent(jRadioButtonASDbPetasciiText) .addComponent(jScrollPaneASDotPetasciiText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(32, Short.MAX_VALUE)) ); }// </editor-fold>//GEN-END:initComponents private void jRadioButtonASLabelNameItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASLabelNameItemStateChanged option.asmLabel=Assembler.Label.NAME; option.asiLabel=Assembler.Label.NAME; }//GEN-LAST:event_jRadioButtonASLabelNameItemStateChanged private void jRadioButtonASDbByteItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASDbByteItemStateChanged option.asmByte=Assembler.Byte.DB_BYTE; option.asiByte=Assembler.Byte.DB_BYTE_H; }//GEN-LAST:event_jRadioButtonASDbByteItemStateChanged private void jRadioButtonASDwWordItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASDwWordItemStateChanged option.asmWord=Assembler.Word.DW_WORD; option.asiWord=Assembler.Word.DW_WORD_H; }//GEN-LAST:event_jRadioButtonASDwWordItemStateChanged private void jRadioButtonASSemicolonCommentItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASSemicolonCommentItemStateChanged option.asmComment=Assembler.Comment.SEMICOLON; option.asiComment=Assembler.Comment.SEMICOLON; }//GEN-LAST:event_jRadioButtonASSemicolonCommentItemStateChanged private void jRadioButtonASSemicolonBlockCommentItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASSemicolonBlockCommentItemStateChanged option.asmBlockComment=Assembler.BlockComment.SEMICOLON; option.asiBlockComment=Assembler.BlockComment.SEMICOLON; }//GEN-LAST:event_jRadioButtonASSemicolonBlockCommentItemStateChanged private void jRadioButtonASOriginItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASOriginItemStateChanged option.asmOrigin=Assembler.Origin.ORG; option.asiOrigin=Assembler.Origin.ORG_H; }//GEN-LAST:event_jRadioButtonASOriginItemStateChanged private void jRadioButtonASStartingItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASStartingItemStateChanged option.asmStarting=Assembler.Starting.CPU_M; option.asiStarting=Assembler.Starting.CPU_I; }//GEN-LAST:event_jRadioButtonASStartingItemStateChanged private void jRadioButtonASByteHexMonoSpriteItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASByteHexMonoSpriteItemStateChanged option.glassMonoSprite=Assembler.MonoSprite.BYTE_HEX; }//GEN-LAST:event_jRadioButtonASByteHexMonoSpriteItemStateChanged private void jRadioButtonASByteHexMultiSpriteItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASByteHexMultiSpriteItemStateChanged option.glassMultiSprite=Assembler.MultiSprite.BYTE_HEX; }//GEN-LAST:event_jRadioButtonASByteHexMultiSpriteItemStateChanged private void jRadioButtonASByteBinMonoSpriteItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASByteBinMonoSpriteItemStateChanged option.glassMonoSprite=Assembler.MonoSprite.BYTE_BIN; }//GEN-LAST:event_jRadioButtonASByteBinMonoSpriteItemStateChanged private void jRadioButtonASByteBinMultiSpriteItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASByteBinMultiSpriteItemStateChanged option.glassMultiSprite=Assembler.MultiSprite.BYTE_BIN; }//GEN-LAST:event_jRadioButtonASByteBinMultiSpriteItemStateChanged private void jRadioButtonASMacroHexMonoSpriteItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASMacroHexMonoSpriteItemStateChanged option.glassMonoSprite=Assembler.MonoSprite.MACRO5_HEX; }//GEN-LAST:event_jRadioButtonASMacroHexMonoSpriteItemStateChanged private void jRadioButtonASMacroHexMultiSpriteItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASMacroHexMultiSpriteItemStateChanged option.glassMultiSprite=Assembler.MultiSprite.MACRO5_HEX; }//GEN-LAST:event_jRadioButtonASMacroHexMultiSpriteItemStateChanged private void jRadioButtonASMacroBinMonoSpriteItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASMacroBinMonoSpriteItemStateChanged option.glassMonoSprite=Assembler.MonoSprite.MACRO5_BIN; }//GEN-LAST:event_jRadioButtonASMacroBinMonoSpriteItemStateChanged private void jRadioButtonASMacroBinMultiSpriteItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASMacroBinMultiSpriteItemStateChanged option.glassMultiSprite=Assembler.MultiSprite.MACRO5_BIN; }//GEN-LAST:event_jRadioButtonASMacroBinMultiSpriteItemStateChanged private void jRadioButtonASMacroTribyteItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASMacroTribyteItemStateChanged option.asmTribyte=Assembler.Tribyte.MACRO6_TRIBYTE; option.asiTribyte=Assembler.Tribyte.MACRO6_TRIBYTE; }//GEN-LAST:event_jRadioButtonASMacroTribyteItemStateChanged private void jRadioButtonASDdLongItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASDdLongItemStateChanged option.asmLong=Assembler.Long.DD_LONG; option.asiLong=Assembler.Long.DD_LONG_H; }//GEN-LAST:event_jRadioButtonASDdLongItemStateChanged private void jRadioButtonASMacroWordSwappedItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASMacroWordSwappedItemStateChanged option.asmWordSwapped=Assembler.WordSwapped.MACRO6_WORD_SWAPPED; option.asiWordSwapped=Assembler.WordSwapped.MACRO6_WORD_SWAPPED; }//GEN-LAST:event_jRadioButtonASMacroWordSwappedItemStateChanged private void jRadioButtonASDbTextItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASDbTextItemStateChanged option.asmText=Assembler.Text.DB_BYTE_TEXT; option.asiText=Assembler.Text.DB_BYTE_TEXT; }//GEN-LAST:event_jRadioButtonASDbTextItemStateChanged private void jRadioButtonASDbNumTextItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASDbNumTextItemStateChanged option.asmNumText=Assembler.NumText.DB_BYTE_NUMTEXT; option.asiNumText=Assembler.NumText.DB_BYTE_NUMTEXT; }//GEN-LAST:event_jRadioButtonASDbNumTextItemStateChanged private void jRadioButtonASDbZeroTextItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASDbZeroTextItemStateChanged option.asmZeroText=Assembler.ZeroText.DB_BYTE_ZEROTEXT; option.asiZeroText=Assembler.ZeroText.DB_BYTE_ZEROTEXT; }//GEN-LAST:event_jRadioButtonASDbZeroTextItemStateChanged private void jRadioButtonASDwAddressItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASDwAddressItemStateChanged option.asmAddress=Assembler.Address.DW_ADDR; option.asiAddress=Assembler.Address.DW_ADDR_H; }//GEN-LAST:event_jRadioButtonASDwAddressItemStateChanged private void jRadioButtonASMacroStackWordItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASMacroStackWordItemStateChanged option.asmStackWord=Assembler.StackWord.MACRO5_STACKWORD; option.asiStackWord=Assembler.StackWord.MACRO5_STACKWORD; }//GEN-LAST:event_jRadioButtonASMacroStackWordItemStateChanged private void jRadioButtonASDbHighTextItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASDbHighTextItemStateChanged option.asmHighText=Assembler.HighText.DB_BYTE_HIGHTEXT; option.asiHighText=Assembler.HighText.DB_BYTE_HIGHTEXT; }//GEN-LAST:event_jRadioButtonASDbHighTextItemStateChanged private void jRadioButtonASDbShiftTextItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASDbShiftTextItemStateChanged option.asmShiftText=Assembler.ShiftText.DB_BYTE_SHIFTTEXT; option.asiShiftText=Assembler.ShiftText.DB_BYTE_SHIFTTEXT; }//GEN-LAST:event_jRadioButtonASDbShiftTextItemStateChanged private void jRadioButtonASDbScreenTextItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASDbScreenTextItemStateChanged option.asmScreenText=Assembler.ScreenText.DB_BYTE_SCREENTEXT; option.asiScreenText=Assembler.ScreenText.DB_BYTE_SCREENTEXT; }//GEN-LAST:event_jRadioButtonASDbScreenTextItemStateChanged private void jRadioButtonASDbPetasciiTextItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASDbPetasciiTextItemStateChanged option.asmPetasciiText=Assembler.PetasciiText.DB_BYTE_PETASCIITEXT; option.asiPetasciiText=Assembler.PetasciiText.DB_BYTE_PETASCIITEXT; }//GEN-LAST:event_jRadioButtonASDbPetasciiTextItemStateChanged private void jRadioButtonASLabelNameColonItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButtonASLabelNameColonItemStateChanged option.asmLabel=Assembler.Label.NAME_COLON; option.asiLabel=Assembler.Label.NAME_COLON; }//GEN-LAST:event_jRadioButtonASLabelNameColonItemStateChanged // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextPane TmpxPaneGlassByteHexMultiSprite; private javax.swing.JLabel jLabelASAddressDeclaration; private javax.swing.JLabel jLabelASBlockCommentDeclaration; private javax.swing.JLabel jLabelASByteDeclaration; private javax.swing.JLabel jLabelASCommentDeclaration; private javax.swing.JLabel jLabelASHighTextDeclaration; private javax.swing.JLabel jLabelASLabelDeclaration; private javax.swing.JLabel jLabelASLongDeclaration; private javax.swing.JLabel jLabelASMonoSpriteDeclaration; private javax.swing.JLabel jLabelASMultiSpriteDeclaration; private javax.swing.JLabel jLabelASNumTextDeclaration; private javax.swing.JLabel jLabelASOriginDeclaration; private javax.swing.JLabel jLabelASPetasciiTextDeclaration; private javax.swing.JLabel jLabelASScreenTextDeclaration; private javax.swing.JLabel jLabelASShiftTextDeclaration; private javax.swing.JLabel jLabelASStartingDeclaration; private javax.swing.JLabel jLabelASTextDeclaration; private javax.swing.JLabel jLabelASTribyteDeclaration; private javax.swing.JLabel jLabelASWordDeclaration; private javax.swing.JLabel jLabelASWordSwappedDeclaration; private javax.swing.JLabel jLabelASZeroTextDeclaration; private javax.swing.JLabel jLabelTmpxASStackWordDeclaration; private javax.swing.JRadioButton jRadioButtonASByteBinMonoSprite; private javax.swing.JRadioButton jRadioButtonASByteBinMultiSprite; private javax.swing.JRadioButton jRadioButtonASByteHexMonoSprite; private javax.swing.JRadioButton jRadioButtonASByteHexMultiSprite; private javax.swing.JRadioButton jRadioButtonASDbByte; private javax.swing.JRadioButton jRadioButtonASDbHighText; private javax.swing.JRadioButton jRadioButtonASDbNumText; private javax.swing.JRadioButton jRadioButtonASDbPetasciiText; private javax.swing.JRadioButton jRadioButtonASDbScreenText; private javax.swing.JRadioButton jRadioButtonASDbShiftText; private javax.swing.JRadioButton jRadioButtonASDbText; private javax.swing.JRadioButton jRadioButtonASDbZeroText; private javax.swing.JRadioButton jRadioButtonASDdLong; private javax.swing.JRadioButton jRadioButtonASDwAddress; private javax.swing.JRadioButton jRadioButtonASDwWord; private javax.swing.JRadioButton jRadioButtonASLabelName; private javax.swing.JRadioButton jRadioButtonASLabelNameColon; private javax.swing.JRadioButton jRadioButtonASMacroBinMonoSprite; private javax.swing.JRadioButton jRadioButtonASMacroBinMultiSprite; private javax.swing.JRadioButton jRadioButtonASMacroHexMonoSprite; private javax.swing.JRadioButton jRadioButtonASMacroHexMultiSprite; private javax.swing.JRadioButton jRadioButtonASMacroStackWord; private javax.swing.JRadioButton jRadioButtonASMacroTribyte; private javax.swing.JRadioButton jRadioButtonASMacroWordSwapped; private javax.swing.JRadioButton jRadioButtonASOrigin; private javax.swing.JRadioButton jRadioButtonASSemicolonBlockComment; private javax.swing.JRadioButton jRadioButtonASSemicolonComment; private javax.swing.JRadioButton jRadioButtonASStarting; private javax.swing.JScrollPane jScrollPaneASAsterixOrigin1; private javax.swing.JScrollPane jScrollPaneASByte; private javax.swing.JScrollPane jScrollPaneASByteBinMonoSprite; private javax.swing.JScrollPane jScrollPaneASByteBinMultiSprite; private javax.swing.JScrollPane jScrollPaneASByteHexMonoSprite; private javax.swing.JScrollPane jScrollPaneASByteHexMultiSprite; private javax.swing.JScrollPane jScrollPaneASDotAddrAddress; private javax.swing.JScrollPane jScrollPaneASDotNullZeroText; private javax.swing.JScrollPane jScrollPaneASDotPetasciiText; private javax.swing.JScrollPane jScrollPaneASDotRtaStackWord; private javax.swing.JScrollPane jScrollPaneASDotScreenText; private javax.swing.JScrollPane jScrollPaneASDotShiftHighText; private javax.swing.JScrollPane jScrollPaneASDotShiftlShiftText; private javax.swing.JScrollPane jScrollPaneASDotText; private javax.swing.JScrollPane jScrollPaneASDotTextNumText; private javax.swing.JScrollPane jScrollPaneASDotWord; private javax.swing.JScrollPane jScrollPaneASLabelNameColon; private javax.swing.JScrollPane jScrollPaneASMacroBinMonoSprite; private javax.swing.JScrollPane jScrollPaneASMacroBinMultiSprite; private javax.swing.JScrollPane jScrollPaneASMacroHexMonoSprite; private javax.swing.JScrollPane jScrollPaneASMacroHexMultiSprite; private javax.swing.JScrollPane jScrollPaneASMacroLong; private javax.swing.JScrollPane jScrollPaneASMacroTribyte; private javax.swing.JScrollPane jScrollPaneASMacroWordSwapped; private javax.swing.JScrollPane jScrollPaneASSemicolonBlockComment1; private javax.swing.JScrollPane jScrollPaneASSemicolonComment; private javax.swing.JScrollPane jScrollPaneASStarting; private javax.swing.JScrollPane jScrollPaneASWord; private javax.swing.JTextPane jTextPaneASDbByte; private javax.swing.JTextPane jTextPaneASDwWord; private javax.swing.JTextPane jTextPaneASOrigin; private javax.swing.JTextPane jTextPaneASSemicolonComment; private javax.swing.JTextPane jTextPaneASStarting; private javax.swing.JTextPane jTextPaneDbScreenText; private javax.swing.JTextPane jTextPaneGlassByteBinMonoSprite; private javax.swing.JTextPane jTextPaneGlassByteBinMultiSprite; private javax.swing.JTextPane jTextPaneGlassByteHexMonoSprite; private javax.swing.JTextPane jTextPaneGlassDbHighText; private javax.swing.JTextPane jTextPaneGlassDbNumText; private javax.swing.JTextPane jTextPaneGlassDbPetasciiText; private javax.swing.JTextPane jTextPaneGlassDbShiftText; private javax.swing.JTextPane jTextPaneGlassDbText; private javax.swing.JTextPane jTextPaneGlassDbZeroText; private javax.swing.JTextPane jTextPaneGlassDwAddress; private javax.swing.JTextPane jTextPaneGlassLabelName; private javax.swing.JTextPane jTextPaneGlassLabelNameColon; private javax.swing.JTextPane jTextPaneGlassMacroBinMonoSprite; private javax.swing.JTextPane jTextPaneGlassMacroBinMultiSprite; private javax.swing.JTextPane jTextPaneGlassMacroHexMonoSprite; private javax.swing.JTextPane jTextPaneGlassMacroHexMultiSprite; private javax.swing.JTextPane jTextPaneGlassMacroLong; private javax.swing.JTextPane jTextPaneGlassMacroStackWord; private javax.swing.JTextPane jTextPaneGlassMacroTribyte; private javax.swing.JTextPane jTextPaneGlassMacroWordSwapped; private javax.swing.JTextPane jTextPaneTmpxSemicolonBlockComment1; // End of variables declaration//GEN-END:variables }
71,019
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
JBlockDialog.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/swing/JBlockDialog.java
/** * @(#)JBlockHiDialog.java 2024/04/13 * * ICE Team free software group * * This file is part of JIIT64 Java Ice Team Tracker 64 * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ package sw_emulator.swing; import java.text.ParseException; import java.util.Locale; import javax.swing.JFormattedTextField; import javax.swing.JOptionPane; import javax.swing.JSpinner; import javax.swing.JTable; import javax.swing.text.DefaultFormatter; import javax.swing.text.DefaultFormatterFactory; import sw_emulator.software.MemoryDasm; /** * Automatic label blocks of data * * @author ice */ public class JBlockDialog extends javax.swing.JDialog { /** Memory dasm */ private MemoryDasm[] memories; private static class HexFormatterFactory extends DefaultFormatterFactory { @Override public JFormattedTextField.AbstractFormatter getDefaultFormatter() { return new HexFormatter(); } } private static class HexFormatter extends DefaultFormatter { @Override public Object stringToValue(String text) throws ParseException { try { return Long.valueOf(text, 16); } catch (NumberFormatException nfe) { throw new ParseException(text,0); } } @Override public String valueToString(Object value) throws ParseException { if (value instanceof Long) return Long.toHexString( ((Long)value).intValue()).toUpperCase(); else return Integer.toHexString( ((Integer)value).intValue()).toUpperCase(); } } /** * Creates new form JBlockDialog */ public JBlockDialog(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); JSpinner.DefaultEditor editor = (JSpinner.DefaultEditor)jSpinnerStartAddr.getEditor(); editor.getTextField().setFormatterFactory(new HexFormatterFactory()); editor = (JSpinner.DefaultEditor)jSpinnerEndAddr.getEditor(); editor.getTextField().setFormatterFactory(new HexFormatterFactory()); } /** * Set memory dasm * * @param memories the memories dasm to use * @param start starting addess * @param end ending address */ public void setUp(MemoryDasm[] memories, int start, int end) { this.memories=memories; jSpinnerStartAddr.setValue(start); jSpinnerEndAddr.setValue(end); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanelTitle = new javax.swing.JPanel(); jLabelTitle = new javax.swing.JLabel(); jLabelStartAddr = new javax.swing.JLabel(); jLabelEndAddr = new javax.swing.JLabel(); jSpinnerEndAddr = new javax.swing.JSpinner(); jSpinnerStartAddr = new javax.swing.JSpinner(); jLabelSize = new javax.swing.JLabel(); jSpinnerSize = new javax.swing.JSpinner(); jLabelPrefix = new javax.swing.JLabel(); jLabelStart = new javax.swing.JLabel(); jSpinnerStart = new javax.swing.JSpinner(); jTextFieldPrefix = new javax.swing.JTextField(); jSeparator1 = new javax.swing.JSeparator(); jLabelDigit = new javax.swing.JLabel(); jSpinnerDigit = new javax.swing.JSpinner(); jCheckBoxUpper = new javax.swing.JCheckBox(); jButtonApplyDigit = new javax.swing.JButton(); jSeparator2 = new javax.swing.JSeparator(); jButtonApplyMemory = new javax.swing.JButton(); jPanelCancel = new javax.swing.JPanel(); jButtonCancel = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanelTitle.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jLabelTitle.setText("Automatic blocks labeled"); jPanelTitle.add(jLabelTitle); jLabelStartAddr.setText("Starting address:"); jLabelEndAddr.setText("Ending address:"); jSpinnerEndAddr.setModel(new javax.swing.SpinnerNumberModel(0, 0, 65535, 1)); jSpinnerStartAddr.setModel(new javax.swing.SpinnerNumberModel(0, 0, 65535, 1)); jLabelSize.setText("Block size:"); jSpinnerSize.setModel(new javax.swing.SpinnerNumberModel(24, 1, 1024, 1)); jLabelPrefix.setText("Prefix:"); jLabelStart.setText("Start:"); jSpinnerStart.setModel(new javax.swing.SpinnerNumberModel(0, 0, 255, 1)); jLabelDigit.setText("Digit:"); jSpinnerDigit.setModel(new javax.swing.SpinnerNumberModel(1, 1, 2, 1)); jSpinnerDigit.setToolTipText("Min number of digits to use (can increase automatically)"); jCheckBoxUpper.setText("Uppercase"); jButtonApplyDigit.setText("Apply with digit"); jButtonApplyDigit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonApplyDigitActionPerformed(evt); } }); jButtonApplyMemory.setText("Apply with memory position"); jButtonApplyMemory.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonApplyMemoryActionPerformed(evt); } }); jPanelCancel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jButtonCancel.setText("Cancel"); jButtonCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonCancelActionPerformed(evt); } }); javax.swing.GroupLayout jPanelCancelLayout = new javax.swing.GroupLayout(jPanelCancel); jPanelCancel.setLayout(jPanelCancelLayout); jPanelCancelLayout.setHorizontalGroup( jPanelCancelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanelCancelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelCancelLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(jButtonCancel) .addGap(0, 0, Short.MAX_VALUE))) ); jPanelCancelLayout.setVerticalGroup( jPanelCancelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 35, Short.MAX_VALUE) .addGroup(jPanelCancelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelCancelLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(jButtonCancel) .addGap(0, 0, Short.MAX_VALUE))) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanelTitle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSeparator1) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabelPrefix, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextFieldPrefix, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabelDigit, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSpinnerDigit, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabelSize, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabelStartAddr)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jSpinnerStartAddr, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jSpinnerSize, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(34, 34, 34) .addComponent(jLabelEndAddr, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSpinnerEndAddr, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jLabelStart, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSpinnerStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(31, 31, 31) .addComponent(jCheckBoxUpper))) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(jSeparator2) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addGap(66, 66, 66) .addComponent(jButtonApplyDigit) .addGap(18, 18, 18) .addComponent(jButtonApplyMemory) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jPanelCancel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanelTitle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jSpinnerStartAddr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabelStartAddr)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabelEndAddr) .addComponent(jSpinnerEndAddr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabelSize) .addComponent(jSpinnerSize, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(1, 1, 1) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(1, 1, 1) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabelPrefix) .addComponent(jTextFieldPrefix, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabelDigit, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jSpinnerDigit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jSpinnerStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabelStart) .addComponent(jCheckBoxUpper)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButtonApplyDigit) .addComponent(jButtonApplyMemory)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanelCancel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButtonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelActionPerformed setVisible(false); }//GEN-LAST:event_jButtonCancelActionPerformed private void jButtonApplyDigitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonApplyDigitActionPerformed int start=(Integer)jSpinnerStartAddr.getValue(); int end=(Integer)jSpinnerEndAddr.getValue(); if (end<start) { JOptionPane.showMessageDialog(this, "Low end position must be after low start position"); return; } int step=(int)jSpinnerSize.getValue(); String prefix=jTextFieldPrefix.getText(); boolean uppercase=jCheckBoxUpper.isSelected(); int digit=(Integer)jSpinnerDigit.getValue(); String label; int starting=(Integer)jSpinnerStart.getValue(); // make the action int j=starting; for (int i=starting; i<=starting+end-start; i+=step, j++) { if (prefix!=null && !"".equals(prefix)) { label=Integer.toHexString((int)j); if (label.length()==1 && digit==2) label="0"+label; if (uppercase) label=label.toUpperCase(); else label=label.toLowerCase(); label=prefix+label; memories[(int)(start+i)].userLocation=label; } } setVisible(false); }//GEN-LAST:event_jButtonApplyDigitActionPerformed private void jButtonApplyMemoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonApplyMemoryActionPerformed int start=(Integer)jSpinnerStartAddr.getValue(); int end=(Integer)jSpinnerEndAddr.getValue(); if (end<start) { JOptionPane.showMessageDialog(this, "Low end position must be after low start position"); return; } int step=(int)jSpinnerSize.getValue(); String prefix=jTextFieldPrefix.getText(); String label; // make the action for (int i=start; i<=end; i+=step) { if (prefix!=null && !"".equals(prefix)) { label=ShortToExe((int)i); label=prefix+label; memories[(int)i].userLocation=label; } } setVisible(false); }//GEN-LAST:event_jButtonApplyMemoryActionPerformed /** * Convert a unsigned short (containing in a int) to Exe upper case 4 chars * * @param value the short value to convert * @return the exe string rapresentation of byte */ protected static String ShortToExe(int value) { int tmp=value; if (value<0) return "????"; String ret=Integer.toHexString(tmp); int len=ret.length(); switch (len) { case 1: ret="000"+ret; break; case 2: ret="00"+ret; break; case 3: ret="0"+ret; break; } return ret.toUpperCase(Locale.ENGLISH); } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(JBlockDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(JBlockDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(JBlockDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(JBlockDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the dialog */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { JBlockDialog dialog = new JBlockDialog(new javax.swing.JFrame(), true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButtonApplyDigit; private javax.swing.JButton jButtonApplyMemory; private javax.swing.JButton jButtonCancel; private javax.swing.JCheckBox jCheckBoxUpper; private javax.swing.JLabel jLabelDigit; private javax.swing.JLabel jLabelEndAddr; private javax.swing.JLabel jLabelPrefix; private javax.swing.JLabel jLabelSize; private javax.swing.JLabel jLabelStart; private javax.swing.JLabel jLabelStartAddr; private javax.swing.JLabel jLabelTitle; private javax.swing.JPanel jPanelCancel; private javax.swing.JPanel jPanelTitle; private javax.swing.JSeparator jSeparator1; private javax.swing.JSeparator jSeparator2; private javax.swing.JSpinner jSpinnerDigit; private javax.swing.JSpinner jSpinnerEndAddr; private javax.swing.JSpinner jSpinnerSize; private javax.swing.JSpinner jSpinnerStart; private javax.swing.JSpinner jSpinnerStartAddr; private javax.swing.JTextField jTextFieldPrefix; // End of variables declaration//GEN-END:variables }
20,890
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
JPanelPerc.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/swing/JPanelPerc.java
/** * @(#)JPercPanel.java 2019/12/29 * * ICE Team free software group * * This file is part of JIIT64 Java Ice Team Tracker 64 * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package sw_emulator.swing; import java.awt.Color; /** * Panel for % of completion * * @author ice */ public class JPanelPerc extends javax.swing.JPanel { Color start=Color.GREEN; Color end=Color.RED; /** * Creates new form JPanelPerc */ public JPanelPerc() { initComponents(); setPerc(-1); } /** * Set the actual perc * * @param perc the perc % */ public void setPerc(float perc) { if (perc<0) { jLabelPerc.setText("%"); this.setBackground(Color.WHITE); return; } if (perc>1) perc=1; float blending=perc; float inverse_blending = 1-blending; float red = start.getRed()*blending + end.getRed()*inverse_blending; float green = start.getGreen()*blending + end.getGreen()*inverse_blending; float blue = start.getBlue()*blending + end.getBlue()*inverse_blending; Color blended = new Color (red / 255, green / 255, blue / 255); this.setBackground(blended); jLabelPerc.setText((int)(perc*100)+"%"); this.updateUI(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabelPerc = new javax.swing.JLabel(); setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N setInheritsPopupMenu(true); setMaximumSize(new java.awt.Dimension(54, 36)); setName(""); // NOI18N setPreferredSize(new java.awt.Dimension(54, 36)); setRequestFocusEnabled(false); setLayout(null); jLabelPerc.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N jLabelPerc.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabelPerc.setText("0%"); jLabelPerc.setToolTipText("Percentage of reverse engineering"); add(jLabelPerc); jLabelPerc.setBounds(7, 5, 70, 26); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabelPerc; // End of variables declaration//GEN-END:variables }
4,132
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
JPlayerDialog.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/swing/JPlayerDialog.java
/** * @(#)JPlayerDialog.java 2023/04/07 * * ICE Team free software group * * This file is part of JIIT64 Java Ice Team Tracker 64 * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ package sw_emulator.swing; import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; import sw_emulator.software.sidid.CRSID; import sw_emulator.software.sidid.Memory; import sw_emulator.software.sidid.PSID; import sw_emulator.swing.main.FileManager; import sw_emulator.swing.main.Option; import sw_emulator.swing.main.Project; /** * Sid player for SIDLD * * @author ice */ public class JPlayerDialog extends javax.swing.JDialog { /** cRSID player */ CRSID crsid=new CRSID(); /** JC64dis Option */ Option option; /** JC64dis project*/ Project project; /** Actual sid handler*/ PSID sid; int tune=1; /** * Creates new form JPlayerDialog */ public JPlayerDialog(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); crsid.init(44100); } /** * Setup the dialog * * @param option option of JC64dis * @param project project of JC64dis */ public void setup(Option option, Project project) { this.option=option; this.project=project; } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jToolBarPlayer = new javax.swing.JToolBar(); jButtonPrev = new javax.swing.JButton(); jButtonNext = new javax.swing.JButton(); jButtonStart = new javax.swing.JButton(); jButtonPlay = new javax.swing.JButton(); jButtonFPlay = new javax.swing.JButton(); jButtonPause = new javax.swing.JButton(); jButtonStop = new javax.swing.JButton(); jButtonCurrent = new javax.swing.JButton(); jButtonMax = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("SIDld player"); setResizable(false); jButtonPrev.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sw_emulator/swing/icons/1leftarrow.png"))); // NOI18N jButtonPrev.setToolTipText("Go to previous tune"); jButtonPrev.setFocusable(false); jButtonPrev.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButtonPrev.setMaximumSize(new java.awt.Dimension(32, 32)); jButtonPrev.setMinimumSize(new java.awt.Dimension(32, 32)); jButtonPrev.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButtonPrev.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonPrevActionPerformed(evt); } }); jToolBarPlayer.add(jButtonPrev); jButtonNext.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sw_emulator/swing/icons/1rightarrow.png"))); // NOI18N jButtonNext.setToolTipText("Go to next tune"); jButtonNext.setFocusable(false); jButtonNext.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButtonNext.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButtonNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonNextActionPerformed(evt); } }); jToolBarPlayer.add(jButtonNext); jButtonStart.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sw_emulator/swing/icons/player_start.png"))); // NOI18N jButtonStart.setToolTipText("Rewind the tune"); jButtonStart.setFocusable(false); jButtonStart.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButtonStart.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButtonStart.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonStartActionPerformed(evt); } }); jToolBarPlayer.add(jButtonStart); jButtonPlay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sw_emulator/swing/icons/player_play.png"))); // NOI18N jButtonPlay.setToolTipText("Play the tune"); jButtonPlay.setFocusable(false); jButtonPlay.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButtonPlay.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButtonPlay.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonPlayActionPerformed(evt); } }); jToolBarPlayer.add(jButtonPlay); jButtonFPlay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sw_emulator/swing/icons/player_fwd.png"))); // NOI18N jButtonFPlay.setToolTipText("Fast Forward"); jButtonFPlay.setFocusable(false); jButtonFPlay.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButtonFPlay.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButtonFPlay.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonFPlayActionPerformed(evt); } }); jToolBarPlayer.add(jButtonFPlay); jButtonPause.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sw_emulator/swing/icons/player_pause.png"))); // NOI18N jButtonPause.setToolTipText("Pause the tune"); jButtonPause.setFocusable(false); jButtonPause.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButtonPause.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButtonPause.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonPauseActionPerformed(evt); } }); jToolBarPlayer.add(jButtonPause); jButtonStop.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sw_emulator/swing/icons/player_stop.png"))); // NOI18N jButtonStop.setToolTipText("Stop the tune"); jButtonStop.setFocusable(false); jButtonStop.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButtonStop.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButtonStop.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonStopActionPerformed(evt); } }); jToolBarPlayer.add(jButtonStop); jButtonCurrent.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N jButtonCurrent.setText("1"); jButtonCurrent.setToolTipText("Current tune"); jButtonCurrent.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); jButtonCurrent.setEnabled(false); jButtonCurrent.setFocusable(false); jButtonCurrent.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButtonCurrent.setMaximumSize(new java.awt.Dimension(32, 30)); jButtonCurrent.setMinimumSize(new java.awt.Dimension(32, 30)); jButtonCurrent.setPreferredSize(new java.awt.Dimension(32, 30)); jButtonCurrent.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jToolBarPlayer.add(jButtonCurrent); jButtonMax.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N jButtonMax.setText("1"); jButtonMax.setToolTipText("Number of tunes"); jButtonMax.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); jButtonMax.setEnabled(false); jButtonMax.setFocusable(false); jButtonMax.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButtonMax.setMaximumSize(new java.awt.Dimension(32, 30)); jButtonMax.setMinimumSize(new java.awt.Dimension(32, 30)); jButtonMax.setPreferredSize(new java.awt.Dimension(32, 30)); jButtonMax.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jToolBarPlayer.add(jButtonMax); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jToolBarPlayer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jToolBarPlayer, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButtonPrevActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPrevActionPerformed prev(); }//GEN-LAST:event_jButtonPrevActionPerformed private void jButtonNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNextActionPerformed next(); }//GEN-LAST:event_jButtonNextActionPerformed private void jButtonStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonStartActionPerformed stop(); play(); }//GEN-LAST:event_jButtonStartActionPerformed private void jButtonPlayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPlayActionPerformed play(); }//GEN-LAST:event_jButtonPlayActionPerformed private void jButtonFPlayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonFPlayActionPerformed fplay(); }//GEN-LAST:event_jButtonFPlayActionPerformed private void jButtonPauseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPauseActionPerformed pause(); }//GEN-LAST:event_jButtonPauseActionPerformed private void jButtonStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonStopActionPerformed stop(); }//GEN-LAST:event_jButtonStopActionPerformed /** * Play the current tune */ private void play() { Path path = Paths.get(project.file.replaceAll("[/\\\\]+", "/")); File file=new File(option.tmpPath+File.separator+path.getFileName()); // write the file in temporary path FileManager.instance.writeFile(file, project.inB); sid=crsid.playSIDfile(file.getAbsolutePath(), tune); jButtonCurrent.setText(""+tune); jButtonMax.setText(""+sid.getMaxTune()); } /** * Fast play */ private void fplay() { crsid.fPlay(); } /** * Stop playing */ private void stop() { crsid.stopPlaying(); Path path = Paths.get(project.file.replaceAll("[/\\\\]+", "/")); Memory.instance.close(option.tmpPath+File.separator+path.getFileName(), tune); } /** * Pause playing */ private void pause() { crsid.pausePlaying(); } /** * Prev tune */ private void prev() { stop(); tune--; if (tune<1) tune=1; play(); } /** * Next tune */ private void next() { stop(); if (sid!=null && !(tune>=sid.getMaxTune())) tune++; play(); } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(JPlayerDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(JPlayerDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(JPlayerDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(JPlayerDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the dialog */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { JPlayerDialog dialog = new JPlayerDialog(new javax.swing.JFrame(), true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButtonCurrent; private javax.swing.JButton jButtonFPlay; private javax.swing.JButton jButtonMax; private javax.swing.JButton jButtonNext; private javax.swing.JButton jButtonPause; private javax.swing.JButton jButtonPlay; private javax.swing.JButton jButtonPrev; private javax.swing.JButton jButtonStart; private javax.swing.JButton jButtonStop; private javax.swing.JToolBar jToolBarPlayer; // End of variables declaration//GEN-END:variables }
15,012
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z
JCreditsDialog.java
/FileExtraction/Java_unseen/ice00_jc64/src/sw_emulator/swing/JCreditsDialog.java
/** * @(#)JCreditsDialog.java 2019/12/29 * * ICE Team free software group * * This file is part of JIIT64 Java Ice Team Tracker 64 * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package sw_emulator.swing; /** * Credits dialog * * @author ice */ public class JCreditsDialog extends javax.swing.JDialog { /** Creates new form JCreditsDialog */ public JCreditsDialog(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); Shared.framesList.add(this); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanelDn = new javax.swing.JPanel(); jButtonClose = new javax.swing.JButton(); jScrollPane = new javax.swing.JScrollPane(); jTextPaneCredits = new javax.swing.JTextPane(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Credits"); setResizable(false); jButtonClose.setText("Close"); jButtonClose.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonCloseActionPerformed(evt); } }); jPanelDn.add(jButtonClose); getContentPane().add(jPanelDn, java.awt.BorderLayout.PAGE_END); jTextPaneCredits.setContentType("text/html"); // NOI18N jTextPaneCredits.setText("<html>\n <head>\n </head>\n <body>\n <p style=\"margin-top: 0\">\n <b>Code:</b><br>\n Stefano Tognon (Ice00)\n <br><br>\n <b>External syntax highlight library:</b><br>\n Robert Futrell\n <br><br>\n<b>Flat look & feel:</b><br>\nFormDev Software GmbH\n <br><br>\n<b>Beta testing:</b><br>\nBacchus/Fairligh<br>\nChris Abbott \n <br><br>\n<b>C64 font:</b><br>\nhttps://style64.org/c64-truetype\n </p>\n </body>\n</html>\n"); jScrollPane.setViewportView(jTextPaneCredits); getContentPane().add(jScrollPane, java.awt.BorderLayout.CENTER); setSize(new java.awt.Dimension(416, 365)); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void jButtonCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCloseActionPerformed setVisible(false); }//GEN-LAST:event_jButtonCloseActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { JCreditsDialog dialog = new JCreditsDialog(new javax.swing.JFrame(), true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButtonClose; private javax.swing.JPanel jPanelDn; private javax.swing.JScrollPane jScrollPane; private javax.swing.JTextPane jTextPaneCredits; // End of variables declaration//GEN-END:variables }
4,269
Java
.java
ice00/jc64
43
6
0
2019-11-30T14:02:48Z
2024-05-05T18:41:15Z