Jump to content
IGNORED

The Missing F18A Link


Asmusr

Recommended Posts

How difficult would it be to write a library like The Missing Link to provide support for some of the F18A functions in XB?

 

You could start out with very simple stuff like unlocking the F18A, setting palette colors, one page smooth scrolling (wrapped), and a generic function for setting VDP registers. A more advanced version could add two/four page scrolling, multi-colored tiles, multi-colored sprites (if they are compatible with the console ISR?), and perhaps bitmap layer functions. With the XB compiler you could produce some pretty nice games, with features we haven't seen used in assembly yet.

 

As far as I have figured out the trick is to reserve VDP RAM by allocating more file buffers than required for files, and then use that RAM for graphics tables instead, right? Would XB do anything nasty like resetting the VDP registers?

 

 

  • Like 3
Link to comment
Share on other sites

The Missing Link runs from Assembly for a good reason.

 

It render's many features of RXB useless as it creates it's own environment to run from.

 

But is is very well written as long as you stay in that environment and not step out of those boundaries.

 

Access to SAMS is not possible or using BLOAD or BSAVE or access to CALL IO or some disk routines are impossible in RXB.

 

But normal XB only functions work. So I suspect it is possible to make a verison of F18 The Missing Link.

Link to comment
Share on other sites

How difficult would it be to write a library like The Missing Link to provide support for some of the F18A functions in XB?

 

You could start out with very simple stuff like unlocking the F18A, setting palette colors, one page smooth scrolling (wrapped), and a generic function for setting VDP registers. A more advanced version could add two/four page scrolling, multi-colored tiles, multi-colored sprites (if they are compatible with the console ISR?), and perhaps bitmap layer functions. With the XB compiler you could produce some pretty nice games, with features we haven't seen used in assembly yet.

 

As far as I have figured out the trick is to reserve VDP RAM by allocating more file buffers than required for files, and then use that RAM for graphics tables instead, right? Would XB do anything nasty like resetting the VDP registers?

 

 

 

Something like this would really get me interested in programming again if I could write programs with full 80 column text display and mapped user input similar to "ACCEPT AT".

Link to comment
Share on other sites

  • 3 months later...

I finally made a little progress on an XB support library for the F18A. If you run F18ATEST from the attached disk on a F18A enhanced console you should see a basic demo of palette changing and smooth scrolling.

 

F18ABASIC.dsk

 

The functions in this demo version are limited to:

CALL LINK("UNLOCK"): Unlock F18A
CALL LINK("SETREG", REG, VALUE): Generic register write
CALL LINK("SCROLL", X, Y): Set scroll registers
CALL LINK("PAL", COLOR, R, G, B): Set palette color
CALL LINK("POKEV", ADDR, VALUE): Generic VDP RAM poke (as in E/A)

One obvious question is whether this can be compiled using senior_falcon's compiler, but I'm afraid I haven't tested it yet.

 

In future versions it might be possible to add support for:

  • 256 characters in 4 colors with support for smooth scrolling (by switching to a 'screen 2' like in XB256)
  • A fixed overlay to the scrolling screen
  • Bitmap overlay, up to 128x128 pixels
  • Control of sprite/character priorities
  • Sprite and tile flipping and mirroring
  • Sprite linking, so that two or more sprites automatically maintain their relative position
  • An advance collision routine that reports the numbers of the sprites that overlap
  • Perhaps 80 columns mode?

I'm only going to develop this further if it has some active users, so please let me have your expression of interest if you would consider using it.

 

  • Like 5
Link to comment
Share on other sites

I finally made a little progress on an XB support library for the F18A. If you run F18ATEST from the attached disk on a F18A enhanced console you should see a basic demo of palette changing and smooth scrolling.

 

attachicon.gifF18ABASIC.dsk

 

The functions in this demo version are limited to:

CALL LINK("UNLOCK"): Unlock F18A
CALL LINK("SETREG", REG, VALUE): Generic register write
CALL LINK("SCROLL", X, Y): Set scroll registers
CALL LINK("PAL", COLOR, R, G, B): Set palette color
CALL LINK("POKEV", ADDR, VALUE): Generic VDP RAM poke (as in E/A)

One obvious question is whether this can be compiled using senior_falcon's compiler, but I'm afraid I haven't tested it yet.

 

In future versions it might be possible to add support for:

  • 256 characters in 4 colors with support for smooth scrolling (by switching to a 'screen 2' like in XB256)
  • A fixed overlay to the scrolling screen
  • Bitmap overlay, up to 128x128 pixels
  • Control of sprite/character priorities
  • Sprite and tile flipping and mirroring
  • Sprite linking, so that two or more sprites automatically maintain their relative position
  • An advance collision routine that reports the numbers of the sprites that overlap
  • Perhaps 80 columns mode?

I'm only going to develop this further if it has some active users, so please let me have your expression of interest if you would consider using it.

 

 

Looking good from the description! I downloaded the .dsk file and I'll try to check it out after work tonight. Now the potential for an 80 column mode has me the most excited. I've had some ideas in the back of my skull, that with 80 columns could finally come to fruition.

Link to comment
Share on other sites

:thumbsup:

Any chance you could share the source code when you're done with it? I'd like to see it as an example of how (and what) to write to the various registers to do things like scrolling etc.

 

Mark

What is it you are looking for exactly? I'd be glad to provide short "pluggable" examples of code (assuming assembly) to access the F18A features.

 

Scrolling is pretty easy. Two steps, the first one you always have to do once (usually during an initialization routine) in any program to get access to the F18A's enhance registers:

 

1. Unlock the F18A (this is a blink unlock and does not check if the system actually has an F18A):

*      F18A blind unlock, no testing for success or failure.
*      Perform the Enhance Register Mode (ERM) unlock sequence
*      for the F18A.
       LI   R0,>391C          * VR1/57, value 00011100
       BL   @VWTR             * Write once
       BL   @VWTR             * Write twice, unlock
.

 

2. Update the horz or vert scroll registers:

*      Update horz and vert scroll registers
       LI   R0,>1B00          * Reg 27 horz scroll
       SOCB @R8LB,@R0LB       * Move scroll value to R0 LSB
       BL   @VWTR

       LI   R0,>1C00          * Reg 28 vert scroll
       SOCB @R9LB,@R0LB       * Move scroll value to R0 LSB
       BL   @VWTR
.

 

In the example above the horz and vert values are kept in the LSB of R8 and R9 to make updating the scroll values easier, i.e. you can use INC or DEC, etc. I have some macros defined in my programs that let me address the LSB of the registers using names:

 

* Workspace
*
WRKSP  EQU  >8300             * Workspace
R0LB   EQU  WRKSP+1           * R0 low byte reqd for VDP routines
R1LB   EQU  WRKSP+3           * R1 low byte
R2LB   EQU  WRKSP+5           * R2 low byte
R3LB   EQU  WRKSP+7           * R3 low byte
R4LB   EQU  WRKSP+9           * R4 low byte
R5LB   EQU  WRKSP+11          * R5 low byte
R6LB   EQU  WRKSP+13          * R6 low byte
R7LB   EQU  WRKSP+15          * R7 low byte
R8LB   EQU  WRKSP+17          * R8 low byte
R9LB   EQU  WRKSP+19          * R9 low byte
.

 

Of course you can do this any way you want, you simply need to write the 0-255 scroll value to the scroll register. Or course the vertical scroll values needs to be kept within 0..191 to avoid strange scroll results, but it won't hurt anything if you try to vertically scroll over 191 (which you do with ROW30 mode, which vertical scrolls form 0..239).

 

Scrolling is very safe from XB since it only involves updating new registers above the original eight (0..7) VDP registers.

Link to comment
Share on other sites

:thumbsup:

Any chance you could share the source code when you're done with it? I'd like to see it as an example of how (and what) to write to the various registers to do things like scrolling etc.

 

Mark

 

Since nobody seems to be interested in XB programming for the F18A I don't think I'm going to develop this project further, but you're welcome to have the current source code.

F18ABasSrc.zip

Link to comment
Share on other sites

 

Since nobody seems to be interested in XB programming for the F18A I don't think I'm going to develop this project further, but you're welcome to have the current source code.

 

Extended BASIC is the ONLY kind of programming I've ever done, but understand that you are not going to develop it any further. Pity, the potential of 80 columns in BASIC had me excited. In fact if 80 column text is all it did, with the ability to still redefine characters I'd be happy.

Link to comment
Share on other sites

 

Extended BASIC is the ONLY kind of programming I've ever done, but understand that you are not going to develop it any further. Pity, the potential of 80 columns in BASIC had me excited. In fact if 80 column text is all it did, with the ability to still redefine characters I'd be happy.

 

Unfortunately 80 column mode is one of the more difficult features to support in XB. It's easy enough to switch to 80 column mode:

CALL LINK("SETREG",0,4)
CALL LINK("SETREG",1,240)

However, the screen is a pretty big mess, so you would have to write replacements for many of the XB functions.

  • Like 1
Link to comment
Share on other sites

I would like to write a 80 column version of XB for the TI but refuse to even attempt such a task on anything less than 128K VDP and no Hi Res Modes.

 

Why I started work on MESS using the EVPC mode. It would be fantastic if the F18 offered something like this.

Link to comment
Share on other sites

 

Extended BASIC is the ONLY kind of programming I've ever done, but understand that you are not going to develop it any further. Pity, the potential of 80 columns in BASIC had me excited. In fact if 80 column text is all it did, with the ability to still redefine characters I'd be happy.

You should have a look at Forth. Both TurboForth and fbForth support 80 column modes. And not just your running program. The entire development environment including the code editor can run in 80 columns. 40 Column mode and 32 column mode are also available. fbForth also supports bit-mapped graphics. There are alternatives to XB. Forth is so much faster than XB it's just not funny! And learning to code in Forth is not so hard. If you get stuck, there's people here (Lee, myself, Vorticon and a few others) that would only be too happy to help. Start out with a simple goal (maybe a simple game) and work your way through it. There's lots of example code on the TurboForth website to get you started.

 

Also, there are extension libraries that can be loaded (for example, Local Variables) that can make Forth programming a lot easier and reduce the stack shuffling. Adding local variable support to TurboForth is as easy as typing 37 LOAD :grin:

Link to comment
Share on other sites

What is it you are looking for exactly? I'd be glad to provide short "pluggable" examples of code (assuming assembly) to access the F18A features.

 

Thanks Matt - great stuff. Yes, a "recipe" sheet (perhaps as a sticky somewhere on the AA TI forum) would be awesome. How to do things like enable 32 sprites on a line (or turn it off), use the bitmap layer, use multi-colour sprites, change the pallete etc. I know you've talked about multi-colour sprites and characters before here on AA, but it didn't make much sense to me IIRC!

Link to comment
Share on other sites

 

Unfortunately 80 column mode is one of the more difficult features to support in XB. It's easy enough to switch to 80 column mode:

CALL LINK("SETREG",0,4)
CALL LINK("SETREG",1,240)

However, the screen is a pretty big mess, so you would have to write replacements for many of the XB functions.

 

COOL! I might have some time of Friday to play for an hour or two. I wrote myself a note to remind me to play with this and see how it behaves. THANX!

Link to comment
Share on other sites

 

Since nobody seems to be interested in XB programming for the F18A I don't think I'm going to develop this project further, but you're welcome to have the current source code.

 

Please don't give up that quickly! You know the classic saying: if you build it they will come :) While XB is much maligned for its speed, it is still a particularly powerful Basic and adding support for the F18A will enhance it even further. XB is still the best and easiest way to start (or get back into) programming on the TI. Add to that Harry's compiler and your F18A enhancements and it becomes an extremely attractive package.

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