I released a new module earlier this evening. It’s a logging module allows you to log messages with varying levels of severity to one or more log writers. This is destined to replace my old and crusty muttley.logfilehandler module with something a bit more flexible.
Log writers are included which write messages to the console, to files and via UDP to Syslog servers, and you can also create custom log writers by deriving a new one from the TLogWriter base class. Logging severity levels are based on RFC 3164 for the BSD Syslog protocol
You can specify the level of logging you wish a log writer to receive and only messages that fit within that level of logging will be written. Therefore you can have enhanced logging whilst in Debug mode, etc.
This is licensed under the Artistic License 2.0, which is a fairly sane and permissive license.
The module requires the bah.boost and bah.datetime modules. Additionally, if you wish to be able to run the unit tests provided you will also need the bah.maxunit module.
In the last day or so I’ve been tinkering with some C64 coding again, so I thought a little post about the tool chain I use might be in order.
Here’s a list of the basic software I use:
DASM
I use an unofficial version of the DASM cross-assembler released by the guys at Covert BitOps. You can download it from their Tools page, along with other goodies.
Just unzip this wherever you want it. For example I have it installed in C:\Tools\DASM
For extra niceness you can then add this directory to your path.
WinVICE
VICE is a superb Commodore 64 (as well as C128, VIC 20, Plus4, etc.) emulator which you can get here: http://www.viceteam.org/
Just unzip this wherever you want it. For example I have it installed in C:\Tools\WinVICE
Again put it in your path if you wish.
TextPad
TextPad is a nice text editor for Windows that I’ve been using for years as a Notepad replacement. It’s not free, but it’s not hugely expensive either. You can download a demo version to try out from here: http://www.textpad.com
Now download my syntax highlighting configuration for TextPad, and copy it into TextPad’s system directory. This is a sub-directory of the location you installed TextPad, which in my case is: C:\Program Files (x86)\TextPad 5\system
Now we can configure TextPad. The following steps are for version 5.3.1 which at time of writing is the latest available.
First we need to create a new Document Class:
Select the Configure -> New Document Class menu item.
Give the new class a name and click Next.
Add *.asm as a class member (this file extension is commonly used for assembly code, but you can use something else if you prefer) and click Next.
In the next screen make sure Enable syntax highlighting is ticked and select the dasm6502.syn syntax definition file in the drop-down menu and click Next.
You’ll now be shown a summary screen. Click Finish.
Next we have to set up some External Tools so TextPad can compile our code for us. First the assembler:
Select the Configure -> Preferences menu item.
In the left-hand hierachy view select the Tools section.
In the Add drop-down menu on the right, select Program, navigate to your DASM folder and select the dasm.exe executable.
This will add a tool called Dasm in the tool list. You can select this and press F2 to rename it to something else, for example I call mine Compile with DASM.
Press Apply.
In the left-hand hierachy view select your newly created tool in the Tools section, this will then show up an options panel for it on the right.
Set Parameters to: $FileName -o$BaseName.prg -v0
Check the Save all documents first checkbox
In the Regular expression to match output, enter the following regular expression:
In the Registers section, set File to 4, Line to 2 and leave Column empty.
Press Apply and then OK to save your changes and exit the preferences.
Now we add another tool to allow us to actually launch our compiled code:
Select the Configure -> Preferences menu item.
In the left-hand hierachy view select the Tools section.
In the Add drop-down menu on the right, select Program, navigate to your WinVICE folder and select the x64.exe executable.
This will add a tool called X64 in the tool list. You can select this and press F2 to rename it to something else, for example I call mine Run in WinVICE.
Press Apply.
In the left-hand hierachy view select your newly created tool in the Tools section, this will then show up an options panel for it on the right.
Set Parameters to: -autostart $BaseName.prg
Press Apply and then OK to save your changes and exit the preferences.
Testing it Works!
Now create a new file in TextPad and paste the following into it:
; A small program to test our configuration
processor 6502
org $c000,0
ldx #$00
ldy #$00
loop stx $d020
sty $d021
inx
dey
jmp loop
Save this file as test.asm and you should see that the code now has some syntax highlighting.
Next, in the Tools -> External Tools menu select the Compile with DASM (or whatever you called it) tool. In the Tool Output window at the bottom of the screen you should see something like the following:
DASM V2.12.04, high level Macro Assembler
(C)Copyright 1988 by Matthew Dillon, All Rights Reserved
Improvements (C)Copyright 1995 by Olaf 'Rhialto' Seibert, All Rights Reserved
Tool completed successfully
Click inside the document again (to make it the active document) and then select the Run in WinVICE (or whatever you called it) tool. TextPad should then launch WinVICE and load the compiled program, you can then launch it by typing SYS49152 and hitting return in the WinVICE window and see something like the following:
You may be wondering what that huge regular expression that we added to the DASM tool configuration is for, well it’s rather neat. Create a new test.asm file and copy and paste the following code into it:
; A small program to test our configuration
processor 6502
org $c000,0
ldx #$00
ldy #$00
loop stx $d020
stc $d021
inx
dey
jmp loop
This code has an error in it, and if you compile it you will see something like the following in the Tool Output window:
DASM V2.12.04, high level Macro Assembler
(C)Copyright 1988 by Matthew Dillon, All Rights Reserved
Improvements (C)Copyright 1995 by Olaf 'Rhialto' Seibert, All Rights Reserved
unknown mnemonic: 'stc'
line 10 test2.asm Unknown Mnemonic
Aborting assembly
Tool completed with exit code 1
Now, here’s the clever bit. Double-click on the “line 10 test2.asm Unknown Mnemonic” error message; TextPad will automatically jump your cursor to that line in your source file. Even better, if the error was in an include file isn’t open for editing, it will open the file in question automagically for you and move the cursor to the correct line. Very cool.
Anyway, this should be enough to get you up and running doing some coding on the C64, but there are other tools that can assist which I may go over in another post.
I just keep coming back to Devin Townsend’s new album, Ki. I love this album.
When it first popped through the door I wasn’t really sure (crappy CD player in the kitchen accompanied by noisy kids is not a good listening environment), but since then I’ve played it a lot and it’s really grown on me to the point that it’s probably getting up there with my favourite albums of the last few years. It’s very mellow and angsty, and quite different from his previous stuff, but this is a man baring his soul to the world and is incredibly beautiful and moving. There’s some wonderfully tasteful guitar going on too; stuff you’d normally expect someone like Gilmour to do. Plus he somehow manages to make clean guitars sound heavy at times.
Here’s a few YouTube links containing some stuff from Ki (crap audio quality as always with YouTube unfortunately):
Can’t wait for the next album. If it’s even half as good as Ki we’re got a real treat in store.
Finally PC users can experience the wonders of my mate’s game, Space Giraffe, the game that Braid developer Jonathan Blow compared to Ulysses. Something that until now was only available to lucky Xbox 360 owners.
From the Llamasoft site:
This is more than just a copy of the Xbox 360 game! In the intervening time the development of the Neon engine has continued, and we now have a lovely new shader library. These new shaders have been used to create a NUXX mix of Space Giraffe which is at once much nicer-looking than the original, and alsoless intensely psychedelic (one criticism of SG 360 was that some of the effects were *too* intense; accordingly the new mix is beautiful and abstract without being quite so overwhelming).
For those who do enjoy the full-on psychedelia of the original, that is still available, because SG PC comes with two packs of 100 levels each - the NUXX smoother mix and the Acid Mix which is the levels from SG 360. We also added the capability for us to make available further level packs - which can be completely new levels rather than simply remixes - should there be sufficient interest. We could make chillout level packs, ultra-intense packs, shorter game packs (maybe 20 levels instead of 100 for those who want a shorter game), special themed packs to celebrate Christmas or L. Ron Hubbard’s birthday - whatever people would like.
I’m especially pleased, as I created one of the sound effects for the game (the feedback monsters), usng only my collections of guitars, my Marshall amp and a copy of Cakewalk SONAR.
The RetroRemakes 2008 Competition has started, and this year I’m going to enter. So, after a few days tinkering with my game engine, I”ve actually started work on it.
I’m doing a remake of Bank Panic (one of my fave arcade games that I never actually played untl MAME came along). Anyway, as I can’t draw I decided to have a play with using vector graphics for everything, and here’s the results of 4 hours of experimentation with Inkscape trying to do the money bag logo, along with the original for comparison:
I think I need to get a bit more practice in before I start trying to make the main characters (rotoscoping FTW).
I’ve set up a small discussion forum. This will be mainly for information and support purposes for my BlitzMax modules to start with. Not much there yet, but I’ll start adding things over the next few days.
There’s also a section for discussing the RetroRemakes Framework, so if you have any questions or suggestions, that’s the place to post them.
The first YakYak Programming Competition has finished, and we’re awaiting the results.
This “Just for Fun” competition had a straight-forward remit:
pick a *minimum* of 10 of your favourite yakak forum members to greetz in your demo, and at the end write a special greeting to the Yak. You can greet as many yakyakers as you like, but don’t make your demo too long (or too short).
Sounds simple enough, eh!
Well, we had from the 11th June to the 13th July to complete our entries. Needless to say the 13th July arrived and I hadn’t even started. *oops*
Luckily there were several others in the same boat and so the competition was extended by a week with a new closing date of the 20th July. Of course that meant I put things off a bit more and didn’t actually start work on my entry until the 17th. *double oops*
So, 4 days to knock a demo together, no problem. Except it didn’t turn out to be 4 days, it was 3 as the wife wanted to watch a film Saturday night (Sweeney Todd. Very good.). So, 3 days, no problem… well, I say days, but what I really mean is a few hours a day for 3 days… *eeek*
Anyway, I just about managed to pull things together in time, and the initial response I’ve had has been very flattering.
The demo is an old-skool romp, complete with starfields, scrolling messages, flashing colours… and a nice little sneak peak at something else I’ve been working with a friend at the end.
Anyway, you can see for yourselves at the links below (thanks go to RiK and Devlin helping out compiling the OSX and Linux versions respectively)