Since Github prefers text-files I converted them to ZXText2P-format using a modified version of p2txt that is also in the same repository. There are also some ported programs from More BASIC Computer Games edited by David H. Ahl, published 1979.
More programs and p-files are here:
I was thinking of improving p2txt further by showing not used characters as hex-codes and use hex-codes for the **-operator and all keywords and functions in REM-statements, e.g. \C4 is CODE in a REM-statement. Then I first have to change ZXText2P so that it can handle this. This would make it possible to convert more programs from bas- to p-files. Any opinions about this?
Code: Select all
<sysvars> ... </sysvars> <program> <lineno>10</lineno><statement>&rem;#c9/statement> <lineno>20</lineno><statement>&rand;&usr;#4082</statement> </program> <display> ... </display> <vars> ... </vars>
I agree to that XML would not be very suitable for Github since one wants the files in an easily editable text-format. One could have REM:s with hex-streams e.g.:sirmorris wrote:Perhaps you could routinely encode all REM statements which contain non-alphanumerics as hex streams. It would be neater, maybe.
Forget XML. Just my 2€ worth.
1 REM \*2A0C40C9
1 REM [HEX: 2A,0C,40,C9]
(The second notation comes from ZxToken.zip.)
If one wants to mix hex and ordinary code:
1 REM \2A\0C\40\C9 LD HL,(D_FILE);RET
1 REM \*2A0C40C9*\ LD HL,(D_FILE);RET
1 REM [HEX: 2A,0C,40,C9] LD HL,(D_FILE);RET
The system variables are constructed by ZXText2P. If one has a program that has non-typical system-variables one could in a future version of ZXText2P load the content of REM-statements to those addresses using negative line numbers and have the address after @, e.g.
-10 REM @403C \*2A0C40C9
-10 REM @403C [HEX: 2A,0C,40,C9]
-10 REM @403C \2A\0C\40\C9
If one wanted to add to the display or variables area one could add REM-statements after the BASIC-program using line numbers with plus:
+10000 REM @D_FILE \*2A0C40C9
+10000 REM @D_FILE [HEX: 2A,0C,40,C9]
+10010 REM @VARS \*2A0C40C9
+10010 REM @VARS [HEX: 2A,0C,40,C9]
+10020 REM @VARS+5*4 \*2A0C40C9
+10020 REM @VARS+5*4 [HEX: 2A,0C,40,C9]