Jump to content
IGNORED

F18A programming, info, and resources


matthew180

Recommended Posts

  • 2 weeks later...

Please forgive me for not RTFM, but I figure someone can answer this really quickly. Does the F18A give any indication on its setting for handling multiple sprites on a line? I would like to have my sprite rotation routine not trigger if the F18A is not set to mimic the old 9918A behavior.

Link to comment
Share on other sites

Please forgive me for not RTFM, but I figure someone can answer this really quickly. Does the F18A give any indication on its setting for handling multiple sprites on a line? I would like to have my sprite rotation routine not trigger if the F18A is not set to mimic the old 9918A behavior.

 

So you want to respect the user's decision to see sprite flicker?

 

You probably know that VR30/>1E controls the numbers of sprites that can be displayed on a line, but whether the default value (if you read the register) reflects the jumper setting or it's just zero Matthew will have to answer. Reading the register can AFAIK only be done from the GPU side by reading address >601E.

 

The question is why you would bother to disable your rotation algorithm unless you need the clock cycles you gain for something specific to the F18A?

Link to comment
Share on other sites

Please forgive me for not RTFM ...

Forgiven. There is no FM to R at this time. It is on a long list of things to do.

 

At power-on VR30 gets its value from the jumper, however it can be altered by writing a new value to VR30. You can reset VR30 to the jumper selection by writing a zero to VR30. With an F18A you can also read any VDP Register (VR) via the host interface, meaning the 99/4A can read the F18A VDP Registers.

 

Also note that the F18A cannot display a sprite that is disabled, so if your rotation routine prevents a sprite from being displayed for a frame or two then the sprites will flicker.

Edited by matthew180
Link to comment
Share on other sites

Any time you set up a VDP *read* address, the MSB is used as the address of the VR to read (just like when writing to a VR, but the VR is read instead of written). To gain access to the value you read SR (status register) 15. The F18A has 16 status registers, although not all are used, and you set up the SR to read via VR15.

 

       LI   R0,>0F0F    // Set VR15 to read SR15
       BL   @VWTR
       LI   R0,>0100    // Set to read VR01
       BL   @VRAD       // Set up a VDP Read address which will also put the addressed VR into SR15
       MOVB @VDPSTA,R1  // The MSB of R1 now has the addressed VR value
       LI   R0,>0F00    // Set VR15 to read SR0 (the default)
       BL   @VWTR
Here is a routine to read all VRs

 

       LI   R0,>0F0F    // Set status port to read SR15
       BL   @VWTR

       CLR  R0          // Start with VR0
       LI   R2,64       // Read all VRs, some do not exist and will return 0
LP
       BL   @VRAD       // Read the register to SR15
       MOVB @VDPSTA,R1  // Put the register value into MSB of R1

  . . . do something with VR value in MSB of R1 . . .

       AI   R0,>0100    // Next VR to read
       DEC  R2
       JNE  LP

       LI   R0,>0F00    // Set status port to read SR0
       BL   @VWTR

. . .


*********************************************************************
*
* VDP Set Read Address
*
* R0   Address to set VDP address counter to
*
VRAD   MOVB @R0LB,@VDPWA      // Send low byte of VDP RAM write address
       ANDI R0,>3FFF          // Make sure the two MSbits are 00 for read
       MOVB R0,@VDPWA         // Send high byte of VDP RAM write address
       B    *R11
*// VRAD


*********************************************************************
*
* VDP Write To Register
*
* R0 MSB    VDP register to write to
* R0 LSB    Value to write
*
VWTR   MOVB @R0LB,@VDPWA      // Send low byte (value) to write to VDP register
       ORI  R0,>8000          // Set up a VDP register write operation (10)
       MOVB R0,@VDPWA         // Send high byte (address) of VDP register
       ANDI R0,>3FFF          // Restore R0 top two MSbits
       B    *R11
*// VWTR

post-24952-0-35410800-1341593857_thumb.jpg

vr_read_test.zip

Link to comment
Share on other sites

  • 1 month later...

After a year of work I'm happy to announce the release of the F18A V1.6 Firmware. There have been many changes (see below), most of which were driven by suggestions, wishes, and feedback from Rasmus and Tursi as they were exploring the enhanced F18A features. I owe both of them a huge thanks, without their input and help this update would not exist.

 

The main focus of the V1.6 changes was usability. When I created many of the initial F18A features I did not have any context for how they might be used, and in practice some of the features were cool but useless. On the other hand Rasmus was writing games and asking if certain features would be possible, thus began the changes and updates.

 

There are also a few bug fixes, most notably a change to the 5th sprite number in the status register. This change corrects the miner49er bug, and probably fixes compatibility problems with other software not reported to me.

 

One of the coolest (I think) new features is Tile Layer 2 (TL2), which is a second completely independent tile layer that sits on top of the first original tile layer (TL1). Both TL1 and TL2 can have their own name table, color table, and horizontal and vertical scroll registers.

 

Another new feature for those who really like the Text Modes (T40 / T80) is the ability for *each tile* to have its own foreground and background color. This means you can now do full ANSI color in terminal programs, easily highlight text, etc. The text modes now have single-page pixel-scroll support too.

 

There is a virtual scan line feature for those who want to simulate the look of the old CRT monitors.

 

And much more.

 

I have updated the first post of this thread with the 99/4A in-system update program. Also included is a demo disk with excellent programs supplied by Rasmus and Tursi (original Hat and Manderbolt code). Hopefully these demos will entice others to start taking advantage of the F18A's enhanced features. Also, Rasmus' emulator (js99er) has almost full F18A support so you can write and test your F18A code under emulation! Classic99 has some initial F18A support as well, with more support on the way (I hope).

 

 

Change Log: V1.6 Apr 26, 2015

 

* Removed fixed tile functionality

* Removed border scroll limit functionality

* Removed banner functionality

* Removed host-side 32-bit counter

* Removed host-side 32-bit RNG

* Removed GPU 32-bit counter

* Removed GPU 32-bit RNG

* Removed the sprite "disable value" (>F8) in the sprite Y-location when ROW30 is enabled.

 

* Added second tile layer with its own NTBA, CTBA, h/v page sizes, and h/v scroll regs

 

* Added ECM2/3 pattern table size selections for tiles and sprites.

 

* Added host-side segmented counter with 10ns accuracy.

 

* Added configurable HSYNC and VSYNC GPU triggers.

 

* Added fat-pixel (2x1) with 16-color support to the bitmap layer (BML).

 

* Added 1x1 page scroll support for T40 and T80 modes.

 

* Added option to reset most VDP registers to their power-on values.

 

* Added option to disable Tile Layer 1, which includes GM1, GM2, MCM, T40, and T80.

Sprites, the BML, and TL2 are still active and can be enabled/disabled independently.

 

* Added option to allow attribute byte to be fg/bg color select in T40 and T80.

 

* Added per-position tile attribute support.

 

* Added DMA capability to the GPU:

8xx0 - MSB src

8xx1 - LSB src

8xx2 - MSB dst

8xx3 - LSB dst

8xx4 - width

8xx5 - height

8xx6 - stride

8xx7 - 0..5 | !INC/DEC | !COPY/FILL

8xx8 - trigger

 

FILL (active high) will read a single byte at the src address and fill the

destination with that byte.

 

src, dst, width, height, and stride are copied to dedicated counters when

the DMA is triggered, thus the original values remain unchanged.

 

* Added USR3 jumper to control GROMCLK/CPUCLK output on pin37 to provide support for 9128/29

 

* Added USR2 jumper to disable/enable simulated scan lines (every other VGA scan line has its

color reduced by 50%.) Also controllable via a new VDP register bit.

 

* Added a 5th sprite reporting option instead of reporting the max-sprite, which on the F18A

might be different than the original VDP because all 32 sprites can be on a single scan line.

 

* Added a new register (VR51) to limit the maximum sprite processed. This has nothing

to do with the number of sprites that can be visible on a scan line, which is controlled

by a separate register (VR30). This register is always active and can be used instead of

the >D0 byte in the sprite Y-location, and is the only way to limit sprite processing early

when ROW30 is enabled.

 

* Changed the GPU interlock so that polling the VDP status register will not cause the GPU

to pause. This should greatly increase GPU performance during heavy VDP interrupt polling.

 

* Fixed T80 NTBA two LSbit problem. They are ignored (set to "00") when the F18A

is locked to provide compatibility with the 9938 and avoid problem with software

that set the two LSbits of the NTBA to other than "11" as the 9938 documentation

specifies they should be. This limits the T80 name table to 4K boundaries. When

the F18A is unlocked, all 4-bits of the NTBA are used and the T80 name table can

be located on 1K boundaries.

 

* Fixed the 5th number update during a scan line. As long as the 5S flag is zero, the 5th

number register follows the sprite scanning sequence. Seems to be a transparent latch that

follows the input (current sprite being scanned) until latched by the 5S flag. If the status

register is being polled and 5S is reset mid frame, then the 5th number begins following the

scanned sprites again. This bug is known to have affected Miner49er on the 99/4A.

  • Like 10
Link to comment
Share on other sites

  • 2 weeks later...

Two ways:

 

1. The USR2 jumper will set the default virtual scan line behavior. With the jumper "on" the scan lines are "off".

 

2. Using VR50 bit >04 (0000 0100) the scan lines can be turned on or off.

 

If the USR2 jumper is off (scan lines enabled) then VR50 cannot turn them off.

Link to comment
Share on other sites

can i change the Scanlines Setting to be active as default via some software Changes only?

If not, are the pins for the JMP2 jumper on the F18A on the board or do I need to solder anything to add this jumper?

Sorry, it has been long since I have seen the F18a hardware...

I use it almost daily but only see the vga connector :)

Link to comment
Share on other sites

  • 2 weeks later...

The absolute top feature of the 1.6 firmware is the ability to add a second layer of tiles (aka patterns or characters) on top of the normal Graphics I tile layer. The new layer has its own name table but shares its patterns with tile layer 1. Sprites can be placed anywhere below, above or in between the two tile layer. What's more, each tile layer has its own set of pixel smooth hardware scroll registers. This provides almost unlimited potential for what we could do with a Ti-99/4A.

 

Check out the attached demo (needs to run on F18A console or JS99er.net). Here I have ripped some graphics from MAME from the arcade game Bomb Jack and converted it to TI format using Magellan.

 

post-35226-0-04963400-1432328127_thumb.pngpost-35226-0-72972200-1432330121_thumb.pngpost-35226-0-13305600-1432330143_thumb.png

 

The background is displayed in tile layer 1 while the foreground with the platforms is tile layer 2. You can change between foreground and background layers using keys 1-9 and turn off the foreground using 0. 1-3 are displayed on the same background and so are 4-6 and 7-9.

 

If you had to make different patterns for each combination of foreground and background the 256 characters would soon run out, but with two tile layers we have no such problems.

 

Just to show the scrolling capabilities you can also scroll the top layer using the joystick. Imagine what we can do with this: graphical adventures like Leisure suit Larry, platform games like Mario bros, etc.

 

With the F18A it's really easy, all you need to do is to set a few VDP registers. Look in the register spreadsheet for instructions, and please ask if you have any questions.

BOMBJACK.dsk

Bomb Jack.zip

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