aboutsummaryrefslogtreecommitdiff
path: root/source/dsp2emu.c
diff options
context:
space:
mode:
authortwinaphex2017-08-14 08:43:57 +0200
committertwinaphex2017-08-14 08:43:57 +0200
commit4b0bf2bc68a317b98382823ea2b7dd2e77ec8d37 (patch)
treec60c664807d9ba0f1b847003a49a876625be5035 /source/dsp2emu.c
parent78b32e05a8e3c221279ba40c8f19d762420be8a6 (diff)
downloadsnes9x2005-4b0bf2bc68a317b98382823ea2b7dd2e77ec8d37.tar.gz
snes9x2005-4b0bf2bc68a317b98382823ea2b7dd2e77ec8d37.tar.bz2
snes9x2005-4b0bf2bc68a317b98382823ea2b7dd2e77ec8d37.zip
Rewrite C++ comments
Diffstat (limited to 'source/dsp2emu.c')
-rw-r--r--source/dsp2emu.c66
1 files changed, 34 insertions, 32 deletions
diff --git a/source/dsp2emu.c b/source/dsp2emu.c
index 4e22d54..48e06c2 100644
--- a/source/dsp2emu.c
+++ b/source/dsp2emu.c
@@ -11,30 +11,31 @@ uint8_t DSP2Op05Transparent = 0;
void DSP2_Op05(void)
{
uint8_t color;
- // Overlay bitmap with transparency.
- // Input:
- //
- // Bitmap 1: i[0] <=> i[size-1]
- // Bitmap 2: i[size] <=> i[2*size-1]
- //
- // Output:
- //
- // Bitmap 3: o[0] <=> o[size-1]
- //
- // Processing:
- //
- // Process all 4-bit pixels (nibbles) in the bitmap
- //
- // if ( BM2_pixel == transparent_color )
- // pixelout = BM1_pixel
- // else
- // pixelout = BM2_pixel
+ /* Overlay bitmap with transparency.
+ * Input:
+ *
+ * Bitmap 1: i[0] <=> i[size-1]
+ * Bitmap 2: i[size] <=> i[2*size-1]
+ *
+ * Output:
+ *
+ * Bitmap 3: o[0] <=> o[size-1]
+ *
+ * Processing:
+ *
+ * Process all 4-bit pixels (nibbles) in the bitmap
+ *
+ * if ( BM2_pixel == transparent_color )
+ * pixelout = BM1_pixel
+ * else
+ * pixelout = BM2_pixel
- // The max size bitmap is limited to 255 because the size parameter is a byte
- // I think size=0 is an error. The behavior of the chip on size=0 is to
- // return the last value written to DR if you read DR on Op05 with
- // size = 0. I don't think it's worth implementing this quirk unless it's
- // proven necessary.
+ * The max size bitmap is limited to 255 because the size parameter is a byte
+ * I think size=0 is an error. The behavior of the chip on size=0 is to
+ * return the last value written to DR if you read DR on Op05 with
+ * size = 0. I don't think it's worth implementing this quirk unless it's
+ * proven necessary.
+ */
int32_t n;
uint8_t c1;
@@ -55,15 +56,15 @@ void DSP2_Op05(void)
void DSP2_Op01(void)
{
- // Op01 size is always 32 bytes input and output.
- // The hardware does strange things if you vary the size.
+ /* Op01 size is always 32 bytes input and output.
+ * The hardware does strange things if you vary the size. */
int32_t j;
uint8_t c0, c1, c2, c3;
uint8_t* p1 = DSP1.parameters;
uint8_t* p2a = DSP1.output;
- uint8_t* p2b = &DSP1.output[16]; // halfway
+ uint8_t* p2b = &DSP1.output[16]; /* halfway */
- // Process 8 blocks of 4 bytes each
+ /* Process 8 blocks of 4 bytes each */
for (j = 0; j < 8; j++)
{
c0 = *p1++;
@@ -79,9 +80,10 @@ void DSP2_Op01(void)
void DSP2_Op06(void)
{
- // Input:
- // size
- // bitmap
+ /* Input:
+ * size
+ * bitmap
+ */
int32_t i, j;
@@ -93,10 +95,10 @@ bool DSP2Op0DHasLen = false;
int32_t DSP2Op0DOutLen = 0;
int32_t DSP2Op0DInLen = 0;
-// Scale bitmap based on input length out output length
+/* Scale bitmap based on input length out output length */
void DSP2_Op0D(void)
{
- // (Modified) Overload's algorithm
+ /* (Modified) Overload's algorithm */
int32_t i;
for(i = 0 ; i < DSP2Op0DOutLen ; i++)
{