comparison src/th06/ecl_vm.rs @ 672:d20cf9ede914

Verified some more of ecl_vm.
author Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
date Mon, 12 Aug 2019 20:26:12 +0200
parents 838d9402b12f
children 81ad01910f4b
comparison
equal deleted inserted replaced
671:266911c0ccfd 672:d20cf9ede914
476 let mut enemy = self.enemy.borrow_mut(); 476 let mut enemy = self.enemy.borrow_mut();
477 enemy.set_pos(self.get_f32(x), self.get_f32(y), self.get_f32(z)); 477 enemy.set_pos(self.get_f32(x), self.get_f32(y), self.get_f32(z));
478 } 478 }
479 // 44 479 // 44
480 /* 480 /*
481 SubInstruction::SetPositionInterlacing(x, y, z) => { 481 SubInstruction::SetAngularSpeed(x, y, z) => {
482 //TODO: almost the same as setpos, except with 3 different values and sets the 482 // same as above, except for angular speed
483 //interlacing, should double check 483 let mut enemy = self.enemy.borrow_mut();
484 let mut enemy = self.enemy.borrow_mut(); 484 enemy.set_angular_speed(self.get_f32(x), self.get_f32(y), self.get_f32(z));
485 enemy.set_pos(self.get_f32(x), self.get_f32(y), self.get_f32(z));
486 } 485 }
487 */ 486 */
488 // 45 487 // 45
489 SubInstruction::SetAngleAndSpeed(angle, speed) => { 488 SubInstruction::SetAngleAndSpeed(angle, speed) => {
490 let angle = self.get_f32(angle); 489 let angle = self.get_f32(angle);
522 521
523 // 83 -> star items >>> life items 522 // 83 -> star items >>> life items
524 523
525 // 97 524 // 97
526 SubInstruction::SetAnim(index) => { 525 SubInstruction::SetAnim(index) => {
527 // TODO: check in ghidra! 526 // seems correct, game internally gets base_addr =(iVar13 + 0x1c934), pointer_addr = iVar14 * 4
528 let mut enemy = self.enemy.borrow_mut(); 527 let mut enemy = self.enemy.borrow_mut();
529 enemy.set_anim(index as u8); 528 enemy.set_anim(index as u8);
530 } 529 }
531 // 98 530 // 98
532 SubInstruction::SetMultipleAnims(default, end_left, end_right, left, right, _unused) => { 531 SubInstruction::SetMultipleAnims(default, end_left, end_right, left, right, _unused) => {
533 // TODO: check in ghidra! 532 // _unused was supposed to set movement_dependant_sprites, but internally the game
533 // assigns it 0xff
534 // TODO: THIS DOES NOT CALL set_anim. this only assigns all parameters to their
535 // internal struct. To check if the anims are set somewhere else
534 let mut enemy = self.enemy.borrow_mut(); 536 let mut enemy = self.enemy.borrow_mut();
535 enemy.movement_dependant_sprites = if left == -1 { 537 enemy.movement_dependant_sprites = if left == -1 {
536 None 538 None
537 } else { 539 } else {
538 enemy.set_anim(default as u8); 540 enemy.set_anim(default as u8);
540 }; 542 };
541 } 543 }
542 544
543 // 100 545 // 100
544 SubInstruction::SetDeathAnim(index) => { 546 SubInstruction::SetDeathAnim(index) => {
545 // TODO: check in ghidra! 547 // TODO: takes 3 parameters in game, first one is death anim and 2 others are
548 // unknown. To reverse!
546 let mut enemy = self.enemy.borrow_mut(); 549 let mut enemy = self.enemy.borrow_mut();
547 enemy.death_anim = index; 550 enemy.death_anim = index;
548 } 551 }
549 552
550 // 103 553 // 103
551 SubInstruction::SetHitbox(width, height, depth) => { 554 SubInstruction::SetHitbox(width, height, depth) => {
552 // TODO: check in ghidra!
553 assert_eq!(depth, 32.); 555 assert_eq!(depth, 32.);
554 let mut enemy = self.enemy.borrow_mut(); 556 let mut enemy = self.enemy.borrow_mut();
555 enemy.set_hitbox(width, height); 557 enemy.set_hitbox(width, height);
556 } 558 }
557 559