Forum > Games

Pascal Fantasy Console

(1/1)

x2nie:
Hi everyone !


I just landed into fantasy console world,
and meet to say Pico-8, LIKO-12, Picolove, Neko8, Tic-computer, Pixel Vison 8, and many more ..
it's quite mind blowing while playing with small screen & big pixels.
A lot of them is FOSS; but, I wonder that none of them is written in pascal yet. :o
(at least I didn't found any)


And, hey, isn't freepascal/lazarus a perfect tool to build such one?
Lazarus already able to compile for most platform (including android & raspi) and machines (x86,arm,etc)
no need specific VM,
and luckily: there are many scripting language for lazarus like (pascalscript, python, php, lua, javascript?)
 :o


So maybe let start discussion about it,
I think it would be a lot of fun if we could write one. 




hmm....
(if there was no any fantasy console written in freepascal/lazarus)
maybe the spec is something like this:
* There are 3 area to develop: Game Player. Game Cassette (the game), Game Editor.
* Game Player is an application built with lazarus, in which the game is running on it
* Game Cassette is a file contained anything (sprites, tilemap, script) to run the game
* Game Editor is an application to develop a game cassette, such as writing script, drawing sprites etc.
well,
since using Lazarus gives us rich of options, the possibility is then open to us to provide much implemented application. Let say, someone may create Game Player part using LCL, while other might use MSE, fpGUI,  dedicated android, or targeting arduino, or export as web, or terminal/text console; who knows?
You can add advanced technology like openGL, OpenAudioLib, SDL, SSE-aware, unimagined tech, etc.
So,
obviously the cassette format should be portable (just like as fantasy console game file in common)
if we want all game player variant able to run many games.
Yeah, you guessed it that the game is in a text format, additionally can be converted into png file.


That is said, game editor can be your favorite text editor, or a specific-purpose application written in lazarus (as you might guess) for drawing sprites, making sounds, music and editing game source code, of course.
-------------------


Nah, what you are saying now?
Let's start discussing  ;D 8-) :P

Ñuño_Martínez:
That would be great.

Unfortunately I have a ton of projects so I can help (now), but you can use Allegro.pas so that would be like I helped...  ;D

x2nie:
Hi Ñuño_Martínez  ;D


Yeah, Allegro5-pas is awesome. I have played with it for several days.
and currently my fantasy console can play this game cassette:



--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---lite8 https://github.com/lite8 ver. 0.1  __script__.pasprogram HelloWorld02;  var  x,y: integer;procedure _init();begin  x:=64;  y:=64;end;   procedure _update();begin    if btn(0) then X := X - 1;    if btn(1) then X := X + 1;      if btn(2) then Y := Y - 1;    if btn(3) then Y := Y + 1;                    { if btn(10) then dec(Y,5); //pgup }    { if btn(11) then inc(Y,5); }            if btn(12) then dec(Y);         if btn(13) then inc(Y);end;    procedure _draw();begin  cls(1);  color(7);  //al_put_pixel (x, y, Red);  pset(x,y,9); //   print('halo');  { print('world',30,8); }  //-1//   print     (  ' hey',8,8);  //0//   print(        // 'yolayhey',16,16); print('fooh!');  //a  print('Hello',30,64, 11);  //b  print('World !');  //c  spr(0, x,y);end;   beginend.  __palette__later..0|ff8800a|aabbccf|0088ff  __sprite__0044444000444440000000000000000000eeeee000eeeee000000000000000000ef75f500ef75f5000000000000000000efffff00efff8f00000000000000000000ee00000eeee00000000000000000000eeee000f0ee0f000000000000000000f0e40f00f0e40f0000000000000000000e0040000e004000000000000000000000444440004444400044444000444440eeeeeee0e0eeeeee00eeeeee0eeeeeee00ff75fe0eff75f0eeff75f0e0ff75f000ffff8000ffff8000ffff8000ffff80feee0000feee0000feee0000feee000000ee000000ee000000ee000000ee0000ee0400000e400000440e000004e00000000400000e400000000e000004e000000044444e0044444000000000000000000eeeeee0eeeeeee04444400000000000e0ff75f000ff75f0eeeee0000000000e00ffff8000ffff8ef75f5000000000000eee0000000eee0efff8f00000000000f0ee0000000ee0f00eeeef000000000004e000000000e400f0ee4000000000004e00000000000e40000ee4400000000    __maptile__0123456789...256later..  __sound__later..  __music__later.. 


The pascal code above is executed via custom pascal-script (to work around "overload" procedure/function).
It was lot of fun developing this project. In future I may develop similar framework using other backend like ZenGL, Libreto-FPC, msegui, oh... there are tons of option to work with, actually;
each of them will able to run game cassette like above  ;D




Now,  Ñuño_Martínez, my question: how to create 4bit / 16 palette bitmap with Allegro5.pas ?
I was searching, but allegro c/c++ was not support 4bit bitmap. any solution?

Ñuño_Martínez:
Looks great!  Good job.


--- Quote from: x2nie on November 08, 2020, 01:40:04 pm ---Now,  Ñuño_Martínez, my question: how to create 4bit / 16 palette bitmap with Allegro5.pas ?
I was searching, but allegro c/c++ was not support 4bit bitmap. any solution?

--- End quote ---
I theory you can write a sort of driver to support such bitmaps, but in Allegro5 is quite annoying since it uses GLSL & HLSL for final rendering and, as far as I know, internal API isn't as strightforward than Allegro4.

You can try a workaround: example ex_palette.pas shows how to fake 8bpp/256colour palette modes.  May be you can do something to convert the 4bit bitmap in to 8bit bitmaps.

Actually I want 8bpp/256 color palette for my game engine and I'm considering the possibility to build my very own game library supporting old-school stuff like that (8bpp graphic, MIDI sound, etc) in modern (and old) architectures.  But first I must finish a game for a customer.

Navigation

[0] Message Index

Go to full version