Skip to content

Commit

Permalink
Python script changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pseurae committed Oct 18, 2024
1 parent f998b91 commit bcd7d0a
Show file tree
Hide file tree
Showing 15 changed files with 693 additions and 1,769 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ build
.vscode
armips
output.*
output-*.png
snakewood.*
pokeruby.map
.D[Ss]_[Ss]tore
[Dd]esktop.ini
*.ips
*.ips
__pycache__
57 changes: 29 additions & 28 deletions include/constants/event_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,38 @@
// These are dynamic object gfx ids.
// They correspond with the values of the VAR_OBJ_GFX_ID_X vars.
// More info about them in include/constants/vars.h
#define OBJ_EVENT_GFX_VARS 240
#define OBJ_EVENT_GFX_VAR_0 (OBJ_EVENT_GFX_VARS + 0x0)
#define OBJ_EVENT_GFX_VAR_1 (OBJ_EVENT_GFX_VARS + 0x1)
#define OBJ_EVENT_GFX_VAR_2 (OBJ_EVENT_GFX_VARS + 0x2)
#define OBJ_EVENT_GFX_VAR_3 (OBJ_EVENT_GFX_VARS + 0x3)
#define OBJ_EVENT_GFX_VAR_4 (OBJ_EVENT_GFX_VARS + 0x4)
#define OBJ_EVENT_GFX_VAR_5 (OBJ_EVENT_GFX_VARS + 0x5)
#define OBJ_EVENT_GFX_VAR_6 (OBJ_EVENT_GFX_VARS + 0x6)
#define OBJ_EVENT_GFX_VAR_7 (OBJ_EVENT_GFX_VARS + 0x7)
#define OBJ_EVENT_GFX_VAR_8 (OBJ_EVENT_GFX_VARS + 0x8)
#define OBJ_EVENT_GFX_VAR_9 (OBJ_EVENT_GFX_VARS + 0x9)
#define OBJ_EVENT_GFX_VAR_A (OBJ_EVENT_GFX_VARS + 0xA)
#define OBJ_EVENT_GFX_VAR_B (OBJ_EVENT_GFX_VARS + 0xB)
#define OBJ_EVENT_GFX_VAR_C (OBJ_EVENT_GFX_VARS + 0xC)
#define OBJ_EVENT_GFX_VAR_D (OBJ_EVENT_GFX_VARS + 0xD)
#define OBJ_EVENT_GFX_VAR_E (OBJ_EVENT_GFX_VARS + 0xE)
#define OBJ_EVENT_GFX_VAR_F (OBJ_EVENT_GFX_VARS + 0xF) // 255
#define OBJ_EVENT_GFX_VARS 240
#define OBJ_EVENT_GFX_VAR_0 (OBJ_EVENT_GFX_VARS + 0x0)
#define OBJ_EVENT_GFX_VAR_1 (OBJ_EVENT_GFX_VARS + 0x1)
#define OBJ_EVENT_GFX_VAR_2 (OBJ_EVENT_GFX_VARS + 0x2)
#define OBJ_EVENT_GFX_VAR_3 (OBJ_EVENT_GFX_VARS + 0x3)
#define OBJ_EVENT_GFX_VAR_4 (OBJ_EVENT_GFX_VARS + 0x4)
#define OBJ_EVENT_GFX_VAR_5 (OBJ_EVENT_GFX_VARS + 0x5)
#define OBJ_EVENT_GFX_VAR_6 (OBJ_EVENT_GFX_VARS + 0x6)
#define OBJ_EVENT_GFX_VAR_7 (OBJ_EVENT_GFX_VARS + 0x7)
#define OBJ_EVENT_GFX_VAR_8 (OBJ_EVENT_GFX_VARS + 0x8)
#define OBJ_EVENT_GFX_VAR_9 (OBJ_EVENT_GFX_VARS + 0x9)
#define OBJ_EVENT_GFX_VAR_A (OBJ_EVENT_GFX_VARS + 0xA)
#define OBJ_EVENT_GFX_VAR_B (OBJ_EVENT_GFX_VARS + 0xB)
#define OBJ_EVENT_GFX_VAR_C (OBJ_EVENT_GFX_VARS + 0xC)
#define OBJ_EVENT_GFX_VAR_D (OBJ_EVENT_GFX_VARS + 0xD)
#define OBJ_EVENT_GFX_VAR_E (OBJ_EVENT_GFX_VARS + 0xE)
#define OBJ_EVENT_GFX_VAR_F (OBJ_EVENT_GFX_VARS + 0xF) // 255

#define SHADOW_SIZE_S 0
#define SHADOW_SIZE_M 1
#define SHADOW_SIZE_L 2
#define SHADOW_SIZE_XL 3
#define SHADOW_SIZE_S 0
#define SHADOW_SIZE_M 1
#define SHADOW_SIZE_L 2
#define SHADOW_SIZE_XL 3

#define TRACKS_NONE 0
#define TRACKS_FOOT 1
#define TRACKS_BIKE_TIRE 2
#define TRACKS_NONE 0
#define TRACKS_FOOT 1
#define TRACKS_BIKE_TIRE 2

#define OBJ_KIND_NORMAL 0
#define OBJ_KIND_CLONE 255 // Exclusive to FRLG
#define OBJ_KIND_NORMAL 0
#define OBJ_KIND_CLONE 255 // Exclusive to FRLG

#define OBJ_EVENT_ID_PLAYER 0xFF
#define OBJ_EVENT_ID_CAMERA 0x7F
#define OBJ_EVENT_ID_FOLLOWER 0xFE
#define OBJ_EVENT_ID_PLAYER 0xFF
#define OBJ_EVENT_ID_CAMERA 0x7F

#endif // GUARD_CONSTANTS_EVENT_OBJECTS_H
3 changes: 3 additions & 0 deletions include/event_object_movement.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ void LONG_CALL ObjectEventGetLocalIdAndMap(struct ObjectEvent *, void *, void *,
void LONG_CALL ObjectEventClearHeldMovementIfActive(struct ObjectEvent *);
void LONG_CALL ObjectEventClearHeldMovement(struct ObjectEvent *);
void LONG_CALL FreezeObjectEvents(void);
u8 LONG_CALL SpawnSpecialObjectEvent(struct ObjectEventTemplate *objectEventTemplate);
void LONG_CALL RemoveObjectEvent(struct ObjectEvent *objectEvent);
u8 LONG_CALL SpawnSpecialObjectEventParametrized(u8 graphicsId, u8 movementType, u8 localId, s16 x, s16 y, u8 elevation);

#define GROUND_EFFECT_FLAG_TALL_GRASS_ON_SPAWN (1 << 0)
#define GROUND_EFFECT_FLAG_TALL_GRASS_ON_MOVE (1 << 1)
Expand Down
17 changes: 17 additions & 0 deletions include/fieldmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,23 @@ struct PACKED ObjectEventGraphicsInfo
/*0x20*/ const union AffineAnimCmd *const *affineAnims;
};

struct PACKED ObjectEventTemplate
{
/*0x00*/ u8 localId;
/*0x01*/ u8 graphicsId;
/*0x02*/ u8 kind; // Always OBJ_KIND_NORMAL in Ruby/Sapphire.
/*0x04*/ s16 x;
/*0x06*/ s16 y;
/*0x08*/ u8 elevation;
/*0x09*/ u8 movementType;
/*0x0A*/ u8 movementRangeX:4;
u8 movementRangeY:4;
/*0x0C*/ u16 trainerType;
/*0x0E*/ u16 trainerRange_berryTreeId;
/*0x10*/ const u8 *script;
/*0x14*/ u16 flagId;
};

extern struct MapHeader gMapHeader;

void LONG_CALL LoadMapTilesetPalettes(struct MapLayout *mapLayout);
Expand Down
1 change: 1 addition & 0 deletions include/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ void LONG_CALL Menu_DestroyCursor(void);
u8 LONG_CALL InitMenu(u8, u8, u8, u8, u8, u8);
u8 LONG_CALL Menu_MoveCursor(s8);

void LONG_CALL ResetGpuAndVram(void);
void LONG_CALL ClearTilemapBuffers(void);

enum
Expand Down
26 changes: 13 additions & 13 deletions include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ typedef u8 bool8;
typedef u16 bool16;
typedef u32 bool32;

struct Coords16
{
s16 x;
s16 y;
};

struct UCoords16
{
u16 x;
u16 y;
};

#define EWRAM_DATA __attribute__((section(".ewram")))
#define PACKED __attribute__((packed))
#define LONG_CALL __attribute__((long_call))
Expand All @@ -58,4 +46,16 @@ struct UCoords16
#define INCBIN_U32 INCBIN
#define INCBIN_S8 INCBIN
#define INCBIN_S16 INCBIN
#define INCBIN_S32 INCBIN
#define INCBIN_S32 INCBIN

struct PACKED Coords16
{
s16 x;
s16 y;
};

struct PACKED UCoords16
{
u16 x;
u16 y;
};
2 changes: 1 addition & 1 deletion linker/text.ld
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,4 @@ SquishCursor = 0x80b6914 | 1;
SetInputState = 0x80b6210 | 1;
MainState_StartPageSwap = 0x80b61c8 | 1;
GetTextEntryPosition = 0x80b6f44 | 1;
sub_80F9368 = 0x80f9368 | 1;
ResetGpuAndVram = 0x80f9368 | 1;
32 changes: 0 additions & 32 deletions new_moves.txt

This file was deleted.

Loading

0 comments on commit bcd7d0a

Please sign in to comment.