1#pragma helper_mask_gpr 0x30
2#pragma helper_mask_fpr 0x1000
3#include "textureanime.hpp"
9#include "scriptinterpreter.hpp"
16static void CommandTEX_ANIME(
void **arguments);
17static void CommandTEX_ANIME_DATA(
void **arguments);
18static void CommandTEX_ANIME_DATA2(
void **arguments);
19static void CommandTEX_SCROLL_DATA(
void **arguments);
20static void CommandTEX_ANIME_END(
void **arguments);
23 if (texture != NULL) {
70 sceVif1PkCnt(Vif1Packet, 0);
71 sceVif1PkOpenDirectCode(Vif1Packet, 0);
72 sceVif1PkOpenGifTag(Vif1Packet, *(u_long128 *) &GiftagAD);
73 sceVif1PkAddGsAD(Vif1Packet, 0x3F, 0);
74 sceVif1PkCloseGifTag(Vif1Packet);
75 sceVif1PkCloseDirectCode(Vif1Packet);
77 for (
int i = 0; i < 24; i++) {
83 for (group = 0; group < 24; group++) {
91 if (record->
kind == 0) {
99 clut_source.bits.tbw = 1;
102 clut_destination.bits.tbw = 1;
104 MGMoveImage(&clut_source,
CRect_i_(0, 0, 16, 16), &clut_destination, 0, 0, 0);
108 if (record->
kind == 1) {
119 if (width > 0 && height > 0) {
130 if (width > 0 && height > 0) {
141 if (width > 0 && height > 0) {
153 if (width > 0 && height > 0) {
190 record = record->
next;
209 sceVif1PkCnt(Vif1Packet, 0);
210 sceVif1PkOpenDirectCode(Vif1Packet, 0);
211 sceVif1PkOpenGifTag(Vif1Packet, *(u_long128 *) &GiftagAD);
212 sceVif1PkAddGsAD(Vif1Packet, 0x3F, 0);
213 sceVif1PkCloseGifTag(Vif1Packet);
214 sceVif1PkCloseDirectCode(Vif1Packet);
221 for (
int group = 0; group < 24; group++) {
241 for (
int i = 0; i <
data_count; i++, record++) {
242 if (record->
kind == -1) {
251 if (group < 0 || group >= 24) {
257 if (record == NULL) {
263 if (
last[group] != NULL) {
267 last[group] = record;
274 if (
first[group] == NULL) {
275 first[group] = record;
284 if (record == NULL) {
306 for (
int group = 0; group < 24; group++) {
312 if (group < 0 || group >= 24) {
320 if (group < 0 || group >= 24) {
331 {
"TEX_ANIME", {1, 1, -1} },
332 {
"TEX_ANIME_DATA", {0, 1, 1, 1, 1, 0, 1, 1, 1, 1, -1} },
333 {
"TEX_ANIME_DATA2", {0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, -1}},
334 {
"TEX_SCROLL_DATA", {0, 1, 1, 1, 1, 0, 1, 1, 2, 2, 1, 1, -1} },
335 {
"TEX_ANIME_END", {-1} },
339static void (*CommandExe[5])(
void **arguments) = {
341 CommandTEX_ANIME_DATA,
342 CommandTEX_ANIME_DATA2,
343 CommandTEX_SCROLL_DATA,
344 CommandTEX_ANIME_END,
353 interpreter.
SetScript(script, script_size);
364 CommandExe[command](interpreter.
arguments);
375static void CommandTEX_ANIME(
void **arguments) {
376 now_group = *(
int *) arguments[0];
378 if (*(
int *) arguments[1] != 0) {
379 pTexAnime->
Enable(now_group);
393static void CommandTEX_ANIME_DATA(
void **arguments) {
395 record.
group = (s16) now_group;
397 char *first_name = (
char *) arguments[0];
398 record.
source_x = *(s16 *) arguments[1];
399 record.
source_y = *(s16 *) arguments[2];
402 char *second_name = (
char *) arguments[5];
403 record.
dest_x = *(s16 *) arguments[6];
404 record.
dest_y = *(s16 *) arguments[7];
405 record.
duration = *(s16 *) arguments[8];
407 if (*(
int *) arguments[9] != 0) {
411 CTexture *first_texture = TexManager.GetTexture(first_name, -1);
412 CTexture *second_texture = TexManager.GetTexture(second_name, -1);
418 if (first_texture != NULL && second_texture != NULL) {
432static void CommandTEX_ANIME_DATA2(
void **arguments) {
434 record.
group = (s16) now_group;
436 char *first_name = (
char *) arguments[0];
437 record.
source_x = *(s16 *) arguments[1];
438 record.
source_y = *(s16 *) arguments[2];
441 char *second_name = (
char *) arguments[5];
442 record.
dest_x = *(s16 *) arguments[6];
443 record.
dest_y = *(s16 *) arguments[7];
444 record.
duration = *(s16 *) arguments[8];
445 int hold = *(
int *) arguments[9];
452 CTexture *first_texture = TexManager.GetTexture(first_name, -1);
453 CTexture *second_texture = TexManager.GetTexture(second_name, -1);
455 if (first_texture != NULL && second_texture != NULL) {
469static void CommandTEX_SCROLL_DATA(
void **arguments) {
471 record.
group = (s16) now_group;
473 char *first_name = (
char *) arguments[0];
474 record.
source_x = *(s16 *) arguments[1];
475 record.
source_y = *(s16 *) arguments[2];
478 char *second_name = (
char *) arguments[5];
479 record.
dest_x = *(s16 *) arguments[6];
480 record.
dest_y = *(s16 *) arguments[7];
483 record.
duration = *(s16 *) arguments[10];
485 if (*(
int *) arguments[11] != 0) {
489 CTexture *first_texture = TexManager.GetTexture(first_name, -1);
490 CTexture *second_texture = TexManager.GetTexture(second_name, -1);
492 if (first_texture != NULL && second_texture != NULL) {
506static void CommandTEX_ANIME_END(
void **arguments) {
void SetScript(char *script, int script_size)
void SetTAG(TAG_PARAM *tags, int count)
CTextureTexAnime second_texture
CTextureTexAnime first_texture
void Initialize(CTexAnimeData *records, int count)
CTexAnimeData * NewTexAnimeData()
CTexAnimeData * current[24]
CTextureAnime(CTexAnimeData *records=0, int count=0)
CTexAnimeData * NewTexAnimeGroupData(int group)
CTexAnimeData * first[24]
void TexAnime(int texture_block)
int EnterTexAnime(CTexAnimeData *source)
void LoadCFGFile(char *script, int script_size)
void Copy(CTexture *texture)