[QUOTE=amazer97;35986499]Always wanted to know, do you use bytecode that you compile to use for your own VM or are you actually compiling it into x86 opcodes?[/QUOTE]
The user types something into the prompt and I emit LLVM code as a string, then I do this:
[CPP]
void compileIR(string in)
{
SMDiagnostic errors;
ParseAssemblyString(in.c_str(),Program,errors,Context);
if(!errors.getMessage().empty())
printf("\n%s",errors.getMessage().c_str());
if(verifyModule(*Program))
{
printf("The IR verifier found an unknown error.");
Unwind();
}
}
[/CPP]
ParseAssemblyString() takes LLVM IR as a string and compiles it into a new module. You can provide it with another Module* in the argument, so that the machine has a reference to the old code: Previously defined functions and types, so you don't have to append it to the new code. In this case, Program is a global Module* object that holds the entire code of the program, and Context is an LLVMContext& object. Unwind() is a function that uses <setjmp.h> to abort and return to the prompt/REPL.
Then I do this to run the code:
[CPP]
Function* entryfn = Engine->FindFunctionNamed("entry");
if(entryfn == NULL)
{
printf("ERROR: Couldn't find program entry point.");
Unwind();
}
entryfnptr entry = reinterpret_cast<entryfnptr>(Engine->getPointerToFunction(entryfn));
entry();
entryfn->eraseFromParent();
[/CPP]
When you type immediately executable code (Immediates, variable names, function calls), these are compiled into the entry() function in LLVM which is compiled to native code and run on the fly.
[QUOTE=calzoneman;35986352]Can you suggest a good virtual machine that works with JSOS?
So far I've tried
- VirtualBox (doesn't recognize .img file)
- VMware Player (Hangs when trying to boot .img file)
- QEMU (Kernel panics and can't load utils.jmg)
Perhaps my configuration is wrong, but I'm having trouble getting this to work.[/QUOTE]
VirtualBox:
[code]VBoxManage convertdd hdd.img hdd.vdi[/code]
Add it as hard drive to your virtual machine and you're done.
swear to god this isn't what it looks like
[img]http://eagle.undo.it:8083/img/kintel_82.png[/img]
unless it looks like the GPU is being used to accelerate terrain generation
Anyone know if OpenGL is commonly available on gaming [i]servers[/i]? It's never come up before...
[QUOTE=Overv;35987613]VirtualBox:
[code]VBoxManage convertdd hdd.img hdd.vdi[/code]
Add it as hard drive to your virtual machine and you're done.[/QUOTE]
I just had to get the makefile to run properly, then I installed QEMU and did this:
[code]qemu -hda hdd.img[/code]
Worked instantly
[editline]16th May 2012[/editline]
[QUOTE=Night-Eagle;35987664]swear to god this isn't what it looks like
[img]http://eagle.undo.it:8083/img/kintel_82.png[/img]
unless it looks like the GPU is being used to accelerate terrain generation
Anyone know if OpenGL is commonly available on gaming [i]servers[/i]? It's never come up before...[/QUOTE]
I could swear you just had a different image there
[QUOTE=ZenX2;35987747]I could swear you just had a different image there[/QUOTE]
...wait a minute, I think -
[img]http://eagle.undo.it:8083/img/kintel_83.png[/img]
IT'S ALIVE! HOLY FUUUUCK! RUN FOR YOUR LIVES!
[vid]http://bit.ly/JLXMve[/vid]
[url=https://github.com/naelstrof/Astrostruct/tree/master/src]All this hard work[/url] and all I have is a window and a couple of buttons... IT FEELS GREAT.
alright, Mr. Voronoi diagram is on a smoke break
[img]http://eagle.undo.it:8083/img/kintel_84.png[/img]
guess it's time for me to catch some z's
(Damned diagram is finally loaded into a texture in real-time. Now I just have to fetch it into system memory, do a few transforms, and viola! Sexy heightmaps.)
[QUOTE=Larikang;35986218]Ugh. I hate efforts to make computer science more accessible by... not teaching programming. My first programming class took a similar approach: trying to teach us the ideas behind OOP without teaching us the real language. It was frustrating and pointless. For me (and I think most programmers) 99% of the difficulty of programming comes down to syntax. Ideas, for the most part, are simple. The challenge is figuring out the right code to express those ideas.
I'm going to go with Knuth on this one:[/QUOTE]
I strongly disagree. Syntax is something that after some time comes naturally to you. Thinking up solutions or, even better, designing your code structure is a far greater challenge. For me at least.
[QUOTE=Darwin226;35988837]I strongly disagree. Syntax is something that after some time comes naturally to you. Thinking up solutions or, even better, designing your code structure is a far greater challenge. For me at least.[/QUOTE]
I disagree - syntax is a major hurdle for many non programmers
I think that lot's of people come into learning to program with this misconception that it is difficult to learn. They become easily confused because the expect to become confused. I don't know if this has any grounds at all but from my experience, people don't like to think.
In our "introductory" programming class for engineering, most people usually get stuck working out the algorithms or on logical errors.
Syntax hasn't really been a major problem from what I've seen, with some exceptions of course.
Core dumps tend to like our class though.
Best way to learn something is to work on something. All this theory stuff comes from practice, not other way around.
Weird question, does anyone know of a tool I can run on my code that will scan #include's and automatically correct the caps on them?
[QUOTE=garry;35990038]Weird question, does anyone know of a tool I can run on my code that will scan #include's and automatically correct the caps on them?[/QUOTE]
you could write one in python/pearl/lua
[QUOTE=garry;35990038]Weird question, does anyone know of a tool I can run on my code that will scan #include's and automatically correct the caps on them?[/QUOTE]
If you mean remove the unneeded includes then I seem to remember there was one but no idea what it was called.
[QUOTE=DrLuke;35990068]you could write one in python/pearl/lua[/QUOTE]
I know I could, thanks for your confidence though.
[editline]17th May 2012[/editline]
[QUOTE=Richy19;35990088]If you mean remove the unneeded includes then I seem to remember there was one but no idea what it was called.[/QUOTE]
No I mean if the include is like
#include "public/HairyArse.h"
but the file is called
public/hairyarse.h
it changes it to
#include "public/hairyarse.h"
[QUOTE=r0b0tsquid;35967080][B]Another thing to think about is putting each set of faces (for each direction) into a separate buffer: this means you can render only faces pointing towards the player, which cuts the transform cost significantly. That's more of a fiddly thing though, you're better off getting it mostly working first before you go all-out on the optimization.[/B][/QUOTE]
Just wondering, why do this yourself and not just use GL_CULL_FACE?
[QUOTE=DrLuke;35990068]you could write one in python/pearl/lua[/QUOTE]
what's a pearl
[QUOTE=DrLuke;35990068]you could write one in python/pearl/lua[/QUOTE]
At least in Lua you could pretty simply use patterns to grab #includes and then use a replace function that has a list of the proper names for various headers in it.
Standard headers are all lower-case, though, so all #includes not ending in .h(pp)? could be simply fixed by removing all capitalisation. Other things would probably require a bit of file searching to get the proper filenames but that shouldn't be an issue. You could just scan through all the include directories. I guess.
[QUOTE=garry;35990148]I know I could, thanks for your confidence though.[/QUOTE]
Dont know about lua or perl but should be pretty easy in python.
Read the C/C++ file
go throught the lines and check if it starts with #include
if it doesnt move to next
if it does then get the name of the file it includes
scan through your source folder adding the name/location of each file to a list
turn the name of your included file to lower/upper case, and create a new list with just lower/upper case names
check the list and use the inder of the found item to get the real name of it using the original list
finally update the #include
simples.
He's asking for a tool to do it, not how to do it.
In the middle of making something in Construct , saves , closes , I open it up again , save file is corrupted.
Better start making backups from now on. Ugh. Maybe I should actually learn how to code rather than pseudocode
[QUOTE=swift and shift;35990210]what's a pearl[/QUOTE]
It's a programming language I just invented leave me alone
[QUOTE=DrLuke;35990068]pe[b]a[/b]rl[/QUOTE]
:(
Anyone very familiar with EGL/GLESv2 who can give me a hand getting the Broadcom-specifics of the Pi working with the EGL surface/context code in Chrome? I've added the dispmanx stuff, and here's where I am at the moment:
[code]
./chrome --use-gl=egl -log-level=0 and --enable-logging=stderr --vmodule=gl*=3
[1597:1597:1219673032:INFO:gpu_main.cc(85)] gpu_info_collector::CollectGraphicsInfo failed
[1597:1597:1219831736:VERBOSE1:gles2_cmd_decoder.cc(2139)] GL_OES_packed_depth_stencil not supported.
[1597:1597:1219842298:ERROR:gles2_cmd_decoder.cc(3031)] GLES2DecoderImpl::ResizeOffscreenFrameBuffer failed because offscreen FBO was incomplete.
[1597:1597:1219844701:ERROR:gles2_cmd_decoder.cc(2211)] Could not allocate offscreen buffer storage.
[1573:1573:1219850261:ERROR:command_buffer_proxy_impl.cc(134)] Failed to initialize command buffer service.
[1573:1573:1219854068:FATAL:image_transport_factory.cc(377)] Failed to make compositor shared context current.
[/code]
My understanding is that GL_OES_packed_depth_stencil is very much supported, and so I think my surface setup code is incorrect.
If you're well versed in this black art, then catch me on IRC (##hexxeh on Freenode) or email me (hexxeh@hexxeh.net). If you're interested in getting a Pi, then I might be able to hook you up if you can help me out with this.
[t]http://s.hruhf.in/2012-05/Project_TPC-2012-05-17_21.48.02.png[/t]
Yay Mobs!
Man, so lonely trying to find people to test your multiplayer games and no-one accepts.
[QUOTE=ZenX2;35987747]I just had to get the makefile to run properly, then I installed QEMU and did this:
[code]qemu -hda hdd.img[/code]
Worked instantly
[/quote]
I mentioned before, I got it to run in QEMU, just the kernel panics when trying to load utils.jmg. I'll try Overv's virtualbox fix.
[QUOTE=Instant Mix;35990560]In the middle of making something in Construct , saves , closes , I open it up again , save file is corrupted.
Better start making backups from now on. Ugh. Maybe I should actually learn how to code rather than pseudocode[/QUOTE]
It has an autosave feature btw.
[QUOTE=Murkat;35991299]It has an autosave feature btw.[/QUOTE]
I know, it was that that corrupted..
Hey what are your guys thoughts on Unity 3D?
Sorry, you need to Log In to post a reply to this thread.