VMU development: Difference between revisions

From dreamcast.wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
=== Overview ===
=== Overview ===
Developing standalone games for the VMU is both a challenging and rewarding development feat. On one hand, it's not the easiest embedded device or to target, given that it doesn't have a C compiler and has its own set of hardware eccentricities. On the other hand, the device features a rich instruction set, 3 different clock sources, a FAT filesystem, and many different peripherals which can be leveraged by a developer, making it something of a Sega Saturn of little 8-bit gaming devices.
Developing standalone games for the Sega Dreamcast's VMU (also known as VMS) is both a challenging and rewarding development feat. On one hand, it's not the easiest embedded device or to target, given that it doesn't have a C compiler and has its own set of hardware eccentricities. On the other hand, the device features a rich instruction set, 3 different clock sources, a FAT filesystem, and many different peripherals which can be leveraged by a developer, making it something of a Sega Saturn of little 8-bit gaming devices.


While there is an active and ongoing effort within the scene to lower the barrier of entry into VMU development and to get more high-quality tutorials and materials out there for newbies, this page will hopefully serve as an entry point based on what is currently available.
While there is an active and ongoing effort within the scene to lower the barrier of entry into VMU development and to get more high-quality tutorials and materials out there for newbies, this page will hopefully serve as an entry point based on what is currently available.
Line 6: Line 6:
=== Hardware ===
=== Hardware ===
A high-level overview of the VMU's hardware and peripherals can be found [[VMU_hardware_overview|here]]. A good initial look at application-development for the device can be found [https://mc.pp.se/dc/vms/index.html at Marcus Comstedt's VMU Programming Site]. A combination of this site and the official [[:File:VMU.pdf|VMU Development Manual]] is typically what is referenced while programming for the VMU.
A high-level overview of the VMU's hardware and peripherals can be found [[VMU_hardware_overview|here]]. A good initial look at application-development for the device can be found [https://mc.pp.se/dc/vms/index.html at Marcus Comstedt's VMU Programming Site]. A combination of this site and the official [[:File:VMU.pdf|VMU Development Manual]] is typically what is referenced while programming for the VMU.
=== Architecture ===


=== Programming ===
=== Programming ===
Since there is no C compiler for the VMU's 8-bit Sanyo CPU, development is traditionally done in Sanyo LC86k assembly language; however, it is now possible to write C code indirectly targeting the device via emulation of the ARM Cortex A23 CPU.  
Since there is no C compiler for the VMU's 8-bit Sanyo CPU, development is traditionally done in Sanyo LC86k assembly language; however, it is now possible to write C code indirectly targeting the device via emulation of the ARM Cortex A23 CPU.  
==== LC86k Assembly Code ====
==== LC86k Assembly Code ====
The Waterbear assembler/disassembler is the favored tool for creating VMU binaries, as it is cross-platform, supports all undocumented opcodes and SFRs, and is still under active development. You can find it [https://github.com/wtetzner/waterbear here].
The Waterbear assembler/disassembler is the favored tool for creating VMU binaries, as it is cross-platform, is feature-rich, supports all undocumented opcodes and SFRs, and is still under active development. You can find it [https://github.com/wtetzner/waterbear here].
===== LibPerspective =====
Due to the non-contiguous, banked nature of XRAM, it is actually a nontrivial engineering feat to blit an image to the LCD screen. LibPerspective is a simple rendering library developed to aid in such tasks. It is frequently used in modern VMU homebrew and will enable you to work with rendering bitmaps to the display much more quickly. More information can be found [https://slum.online/dreamcast/ here].
===== VMS Tetris =====
The source code to Marcus Comstedt's VMU version of Tetris serves as a a great beginner resource, as it is well-commented and is a fairly complex game. The source code can be found [https://mc.pp.se/dc/files/tetris.s here].
===== Raining Squares =====
Raining Squares is a tech demo which serves as a great example for newbies to the platform. More information can be found [http://sebastianmihai.com/raining-squares.html here].
 
==== C Code ====
==== C Code ====
Thanks to the uM23 emulator, it is now possible to indirectly write C code for the VMU. The code is cross-compiled for the ARM Cortex A23 target, and the resulting binary image is then loaded onto the VMU as a "DATA" file. The uM23 emulator, which must be loaded onto the device as the main "GAME" file, will then allow you to select an ARM binary image to run from its menu. More information can be found [https://dmitry.gr/?r=05.Projects&proj=25.%20VMU%20Hacking here].
Thanks to the uM23 emulator, it is now possible to indirectly write C code for the VMU. The code is cross-compiled for the ARM Cortex A23 target, and the resulting binary image is then loaded onto the VMU as a "DATA" file. The uM23 emulator, which must be loaded onto the device as the main "GAME" file, will then allow you to select an ARM binary image to run from its menu. More information can be found [https://dmitry.gr/?r=05.Projects&proj=25.%20VMU%20Hacking here].
Line 24: Line 29:
* VMU Tool
* VMU Tool
* Web Browser
* Web Browser
* Nexus Memory Card


=== References ===
=== References ===
Here are some reference resources to get started
* [https://mc.pp.se/dc/vms/index.html Marcus Comstedt's VMU Programming Site] - Architecture overview, instruction map, SFR references, etc
 
* [https://dmitry.gr/?r=05.Projects&proj=25.%20VMU%20Hacking Dmitry.gr VMU hacking] - uM23 Emulator Homepage
* [https://mc.pp.se/dc/vms/index.html Marcus Comstedt's VMU Programming Site]
* [http://slum.online/dreamcast/ Slum Online development] - LibPerspective and other VMU content
* [https://dmitry.gr/?r=05.Projects&proj=25.%20VMU%20Hacking link Dmitry.gr VMU hacking]
* [http://slum.online/dreamcast/ Slum Online development]
* [[VMU Emulators#ElysianVMU|ElysianVMU]] - Emulator, File Manager, Debugger
* [[VMU Emulators#ElysianVMU|ElysianVMU]] - Emulator, File Manager, Debugger
* [https://github.com/wtetzner/waterbear Waterbear] - VMU Assembler, Disassembler, VMS tools
* [https://github.com/wtetzner/waterbear Waterbear] - VMU Assembler, Disassembler, VMS tools
* VMU documentation in PDF: [[:File:VMU.pdf]]
* [https://www.deco.franken.de/myfiles/myfiles.html VMU Development and Tools] - Largely outdated with many broken links, still useful as a reference
* [[:File:VMU.pdf|VMU.pdf]] - Official Sega VMU Development Manual


{{DCWiki:Stub}}
{{DCWiki:Stub}}

Revision as of 22:57, 27 December 2022

Overview

Developing standalone games for the Sega Dreamcast's VMU (also known as VMS) is both a challenging and rewarding development feat. On one hand, it's not the easiest embedded device or to target, given that it doesn't have a C compiler and has its own set of hardware eccentricities. On the other hand, the device features a rich instruction set, 3 different clock sources, a FAT filesystem, and many different peripherals which can be leveraged by a developer, making it something of a Sega Saturn of little 8-bit gaming devices.

While there is an active and ongoing effort within the scene to lower the barrier of entry into VMU development and to get more high-quality tutorials and materials out there for newbies, this page will hopefully serve as an entry point based on what is currently available.

Hardware

A high-level overview of the VMU's hardware and peripherals can be found here. A good initial look at application-development for the device can be found at Marcus Comstedt's VMU Programming Site. A combination of this site and the official VMU Development Manual is typically what is referenced while programming for the VMU.

Programming

Since there is no C compiler for the VMU's 8-bit Sanyo CPU, development is traditionally done in Sanyo LC86k assembly language; however, it is now possible to write C code indirectly targeting the device via emulation of the ARM Cortex A23 CPU.

LC86k Assembly Code

The Waterbear assembler/disassembler is the favored tool for creating VMU binaries, as it is cross-platform, is feature-rich, supports all undocumented opcodes and SFRs, and is still under active development. You can find it here.

LibPerspective

Due to the non-contiguous, banked nature of XRAM, it is actually a nontrivial engineering feat to blit an image to the LCD screen. LibPerspective is a simple rendering library developed to aid in such tasks. It is frequently used in modern VMU homebrew and will enable you to work with rendering bitmaps to the display much more quickly. More information can be found here.

VMS Tetris

The source code to Marcus Comstedt's VMU version of Tetris serves as a a great beginner resource, as it is well-commented and is a fairly complex game. The source code can be found here.

Raining Squares

Raining Squares is a tech demo which serves as a great example for newbies to the platform. More information can be found here.

C Code

Thanks to the uM23 emulator, it is now possible to indirectly write C code for the VMU. The code is cross-compiled for the ARM Cortex A23 target, and the resulting binary image is then loaded onto the VMU as a "DATA" file. The uM23 emulator, which must be loaded onto the device as the main "GAME" file, will then allow you to select an ARM binary image to run from its menu. More information can be found here.

Testing

Emulators

The favored emulator for VMU development and testing is the ElysianVMU emulator, as it is cross-platform, is ranked top for features and accuracy, and is still actively developed. The emulator also has an explicit goal of offering a debugging environment to facilitate development. Much of the debugger is still under active development; however, just features like the RAM and flash memory explorer widgets can be of great use during development. More information can be found here.

Physical Device

Before publishing or distributing your game, it is highly recommended that you still test on physical hardware. There are various ways through which one can get a GAME file onto the actual device depending on your Dreamcast's configuration and peripherals.

  • DreamShell
  • VMU Tool
  • Web Browser
  • Nexus Memory Card

References

This page is a stub page. It needs to be expanded with more detail. If you know more information about this topic, please sign up and contribute to dreamcast.wiki!