Search the Community
Showing results for tags 'xdt99'.
Found 3 results
As discussed a little yesterday in the Pandemic club 4A zoom call (thanks for the interesting discussion!) I started to look a bit how the GPL interpreter could be optimised. My original idea was to add some instructions to my FPGA processor core to speed up the interpretation with special purpose instructions, but as I started to look at the code it's quite clear that a lot can be achieved with normal code optimisation. @RXB mentioned that there has been a discussion with @Tursi about this topic. I somehow recall seeing that thread myself, but couldn't easily find it (which is probably my fault). As an obvious optimisation, instead of the multiple levels of tables, the GPL instruction decoding could be improved at the cost of using some more memory simply by having a 256 entry lookup table (occupying 512 bytes). For that part I could create a new instruction which could combine a few TMS9900 instructions, in pseudo code: // Address 0x78 MOVB *R13,R9 JGPL @TABLE,R9 // Here JGPL would be a new instuction, something like below. // The instruction would only perform 2 memory fetches: Read R9, and fetch the jump vector from TABLE. BANK 1 // Switch bottom 8K to a new bank, which has the jump table MOV R9,TEMP // Temp internal register SRL TEMP,7 // TEMP >> 7, shift to a word index MOV @TABLE(TEMP),TEMP // Fetch from table BANK 0 // Switch bottom 8K to normal bank B *TEMP In the arrangement above since the opcode would be passed to the new instruction JGPL, that instruction could also be developed further to understand some GPL instructions directly, executing them directly by the CPU instead of TMS9900. Many GPL instructions are quite involved, so it would best to be able to incrementally improve things, for example starting with branch instructions which seem to be rather simple. I also realised that I am jumping the gun - I should try to look at some GPL code before going to optimization phase to understand how things work. To that end I started using xga99.py to assemble the GPL code for Minimemory cartridge, as a test. Also since I think this a very cool cartridge which could be integrated and expanded in interesting ways in both my icy99 and StrangeCart projects. So I got the GPL source code for Minimemory from Thierry's excellent TI-99/4A tech pages. I guess that code is for his GPL assembler. But I wanted to use the xdt99 package. So I started to assemble the source with xga99.py, like so: xga99.py --aorg 6000 mmg.gpl -L mmg.lst I quite quickly ran into a few problems, due to differences in syntax, for example: The AORG directive in xdt99 does not accept addresses higher than 8K. This causes a number of problems, because there is a hole in the code, i.e. it AORGs to >70AC skipping a bunch of bytes. I guess I have to manually fill that range with some bytes. The multiplication instruction in the source is MPY, but xga99 uses MUL. Not a biggie. Many lines in the code contain comments (which is great) after the code. I have never understood why the comments don't start with a special character like semicolon or something, that would make parsing easier for the assembler and it could probably also prevent some mistakes. Anyway, xga99 could not assemble a number of lines because the comments were separated by just a space. I just removed those comments after the code (by moving them to a separate comment line). The HTEX instruction (in a FMT block) escapes hex bytes differently, simple change: from HTEX '[>0A]' to HTEX >0A Some other opcodes also are different: CAR -> CARRY, PARS -> PARSE, DCGTE -> DCGT The source code uses the BIAS command also outside a FMT - FEND block, it appears to specify a constant to be added to strings specified with the STRI directive. The source I used has first BIAS >60 to set the TI Basic character code offset. I did not find a way to replicate this functionality in xda99. The advice goes: "use the source, Luke". And so I did, and created a new directive STRI60 for xda99, as follows. It's hack for sure, but I didn't want to enter the text as BYTE statements. * Original source (disassembled and commented by Thierry) BIAS >60 G6E1A STRI "ILLEGAL TAG" G6E26 STRI "CHECKSUM ERROR" ---------------------------------- * Modified source for xda99: *EPEP BIAS >60 G6E1A STRI60 "ILLEGAL TAG" G6E26 STRI60 "CHECKSUM ERROR ---------------------------------- * xda99.py has been modified to support the new STRI60 as follows: # EP 2020-12-13 added new STRI60 operation to add the screen offset to each byte. # Used for Mini Memory porting @staticmethod def STRI60(asm, label, ops): asm.process_label(label) text = ''.join(asm.parser.text(op) for op in ops) asm.emit(len(text), *[ord(c)+0x60 for c in text]) And this is roughly where I am at the moment. I am comparing the generated GPL binary image to the original, and now the first >770 bytes match (except for the pointer to >70AC due the AORG stuff, need to come up with a solution for that - probably I'll just fill in the empty range with some bytes) to get to 70AC.
Hi, all, I'm practicing assembly language with the Editor/Assembler, using the xdt99 cross-assembler with Emacs on a Mac and running it on js99er.net for the emulator. So far, everything has gone very smoothly...but this one weird bug: If I have a period in a TEXT directive string, I get unpredictable VDP results when I display it using VMBW. For example, I printed my name to the screen (along with some other text), with the text set as: MSG2 TEXT 'Timothy S. Hamilton' The other strings printed to the screen just fine with VMBW, but this one came up with the last byte displayed as a space: Timothy S. Hamilto Thinking I'd miscounted the bytes by one, I tried other combinations of characters. It turned out it was the period causing the problem. Later, after putting it back in, sending this same string to VMBW caused the screen to flash with colored noise. Another time, it made it go blank, with a solid color on the border. [Edit: It was another version of the string that caused the flashing, with one or two characters changed, but with the period still there. I haven't tried replicating that particular behavior since then.] I thought it might be some glitch in encoding the period, so I opened up my assembly source file in E/A directly and put the period in there. It displayed the period just fine. Does anybody have a suggestion as to what might be causing this and how to get around it?
IDE for developing in TI99 Assembler on the PC (Windows) (using NotePad++ Editor, xdt99 Cross-Assembler and MAME Emulator) https://github.com/miriki/TI-xdt99-IDE/ Hi, all! A few may have noticed: In an xdt99 thread I have published a Batch for DOS that shortens a lot of typing work when developing software. After years of abstinence from the TI99 I actually remembered the "good old days" developing tools and libraries again and tried to recall what I was doing those days. Well, 35 or so years... Firing up the MAME emulator, using TI99_4ev as machine, a cartridge with Editor/Assembler inserted and the needed disk in DSK1 mounted I started typing a few lines while reading through a bunch of books and forum articles. Hmmm... A PC keyboard and the function keys of the TI99, two worlds collide. Yes, the editor _was_ a very good one, at least that days. But nowadays I really, really prefer the comfort of NotePad++ or at least any other GUI based editor. Then I've read about the one or another Cross-Assembler to develop in Windows and using the output to mount within MAME. Almost right from the beginning I got stuck with xdt99, a collection of not only a cross-assembler, but other tools like a "disk creation", too. An integration into "IntelliJ IDEA" sounded good, but.... Hmmm... Maybe I have not digged deep enough, but there is only the editor used for syntax highlighting, isn't it? Putting things together: A batch for DOS (Windows, Microsoft, sorry...) was created that enabled the workflow from editing the Assembler source code assembling the source code into object code creating a disk which contains the object file starting an Emulator with this disk mounted plus a few more tasks... To be honest: I don't like DOS batches with more than, let's say, 25 or so lines. The syntax is ugly and the CLI commands are far from comfortable - not comparable with a high level language. Changing default values is a pain, (re)storing user settings a tremendous effort and doing all with user parameters results in a jungle of % characters shattered across the lines. So I used that batch only as a sketch for a "real" project: An IDE for those tools written in a high level language. I decided on C# (VB.Net would have been the alternative), because it is the preferred language right now in our company. Training... If anybody would like to have a look at it: I just published that project on GitHub. That was kind of training, too. We use Azure DevOps in our company and I have to get familiar with those cloud based team thingy. So hopefully I published correctly - it is my first published project over there. https://github.com/miriki/TI-xdt99-IDE/ This is the main page of the project. There is a README, but empty as of now. You will find a subfolder "TI xdt99 IDE" though... There is a subfolder "snap" which contains a few screenshots of the published project: Settings_Xdt.png shows the settings to include the tools from the xdt99 package. Settings_Mame.png shows parameters for the emulator, including configuration of the peripherals etc. Settings_Ide.png shows the standard working area with buttons to start actions and checkboxes to set options. Output_CommandStack.png shows the list of calls to external tools like the editor, assembler etc. Output_Standard.png shows the standard output of the last command, for example the directory of the disk. Output_Errors.png shows the error output of the last command, if there is any. Emulator_AutoStart.png shows the XB output from DSK1.LOAD if "catalog" and "autostart" is checked. Output_Result.png shows the loaded and started demo program I was just working on. Another subfolder "publish" contains a "setup.exe" that should install the IDE. I'd like to get feedback, if that thing runs without any problems. But what has to be done? Well... Perhaps it is best to show my setup: E:\TI99 mame64.exe >roms ti99_*.zip >hash ti99_cart.xml (thanks again, mizapf!) >cart editass.zip minimem.zip exbasic.zip >disk *.dsk >hard *.chd This should be enough to start MAME using e.g. ti99_4ev as machine. Try it... mame64 ti99_4a If successful, try inserting a cartride: mame64 ti99_4a -gromport single -cart exbasic If successful, try connecting a peb with a hfdc in slot 8, a disk drive connected and a disk inserted: mame64 ti99_4a -gromport single -cart exbasic -ioport peb -ioport:peb:slot8 hfdc -ioport:peb:slot8:hfdc:f1 525dd -flop1 disk/flopdsk1.dsk whew... After the first start of MAME there will be a few more subdirs like cfg, nvram etc. You might like to start MAME with -createconfig and edit the output mame.ini to suit your needs. I added cart and cart2 subdirs to the roms path, disabled the info screen at startup and the like... Then I added a subdir >xdt99 xas99.py xdm99.py xbas99.py >lib vdptools.a99 >projects >gmode gmode1.a99 etc. The "lib" folder contains a "vdptools.a99" file right now. There are only a few routines to avoid "BLWP VSBW" etc. in it. The "projects" folder contains the, as you already might have guessed, projects I am working on - for example a "gmode" subfolder. And in the "gmode" folder there are gmode1.a99, tmode.a99, mulcol.a99 and bitmap.a99. With this setup the settings on the XDT and MAME tabs should be self explanatory, kind of... The right hand side shows extensions for the filenames. For example the source "gmode1" gets expanded to "gmode1.a99" for the editor, is compiled into "gmode1.obj" and will become "GMODE1O" when copied to the TI disk. You may change the settings on the MAME tab and can use the IDE purely as a frontend, if you like. The "run" button will start the emulator without fiddling around with an assembler or anything else. BTW: Settings are loaded at startup of the IDE and saved when the IDE is closed or any external program is called. The IDE tab is the "all singing, all dancing" desktop for your development. The left box lists all subdirs aka projects, the right box lists the source files in that (selected) project. The selection is shown additionally in the two textboxes in the upper right (for later extensions). The "edit" button starts the editor, the "assemble" buttons starts the xdt99 cross assembler. It creates the object, image and rpk files, if checked. If "all" is checked, not only the actual selected source but all within the project will be assembled. The "disk" button creates the disk to be mounted for the emulator. It copies the source, list, object and image files, if checked. Again: For "all", if checked. Additionally it can create a DSK1.LOAD to show the contents of the disk and / or load and run the object file of the selected source. The "emulator" button starts the MAME emulator with the configured devices. If set up properly you might select "TI Extended Basic" from the master selection, get the disk contents displayed and after "please wait..." the compiled program should start. The "ADE" button is a shortcut: (A)ssembler, (D)iskManager and (E)mulator - all in one shot. So after editing / saving the source the test only needs 1) click on "ADE" button, 2) any key at the master title screen 3) "2" for XB, then wait... and enjoy! The menu at the top has no function as of now. The status bar at the bottoms shows info about running external tools to the left, "idle" to the right otherwise. Have fun! Michael