News:

Welcome to RetroCoders Community

Main Menu

Recent posts

#21
C / C++ / Re: C prigramming in Windows X...
Last post by CharlieJV - May 20, 2024, 11:02 AM
I really liked Windows XP, so I find that pretty cool.
#22
C / C++ / C prigramming in Windows XP
Last post by ron77 - May 20, 2024, 09:33 AM
hi all long time not posted...

i have installed windows XP in vertualbox and set up MingW 6 GCC with SDL 1.2 and Bass lib (compatible with win XP)...

here is a few Examples of Programs:



i compile using NotePad++ 6.9 given to me from Mysoft plus i use for images Paint Shop 4 Pro also from Mysoft

here is the SDL 1.2 Mandelbrot set code:

#include <SDL\SDL.h>
#include <windows.h>
#include <math.h>

int WIDTH = 800;
int HEIGHT = 800;

long double min = -2.84;
long double max = 1.0;
long double factor = 1;

int MAX_ITERATIONS = 200;

long double map(long double value, long double in_min, long double in_max, long double out_min, long double out_max) {
    return (value - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}

int main(int argc, char* argv[]) {
    SDL_Init(SDL_INIT_VIDEO);
    
    SDL_Surface* screen = SDL_SetVideoMode(1440, 900, 32, SDL_SWSURFACE);
    if (!screen) {
        printf("Unable to set video mode: %s\n", SDL_GetError());
        return 1;
    }
    
    SDL_Event event; // Declare event variable
    int count = 0;
    
    while (1) {
        max -= 0.1 * factor;
        min += 0.15 * factor;
        factor *= 0.9349;
        MAX_ITERATIONS += 5;
        
        if (count > 30) {
            MAX_ITERATIONS *= 1.02;
        }
        
        for (int x = 0; x < WIDTH; x++) {
            for (int y = 0; y < HEIGHT; y++) {
                // Move event handling inside the rendering loop
                if (SDL_PollEvent(&event) && event.type == SDL_QUIT) {
                    SDL_Quit();
                    return 0;
                }
                if (GetKeyState('Q') & 0x8000) {
                    SDL_Quit();
                    return 0;
                }
                
                long double a = map(x, 0, WIDTH, min, max);
                long double b = map(y, 0, HEIGHT, min, max);
                long double ai = a;
                long double bi = b;
                int n = 0;
                
                for (int i = 0; i < MAX_ITERATIONS; i++) {
                    long double a1 = a * a - b * b;
                    long double b1 = 2 * a * b;
                    a = a1 + ai;
                    b = b1 + bi;
                    
                    if ((a + b) > 2) {
                        break;
                    }
                    
                    n++;
                }
                
                int bright = map(n, 0, MAX_ITERATIONS, 0, 255);
                if ((n == MAX_ITERATIONS) || (bright < 20)) {
                    bright = 0;
                }
                
                int red = map(bright * bright, 0, 65025, 0, 255);
                int green = bright;
                int blue = map(sqrt(bright), 0, sqrt(255), 0, 255);
                
                Uint32 color = SDL_MapRGB(screen->format, red, green, blue);
                Uint32* pixels = (Uint32*)screen->pixels;
                pixels[(y * screen->pitch / 4) + x] = color;
            }
        }
        
        SDL_Flip(screen);
        count++;
    }
    
    SDL_Quit();
    return 0;
}

#24
Other Programming Languages / Re: UDF in interpreter
Last post by aurel - May 03, 2024, 08:45 AM
in case someone is interested
https://discord.gg/ANsRUPy
#25
Other Programming Languages / Re: UDF in interpreter
Last post by aurel - May 01, 2024, 06:02 PM
and now test with 3 params and one of them is
expression with built-in function sin(90)

' function with arguments
var g : g = 50 : wcolor 0,0,0 : mode 1
fcolor 150,240,150 :print 5,10,"global:": print 100,10,g : swap
' func call with params...
myFn(5,3+g,2*sin(90))

func myFn(var a,var b,var c)
  fcolor 250,200,150
  print 50,30,"local a"
  print 50,50,a
  print 50,80,"local b"
  print 50,100,b
  var f : f = a + b + c
  fcolor 150,200,250 :print 5,150,"result:": print 100,150,f
  swap   
endFn
#26
Other Programming Languages / UDF in interpreter
Last post by aurel - Apr 30, 2024, 02:38 PM
;D
First time in micro(A) global and local
calculation as function parameter expression


' function with arguments
var g : g = 50 : wcolor 0,0,0 : mode 1
fcolor 150,240,150 : print 50,50,g : swap
myFn(5+g*2)
'print 100,150,a

func myFn(var a)
fcolor 250,200,150
print 50,80,"local + global (5+g*2)"
print 50,100,a
swap 
endFn
#27
QBasic / Re: Fox Oring
Last post by mysoft - Apr 23, 2024, 04:21 PM
looks pretty good, fun playability , heh so the DOS version is in qbasic... and the win32 version uses OpenGL? hehe

thanks for the effort of multiple platforms :)
#28
QBasic / Fox Oring
Last post by yevrowl - Apr 20, 2024, 05:01 AM
Fox Oring is a variation of the sport of amateur radio direction finding. Fox Oring is a timed race in which individual competitors use a topographic map and a magnetic compass to navigate through diverse, wooded terrain while searching for radio transmitters. The term is derived from the use of the term fox hunting to describe recreational radio direction finding activity and an abbreviation of the word orienteering. It is necessary to discover 5 hidden transmitters located on a 10 × 10 field in as few moves as possible. The transmitters broadcast in all 8 directions, the number on the cell indicates the number of intersecting signals.



http://foxoring.sf.net/
#29
FreeBasic Projects / Piranha Panic Port
Last post by mysoft - Apr 19, 2024, 07:29 PM
despite this being a game, i didnt made it... so i'm not posting on gamedev
what i made was to port the binary version (there's no source), so it can run on linux and DOS

the port works in a way "similar as that WINE do", i implemented the required windows API that the game uses, and manually load the binary blob of the game and run that

press F2,F3,F4 for new game in... easy/medium/hard difficulties respectively



for the DOS version if running in dosbox i recommend using hdpmi32 instead of cwsdpmi...

i'm now working, on the 2nd step of this project, that is to make a static recompiler, so that i can port this for ARM/WebAsm/x64 etc... and have the game over NDS

source + win32/dos binaries
Download Piranha RE
#30
FreeBasic Game Dev / Re: Tetris in a day
Last post by yevrowl - Apr 18, 2024, 11:33 PM
Quote from: ron77 on Apr 18, 2024, 03:32 PMi compiled the tetris game code with freebasic for dos (DJGPP) AND ADDED HDMPI32.EXE file and a batch file so you can run it under dos (either dosbox or freeDOS OS) I am attaching it here for you as a zip file - tell us if it works for you (to start the game just run START.BAT file)
Thanks a lot, Tetris works great!