Thread Rating:
  • 3 Vote(s) - 4.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Native VGM player for the NGP(C)
#22
I've been working on an improved version of a VGM packer that I originally wrote for use with the SNES. The original packing scheme has been changed to the following:

Each group of 7 VGM commands are preceded by one byte worth of flags:

wppppppp

p: if 1, the corresponding VGM command is a "PSG write" command (0x50 0xnn) and only the argument (0xnn) will be stored in the compressed stream. if 0, the corresponding command is something other than a "PSG write" command and is stored verbatim.

w: if 0, all commands in the group for which the corresponding p-bit is 0 are "wait one frame" commands (0x62 or 0x63), and those command bytes will not be stored in the compressed stream.

This compression technique will fail if a song uses both command 0x62 (wait 1/60 s) and 0x63 (wait 1/50 s), but I see no good reason for why any song would do that.

According to my tests this gives a compression ratio of about 1.85:1 for most songs, and in some cases over 2:1 (for SMS/GG songs that is, it doesn't pack NGP songs nearly as good).
For example, this:

50 83 50 15 50 A9 50 0A 62 50 F4 62

would be compressed into this:

2F 83 15 A9 0A F4

If I also bumped up the maximum ROM size to 4 MB you'd be able to fit something like 3.5 hours worth of VGMs Tongue
Reply


Messages In This Thread
Native VGM player for the NGP(C) - by mic_ - 04-14-2012, 03:19 AM
RE: Native VGM player for the NGP(C) - by Morden - 04-14-2012, 03:34 AM
RE: Native VGM player for the NGP(C) - by Flavor - 04-14-2012, 02:23 PM
RE: Native VGM player for the NGP(C) - by mic_ - 04-14-2012, 06:04 PM
RE: Native VGM player for the NGP(C) - by mic_ - 04-14-2012, 08:30 PM
RE: Native VGM player for the NGP(C) - by Morden - 04-15-2012, 12:20 AM
RE: Native VGM player for the NGP(C) - by mic_ - 04-15-2012, 02:11 AM
RE: Native VGM player for the NGP(C) - by Flavor - 04-15-2012, 12:31 AM
RE: Native VGM player for the NGP(C) - by mic_ - 04-15-2012, 05:36 PM
RE: Native VGM player for the NGP(C) - by mic_ - 04-16-2012, 04:47 AM
RE: Native VGM player for the NGP(C) - by mic_ - 04-17-2012, 04:37 AM
RE: Native VGM player for the NGP(C) - by Flavor - 04-17-2012, 07:34 AM
RE: Native VGM player for the NGP(C) - by mic_ - 04-21-2012, 07:01 PM
RE: Native VGM player for the NGP(C) - by Flavor - 04-22-2012, 10:29 AM
RE: Native VGM player for the NGP(C) - by mic_ - 04-22-2012, 05:34 PM
RE: Native VGM player for the NGP(C) - by Flavor - 04-22-2012, 11:25 PM
RE: Native VGM player for the NGP(C) - by mic_ - 04-23-2012, 05:17 AM
RE: Native VGM player for the NGP(C) - by mic_ - 04-28-2012, 05:42 PM
RE: Native VGM player for the NGP(C) - by Morden - 05-01-2012, 01:42 AM
RE: Native VGM player for the NGP(C) - by mic_ - 05-01-2012, 03:48 AM
RE: Native VGM player for the NGP(C) - by Morden - 05-01-2012, 04:20 AM
RE: Native VGM player for the NGP(C) - by mic_ - 05-02-2012, 04:00 PM
RE: Native VGM player for the NGP(C) - by sodthor - 04-17-2013, 01:06 AM
RE: Native VGM player for the NGP(C) - by mic_ - 04-17-2013, 01:22 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)