[libbluray-devel] Implement HDMV SETSYSTEM command 0x10

npzacs git at videolan.org
Sun Jul 7 13:30:44 CEST 2013


libbluray | branch: master | npzacs <npzacs at gmail.com> | Sun Jul  7 14:26:41 2013 +0300| [c8ce62f2ad470bfd684c5224a8c4c110b383fd28] | committer: npzacs

Implement HDMV SETSYSTEM command 0x10

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=c8ce62f2ad470bfd684c5224a8c4c110b383fd28
---

 src/libbluray/hdmv/hdmv_insn.h  |    2 ++
 src/libbluray/hdmv/hdmv_vm.c    |   14 ++++++++++++++
 src/libbluray/hdmv/mobj_print.c |   14 +++++++++++++-
 3 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/hdmv/hdmv_insn.h b/src/libbluray/hdmv/hdmv_insn.h
index 84c32af..acf4ac9 100644
--- a/src/libbluray/hdmv/hdmv_insn.h
+++ b/src/libbluray/hdmv/hdmv_insn.h
@@ -123,6 +123,8 @@ typedef enum {
     INSN_STILL_OFF       = 0x09,
     INSN_SET_OUTPUT_MODE = 0x0a,
     INSN_SET_STREAM_SS   = 0x0b,
+
+    INSN_SETSYSTEM_0x10  = 0x10,
 } hdmv_insn_setsystem;
 
 #endif // _HDMV_INSN_H_
diff --git a/src/libbluray/hdmv/hdmv_vm.c b/src/libbluray/hdmv/hdmv_vm.c
index 7e9a3dd..cb9afe5 100644
--- a/src/libbluray/hdmv/hdmv_vm.c
+++ b/src/libbluray/hdmv/hdmv_vm.c
@@ -671,6 +671,19 @@ static void _set_stream_ss(HDMV_VM *p, uint32_t dst, uint32_t src)
     BD_DEBUG(DBG_HDMV, "_set_stream_ss(0x%x, 0x%x) unimplemented\n", dst, src);
 }
 
+static void _setsystem_0x10(HDMV_VM *p, uint32_t dst, uint32_t src)
+{
+    BD_DEBUG(DBG_HDMV, "_set_psr103(0x%x, 0x%x)\n", dst, src);
+
+    bd_psr_lock(p->regs);
+
+    /* just a guess ... */
+    //bd_psr_write(p->regs, 104, 0);
+    bd_psr_write(p->regs, 103, dst);
+
+    bd_psr_unlock(p->regs);
+}
+
 /*
  * SET/SYSTEM navigation control
  */
@@ -1035,6 +1048,7 @@ static int _hdmv_step(HDMV_VM *p)
                         case INSN_STILL_OFF:       _set_still_mode (p,   0);      break;
                         case INSN_SET_OUTPUT_MODE: _set_output_mode(p, dst);      break;
                         case INSN_SET_STREAM_SS:   _set_stream_ss  (p, dst, src); break;
+                        case INSN_SETSYSTEM_0x10:  _setsystem_0x10 (p, dst, src); break;
                         default:
                             BD_DEBUG(DBG_HDMV|DBG_CRIT, "unknown SETSYSTEM option %d in opcode 0x%08x\n", insn->set_opt, *(uint32_t*)insn);
                             break;
diff --git a/src/libbluray/hdmv/mobj_print.c b/src/libbluray/hdmv/mobj_print.c
index 53c5433..8865892 100644
--- a/src/libbluray/hdmv/mobj_print.c
+++ b/src/libbluray/hdmv/mobj_print.c
@@ -204,6 +204,11 @@ static const char * const insn_opt_setsys[32] = {
     "STILL_OFF",
     "SET_OUTPUT_MODE",
     "SET_STREAM_SS",
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    "[SETSYSTEM_0x10]",
 };
 
 static const char * const insn_opt_cmp[16] = {
@@ -364,8 +369,15 @@ int mobj_sprint_cmd(char *buf, MOBJ_CMD *cmd)
                     break;
             case SET_SETSYSTEM:
                 if (insn_opt_setsys[insn->set_opt]) {
+
                     buf += sprintf(buf, "%-10s ", insn_opt_setsys[insn->set_opt]);
-                    buf += _sprint_operands_hex(buf, cmd);
+                    if (insn->set_opt == INSN_SET_STREAM ||
+                        insn->set_opt == INSN_SET_SEC_STREAM ||
+                        insn->set_opt == INSN_SET_BUTTON_PAGE) {
+                        buf += _sprint_operands_hex(buf, cmd);
+                    } else {
+                        buf += _sprint_operands(buf, cmd);
+                    }
                 } else {
                     buf += sprintf(buf, "[unknown SETSYSTEM option in opcode 0x%08x] ", *(uint32_t*)insn);
                 }



More information about the libbluray-devel mailing list