Page 2 of 4

Posted: Wed Dec 12, 2007 6:37 am
by LocalH
I'm not sure how it would work in emulation since a good number of official SRAM-enabled carts did place it at $200000 AFAIK, but theoretically you can place the RAM anywhere you want, as long as the cart hardware is designed around that. I'm not even sure if you absolutely have to denote it in the header, although it may be necessary for emulation. How much cart RAM are you using? You could try putting it at the top of ROM space, leaving the space in-between for the VGM. Alternately, you could try placing it inbetween your code and the VGM data. Once again, I don't know how this would pan out for emulation, nor with cart copiers or flash carts, but with a suitably-designed PCB I'm certain that it would work at least on real hardware.

Posted: Wed Dec 12, 2007 7:55 am
by Chilly Willy
MIKE-STAMP wrote:on a different subject, does anyone have any information about how to access the cd hardware in the sega cd. I am now trying to write a new version of my vgm player for the sega cd.
Fonzie has the biggest selection of docs. You'll find the SEGA CD docs there.

http://www.genny4ever.net/index.php?page=docs

Posted: Wed Dec 12, 2007 8:41 am
by MG
I had downloaded all of your demos.
Good job guy !

For the moment, i prefer this : "Z80MUS.BIN", lot of zics in the same rom, great idea !

Very funny and good stuff !

A+

Posted: Thu Dec 13, 2007 11:17 am
by TmEE co.(TM)
Emulators only emulate SRAM in $200000 to $20FFFF range (64KB)... Genecyst is the only one that emulates full 2MB of SRAM.

Posted: Sat Dec 15, 2007 8:07 pm
by tinctu
@Shiru ,Mike-Stamp...
I have this little idea...
Is possible in future version display author and song name ,total time and current possition in song on MD screen (into BIN or SMD)???
Simple TXT menu player (for more songs...)????
Something like this one 8bit player for Atari... but with more features.
Image

Posted: Sun Dec 16, 2007 3:02 am
by MIKE-STAMP
I supose it would be possible, vgm files though are usually very consuming on space, so there is only a limited number of games in which you could get more that a couple of tracks on. Could probaly get away with the increased cpu usage but, adding things does increase the likelyhood of the buffer becomnig empty. I could easylt though read the gd3 tag, and support for multiple tracks.

Posted: Tue Dec 18, 2007 11:53 am
by zinger
MIKE-STAMP wrote:I supose it would be possible, vgm files though are usually very consuming on space, so there is only a limited number of games in which you could get more that a couple of tracks on.
That's why you want to make a player for Mega CD? It would be really cool having the entire library on one or a few discs, to play on real hardware.

Posted: Wed Dec 19, 2007 3:45 am
by MIKE-STAMP
Yes, iv'e been working quite hard on the mega cd version. Running up against quite a few problems. The mega cd is an horible machine. The lack of any shared memory is causing me problems. And also, the megacd docs say that the z80 should not access the word ram. If the real hardware has issues with this i'm screwed.

Posted: Wed Dec 19, 2007 10:49 am
by Fonzie
Wow :)

Btw, you might be able to cleverly mix 1M and 2M ram modes (so you can always keep 128KB for z80 and the other 128KB alternatively on megacd or megadrive side for the undécoded VGM file... That's just an idea.

I would not suggest to bus request the megacd pgrm ram... I do it for tavern rpg and it cause a lot more issues than expected ^^

About the z80 reading the Word ram... I suspect it is possible because many ports (with just intro FMV) ran from the word ram, z80 included (probably).
Just get sure to halt the Z80 for few cycles when switching word ram modes/sides (sometimes, the hardware take some time to react, f***** hardware).

Good luck!

Posted: Wed Feb 06, 2008 6:59 pm
by zinger
I tired the software with my tototek flash cart and it doesn't work... :?

Posted: Mon Aug 10, 2009 6:30 pm
by mic_
You might know this already (I didn't bother reading through the entire thread), but your player doesn't seem to clear VRAM properly when starting. This is what I get on my Megadrive II + Megacart:

Image

That garbage on the top half of the screen is leftovers from the Megacart menu.

Posted: Mon Aug 10, 2009 6:41 pm
by TmEE co.(TM)
its far worse on MD1... at least with some versions. I recall the version I have having no garbage.

Posted: Wed Aug 12, 2009 2:24 pm
by mic_
One of the major issues with Genesis VGM players is the size of VGM files that do a lot of PCM playback, and the harsh limits that puts on the number of songs you can fit on a cart (at least if you have a 4MB cart like me). Decoding VGZ files in real time on a Genesis isn't really an option IMO. I briefly considered LZSS because I think it would be perfectly doable as long as you only access the data sequentially. But it would cause problems when seeking in the PCM data bank or when looping.

So instead I thought I'd extend the VGM format by using some of the unused command ranges to add some run-length encoding. I decided to focus only on compressing the 0x8n commands since they are the major space eaters.

Here's what I did:

If you have a long sequence of the same 0x8n command (like "0x84 0x84 0x84 0x84 0x84 ...") it will be encoded as 0xAn rr where rr is the run length minus one. So if you had 50 0x84:s in a row they would be encoded as 0xA4 0x32.

A far more common scenario is to have a long sequence of 0x8n commands but with varying values for n, e.g. "0x83 0x84 0x80 0x82 0x84 0x83 ...". In these cases the entire sequence (up to a length of 512 commands, and truncated down to an even length) will be encoded as 0x4E rr nm nm nm ...

rr is the number of bytes that follow, and each nm byte is a pair of n-values, where m comes from the first command and n from the second. So e.g. if you had 0x83 0x84 0x80 0x82 0x84 0x83 it would be encoded as 0x4E 0x03 0x43 0x20 0x34. Sequences of less than 6 commands will be encoded as-is (though usually these sequences are quite long).

I don't see any problems with decoding this in real time on the Genesis and still achieve accurate timing, but I'll try to add support for it to my own VGM player later to find out.

So far I've written an initial version of the encoder, and when trying it out on some VGMs that do a lot of PCM playback I've seen compression ratios of 40-70%, so it seems to work fairly well considering its simplicity.

Posted: Wed Aug 12, 2009 5:11 pm
by mic_
Looks like I spoke a bit too soon.. There was a bug in my encoder which I didn't discover until I actually tried to play back one of the packed files. So the actual compression ratio is more like 30-35% when using 0x8n commands with mixed n-values. If n is always the same the compression ratio can still be something like 70%.

Here's the encoder for anyone that's interested: http://jiggawatt.org/vgmpack.zip
It's a Windows console application for now, so you invoke it with vgmpack inputFile outputFile

Posted: Wed Aug 12, 2009 7:23 pm
by Shiru
I don't really get what's the point to have actual VGM format on SMD side. ROM builder could convert VGM data to any other format, more optimized for playback.