Search found 621 matches

by UEZ
Aug 02, 2020 13:06
Forum: General
Topic: A PRNG for graphics programs?
Replies: 84
Views: 2455

Re: A PRNG for graphics programs?

deltarho[1859] wrote:Agreed, but I don't understand your point.

That was only a brain fart... ^^

deltarho[1859] wrote:Modern compilers will replace 2^32 with 4294967296

I didn't disassemble the code to see if the FB compiler is smart to replace such expression.
by UEZ
Aug 02, 2020 11:48
Forum: General
Topic: A PRNG for graphics programs?
Replies: 84
Views: 2455

Re: A PRNG for graphics programs?

Btw, you use a constant 2^32, shouldn't it be 2^32-1? Where in particular? In functions: Private Function NR32.RandD As Double ' Rnd replacement Engine Return this.state/2^32 End Function Private Function NR32.Range Overload ( Byval One As Double, Byval Two As Double ) As Double Engine Return this....
by UEZ
Aug 02, 2020 10:49
Forum: General
Topic: A PRNG for graphics programs?
Replies: 84
Views: 2455

Re: A PRNG for graphics programs?

I may as well continue. http://deltarho.org.uk/Downloads/smile.png UEZ uses Function RandomRange(fStart As Single, fEnd As Single) As Single Return Rnd() * (fEnd - fStart) + fStart End Function In keeping with Microsoft's appending with Ex for their 'posh' versions of APIs my normal distribution ve...
by UEZ
Jul 31, 2020 8:41
Forum: General
Topic: A PRNG for graphics programs?
Replies: 84
Views: 2455

Re: A PRNG for graphics programs?

Thanks deltarho[1859]. Imho, the total randomness is for gfx programs not that important, rather perlin noise function to get a controlled randomness. Let this run for a while and maybe you can see Mona Lisa or even your self for a fraction of a second... ;-) 'Coded by UEZ build 2020-08-06 'Random f...
by UEZ
Jul 25, 2020 14:15
Forum: Windows
Topic: Issue with VirtualProtect
Replies: 10
Views: 569

Re: Issue with VirtualProtect

Thanks @jj2007. Let's say my opcode is in memory using Allocate which gives me the address and one function within the opcode is memory opcode + &h00A1. There is the entry point for a function with 3 parameters. How can I call it? Any idea on this? Is this a valid approach? (code extract from ab...
by UEZ
Jul 24, 2020 20:01
Forum: Windows
Topic: Issue with VirtualProtect
Replies: 10
Views: 569

Re: Issue with VirtualProtect

Thanks all for your replies. The odd thing is that VirtualProtect returns 1 which means is successful but on the other hand the error flag was set. When I use following code #Include Once "windows.bi" SetLastError(0) ? GetLastError() Dim As Ubyte Ptr BinData Dim As SIZE_T iLen = 1000 Dim A...
by UEZ
Jul 24, 2020 14:38
Forum: Windows
Topic: Issue with VirtualProtect
Replies: 10
Views: 569

Re: Issue with VirtualProtect

Not everybody around here is familiar, with Auto-It. More information on: VirtualProtect's 'workings', is therefore needed ... Currently there is no need for Autoit code, just the issue why VirtualProtect produces an error code 126. With Autoit the return value of VirtualProtect is 1, same with FB,...
by UEZ
Jul 24, 2020 9:19
Forum: Windows
Topic: Issue with VirtualProtect
Replies: 10
Views: 569

Issue with VirtualProtect

I want to port an Autoit script to Freebasic but I've problems with VirtualProtect. #Include Once "windows.bi" Sub __MemoryDllCore() Static As Ubyte Ptr BinData Dim As Ushort iLen, iLines, p = 0 Dim As String aBinary(1) Restore __OpCode: Read iLen iLen \= 2 Read iLines BinData = Allocate(i...
by UEZ
Jul 23, 2020 15:58
Forum: Projects
Topic: Gas64 (no more use of gcc, only gas) WDS / LNX
Replies: 381
Views: 40725

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

@UEZ Thanks again for your report in the BasicCoder2's thread. The error was due to 'dx' used as variable name generating an error when assembling. It's allowed in the current version but I did a mistake when compiling or copying files. The right version (For now only Exes for WDS) http://users.fre...
by UEZ
Jul 23, 2020 6:32
Forum: Game Dev
Topic: Retro parallax scrolling
Replies: 4
Views: 470

Re: Retro parallax scrolling

@BasicCoder2: looks nice but why didn't you use the images I've zipped? The original images are in one big PNG image and I had cut them out and saved it as 32-bit bmp using GIMP. This 32-bit bmp format is support by FB. Btw, the Demo code above is posted twice. What a pitty that FB has no built-in f...
by UEZ
Jul 18, 2020 18:12
Forum: Tips and Tricks
Topic: 2D Parallax Scrolling Example v0.65 build 2020-07-29
Replies: 5
Views: 498

Re: 2D Parallax Scrolling Example v0.60 build 2020-07-17

Thanks UEZ. Yesterday I got connected via fibre, your bitmaps arrived here intact in no time at all. You code runs well. Thank you, too, dodicat. What is your internet speed now with fiber? At the moment here in our town there are construction works to lay fiber cables to each residential buildings...
by UEZ
Jul 18, 2020 14:48
Forum: Tips and Tricks
Topic: 2D Parallax Scrolling Example v0.65 build 2020-07-29
Replies: 5
Views: 498

Re: 2D Parallax Scrolling Example v0.60 build 2020-07-17

Roland Chastain wrote:
UEZ wrote:Theoretically it should work also on Linux...


Yes, it works. Thank you for sharing.

Thanks for testing. :-)
by UEZ
Jul 16, 2020 17:20
Forum: Tips and Tricks
Topic: 2D Parallax Scrolling Example v0.65 build 2020-07-29
Replies: 5
Views: 498

2D Parallax Scrolling Example v0.65 build 2020-07-29

A small and simple example of a "2D Parallax Scrolling" with 6 layers. Preview: https://i.ibb.co/j6Py3x9/2-D-Parallax-Scrolling.jpg 2D Parallax Scrolling.bas 'Coded by UEZ build 2020-07-29 'Images used from https://gamedevelopment.tutsplus.com/tutorials/parallax-scrolling-a-simple-effectiv...
by UEZ
Jul 09, 2020 21:09
Forum: General
Topic: Crashing on x64 execution
Replies: 8
Views: 447

Re: Crashing on x64 execution

fxm wrote:Do you use some gcc options when compiling?
(what is the gcc version of your fbc build?)

No gcc, just default compiler options.

Problem was probably playing around with different FB tool chains version and mixing up things...
by UEZ
Jul 09, 2020 21:08
Forum: General
Topic: Crashing on x64 execution
Replies: 8
Views: 447

Re: Crashing on x64 execution

FreeBASIC Compiler - Version 1.08.0 (2020-04-30), built for win64 (64bit) Where does that originate from? The last build from St_W is: Version 1.08.0 (2020-01-12), built for win64 (64bit) This works without any problems ... As already written above, I cannot remember. Anyhow, I replaced the fbc.exe...

Go to advanced search