Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Catching prodos commands

13 views
Skip to first unread message

BLuRry

unread,
Feb 5, 2012, 2:00:55 AM2/5/12
to
Found a fun thing to do: Re-route calls to $a685 to a custom parser in prodos. This is the prodos syntax check routine, so if you replace the contents of the keyboard buffer with something else before resuming the command, you can essentially extend the recognized commands almost indefinitely.

Here's my proof of concept stub in the JACE code to do this, though right now I just print out the intercepted command it can be used for much more interesting things later:

new RAMListener(RAMEvent.TYPE.READ, RAMEvent.SCOPE.ADDRESS, RAMEvent.VALUE.ANY) {
@Override
protected void doConfig() {setScopeStart(0x0a685);}

@Override
protected void doEvent(RAMEvent e) {
if (getCpu().getProgramCounter() != getScopeStart()) return;
String in = "";
for (int i=0x0200; i < 0x0300; i++) {
char c = (char) (getMemory().read(i, false) & 0x07f);
if (c == 0x0d) break;
in += c;
}
System.err.println("Intercepted command: "+in);
}

Antoine Vignau

unread,
Feb 5, 2012, 8:51:01 AM2/5/12
to
At that address, it is not ProDOS, it is BASIC.SYSTEM and I am sure
that address is not guaranteed.

Purchase a book about ProDOS and BASIC.SYSTEM (like the one from Gary
Little, Exploring P8 and GS/OS) and you'll learn how to add/intercept
commands directly by, for instance, studying the $BE00..$BEFF buffer.

antoine

BLuRry

unread,
Feb 5, 2012, 9:42:13 AM2/5/12
to
Oh it's not terribly important, just a bit of fun to intercept something like "cd .." and swap it out with the appropriate PREFIX call. Or rewrite commands such that anything matching dir or ls gets chaanged to cat or catalog (if in 80 cols)

JACE has an option to provide friendly messages so offering some sort of help pages could be an easy sort of add-on.

Michael J. Mahon

unread,
Feb 8, 2012, 2:25:53 PM2/8/12
to
BLuRry wrote:
> Oh it's not terribly important, just a bit of fun to intercept something like "cd .." and swap it out with the appropriate PREFIX call. Or rewrite commands such that anything matching dir or ls gets chaanged to cat or catalog (if in 80 cols)

I've been using "cd" from the PROCMD suite for years. It hooks into
BASIC.SYSTEM using the standard protocol and does just what you would
expect.

-michael

NadaNet 3.1 for Apple II parallel computing!
Home page: http://home.comcast.net/~mjmahon/

"The wastebasket is our most important design
tool--and it's seriously underused."

BLuRry

unread,
Feb 9, 2012, 12:49:20 AM2/9/12
to mjm...@aol.com
Yes, but I would also like to hook in some simple commands as well that control the emulator directly... Hint: Semantic computing. :^)
0 new messages