Jump to content
senior_falcon

XB Game Developers Package

Recommended Posts

Posted (edited)

I have no doubt that a good programmer could write a program that goes directly from an XB program to a finished compiled program that is ready to run. Windows would have plenty of power to do this. On the TI99 it could probably be done if you used SAMS.

There are several reasons my compiler works the way it does.

1 - I'm not that good a programmer a good enough programmer to do that.

2 - most of this was developed on a real TI99 with the usual 32K memory limitations.

3 - because of the memory limitations I chose to save the XB program in merge format. This way each line can be read individually and processed.

4 - The compiler reads the XB merge file to make a DV80 file containing "threaded code." This way you can look at the code produced to see if it makes sense and if runtime routines can be made to process it. 

5 - now the runtime routines can be created to process the threaded code. Because the compiled code and runtime routines are text files they can be read easily which facilitates debugging.

6 - Since they are source code they must be compiled into object code.

7 - Now the compiled object code must be loaded. This is a little tricky because the code must be able to run in both XB and EA5. So there are custom loaders to handle the various possibilities.

 

Edited by senior_falcon
  • Like 5

Share this post


Link to post
Share on other sites
Posted (edited)
45 minutes ago, 1980gamer said:

I thought I was squared away...

Now I always get this error...   First it skips the Assembler Step.  So, I arrow up to run it.

image.thumb.png.c1f3978341524ce165be8076db53bcca.png

If it is skipping the assembler step, that's because you chose Y for "assembling with Asm994a."

You cannot mix and match. If you choose Y then you must use Asm994a. If you choose N then you must use the TI assembler.

Also, to use Asm994a, the runtime routines and the file being processed must be on the same disk.

Edited by senior_falcon
  • Like 4

Share this post


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

I have no doubt that a good programmer could write a program that goes directly from an XB program to a finished compiled program that is ready to run. Windows would have plenty of power to do this. On the TI99 it could probably be done if you used SAMS.

There are several reasons my compiler works the way it does.

1 - I'm not that good a programmer

2 - most of this was developed on a real TI99 with the usual 32K memory limitations.

3 - because of the memory limitations I chose to save the XB program in merge format. This way each line can be read individually and processed.

4 - The compiler reads the XB merge file to make a DV80 file containing "threaded code." This way you can look at the code produced to see if it makes sense and if runtime routines can be made to process it. 

5 - now the runtime routines can be created to process the threaded code. Because the compiled code and runtime routines are text files they can be read easily which facilitates debugging.

6 - Since they are source code they must be compiled into object code.

7 - Now the compiled object code must be loaded. This is a little tricky because the code must be able to run in both XB and EA5. So there are custom loaders to handle the various possibilities.

 

Thx, makes sense now ;)

Share this post


Link to post
Share on other sites
2 hours ago, senior_falcon said:

If it is skipping the assembler step, that's because you chose Y for "assembling with Asm994a."

You cannot mix and match. If you choose Y then you must use Asm994a. If you choose N then you must use the TI assembler.

Also, to use Asm994a, the runtime routines and the file being processed must be on the same disk.

This solved it!

I had tried every combo to try to make the process work.  Then I didn't remember what worked the other night at 3:30am   Go figure!

 

Anyway,  Now I cannot duplicate my original problem!

 

Maybe if I go back to 7.. But I don't want to break it.  LOL 

 

Thanks for the help.  I had been going crazy and giving up.   I downloaded the latest and couldn't sleep, so I started trying things again.  Bingo.

  • Like 2

Share this post


Link to post
Share on other sites
Posted (edited)

Here is a short video showing how to compile a simple missing link program. I chose the regular version of TML because it is a little slower than the XB 2.8 G.E.M. version, so the increase in speed is greater.

I added: 1 CALL LINK("TML16")

Then loaded and ran UC2LC, a utility that converts all the CALL LINKs to lower case. (This is necessary to tell the compiler that they are user CALL LINKs that are not built into the compiler like the XB256 routines.) Saved, compiled and assembled as usual by pressing Enter repeatedly. At the loader I chose "Y" for "Using Assembly Support?," then pressed Enter to use the suggested file name. Then used DSK1.TMLC for the assembly support routines. Pressed enter at the prompts until it was done. I first ran the XB version, then used the Editor Assembler cartridge to load and run DSK2.POLYL-E just to show that you can save as EA5.

POLY.gif

 


10 CALL LINK("CLEAR"):: ANG=RND*90+90 :: CALL LINK("PUTPEN",92,120,0)
20 FOR I=1 TO 130 :: CALL LINK("FWD",I,ANG):: NEXT I
30 GOTO 10

 

Edited by senior_falcon
  • Like 3

Share this post


Link to post
Share on other sites
7 hours ago, senior_falcon said:

1 - I'm not that good a programmer

"Not that good", only freaking amazing. ;)

 

  • Like 4

Share this post


Link to post
Share on other sites
7 hours ago, senior_falcon said:

1 - I'm not that good a programmer

 

Your tongue is coming through your cheek! 😊

 

...lee

  • Like 2

Share this post


Link to post
Share on other sites

There seems to be a trend these days to save compiled programs as EA5 and convert them into cartridges. This makes a nice, neat package and works fine for self contained programs.

On the other hand, saving a compiled program as XB has other advantages. Remember that, as far as XB is concerned, the compiled program is just a large assembly language subroutine. So it is possible to write an autoloading menu program in XB, and use it to select different compiled programs on the disk. When the compiled program ends it returns back to XB. If the next statement in the XB program is RUN "DSK1.MENU" then the menu program will be loaded and you can choose a different compiled program. Below is a short tutorial showing how to do this. This demo runs 2 programs using compiled TML. One program draws a polyspiral; the other draws circles using CALL LINK("PR") to make an interesting graphics demo. This is all done on DSK1.

First the menu program:

10 CALL CLEAR :: PRINT "PRESS:":"1 - POLYSPIRAL":"2 - CIRCLES WITH PENREVERSE"
20 CALL KEY(0,K,S):: IF K=49 THEN CALL CLEAR :: RUN "DSK1.POLY-X"
21 IF K=50 THEN CALL CLEAR :: RUN "DSK1.CIRCLES4-X"
22 GOTO 20

Save this - SAVE DSK1.TMLMENU

 

Here are the two programs. The first is POLY and the second is CIRCLES4

10 !CALL LINK("tml16")
20 FOR I=1 TO 500 :: CALL LINK("FWD",I,123):: NEXT I
30 CALL LINK("GRAFIX")


80 !CALL LINK("tml16")
100 CALL LINK("PR"):: FOR K=1 TO 2 :: FOR C=1 TO 90 STEP 1 :: FOR I=-1 TO 1 STEP 2 :: FOR J=-1 TO 1 STEP 2 :: CALL LINK("CIRCLE",96+I*C,120+J*C,C,0):: NEXT J :: NEXT I :: NEXT C :: NEXT K :: CALL LINK("PD")
120 CALL LINK("GRAFIX")

Note the CALL LINK("GRAFIX") at the end of the programs This sets the graphics mode to the normal XB mode so the XB menu program will look right.
 

These get compiled as described the XB COMPILER docs in the Juwel package, pages 17-19. Be sure to uncomment the first lines. Then they are saved as XB programs (POLY-X and CIRCLES4-X), and of course tested to be sure they work.

 

Now let's put it all together

Start by modifying TMLC, then save it: SAVE "DSK1.LOADTMLC"

10 CALL LOAD(8192,255,172):: CALL LINK("X")

10 CALL INIT::CALL LOAD(8192,255,172):: CALL LINK("X")::RUN "DSK1.TMLMENU"

This does CALL INIT, loads the compiled version of The Missing Link into low memory, then runs the TMLMENU program. This can be saved as LOAD if you want it to autoload. Once this has run, the Missing Link routines are in low memory and do not have to be loaded again as long as you do not CALL INIT or otherwise do something to overwrite them.

 

Now let's fix the two compiled programs. The XB part looks the same for both. We just need to add RUN "DSK1.TMLMENU" to run the menu program.

10 CALL LOAD(8192,255,158):: CALL LINK("RUN")

1 !POLYSPIRAL or CIRCLES4PR
10 CALL LOAD(8192,255,158):: CALL LINK("RUN"):: RUN "DSK1.TMLMENU"

Save them as POLY-X and CIRCLES4-X

 

Now to test:

RUN "DSK1.LOADTMLC". This loads The Missing Link routines and runs the menu program. In the menu program, press 1 for POLYSPIRAL or 2 for CIRCLES WITH PEN REVERSE

The program will run and when finished it will reload the menu program.

TMLCMENU.zip

TMLCMENU.gif

 

 

 

 

 

 

 

  • Like 7
  • Thanks 2

Share this post


Link to post
Share on other sites

I'm having trouble running these program on JS99er.net, but they work on Classic99. The circles only work when I disable the F18A emulation, and the polyspiral doesn't run at all. Can you confirm that it's working on real hardware?

Share this post


Link to post
Share on other sites
51 minutes ago, Asmusr said:

I'm having trouble running these program on JS99er.net, but they work on Classic99. The circles only work when I disable the F18A emulation, and the polyspiral doesn't run at all. Can you confirm that it's working on real hardware?

It turns out polyspiral wasn't working because I had 'debug reset' enabled where it's filling the RAM with random values. 

  • Like 2

Share this post


Link to post
Share on other sites

Sounds like polyspiral works for you now. What about the circles program?

I can send these over to the real TI tonight to see if they work. They should - TMLDEMO worked fine on real hardware.

Share this post


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

Sounds like polyspiral works for you now. What about the circles program?

Yes. The circles program still only works when I disable the F18A emulation, but it looks like a problem with the emulation.

Share this post


Link to post
Share on other sites
15 minutes ago, Asmusr said:

Yes. The circles program still only works when I disable the F18A emulation, but it looks like a problem with the emulation.

Fixed

  • Like 4

Share this post


Link to post
Share on other sites

I just sent this over to the real TI99 and it works fine using an HRD 4000.

TMLC has 2 workspaces in scratchpad ram, which helped a lot. But it is noticeably snappier when running on the 16 bit data bus vs. the 8 bit data bus.

To do the circles program takes 54 seconds vs. 74 seconds.

  • Like 3

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