Search found 45 matches

by Vendan
Jun 15, 2011 1:49
Forum: General
Topic: Getting the address of an instruction (inside an asm block)
Replies: 14
Views: 3156

That is some freaky looking code. Here's mine #include "windows.bi" enum operand_type reg8 reg16 reg32 reg_mem reg_offset_mem mem literal8 literal16 literal32 end enum enum encode_type regadd modrm1 modrm2 end enum type jit_operand op_type as operand_type regval as ubyte value as integer e...
by Vendan
Jun 14, 2011 18:39
Forum: General
Topic: print using "###.##" (resolved)
Replies: 6
Views: 2309

Hrm, check your fbc version. I just tried it and it printed out 1.2
by Vendan
Jun 14, 2011 18:36
Forum: General
Topic: Getting the address of an instruction (inside an asm block)
Replies: 14
Views: 3156

woah woah woah, that's getting to be some freaking crazy code. Here's a better solution, with supporting code and all dim test as function cdecl() as integer function maketest(value as integer) as function cdecl() as integer dim as function cdecl() as integer l1, l2, l3 asm jmp asmend label1: mov ea...
by Vendan
Jun 14, 2011 16:48
Forum: Game Dev
Topic: ASM assistance, if you please.
Replies: 87
Views: 26513

Glad to hear it. Just remember a nop loop is still sucking CPU time, which is generally a no-no. Sleep should yield control to the OS, thus reducing cpu usage. In games, it's generally not a big deal, as you get to be the primary foreground app with little else actively running, but try to play nice...
by Vendan
Jun 14, 2011 13:26
Forum: Game Dev
Topic: ASM assistance, if you please.
Replies: 87
Views: 26513

I'm not sure how much more asm can help out. What I added was a rare case where a person can easily out-optimize a good compiler, but I wouldn't count on that happening often. I'd be a little surprised if it can be optimized terribly much more, as all the other stuff will be asm based on a loop. My ...
by Vendan
Jun 14, 2011 5:16
Forum: Game Dev
Topic: ASM assistance, if you please.
Replies: 87
Views: 26513

veering off the original topic What im getting at is this, if you had a coupe of cpus hanging off your usb ports this would provide some parallel processing, which would be handy if you where writing a game , vision application or other app which was bogging down your computers PC It'd be interestin...
by Vendan
Mar 15, 2009 3:13
Forum: Beginners
Topic: Easy Webcam - uses dll
Replies: 49
Views: 22003

Kinda working on a strange project so i had already coded a little bit of edge detection into this version, which shows pixel data access as well. Plus, includes defines for height and width, you may have missed the one of the values. This one does 640x480 for me, just a little slow, drop it to 320x...
by Vendan
Mar 14, 2009 13:46
Forum: Beginners
Topic: Easy Webcam - uses dll
Replies: 49
Views: 22003

Easy Webcam - uses dll

This is a rather easy to implement webcam dll, pretty fast, and copys the data into a buffer for you. http://sol.gfxile.net/code.html download the escapi21.zip and pull out the escapi.dll #define PTC_WIN #include "tinyptc.bi" Dim escapi_dll As any ptr Type SimpleCapParams mTargetBuf As Int...
by Vendan
Oct 03, 2008 18:44
Forum: Game Dev
Topic: Unnamed tech demo
Replies: 2
Views: 2542

Yeah, it's just a placeholder borrowed from Galactic Empires. as soon as i get the bugs out of my keplerian motion for the planets, i'm gonna start on it
by Vendan
Oct 03, 2008 17:09
Forum: Game Dev
Topic: Unnamed tech demo
Replies: 2
Views: 2542

Unnamed tech demo

Inspired by Galactic Empire, but i wanted to see if i could make better looking (IMHO) planets. OpenGL powered 2d sprite graphics with a day/night cycle on planets, seperate planet rotation, and a little bit of atmospheric glow on the planets(if you look closely). http://files.vendaria.net/game.rar ...
by Vendan
Apr 01, 2007 0:49
Forum: Beginners
Topic: Setting Timeout for recieving data from server
Replies: 3
Views: 1835

After you make the socket and connect and all, but before you call recv(), call this function

Code: Select all

dim timeout as integer
timeout = 15000
setsockopt(s ,SOL_SOCKET, SO_RCVTIMEO, value, len(value))
That'll make it timeout on the recv() call if it takes more then 15 seconds.
by Vendan
Apr 01, 2007 0:37
Forum: Beginners
Topic: ON KEY
Replies: 6
Views: 2345

Lol, i was just trying to do what he wanted, i.e. QB compatible, although the sleep 10 does break it a little.
by Vendan
Mar 31, 2007 12:25
Forum: Beginners
Topic: ON KEY
Replies: 6
Views: 2345

Um, i'm not sure you can do a QB compatible keyboard event system. I'd suggest your best bet is to do a loop checking for keys, but if your worried about CPU usage, put a Sleep 10 in it. That'll make it sleep for roughly 10 milliseconds, which will release the timeslice so your program won't hog the...
by Vendan
Mar 31, 2007 2:23
Forum: General
Topic: System & Version
Replies: 2
Views: 1492

It's a bit jury rigged, but here #ifdef __FB_WIN32__ #include "windows.bi" #endif #ifdef __FB_LINUX_ Print "I'm on Linux!" #endif #ifdef __FB_DOS__ print "Im on Dos!" #endif #ifdef __FB_WIN32__ dim WindowsVersion as OSVERSIONINFO WindowsVersion.dwOSVersionInfoSize = len...
by Vendan
Mar 30, 2007 18:29
Forum: Sources, Examples, Tips and Tricks
Topic: SDL Rotated Blit Function
Replies: 1
Views: 1975

SDL Rotated Blit Function

SDL Rotated blit function, with antialising(somewhat) SDL_RotBlit(destination, source, destx, desty, angle) Angle is in radians. Yeah, i know there's a rotozoom function, but i felt like coding it myself. Also, this pastes it onto a preexisting surface, instead of creating a new one. I'd recommend k...