Jump to content

Recommended Posts

I know that a DSR ROM can add CALLs to BASIC or XBASIC, but what happens when it provides the same name?

 

Can a DSR ROM override, say, CALL SOUND, intercepting all the calls? Or does the BASIC interpreter always take its version first?

 

Any ideas on how you could pull this off?

 

Link to comment
https://forums.atariage.com/topic/313931-can-an-dsr-rom-replace-a-xbasic-call/
Share on other sites

3 hours ago, FarmerPotato said:

Can a DSR ROM override, say, CALL SOUND, intercepting all the calls? Or does the BASIC interpreter always take its version first?

I think there are examples of this. Though I am at a loss to recall ...Perhaps XB does this natively for some subs.

 

I was under the impression that BASIC uses the first CALL match it finds. But, scanning starts with peripheral card ROMs, than GROM bases, in reversed order.

 

However, this would seem to indicate otherwise...:twisted:

 

Calling a subprogram

The calling convention is that the subprogram name (with a leading lenght byte) should be placed in VDP memory, with word >8356-57 pointing at the length byte. Then DSRLNK can be called from GPL with CALL G@>0010.

  • This routine first scans the peripheral card ROMs in the order if their CRU addresses, by calling XML >19.
  • It then repeatedly calls XML >1A to scan the GROMs at base >9800, starting with GROM >0000, then >2000, etc upto >E000.
  • It then repeats the process with bases >9804, >9808, upto >983C.

If you're curious, here is a disassembly of XML >19 and XML >1A

 

Standard headers

 

:)

  • Like 2
2 hours ago, jedimatt42 said:

In TI BASIC it scans Device ROMs for subprograms with every CALL before looking for built-ins. 

 

In XB, it is useless (exaggerating (tm)) as Device ROMs are only scanned in immediate mode.

Thanks. Plain ol' BASIC shines through on this one.  XB thinks it is the boss. Alas.

Maybe the DSR subprogram code couldn't work in both BASIC and XB anyhow (fetching the arguments etc).

 

 

 

Prescan: does XB prescan build a table of user-defined subprograms? I wonder if there might be some loophole there. 

 

Something like

1000 SUB SOUND(A,B,C)

1010 CALL LINK("MYCALL", "SOUND", A, B, C)

1020 SUB END

where MYCALL looks in the DSR ROMs... or just implements the darn thing that would be in the ROM

 

 

 

 

6 hours ago, HOME AUTOMATION said:

I think there are examples of this. Though I am at a loss to recall ...Perhaps XB does this natively for some subs.

 

I was under the impression that BASIC uses the first CALL match it finds. But, scanning starts with peripheral card ROMs, than GROM bases, in reversed order.

 

However, this would seem to indicate otherwise...:twisted:

 

Calling a subprogram

The calling convention is that the subprogram name (with a leading lenght byte) should be placed in VDP memory, with word >8356-57 pointing at the length byte. Then DSRLNK can be called from GPL with CALL G@>0010.

  • This routine first scans the peripheral card ROMs in the order if their CRU addresses, by calling XML >19.
  • It then repeatedly calls XML >1A to scan the GROMs at base >9800, starting with GROM >0000, then >2000, etc upto >E000.
  • It then repeats the process with bases >9804, >9808, upto >983C.

If you're curious, here is a disassembly of XML >19 and XML >1A

 

Standard headers

 

:)

Following Thierry's excellent (as always) docs.

I didn't know any of that. Wow. 

 

  • Like 1

LOL I DID, why I like XB over TI BASIC.

My CALL FILES(0) routine in RXB works fine as it does from my Module not a DSR.

After all how many DSR ever get updated????

Also in RXB 2020 you can do CALL FILES(15) try that on a normal TI and see what results!

 

In RXB 2020 you get 5624 Stack Bytes Free with CALL FILES(15)

Memory address used and free: 

>1F8F First Free VDP Address

>0958 VDP Stack Address

Edited by RXB
missing text
10 hours ago, FarmerPotato said:

I know that a DSR ROM can add CALLs to BASIC or XBASIC, but what happens when it provides the same name?

 

Can a DSR ROM override, say, CALL SOUND, intercepting all the calls? Or does the BASIC interpreter always take its version first?

 

Any ideas on how you could pull this off?

 

Why not use your own, unique name for SOUNDSOUNDS, say.

 

...lee

  • Like 2
On 11/25/2020 at 12:39 PM, FarmerPotato said:

Thanks. Plain ol' BASIC shines through on this one.  XB thinks it is the boss. Alas.

Maybe the DSR subprogram code couldn't work in both BASIC and XB anyhow (fetching the arguments etc).

Prescan: does XB prescan build a table of user-defined subprograms? I wonder if there might be some loophole there. 

Something like

1000 SUB SOUND(A,B,C)

1010 CALL LINK("MYCALL", "SOUND", A, B, C)

1020 SUB END

where MYCALL looks in the DSR ROMs... or just implements the darn thing that would be in the ROM

 

User subs can be the same name as an XB sub.

10 CALL SOUND(30)

20 END

1000 SUB SOUND(X)

1010 PRINT X

1020 SUBEND

This will print 30

 

Not sure what you're trying to do or if this is even of use.

Edited by senior_falcon
  • Like 4

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