Skip to content

Data Blocks, RAM, and a New Feature?

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

  • Quantam Offline
  • Posts: 24
  • Joined: 2020-03-05, 9:25:23

Data Blocks, RAM, and a New Feature?

Post by Quantam »

I am not familiar enough with the range of chips supported by VGM to know the answer to this. Is there a use case where creating (PCM or compressed) data blocks are absolutely required? If I understand correctly, ROM/RAM image dumps and RAM writes through the data block command are immediate commands that write their command data to ROM/RAM without having to create a data block. On the other hand, the separate PCM write command requires a pre-existing data block. Is there anything that can be written with the PCM RAM write command that can't be done with the ROM/RAM dump and RAM write data block command without using data blocks?

The DAC stream mechanism also uses a data block, but this mechanism can be baked and converted into writes of the DAC register, so data blocks are not required here.

The reason I ask is that data blocks are not suitable for microcontrollers that control real hardware due to the very limited RAM. So I'm trying to figure out if it's possible to have the host computer pre-process the VGM to convert from data blocks into equivalent commands that don't require creating data blocks before sending it to the microcontroller.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

PCM data blocks (command 67, IDs 0x00..0x7F) are not required. You can resolve all of them into "usual" commands.
The exact method of resolving those depends on how the data blocks are used:
  • command 68 - resolves into "67 66 ii" commands where "ii" is 0xC0..0xFF
  • commands 80..8F - resolves into "52 2A dd" (dd = data)
  • commands 90..95 - these are the DAC stream commands and they are the most complicated
    command 90 specifies what sound chip + register the data goes to
In general the PCM data blocks are just a way to optimize the VGM file sizes. If you want, you can do everything without them.
  • Quantam Offline
  • Posts: 24
  • Joined: 2020-03-05, 9:25:23

Post by Quantam »

Excellent!
Post Reply