Jump to content
IGNORED

xdt99: New TI 99 cross-development tools available


ralphb

Recommended Posts

1 hour ago, pixelpedant said:

That having said, one issue I experienced is just that as written (at least on Windows and Python 3.11), it was necessary to change all the string conversion in XBAS99.PY to Latin1 rather than ASCII, as my program uses the full range of characters available to (i.e., which can be typed under) TI BASIC.  Which is to say, 127-159 and 176-198 inclusive.

Thanks for the kind feedback, I'm really glad you find the tool useful.  Regarding Latin1, do you CALL CHAR characters above 127 to their corresponding Latin1 pattern?  If so, it's probably a good idea to make the input encoding a parameter.  (The other tools already have such a parameter for the output encoding.)

 

EDIT: Rereading your post, are you using Latin1 char codes as part of the program, i.e., as variable names?  Or only within strings?

 

BTW, have you tested the IDEA plugin that's part of xdt99?  While you need to install the rather heavy Jetbrains IDEA Community Edition IDE, the plugin has some advanced editing features, like renaming variables or line numbers consistently, finding all occurrences, finding the definition of a symbol (first occurrence in the case of BASIC), showing unused and undefined variables, and syntax highlighting.

Edited by ralphb
  • Like 2
Link to comment
Share on other sites

1 hour ago, ralphb said:

Thanks for the kind feedback, I'm really glad you find the tool useful.  Regarding Latin1, do you CALL CHAR characters above 127 to their corresponding Latin1 pattern?  If so, it's probably a good idea to make the input encoding a parameter.

Well, CALL CHAR uses a numeric value as its character value, so this does originate as a character with a value greater than 127 in the DATA statements from which the value and ensuing pattern string is read, but ends up as a numeric value as far as CALL CHAR is concerned.  In any case, all instances of characters greater than 127 (of which there are a great many) are now being successfully read from source and written to disk as desired, so I'm happy.  XBAS99.PY is having no trouble with lines like the following, with all the string .encode and .decode methods just using Latin1 by default (and my editor set to Latin1 likewise):

 

15 DATA "¹RLCONSPIRING¹SMTO DESCEND¸h821928C492462831i9146482184126289¹RNTO CONQUER¹SOIN THE ENDÁBBA¾!9B^!6DZ¸jB2096A92AC219A44k4299244242249942"
16 DATA "¾ =;¼>7ÁBBH¾^8B^^5DZ]7=G>UÁNBAGBH¹KIHELL@S HEART°I°G°F°C³D¸l914E5045A20A7289m924C419205649229n894658A4251A6291oB25C42D684749A01"

 

I shall perhaps have to try the IDEA option, in the future.  This project is so built around interpreted data (housed in DATA statements, as above), that conventional code editing tools aren't as useful as they might be, but perhaps when next I have a saner project on my hands. 

Link to comment
Share on other sites

I'd like to chime in here to second PixelPedant's sentiments.

 

I'm now using the XDT99 assembler and IDEA plugin for my AL project. It's a total game-changer in terms of coding efficiency and enjoyment. Like many, I love coding to the limitations of the TI hardware to see what can be accomplished, etc., but I've "done my time" back in the 80's in terms of ever wanting to actually write/debug code using the console itself. That's a whole level of pain that no amount of nostalgia can overcome. :)

 

So many thanks for putting this amazing project together. My code/assemble/load/run cycle is now a few seconds vs. even the streamlined/semi-automated cycle required when I was using compiled XB256. And I'm able to develop completely natively on my M2 mac (excepting classic99_64.exe which runs under WINE).

 

One thing I wish IDEA had was a simple left-side nav pane with the just the labels listed so I could navigate quickly by clicking on them. Perhaps it's "not a thing" in the IDEA world.

 

 

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

7 hours ago, pixelpedant said:
15 DATA "¹RLCONSPIRING¹SMTO DESCEND¸h821928C492462831i9146482184126289¹RNTO CONQUER¹SOIN THE ENDÁBBA¾!9B^!6DZ¸jB2096A92AC219A44k4299244242249942"
16 DATA "¾ =;¼>7ÁBBH¾^8B^^5DZ]7=G>UÁNBAGBH¹KIHELL@S HEART°I°G°F°C³D¸l914E5045A20A7289m924C419205649229n894658A4251A6291oB25C42D684749A01"

Thanks for the clarification.  There's an alternative to the latin1 encoding: How useful would it be for you (and others) if you could insert arbitrary chars by their code point the way Python does it?  For example, you could write

 

10 PRINT "Copyright \xa7 pixelpedant"

 

and the \xa7 would be replaced by the char whose ORD is >A7 in the generated program.  This would work for quoted and unquoted strings.

 

I thought about implementing this before, but it doesn't really offer any advantages for (GPL) assembly, where you can mix hex strings and text anyway.

Edited by ralphb
Link to comment
Share on other sites

56 minutes ago, retrodroid said:

I'd like to chime in here to second PixelPedant's sentiments.

[...]

One thing I wish IDEA had was a simple left-side nav pane with the just the labels listed so I could navigate quickly by clicking on them. Perhaps it's "not a thing" in the IDEA world.

Thank you very much.  I don't think that IDEA offers this symbol list out of the box.  I guess using Navigation / Symbol ... to quickly navigate to a symbol is the next best thing (after changing the Ctrl-Shift-Alt modifier to something sane 😉).

Link to comment
Share on other sites

8 minutes ago, ralphb said:

Thank you very much.  I don't think that IDEA offers this symbol list out of the box.  I guess using Navigation / Symbol ... to quickly navigate to a symbol is the next best thing (after changing the Ctrl-Shift-Alt modifier to something sane 😉).

The Structure panel works like that for Java. Perhaps it's possible to write support code for the Structure panel?

  • Like 3
Link to comment
Share on other sites

10 minutes ago, Asmusr said:

The Structure panel works like that for Java. Perhaps it's possible to write support code for the Structure panel?

Oh, I didn't know that tool window.  Yes, that might be a good idea,  I'll see if I can implement it.

  • Like 2
Link to comment
Share on other sites

3 hours ago, ralphb said:

Thanks for the clarification.  There's an alternative to the latin1 encoding: How useful would it be for you (and others) if you could insert arbitrary chars by their code point the way Python does it?  For example, you could write

 

10 PRINT "Copyright \xa7 pixelpedant"

 

and the \xa7 would be replaced by the char whose ORD is >A7 in the generated program.  This would work for quoted and unquoted strings.

I think that would make a great deal of sense.  I'd considered writing a script to do this on my own behalf, actually, just because it would arguably result in more readable DATA statements.  Since the character is ultimately not being used for the sake of the character itself in this case - it is being used for its numeric value.  And so the Latin1 representation is ultimately meaningless, and a numeric representation, whether hex or decimal, would be more useful, in general. 

Link to comment
Share on other sites

7 hours ago, ralphb said:

Thank you very much.  I don't think that IDEA offers this symbol list out of the box.  I guess using Navigation / Symbol ... to quickly navigate to a symbol is the next best thing (after changing the Ctrl-Shift-Alt modifier to something sane 😉).

Upon further review it seems the "Bookmarks" panel is quite useful for navigating between key sections, though it requires managing the bookmarks yourself.

  • Like 1
Link to comment
Share on other sites

I've just pushed the new xbas99 version with support for char escape codes.  You can find all the information here.

 

I wasn't sure if incorrect escape codes should be interpreted verbatim, as that would improve backwards compatibility.  But on the other hand the code (and I think the logic) is much simpler without that.  You can still disable the new feature (and any future ones) with the new strict option -s.

 

  • Like 3
Link to comment
Share on other sites

  • 4 weeks later...
10 hours ago, arcadeshopper said:

Is there a way to identify dis/var 254 files as basic files and view them?

Greg, that's long format, isn't it?  You can use xbas99 to view that file like this

 

xbas99.py -L -d <file>

 

If the file is from Classic 99, you'll need to unwrap it first.  You can combine both steps like this:

 

xdm99.py -F <file> -o - | xbas99.py -L -d -

 

There's no real detection feature, but if the output of these commands is nonsense, then the file was no BASIC program.

 

It's a real pity that TI chose DISPLAY format for merge and long formats.  Since xdm99 assumes that DISPLAY files contain text, records are separated by newlines and do not include a length byte.  It's entirely possible, though, that a record contains >0A, which will break that logic.  For now it hasn't been an issue for me ...

 

EDIT: newline = >0A

Edited by ralphb
  • Like 1
Link to comment
Share on other sites

4 minutes ago, ralphb said:

Greg, that's long format, isn't it?  You can use xbas99 to view that file like this

 

xbas99.py -L -d <file>

 

If the file is from Classic 99, you'll need to unwrap it first.  You can combine both steps like this:

 

xdm99.py -F <file> -o - | xbas99.py -L -d -

 

There's no real detection feature, but if the output of these commands is nonsense, then the file was no BASIC program.

 

It's a real pity that TI chose DISPLAY format for merge and long formats.  Since xdm99 assumes that DISPLAY files contain text, records are separated by newlines and do not include a length byte.  It's entirely possible, though, that a record contains 0x0a, which will break that logic.  For now it hasn't been an issue for me ...

 

I get nothing in response just returns to the prompt

 

the file here is the disk, and it contains one file, i have that disk unpacked to my TIPI and it's in TIFILES format
 

Oregon.dsk

  • Like 1
Link to comment
Share on other sites

Oh, I forgot to mention, it creates a file <file>.bas or <file>.b99 on the disk.  If you want to print it directly to the screen, use

 

xbas99.py -L -p <file>

 

instead.  To print it directly from disk:

 

xdm99.py Oregon.dsk -e OREGONTEB -o - | xbas99.py -L -p -

 

EDIT: No dysentery?! 😄  But very cool!

Edited by ralphb
  • Like 1
  • Haha 1
Link to comment
Share on other sites

4 hours ago, ralphb said:

Oh, I forgot to mention, it creates a file <file>.bas or <file>.b99 on the disk.  If you want to print it directly to the screen, use

 

xbas99.py -L -p <file>

 

instead.  To print it directly from disk:

 

xdm99.py Oregon.dsk -e OREGONTEB -o - | xbas99.py -L -p -

 

EDIT: No dysentery?! 😄  But very cool!

cool thanks I see now! :)

 

 

 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I've pushed a new version of xbas99.py that implements a few GitHub requests.  In particular, I've added local labels within subprograms as well as an option to shorten all labels to 6 chars max so that it can be compiled with senior_falcon's compiler.  I also fixed a bug when using labels and more whitespace than LIST would output.  All new changes are described in this file (renamed from MANUAL.diff).

Edited by ralphb
  • Like 4
Link to comment
Share on other sites

  • 2 weeks later...

@ralphb I'm working on the conversion of some Z80 code. If I define a macro 'call', and invoke it like '.call @my_routine', is there any way the IntelliJ plugin could recognize my_routine as a label so, for instance, when I rename my_routine it would also change it in the .call?  

  • Like 3
Link to comment
Share on other sites

22 minutes ago, Asmusr said:

@ralphb I'm working on the conversion of some Z80 code. If I define a macro 'call', and invoke it like '.call @my_routine', is there any way the IntelliJ plugin could recognize my_routine as a label so, for instance, when I rename my_routine it would also change it in the .call?  

Oh, you're right.  In fact, I don't analyze macro arguments at all right now.  It should be possible, though.  Thankfully, I decided to do "semantic substitution", i.e., macro arguments need to be complete and valid expressions.

 

I'm working on xdt99 right now anyway, so I'll add your request to the next release.

  • Like 3
Link to comment
Share on other sites

I've just published release 3.6.0:

  • Add -B option for fully padded binaries for xas99 and xga99 (also joins all SAVEs and banks/GROMs)
  • Detect existing GPL header when creating MAME cart images for xas99 and xga99
  • Include macro calls in list file for xas99 and xga99
  • Add syntax highlighting, navigation and semantic renaming for macros for IDEA plugin

Here are direct links to the new plugin here and the summary of changes.

  • Like 5
  • Thanks 3
Link to comment
Share on other sites

20 hours ago, Asmusr said:

In the IDEA plugin, equates no longer seem to be recognized in macros

 

You're right, and it turns out that we have conflicting rules for macro arguments.  Right now I define

 

args_pp ::=
    ((opGA | expr) (OP_SEP (opGA | expr))*)?

 

which means that IDEA first tries to parse a general address and then a value expression.  A general address includes a register and thus a register alias, so any plain symbol that is not preceded by @ is parsed as register aliases.

 

If I swap the rule

 

args_pp ::=
    ((expr | opGA) (OP_SEP (expr | opGA))*)?

 

then any plain symbol will be parsed as symbol and never as register alias.

 

We never have this ambiguity outside of macro arguments, since every operand is either-or.  The only solutions to this ambiguity I see right now are 

 

- live with having an error for symbols or register aliases

- make register aliases syntactically different from other symbols, e.g., by prepending an unused symbol like §

- use a marker like R# for register aliases only in macro arguments

- analyze the macro body to figure out if symbol is value or register alias (difficult (EDIT: very difficult), since it would also need to change the parser result)

 

Do you have a preference for a solution, besides 4?

Edited by ralphb
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...