mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
link radio
This commit is contained in:
@@ -48,6 +48,9 @@ jaudio_NES/rhythm.c:
|
||||
.sdata: [0x80217bd0, 0x80217bd8]
|
||||
.sbss: [0x802183a0, 0x802183b0]
|
||||
.sdata2: [0x80218d60, 0x80218d78]
|
||||
jaudio_NES/radio.c:
|
||||
.text: [0x800165ec, 0x8001676c]
|
||||
.sdata2: [0x80218d78, 0x80218d88]
|
||||
jaudio_NES/aictrl.c:
|
||||
.text: [0x80017e80, 0x80018640]
|
||||
.rodata: [0x800aa500, 0x800aa518]
|
||||
|
||||
@@ -635,6 +635,7 @@ JAUDIO_FUNC_ALIGN_32_TUS = [
|
||||
JAUDIO_USER_TUS = [
|
||||
"verysimple.c",
|
||||
"melody.c",
|
||||
"radio.c",
|
||||
"rhythm.c"
|
||||
]
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void Na_GetRadioCounter(void*);
|
||||
extern void Na_GetKappaCounter(void*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -3,11 +3,17 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
typedef struct radio_ {
|
||||
/* 0x000 */ s8 unk0;
|
||||
/* 0x004 */ f32 unk4;
|
||||
/* 0x008 */ u16 tempo;
|
||||
} radio;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void Na_GetKappaCounter(void*);
|
||||
extern s16 Na_GetRadioCounter(radio* radio);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#include "jaudio_NES/radio.h"
|
||||
#include "jaudio_NES/game64.h"
|
||||
#include "jaudio_NES/audiowork.h"
|
||||
|
||||
|
||||
s16 Na_GetRadioCounter(radio* radio) {
|
||||
int unk16;
|
||||
u16 tempo = 0;
|
||||
|
||||
group* group = nullptr;
|
||||
int unused = 0;
|
||||
|
||||
|
||||
if (AG.groups[sou_now_bgm_handle].flags.enabled != 0 && AG.groups[sou_now_bgm_handle].seq_id == 0xDA) {
|
||||
group = &(AG.groups)[sou_now_bgm_handle];
|
||||
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
unk16 = group->unk016;
|
||||
|
||||
(void)unused;
|
||||
|
||||
if (unk16 < 0x2E8) {
|
||||
radio->unk0 = 0;
|
||||
} else {
|
||||
unk16 -= 0x2E8;
|
||||
radio->unk0 = (s8)(unk16 / 0x300);
|
||||
unk16 = unk16 - (radio->unk0 * 0x300);
|
||||
radio->unk0++;
|
||||
}
|
||||
if (radio->unk0 == 9) {
|
||||
radio->unk4 = unk16 / 216.0f;
|
||||
|
||||
} else {
|
||||
radio->unk4 = unk16 / 768.0f;
|
||||
}
|
||||
|
||||
radio->tempo = AG.groups[sou_now_bgm_handle].tempo / 48;
|
||||
tempo = radio->tempo;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user