Kareem Callender avatar Kareem Callender committed 7c4a6e2 Draft

Updated changelog and readme.
Made code insertion window a single-window dialog.

Comments (0)

Files changed (7)

gbread/Base/GBXLexer.cs

 // </auto-generated>
 //------------------------------------------------------------------------------
 
-// $ANTLR 3.4 GBX.g 2012-11-05 21:34:07
+// $ANTLR 3.4 GBX.g 2012-11-07 03:48:13
 
 // The variable 'variable' is assigned but its value is never used.
 #pragma warning disable 219
 	public const int WS=125;
 	public const int X_ESCAPE=126;
 
-		private List<ErrInfo> Errors = new List<ErrInfo>();
-
-		public override void DisplayRecognitionError(string[] tokenNames, RecognitionException e)
-		{
-			string errHeader = GetErrorHeader(e);
-			string errMSG = GetErrorMessage(e, tokenNames);
-			Errors.Add(new ErrInfo() {errText = errMSG, error = e});
-		}
-
-		public List<ErrInfo> GetErrors()
-		{
-			return Errors;
-		}
+	private List<ErrInfo> Errors = new List<ErrInfo>();
+
+	public override void DisplayRecognitionError(string[] tokenNames, RecognitionException e)
+	{
+		string errHeader = GetErrorHeader(e);
+		string errMSG = GetErrorMessage(e, tokenNames);
+		Errors.Add(new ErrInfo() {errText = errMSG, error = e});
+	}
+
+	public List<ErrInfo> GetErrors()
+	{
+		return Errors;
+	}
 
 
     // delegates

gbread/Base/GBXParser.cs

 // </auto-generated>
 //------------------------------------------------------------------------------
 
-// $ANTLR 3.4 GBX.g 2012-11-05 21:34:06
+// $ANTLR 3.4 GBX.g 2012-11-07 03:48:12
 
 // The variable 'variable' is assigned but its value is never used.
 #pragma warning disable 219
 	public override string GrammarFileName { get { return "GBX.g"; } }
 
 
-		private List<ErrInfo> Errors = new List<ErrInfo>();
-
-		public override void DisplayRecognitionError(string[] tokenNames, RecognitionException e)
-		{
-			string errHeader = GetErrorHeader(e);
-			string errMSG = GetErrorMessage(e, tokenNames);
-			Errors.Add(new ErrInfo() {errText = errMSG, error = e});
-		}
-
-		public List<ErrInfo> GetErrors()
-		{
-			return Errors;
-		}
+	private List<ErrInfo> Errors = new List<ErrInfo>();
+
+	public override void DisplayRecognitionError(string[] tokenNames, RecognitionException e)
+	{
+		string errHeader = GetErrorHeader(e);
+		string errMSG = GetErrorMessage(e, tokenNames);
+		Errors.Add(new ErrInfo() {errText = errMSG, error = e});
+	}
+
+	public List<ErrInfo> GetErrors()
+	{
+		return Errors;
+	}
 
 
 	partial void OnCreated();
 
 				{
 				// AST REWRITE
-				// elements: expression, ID
+				// elements: ID, expression
 				// token labels: 
 				// rule labels: retval
 				// token list labels: 
 
 				{
 				// AST REWRITE
-				// elements: ID, statement
+				// elements: statement, ID
 				// token labels: 
 				// rule labels: retval
 				// token list labels: 

gbread/Forms/InsertCodeForm.Designer.cs

             this.assembleButton = new System.Windows.Forms.Button();
             this.offsetBox = new System.Windows.Forms.TextBox();
             this.label1 = new System.Windows.Forms.Label();
-            this.insertButton = new System.Windows.Forms.Button();
-            this.replaceTextBox = new System.Windows.Forms.RichTextBox();
-            this.intermediaryTextBox = new System.Windows.Forms.RichTextBox();
-            this.label3 = new System.Windows.Forms.Label();
-            this.label4 = new System.Windows.Forms.Label();
-            this.label2 = new System.Windows.Forms.Label();
-            this.label5 = new System.Windows.Forms.Label();
-            this.label6 = new System.Windows.Forms.Label();
             this.cancelButton = new System.Windows.Forms.Button();
             this.elementHost1 = new System.Windows.Forms.Integration.ElementHost();
             this.textBoxHost1 = new GBRead.TextBoxHost();
             // 
             // assembleButton
             // 
+            this.assembleButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.assembleButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.assembleButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.assembleButton.Location = new System.Drawing.Point(12, 417);
+            this.assembleButton.Location = new System.Drawing.Point(228, 417);
             this.assembleButton.Name = "assembleButton";
-            this.assembleButton.Size = new System.Drawing.Size(251, 23);
+            this.assembleButton.Size = new System.Drawing.Size(79, 23);
             this.assembleButton.TabIndex = 2;
-            this.assembleButton.Text = "Assemble Code";
+            this.assembleButton.Text = "Assemble";
             this.assembleButton.UseVisualStyleBackColor = true;
             this.assembleButton.Click += new System.EventHandler(this.assembleButton_Click);
             // 
             // offsetBox
             // 
-            this.offsetBox.Location = new System.Drawing.Point(163, 391);
+            this.offsetBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+            this.offsetBox.Location = new System.Drawing.Point(122, 419);
             this.offsetBox.Name = "offsetBox";
             this.offsetBox.Size = new System.Drawing.Size(100, 20);
             this.offsetBox.TabIndex = 1;
             // 
             // label1
             // 
+            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.label1.Location = new System.Drawing.Point(9, 392);
+            this.label1.Location = new System.Drawing.Point(9, 420);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(107, 16);
             this.label1.TabIndex = 4;
             this.label1.Text = "Insert at position:";
             // 
-            // insertButton
-            // 
-            this.insertButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.insertButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.insertButton.Location = new System.Drawing.Point(289, 417);
-            this.insertButton.Name = "insertButton";
-            this.insertButton.Size = new System.Drawing.Size(247, 23);
-            this.insertButton.TabIndex = 3;
-            this.insertButton.Text = "Insert ASM";
-            this.insertButton.UseVisualStyleBackColor = true;
-            this.insertButton.Click += new System.EventHandler(this.insertButton_Click);
-            // 
-            // replaceTextBox
-            // 
-            this.replaceTextBox.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.replaceTextBox.Location = new System.Drawing.Point(562, 25);
-            this.replaceTextBox.Name = "replaceTextBox";
-            this.replaceTextBox.ReadOnly = true;
-            this.replaceTextBox.Size = new System.Drawing.Size(258, 360);
-            this.replaceTextBox.TabIndex = 6;
-            this.replaceTextBox.Text = "";
-            this.replaceTextBox.WordWrap = false;
-            // 
-            // intermediaryTextBox
-            // 
-            this.intermediaryTextBox.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.intermediaryTextBox.Location = new System.Drawing.Point(289, 25);
-            this.intermediaryTextBox.Name = "intermediaryTextBox";
-            this.intermediaryTextBox.ReadOnly = true;
-            this.intermediaryTextBox.Size = new System.Drawing.Size(247, 360);
-            this.intermediaryTextBox.TabIndex = 5;
-            this.intermediaryTextBox.Text = "";
-            this.intermediaryTextBox.WordWrap = false;
-            // 
-            // label3
-            // 
-            this.label3.AutoSize = true;
-            this.label3.Font = new System.Drawing.Font("Consolas", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.label3.Location = new System.Drawing.Point(264, 152);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(24, 17);
-            this.label3.TabIndex = 10;
-            this.label3.Text = "->";
-            // 
-            // label4
-            // 
-            this.label4.AutoSize = true;
-            this.label4.Font = new System.Drawing.Font("Consolas", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.label4.Location = new System.Drawing.Point(537, 152);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(24, 17);
-            this.label4.TabIndex = 11;
-            this.label4.Text = "->";
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.label2.Location = new System.Drawing.Point(97, 9);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(57, 13);
-            this.label2.TabIndex = 12;
-            this.label2.Text = "ASM Input";
-            // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(378, 9);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(65, 13);
-            this.label5.TabIndex = 13;
-            this.label5.Text = "ASM Output";
-            // 
-            // label6
-            // 
-            this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(634, 9);
-            this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(109, 13);
-            this.label6.TabIndex = 14;
-            this.label6.Text = "Data Being Replaced";
-            // 
             // cancelButton
             // 
+            this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
             this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.cancelButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.cancelButton.Location = new System.Drawing.Point(562, 417);
+            this.cancelButton.Location = new System.Drawing.Point(313, 417);
             this.cancelButton.Name = "cancelButton";
-            this.cancelButton.Size = new System.Drawing.Size(258, 23);
-            this.cancelButton.TabIndex = 4;
+            this.cancelButton.Size = new System.Drawing.Size(60, 23);
+            this.cancelButton.TabIndex = 3;
             this.cancelButton.Text = "Cancel";
             this.cancelButton.UseVisualStyleBackColor = true;
             // 
             // elementHost1
             // 
-            this.elementHost1.Location = new System.Drawing.Point(12, 25);
+            this.elementHost1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.elementHost1.Location = new System.Drawing.Point(12, 12);
             this.elementHost1.Name = "elementHost1";
-            this.elementHost1.Size = new System.Drawing.Size(251, 360);
-            this.elementHost1.TabIndex = 15;
+            this.elementHost1.Size = new System.Drawing.Size(808, 399);
+            this.elementHost1.TabIndex = 0;
             this.elementHost1.Text = "elementHost1";
             this.elementHost1.Child = this.textBoxHost1;
             // 
             this.ClientSize = new System.Drawing.Size(834, 452);
             this.Controls.Add(this.elementHost1);
             this.Controls.Add(this.cancelButton);
-            this.Controls.Add(this.label6);
-            this.Controls.Add(this.label5);
-            this.Controls.Add(this.label2);
-            this.Controls.Add(this.label4);
-            this.Controls.Add(this.label3);
-            this.Controls.Add(this.intermediaryTextBox);
-            this.Controls.Add(this.replaceTextBox);
-            this.Controls.Add(this.insertButton);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.offsetBox);
             this.Controls.Add(this.assembleButton);
 		private System.Windows.Forms.Button assembleButton;
         private System.Windows.Forms.TextBox offsetBox;
         private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.Button insertButton;
-        private System.Windows.Forms.RichTextBox replaceTextBox;
-        private System.Windows.Forms.RichTextBox intermediaryTextBox;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.Label label4;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Label label5;
-        private System.Windows.Forms.Label label6;
         private System.Windows.Forms.Button cancelButton;
         private System.Windows.Forms.Integration.ElementHost elementHost1;
         private TextBoxHost textBoxHost1;

gbread/Forms/InsertCodeForm.cs

                     Error.ShowErrorMessage(c);
                     gcheckSuccess = false;
                 }
-                else if (preComCheck.Length == 0)
+                else if (preComCheck.Length != 0)
                 {
-                    gcheckSuccess = false;
-                }
-                else
-                {
-                    intermediaryTextBox.Text = refFile.PrintASM(preComCheck, off, 0, preComCheck.Length);
-                    replaceTextBox.Text = refFile.PrintASM(off, preComCheck.Length);
-                    gcheckSuccess = true;
-                }
-            }
-        }
-
-        private void insertButton_Click(object sender, EventArgs e)
-        {
-            if (gcheckSuccess)
-            {
-                if (MessageBox.Show("Are you sure you want to insert this code?", "Confirm Insertion", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
-                {
-                    baseFile.ModifyFile(insertOffset, preComCheck);
-                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
+                    string message = "Are you sure you want to insert this code?";
+                    message += "\n" + "Offset: $" + insertOffset.ToString("X") + "  Size: $" + preComCheck.Length.ToString("X") + " byte(s)";
+                    if (MessageBox.Show(message, "Confirm Insertion", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
+                    {
+                        baseFile.ModifyFile(insertOffset, preComCheck);
+                        this.DialogResult = System.Windows.Forms.DialogResult.OK;
+                    }
                 }
             }
         }
         {
             if ((Keys)e.KeyChar == Keys.Enter)
             {
-                insertButton_Click(new object(), new EventArgs());
+                assembleButton_Click(new object(), new EventArgs());
                 e.Handled = true;
             }
             if (!Char.IsControl(e.KeyChar) && !Char.IsDigit(e.KeyChar) && !(e.KeyChar >= 'A' && e.KeyChar <= 'F') && !(e.KeyChar >= 'a' && e.KeyChar <= 'f') && !(e.KeyChar == ':'))

gbread/Forms/MainForm.cs

             }
         }
 
+        private void iPSToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            if (romFile.FileLoaded)
+            {
+                OpenFileDialog ofd = new OpenFileDialog();
+                ofd.Title = "Open original file";
+                ofd.Filter = "GB/GBC Files|*.gb;*.gbc|All Files|*";
+                ofd.FileName = "";
+                if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+                {
+                    byte[] orig = File.ReadAllBytes(ofd.FileName);
+                    if (orig.Length != romFile.Length)
+                    {
+                        Error.ShowErrorMessage(ErrorMessage.IPS_FileSizeMismatch);
+                    }
+                    SaveFileDialog afd = new SaveFileDialog();
+                    afd.Title = "Save IPS File...";
+                    afd.Filter = "GB/GBC Files|*.gb;*.gbc|All Files|*";
+                    afd.FileName = "";
+                    if (afd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+                    {
+                        IPS ips = new IPS();
+                        ErrorMessage emt = ips.GenerateIPS(orig, romFile.MainFile);
+                        if (emt != ErrorMessage.General_NoError)
+                        {
+                            File.WriteAllBytes(afd.FileName, ips.GetIPS());
+                            MessageBox.Show("Patch successfuly written to " + Environment.NewLine + afd.FileName);
+                        }
+                        else
+                        {
+                            Error.ShowErrorMessage(emt);
+                        }
+                    }
+                }
+            }
+            else
+            {
+                Error.ShowErrorMessage(ErrorMessage.General_NoFileLoaded);
+            }
+        }
+
+        private void loadTableFileToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            OpenFileDialog ofd = new OpenFileDialog();
+            ofd.Title = "Open Table File...";
+            ofd.Filter = "Table Files|*.tbl;*.txt|All Files|*";
+            ofd.FileName = "";
+            if (ofd.ShowDialog() == DialogResult.OK)
+            {
+                labelContainer.TableFile.LoadTableFile(ofd.FileName);
+            }
+        }
+
+        private void loadShiftJISTableFileToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            OpenFileDialog ofd = new OpenFileDialog();
+            ofd.Title = "Open Table File...";
+            ofd.Filter = "Table Files|*.tbl;*.txt|All Files|*";
+            ofd.FileName = "";
+            if (ofd.ShowDialog() == DialogResult.OK)
+            {
+                labelContainer.TableFile.LoadTableFile(ofd.FileName, true);
+            }
+        }
+
         #endregion Toolstrip Menus
 
         private void printASMButton_Click(object sender, EventArgs e)
                 Error.ShowErrorMessage(ErrorMessage.General_NoFileLoaded);
             }
         }
-
-        private void iPSToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            if (romFile.FileLoaded)
-            {
-                OpenFileDialog ofd = new OpenFileDialog();
-                ofd.Title = "Open original file";
-                ofd.Filter = "GB/GBC Files|*.gb;*.gbc|All Files|*";
-                ofd.FileName = "";
-                if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
-                {
-                    byte[] orig = File.ReadAllBytes(ofd.FileName);
-                    if (orig.Length != romFile.Length)
-                    {
-                        Error.ShowErrorMessage(ErrorMessage.IPS_FileSizeMismatch);
-                    }
-                    SaveFileDialog afd = new SaveFileDialog();
-                    afd.Title = "Save IPS File...";
-                    afd.Filter = "GB/GBC Files|*.gb;*.gbc|All Files|*";
-                    afd.FileName = "";
-                    if (afd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
-                    {
-                        IPS ips = new IPS();
-                        ErrorMessage emt = ips.GenerateIPS(orig, romFile.MainFile);
-                        if (emt != ErrorMessage.General_NoError)
-                        {
-                            File.WriteAllBytes(afd.FileName, ips.GetIPS());
-                            MessageBox.Show("Patch successfuly written to " + Environment.NewLine + afd.FileName);
-                        }
-                        else
-                        {
-                            Error.ShowErrorMessage(emt);
-                        }
-                    }
-                }
-            }
-            else
-            {
-                Error.ShowErrorMessage(ErrorMessage.General_NoFileLoaded);
-            }
-        }
-
-        private void loadTableFileToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            OpenFileDialog ofd = new OpenFileDialog();
-            ofd.Title = "Open Table File...";
-            ofd.Filter = "Table Files|*.tbl;*.txt|All Files|*";
-            ofd.FileName = "";
-            if (ofd.ShowDialog() == DialogResult.OK)
-            {
-                labelContainer.TableFile.LoadTableFile(ofd.FileName);
-            }
-        }
-
-        private void loadShiftJISTableFileToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            OpenFileDialog ofd = new OpenFileDialog();
-            ofd.Title = "Open Table File...";
-            ofd.Filter = "Table Files|*.tbl;*.txt|All Files|*";
-            ofd.FileName = "";
-            if (ofd.ShowDialog() == DialogResult.OK)
-            {
-                labelContainer.TableFile.LoadTableFile(ofd.FileName, true);
-            }
-        }
     }
 
     public class MainFormOptions

gbread/changelog.txt

-r1: 2010/10/01
-Initial Release
+r16(2012/11/7)
+-[Add]Comments can be specified for disassembly. They are attached to specific
+offsets, and are printed whenever the instruction at that offset is printed.
+-[Add]Data templates, for sections. See readme for usage.
+-[Add]Preliminary string handling, and table support. See readme for usage.
+-[Change]New save file format, settings.txt. Option setting details can be
+found in the readme.
+-[Change]Added default.txt. This file contains default labels that are loaded
+whenever a new project is opened.
+-[Change]Highlighting is now on all the time.
+-[Fix]New assembler engine generated by ANTLR. So, it should be a lot more
+flexible, and simultaneously more strict.
 
-r2: 2010/10/3
--[Fix]accidentally reversed byte order on some asm calls.
--[Add]Function labels
+r15(2012/6/24)
+-[Change]Various miscellaneous things.
+-[Remove]Function length, "guessed" length. Current length options in label
+files will be ignored.
+-[Fix]Miscellaneous errors.
 
-r3: 2010/10/4
--[Fix]Some logic concerning data length and division
--[Fix]Added more catches for faulty data.
--[Add]Data labels (labels for sections of binary data)
--[Add]A few extra options in the options menu
--[Change]The format of the Function List:
-label,xxxxxxxx,name       <--For code labels
-data,xxxxxxxx,name,length <--For data labels
+r14.7(2012/2/11)
+-[Add]When searching for references to a function, search results will specify
+the type of reference.
+-[Change]When giving addresses for calls and jumps, if no label is present,
+they will be represented as word-sized numbers, instead of using file offsets.
+-[Fix]Fixed the selection highlighting not working when Shift was used.
+-[Fix]Fixed the "Data Row Size" not using the entered size when a section is
+added.
+-[Fix]"Guessed Length" was too low on certain functions that used the "jr"
+instruction.
+-[Fix]Fixed "ld a,[nnnn]" not showing brackets.
+-[Fix]Fixed error related to textbox drawing.
+-[Fix]Fixed the broken "Search for Calls"
+-[Fix]Changed the default 'header' label to start at $104.
 
-r4: 2010/10/7
--[Fix]Various ambiguous areas in the code
--[Add]Export Data Sections to .bin File (On the Right Click Menu)
--[Change] The way instructions are displayed. Now, ASM instructions are
-default, and extended instructions are added on as comments at the end
-of the line.
+r14.51(2012/2/3)
+-[Fix]Some instructions had missing brackets.
+-[Fix]"Guessed Length" was in decimal, and not hex, as its identifier would
+indicate.
+-[Fix]Some instructions had missing arguments.
+-[Fix]Some instructions printed the register twice.
 
-r5: 2010/10/10
--[Fix]Made the header info less ambiguous.
--[Add]You can specify which bank you want to change to, instead of always
-assuming "1" is loaded. This still needs mbc-specific work, though.
--[Change]By default, ASM-style instructs will be printed. The option to append
-extended instructions as comments is in the Options menu.
+r14.5(2012/2/3)
+-[Add]Default variables are loaded when a file is loaded. These vars consist
+of all the areas in the memory-mapped I/O, like JOY and LCDC.
+-[Add]"Data Row Size". That is, this determines how many bytes per line data
+prints at.
+-[Change]A little work on the backend, so the lookup speed for each line
+should be improved.
+-[Fix]Removed and repurposed older functions.
+-[Fix]The newly added options should be saved now.
 
-r6: ????
-Lost forever
+r14(2012/1/29)
+-[Add]Highlighting of various text elements. Comments, labels, and
+instruction keywords are highlighted by default, and others can be set in the
+Options menu. Currently, the highlighting options aren't saved.
+-[Add]When printing functions with no length (double clicking on the label),
+the guessed length of the function will be printed along with the comments.
+Since the guessed length can't compensate for jumps made through means other
+than jp and jr (like jp hl, or rst to a jump table, for example), reading the
+function to see what it does may still be necessary.
+-[Change]When searching for a variable within the saved functions, only the
+ones with set lengths will be searched. Same goes for the function reference
+search.
+-[Change]The format of the search results for variable searching has been
+changed to be more compact.
+-[Remove]The "Find Functions With Bank Changes" option. Doesn't say much about
+the function itself.
+-[Fix]Minor option error.
+-[Fix]When assembling code, the offsets printed didn't take into account the
+place being replaced. The correct offsets should be printed now.
+-[Fix]Rewrote the variable search and the called function searches. They
+should be a bit better now.
+-[Fix]Some functions with unknown length were printing short.
 
-r7 (2010/11/21) 
--[Add]Added ability to search for bank changes in functions.
--[Fix]Fixed bug where function list is not closed after reading it for the first
-time.
+r13.01(2012/1/6)
+-[Add]An option for word wrap on the main window. Option is not saved yet,
+though.
+-[Fix]Various alignment changes in the interface.
+-[Fix]Wrong check caused some search results to not be shown for variable ref.
+searching.
+-[Fix]Mistyped instruction caused the wrong thing to be searched for in the
+var search. Changed to correct instruction.
 
-r8 (2011/2/11)
--[Add]Variables (of the sort used in ld ($xxxx),a) can now be defined, and
-searched for.
--[Fix]Removal of some redundant code.
--[Fix]Fixed the code for instruction "ldhl sp,"
--[Change]: A bit of a change to the code used to find calls, to help find more 
-calls and eliminate some bad functions.
--[Fix]Whoops, spelling error made a function act up in a certain situation.
+r13(2011/12/25)
+-[Add]Labels will show up green if they have a length defined.
+-[Add]Data will show up pink if they are images.
+-[Add]Added visible option to fix header info, specifically the complement 
+check and the checksum.
+-[Change]Changed interface a bit.
+-[Fix]The function that guessed at the contents of a function with no length
+defined was giving weird results.
+-[Fix]Function labels saving with negative length.
+-[Fix]Added a bit more resistance against edge conditions.
+-[Fix]Limits changed to [4 kilobytes - 8 megabytes].
+-[Fix]When 'assembling', the results were appended to the output, instead of
+replacing. 
+-[Remove]"Search for var usage". Redundant.
 
-r9 (2011/5/4)
--[Change]Made GB/GBC files a single option instead of 2. Hmm, should have done 
-this before.
--[Change]Resizable window...
--[Change]Commas should be alright with comments now.
--[Fix]Functions didn't rename properly.
--[Fix]Vars weren't being shown by name in certain situations.
--[Fix]Edge condition in a certain function inside the program.
--[Fix]I only considered ret, and forgot about reti...
--[Fix]Syntax.
+r12.03(2011/10/03)
+-[Fix]Offset + 1, not offset...
+-[Fix]Printing actual names instead of default names for labels...
 
-r10 (2011/07/06)
--[Fix] Some more instructions I missed. Went through the whole list, the
-following ones were mistyped originally:
-ldd [hl],a and ldd a,[hl]
-as well as numbers written wrongly. Sorry for those affected by these
-instructions which were written differently.
--[Add] Added some assembling capability based a little off xASM. Can insert
-data at specific parts of the file, from hand-typed code, or from an external
-binary file.
--[Add] Added ability to save changes to the file, whether by saving a whole
-file, or an IPS patch.
--[Change] Moved around some options to increase visibility.
+r12.02(2011/10/01)
+-[Fix]Printing ASM used default labels instead of actual labels.
+
+r12.01(2011/09/29)
+-[Fix]Search For Calls causing an exception.
+
+r12 (2011/09/27)
+-[Add/Change]All regular labels will have autogenerated names if none are
+specified (Ex: 345 -> "F_000345"). As a result, all unnamed labels will get
+names when you load them, or generate them.
+-[Add]More options :p
+-[Change]The way data sections and variables are displayed in the boxes to the
+side.
+-[Fix]Some spelling mistakes.
+-[Fix]Misplaced newline.
+-[Fix]Function list at the side wasn't being sorted.
+-[Fix]Put ASM printing on a different thread.
+-[Fix]Code cleanup.
+-[Fix]Changed some things to free up resources.
+-[Fix]Size was being printed as decimal instead of hex...
+-[Fix]After changing a label, if a mistake was made, the window closed instead
+of remaining open.
+-[Fix]Data sections being loaded ignored the palette options. Not anymore.
+-[Fix]When variables were being printed out in the ASM file, they didn't have
+the prefix to indicate they were hex.
+-[Fix]Default palette for 'image' sections.
+-[Remove]Save Window Contents. You can just copy the stuff out of it, or
+print ASM to file directly...
+-[Remove]For now, I'm disabling the IPS save option to work on it some more.
 
 r11 (2011/08/04)
 -[Add]You now have the option of specifying data as an image. The palettes
 -[Fix]CB instructions had been printing the wrong bytes for most of the
 instructions.
 
-r12 (2011/09/27)
--[Add/Change]All regular labels will have autogenerated names if none are
-specified (Ex: 345 -> "F_000345"). As a result, all unnamed labels will get
-names when you load them, or generate them.
--[Add]More options :p
--[Change]The way data sections and variables are displayed in the boxes to the
-side.
--[Fix]Some spelling mistakes.
--[Fix]Misplaced newline.
--[Fix]Function list at the side wasn't being sorted.
--[Fix]Put ASM printing on a different thread.
--[Fix]Code cleanup.
--[Fix]Changed some things to free up resources.
--[Fix]Size was being printed as decimal instead of hex...
--[Fix]After changing a label, if a mistake was made, the window closed instead
-of remaining open.
--[Fix]Data sections being loaded ignored the palette options. Not anymore.
--[Fix]When variables were being printed out in the ASM file, they didn't have
-the prefix to indicate they were hex.
--[Fix]Default palette for 'image' sections.
--[Remove]Save Window Contents. You can just copy the stuff out of it, or
-print ASM to file directly...
--[Remove]For now, I'm disabling the IPS save option to work on it some more.
+r10 (2011/07/06)
+-[Fix] Some more instructions I missed. Went through the whole list, the
+following ones were mistyped originally:
+ldd [hl],a and ldd a,[hl]
+as well as numbers written wrongly. Sorry for those affected by these
+instructions which were written differently.
+-[Add] Added some assembling capability based a little off xASM. Can insert
+data at specific parts of the file, from hand-typed code, or from an external
+binary file.
+-[Add] Added ability to save changes to the file, whether by saving a whole
+file, or an IPS patch.
+-[Change] Moved around some options to increase visibility.
 
-r12.01(2011/09/29)
--[Fix]Search For Calls causing an exception.
+r9 (2011/5/4)
+-[Change]Made GB/GBC files a single option instead of 2. Hmm, should have done 
+this before.
+-[Change]Resizable window...
+-[Change]Commas should be alright with comments now.
+-[Fix]Functions didn't rename properly.
+-[Fix]Vars weren't being shown by name in certain situations.
+-[Fix]Edge condition in a certain function inside the program.
+-[Fix]I only considered ret, and forgot about reti...
+-[Fix]Syntax.
 
-r12.02(2011/10/01)
--[Fix]Printing ASM used default labels instead of actual labels.
+r8 (2011/2/11)
+-[Add]Variables (of the sort used in ld ($xxxx),a) can now be defined, and
+searched for.
+-[Fix]Removal of some redundant code.
+-[Fix]Fixed the code for instruction "ldhl sp,"
+-[Change]: A bit of a change to the code used to find calls, to help find more 
+calls and eliminate some bad functions.
+-[Fix]Whoops, spelling error made a function act up in a certain situation.
 
-r12.03(2011/10/03)
--[Fix]Offset + 1, not offset...
--[Fix]Printing actual names instead of default names for labels...
+r7 (2010/11/21) 
+-[Add]Added ability to search for bank changes in functions.
+-[Fix]Fixed bug where function list is not closed after reading it for the first
+time.
 
-r13(2011/12/25)
--[Add]Labels will show up green if they have a length defined.
--[Add]Data will show up pink if they are images.
--[Add]Added visible option to fix header info, specifically the complement 
-check and the checksum.
--[Change]Changed interface a bit.
--[Fix]The function that guessed at the contents of a function with no length
-defined was giving weird results.
--[Fix]Function labels saving with negative length.
--[Fix]Added a bit more resistance against edge conditions.
--[Fix]Limits changed to [4 kilobytes - 8 megabytes].
--[Fix]When 'assembling', the results were appended to the output, instead of
-replacing. 
--[Remove]"Search for var usage". Redundant.
+r6: ????
+Lost forever
 
-r13.01(2012/1/6)
--[Add]An option for word wrap on the main window. Option is not saved yet,
-though.
--[Fix]Various alignment changes in the interface.
--[Fix]Wrong check caused some search results to not be shown for variable ref.
-searching.
--[Fix]Mistyped instruction caused the wrong thing to be searched for in the
-var search. Changed to correct instruction.
+r5: 2010/10/10
+-[Fix]Made the header info less ambiguous.
+-[Add]You can specify which bank you want to change to, instead of always
+assuming "1" is loaded. This still needs mbc-specific work, though.
+-[Change]By default, ASM-style instructs will be printed. The option to append
+extended instructions as comments is in the Options menu.
 
-r14(2012/1/29)
--[Add]Highlighting of various text elements. Comments, labels, and
-instruction keywords are highlighted by default, and others can be set in the
-Options menu. Currently, the highlighting options aren't saved.
--[Add]When printing functions with no length (double clicking on the label),
-the guessed length of the function will be printed along with the comments.
-Since the guessed length can't compensate for jumps made through means other
-than jp and jr (like jp hl, or rst to a jump table, for example), reading the
-function to see what it does may still be necessary.
--[Change]When searching for a variable within the saved functions, only the
-ones with set lengths will be searched. Same goes for the function reference
-search.
--[Change]The format of the search results for variable searching has been
-changed to be more compact.
--[Remove]The "Find Functions With Bank Changes" option. Doesn't say much about
-the function itself.
--[Fix]Minor option error.
--[Fix]When assembling code, the offsets printed didn't take into account the
-place being replaced. The correct offsets should be printed now.
--[Fix]Rewrote the variable search and the called function searches. They
-should be a bit better now.
--[Fix]Some functions with unknown length were printing short.
+r4: 2010/10/7
+-[Fix]Various ambiguous areas in the code
+-[Add]Export Data Sections to .bin File (On the Right Click Menu)
+-[Change] The way instructions are displayed. Now, ASM instructions are
+default, and extended instructions are added on as comments at the end
+of the line.
 
-r14.5(2012/2/3)
--[Add]Default variables are loaded when a file is loaded. These vars consist
-of all the areas in the memory-mapped I/O, like JOY and LCDC.
--[Add]"Data Row Size". That is, this determines how many bytes per line data
-prints at.
--[Change]A little work on the backend, so the lookup speed for each line
-should be improved.
--[Fix]Removed and repurposed older functions.
--[Fix]The newly added options should be saved now.
+r3: 2010/10/4
+-[Fix]Some logic concerning data length and division
+-[Fix]Added more catches for faulty data.
+-[Add]Data labels (labels for sections of binary data)
+-[Add]A few extra options in the options menu
+-[Change]The format of the Function List:
+label,xxxxxxxx,name       <--For code labels
+data,xxxxxxxx,name,length <--For data labels
 
-r14.51(2012/2/3)
--[Fix]Some instructions had missing brackets.
--[Fix]"Guessed Length" was in decimal, and not hex, as its identifier would
-indicate.
--[Fix]Some instructions had missing arguments.
--[Fix]Some instructions printed the register twice.
+r2: 2010/10/3
+-[Fix]accidentally reversed byte order on some asm calls.
+-[Add]Function labels
 
-r14.7(2012/2/11)
--[Add]When searching for references to a function, search results will specify
-the type of reference.
--[Change]When giving addresses for calls and jumps, if no label is present,
-they will be represented as word-sized numbers, instead of using file offsets.
--[Fix]Fixed the selection highlighting not working when Shift was used.
--[Fix]Fixed the "Data Row Size" not using the entered size when a section is
-added.
--[Fix]"Guessed Length" was too low on certain functions that used the "jr"
-instruction.
--[Fix]Fixed "ld a,[nnnn]" not showing brackets.
--[Fix]Fixed error related to textbox drawing.
--[Fix]Fixed the broken "Search for Calls"
--[Fix]Changed the default 'header' label to start at $104.
-
-r15(2012/6/24)
--[Change]Various miscellaneous things.
--[Remove]Function length, "guessed" length. Current length options in label
-files will be ignored.
--[Fix]Miscellaneous errors.
-
-r16(Late 2012)
--[Add]Comments can be specified for disassembly. They are attached to specific
-offsets, and are printed whenever the instruction at that offset is printed.
--[Add]Shiny new Add Comment button to add those comments :)
--[Change]New save file format, settings.txt. Option setting details can be
-found in the readme.
--[Change]Added default.txt. This file contains default labels that are loaded
-whenever a new project is opened.
--[Change]Highlighting is now on all the time.
--[Fix]New assembler engine generated by ANTLR(tm). So, it should be a lot more
-flexible, and simultaneously more strict.
+r1: 2010/10/01
+Initial Release

gbread/readme.txt

 memory map is used repeatedly (e.g. [$FF41], the LCD Status register).
 Comments can also be added by themselves, through [Add Comments...].
 
+c-2. Data Templates
+Data templating (added in r16) is a way to format the output of a given data
+section, when printed. Each command is ended with a semicolon (;).
+
+    byte[count];
+    word[count];
+    dword[count];
+    qword[count];
+    string(length)[count];
+
+byte,word,dword,qword,string: The type of data to print on a line. Sizes are
+8-bit, 16-bit, 32-bit, 64-bit, and "variable", respectively.
+
+count: The amount that is printed on a single line. For example:
+
+    word[2];
+
+    dw $4503, $3204
+
+Omitting the array specifier is the same as having [1].
+
+length: Used with the string option, specifies a fixed length string to be
+printed.
+
+    string(3)[2];
+
+    ds "hah", "lol"
+
+Omitting the length parameter, strings default to null-terminated, or best-fit
+with the space available.
+
+    string[1];
+
+    ds "This is a sentence.\x00"
+
+c-1-a: Tables
+When printing strings, an ASCII table is used by default (well, just casting
+each byte as a char). For other formats, you can use the option in the file
+menu to load either regular table files, or Shift-JIS table files, for those
+who still have them lying around. There is no support for string handling in
+building (not at the moment, anyway).
+
 d. View Labels/Variables
 You can manage labels through clicking on them in the list to the right of the
 main box. Double clicking on a regular label or data section label will
 boxes. Save format is as follows:
 
 ------------------------------------------------------------------------------
-gbr
-.label
-_n:<name>
-_o:<offset>
-_c:<comment line>
+    gbr
+    .label
+    _n:<name>
+    _o:<offset>
+    _c:<comment line>
 
-.data
-_n:<name>
-_o:<offset>
-_c:<comment>
-_l:<length>
-_t:<type>
-_d:<data row size>
-_p1:<palette color 1 (optional)>
-_p2:<palette color 2 (optional)>
-_p3:<palette color 3 (optional)>
-_p4:<palette color 4 (optional)>
+    .data
+    _n:<name>
+    _o:<offset>
+    _c:<comment>
+    _l:<length>
+    _t:<type>
+    _d:<data template>
+    _p1:<palette color 1 (optional)>
+    _p2:<palette color 2 (optional)>
+    _p3:<palette color 3 (optional)>
+    _p4:<palette color 4 (optional)>
 
-.var
-_n:<name>
-_v:<value>
-_c:<comment line>
+    .var
+    _n:<name>
+    _v:<value>
+    _c:<comment line>
 
 gbr: The header of this save file format. Required.
 
 _t: Type. The type of data label. Can be either Data (for regular data), or
 Image (for raw tiles).
 
-_d: Data Row Size. This determines where to place breaks when printing data
-in the program. For example:
+_d: Data Template This determines how to format the data that is printed in
+this section. For example:
 
-_d:3
+    _d:b3
 
-db $56,$67,$07
-db $08,$08,$09
-db $09,$23,$54,
-db $23
+    db $56,$67,$07
+    db $08,$08,$09
+    db $09,$23,$54,
+    db $23
 
-_d:8
+    _d:b8
 
-db $56,$67,$07,$08,$08,$09,$09,$23
-db $54,$23
+    db $56,$67,$07,$08,$08,$09,$09,$23
+    db $54,$23
+
+    _d:b8s3!4w2
+
+    db $56,$67,$07,$08,$08,$09,$09,$23
+    ds "haha","pony","lime"
+    dw $2304, $2401
+
+b, d, w, q, s: Represents byte, word, dword, qword, and string, in that order.
+number: Specifies how many on the same line.
+! : This, following the s#, specifies that the string is fixed length, with
+the size following it.
 
 _p1, 2, 3, 4: Palette colors. Each one is the 16-bit representation of the
 color:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.