Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

User projects written in or related to FreeBASIC.
Dr_D
Posts: 2345
Joined: May 27, 2005 4:59
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Dr_D » Mar 11, 2016 1:20

That high score thing is pretty cool man. It eliminates some of the more boring programming one has to do when making a game. ;)
Adigun A. Polack
Posts: 230
Joined: May 27, 2005 15:14
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Adigun A. Polack » Mar 27, 2016 4:37

Dr_D, you wrote:That high score thing is pretty cool man. It eliminates some of the more boring programming one has to do when making a game. ;)


I *thoroughly* agree with you, my fantastic man, and you are quite undoubtedly very correct on this one. And I definitely thank you on that excellent compliment, too. ;)

You know what goes great with my Score Ranking routines for AFlib III, Dr_D? The brand-newest Score-Extend routines that award extra lives to any player who reaches certain score plateaus that only get higher and higher as he/she blows through them successfully in a game on a single credit, just like in the arcades non-stop!! And they are all right here for you RIGHT NOW in this very latest new update to AFlib III that I just put out for you on this early Sunday wee-morning, so read on and head back to the very first post of this entire thread to grab yourself a copy of that new version indeed!!! :D

That being said, all the rest of you, I have just now updated AFlib III to v0.89 beta test release for you ever-wonderful ladies and gentlemen right here. And in it, it does feature the new Score-Extend routines indeed that has just now been included in the main “Score Ranking” .bi module of this very FB original game-creation library, quite definitely. ^-^=b Plus, for the image conversion routines, I have also now included my own custom RGB lookup tables in order to fit and adapt to the rest of the featured roster of computer/video-game console palettes right down to each and *every* proper color while seriously optimizing them speed-wise, and here are some more of them now!!!

    • VGA Mode13h Image Conversion:
    Image

    • Relsoft 8-bit Image Conversion:
    Image

    • Adigun Azikiwe Polack 8-bit Image Conversion:
    Image

    • Atari 400/800/XL/XE Image Conversion:
    Image

    • Atari 7800 Image Conversion:
    Image

    • Atari 2600 (NTSC 128-color palette) Image Conversion:
    Image

    • DawnBringer’s 32-color palette (DB32) Image Conversion:
    Image

    • Commodore-64 (c64) 16-color Image Conversion:
    Image

    ...and all the rest of the remaining cast, so to speak, including:

      • Atari 2600 (PAL 104-color palette)
      • Commodore Plus/4 121-color palette
      • Famicom/FDS/NES 56-color palette
      • Arne’s FamiCube 64-color palette
      • Arne’s 16-color palette
      • DawnBringer’s FUN16 palette
      • Intellivision 16-color palette
      • NEC PC-6001/PC-6601 Series palette
      • Commodore VIC-20 palette (both the NTSC and PAL versions!!)
      • MSX/SG-1000/ColecoVision/ADAM palette
      • Sinclair ZX Spectrum palette
      • Apple II/IIc/IIe 16-color palette
      • Aquarius Home Computer 16-color palette

NOW THAT IS QUITE A GRAND LOT if you ask me!!! d=(^-^)=b !!! And to show you just how very plain fast they are indeed in motion that proudly extends to your own retro-based/2d indie game creations and more in FreeBASIC, included now for you in this newest AFlib III update indeed is something downright interesting from me that is called the AFlib III Motion Palette Test, all TOTALLY brand new for you in FB source-code for use in AFlib III v0.89 beta:

Image Image
Image Image



And now, here we go as we dive head-first into the deep and glorious clear waters in the form of yet another all-new AFlib III code snippet (for v0.89 beta or higher)... this time on how to implement you a very simple Score-Extend system of your very own, as well as a custom Score-Counterstop feature on top, too!!! ;)

Code: Select all

#include "AFlib3_Font.bi"
#include "AFlib3_Screen.bi"
#include "AFlib3_Sprite.bi"
#include "AFlib3_Resize2X.bi"
#include "AFlib3_ScoreRanking.bi"
#include "AFlib3_Miscellaneous.bi"

Dim as Double Player1_Score = 0, _
              Player2_Score = 0, _
              HighScore = 7650000

Dim as Double Player1_Lives = 2, _
              Player2_Lives = 2
             
Dim as Integer FlashIndicator_Player    = 0, _
               FlashIndicatorMax_Player = 32

ScreenRes 640, 480, 24

'---------------------------------------------------------------
ScreenLock
AFlibIII_PrepareScreenTrans
AFlibIII_DisplayAllChars 0, 0, rgb(255, 255, 255), rgb(255, 255, 255), 0, 21
AFlibIII_OptimizeFontSet 0, 0, 1
ScreenUnlock
'---------------------------------------------------------------




'============================================================================
' First, we set the score counterstop to 9,999,999,999pts.
'============================================================================
AFlibIII_SetScore_Counterstop 9999999999


'============================================================================
' Next, let's set our custom score-based extend type to where we get our
' first extra life at 3,000,000pts., our second at 8,000,000pts., and then
' another additional one sequentially for every 12,000,000pts. thereafter!!
'============================================================================
AFlibIII_CreateExtend_1st_2nd_then_Every 3000000, _
                                         8000000, _
                                         12000000

'============================================================================
' Now, let's lock in the our new custom score-based extend type with the
' command "AFlibIII_ScrExtendReset_AllPlayers" to begin it all!!!  ^-^=b !!
'============================================================================
AFlibIII_ScrExtendReset_AllPlayers


Do
  ScreenLock
  AFlibIII_ClearDisplay
  Player1_Score += 2370
  Player2_Score += 3690

  If Player1_Score > HighScore then HighScore = Player1_Score
  If Player2_Score > HighScore then HighScore = Player2_Score

  If Player1_Lives > 999 then Player1_Lives = 999
  If Player2_Lives > 999 then Player2_Lives = 999
   
  Player1_Score = AFlibIII_CheckScore_Counterstop(Player1_Score)
  Player2_Score = AFlibIII_CheckScore_Counterstop(Player2_Score)
      HighScore = AFlibIII_CheckScore_Counterstop(HighScore)

  FlashIndicator_Player += 1
  If FlashIndicator_Player > FlashIndicatorMax_Player then FlashIndicator_Player = 0
 
  If FlashIndicator_Player < (FlashIndicatorMax_Player \ 2) then AFlibIII_OptimizedPrint_color "1-UP", 40, 0, 1, 0, RGB(255, 0, 0)
  AFlibIII_OptimizedScoreR_color Player1_Score, (16 - 40), 8, 8, 1, RGB(255, 255, 255)
  AFlibIII_OptimizedPrint_color "REST- " + Ltrim(Str(Player1_Lives)), 16, 20, 1, 0, RGB(255, 255, 0)

  AFlibIII_OptimizedPrint_color "HIGH-SCORE", 120, 0, 1, 0, RGB(255, 0, 0)
  AFlibIII_OptimizedScoreR_color HighScore, (120 - 40), 8, 8, 1, RGB(255, 255, 255)

  If FlashIndicator_Player < (FlashIndicatorMax_Player \ 2) then AFlibIII_OptimizedPrint_color "2-UP", 248, 0, 1, 0, RGB(255, 0, 0)
  AFlibIII_OptimizedScoreR_color Player2_Score, (224 - 40), 8, 8, 1, RGB(255, 255, 255)
  AFlibIII_OptimizedPrint_color "REST- " + Ltrim(Str(Player2_Lives)), 224, 20, 1, 0, RGB(255, 255, 0)

  AFlibIII_OptimizedPrint_color "--- My Simple Score-Extend Test ---", 24, 80, 1, 0, RGB(127, 255, 127)
  AFlibIII_OptimizedPrint_color "(using AFlib III on FreeBASIC!!!)", 32, 88, 1, 0, RGB(63, 127, 63)
 
  AFlibIII_OptimizedPrint_color "1ST EXTENDED PLAY at", 32, 136, 1, 0, RGB(127, 255, 255)
  AFlibIII_OptimizedScoreR_color AF3_ExtendScore_1st, (200 - 40), 136, 8, 1, RGB(255, 255, 255)
  AFlibIII_OptimizedPrint_color "pts.", 256, 144, 1, 0, RGB(127, 255, 255)

  AFlibIII_OptimizedPrint_color "2ND EXTENDED PLAY at", 32, 160, 1, 0, RGB(127, 255, 255)
  AFlibIII_OptimizedScoreR_color AF3_ExtendScore_2nd, (200 - 40), 160, 8, 1, RGB(255, 255, 255)
  AFlibIII_OptimizedPrint_color "pts.", 256, 168, 1, 0, RGB(127, 255, 255)

  AFlibIII_OptimizedPrint_color "and then for every", 48, 184, 1, 0, RGB(127, 255, 255)
  AFlibIII_OptimizedScoreR_color AF3_ExtendScore_Every, (200 - 40), 184, 8, 1, RGB(255, 255, 255)
  AFlibIII_OptimizedPrint_color "pts.", 256, 192, 1, 0, RGB(127, 255, 255)

  AFlibIII_OptimizedPrint_color "CREDIT 0", 232, 232, 1, 0, RGB(255, 255, 255)


  '============================================================================
  ' These next two lines of code are where THE REAL MAGIC begins!!!  :o !!
  '============================================================================
  If AFlibIII_CheckPtsforExtend(Player1_Score, 1) then Player1_Lives += 1
  If AFlibIII_CheckPtsforExtend(Player2_Score, 2) then Player2_Lives += 1
 
 
  '============================================================================
  ' And now, we go ahead and make the viewing of this screen a lot more easier
  ' on the eyes with just one use of "AFlibIII_Resize2X_auto", which only works
  ' in a certain wide variety of 15- to 32-bit color graphics modes!!  ;)
  '============================================================================
  AFlibIII_Resize2X_auto
  ScreenUnlock

  AFlibIII_CustomSync 70
 
Loop until Multikey(&h01) ' <----- [ESC] key exits this program.


AFlibIII_RemoveFontSet 1
AFlibIII_EndProgram

Image

And finally, I have even thrown in TWO (2) very special ASCii-based .BMP image loaders in which they are converted for you to the following paletted formats:

    • DawnBringer’s 32-color palette (DB32)
    • EGA 16-color palette
    • Commodore-64 (c64) 16-color palette
    • Arne’s 16-color palette
    • DawnBringer’s FUN16 palette
    • Intellivision 16-color palette
    • NEC PC-6001/PC-6601 Series palette
    • Commodore VIC-20 palette (both the NTSC and PAL versions!!)
    • MSX/SG-1000/ColecoVision/ADAM palette
    • Sinclair ZX Spectrum palette
    • Apple II/IIc/IIe 16-color palette
    • Aquarius Home Computer 16-color palette
    • CGA 4-color (1st, 2nd, and 3rd palettes with both Low and High Intensities for each of the three!!)
    • Game Boy 4-shaded Natural Greyscale palette
    • Virtual Boy 4-shaded Red-scale palette
    • WonderSwan 8-shaded Greyscale palette
    RGB 8-color (3-bit) palette
    • 16-color Greyscaled Monochrome palette
    • 16-color Green-scaled Monochrome palette

...and here is an example of such right now, as they are successfully loaded in a DawnBringer’s 32-color palette (DB32) format to ASCii characters in FB:

Image Image
Image Image

Be warned though, as some of the ASCii-based conversions can be really messy sometimes. :( Furthermore, if there is an improved Hi-/True-color version of this very .BMP to ASCii loader, please let me know in this thread ASAP, as I would love to feature it in AFlib III for you!! ;)

Enjoy the updates on this newest AFlib III release, and thank you EVER SO VERY MUCH quite handsomely once again!!! d=(^-^)=b !!!
Adigun A. Polack
Posts: 230
Joined: May 27, 2005 15:14
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Adigun A. Polack » Apr 24, 2016 12:29

Okay. Time for yet another brand-new update to AFlib III, and it is v0.90 beta test release as the now-latest current version for you awesome FreeBASIC people, and also for those of you who want to try this lib out in FB indeed. And check back at the very first post of this thread for a download of that latest version for you indeed, as now is QUITE the perfect time for you to do it because take a damn good look at these marvelously awesome truecolor ASCii-based special effects for all 24- to 32-bit color graphics modes that I have just now added in for you like never, *ever* before in FreeBASIC:

Image
Image
Image

These are all ASCii Waterfall, ASCii Flowing Sea, and ASCii Sine Wave, respectively... and they are ALL-NEW for AFlib III on this newest version right here. And each of these new effects can fully support up to 2048x2048 tiles (while the Waterfall and Sine Wave ASCii effects fully support up to as highest as 4096x4096 tiles, which is even better!!!), and yes, even the .BMP ones truly work here, as always!!! ;) !!

As for the “AFlib3_GraphicsFilter.bi” module, I removed the following:

    • AFlibIII_Patchwork
    • AFlibIII_StainedTile
    • AFlibIII_GlassWall
    • AFlibIII_OilPaint
    • AFlibIII_Quilt
    • AFlibIII_glow32
    • AFlibIII_blur32

...since most of them were just too fricking slow at runtime ( :( ), anyways. In their place, I added the following:

    • AFlibIII_CrossHatch
    • AFlibIII_IrisShot
    (supports full alpha translucency!)
    • AFlibIII_IrisShot_add
    (supports full additive blending!)
    • AFlibIII_RectanglePeek
    (supports full alpha translucency!)
    • AFlibIII_RectanglePeek_add
    (supports full additive blending!)

And on the “AFlib3_ASCii.bi” module, to clarify, I added in the following:

    • AFlibIII_ASCii_Mode7_bottom
    • AFlibIII_ASCii_Mode7_top
    • AFlibIII_ASCii_Waterfall
    • AFlibIII_ASCII_FlowingSea_bottom
    • AFlibIII_ASCII_FlowingSea_top
    • AFlibIII_ASCii_TiledSineWave
    • AFlibIII_ASCii_SphereMap
    • AFlibIII_ASCii_Plasma
    • AFlibIII_ASCii_Liquefy
    • AFlibIII_ASCii_FlowingLiquid_2D

...and added in the special .BMP loaders to be converted to true ASCii format (where only the first 128 custom-made colors out of 256 in any 8-bit palette file of either just 768 bytes or from Jasc Paint Shop Pro can be fully loaded in to fit with any specific .BMP picture of your choice on this, so far):

    • AFlibIII_24bit_LoadBMP_to_DOS768pal_ASCii
    • AFlibIII_24bit_LoadBMP_to_768pal_ASCii
    • AFlibIII_24bit_LoadBMP_to_PaintShopPro_ASCii

Also, remember I said in my previous post (just before this current one!) where I have mentioned about an improved Hi-/True-color version of this very .BMP to ASCii loader, hmmm? Well quite amazingly rather enough, ladies and gents, I JUST PROGRAMMED ONE myself for all of you to truly enjoy... as it is fully accurate to the 8x8-dot ASCii-character grid matrix, all in rich truecolor ASCii-graphics modes in 24-bit and 32-bit color depths!!! The newest command for you to use to make this kind of newest magic happen in AFlib III is:

    • AFlibIII_24bit_LoadBMP_to_TrueColor_ASCii

Take a grand gander at the following example here that uses my very own custom-made snapshot of the University of the Arts building at night in Philadelphia, PA, USA that I took a picture of back in late 2008 with a digital camera myself:

Image

...and with “AFlibIII_24bit_LoadBMP_to_TrueColor_ASCii”, the fun truly, truly begins right here as these next examples show:

Image
Image
Image

Supporting all 24- to 32-bit color graphics modes only, this new truecolor-based ASCii command is preliminary so far, but what I have here is pretty darned impressive indeed for the most part so far, at least. So, not even half bad at all if you ask me now!!! (^-^)=b !!

Furthermore and even better news on top of all of this so far in this newest AFlib III comes this: in the “AFlib3_Sprite.bi” module, I very newly updated the command “AFlibIII_TiledSineWave” just now to add full custom buffer support, since my previous versions of this command in AFlib III did not have this. Ever. Also, I have now added in the command “AFlibIII_FlowingLiquid_2D” as the *very* newest addition to the special graphics effects roster to help make this game-creation lib the mega-powerhouse in FreeBASIC that it truly plain is.

On top of that, I have dramatically quite improved the support and custom-buffer stability of all of the special graphical effects, including the Flowing Sea effect, which now looks a whole lot damn better and tons more exciting than ever before:

Image
Image

You know what else? I have fully and most enthusiastically raised the maximum number of captured screens you can store into memory from 128 to an monstrously plain staggering 512 SCREENS at once!!! Prepare to have your jaw drop past the floor upon seeing this in action, like in this newest example right here that I will show you to see that I am absolutely not even lying at all here:

Image

And finally, I have increased the amount of included built-in 8x8 fonts in this FreeBASIC game creation library from 36 to an ultimate grand total of a mega-whopping 40, which is quite more than enough for anybody, I should well say!!! ;) Here are the four new fonts indeed that are pixelled and created by me, Adigun Azikiwe Polack:

    • Japanese Bit-Kana
    Image

    • Destino Slim
    Image

    • Paro-Fantasique
    Image

    • Bios IV Custom
    Image

...and they are indeed included in the lib itself now, just to *really* help you tremendously in your next great FB game project, be it shmup, hard-as-razor-sharp-nails arcade 2d platformer, metroidvania, RPG, puzzle, maze, arcade racer, run-and-gunner, belt-scrolling brawler, or whatever strikes your very fancy when it comes to game development!!!

With all of that and more, please enjoy even this updated newest version today of my AFlib III... all for you. THANK YOU ALL EVER SO MUCH once again most, most rather splendidly!!! (^_~)v !!!
h4tt3n
Posts: 644
Joined: Oct 22, 2005 21:12
Location: Denmark

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby h4tt3n » Apr 24, 2016 13:34

Hi there, this looks very interesting, but I'm having a bit of trouble.

I downloaded the package from the first post and tried to compile some of the .bas files, but no matter what I pick freebasic (1.05) crashes. Afterwards, a c source file of the same name has appeared in the folder. Am I doing something wrong here?

Cheers, Mike
Adigun A. Polack
Posts: 230
Joined: May 27, 2005 15:14
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Adigun A. Polack » Apr 24, 2016 17:47

Why hello and cheers to you too, h4tt3n, and really quite nice to see you handsomely indeed. :D

Your question to me just now was this:

I downloaded the package from the first post and tried to compile some of the .bas files, but no matter what I pick freebasic (1.05) crashes. Afterwards, a c source file of the same name has appeared in the folder. Am I doing something wrong here?


Are you using the 64-bit edition of FreeBasic? If so, then that was the major trouble, as when I have tested that very edition of FreeBASIC not too long ago with AFlib III, it crashed indeed upon compile of the many .bas source codes here, regardless of the version you used. And so, my personal recommendation that I am so happy to share with you is this: get the 32-bit version of FreeBASIC and use that instead (current version at the time of writing, as you just said, is v1.05 32-bit that you can download for Windows right here: ZIP and installer formats, by the way). Because when I have compiled the examples myself using that 32-bit edition on which I first built the lib from the ground up, it fully worked 100% and the examples were off and running. Be sure to try it with the 32-bit edition of the current version of FB for Windows indeed and see if it works much better for you.

Let me know then how it turns out, and thank you so very much for the fine question!! ^-^
MrSwiss
Posts: 2020
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby MrSwiss » Apr 24, 2016 18:15

Adigun A. Polack wrote:... the 32-bit version of FreeBASIC and use that instead ...
Excuse me, but are you still living in the Second Millenium?

Nowadays 64 bit is Standard (on every NEW PC sold). My Advice to you would be:
code your Lib in a compatible way, for both compiler versions.

BTW. You don't need to use your Marketing Slang, when answering ... (I won't buy any of it, ever!).
Adigun A. Polack
Posts: 230
Joined: May 27, 2005 15:14
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Adigun A. Polack » Apr 24, 2016 19:33

MrSwiss, you wrote:
Adigun A. Polack wrote:... the 32-bit version of FreeBASIC and use that instead ...
Excuse me, but are you still living in the Second Millenium?

Nowadays 64 bit is Standard (on every NEW PC sold). My Advice to you would be:
code your Lib in a compatible way, for both compiler versions.

BTW. You don't need to use your Marketing Slang, when answering ... (I won't buy any of it, ever!).


I am so *very* sorry on purpose for being quite rude on my last reply. I did not know that that was what I doing. :*( That is the serious trouble with me not having a chance of being around these forums for eight straight years... I have been quite way, way plain behind on the times. Still, MrSwiss and h4tt3n, I am very quite genuinely sorry from the heart for my own rashness on that there indeed, and next time, I will try to answer your question a whole lot better and with more straight-up honest sincerity. No more marketing mumbo-jumbo from me, as that was not even necessary for me to do at all. Again, I did not know.

Please forgive me.

Currently, I do not know how to translate AFlib III from the 32-bit version of FB to the 64-bit one. Could you please help me on getting some pointers on how to do it down pat, just to get me started? All I have been using is the 32-bit version of FreeBASIC, as far as I know how.

Thank you again for your understanding and patience.
srvaldez
Posts: 1354
Joined: Sep 25, 2005 21:54

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby srvaldez » Apr 24, 2016 20:12

hello Adigun A. Polack
thank you for this amazing work you are doing :)
one thing that can cause problems in making code compatible with 64-bit is the use of Integer, it's 32-bit on FB-32 but 64-bit on FB-64
if you want a 32-bit integer then use Long.
h4tt3n
Posts: 644
Joined: Oct 22, 2005 21:12
Location: Denmark

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby h4tt3n » Apr 24, 2016 20:24

Adigun A. Polack wrote: Still, MrSwiss and h4tt3n, I am very quite genuinely sorry from the heart for my own rashness on that there indeed, and next time, I will try to answer your question a whole lot better and with more straight-up honest sincerity. No more marketing mumbo-jumbo from me, as that was not even necessary for me to do at all. Again, I did not know.

Please forgive me.


No need for any of this, Adigun. Take it easy now, you're among friends and fellow nerds here :-) And I must agree with srvaldez that your work looks really amazing. I hope you'll get around to make this 64 bit compatible.

Cheers, Mike
MrSwiss
Posts: 2020
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby MrSwiss » Apr 25, 2016 13:48

Well, converting to 64bit's is not going to be that easy, because of ASM use, as follows:

Code: Select all

Function AFlibIII_DetectCPUmhz as UlongInt

'----------------------------------------------------------------------
' Special thanks to D.J.Peters for this fine CPU detection routine!!
'----------------------------------------------------------------------

  Dim As UlongInt start64,diff64
  Dim As Double starttimer=Timer
  ASM
    rdtsc
    mov dword Ptr [start64], eax
    mov dword Ptr [start64+4], edx
  End ASM
  While (timer-starttimer)<1.0:Wend
  ASM
    rdtsc
    mov ebx, eax
    mov eax, edx
    sub ebx, dword Ptr [start64]
    sbb eax, dword Ptr [start64+4]
    mov dword Ptr [diff64], ebx
    mov dword Ptr [diff64+4], eax
  End ASM
  Return diff64\1000000

End Function
This is clearly 32 bit ASM, and therefore NOT 64 bit compatible.
dkl
Site Admin
Posts: 3166
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby dkl » Apr 25, 2016 17:52

Couldn't it work? I mean, x86_64 still lets you use the 32bit registers, and if rdtsc is still compatible with that, it should work, I think.
MrSwiss
Posts: 2020
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby MrSwiss » Apr 25, 2016 18:00

dkl wrote:Couldn't it work? I mean, x86_64 still lets you use the 32bit registers
That's correct but:
the naming of the registers has changed, EAX - 32bit, RAD - 32bit (RAX - DoubleWord) ...
I think the only way (to stay cross compatible) would be "conditional compile options" settings.
Adigun A. Polack
Posts: 230
Joined: May 27, 2005 15:14
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Adigun A. Polack » May 05, 2016 6:26

Okay, everybody. You truly wanted the 64-bit version called AFlib III to happen from me... and you got it ( ^-^=b !! ), because here comes a most splendidly important little update to my original FB game-creation lib, available right now for you to download at once with absolutely NO viruses period as always right here:


Image

This critically vital update to this lib of mine not only extends full support to the 64-bit version of FreeBASIC in addition to the 32-bit one, but just about all of the commands in AFlib III are as quite handsomely faithful as ever between the 32- and 64-bit versions of FB, to really help you port your newly-created game effortlessly between 32-bit and 64-bit directly in Windows with just about no trouble whatsoever!! How does that sound? ;)

The trick to ensuring cross-compatibility between the 32-bit and 64-bit versions of FB is that I have now included the “Launch_AFlib3.bi” module file in the entire update package of AFlib III. You may suit and tailor it to your own needs when it comes to using only the exact modules you need between both the 32- and 64-bit versions so that, when you finally add “Launch_AFlib3.bi” to the start of your FB programs in Windows, all of your selected AFlib III game-library modules from within “Launch_AFlib3.bi” indeed will have already been added automatically... all for your generous convenience!!! That should make a ton of sense in an awesome way, I am sure!!! ;*)

Over quite the past 10 straight days just now — and with TONS of serious trial and error as well — I have thoroughly tested, rethought, well-revised, and tested again this whole entire lib to make sure your games, demos, and other programs that you create using AFlib III is entirely compatible so easily between the 32-bit and 64-bit versions of FreeBASIC indeed. It took me most definitely some major, major doing to get there... and since this is indeed my very, very first time using FB 64-bit in having to convert and translate my entire lib in such a way as to fully support it all the way around from commencement to conclusion, I just hope that I have done you proud with what I came up with here.

Having just now said all of that, please be sure to try this VERY newest version of AFlib III out on the latest version of FreeBASIC 64-bit on Windows in addition with the latest version of FreeBASIC 32-bit as well, in addition to the .BAS source-code examples that are included in the lib that you are especially welcome to test out on FB 64-bit v1.02 or higher, also. You will be truly amazed in a real good way, I promise. ^^

Please let me know how well this new version of AFilb III works for you, and thank you ever so much once more as you continue to enjoy it!!!



P.S. I personally and *fully* dedicate this AFlib III update quite very handsomely to both MrSwiss and h4tt3n, whom I SPLENDIDLY thank for helping me to make the dream of my whole 2D truecolor game-creation lib right here in 64-bit a huge, huge reality. Major cheers definitely to the both of them indeed!!! (^_~)v !!!
MrSwiss
Posts: 2020
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby MrSwiss » May 05, 2016 12:00

Adigun A. Polack wrote:You truly wanted the 64-bit version called AFlib III to happen from me... and you got it

My compliments on managing that Conversion, on such short notice: brilliant!
I've picked one of your examples, "randomly" I might add, and simply "hammered" it through FBC 1.05.0 (both 32/64),
for a quick test (OS-WIN 8.1 - 64), on both counts success!

Unfortunately my "pick" showed a flaw, it simply did not want to run (until I've checked the Code, that is).
I've used: AF3_BMPload_to_Truecolor_ASCii.bas

You are using Command(1) to get the "BMP_File_Name" String, but if there is NONE, the prog. simply quits.
This is considered "bad" behaviour because: the user isn't even given a clue to "what's wrong".
Since most users nowadays simply click an *.exe and expect it to run, Cmd-Line Start isn't even considered!
(I've straight away, fell into this Trap!)

After a little modification it runs as expected. (just added a "default" bmp to load)

I'm only posting the modified and commented parts here (at the very top of prog.):

Code: Select all

BMPfile = Command(1)   ' get BMP-Name from Command-Line

' if user simply clicks the *.exe, supply a "DEFAULT_BMP_NAME"
If BMPfile = "" Then BMPfile = "AF3_PaletteEGA_20.bmp"
' added, 5/5/2016, by MrSwiss (+ all Comments)

If not AFlibIII_CheckFile (BMPfile) then AFlibIII_EndProgram    ' used to quit here quietly: bad
Adigun A. Polack
Posts: 230
Joined: May 27, 2005 15:14
Contact:

Re: Welcome to my newest 2D Truecolor Game Lib in FB: AFlib III.

Postby Adigun A. Polack » May 06, 2016 1:47

MrSwiss just excellently said this to me and so proudly wrote:
Adigun A. Polack wrote:You truly wanted the 64-bit version called AFlib III to happen from me... and you got it

My compliments on managing that Conversion, on such short notice: brilliant!


Why THANKS a ton indeed for that outstanding comment about the newest version of AFlib III ( ^-^=b !! )... that simply means an enormous lot to me in quite a superbly plain wonderful way, MrSwiss, as I am truly very ecstatic that it fully and seriously works on both the 32- and 64-bit editions of FreeBASIC indeed just as it surely should in the first place!!! That means, even more and more FB users like you and quite very many others in our entire own FreeBASIC community will now definitely have a sure guaranteed shot at enjoying this all-new 64-bit conversion of my own original game-creation library indeed as well as — like I said from my last post — easy compatibility between 32-bit and 64-bit when it comes to our own FB programs that use AFlib III. To illustrate this now, here is an example for you of how it all works between the 32-bit and 64-bit editions of FB using this lib, as the following program example that I had once displayed earlier in this thread is now fully updated to work with them both, between 32- and 64-bit:

Code: Select all

'-------------------------------------------------------------------------------
' NOTE: This FB code snippet requires AFlib III v0.90.1 or higher to run!!  ;)
'-------------------------------------------------------------------------------

#ifdef __FB_64BIT__
  #include "AFlib3_64bit_Palette.bi"
  #include "AFlib3_64bit_Sprite.bi"
  #include "AFlib3_64bit_Miscellaneous.bi"
#else
  #include "AFlib3_Palette.bi"
  #include "AFlib3_Sprite.bi"
  #include "AFlib3_Miscellaneous.bi"
#endif

Dim as Integer ImgConversionType
Dim as String  BMPfile
Dim as Integer BMPsize_x, BMPsize_y


BMPfile = "AF3_ColConv_TestPic_02.bmp"  ' <--- Place any .BMP filename you want right here!!  ;)

ImgConversionType = 0  ' <---------- Pass '0'  for an RGB 4,096-color (12-bit) Conversion;
                       '                  '1'  for an RGB 512-color (9-bit) Conversion;
                       '                  '2'  for the VGA Mode13h Palette Conversion;
                       '                  '3'  for a Relsoft Palette Conversion;
                       '                  '4'  for the Adigun Azikiwe Polack 8-bit Palette Conversion;
                       '                  '5'  for an Atari 400/800/XL/XE Palette Conversion;
                       '                  '6'  for an Atari 7800 Palette Conversion;
                       '                  '7'  for an Enterprise Home Computer 256-color Conversion;
                       '                  '8'  for an Atari 2600 Palette (NTSC ver.) 128-color Conversion;
                       '                  '9'  for an Atari 2600 Palette (PAL ver.) 104-color Conversion;
                       '                  '10' for a Commodore Plus/4 121-color Conversion;
                       '                  '11' for a SAM COUPE 128-color Conversion;
                       '                  '12' for a Master System/Mark III 64-color Conversion;
                       '                  '13' for an FC/FDS/NES Palette 56-color Conversion;
                       '                  '14' for a FamiCube 64-color Conversion;
                       '                  '15' for a DawnBringer's 32-color Palette Conversion;
                       '                  '16' for an Amstrad CPC 27-color Conversion;
                       '                  '17' for an EGA 16-color Conversion;
                       '                  '18' for a Commodore-64 16-color Conversion;
                       '                  '19' for an Arne's 16-color Palette Conversion;
                       '                  '20' for a DawnBringer's FUN16 Palette Conversion;
                       '                  '21' for an Intellivision 16-color Conversion;
                       '                  '22' for an NEC PC-6001/PC-6601 Series Palette Conversion;
                       '                  '23' for a Commodore VIC-20 Palette (NTSC ver.) 16-color Conversion;
                       '                  '24' for a Commodore VIC-20 Palette (PAL ver.) 16-color Conversion;
                       '                  '25' for an MSX/SG-1000/ColecoVision/ADAM and TI-99/4a 16-color Conversion;
                       '                  '26' for a Sinclair ZX Spectrum 16-color Conversion;
                       '                  '27' for an Apple II/IIc/IIe 16-color Conversion;
                       '                  '28' for an Aquarius Home Computer 16-color Conversion;
                       '                  '29' for an RGB 8-color (3-bit) Conversion;
                       '                  '30' for a CGA 4-color Palette (1st palette; Normal);
                       '                  '31' for a CGA 4-color Palette (1st palette; High Intensity);
                       '                  '32' for a CGA 4-color Palette (2nd palette; Normal);
                       '                  '33' for a CGA 4-color Palette (2nd palette; High Intensity);
                       '                  '34' for a CGA 4-color Palette (3rd palette; Normal);
                       '                  '35' for a CGA 4-color Palette (3rd palette; High Intensity);
                       '                  '36' for a Game Boy 4-shaded Natural Greyscale Conversion;
                       '                  '37' for a Virtual Boy 4-shaded Red-scale Conversion; or
                       '                  '38' for a WonderSwan 8-shaded Greyscale Conversion.
                       
BMPsize_x = AFlibIII_checkBMPsize_x(BMPfile)
BMPsize_y = AFlibIII_checkBMPsize_y(BMPfile)
If BMPsize_x < 1 or BMPsize_y < 1 then AFlibIII_EndProgram

ScreenRes BMPsize_x, BMPsize_y, 24, , 0
Bload BMPfile

WindowTitle "AFlib III -- Press any Key..."

Sleep
 
Select Case ImgConversionType
  Case is < 1: AFlibIII_ConvertImage_RGB4096
  Case  1: AFlibIII_ConvertImage_RGB512
  Case  2: AFlibIII_ConvertImage_VGA
  Case  3: AFlibIII_ConvertImage_REL
  Case  4: AFlibIII_ConvertImage_AAP
  Case  5: AFlibIII_ConvertImage_ATARI
  Case  6: AFlibIII_ConvertImage_ATARI7800
  Case  7: AFlibIII_ConvertImage_ENTERPRISE
  Case  8: AFlibIII_ConvertImage_ATARI2600
  Case  9: AFlibIII_ConvertImage_PAL2600
  Case 10: AFlibIII_ConvertImage_PLUS4
  Case 11: AFlibIII_ConvertImage_SAMCOUPE
  Case 12: AFlibIII_ConvertImage_SMS
  Case 13: AFlibIII_ConvertImage_NES
  Case 14: AFlibIII_ConvertImage_FCUBE
  Case 15: AFlibIII_ConvertImage_DB32
  Case 16: AFlibIII_ConvertImage_CPC
  Case 17: AFlibIII_ConvertImage_EGA
  Case 18: AFlibIII_ConvertImage_C64
  Case 19: AFlibIII_ConvertImage_ARNE
  Case 20: AFlibIII_ConvertImage_FUN16
  Case 21: AFlibIII_ConvertImage_INTV
  Case 22: AFlibIII_ConvertImage_PC6001
  Case 23: AFlibIII_ConvertImage_VIC20_NTSC
  Case 24: AFlibIII_ConvertImage_VIC20_PAL
  Case 25: AFlibIII_ConvertImage_MSX
  Case 26: AFlibIII_ConvertImage_ZX
  Case 27: AFlibIII_ConvertImage_APPLEII
  Case 28: AFlibIII_ConvertImage_AQUAR
  Case 29: AFlibIII_ConvertImage_RGB8
  Case 30: AFlibIII_ConvertImage_CGA , 0
  Case 31: AFlibIII_ConvertImage_CGA , 1
  Case 32: AFlibIII_ConvertImage_CGA , 2
  Case 33: AFlibIII_ConvertImage_CGA , 3
  Case 34: AFlibIII_ConvertImage_CGA , 4
  Case 35: AFlibIII_ConvertImage_CGA , 5
  Case 36: AFlibIII_ConvertImage_GB
  Case 37: AFlibIII_ConvertImage_VB
  Case is > 37: AFlibIII_ConvertImage_WS
End Select
 
WindowTitle "AFlib III -- Image Color Conversion Complete!!!"
Sleep

AFlibIII_EndProgram


Speaking of that updated program example that I put in just right now in this post, MrSwiss, you also wrote to me this:

I've picked one of your examples, "randomly" I might add, and simply "hammered" it through FBC 1.05.0 (both 32/64),
for a quick test (OS-WIN 8.1 - 64), on both counts success!

Unfortunately my "pick" showed a flaw, it simply did not want to run (until I've checked the Code, that is).
I've used: AF3_BMPload_to_Truecolor_ASCii.bas

You are using Command(1) to get the "BMP_File_Name" String, but if there is NONE, the prog. simply quits.
This is considered "bad" behaviour because: the user isn't even given a clue to "what's wrong".
Since most users nowadays simply click an *.exe and expect it to run, Cmd-Line Start isn't even considered!
(I've straight away, fell into this Trap!)

After a little modification it runs as expected. (just added a "default" bmp to load)

I'm only posting the modified and commented parts here (at the very top of prog.):

Code: Select all

BMPfile = Command(1)   ' get BMP-Name from Command-Line

' if user simply clicks the *.exe, supply a "DEFAULT_BMP_NAME"
If BMPfile = "" Then BMPfile = "AF3_PaletteEGA_20.bmp"
' added, 5/5/2016, by MrSwiss (+ all Comments)

If not AFlibIII_CheckFile (BMPfile) then AFlibIII_EndProgram    ' used to quit here quietly: bad


Ahhhhh, I clearly see what you mean here... I did not quite know about that one, too. I gotta remember to jot all of that down in my own FB code examples in AFlib III that illustrate upon what you just now said about files like “AF3_BMPload_to_Truecolor_ASCii.bas”, as you are most *exactly* correct 100% on literally everything you said from your reply to me from just several hours ago. There are still quite some things I gotta learn about FreeBASIC, even after my first 12 years of using it all the time. You know what I mean? ;*)

Thank you EVER so splendidly, splendidly much again for the seriously awesome comment, MrSwiss, and I hope this definitely inspires quite a whole lot of others to get so very excited overall about using AFlib III for both the 32-bit and 64-bit versions of FreeBASIC. I just wanted from the bottom of my heart to open up a lot more to you and others as I broaden and expand my horizons when it comes to full accessibility that you and I are most honestly talking about regarding my own 2d truecolor game-creation lib here indeed, so to speak. :D

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 5 guests