diff scn2k/scn2k_grp.cc @ 26:f45da03ca631

* Corrected --disable-vorbis in configure.ac * Added sound configuration * Added misc functions
author thib
date Sun, 01 Mar 2009 19:08:02 +0000
parents 824b89018ea8
children 01aa5ddf7dc8
line wrap: on
line diff
--- a/scn2k/scn2k_grp.cc
+++ b/scn2k/scn2k_grp.cc
@@ -1741,13 +1741,19 @@ void GrpImpl::Exec(Cmd& cmd) {
 			cmd.clear();
 		}
 	}
-	if (cmd.cmd1 == 1 && cmd.cmd2 == 4) { // Percentage... maybe not working?
-		if (cmd.cmd3 == 0x5de) {
+	if (cmd.cmd1 == 1 && cmd.cmd2 == 4) {
+		if (cmd.cmd3 == 0x5dc) // Total number of CG
+			cmd.SetSysvar(cgm_size);
+		if (cmd.cmd3 == 0x5dd) // Number of CG viewed
+			cmd.SetSysvar(cgm_data.size());
+		if (cmd.cmd3 == 0x5de) // Percentage of CG viewed
 			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 と組で出てくる
 		}
+
+		// CG Status
 		if (cmd.cmd3 == 0x5e0) { // 画像既視フラグを得る
 			string s = cmd.Str(cmd.args[0]);
 			if (cgm_info.find(s) == cgm_info.end()) {
@@ -1758,6 +1764,16 @@ void GrpImpl::Exec(Cmd& cmd) {
 			if (cgm_data.find(n) == cgm_data.end()) cmd.SetSysvar(0);
 			else cmd.SetSysvar(1);
 		}
+
+		if (cmd.cmd3 == 0x6a4) { // CreateInput (index, x, y, width, height, fontsize, br, bg, bb, fr, fg, fb)
+			int index = cmd.args[0].value;
+			int x = cmd.args[1].value;
+			int y = cmd.args[2].value;
+			//TODO
+		}
+		if (cmd.cmd3 == 0x6ae) { // SetInput (index, text)
+			//TODO
+		}
 	}
 #if 1
 	/* object 操作 */
@@ -2202,11 +2218,17 @@ 487 / 8047 : unsupported command; 0x23 -
 //		if (!music.IsStopSE()) status = WAIT_SE;
 		cmd.clear();
 	}
-	if (cmd.cmd1 == 1 && cmd.cmd2 == 4 && (cmd.cmd3 == 0x8b6 || cmd.cmd3 == 0x91a) ) {
+
 		// 音楽モードで音量を上げるためのコマンド (SetBgmVolume)
 		// とりあえず未実装
+	if (cmd.cmd1 == 1 && cmd.cmd2 == 4 && cmd.cmd3 >= 0x8b6 && cmd.cmd3 <= 0x8b9) { // Set{Bgm,Koe,PCM,Se}VolMod
+		music.volmod[cmd.cmd3-0x8b6] = cmd.args[0].value;
+		config.SetParam("#VOLMOD", 4, music.volmod[0], music.volmod[1], music.volmod[2], music.volmod[3]);
 		cmd.clear();
 	}
+	if (cmd.cmd1 == 1 && cmd.cmd2 == 4 && cmd.cmd3 >= 0x91a && cmd.cmd3 <= 0x91d) { // Get{Bgm,Koe,PCM,Se}VolMod
+		cmd.SetSysvar(music.volmod[cmd.cmd3-0x91a]);
+	}
 
 	if (cmd.cmd1 == 1 && cmd.cmd2 == 0x16) {
 		if (cmd.cmd3 == 0 && cmd.cmd4 == 0) {