mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
Merge pull request #347 from Cuyler36:jaudio_NES_audioheaders
Implement & link jaudio_NES/audioheaders.c
This commit is contained in:
@@ -30,6 +30,8 @@ dvderr.c:
|
||||
.bss: [0x800e2790, 0x800e2b88]
|
||||
jaudio_NES/dummyprobe.c:
|
||||
.text: [0x800083f8, 0x80008400]
|
||||
jaudio_NES/audioheaders.c:
|
||||
.data: [0x800cca40, 0x800ce880]
|
||||
jaudio_NES/aictrl.c:
|
||||
.text: [0x80017e80, 0x80018640]
|
||||
.rodata: [0x800aa500, 0x800aa518]
|
||||
|
||||
@@ -3026,6 +3026,11 @@ global:
|
||||
0x800c30c0: logo_nin_v
|
||||
0x800c3100: logo_ninT_model
|
||||
0x800c3140: nintendo_hi_0
|
||||
0x800cca40: AudioseqHeaderStart
|
||||
0x800cd9e0: AudiobankHeaderStart
|
||||
0x800ce3e0: AudiowaveHeaderStart
|
||||
0x800ce450: AudiodataHeaderStart
|
||||
0x800ce490: AudiomapHeaderStart
|
||||
0x800ce880: LEN_TABLE
|
||||
0x800ce8a0: NOISE_FREQ_TABLE
|
||||
0x800ce8e0: sbuffer
|
||||
|
||||
@@ -19,6 +19,22 @@ typedef enum DSPBUF_EVENTS {
|
||||
DSPBUF_EVENTS_2 = 2,
|
||||
} DSPBUF_EVENTS;
|
||||
|
||||
typedef enum SampleMedium {
|
||||
/* 0 */ MEDIUM_RAM,
|
||||
/* 1 */ MEDIUM_UNK,
|
||||
/* 2 */ MEDIUM_CART,
|
||||
/* 3 */ MEDIUM_DISK_DRIVE,
|
||||
/* 5 */ MEDIUM_RAM_UNLOADED = 5
|
||||
} SampleMedium;
|
||||
|
||||
typedef enum AudioCacheLoadType {
|
||||
/* 0 */ CACHE_LOAD_PERMANENT,
|
||||
/* 1 */ CACHE_LOAD_PERSISTENT,
|
||||
/* 2 */ CACHE_LOAD_TEMPORARY,
|
||||
/* 3 */ CACHE_LOAD_EITHER,
|
||||
/* 4 */ CACHE_LOAD_EITHER_NOSYNC
|
||||
} AudioCacheLoadType;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef AUDIOHEADERS_H
|
||||
#define AUDIOHEADERS_H
|
||||
|
||||
#include "types.h"
|
||||
#include "jaudio_NES/audiostruct.h"
|
||||
|
||||
extern ArcHeader AudioseqHeaderStart;
|
||||
extern ArcHeader AudiobankHeaderStart;
|
||||
extern ArcHeader AudiowaveHeaderStart;
|
||||
extern ArcHeader AudiodataHeaderStart;
|
||||
extern u16 AudiomapHeaderStart[];
|
||||
|
||||
#endif
|
||||
@@ -49,13 +49,26 @@ typedef struct ALHeap {
|
||||
/* 0x10 */ u8* last;
|
||||
} ALHeap;
|
||||
|
||||
/* sizeof(ArcHeader) == 0x10 */
|
||||
/* sizeof(ArcEntry) == 0x10 */
|
||||
typedef struct ArcEntry_ {
|
||||
/* 0x00 */ u32 addr;
|
||||
/* 0x04 */ size_t size;
|
||||
/* 0x08 */ s8 medium;
|
||||
/* 0x09 */ s8 cacheType;
|
||||
/* 0x0A */ s16 param0;
|
||||
/* 0x0C */ s16 param1;
|
||||
/* 0x0E */ s16 param2;
|
||||
} ArcEntry;
|
||||
|
||||
/* sizeof(ArcHeader) == [0x10, 0x10+entries*0x10] */
|
||||
typedef struct ArcHeader_ {
|
||||
/* 0x00 */ s16 numEntries;
|
||||
/* 0x02 */ u16 _02;
|
||||
/* 0x02 */ s16 _02;
|
||||
/* 0x04 */ u8* pData;
|
||||
/* 0x08 */ u8 copy;
|
||||
} ArcHeader ATTRIBUTE_ALIGN(8);
|
||||
/* 0x09 */ u8 pad[7];
|
||||
/* 0x10 */ ArcEntry entries[]; /* variable size */
|
||||
} ArcHeader;
|
||||
|
||||
/* sizeof(AutoHeapstrc) == 0xC */
|
||||
typedef struct AutoHeapstrc_ {
|
||||
|
||||
+28
-22
@@ -4,7 +4,7 @@
|
||||
#include "../tools/ppcdis/include/ppcdis.h"
|
||||
|
||||
#ifdef IS_REL
|
||||
//#pragma section const_type sconst_type ".rodata" ".rodata" data_mode=far_abs code_mode=pc_rel
|
||||
// #pragma section const_type sconst_type ".rodata" ".rodata" data_mode=far_abs code_mode=pc_rel
|
||||
#endif
|
||||
|
||||
typedef signed char s8;
|
||||
@@ -41,15 +41,16 @@ typedef u32 unknown;
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
#define NULL ((void*)0)
|
||||
#define nullptr 0
|
||||
|
||||
#define AT_ADDRESS(x) : (x)
|
||||
|
||||
#define ALIGN_PREV(u, align) (u & (~(align-1)))
|
||||
#define ALIGN_NEXT(u, align) ((u + (align-1)) & (~(align-1)))
|
||||
#define IS_ALIGNED(X, N) (((X) & ((N)-1)) == 0)
|
||||
#define IS_NOT_ALIGNED(X, N) (((X) & ((N)-1)) != 0)
|
||||
#define ALIGN_PREV(u, align) (u & (~(align - 1)))
|
||||
#define ALIGN_NEXT(u, align) ((u + (align - 1)) & (~(align - 1)))
|
||||
#define IS_ALIGNED(X, N) (((X) & ((N) - 1)) == 0)
|
||||
#define IS_NOT_ALIGNED(X, N) (((X) & ((N) - 1)) != 0)
|
||||
|
||||
#define FLAG_ON(V, F) (((V) & (F)) == 0)
|
||||
#define FLAG_OFF(V, F) (((V) & (F)) != 0)
|
||||
@@ -91,34 +92,39 @@ typedef u32 unknown;
|
||||
#define F32_IS_ZERO(v) (fabsf(v) < 0.008f)
|
||||
|
||||
/* ARGB8 color format (32 bits) to RGB5A3 color format (16 bits) */
|
||||
#define ARGB8_to_RGB5A3(argb8) \
|
||||
((u16)(((argb8) & 0xFF000000) >= 0xE0000000 ? \
|
||||
/* Fully opaque, 5 bits per color channel */ (0x8000 | ((((argb8) >> 16) & 0xF8) << 7) | ((((argb8) >> 8) & 0xF8) << 2) | (((argb8) & 0xFF) >> 3)) : \
|
||||
/* 3 bits of transparency, 4 bits per color channel */ (((((argb8) >> 24) & 0xE0) << 7) | ((((argb8) >> 16) & 0xF0) << 4) | (((argb8) >> 8) & 0xF0) | (((argb8) & 0xF0) >> 4))))
|
||||
#define ARGB8_to_RGB5A3(argb8) \
|
||||
((u16)(((argb8) & 0xFF000000) >= 0xE0000000 \
|
||||
? /* Fully opaque, 5 bits per color channel */ (0x8000 | ((((argb8) >> 16) & 0xF8) << 7) | \
|
||||
((((argb8) >> 8) & 0xF8) << 2) | \
|
||||
(((argb8) & 0xFF) >> 3)) \
|
||||
: /* 3 bits of transparency, 4 bits per color channel */ ( \
|
||||
((((argb8) >> 24) & 0xE0) << 7) | ((((argb8) >> 16) & 0xF0) << 4) | (((argb8) >> 8) & 0xF0) | \
|
||||
(((argb8) & 0xF0) >> 4))))
|
||||
|
||||
#define GPACK_RGB5A3(r, g, b, a) ARGB8_to_RGB5A3((((a) & 0xFF) << 24) | (((r) & 0xFF) << 16) | (((g) & 0xFF) << 8) | ((b) & 0xFF))
|
||||
#define GPACK_RGB5A3(r, g, b, a) \
|
||||
ARGB8_to_RGB5A3((((a) & 0xFF) << 24) | (((r) & 0xFF) << 16) | (((g) & 0xFF) << 8) | ((b) & 0xFF))
|
||||
|
||||
#pragma section RX "forcestrip"
|
||||
#ifndef __INTELLISENSE__
|
||||
#define FORCESTRIP __declspec(section "forcestrip")
|
||||
#ifndef __INTELLISENSE__
|
||||
#define FORCESTRIP __declspec(section "forcestrip")
|
||||
#else
|
||||
#define FORCESTRIP
|
||||
#define FORCESTRIP
|
||||
#endif
|
||||
|
||||
#ifdef MUST_MATCH
|
||||
#define MATCH_FORCESTRIP FORCESTRIP
|
||||
#define MATCH_FORCESTRIP FORCESTRIP
|
||||
#else
|
||||
#define MATCH_FORCESTRIP
|
||||
#define MATCH_FORCESTRIP
|
||||
#endif
|
||||
|
||||
#if !defined(__INTELLISENSE__) && defined(MUST_MATCH)
|
||||
#define BSS_ORDER_GROUP_START FORCESTRIP ORDER_BSS_DATA {
|
||||
#define BSS_ORDER_GROUP_END }
|
||||
#define BSS_ORDER_ITEM(v) ORDER_BSS(v)
|
||||
#define BSS_ORDER_GROUP_START FORCESTRIP ORDER_BSS_DATA {
|
||||
#define BSS_ORDER_GROUP_END }
|
||||
#define BSS_ORDER_ITEM(v) ORDER_BSS(v)
|
||||
#else
|
||||
#define BSS_ORDER_GROUP_START
|
||||
#define BSS_ORDER_GROUP_END
|
||||
#define BSS_ORDER_ITEM(v)
|
||||
#define BSS_ORDER_GROUP_START
|
||||
#define BSS_ORDER_GROUP_END
|
||||
#define BSS_ORDER_ITEM(v)
|
||||
#endif
|
||||
|
||||
#ifndef __cplusplus
|
||||
@@ -126,4 +132,4 @@ typedef u32 unknown;
|
||||
typedef short wchar_t;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user