From e742981dee8cf4fb27da74f10f492b26aebfd12b Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 5 Oct 2010 20:46:10 +0200 Subject: merger DRO support from adplug-2.2.1 --- plugins/adplug/adplug/dro.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'plugins/adplug') diff --git a/plugins/adplug/adplug/dro.cpp b/plugins/adplug/adplug/dro.cpp index 1d7d5f8e..fdf08e42 100644 --- a/plugins/adplug/adplug/dro.cpp +++ b/plugins/adplug/adplug/dro.cpp @@ -59,9 +59,20 @@ bool CdroPlayer::load(const char *filename, const CFileProvider &fp) // load section mstotal = f->readInt(4); // Total milliseconds in file length = f->readInt(4); // Total data bytes in file - f->ignore(4); // Type of opl data this can contain - ignored data = new unsigned char [length]; - for (i=0;iignore(1); // Type of opl data this can contain - ignored + for (i=0;i<3;i++) + data[i]=f->readInt(1); + + if ((data[0] == 0) || (data[1] == 0) || (data[2] == 0)) { + // Some early .DRO files only used one byte for the hardware type, then + // later changed to four bytes with no version number change. If we're + // here then this is a later (more popular) file with the full four bytes + // for the hardware-type. + i = 0; // so ignore the three bytes we just read and start again + } + for (;ireadInt(1); fp.close(f); rewind(0); -- cgit v1.2.3