Jump to content
IGNORED

Running a Basic program


OX.

Recommended Posts

10 minutes ago, Retrospect said:

"why can't you trust an Atom?  Because they make up literally everything."

Not a bad on-liner, I must say.

10 minutes ago, Retrospect said:

OLD CS1
RUN

No.  I am tired.

  • Haha 7
Link to comment
Share on other sites

On 1/28/2024 at 9:13 PM, OLD CS1 said:

In regular old TI BASIC, probably not without some level of trickery.  TI BASIC does not accommodate chaining commands, and offers no keyboard buffer.

I wonder if it's possible to hack the basic rom to use chained commands or use a keyboard buffer?  Or add RUN"DSK.BLAHBLAH" functionality as in extended basic.  I know they can be ran in RXB but that's speeding things up.

 

The reason I ask is because I want to automatically run a basic program from disk after it is loaded in the Gamebase, the old solution was to count a given amount of seconds per program in the script but that was unreliable so got dropped in favour of letting the user type "RUN" after the load.

Link to comment
Share on other sites

1 hour ago, OX. said:

I wonder if it's possible to hack the basic rom to use chained commands or use a keyboard buffer?  Or add RUN"DSK.BLAHBLAH" functionality as in extended basic.  I know they can be ran in RXB but that's speeding things up.

 

The reason I ask is because I want to automatically run a basic program from disk after it is loaded in the Gamebase, the old solution was to count a given amount of seconds per program in the script but that was unreliable so got dropped in favour of letting the user type "RUN" after the load.

It would be a crapton of work, but you could use Classic99 to save the TI BASIC program as a loader cartridge after you type RUN (if it has a nice title page, that's also a good place to save it, but you'd have to decide program by program where to catch it). 

 

This would give you a 16k ROM cart that loads the BASIC program to RAM and continues from whatever point you saved it at - sort of a save state. Since it's an actual cartridge, it works on any emulator and even real hardware.

 

  • Like 3
Link to comment
Share on other sites

2 hours ago, Tursi said:

It would be a crapton of work, but you could use Classic99 to save the TI BASIC program as a loader cartridge after you type RUN (if it has a nice title page, that's also a good place to save it, but you'd have to decide program by program where to catch it). 

 

This would give you a 16k ROM cart that loads the BASIC program to RAM and continues from whatever point you saved it at - sort of a save state. Since it's an actual cartridge, it works on any emulator and even real hardware.

 

Unfortunately that would also mean a ton of work given the amount of basic programs in the Gamebase, looks like it's sticking with manual input to run.

 

PS.  Was that a Metric or Imperial Crapton?  ;)

Edited by OX.
adding
  • Like 1
  • Haha 2
Link to comment
Share on other sites

11 hours ago, OX. said:

I wonder if it's possible to hack the basic rom to use chained commands or use a keyboard buffer?  Or add RUN"DSK.BLAHBLAH" functionality as in extended basic.  I know they can be ran in RXB but that's speeding things up.

 

The reason I ask is because I want to automatically run a basic program from disk after it is loaded in the Gamebase, the old solution was to count a given amount of seconds per program in the script but that was unreliable so got dropped in favour of letting the user type "RUN" after the load.

In theory, it would not be to hard to modify TI BASIC so that after OLD CS1 or OLD DSK1.PROGRAM, the interpreter would RUN the program instead of returning to the command line. But you would need to modify the BASIC interpreter. That can be done pretty easily in classic99, at least temporarily, but a real TI99 would need a revised grom chip, and it's hard to picture anyone wanting to do that.

There has been some talk about a new minimemory cartridge, and for that or EZ basic,  you might add a CALL RUN which could work like so: CALL RUN("CS1") or CALL RUN("DSK1.PROGRAM").

But I am not really sure that would do what you want.

  • Like 1
Link to comment
Share on other sites

10 hours ago, senior_falcon said:

In theory, it would not be to hard to modify TI BASIC so that after OLD CS1 or OLD DSK1.PROGRAM, the interpreter would RUN the program instead of returning to the command line. But you would need to modify the BASIC interpreter. That can be done pretty easily in classic99, at least temporarily, but a real TI99 would need a revised grom chip, and it's hard to picture anyone wanting to do that.

There has been some talk about a new minimemory cartridge, and for that or EZ basic,  you might add a CALL RUN which could work like so: CALL RUN("CS1") or CALL RUN("DSK1.PROGRAM").

But I am not really sure that would do what you want.

As long as it runs a Ti Basic program at the correct speed and is 100% compatible then yes that would do.

Link to comment
Share on other sites

11 hours ago, senior_falcon said:

but a real TI99 would need a revised grom chip, and it's hard to picture anyone wanting to do that.

Well, that's one of the things UberGROM was developed for, though I'd need to release the version with address readback. (I had it working, but then didn't.)

 

Made GROM access roughly 20% faster, which had absolutely no impact whatsoever on BASIC's operational speed. ;)

 

  • Like 2
Link to comment
Share on other sites

I am looking if I can do something along the lines for the TI Basic integration in my Stevie editor.

There I have the possibility to run up to 5 TI Basic sessions. Basically there is an ISR that is setup before jumping into TI Basic.

Purpose of the ISR is to show the session number and read the command buffer so I can jump back into the editor. Think it watches for the command “EXIT”, but have to verify. Has been a while.

 

Long story short, in regards to your question. What perhaps is possible is to have an ISR that watches the command buffer, pokes OLD DSK…… and after completion pokes “RUN”.

  • Like 1
Link to comment
Share on other sites

Actually, you did say Gamebase, right? For Classic99, you could just include a keyboard line in the INI that includes "RUN".

 

I am not sure how you are loading it, so I can't provide a customized example, but this INI would load and RUN a TI BASIC program from disk:

 

[mikes28]
name=Hello World BASIC
rom0=K|0|0|nn1OLD DSK0.HELLOWORLD\nRUN\n

 

"K" indicates to load the data to the keyboard buffer (which is a Classic99 thing, not a TI-99 thing). The 0's are ignored but the line won't be parsed without a load address and length. The two 'n's are to get off the title page -- any key will do but I specifically use a non-digit because sometimes the first character isn't needed. (There's a dummy call to KSCAN in the ROMs but sometimes the paste function misses it.) The '1' selects TI BASIC. The "OLD DSK0.HELLOWORLD" loads the program from DSK0 (and the "\n" forces Enter to be pressed). Then the "RUN\n" works the same way. Since it runs through calls to the keyboard scanner it will wait as long as needed for the load to complete.

 

  • Like 2
Link to comment
Share on other sites

In thinking about your other question... here's a patched GROM2 (part of TI BASIC) that automatically jumps to 'RUN' after 'OLD' finishes. It will also do so after 'SAVE', but I don't think that affects Gamebase. It should be possible to use it with other emulators (though MAME will complain as the CRC changes), but you can use it in Classic99 like so:

 

[usercart1]
name=Hello New Basic ROM
rom0=G|4000|2000|mods\994AGROM2-BASICPATCH.bin
rom1=K|0|0|nn1OLD DSK0.HELLOWORLD\n

 

Again, the K line just loads the file as previous.

 

The zip includes notes on what the patch it - it just changes the final branch to go to RUN instead of back to the interpreter.

 

994AGROM2-BASICPATCH.zip

  • Like 2
Link to comment
Share on other sites

1 hour ago, Tursi said:

Actually, you did say Gamebase, right? For Classic99, you could just include a keyboard line in the INI that includes "RUN".

 

I am not sure how you are loading it, so I can't provide a customized example, but this INI would load and RUN a TI BASIC program from disk:

 

[mikes28]
name=Hello World BASIC
rom0=K|0|0|nn1OLD DSK0.HELLOWORLD\nRUN\n

 

"K" indicates to load the data to the keyboard buffer (which is a Classic99 thing, not a TI-99 thing). The 0's are ignored but the line won't be parsed without a load address and length. The two 'n's are to get off the title page -- any key will do but I specifically use a non-digit because sometimes the first character isn't needed. (There's a dummy call to KSCAN in the ROMs but sometimes the paste function misses it.) The '1' selects TI BASIC. The "OLD DSK0.HELLOWORLD" loads the program from DSK0 (and the "\n" forces Enter to be pressed). Then the "RUN\n" works the same way. Since it runs through calls to the keyboard scanner it will wait as long as needed for the load to complete.

 

Yeah already do this with the Classic99 emulator but need the solution for the MAME option.

Link to comment
Share on other sites

I seem to remember that the Lua interface in MAME is intended to support predefined key sequences, but I never really tried.

 

https://docs.mamedev.org/luascript/index.html

https://docs.mamedev.org/luascript/ref-input.html#keyboard-input-device

 

(Fun fact; I never tried either, just discovered it by chance: When you press PgDn in UI enable mode (formerly "partial mode", ScrlLock), MAME skips all pauses and runs "fast forward" until you release the button. For the impatient ones amongst us.)

  • Like 2
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...