Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Rbz

Pages: [1] 2 3 4 5 6 7 8 ... 93
1
 :goodpost:

Very nice javascript/html5 tutorial!

It's nice to see  all those nice effects done on a browser and running smoothly.

Right now, I'm learning some webgl/javascript myself and I'm really happy with it!  :kewl:

2
Hi Ampli,

Unfortunately I don't have purebasic nor linux installed, but here some ideas for you to research about it.

Using Energy's example, you will need to remove "wimm.lib" and "kernel32.lib" they are windows specific, on linux you will use SDL.

Use something like this:
Code: [Select]
ImportC "-lSDL2"
Here is a "C" code used to setup sdl audio, I think it should be easy to convert to purebasic:

Code: [Select]
static void synthCallback(void *udata, Uint8 *stream, int len) {
/* the music is stereo - use 32 bit for left and right channel */
static int32_t* sample = (int32_t*)synthBuffer;
int32_t* ptr = (int32_t*) stream;

udata += 0;
int i;
for (i = len / (SYNTH_OUTPUT_SAMPLE_SIZE * SYNTH_CHANNELS); i > 0 ; i--) {
/* loop the track */
if (samplePosition >= MAX_SAMPLES) {
samplePosition = 0;
sample = udata;
}
/* copy left and right channel at the same time */
*ptr++ = *sample++;
samplePosition++;
}
}

Code: [Select]
/* audio specification */
SDL_AudioSpec audioSpec;
audioSpec.freq = SAMPLE_RATE;
audioSpec.format = AUDIO_S16SYS;
audioSpec.channels = SYNTH_CHANNELS;
audioSpec.silence = 0;
audioSpec.samples = SYNTH_PLAY_BUFFER;
audioSpec.size = 0;
audioSpec.callback = synthCallback;
audioSpec.userdata = synthBuffer;

/* setup audio */
if (SDL_OpenAudio(&audioSpec, NULL)) {
fprintf(stderr, "SDL_OpenAudio() failed\n");
SDL_Quit();
return EXIT_FAILURE;
}

/* no multicore - precalculate the music */
__4klang_render(synthBuffer);

/* start the music */
SDL_PauseAudio(0);

Another thing to check is how to allocate memory for "synthBuffer", I believe it should be:
Code: [Select]
synthBuffer = AllocateMemory(#MAX_SAMPLES*#SAMPLE_TYPE*2)

3
General chat / Re: The Welcoming Committee
« on: October 17, 2018 »
 :hi: @ablablablablabla and @js

4
@aNdy: That's exactly what I was suspecting about the compos here.

This is also what happen on demoparties in general, in my point of view, it's not fair when you have to compete with guys/groups like for eg: Fairlightfarbrausch which coders are all professional, and I don't really know what compo organizers should do, eventually they will find a way to make things fair for newcomers on the demoscene.

But don't get me wrong, I know the value of a competition, it's part of our life, every day we are competing some how, but if we have a chance to make a fair compo - that's what we should do.

Glad to hear you already learned something new by just participating in this challenge.
 :cheers:

5
Simple because for the last competitions we weren't getting much entries and not even people for voting.

Now my idea is to changing it to a "challenge" only, and maybe get more people entering without being stressed out by a competition, as you know we have super experienced demo coders and newbies here. It's just a test challenge and I want to see how it will be received.

6
@Tetra: mission accomplished :)

@Knurz: oh nooooooo...

@aNdy: just remember it's a challenge for YOU and I believe you can do it :)

But really, those challenges are meant for you to try new things and be creative, no need to do mega productions, just something you never did before, and last but not the least to make this forum alive again which already is worth it.

 :cheers:

7
Challenges & Competitions / Halloween Challenge 2018
« on: September 30, 2018 »

:hanging: DBF Halloween Challenge 2018  :hanging:

  • The theme is "Halloween"
  • You can use any platform that is compatible with: Windows 10/8.1/8/7/Vista/XP and Linux!
  • You may write something for web browsers as long as it works in IE / Chrome / FireFox (or all!)
  • The following emulators are welcome: Vice, Winuae, Saint, PS2 Yabasic
  • Please give credit if you use ripped sound/gfx, or even better credit the original artist.
  • Please write something new for the challenge, no previously released stuff.
  • Do not use ripped routines. (dlls, libs, fmod, sdl, frameworks etc are fine but say what you used please!).
  • Entries to be posted in this forum please with the title [Halloween 2018] entry name
  • Entries may be posted between NOW and until October 31 2018 23:59 GMT [31th October 2018 - 23:59 GMT]
  • Please include a screenshot of your entry in your post.
  • There won't be a voting/poll this time, everyone entering will receive a "good karma" boost, so have some fun!





:rip: Have fun!  :rip:

8
ASM / Re: sine generator in TASM
« on: August 19, 2018 »
And here is the Freebasic port for the sine generator part, for anyone who wants to investigate how it works.

Keep in mind that this generator was done for old computers without FPU (old PC 286 computers I believe), but it's an interesting piece of code that shows how those old coders did their stuff, might be useful for someone making demos for other kinds of old school  computers ofcourse.

Code: [Select]
' CALCULATE SINE/COS - VALUES (Wally/Rage)

    dim shared bx(16384) as short

    dim as short cx = &h783F
    dim as byte ch = 0
    dim as short si = 0
    dim as short ax = 0
    dim as short dx = 0
    dim as short b = 0

    width 80, 25
    cls

    dim as integer i = 0
    for i = 0 to 16383
   
      ax = -39  '65497
      dx = (cx * ax) shr 16
      si += dx
      cx += si

      ch = (cx shr 8 ) and &hFF
      bx( i ) = ch
      b = bx( i )
      bx( i ) = b shr 1

      print bx( i ); "  ";
     
   next
   
   print
   print
   print "press any key to exit..."
   sleep
   dim as string clearkey = inkey
   

9
@boogop: This is an interesting piece of asm code, and I've tried to convert it to C and I got this result below.
Not exactly sure if it is correctly but it seems to be working.

Quote
   short bx[16384] = {};

   short cx = 0x783F;
   char ch = 0;
   short si = 0;
   short ax = 0;
   short dx = 0;

   for(int i = 0; i < 16384; i++)
   {
      ax = -39;//65497;
      dx = (cx * ax) >> 16;
      si += dx;
      cx += si;

      ch = (cx >> 8 ) & 0xFF;
      bx[ i ] = ch;
      short b = bx[ i ];
      bx[ i ] = b >> 1;

      printf("%d    ", bx[ i ]);
   }

If you want to investigate further please open a new thread for it on a proper coding section, I'm sure people will like to try this.

I've attached part of the numbers I got and an image of those points plotted on x coordinate.

10
General chat / Re: The Welcoming Committee
« on: August 08, 2018 »
 :hi: Heiker

11
I'm using ArtRage 5, it's cool painting program.
I've also tryed Corel Painter, which is awesome, too bad it's expensive for just play around, but who knows maybe one day.

Also your paintings are awesome 8)

12
I'm still learning digital painting... :)


13
Projects / Re: The Papillons Remake
« on: June 02, 2018 »
Just to be sure, I'm not against vc runtime or anything like that :)
I'm pointing it out because most of users don't know how to fix it by installing msvc redistributable package thing.

Quote
Any suggestions how I can link it to a non-VC-RT dll (I wasn't aware that using the mem-functions opens up a new dependecy).
What I do these days is to simple setup on "Code Generation" - "Runtime Library" to "Multi-threaded (/MT)" and the vc runtime will be static linked to your executable file. Sure the file will increase in size but well.. AV programs today are so annoying that you can't have small executables anymore anyway :(

Another way is to follow this tutorial and complete remove c runtime lib usage (prepare to have some fun ;) ).

 

14
Purebasic / Re: Beast Tribute
« on: June 02, 2018 »
Really great welldone aNdy!
The music version you did is awesome, keep it up!

15
Purebasic / Re: Psygnosis Agony MinIntro
« on: June 02, 2018 »
Been a bit busy lately but have managed to put together a little demo along similar lines as ~Ar-S~.  I've gone for a minimalist approach to colour on this one but it did start off very differently.  :-X
Written as usual in PB, standard libraries except the music library.
Nice work on this one!
Oldschool vibe approved  :cheers:

16
Projects / Re: The Papillons Remake
« on: June 02, 2018 »
Nice remake!

Consider removing the use of "VCRUNTIME140.dll" and it will be perfect :)

17
Hi,

You will need an old Freebasic version (0.17) to compile this one, fortunately I've one copy of it on my hd.
Of course, this code can be ported to the new/recent FB version but it's time consuming, a lot of things changed since 0.17 ver.

Anyway, if you like, you can download the 0.17 version from here:
www.rbraz.com/temp/FreeBASIC017.zip

And in the source there is some duplicated variables, just comment or remove those lines in the CooperMaster.bas, those lines are already defined in nzo_func.bas

Code: [Select]
Const XRES=640
CONST YRES=480
Const PI=3.141 
Const Sin_PI=PI/180
Const twopi=PI*2

18
C / C++ /C# / Re: stb libraries
« on: April 16, 2018 »
I also scratched my head on the first time I was using it, but in the end it is very simple.

Just all you need to do is to include this lines on your texture ".CPP"  file:
Code: [Select]
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"

It includes those functions on your source code and no other file or library is necessary, besides of course it uses the standard C runtime, needed for open file, memory allocation and etc.


Ps. I've only tested the image loader, but the other libs should be also simple to use, just take a look on the header file for example usage.


19
C / C++ /C# / stb libraries
« on: April 15, 2018 »
For those looking for a simple image loader, take a look at "stb image library" by Sean Barrett
https://github.com/nothings/stb

It's simple to use:

Code: [Select]
#define STB_IMAGE_IMPLEMENTATION
#define STBI_ONLY_PNG     //You can request *only* certain decoders and suppress all other
#include "stb_image.h"

    int x,y,n;
    unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
    // ... process data if not NULL ...
    // ... x = width, y = height, n = # 8-bit components per pixel ...
    // ... replace '0' with '1'..'4' to force that many components per pixel
    // ... but 'n' will always be the number that it would have been if you said 0

    stbi_image_free(data)

// Standard parameters:
//    int *x                 -- outputs image width in pixels
//    int *y                 -- outputs image height in pixels
//    int *channels_in_file  -- outputs # of image components in image file
//    int desired_channels   -- if non-zero, # of image components requested in result

20
General chat / DBF Challenge theme
« on: April 13, 2018 »
Hello,

I'm willing to setup a new DBF challenge and need your help for theme suggestions.
This time will be only a challenge and not a "competition" which means -> no voting, so everyone entering will be receiving our precious "karma" points. :)


That said, one of my ideas for a challenge would be choose a theme based on Pixel Dailies theme for a specific day and have a month to develop around that theme.


Please post your ideas below.

Pages: [1] 2 3 4 5 6 7 8 ... 93