Alien Experiment Laboratories

May 25, 2007

Z88dk Wiki! Yay!

Z88dk now has a documentation wiki!

Flippin’ sweet! :-)

And none other than Alvin Albrecht (he of Z88dk Sprite Pack fame) has the distinction of being the first commenter here, with a very helpful explanation of some of the things I was unsure of. Cheers, ’tis much appreciated!

Blimey. I’d better try to do some work on this thing again now, hadn’t I?

May 9, 2007

You may not believe it, but…

…there’s been some progress lately.

After quite literally not touching the project for months, I spent a solid few hours getting things knocked into shape to the extent that some code actually exists, builds to a Spectrum .TAP file, and runs without crashing.

All it does right now is initialize a bunch of stuff, including partially drawing the game area. No “Y.S. Megagame” awards as it stands, but a lot of what was done is what I call the “drudge work”, getting the bare essentials pulled together. Think of it as laying the foundations.

It’s hard because at this stage you can’t run it and see any obvious progress. This was always one of the cool things about programming in Sinclair (or any other) BASIC: instant gratification. But that doesn’t always translate into well-written code.

Meanwhile, my biggest weakness in managing these hobbyist projects is already showing itself, namely my tendency to get the “next big idea” while I’m still trying to code the current one. The next big idea in this case is looking like being open source, and written using PyGame, as I want to learn Python. I should try not to think too much about that just yet though!

April 23, 2007

On this day in 1982…

Sinclair Research Ltd. launched their latest computer: The Sinclair ZX Spectrum.

Happy 25th Birthday, Speccy!

(And maybe, at the rate I’m going, I’ll finish the current project in time for the Spectrum’s 50th birthday celebrations…)

February 16, 2007

Experimental Gameplay

Erk. A month since I last posted. Has it really been so long?

Busy at work, busy at home, I’ve barely even touched a computer outside of work for about the last 2 weeks. Such is the fate of the hobbyist on a time budget.

This site, the Experimental Gameplay Project caught my attention recently. The idea of coming up with something quirky and fun, yet so simple our cats could program it in an afternoon, greatly appeals to me and reminds me of those days of non-stop coding which produced such instant classics as “Lightcycles +3″ and…erm…well, just that one, really.

January 16, 2007

ListingCorp - SEO scammers

Ooh, controversial title or what?

A few days back, I received a letter from the ListingCorp Website Listing Service, requesting payment of $65 for my annual listing. At first glance, it looks exactly like a bill (though it does state that it is “not a bill”, if you look closely; definitely a pseudo-legal CYA there, and probably the only thing between them and a stay in Federal penitentiary for mail fraud).

It says that their website address listing “service” includes (among other stuff)

Domain name submission with up to 8 keywords / phrases to 20 established search engines.

and that this is for my “annual search engine listing”.

There’s only one way to exchange money for search engine position, and that’s to bid on keywords using the pay-per-click advertising on Google, Yahoo, MSN, and so on. I don’t imagine $65 would buy me too many clicks, especially spread out over 8 keywords and multiple PPC accounts, and certainly not after ListingCorp get their cut.

Since this site is a non-profit venture right now, I have no intention of paying anyone for clicks, legitimate or not, and am happy to add content and await whatever organic search results eventually come my way.

Judging by the comments in this posting they’ve been trying to pull this stunt for a while now, and no doubt have succeeded in stealing money from some of the people they targeted.

Needless to say, I filed a mail fraud report, as they’re using the USPS to send out solicitations (made to look like bills) for a clearly fraudulent “service”.

December 31, 2006

Procrastination

’nuff said.

OK, maybe not quite. Work, Christmas, Life in general, and this is a fun project which isn’t intended to pay the bills, so it tends to fall off the bottom of the urgency queue now and then.

But at least my Linux box is working again. I used the Microsoft Way and freshly reinstalled the thing, not having enough time to fix it the proper way. Also it gave me an opportunity to reclaim the 6GB being wasted for an unused Windows install, simplify my partitioning a bit, remove some cruft, and switch over to the ext3 filesystem. All of which (including the backup and restore of 30+GB of /usr/local and /home so that I could change filesystems safely) was quicker than tinkering with the system for God knows how long with no guarantee of success at the end of it.

Anyway, Happy New Year! My resolution will be to finish this project. Just as soon as I solve another Sudoku puzzle and read up some more on reflexology, that is…

December 17, 2006

Nothingness…

…is about what I achieved this week. My beautiful, shiny Ubuntu install (complete with AIGLX and Beryl 3D niceness) is currently resembling the raggedy old laptop it resides on, after XFS failed to live up to it’s reputation of being robust in the face of crashes and unplanned power-offs (which happened during my attempts to get that 3D desktop working).

I now have a text-based login, because GDM goes into cyclic restart (but I can start X windows just fine once I log in; go figure…), my USB key and iPod don’t show up in /dev when I plug them in (but the USB hard drive I use as backup does work, having somehow obtained a static device node), and even if they did show up, the gnome-volume-manager refuses to start. forcing me to manually pmount things. Pffft.

Yet, crippled and b0rken as it now is, Linux is still working better than the XP box I use in work. Sadly I have no time to troubleshoot and fix the thing like a proper geek should, so I’ll likely just reinstall and use it as an opportunity to lose some old cruft, simplify my horrible, badly considered partitioning, reclaim the long-unused Windows partition, and switch to ext3 for the filesystem.

December 10, 2006

Knuckling down

In my (limited) spare time this week, I’ve been doing a lot of scribbling down of near-C-code on paper.

This is my normal M.O., and has been since 1985 when I’d scribble stuff down on the back pages of school exercise books during dull moments in class, then go home and implement the idea on the computer. If I had enough time I would even write the entire program out, longhand, ready to be typed in later.

In this case, I’ve been working on routines for initializing and moving around the play area, and a handful of related utility functions.

I’d forgotten how much I enjoy doing this, at least when it’s on my terms, or terms I can live with. My day job now is great as far as creation-from-scratch and quick results go, but most corporate programming jobs, including my previous 7 or so years of process-driven, delayed results “coding”, just suck the fun and creativity out of being a programmer.

December 3, 2006

Finally some example code!

It took long enough (these things happened so much quicker before I got a life ;-) ) but here, at last, is some code making use of the most current version of z88dk and version 3 of Sprite Pack.

It’s mostly self-documenting, but there are a few places where it begs explanation, particularly when setting up sprites, so I’ve expanded heavily on the comments in the code.

Well, whaddya waiting for? Go download the source code and have a look (But don’t blame me if it makes your eyes go all funny).

November 27, 2006

Z88dk and C gotchas - episode 1

Still working on experimental stuff (partly to get the hang of Z88dk, and partly to scrape the rust off my underutilized C-coding “skillz” before doing anything important), I got stung by a nasty little gotcha.

I created a source file, 2player.c, which is expanding on the first bit of z88dk/Spritepack 3 code I wrote, to have two graphics on screen, both player controllable.

Every build attempt met with this error:

zcc +zx -vn 2player.c -o 2player.bin -create-app -lsp1 -lballoc
1 errors occurred during assembly
Errors in source file 2player.c:
File '/tmp/tmpXXTIgPHd.opt', at line 10, Illegal identifier
make: *** [2player] Error 1

Ouch. Where’s the error? Line 10 is in the middle of my descriptive comment section! This is meaningless!! Eventually I stripped out just about everything to the point where it couldn’t possibly NOT compile and…still the same error! WTF?

Then it occurred to me: somewhere in the build process, perhaps the filename is being used as an identifier. And perhaps identifiers starting with a number are illegal. A quick rollback to the proper code I’d written first time around (Vim 7 undo rocks!), rename to twoplayer.c and the bugger builds first time.

Attempting to run the thing resulted in a spectacular crash, but at least it built! Now for some trial and error debugging (my kingdom for a z88dk equivalent to gdb). I look at the pointer stuff first and find that it doesn’t like the following code:

for (p = 0; p != 2; p++) {
    player[p]->sprite = sp1_CreateSpr(sp1_SprId2Type(SP1_ID_MASK2_LB) | SP1_TYPE_2BYTE, 3, 0, 0);
    sp1_AddColSpr(player[p]->sprite, sp1_SprId2Type(SP1_ID_MASK2), 48, 0);
    sp1_AddColSpr(player[p]->sprite, sp1_SprId2Type(SP1_ID_MASK2_RB), 0, 0);
    sp1_MoveSprAbs(player[p]->sprite, &drawarea, man + 16, 10, 14, 0, 4);
    player[p]->frameoffset = (uchar *) 0;   /* no frame offset */
    /* make sure player[p] isn't in motion */
    player[p]->dx = player[p]->dy = 0;
}

Changing it to this code (with the appropriate pointer-to-player-struct declared at the top of main()) gets over that speed bump, by pointing a pointer at the array element and then using the pointer instead of the subscripted reference. It’s not clear why the first fails and the second appears to work. I probably need to go read K&R again…

for (p = 0; p != 2; p++) {
    pl = &player[p];
    pl->sprite = sp1_CreateSpr(sp1_SprId2Type(SP1_ID_MASK2_LB) | SP1_TYPE_2BYTE, 3, 0, p);
    sp1_AddColSpr(pl->sprite, sp1_SprId2Type(SP1_ID_MASK2), 48, p);
    sp1_AddColSpr(pl->sprite, sp1_SprId2Type(SP1_ID_MASK2_RB), 0, p);
    sp1_MoveSprAbs(pl->sprite, &drawarea, man + 16, 10, 14, 0, 4);
    pl->frameoffset = (uchar *) 0;  /* no frame offset */
    /* make sure pl isn't in motion */
    pl->dx = pl->dy = 0;
}

Referencing the players array via a temporary pointer like this, the program builds and runs exactly as designed.

Older posts