summaryrefslogtreecommitdiff
path: root/include/gba
diff options
context:
space:
mode:
authorscnorton <scnorton@biociphers.org>2017-10-16 14:12:59 -0400
committerscnorton <scnorton@biociphers.org>2017-10-16 14:12:59 -0400
commita6d2bfaebd16940fc0ac1be3ca29caf0888296ca (patch)
tree7ec979bc8481b2c2d55874aef3e9004ddb715781 /include/gba
parent96ebc5d46287e33df7bda74a6fb340281cdaa4c5 (diff)
parent7d657ef56716fd01bacf4a47df50ad0ec3d03b10 (diff)
Merge branch 'master' into secret_base
Diffstat (limited to 'include/gba')
-rw-r--r--include/gba/m4a_internal.h4
-rw-r--r--include/gba/macro.h34
-rw-r--r--include/gba/types.h10
3 files changed, 39 insertions, 9 deletions
diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h
index 572b77711..ff92fcc40 100644
--- a/include/gba/m4a_internal.h
+++ b/include/gba/m4a_internal.h
@@ -404,10 +404,6 @@ void SampleFreqSet(u32 freq);
void m4aSoundVSyncOn(void);
void m4aSoundVSyncOff(void);
-void m4aMPlayTempoControl(struct MusicPlayerInfo *mplayInfo, u16 tempo);
-void m4aMPlayVolumeControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u16 volume);
-void m4aMPlayPitchControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u16 pitch);
-void m4aMPlayPanpotControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, s8 pan);
void ClearModM(struct MusicPlayerTrack *track);
void m4aMPlayModDepthSet(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u8 modDepth);
void m4aMPlayLFOSpeedSet(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u8 lfoSpeed);
diff --git a/include/gba/macro.h b/include/gba/macro.h
index 230fb4383..1e0254806 100644
--- a/include/gba/macro.h
+++ b/include/gba/macro.h
@@ -84,4 +84,38 @@
dmaRegs[5]; \
}
+#define DmaCopyLarge(dmaNum, src, dest, size, block, bit) \
+{ \
+ const void *_src = src; \
+ void *_dest = dest; \
+ u32 _size = size; \
+ while (1) \
+ { \
+ DmaCopy##bit(dmaNum, _src, _dest, (block)); \
+ _src += (block); \
+ _dest += (block); \
+ _size -= (block); \
+ if (_size <= (block)) \
+ { \
+ DmaCopy##bit(dmaNum, _src, _dest, _size); \
+ break; \
+ } \
+ } \
+}
+
+#define DmaCopyLarge16(dmaNum, src, dest, size, block) DmaCopyLarge(dmaNum, src, dest, size, block, 16)
+
+#define DmaCopyLarge32(dmaNum, src, dest, size, block) DmaCopyLarge(dmaNum, src, dest, size, block, 32)
+
+#define DmaCopyDefvars(dmaNum, src, dest, size, bit) \
+{ \
+ const void *_src = src; \
+ void *_dest = dest; \
+ u32 _size = size; \
+ DmaCopy##bit(dmaNum, _src, _dest, _size); \
+}
+
+#define DmaCopy16Defvars(dmaNum, src, dest, size) DmaCopyDefvars(dmaNum, src, dest, size, 16)
+#define DmaCopy32Defvars(dmaNum, src, dest, size) DmaCopyDefvars(dmaNum, src, dest, size, 32)
+
#endif // GUARD_GBA_MACRO_H
diff --git a/include/gba/types.h b/include/gba/types.h
index 96e057ab7..480619d21 100644
--- a/include/gba/types.h
+++ b/include/gba/types.h
@@ -39,11 +39,11 @@ struct PlttData
struct OamData
{
/*0x00*/ u32 y:8;
- /*0x01*/ u32 affineMode:2;
- u32 objMode:2;
- u32 mosaic:1;
- u32 bpp:1;
- u32 shape:2;
+ /*0x01*/ u32 affineMode:2; // 0x1, 0x2 = 0x3
+ u32 objMode:2; // 0x4, 0x8 = 0xC
+ u32 mosaic:1; // 0x10
+ u32 bpp:1; // 0x20
+ u32 shape:2; // 0x40, 0x80
/*0x02*/ u32 x:9;
u32 matrixNum:5; // bits 3/4 are h-flip/v-flip if not in affine mode