diff scn2k/scn2k_grp.cc @ 20:824b89018ea8

* CG completion percentage (maybe not working properly?) * Removed unneeded files from the SVN
author thib
date Fri, 24 Oct 2008 16:59:14 +0000
parents 4d7486cb20a9
children f45da03ca631
line wrap: on
line diff
--- a/scn2k/scn2k_grp.cc
+++ b/scn2k/scn2k_grp.cc
@@ -179,6 +179,7 @@ class GrpImpl {
 	void LoadCgm(AyuSysConfig& config);
 	std::map<std::string, int> cgm_info;
 	set<int>& cgm_data;
+	int cgm_size;
 	
 	class MuSys& music;
 
@@ -1278,7 +1279,7 @@ void GrpImpl::LoadCgm(AyuSysConfig& conf
 		delete[] data;
 		return;
 	}
-	int cgm_size = read_little_endian_int(data+0x10);
+	cgm_size = read_little_endian_int(data+0x10);
 
 	int i,j;
 	// xor 解除
@@ -1740,7 +1741,10 @@ void GrpImpl::Exec(Cmd& cmd) {
 			cmd.clear();
 		}
 	}
-	if (cmd.cmd1 == 1 && cmd.cmd2 == 4) {
+	if (cmd.cmd1 == 1 && cmd.cmd2 == 4) { // Percentage... maybe not working?
+		if (cmd.cmd3 == 0x5de) {
+			cmd.SetSysvar(cgm_data.size() * 100 / cgm_size);
+		}
 		if (cmd.cmd3 == 0xd8 || cmd.cmd3 == 0xd3 || cmd.cmd3 == 0xd2 || cmd.cmd3 == 0xd7) {
 			cmd.clear(); // いつも 0xd8 / 0xd7 と組で出てくる
 		}