Raining Squares is a Sega Dreamcast VMU homebrew tech demo. The VMU is also sometimes called VMS. The background is animated, the player controls a pixel, moving it left right, and there are falling squares which appear at random X positions, and have random sizes. There is a delay every time the player's pixel collides with a falling square.
Just like Sony's PocketStation, Sega's Dreamcast VMU (or VMS) is essentially a memory card plus controls, speaker, and LCD screen. The brain of the VMS is a LC86000-compatible micro controller. Its display resolution is an amusing 48x32 pixels.
While there exist other demos of how to program the Dreamcast VMS, I wrote my own pixel routines, which can set, clear, and get the value of a single pixel, given its row and column. This is because I consider this kind of routines fundamental, and found nothing similar in the freely-available demos I've analyzed. This was not trivial because of the way the LCD is driven. Once I had pixels, I could draw squares!
The assembly language of this chip is more rudimentary than the x86 assembly, to which I'm more accustomed. For example:
- there are no "string" opcodes, such as x86's lodsb, stosb, etc.
- there are no numeric comparison opcodes, such as x86's ja, jg, etc.; comparing two numbers requires a subtraction and then a carry flag check
- there are fewer registers to work with
the Raining Squares ROM. Should play in most VMU emulators (I recommend DirectVMS)
the Raining Squares source code. Use it with the SDK below
use this to develop your own Dreamcast VMU homebrew. It relies on a version of the assembler below compiled under Cygwin. Requires Cygwin. It contains the source code for Raining Squares.
VMS assembler source
the VMS assembler source code, in case you'd like to compile the assembler yourself under Linux or Cygwin
VMS assembler compiled under Linux
compiled under Linux from the source code above