From 3bd41879d4a8929ff0686ebb53c9c7c4016c9d32 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Tue, 1 Sep 2009 14:31:24 +0200 Subject: add method writeNibble and all needed members to cSpuEncoder --- spuencoder.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'spuencoder.c') diff --git a/spuencoder.c b/spuencoder.c index 965683a..d61b462 100644 --- a/spuencoder.c +++ b/spuencoder.c @@ -65,3 +65,18 @@ void cSpuEncoder::clearOsd() cDxr3Interface::instance()->WriteSpu((uchar *)&d, 10); } + +void cSpuEncoder::writeNibble(uint8_t val) { + + // look if we have an overflow + if (written == MAX_SPU_DATA) { + throw "overflow"; + } + + if (ncnt++ & 1) { + *p++ = nholder | ((val) & 0x0f); + written++; + } else { + nholder = (val << 4); + } +} -- cgit v1.2.3