Sunday, February 15, 2015

FMod - AbiatharOS

Today, I was doing some Windows deployments and reading about Windows PE (the boot images). I read that it's possible to create custom boot images, and I thought that sounded pretty interesting, so I checked it out. After some tinkering with the Deployment and Imaging Tools Environment console and some wrestling with out-of-date documentation, I managed to create a boot image that launches Abiathar.

Surprisingly, Abiathar actually worked - to some extent. I could create new level sets and mess with them all I wanted, but as soon as I tried to open or save (both of which open a Windows common dialog), Abiathar crashed immediately and the VM I was using rebooted. Also, since most items in the Help menu try to open a web browser and there is none in WinPE, nothing happens.

Before going into Visual Studio, I messed with the image some more and was able to change the WinPE desktop background picture from its blank purple to the Abiathar logo. I also successfully created an ISO file and booted from it in VirtualBox.

I spent some time poking around the code of Abiathar and determined that it wouldn't be too hard to get it working stably in WinPE. The following issues need to be addressed:

  • Where to load the config files from. Obviously, burning one into the image doesn't allow for much configurability. I rigged up a means of scanning all writable drives for a config file, and it works reasonably well.
  • What to do with the Help menu. I just had Abiathar detect whether it's running in PE and hide a bunch of menus if they would do bad things. The update checker is similarly disabled.
  • How to open and save files. I'm imagining a very basic home-grown file browser and an interface to switch between the real dialog and my custom one depending on PE-ness. (I want to keep these as the same code base.)
  • How to playtest the levels. I burned the portable version of DOSBox into the image and added a menu option for it if running in PE mode.
This might be a huge waste of time, but it's pretty fun. And who knows, maybe a lightweight bootable level editing CD might be a nice thing to have around.

Saturday, February 14, 2015

Clearing the Temporary Image File from a WDS-Captured Disk

If you use Windows Deployment Services to capture an image of a Sysprepped Windows OS, you have to save the WIM file to the local disk before uploading it to the server. This is somewhat inconvenient if you don't want to boot the computer to delete it, thereby wrecking the OOBE.

Fortunately, it's possible to get into the file system using WDS without booting up into the real OS - no other boot media necessary. Just boot into the capture image again and press Shift+10 when the wizard appears - a command prompt will come up. Navigate to the place you put the WIM file and erase it. You can cut the power to the machine safely, or close the command prompt and wizard to cause a reboot.

Friday, February 13, 2015

AJAX in ASP.NET

I did some searching on how to do AJAX with ASP.NET, and it actually took me a while to find useful information. It turns out that you don't actually have to know any JavaScript at all to get asynchronous web programming done in ASP.NET!

It's all done by using the UpdatePanel control. When a button inside one of those is clicked and if it modifies only the state of controls inside an UpdatePanel, the server will return only the contents of the panel, so there's no full postback/navigation/blink. It's so great and simple - the compiler takes care of all the JavaScript stuff. Controls can be added dynamically simply by doing a .Controls.Add(newCtl) on a Panel.

I am really looking forward to using this functionality to build great stuff with ASP.NET. Thanks Microsoft!

Wednesday, February 11, 2015

MMC: Control Panel at the Next Level

I've mentioned MMC before, but I really need to express how great it is. MMC stands for Microsoft Management Console. It's a one-stop shop for system administrators to control every aspect of their domain, a server role, or a computer. It can be accessed on any computer running the "Pro" edition of its OS - any computer that can be joined to a domain. Press Windows+R, type "mmc", hit Enter, and you get the amazing view of a blank MMC console.

It starts actually doing things when you add snap-ins. Hit Ctrl+M or choose "Add/Remove Snap-ins" under File. Add one or more snap-ins to the console by selecting them in the left pane, clicking Add, and configuring them as appropriate. (If you're a domain admin, you can remotely administer computers using MMC simply by typing the remote computer name in snap-in configuration, no Remote Desktop needed.) For example, "Local Users and Groups" lets you manage non-domain user accounts and groups on a machine. "Group Policy Object Editor" (which works whether or not you're on a domain) lets you tweak literally every setting you've ever heard of and also ones that are super obscure. "Disk Management" is great for establishing software RAID without third-party tools.

In fact, you've probably used some MMC snap-ins without knowing it. Device Manager is an MMC snap-in that, when launched from the advanced system properties, doesn't display the MMC chrome. Services and Task Scheduler are similar examples. Almost all of these can be found in Administrative Tools, but some super-big ones like Group Policy Object Editor can't be found there.

MMC is really great. Thanks Microsoft!

Tuesday, February 10, 2015

Gash - Plane Problems

I started implementing the function for NextGenGraphics that converts a bunch of raw data into pixel values. This of course has to take into account the bits per pixel of the graphics adapter and whether it shuffles the planes around like EGA. I thought it would be easy until I remembered the mask plane. If included in CGA, there would be three bits per pixel, which would be very messy if it was arranged linearly. Sadly, there is no format documentation on masked CGA data or CGAGRAPH, so I just have to figure out where CGA keeps the mask information before I can move on.

Monday, February 9, 2015

Gash - Understand Sprite Shifts

The ModdingWiki's format documentation on xGAGRAPH claims that there are 8 shorts in each sprite table entry. However, I did some reading of the ModKeen code and determined that there are 9. The extra one is the number of shifts the game will create for that sprite, used in smooth motion. The old GalaxyGraphics implementation knew about the extra short, but it simply called it "flags" and didn't know what to do. NextGenGraphics labels it appropriately and provides an enum of the three valid choices: 1, 2, 4.

Sunday, February 8, 2015

Printers are Frustrating

I am sure by now - printers are the most challenging and insanity-inducing area of information technology. There are ten bajillion drivers from which to choose and at least four ways of connecting computers to the printer.

Today I tried to connect an old (grayscale) HP LaserJet 4000 printer to my shiny new Windows 8.1 PC via a parallel card that I had to add because nobody uses parallel ports anymore. The drivers seemed to install themselves successfully after wrecking one hibernated state and then scribbling all over my mouse settings. I plugged in the printer and... nothing. The test page wouldn't print and all Windows would do was display an "out of paper" message despite there being no data activity on the printer end.

I then installed some manufacturer drivers from a mini DVD that came with the card. Those completely wiped the LPT1 port out of Device Manager. The printer continued to not work. (I do know for sure that it can print because it successfully outputted a printer configuration report page.) I tried installing drivers from other places. No dice, though the device did reappear in Device Manager.

Telecom used to be the hardest thing in IT. Now, it's printers. I'll continue trying to deal with this tomorrow.