mirror of
https://github.com/SAT-R/sa2.git
synced 2026-10-28 09:43:38 +00:00
misc cleanup, split background.h and sprite.h, move stuff into core.h
This commit is contained in:
1 parent
d9aa9b2748
commit
6d93f970e3
133 files changed
+938
-853
No files matched your search
@@ -257,7 +257,7 @@ _08041F02:
|
||||
adds r2, r0, #0
|
||||
muls r2, r6, r2
|
||||
ldr r3, _08042004 @ =0x3C6EF35F
|
||||
adds r2, r2, r3 @ r2 = PseudoRandom32()
|
||||
adds r2, r2, r3 @ r2 = PSEUDO_RANDOM_32()
|
||||
movs r1, #0x3f
|
||||
ands r1, r2
|
||||
movs r0, #0xfa
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
#ifndef GUARD_ANIMATION_COMMANDS_H
|
||||
#define GUARD_ANIMATION_COMMANDS_H
|
||||
|
||||
#include "global.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#define AnimCommandSizeInWords(_structType) ((sizeof(_structType)) / sizeof(s32))
|
||||
|
||||
typedef AnimCmdResult (*AnimationCommandFunc)(void *cursor, Sprite *sprite);
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -2
|
||||
|
||||
// Note(Jace): This needs to be signed, since a
|
||||
// negative value infers that it's using 8bit-colors
|
||||
/* 0x04 */ s32 tileIndex;
|
||||
|
||||
/* 0x08 */ u32 numTilesToCopy;
|
||||
} ACmd_GetTiles;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -2
|
||||
|
||||
/* 0x04 */ s32 palId;
|
||||
/* 0x06 */ u16 numColors;
|
||||
/* 0x08 */ u16 insertOffset;
|
||||
} ACmd_GetPalette;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -3
|
||||
|
||||
/* 0x04 */ s32 offset;
|
||||
} ACmd_JumpBack;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -4
|
||||
} ACmd_4;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -5
|
||||
|
||||
/* 0x04 */ u16 songId;
|
||||
} ACmd_PlaySoundEffect;
|
||||
|
||||
// TODO: param types unknown
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -6
|
||||
|
||||
/* 0x04 */ Hitbox hitbox;
|
||||
} ACmd_Hitbox;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -7
|
||||
|
||||
/* 0x04 */ u16 x;
|
||||
/* 0x06 */ u16 y;
|
||||
} ACmd_TranslateSprite;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -8
|
||||
|
||||
/* 0x04 */ s32 unk4;
|
||||
/* 0x08 */ s32 unk8;
|
||||
} ACmd_8;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -9
|
||||
|
||||
/* 0x04 */ AnimId animId;
|
||||
/* 0x06 */ u16 variant;
|
||||
} ACmd_SetIdAndVariant;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -10
|
||||
|
||||
/* 0x04 */ s32 unk4;
|
||||
/* 0x08 */ s32 unk8;
|
||||
/* 0x0C */ s32 unkC;
|
||||
} ACmd_10;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -11
|
||||
|
||||
/* 0x04 */ s32 priority;
|
||||
} ACmd_SetSpritePriority;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -12
|
||||
|
||||
/* 0x04 */ s32 orderIndex;
|
||||
} ACmd_SetOamOrder;
|
||||
|
||||
typedef struct {
|
||||
// number of frames this will be displayed
|
||||
s32 delay;
|
||||
|
||||
// frameId of this animation that should be displayed
|
||||
s32 index;
|
||||
} ACmd_ShowFrame;
|
||||
|
||||
typedef union {
|
||||
s32 id;
|
||||
|
||||
ACmd_GetTiles tiles;
|
||||
ACmd_GetPalette pal;
|
||||
ACmd_JumpBack jump;
|
||||
ACmd_4 end;
|
||||
ACmd_PlaySoundEffect sfx;
|
||||
ACmd_Hitbox _6;
|
||||
ACmd_TranslateSprite translate;
|
||||
ACmd_8 _8;
|
||||
ACmd_SetIdAndVariant setAnimId;
|
||||
ACmd_10 _10;
|
||||
ACmd_SetSpritePriority _11;
|
||||
ACmd_SetOamOrder setOamOrder;
|
||||
|
||||
ACmd_ShowFrame show;
|
||||
} ACmd;
|
||||
|
||||
u32 Base10DigitsToHexNibbles(u16 num);
|
||||
|
||||
#endif // GUARD_ANIMATION_COMMANDS_H
|
||||
@@ -1,11 +0,0 @@
|
||||
#ifndef GUARD_ANIMATION_COMMANDS_EXTRA_H
|
||||
#define GUARD_ANIMATION_COMMANDS_EXTRA_H
|
||||
|
||||
#include "gba/types.h"
|
||||
#include "sprite.h"
|
||||
|
||||
void UpdateBgAnimationTiles(Background *);
|
||||
|
||||
s32 RenderText(void *dest, const void *font, u16 x, u16 y, u8 bg, const char *text, u8 palette);
|
||||
|
||||
#endif // GUARD_ANIMATION_COMMANDS_EXTRA_H
|
||||
@@ -0,0 +1,66 @@
|
||||
#ifndef GUARD_BACKGROUND_H
|
||||
#define GUARD_BACKGROUND_H
|
||||
|
||||
#include "core.h"
|
||||
|
||||
// TODO: Put this somewhere else! (or is this already somewhere?)
|
||||
#define TileMask_Index (0x3FF)
|
||||
#define TileMask_FlipX (1 << 10)
|
||||
#define TileMask_FlipY (1 << 11)
|
||||
#define TileMask_FlipXY (TileMask_FlipX | TileMask_FlipY)
|
||||
#define TileMask_Palette (TileMask_FlipX | TileMask_FlipY)
|
||||
|
||||
#define BACKGROUND_FLAGS_BG_ID(id) (id)
|
||||
#define BACKGROUND_FLAGS_MASK_BG_ID 0x3
|
||||
#define BACKGROUND_FLAG_4 0x4
|
||||
#define BACKGROUND_DISABLE_TILESET_UPDATE 0x8
|
||||
#define BACKGROUND_DISABLE_PALETTE_UPDATE 0x10
|
||||
#define BACKGROUND_FLAG_20 0x20
|
||||
#define BACKGROUND_FLAG_IS_LEVEL_MAP 0x40
|
||||
#define BACKGROUND_FLAG_80 0x80
|
||||
#define BACKGROUND_FLAG_100 0x100
|
||||
#define BACKGROUND_UPDATE_ANIMATIONS 0x200
|
||||
#define BACKGROUND_FLAG_400 0x400
|
||||
#define BACKGROUND_FLAG_800 0x800
|
||||
|
||||
// TODO: potentially rename these. For now, all we know is
|
||||
// that they are used in the same functions which handles
|
||||
// bg sprites
|
||||
#define INIT_BG_SPRITES_LAYER_32(index) \
|
||||
({ \
|
||||
gBgSprites_Unknown1[(index)] = 0; \
|
||||
gBgSprites_Unknown2[(index)][0] = 0; \
|
||||
gBgSprites_Unknown2[(index)][1] = 0; \
|
||||
gBgSprites_Unknown2[(index)][2] = 255; \
|
||||
gBgSprites_Unknown2[(index)][3] = 32; \
|
||||
});
|
||||
|
||||
#define INIT_BG_SPRITES_LAYER_64(index) \
|
||||
({ \
|
||||
gBgSprites_Unknown1[(index)] = 0; \
|
||||
gBgSprites_Unknown2[(index)][0] = 0; \
|
||||
gBgSprites_Unknown2[(index)][1] = 0; \
|
||||
gBgSprites_Unknown2[(index)][2] = 255; \
|
||||
gBgSprites_Unknown2[(index)][3] = 64; \
|
||||
})
|
||||
|
||||
#define INIT_BG_SPRITES_LAYER_128(index) \
|
||||
({ \
|
||||
gBgSprites_Unknown1[(index)] = 0; \
|
||||
gBgSprites_Unknown2[(index)][0] = 0; \
|
||||
gBgSprites_Unknown2[(index)][1] = 0; \
|
||||
gBgSprites_Unknown2[(index)][2] = 255; \
|
||||
gBgSprites_Unknown2[(index)][3] = 128; \
|
||||
})
|
||||
|
||||
void DrawBackground(Background *);
|
||||
void DisplaySprite_BG(Sprite *);
|
||||
s32 UpdateSpriteAnimation_BG(Sprite *);
|
||||
void UpdateBgAnimationTiles(Background *);
|
||||
s32 RenderText(void *dest, const void *font, u16 x, u16 y, u8 bg, const char *text, u8 palette);
|
||||
void SA2_LABEL(sub_8003EE4)(u16 p0, s16 p1, s16 p2, s16 p3, s16 p4, s16 p5, s16 p6, BgAffineReg *affine);
|
||||
bool32 SA2_LABEL(sub_8004010)(void);
|
||||
bool32 SA2_LABEL(sub_8002B20)(void);
|
||||
bool32 SA2_LABEL(sub_80039E4)(void);
|
||||
|
||||
#endif // GUARD_BACKGROUND_H
|
||||
@@ -31,4 +31,6 @@ extern void SA2_LABEL(sub_8007738)(u8 bg, int_vcount minY, int_vcount maxY, u16
|
||||
extern void SA2_LABEL(sub_8007858)(u8 param0, int_vcount minY, int_vcount maxY, u16 param3, u16 param4);
|
||||
extern void SA2_LABEL(sub_80078D4)(u8 bg, int_vcount minY, int_vcount maxY, u16 offsetEven, u16 offsetOdd);
|
||||
void SA2_LABEL(sub_8007958)(u8 bg, int_vcount minY, int_vcount maxY, s16 param3, s8 param4, u16 param5, u16 param6);
|
||||
void SA2_LABEL(sub_80064A8)(u8 p0, u8 p1, u8 p2, u8 p3, u8 p4, u8 p5);
|
||||
void SA2_LABEL(sub_8006228)(u8 p0, u8 p1, u8 p2, u8 p3, u8 p4, u8 p5);
|
||||
#endif
|
||||
+329
-13
@@ -6,12 +6,29 @@
|
||||
#endif
|
||||
|
||||
#include "global.h"
|
||||
#include "sprite.h"
|
||||
#include "rect.h"
|
||||
#include "task.h"
|
||||
#include "flags.h"
|
||||
#include "tilemap.h"
|
||||
#include "input_recorder.h"
|
||||
#include "animation_commands.h"
|
||||
|
||||
#define VRAM_HEAP_TILE_SIZE TILE_SIZE_4BPP
|
||||
#define VRAM_HEAP_SEGMENT_SIZE (4 * VRAM_HEAP_TILE_SIZE)
|
||||
#define VRAM_TILE_SLOTS_PER_SEGMENT (VRAM_HEAP_SEGMENT_SIZE / VRAM_HEAP_TILE_SIZE)
|
||||
|
||||
// TODO: Find out where these numbers come from
|
||||
#if (ENGINE == ENGINE_1)
|
||||
#define VRAM_TILE_SEGMENTS 156
|
||||
#define VRAM_HEAP_TILE_COUNT 112
|
||||
#elif (ENGINE == ENGINE_2)
|
||||
#if COLLECT_RINGS_ROM
|
||||
#define VRAM_TILE_SEGMENTS 128
|
||||
#define VRAM_HEAP_TILE_COUNT 0
|
||||
#else
|
||||
#define VRAM_TILE_SEGMENTS 140
|
||||
#define VRAM_HEAP_TILE_COUNT 48
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct MultiSioData_0_0 {
|
||||
// id
|
||||
@@ -147,6 +164,19 @@ typedef u16 collPxDim_t;
|
||||
typedef u32 collPxDim_t;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
u16 bldCnt;
|
||||
u16 bldAlpha;
|
||||
u16 bldY;
|
||||
} BlendRegs;
|
||||
|
||||
// Values to be passed top the affine registers
|
||||
// (used by BG2/BG3 in affine screen modes)
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 pa, pb, pc, pd;
|
||||
/* 0x08 */ u32 x, y;
|
||||
} BgAffineReg;
|
||||
|
||||
// Thanks @MainMemory_ for figuring out how collision is stored!
|
||||
typedef struct {
|
||||
/* 0x00 */ const s8 *height_map;
|
||||
@@ -185,25 +215,311 @@ struct Unk_03003674 {
|
||||
const s32 *unk18;
|
||||
}; /* size = 0x1C */
|
||||
|
||||
struct SpriteTables {
|
||||
typedef u16 AnimId;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ const void *src;
|
||||
/* 0x04 */ void *dest;
|
||||
/* 0x08 */ u16 size;
|
||||
/* 0x0A */ AnimId anim;
|
||||
} GraphicsData;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ GraphicsData graphics;
|
||||
|
||||
// 'tilesVram' points to tile-index array in VRAM, telling the GBA which tiles to
|
||||
// draw on this BG
|
||||
//
|
||||
// (!!! Data likely different depending on type of Background (Affine vs. Text). !!!)
|
||||
//
|
||||
// Data-Structure (16 bits): MSB > PPPPYXTTTTTTTTTT < LSB
|
||||
// P = Palette Index
|
||||
// Y = Y-Flip
|
||||
// X = X-Flip
|
||||
// T = Tile-Index
|
||||
//
|
||||
// NOTE: It does NOT point to the tileset!
|
||||
/* 0x0C */ u16 *layoutVram;
|
||||
|
||||
// Stage-Map: Metatiles
|
||||
// Common Tilemaps: Tilemap-Tiles
|
||||
/* 0x10 */ const u16 *layout;
|
||||
|
||||
// Tile-count on each axis
|
||||
// - Stage maps: should be 12 (# per metatile)
|
||||
// - Common Tilemaps: should be .targetTilesX/Y
|
||||
/* 0x14 */ u16 xTiles;
|
||||
/* 0x16 */ u16 yTiles;
|
||||
|
||||
/* 0x18 */ u16 unk18;
|
||||
/* 0x1A */ u16 unk1A;
|
||||
/* 0x1C */ u16 tilemapId;
|
||||
/* 0x1E */ u16 unk1E;
|
||||
|
||||
/* 0x20 */ u16 unk20;
|
||||
/* 0x22 */ u16 unk22;
|
||||
/* 0x24 */ u16 unk24;
|
||||
|
||||
/* Tile-Dimensions for the rendering target */
|
||||
/* - Stage maps: DISPLAY_WIDTH/_HEIGHT + 1*TILE_WIDTH */
|
||||
/* - Common Tilemaps: full image dimensions */
|
||||
/* 0x26 */ u16 targetTilesX;
|
||||
/* 0x28 */ u16 targetTilesY;
|
||||
|
||||
/* 0x2A */ u8 paletteOffset;
|
||||
/* 0x2B */ u8 animFrameCounter;
|
||||
/* 0x2C */ u8 animDelayCounter;
|
||||
|
||||
/* 0x2E */ u16 flags;
|
||||
|
||||
// apparently NOT signed?
|
||||
/* 0x30 */ u16 scrollX;
|
||||
/* 0x32 */ u16 scrollY;
|
||||
/* 0x34 */ u16 prevScrollX;
|
||||
/* 0x36 */ u16 prevScrollY;
|
||||
|
||||
/* Only used by stage maps (they are encoded as Tilemaps) */
|
||||
/* 0x38 */ const MetatileIndexType *metatileMap;
|
||||
/* 0x3C */ u16 mapWidth;
|
||||
/* 0x3E */ u16 mapHeight;
|
||||
} Background; /* size = 0x40 */
|
||||
|
||||
typedef struct {
|
||||
#if (ENGINE >= ENGINE_3)
|
||||
// In SA3 flip-bits are integrated into the oamIndex.
|
||||
// X-Flip: Bit 14
|
||||
// Y-Flip: Bit 15
|
||||
/* 0x00 */ u16 oamIndex;
|
||||
#else
|
||||
/* 0x00 */ u8 flip;
|
||||
|
||||
// every animation has an associated oamData pointer, oamIndex starts at
|
||||
// 0 for every new animation and ends at variantCount-1
|
||||
/* 0x01 */ u8 oamIndex;
|
||||
#endif
|
||||
|
||||
// some sprite frames consist of multiple images (of the same size
|
||||
// as GBA's Object Attribute Memory, e.g. 8x8, 8x32, 32x64, ...)
|
||||
/* 0x02 */ u16 numSubframes;
|
||||
|
||||
// In pixels
|
||||
/* 0x04 */ u16 width;
|
||||
// In pixels
|
||||
/* 0x06 */ u16 height;
|
||||
|
||||
/* 0x08 */ s16 offsetX;
|
||||
/* 0x0A */ s16 offsetY;
|
||||
} SpriteOffset;
|
||||
|
||||
typedef struct {
|
||||
// index: -1 on init; lower 4 bits = index (in anim-cmds)
|
||||
/* 0x00 */ s32 index;
|
||||
/* 0x04 */ Rect8 b;
|
||||
} Hitbox;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ GraphicsData graphics;
|
||||
/* 0x0C */ const SpriteOffset *dimensions;
|
||||
|
||||
// Bitfield description from KATAM decomp
|
||||
/* 0x10 */ u32 frameFlags; // bit 0-4: affine-index / rotscale param selection
|
||||
// bit 5: rotscale enable
|
||||
// bit 6: rotscale double-size
|
||||
// bit 7-8: obj mode
|
||||
// bit 9
|
||||
// bit 10 X-Flip
|
||||
// bit 11 Y-Flip
|
||||
// bit 12-13: priority
|
||||
// bit 14
|
||||
// bit 15-16: Background ID
|
||||
// bit 17
|
||||
// bit 18
|
||||
// bit 19-25(?)
|
||||
// bit 26
|
||||
// bit 27-29(?)
|
||||
// bit 30
|
||||
// bit 31
|
||||
|
||||
/* 0x14 */ u16 animCursor;
|
||||
|
||||
/* 0x16 */ s16 x;
|
||||
/* 0x18 */ s16 y;
|
||||
|
||||
/* 0x1A */ u16 oamFlags; // bit 6-10: OAM order index
|
||||
|
||||
/* 0x1C */ s16 qAnimDelay; // Q_8_8, in frames
|
||||
/* 0x1E */ u16 prevAnim;
|
||||
/* 0x20 */ u8 variant;
|
||||
/* 0x21 */ u8 prevVariant;
|
||||
|
||||
// 0x08 = 0.5x, 0x10 = 1.0x, 0x20 = 2.0x ...
|
||||
/* 0x22 */ u8 animSpeed;
|
||||
|
||||
/* 0x23 */ u8 oamBaseIndex;
|
||||
/* 0x24 */ u8 numSubFrames;
|
||||
/* 0x25 */ u8 palId;
|
||||
/* 0x28 */ Hitbox hitboxes[1];
|
||||
} Sprite /* size = 0x30 */;
|
||||
|
||||
// TODO: Unify Sprite with variable hitbox count through a macro
|
||||
typedef struct {
|
||||
Sprite s;
|
||||
Hitbox hb1;
|
||||
} Sprite2;
|
||||
|
||||
// TODO: Unify Sprite with variable hitbox count through a macro
|
||||
typedef struct {
|
||||
Sprite s;
|
||||
Hitbox hb1;
|
||||
Hitbox hb2;
|
||||
} Sprite3;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 rotation;
|
||||
/* 0x02 */ s16 qScaleX;
|
||||
/* 0x04 */ s16 qScaleY;
|
||||
/* 0x06 */ s16 x;
|
||||
/* 0x08 */ s16 y;
|
||||
} SpriteTransform; /* size 0xA */
|
||||
|
||||
#define AnimCommandSizeInWords(_structType) ((sizeof(_structType)) / sizeof(s32))
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -2
|
||||
|
||||
// Note(Jace): This needs to be signed, since a
|
||||
// negative value infers that it's using 8bit-colors
|
||||
/* 0x04 */ s32 tileIndex;
|
||||
|
||||
/* 0x08 */ u32 numTilesToCopy;
|
||||
} ACmd_GetTiles;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -2
|
||||
|
||||
/* 0x04 */ s32 palId;
|
||||
/* 0x06 */ u16 numColors;
|
||||
/* 0x08 */ u16 insertOffset;
|
||||
} ACmd_GetPalette;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -3
|
||||
|
||||
/* 0x04 */ s32 offset;
|
||||
} ACmd_JumpBack;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -4
|
||||
} ACmd_4;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -5
|
||||
|
||||
/* 0x04 */ u16 songId;
|
||||
} ACmd_PlaySoundEffect;
|
||||
|
||||
// TODO: param types unknown
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -6
|
||||
|
||||
/* 0x04 */ Hitbox hitbox;
|
||||
} ACmd_Hitbox;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -7
|
||||
|
||||
/* 0x04 */ u16 x;
|
||||
/* 0x06 */ u16 y;
|
||||
} ACmd_TranslateSprite;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -8
|
||||
|
||||
/* 0x04 */ s32 unk4;
|
||||
/* 0x08 */ s32 unk8;
|
||||
} ACmd_8;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -9
|
||||
|
||||
/* 0x04 */ AnimId animId;
|
||||
/* 0x06 */ u16 variant;
|
||||
} ACmd_SetIdAndVariant;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -10
|
||||
|
||||
/* 0x04 */ s32 unk4;
|
||||
/* 0x08 */ s32 unk8;
|
||||
/* 0x0C */ s32 unkC;
|
||||
} ACmd_10;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -11
|
||||
|
||||
/* 0x04 */ s32 priority;
|
||||
} ACmd_SetSpritePriority;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 cmdId; // -12
|
||||
|
||||
/* 0x04 */ s32 orderIndex;
|
||||
} ACmd_SetOamOrder;
|
||||
|
||||
typedef struct {
|
||||
// number of frames this will be displayed
|
||||
s32 delay;
|
||||
|
||||
// frameId of this animation that should be displayed
|
||||
s32 index;
|
||||
} ACmd_ShowFrame;
|
||||
|
||||
typedef union {
|
||||
s32 id;
|
||||
|
||||
ACmd_GetTiles tiles;
|
||||
ACmd_GetPalette pal;
|
||||
ACmd_JumpBack jump;
|
||||
ACmd_4 end;
|
||||
ACmd_PlaySoundEffect sfx;
|
||||
ACmd_Hitbox _6;
|
||||
ACmd_TranslateSprite translate;
|
||||
ACmd_8 _8;
|
||||
ACmd_SetIdAndVariant setAnimId;
|
||||
ACmd_10 _10;
|
||||
ACmd_SetSpritePriority _11;
|
||||
ACmd_SetOamOrder setOamOrder;
|
||||
|
||||
ACmd_ShowFrame show;
|
||||
} ACmd;
|
||||
|
||||
typedef enum {
|
||||
ACMD_RESULT__ANIM_CHANGED = -1,
|
||||
ACMD_RESULT__ENDED = 0,
|
||||
ACMD_RESULT__RUNNING = +1,
|
||||
} AnimCmdResult;
|
||||
|
||||
typedef AnimCmdResult (*AnimationCommandFunc)(void *cursor, Sprite *sprite);
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ const ACmd **const *animations;
|
||||
/* 0x04 */ const SpriteOffset *const *dimensions;
|
||||
/* 0x08 */ const u16 **const oamData;
|
||||
/* 0x0C */ const ColorRaw *const palettes;
|
||||
/* 0x10 */ const u8 *const tiles_4bpp;
|
||||
/* 0x14 */ const u8 *const tiles_8bpp;
|
||||
};
|
||||
} SpriteTables;
|
||||
|
||||
// No idea why this exists when there is a
|
||||
// better random number generator in the math
|
||||
// module
|
||||
#define PseudoRandom32() \
|
||||
#define PSEUDO_RANDOM_32() \
|
||||
({ \
|
||||
gPseudoRandom = (gPseudoRandom * 0x196225) + 0x3C6EF35F; \
|
||||
gPseudoRandom; \
|
||||
})
|
||||
|
||||
#define MultiplayerPseudoRandom32() \
|
||||
#define MP_PSEUDO_RANDOM_32() \
|
||||
({ \
|
||||
gMultiplayerPseudoRandom = (gMultiplayerPseudoRandom * 0x196225) + 0x3C6EF35F; \
|
||||
gMultiplayerPseudoRandom; \
|
||||
@@ -211,9 +527,9 @@ struct SpriteTables {
|
||||
|
||||
// TODO: align the usage of this between both games
|
||||
#if (GAME == GAME_SA1)
|
||||
#define PseudoRandBetween(min, max) ((PseudoRandom32() & ((-min) + (max))) + (min))
|
||||
#define PseudoRandBetween(min, max) ((PSEUDO_RANDOM_32() & ((-min) + (max))) + (min))
|
||||
#else
|
||||
#define PseudoRandBetween(min, max) ((PseudoRandom32() & ((-min) + (max - 1))) + (min))
|
||||
#define PseudoRandBetween(min, max) ((PSEUDO_RANDOM_32() & ((-min) + (max - 1))) + (min))
|
||||
#endif
|
||||
|
||||
extern u32 gFlags;
|
||||
@@ -294,7 +610,7 @@ extern u16 gDispCnt;
|
||||
#define SET_PALETTE_COLOR_BG(_paletteId, _colorId, _color) GET_PALETTE_COLOR_BG(_paletteId, _colorId) = (_color);
|
||||
|
||||
extern winreg_t gWinRegs[6];
|
||||
extern struct BlendRegs gBldRegs;
|
||||
extern BlendRegs gBldRegs;
|
||||
extern BgAffineReg gBgAffineRegs[NUM_AFFINE_BACKGROUNDS];
|
||||
extern ColorRaw gObjPalette[16 * PALETTE_LEN_4BPP];
|
||||
extern ColorRaw gBgPalette[16 * PALETTE_LEN_4BPP];
|
||||
@@ -336,7 +652,7 @@ extern u8 gBgSprites_Unknown1[4];
|
||||
#else
|
||||
#define GFX_QUEUE_LOG_ADD(gfx)
|
||||
#endif
|
||||
extern struct GraphicsData *gVramGraphicsCopyQueue[32];
|
||||
extern GraphicsData *gVramGraphicsCopyQueue[32];
|
||||
extern u8 gVramGraphicsCopyQueueIndex;
|
||||
// Because the graphics in the queue only get copied if
|
||||
// (gVramGraphicsCopyCursor != gVramGraphicsCopyQueueIndex),
|
||||
@@ -353,9 +669,9 @@ extern u8 gVramGraphicsCopyQueueIndex;
|
||||
// pointers we need to copy so that a race condition
|
||||
// happens where sprite has been freed but the copy
|
||||
// has not happened we don't get invalid memory access
|
||||
extern struct GraphicsData gVramGraphicsCopyQueueBuffer[32];
|
||||
extern GraphicsData gVramGraphicsCopyQueueBuffer[32];
|
||||
#define ADD_TO_GRAPHICS_QUEUE(gfx) \
|
||||
memcpy(&gVramGraphicsCopyQueueBuffer[gVramGraphicsCopyQueueIndex], gfx, sizeof(struct GraphicsData)); \
|
||||
memcpy(&gVramGraphicsCopyQueueBuffer[gVramGraphicsCopyQueueIndex], gfx, sizeof(GraphicsData)); \
|
||||
gVramGraphicsCopyQueue[gVramGraphicsCopyQueueIndex] = &gVramGraphicsCopyQueueBuffer[gVramGraphicsCopyQueueIndex]; \
|
||||
/* Log has to happen before gVramGraphicsCopyQueueIndex increment */ \
|
||||
GFX_QUEUE_LOG_ADD(gfx) \
|
||||
@@ -406,7 +722,7 @@ extern s32 gPseudoRandom;
|
||||
extern u8 gOamMallocCopiedOrder[128];
|
||||
extern struct MultiBootParam gMultiBootParam;
|
||||
|
||||
extern const struct SpriteTables *gRefSpriteTables;
|
||||
extern const SpriteTables *gRefSpriteTables;
|
||||
|
||||
void EngineInit(void);
|
||||
void EngineMainLoop(void);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define GUARD_DATA_ANIMATIONS_H
|
||||
|
||||
#include "gba/types.h"
|
||||
#include "animation_commands.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#define NUM_SPRITE_ANIMATIONS 908
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
#include "core.h"
|
||||
|
||||
extern const struct SpriteTables gSpriteTables;
|
||||
extern const SpriteTables gSpriteTables;
|
||||
|
||||
#endif
|
||||
@@ -2,7 +2,6 @@
|
||||
#define GUARD_DATA_ANIMATIONS_H
|
||||
|
||||
#include "core.h"
|
||||
#include "animation_commands.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#if !ENABLE_DECOMP_CREDITS
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
#include "core.h"
|
||||
|
||||
extern const struct SpriteTables gSpriteTables;
|
||||
extern const SpriteTables gSpriteTables;
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef GUARD_SOME_TASK_MANAGER_H
|
||||
#define GUARD_SOME_TASK_MANAGER_H
|
||||
|
||||
#include "sprite.h"
|
||||
|
||||
typedef struct GfxInfo {
|
||||
TileInfoBitfield tileInfo;
|
||||
u8 *vram;
|
||||
|
||||
@@ -333,23 +333,10 @@ typedef struct {
|
||||
void *data;
|
||||
} RLCompressed;
|
||||
|
||||
struct BlendRegs {
|
||||
u16 bldCnt;
|
||||
u16 bldAlpha;
|
||||
u16 bldY;
|
||||
};
|
||||
|
||||
// TODO: Should this be in a GBA-specific header file?
|
||||
#define NUM_AFFINE_BACKGROUNDS 2
|
||||
#define NUM_BACKGROUNDS 4
|
||||
|
||||
// Values to be passed top the affine registers
|
||||
// (used by BG2/BG3 in affine screen modes)
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 pa, pb, pc, pd;
|
||||
/* 0x08 */ u32 x, y;
|
||||
} BgAffineReg;
|
||||
|
||||
// TODO: Find better place for this
|
||||
typedef void (*HBlankIntrFunc)(int_vcount vcount);
|
||||
typedef void (*IntrFunc)(void);
|
||||
|
||||
@@ -3,24 +3,6 @@
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#define VRAM_HEAP_TILE_SIZE TILE_SIZE_4BPP
|
||||
#define VRAM_HEAP_SEGMENT_SIZE (4 * VRAM_HEAP_TILE_SIZE)
|
||||
#define VRAM_TILE_SLOTS_PER_SEGMENT (VRAM_HEAP_SEGMENT_SIZE / VRAM_HEAP_TILE_SIZE)
|
||||
|
||||
// TODO: Find out where these numbers come from
|
||||
#if (ENGINE == ENGINE_1)
|
||||
#define VRAM_TILE_SEGMENTS 156
|
||||
#define VRAM_HEAP_TILE_COUNT 112
|
||||
#elif (ENGINE == ENGINE_2)
|
||||
#if COLLECT_RINGS_ROM
|
||||
#define VRAM_TILE_SEGMENTS 128
|
||||
#define VRAM_HEAP_TILE_COUNT 0
|
||||
#else
|
||||
#define VRAM_TILE_SEGMENTS 140
|
||||
#define VRAM_HEAP_TILE_COUNT 48
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void *VramMalloc(u32);
|
||||
void VramResetHeapState(void);
|
||||
void VramFree(void *);
|
||||
|
||||
+2
-235
@@ -1,235 +1,18 @@
|
||||
#ifndef GUARD_SPRITE_H
|
||||
#define GUARD_SPRITE_H
|
||||
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "rect.h"
|
||||
#include "malloc_vram.h"
|
||||
|
||||
typedef u16 AnimId;
|
||||
|
||||
typedef struct GraphicsData {
|
||||
/* 0x00 */ const void *src;
|
||||
/* 0x04 */ void *dest;
|
||||
/* 0x08 */ u16 size;
|
||||
/* 0x0A */ AnimId anim;
|
||||
} GraphicsData;
|
||||
|
||||
// TODO: Put this somewhere else! (or is this already somewhere?)
|
||||
#define TileMask_Index (0x3FF)
|
||||
#define TileMask_FlipX (1 << 10)
|
||||
#define TileMask_FlipY (1 << 11)
|
||||
#define TileMask_FlipXY (TileMask_FlipX | TileMask_FlipY)
|
||||
#define TileMask_Palette (TileMask_FlipX | TileMask_FlipY)
|
||||
|
||||
#define BACKGROUND_FLAGS_BG_ID(id) (id)
|
||||
#define BACKGROUND_FLAGS_MASK_BG_ID 0x3
|
||||
#define BACKGROUND_FLAG_4 0x4
|
||||
#define BACKGROUND_DISABLE_TILESET_UPDATE 0x8
|
||||
#define BACKGROUND_DISABLE_PALETTE_UPDATE 0x10
|
||||
#define BACKGROUND_FLAG_20 0x20
|
||||
#define BACKGROUND_FLAG_IS_LEVEL_MAP 0x40
|
||||
#define BACKGROUND_FLAG_80 0x80
|
||||
#define BACKGROUND_FLAG_100 0x100
|
||||
#define BACKGROUND_UPDATE_ANIMATIONS 0x200
|
||||
#define BACKGROUND_FLAG_400 0x400
|
||||
#define BACKGROUND_FLAG_800 0x800
|
||||
|
||||
// TODO: potentially rename these. For now, all we know is
|
||||
// that they are used in the same functions which handles
|
||||
// bg sprites
|
||||
#define INIT_BG_SPRITES_LAYER_32(index) \
|
||||
({ \
|
||||
gBgSprites_Unknown1[(index)] = 0; \
|
||||
gBgSprites_Unknown2[(index)][0] = 0; \
|
||||
gBgSprites_Unknown2[(index)][1] = 0; \
|
||||
gBgSprites_Unknown2[(index)][2] = 255; \
|
||||
gBgSprites_Unknown2[(index)][3] = 32; \
|
||||
});
|
||||
|
||||
#define INIT_BG_SPRITES_LAYER_64(index) \
|
||||
({ \
|
||||
gBgSprites_Unknown1[(index)] = 0; \
|
||||
gBgSprites_Unknown2[(index)][0] = 0; \
|
||||
gBgSprites_Unknown2[(index)][1] = 0; \
|
||||
gBgSprites_Unknown2[(index)][2] = 255; \
|
||||
gBgSprites_Unknown2[(index)][3] = 64; \
|
||||
})
|
||||
|
||||
#define INIT_BG_SPRITES_LAYER_128(index) \
|
||||
({ \
|
||||
gBgSprites_Unknown1[(index)] = 0; \
|
||||
gBgSprites_Unknown2[(index)][0] = 0; \
|
||||
gBgSprites_Unknown2[(index)][1] = 0; \
|
||||
gBgSprites_Unknown2[(index)][2] = 255; \
|
||||
gBgSprites_Unknown2[(index)][3] = 128; \
|
||||
})
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ struct GraphicsData graphics;
|
||||
|
||||
// 'tilesVram' points to tile-index array in VRAM, telling the GBA which tiles to
|
||||
// draw on this BG
|
||||
//
|
||||
// (!!! Data likely different depending on type of Background (Affine vs. Text). !!!)
|
||||
//
|
||||
// Data-Structure (16 bits): MSB > PPPPYXTTTTTTTTTT < LSB
|
||||
// P = Palette Index
|
||||
// Y = Y-Flip
|
||||
// X = X-Flip
|
||||
// T = Tile-Index
|
||||
//
|
||||
// NOTE: It does NOT point to the tileset!
|
||||
/* 0x0C */ u16 *layoutVram;
|
||||
|
||||
// Stage-Map: Metatiles
|
||||
// Common Tilemaps: Tilemap-Tiles
|
||||
/* 0x10 */ const u16 *layout;
|
||||
|
||||
// Tile-count on each axis
|
||||
// - Stage maps: should be 12 (# per metatile)
|
||||
// - Common Tilemaps: should be .targetTilesX/Y
|
||||
/* 0x14 */ u16 xTiles;
|
||||
/* 0x16 */ u16 yTiles;
|
||||
|
||||
/* 0x18 */ u16 unk18;
|
||||
/* 0x1A */ u16 unk1A;
|
||||
/* 0x1C */ u16 tilemapId;
|
||||
/* 0x1E */ u16 unk1E;
|
||||
|
||||
/* 0x20 */ u16 unk20;
|
||||
/* 0x22 */ u16 unk22;
|
||||
/* 0x24 */ u16 unk24;
|
||||
|
||||
/* Tile-Dimensions for the rendering target */
|
||||
/* - Stage maps: DISPLAY_WIDTH/_HEIGHT + 1*TILE_WIDTH */
|
||||
/* - Common Tilemaps: full image dimensions */
|
||||
/* 0x26 */ u16 targetTilesX;
|
||||
/* 0x28 */ u16 targetTilesY;
|
||||
|
||||
/* 0x2A */ u8 paletteOffset;
|
||||
/* 0x2B */ u8 animFrameCounter;
|
||||
/* 0x2C */ u8 animDelayCounter;
|
||||
|
||||
/* 0x2E */ u16 flags;
|
||||
|
||||
// apparently NOT signed?
|
||||
/* 0x30 */ u16 scrollX;
|
||||
/* 0x32 */ u16 scrollY;
|
||||
/* 0x34 */ u16 prevScrollX;
|
||||
/* 0x36 */ u16 prevScrollY;
|
||||
|
||||
/* Only used by stage maps (they are encoded as Tilemaps) */
|
||||
/* 0x38 */ const MetatileIndexType *metatileMap;
|
||||
/* 0x3C */ u16 mapWidth;
|
||||
/* 0x3E */ u16 mapHeight;
|
||||
} Background; /* size = 0x40 */
|
||||
|
||||
typedef struct {
|
||||
#if (ENGINE >= ENGINE_3)
|
||||
// In SA3 flip-bits are integrated into the oamIndex.
|
||||
// X-Flip: Bit 14
|
||||
// Y-Flip: Bit 15
|
||||
/* 0x00 */ u16 oamIndex;
|
||||
#else
|
||||
/* 0x00 */ u8 flip;
|
||||
|
||||
// every animation has an associated oamData pointer, oamIndex starts at
|
||||
// 0 for every new animation and ends at variantCount-1
|
||||
/* 0x01 */ u8 oamIndex;
|
||||
#endif
|
||||
|
||||
// some sprite frames consist of multiple images (of the same size
|
||||
// as GBA's Object Attribute Memory, e.g. 8x8, 8x32, 32x64, ...)
|
||||
/* 0x02 */ u16 numSubframes;
|
||||
|
||||
// In pixels
|
||||
/* 0x04 */ u16 width;
|
||||
// In pixels
|
||||
/* 0x06 */ u16 height;
|
||||
|
||||
/* 0x08 */ s16 offsetX;
|
||||
/* 0x0A */ s16 offsetY;
|
||||
} SpriteOffset;
|
||||
|
||||
// TODO: Verify "(in)active" name
|
||||
#define HITBOX_STATE_INACTIVE -1
|
||||
#define HITBOX_IS_ACTIVE(hb) ((hb).index != HITBOX_STATE_INACTIVE)
|
||||
|
||||
typedef struct {
|
||||
// index: -1 on init; lower 4 bits = index (in anim-cmds)
|
||||
/* 0x00 */ s32 index;
|
||||
/* 0x04 */ Rect8 b;
|
||||
} Hitbox;
|
||||
|
||||
#define SPRITE_ANIM_SPEED(speed) ((int)((float)(speed)*0x10))
|
||||
#define SPRITE_OAM_ORDER(index) ((index) << 6)
|
||||
#define GET_SPRITE_OAM_ORDER(s) ((((s)->oamFlags) & 0x7C0) >> 6)
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ struct GraphicsData graphics;
|
||||
/* 0x0C */ const SpriteOffset *dimensions;
|
||||
|
||||
// Bitfield description from KATAM decomp
|
||||
/* 0x10 */ u32 frameFlags; // bit 0-4: affine-index / rotscale param selection
|
||||
// bit 5: rotscale enable
|
||||
// bit 6: rotscale double-size
|
||||
// bit 7-8: obj mode
|
||||
// bit 9
|
||||
// bit 10 X-Flip
|
||||
// bit 11 Y-Flip
|
||||
// bit 12-13: priority
|
||||
// bit 14
|
||||
// bit 15-16: Background ID
|
||||
// bit 17
|
||||
// bit 18
|
||||
// bit 19-25(?)
|
||||
// bit 26
|
||||
// bit 27-29(?)
|
||||
// bit 30
|
||||
// bit 31
|
||||
|
||||
/* 0x14 */ u16 animCursor;
|
||||
|
||||
/* 0x16 */ s16 x;
|
||||
/* 0x18 */ s16 y;
|
||||
|
||||
/* 0x1A */ u16 oamFlags; // bit 6-10: OAM order index
|
||||
|
||||
/* 0x1C */ s16 qAnimDelay; // Q_8_8, in frames
|
||||
/* 0x1E */ u16 prevAnim;
|
||||
/* 0x20 */ u8 variant;
|
||||
/* 0x21 */ u8 prevVariant;
|
||||
|
||||
// 0x08 = 0.5x, 0x10 = 1.0x, 0x20 = 2.0x ...
|
||||
/* 0x22 */ u8 animSpeed;
|
||||
|
||||
/* 0x23 */ u8 oamBaseIndex;
|
||||
/* 0x24 */ u8 numSubFrames;
|
||||
/* 0x25 */ u8 palId;
|
||||
/* 0x28 */ Hitbox hitboxes[1];
|
||||
} Sprite /* size = 0x30 */;
|
||||
|
||||
// TODO: Unify Sprite with variable hitbox count through a macro
|
||||
typedef struct {
|
||||
Sprite s;
|
||||
Hitbox hb1;
|
||||
} Sprite2;
|
||||
|
||||
// TODO: Unify Sprite with variable hitbox count through a macro
|
||||
typedef struct {
|
||||
Sprite s;
|
||||
Hitbox hb1;
|
||||
Hitbox hb2;
|
||||
} Sprite3;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 rotation;
|
||||
/* 0x02 */ s16 qScaleX;
|
||||
/* 0x04 */ s16 qScaleY;
|
||||
/* 0x06 */ s16 x;
|
||||
/* 0x08 */ s16 y;
|
||||
} SpriteTransform; /* size 0xA */
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 unk0[4];
|
||||
/* 0x08 */ s16 qDirX;
|
||||
@@ -286,19 +69,9 @@ typedef struct {
|
||||
|
||||
extern const u8 gOamShapesSizes[12][2];
|
||||
|
||||
typedef enum {
|
||||
ACMD_RESULT__ANIM_CHANGED = -1,
|
||||
ACMD_RESULT__ENDED = 0,
|
||||
ACMD_RESULT__RUNNING = +1,
|
||||
} AnimCmdResult;
|
||||
|
||||
AnimCmdResult UpdateSpriteAnimation(Sprite *);
|
||||
|
||||
void DisplaySprite(Sprite *);
|
||||
void DrawBackground(Background *);
|
||||
bool32 SA2_LABEL(sub_8002B20)(void);
|
||||
bool32 SA2_LABEL(sub_80039E4)(void);
|
||||
bool32 SA2_LABEL(sub_8004010)(void);
|
||||
void ProcessOamBuffers(void);
|
||||
OamData *OamMalloc(u8 order);
|
||||
|
||||
@@ -306,17 +79,11 @@ void TransformSprite(Sprite *, SpriteTransform *);
|
||||
// NOTE: Not actually unused in SA1. TODO: Align name with SA2!
|
||||
void UnusedTransform(Sprite *, SpriteTransform *);
|
||||
void SA2_LABEL(sub_8004E14)(Sprite *, SpriteTransform *);
|
||||
|
||||
void SA2_LABEL(sub_8003EE4)(u16 p0, s16 p1, s16 p2, s16 p3, s16 p4, s16 p5, s16 p6, BgAffineReg *affine);
|
||||
void SA2_LABEL(sub_8006228)(u8 p0, u8 p1, u8 p2, u8 p3, u8 p4, u8 p5);
|
||||
void SA2_LABEL(sub_80064A8)(u8 p0, u8 p1, u8 p2, u8 p3, u8 p4, u8 p5);
|
||||
|
||||
s32 UpdateSpriteAnimation_BG(Sprite *);
|
||||
void DisplaySprite_BG(Sprite *);
|
||||
void SA2_LABEL(sub_80047A0)(u16 angle, s16 p1, s16 p2, u16 affineIndex);
|
||||
|
||||
s16 SA2_LABEL(sub_8004418)(s16 x, s16 y);
|
||||
void numToASCII(u8 digits[5], u16 number);
|
||||
u32 Base10DigitsToHexNibbles(u16 num);
|
||||
|
||||
#if ((GAME == GAME_SA1) || (GAME == GAME_SA2))
|
||||
#define GET_SPRITE_ANIM(s) ((s)->graphics.anim)
|
||||
|
||||
@@ -210,38 +210,6 @@ struct SongHeader
|
||||
u8 *part[1];
|
||||
};
|
||||
|
||||
struct PokemonCrySong
|
||||
{
|
||||
u8 trackCount;
|
||||
u8 blockCount;
|
||||
u8 priority;
|
||||
u8 reverb;
|
||||
struct ToneData *tone;
|
||||
u8 *part[2];
|
||||
u8 gap;
|
||||
u8 part0; // 0x11
|
||||
u8 tuneValue; // 0x12
|
||||
u8 gotoCmd; // 0x13
|
||||
u32 gotoTarget; // 0x14
|
||||
u8 part1; // 0x18
|
||||
u8 tuneValue2; // 0x19
|
||||
u8 cont[2]; // 0x1A
|
||||
u8 volCmd; // 0x1C
|
||||
u8 volumeValue; // 0x1D
|
||||
u8 unkCmd0D[2]; // 0x1E
|
||||
u32 unkCmd0DParam; // 0x20
|
||||
u8 xreleCmd[2]; // 0x24
|
||||
u8 releaseValue; // 0x26
|
||||
u8 panCmd;
|
||||
u8 panValue; // 0x28
|
||||
u8 tieCmd; // 0x29
|
||||
u8 tieKeyValue; // 0x2A
|
||||
u8 tieVelocityValue; // 0x2B
|
||||
u8 unkCmd0C[2]; // 0x2C
|
||||
u16 unkCmd0CParam; // 0x2E
|
||||
u8 end[2]; // 0x30
|
||||
};
|
||||
|
||||
#define MPT_FLG_VOLSET 0x01
|
||||
#define MPT_FLG_VOLCHG 0x03
|
||||
#define MPT_FLG_PITSET 0x04
|
||||
|
||||
Vendored
+3
-3
@@ -6,7 +6,7 @@ address = int(sys.argv[1], 16)
|
||||
length = int(sys.argv[2], 16)
|
||||
|
||||
graphics_data_reference = """
|
||||
struct GraphicsData {
|
||||
GraphicsData {
|
||||
void *src;
|
||||
void *dest;
|
||||
u16 size;
|
||||
@@ -16,7 +16,7 @@ struct GraphicsData {
|
||||
|
||||
background_reference = """
|
||||
typedef struct {
|
||||
struct GraphicsData graphics;
|
||||
GraphicsData graphics;
|
||||
|
||||
// 'tilesVram' points to tile-index array in VRAM, telling the GBA which tiles to
|
||||
// draw on this BG
|
||||
@@ -117,7 +117,7 @@ references = {
|
||||
"s8": (1, read_s8),
|
||||
"s16": (2, read_s16),
|
||||
"s32": (4, read_s32),
|
||||
"struct GraphicsData": (4, read_graphics_data),
|
||||
"GraphicsData": (4, read_graphics_data),
|
||||
}
|
||||
|
||||
for line in graphics_data_reference.split("\n")[2:]:
|
||||
|
||||
+3
-3
@@ -2,12 +2,12 @@
|
||||
#include "core.h"
|
||||
#include "flags.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "trig.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "platform/platform.h"
|
||||
|
||||
#include "animation_commands.h"
|
||||
|
||||
static AnimCmdResult animCmd_GetTiles_BG(void *, Sprite *);
|
||||
static AnimCmdResult animCmd_GetPalette_BG(void *, Sprite *);
|
||||
static AnimCmdResult animCmd_JumpBack_BG(void *, Sprite *);
|
||||
@@ -748,7 +748,7 @@ s32 UpdateSpriteAnimation_BG(Sprite *s)
|
||||
{
|
||||
s32 frame = ((ACmd_ShowFrame *)cmd)->index;
|
||||
if (frame != -1) {
|
||||
const struct SpriteTables *sprTables = gRefSpriteTables;
|
||||
const SpriteTables *sprTables = gRefSpriteTables;
|
||||
|
||||
s->dimensions = &sprTables->dimensions[s->graphics.anim][frame];
|
||||
} else {
|
||||
|
||||
+9
-8
@@ -4,6 +4,7 @@
|
||||
#include "malloc_vram.h"
|
||||
#include "multi_sio.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
#include "flags.h"
|
||||
#include "input_recorder.h"
|
||||
@@ -35,7 +36,7 @@ union MultiSioData gMultiSioRecv[4] = {};
|
||||
u32 gUnknown_03002BF0 = 0;
|
||||
#endif
|
||||
u8 gNumHBlankIntrs = 0;
|
||||
struct BlendRegs gBldRegs ALIGNED(8) = {};
|
||||
BlendRegs gBldRegs ALIGNED(8) = {};
|
||||
u8 gOamFreeIndex = 0;
|
||||
Task gEmptyTask ALIGNED(16) = {};
|
||||
|
||||
@@ -75,9 +76,9 @@ u16 gRepeatedKeys ALIGNED(4) = 0;
|
||||
Task *gNextTask = NULL;
|
||||
#if ((ENGINE == ENGINE_1) || (ENGINE == ENGINE_2))
|
||||
// Only here in SA3
|
||||
// struct GraphicsData *gVramGraphicsCopyQueue[];
|
||||
// GraphicsData *gVramGraphicsCopyQueue[];
|
||||
#else
|
||||
struct GraphicsData gVramGraphicsCopyQueue[] = {};
|
||||
GraphicsData gVramGraphicsCopyQueue[] = {};
|
||||
#endif
|
||||
#if (ENGINE == ENGINE_2)
|
||||
void *gBgOffsetsSecondary = NULL;
|
||||
@@ -97,18 +98,18 @@ u8 gKeysFirstRepeatIntervals[10] ALIGNED(16) = {};
|
||||
u16 gReleasedKeys ALIGNED(4) = 0;
|
||||
u8 gOamMallocCopiedOrder[] ALIGNED(16) = {};
|
||||
u32 gFlagsPreVBlank = 0;
|
||||
/* 0x03002794 */ const struct SpriteTables *gRefSpriteTables = NULL;
|
||||
/* 0x03002794 */ const SpriteTables *gRefSpriteTables = NULL;
|
||||
|
||||
#if PORTABLE
|
||||
// TODO: Once SA3 works in PORTABLE, it can just use
|
||||
// the regular gVramGraphicsCopyQueue[].
|
||||
struct GraphicsData gVramGraphicsCopyQueueBuffer[] = {};
|
||||
GraphicsData gVramGraphicsCopyQueueBuffer[] = {};
|
||||
#endif // PORTABLE
|
||||
#if ((ENGINE == ENGINE_1) || (ENGINE == ENGINE_2))
|
||||
struct GraphicsData *gVramGraphicsCopyQueue[] ALIGNED(16) = {};
|
||||
GraphicsData *gVramGraphicsCopyQueue[] ALIGNED(16) = {};
|
||||
#else
|
||||
// NOT here in SA3
|
||||
// struct GraphicsData gVramGraphicsCopyQueue[32] = {};
|
||||
// GraphicsData gVramGraphicsCopyQueue[32] = {};
|
||||
#endif
|
||||
|
||||
#if (ENGINE == ENGINE_3)
|
||||
@@ -909,7 +910,7 @@ bool32 ProcessVramGraphicsCopyQueue(void)
|
||||
#ifndef NON_MATCHING
|
||||
struct GraphicsData_Hack *graphics;
|
||||
#else
|
||||
struct GraphicsData *graphics;
|
||||
GraphicsData *graphics;
|
||||
#endif
|
||||
|
||||
while (gVramGraphicsCopyCursor != gVramGraphicsCopyQueueIndex) {
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
extern const u8 gObjTiles_4bpp[];
|
||||
extern const u8 gObjTiles_8bpp[];
|
||||
|
||||
const struct SpriteTables gSpriteTables = { (const void *)gAnimations, gSpriteDimensions, (const u16 **const)gSpriteOamData,
|
||||
(const ColorRaw *)gSpritePalettes, gObjTiles_4bpp, gObjTiles_8bpp };
|
||||
const SpriteTables gSpriteTables = { (const void *)gAnimations, gSpriteDimensions, (const u16 **const)gSpriteOamData,
|
||||
(const ColorRaw *)gSpritePalettes, gObjTiles_4bpp, gObjTiles_8bpp };
|
||||
@@ -3,7 +3,7 @@
|
||||
extern const u8 gObjTiles_4bpp[];
|
||||
extern const u8 gObjTiles_8bpp[];
|
||||
|
||||
const struct SpriteTables gSpriteTables = {
|
||||
const SpriteTables gSpriteTables = {
|
||||
gAnimations,
|
||||
gSpriteDimensions,
|
||||
(const u16**const)gSpriteOamData,
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "core.h"
|
||||
#include "flags.h"
|
||||
#include "multi_boot.h"
|
||||
#include "background.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/shared/multiplayer/communication_outcome.h"
|
||||
#include "game/sa1/menus/mp_mode_select.h"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "data/sa1/ui_graphics.h"
|
||||
#include "game/sa1/ui/game_over.h"
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "trig.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "bg_triangles.h"
|
||||
#include "background.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa1/ui/character_select.h"
|
||||
#include "game/shared/stage/entity.h"
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include "flags.h"
|
||||
#include "bg_triangles.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "background.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "data/sa1/ui_graphics.h"
|
||||
#include "game/sa1/stage/ui_rendering.h"
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "core.h"
|
||||
#include "trig.h"
|
||||
#include "malloc_ewram.h"
|
||||
#include "background.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "lib/m4a/m4a_internal.h" // for MP2KSongHeader
|
||||
#include "game/globals.h"
|
||||
@@ -1565,7 +1567,7 @@ void sub_802B214(void)
|
||||
strc74->unk52 = 0;
|
||||
strc74->unk54 = 0;
|
||||
strc74->unk56 = 0;
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
strc74->unk58 = rnd & 0xF;
|
||||
strc74->unk5A = -((0x70 & rnd) >> 4);
|
||||
strc74->unk5C = -0x10;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "animation_commands_bg.h"
|
||||
#include "game/globals.h"
|
||||
#include "game/shared/stage/camera.h"
|
||||
#include "game/sa1/stage/backgrounds/zone_5.h"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "flags.h"
|
||||
#include "animation_commands_bg.h"
|
||||
#include "game/globals.h"
|
||||
#include "game/shared/stage/camera.h"
|
||||
#include "game/sa1/stage/backgrounds/zone_5.h"
|
||||
|
||||
@@ -204,14 +204,14 @@ void StageBgUpdate_Zone3Acts12(s32 x, s32 y)
|
||||
}
|
||||
}
|
||||
|
||||
if (((gStageTime % 4u) == 0) && ((PseudoRandom32() & 0x700) == 0)) {
|
||||
if (((gStageTime % 4u) == 0) && ((PSEUDO_RANDOM_32() & 0x700) == 0)) {
|
||||
// Spawn Firework, at random location in the sky, randomly big or small.
|
||||
Task *t;
|
||||
CasinoParadiseFirework *firework;
|
||||
Sprite *s;
|
||||
s32 randX = (((u32)PseudoRandom32() & 0xFF00) >> 8) - 8; // 0 - +256 ---> -8 - +248
|
||||
s32 randY = (((u32)PseudoRandom32() & 0x7F00) >> 8) - (BG_LINE_WATER_END - BG_LINE_SKY_END);
|
||||
u8 fireworkType = (((u32)PseudoRandom32() & 0x0100) >> 8);
|
||||
s32 randX = (((u32)PSEUDO_RANDOM_32() & 0xFF00) >> 8) - 8; // 0 - +256 ---> -8 - +248
|
||||
s32 randY = (((u32)PSEUDO_RANDOM_32() & 0x7F00) >> 8) - (BG_LINE_WATER_END - BG_LINE_SKY_END);
|
||||
u8 fireworkType = (((u32)PSEUDO_RANDOM_32() & 0x0100) >> 8);
|
||||
const TileInfoFirework *tileInfo = &gTileInfoZone3Fireworks[fireworkType];
|
||||
|
||||
t = CreateMultiplayerSpriteTask(randX, randY, 0, 0, Task_UpdateFireworkAnimation, TaskDestructor_MultiplayerSpriteTask);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "animation_commands_bg.h"
|
||||
#include "game/globals.h"
|
||||
#include "game/shared/stage/camera.h"
|
||||
#include "game/shared/stage/water_effects.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "animation_commands_bg.h"
|
||||
#include "game/globals.h"
|
||||
#include "game/shared/stage/camera.h"
|
||||
#include "game/sa1/stage/backgrounds/zone_5.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "animation_commands_bg.h"
|
||||
#include "game/globals.h"
|
||||
#include "game/shared/stage/camera.h"
|
||||
#include "game/sa1/stage/backgrounds/zone_5.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "animation_commands_bg.h"
|
||||
#include "game/globals.h"
|
||||
#include "game/shared/stage/camera.h"
|
||||
#include "game/sa1/stage/backgrounds/zone_5.h"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include "core.h"
|
||||
#include "flags.h"
|
||||
#include "bg_triangles.h"
|
||||
#include "animation_commands_bg.h"
|
||||
#include "game/globals.h"
|
||||
#include "game/shared/stage/camera.h"
|
||||
#include "game/sa1/stage/backgrounds/zone_6.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "animation_commands_bg.h"
|
||||
#include "game/globals.h"
|
||||
#include "game/shared/stage/camera.h"
|
||||
#include "game/sa1/stage/backgrounds/zone_5.h"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "flags.h"
|
||||
#include "animation_commands_bg.h"
|
||||
#include "game/globals.h"
|
||||
#include "game/shared/stage/camera.h"
|
||||
#include "game/sa1/stage/backgrounds/zone_5.h"
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "flags.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "bg_triangles.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "game/sa1/stage/nuts_and_bolts_task.h"
|
||||
#include "game/globals.h"
|
||||
#include "game/shared/stage/camera.h"
|
||||
@@ -64,14 +66,14 @@ NONMATCH("asm/non_matching/game/sa1/egg_rocket_trans__Task_8028CE4.inc", void Ta
|
||||
CamCoord prevCamX = gCamera.x, prevCamY = gCamera.y - 32;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
s32 index = PseudoRandom32() % 8u;
|
||||
s32 index = PSEUDO_RANDOM_32() % 8u;
|
||||
s32 index2;
|
||||
|
||||
t = CreateNutsAndBoltsTask(0x2000, VramMalloc(gUnknown_080BB434[index]), gUnknown_080BB41C[index], gUnknown_080BB42C[index],
|
||||
TaskDestructor_NutsAndBolts);
|
||||
nuts = TASK_DATA(t);
|
||||
|
||||
nuts->qUnk30 = Q(prevCamX + (PseudoRandom32() & 0xFF));
|
||||
nuts->qUnk30 = Q(prevCamX + (PSEUDO_RANDOM_32() & 0xFF));
|
||||
nuts->qUnk34 = Q(prevCamY);
|
||||
|
||||
nuts->s.frameFlags = 0x3000;
|
||||
@@ -79,7 +81,7 @@ NONMATCH("asm/non_matching/game/sa1/egg_rocket_trans__Task_8028CE4.inc", void Ta
|
||||
nuts->qUnk3E = Q(40. / 256.);
|
||||
nuts->qUnk40 = Q(1);
|
||||
|
||||
index2 = PseudoRandom32() & 0x1FF;
|
||||
index2 = PSEUDO_RANDOM_32() & 0x1FF;
|
||||
nuts->qUnk3A = (SIN(index2) >> 6);
|
||||
|
||||
nuts->qUnk3A = ABS(nuts->qUnk3A);
|
||||
@@ -88,14 +90,14 @@ NONMATCH("asm/non_matching/game/sa1/egg_rocket_trans__Task_8028CE4.inc", void Ta
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
s32 index = PseudoRandom32() % 8u;
|
||||
s32 index = PSEUDO_RANDOM_32() % 8u;
|
||||
s32 index2;
|
||||
|
||||
t = CreateNutsAndBoltsTask(0x2000, VramMalloc(gUnknown_080BB434[index]), gUnknown_080BB41C[index], gUnknown_080BB42C[index],
|
||||
TaskDestructor_NutsAndBolts);
|
||||
nuts = TASK_DATA(t);
|
||||
|
||||
nuts->qUnk30 = Q(prevCamX + (PseudoRandom32() % 256u));
|
||||
nuts->qUnk30 = Q(prevCamX + (PSEUDO_RANDOM_32() % 256u));
|
||||
nuts->qUnk34 = Q(prevCamY);
|
||||
|
||||
nuts->s.frameFlags = 0x0000;
|
||||
@@ -103,7 +105,7 @@ NONMATCH("asm/non_matching/game/sa1/egg_rocket_trans__Task_8028CE4.inc", void Ta
|
||||
nuts->qUnk3E = Q(40. / 256.);
|
||||
nuts->qUnk40 = Q(1);
|
||||
|
||||
index2 = (PseudoRandom32() % 512u);
|
||||
index2 = (PSEUDO_RANDOM_32() % 512u);
|
||||
nuts->qUnk3A = (SIN(index2) >> 5);
|
||||
nuts->qUnk3A = ABS(nuts->qUnk3A);
|
||||
|
||||
@@ -226,7 +228,7 @@ NONMATCH("asm/non_matching/game/sa1/egg_rocket_trans__Task_8029194.inc", void Ta
|
||||
nuts->qUnk3E = Q(40. / 256.);
|
||||
nuts->qUnk40 = Q(1);
|
||||
|
||||
index2 = PseudoRandom32() & 0x1FF;
|
||||
index2 = PSEUDO_RANDOM_32() & 0x1FF;
|
||||
nuts->qUnk3A = (SIN(index2) >> 6);
|
||||
|
||||
nuts->qUnk3A = ABS(nuts->qUnk3A);
|
||||
@@ -306,7 +308,7 @@ NONMATCH("asm/non_matching/game/sa1/egg_rocket_trans__Task_80294A8.inc", void Ta
|
||||
TaskDestructor_NutsAndBolts);
|
||||
nuts = TASK_DATA(t);
|
||||
|
||||
nuts->qUnk30 = Q(prevCamX + (PseudoRandom32() & 0xFF));
|
||||
nuts->qUnk30 = Q(prevCamX + (PSEUDO_RANDOM_32() & 0xFF));
|
||||
nuts->qUnk34 = Q(prevCamY);
|
||||
|
||||
nuts->s.frameFlags = 0x3000;
|
||||
@@ -314,7 +316,7 @@ NONMATCH("asm/non_matching/game/sa1/egg_rocket_trans__Task_80294A8.inc", void Ta
|
||||
nuts->qUnk3E = Q(40. / 256.);
|
||||
nuts->qUnk40 = Q(1);
|
||||
|
||||
index2 = PseudoRandom32() & 0x1FF;
|
||||
index2 = PSEUDO_RANDOM_32() & 0x1FF;
|
||||
nuts->qUnk3A = (SIN(index2) >> 6);
|
||||
|
||||
nuts->qUnk3A = ABS(nuts->qUnk3A);
|
||||
|
||||
@@ -832,7 +832,7 @@ void Task_8026C44(void)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
Sprite *sprBolts;
|
||||
s32 rndIndex = PseudoRandom32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndIndex = PSEUDO_RANDOM_32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndTheta;
|
||||
s32 a0, a1;
|
||||
s32 rnd;
|
||||
@@ -846,11 +846,11 @@ void Task_8026C44(void)
|
||||
sprBolts->oamFlags = 0x440;
|
||||
bolts->qUnk3E = Q(40. / 256.);
|
||||
bolts->qUnk40 = Q(32. / 256.);
|
||||
rndTheta = PseudoRandom32();
|
||||
rndTheta = PSEUDO_RANDOM_32();
|
||||
bolts->qUnk3A = (-(SIN(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
bolts->qUnk38 = (-(COS(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
a0 = Q((worldX + (0x3F & rnd)) - 0x20);
|
||||
a1 = (((rnd & 0x3F0000) >> 0x10));
|
||||
a1 += 32;
|
||||
@@ -906,7 +906,7 @@ void Task_8026ED0(void)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
Sprite *sprBolts;
|
||||
s32 rndIndex = PseudoRandom32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndIndex = PSEUDO_RANDOM_32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndTheta;
|
||||
s32 a0, a1;
|
||||
s32 rnd;
|
||||
@@ -920,11 +920,11 @@ void Task_8026ED0(void)
|
||||
sprBolts->oamFlags = 0x440;
|
||||
bolts->qUnk3E = Q(40. / 256.);
|
||||
bolts->qUnk40 = Q(32. / 256.);
|
||||
rndTheta = PseudoRandom32();
|
||||
rndTheta = PSEUDO_RANDOM_32();
|
||||
bolts->qUnk3A = (-(SIN(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
bolts->qUnk38 = (-(COS(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
a0 = Q((worldX + (0x3F & rnd)) - 0x20);
|
||||
a1 = (((rnd & 0x3F0000) >> 0x10));
|
||||
a1 += 32;
|
||||
|
||||
@@ -747,7 +747,7 @@ void Task_802EA8C(void)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
Sprite *sprBolts;
|
||||
s32 rndIndex = PseudoRandom32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndIndex = PSEUDO_RANDOM_32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndTheta;
|
||||
s32 a0, a1;
|
||||
s32 rnd;
|
||||
@@ -761,11 +761,11 @@ void Task_802EA8C(void)
|
||||
sprBolts->oamFlags = SPRITE_OAM_ORDER(17);
|
||||
bolts->qUnk3E = Q(40. / 256.);
|
||||
bolts->qUnk40 = Q(32. / 256.);
|
||||
rndTheta = PseudoRandom32();
|
||||
rndTheta = PSEUDO_RANDOM_32();
|
||||
bolts->qUnk3A = (-(SIN(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
bolts->qUnk38 = (-(COS(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
sub_8017540(Q((worldX + (0x3F & rnd)) - 32), Q(worldY - ((rnd & 0x3F0000) >> 0x10)));
|
||||
}
|
||||
|
||||
@@ -801,7 +801,7 @@ void sub_802ECFC(void)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
Sprite *sprBolts;
|
||||
s32 rndIndex = PseudoRandom32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndIndex = PSEUDO_RANDOM_32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndTheta;
|
||||
s32 a0, a1;
|
||||
s32 rnd;
|
||||
@@ -815,11 +815,11 @@ void sub_802ECFC(void)
|
||||
sprBolts->oamFlags = SPRITE_OAM_ORDER(17);
|
||||
bolts->qUnk3E = Q(40. / 256.);
|
||||
bolts->qUnk40 = Q(32. / 256.);
|
||||
rndTheta = PseudoRandom32();
|
||||
rndTheta = PSEUDO_RANDOM_32();
|
||||
bolts->qUnk3A = (-(SIN(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
bolts->qUnk38 = (-(COS(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
sub_8017540(Q((worldX + (0x3F & rnd)) - 32), Q(worldY - ((rnd & 0x3F0000) >> 0x10)));
|
||||
}
|
||||
|
||||
|
||||
@@ -497,7 +497,7 @@ void Task_802F804(void)
|
||||
if (--boss->unk88 == 0) {
|
||||
EggBall_44 *strc = TASK_DATA(boss->strc6C);
|
||||
s32 a;
|
||||
s32 unk8E = PseudoRandom32() & 0x7;
|
||||
s32 unk8E = PSEUDO_RANDOM_32() & 0x7;
|
||||
boss->unk8E = unk8E;
|
||||
a = gUnknown_084ACEA4[unk8E][0];
|
||||
boss->qUnk70 = gUnknown_084ACE24[a][0];
|
||||
@@ -645,7 +645,7 @@ void Task_802FC14(void)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
Sprite *sprBolts;
|
||||
s32 rndIndex = PseudoRandom32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndIndex = PSEUDO_RANDOM_32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndTheta;
|
||||
s32 a0, a1;
|
||||
s32 rnd;
|
||||
@@ -659,11 +659,11 @@ void Task_802FC14(void)
|
||||
sprBolts->oamFlags = SPRITE_OAM_ORDER(17);
|
||||
bolts->qUnk3E = Q(40. / 256.);
|
||||
bolts->qUnk40 = Q(32. / 256.);
|
||||
rndTheta = PseudoRandom32();
|
||||
rndTheta = PSEUDO_RANDOM_32();
|
||||
bolts->qUnk3A = (-(SIN(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
bolts->qUnk38 = (-(COS(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
sub_8017540(Q((worldX + (0x3F & rnd)) - 32), Q(worldY + 32 - ((rnd & 0x3F0000) >> 0x10)));
|
||||
}
|
||||
|
||||
@@ -716,7 +716,7 @@ void Task_802FE88(void)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
Sprite *sprBolts;
|
||||
s32 rndIndex = PseudoRandom32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndIndex = PSEUDO_RANDOM_32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndTheta;
|
||||
s32 a0, a1;
|
||||
s32 rnd;
|
||||
@@ -730,11 +730,11 @@ void Task_802FE88(void)
|
||||
sprBolts->oamFlags = SPRITE_OAM_ORDER(17);
|
||||
bolts->qUnk3E = Q(40. / 256.);
|
||||
bolts->qUnk40 = Q(32. / 256.);
|
||||
rndTheta = PseudoRandom32();
|
||||
rndTheta = PSEUDO_RANDOM_32();
|
||||
bolts->qUnk3A = (-(SIN(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
bolts->qUnk38 = (-(COS(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
sub_8017540(Q((worldX + (0x3F & rnd)) - 32), Q(worldY + 32 - ((rnd & 0x3F0000) >> 0x10)));
|
||||
}
|
||||
|
||||
@@ -871,7 +871,7 @@ void Task_8030414(void)
|
||||
}
|
||||
|
||||
if ((boss_44->unk40 & 0x7) == 0) {
|
||||
s32 rnd = PseudoRandom32();
|
||||
s32 rnd = PSEUDO_RANDOM_32();
|
||||
sub_8017540(Q((worldX + (0x3F & rnd)) - 32), Q(worldY + 32 - ((rnd & 0x3F0000) >> 0x10)));
|
||||
}
|
||||
|
||||
|
||||
@@ -395,7 +395,7 @@ void sub_8030EE4()
|
||||
return;
|
||||
}
|
||||
s->variant = 0;
|
||||
temp_r0_7 = (u32)PseudoRandom32() % 9U;
|
||||
temp_r0_7 = (u32)PSEUDO_RANDOM_32() % 9U;
|
||||
boss->unk80 = Q(gUnknown_084ACEC6[temp_r0_7]);
|
||||
if (boss->qUnk6C == boss->unk80) {
|
||||
boss->unk80 = Q(gUnknown_084ACEC6[((temp_r0_7 + 5) % 9)]);
|
||||
@@ -590,7 +590,7 @@ void Task_8031480(void)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
Sprite *sprBolts;
|
||||
s32 rndIndex = PseudoRandom32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndIndex = PSEUDO_RANDOM_32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndTheta;
|
||||
s32 a0, a1;
|
||||
s32 rnd;
|
||||
@@ -604,11 +604,11 @@ void Task_8031480(void)
|
||||
sprBolts->oamFlags = SPRITE_OAM_ORDER(17);
|
||||
bolts->qUnk3E = Q(5. / 256.);
|
||||
bolts->qUnk40 = Q(32. / 256.);
|
||||
rndTheta = PseudoRandom32();
|
||||
rndTheta = PSEUDO_RANDOM_32();
|
||||
bolts->qUnk3A = (-(SIN(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
bolts->qUnk38 = (-(COS(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
sub_8017540(Q((worldX + (0x3F & rnd)) - 32), Q(worldY + 32 - ((rnd & 0x3F0000) >> 0x10)));
|
||||
}
|
||||
|
||||
@@ -652,7 +652,7 @@ void sub_803170C(void)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
Sprite *sprBolts;
|
||||
s32 rndIndex = PseudoRandom32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndIndex = PSEUDO_RANDOM_32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndTheta;
|
||||
s32 a0, a1;
|
||||
s32 rnd;
|
||||
@@ -666,11 +666,11 @@ void sub_803170C(void)
|
||||
sprBolts->oamFlags = SPRITE_OAM_ORDER(17);
|
||||
bolts->qUnk3E = Q(5. / 256.);
|
||||
bolts->qUnk40 = Q(32. / 256.);
|
||||
rndTheta = PseudoRandom32();
|
||||
rndTheta = PSEUDO_RANDOM_32();
|
||||
bolts->qUnk3A = (-(SIN(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
bolts->qUnk38 = (-(COS(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
sub_8017540(Q((worldX + (0x3F & rnd)) - 32), Q(worldY + 32 - ((rnd & 0x3F0000) >> 0x10)));
|
||||
}
|
||||
|
||||
@@ -711,14 +711,14 @@ NONMATCH("asm/non_matching/game/sa1/stage/enemies/boss_4__CreateIciclePlatform.i
|
||||
icicle->worldX = TO_WORLD_POS(boss->base.meX, boss->base.regionX);
|
||||
icicle->worldY = TO_WORLD_POS(me->y, boss->base.regionY);
|
||||
|
||||
r7 = ((u32)PseudoRandom32() >> 1);
|
||||
r7 = ((u32)PSEUDO_RANDOM_32() >> 1);
|
||||
r7 &= 0xF;
|
||||
icicle->unk4C = Q(-(((r7 << 2) + r7) << 2) - 10);
|
||||
icicle->unk50 = -Q(32);
|
||||
icicle->unk54 = 0;
|
||||
icicle->unk58 = 0xA;
|
||||
PseudoRandom32();
|
||||
icicle->unk58 = ((PseudoRandom32()) & 0xF) + 10;
|
||||
PSEUDO_RANDOM_32();
|
||||
icicle->unk58 = ((PSEUDO_RANDOM_32()) & 0xF) + 10;
|
||||
|
||||
s->x = 0;
|
||||
s->y = 0;
|
||||
|
||||
@@ -910,7 +910,7 @@ MechaKnucklesStates sub_804ED80(MechaKnuckles *boss, Player *p)
|
||||
diffX = temp_r1 - temp_r2;
|
||||
}
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
|
||||
if (boss->phase == MKPHASE_A) {
|
||||
if (diffX < 80) {
|
||||
@@ -953,8 +953,8 @@ bool32 sub_804EE20(MechaKnuckles *boss)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
|
||||
temp_r0 = (((u32)PseudoRandom32() & 0x1FFF00) >> 8) - 4096;
|
||||
temp_r3 = (((u32)PseudoRandom32() & 0x1FFF00) >> 8) - 4096;
|
||||
temp_r0 = (((u32)PSEUDO_RANDOM_32() & 0x1FFF00) >> 8) - 4096;
|
||||
temp_r3 = (((u32)PSEUDO_RANDOM_32() & 0x1FFF00) >> 8) - 4096;
|
||||
t = sub_8017540(boss->qUnk74 + Q(boss->spawnX) + temp_r0, boss->qUnk78 + Q(boss->spawnY) + temp_r3);
|
||||
|
||||
bolts = TASK_DATA(t);
|
||||
@@ -1100,7 +1100,7 @@ void CreateMechaKnucklesRocket(MechaKnuckles *boss)
|
||||
rocket->unkA = 0;
|
||||
rocket->unkC = 0x40;
|
||||
|
||||
if (PseudoRandom32() & 0x1000) {
|
||||
if (PSEUDO_RANDOM_32() & 0x1000) {
|
||||
rocket->unkC = 0x20;
|
||||
}
|
||||
|
||||
@@ -1217,7 +1217,7 @@ NONMATCH("asm/non_matching/game/sa1/stage/enemies/boss_5__Task_MechaKnucklesRock
|
||||
}
|
||||
screenX = I(qWorldX) - gCamera.x;
|
||||
screenY = I(qWorldY) - gCamera.y;
|
||||
temp_r2_2 = (PseudoRandom32() & 0x3FF) - Q(26);
|
||||
temp_r2_2 = (PSEUDO_RANDOM_32() & 0x3FF) - Q(26);
|
||||
|
||||
CreateBrakingDustEffect(I(qWorldX + Q_MUL(temp_r2_2, COS_24_8((var_r8 & 0xFF) * 4))),
|
||||
I(qWorldY + Q_MUL(temp_r2_2, SIN_24_8((var_r8 & 0xFF) * 4))));
|
||||
@@ -1273,17 +1273,17 @@ Task *CreateMechaKnucklesParts(MechaKnuckles *boss, s32 variant)
|
||||
s->frameFlags = 0x2000;
|
||||
parts->unk0 = Q(boss->spawnX) + boss->qUnk74;
|
||||
parts->unk4 = Q(boss->spawnY) + boss->qUnk78;
|
||||
val = (((u32)(PseudoRandom32() << 0xD) >> 0x15) - Q(4));
|
||||
val = (((u32)(PSEUDO_RANDOM_32() << 0xD) >> 0x15) - Q(4));
|
||||
parts->unk8 = val;
|
||||
{
|
||||
s32 val = -((u32)(PseudoRandom32() << 15) >> 23) - Q(2);
|
||||
s32 val = -((u32)(PSEUDO_RANDOM_32() << 15) >> 23) - Q(2);
|
||||
parts->unkA = val;
|
||||
}
|
||||
parts->unkC = 0;
|
||||
parts->unkE = (s16)(0x2A - ((u32)(0x1F00 & PseudoRandom32()) >> 8));
|
||||
parts->unkE = (s16)(0x2A - ((u32)(0x1F00 & PSEUDO_RANDOM_32()) >> 8));
|
||||
parts->unk10 = 0;
|
||||
parts->unk12 = ((u32)PseudoRandom32() >> 8);
|
||||
val = ((u32)(PseudoRandom32() << 0xC) >> 0x14) - Q(8);
|
||||
parts->unk12 = ((u32)PSEUDO_RANDOM_32() >> 8);
|
||||
val = ((u32)(PSEUDO_RANDOM_32() << 0xC) >> 0x14) - Q(8);
|
||||
parts->unk14 = val;
|
||||
s->graphics.size = 0;
|
||||
s->prevVariant = -1;
|
||||
|
||||
@@ -506,7 +506,7 @@ NONMATCH("asm/non_matching/game/sa1/stage/enemies/boss_6__Task_8032370.inc", voi
|
||||
s2->variant = 0;
|
||||
s->prevVariant = -1;
|
||||
boss->unkAA = 0;
|
||||
boss->unk98 = gUnknown_084ACF08[(PseudoRandom32() + gStageTime) & 3];
|
||||
boss->unk98 = gUnknown_084ACF08[(PSEUDO_RANDOM_32() + gStageTime) & 3];
|
||||
boss->unk9B = boss->unk9A;
|
||||
boss->unkA9++;
|
||||
break;
|
||||
@@ -703,7 +703,7 @@ void Task_8032AF8(void)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
Sprite *sprBolts;
|
||||
s32 rndIndex = PseudoRandom32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndIndex = PSEUDO_RANDOM_32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndTheta;
|
||||
s32 a0, a1;
|
||||
s32 rnd;
|
||||
@@ -717,11 +717,11 @@ void Task_8032AF8(void)
|
||||
sprBolts->oamFlags = SPRITE_OAM_ORDER(17);
|
||||
bolts->qUnk3E = Q(5. / 256.);
|
||||
bolts->qUnk40 = Q(32. / 256.);
|
||||
rndTheta = PseudoRandom32();
|
||||
rndTheta = PSEUDO_RANDOM_32();
|
||||
bolts->qUnk3A = (-(SIN(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
bolts->qUnk38 = (-(COS(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
sub_8017540(Q((worldX + (0x3F & rnd)) - 32), Q(worldY + 32 - ((rnd & 0x3F0000) >> 0x10)));
|
||||
}
|
||||
|
||||
|
||||
@@ -584,7 +584,7 @@ void sub_8034EE0(CamCoord worldX, CamCoord worldY)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
Sprite *sprBolts;
|
||||
s32 rndIndex = PseudoRandom32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndIndex = PSEUDO_RANDOM_32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndTheta;
|
||||
s32 a0, a1;
|
||||
s32 rnd;
|
||||
@@ -598,11 +598,11 @@ void sub_8034EE0(CamCoord worldX, CamCoord worldY)
|
||||
sprBolts->oamFlags = SPRITE_OAM_ORDER(23);
|
||||
bolts->qUnk3E = Q(5. / 256.);
|
||||
bolts->qUnk40 = Q(32. / 256.);
|
||||
rndTheta = PseudoRandom32();
|
||||
rndTheta = PSEUDO_RANDOM_32();
|
||||
bolts->qUnk3A = (-(SIN(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
bolts->qUnk38 = (-(COS(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
sub_8017540(Q((worldX + (0x3F & rnd)) - 32), Q(worldY - ((rnd & 0x3F0000) >> 0x10)));
|
||||
}
|
||||
|
||||
@@ -884,7 +884,7 @@ NONMATCH("asm/non_matching/game/sa1/stage/enemies/boss_x1__Task_8035588.inc", vo
|
||||
|
||||
if (boss->unk86 > 3) {
|
||||
if (!(7 & boss_44->unk30)) {
|
||||
temp_r1_2 = PseudoRandom32();
|
||||
temp_r1_2 = PSEUDO_RANDOM_32();
|
||||
sub_8017540(((worldX + (0x1F & temp_r1_2)) - 0xF) << 8, ((worldY + ((temp_r1_2 & 0x1F0000) >> 0x10)) - 0xF) << 8);
|
||||
}
|
||||
|
||||
|
||||
@@ -536,7 +536,7 @@ void sub_8036478(CamCoord worldX, CamCoord worldY)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
Sprite *sprBolts;
|
||||
s32 rndIndex = PseudoRandom32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndIndex = PSEUDO_RANDOM_32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndTheta;
|
||||
s32 a0, a1;
|
||||
s32 rnd;
|
||||
@@ -550,11 +550,11 @@ void sub_8036478(CamCoord worldX, CamCoord worldY)
|
||||
sprBolts->oamFlags = SPRITE_OAM_ORDER(23);
|
||||
bolts->qUnk3E = Q(5. / 256.);
|
||||
bolts->qUnk40 = Q(32. / 256.);
|
||||
rndTheta = PseudoRandom32();
|
||||
rndTheta = PSEUDO_RANDOM_32();
|
||||
bolts->qUnk3A = (-(SIN(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
bolts->qUnk38 = (-(COS(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
sub_8017540(Q((worldX + (0x3F & rnd)) - 32), Q(worldY + 32 - ((rnd & 0x3F0000) >> 0x10)));
|
||||
}
|
||||
|
||||
|
||||
@@ -388,7 +388,7 @@ u8 sub_803711C(s16 arg0)
|
||||
}
|
||||
}
|
||||
|
||||
var_r1 = PseudoRandom32() % 100U;
|
||||
var_r1 = PSEUDO_RANDOM_32() % 100U;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
var_r1 -= ptr[i];
|
||||
@@ -689,7 +689,7 @@ NONMATCH("asm/non_matching/game/sa1/stage/enemies/boss_x3__Task_803775C.inc", vo
|
||||
boss->unk9A = 0;
|
||||
strc7C->unk79 = 8;
|
||||
boss->unk99++;
|
||||
rnd = ((u32)PseudoRandom32() & 0x30) >> 4;
|
||||
rnd = ((u32)PSEUDO_RANDOM_32() & 0x30) >> 4;
|
||||
switch (rnd) {
|
||||
case 3:
|
||||
case 0:
|
||||
@@ -1144,7 +1144,7 @@ void sub_8038420(CamCoord worldX, CamCoord worldY)
|
||||
Task *t;
|
||||
NutsAndBolts *bolts;
|
||||
Sprite *sprBolts;
|
||||
s32 rndIndex = PseudoRandom32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndIndex = PSEUDO_RANDOM_32() % ARRAY_COUNT(gUnknown_080BB41C);
|
||||
s32 rndTheta;
|
||||
s32 a0, a1;
|
||||
s32 rnd;
|
||||
@@ -1158,11 +1158,11 @@ void sub_8038420(CamCoord worldX, CamCoord worldY)
|
||||
sprBolts->oamFlags = SPRITE_OAM_ORDER(23);
|
||||
bolts->qUnk3E = Q(5. / 256.);
|
||||
bolts->qUnk40 = Q(32. / 256.);
|
||||
rndTheta = PseudoRandom32();
|
||||
rndTheta = PSEUDO_RANDOM_32();
|
||||
bolts->qUnk3A = (-(SIN(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
bolts->qUnk38 = (-(COS(rndTheta & 0x1FF) * 0x600)) >> 0xE;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
sub_8017540(Q((worldX + (0x3F & rnd)) - 32), Q(worldY + 32 - ((rnd & 0x3F0000) >> 0x10)));
|
||||
}
|
||||
|
||||
@@ -1349,9 +1349,9 @@ void Task_Strc10_803891C()
|
||||
EggX_10 *strc10 = TASK_DATA(gCurTask);
|
||||
|
||||
if ((++strc10->unk4 & 3) == 0) {
|
||||
rndX = PseudoRandom32();
|
||||
rndX = PSEUDO_RANDOM_32();
|
||||
x = (rndX % DISPLAY_WIDTH) + gCamera.x;
|
||||
rndY = PseudoRandom32();
|
||||
rndY = PSEUDO_RANDOM_32();
|
||||
y = (rndY % DISPLAY_HEIGHT) + gCamera.y;
|
||||
sub_8038420(x, y);
|
||||
}
|
||||
@@ -1897,7 +1897,7 @@ void Task_8039264()
|
||||
|
||||
void sub_803967C(void)
|
||||
{
|
||||
s32 rnd = PseudoRandom32() & 0x800;
|
||||
s32 rnd = PSEUDO_RANDOM_32() & 0x800;
|
||||
EggX *boss = TASK_DATA(gCurTask);
|
||||
Sprite *s;
|
||||
Task *t;
|
||||
@@ -2132,7 +2132,7 @@ NONMATCH("asm/non_matching/game/sa1/stage/enemies/boss_x3__Task_8039A64.inc", vo
|
||||
switch (sparkle->unk61) {
|
||||
case 0:
|
||||
if (--sparkle->unk3C == 0) {
|
||||
temp_r0 = PseudoRandom32();
|
||||
temp_r0 = PSEUDO_RANDOM_32();
|
||||
sparkle->unk48 = 0;
|
||||
sparkle->unk61++;
|
||||
if (((temp_r0 % 100) - 35) <= 0) {
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include "trig.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "bg_triangles.h"
|
||||
#include "background.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/shared/stage/entity.h"
|
||||
#include "game/sa1/stage/enemies/bosses_shared.h" // CreatePreBossCameraPan
|
||||
@@ -270,7 +272,7 @@ NONMATCH("asm/non_matching/game/sa1/stage/enemies/boss_xtra__sub_8050194.inc", s
|
||||
var_sl = temp_sb;
|
||||
}
|
||||
if ((var_sl <= 0) && (sp4->unk6E != 1) && (gStageTime & 1)) {
|
||||
if (!(PseudoRandom32() & 0x30000)) {
|
||||
if (!(PSEUDO_RANDOM_32() & 0x30000)) {
|
||||
s32 var = I(temp_r8->unk0.qUnk50);
|
||||
var_r0_2 = temp_r4;
|
||||
if (var_r0_2 < temp_r6) {
|
||||
@@ -301,7 +303,7 @@ NONMATCH("asm/non_matching/game/sa1/stage/enemies/boss_xtra__sub_8050194.inc", s
|
||||
var_r6 = temp_sb_2;
|
||||
}
|
||||
if ((var_r6 <= 0) && (sp4->unk6E != 1) && !(gStageTime & 1)) {
|
||||
if (!(PseudoRandom32() & 0x30000)) {
|
||||
if (!(PSEUDO_RANDOM_32() & 0x30000)) {
|
||||
s32 var = I(temp_r8_2->unk0.qUnk50);
|
||||
var_r0_3 = temp_r4_2;
|
||||
if (var_r0_3 < temp_r5_3) {
|
||||
@@ -937,7 +939,7 @@ NONMATCH("asm/non_matching/game/sa1/stage/enemies/boss_xtra__sub_8051344.inc", v
|
||||
break;
|
||||
case 9:
|
||||
v_r1 = 0x4000;
|
||||
v_r1 -= ((u32)(PseudoRandom32() << 0xC) >> 0x14);
|
||||
v_r1 -= ((u32)(PSEUDO_RANDOM_32() << 0xC) >> 0x14);
|
||||
sub_804CFE0((&strc->unk76), v_r1, 0x1000U);
|
||||
break;
|
||||
case 13:
|
||||
@@ -1023,7 +1025,7 @@ NONMATCH("asm/non_matching/game/sa1/stage/enemies/boss_xtra__sub_8051604.inc", v
|
||||
s32 qX = strc->unk0.qUnk50;
|
||||
s32 qY = strc->unk0.qUnk54 + 0x1700;
|
||||
bool32 var_r2_2 = 0;
|
||||
if (!(PseudoRandom32() & 0x30000)) {
|
||||
if (!(PSEUDO_RANDOM_32() & 0x30000)) {
|
||||
var_r2_2 = 1;
|
||||
}
|
||||
sub_804A8A8(qX, qY, var_r2_2);
|
||||
@@ -1285,8 +1287,8 @@ bool32 sub_80520B8(SuperEggRobo *boss)
|
||||
|
||||
if (!(0xF & gStageTime) || ((boss->unk6E == 0xE) && !(gStageTime & 7))) {
|
||||
s32 a, b;
|
||||
temp_r0 = (((u32)PseudoRandom32() << 10) >> 18) - Q(32);
|
||||
temp_r3 = (((u32)PseudoRandom32() << 9) >> 17) - Q(64);
|
||||
temp_r0 = (((u32)PSEUDO_RANDOM_32() << 10) >> 18) - Q(32);
|
||||
temp_r3 = (((u32)PSEUDO_RANDOM_32() << 9) >> 17) - Q(64);
|
||||
a = boss->qUnk44 + Q(boss->unk60) + temp_r0;
|
||||
b = boss->qUnk48 + Q(boss->qUnk64) + temp_r3;
|
||||
bolts = TASK_DATA(sub_8017540(a, b));
|
||||
|
||||
@@ -554,7 +554,7 @@ void Task_8016B6C(void)
|
||||
if ((strc->unk4++ & 0x3) == 0) {
|
||||
if (strc->unk4 != 5) {
|
||||
strc44 = TASK_DATA(sub_8016D80(strc->unk0, strc->unk2 - 32, gUnknown_080BB43C[LEVEL_TO_ZONE(gCurrentLevel)][0], 0));
|
||||
var_r4 = PseudoRandom32();
|
||||
var_r4 = PSEUDO_RANDOM_32();
|
||||
strc44->qUnk3E += var_r4 & 0xFF;
|
||||
if (1 & strc->unk8) {
|
||||
strc44->qUnk3E = -strc44->qUnk3E;
|
||||
@@ -564,7 +564,7 @@ void Task_8016B6C(void)
|
||||
}
|
||||
|
||||
strc44 = TASK_DATA(sub_8016D80(strc->unk0, strc->unk2 - 32, gUnknown_080BB43C[LEVEL_TO_ZONE(gCurrentLevel)][1], 0));
|
||||
var_r4 = PseudoRandom32();
|
||||
var_r4 = PSEUDO_RANDOM_32();
|
||||
strc44->qUnk3E += var_r4 & 0xFF;
|
||||
if (!(1 & strc->unk8)) {
|
||||
strc44->qUnk3E = -strc44->qUnk3E;
|
||||
@@ -573,7 +573,7 @@ void Task_8016B6C(void)
|
||||
strc44->qUnk40 = strc44->qUnk3C;
|
||||
if (strc->unk4 != 5) {
|
||||
strc54 = TASK_DATA(sub_8016F44(strc->unk0, strc->unk2 - 32, 0x1C0, 0));
|
||||
var_r4 = PseudoRandom32();
|
||||
var_r4 = PSEUDO_RANDOM_32();
|
||||
strc54->unk52 += (var_r4 & 7);
|
||||
if (1 & strc->unk8) {
|
||||
strc54->unk52 = -strc54->unk52;
|
||||
@@ -957,7 +957,7 @@ Task *sub_8017540(s32 qParam0, s32 qParam1)
|
||||
bolts->qUnk34 = qParam1;
|
||||
s->frameFlags = 0x2000;
|
||||
s->oamFlags = 0x500;
|
||||
s->frameFlags |= ((PseudoRandom32() & 0xC00) | 0x2000);
|
||||
s->frameFlags |= ((PSEUDO_RANDOM_32() & 0xC00) | 0x2000);
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ NONMATCH("asm/non_matching/game/sa1/stage/enemies/Slot__Task_SlotProjectileMain.
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
s32 r4 = qUnk4C * 10; // ???
|
||||
s32 modRes = Mod(PseudoRandom32(), 4) + 0x10;
|
||||
s32 modRes = Mod(PSEUDO_RANDOM_32(), 4) + 0x10;
|
||||
s32 r0 = Div(-r4, modRes);
|
||||
|
||||
proj->qUnk4C[i] = (r0 * SIN(((sp08 * 4) & 0x7F) + 0x100)) / 20000;
|
||||
|
||||
@@ -49,8 +49,8 @@ void Task_ShrubberyMain(void)
|
||||
&& (worldY <= I(PLAYER(i).qWorldY)) && (worldY + (me->d.uData[3] * TILE_WIDTH) >= I(PLAYER(i).qWorldY))) {
|
||||
if (!(PLAYER(i).moveState & MOVESTATE_DEAD)) {
|
||||
if (!GetBit(shrubbery->unk3C, i)) {
|
||||
CreateShrubberyParticles(I(PLAYER(i).qWorldX) + (((u32)PseudoRandom32() & 0x1F00) >> 8) - 16,
|
||||
I(PLAYER(i).qWorldY) + (((u32)PseudoRandom32() & 0x0F00) >> 8) - 8);
|
||||
CreateShrubberyParticles(I(PLAYER(i).qWorldX) + (((u32)PSEUDO_RANDOM_32() & 0x1F00) >> 8) - 16,
|
||||
I(PLAYER(i).qWorldY) + (((u32)PSEUDO_RANDOM_32() & 0x0F00) >> 8) - 8);
|
||||
m4aSongNumStart(SE_SHRUBBERY);
|
||||
}
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ void Task_Itembox2(void)
|
||||
} break;
|
||||
|
||||
case ITEM__RINGS_RANDOM: {
|
||||
s16 rings = ItemBox_RingAmountTable[(u32)PseudoRandom32() % ARRAY_COUNT(ItemBox_RingAmountTable)];
|
||||
s16 rings = ItemBox_RingAmountTable[(u32)PSEUDO_RANDOM_32() % ARRAY_COUNT(ItemBox_RingAmountTable)];
|
||||
INCREMENT_RINGS(rings);
|
||||
|
||||
if (gGameMode == GAME_MODE_MULTI_PLAYER_COLLECT_RINGS) {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/globals.h"
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa1/ui/character_select.h"
|
||||
#include "game/shared/multiplayer/communication_outcome.h"
|
||||
@@ -166,11 +169,11 @@ NONMATCH("asm/non_matching/game/sa1/stage/results__Task_801874C.inc", void Task_
|
||||
if (strc->unk203 == 0) {
|
||||
gGameMode = GAME_MODE_RACE;
|
||||
TaskDestroy(gCurTask);
|
||||
CreateCharacterSelectionScreen((PseudoRandom32() + SIO_MULTI_CNT->id) % 4u);
|
||||
CreateCharacterSelectionScreen((PSEUDO_RANDOM_32() + SIO_MULTI_CNT->id) % 4u);
|
||||
} else {
|
||||
gGameMode = GAME_MODE_CHAO_HUNT;
|
||||
TaskDestroy(gCurTask);
|
||||
CreateCharacterSelectionScreen((PseudoRandom32() + SIO_MULTI_CNT->id) % 4u);
|
||||
CreateCharacterSelectionScreen((PSEUDO_RANDOM_32() + SIO_MULTI_CNT->id) % 4u);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "trig.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa1/ui/character_select.h"
|
||||
#include "game/sa1/ui/course_select.h"
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#include "malloc_vram.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "bg_triangles.h"
|
||||
#include "background.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "data/sa1/ui_graphics.h"
|
||||
#include "game/sa1/ui/course_select.h"
|
||||
#include "game/shared/menus/unused_level_select.h"
|
||||
|
||||
@@ -380,7 +380,7 @@ void sub_801C130()
|
||||
switch (itembox->rndItemIndex) {
|
||||
case 2:
|
||||
case 0:
|
||||
ringsInBox = ItemBox_RingAmountTable[PseudoRandom32() % 6u];
|
||||
ringsInBox = ItemBox_RingAmountTable[PSEUDO_RANDOM_32() % 6u];
|
||||
INCREMENT_RINGS(ringsInBox);
|
||||
if ((gGameMode == 6) && ((u32)gRingCount > 0xFFU)) {
|
||||
gRingCount = 0xFF;
|
||||
|
||||
@@ -434,12 +434,12 @@ void sub_8049D7C(Player *p)
|
||||
}
|
||||
|
||||
if ((gStageTime % 4u) == 0) {
|
||||
if (PseudoRandom32() & 0x10000) {
|
||||
if (PSEUDO_RANDOM_32() & 0x10000) {
|
||||
s32 qWorldX, qWorldY;
|
||||
s32 qRand;
|
||||
qWorldX = p->qWorldX + (((u32)PseudoRandom32() & 0xF0000) >> 8);
|
||||
qWorldY = p->qWorldY + (((u32)PseudoRandom32() & 0xF0000) >> 8) - Q(8);
|
||||
qRand = (((u32)PseudoRandom32() & 0x10000) >> 16);
|
||||
qWorldX = p->qWorldX + (((u32)PSEUDO_RANDOM_32() & 0xF0000) >> 8);
|
||||
qWorldY = p->qWorldY + (((u32)PSEUDO_RANDOM_32() & 0xF0000) >> 8) - Q(8);
|
||||
qRand = (((u32)PSEUDO_RANDOM_32() & 0x10000) >> 16);
|
||||
|
||||
sub_804A498(qWorldX, qWorldY, qRand);
|
||||
}
|
||||
@@ -1156,11 +1156,11 @@ void sub_804A8A8(s32 qX, s32 qY, s32 param2)
|
||||
mgr->unk0.qUnk54 = qY;
|
||||
|
||||
if (qX == Q(512)) {
|
||||
mgr->unk0.qUnk58 = -(((u32)PseudoRandom32() << 14) >> 22);
|
||||
mgr->unk0.qUnk5A = ((u32)PseudoRandom32() & 0xFF00) >> 8;
|
||||
mgr->unk0.qUnk58 = -(((u32)PSEUDO_RANDOM_32() << 14) >> 22);
|
||||
mgr->unk0.qUnk5A = ((u32)PSEUDO_RANDOM_32() & 0xFF00) >> 8;
|
||||
} else {
|
||||
mgr->unk0.qUnk58 = (((u32)PseudoRandom32() & 0x3FF00) >> 8) - 0x300;
|
||||
mgr->unk0.qUnk5A = -(((u32)PseudoRandom32() & 0x3FF00) >> 8) - 0x80;
|
||||
mgr->unk0.qUnk58 = (((u32)PSEUDO_RANDOM_32() & 0x3FF00) >> 8) - 0x300;
|
||||
mgr->unk0.qUnk5A = -(((u32)PSEUDO_RANDOM_32() & 0x3FF00) >> 8) - 0x80;
|
||||
}
|
||||
|
||||
if (param2 == 2) {
|
||||
@@ -1169,8 +1169,8 @@ void sub_804A8A8(s32 qX, s32 qY, s32 param2)
|
||||
}
|
||||
|
||||
mgr->unk0.qUnk5E = Q(7. / 256.);
|
||||
mgr->unk70 = (u32)PseudoRandom32() >> 8;
|
||||
mgr->unk72 = (((u32)PseudoRandom32() << 11) >> 19) - 0x1000;
|
||||
mgr->unk70 = (u32)PSEUDO_RANDOM_32() >> 8;
|
||||
mgr->unk72 = (((u32)PSEUDO_RANDOM_32() << 11) >> 19) - 0x1000;
|
||||
|
||||
mgr->unk0.s.oamFlags = SPRITE_OAM_ORDER(12);
|
||||
mgr->unk0.s.frameFlags = SPRITE_FLAG(PRIORITY, 1);
|
||||
@@ -1180,15 +1180,15 @@ void sub_804A8A8(s32 qX, s32 qY, s32 param2)
|
||||
u32 v;
|
||||
mgr->unk72 >>= 1;
|
||||
|
||||
v = (u32)PseudoRandom32();
|
||||
v = (u32)PSEUDO_RANDOM_32();
|
||||
a = mgr->unk0.transform.qScaleX;
|
||||
mgr->unk0.transform.qScaleX = a - ((v & 0x4000) >> 8);
|
||||
v = (u32)PseudoRandom32();
|
||||
v = (u32)PSEUDO_RANDOM_32();
|
||||
b = mgr->unk0.transform.qScaleY;
|
||||
mgr->unk0.transform.qScaleY = b - ((v & 0x4000) >> 8);
|
||||
}
|
||||
|
||||
if ((u32)PseudoRandom32() & 0x10000) {
|
||||
if ((u32)PSEUDO_RANDOM_32() & 0x10000) {
|
||||
mgr->unk0.transform.qScaleY = -mgr->unk0.transform.qScaleY;
|
||||
}
|
||||
}
|
||||
@@ -1430,11 +1430,11 @@ void sub_804AFCC(s32 qX, s32 qY)
|
||||
mgr->unk0.qUnk50 = qX;
|
||||
mgr->unk0.qUnk54 = qY;
|
||||
|
||||
mgr->unk0.qUnk58 = -((((u32)PseudoRandom32() & 0x7F00) >> 8) + 0x80);
|
||||
mgr->unk0.qUnk5A = +((((u32)PseudoRandom32() & 0x7F00) >> 8) + 0x40);
|
||||
mgr->unk0.qUnk58 = -((((u32)PSEUDO_RANDOM_32() & 0x7F00) >> 8) + 0x80);
|
||||
mgr->unk0.qUnk5A = +((((u32)PSEUDO_RANDOM_32() & 0x7F00) >> 8) + 0x40);
|
||||
mgr->unk0.qUnk5E = Q(7. / 256.);
|
||||
|
||||
mgr->unk72 = (((u32)PseudoRandom32() << 13) >> 21) - Q(4);
|
||||
mgr->unk72 = (((u32)PSEUDO_RANDOM_32() << 13) >> 21) - Q(4);
|
||||
|
||||
if (i & 1) {
|
||||
mgr->unk0.transform.qScaleX = -Q(1);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "trig.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "game/globals.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "flags.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "game/sa1/stage/ui_rendering.h"
|
||||
#include "game/sa1/stage/stage_ui.h"
|
||||
|
||||
@@ -719,7 +721,7 @@ IwramData UiGfxStackInit(void)
|
||||
return offset;
|
||||
}
|
||||
|
||||
struct GraphicsData *UiGfxStackPop(void)
|
||||
GraphicsData *UiGfxStackPop(void)
|
||||
{
|
||||
Task_3006240 *strc = TASK_DATA(gTask_03006240);
|
||||
struct GfxSubstruct *curr;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "trig.h"
|
||||
#include "background.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "data/sa1/ui_graphics.h"
|
||||
#include "game/sa1/stage/ui_rendering.h"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "data/sa1/ui_graphics.h"
|
||||
#include "game/sa1/ui/character_select.h"
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "core.h"
|
||||
#include "flags.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "background.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa1/ui/game_over.h"
|
||||
#include "game/sa1/menus/options_screen.h" // contains EditLanguageScreen
|
||||
|
||||
@@ -1167,9 +1167,9 @@ void Task_8066C78_164()
|
||||
strc164->unkD6[var_r8] -= 0x10;
|
||||
} else {
|
||||
s32 rnd2;
|
||||
temp_r0_3 = PseudoRandom32();
|
||||
temp_r0_3 = PSEUDO_RANDOM_32();
|
||||
strc164->unkD6[var_r8] = Mod(temp_r0_3, 40) + 0x8C;
|
||||
rnd2 = PseudoRandom32();
|
||||
rnd2 = PSEUDO_RANDOM_32();
|
||||
strc164->unk50[var_r8] = Mod(rnd2, 0xDC) + 0x14;
|
||||
var_r3 = temp_r5;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa1/stage/ui_rendering.h"
|
||||
#include "game/sa1/stage/mp_chao.h"
|
||||
@@ -461,9 +463,9 @@ NONMATCH("asm/non_matching/game/sa1/ui/game2_3__Task_8063638.inc", void Task_806
|
||||
gMultiSioSend.pat0.unk0 = 0x52;
|
||||
gMultiSioSend.pat0.unk2 = strc5C->unk55;
|
||||
|
||||
while (gMultiSioSend.pat0.unk3 == ((PseudoRandom32() >> 8) & 7))
|
||||
while (gMultiSioSend.pat0.unk3 == ((PSEUDO_RANDOM_32() >> 8) & 7))
|
||||
;
|
||||
while (gMultiSioSend.pat0.unk4 == ((PseudoRandom32() >> 8) & 7))
|
||||
while (gMultiSioSend.pat0.unk4 == ((PSEUDO_RANDOM_32() >> 8) & 7))
|
||||
;
|
||||
|
||||
// gMultiSioSend.pat0.unk5 = (s8) (var_r3_5 & 7);
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "game/sa1/ui/game_over.h"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa1/ui/game_over.h"
|
||||
#include "game/sa1/stage/ui_rendering.h"
|
||||
@@ -158,8 +160,8 @@ void CreateSpecialStageIntro(void)
|
||||
temp_r2->qUnk40 = 0;
|
||||
|
||||
for (var_r5 = 0; var_r5 < 16; var_r5++) {
|
||||
temp_r2->unk84[var_r5] = Mod(PseudoRandom32(), 40) - 20;
|
||||
temp_r2->unk44[var_r5] = Mod(PseudoRandom32(), 220) + 20;
|
||||
temp_r2->unk84[var_r5] = Mod(PSEUDO_RANDOM_32(), 40) - 20;
|
||||
temp_r2->unk44[var_r5] = Mod(PSEUDO_RANDOM_32(), 220) + 20;
|
||||
}
|
||||
|
||||
s->graphics.dest = OBJ_VRAM0 + 0x820;
|
||||
@@ -366,8 +368,8 @@ void Task_8068BB0(void)
|
||||
if ((sp0 + var_r8) & 0xF) {
|
||||
strcC4->unk84[var_r8] += 0x10;
|
||||
} else {
|
||||
strcC4->unk84[var_r8] = Mod(PseudoRandom32(), 0x28) - 0x14;
|
||||
strcC4->unk44[var_r8] = Mod(PseudoRandom32(), 0xDC) + 0x14;
|
||||
strcC4->unk84[var_r8] = Mod(PSEUDO_RANDOM_32(), 0x28) - 0x14;
|
||||
strcC4->unk44[var_r8] = Mod(PSEUDO_RANDOM_32(), 0xDC) + 0x14;
|
||||
}
|
||||
|
||||
s->x = strcC4->unk44[var_r8];
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa1/stage/ui_rendering.h"
|
||||
#include "game/sa1/ui/collect_chaos_emeralds_msg.h"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "data/sa1/ui_graphics.h"
|
||||
#include "game/sa1/ui/course_select.h"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "data/sa1/ui_graphics.h"
|
||||
#include "game/sa1/stage/ui_rendering.h"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "data/sa1/ui_graphics.h"
|
||||
#include "game/sa1/stage/ui_rendering.h"
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include "flags.h"
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "background.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "multi_boot.h"
|
||||
#include "sio32_multi_load.h"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "core.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "flags.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "game/globals.h"
|
||||
#include "game/sa2/collect_rings/time_display.h"
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa2/cutscenes/credits.h"
|
||||
#include "game/sa2/cutscenes/credits_end.h"
|
||||
#include "game/sa2/cutscenes/credits_slides.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "task.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa2/save.h"
|
||||
|
||||
#include "constants/sa2/tilemaps.h"
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
#include "animation_commands_bg.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa2/cutscenes/credits.h"
|
||||
#include "game/sa2/cutscenes/credits_end.h"
|
||||
#include "game/sa2/cutscenes/missing_emeralds.h"
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
#include "global.h"
|
||||
#include "game/sa2/cutscenes/credits.h"
|
||||
#include "game/sa2/cutscenes/credits_end.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa2/save.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "game/sa2/cutscenes/credits.h"
|
||||
#include "game/sa2/cutscenes/credits_end.h"
|
||||
|
||||
#include "constants/sa2/animations.h"
|
||||
#include "constants/sa2/tilemaps.h"
|
||||
|
||||
@@ -39,7 +39,7 @@ void sub_808E8F8(s16 *ptr, s16 a, u8 b)
|
||||
if (*ptr != a) {
|
||||
*ptr = a;
|
||||
} else {
|
||||
u16 rand = PseudoRandom32();
|
||||
u16 rand = PSEUDO_RANDOM_32();
|
||||
if (rand >> 8 != 0) {
|
||||
*ptr += ((rand) >> ((16 - b)));
|
||||
} else {
|
||||
@@ -53,7 +53,7 @@ void sub_808E95C(s32 *ptr, s32 a, u8 b)
|
||||
if (*ptr != a) {
|
||||
*ptr = a;
|
||||
} else {
|
||||
u16 rand = PseudoRandom32();
|
||||
u16 rand = PSEUDO_RANDOM_32();
|
||||
if (rand >> 8 != 0) {
|
||||
*ptr += ((rand) >> ((8 - b)));
|
||||
} else {
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
#include "global.h"
|
||||
#include "game/sa2/cutscenes/endings.h"
|
||||
#include "game/sa2/cutscenes/extra_ending_slides.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "trig.h"
|
||||
#include "game/sa2/save.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/math.h"
|
||||
#include "game/sa2/save.h"
|
||||
#include "game/sa2/cutscenes/endings.h"
|
||||
#include "game/sa2/cutscenes/extra_ending_slides.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
|
||||
#include "constants/sa2/animations.h"
|
||||
#include "constants/sa2/songs.h"
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
#include "global.h"
|
||||
#include "game/sa2/cutscenes/credits.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa2/save.h"
|
||||
#include "game/sa2/cutscenes/credits.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
|
||||
#include "constants/sa2/animations.h"
|
||||
#include "constants/sa2/songs.h"
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "game/sa2/cutscenes/endings.h"
|
||||
#include "game/sa2/cutscenes/extra_ending_slides.h"
|
||||
#include "game/sa2/cutscenes/final_ending_land.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "task.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa2/save.h"
|
||||
#include "game/math.h"
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "task.h"
|
||||
#include "game/sa2/cutscenes/credits.h"
|
||||
#include "game/sa2/cutscenes/missing_emeralds.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "background.h"
|
||||
#include "trig.h"
|
||||
#include "task.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/math.h"
|
||||
#include "game/sa2/save.h"
|
||||
#include "game/sa2/title_screen.h"
|
||||
#include "game/math.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "game/sa2/cutscenes/credits.h"
|
||||
#include "game/sa2/cutscenes/missing_emeralds.h"
|
||||
|
||||
#include "constants/sa2/animations.h"
|
||||
#include "constants/sa2/songs.h"
|
||||
@@ -658,7 +661,7 @@ void sub_8093740(struct FinalEndingLandCutScene *scene)
|
||||
for (i = 0; i < (0xD - (scene->unk33C >> 1)); i++) {
|
||||
s32 sin, temp, unused;
|
||||
if (scene->unk4DC[i][1] == ((0xBE - gBgScrollRegs[1][1]) * 0x100)) {
|
||||
if (PseudoRandom32() < 0) {
|
||||
if (PSEUDO_RANDOM_32() < 0) {
|
||||
scene->unk4DC[i][4] = -1;
|
||||
} else {
|
||||
scene->unk4DC[i][4] = 1;
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
#include "global.h"
|
||||
#include "game/sa2/cutscenes/level_endings.h"
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "trig.h"
|
||||
#include "game/sa2/ui/course_select.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa2/save.h"
|
||||
#include "game/sa2/cutscenes/level_endings.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "game/sa2/ui/course_select.h"
|
||||
|
||||
#include "game/shared/stage/terrain_collision.h"
|
||||
#include "game/shared/stage/player.h"
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "game/sa2/cutscenes/missing_emeralds.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa2/save.h"
|
||||
#include "game/sa2/title_screen.h"
|
||||
#include "game/sa2/cutscenes/missing_emeralds.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
|
||||
#include "constants/sa2/animations.h"
|
||||
#include "constants/sa2/songs.h"
|
||||
|
||||
@@ -4,9 +4,12 @@
|
||||
#include "malloc_vram.h"
|
||||
#include "multi_sio.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa2/multiplayer/mode_select.h"
|
||||
#include "game/sa2/multiplayer/multipak_connection.h"
|
||||
#include "game/sa2/collect_rings/singlepak_connection.h"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "core.h"
|
||||
#include "task.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "multi_sio.h"
|
||||
|
||||
#include "game/sa2/multiplayer/multipak_connection.h"
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
#include "flags.h"
|
||||
#include "multi_sio.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
|
||||
#include "game/shared/stage/stage.h"
|
||||
#include "game/sa2/ui/course_select.h"
|
||||
#include "game/sa2/multiplayer/results.h"
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
#include "core.h"
|
||||
#include "task.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "multi_sio.h"
|
||||
|
||||
#include "game/sa2/multiplayer/multipak_connection.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "flags.h"
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
#include "game/sa2/options_screen.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "task.h"
|
||||
#include "game/sa2/save.h"
|
||||
#include "malloc_ewram.h"
|
||||
#include "game/math.h"
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "background.h"
|
||||
#include "malloc_ewram.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/math.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "constants/sa2/songs.h"
|
||||
#include "constants/sa2/text.h"
|
||||
#include "game/sa2/options_screen.h"
|
||||
#include "game/sa2/save.h"
|
||||
#include "game/sa2/title_screen.h"
|
||||
#include "game/sa2/sound_test.h"
|
||||
#include "game/shared/stage/stage.h"
|
||||
#include "game/sa2/stage/stage_ui.h"
|
||||
#include "game/sa2/multiplayer/mode_select.h"
|
||||
#include "game/sa2/ui/character_select.h"
|
||||
#include "game/shared/stage/stage.h"
|
||||
|
||||
#include "constants/sa2/tilemaps.h"
|
||||
#include "constants/sa2/songs.h"
|
||||
#include "constants/sa2/text.h"
|
||||
|
||||
#define NUM_PLAYER_DATA_MENU_ITEMS 4
|
||||
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa2/title_screen.h"
|
||||
#include "game/sa2/save.h"
|
||||
#include "game/sa2/special_stage/main.h"
|
||||
#include "game/sa2/special_stage/utils.h"
|
||||
#include "game/sa2/special_stage/player.h"
|
||||
@@ -8,15 +16,10 @@
|
||||
#include "game/sa2/special_stage/guard_robo.h"
|
||||
#include "game/sa2/special_stage/physics.h"
|
||||
#include "game/sa2/special_stage/tables.h"
|
||||
#include "game/shared/stage/stage.h"
|
||||
#include "game/sa2/save.h"
|
||||
#include "sprite.h"
|
||||
#include "game/sa2/stage/screen_fade.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "task.h"
|
||||
#include "game/sa2/title_screen.h"
|
||||
#include "constants/zones.h"
|
||||
#include "game/shared/stage/stage.h"
|
||||
|
||||
#include "constants/zones.h"
|
||||
#include "constants/sa2/songs.h"
|
||||
#include "constants/sa2/tilemaps.h"
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "trig.h"
|
||||
|
||||
#include "game/sa2/special_stage/main.h"
|
||||
#include "game/sa2/special_stage/world.h"
|
||||
#include "game/sa2/special_stage/utils.h"
|
||||
#include "game/sa2/special_stage/data.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "data/sa2/sprite_data.h"
|
||||
#include "trig.h"
|
||||
|
||||
void *gSpecialStageSubMenuVramPointer = NULL;
|
||||
void *gSpecialStageVramPointer = NULL;
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
#include "core.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
#include "flags.h"
|
||||
#include "malloc_ewram.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa2/save.h"
|
||||
#include "game/sa2/special_stage/main.h"
|
||||
#include "game/sa2/special_stage/player.h"
|
||||
#include "game/sa2/special_stage/utils.h"
|
||||
#include "game/sa2/special_stage/world.h"
|
||||
#include "game/sa2/special_stage/guard_robo.h"
|
||||
#include "game/sa2/special_stage/data.h"
|
||||
#include "task.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa2/save.h"
|
||||
#include "trig.h"
|
||||
#include "flags.h"
|
||||
#include "malloc_ewram.h"
|
||||
|
||||
#include "constants/zones.h"
|
||||
#include "constants/sa2/songs.h"
|
||||
#include "constants/sa2/tilemaps.h"
|
||||
|
||||
@@ -1088,16 +1088,16 @@ static void DestructionScene_UpdateComponents(EggHammerTankII *boss)
|
||||
parts.unk4 = 0;
|
||||
CreateBossParticleWithExplosionUpdate(&parts, &ds->numPartsCreated);
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
parts.spawnX = (I(ds->hammerX) - gCamera.x) + (rand & 15);
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
parts.spawnY = (I(ds->hammerY) - gCamera.y) + (rand & 15);
|
||||
|
||||
CreateBossParticleWithExplosionUpdate(&parts, &ds->numPartsCreated);
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
parts.spawnX = (I(ds->hammerX) - gCamera.x) + (rand & 15);
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
parts.spawnY = (I(ds->hammerY) - gCamera.y) + (rand & 15);
|
||||
|
||||
CreateBossParticleWithExplosionUpdate(&parts, &ds->numPartsCreated);
|
||||
@@ -1239,7 +1239,7 @@ static void DestructionScene_Render(EggHammerTankII *boss)
|
||||
init.spawnX = I(ds->bodyX) - gCamera.x;
|
||||
init.spawnY = I(ds->bodyY) - gCamera.y;
|
||||
init.velocity = 0x40;
|
||||
init.rotation = PseudoRandom32() & (SIN_PERIOD - 1);
|
||||
init.rotation = PSEUDO_RANDOM_32() & (SIN_PERIOD - 1);
|
||||
init.speed = 0x600;
|
||||
init.vram = (void *)OBJ_VRAM0 + (gTileInfoBossScrews[i][0] * TILE_SIZE_4BPP);
|
||||
init.anim = gTileInfoBossScrews[i][1];
|
||||
@@ -1248,7 +1248,7 @@ static void DestructionScene_Render(EggHammerTankII *boss)
|
||||
CreateBossParticleWithExplosionUpdate(&init, &ds->numPartsCreated);
|
||||
}
|
||||
|
||||
if (Mod(boss->sceneTimer + PseudoRandom32(), 13) == 0) {
|
||||
if (Mod(boss->sceneTimer + PSEUDO_RANDOM_32(), 13) == 0) {
|
||||
m4aSongNumStart(SE_EXPLOSION);
|
||||
}
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ static void Task_TransitionToEscapeSequence(void)
|
||||
UpdateBomberTankPalette(boss);
|
||||
CreateDestructionExplosions(boss);
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
|
||||
if (Mod(gStageTime + rand, 0x11) == 0) {
|
||||
m4aSongNumStart(SE_EXPLOSION);
|
||||
@@ -746,7 +746,7 @@ static void HandleCannonBombTrigger(EggBomberTank *boss)
|
||||
boss->timer = 12;
|
||||
gCurTask->main = Task_BomberTankCannonReload;
|
||||
m4aSongNumStart(SE_241);
|
||||
CreateBomberTankBomb(boss, x, y, boss->cannonAngle, 64, sExplosionTimes[PseudoRandom32() & 0xF]);
|
||||
CreateBomberTankBomb(boss, x, y, boss->cannonAngle, 64, sExplosionTimes[PSEUDO_RANDOM_32() & 0xF]);
|
||||
|
||||
} else {
|
||||
boss->timer--;
|
||||
@@ -892,9 +892,9 @@ static void CreateDestructionExplosions(EggBomberTank *boss)
|
||||
if ((0x103U - boss->timer) >> 5 > boss->unk76) {
|
||||
u32 rand;
|
||||
ExplosionPartsInfo init;
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
init.spawnX = (I(boss->qWorldX) - gCamera.x) + ((rand * 0x22) & 63) - 0x34;
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
init.spawnY = (I(boss->qWorldY) - gCamera.y) + ((rand * 0x34) & 63) - 0x30;
|
||||
init.velocity = 0;
|
||||
|
||||
@@ -907,7 +907,7 @@ static void CreateDestructionExplosions(EggBomberTank *boss)
|
||||
CreateBossParticleWithExplosionUpdate(&init, &boss->unk76);
|
||||
}
|
||||
} else {
|
||||
if ((PseudoRandom32() & 5) == 0 && (0x103U - boss->timer) >> 5 > boss->unk74) {
|
||||
if ((PSEUDO_RANDOM_32() & 5) == 0 && (0x103U - boss->timer) >> 5 > boss->unk74) {
|
||||
u32 rand;
|
||||
ExplosionPartsInfo init;
|
||||
boss->unk75++;
|
||||
@@ -915,14 +915,14 @@ static void CreateDestructionExplosions(EggBomberTank *boss)
|
||||
boss->unk75 = 0;
|
||||
}
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
init.spawnX = (I(boss->qWorldX) - gCamera.x) + (rand & 63) - 0x20;
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
init.spawnY = (I(boss->qWorldY) - gCamera.y) + (rand & 63) - 0x20;
|
||||
init.velocity = 0x40;
|
||||
|
||||
init.rotation = PseudoRandom32() & (SIN_PERIOD - 1);
|
||||
init.rotation = PSEUDO_RANDOM_32() & (SIN_PERIOD - 1);
|
||||
init.speed = 0x600;
|
||||
init.vram = (void *)OBJ_VRAM0 + (gTileInfoBossScrews[boss->unk75][0] * TILE_SIZE_4BPP);
|
||||
init.anim = gTileInfoBossScrews[boss->unk75][1];
|
||||
@@ -1001,7 +1001,7 @@ static void Task_StartBossDestruction(void)
|
||||
UpdateBomberTankPalette(boss);
|
||||
CreateDestructionExplosions(boss);
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
if (Mod(gStageTime + rand, 21) == 0) {
|
||||
m4aSongNumStart(SE_EXPLOSION);
|
||||
}
|
||||
@@ -1024,7 +1024,7 @@ static void Task_WaitForBossOffScreen(void)
|
||||
UpdateBomberTankPalette(boss);
|
||||
CreateDestructionExplosions(boss);
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
|
||||
if (Mod(gStageTime + rand, 13) == 0) {
|
||||
m4aSongNumStart(SE_EXPLOSION);
|
||||
@@ -1067,7 +1067,7 @@ static void HandleCannonlessBombTrigger(EggBomberTank *boss)
|
||||
RenderCannon(boss);
|
||||
if (boss->timer == 0) {
|
||||
CreateBomberTankBomb(boss, boss->qWorldX - Q(8), boss->qWorldY - Q(22), DEG_TO_SIN(180), 8,
|
||||
sExplosionTimes[PseudoRandom32() & 0xF]);
|
||||
sExplosionTimes[PSEUDO_RANDOM_32() & 0xF]);
|
||||
boss->timer = 113;
|
||||
} else {
|
||||
if (boss->timer > 150) {
|
||||
|
||||
@@ -790,15 +790,15 @@ void sub_803FC14(EggTotem *totem)
|
||||
totem->qUnk90 += totem->qUnk98;
|
||||
|
||||
if (Mod(gStageTime, 14) == 0) {
|
||||
s32 rnd = PseudoRandom32();
|
||||
s32 rnd = PSEUDO_RANDOM_32();
|
||||
info.spawnX = (I(totem->qUnk90) - gCamera.x) + (rnd % 64u) - 31;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
info.spawnY = ((I(totem->qUnk94) - gCamera.y) + (rnd % 32u)) - 75;
|
||||
|
||||
info.velocity = 0;
|
||||
info.rotation = ({ 1000 - (PseudoRandom32() % 64u); });
|
||||
info.speed = ({ BOSS_EXPLOSION_VELOCITY_X - (PseudoRandom32() % 512u); });
|
||||
info.rotation = ({ 1000 - (PSEUDO_RANDOM_32() % 64u); });
|
||||
info.speed = ({ BOSS_EXPLOSION_VELOCITY_X - (PSEUDO_RANDOM_32() % 512u); });
|
||||
info.vram = (void *)(OBJ_VRAM0 + 0x2980);
|
||||
info.anim = SA2_ANIM_EXPLOSION;
|
||||
info.variant = 0;
|
||||
@@ -809,16 +809,16 @@ void sub_803FC14(EggTotem *totem)
|
||||
// _0803FD04
|
||||
|
||||
if (Mod(gStageTime, 13) == 0) {
|
||||
s32 rnd = PseudoRandom32();
|
||||
s32 rnd = PSEUDO_RANDOM_32();
|
||||
info.spawnX = (I(totem->qUnk9C) - gCamera.x) + (rnd % 64u) - 31;
|
||||
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
info.spawnY = ((I(totem->qUnkA0) - gCamera.y) + (rnd % 32u)) - 0x10;
|
||||
|
||||
info.velocity = 0;
|
||||
info.rotation = ({ 1000 - (PseudoRandom32() % 64u); });
|
||||
info.rotation = ({ 1000 - (PSEUDO_RANDOM_32() % 64u); });
|
||||
|
||||
info.speed = ({ BOSS_EXPLOSION_VELOCITY_X - (PseudoRandom32() % 512u); });
|
||||
info.speed = ({ BOSS_EXPLOSION_VELOCITY_X - (PSEUDO_RANDOM_32() % 512u); });
|
||||
info.vram = (void *)(OBJ_VRAM0 + 0x2980);
|
||||
info.anim = SA2_ANIM_EXPLOSION;
|
||||
info.variant = 0;
|
||||
@@ -842,13 +842,13 @@ void sub_803FC14(EggTotem *totem)
|
||||
|
||||
// TODO: Check loop values
|
||||
for (j = 0; j < 4; j++) {
|
||||
s32 rnd = PseudoRandom32();
|
||||
s32 rnd = PSEUDO_RANDOM_32();
|
||||
info.spawnX = ((I(t3c->qWorldX) - gCamera.x) + (rnd % 64u)) - 31;
|
||||
rnd = PseudoRandom32();
|
||||
rnd = PSEUDO_RANDOM_32();
|
||||
info.spawnY = ((I(t3c->qWorldY) - gCamera.y) + (rnd % 8u)) - 3;
|
||||
info.velocity = 0;
|
||||
info.rotation = ({ 1000 - (PseudoRandom32() % 64u); });
|
||||
info.speed = ({ BOSS_EXPLOSION_VELOCITY_X - Q(1.5) - (PseudoRandom32() % 512u); });
|
||||
info.rotation = ({ 1000 - (PSEUDO_RANDOM_32() % 64u); });
|
||||
info.speed = ({ BOSS_EXPLOSION_VELOCITY_X - Q(1.5) - (PSEUDO_RANDOM_32() % 512u); });
|
||||
info.vram = (void *)(OBJ_VRAM0 + 0x2980);
|
||||
info.anim = SA2_ANIM_EXPLOSION;
|
||||
info.variant = 0;
|
||||
@@ -939,15 +939,15 @@ void sub_803FF44(EggTotem *totem)
|
||||
totem->qUnk94 = totem->qUnkA0 + Q(50);
|
||||
|
||||
if (Mod(gStageTime, 6) == 0) {
|
||||
s32 rnd32 = PseudoRandom32();
|
||||
s32 rnd32 = PSEUDO_RANDOM_32();
|
||||
info.spawnX = I(totem->qUnk9C) - gCamera.x + (rnd32 % 64u) - 31;
|
||||
|
||||
rnd32 = PseudoRandom32();
|
||||
rnd32 = PSEUDO_RANDOM_32();
|
||||
info.spawnY = I(totem->qUnkA0) - gCamera.y + (rnd32 % 64u) - 45;
|
||||
|
||||
info.velocity = 0;
|
||||
info.rotation = ({ 1000 - (PseudoRandom32() % 64u); });
|
||||
info.speed = ({ BOSS_EXPLOSION_VELOCITY_X - (PseudoRandom32() % 512u); });
|
||||
info.rotation = ({ 1000 - (PSEUDO_RANDOM_32() % 64u); });
|
||||
info.speed = ({ BOSS_EXPLOSION_VELOCITY_X - (PSEUDO_RANDOM_32() % 512u); });
|
||||
info.vram = (void *)(OBJ_VRAM0 + 0x2980);
|
||||
info.anim = SA2_ANIM_EXPLOSION;
|
||||
info.variant = 0;
|
||||
@@ -973,16 +973,16 @@ void sub_803FF44(EggTotem *totem)
|
||||
// _08040256
|
||||
if (--totem->unk38 == 0) {
|
||||
for (j = 0; j < 9; j++) {
|
||||
s32 rnd32 = PseudoRandom32();
|
||||
s32 rnd32 = PSEUDO_RANDOM_32();
|
||||
info.spawnX = I(totem->qUnk9C) - gCamera.x + (rnd32 % 64u) - 31;
|
||||
|
||||
rnd32 = PseudoRandom32();
|
||||
rnd32 = PSEUDO_RANDOM_32();
|
||||
info.spawnY = I(totem->qUnkA0) - gCamera.y + (rnd32 % 64u) - 45;
|
||||
|
||||
info.velocity = 0;
|
||||
|
||||
info.rotation = ({ 1000 - (PseudoRandom32() % 64u); });
|
||||
info.speed = ({ Q(6.0) - (PseudoRandom32() % 512u); });
|
||||
info.rotation = ({ 1000 - (PSEUDO_RANDOM_32() % 64u); });
|
||||
info.speed = ({ Q(6.0) - (PSEUDO_RANDOM_32() % 512u); });
|
||||
info.vram = (void *)(OBJ_VRAM0 + 0x2980);
|
||||
info.anim = SA2_ANIM_EXPLOSION;
|
||||
info.variant = 0;
|
||||
@@ -1005,16 +1005,16 @@ void sub_803FF44(EggTotem *totem)
|
||||
// _08040360
|
||||
|
||||
if (Mod(gStageTime, 14) == 0) {
|
||||
s32 rnd32 = PseudoRandom32();
|
||||
s32 rnd32 = PSEUDO_RANDOM_32();
|
||||
info.spawnX = I(totem->qUnk90) - gCamera.x + (rnd32 % 64u) - 31;
|
||||
|
||||
rnd32 = PseudoRandom32();
|
||||
rnd32 = PSEUDO_RANDOM_32();
|
||||
info.spawnY = I(totem->qUnk94) - gCamera.y + (rnd32 % 32u) - 75;
|
||||
|
||||
info.velocity = 0;
|
||||
|
||||
info.rotation = ({ 1000 - (PseudoRandom32() % 64u); });
|
||||
info.speed = ({ BOSS_EXPLOSION_VELOCITY_X - (PseudoRandom32() % 512u); });
|
||||
info.rotation = ({ 1000 - (PSEUDO_RANDOM_32() % 64u); });
|
||||
info.speed = ({ BOSS_EXPLOSION_VELOCITY_X - (PSEUDO_RANDOM_32() % 512u); });
|
||||
info.vram = (void *)(OBJ_VRAM0 + 0x2980);
|
||||
info.anim = SA2_ANIM_EXPLOSION;
|
||||
info.variant = 0;
|
||||
@@ -1025,16 +1025,16 @@ void sub_803FF44(EggTotem *totem)
|
||||
// _08040400
|
||||
|
||||
if (Mod(gStageTime, 13) == 0) {
|
||||
s32 rnd32 = PseudoRandom32();
|
||||
s32 rnd32 = PSEUDO_RANDOM_32();
|
||||
info.spawnX = I(totem->qUnk9C) - gCamera.x + (rnd32 % 64u) - 31;
|
||||
|
||||
rnd32 = PseudoRandom32();
|
||||
rnd32 = PSEUDO_RANDOM_32();
|
||||
info.spawnY = I(totem->qUnkA0) - gCamera.y + (rnd32 % 32u) - 16;
|
||||
|
||||
info.velocity = 0;
|
||||
|
||||
info.rotation = ({ 1000 - (PseudoRandom32() % 64u); });
|
||||
info.speed = ({ BOSS_EXPLOSION_VELOCITY_X - (PseudoRandom32() % 512u); });
|
||||
info.rotation = ({ 1000 - (PSEUDO_RANDOM_32() % 64u); });
|
||||
info.speed = ({ BOSS_EXPLOSION_VELOCITY_X - (PSEUDO_RANDOM_32() % 512u); });
|
||||
info.vram = (void *)(OBJ_VRAM0 + 0x2980);
|
||||
info.anim = SA2_ANIM_EXPLOSION;
|
||||
info.variant = 0;
|
||||
@@ -1052,16 +1052,16 @@ void sub_803FF44(EggTotem *totem)
|
||||
t3c->qUnkA += Q(0.125);
|
||||
} else if (--t3c->unk18 == 0) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
s32 rnd32 = PseudoRandom32();
|
||||
s32 rnd32 = PSEUDO_RANDOM_32();
|
||||
info.spawnX = I(t3c->qWorldX) - gCamera.x + (rnd32 % 64u) - 31;
|
||||
|
||||
rnd32 = PseudoRandom32();
|
||||
rnd32 = PSEUDO_RANDOM_32();
|
||||
info.spawnY = I(t3c->qWorldY) - gCamera.y + (rnd32 % 8u) - 3;
|
||||
|
||||
info.velocity = 0;
|
||||
|
||||
info.rotation = ({ 1000 - (PseudoRandom32() % 64u); });
|
||||
info.speed = ({ Q(4.0) - (PseudoRandom32() % 512u); });
|
||||
info.rotation = ({ 1000 - (PSEUDO_RANDOM_32() % 64u); });
|
||||
info.speed = ({ Q(4.0) - (PSEUDO_RANDOM_32() % 512u); });
|
||||
info.vram = (void *)(OBJ_VRAM0 + 0x2980);
|
||||
info.anim = SA2_ANIM_EXPLOSION;
|
||||
info.variant = 0;
|
||||
@@ -1097,7 +1097,7 @@ void sub_804063C(EggTotem *totem)
|
||||
const u8 *bp;
|
||||
s8 r6;
|
||||
|
||||
u8 rnd = PseudoRandom32();
|
||||
u8 rnd = PSEUDO_RANDOM_32();
|
||||
s8 v = Mod(rnd, 3);
|
||||
s8 r4 = gStageTime % 4u;
|
||||
|
||||
@@ -1108,7 +1108,7 @@ void sub_804063C(EggTotem *totem)
|
||||
|
||||
r2 = r4 * 3 + v;
|
||||
|
||||
if ((PseudoRandom32() % 2u) != 0) {
|
||||
if ((PSEUDO_RANDOM_32() % 2u) != 0) {
|
||||
if ((v == 0) && (totem->unk3C[EGGTOTEM_NUM_PLATFORMS - 1].unk13 == 0)) {
|
||||
r2 = 12;
|
||||
} else if ((v == 1) && (totem->unk3C[EGGTOTEM_NUM_PLATFORMS - 1].unk13 == 0)) {
|
||||
@@ -1213,7 +1213,7 @@ void sub_80408C4(EggTotem *totem)
|
||||
}
|
||||
} else if ((u16)t3c->unkE == 30 && t3c->unk14 != 0) {
|
||||
if (t3c->unk16 & 0x80) {
|
||||
if ((PseudoRandom32() % 2u) == 0) {
|
||||
if ((PSEUDO_RANDOM_32() % 2u) == 0) {
|
||||
s32 qx = t3c->qWorldX;
|
||||
s32 qy = t3c->qWorldY + Q(t3c->unk17);
|
||||
qy -= Q(t3c->unk15 * 3);
|
||||
|
||||
@@ -509,18 +509,18 @@ NONMATCH("asm/non_matching/game/sa2/stage/bosses/boss_4__sub_8041D34.inc", void
|
||||
do {
|
||||
#endif
|
||||
sub->unk6A = 0x30;
|
||||
rand = PseudoRandom32() + 0;
|
||||
rand = PSEUDO_RANDOM_32() + 0;
|
||||
spawnX = (I(sub->body.x));
|
||||
partsInfo.spawnX = (spawnX - gCamera.x) + (rand & 0x1F) - 0x1F;
|
||||
;
|
||||
|
||||
rand = PseudoRandom32() + 0;
|
||||
rand = PSEUDO_RANDOM_32() + 0;
|
||||
spawnY = (I(sub->body.y));
|
||||
partsInfo.spawnY = (spawnY - gCamera.y) + (rand % 64u) - 48;
|
||||
partsInfo.velocity = 0;
|
||||
|
||||
partsInfo.rotation = ({ (1000 - (PseudoRandom32() & 0x3F)); }) + 0;
|
||||
partsInfo.speed = ({ 1024 - (PseudoRandom32() & 0x1FF); }) + 0;
|
||||
partsInfo.rotation = ({ (1000 - (PSEUDO_RANDOM_32() & 0x3F)); }) + 0;
|
||||
partsInfo.speed = ({ 1024 - (PSEUDO_RANDOM_32() & 0x1FF); }) + 0;
|
||||
|
||||
partsInfo.vram = RESERVED_EXPLOSION_TILES_VRAM;
|
||||
partsInfo.anim = SA2_ANIM_EXPLOSION;
|
||||
@@ -540,20 +540,20 @@ NONMATCH("asm/non_matching/game/sa2/stage/bosses/boss_4__sub_8041D34.inc", void
|
||||
s32 spawnY, r5, r4;
|
||||
s32 temp;
|
||||
|
||||
rand = ({ PseudoRandom32() & 0xF; }) + 0;
|
||||
rand = ({ PSEUDO_RANDOM_32() & 0xF; }) + 0;
|
||||
|
||||
i = rand - Div(rand, 6) * 6;
|
||||
spawnX = I(sub->body.x);
|
||||
partsInfo.spawnX = (spawnX - gCamera.x) - rand * 2 + rand * 4;
|
||||
|
||||
rand = ({ PseudoRandom32() & 0xF; }) + 0;
|
||||
rand = ({ PSEUDO_RANDOM_32() & 0xF; }) + 0;
|
||||
spawnY = I(sub->body.y);
|
||||
partsInfo.spawnY = (spawnY - gCamera.y) - (rand * 2) + rand * 4;
|
||||
|
||||
partsInfo.velocity = Q_24_8(0.25);
|
||||
|
||||
partsInfo.rotation = ({ (PseudoRandom32() & 0x3FF); }) + 0;
|
||||
partsInfo.speed = ({ 1792 - (PseudoRandom32() & 0x1FF); }) + 0;
|
||||
partsInfo.rotation = ({ (PSEUDO_RANDOM_32() & 0x3FF); }) + 0;
|
||||
partsInfo.speed = ({ 1792 - (PSEUDO_RANDOM_32() & 0x1FF); }) + 0;
|
||||
|
||||
partsInfo.vram = (void *)(OBJ_VRAM0 + (gTileInfoBossScrews[i][0] * TILE_SIZE_4BPP));
|
||||
partsInfo.anim = gTileInfoBossScrews[i][1];
|
||||
@@ -573,8 +573,8 @@ NONMATCH("asm/non_matching/game/sa2/stage/bosses/boss_4__sub_8041D34.inc", void
|
||||
partsInfo.spawnY = spawnY - gCamera.y;
|
||||
|
||||
partsInfo.velocity = 0;
|
||||
partsInfo.rotation = ({ (1000 - (PseudoRandom32() & 0x3F)); }) + 0;
|
||||
partsInfo.speed = ({ 1152 - (PseudoRandom32() & 0x1FF); }) + 0;
|
||||
partsInfo.rotation = ({ (1000 - (PSEUDO_RANDOM_32() & 0x3F)); }) + 0;
|
||||
partsInfo.speed = ({ 1152 - (PSEUDO_RANDOM_32() & 0x1FF); }) + 0;
|
||||
|
||||
partsInfo.vram = RESERVED_EXPLOSION_TILES_VRAM;
|
||||
partsInfo.anim = SA2_ANIM_EXPLOSION;
|
||||
@@ -594,8 +594,8 @@ NONMATCH("asm/non_matching/game/sa2/stage/bosses/boss_4__sub_8041D34.inc", void
|
||||
partsInfo.spawnY = spawnY - gCamera.y;
|
||||
|
||||
partsInfo.velocity = 0;
|
||||
partsInfo.rotation = ({ (1000 - (PseudoRandom32() % 64u)); }) + 0;
|
||||
partsInfo.speed = ({ 1024 - (PseudoRandom32() % 512u); }) + 0;
|
||||
partsInfo.rotation = ({ (1000 - (PSEUDO_RANDOM_32() % 64u)); }) + 0;
|
||||
partsInfo.speed = ({ 1024 - (PSEUDO_RANDOM_32() % 512u); }) + 0;
|
||||
|
||||
partsInfo.vram = RESERVED_EXPLOSION_TILES_VRAM;
|
||||
partsInfo.anim = SA2_ANIM_EXPLOSION;
|
||||
@@ -1007,7 +1007,7 @@ static void CreateAeroEggBombDebris(AeroEgg *boss, s32 screenX, s32 screenY, s16
|
||||
s->x = I(screenX);
|
||||
s->y = I(deb->screenY);
|
||||
|
||||
if (PseudoRandom32() % 2u) {
|
||||
if (PSEUDO_RANDOM_32() % 2u) {
|
||||
s->graphics.dest = boss->sub.tilesBomb + (32 * TILE_SIZE_4BPP);
|
||||
s->graphics.anim = SA2_ANIM_AERO_EGG_DEBRIS_BIG;
|
||||
s->variant = 0;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "trig.h"
|
||||
@@ -522,7 +523,7 @@ void sub_80436E4(EggSaucer *boss)
|
||||
boss->unkDC[i][0] = x + (x2 >> 3);
|
||||
boss->unkDC[i][1] = y + (y2 >> 3);
|
||||
|
||||
boss->unk10C[i][0] = Q_8_8(5.25) - (PseudoRandom32() & 255)
|
||||
boss->unk10C[i][0] = Q_8_8(5.25) - (PSEUDO_RANDOM_32() & 255)
|
||||
|
||||
#ifndef NON_MATCHING
|
||||
+ i * 2 - i * 2;
|
||||
@@ -775,13 +776,13 @@ void sub_8043E2C(EggSaucer *boss)
|
||||
if (Mod(gStageTime, 3) == 0) {
|
||||
u32 rand;
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
explosion.spawnX = (I(x) - gCamera.x) + (rand & 15) - 8;
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
explosion.spawnY = (I(y) - gCamera.y) + (rand & 15) - 8;
|
||||
explosion.velocity = 0;
|
||||
|
||||
explosion.rotation = ({ 1055 - (PseudoRandom32() & 63); });
|
||||
explosion.rotation = ({ 1055 - (PSEUDO_RANDOM_32() & 63); });
|
||||
explosion.speed = Q_8_8(5);
|
||||
explosion.vram = (void *)OBJ_VRAM0 + 0x2980;
|
||||
explosion.anim = SA2_ANIM_EXPLOSION;
|
||||
@@ -1232,7 +1233,7 @@ static void sub_8044B28(EggSaucer *boss)
|
||||
}
|
||||
|
||||
if (++boss->unkBC >= 0x50) {
|
||||
if (boss->gunHealth != 0 || (PseudoRandom32() & 1)) {
|
||||
if (boss->gunHealth != 0 || (PSEUDO_RANDOM_32() & 1)) {
|
||||
boss->unkBC = 0;
|
||||
boss->armStateTimer = 64;
|
||||
boss->armState = 2;
|
||||
@@ -1667,14 +1668,14 @@ NONMATCH("asm/non_matching/game/sa2/stage/bosses/boss_5__sub_8045564.inc", void
|
||||
s32 rand;
|
||||
|
||||
if (Mod(gStageTime, 7) == 0) {
|
||||
rand = ({ (PseudoRandom32() & 0x1f) + 0x18; }) + 0;
|
||||
rand = ({ (PSEUDO_RANDOM_32() & 0x1f) + 0x18; }) + 0;
|
||||
index = CLAMP_SIN_PERIOD(gStageTime * 900) + 0;
|
||||
e.spawnX = (Q_24_8_TO_INT(boss->x) - gCamera.x);
|
||||
e.spawnX += ((rand * COS(index)) >> 14);
|
||||
e.spawnY = (Q_24_8_TO_INT(boss->y) - gCamera.y);
|
||||
e.spawnY += ((rand * SIN(index)) >> 14);
|
||||
e.velocity = 0;
|
||||
e.rotation = ({ 0x407 - (PseudoRandom32() & 0x3F); }) + 0;
|
||||
e.rotation = ({ 0x407 - (PSEUDO_RANDOM_32() & 0x3F); }) + 0;
|
||||
e.speed = 0x500;
|
||||
e.vram = (void *)OBJ_VRAM0 + 0x2980;
|
||||
e.anim = SA2_ANIM_EXPLOSION;
|
||||
@@ -1685,7 +1686,7 @@ NONMATCH("asm/non_matching/game/sa2/stage/bosses/boss_5__sub_8045564.inc", void
|
||||
|
||||
if (Mod(gStageTime, 10) == 0) {
|
||||
u8 val2;
|
||||
rand = ({ (PseudoRandom32() & 0x1f) + 0x18; }) + 0;
|
||||
rand = ({ (PSEUDO_RANDOM_32() & 0x1f) + 0x18; }) + 0;
|
||||
index = CLAMP_SIN_PERIOD(gStageTime * 900) + 0;
|
||||
val2 = Mod(gStageTime, 6);
|
||||
e.spawnX = (Q_24_8_TO_INT(boss->x) - gCamera.x);
|
||||
@@ -1693,7 +1694,7 @@ NONMATCH("asm/non_matching/game/sa2/stage/bosses/boss_5__sub_8045564.inc", void
|
||||
e.spawnY = (Q_24_8_TO_INT(boss->y) - gCamera.y);
|
||||
e.spawnY += ((rand * SIN(index)) >> 14);
|
||||
e.velocity = 0x40;
|
||||
e.rotation = ({ (PseudoRandom32() & 0x3FF); }) + 0;
|
||||
e.rotation = ({ (PSEUDO_RANDOM_32() & 0x3FF); }) + 0;
|
||||
e.speed = 0x600;
|
||||
e.vram = (void *)OBJ_VRAM0 + (gTileInfoBossScrews[val2][0] * 0x20);
|
||||
e.anim = gTileInfoBossScrews[val2][1];
|
||||
@@ -1704,12 +1705,12 @@ NONMATCH("asm/non_matching/game/sa2/stage/bosses/boss_5__sub_8045564.inc", void
|
||||
|
||||
if (Mod(gStageTime, 9) == 0) {
|
||||
u32 r4;
|
||||
rand = PseudoRandom32() & 0xf;
|
||||
rand = PSEUDO_RANDOM_32() & 0xf;
|
||||
|
||||
e.spawnX = (Q_24_8_TO_INT(boss->cabinX) - gCamera.x);
|
||||
e.spawnX += rand & 0xf;
|
||||
e.spawnX -= 8;
|
||||
rand = PseudoRandom32() + 0;
|
||||
rand = PSEUDO_RANDOM_32() + 0;
|
||||
e.spawnY = (Q_24_8_TO_INT(boss->cabinY) - gCamera.y);
|
||||
e.spawnY += (rand & 0xf);
|
||||
e.spawnY -= 8;
|
||||
@@ -1718,7 +1719,7 @@ NONMATCH("asm/non_matching/game/sa2/stage/bosses/boss_5__sub_8045564.inc", void
|
||||
#endif
|
||||
e.velocity = 0;
|
||||
|
||||
e.rotation = ({ 0x407 - (PseudoRandom32() & 63); }) + 0;
|
||||
e.rotation = ({ 0x407 - (PSEUDO_RANDOM_32() & 63); }) + 0;
|
||||
e.speed = 0x500;
|
||||
e.vram = (void *)OBJ_VRAM0 + 0x2980;
|
||||
e.anim = SA2_ANIM_EXPLOSION;
|
||||
@@ -1729,11 +1730,11 @@ NONMATCH("asm/non_matching/game/sa2/stage/bosses/boss_5__sub_8045564.inc", void
|
||||
|
||||
if (Mod(gStageTime, 0xB) == 0) {
|
||||
u32 r3;
|
||||
rand = PseudoRandom32() & 0xF;
|
||||
rand = PSEUDO_RANDOM_32() & 0xF;
|
||||
e.spawnX = (Q_24_8_TO_INT(boss->armBaseX) - gCamera.x);
|
||||
e.spawnX += rand & new_var;
|
||||
e.spawnX -= 8;
|
||||
rand = PseudoRandom32() + 0;
|
||||
rand = PSEUDO_RANDOM_32() + 0;
|
||||
e.spawnY = (Q_24_8_TO_INT(boss->armBaseY) - gCamera.y);
|
||||
e.spawnY += (rand & new_var);
|
||||
e.spawnY -= 8;
|
||||
@@ -1741,7 +1742,7 @@ NONMATCH("asm/non_matching/game/sa2/stage/bosses/boss_5__sub_8045564.inc", void
|
||||
#ifndef NON_MATCHING
|
||||
rand = 0x6000000 + 0x10000;
|
||||
#endif
|
||||
e.rotation = ({ 0x407 - (PseudoRandom32() & 63); }) + 0;
|
||||
e.rotation = ({ 0x407 - (PSEUDO_RANDOM_32() & 63); }) + 0;
|
||||
e.speed = 0x500;
|
||||
e.vram = (void *)OBJ_VRAM0 + 0x2980;
|
||||
e.anim = SA2_ANIM_EXPLOSION;
|
||||
|
||||
@@ -933,14 +933,14 @@ static void sub_8046F00(EggGoRound *boss)
|
||||
for (j = 0; j < NUM_LINKS; j++) {
|
||||
u32 rand;
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
explosion.spawnX = x + (rand % 16) - 8;
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
explosion.spawnY = y + (rand % 16) - 8;
|
||||
|
||||
explosion.velocity = 0;
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
explosion.rotation = idx - (rand % 64) + 31;
|
||||
explosion.speed = Q(10) - (j * Q(2));
|
||||
explosion.vram = (void *)OBJ_VRAM0 + (0x2980);
|
||||
@@ -963,15 +963,15 @@ static void sub_8047060(EggGoRound *boss)
|
||||
ExplosionPartsInfo explosion;
|
||||
x = (I(boss->x) - gCamera.x);
|
||||
y = (I(boss->y) - gCamera.y);
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
explosion.spawnX = x + (rand % 64) - 31;
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
explosion.spawnY = y + (rand % 64) - 31;
|
||||
|
||||
explosion.velocity = 0;
|
||||
explosion.rotation = ({ 1031 - ((PseudoRandom32() % 64u)); });
|
||||
explosion.speed = ({ Q(4) - (PseudoRandom32() % (unsigned)Q(2)); });
|
||||
explosion.rotation = ({ 1031 - ((PSEUDO_RANDOM_32() % 64u)); });
|
||||
explosion.speed = ({ Q(4) - (PSEUDO_RANDOM_32() % (unsigned)Q(2)); });
|
||||
explosion.vram = (void *)OBJ_VRAM0 + 0x2980;
|
||||
explosion.anim = SA2_ANIM_EXPLOSION;
|
||||
explosion.variant = 0;
|
||||
@@ -991,15 +991,15 @@ static void sub_8047138(EggGoRound *boss)
|
||||
ExplosionPartsInfo explosion;
|
||||
x = (I(destruction->cabin.x) - gCamera.x);
|
||||
y = (I(destruction->cabin.y) - gCamera.y);
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
explosion.spawnX = x + (rand % 64) - 31;
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
explosion.spawnY = y + (rand % 64) - 31;
|
||||
|
||||
explosion.velocity = 0;
|
||||
explosion.rotation = ({ 1031 - ((PseudoRandom32() % 64u)); });
|
||||
explosion.speed = ({ Q(4) - (PseudoRandom32() % (unsigned)Q(2)); });
|
||||
explosion.rotation = ({ 1031 - ((PSEUDO_RANDOM_32() % 64u)); });
|
||||
explosion.speed = ({ Q(4) - (PSEUDO_RANDOM_32() % (unsigned)Q(2)); });
|
||||
explosion.vram = (void *)OBJ_VRAM0 + 0x2980;
|
||||
explosion.anim = SA2_ANIM_EXPLOSION;
|
||||
explosion.variant = 0;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include "core.h"
|
||||
#include "background.h"
|
||||
#include "trig.h"
|
||||
|
||||
#include "game/globals.h"
|
||||
@@ -406,14 +408,14 @@ static void sub_8047F0C(void)
|
||||
if (Mod(gStageTime, 7) == 0 && boss->unk65 == 0) {
|
||||
ExplosionPartsInfo explosion;
|
||||
u32 rand;
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
explosion.spawnX = (I(boss->x) - gCamera.x) + (rand & 0x3F) - 0x1F;
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
explosion.spawnY = (I(boss->y) - gCamera.y) + (rand & 0x3F) - 0x1F;
|
||||
|
||||
explosion.velocity = 0;
|
||||
explosion.rotation = ({ 1000 - ((PseudoRandom32() % 64u)); });
|
||||
explosion.speed = ({ Q(4) - (PseudoRandom32() % (unsigned)Q(2)); });
|
||||
explosion.rotation = ({ 1000 - ((PSEUDO_RANDOM_32() % 64u)); });
|
||||
explosion.speed = ({ Q(4) - (PSEUDO_RANDOM_32() % (unsigned)Q(2)); });
|
||||
explosion.vram = (void *)OBJ_VRAM0 + 0x2980;
|
||||
explosion.anim = SA2_ANIM_EXPLOSION;
|
||||
explosion.variant = 0;
|
||||
@@ -547,7 +549,7 @@ static void sub_80484C8(EggFrog *boss)
|
||||
r1 = 0;
|
||||
} else {
|
||||
|
||||
r1 = PseudoRandom32() & 1;
|
||||
r1 = PSEUDO_RANDOM_32() & 1;
|
||||
}
|
||||
boss->unk1A = r1;
|
||||
|
||||
|
||||
@@ -7,9 +7,11 @@
|
||||
#include "flags.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
#include "background.h"
|
||||
#include "bg_triangles.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/globals.h"
|
||||
#include "game/shared/stage/camera.h"
|
||||
#include "game/shared/stage/collision.h"
|
||||
@@ -1124,7 +1126,7 @@ void sub_804AE40(SuperEggRoboZ *boss)
|
||||
InitHBlankBgOffsets(0);
|
||||
|
||||
sub_80075D0(0, 0, DISPLAY_HEIGHT, r8, r6, ({
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
I(SIN(((boss->unk12 - 90) * 8) % 256u))
|
||||
+(rand % 8u);
|
||||
}));
|
||||
@@ -1145,7 +1147,7 @@ void sub_804AE40(SuperEggRoboZ *boss)
|
||||
// _0804B02A
|
||||
|
||||
if (boss->unk12 < 70) {
|
||||
s32 rand = (PseudoRandom32());
|
||||
s32 rand = (PSEUDO_RANDOM_32());
|
||||
r4 = (boss->unk12 >> 1) + ((rand % 8u) + 8);
|
||||
|
||||
if (boss->unk12 > 60) {
|
||||
@@ -1153,7 +1155,7 @@ void sub_804AE40(SuperEggRoboZ *boss)
|
||||
}
|
||||
} else {
|
||||
// _0804B074
|
||||
s32 rand = PseudoRandom32();
|
||||
s32 rand = PSEUDO_RANDOM_32();
|
||||
r4 = ((116 - boss->unk12) >> 2) + ((rand % 8u) + 30);
|
||||
}
|
||||
// _0804B096
|
||||
@@ -1644,9 +1646,9 @@ static void sub_804C080(SuperEggRoboZ *boss)
|
||||
ExplosionPartsInfo info;
|
||||
|
||||
if ((gStageTime & 0x7) == 0) {
|
||||
s32 rand = PseudoRandom32();
|
||||
s32 rand = PSEUDO_RANDOM_32();
|
||||
info.spawnX = gCamera.x + (rand & 0xFF);
|
||||
info.spawnY = gCamera.y + (PseudoRandom32() & 0xFF);
|
||||
info.spawnY = gCamera.y + (PSEUDO_RANDOM_32() & 0xFF);
|
||||
info.velocity = Q(18. / 256.);
|
||||
info.rotation = (PseudoRandBetween(0, SIN_PERIOD));
|
||||
// '= rand =' needed for matching
|
||||
@@ -1669,15 +1671,15 @@ static void sub_804C080(SuperEggRoboZ *boss)
|
||||
|
||||
if (((gStageTime + 3) & 0x7) == 0) {
|
||||
s32 rand;
|
||||
u8 r4 = PseudoRandom32();
|
||||
u8 r4 = PSEUDO_RANDOM_32();
|
||||
r4 &= 0xF;
|
||||
r4 -= Div(r4, 6) * 6;
|
||||
|
||||
rand = PseudoRandom32();
|
||||
rand = PSEUDO_RANDOM_32();
|
||||
info.spawnX = gCamera.x + (rand & 0xFF);
|
||||
info.spawnY = gCamera.y + (PseudoRandom32() & 0xFF);
|
||||
info.spawnY = gCamera.y + (PSEUDO_RANDOM_32() & 0xFF);
|
||||
info.velocity = Q(0.125);
|
||||
info.rotation = (PseudoRandom32() & ONE_CYCLE);
|
||||
info.rotation = (PSEUDO_RANDOM_32() & ONE_CYCLE);
|
||||
info.speed = Q(2);
|
||||
|
||||
info.vram = (OBJ_VRAM0 + (gTileInfoBossScrews[r4][0] * TILE_SIZE_4BPP));
|
||||
@@ -1721,7 +1723,7 @@ void sub_804C240(SuperEggRoboZ *boss, u8 arm)
|
||||
info.velocity = 0;
|
||||
info.rotation = sub_8004418(-(boss->qUnk34[arm][1] >> 3), -(boss->qUnk34[arm][0] >> 3));
|
||||
|
||||
info.rotation = ({ ((PseudoRandom32() & chance) + info.rotation) - 0x10; })
|
||||
info.rotation = ({ ((PSEUDO_RANDOM_32() & chance) + info.rotation) - 0x10; })
|
||||
#ifndef NON_MATCHING
|
||||
& (SIN_PERIOD - one);
|
||||
#else
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
#include "flags.h"
|
||||
#include "rect.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/math.h"
|
||||
#include "game/sa2/stage/bosses/common.h"
|
||||
#include "game/sa2/stage/bosses/boss_9.h"
|
||||
@@ -1132,8 +1135,8 @@ void sub_804DEEC(s32 qX, s32 qY)
|
||||
if (unk594->unk4[i] == 0) {
|
||||
unk594->unk4[i] = 1;
|
||||
unk594->unkE[i] = 60;
|
||||
unk594->unk18[i][0] = (PseudoRandom32() & 0xFF) - Q(2);
|
||||
unk594->unk18[i][1] = (PseudoRandom32() & 0xFF) - Q(2);
|
||||
unk594->unk18[i][0] = (PSEUDO_RANDOM_32() & 0xFF) - Q(2);
|
||||
unk594->unk18[i][1] = (PSEUDO_RANDOM_32() & 0xFF) - Q(2);
|
||||
|
||||
unk594->unk40[i].x = qX;
|
||||
unk594->unk40[i].y = qY;
|
||||
@@ -1308,7 +1311,7 @@ void sub_804E15C(struct TA53_unk48 *unk48)
|
||||
gBldRegs.bldY = r5;
|
||||
|
||||
// NOTE: Why would you call Mod() for % 8? *sigh*
|
||||
r4 = (s8)Mod(PseudoRandom32(), 8);
|
||||
r4 = (s8)Mod(PSEUDO_RANDOM_32(), 8);
|
||||
if (r4 < 0) {
|
||||
r4 = -r4;
|
||||
}
|
||||
@@ -2366,7 +2369,7 @@ void sub_804FE24(struct TA53_unk654 *unk654)
|
||||
unk654->callback = sub_804FEFC;
|
||||
unk654->unk8 = 101;
|
||||
|
||||
funcId = Mod((u8)PseudoRandom32(), ARRAY_COUNT(gUnknown_080D89AC));
|
||||
funcId = Mod((u8)PSEUDO_RANDOM_32(), ARRAY_COUNT(gUnknown_080D89AC));
|
||||
unk654->func4 = gUnknown_080D89AC[funcId];
|
||||
|
||||
s = &unk654->spr128;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "core.h"
|
||||
#include "task.h"
|
||||
#include "sprite.h"
|
||||
#include "background.h"
|
||||
#include "trig.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
@@ -68,7 +68,7 @@ static void Task_BellMain(void)
|
||||
bell->unk4C--;
|
||||
|
||||
if (bell->unk4C == 0) {
|
||||
if (PseudoRandom32() & 1) {
|
||||
if (PSEUDO_RANDOM_32() & 1) {
|
||||
bell->unk4C = 124;
|
||||
} else {
|
||||
bell->unk4C = 180;
|
||||
|
||||
Loaded 100 of 133 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user