From 0ab5431c5fa36f4799e172e8d619a450a5f30e64 Mon Sep 17 00:00:00 2001 From: arookas Date: Wed, 23 Dec 2015 20:20:13 -0500 Subject: [PATCH] Made variable symbols write a custom name. --- ssc/symbol table.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ssc/symbol table.cs b/ssc/symbol table.cs index a93ce59..c2c9c7b 100644 --- a/ssc/symbol table.cs +++ b/ssc/symbol table.cs @@ -201,6 +201,8 @@ namespace arookas public int Display { get; private set; } public int Index { get; private set; } + string TableName { get { return String.Format("varsym_{0}_{1}", Display, Index); } } + // symbol table public override sunSymbolType Type { get { return sunSymbolType.Variable; } } public override uint Data { get { return (uint)Index; } } @@ -211,6 +213,16 @@ namespace arookas Display = display; Index = index; } + + public override int WriteSymbolTable(aBinaryWriter writer, int ofs) + { + base.WriteSymbolTable(writer, ofs); + return writer.Encoding.GetByteCount(TableName) + 1; // include null terminator + } + public override void WriteStringTable(aBinaryWriter writer) + { + writer.WriteString(TableName, aBinaryStringFormat.NullTerminated); + } } enum sunSymbolType