Programming

Dennis Ritchie, father of Unix and C, Has Passed Away

0

Dennis RitchieDennis Ritchie, creator of the C programming language and co-creator of the Unix operating system, has died aged at the age of 70.

Thank-you for giving us a superior language, and being a pioneer in the age of computing. Rest in peace!

/* for Dennis Ritchie */
#include <stdio.h> 

main() 
{
    printf("Goodbye World");
}

ZD Net Article: http://www.zdnet.com/news/dennis-ritchie-father-of-unix-and-c-dies/6314570

Wiki entry on C: http://en.wikipedia.org/wiki/C_%28programming_language%29 

Telling Git To Ignore File Permissions

0

So, I have been having issues with git and repos. Im still extremely new to git (having used subversion for years) so every once in a while I run into something that makes me want to keep going back to svn. Today was such a day when I discovered that git didn’t like that some of the permissions had changed on the files within my repos.

Most of this problem for me occurs from working on files both in Linux and Windows, so its natural that samba will change some of these permissions. So, after reading the manual for a while, I discovered I could issue the following:

git config core.filemode false

This will instruct git to ignore changes to file permissions! Yay! Migraine easing. And according to the git manual:

core.fileMode
    If false, the executable bit differences between the index and the
    working copy are ignored; useful on broken filesystems like FAT.
    See git-update-index(1). True by default.

And there you have it 🙂 Pretty straight forward, and saved me from having to buy more headache pills 🙂

Prototyping New CNC FlexIO Program

2

CNC TouchScreen PrototypeI have been working on a new version of my FlexIO program for quite some time new, which has a lot of new features in it including use of wXwidgets for the GUI interface, better accuracy, and even more tools & control for the operator using it. This week I have finally began connecting stepper motors to it, and doing some real motor experiments.

There have been other significant improvements to the program as well, especially on the controller side. It is still using the Parker 6K4/ZETA4 Combo, only now with the new code the communication between the hardware and the controller is much more effective. It also does not need such a high end PC to run, as now there is no DirectX requirements, there doesn’t need to be any high refresh rates. This was a problem with the MicroATX computer used on Joshua, and a problem of the old program anyways. We all do crazy things when we have very little time to complete a project 🙂

Now that the new program is going through the final paces of it’s hardware testing, I hope to have this finished and out of the way within the next couple of weeks depending on how many free nights I get to work on it. I have a lot of other projects building up that I need to work on! Click on any image to see an enlarged version.

In the above picture: Hardware setup from the original FlexIO Classic program. On the left are 3 ZETA83-135-MO Parker stepper motors, each connected to a ZETA4 controller box (the 3 stacked units to the right of the motors). These are then connected to the Parker 6K4 controller box (the large box to the right of the ZETA4 units, with 4 red LED’s on the top) which controls the motor’s movement. The 6K4 is then connected to the PC via an RS-232 connection, which receives instructions from FlexIO. During the development process, laying the motors out flat like this is a good way to test the motor communication & the programs ability to switch between motors and steps accurately and smoothly, without damaging any real hardware in the event that a problem might occur.

Screenshot of the current beta program interface for setting up the cable being processed:

FlexIO V3 Screenshot - 06/13/2011

Creating A New Game & Framework In 30 Days – Piles’o’Tiles for Android/iPhone \o/

0
The Big Arrow - PilesOTiles

Click To Enlarge The Image

It’s been a while since I did any work on my games, which really is a shame as I still play my own games from time to time, and people are still buying them and playing them too. So, I have decided that I would motivate myself with a “New Game In 30 Days” type blogfest, where I port the old game to a brand new format in the space of a month!

The first game I picked to port is my popular Piles’o’Tiles Mahjong game, its been long overdue to be overhauled and is still fairly popular amongst players. On top of porting the game, within the same period of time I plan to develop a re-usable game framework that I will use in all of my games, so after Tiles I can easily jump in and start porting my other games such as Jelly-Othelly, Crazy Crystals and my unreleased WordHunter games. I also have some ideas for a few new games, but need the framework before I put together some experimental test versions, and see how bad the idea sucks when it’s played for real!

The plan is to have tiles in an almost-ready state by the end of the month, and from there I can fix any small issues, tweak a few bits and pieces and then release not too long after, if it even takes that long.

Today is Day 4, and most of the screen switching framework is in place, graphics are loading and being processed accordingly, and most menu/gadget functions are in and working. Once a few little things are fixed, the next steps are to start adding actual game code, such as level rendering and a few other parts critical to testing the rest of the game itself. Once they work, then I can start on the menus and level selectors etc. before finishing with the finer details.

I will keep you posted as to how it progresses, and when I am ready to find some beta testers to take a look at it! The plan is to try and get it released for Android & Desktops at the same time with an iPhone version to follow not too long afterwards. Thanks!

Android Development Finally Taking Shape!!

0

Over the last few weeks, I have been helping my friend Paul port some of his code over to Android. Currently he releases games for PC, Mac, and iPhone and so the move to Android is a good one. Most of my involvement was working on sound, and the C to Java handling code. Lots of stress when digging through the error logs, but it has coming along very nicely! We started the process aiming for an Android 1.6 target, to ensure we can support the most amount of users across all devices.

I have also been tinkering with some of my own Android projects, moreso converting some of the games I have written to work on the new platform. So far its working out well, I have the basis for my framework in and working, and I am hoping to have the first of my games ready in about 2 months. I’ll post more about them here as I get them ready for testing or release.

In the meantime, check out some of Paul’s great games at http://www.shoecakegames.com 🙂

New FlexIO Module – XYZ Movement Detection

0

I added a basic module to the new FlexIO program this week to assist in detecting moved XYZ tables. After a frustrating day at the office, I came home, had a few beers and came up with this solution to try and fix my problem for the next time. A common problem I faced was after a drawing had been created for a part, the actual part itself had been moved in virtual space. Then when the bend file had been created, the tables were completely different because of the move. Because of this, how to correctly determine if the table is actually correct, or if there was an actual geometry change in the design that had been overlooked?

The module I created just looks for simple X/Y/Z direction movements, it gets a little more complex when looking for parts that have been rotated in 3D space, so the model doesn’t look for that yet. It works by asking for the first row of coordinates from the drawing, and calculates the differences between the X/Y/Z in the bend file. If its just a case of simple movement, the offset is applied to the remaining points and the new table when updated will then identically match the drawing (if there is no geometry change). If you start seeing some points being a little off, you can check in CAD to make sure there is no rotation, and put the difference to being a design change which requires the original part designer to submit a revision change.

It’s a start, and saves me a lot of time when verifying a large number of drawings at one time. Still lots of other verification code to add to other areas of the program 🙂

Win32 – SDL Loses Sound When The Main Window Loses Focus – Fix

0

So, I ran into an interesting problem this week while working on the “Alien Invasion” music disk that causes all sound to be disabled when the main SDL window would lose focus or become hidden. This could be a bit of a problem for a music disk, so I looked into trying to figure it out for myself.At first I tried the usual SDL culprits, which are the event system for handling focus, but no luck there.

After some poking around in the SDL source code, I was finally able to find a fix. In SDL_dx5audio.c you can change the following function to read:

void DX5_SoundFocus(HWND hwnd)
{
    // This makes sound audible regardless of focus being lost
    //mainwin = hwnd;
}

A better solution long-term in SDL will be to have an option to do this, rather than having to change the code, or just have this enabled by default. We’ll see! This was tested on 1.2.14 which is available to download from http://www.libsdl.org Hopefully someone else can find this useful too 🙂

Converting Databases To UTF8 Format From Latin1

1

I have been putting off the inevitable the last couple of weeks, which was the task of converting the database for CVGM.net to UTF8 from the default collation of latin1-swedish-ci. I am not the best when it comes to administering MySQL via command script, and phpMyAdmin didnt do the job properly of conversion for me. After a bit of googling, I found a bash script at islandlinux that was able to help me out considerably:

#!/bin/bash

DATABASE=$1

if [ ! "$DATABASE" ]; then
echo "Please specify a database"
exit
fi

BACKUPDIR="/root/tmp/mysql_backups/"

if [ ! -d "$BACKUPDIR" ]; then
mkdir -p "$BACKUPDIR"
fi

BACKUP="$BACKUPDIR""$DATABASE.sql"

mysqldump --add-drop-table --extended-insert "$DATABASE" > "$BACKUP"

TABLES=`mysql --batch --execute 'SHOW TABLES' "$DATABASE" | grep -v "^Tables_in"`

for TABLE in $TABLES; do
echo 'ALTER TABLE `'"$TABLE"'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;';
# uncomment the following line to process the commands
#mysql --execute 'ALTER TABLE `'"$TABLE"'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;' "$DATABASE"
done

This script converted the database tables and everything under it to the correct format. It also backs up the databases first in case something decides to take a crap on you. The problem I had with phpMyAdmin was even though I changed the collation to utf8_general_ci it didn’t do it recursively into the tables and the fields underneath it.

Thanks for the script guys 🙂 You saved me even more work!

NOW! Amstrad CPC Music Disk Released At Main Party 2010

1

NOW! Screenshot NOW! is a music disk I have been working on in collaboration with Ultrasyd and Fenyx Kell for the Amstrad CPC 128K system. The music disk features 12 awesome music tracks, and was coded in a little over two weeks before I get settled into working on Zine again. This is my first production on the Amstrad (and also the first CPC project for Brainstorm) that was any good (as I did a bit of BASIC many moons ago), I have played with a friends system many years ago as a kid, but this is the first piece of code I have written on the system that hasn’t been utter shite. I am very pleased with the outcome of this project, and the music is amazing 🙂

I started working on this project on Sept. 13 with Ultrasyd, as the people who were supposed to write him a music disk had bailed out of the project. I took it on as a challenge, realizing the path would not be straight and easy, plus I have been looking for an excuse to get back into 8-bit development for quite some time 🙂

The project is written using Z88DK (available HERE) and uses C and Z80 Assembly language. I used CPCRSlib for some of the graphics code, mixed with a bit of my own dodgy code. The music replayer is by Targhan and available HERE.

There were many technical challenges on this project. The biggest was the small amount of RAM available to the system at any one time, certainly not enough to hold all the music let alone the program and the data it needed to run. At one point, I spent 2 solid days working on getting 5 tunes in and working without crashing the computer, when I realized a mistake I had made in some code earlier that would allow me to hold many more. So at around 4pm yesterday I was able to fit all 12 songs into the production without a problem. Nothing quite like a last second fix for a production thats due to be released the very next morning 🙂 Many thanks to Ultrasyd for staying up late on the CVGM OneLiner to get this thing finished in time for Main (and showing it off to the Amstrad community there). There is also a hidden, 13th tune 🙂

Download the DSK file Here. To run, insert the disk and type RUN “NOW!” to start the music disk. Up & Down arrow keys to change between music. Escape to quit. If you wish to run this in an emulator, I recommend using JavaCPC or WinAPE. This disk has been fully tested on real 6128 Hardware (Thanks again, Ultrasyd!).

Full Production Credits

Music: Ultrasyd/BRS and Fenyx Kell
Graphics: Yes/BRS (Loading Screen), Ultrasyd/BRS (Main Picture)
Code: FishGuy876/BRS
See the TXT file on the DSK/Zip for a full list of everyones greetings and thanks 🙂

EDIT: The music disk was entered into the Wild compo at Main and ranked in 3rd place!!! Fantastic! \o/ Congratulations to everyone again! It can also be found on Pouet now, where you can comment and rate it! Thanks!

Zine Issue #14 Has Been Released!

0

I guess it is safe to say at this point that the secret project I have been working on for the last few months was Zine 🙂  Zine is a demoscene based disk magazine filled with articles and information on the demoscene and demoscene-related productions. Zine #14 is now available for immediate download. The pouet page (where you can download, as well as comment) can be found Here. Enjoy!

Zine is the first project I worked on after joinging the group Brainstorm, and has been more than a year in production on and off. Most of the work was done on the issue in the last 6 months or so, with a lot of last minute changes and implementations in the last 40 days or so until release making this one of the most challenging projects that I have ever worked on. Last minute stuff always works the best, eh?  🙂 In a positive note, it’s also the first issue to go multi-platform, working on Windows, Mac and Linux! \o/

Overall, im OK with this production. There was a shed load of features and things that I needed to get in and working, but simply didn’t have time. They will have to go into the upcoming issues to meet my personal “This rocks” meter – Unfortunately, if I can see or think of problems that exist in a production, I tend not to think too highly of myself.

Zine #14 was released at the Evoke 2010 demo party, which I attended with my wife epec. It was truly amazing to be stood on the stage in front of all those people talking about something I had worked on. Then throughout the party, looking at peoples screens and monitors to see them reading and talking about the issue. Very inspiring, and made me feel good to have produced something people liked to read 🙂 Evoke really inspired me.

The Zine team wasn’t just myself, I would like to thank the following people and individuals for their help and contributions to the issue (and I apologize if I forget anyone!) :

Axel – Chief editor of Zine
Menace – Co-Editor of Zine with Axel, both responsible for article content and chasing down articles etc.
Epec – Copy Editor & Production Assistant.  Her contributions to articles and scheduling were invaluable on this project, and it would have failed without them.
Prm – Responsible for all article and issue layout graphics once a base layout had been devised and coded in.
Prowler – Artist who composed the opening picture in such a short time period, at the same time he was opening a gallery of some of his other works, including the oil painting our picture was based on.
Bit Arts – For creating those wonderful intro & outtro jingles on such short notice.

And the Musicians who contributed to this issue:
Hansee, Mikael Fyrek, c-jeff, Scott and  Willbe

Other Thanks:
My Family – For putting up with my shit this last year as I worked on this project!
Shoecake – Your work on Dexter is invaluable, my friend! I wish you could have been there!
bpoint – Thanks for the last minute code tips and info, even though we couldn’t use most of them in the end, I thank you for being there while I was still awake at 5am fixing this stuff
deathy – Always my voice of reason when I needed to vent 🙂
Brainstorm – You guys fucking rock!

Enjoy!

Go to Top