Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 27 May 2010
Offline Last Active Jun 22 2013 01:13 AM

Topics I've Started

Writing my own programming language

27 February 2013 - 02:26 AM

Hello, I have been working on this project for some months now and I
want to show it to other people. Basically speaking, it's a programming
language which can be compiled and ran using a virtual machine. Here's a
detailed explanation I wrote in my blog:


                So, in last blog post I gave small introduction to my current
project that I am working on. In this blog I want to release the first
version of my current project. You can grab it from here: http://www.pradsprojects.com/despair.html

So, this piece of software that I wrote is a system to write portable
programs. It has its own programming language and the program that are
compiled can be executed using a Virtual Machine. The system isn’t
mature and lot of things are lacking but I hope to develop it further in
the future.

Let me talk a little about how this system works. You write a program
using its programming language (here’s the documentation of programming
language: http://www.pradsprojects.com/despair...ion/index.html)
then compile it using compiler tool that I have written. The compiler
generates a file with ‘.dbin’ extension which can be executed using the
Virtual Machine.

I have created a small IDE for developing program for this system
which you can download it from the project site (the one that I gave you
on the top). IDE consist of editor to write and manage source code
(which is fairly basic at the moment, no syntax highlighting for the
moment sorry), a compiler to compile the source code and a virtual
machine to run the compiled file.

Alternately, if you don’t want to create programs for the system but
want to run program created by others, you’re going to have to download
the VM from the project site. There are two types of VM for Windows OS:
interpreter version and JIT version (Dynamic Recompiler). The JIT
version is faster than interpreter version though I am still not very
happy with the JIT performance, I think it can be improved more. I will
port the JIT version to Linux later.

I want to create the Virtual Machine for various different platforms
like android, iOS, MacOS etc so that the program written using
despairLanguage can be run in different platforms. Currently the VM
works in Windows and Linux.

P.S: The software is open source and is on github. Links are on the project site.

So, I just wanted you guys to look at it and play around with it. Some feedbacks (good or bad) is highly appreciated.


Simulating keystrokes for directx application

27 March 2012 - 07:00 PM

Hello, I am trying to create a keystorke simulator to control games like NFS World. I tried using SendInpu, and it works great for notepad and explorer window but doesn't for for directx applications. Here my code, it sends DOWN key every 1 second:

#include <Windows.h>
#pragma comment (lib, "Winmm.lib")
#define DIKEY_DOWN  0x04D0
int main() {
KEYBDINPUT keyB = {0};
keyB.wScan = DIKEY_DOWN;
in.ki = keyB;
DWORD prevTime = timeGetTime();
DWORD currTime;
while (true) {
  if (GetAsyncKeyState(VK_ESCAPE) & 0x8000) break;
  currTime = timeGetTime();
  if ((currTime - prevTime) >= 1000) {
   SendInput(1, &in, sizeof(in));
   prevTime = currTime;
return 0;

I am testing this code in Windows 7.

So, are there anyway to simulate key that works for directx applications? Thanks...

Wave frequency question

09 October 2011 - 04:17 AM

So, 1 Hz Frequency wave looks like this: (The middle line is 0 amplitude)

Posted Image

But what if wave looks something like this:

Posted Image

Is it still 1Hz? Sorry if this is a stupid question.

Sound pops and clicks - XAudio2

16 September 2011 - 09:55 PM

I have to play different quadrangular waves of 12.5%, 25%, 50% and 75% duty cycle to create melodies. So far I have been able to get melodies right but one problem exist and that is when I try to start and stop the sound, it gives me nasty pops and clicks sound. The program has to start and stop the sound quite a lot so there is lot of pops and clicks. One way I have found to get rids of these pops and clicks is by instead of starting and stopping the sound, I just start it once and then change the volume, if I am starting the sound I change the volume to 1 and if I am stopping the sound I change the volume to 0. This method works but I am not sure if this is a good or the right method to stop sound. So, can anyone tell me how I can get rid of pops and clicks when I am starting and stopping sound?


Updating Texture Regularly

11 July 2011 - 11:05 AM

Ok, I need to create a IDirect3dTexture9 that I have lock in every frame and update it. I have never done this before so I just wanted to know how to do it properly. Should I create a texture, lock it in every frame, unlock it and then render it? Can you give me a small example or article? Thanks!