Jump to content
ralphb

xdt99: New TI 99 cross-development tools available

Recommended Posts

22 minutes ago, ralphb said:

That really depends on your distribution.

 

On Debian-based distributions, you can choose which Python version to start by running

update-alternatives --config python

For other distributions, you could edit the first line of each program (recommended), as you suggested, or create an alias python=python3 (which will not work for xhm99/xvm99).  And you can still use the old version of xdt99 by selecting "python2" in the branch selector on GitHub, or downloading an old release.

 

Please note that Python 2 has been out of maintenance since the beginning of this year.  Ubuntu 20.04 doesn't even ship Python 2 any more.

 

I appreciate the info.  It sounds like there are some easy options for resolving the issue.

 

Thanks!

Share this post


Link to post
Share on other sites
On 1/11/2015 at 3:24 PM, ralphb said:

The TI 99 Cross-Development Tools (xdt99) are planned as a suite of programs to facilitate the development of programs for the TI 99 family of home computers on modern computer systems.

 

Hi, Ralph!

 

I just wanted to step in and say "thank you" for the cross-assembler and the companying tools.

 

I have set up an environment through a DOS batch combining xas99, xdm99, NotePad++ and MAME that helps saving typing a lot:

 

So now I just have to E, A, R, I, D, M to have a complete workflow from editing to starting up Editor/Assembler and "load and run" the output.

 

Special thanks for the xdm that creates a disk file with the needed files ready to mount with MAME.

 

Michael

 

2020-05-10 01_11_03-C__WINDOWS_system32_cmd.exe - xdt99  gmode gmode1.png

2020-05-10 01_18_58-C__WINDOWS_system32_cmd.exe - xdt99  gmode gmode1.png

  • Like 4

Share this post


Link to post
Share on other sites

You're welcome!

 

Your environment looks very interesting.  It's basically a GUI for xdt99! 😃  I'm sure other people might be interested in that tool.  Have you thought about sharing it?

 

Share this post


Link to post
Share on other sites
1 hour ago, ralphb said:

Have you thought about sharing it?

 

Well, it's far from "ready", but if someone wants to habe a glimpse... ;-)

 

It makes heavy use of setting (and combining) DOS environment variables. But they are all "cleaned up" when exiting through (Q)uit.

 

Pro: An "echo" here and there could show up problems like "Debug.Print()" or "Console.WriteLine()". Con: All that % create an awkward syntax.

 

(And "awkward syntax" was the reason to fork to TurboPasc99 instead of c99 that days.)

 

In fact that DOS batch started as a sketch to have a blueprint for creating a "real" IDE coded in C# or VB.Net. Well, if time permits...

 

As a purist I'm not that happy using things like calling subroutines (TOUPPERCASE) or using "choice" in the batch. But on the other hand... It's the 21st century and I'm still dealing with a gray/black CLI, so what am I complaining about? ;-)

 

I should say some words about the using, or at least the adapting. I'll make another post for that.

 

Michael

 

And here it goes:

@echo off
cls
setlocal enabledelayedexpansion

:param1
if [%1] == [] goto noproject
set ti99_prj=%1
goto param2
:noproject
rem ...
goto quit

:param2
if [%2] == [] goto defaultsource
set ti99_wrk=%2
goto setfiles
:defaultsource
set ti99_wrk=%ti99_prj%
:setfiles
set ti99_src=%ti99_wrk%.a99
set ti99_obj=%ti99_wrk%.obj
set ti99_lst=%ti99_wrk%.lst
set ti99_img=%ti99_wrk%.img
set ti99_rpk=%ti99_wrk%.rpk
set ti99_dsk=%ti99_prj%.dsk

:settings
set wrk_drv=E:
set wrk_dir=\Spiele\MAME\TI99\
set xdt_drv=E:
set xdt_dir=\Spiele\MAME\TI99\xdt99\
set xdt_prj=%xdt_dir%projects\
set xdt_lib=%xdt_dir%lib\
set xdt_ed="C:\Program Files (x86)\Notepad++\notepad++.exe"
set xdt_as=xas99.py
set xdt_dm=xdm99.py
set dsk_img=%ti99_wrk:~0,9%
call :TOUPPERCASE dsk_img
set dsk_asm=%dsk_img%A
set dsk_obj=%dsk_img%O
set dsk_lst=%dsk_img%L

set emu_drv=E:
set emu_dir=\Spiele\MAME\
set emu_bin=mame64.exe
set emu_par=ti99_4ev
set emu_par=%emu_par% -gromport single
set emu_par=%emu_par% -cart editass
set emu_par=%emu_par% -ioport peb
set emu_par=%emu_par% -ioport:peb:slot2 evpc
set emu_par=%emu_par% -ioport:peb:slot2:evpc:colorbus busmouse
set emu_par=%emu_par% -ioport:peb:slot4 speech
set emu_par=%emu_par% -ioport:peb:slot6 tirs232
set emu_par=%emu_par% -ioport:peb:slot8 hfdc
set emu_par=%emu_par% -ioport:peb:slot8:hfdc:f1 525dd
set emu_par=%emu_par% -ioport:peb:slot8:hfdc:f2 525dd
set emu_par=%emu_par% -ioport:peb:slot8:hfdc:f3 525dd
set emu_par=%emu_par% -ioport:peb:slot8:hfdc:f4 525dd
set emu_par=%emu_par% -ioport:peb:slot8:hfdc:h1 generic
set emu_par=%emu_par% -ioport:peb:slot8:hfdc:h2 generic
set emu_par=%emu_par% -ioport:peb:slot8:hfdc:h3 generic
set emu_par=%emu_par% -flop1 ti99/disk/edassa.dsk
set emu_par=%emu_par% -flop3 ti99/disk/flopdsk3.dsk
set emu_par=%emu_par% -flop4 ti99/disk/flopdsk4.dsk
set emu_par=%emu_par% -hard1 ti99/hard/harddsk1.chd
set emu_par=%emu_par% -hard2 ti99/hard/harddsk2.chd
set emu_par=%emu_par% -hard3 ti99/hard/harddsk3.chd
rem set emu_par=%emu_par% -flop2 flopdsk2.dsk

%xdt_drv%
cd %xdt_drv%%xdt_prj%%ti99_prj%
for %%g in (*.a99) do (
  set file1=%%g
  set file2=!file1:.a99=a!
  call :TOUPPERCASE file2
  echo        %%g --- !file1! --- !file2!
  set file1=
  set file2=
)
for %%g in (*.obj) do (
  set file1=%%g
  set file2=!file1:.obj=o!
  call :TOUPPERCASE file2
  echo        %%g --- !file1! --- !file2!
  set file1=
  set file2=
)
for %%g in (*.lst) do (
  set file1=%%g
  set file2=!file1:.lst=l!
  call :TOUPPERCASE file2
  echo        %%g --- !file1! --- !file2!
  set file1=
  set file2=
)
for %%g in (*.img) do (
  set file1=%%g
  set file2=!file1:.img=!
  call :TOUPPERCASE file2
  echo        %%g --- !file1! --- !file2!
  set file1=
  set file2=
)
%xdt_drv%
cd %xdt_dir%
rem goto quit

%xdt_drv%
cd %xdt_dir%

goto showsettings

rem ***************************************************************************

:loop
%wrk_drv%
cd %wrk_dir%
echo.
echo -------------------------------------------------------------------------------
echo (E) edit source file                    (A) assemble E/A 3 object file
echo (R) create MESS .rpk file               (I) create E/A 5 image file
echo (D) create MAME .dsk file               (S) show settings / used files
echo (M) emulator start                      (Q) quit
echo.
choice /c EARIDSMQ /N /m "Choice: E, A, R, I, D, S, M, Q > "
echo.
if %errorlevel% EQU 8 goto quit
if %errorlevel% EQU 7 goto emulator
if %errorlevel% EQU 6 goto showsettings
if %errorlevel% EQU 5 goto disk
if %errorlevel% EQU 4 goto image
if %errorlevel% EQU 3 goto mess
if %errorlevel% EQU 2 goto assemble
if %errorlevel% EQU 1 goto edit
if %errorlevel% EQU 0 goto loop
goto loop

rem ***************************************************************************

:edit
echo (E)dit
echo %xdt_drv%%xdt_prj%%ti99_prj%\%ti99_src%
%xdt_drv%
cd %xdt_prj%%ti99_prj%
%xdt_ed% %ti99_src%
goto loop

rem ***************************************************************************

:assemble
echo (A)ssemble for EA3
echo %xdt_drv%%xdt_prj%%ti99_prj%\%ti99_obj% / %ti99_lst%
%xdt_drv%
cd %xdt_prj%%ti99_prj%
%xdt_as% -R -S -I %xdt_drv%%xdt_lib% -L %ti99_lst% %ti99_src%
goto loop

rem ***************************************************************************

:mess
echo (R)pk for MESS
echo %xdt_drv%%xdt_prj%%ti99_prj%\%ti99_rpk%
%xdt_drv%
cd %xdt_prj%%ti99_prj%
%xdt_as% -R -S -I %xdt_drv%%xdt_lib% -c %ti99_src%
goto loop

rem ***************************************************************************

:image
echo (I)mage for EA5
echo %xdt_drv%%xdt_prj%%ti99_prj%\%ti99_img%
%xdt_drv%
cd %xdt_prj%%ti99_prj%
%xdt_as% -R -S -I %xdt_drv%%xdt_lib% -i %ti99_src%
goto loop

rem ***************************************************************************

:disk
echo (D)isk for MAME
echo %xdt_drv%%xdt_prj%%ti99_dsk%
%xdt_drv%
cd %xdt_prj%
%xdt_dm% -X 2s2d40t %ti99_dsk%
%xdt_dm% %ti99_dsk% -a %xdt_drv%%xdt_prj%%ti99_prj%\%ti99_src% -n %dsk_asm% -f DIS/VAR80
%xdt_dm% %ti99_dsk% -a %xdt_drv%%xdt_prj%%ti99_prj%\%ti99_obj% -n %dsk_obj% -f DIS/FIX80
%xdt_dm% %ti99_dsk% -a %xdt_drv%%xdt_prj%%ti99_prj%\%ti99_lst% -n %dsk_lst% -f DIS/VAR80
%xdt_dm% %ti99_dsk% -a %xdt_drv%%xdt_prj%%ti99_prj%\%ti99_img% -n %dsk_img% -f P
%xdt_dm% %ti99_dsk%
goto loop

rem ***************************************************************************

:showsettings
cls
echo (S)ettings in use
echo.
echo xdt:
echo   xdt       : %xdt_drv%%xdt_dir%
echo   Assembler : %xdt_as%
echo   Diskmgr.  : %xdt_dm%
echo.
echo Project:
echo   Project   : -''- \%ti99_prj%\
echo   Source    : %ti99_src%
echo.
echo Externals:
echo   Editor    : %xdt_ed%
goto loop

rem ***************************************************************************

:emulator
echo e(M)ulate  %emu_drv%%emu_dir%%emu_bin%
echo.
copy %xdt_drv%%xdt_prj%%ti99_dsk% E:\Spiele\MAME\TI99\disk\%ti99_dsk%
%emu_drv%
cd %emu_dir%
%emu_bin% %emu_par% -flop2 TI99/disk/%ti99_dsk%
goto loop

rem ***************************************************************************

:quit
echo (Q)uit
%wrk_drv%
cd %wrk_dir%
set ti99_prj=
set ti99_src=
set ti99_obj=
set ti99_lst=
set ti99_img=
set ti99_rpk=
set ti99_dsk=
set dsk_asm=
set dsk_obj=
set dsk_lst=
set dsk_img=
set xdt_drv=
set xdt_dir=
set xdt_prj=
set xdt_lib=
set xdt_as=
set xdt_ed=
set xdt_dm=
set wrk_drv=
set wrk_dir=
set emu_drv=
set emu_dir=
set emu_bin=
set emu_par=
echo done...
goto ende

:TOUPPERCASE
if not defined %~1 exit /b
for %%a in ("a=A" "b=B" "c=C" "d=D" "e=E" "f=F" "g=G" "h=H" "i=I" "j=J" "k=K" "l=L" "m=M" "n=N" "o=O" "p=P" "q=Q" "r=R" "s=S" "t=T" "u=U" "v=V" "w=W" "x=X" "y=Y" "z=Z" "ä=Ä" "ö=Ö" "ü=Ü") do (
call set %~1=%%%~1:%%~a%%
)

:ende

 

  • Like 2

Share this post


Link to post
Share on other sites

The usage of this batch is
* xdt99 <project> [<source>]
while <source> must not have an extension.

 

The batch then initializes a lot of constants, some of them depending on the one or two parameters given.

If you have a look at chapters (labels) param1 and param2:
* If param1 <project> is not given then the batch ends instantly. Otherwise the %1 is stored in <ti99_prj>.
* if param2 is not given then <project> is used as a base for the filenames <ti99_wrk>. Otherwise %2 is stored there.

 

From <ti99_wrk> there are derived a few filenames for source, object, list, image, rpk and disk files.

Given that you may have a project folder like "graphics" and work on a specific source "grf1.a99" within that folder by calling the batch with:
* xdt99 graphics grf1
I would recommend to not use more than 6 letters for the source and not more than 10 letters for the project. Reason: I normally use the filename same as the "start" label and the project name is used as the disk-label (not the filename, but the label for the TI filesystem).

 

Now the interesting part you have to adapt - chapter "settings":


A lot of "set=..." for setting up the working directory / files (wrk), incorporating the cross-assembler and other external tools (xdt), the emulator (emu) and the like. This is the place where you will have to adapt one or another path and bin name.

 

As you can see, the "windows" filenames are directly derived from <ti99_wrk> by adding .a99, .obj etc to the base. The "ti99" filenames are derived from the (uppercase) <ti99_wrk> by adding A, O etc. I normally separate file infos into <drive>, <path> and <file> to make moving the directory to another drive a bit easier.

 

And then there is the big <emu> chapter that sets up the emulator, MAME in this case. Please note that there is set up a <flop1> with the disk for the Editor/Assembler and that <flop2> is REMed out - that one will be set later on.

 

There are 4 loops following that you simply can ignore. They are a test for the project / file separation and I just happen to have them not deleted before publishing. ;-) What I will try to get: Albeit working on a specific source right now the (D)isk command shall copy other files from that "project" to the created disk, too. So if the project "graphics" contains grf1, grf2, grf3 and vdptools they all should be copied later on.

 

The lifetime cycle of the batch starts at chapter "loop". After getting the user's choice it branches to the chosen chapter and hopefully executes the wanted tasks by using all that set up variables.

 

(E)dit starts the external editor. I'm quite happy with NotePad++ although the syntax highlighting is not perfect. That d**n asteriks and greater-than characters always mix up with remarks, formulas and the like. Perhaps I have to always use ** for remarks and use blanks after the > operator to help with NP recognize them correctly.

 

Nevertheless... If you start the (E)ditor the batch will wait for return from there, if... If you already have the editor opened then it will return instantly. I use this quite often to spare the (E) and work directly in the editor, save the file and continue directly with the (A)ssemble.

 

For completeness I usually start creating (R)pk and (I)mage, too. Then The (D)isk has to be created and finally the e(M)ulator can be started.

 

From the TI title screen a keypress leads to the menu where Editor/Assembler should be an option if nothing went wrong mounting the cartridge.

From EA via option 3 "load and run" the compiled object code is found as DSK2.<ti99_obj> if nothing went wrong mounting the disk, too. If you are unsure about the exact filename just have a look at the last output from the batch: xdt shows the current directory of the disk.

 

Have fun...

 

  • Like 2

Share this post


Link to post
Share on other sites

Ah, and I should have added:

 

The <project> folder must be created prior to calling the batch! Have a look at

set xdt_drv=E:

set xdt_dir=\Spiele\MAME\TI99\xdt99\

set xdt_prj=%xdt_dir%projects\

 

So I would have to MKDIR a project folder like

E:\Spiele\MAME\TI99\xdt99\projects\graphics

Probably a

rem. > grf1.a99

in there, too, to create an empty source file. But that depends a bit on the editor used - how it complains about the "not existing" input file.

 

And I like to have that batch as

E:\Spiele\MAME\TI99\xdt99\xdt99.bat

to have the projects folder directly beneath the compiler.

 

BTW: The batch uses a "library" path for xas99 via

set xdt_lib=%xdt_dir%lib\

Just in case you didn't notice... ;-)

 

Michael

 

 

Share this post


Link to post
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.

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...