Tempest is possible

Use this forum to share and discuss Uzebox games and demos.
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Tempest is possible

Post by CunningFellow »

I guess I should update the ToDo: list.

I couple of things got done since the last time I posted it and I have added a few more things to the bottom.
CunningFellow wrote: Mon Aug 29, 2022 5:05 am
Not done
  • Proper behavior on some of the higher level enemies (Demon Head, Mutant Flipper and Pulsar) [est. 50 bytes per behavior]
  • Selectable start level viewtopic.php?f=5&t=1905&start=380#p15111 [est. 100 bytes]
  • Increase powerup dwell time based on Z [est. 64 bytes]
  • More vibrant "game over" screen with more colour and maybe its own animated background [est. 0 bytes]
  • More vector text "Caught You" "Avoid Spikes" "Eat Electric Death" [many hundreds of bytes each]
  • Extra audio channels so music and SFX can play at same time (new 8 channel audio system)
  • User defined volume for SFX and Music
  • AI Driod as player two (new object type #define OBJ_Player2_droid 2) viewtopic.php?f=5&t=1905&start=420 [est. 100 bytes]
  • Make the super zapper look like a lightning bolt striking each enemy[est. 150 bytes]
  • Bacon Strip bonus levels[est. 1000 bytes]
  • Modify the MOD player to be able to store songs in the wasted space of "renderlines" to claw back about 1K of flash
Already done
  • Enemy count gets corrupt and level will not end viewtopic.php?f=5&t=1905&start=440#p15318 FIXED
  • Some times speed moderation fails (wait VSync does not keep the game at steady slow speed) FIXED
  • Drawing random green lines on the screen when super zapper active and spikes exist FIXED
  • Can not catch powerups while zooming FIXED
  • Powerups and enemies should not wrap past zero FIXED
  • Distance to enemy (or spikes) distorted while zooming (apparent when "outta here" happens) FIXED
  • Random graphical glitches on screen IDENTIFIED
  • Flippers will flip onto lane 16 on open webs (and float in space) FIXED
  • Ai Droid will jump open lane when first created if no enemies to chase FIXED
  • Demon heads are still fatal even when even when superzapped Think it's fixed not 100% sure
  • Avoid spikes delay when an "outta here" is collected DONE
  • Gradient on the 2000 on the title screen viewtopic.php?f=5&t=1905&start=450#p15505 DONE
  • a "Meet the Enemies" screen in attract mode shows the enemies and some brief text DONE
  • PCM channel has gotten very quiet at some point viewtopic.php?f=5&t=1905&start=530#p16783 FIXED
Things I maybe could do now with extra flash space
  • ADPCM audio compression to fit extra samples
  • Extra songs
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Tempest is possible

Post by Artcfox »

If you modify the mod player, it seems you might be able to fit in so many of the extras. How hard would it be to change the mod player? Or would you just have a pointer to the next segment of the song sort of like how non-contiguous clusters work in a FAT?
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Tempest is possible

Post by CunningFellow »

The wasted space that is currently just taken up by "Nop"s in the renderlines code is all scattered out between real code.

The modification would be like you suggest pulling data from non-contiguous memory. It would be more like a hash function than chaining clusters though.

There is 1792 bytes of easy to get to wasted flash that could be gotten with some simple logic. There is another 310 bytes that seems harder.

The "intro" song is 1660 bytes so could be completely moved to there and I would then have 3k5 of flash free for extra features.

The hardest part of this hack though is going to be getting the data into the gaps. I can't just say

#include "data/intro.inc"
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Tempest is possible

Post by Artcfox »

Wouldn't you have to skip the data as instructions, and maintain the same # of clock cycles as the NOPs? How would that work unless you have lots of NOPs in a row?
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Tempest is possible

Post by CunningFellow »

The nops are never run. They are just place holders. I could have as easily done

.dw 0
.dw 0

Here is two runs of the renderline switch/case statement. There are 14 lines of code that is run. The last line being an IJMP to the next CASE.

Then there are two NOPs to pad the size out to 16 words.

Code: Select all

     out    _SFR_IO_ADDR(PORTC), r23
     mul    r13, r1
     ld     YL, X+
     out    _SFR_IO_ADDR(PORTC), r23
     mul    r13, r1
     ld     ZH, Y+
     out    _SFR_IO_ADDR(PORTC), r23
     mul    r13, r1
     mov    ZL, ZH
     andi   ZH, 0x0F
     out    _SFR_IO_ADDR(PORTC), r23
     andi   r18, 0x80
     ori    ZH, 0x20
     ijmp
     nop
     nop
     out    _SFR_IO_ADDR(PORTC), r23
     mul    r13, r1
     ld     YL, X+
     out    _SFR_IO_ADDR(PORTC), r23
     mul    r13, r1
     ld     ZH, Y+
     out    _SFR_IO_ADDR(PORTC), r21
     mul    r13, r1
     mov    ZL, ZH
     andi   ZH, 0x0F
     out    _SFR_IO_ADDR(PORTC), r23
     andi   r18, 0x80
     ori    ZH, 0x20
     ijmp
     nop
     nop
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Tempest is possible

Post by Artcfox »

Oh, perfect then! Maybe not easy, especially changing the MOD player, but probably straightforward (can always just read backward from the next alignment if there are variable amounts of padding).
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Tempest is possible

Post by CunningFellow »

I thought that - but that then makes random access difficult.

There are 2 NOPs minimum space. Some have 3 NOPs. If I just discard the third NOP from the 62 instances it happens I still have 1792 bytes recovered AND the logic is still simple enough I can do random access.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Tempest is possible

Post by Artcfox »

That is awesome, and totally wild that you can interleave so many different things to achieve space savings (and SD card reading!)
User avatar
danboid
Posts: 1937
Joined: Sun Jun 14, 2020 12:14 am

Re: Tempest is possible

Post by danboid »

"More vibrant "game over" screen with more colour and maybe its own animated background [est. 0 bytes]"

I presume zero bytes isn't a typo? If so, please explain how the extra feature gets magickd.
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Tempest is possible

Post by CunningFellow »

Well - At the moment "GAME OVER" is a string that is stored in flash. That string takes 10 bytes of flash. The call to PrintString with arguments will take 6 bytes of flash.

If I make the game over screen a resource that is loaded from the SD card the same as the title screen and all the meet the enemy screens - It will take a total of 4 bytes to show the screen. So that is minus 12 bytes to change the game over message to its own screen.

Negative 12 bytes is approximately zero.
Post Reply