Fix typos, colors, add redux notice
This commit is contained in:
parent
1cf7b7efa6
commit
b6d1c1b2f7
@ -6,6 +6,11 @@ In this instance, it's used to determine the coordinates of a few primitives to
|
|||||||
|
|
||||||
This technique is known to be used in certain games for lipsynching or audio visualization ( Crash team racing, Hercules, Vib Ribbon ...).
|
This technique is known to be used in certain games for lipsynching or audio visualization ( Crash team racing, Hercules, Vib Ribbon ...).
|
||||||
|
|
||||||
|
## pcsx-redux : no animation
|
||||||
|
|
||||||
|
Pcsx-redux does not yet support these specific SPU buffers nor triggerring IRQ from them so as of 11-2021 this example doesn't work in this particular emulator.
|
||||||
|
If looking for an alternative, check [duckstation](https://www.duckstation.org/) out.
|
||||||
|
|
||||||
## PsyQ's SpuReadDecodedData() doc errata
|
## PsyQ's SpuReadDecodedData() doc errata
|
||||||
|
|
||||||
The main function for transferring data from the SPU to the RAM is `SpuReadDecodedData()`, and is documented in **LibRef47.pdf, p1054**.
|
The main function for transferring data from the SPU to the RAM is `SpuReadDecodedData()`, and is documented in **LibRef47.pdf, p1054**.
|
||||||
|
@ -71,9 +71,9 @@ POLY_F4 * current[BARNUM];
|
|||||||
// Red : volume peak in the last 3 seconds
|
// Red : volume peak in the last 3 seconds
|
||||||
POLY_F4 * peak[BARNUM];
|
POLY_F4 * peak[BARNUM];
|
||||||
// Colors for the VU-metre
|
// Colors for the VU-metre
|
||||||
CVECTOR bg = {0,90,255};
|
CVECTOR bg = {20, 10, 0};
|
||||||
CVECTOR fg = {255,190,0};
|
CVECTOR fg = {10,200,20};
|
||||||
CVECTOR cursor = {255,40,0};
|
CVECTOR cursor = {200,40,10};
|
||||||
|
|
||||||
void init(void)
|
void init(void)
|
||||||
{
|
{
|
||||||
@ -133,10 +133,14 @@ void initPrimitives(void)
|
|||||||
SetPolyF4 ( bar[i] );
|
SetPolyF4 ( bar[i] );
|
||||||
setRGB0 ( bar[i], bg.r,bg.g,bg.b );
|
setRGB0 ( bar[i], bg.r,bg.g,bg.b );
|
||||||
setXY4 ( bar[i],
|
setXY4 ( bar[i],
|
||||||
MINBAR, BARTOP + i * MARGIN, /* NW */
|
// Top-left
|
||||||
MAXBAR, BARTOP + i * MARGIN, /* NE */
|
MINBAR, BARTOP + i * MARGIN,
|
||||||
MINBAR, BARBOTTOM + i * MARGIN, /* SW */
|
// Top-right
|
||||||
MAXBAR, BARBOTTOM + i * MARGIN); /* SE */
|
MAXBAR, BARTOP + i * MARGIN,
|
||||||
|
// Bottom-left
|
||||||
|
MINBAR, BARBOTTOM + i * MARGIN,
|
||||||
|
// Bottom-right
|
||||||
|
MAXBAR, BARBOTTOM + i * MARGIN);
|
||||||
|
|
||||||
// Current volume is light purple-ish
|
// Current volume is light purple-ish
|
||||||
SetPolyF4 (current[i]);
|
SetPolyF4 (current[i]);
|
||||||
@ -284,7 +288,7 @@ void findSampleMaxVolume(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Values used to switch CD track after
|
// Values used to switch CD track
|
||||||
u_int counter = 0;
|
u_int counter = 0;
|
||||||
int8_t flip = 1;
|
int8_t flip = 1;
|
||||||
// These will hold the normalised values of leftMax/rightMax, leftPeak/rightPeak
|
// These will hold the normalised values of leftMax/rightMax, leftPeak/rightPeak
|
||||||
@ -350,10 +354,12 @@ int main(void)
|
|||||||
u_char param[4], result[8];
|
u_char param[4], result[8];
|
||||||
// Set CD parameters ; Report Mode ON, CD-DA ON. See LibeOver47.pdf, p.188
|
// Set CD parameters ; Report Mode ON, CD-DA ON. See LibeOver47.pdf, p.188
|
||||||
param[0] = CdlModeRept|CdlModeDA;
|
param[0] = CdlModeRept|CdlModeDA;
|
||||||
CdControlB (CdlSetmode, param, 0); /* set mode */
|
// Set CD mode
|
||||||
VSync (3); /* wait three vsync times */
|
CdControlB (CdlSetmode, param, 0);
|
||||||
|
// Wait 3 vsync
|
||||||
|
VSync (3);
|
||||||
// Play second track in toc array
|
// Play second track in toc array
|
||||||
CdControlB (CdlPlay, (u_char *)&loc[3], 0); /* play */
|
CdControlB (CdlPlay, (u_char *)&loc[3], 0);
|
||||||
// Graphics setup
|
// Graphics setup
|
||||||
initPrimitives();
|
initPrimitives();
|
||||||
while (1)
|
while (1)
|
||||||
@ -368,6 +374,7 @@ int main(void)
|
|||||||
rPeak = (rightPeak * 256) / 0x8000 + MINBAR;
|
rPeak = (rightPeak * 256) / 0x8000 + MINBAR;
|
||||||
|
|
||||||
// Update primitives XY coordinates
|
// Update primitives XY coordinates
|
||||||
|
// Set coordinates for volume bar polygons
|
||||||
setXY4 ( current[LEFTBAR],
|
setXY4 ( current[LEFTBAR],
|
||||||
MINBAR, BARTOP,
|
MINBAR, BARTOP,
|
||||||
lMax + TSIZE, BARTOP,
|
lMax + TSIZE, BARTOP,
|
||||||
@ -378,6 +385,7 @@ int main(void)
|
|||||||
rMax + TSIZE, BARTOP + MARGIN,
|
rMax + TSIZE, BARTOP + MARGIN,
|
||||||
MINBAR, BARBOTTOM + MARGIN,
|
MINBAR, BARBOTTOM + MARGIN,
|
||||||
rMax + TSIZE, BARBOTTOM + MARGIN);
|
rMax + TSIZE, BARBOTTOM + MARGIN);
|
||||||
|
// Set coordinates for peak cursor polygons
|
||||||
setXY4 (peak[LEFTBAR],
|
setXY4 (peak[LEFTBAR],
|
||||||
lPeak, BARTOP,
|
lPeak, BARTOP,
|
||||||
lPeak + TSIZE, BARTOP,
|
lPeak + TSIZE, BARTOP,
|
||||||
|
Loading…
Reference in New Issue
Block a user