Dreamcast VMU Programming and Tools |
SEGAs Visual Memory Unit (VMU for short) is a neat little platform for writing small games and doing little hardware projects. And it's easy to share them with friends over the internet or in person.
If you already are into Dreamcast VMU Programming and want some helpful tools that create .VMI and .DCI files for you or that convert .DCI files back into .VMS files, then have a look at my self-programmed stuff here:
| ||
dci_vmi.zip
German Version dci_vmi.zip English Version |
This little program lets you create .DCI files (that can then be
uploaded into the Nexus 4x Memory Card) and .VMI files that are
needed to download .VMS files from webpages directly into the Visual
Memory Unit of your Dreamcast (type the program name without any
parameter to get additional info).
Note: Version 1.5 had a bug with .VMI file creating (the bits for 'copy protect' and 'file type' were mixed up, resulting in copy protected data files being marked as game files). | |
| ||
dci2vms.zip
German Version dci2vms.zip English Version | This little program converts .DCI files (for the Nexus 4x Memory Card) back into .VMS files (type the program name without any parameter to get additional info). | |
| ||
dci2file.zip
German Version dci2file.zip English Version |
You can use this to extract Internet Downloads from .DCI files
(images that have been saved with Dreamkey and copied to your PC
with the Nexus 4x Memory Card).
This is a 'beta' release, so I guarantee for nothing. ;) I only made this program because someone from France requested it, since he can access the internet via the Dreamcast only (oh, the poor guy), but wanted to use the images that he saves while online on his PC too. Note: you can NOT decode Dreamcast Mail Attachments with this tool! |
For more information about the Nexus 4x Memory Card, please go to http://www.hkems.com (there you can also get the software to up-/download stuff from and to the card).
| ||
ripit.zip
German Version ripit.zip English Version | When writing VMU programs, don't you too find it quite hard to create the binary image data that you later copy to the LCD screen? With this neat little tool it's a piece of cake. You can now simply create all your images with VMU Animator (see http://www.vmudev.org/) or Dream Animator (see http://www.booyaka.com/), safe your work as an .LCD file and then use Frame Ripper to extract the frames that you need. They will be saved as plain text, ready-to-be-included into your source file. | |
| ||
vms_crc.zip
German Version vms_crc.zip English Version |
Many Dreamcast Save Game files contain a CRC checksum to prevent
manipulation of its data. This small program calculates the new
checksum value for you. Simply run it after you are done with
modifying your Save Game data, and the new CRC value is written
into the file.
Note: Version 1.1 had a bug that made it calculate the filesize incorrectly in files that had a graphic eyecatch image included (an extra picture that appears at the bottom left in the Dreamcast File Manager). | |
| ||
lcd_anim.zip
German Version lcd_anim.zip English Version |
A simple program that converts .LCD animations into .VMS files that
can then be run on a VMU like a normal game (type the program name
without any parameter to get additional info). Also creates
a matching animated GIF image that can be used on webpages.
Unlike booyaka's Online LCD Converter, this one does not support any 'special features' like screen inverting, slide effects, selective displaying of frames, button checking, and so on. Anyone who wants such things should IMHO try to write real VMU programs instead of just playing with LCD animations. Also, I think that at least some stuff should be reserved for those who are willing to invest the time and effort to learn VMU programming... if everything were made so easy that even an idiot can use it, then all we would get in the end is stuff made by idiots, right? ;) BTW, anyone else around who ever programmed GIF LZW compression in assembler like me? ;) | |
| ||
uldecode.zip
German Version uldecode.zip English Version |
This program displays and decodes the Chao data stored in a
Chao Upload File (which is generated when you press and hold A+Y
while putting a Chao into the Chao machine in Sonic Adventure)
and also creates a matching Chao Download File named CHAODATA.VMS
that you can then put on your website.
Note: you can only decode the data of Chao creatures with this tool, NOT scores from minigame competitions and stuff like this! | |
| ||
bmp2asm.zip |
This tool converts .BMP images to binary source data. You can
choose between screen-data, icon-data or sprite-data. The output
can be included into a source file and be compiled. The code
it generates is in conformance with Marcus VMU Assembler
(type the program name without any parameter to get additional
info).
Written by Pascal Lacroix |
The CPU in SEGAs Visual Memory Unit is a customized Sanyo microcontroller which is code compatible with the LC86000 series. This means that you have to write your VMU programs in assembler, 'LC86000 Assembler' to be exact. Also, you need to know how a VMU game file is organized (Header Data, Interrupt Vectors, Header Icons etc.) and how the VMU hardware works (LCD-Screen, Flash Rom, Special Function Registers etc.).
I can't give a 'full course' about how to program games for the VMU here, but I can try to help newcomers a little to get started...
First you need an Assembler (the program that makes a VMU game file out of your source listing) and a VMU Emulator (to test-run your program on your PC).
A DOS / Windows version of Marcus Comstedt's VMU assembler can be downloaded from
http://www.maushammer.com/vmuasm.exeTo use the assembler, simply type
VMUASM [-i<include_directory>] <sourcefile>This program also needs a file called 'SFR.I' to recognize all Special Function Registers and PSW bits. If it wasn't included in your copy of the assembler, then you can download it here.
For additional help, simply type "vmuasm -h". After compiling your source file, you should end up with a file called <sourcefile>.VMS. This is the output file, suitable for use with the VMU emulator, or if you build an appropriate .VMI file and put it on a properly configured website, you can get it into an actual VMU.
A DOS / Windows version of Marcus Comstedt's VMU Emulator (called DOS SoftVMS, ported by Colm Cox) can be downloaded from
http://www.fortunecity.com/skyscraper/wav/1190/dl_exe.htmlIt runs full-screen or in a DOS box under Windows and emulates most of VMU hardware, which is enough to run all known SEGA games. There is no sound support yet, but hopefully that will soon be added too.
To run a game, simply type
VMS <game_filename>There is also a VMU disassembler (a program that can make source listings out of a .VMS game file, so you can have a look at the code) available at
http://www.maushammer.com/LCdis.exeThe disassembler takes machine-readable code and turns it into a human-readable format, which is very useful for analyzing programs.
For additional info how to use the Assembler, Disassembler and Emulator, go to
http://www.maushammer.com/vmu.html
http://mc.pp.se/dc/Choose 'software' for programming info. Most notably are the explanations of addressing modes & the CPU Instruction Set and about the VMU Special Function Registers & the LCD Frame Buffer (especially the latter is important to be able to display stuff on the screen). I suggest saving the pages to disk and printing them, so you have something to refer to if you get stuck. :)
A sample source listing of a VMU Tetris game is available at
http://mc.pp.se/dc/files/tetris.sI suggest you start with the Tetris source, it's the same one I used to learn it. The code is pretty well documented, and most other programs use functions from this code too.
A sample VMU Pong (Breakout) source listing is available at
http://www.maushammer.com/bounce.sA sample VMU Scroll demo (scrolling text) is available at
http://www.virtuamunstaz.de/scroll.sLook at every line of program code, try to understand what it does and write it behind the code as a comment (even when it's something obvious), for example
MOV #$01,ACC ST B MOV #$0,XBNK |
; move value $01 into ACC register ; move contents of ACC register into B register ; set XBANK-register to 0 (this selects memory ; bank 0 of the LCD frame buffer) |
I know that this can be quite hard and time-consuming, but believe me, it's the best way to learn it. :) I suggest you start with a simple routine like 'CLRSCR' (which clears the screen of the VMU by writing bytes with the value $00 to the LCD frame buffer). Understanding how to address the LCD is one of THE most important things in VMU programming.
BTW, everything following a ; or * character is considered a comment by the assembler and is ignored.
For your convenience, you can download my
Example Source SkeletonThis is a fully-documented and easy-to-understand source sample with explains everything about the basic VMU program structure that you need to know. Also note that even though its only meant to serve demonstratic purposes, it's also a ready-to-compile program, so you can run it through the VMU assembler right on the spot and test it, if you want (although all it does is clearing the screen and then displaying the message "Hello World").
http://www.booyaka.comYou can also go to the VMU development mailinglist at
http://www.egroups.com/group/vmu-dev/That's where most people interested in writing stuff for the VMU appear to be gathering. Also, it has been noted that Sega engineer Alexander Villagran is working on getting the official VMU development tools released to hobbyists. Let's wait and see if he succeeds.
There is also an 'Unofficial VMU FAQ' available at
http://rvmu.port5.com/faq.htmlPhew. ;) That's it so far... more stuff will be added at a later time.