Jump to content
whoami999ster

TI99/4A and vector graphics

Recommended Posts

I guess assembler no other option possible I think ... XB256 have smooth scrolling capabilities bat not for a wide background (I guess only background in loop) . Maybe after compile the result woud be fast enought ... but it's just a guess... 
I saw your lines demo and it's seems that line tracing could be feasible with an acceptable velocity. I know that raster is completely different from vector graph technology but battlezone was released for different 8-bit platform and I wonder that it would be be possible for TI99... 
My dream is to implement the game in assembler but but my knowledge is far from to be enough ... the initial idea came from your smooth scrolling examples/demos but another thing is to implement the game in assembler (... maybe in XB basic .. xb256 or TML which manage bitmap "natively"). 
I found this interesting link https://6502disassembly.com/va-battlezone/  (for me the listing is like hieroglyphs but maybe for you is simply ) ... battlezone was developed on 6502 processor ... so why not for TMS9900 ? 
    
   
6502 CPU (@1.5MHz). Handles the game logic and system diagnostics.
2901 ALUs. The 2901 is a 4-bit ALU that can be cascaded, allowing four of them to be combined to make a 16-bit math co-processor. The ALU can perform basic arithmetic and bitwise operations (add, subtract, exclusive-or, etc.). Battlezone includes a board with the 2901s, some ROM, and an interface that allows the 6502 to send and receive bytes of data. This is known as the "math box".

The 16 bit math box is why.. the 9900 has to do both.. with wait states and 8 bit multiplexer
Also the xy display and the vector system is totally different to operate then the 9918

Sent from my Pixel 6 Pro using Tapatalk

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
3 hours ago, whoami999ster said:

any very simple example in assembler would be very appreciated for the 4 method you suggest :) ... i.e tracing a rectangle or triangle  

This is the assembly listing of Vortex which is small enough and well commented to give you one example of rectangles and triangles bitmap drawing.

Vortex.txt

  • Like 6
  • Thanks 1

Share this post


Link to post
Share on other sites
5 hours ago, arcadeshopper said:

6502 CPU (@1.5MHz). Handles the game logic and system diagnostics.
2901 ALUs. The 2901 is a 4-bit ALU that can be cascaded, allowing four of them to be combined to make a 16-bit math co-processor. The ALU can perform basic arithmetic and bitwise operations (add, subtract, exclusive-or, etc.). Battlezone includes a board with the 2901s, some ROM, and an interface that allows the 6502 to send and receive bytes of data. This is known as the "math box".

The 16 bit math box is why.. the 9900 has to do both.. with wait states and 8 bit multiplexer
Also the xy display and the vector system is totally different to operate then the 9918

Sent from my Pixel 6 Pro using Tapatalk
 

= mission impossible ! :(     ... but still I wonder how 8-bit/raster VIC20 was able to implement battlezone... maybe was not the most famous version ... but still 

Share this post


Link to post
Share on other sites
= mission impossible !      ... but still I wonder how 8-bit/raster VIC20 was able to implement battlezone... maybe was not the most famous version ... but still 
It uses characters.. same way armor attack on the trs80 model 3 does. Less screen space too

Sent from my Pixel 6 Pro using Tapatalk

Share this post


Link to post
Share on other sites

The fastest line draw I managed on the TI could do about 67 lines per second (drawing from the center out to the screen edges) in monochrome. Even if you were happy with 10 frames per second, that's only about 6 lines per frame, and both erasing and re-drawing count, so isn't going to manage Battlezone very well. Now, this does read VDP and write the byte back, as was mentioned earlier. You can get faster writes to CPU memory, but you still need to copy that data to VDP. (It looks like I did some experiments using a dirty buffer, but with minimal success.) Shorter lines will draw faster, of course, but even if you tripled performance, that still won't manage much of a game.

 

So, you probably need to dismiss vectors, unless you want to try for the F18A specifically. The F18A GPU is much, much faster than the TI's 9900 and has direct, background access to video RAM and much faster ways to calculate pixels and clear the screen. (We really need to measure how much faster someday...) At any rate, it might be able to do a vector display for you.

 

But, you can get a pretty good fake out of pre-defined characters. I actually think that Vic-20 Battlezone video looks pretty good for the system. ;) But that's the direction I'd be looking if I were working on it.

 

  • Like 1

Share this post


Link to post
Share on other sites

Rasmus has done this test in the past, right?

 

This is without F18A:

 

 

This is with F18A:

 

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, TheMole said:

Rasmus has done this test in the past, right?

 

This is without F18A:

 

 

This is with F18A:

 

very clear

Share this post


Link to post
Share on other sites
4 hours ago, Tursi said:

The fastest line draw I managed on the TI could do about 67 lines per second (drawing from the center out to the screen edges) in monochrome. Even if you were happy with 10 frames per second, that's only about 6 lines per frame, and both erasing and re-drawing count, so isn't going to manage Battlezone very well. Now, this does read VDP and write the byte back, as was mentioned earlier. You can get faster writes to CPU memory, but you still need to copy that data to VDP. (It looks like I did some experiments using a dirty buffer, but with minimal success.) Shorter lines will draw faster, of course, but even if you tripled performance, that still won't manage much of a game.

 

So, you probably need to dismiss vectors, unless you want to try for the F18A specifically. The F18A GPU is much, much faster than the TI's 9900 and has direct, background access to video RAM and much faster ways to calculate pixels and clear the screen. (We really need to measure how much faster someday...) At any rate, it might be able to do a vector display for you.

 

But, you can get a pretty good fake out of pre-defined characters. I actually think that Vic-20 Battlezone video looks pretty good for the system. ;) But that's the direction I'd be looking if I were working on it.

 

I'm completely agree... I didn't expect to implement vector graphic on TI but as always the true is always in the middle ... 

thanks a lot to all of you for the precious suggestions and availability 

Share this post


Link to post
Share on other sites

I tried doing 3D wire graphics in Fortran99 on the TI without pre-rendering. Let's just say that the result is forgettable...

 

  • Like 3
  • Haha 1

Share this post


Link to post
Share on other sites
Posted (edited)
4 hours ago, Vorticon said:

I tried doing 3D wire graphics in Fortran99 on the TI without pre-rendering. Let's just say that the result is forgettable...

 

I would say ... unforgettableeeee .... ;) .... no way to manage "online drawing" ... I already give up ... It's a pity because the background scrolling it's very nice and promising ... did you see my bz0.avi above ?  

Edited by whoami999ster
  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, whoami999ster said:

Did you see my bz0.avi above ?  

I did and it looked awesome!  

Share this post


Link to post
Share on other sites
4 hours ago, dhe said:

Wonder if strange cart might be a good target?

Yes I think the StrangeCart would be able to draw the vector graphics at 15-20 FPS. As mentioned before the F18A could also easily do it, at 60 FPS, with lines, with filled polygons, or even with texture mapping. Both options have co-processors performing way beyond what the TMS9900 could do, but I think the more acceptable option would be that the co-processor is inside a cartridge rather than inside the machine. With an F18A version people would say that "Bah, it's just 21st century hardware doing all the work", but with the StrangeCart people, including myself, would say "Whoa, this game runs on a bare console". 🙂🙂🙂

  • Like 3
  • Haha 1

Share this post


Link to post
Share on other sites

The interesting bit:

 

" I've found an algorithm to split up triangles into character based graphics very nicely (so every 8x8 region of a solid color is transferred as a character index rather than a bitmap)."

  • Like 1

Share this post


Link to post
Share on other sites

I think Atari proved what was necessary BITD, i.e. an AM2901-based 16-bit ALU (mathbox) co-processor, coupled with a vector display (no need to calculate lines or clear/write to a frame buffer).  Some might have called that "cheating" back in 1980 as well, since the 8-bit CPUs were not really doing all the processing either.

 

Any MCU or FPGA used today to augment our retro-computers are easily more powerful than the entire original system, so there is simply nothing to discuss as far as that is concerned.  Just use a modern computer and throw that old computer in the trash...

 

Since the whole reason any of us are here is to enjoy and have fun with our retro computers, what anyone does with theirs, and what enhancements anyone uses, it totally up to the person using the system, writing the software, or playing the game.

 

Some people like to push or use only original hardware, and if that if the goal for a BattleZone port then I think you will have a lot of disappointment.  As I mentioned above, Atari showed what was necessary with real 1980 hardware, and the 99/4A does not have the graphic muscle to pull it off.

 

Now, if you are willing to consider using some modern enhancements to provide the same capability that the BattleZone MathBox provided to the 6502 in the original game, then I think it is justifiable to use something like the F18A to implement the MathBox functionality and a pseudo-vector display, and still call it a *fair* port.  Even with the F18A, you still have to write the code in 9900-assembly, and you can always burn cycles if you think it would be more fair to slow it down a bit.  To me, it seems reasonable to think that a 9900 could have done just as well as the 6502 in the original, all else being equal.

 

Something to keep in mind, pretty much all arcade-machine computers have custom graphics hardware support which give them their better color, scrolling, sprites, etc. capabilities.  Any port to a single-CPU system of similar era hardware, is going to be inferior or require additional *faking it*.

 

  • Like 4

Share this post


Link to post
Share on other sites
1 hour ago, matthew180 said:

Something to keep in mind, pretty much all arcade-machine computers have custom graphics hardware support which give them their better color, scrolling, sprites, etc. capabilities.  Any port to a single-CPU system of similar era hardware, is going to be inferior or require additional *faking it*.

I remember how impressed I was when I first saw Sega Outrun back in 1988, running in a racing cabinet with force feedback wheel. I was on holiday in Salou, Spain; this was somewhere near the beach.

 

Outrun is also emulated in MAME; it states:

2 x Motorola MC68000 10 MHz

Zilog Z80 4 MHz

Video: 320x224 60 Hz

 

So they spent quite a lot of computing power for this modest resolution.

  • Like 3

Share this post


Link to post
Share on other sites
Posted (edited)

For Battlezone, provided it's OK to require 32K and a large cartridge ROM, I think I would go for a solution like this:

  • Use bitmap mode with 2/3 of the screen as playfield. Monochrome only, set all colors to black or a static gradient.
  • Draw the background mountains a few screens wide and store in ROM.
  • Draw the objects at all different orientations and scales and store in ROM. For simplicity and to save space, let's restrict horizontal movement to 8 pixel boundaries.
  • During the game:
    • Copy background at scroll position to a 4K linear screen buffer in 32K RAM
    • Copy objects from ROM into buffer (using OR/SOCB)
    • Copy buffer to VDP
  • Execute copy routines from scratchpad using unrolled loops.
  • Use sprites for explosions, crosshair, etc.

I think 10 FPS would be possible, but I haven't done the math in detail.

 

By linear screen buffer I mean a buffer where each scanline follows the next top to bottom. It's simpler to write to than a character based buffer, and it's possible to copy it to the VDP just as fast as a character based buffer, using a trick with 8 registers.

 

To speed things up, only using 1/3 of the screen could be an option.

Edited by Asmusr
  • Like 6

Share this post


Link to post
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...