MobiReg - Beta 1

Illustration

I created small registry editor for windows mobile devices. With it you can browse your registry and perform whatever change you wish. It supports string, binary, DWord (32-bit), QWord (64-bit), multi-string and expandable-string data types. Additionally to that, there is support for both Smartphone (Windows Mobile Classic) and Pocket PC (Windows Mobile Professional) platform in single executable.

You can download first beta here (cab installer) [2009-04-21: final version is out]. In order to run it, you may need .NET Compact Framework 2.0 or higher (if it is not already installed).

Starcraft Color Problem

[2010-08-12: It seems that perfect solution is found. Start reading article from bottom. :)]

Illustration

I like Starcraft. Both playing and watching it. However, since I installed Windows 7, each time I run it, screen goes into weird color. Half of color palette just goes into cyan.

This is usually restricted to menus. Once game starts, everything looks fine (ok, water has artefacts too), but from time to time, whole game gets garbled. There is nothing to do other than exiting game.

I tried various settings on compatibility mode without real success. Setting compatibility mode to Windows XP (where game looks good) made things even worse since Starcraft started reporting that it cannot load a file (font\font.gid). Neither combination of settings got palette problem solved.

Unrelated googling threw me a solution. Just open Screen Resolution window and run Starcraft (with that window still open). Colors are as they should be.

I haven’t tested this on Vista yet, but if you have a same problem, it is worth a shot.

Why exactly this works - I have no idea.

Illustration

[2009-03-06: Notice that you still need some compatibility settings. Here are ones that work for me in Windows 7. Disabling display scaling enables me to have higher DPI (120%) and still use my map (otherwise, place I select on map isn’t place where I end up). Without disabling desktop composition, I cannot even switch to game and without administrative rights you may stumble upon some problems if you are running from Program Files folder (write forbidden for normal users). Checking other stuff didn’t make anything better, so I left it off.]

[2009-06-09: With Windows 7 RC, things got worse. Even with every checkbox selected, Windows 95 compatibility mode and resolution screen open, I cannot reproduce proper screen every time. Sometimes it works properly, sometimes you can get it to work by pressing Alt+Tab repeatedly, and sometimes it is best to exit and enter again.]

[2009-08-28: This workaround works for final version of Windows 7. It does not work every time but success ratio is well over 50%.]

[2010-08-12: One annonymous commenter suggested solution that includes registry changes. All I can say is that it really works. I did test it only on Windows 7 (64-bit version) and it works perfectly. I do hope that it works on other versions (Vista also). I took liberty of packing those two hacks into one zip file. Do leave comment if you find it working (or not) on other versions.]

[2017-04-19: With patch 1.18, issue is finally resolved.

Edit and Continue

Illustration

Long time ago, I have sinned. Yes, I used Visual Basic 6.0 to make programs. Even worst, I got paid to do so.

My work involved working with medical devices (oh, AxSYM, how I miss you…) there was one killer feature for me. Ability to set breakpoint, change some code and resume from that point was priceless. I would connect to device, when something in communication goes wrong, I would edit code in place, fix a bug and continue onto next packet. I could afford myself to be lazy (ok, there were timeouts to consider) and fix few bugs that occurred in single session. How did I liked it.

When .NET came I was missing that feature. I cannot say I was too sorry for old VB since new VB.NET was so much more powerful, but some things took a little more time and concentration to be done.

For Visual Studio 2005, there was a treat for me. They reintroduced that very same feature as “Edit and Continue”. It wasn’t as good as one in Visual Basic 6.0, even small changes would force you to restart, but smaller adjustments were possible. Life was good.

Recently, I switched to 64-bit system. I figured that since 64-bit systems were gathering momentum, so should I.

Illustration

It was not as smooth transition as I hopped. There were driver problems, non-working 16-bit programs, some API calls that kept failing since I had int instead of IntPtr. All those things are nothing compared to not having “Edit and Continue” again.

Not only that I lost it, there is stupid dialog that reminds me of it every time. You can turn whole feature off in order to prevent that annoying dialog, but then you cannot play with it even on 32-bit applications (yes, feature still works if you compile for x86).

I do not use it often anymore. It is just to annoying to switch between Any CPU and x86 platforms. However, when I have some weird problem at hand, and I see that lot of debugging is involved, switching temporary into 32-bit world is small price to pay.

When to Go X64

Illustration

Sometimes it is hard to tell wether to work in 32-bit or 64-bit world. Here are some hints.

Hyper-V

This one is easiest. To use Hyper-V you must use x64 windows. End of story.

Windows XP

This was first consumer choice of 64-bit operating system and as such it had some problems. You can argue that most (if not all) problems were caused by lousy drivers, but fact remains that there were problems. Later drivers fixed this situation, but I would not recommend this version to anyone.

Vista / Server 2008

Here situation depends mostly on memory. It is easy if you have more than 4 GB of memory (e.g. 6 GB). You must use 64-bit windows to use all that memory. There is choice of using 32-bit Windows Server with PAE which then enables usage of more memory, but I would not recommend it since performance cost for that memory is too high.

Here I must say that 64-bit drivers are really stable now. Device manufacturers really learned their lesson with Windows XP x64 and now everything works as it should. There can be some issues with finding proper and signed driver (driver signing is requirement) for older devices, but for newly bought devices everything just works.

When you have just 4 GB of memory there is slight dilemma. 32-bit windows will see less than 3.5 GB (even with /3GB switch). Rest of memory will be simply unavailable. However, in 64-bit world pointers are bigger (eight bytes instead of four) so all that additional memory is just used for larger pointers. Useful memory (used for data) is roughly the same.

Here I would go with 64-bit Windows (if all drivers are available). You will have no advantages now but if you add more memory to your computer, there is no need to reinstall anything. Also, from developer perspective, you can track those pointer bugs (e.g. .NET interop calls) more easily since most of them are there because someone decided to put pointer (64-bit value) in integer (which is 32-bit value even on 64-bit system).

When there is less than 4 GB, memory is just wasted if you go 64-bit.