• What are you working on? v19
    6,590 replies, posted
[QUOTE=Dr Magnusson;31609589]I've written the ugliest 300 lines of code in my life that turns this: [code]((5 (10 20 *) +) x =)[/code] Into this: [img]http://localhostr.com/files/Sh0H1aC/capture.png[/img] That when executed, results in this: [img]http://localhostr.com/files/a5Ff73k/capture.png[/img][/QUOTE] Rated artistic because i'm not quite sure what's going on...
Basically what's happening is that I'm tokenizing the input string, running the tokenized output through a parser that converts each step into a bunch of machine code instructions, I then "link" the program, replacing all references to variables with whatever I want them to be (*, = and + are all just symbols). I then pass the machinecode to my assembly function that then jumps into it, and if all goes well, it'll jump right back out again sooner or later :v:
[QUOTE=Dr Magnusson;31610136]Basically what's happening is that I'm tokenizing the input string, running the tokenized output through a parser that converts each step into a bunch of machine code instructions, I then "link" the program, replacing all references to variables with whatever I want them to be (*, = and + are all just symbols).[/QUOTE] Basically you are one step away from a Lisp compiler, just need to change RPN to ordinary prefix notation :v:.
[QUOTE=q3k;31610342]Basically you are one step away from a Lisp compiler, just need to change RPN to ordinary prefix notation :v:.[/QUOTE] RPN Lisp would be pretty rad too
This notation makes more sense from an assembly standpoint though, as all I'm doing is writing the stuff to the array containing the machine code as it goes.
[QUOTE=Dr Magnusson;31610563]This notation makes more sense from an assembly standpoint though, as all I'm doing is writing the stuff to the array containing the machine code as it goes.[/QUOTE] If I understand correctly, ESI is set to an array of function pointers before you jump into your generated code?
[QUOTE=q3k;31610688]If I understand correctly, ESI is set to an array of function pointers before you jump into your generated code?[/QUOTE] Close! It's not only an array of function pointers, it's an array of unsigned integers. Everything that has a symbol in the code (*, +, = and x) are assigned a position in this array. All operations are performed an offset in this array. You could theoretically do something like: [code] (* temp =) (+ * =) (temp + =) [/code] After which the multiplication and addition functions would be reversed. The linking stage is really just me filling that array with function pointers.
Rated artistic again because I've still got no idea whats going on
I'm working on a software renderer, thanks for the idea whoever did that a few threads back, I'm going to try to do mine in real time, though.
[img]http://images.overvprojects.nl/SS-2011-08-09_01.09.55.png[/img]
Managed to incorporate a data segment in the compiled code, translating all pointers to it later on was a bit tricky though. Here's some example code: [cpp] (\"Hello world\" x =); ((2 (x ?) +) x =); [/cpp] This is the most accurate representation of what's going on. [cpp] char *temp = "Hello world"; int x = (int)&temp; *x = *((char *)x) + 2; [/cpp] Since all variables, like x, or = for that matter, are pointers, you need to dereference them when using their actual value in arithmetic. In assignment, the receiving variable is dereferenced internally. In the code above, x is a pointer to a pointer to "Hello world", so by derefencing it, and incrementing it, we're moving the pointer to "Hello world" forward. The syntax is actually really simply, it's just turned flipways, so it's harder to make out what's going on. Here's the syntax for the entire language: [code] (argument argument argument function) [/code] That's all there is to it.
[QUOTE=Overv;31613884][img]http://images.overvprojects.nl/SS-2011-08-09_01.09.55.png[/img][/QUOTE]What the hell is this? A tutorial for ants? It needs to be at least 3 times as big!
[QUOTE=danharibo;31613929]What the hell is this? A tutorial for ants? It needs to be at least 3 times as big![/QUOTE] It's a sneak preview. Please appreciate my personal appeal.
[QUOTE=Overv;31613950]It's a sneak preview. Please appreciate my personal appeal.[/QUOTE] "It my desire" you accidentally a word, but other than that this looks realy promising. I'm looking forward to this a lot.
[QUOTE=Jawalt;31613496]I'm working on a software renderer, thanks for the idea whoever did that a few threads back, I'm going to try to do mine in real time, though.[/QUOTE] Maybe try a raytracing one.
[QUOTE=Overv;31613884][img]http://images.overvprojects.nl/SS-2011-08-09_01.09.55.png[/img][/QUOTE] Before we can start drawing things, we need to create a window with the appropriate pixel format and create an OpenGL context. Please elaborate further. I dun wanna transcribe everything from that. [editline]8th August 2011[/editline] I'm also making a .tar alternative. So far, its better than .tar except it doesn't support folders yet.
[QUOTE=Map in a box;31614267]Before we can start drawing things, we need to create a window with the appropriate pixel format and create an OpenGL context. Please elaborate further. I dun wanna transcribe everything from that.[/QUOTE] No, I just want to give an indication of progress. I'm not publishing incomplete content that has not yet been proofread.
[QUOTE=danharibo;31613929]What the hell is this? A tutorial for ants? It needs to be at least 3 times as big![/QUOTE] Zoolander much huh? Anyway I was wondering about something... maybe you guys can help me out. Is there an actual way to communicate between two different .exe application? I'm making a wxWidget editor witch have a function that runs the engine (another .exe app). I would like to be able to use the editor's console output for the engine even though the print call are on the engine side, any ideas?
[QUOTE=Dr Magnusson;31610136]Basically what's happening is that I'm tokenizing the input string, running the tokenized output through a parser that converts each step into a bunch of machine code instructions, I then "link" the program, replacing all references to variables with whatever I want them to be (*, = and + are all just symbols). I then pass the machinecode to my assembly function that then jumps into it, and if all goes well, it'll jump right back out again sooner or later :v:[/QUOTE] Are you converting to x86 instructions? Also, are the arithmetic instructions passed to the FPU? Because, given the way the 8087-based chips work (and if I'm not mistaken), the translation between RPN and machine code is trivial, while working with the normal instruction set might be a bit more annoying.
[QUOTE=Overv;31613884][img]http://images.overvprojects.nl/SS-2011-08-09_01.09.55.png[/img][/QUOTE] [QUOTE=Overv;31613884] Before we can start drawing things, we need to create a window with the appropriate pixel format and create an OpenGL context. A pixel format describes the attributes and capabilites of images and pixel-based surfaces. such attributes include the anti-aliasing level, the color depth, the capability of using OpenGL and many other things. it's part [OGL] which is the API that manages graphics and [blah] the output devices, such as printers and [blah]. In the early days, you chose a pixel format by passing a struct with the desired attributes to the ChoosePixelFormat function. Back when this function became available, there was no widespread support for anti-aliasing yet and the struct did not have an attribute for it. Eventually an extension was introduced to support all of these fancy new features; wglChoosePixelFormat[RD]. as we will see, this function takes an array of attribute identifiers and their [visuals], so it will always be able to support the latest features. Similaryl, the function to create the actual content, wglCreateContext, became outdated quickly and was superceded by wglCreateContext[RD]. This new function allows us to specify what verion and profile of OpenGL we need for our context. OpenGL [some version number] allows us to choose [blah] the following [blah] profiles; Compatability - This is the default profile and is the [same] you would get by calling the old context creation function. it allows us to [blah] every single function we desire to use, deprecated or not. Core - This is the [blah] [blah] [blah] [blah]. it will only allow us to use the [blah] pipeline and will throw an error of GL_INVALID_OPERATION when using a deprecated function. this serves to keep us in check and is otherwise known as a forward-compatible context. <begin yellow/green note> Note that we can stil use all of the newer OpenGL functions in the compatability profile and a context created with the old wglCreateContext will still work correctly. That means it's [blah] if you want to use a library like SFML to create your context if you want to. I advise you to check out how a context is created by hand before doing so, though. </note> Still with me? There's one more problem we have to overcome. As detailed above, we're going to need some [deprecated] functions, but we can't get the pointers to extension functions without an OpenGL context. So, we need a context to get access to those functions. we need to create a context in the first place. The solution is to create a dummy window. Use ChoosePixelFormat to set a dummy pixel format and create a dummy context with wglCreateContext. As soon as we've set up that context, we fetch the pointers for our needed functions and destroy the dummy context and window. After that we can create our actual window and the forward-compatible context using the core profile.[/quote] (Things i'm not sure of are in []) [QUOTE=Overv;31614491]No, I just want to give an indication of progress. I'm not publishing incomplete content that has not yet been proofread.[/QUOTE] Oops.
I'm working on a space-shooter, but there's no way to get an entity's torque in polycode, only set it, so trying to slow an entity from spinning is difficult...
[QUOTE=Overv;31613884][img]http://images.overvprojects.nl/SS-2011-08-09_01.09.55.png[/img][/QUOTE] Add some line-height to the text on the site. It'll make it much easier to read. (Won't help with the tiny screenshot, though.)
[QUOTE=ZenX2;31619532]I'm working on a space-shooter, but there's no way to get an entity's torque in polycode, only set it, so trying to slow an entity from spinning is difficult...[/QUOTE] Store it yourself and submit a ticket.
[img]http://i.imgur.com/ttYWU.png[/img] Woo! Man that takes stress off me. Helios is planned to be in the app store this week.
[QUOTE=i300;31620473][img]http://i.imgur.com/ttYWU.png[/img] Woo! Man that takes stress off me. Helios is planned to be in the app store this week.[/QUOTE] What if it ends up being unsuccessful? The $100/year fee sucks.
[IMG]http://localhostr.com/files/5Bim2rK/nrockets.png[/IMG] My first BSP loader/renderer.
[QUOTE=Map in a box;31620573]What if it ends up being unsuccessful? The $100/year fee sucks.[/QUOTE] I don't honestly care if it is successful or unsuccessful. If it is, great! If not, oh well. I am willing to pay 100$ a year to continue to publish on the app store! Plus its great for my resume!
[QUOTE=DevBug;31619818]Store it yourself and submit a ticket.[/QUOTE] I did report it; but because I can't tell when another entity bumps it or how much a collision will change the spin, storing it myself is useless.
Writing a script to export, tag and embed album art into my iTunes Library so I can sync it to my new phone. [img]http://i.imgur.com/NKldR.png[/img] Not completely perfect. [editline]9th August 2011[/editline] and because iTunes is so completely retarded, i had to do this: [code]URI.unescape(track["Location"]).gsub("file://localhost", "")[/code]
[QUOTE=tanraga;31621932] [editline]9th August 2011[/editline] and because iTunes is so completely retarded, i had to do this: [code]URI.unescape(track["Location"]).gsub("file://localhost", "")[/code][/QUOTE]I'm sure that's for music hosted on other machines / locations
Sorry, you need to Log In to post a reply to this thread.