• R/O
  • SSH
  • HTTPS

oricsdk: Commit


Commit MetaInfo

Revision1708 (tree)
Time2023-09-30 19:04:49
Authordbug

Log Message

XA 2.2.7
- Extended the "#print" command to make the formatting of size output nicer by using the '=' symbol as a separator between the expression and some arbitrary string on the left hand side

Originally the code would typically look like that:

#echo Total size
#print (end-start)

which would display

Total size
(end-start)=(5-1)= 4

Now instead we can just use

#print Total size = (end-start)

which would output

Total size = (5-1)= 4

Not a major change, but it makes it much nicer to output a bunch of data in a compact and readable way:

#print Total size of game text content = (_EndGameTextData - _StartGameTextData)
#print - Messages and prompts = (_EndMessagesAndPrompts - _StartMessagesAndPrompts)
#print - Error messages = (_EndErrorMessages - _StartErrorMessages)
#print - Location names = (_EndLocationNames - _StartLocationNames)
#print - Item names = (_EndItemNames - _StartItemNames)
#print - Scene scripts = (_EndSceneScripts - _StartSceneScripts)

will result in that output:

Total size of game text content = (_EndGameTextData - _StartGameTextData)= 6314
- Messages and prompts = (_EndMessagesAndPrompts - _StartMessagesAndPrompts)= 518
- Error messages = (_EndErrorMessages - _StartErrorMessages)= 590
- Location names = (_EndLocationNames - _StartLocationNames)= 1267
- Item names = (_EndItemNames - _StartItemNames)= 1015
- Scene scripts = (_EndSceneScripts - _StartSceneScripts)= 2894

Change Summary

Incremental Difference

--- public/pc/tools/osdk/main/Osdk/_final_/documentation/doc_assembler.htm (revision 1707)
+++ public/pc/tools/osdk/main/Osdk/_final_/documentation/doc_assembler.htm (revision 1708)
@@ -352,6 +352,9 @@
352352 <p>Here is the list of all releases with a short description of things that changed:
353353 </p>
354354
355+<p id=dateentry>2.2.7</p>
356+- Extended the "#print" command to make the formatting of size output nicer by using the '=' symbol as a separator between the expression and some arbitrary string on the left hand side
357+
355358 <p id=dateentry>2.2.6</p>
356359 - Returns an Error Code value 1 if a source file is missing
357360
--- public/pc/tools/osdk/main/Osdk/_final_/documentation/doc_historic.htm (revision 1707)
+++ public/pc/tools/osdk/main/Osdk/_final_/documentation/doc_historic.htm (revision 1708)
@@ -24,6 +24,7 @@
2424 <li>Fixed the debugger documentation with the modified Oricutron commands, and fixed the HTML to actually show the parameters</li>
2525 <li>Added the BASIC flood fill sample program from Geoff Phillips book "Oric Atmos and Oric 1 Graphics and Machine code techniques" in sample\basic\paint</li>
2626 <li>Added the C equivalent flood fill routine in sample\c\paint</li>
27+ <li>Upgraded <A href="doc_assembler.htm">XA</A> to the version 2.2.7 which an extended syntax for the #print command to allow displaying information on a single line</li>
2728 </ul>
2829
2930 <p id=dateentry>Version 1.20 - January 14th 2023</p>
--- public/pc/tools/osdk/main/xa/sources/xa.cpp (revision 1707)
+++ public/pc/tools/osdk/main/xa/sources/xa.cpp (revision 1708)
@@ -93,9 +93,9 @@
9393 static const char *copyright=
9494 {
9595 #ifdef _WIN32
96- "Cross-Assembler 65xx V2.2.6 (" __TIME__ " / " __DATE__ ") \r\n"
96+ "Cross-Assembler 65xx V2.2.7 (" __TIME__ " / " __DATE__ ") \r\n"
9797 #else
98- "Cross-Assembler 65xx V2.2.6 (No date available) \r\n"
98+ "Cross-Assembler 65xx V2.2.7 (No date available) \r\n"
9999 #endif
100100 "(c) 1989-98 by A.Fachat\r\n"
101101 "65816 opcodes and modes coded by Jolse Maginnis\r\n"
--- public/pc/tools/osdk/main/xa/sources/xap.cpp (revision 1707)
+++ public/pc/tools/osdk/main/xa/sources/xap.cpp (revision 1708)
@@ -171,11 +171,27 @@
171171 return E_OK;
172172 }
173173
174+// There are now two possible syntaxes:
175+// #print expression
176+// #print some stuff to print = expression
174177 ErrorCode Preprocessor::command_print(char *t)
175178 {
176179 int f,a,er;
177180
178- logout(t);
181+ char* equalPtr = strchr(t, '=');
182+ if (equalPtr)
183+ {
184+ // Found a "=" symbol: We print out the left hand side expression as is, and move the pointer to after the expression
185+ *equalPtr++ = 0;
186+ logout(t);
187+ t = equalPtr;
188+ }
189+ else
190+ {
191+ // No "=" symbol found
192+ logout(t);
193+ }
194+
179195 if ((er=pp_replace(BufferLine,t,-1,m_CurrentListIndex)))
180196 {
181197 logout("\n");
@@ -185,7 +201,7 @@
185201 {
186202 logout("=");
187203 logout(BufferLine);
188- logout("=");
204+ logout("= ");
189205 er=b_term(BufferLine,&a,&f,TablePcSegment[gCurrentSegment]);
190206 if (er)
191207 {
Show on old repository browser