Latest News


June 13th, 2002
Picked up the FooN source after a fairly long period of inactivity - made a couple of cosmetic changes. The font in the menus is now somewhat smaller, allowing a greater number of options (or games) to be displayed at once. Also, the LEFT and RIGHT buttons scroll by a page at a time, thus enabling somewhat faster game selection. I think that's it - let me know if I broke anything. This is version 0.22.


May 1st, 2002
So, after promising to release the FooN source code for some time now, I've finally got around to it.

It's released under the terms of the GPL, and is available for download from http://sourceforge.net/project/showfiles.php?group_id=52634.

Check the build.txt file for instructions on how to build it... you will need Visual C++ 6, as well as a suitably configured gcc cross compiler for win32. Check http://www.devrs.com for more information on this.

If you have problems/questions, then take it to the forums - I'll try and lurk and perhaps answer questions, but, as usual, I make no guarantees.

Enjoy!


March 17th, 2002
Version 0.21 contains a couple of 5-minute changes. The right shoulder button is now used to scroll the display in unscaled mode. There's also an "Even Faster" option in the emulation wait-state settings. For the technically curious, this enables prefetch, which will supposedly increase speed somewhat. I say "supposedly" because I haven't noticed a significant speedup in the few games I've tested, but hey, your mileage may vary. I suspect the speed gains aren't as significant as they've been with some of my other projects, since FooN doesn't run much code from ROM - it mostly runs from IRAM.


February 20th, 2002
Version 0.20 adds an extra option to the Emulation Options menu. If your flash cart supports it, you can modify the GBA's wait-state setting when accessing the ROM. This should give a speed boost. However, not all flash carts are fast enough to handle this setting, so if you start to experience random hangs or anything like that, you should stick to the slow setting.


I don't have my GBA hardware with me at the moment, so this is a completely untested release. Let me know in the forum if I broke anything!


January 20th, 2002
I'm such a dumbass. A user had been experiencing trouble with Kokotoni Wilf, where the final flashing star on the first level couldn't be picked up. The guy suggested that maybe the flashing attribute was causing the problem. I immediately dismissed this as a possibility since the flash code shouldn't affect memory, and is so incredibly simple.

Simple and wrong, as it turns out. I spent a good few hours tracing through my CPU core trying to find the problem, before realising the the flash code was scribbling over the BRIGHT attribute bit. Grrr.... stupid me. Looks like KW does its collision testing by searching for a specific attribute value.

Anyway, 0.19 fixes this problem.


January 12th, 2002
Version 18 modifies the unscaled scrollable mode. Now, you can hold down the left shoulder button and use the direction pad to scroll in all 4 directions. The left shoulder button cannot be used as a control key in this mode. Also, as requested, there's a version number on the Injector.


January 1st, 2002
Version 17 is (probably) a little bit faster than previous versions, and includes an extra R-Inc option which should hopefully help games that use the R register as a random seed.


December 25th, 2001
What the hell am I doing updating on Christmas day?!

Actually, I have a spare moment before the missus and I head over to friends for dinner, and there's nothing worth watching on TV, so I figured what the hell. Todays update adds some options to both the injector and the runtime menus.

It's now possible to set a value from 0-7 for "R-Inc". This is the amount that the R-register is incremented by each time it's read. I don't emulate the Z80 R-register properly, because it would add a fair amount of overhead to the emulator. Most games work fine with a setting of zero. Some games (eg. Boulder Dash) work better with a setting of 1.

The other option is the screen/interrupt timing. Once again, for speed reasons, I don't emulate the Spectrum ULA. Again, this doesn't matter for most games. However, some games that synchronise their rendering to the electron beam position will appear all flickery. The Scr/Int Timing option allows you to try a few different settings that may alleviate the flicker. It seems to work for Ghosts'n'Goblins, anyway.

The only other change is that "Reset Game" no longer trashes any changes to the key mappings that you may have made.


December 16th, 2001
Version 15! - Tweaked R register for Thunderbirds. Please let me know in the forum if this breaks any games that were working previously!


December 15th, 2001
A few tweaks in version 0.14... mostly requests from forum users. I'm going to be fairly busy over the next few weeks, but will try to keep updating FooN as much as possible.


December 11th, 2001
Minor bug fix relating to the Remap Control screen, and hey presto, a new, snazzier way of selecting Speccy keys. Download it now!


December 10th, 2001
Not bad progress for 1 month, eh? Anyway... todays update is a bug fix. Poking zero values should now work, as should a whole load of other .Z80 images. Turns out the document I was using as a reference to the .Z80 snapshot format wasn't entirely complete. Also, I've messed with the R-register again. Commando should still work, and Cookie should start working too. Hopefully nothing else will break as a result of this. If so, let me know in the forum!


December 9th, 2001
v0.11 contains some undocumented flag fixes, so hopefully Ghosts'n'Goblins will run. Apparently GnG uses undocumented Z80 flag behaviour due to a programming bug, or somesuch. I've also added an "Apply Poke" screen in the shell. Cheaters!
UPDATE: hmmm... GnG runs, but it's a bit flickery :(


December 6th, 2001
Lots of changes in v0.10. SRAM saves are added, but not thoroughly tested - (that's your job!). Fixed the strange R-register bug that was causing problems in Commando. Made the Z80 loader a little bit less fussy. Fixed the scrolling-off-the-end-of-the-menu problem. Video settings are saved in SRAM. Couple of other little things... you get the picture. Spent bloody ages with the SRAM stuff due to a GCC compiler optimisation bug. Doh!

Incidentally, if you have problems with a game not working, please try using a previous version and see if the injector complains about it not being a valid image... If that happens, it's possible I've messed up something in the .Z80 loader. Thanks!


December 4th, 2001
Managed to pull back a spare ARM register, and am putting it to work straight away. I think this will yield a fair speed improvement in the Z80 core. If all goes well on hardware, I'll release later today. It's a fairly substantial core rewrite, so if you come across a game that's misbehaving, please check it with v0.08 and let me know if I've buggered something up.

The astute observers among you will notice that I've put a PayPal button at the top of the page. Let me emphasise this because it's really important: FooN is completely free!. You're not under any obligation to pay anything for it if you don't want to. The button is there because a couple of people have emailed me to request a method of making donations. If you feel that FooN has provided you with some measure of entertainment, and you would like to express your gratitude, then click away - I certainly won't complain - but don't feel you have to.

Update: v0.09 is on the download page. I also added a frameskip option in the video modes section.


December 3rd, 2001
The bad news is that my car needs a new clutch. The good news, however, is that v0.08 is ready for download. The significant change here is that there's now a full menu system on the GBA side, allowing re-mapping of keys, insertion of unmapped keypresses, a bunch of video options, snapshot save/restore, etc... etc... a veritable smorgasbord of options for you to play with. This is quite a lot of code put together in a short space of time, so expect to find the odd bug or two. Actually, come to think of it, that pretty much describes the whole emulator :)


December 1st, 2001
Thanks to pocketheaven.com, FooN has a new home. This is a good thing, because it means that my home DSL connection no longer has to bear the burden of all those downloads.

UPDATE: The FooN forum is also moving over to Pocket Heaven. I'll continue to check the Bravenet forum occasionally, but the Pocket Heaven forums are where the action's at now.


November 30th, 2001
v0.07 is out. Some nice opcode fixes - I believe Batman, Head over Heels, Thanatos, Match Day 2, Target Renegade, and hopefully a whole load of others should now be working. For the 2 people who are probably interested in the details - ADC HL,xx was occasionally mistreating the carry flag, and LDD was incrementing, not decrementing.

As usual, bug reports to the forum - thanks!



November 29th, 2001 (PM)
Okay... v0.06 is available. This is a relatively minor update - some speed improvements and as requested, you can now delete games from the ROM manager.


November 29th, 2001
Tidied up the screen-copyup code. It's now in a completely separate module, and I can page in different versions of the code depending on the screen mode (tiled/non-tiled, scaled/non-scaled, etc...). Wrote a new 16-color scaled-mode version which should yield significant speed increases. It seems to work under emulation, but I won't know how much faster it is until I try it on actual hardware this evening.

Since I put the audio in, all games are limited to 100% spectrum speed. That means that you won't see Manic Miner, for instance, running any faster. You will (hopefully) however, see more games running at the correct speed with no audio glitches. Which is nice.


November 28th, 2001
Bubbz from pocketheaven.com pointed me at SnapConv, which is a utlity for converting Z80 images. Bubbz writes: "It can convert files to 48k images and the correct z80 version, so has worked with every game I've tried so far."

If you're having difficulty with certain games, you should try ZX-32 or SnapConv first. Also please remember - this emulator is for 48K images only!


November 27th (later PM), 2001
I'm an idiot. Serves me right for not testing things enough! The injector in v0.04 completely ignored your new key selections when generating the image. Hopefully v0.05 will behave a little better... If you're one of the eleven people who downloaded it during the night, please accept my apologies!


November 27th (PM), 2001
Well the audio isn't 100% but it's good enough for a release candidate. You may find that some games play slower than they did before. This isn't because of the CPU intensitivity of the audio - it's to do with my trying (and failing) to synchronise the emulation to the audio buffers. In the end I implemented a quick and dirty approach... it seems to work great for a number of games, but I'll probably eventually be replacing it with something better.

I've also made some changes to the game injector. It now creates a inject.ini file in the working directory, containing a list of previously injected images, along with their key mappings. This is a real timesaver if you decide to re-download a bunch of games - their key mappings will be restored from last time. I also added a cute little "screenshot" feature to the properties dialog - you'll see what I mean :)

Head over to the download page for the latest version (0.04).

I've had a couple of compatibility reports. The CPU core, though reasonably stable, is still under development, and consequently won't play every game out there. If you find a game that exhibits bizarre behaviour, please report it in the forum. I may eventually set up a more formal compatibility list, but the forum will do for now.

One other issue - the .Z80 loader I have is fairly fussy. When I get around to supporting .SNA format as well, I'll take another look at it. For now though, if you have a game that won't play at all or is rejected by the injector, before reporting it, please do the following:

1. Ensure that this is a 48K image, and not 128K.
2. Load the game up in ZX-32, and then immediately save it out as a .Z80 file. Try loading the new file - if you still have problems, report it.

Once again, thanks to those who've sent messages of encouragement. I'm glad you're enjoying this stuff, 'cos it'd be fairly pointless otherwise.


November 27th, 2001
Grrrr... spent several hours trying to get smooth buffer changeovers. It's so frustrating because the audio is being generated fine - I just can't get the GBA audio hardware to cooperate. I can hear all the music/sfx fine, but there's an annoying buffer overflow somewhere that's causing a nasty 50Hz click over the top. Oh well... I'll figure it out. I also did some work on the injector, which I'll release later today.


November 26th, 2001
Audio is nearly working... I just have some bizarre timing issues to iron out, and then I'll put up another release. Going to be busy with "real" work today, but will hopefully have an hour or two to spend on the emulator this evening.


November 25th, 2001
Revamped the old web page a bit... hope you like the change. Please let me know if you find any broken links! I've also set up a forum on Bravenet to discuss feature requests, compatibility issues, etc... etc...


November 24th, 2001
Have been talking to The Hive - author of another GBA Spectrum emulator - ZX-Advance. It's really interesting to see the similarities and differences in the approaches we've taken. We're comparing notes, and I think we'll both benefit.

Anyway, what have I been doing recently? Well, I pulled back some IRAM - reworked the screen copyup - fairly cool performance boost. I implemented the infamous undocumented sign-bit behaviour that prevents the rhino in Sabre Wulf from running backwards or in circles!

More significantly, I've also hacked up a quick Windows-based ROM injector. A few things to remember, however:

This is still early code. Don't be surprised if certain ROMs break the emulator completely!

There is no throttling yet. Some games will play slower than 100%, some will play much faster. Most games that I've tested are playable, though!

I'm aware of compatibility issues with some games - in particular those that really push the limits of what a Spectrum can do. If you find any glaring problems with simple (and popular) games, drop me a line at: foon@pocketheaven.com, describing the problem. If possible, send me a URL for the original Spectrum image that's causing problems.

Keyboard/Joystick mappings are done in the Injector program. You can map any GBA button to any Spectrum key or Kempston joystick movement. The START button is, however, reserved. In the future, it will bring up a flashy menu system on the GBA, allowing various option adjustments, etc... etc... For now, it just cycles on to the next ROM.

You will get a warning from the Flash Advance Writer. This is because I don't fix up the header information. Just allow FAW to perform the fix for you, and you should be fine. If you're using some other tool, you may need to fix up the header manually using one of the utilities out there. I will fix this soon, I promise :)

To use the injector, simply run the executable. From Explorer windows, drag .Z80 files (I don't support .SNA, .TAP or .TZX yet) into the big white space at the top of the dialog. They will be added to the ROM list. Double click on a list entry to edit the key mappings for that particular ROM. When you're ready, choose and output filename, and create the binary image. This will generate a .BIN file that you can burn onto your flash cart. When up and running, hit START to cycle through ROMs. I've disabled the snapshot feature in the previous build - eventually it will be accessible from the menu system (that I have yet to write!).

Have fun!


November 23rd, 2001
Thanks to all those who tried out yesterdays release and were kind enough to send complimentary messages! The good news is that it's running even faster now. The bad news is that I'm really short on RAM. For those that are interested - the GBA has 256K of slow RAM, and 32K of fast RAM. I use the 32K for storing code that needs to run quickly. In the emulator, that means pretty much all the code. I currently have 48 bytes free - Doh!

Anyway, here's Manic Miner... foon002.zip. As a bonus extra feature, you can take a snapshot of the current state with the left shoulder button, and restore it with the right shoulder button. A great way to cheat :)


November 21st, 2001
Wow... busy week. Did, however, manage to finish the PC implementation, and then spent a few days frantically hacking out ARM opcodes. After many errors, and cross-checks with the PC version, however, I'm pleased to report that the GBA version is up and running!

As you can see, I'm squishing the screen vertically, and cropping the left/right sides, since the GBA screen is a good deal smaller than the original Speccy. Eventually, I'll scale horizontally also - just haven't had time yet.

There are no doubt many more opcode errors to discover. I haven't even begun compatibility testing, but Chuckie Egg seems to run ok enough for me to release a preview binary! Click here to download the current Chuckie Egg demo. Enjoy!


November 15th, 2001
Added a Windows wrapper, so the keyboard interface now works, and I can see the emu running on the screen at last. Fixed a few bugs with CPIR/CPDR, and a number of various nasty ADD/SUB/ADC/SBC flag-related bugs. Still have to implement DAA, as well as a couple of undocumented instructions. I also have to ensure that the unused flags behave in their correct (although undocumented fashion). Fortunately, the latter is just a case of tweaking my tables, so it shouldn't be too hard. Anyway - here's JSW2:


November 14th, 2001
The "emu generation" code is working - it's generating the core of a Z80 emulator written in C. Last night I added a quick wrapper to enable me to single-step, run, and grab a bitmap of the screen memory. After a few false starts, (it really helps if PUSH and POP are implemented correctly!), I was greeted with the following:

It's never looked so good.

I've written a quick .Z80 loader, and Manic Miner seems to run just fine. Bear in mind there's no keyboard control yet, and I'm grabbing display bitmaps by hitting a key during execution! I need to add a more useful front-end, and then I can try some more serious compatibility testing. My gameplan right now is to get the PC C version working with every game I can find. This will be the "reference" implementation, against which I can test the GBA version.


November 12th, 2001
Wrote some code to emit C code for each bit battern. This will be used to generate the PC speccy emulator (although it ought to also run on the GBA, albeit slowly). I have implemented (but not tested) about 40% of the opcodes so far. Incidentally, the "official" Z80 reference manual I have (from Zilog) is full of typographical errors. Ho hum.


November 10th, 2001
Dug out my old Z80 Microprocessor Family User's Manual. I'm still not sure if that's supposed to mean that it's a User's Manual for the Z80 Microprocessor Family (likely), or whether it's a User's Manual for the Z80 Microprocessor that the entire family can enjoy (unlikely).

Started entering a table of opcodes/bit patterns. My plan is to automate the whole process somewhat by generating code for each bit pattern based on a small number of templates. I think that's the only way to get the speed required.

Some immediate problems to consider:

How to display the spectrum screen on the GBA?
The speccy display is 256x192, but the GBA's is only 240x160. I think I'll try and support both unscalled (scrollable) and scaled modes.

How to generate the screen display?
With the NES emulator, I generated a single row of screen data, and then ran the emulator until the requisite number of CPU clocks had elapsed before moving on to the next row. This gives fairly accurate emulation in cases where the CPU clock is used to mess with the display in sync with the electron beam, but is probably going to be a little slow. An alternative approach would be to maintain a "dirty tile" array, and only update portions of the display that the CPU has written to in the previous frame. Since most Speccy games don't change too much of the display per frame, this may prove to be significantly faster. (The exception would be cases where all the attribute bytes are altered in one frame!).