Conversation
JaceCear
commented
Nov 15, 2022
- sub_0200019c
- sub_02000228
- IntrDummy
Merge main repo
chao_garden/src/init.c
Outdated
| table = base + 3; | ||
| do { | ||
| *table = dummy; | ||
| } while ((signed)--table >= (signed)base); |
There was a problem hiding this comment.
Can these be (u32) or (s32)? I think it's best to specify the length (though I understand void is 4 bytes by default)
There was a problem hiding this comment.
I just wrote signed so that the correct conditional was used.
Not sure whether specifying the length is better or not.
There was a problem hiding this comment.
Use (s32) for consistency with the rest of the code base I guess
There was a problem hiding this comment.
Btw to make the comparison correct you only need to cast one side to a signed value? I think, have a go
There was a problem hiding this comment.
Nope: src/main.c:109: warning: comparison between pointer and integer
There was a problem hiding this comment.
Ah! Leave as both sides then
| build/mb_chao_garden/asm/rom_header.o(.text); | ||
| build/mb_chao_garden/asm/crt0.o(.text); | ||
| build/mb_chao_garden/src/main.o(.text); | ||
| build/mb_chao_garden/src/init.o(.text); |
There was a problem hiding this comment.
Btw can be init.c but it's likely this was just part of main.c? Are these called from any other location?
There was a problem hiding this comment.
Only assuming based on the interrupt stuff being setup as part of main.c in the base rom
There was a problem hiding this comment.
Apparently sub_0200019c gets only called by main, but sub_02000228 is referenced by code.s!
Can push sub_0200019c to main if you prefer
There was a problem hiding this comment.
Probably part of main.c for now
chao_garden/src/init.c
Outdated
| { | ||
| IntrFunc toInsert; | ||
|
|
||
| if (!func) |
There was a problem hiding this comment.
Could probably write this as func == NULL
There was a problem hiding this comment.
C'mon, now you're really nitpicking! :D
There was a problem hiding this comment.
Hahaha sorry! :(
I read !something as booleans instead. == NULL for pointers to understand it's checking for NULL
chao_garden/src/init.c
Outdated
|
|
||
| extern struct TCG_SaveSectorData gUnknown_03003B80; | ||
|
|
||
| void sub_02000228(IntrFunc func) |
There was a problem hiding this comment.
This is also still part of main.c, and likely main.c is actually core.c or something? Anyway this function is likely SetVBlankIntr https://github.com/freshollie/sa2/blob/main/chao_garden/asm/crt0.s#L39 as gIntrTable[1] is the VBlankIntr
There was a problem hiding this comment.
Oh yeah, you're right! I somehow couldn't find the name before.
* Update CI/CD script * Fix build RC