summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--dxr3interface.c39
-rw-r--r--dxr3interface.h2
-rw-r--r--spuencoder.c41
-rw-r--r--spuencoder.h9
5 files changed, 51 insertions, 42 deletions
diff --git a/Makefile b/Makefile
index 264b432..139c470 100644
--- a/Makefile
+++ b/Makefile
@@ -75,7 +75,7 @@ OBJS = $(PLUGIN).o dxr3multichannelaudio.o dxr3colormanager.o \
dxr3pesframe.o dxr3demuxdevice.o dxr3configdata.o \
dxr3interface_spu_encoder.o dxr3interface.o dxr3device.o \
dxr3output.o dxr3output-video.o dxr3output-audio.o dxr3osd.o dxr3spudecoder.o \
- dxr3audio-oss.o dxr3audio-alsa.o
+ dxr3audio-oss.o dxr3audio-alsa.o spuencoder.o
### Default target:
diff --git a/dxr3interface.c b/dxr3interface.c
index 7305aea..878503d 100644
--- a/dxr3interface.c
+++ b/dxr3interface.c
@@ -650,45 +650,6 @@ void cDxr3Interface::Resuscitation()
}
// ==================================
-void cDxr3Interface::ClearOsd()
-{
- encodedata ed;
- int controlstart= 0;
- int x1 = 0;
- int& i = ed.count = 0;
-
- // display duration...
- ed.data[i++]= 0x00;
- ed.data[i++]= 0x00; //durration before turn on command occurs
- //in 90000/1024 units
- // x1
- ed.data[i++]= x1 >> 8; //since this is the last command block, this
- ed.data[i++]= x1 & 0xff; //points back to itself
-
-
- // 0x01: start displaying
- ed.data[i++]= 0x02;
-
- // 0xFF: end sequence
- ed.data[i++]= 0xFF;
- if (!i&1)
- {
- ed.data[i++]= 0xff;
- }
-
- // x0
- ed.data[2]= (controlstart) >> 8;
- ed.data[3]= (controlstart) & 0xff;
-
- // packet size
- ed.data[0]= i >> 8;
- ed.data[1]= i & 0xff;
-
- WriteSpu((const uint8_t*) &ed, (int) ed.count);
- ClearButton();
-}
-
-// ==================================
void cDxr3Interface::WriteSpu(const uint8_t* pBuf, int length)
{
Lock();
diff --git a/dxr3interface.h b/dxr3interface.h
index 8e53781..83f73aa 100644
--- a/dxr3interface.h
+++ b/dxr3interface.h
@@ -123,8 +123,6 @@ public:
void ReOpenAudio();
// osd/spu
-
- void ClearOsd();
void WriteSpu(const uint8_t* pBuf, int length);
void SetButton(uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey,
uint32_t palette);
diff --git a/spuencoder.c b/spuencoder.c
new file mode 100644
index 0000000..b2a9921
--- /dev/null
+++ b/spuencoder.c
@@ -0,0 +1,41 @@
+#include "spuencoder.h"
+#include "dxr3interface.h"
+
+static const uint8_t CMD_FORCE_DISPLAYING = 0x00;
+static const uint8_t CMD_STOP_DISPLAYING = 0x02;
+static const uint8_t CMD_SET_COLOR = 0x03;
+static const uint8_t CMD_SET_ALPHA = 0x04;
+static const uint8_t CMD_SET_DISPLAYAREA = 0x05;
+static const uint8_t CMD_SET_PIXEL_ADDRESES = 0x06;
+static const uint8_t CMD_CHG_COLCON = 0x07;
+
+void cSpuEncoder::clearOsd()
+{
+ uint8_t d[10];
+
+ // packet size
+ d[0] = 0;
+ d[1] = 10;
+
+ // pointer to the SP_DCSQT
+ d[2] = 0;
+ d[3] = 4;
+
+ // display duration...
+ d[4] = 0x00;
+ d[5] = 0x00; // duration before turn on command occurs (will not be used)
+
+ // pointer to next command block
+ d[6] = 0; // since this is the last command block, this
+ d[7] = 4; // points back to itself
+
+ // stop displaying
+ d[8] = CMD_STOP_DISPLAYING;
+
+ // end sequence
+ d[9] = 0xFF;
+
+ // TODO: osd button handling
+
+ cDxr3Interface::instance()->WriteSpu((uchar *)&d, 10);
+}
diff --git a/spuencoder.h b/spuencoder.h
new file mode 100644
index 0000000..f84d037
--- /dev/null
+++ b/spuencoder.h
@@ -0,0 +1,9 @@
+#ifndef SPUENCODER_H
+#define SPUENCODER_H
+
+class cSpuEncoder {
+public:
+ void clearOsd();
+};
+
+#endif // SPUENCODER_H