Jump to content
IGNORED

Turmoil clone (multicolor sprites)


PeteE

Recommended Posts

  • 3 weeks later...

Unreal, brother.... just getting around to putting this one on my hardware and I am absolutely blown away. The controls are immaculate, the enemies are excellent, sound FX are marvelous....

 

You just did something incredible.... :)

 

Thank you so much for this game!!!!!!! High Score Competition fodder, indeed!!!

This high score competition with Turmoil, i will win! ;-)

  • Like 1
Link to comment
Share on other sites

  • 2 years later...
On 12/27/2018 at 4:55 AM, PeteE said:

I've added an EA5 version now - TURMOIL.bin.

 

In case you were wondering how the multicolor sprites work, here's how:

post-43480-0-56739800-1545881891.png

There are 4 different color stripe patterns used for the various moving object types: the player ship, the majority of enemy ships, the arrow/saucer, and the explosion. The color stripes are a block of bitmap mode character patterns, with a single sprite set to the inverted shape of the ship and set to black. Here's what it looks like with the sprite layer turned off in classic99:

post-43480-0-55139400-1545881901.png

Each stripe block can be moved pixel-by-pixel horizontally by using the characters from a set of 8 shifted stripes with black background. There is one set for each corner of the block, so 32 characters total for each color stripe. The character pattern table looks like this: (the stripes are duplicated in each of the 3 bitmap mode screen segments)

post-43480-0-20660300-1545881908.png

The player bullets are two sprites, and with one enemy sprite per row, and a single player ship sprite, that stays within the limit of 4 sprites per line.

I'm very interested with this technique but I didn't usterstand nothing ,,, can you please provide a step by step example/eplanation on how to implement it ,,, an easy example would be very help full... thanks a lot in advance for your kindly help

  

  • Like 2
  • Confused 1
Link to comment
Share on other sites

24 minutes ago, whoami999ster said:

I'm very interested with this technique but I didn't usterstand nothing ,,, can you please provide a step by step example/eplanation on how to implement it ,,, an easy example would be very help full... thanks a lot in advance for your kindly help

  

Are you familiar with bitmap mode on the 9918A?  Familiar with sprites and transparency?  Which programming language would be best for providing an example for you to understand?

Link to comment
Share on other sites

  • 9 months later...
On 7/19/2021 at 7:59 PM, PeteE said:

Are you familiar with bitmap mode on the 9918A?  Familiar with sprites and transparency?  Which programming language would be best for providing an example for you to understand?

Hi Pete 

Apologize for my missing answer (probably I didn't set the notificaion) ... Anyway I come back on this subject (multicolor sprites, bitmap mode) and in the mean time I get familiar with 9918A and assembly (unfortunately not really applied pratically) ... I think to had understood you technique but not sure ... and I didn't understood  "Each stripe block can be moved pixel-by-pixel horizontally by using the characters from a set of 8 shifted stripes with black background. There is one set for each corner of the block, so 32 characters total for each color stripe" 

By chance do you have some little example in TI99 aassembly I could use as case study...

 

Thanks a lot in advance for your patience and understanding

Regards

Francesco 

Link to comment
Share on other sites

9 hours ago, whoami999ster said:

Hi Pete 

Apologize for my missing answer (probably I didn't set the notificaion) ... Anyway I come back on this subject (multicolor sprites, bitmap mode) and in the mean time I get familiar with 9918A and assembly (unfortunately not really applied pratically) ... I think to had understood you technique but not sure ... and I didn't understood  "Each stripe block can be moved pixel-by-pixel horizontally by using the characters from a set of 8 shifted stripes with black background. There is one set for each corner of the block, so 32 characters total for each color stripe" 

By chance do you have some little example in TI99 aassembly I could use as case study...

 

Thanks a lot in advance for your patience and understanding

Regards

Francesco 

I see your message.  I will work on an example and post it within a couple days.

Link to comment
Share on other sites

Hi @whoami999ster

Here is an example multicolor sprite assembly cartridge program.  Use xas99.py to compile.  Use Joystick 1 to move the sprite, left and right are smooth pixel-scroll, and up and down are chunky 8-pixel jump.  (Which suited Turmoil just fine.) The example sprite was inspired by Zippy the Porcupine on the 2600. The Magellan file is included so you can see how the masked sprite and shifted character sprites are combined.  (Turn on the grid to see more clearly.) The character positions are chosen specifically so that the X coordinate mod 8 can be added to the base character index, making the drawing code simple.  I tried to comment everything thoroughly but let me know if you have any questions and I will be happy to answer. 

sprite.asm mcspr.mag mcspr.asm mcsprc.bin

Edited by PeteE
typo
  • Like 7
Link to comment
Share on other sites

23 hours ago, PeteE said:

Hi @whoami999ster

Here is an example multicolor sprite assembly cartridge program.  Use xas99.py to compile.  Use Joystick 1 to move the sprite, left and right are smooth pixel-scroll, and up and down are chunky 8-pixel jump.  (Which suited Turmoil just fine.) The example sprite was inspired by Zippy the Porcupine on the 2600. The Magellan file is included so you can see how the masked sprite and shifted character sprites are combined.  (Turn on the grid to see more clearly.) The character positions are chosen specifically so that the X coordinate mod 8 can be added to the base character index, making the drawing code simple.  I tried to comment everything thoroughly but let me know if you have any questions and I will be happy to answer. 

sprite.asm 7.09 kB · 6 downloads mcspr.mag 120.81 kB · 7 downloads mcspr.asm 13.11 kB · 6 downloads mcsprc.bin 8 kB · 8 downloads

THANKS A LOT PETER! I'll study your beautiful example ... it's a perfect starting point for me ... maybe I'll come back to you with some questions I hope to not disturb you too much

May I ask you something personal ... are you placed in Walldorf (Germany)? ... not problem at all if your prefer to not answer for privacy

In the mean time thanks once again 

Francesco 

Link to comment
Share on other sites

1 hour ago, whoami999ster said:

THANKS A LOT PETER! I'll study your beautiful example ... it's a perfect starting point for me ... maybe I'll come back to you with some questions I hope to not disturb you too much

May I ask you something personal ... are you placed in Walldorf (Germany)? ... not problem at all if your prefer to not answer for privacy

In the mean time thanks once again 

Francesco 

Hi Francesco,

I hope it is useful for you to learn from.

My location is listed under my profile... I've never been to Germany but all the Germans I've met are wonderful people.

Pete

Link to comment
Share on other sites

4 hours ago, speccery said:

Just discovered this thread on a coffee break, nice game, thanks @PeteE! Very cool implementation strategy with those inverted black sprites. I suppose you're using GM2 for the tiles?

Glad you liked it.  Yes, the tiles are in Graphics II Mode, the so-called "bitmap" mode, which allows you to independently select a foreground and background color for each of the 8 lines per tile.

  • Like 3
Link to comment
Share on other sites

On 5/7/2022 at 9:00 PM, PeteE said:

Hi Francesco,

I hope it is useful for you to learn from.

My location is listed under my profile... I've never been to Germany but all the Germans I've met are wonderful people.

Pete

I'm trying to learn something from your super example but I would need for a little hand ...

 

why the following definition for VDP registers I mean a memory location divided by >400   , >40 etc...  why not the exact value?

 

VDPINI ; Initial VDP register data
       BYTE >02          ; VDP Register 0: 02 (Bitmap Mode)
       BYTE >E2          ; VDP Register 1: 16x16 Sprites
       BYTE (SCRTAB/>400); VDP Register 2: Screen Image Table
       BYTE (CLRTAB/>40)+>7F ; VDP Register 3: Color Table
       BYTE (PATTAB/>800)+>3; VDP Register 4: Pattern Table
       BYTE (SPRTAB/>80) ; VDP Register 5: Sprite List Table
       BYTE (SPRPAT/>800); VDP Register 6: Sprite Pattern Table
       BYTE >F1          ; VDP Register 7: White on Black

 

thank in advance for you patience... 

 

Link to comment
Share on other sites

52 minutes ago, whoami999ster said:

I'm trying to learn something from your super example but I would need for a little hand ...

 

why the following definition for VDP registers I mean a memory location divided by >400   , >40 etc...  why not the exact value?

 

VDPINI ; Initial VDP register data
       BYTE >02          ; VDP Register 0: 02 (Bitmap Mode)
       BYTE >E2          ; VDP Register 1: 16x16 Sprites
       BYTE (SCRTAB/>400); VDP Register 2: Screen Image Table
       BYTE (CLRTAB/>40)+>7F ; VDP Register 3: Color Table
       BYTE (PATTAB/>800)+>3; VDP Register 4: Pattern Table
       BYTE (SPRTAB/>80) ; VDP Register 5: Sprite List Table
       BYTE (SPRPAT/>800); VDP Register 6: Sprite Pattern Table
       BYTE >F1          ; VDP Register 7: White on Black

 

thank in advance for you patience... 

 

Because that's how the VDP defines them... see sections 5.1.3 - 5.1.7 in the programmers guide vdp_pg.pdf

The addresses are 14 bits, but the registers are only 8 bits, so it can only use some of the bits.  For registers 3 and 4, there are special notes for Graphics II Mode, that's what +>7F and +>3 are added, to set the right number of least-significant bits (LSB) to 1s.

Edited by PeteE
  • Like 2
Link to comment
Share on other sites

4 minutes ago, PeteE said:

Because that's how the VDP defines them... see sections 5.1.3 - 5.1.7 in the programmers guide vdp_pg.pdf

uhmmm .... I need to read again VDP_PG .. I guessed that was for the "VDP table" dimension but the calculation deceived me because I tryed to compile the code with WinASM but  got errors due to the division... 

I'm a donkey and It will take time but finally I will get something... I star to read lot of material around TI assembly but your "programming style" is a litlle bit different from the classical (like the usage of standard routine VMBW, MSBW, etc..) .. it take time to learn the optimal programming method ... any lecture to suggest ?

 

Thanks as sual  

Link to comment
Share on other sites

20 minutes ago, whoami999ster said:

uhmmm .... I need to read again VDP_PG .. I guessed that was for the "VDP table" dimension but the calculation deceived me because I tryed to compile the code with WinASM but  got errors due to the division... 

I'm a donkey and It will take time but finally I will get something... I star to read lot of material around TI assembly but your "programming style" is a litlle bit different from the classical (like the usage of standard routine VMBW, MSBW, etc..) .. it take time to learn the optimal programming method ... any lecture to suggest ?

 

Thanks as sual  

WinASM probably doesn't support the arithmetic calculations in the data.  I prefer the more advanced features of XDT99 xas99.py.  I'm sorry if my ASM style is not classical, I started learning when XDT99 came out, and haven't tried anything else.

Edited by PeteE
  • Like 3
Link to comment
Share on other sites

1 hour ago, whoami999ster said:

why the following definition for VDP registers I mean a memory location divided by >400   , >40 etc...  why not the exact value?

Because if you later change the value of SCRTAB, CLRTAB etc. the calculations ensure that the VDP registers are automatically set up to match. It's the standard programming principle of not defining a common value in more than one place.

  • Like 2
Link to comment
Share on other sites

1 hour ago, Asmusr said:

Because if you later change the value of SCRTAB, CLRTAB etc. the calculations ensure that the VDP registers are automatically set up to match. It's the standard programming principle of not defining a common value in more than one place.

Thanks Rasmus.  I totally missed the intent of his question.  Yes, that is it, exactly - I wanted the table address and register values to be automatically consistent.  But care needs to be taken that an invalid table address isn't used, some must be at a multiple of >40,>80,>400,>800 etc, otherwise the register setting won't match.

Edited by PeteE
  • Like 2
Link to comment
Share on other sites

  • 1 month later...

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