Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc code 80005fd0 #697

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Conversation

coco875
Copy link
Contributor

@coco875 coco875 commented Jan 2, 2025

No description provided.

@coco875
Copy link
Contributor Author

coco875 commented Jan 2, 2025

I will rename file once 684 are merge

@coco875
Copy link
Contributor Author

coco875 commented Jan 2, 2025

need also HarbourMasters/Torch#166

@@ -69,14 +69,14 @@ glabel func_800088D8
/* 0095D0 800089D0 03193821 */ addu $a3, $t8, $t9
/* 0095D4 800089D4 3C0E800E */ lui $t6, %hi(gDemoMode)
/* 0095D8 800089D8 95CEC51C */ lhu $t6, %lo(gDemoMode)($t6)
/* 0095DC 800089DC 3C048016 */ lui $a0, %hi(D_80164450) # $a0, 0x8016
/* 0095E0 800089E0 24844450 */ addiu $a0, %lo(D_80164450) # addiu $a0, $a0, 0x4450
/* 0095DC 800089DC 3C048016 */ lui $a0, %hi(gLapProgressScore) # $a0, 0x8016
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is gLapProgressScore? The confusing part is score

Players don't really get scored on the progress in the course. I would imagine that gLapProgress would track which waypoint you're on in the course. But we already have this variable gNearestWaypoint or whatever.

/* 0096E8 80008AE8 3C0B8016 */ lui $t3, %hi(D_80163478) # $t3, 0x8016
/* 0096EC 80008AEC 856B3478 */ lh $t3, %lo(D_80163478)($t3)
/* 0096E8 80008AE8 3C0B8016 */ lui $t3, %hi(gPlayerInFront) # $t3, 0x8016
/* 0096EC 80008AEC 856B3478 */ lh $t3, %lo(gPlayerInFront)($t3)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean 'player in 1st place' or 'a player in front of another player'

If it's in 1st place. We need a name morel ike gPlayerInFirstPlace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's say in two player with player have the best rank, so in one player it's always player one but in two player mode it can be player one or player two even if both and in 7th and 8th

@@ -141,24 +141,24 @@ glabel func_8000B140
/* 00BF2C 8000B32C 3125FFFF */ andi $a1, $t1, 0xffff
/* 00BF30 8000B330 00003025 */ move $a2, $zero
/* 00BF34 8000B334 24070014 */ li $a3, 20
/* 00BF38 8000B338 3C0C8016 */ lui $t4, %hi(D_80164430) # $t4, 0x8016
/* 00BF38 8000B338 3C0C8016 */ lui $t4, %hi(gCurrentWaypointCountByPathIndex) # $t4, 0x8016
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gCurrentPathCount?

D_80164430 = gWaypointCountByPathIndex[pathIndex];
We're taking the array of paths. And selecting a path.

gSelectedPathCount?

/* 00BF58 8000B358 A7A300E4 */ sh $v1, 0xe4($sp)
/* 00BF5C 8000B35C AFA800FC */ sw $t0, 0xfc($sp)
/* 00BF60 8000B360 A7A900E6 */ sh $t1, 0xe6($sp)
/* 00BF64 8000B364 AFAA00F0 */ sw $t2, 0xf0($sp)
/* 00BF68 8000B368 E7A000DC */ swc1 $f0, 0xdc($sp)
/* 00BF6C 8000B36C E7A20060 */ swc1 $f2, 0x60($sp)
/* 00BF70 8000B370 0C001EFE */ jal func_80007BF8
/* 00BF70 8000B370 0C001EFE */ jal is_waypoint_in_range
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_path_point_in_range

// @return bool If path point is in the range
range_path_point
?

My only thought here, is it would be nice if we found a way to be less verbose kinda like how python does someVar.range()
but whatever.
You can ignore this one if u want.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a little more complex then a bool
return

  • 1: waypoint is within normal range
  • -1: waypoint is within wrapped range
  • 2: waypoint is out of range
  • 0: invalid range parameters

/* 01BDAC 8001B1AC 018F001A */ div $zero, $t4, $t7
/* 01BDB0 8001B1B0 000DC880 */ sll $t9, $t5, 2
/* 01BDB4 8001B1B4 01795821 */ addu $t3, $t3, $t9
/* 01BDB8 8001B1B8 8D6B4550 */ lw $t3, %lo(D_80164550)($t3) # 0x4550($t3)
/* 01BDB8 8001B1B8 8D6B4550 */ lw $t3, %lo(gTrackPath)($t3) # 0x4550($t3)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

track path? course path?
I'm presuming a gCoursePath might already exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no but I use the term track to be more conform to other mario kart

@@ -782,7 +782,7 @@ glabel L8001B6AC
/* 01C330 8001B730 100001C0 */ b .L8001BE34
/* 01C334 8001B734 86020004 */ lh $v0, 4($s0)
glabel L8001B738
/* 01C338 8001B738 0C006AFB */ jal func_8001ABEC
/* 01C338 8001B738 0C006AFB */ jal reset_strategy_if_actor_valid
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reset behaviour?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's reset the item strategy it have no link with behaviour

/* 00A1EC 800095EC AFA40050 */ sw $a0, 0x50($sp)
/* 00A1F0 800095F0 0C0046B9 */ jal reset_kart_ai_behaviour
/* 00A1F4 800095F4 8FA40050 */ lw $a0, 0x50($sp)
/* 00A1F8 800095F8 8FA40050 */ lw $a0, 0x50($sp)
/* 00A1FC 800095FC 3C0F8016 */ lui $t7, %hi(D_8016348C) # $t7, 0x8016
/* 00A200 80009600 85EF348C */ lh $t7, %lo(D_8016348C)($t7)
/* 00A204 80009604 3C018016 */ lui $at, %hi(D_801642D8 + 0x6) # 0x8016
/* 00A204 80009604 3C018016 */ lui $at, %hi(gCpuItemStrategy + 0x6) # 0x8016
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gCPU ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by memory once I name a variable with CPU in uppercase but you say no so I rename with cpu in pascal case

/* 009F88 80009388 8CC63448 */ lw $a2, %lo(D_80163448)($a2)
/* 009F80 80009380 3C068016 */ lui $a2, %hi(gActualPath) # $a2, 0x8016
/* 009F84 80009384 0C002E57 */ jal update_player_position_factor
/* 009F88 80009388 8CC63448 */ lw $a2, %lo(gActualPath)($a2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if actual path refers to the path the AI use. We should make this clear this is like the gMainPath or gCoursePath or gAIPath or something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure I think it's a little more general then just AI

/* 0AD424 800AC824 3C048016 */ lui $a0, %hi(D_80164478) # $a0, 0x8016
/* 0AD428 800AC828 24844478 */ addiu $a0, %lo(D_80164478) # addiu $a0, $a0, 0x4478
/* 0AD424 800AC824 3C048016 */ lui $a0, %hi(gCharacterPlayer) # $a0, 0x8016
/* 0AD428 800AC828 24844478 */ addiu $a0, %lo(gCharacterPlayer) # addiu $a0, $a0, 0x4478
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gCharacterIdDup ?

src/code_80005FD0.c Outdated Show resolved Hide resolved
src/code_80005FD0.c Outdated Show resolved Hide resolved
src/code_80005FD0.c Outdated Show resolved Hide resolved
src/code_80005FD0.c Show resolved Hide resolved
src/code_80005FD0.c Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants