M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions

View File

@ -0,0 +1,110 @@
// Fountain test script
#pragma version(1)
#pragma stateVertex(orthoWindow)
#pragma stateRaster(flat)
#pragma stateFragment(PgmFragBackground)
#pragma stateStore(MyBlend)
int main(void* con, int ft, int launchID) {
int count, touch, x, y, rate, maxLife, lifeShift;
int life;
int ct, ct2;
int newPart;
int drawCount;
int dx, dy, idx;
int posx,posy;
int c;
int srcIdx;
int dstIdx;
count = loadI32(con, 0, 1);
touch = loadI32(con, 0, 2);
x = loadI32(con, 0, 3);
y = loadI32(con, 0, 4);
rate = 4;
maxLife = (count / rate) - 1;
lifeShift = 0;
{
life = maxLife;
while (life > 255) {
life = life >> 1;
lifeShift ++;
}
}
drawRect(con, 0, 256, 0, 512);
contextBindProgramFragment(con, NAMED_PgmFragParts);
if (touch) {
newPart = loadI32(con, 2, 0);
for (ct2=0; ct2<rate; ct2++) {
dx = scriptRand(con, 0x10000) - 0x8000;
dy = scriptRand(con, 0x10000) - 0x8000;
idx = newPart * 5 + 1;
storeI32(con, 2, idx, dx);
storeI32(con, 2, idx + 1, dy);
storeI32(con, 2, idx + 2, maxLife);
storeI32(con, 2, idx + 3, x << 16);
storeI32(con, 2, idx + 4, y << 16);
newPart++;
if (newPart >= count) {
newPart = 0;
}
}
storeI32(con, 2, 0, newPart);
}
drawCount = 0;
for (ct=0; ct < count; ct++) {
srcIdx = ct * 5 + 1;
dx = loadI32(con, 2, srcIdx);
dy = loadI32(con, 2, srcIdx + 1);
life = loadI32(con, 2, srcIdx + 2);
posx = loadI32(con, 2, srcIdx + 3);
posy = loadI32(con, 2, srcIdx + 4);
if (life) {
if (posy < (480 << 16)) {
dstIdx = drawCount * 9;
c = 0xffafcf | ((life >> lifeShift) << 24);
storeU32(con, 1, dstIdx, c);
storeI32(con, 1, dstIdx + 1, posx);
storeI32(con, 1, dstIdx + 2, posy);
storeU32(con, 1, dstIdx + 3, c);
storeI32(con, 1, dstIdx + 4, posx + 0x10000);
storeI32(con, 1, dstIdx + 5, posy + dy * 4);
storeU32(con, 1, dstIdx + 6, c);
storeI32(con, 1, dstIdx + 7, posx - 0x10000);
storeI32(con, 1, dstIdx + 8, posy + dy * 4);
drawCount ++;
} else {
if (dy > 0) {
dy = (-dy) >> 1;
}
}
posx = posx + dx;
posy = posy + dy;
dy = dy + 0x400;
life --;
//storeI32(con, 2, srcIdx, dx);
storeI32(con, 2, srcIdx + 1, dy);
storeI32(con, 2, srcIdx + 2, life);
storeI32(con, 2, srcIdx + 3, posx);
storeI32(con, 2, srcIdx + 4, posy);
}
}
drawTriangleArray(con, NAMED_PartBuffer, drawCount);
return 1;
}

View File

@ -0,0 +1,94 @@
// Fountain test script
#pragma version(1)
#pragma stateVertex(PVBackground)
#pragma stateFragment(PFBackground)
#pragma stateStore(PSBackground)
#define STATE_TRIANGLE_OFFSET_COUNT 0
#define STATE_LAST_FOCUS 1
// The script enviroment has 3 env allocations.
// bank0: (r) The enviroment structure
// bank1: (r) The position information
// bank2: (rw) The temporary texture state
int lastFocus;
int main(int index)
{
float mat1[16];
float trans = Pos->translate;
float rot = Pos->rotate;
matrixLoadScale(mat1, 2.f, 2.f, 2.f);
matrixTranslate(mat1, 0.f, 0.f, trans);
matrixRotate(mat1, 90.f, 0.f, 0.f, 1.f);
matrixRotate(mat1, rot, 1.f, 0.f, 0.f);
vpLoadModelMatrix(mat1);
// Draw the lighting effect in the strip and fill the Z buffer.
drawSimpleMesh(NAMED_mesh);
// Start of images.
bindProgramStore(NAMED_PSImages);
bindProgramFragment(NAMED_PFImages);
bindProgramVertex(NAMED_PVImages);
float focusPos = Pos->focus;
int focusID = 0;
int lastFocusID = loadI32(2, STATE_LAST_FOCUS);
int imgCount = 13;
if (trans > (-.3f)) {
focusID = -1.0f - focusPos;
if (focusID >= imgCount) {
focusID = -1;
}
} else {
focusID = -1;
}
/*
if (focusID != lastFocusID) {
if (lastFocusID >= 0) {
uploadToTexture(con, env->tex[lastFocusID], 1);
}
if (focusID >= 0) {
uploadToTexture(con, env->tex[focusID], 0);
}
}
*/
lastFocus = focusID;
int triangleOffsetsCount = Pos->triangleOffsetCount;
int imgId = 0;
for (imgId=1; imgId <= imgCount; imgId++) {
float pos = focusPos + imgId + 0.4f;
int offset = (int)floorf(pos * 2.f);
pos = pos - 0.75f;
offset = offset + triangleOffsetsCount / 2;
if (!((offset < 0) || (offset >= triangleOffsetsCount))) {
int start = offset -2;
int end = offset + 2;
if (start < 0) {
start = 0;
}
if (end >= triangleOffsetsCount) {
end = triangleOffsetsCount-1;
}
bindTexture(NAMED_PFImages, 0, loadI32(0, imgId - 1));
matrixLoadTranslate(mat1, -pos - loadF(5, triangleOffsetsCount / 2), 0, 0);
vpLoadTextureMatrix(mat1);
drawSimpleMeshRange(NAMED_mesh, loadI32(4, start), (loadI32(4, end) - loadI32(4, start)));
}
}
return 0;
}