Search found 822 matches

by Zamaster
Feb 12, 2019 23:48
Forum: Community Discussion
Topic: "A Love Letter To FreeBASIC" Game Dev Competition (Oct 2018 – Feb 2019), 1000 $ 1st prize
Replies: 360
Views: 17788

Re: "A Love Letter To FreeBASIC" Game Dev Competition (Oct 2018 – Feb 2019), 1000 $ 1st prize

The Secret Gallery https://drive.google.com/file/d/1mfyQ4j0D5EILLbdyicHFGULBT5Kp4xu3/view Hi folks! Sorry about the technical difficulties, above is a version compiled that should work on machines that were having trouble running the game before. Oh and if you don't like reading the hints in game: ...
by Zamaster
Dec 08, 2018 7:51
Forum: General
Topic: Been a while...
Replies: 4
Views: 320

Re: Been a while...

Yeah so not being an idiot and just specifying "-l stdc++" doesn't get me anywhere, it compiles but with the usual undefined reference errors.
by Zamaster
Dec 08, 2018 0:24
Forum: General
Topic: Been a while...
Replies: 4
Views: 320

Re: Been a while...

I wasn't! I get "invalid command line option" when I try this (i.e. directly adding -lstdc++ to my compiler invocation). Is this wrong/dumb/both?
by Zamaster
Dec 06, 2018 8:10
Forum: General
Topic: Been a while...
Replies: 4
Views: 320

Been a while...

Hey all... great to be back (for Lachie's last hurrah competition)...! Quick Q here: I have a C++ library I want to link into an FB program, and when I try to compile I get hit with linker errors like "undefined reference to `__std_terminate'", which I think means it can't find the c++ run...
by Zamaster
Nov 21, 2016 20:58
Forum: Tips and Tricks
Topic: AES Encryption/Decryption Algorithm
Replies: 22
Views: 12129

Re: AES Encryption/Decryption Algorithm

Hey! Guy who wrote the code here! It should be (heh) to AES spec as back when I wrote it (sheesh 9 years ago) I ran it on the AES test vectors and it was fully correct. However you guys are right, do not use this for any serious encryption application. Why? As said previously, AES is pretty suscepti...
by Zamaster
Apr 18, 2016 19:49
Forum: Tips and Tricks
Topic: 2D shadows
Replies: 14
Views: 1589

Re: 2D shadows

Yo @badidea, I think this is what you're looking for: https://www.dropbox.com/s/dgxth9osypwd9im/PointLight.zip?dl=0 Incidentally I updated that code many years later to use it for something! To anyone who doesn't know, this is a pixel based 2D light casting routine, so ideal for all ur baz needs. It...
by Zamaster
Mar 28, 2016 16:22
Forum: General
Topic: Multiple function definitions for fake templating
Replies: 5
Views: 606

Re: Multiple function definitions for fake templating

Thanks guys, I had most of that but St_W's solution to use FB_MAIN is close to what I needed. Unfortunately this requires that the code is included at least once in the main module. Is there a way to do it so that its included in exactly ONE of the modules even if not included in FB_MAIN?
by Zamaster
Mar 28, 2016 8:02
Forum: General
Topic: Multiple function definitions for fake templating
Replies: 5
Views: 606

Multiple function definitions for fake templating

Hey so I wrote a header with some template macros that generate types/methods based on a data type provided to the macro (standard C style fake templating). What I wasn't paying attention to was that including the header in multiple .bas units would confused the linker since their would be multiple ...
by Zamaster
Feb 23, 2016 20:42
Forum: Tips and Tricks
Topic: The Ultimate FB HashMap
Replies: 2
Views: 594

Re: The Ultimate FB HashMap

Right right, I know there are tons of these lying around, I just thought mine was pretty quick :)
by Zamaster
Feb 23, 2016 8:11
Forum: Tips and Tricks
Topic: The Ultimate FB HashMap
Replies: 2
Views: 594

The Ultimate FB HashMap

I know we've all done 96 of these, but are yours as overboard as this? I'm updating my personal FB libraries and wanted to redo my associated array via templated Hash map, so I did. Design choices: Key types are strictly long and zstring for now, and are not explicitly OOP constructs. Key types must...
by Zamaster
Feb 12, 2016 7:03
Forum: General
Topic: Calling realloc from assembly block
Replies: 7
Views: 607

Re: Calling realloc from assembly block

I didn't even know about FB exported functions until you said so! I'll certainly keep that in mind going forward. I ended up calling a different procedure inside the routine anyway, mostly wanted to keep the common case fast since reallocates should be rare in this code.
by Zamaster
Feb 12, 2016 3:55
Forum: General
Topic: Calling realloc from assembly block
Replies: 7
Views: 607

Re: Calling realloc from assembly block

actually, "call reallocate" works just fine!
by Zamaster
Feb 12, 2016 0:58
Forum: General
Topic: Calling realloc from assembly block
Replies: 7
Views: 607

Re: Calling realloc from assembly block

Okay okay I'm dumb yeah I see it HA, forgive me I was having a special moment
by Zamaster
Feb 12, 2016 0:21
Forum: General
Topic: Calling realloc from assembly block
Replies: 7
Views: 607

Re: Calling realloc from assembly block

Even weirder, if I debug it in x32dbg it runs without a problem (can even print stuff after the block), so whats wrong here? Here's the source listing from the member function making the call: sub DArray.reserve naked cdecl(byref _this as DArray, _elements as size_t) asm #ifdef __FB_64BIT__ #else mo...
by Zamaster
Feb 11, 2016 23:16
Forum: General
Topic: Calling realloc from assembly block
Replies: 7
Views: 607

Calling realloc from assembly block

I assumed it would be something like:

Code: Select all

asm
   push      ebx          'num bytes
   push      ecx          'address
   call      reallocate
   add        esp,                   8
   mov      ecx,         eax   'get result of function call
end asm


But I get a big 'ol crash. What should I have done differently? Thanks!

Go to advanced search