Author Topic: Vectronix GTA cracktro code  (Read 410 times)

0 Members and 1 Guest are viewing this topic.

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 404
  • Karma: 136
    • View Profile
    • KrazyK Remakes
Vectronix GTA cracktro code
« on: August 05, 2026 »
Here's the Vectronix cracktro code including userlibraries for PB x86 5.73+
Feel free to use/abuse/improve.
I've also posted the updated vis demo exe in the projects section after getting back from Scotland this week.
https://www.dbfinteractive.com/forum/index.php?topic=7030.0
Challenge Trophies Won:

Offline ttemper

  • Amiga 1200
  • ****
  • Posts: 278
  • Karma: 8
    • View Profile
Re: Vectronix GTA cracktro code
« Reply #1 on: August 07, 2026 »
very nice... will check it out when i get the chance. it's always nice to see how other coders do things.

Offline ttemper

  • Amiga 1200
  • ****
  • Posts: 278
  • Karma: 8
    • View Profile
Re: Vectronix GTA cracktro code
« Reply #2 on: August 20, 2026 »
Big thanks KrazyK for the code to check out.

In my poking around, I noticed that you still use an old PB version 5.71 or such IIRC. ouch. and for many days I was pulling my hair as to why PB 6.2.0 wouldnt render things properly, until one day half asleep I peeped the idea that the older versions of PB use DirectX as the renderer, not OpenGL... so i put DirectX9 as the render and bingo, everything renders fine. \o/

On that note... I went down a rabbit hole, and by rabbit hole I mean it was more like an ant-farm.

I coded and recoded your Vectronix cractro using PB 6.2.0... removed a heap of code, added in new code and got it all working again. Your transparent blit proc only works on DX, so i fixed that by using a work-around method using 32bit images with dedicated alpha table (RGBA, not just RGB) and adjusting the draw commands to suit what was needed. Needless to say that the images now blit in reverse (cut out) to reveal the raster underneath keeping the background fully transparent, and with zero performance hit (unlike the previous method i used which was a cpu hammer).

What I changed...

  • updated constants.
    created enumeration.
    created new proc to convert a color to fully transparent and set the alpha channel to this (32bit image).
    removed (commented out) dx drawtransparentimage proc.
    updated the static text page proc(s) to use new drawing routines (works in dx9 and opengl with pb 6.*). display + wipes.
    updated the small scroller code to use any bitmap font chosen. swapped out the small bitmap font for 'chunky monkey' atari-st bitmap font (found it after a bit of a scavenger hunt... now i have about ~300 atari-st bitmap fonts to use).
    updated the big scroller code for the new drawing routines (works in dx9 and opengl with pb 6.*)
    swapped out the main logo/background image for a 'screenshot' from yt on the original capture of the cracktro (32px borders kept in).
    adjusted most of the blits to render to sprites, then draw those to screen... since when adjusting screen resolutions, it keeps the scaling proper (unlike drawing directly to screen).
    adjusted all draw sprites to smaller resolution to fit within the new background to give that 'border' effect like the atari-st has.
    numerous other tweaks and code changes (i have certainly learned more from poking around, updating/changing code... so thx).

Attached is my compiled version (PB 6.2.0) to check out.

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 404
  • Karma: 136
    • View Profile
    • KrazyK Remakes
Re: Vectronix GTA cracktro code
« Reply #3 on: September 18, 2026 »
Nice work mate. Good to see another version of this.    :clap:
Could you post your code so I can check out the transparent blit method etc?  I'm always keen to add new routines to my library.
I've moved from 5.73 x86 to 6.41 x64 as my new AtariAudio music library works with x64 so I doubt i'll use OSME now as it was 20+ years old C and would sometime crash out with memory errors.  It served me well though and was great for many years.  AtariAudio adds an additional 300k to the exe compared OSME but I can live with it!
Challenge Trophies Won:

Offline ttemper

  • Amiga 1200
  • ****
  • Posts: 278
  • Karma: 8
    • View Profile
Re: Vectronix GTA cracktro code
« Reply #4 on: September 20, 2026 »
Nice work mate. Good to see another version of this. <- :) albeit the intro fade in/out i skipped over... as i just wanted to test/achieve the inverse blit so that the rasters show through on the text. more learning.

Could you post your code so I can check out the transparent blit method etc?  I'm always keen to add new routines to my library. <- sure, check the google drive, its on there. lmk if its missing anything (and if any other PB fanatics want to check out the code... lmk also). the gist of it is, create a new 32bit image to blit to, load/catch your image then blit it to the new 32bit image, then convert the background of it, eg RGB(0, 0, 0) to RGBA(0, 0, 0, 0). this then allows the drawing mode alpha channel to only blit the alpha values leaving the rest of the image untouched. the image must be 32bit (not 24bit) as it needs to use the alpha channel with the PB drawing modes. therefore... you draw the underneath (eg the moving color rasters) with drawing mode all channels (RGBA), then draw the scroller on top of it with alpha channel only (A)... aka 'cut out' effect. very similar how you do it with dx9 and your transparent blit proc.

I've moved from 5.73 x86 to 6.41 x64 as my new AtariAudio music library works with x64 so I doubt i'll use OSME now as it was 20+ years old C and would sometime crash out with memory <- ahh nice. im still using pb 6.2.0 32bit, since the audio (osme and others) work with it still... as for PB 64bit nope, and PB 6.4.0+ nope. :/ and i dont have the skillset to update/compile my own libraries for use. i did test out bass.dll, and it works, but i dont want an extra .dll floating around (or have it unpack in a temp dir at runtime)... i just want it all packed within the .exe as it has always been and then unpack to memory.

AtariAudio adds an additional 300k to the exe compared OSME but I can live with it! <- ah yeh... so be it i guess. an extra 300k, it is what it is... for the convenience.
« Last Edit: September 20, 2026 by ttemper »

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 404
  • Karma: 136
    • View Profile
    • KrazyK Remakes
Re: Vectronix GTA cracktro code
« Reply #5 on: Today at 10:36 AM »
Thanks for the code ttemper.
For some reason the intro opens in the top left corner of the window at normal size (using pb 5.73) so I had to add these 2 lines to get it to the right size after HideWindow(#WINDOW,#False).
SetWindowState(#WINDOW,#PB_Window_Maximize)
SetWindowState(#WINDOW,#PB_Window_Normal)
I tried with DPI aware on and off.

I like the ConvertImageColorToTransparent() routine.  I may have to add that one to my snippet collection.   ;)  I'll do some comparisons with my old intros soon.

On another note.  I've made the Spiceboys intro a bit smaller after finding the sndh tunes on the Atari-Forum.  I had originally saved as wav then converted to ogg as I couldn't find the tunes.  It works fine on my PC and my crappy old laptop too.

Challenge Trophies Won:

Offline ttemper

  • Amiga 1200
  • ****
  • Posts: 278
  • Karma: 8
    • View Profile
Re: Vectronix GTA cracktro code
« Reply #6 on: Today at 12:35 PM »
Thanks for the code ttemper.

np at all. :)

For some reason the intro opens in the top left corner of the window at normal size (using pb 5.73) so I had to add these 2 lines to get it to the right size after HideWindow(#WINDOW,#False).
SetWindowState(#WINDOW,#PB_Window_Maximize)
SetWindowState(#WINDOW,#PB_Window_Normal)
I tried with DPI aware on and off.

y u do dis? use 6.2.0+ hehe. unsure why it would cause issue with the DPI aware enabled, -shrugs-. least you got it working as intended with the older pb version.

I like the ConvertImageColorToTransparent() routine.  I may have to add that one to my snippet collection.   ;)  I'll do some comparisons with my old intros soon.

yah, it works nicely for those non 32bit images... and especially for those 1bit/8bit images. remove the background (or foreground) in one pass (or two if you have more colors to make transparent). it works well for what i need it to do. 8 bit -> 32 bit, convert color to transparent, done (save image too and use that instead, if you want to save setup at runtime that is).

On another note.  I've made the Spiceboys intro a bit smaller after finding the sndh tunes on the Atari-Forum.  I had originally saved as wav then converted to ogg as I couldn't find the tunes.  It works fine on my PC and my crappy old laptop too.

nice... gotta love tweaking code, im forever learning this demo code stuffs. :P and yeh i grabbed the full .zip files for all the sndh tunes, and am using SndhArchivePlayer_x64 to go through/play them all.