siwu's blog sir, i'm certified cpr ! 2008-09-12T16:51:30Z WordPress http://siwu.info/feed/atom siwu http://siwu.info/ <![CDATA[SeeqSharp: Use SeeqPod from C#]]> http://siwu.info/82/seeqsharp-use-seeqpod-from-c.html 2008-08-27T12:42:54Z 2008-08-27T12:38:08Z Hey folks! Long time no see!

Disclaimer: I do not condone piracy and/or stealing. Use at your own risks. Also continue to use the real SeeqPod service, as they are doing a great job.

Just a quick post to let you guys know about a small library I did yesterday. With this library it is possible to make searches on SeeqPod right from C#. I did this library because there was none available, and more specifically none that was compatible with the SeeqPod cache. You see, the mp3 locations you see sometimes are invalid, but happen to work in the SeeqPod flash player. That's because SeeqPod caches the mp3 it crawls (it seems). So here it is, Seeqsharp :)
The project is hosted on Google Code. And you can also download the demo application.
Here is a screenshot of the demo application:
Seeqdownloader Screenshot

And a quick code sample:

  1. Playlist results = Playlist.Search("nine inch nails");
  2. Console.WriteLine("Found " + results.TrackList.Count.ToString() + " items.");
  3. foreach (Track track in results.TrackList)
  4.     Console.WriteLine("Title: " + track.Creator + " - " + track.Title + " - Location: " + track.Location);

]]>
0
siwu http://siwu.info/ <![CDATA[GTA2 Classics Stuck at 640×480 (and fix!)]]> http://siwu.info/80/gta2-classics-stuck-at-640x480-and-fix.html 2008-05-26T16:30:37Z 2008-05-23T00:35:40Z Lately with friends we've been having some multiplayer fun at GTA 2 Classics Edition (the free one that you can download at Rockstar Classics). I'm amazed to see how cool this game still is in multiplayer. BUT, there was a but. As of now it was impossible to make it run at more than 640x480, despite setting higher resolutions on the GTA 2 Manager. While it's not a big issue, it's still annoying nonetheless.
So I've looked and looked and looked and looked on the net to find some kind of answer. While I did find some people who had the same problem as me (and all my friends for that matter), I did not find any answer.
Because I'm not desperate, I've took my tools and started decompiling GTA 2 (;))
Long story short, here is a patch to activate high resolution on GTA 2 Classics Edition (aka 9.6F) only:

gta2patch.exe (7 kb)

Please bear in mind that this patch is VERY ghetto. It doesn't even check if you are patching the right version, so USE AT YOU OWN RISK!
For the details, the source code and the alternate methods (if you don't feel like downloading and launching an executable from an unknown source), hit the jump.

I won't go into big details but it seems at some point the code to detect whether or not your graphic card is capable of handling high resolution screws up decides that it can't and falls back into "safe mode" by setting a flag. For another weird reason, the flag is not set when a registry key is.
Try to set the DWORD key skip_frontend to 1 under HKEY_LOCAL_MACHINE\SOFTWARE\DMA Design Ltd\GTA2\Debug and it should launch the game at high resolution. The problem is, the game fails telling you that it can't open some file. Whatever.
So what did I do, well, I simply patched the fail-safe code, by forcing high-res.

If you want to patch it yourself, take you favorite hex editor and open gta2.exe. Go at offset 0x000CB2C9, and replace 74 1D by EB 1D (forced jmp ftw).

Finally, if you want to compile the patch yourself (some people do I guess!), here is the code! I told you it was ghetto!

  1. #include <windows.h>
  2. #include <stdio.h>
  3. #include <conio.h>
  4.  
  5. int  main(int argc, char **argv)
  6. {
  7.     char *patchFile = "gta2.exe";
  8.     char *backupFile = "gta2.original.exe";
  9.     long patchOffset = 0x000CB2C9;
  10.     unsigned char patchData[] = "\xEB";
  11.  
  12.     printf("GTA2 Classics Edition High Resolution Patch\n");
  13.     printf("by siwu (siwuzzz@gmail.com)\n\n");
  14.  
  15.     printf("This program will patch %s to allow high resolutions\n", patchFile);
  16.     printf("on systems that don't work.\n");
  17.     printf("It will also create a backup file called %s\n\n", backupFile);
  18.  
  19.     printf("Press any key to patch!\n");
  20.     getch();
  21.  
  22.     if (CopyFile((LPCSTR)patchFile, (LPCSTR)backupFile, FALSE) == FALSE)
  23.     {
  24.         printf("Unable to copy %s to %s! Press a key to quit!\n", patchFile, backupFile);
  25.         getch();
  26.         return (1);
  27.     }
  28.  
  29.     FILE *gtaFile = fopen(patchFile, "r+");
  30.     if (gtaFile == NULL)
  31.     {
  32.         printf("Unable to open %s! Press a key to quit!\n", patchFile);
  33.         getch();
  34.         return (1);
  35.     }
  36.  
  37.     fseek(gtaFile, patchOffset, SEEK_SET);
  38.     fwrite((const void *)patchData, sizeof(unsigned char), sizeof(patchData) - 1, gtaFile);
  39.     fclose(gtaFile);
  40.  
  41.     printf("Succesfully patched %s! Press a key to quit!\n", patchFile);
  42.     getch();
  43.  
  44.     return (0);
  45. }

]]>
4
siwu http://siwu.info/ <![CDATA[DWMaxx: Back to business]]> http://siwu.info/79/dwmaxx-back-to-business.html 2008-05-14T12:28:27Z 2008-05-14T12:28:27Z It's been a solid 3 months since I've last worked on DWMaxx. I am just posting this quick post to tell everyone that I'm resuming work on it. I've had a LOT of computer problems (my 2 computers died), and a lot of real life stuff to take care of.
Moreover, after my computer died and I pretty changed everything in it (cpu, mobo, ram), my second computer died too. Which left me unable to work on DWMaxx at all (2 computers needed, as one is for debug).
So what's to be expected?

First of all, moving to uDWM.dll from Vista SP1. DWMaxx will be distributed with it's own uDWM.dll because finding RVAs using a PDB download process of msdl.microsoft.com is a pain in the ass. And let's not even talk about compiler optimizations.
Second, I've been trying to have 3D transformations on windows working, as well as improving stability. 3D transformations is pretty tricky: for instance, CWindow3D::ValidateVisual() forces the 3D version to be displayed ONLY when doing the minimize/maximize animations. If it finds it's not animating, it will force the original 2D window to show and hide itself. It's hard in the code. That's also why Flip3D has it's own 3D window class. But I can't use it since the class asks for a CFlip3D object.
So what can I do? Well, do it the hard way in the MIL protocol itself.
At the moment, here's what I have:

  • Creating a new 3D object (not CWindow3D)
  • Tying it to the original 2D CVisual Window
  • Creating the 3D viewport
  • Setting the 3D viewport view matrices

What's missing is the command to tell MIL to display the viewport. And of course everytime I test I have to restart the DWM because it crashes (hence the 2nd computer).
Anyway, I'll keep you guys informed of how everything falls into place, and release a DWMaxx demo pretty soon.

]]>
10
siwu http://siwu.info/ <![CDATA[Computer outage 2: the PSU strikes back]]> http://siwu.info/78/computer-outage-2-the-psu-strickes-back.html 2008-02-21T00:52:31Z 2008-02-21T00:38:15Z I know you folks pretty much don't give a damn about my computer problems, BUT I feel like I need to say it anyway. Since yesterday I started having problems again with my computer. It would not restart in a loop, but this time, just freeze, usually after 10-15 mins. After looking everywhere, I stopped to look at the voltage levels, and... oh crap.

Vcore: 1.48v to 1.608v (set a 1.6v)
+3.3v: 2.7v to 3.08v
+5v: 4.3v to 4.7v
+12v: 11.3v to 11.5v

Holy shit! Look at that +3.3v! Something was definitely wrong with the PSU or the Mobo. I immediately tried with another PSU (a 220w from my HTPC, pretty weak compared to my actual 350w), and bam, levels back to normal.
So I guess all my problems came from the PSU after all...
UPDATE: Well, I was wrong again. My computer just crashed with the temporary PSU. Perhaps I'll try a more powerful one.

]]>
1
siwu http://siwu.info/ <![CDATA[Meh body be hurtin]]> http://siwu.info/76/meh-body-be-hurtin.html 2008-02-18T15:32:10Z 2008-02-18T15:31:42Z So saturday night some friends and I went to see Black Bomb A, a french metalcore band, in concert. How was it? Well, I almost broke my nose (I took some guy's head in the face), my thumb is hurting, my arms/neck/back muscles are soared, and I slept 13 hours straight the night after. To put it shortly, awesome.

Black Bomb A

When I was younger (roughly 5 years ago) I used to listen to them a lot and go to their concert, but when one of the singers (the lower tone one), Djag, left and was replaced with another guy with a more "conventional" metal voice, Arno, I didn't really like the new sound and kinda stopped following their news, but would still listen to the old albums.

Fast forward to November 2007, my best friend tells me that the new singer is leaving the group and that Djag will take on for a few concerts! W00T! Of course, we rushed to the concert, and boy, was it awesome. What energy they have! Simpy amazing. Added to the fact that it has been 5 years since I've been in a mosh pit :)

So you can imagine my joy when I knew they were performing nearby (Velizy, 78, France) last saturday! We got to the concert, the venue was quite big but there weren't many people, too bad! But it didn't stopped us from mosh pitting and slamming a few times ;)

So now, my body is aching, but that was well worth it!

Of course I urge you to listen to a few songs I found on Seeqpod, after the jump!
And of course, a video with a crappy sound of an old live (2002):

]]>
0
siwu http://siwu.info/ <![CDATA[Computer Outage - Not?]]> http://siwu.info/75/computer-outage.html 2008-02-12T10:16:00Z 2008-02-11T11:48:16Z There may be a stall in the development of DWMaxx for the next two weeks, because I think my motherboard is dying (Asus P4P800 Deluxe). I spent the whole weekend trying to revive it, it works sometimes, sometimes it doesn't.... Well, after 3 days and nights and 100€ on a new hard drive, it seems I'll have to let it go... After all, it's been on 24h/24 for the last 5 years... And because everything has evolved, I can't just buy a new mobo, I'll need a complete upgrade (from the CPU to the GPU). And I'll do it when I have the money, that is probably at the end of the month!
In the mean time, I'm still trying to make it work again, because I'm not as coffy on the laptop :)

UPDATE 12/02/2008: It's alive! True magic involved here. Read on for the whole story.

So yesterday, when I got back from work, I gave a try to boot the computer, and this time it started, but it did the same as it would do with it would boot: boot, but being INCREDIBLY slow on the BIOS screens. Anyway, it booted, sweet. But when I unplugged it to put it back in it's proper place, and plugged it in, it wouldn't boot anymore, with the dreaded "System fail CPU test" in a loop on the speakers.
For the story, there is a small LED light on the mobo, and when you turn the computer off, it should turn off too, but it wouldn't (the PSU was fully unplugged). Also, the reset CMOS procedure wasn't working (I would try to reset the CMOS, and when it would boot, the settings were the same as before). So what I tried was to left it unplugged without any juice whatsoever, removed the battery, and went to work. When I got back, the LED was still on, after a whole day without juice... Something was weird. I guess in a desperate move (and with some true magic), I unplugged my external hard drive. And bam, the computer booted! Without being slow in the BIOS! So my guess is a ground issue. The USB hard drive perhaps was supplying current to the mobo through the USB port. Anyway, it's alive now, and I'll try to keep it that way for a while :)

]]>
5
siwu http://siwu.info/ <![CDATA[DWMaxx going Open Source]]> http://siwu.info/74/dwmaxx-going-open-source.html 2008-02-04T10:33:44Z 2008-02-04T10:32:38Z I've decided that for the good of this project, I may be best for it to go open source. So that's it, DWMaxx is open sourced! It is distributed under GPLv2 (to prevent people from using it for commercial purposes). Of course, it doesn't mean that I'm letting this project down, not at all! But I don't want it to finish like SPrintWindow (I still have to commit the sources somewhere...).
I'll try to comment the code as often as I can, and write documentations too.

Anyway, you can now find everything on the DWMaxx Google Code project page.

On a side note, I've been working pretty hard to get 3D window rotations working. I think I'm on something, but it might be trickier than I thought (because theses things are quite hard-wired inside the DWM). I'll keep you guys posted.

]]>
38
siwu http://siwu.info/ <![CDATA[DWMaxx: Z Rotation]]> http://siwu.info/73/dwmaxx-z-rotation.html 2008-01-30T10:01:54Z 2007-12-19T00:53:40Z So yesterday I spent most the evening and night rewriting some of the low level code, to interact more directly with MIL (on which DWM sits). The result is a much faster code, and thus creates smoother animations. This also allowed me to implemented Z Rotation :)

Once again, pardon my AGP card for the slow capture framerate :(

]]>
6
siwu http://siwu.info/ <![CDATA[Sinapse running DWMaxx]]> http://siwu.info/72/sinapse-running-dwmaxx.html 2007-12-19T00:43:13Z 2007-12-14T21:19:40Z Quick video of one of the first shots of Sinapse running in pair with DWMaxx, hope you'll like it ;)

]]>
3
siwu http://siwu.info/ <![CDATA[DWMaxx: Another Quick Tech Demo]]> http://siwu.info/70/dwmaxx-another-quick-tech-demo.html 2007-12-19T00:42:04Z 2007-12-13T02:19:19Z So tonight I tried to make Sinapse run with DWMaxx. The two mains issues were that Sinapse is old, and that I was running into some kind of lags.
Basically, when I would resize the window in the animation loop, the window would not resize. After tweaking everything in my code, something came to light.

DWM uses timing magic to minimize the number of scene rendering is has to do! When idle, for instance, my desktop runs at 2 fps (according to Fraps). And indeed, when I change the size of the my window, the scene doesn't get redrawn. But thankfully, the DWM has also the less known DWM Frame Timing API. Basically, this API allows you to control the rendering frame-rate of the screen, according mostly to "refreshes" (V-Sync) signals. So, indeed, I requested my frame to get redrawn after I change a window size.

Also, I've added the possibility to change the window's position (regardless of it's real position, it's only graphic).

And here's what it looks like, running inside Sinapse (which is being rewritten):

]]>
4