flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 22 Apr 2018, 10:46
This is a very simple groundwork for a game that I've been making a few years ago with my friends, purely for fun. As it has been abandoned then, they gave me a permission to share it and now I release this code as a public domain.
It was originally created with fasm 1 and later converted to fasmg. But a few minor tweaks should suffice to make it assemble with fasm 1 once more. Assembling it with fasmg requires the fasm 1 compatibility macros. It uses 32-bit SDL2 library. For Windows the required DLLs are included, on Linux 32-bit version of libSDL2 needs to be installed with all components. You may notice that it shares some similarities with my much older engine for DOS, except this one has been abandoned at even earlier stage. There are no "lemmings" to decimate here, they were never added. The player is left with nothing more than punching and kicking the air. To start the game, a .DEF file needs to be provided as an argument from command line or by dropping the file onto the program. There are two .DEF files included.
|
|||||||||||
![]() |
|
yeohhs 22 Apr 2018, 12:48
![]() |
|||
![]() |
|
Picnic 17 Aug 2018, 08:26
Nice to sharing the source Tomasz.
The road.def level looks like the 2nd level of the game Bad Dudes Vs. DragonNinja, very cool ![]() ![]() ![]() |
|||
![]() |
|
TheRaven 09 Mar 2019, 08:06
I do remember Bad Dudes --played many Data East and SNK rumblers & shmups.
Didn't think T.G. had the Fist of the North Star in him -nice. |
|||
![]() |
|
Mat Quasar 07 Feb 2025, 12:36
Tomasz Grysztar wrote: It was originally created with fasm 1 and later converted to fasmg. But a few minor tweaks should suffice to make it assemble with fasm 1 once more. Hi, I am using the SDL2 files and Tomasz's game as reference to do my graphical version of space invader game. But I am using fasm 1, and have near to zero knowledge in macro. May I know how to make the following line works with fasm 1? Code: struc SDL_DEFINE_PIXELFORMAT type,order,layout,bits,bytes . = 1 shl 28 or (type) shl 24 or (order) shl 20 or (layout) shl 16 or (bits) shl 8 or (bytes) end struc FASMW.EXE wrote: Error: unexpected character Please help.... I may need more help as I go through the source code. Thanks! ![]() |
|||
![]() |
|
macomics 07 Feb 2025, 13:20
It declares a dword with the following content 0001ttttoooollllyyyyyyyyxxxxxxxxb t - type, o - order, l - layout, y - bits, x - bytes b - binary suffix for number
Code: ; fasm1 struc SDL_DEFINE_PIXELFORMAT type=0,order=0,layout=0,bits=0,bytes=0 { label . dword .bytes db bytes .bits db bits .layout_and_order db ((order) shl 4) or (layout) .type db 0x10 or (type) } Last edited by macomics on 07 Feb 2025, 14:09; edited 1 time in total |
|||
![]() |
|
Mat Quasar 07 Feb 2025, 13:36
macomics wrote: It declares a dword with the following content 0001ttttoooollllyyyyyyyyxxxxxxxxb t - type, o - order, l - layout, y - bits, x - bytes b - binary suffix for number Thanks @macomics, now I have another error, not sure if related or not related to the macro above: Code: SDL_PIXELFORMAT_INDEX1LSB \ SDL_DEFINE_PIXELFORMAT SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, \ 1, 0 Error in the screenshot, please see.
|
||||||||||
![]() |
|
Mat Quasar 07 Feb 2025, 13:56
Please ignore the post above. Problem solved....because of small typo:
Code: SLD_DEFINE_PIXELFORMAT ...should be SDL_XXXXX. Thank you , @macomics! |
|||
![]() |
|
macomics 07 Feb 2025, 14:17
Code: ; fasm1 struc SDL_DEFINE_PIXELFORMAT type=0,order=0,layout=0,bits=0,bytes=0 { . = (1 shl 28) or (((type) and 15) shl 24) or (((order) and 15) shl 20) or \ (((layout) and 15) shl 16) or (((bits) and 255) shl 8) or \ ((bytes) and 255) } |
|||
![]() |
|
Mat Quasar 07 Feb 2025, 14:31
macomics wrote:
Thanks for your improvement. I am not able to run Tomasz's game yet on fasm 1, but compile error-free on my new game code (with your modified macro) - I may eventually run into fasmg-to-fasm1 error again as I add more code from Tomasz's example to my game code. |
|||
![]() |
|
sylware 08 Feb 2025, 15:58
wowowow, guys libSDL3 is getting close to release, you better jump on the wagon because I can tell you, that's not going to be a small API breakage. (dota2 and cs2 have been using libSDL3 for more than a year)
|
|||
![]() |
|
Ali.Z 08 Feb 2025, 22:12
sylware wrote: (dota2 and cs2 have been using libSDL3 for more than a year) valve has their own internal version of sdl, and it is different. _________________ Asm For Wise Humans |
|||
![]() |
|
sylware 09 Feb 2025, 18:13
dota2 and cs2 libSDL3 is the official libSDL3, with some lag.
I know because I did fix linux alsa support in libSDL3 (severely broken). Icculus said he will do the merge. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.