Any Colour You Like

Profile
Purley, United Kingdom
Z80 and C#-related shenanigans - now with added electronics.
606 comments
1 followers
222 entries
Advertisement
benryves
March 28, 2008
Fun with IThumbnailProvider
Note: I have been informed that the code below no longer works in Windows 7 due to changes in the way IThumbnailProvider operates. It is recommended that you use unmanaged code instead of the managed solution presented below.


I have started releasing Cogwheel binaries on its project page, so if you'…
5,066 views
benryves
March 07, 2008
Sound, at long last.
I have finally got around to adding sound to Cogwheel using Ianier Munoz's waveOut API wrapper.



The technique used is fairly simple. I start with a sound buffer that is a multiple a number of video frames in length (1/60th of a second is one frame) - four seems a good number. This buffer needs to be…
1,521 views
benryves
March 03, 2008
Joysticks and Game Genie codes
The biggest update to the emulator relates to input.



I've added a new control panel that lets you customise key bindings. For the keyboard, you simply click on the button you wish to customise, then press the key on your keyboard you wish to bind. As you can probably tell from the screenshot, I've a…
2,065 views
benryves
February 24, 2008
Cogwheel on Google Code
On bakery2k1's suggestion, I took a look at my sprite collision flag code. It only checked for collisions between sprites appearing in the foreground - sprites that were hidden behind a background tile weren't checked, which caused the Fantastic Dizzy bug.


I have decided to give Google's free projec…
2,066 views
benryves
February 22, 2008
/INTerminable Interrupt Problems

World Class Leaderboard Golf

Well, I've just about got it the way it was before with the new interrupt code; most games work again, but the few that have always given problems (such as Desert Speedtrap) still don't work properly. [sad] I think this is the stage where I have to start trawling throug…
1,880 views
benryves
February 21, 2008
Interrupts: A Fresh Start
I gave in and rewrote all of the Z80's interrupt emulation from scratch, finding some rather horrible bugs in the existing implementation as I went.

Some of the highlights included non-maskable interrupts ignoring the state of the IFF1 flag (this flag is automatically cleared when an interrupt is se…
1,478 views
benryves
February 20, 2008
Loading ROMs

OutRun Europa
I've been adding a series of new features to Cogwheel. I wrote a basic zip file class a while back (only supporting store and deflate compression - the majority of zip files use deflate), and have added a Utility namespace with methods for help with loading ROMs.

For example, there is …
1,811 views
benryves
February 14, 2008
Game Gear LCD Scaling
The Game Gear's hardware is very similar indeed to the Master System's - so similar that you can play Master System games on a Game Gear via a special adapter. Some Game Gear games were just the Master System ROMs in a Game Gear cartridge. [smile]

That said, the Game Gear's LCD is only 160x144, and …
2,469 views
benryves
February 08, 2008
Necromancy
After seeing Scet and Drilian's work on their respective emulator projects I decided I needed to do something with the stagnating Cogwheel source on my hard disk drive.

The only ROM I have tested where I can't find an explanation for a bug is the Game Gear Garfield: Caught in the Act game. Like many…
1,724 views
benryves
February 04, 2008
PlayStation Controllers
PlayStation controllers are relatively comfortable, and I have a number of them knocking about.


From top to bottom - PS2 IR remote control and receiver; Guitar Hero wireless Kramer and receiver; black PS2 DualShock 2 analogue joypad; a pair of grey standard PS1 digital joypads.

As I've learned in the…
3,346 views
benryves
February 01, 2008
Site update
I intended on making at least one post in January, but looked like I missed the opportunity by a day. I hope you all had pleasant breaks (and here I refer to breaks from my inane ramblings, not any religious festivals).

The lack of updates stem from having precious little to talk about; I've been bu…
1,515 views
benryves
November 21, 2007
Scripting
Scripting with .NET is unbelievably easy. [grin]

I wanted to add scripting support to Brass, and have added it using .NET's excellent powers of reflection and its System.CodeDom.Compiler namespace.

The first thing I need to do is find out which language the source script is written in. I use the exte…
1,715 views
benryves
November 14, 2007
Brass 3 and software PAL
My work with the VDP in the Sega Master System made me more aware of how video signals are generated, so thought it would be an interesting exercise to try and generate them in software. This also gives me a chance to test Brass 3, by actively developing experimental programs.


I'm using a simple 2-b…
1,859 views
benryves
November 05, 2007
Brass 3.0.0.0 Beta 1


Brass 3 Website.


I've released a beta version of the new assembler. It comes with the compiler, a GUI builder (see the above screenshot) and the help viewer; it also comes bundled with a number of plugins.

I've also knocked together a quick demo project that can be built directly from Explorer once B…
1,585 views
benryves
October 29, 2007
Emulating TI-OS 1.15 and a greyscale LCD
OS 1.15 appears to boot, and if I run an OS in Pindur TI, archive the files (copy them to Flash ROM) then use that ROM dump in my emulator the files are still there, where they can be copied to RAM.

Trying to re-archive them results in a fairly un-helpful message, as I haven't implemented any Flash …
1,502 views
benryves
October 26, 2007
Brass 3 and TI-83+ Emulation
Brass 3 development continues; the latest documentation (automatically generated from plugins marked with attributes via reflection) is here. The compiler is becoming increasibly powerful - and labels can now directly store string values, resulting in things like an eval() function for powerful mac…
1,747 views
benryves
October 02, 2007
Brass 3
Quake isn't dead, but I've shifted my concentration to trying to get Brass 3 (the assembler project) out.



Brass 2 didn't really work, but I've taken a lot of its ideas - namely the plugin system - and kept some of the simplicity from Brass 1. The result works, and is easy to extend and maintain. Las…
1,519 views
benryves
September 18, 2007
Dynamic Lighting
Quake has a few dynamic lights - some projectiles, explosions and the fireballs light up their surroundings.

Fortunately, the method used is very simple: take the brightness of the projectile, divide it by the distance between the point on the wall and the light and add it to the light level for tha…
1,827 views
benryves
September 14, 2007
Bounding Box Bouncing
I've updated the collision detection between points and the world with Scet's idea of only testing with the faces in the leaf containing the start position of the point.



ZiggyWare's Simple Vector Rendering GameComponent is being very useful for testing the collision routines. [smile]

I have also exte…
2,357 views
benryves
September 12, 2007
Goodness Gracious, Great Balls of Lava
I've reworked the VM completely to use an array of a union of a float and an int, rather than the MemoryStream kludge I was using before. This also removes a lot of the multiply-or-divide-by-four mess I had with converting indices to positions within the memory stream.

There are (as far as I know) t…
1,543 views
benryves
September 06, 2007
Entities Spawned by QuakeC Code
After all that time spent trying to work out how the QuakeC VM works I finally have some real-world results. [smile]

Apart from the obvious boring stuff going on in the background parsing and loading entities go, two functions in particular are of note. The first is a native function, precache_model…
2,856 views
benryves
September 03, 2007
QuakeC
This journal hasn't been updated for a while, I know. That doesn't mean that work on the Quake project has dried up - on the contrary, a fair amount of head-way has been made!



The problem is that screenshots like the above are really not very interesting at all. [rolleyes]

As far as I can tell, Quake…
2,195 views
benryves
August 20, 2007
8-bit Raycasting Quake Skies and Animated Textures
All of this Quake and XNA 3D stuff has given me a few ideas for calculator (TI-83) 3D.

One of my problems with calculator 3D apps is that I have never managed to even get a raycaster working. Raycasters aren't exactly very tricky things to write.

So, to help me, I wrote a raycaster in C#, limiting my…
5,315 views
benryves
August 15, 2007
QuakeC VM
I've started serious work on the QuakeC virtual machine.



The bytecode is stored in a single file, progs.dat. It is made up of a number of different sections:

  • Definitions data - an unformatted block of data containing a mixture of floating point values, integers and vectors.
  • Statements - individual ins…
2,233 views
benryves
August 14, 2007
Vista and MIDI



I have a Creative Audigy SE sound card, which provides hardware MIDI synthesis. However, under Vista, there was no way (that I could see) to change the default MIDI output device to this card, meaning that all apps were using the software synthesiser instead.

Vista MIDI Fix is a 10-minute applicatio…
1,574 views
benryves
August 10, 2007
Quake 2 PVS, Realigned Lightmaps and Colour Lightmaps
Quake 2 stores its visibility lists differently to Quake 1 - as close leaves on the BSP tree will usually share the same visibility information, the lists are grouped into clusters (Quake 1 stored a visibility list for every leaf). Rather than go from the camera's leaf to find all of the other visi…
2,310 views
benryves
August 09, 2007
Journals need more animated GIFs


Pixel shaders are fun.

I've implemented support for decoding mip-maps from mip textures (embedded in the BSP) and from WAL files (external).

Now, I know that non-power-of-two textures are naughty. Quake uses a number of them, and when loading textures previously I've just let Direct3D do its thing wh…
1,749 views
benryves
August 07, 2007
Shaders
Following sirob's prompting, I dropped the BasicEffect for rendering and rolled my own effect. After seeing the things that could be done with them (pixel and vertex shaders) I'd assumed they'd be hard to put together, and that I'd need to change my code significantly.

In reality all I've had to do …
1,696 views
benryves
August 06, 2007
Less Colourful Quake 2


I've transferred the BSP rendering code to use the new level loading code, so I can now display correctly-coloured Quake 2 levels. [smile] The Quake stuff is in its own assembly, and is shared by the WinForms resource browser project and the XNA renderer.



I'm also now applying lightmaps via multipli…
1,644 views
benryves
August 03, 2007
Keyboard Handler Fix
ArchG indicated a bug in the TextInputHandler class I posted a while back - no reference to the delegate instance used for the unmanaged callback is held, so as soon as the garbage collector kicks in things go rather horribly wrong.

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * …
2,138 views
Advertisement

Popular Blogs

shawnhar
Generalist
101 Entries
10 Followers
15 Entries
11 Followers
johnhattan
Programmer
1,277 Entries
48 Followers
ApochPiQ
Generalist
628 Entries
44 Followers
dgreen02
Generalist
338 Entries
56 Followers
Advertisement