Jump to content
IGNORED

Sprites Multicolor TML


atari1byte

Recommended Posts

Making sprites more than one colour on the TI-99 (under any circumstance, TML or otherwise) is achieved by stacking multiple sprites.  Any individual sprite can only be one colour. 

 

Giving a sprite the appearance of containing more than one colour can also be achieved by modifying background tiles in real time in tandem with sprite motion, but this usually won't be practical in a high level interpreted language. 

 

Among high-level interpreted languages, Logo and TML make sprite stacking more practical by providing the means to control sprite movement in groups (rather than individually and sequentially). 

 

See my discussion and demonstration of sprite stacking, at this point in this video here:

 

 

  • Like 3
Link to comment
Share on other sites

3 hours ago, pixelpedant said:

Among high-level interpreted languages, Logo and TML make sprite stacking more practical by providing the means to control sprite movement in groups (rather than individually and sequentially). 

What's that sound?  

Is it a gauntlet being thrown to ground?  :)

 

Sounds like I need to add a SPRITE stacker to my library. It would work best if the sprite numbers used are sequential.

Back to the trench I go.

  • Like 3
Link to comment
Share on other sites

6 hours ago, atari1byte said:

Hi guys!
I,m looking for a tutorial to make multicolor sprites in TML
I am so distracted that I can't find it in the manuals....
Can I get some help?
Thank you all!

 

So—to be clear—are you looking to use sprites in Multicolor mode or are you trying to figure out how to define a single sprite to have more than one color? As mentioned by @pixelpedant, the latter is not possible except as a trick that defines and controls several sprites to act as one. Of course, the 4-sprites-on-one-line limit will screw with that unless you have an F18A.

 

...lee

Link to comment
Share on other sites

8 hours ago, TheBF said:

Cos'è quel suono?

È un guanto di sfida che viene gettato a terra? :)

 

Sembra che io debba aggiungere uno stocker SPRITE alla mia libreria. Funzionerebbe meglio se i numeri di sprite utilizzati fossero sequenziali.

Torno in trincea.

 

11 hours ago, pixelpedant said:

La realizzazione di sprite di più di un colore sul TI-99 (in qualsiasi circostanza, TML o altro) si ottiene impilando più sprite. Ogni singolo sprite può essere solo di un colore.

 

Dare a uno sprite l'aspetto di contenere più di un colore può anche essere ottenuto modificando le tessere di sfondo in tempo reale in tandem con il movimento dello sprite, ma questo di solito non sarà pratico in un linguaggio interpretato di alto livello.

 

Tra i linguaggi interpretati di alto livello, Logo e TML rendono più pratico l'impilamento di sprite fornendo i mezzi per controllare il movimento degli sprite in gruppi (piuttosto che individualmente e sequenzialmente).

 

Vedi la mia discussione e dimostrazione di sprite stacking, a questo punto in questo video qui:

 

 

thanks for the video...

Link to comment
Share on other sites

6 hours ago, Lee Stewart said:

 

Quindi, per essere chiari, stai cercando di usare gli sprite in modalità Multicolore o stai cercando di capire come definire un singolo sprite per avere più di un colore? Come menzionato da @pixelpedant, quest'ultimo non è possibile se non come trucco che definisce e controlla diversi sprite per agire come uno. Naturalmente, il limite di 4 sprite su una linea si avviterà con quello a meno che tu non abbia un F18A.

 

... sottovento

thanks for the reply.
interesting....
Can I have a link / tutorial for F18A ?

Link to comment
Share on other sites

3 hours ago, atari1byte said:

thanks for the reply.
interesting....
Can I have a link / tutorial for F18A ?

 

Because the F18A is no longer made by @matthew180 in favor of his MK2 (stalled due to global parts shortages), you might be able to get one via @Hans23’s efforts F18A DIY?.

 

...lee

 

  • Like 1
Link to comment
Share on other sites

Even if you get an F18A you still can't make multicolor sprites from BASIC. You have to use assembly language for that.

Well I guess you can stack multiple 1 color sprites, but you can't use real F18A multicolor sprites.

Edited by Asmusr
Link to comment
Share on other sites

10 hours ago, atari1byte said:

Can I have a link / tutorial for F18A ?

As mentioned, the F18A and MK2 are stalled due to the electronics part shortage.  The documentation is also lacking for sure; just not enough time to do everything I want to do.  For now you can use js99er (and limited support in Classic99) to do F18A programming in emulation.

 

Probably the best way to dig into the F18A is to first understand the 9918A architecture, its registers and how they control the modes and video tables locations that the VDP uses to generate the display.  It is then a short jump to understand the F18A is mostly an expansion of the 9918A register set, which are used to enable and control the F18A's enhanced features (scrolling, more colors per pixel, etc.)

 

6 hours ago, Asmusr said:

Well I guess you can stack multiple 1 color sprites, but you can't use real F18A multicolor sprites.

To elaborate on what Asmusr said, the F18A does not have the 4-sprite on a line limitation of the original 9918A.  This enhancement is usually the default setting (people can choose to have the original 4-sprite limit), and since allowing all 32-sprites to be drawn can be done passively, you can take advantage of that in environments like XB.

 

If you are using assembly language (or some other recent homebrew languages, Forth for example), you can enable the F18A's enhanced capabilities which can be set to allow tiles and/or sprites to have 4 or 8 colors per pixel, among other capabilities.

 

Attached is an example of having all 28 sprites (XB only allows access to 28 of the 32 sprites) visible on the same scan line from XB, without having to do anything other that having an F18A in the system.

xb_28_sprites.thumb.jpg.9226e748e01724de33f0060258d43844.jpg

  • Like 4
  • Thanks 2
Link to comment
Share on other sites

On 7/23/2022 at 8:32 PM, matthew180 said:

some other recent homebrew languages, Forth for example

Has anyone developed a Forth library for the F18A for game developers? This could include multi color characters and sprites, smooth scrolling, access to tile layer 2, access to bitmap layer, and maybe a way to split the screen using the GPU. 

Edit: and support for editing the color palette of course.

 

Edited by Asmusr
  • Like 6
Link to comment
Share on other sites

Maybe that's something next on a list of things..

I know that there is a spreadsheet floating around that has all the registers and definitions.

That's the starting point I believe.

I have a copy of that, I think Matt put it together awhile back.

I'll throw it on my forth postings...

  • Like 3
Link to comment
Share on other sites

On 7/30/2022 at 10:07 AM, Asmusr said:

Has anyone developed a Forth library for the F18A for game developers? This could include multi color characters and sprites, smooth scrolling, access to tile layer 2, access to bitmap layer, and maybe a way to split the screen using the GPU. 

Edit: and support for editing the color palette of course.

 

I’ve done all these in custom assembly. Some questions that come to mind for any library:

 

choosing VDP allocation.  In my experience, it’s trade offs between the above features to fit into 16K. You can’t use all the features at once. 
 

So a word set would be low level, requiring the programmer to work out their memory map carefully.


F18? ( — f ) ( present? )


I imagine words to set up the  registers:

 

   0 2 2 TL1 ( 2x2 screens )

1000 1 2 TL2 (1x2 )

1800 256 1 BPP CHRPAT

1800 SPRATT

1880 COLORT

( chars 0-31 eaten by tables)

2000 128 3 BPP SPRPAT

 

or instead organized by context:

 

>SPRITES

3 BITS/PIXEL

128 #PATTERNS

2000 PATTERN-TBL

1800 ATTRIBUTE-TBL

 

>SCREEN

1800 PATTERN-TBL

FF 20 #PATTERNS ( sprites eat 20)

1 BITS/PIXEL

1B00 COLOR-TBL

1A00 ATTRIBUTE-TBL

0 PALETTE ( use palette 0 )

2 2 #SCREENS-TL1

2 1 #SCREENS-TL2


>PALETTE

0 PALETTE ( for 0-15)

F F F RGB F COLOR


>BML

1C00 BML-TABLE

100 4 BML-SIZE

2 BITS/PIXEL

Table base addresses can be retrieved by later code or addresses calculated in convenient words like 3 #SPR or 60 #SPRPAT. 

Magellan tables could be loaded from assembled binary:

MAGELLAN ( vocabulary)

 

S” MAP1-BIN” BINLOAD

or

S” MAP1” ASSEMBLE

FORTH ( leave Magellan vocabulary )

 

Also

>TEXT80

>TEXT40

which are alternates to >SCREEN

 

 

 

 

Getting snazzy: the library could keep track of  the allocated  memory as you go,  filling in holes where possible. You can print out the memory map any time. So then:

 

>SPRITES

3 BITS/PIXEL

80 #PATTERNS

( allocated  for you:)

( 0000 PATTERN-TBL 

 0C00 ATTRIBUTE-TBL ) 

( 3K used by pattern table )

 

Programer gets errors or warnings for doing words out of logical order, or MEMORY FULL. 

 

To optimize:

>PATTERNS

100 #PATTERNS

0 20 FREE

E0 20 FREE

( leaves 100 and 100 byte holes free for other tables )


 

Once all the tables are allocated, 

 

10 80 SCROLL-TL1

 

You might want words for calculating memory address from row/col in 4 screen TL1.. after  scrolling… wherever that is..
 

Fancy multi-sprite manipulators:

 

>SPRITES ( vocabulary )

2 MAGNIFY ( I want all 2x2 )

0 TELL-SPRITE# 7 TO#

C0 ROW ( put all 8 at row C0)

1 PALETTE ( use palette 1 )

EARLY-CLOCK ( set bit )

BEHIND-TL1 ( not sure?)

 

More ideas

Words for drawing in the BML,

calling LINETO in the GPU. 

words for copying  font patterns into the BML

Using the Forth assembler to prepare code  for GPU , somehow incorporating the table addresses set up earlier.  (Maybe tricky to get the assembler to make code for a VDP address?)

 

 

 

 

 

 

 

 

 


 


 


*These numbers were my desired trade offs for smooth scrolling with parallax, 2x2 in TL1 (4K) and 2x1 in TL2 (2K.)  TL2 was the background, scrolling at 1/2 speed. There was a small amount left for BML, About 3 rows) to mask TL2’s vertical scrolling. 

 

  • Like 3
Link to comment
Share on other sites

40 minutes ago, FarmerPotato said:

I’ve done all these in custom assembly. Some questions that come to mind for any library:

 

choosing VDP allocation.  In my experience, it’s trade offs between the above features to fit into 16K. You can’t use all the features at once. 
 

So a word set would be low level, requiring the programmer to work out their memory map carefully.


F18? ( — f ) ( present? )


I imagine words to set up the  registers:

 

   0 2 2 TL1 ( 2x2 screens )

1000 1 2 TL2 (1x2 )

1800 256 1 BPP CHRPAT

1800 SPRATT

1880 COLORT

( chars 0-31 eaten by tables)

2000 128 3 BPP SPRPAT

 

or instead organized by context:

 

>SPRITES

3 BITS/PIXEL

128 #PATTERNS

2000 PATTERN-TBL

1800 ATTRIBUTE-TBL

 

>SCREEN

1800 PATTERN-TBL

FF 20 #PATTERNS ( sprites eat 20)

1 BITS/PIXEL

1B00 COLOR-TBL

1A00 ATTRIBUTE-TBL

0 PALETTE ( use palette 0 )

2 2 #SCREENS-TL1

2 1 #SCREENS-TL2


>PALETTE

0 PALETTE ( for 0-15)

F F F RGB F COLOR


>BML

1C00 BML-TABLE

100 4 BML-SIZE

2 BITS/PIXEL

Table base addresses can be retrieved by later code or addresses calculated in convenient words like 3 #SPR or 60 #SPRPAT. 

Magellan tables could be loaded from assembled binary:

MAGELLAN ( vocabulary)

 

S” MAP1-BIN” BINLOAD

or

S” MAP1” ASSEMBLE

FORTH ( leave Magellan vocabulary )

 

Also

>TEXT80

>TEXT40

which are alternates to >SCREEN

 

 

 

 

Getting snazzy: the library could keep track of  the allocated  memory as you go,  filling in holes where possible. You can print out the memory map any time. So then:

 

>SPRITES

3 BITS/PIXEL

80 #PATTERNS

( allocated  for you:)

( 0000 PATTERN-TBL 

 0C00 ATTRIBUTE-TBL ) 

( 3K used by pattern table )

 

Programer gets errors or warnings for doing words out of logical order, or MEMORY FULL. 

 

To optimize:

>PATTERNS

100 #PATTERNS

0 20 FREE

E0 20 FREE

( leaves 100 and 100 byte holes free for other tables )


 

Once all the tables are allocated, 

 

10 80 SCROLL-TL1

 

You might want words for calculating memory address from row/col in 4 screen TL1.. after  scrolling… wherever that is..
 

Fancy multi-sprite manipulators:

 

>SPRITES ( vocabulary )

2 MAGNIFY ( I want all 2x2 )

0 TELL-SPRITE# 7 TO#

C0 ROW ( put all 8 at row C0)

1 PALETTE ( use palette 1 )

EARLY-CLOCK ( set bit )

BEHIND-TL1 ( not sure?)

 

More ideas

Words for drawing in the BML,

calling LINETO in the GPU. 

words for copying  font patterns into the BML

Using the Forth assembler to prepare code  for GPU , somehow incorporating the table addresses set up earlier.  (Maybe tricky to get the assembler to make code for a VDP address?)

 


*These numbers were my desired trade offs for smooth scrolling with parallax, 2x2 in TL1 (4K) and 2x1 in TL2 (2K.)  TL2 was the background, scrolling at 1/2 speed. There was a small amount left for BML, About 3 rows) to mask TL2’s vertical scrolling. 

 

I have been thinking about doing a wordset just for 9918 to start to allow setting all the memory locations and modes easily, but also recording the info in memory.

I will make reference of your words here if I get up the courage to do F18. 

 

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Maybe we could make use of a task group, like the folks at Debian and how they look at rasberry pi, but to work on Forth AND F18A possibly include tipi and rasberry pi for words with a committee chairman. Oooh... sounds good to me...need some rules placed.

I'd love to sit in on a zoom for that one.

 

Edited by GDMike
  • Like 1
Link to comment
Share on other sites

17 hours ago, TheBF said:

I have been thinking about doing a wordset just for 9918 to start to allow setting all the memory locations and modes easily, but also recording the info in memory.

I will make reference of your words here if I get up the courage to do F18. 

 

The superset could work nicely:

 

9918? ( always true , base features common to 9918/9918A/9929)

9918A? (  true if your chip is an A variant with bitmap mode including 9929A.   False on the 99/4, no A)

9929? ( true on PAL consoles )

F18A? ( true only if you have one )

F18MK2 ( someday )

9938? ( true if you have 9938 or up. Geneve 9640 or AVPC)

9958? ( true if you have 9958 )

34020? ( true if Karl Guttag is your best friend )

 


Here’s an example suited to the 9918. 
 

>SCREEN

( default configures screen image table at 0000 of size 300, pattern table at 0800 with size 800 for 256 patterns)

 

1 BPP ( no effect , F18A only)

0000 PATTERN-TBL

80 #STARTING-WITH

70 #PATTERNS

 

Changes the  pattern table from default 800 to 0000, but only use patterns 80-F0.
 

So pattern table reserves the space 0400 to 0780. There are still free blocks from 0300-03FF and 0780-07FF. 

 

The next thing we request could end up in those free blocks instead of eating into the space at 1000.  
For instance, the color table or   Sprite attribute table. 
 

Thought: once you declare >SPRITES , you would say AUTOMOTION to reserve the auto-motion table which is hard coded at 0780-07FF. 

 

this example follows the TI Extended BASIC layout, biased by >60, so it occupies patterns >7E to >EF.  ASCII <space> is really at pattern >80 and pattern F0 is the sprite auto-motion table!

The top half of the pattern table is free for other uses.

 

issue: >SCREEN must put the 32-byte color table somewhere, but the first free block is at 0300 , which is ideal for the sprite attribute table.  So the color table default is 03E0. Then occupies only 03F0-03FF after the first half of pattern table is freed. Then somehow ask for only 28 sprites and the SATR neatly auto-allocates into the free block of 0300-03EF. ( hmm)
 

Too fancy? There could just be default configurations to choose the E/A, BASIC, or Extended BASIC maps. 
 

Perhaps a good API lets you

1. easily get the common cases.

2. easily specify exactly what you want, but only if you understand  what you want. 
3. API doesn’t do your thinking for you , but can help you learn by outputting the results of your program. (The resulting memory map)
 



 

 

 

 

 

 

 

 

 

 

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