Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void PrintGameSprites(CBlocks *this,map_info *piece,int OtPos,int ScrX,int ScrY,int R,int G,int B,int OtPos2)
- {
- byte bFlags;
- char cVar1;
- char cVar2;
- ushort uVar3;
- byte bVar4;
- char cVar5;
- undefined2 uVar6;
- int bObject;
- uint uVar7;
- int local_v0_676;
- undefined4 uVar8;
- int iVar9;
- uint *puVar10;
- short sVar11;
- undefined4 uVar12;
- int iVar13;
- uint *puVar14;
- byte bVar15;
- int nMonster;
- uint bDead;
- TextDat *pTVar16;
- int local_s1_96;
- int iVar17;
- uint uVar18;
- int iVar19;
- int bItem;
- uint uVar20;
- undefined4 local_90;
- bFlags = piece->dFlags;
- nMonster = (int)piece->dMonster;
- bItem = (int)piece->dItem;
- bObject = (int)piece->dObject;
- bDead = SEXT14(piece->dDead);
- local_s1_96 = 0;
- if ((bObject != 0) && (iVar17 = bObject + -1, 0 < bObject)) {
- if (*(short *)(&DAT_80126832 +
- (int)(char)(&DAT_800dca31)[(int)(char)(&DAT_800dd22e)[iVar17 * 0x2c] * 0x12] * 4)
- == 0) {
- bObject = this->ObjTexId;
- }
- else {
- bObject = this->BgTexId;
- }
- if (bObject == this->ObjTexId) {
- pTVar16 = this->ObjTexDat;
- }
- else {
- pTVar16 = (TextDat *)0x0;
- if (bObject == this->BgTexId) {
- pTVar16 = this->BgTexDat;
- }
- }
- if (pTVar16 == (TextDat *)0x0) {
- FUN_8001e940(0,s_psxsrc_BLOCK_CPP_80120298,0x537);
- }
- local_s1_96 = (*(code *)(&PTR_FUN_800e857c)[(char)(&DAT_800dd22e)[iVar17 * 0x2c]])
- (&DAT_800dd210 + iVar17 * 0x16,ScrX,ScrY,pTVar16,OtPos);
- if (local_s1_96 != 0) {
- *(byte *)(local_s1_96 + 7) = *(byte *)(local_s1_96 + 7) & 0xfe;
- *(undefined *)(local_s1_96 + 4) = (char)DAT_8012bff0;
- *(undefined *)(local_s1_96 + 5) = (char)DAT_8012bff4;
- *(undefined *)(local_s1_96 + 6) = (char)DAT_8012bff8;
- uVar7 = FUN_8008b75c(iVar17,&DAT_8012b26c,(uint)DAT_8012a93a | 0x8000,
- (uint)DAT_8012a93c | 0x8000,(uint)DAT_8012a93e | 0x8000);
- if (uVar7 != 0xffffffff) {
- uVar6 = FUN_80090908((uint)*(ushort *)(local_s1_96 + 0xe),uVar7 & 0xffff,0x10);
- *(undefined2 *)(local_s1_96 + 0xe) = uVar6;
- *(byte *)(local_s1_96 + 7) = *(byte *)(local_s1_96 + 7) | 2;
- }
- }
- }
- if (bItem != 0) {
- if (this->ItemTexDat == (TextDat *)0x0) {
- FUN_8001e940(0,s_psxsrc_BLOCK_CPP_80120298,0x550);
- }
- if (0x7f < bItem) {
- FUN_8001e940(0,s_psxsrc_BLOCK_CPP_80120298,0x552);
- }
- if (item[bItem]._iAnimFlag == '\0') {
- local_s1_96 = FUN_8007f5f4(this->ItemTexDat,(uint)item[bItem].ItemFrame,ScrX,ScrY,0,OtPos,0);
- uVar7 = FUN_8008b75c(bItem + -1,&_pcursitem,(uint)DAT_8012a940 | 0x8000,
- (uint)DAT_8012a942 | 0x8000,(uint)DAT_8012a944 | 0x8000);
- if (uVar7 == 0xffffffff) {
- *(byte *)(local_s1_96 + 7) = *(byte *)(local_s1_96 + 7) & 0xfd;
- }
- else {
- uVar6 = FUN_80090908((uint)*(ushort *)(local_s1_96 + 0xe),uVar7 & 0xffff,0x10);
- *(undefined2 *)(local_s1_96 + 0xe) = uVar6;
- *(byte *)(local_s1_96 + 7) = *(byte *)(local_s1_96 + 7) | 2;
- }
- }
- else {
- local_s1_96 = FUN_8007f5f4(this->ItemTexDat,(uint)item[bItem].ItemFrame,ScrX,ScrY,0,OtPos,0);
- local_v0_676 = FUN_8008bbc0(this->ItemTexDat,(uint)item[bItem].ItemFrame);
- uVar18 = *(uint *)(local_v0_676 + 8) & 0x1ff;
- uVar7 = (uint)*(ushort *)(local_v0_676 + 6) & 0x1ff;
- if ((*(uint *)(local_v0_676 + 8) & 0x200) == 0) {
- *(char *)(local_s1_96 + 0x1d) = *(char *)(local_s1_96 + 0x1d) + -1;
- *(char *)(local_s1_96 + 0x25) = *(char *)(local_s1_96 + 0x25) + -1;
- }
- else {
- *(char *)(local_s1_96 + 0xd) = *(char *)(local_s1_96 + 0xd) + -1;
- *(char *)(local_s1_96 + 0x1d) = *(char *)(local_s1_96 + 0x1d) + -1;
- }
- uVar20 = (uint)(byte)item[bItem]._isin;
- if (item[bItem]._isin == 0) {
- FUN_8003a57c(0x15,(int)item[bItem]._ix,(int)item[bItem]._iy);
- }
- FUN_8001001c(local_s1_96,(int)*(short *)(local_s1_96 + 8) + ((int)uVar7 >> 1),
- (int)*(short *)(local_s1_96 + 10) + ((int)uVar18 >> 1),uVar20 << 8);
- bObject = (int)*(short *)(&DAT_801202c0 + (uVar20 & 0x1f) * 2) >> 2;
- if (bObject < 0) {
- FUN_8003a57c(*(undefined4 *)
- (PTR_DAT_8012b368 + (uint)(byte)(&DAT_800c1204)[item[bItem]._iCurs] * 4),
- (int)item[bItem]._ix,(int)item[bItem]._iy);
- bObject = 0;
- cVar5 = item[bItem + 1]._iAnimLen;
- item[bItem]._iAnimFlag = '\0';
- item[bItem]._iSelFlag = '\x01';
- item[bItem]._iAnimFrame = cVar5;
- }
- sVar11 = (short)bObject;
- if (0 < bObject << 0x10) {
- sVar11 = -sVar11;
- }
- *(short *)(local_s1_96 + 10) = *(short *)(local_s1_96 + 10) + sVar11;
- *(short *)(local_s1_96 + 0x12) = *(short *)(local_s1_96 + 0x12) + sVar11;
- *(short *)(local_s1_96 + 0x1a) = *(short *)(local_s1_96 + 0x1a) + sVar11;
- *(short *)(local_s1_96 + 0x22) = *(short *)(local_s1_96 + 0x22) + sVar11;
- cVar5 = item[bItem]._isin + '\x01';
- bObject = (int)cVar5;
- item[bItem]._isin = cVar5;
- if (bObject < 0) {
- bObject = bObject + 0x1f;
- }
- item[bItem]._isin = cVar5 + (char)(bObject >> 5) * -0x20;
- if (item[bItem].IDidx == 0) {
- uVar12 = 0x80;
- local_90 = 0x20;
- uVar8 = 0x30;
- }
- else {
- uVar12 = 0x60;
- local_90 = 0x60;
- uVar8 = 0x10;
- }
- FUN_8009ab1c(ScrX + ((int)uVar7 >> 2) + (int)*(char *)(local_v0_676 + 4),
- ScrY + ((int)uVar18 >> 2) + (int)*(char *)(local_v0_676 + 5) + (int)sVar11,uVar12
- ,0x60,local_90,uVar8,(int)sVar11 * -2,uVar20 * -4,0,OtPos + 1,1);
- }
- *(undefined *)(local_s1_96 + 4) = (char)DAT_8012bff0;
- *(undefined *)(local_s1_96 + 5) = (char)DAT_8012bff4;
- uVar8 = DAT_8012bff8;
- *(byte *)(local_s1_96 + 7) = *(byte *)(local_s1_96 + 7) & 0xfe;
- *(undefined *)(local_s1_96 + 6) = (char)uVar8;
- }
- bVar15 = bFlags;
- bVar4 = 0;
- if (DAT_8012bffc != 0) {
- bVar15 = bFlags | 0x40;
- bVar4 = bFlags;
- }
- if ((bVar15 & 0x40) == 0) {
- return;
- }
- if (((bVar15 & 1) != 0) && ((int)piece->dMissile != -1)) {
- bObject = ((int)piece->dMissile + -1) * 0x50;
- (**(code **)(&DAT_80111f74 + bObject))
- (bObject + -0x7feee0d8,ScrX + ((int)(char)(&DAT_80111f5d)[bObject] * 0x271) / 1000,
- ScrY + ((int)(char)(&DAT_80111f5e)[bObject] * 0x271) / 1000,OtPos);
- }
- if (nMonster < 1) goto LAB_8008a8b8;
- bObject = FUN_80093a28(nMonster,DAT_8012bff0,DAT_8012bff4,DAT_8012bff8,OtPos,ScrX,ScrY);
- if (bObject != 1) {
- nMonster = nMonster + -1;
- bObject = nMonster * 0x70;
- if (((&DAT_80114808)[nMonster * 0x38] & 1) == 0) {
- if ((&DAT_80114840)[nMonster * 0x1c] == 0) {
- FUN_8001e940(0,s_psxsrc_BLOCK_CPP_80120298,0x5dd);
- }
- if (this->MonstTexDat == (TextDat *)0x0) {
- FUN_8001e940(0,s_psxsrc_BLOCK_CPP_80120298,0x5df);
- }
- pTVar16 = this->MonstTexDat;
- bItem = FUN_80087a10(this,(uint)**(ushort **)(&DAT_80114844 + bObject));
- if (bItem == -1) {
- return;
- }
- cVar5 = (&DAT_80114816)[bObject];
- iVar19 = (int)(char)(&DAT_80114839)[bObject];
- cVar1 = (&DAT_80114818)[bObject];
- cVar2 = (&DAT_8011481d)[bObject];
- iVar17 = (int)(char)(&DAT_80114817)[bObject] * 0x271 >> 0x1f;
- iVar13 = ((int)(char)(&DAT_80114817)[bObject] * 0x271) / 1000 + iVar17;
- iVar9 = FUN_8008bad4(pTVar16,bItem,iVar19,iVar13);
- if (iVar9 <= (int)cVar2 + -1) {
- return;
- }
- uVar8 = FUN_800800c0(pTVar16,bItem,iVar19,(int)cVar1,(int)cVar2 + -1);
- uVar12 = FUN_80080114(pTVar16,bItem,iVar19,(int)cVar1);
- local_s1_96 = FUN_8007e884(pTVar16,uVar8,ScrX + ((int)cVar5 * 0x271) / 1000,
- ScrY + (iVar13 - iVar17),uVar12,OtPos);
- if ((int)*(char *)(*(int *)(&DAT_80114844 + bObject) + 7) != 0) {
- uVar8 = FUN_8008bbc0(this->ObjTexDat,
- *(undefined4 *)
- (&DAT_8011a538 +
- ((((int)*(char *)(*(int *)(&DAT_80114844 + bObject) + 7) << 0x19) >>
- 0x18) + (uint)(iVar19 == 4)) * 4));
- FUN_8007fff8(this->ObjTexDat,uVar8,local_s1_96);
- }
- if ((&DAT_8011480f)[bObject] == '\x0f') {
- bItem = *(int *)(&DAT_8011a43c + (uint)**(ushort **)(&DAT_80114844 + bObject) * 8);
- if ((iVar19 == 4) &&
- ((&DAT_8011a438)[(uint)**(ushort **)(&DAT_80114844 + bObject) * 8] == '\x02')) {
- bItem = bItem + 1;
- }
- if (**(short **)(&DAT_80114844 + bObject) == 0x1d) {
- bItem = bItem + iVar19;
- }
- uVar8 = FUN_8008bbc0(this->ObjTexDat,bItem);
- FUN_8007fff8(this->ObjTexDat,uVar8,local_s1_96);
- }
- *(undefined *)(local_s1_96 + 4) = (char)DAT_8012bff0;
- *(undefined *)(local_s1_96 + 5) = (char)DAT_8012bff4;
- uVar8 = DAT_8012bff8;
- *(byte *)(local_s1_96 + 7) = *(byte *)(local_s1_96 + 7) & 0xfe;
- *(undefined *)(local_s1_96 + 6) = (char)uVar8;
- puVar10 = (uint *)FUN_8008b720(local_s1_96);
- FUN_8008b5b4(puVar10);
- uVar3 = **(ushort **)(&DAT_80114844 + bObject);
- if (uVar3 == 10) {
- LAB_8008a72c:
- if (iVar19 == 5) {
- *(byte *)(local_s1_96 + 7) = *(byte *)(local_s1_96 + 7) & 0xfe | 2;
- }
- }
- else {
- if (uVar3 < 0xb) {
- if (uVar3 == 1) {
- *(short *)((int)puVar10 + 10) = *(short *)((int)puVar10 + 10) + 0x14;
- *(short *)((int)puVar10 + 0x12) = *(short *)((int)puVar10 + 0x12) + 0x14;
- *(short *)((int)puVar10 + 0x1a) = *(short *)((int)puVar10 + 0x1a) + 0x14;
- *(short *)((int)puVar10 + 0x22) = *(short *)((int)puVar10 + 0x22) + 0x14;
- }
- }
- else {
- if (uVar3 == 0x15) goto LAB_8008a72c;
- }
- }
- uVar18 = (uint)DAT_8012a946;
- uVar20 = (uint)DAT_8012a948;
- puVar14 = (uint *)(OtPos * 4 + DAT_8012a714);
- *puVar10 = *puVar10 & 0xff000000 | *puVar14 & 0xffffff;
- uVar7 = (uint)DAT_8012a94a;
- *puVar14 = *puVar14 & 0xff000000 | (uint)puVar10 & 0xffffff;
- uVar7 = FUN_8008b6d8(nMonster,&DAT_8012b264,uVar18 | 0x8000,uVar20 | 0x8000,uVar7 | 0x8000);
- if (uVar7 != 0xffffffff) {
- uVar6 = FUN_80090908((uint)*(ushort *)(local_s1_96 + 0xe),uVar7 & 0xffff,0x10);
- *(undefined2 *)(local_s1_96 + 0xe) = uVar6;
- *(byte *)(local_s1_96 + 7) = *(byte *)(local_s1_96 + 7) | 2;
- }
- }
- }
- if ((DAT_8012bffc != 0) && ((bVar4 & 0x40) == 0)) {
- if (DAT_8012b2b0 == '\0') {
- uVar7 = FUN_8001e7a0();
- *(undefined *)(local_s1_96 + 5) = 0;
- *(undefined *)(local_s1_96 + 6) = 0;
- *(char *)(local_s1_96 + 4) = (char)uVar7 + (char)(uVar7 / 0x30) * -0x30 + -0x70;
- }
- else {
- *(undefined *)(local_s1_96 + 4) = 0x90;
- *(undefined *)(local_s1_96 + 5) = 0;
- *(undefined *)(local_s1_96 + 6) = 0;
- }
- *(byte *)(local_s1_96 + 7) = *(byte *)(local_s1_96 + 7) & 0xfe | 2;
- }
- LAB_8008a8b8:
- if (bDead != 0) {
- if (this->MonstTexDat == (TextDat *)0x0) {
- FUN_8001e940(0,s_psxsrc_BLOCK_CPP_80120298,0x651);
- }
- nMonster = *(int *)(&DAT_800bea18 + (bDead & 0x1f) * 0xc);
- bItem = (int)(bDead & 0xe0) >> 5;
- bObject = FUN_80087a10(this,(uint)*(ushort *)(&DAT_8011a278)[nMonster * 7]);
- if (bObject != -1) {
- iVar17 = FUN_8008bad4(this->MonstTexDat,bObject,4);
- uVar8 = FUN_800800c0(this->MonstTexDat,bObject,4,bItem,iVar17 + -1);
- uVar12 = FUN_80080114(this->MonstTexDat,bObject,4,bItem);
- bObject = FUN_8007e884(this->MonstTexDat,uVar8,ScrX,ScrY,uVar12,OtPos);
- nMonster = (int)*(char *)((int)(&DAT_8011a278)[nMonster * 7] + 7);
- if (nMonster != 0) {
- uVar8 = FUN_8008bbc0(this->ObjTexDat,
- *(undefined4 *)(&DAT_8011a53c + ((nMonster << 0x19) >> 0x16)));
- FUN_8007fff8(this->ObjTexDat,uVar8,bObject);
- }
- *(undefined *)(bObject + 4) = (char)DAT_8012bff0;
- *(undefined *)(bObject + 5) = (char)DAT_8012bff4;
- uVar8 = DAT_8012bff8;
- *(byte *)(bObject + 7) = *(byte *)(bObject + 7) & 0xfe;
- *(undefined *)(bObject + 6) = (char)uVar8;
- puVar10 = (uint *)FUN_8008b720();
- FUN_8008b5b4(puVar10);
- puVar14 = (uint *)(OtPos * 4 + DAT_8012a714);
- *puVar10 = *puVar10 & 0xff000000 | *puVar14 & 0xffffff;
- *puVar14 = *puVar14 & 0xff000000 | (uint)puVar10 & 0xffffff;
- }
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement