Archive

Author Archive

Woopsi 0.99.4 Released

September 2nd, 2010 Ant 2 comments

Woopsi 0.99.4 is now out, but in a break from tradition, you can’t download it from SourceForge. As I said in the last post, Woopsi development has moved to BitBucket.

At Lakedaemon’s suggestion, I’ve created a new website for Woopsi. All releases - including this one - will be available there from now on. The new site can be found here:

This release mainly fixes bugs. Additionally, I’ve fiddled with the fonts and font generation tools a little, mainly to accommodate basic functionality required for Lakedaemon’s “XmlBox” gadget.

The woopsi.org website’s source code is itself hosted by BitBucket, and can be found here:

However, there’s very little PHP behind this site, so there’s not much to see that you can’t find by looking that the HTML behind the pages.

Farewell to SourceForge

August 26th, 2010 Ant No comments

SourceForge has been Woopsi’s source code host since October 2007. They’ve been a great host. They offer some excellent features, and haven’t charged me a thing for nearly 3 years of diligently caring for my code. However, both technology and “social” coding techniques have improved since I adopted Subversion. I’ve found modern distributed version control systems to be faster and more flexible than Subversion, whilst the forking capabilities provided by sites such as GitHub and BitBucket make collaborating with other coders incredibly easy.

A request from Lakedaemon that I move Woopsi to a DVCS finally convinced me that it was time to move on, so I’ve switched from Subversion to Mercurial. Woopsi and its associated sub projects are now hosted on BitBucket:

The SourceForge page remains in place as it’s impossible to close a SourceForge site that has code committed to it. It now includes a notice indicating that the project has moved.

Woopsi 0.99.3: A Belated Release Announcement

August 26th, 2010 Ant No comments

Woopsi 0.99.3 was released a week ago:

http://www.sourceforge.net/projects/woopsi

This is what I said about it on the GBADEV forum:

This release fixes a number of bugs. Some of the code has been tidied up. The only change that could have an impact on user code is the removal of drawHorizLine(), drawVertLine(), drawCircle() and drawFilledCircle() from the GraphicsPort class. The drawLine(), drawEllipse() and drawFilledEllipse() methods will now automatically call the optimised form if it is available.

The full list of changes is available in the ChangeLog.txt file within the archive.

Categories: Woopsi Tags: , ,

WoopsiGfx: A 2D Graphics Library

July 28th, 2010 Ant No comments

WoopsiGfx is a C++ 2D graphics library for the Nintendo DS, derived from Woopsi. It allows developers to create and manipulate bitmaps using a comprehensive set of drawing tools. It includes an extensible font system for drawing text to bitmaps, and features support for packed monochrome and 16-bit fonts out of the box.

WoopsiGfx can be used to draw directly to the DS’ VRAM. This is useful when the DS is in MODE_FB0 or MODE_5_2D.

Features

  • Extensible font system that supports compressed proportional and fixed-width fonts (monochrome and 16-bit);
  • Animation class with support for variable framerates and standard/pingpong looping;
  • Bitmap class for 16-bit bitmap image manipulation;
  • Graphics class providing clipped, DMA-accelerated drawing functions;
  • Dynamic array container and iterator classes;
  • Object-orientated design for easy integration into other C++ software;
  • Simple API;
  • Unicode strings encoded with UTF-8;
  • Compatible with Woopsi font tools.

You can download a demo here:

http://bitbucket.org/ant512/woopsigfx/downloads/woopsigfx-demo-1.00.zip

The source is available as a zip here:

http://bitbucket.org/ant512/woopsigfx/downloads/woopsigfx-src-1.00.zip

Alternatively, you can pull down the Mercurial sourcecode repository from here:

http://bitbucket.org/ant512/woopsigfx

Categories: Woopsi Tags: , , , ,

Removing Code

July 25th, 2010 Ant No comments

I promise I’m not stealing the subject matter for today’s posts from Hacker News. This story got mentioned there today, but it’s something that I’ve kept in the back of my mind when coding for years.

It was this story that lead to the latest Woopsi changes. I’ve been trawling through the code trying to get rid of things that no longer serve any purpose or just clutter things up.

The first change is the removal of the FixedWidthFontBase class. It was needed by the Font and MonoFont classes, which were themselves removed in the last release. Other than in those two classes the FixedWidthFontBase class wasn’t used anywhere. It’s now in the “extras” folder in the SVN repository.

I’ve tidied up some of the Graphics class. The drawHorizLine() and drawVertLine() methods are now protected, and the drawLine() method will automatically detect if a horizontal or vertical line is being drawn and will call the faster method appropriately. All the benefits of the faster routines remain, but Woopsi now handles calling the right method without any developer intervention. The drawCircle() and drawFilledCircle() are similarly called automatically by the drawEllipse() and drawFilledEllipse() methods. These changes meant that the drawVertLine(), drawHorizLine(), drawCircle() and drawFilledCircle() methods in the GraphicsPort class were unnecessary and have been removed.

The putSDLPixel() and getSDLPixel() methods have been moved into the FrameBuffer class as they aren’t used anywhere else.

Finally, the TinyFont class is broken in Woopsi 0.99.2. That has been fixed.

Categories: Woopsi Tags: ,

Software Patents

July 25th, 2010 Ant No comments

Here’s a remarkably apt bit of news for this blog:

Apparently Commodore-Amiga owed $10M for patent infringement. Because of that, the US government wouldn’t allow any CD-32’s into the USA. And because of that, the Phillipines factory seized all of the CD-32’s that had been manufactured to cover unpaid expenses. And that was the end.

http://xcssa.org/pipermail/xcssa/2005-February/002587.html

That’s an unusual assertion: Commodore brought down due to a patent infringement? Their downfall is typically - and, in my opinion, more accurately - attributed to their complete misunderstanding of marketing and the Amiga computer. So what was the patent they infringed?

So, the thing that finally brought the original Amiga house down was the XOR patent! The XOR patent covers the use of the machine language XOR (exclusive-or) operator to make a cursor blink in a bitmapped display.

The XOR patent, eh? Using XOR to draw a cursor to the screen. Must be a fantastically inventive idea, that. Not something that the average programmer wouldn’t come up with in a few seconds of the top of his head. No way.

Here’s a quote from one of my Woopsi blog posts back in October 2008:

The cursor isn’t drawn yet, as it’s a bit tricky. A rectangular XOR box the size and width of the character at the cursor position is probably the easiest option.

http://ant.simianzombie.com/?p=440

That’s a throwaway comment in a throwaway paragraph in a post about creating a timer gadget. The idea is so mind-numbingly trivial that even a decidedly average programmer thinks it barely worth mentioning. Yet this single, simple idea is blamed for the downfall of a multi-million dollar company.

Dear America,

Your patent system is screwed.

Sincerely,

ant.simianzombie.com

Woopsi 0.99.2 Released

July 20th, 2010 Ant 1 comment

Woopsi 0.99.2 is now out. Grab it from SourceForge, as usual:

http://www.sourceforge.com/projects/woopsi

The font system has had some minor changes made. I finally got around to ripping out the Font and MonoFont classes, as the PackedFont classes perform the same job with far more efficiency. They’ve been moved to the “extras” directory in the SVN repository in case anyone should ever need a reference for creating new font classes.

All of the monochrome fonts that ship as part of the library are now PackedFont1 classes instead of PackedFont16. This highlighted a bug in the bmp2font .NET program that is included in Woopsi’s “tools” directory - it was allocating relatively huge bitmaps for the font data instead of the tiny bitmaps that were really necessary. I’ve deleted the “CourierMono” font as it was an exact duplicate of the “Courier” font. The GlyphFont is a PackedFont16-based class instead of a Font-based class.

This changes have reduced Woopsi’s footprint quite significantly:

  • 1.5MB from the size of the Woopsi library;
  • 2MB from the sourcecode;
  • 400K from the packedfont example ROM;
  • 60K from the helloworld example ROM.

A big saving for very little work.

Other changes include replacing the x, y, width and height members of the Gadget class with an instance of the Rect class (itself converted from a struct). A lot of the clipping work can now done be within the rect instance rather than throughout the codebase.

The FileListBox and FileRequester classes include a getPath() method that allows a developer to determine which directory the file requester is pointing at.

Other miscellaneous changes are detailed in the changelog.

Categories: Woopsi Tags: , , , ,

More Mini Projects

July 5th, 2010 Ant No comments

I’ve been tinkering with a few mini projects lately, all of which are available from my BitBucket page:

www.bitbucket.org/ant512

Networked Pacman

Though I released this ages ago, I published it as a zip archive instead of hosting the code in a source code management system. I’ve rectified this and added it to BitBucket:

Networked Pacman

PyScrabble

This is a simple implementation of the logic of Scrabble, written in Python 3. It doesn’t have a UI, so it’s not terribly exciting for anyone but Python programmers, but perhaps someone will write a front-end for it. This was written in a couple of days and was an exercise in trying to think “Pythonically”. Whether or not I achieved this I’m not sure…

PyScrabble

WorkingWeek

Finally, this is a C# library that provides date functions that operate on a user-defined working week. For example, you can define a week of 9:30am to 5:30pm shifts (with time for lunch, natch) and use the functions provided by the library to determine whether or not a given date/time falls within a shift, or how many working hours there are between two dates, etc. It does some neat things with custom iterators and the yield statement to condense a lot of fiddly logic into a couple of very powerful methods.

WorkingWeek

Woopsi Version 0.99.1 Released

May 24th, 2010 Ant 9 comments

This version fixes bugs in the slider and scrollbar gadgets. I basically threw away the previous code and started again. This reworking has introduced a new issue: the grip does not have a minimum size. On the positive side, the sliders behave much more predictably now.

Get it from SourceForge, as always:

http://www.sourceforge.net/projects/woopsi

Categories: Woopsi Tags: , ,

Loose Ends

May 20th, 2010 Ant No comments

I have released a few other projects to the tinterwebs recently, but haven’t as yet announced them.

ALite

First up is version 3.0 of ALite, a simple data-access and data validation framework for .NET4:

http://bitbucket.org/ant512/alite

This version simplifies much of the framework. I went off on a wild tangent before moving the repository from SourceForge to BitBucket and started implementing features such as pseudo-transaction support. I even tried real transaction support using the classes from the System.Transactions namespace, but ran into so many nasty problems that it quickly became obvious that it wasn’t going to work.

Instead, ALite now works much more like Igmongonious. It uses a document (key/value store) to store the values of properties, which simplifies and speeds up the undo system. Swathes of code have been refactored to make the framework easier to use.

The “changelog” document seems to be inaccurate so I can’t give a complete breakdown of everything that has changed. Fortunately, no-one but me is crazy enough to use this library.

I moved the repository from SourceForge to BitBucket for a number of reasons. SourceForge has done some neat things with their UI and added a host of exciting new features, but:

  • BitBucket is a better fit for small projects like this. SourceForge’s insistence on manually vetting all projects doesn’t seem to have alleviated the amount of junk projects in its database, but it does increase the amount of work necessary to get what should be a minor project up and running.

  • Mercurial is magnitudes faster than SubVersion, particularly when SubVersion is lumbered with SourceForge’s horribly slow SVN servers.

  • BitBucket projects come equipped with a Creole-based wiki. Though SourceForge has recently added a per-project MediaWiki installation to their suite of features, Creole is notably terser than MediaWiki markup. The wiki is much simpler, which again is perfect for smaller projects. The entire wiki can be pulled down as a Mercurial repo allowing local editing and change tracking.

Chroma-X

Next up is Chroma-X, my ill-fated, unfinished and unfortunately-named shoot-em-up for the GP2X:

http://bitbucket.org/ant512/chroma-x

Nothing new in here, but the sourcecode is browsable and easily accessible. Incidentally, I managed to get the game running on a GP2X Wiz. I was disappointed to discover that it was slower on the Wiz than it was on the GP2X F-200, which put a damper on my Wiz coding plans.

Canvas UI

Lastly, my canvas UI project is also now on BitBucket:

http://bitbucket.org/ant512/canvasui

Since the last version I’ve fixed a few bugs and added plenty of new features, including:

  • Window close and depth buttons;
  • Scrolling lists;
  • Shadows on label text for disabled buttons;
  • Separation of GUI definition from library code.