Skip to content

Commit

Permalink
many string things, some trainer stuff and more stuff...
Browse files Browse the repository at this point in the history
  • Loading branch information
SBird1337 committed Sep 15, 2018
1 parent ea64db6 commit c407f7e
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/include/pokeagb/battle/trainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "../pokemon.h"
#include "../overworld/item.h"
#include "../overworld/npc.h"
#include "../graphics/sprites.h"

#define TRAINER_COUNT 743
#define TRAINER_CLASS_COUNT 107
Expand Down Expand Up @@ -117,6 +118,9 @@ const struct Trainer trainer_data[TRAINER_COUNT];
*/
extern pchar trainer_class_names[TRAINER_CLASS_COUNT][13];

extern struct SpriteTiles trainer_battle_sprites[];
extern struct SpritePalette trainer_battle_palettes[];

/**
* Fill the trainer party using the Pokemon from the trainer data.
*
Expand Down
1 change: 1 addition & 0 deletions build/include/pokeagb/core/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ extern volatile __writeonly u8 REG_HALTCNT;
#define WINOUT_BUILD(outside, object) ((outside) | ((object) << 8))

#define WIN_ENALL_NO_BLD (WIN_BG0 | WIN_BG1 | WIN_BG2 | WIN_BG3 | WIN_OBJ)
#define WIN_ENALL_BLD (WIN_BG0 | WIN_BG1 | WIN_BG2 | WIN_BG3 | WIN_OBJ | WIN_BLD)

#define BLDCNT_BG0_SRC (1 << 0)
#define BLDCNT_BG1_SRC (1 << 1)
Expand Down
22 changes: 22 additions & 0 deletions build/include/pokeagb/core/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,18 @@ POKEAGB_EXTERN u8 rboxid_clean(u8 id, bool update);
*/
POKEAGB_EXTERN u8 rboxid_free(u8 id);

/**
* Shows the choose a name dialog
* @param mode Mode (0: OW, 5: pkmn)
* @param out String output
* @param sprite sprite ID
* @param a4 pa4
* @param pid Pokémon PID (mode 5)
* @param func return function
* @address{BPRE,0809D954}
*/
POKEAGB_EXTERN void name_chooser_enter(u8 mode, pchar* out, u16 sprite, u16 a4, u32 pid, void (*func)());

/**
*
* @address{BPRE,080F7768}
Expand Down Expand Up @@ -364,6 +376,16 @@ POKEAGB_EXTERN u32 rboxid_get_field(u8 rid, u8 field);
*/
POKEAGB_EXTERN void rboxid_add_812E5A4(u8, u8, u8, u8, u8, u8, u32*, u8, pchar*);

/**
* @address{BPRE,080F6E9C}
*/
POKEAGB_EXTERN void textbox_setup_something(void);

/**
* @address{BPRE,08069348}
*/
POKEAGB_EXTERN void textbox_setup_something2(void);

POKEAGB_END_DECL

#endif /* POKEAGB_CORE_STRING_H_ */
3 changes: 3 additions & 0 deletions build/include/pokeagb/graphics/palette.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ union Color {
u16 packed;
};

#define crgb5(r,g,b) (union Color)(((u16)(((b) << 10) | ((g)<<5) | ((r)))))
#define rgb82rgb5(r,g,b) (crgb5(r/8, g/8, b/8))

/**
* @address{BPRE,02037AB8}
*/
Expand Down
5 changes: 5 additions & 0 deletions build/include/pokeagb/overworld/script.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ POKEAGB_EXTERN void script_env_2_enable_and_set_ctx_running(void);
*/
POKEAGB_EXTERN void script_env_2_enable_and_set_ctx_paused(void);

/**
* @address{BPRE,08069AA8}
*/
POKEAGB_EXTERN void script_execute_maybe(void);

/**
* Read a half word and advance the script pointer
* @address{BPRE,080698F8}
Expand Down
4 changes: 4 additions & 0 deletions build/linker/BPRE.ld
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ PROVIDE(fcode_buffer4 = 0x02021d04);
PROVIDE(fdecoder = 0x08008fcc|1);
PROVIDE(fmt_int_10 = 0x08008e78|1);
PROVIDE(font_get_width_of_string = 0x08005ed4|1);
PROVIDE(name_chooser_enter = 0x0809d954|1);
PROVIDE(pstrcat = 0x08008da4|1);
PROVIDE(pstrcpy = 0x08008d84|1);
PROVIDE(pstrlen = 0x08008e08|1);
Expand All @@ -352,6 +353,8 @@ PROVIDE(remoboxes_upload_tilesets = 0x08002de8|1);
PROVIDE(string_buffer = 0x02021d18);
PROVIDE(textbox_close = 0x080694f4|1);
PROVIDE(textbox_fdecode_auto_and_task_add = 0x080694c8|1);
PROVIDE(textbox_setup_something = 0x080f6e9c|1);
PROVIDE(textbox_setup_something2 = 0x08069348|1);
PROVIDE(textbox_spawn_scroll_arrows = 0x08133a20|1);
PROVIDE(textbox_task_delete_scroll_arrows = 0x08133c30|1);
PROVIDE(write_to_rbox = 0x0804a648|1);
Expand Down Expand Up @@ -616,6 +619,7 @@ PROVIDE(script_env_2_is_enabled = 0x08069958|1);
PROVIDE(script_env_disable = 0x0806994c|1);
PROVIDE(script_env_enable = 0x08069940|1);
PROVIDE(script_env_init_script = 0x08069ae4|1);
PROVIDE(script_execute_maybe = 0x08069aa8|1);
PROVIDE(script_read_halfword = 0x080698f8|1);
PROVIDE(script_read_word = 0x08069910|1);
PROVIDE(scripting_npc = 0x03005074);
Expand Down
4 changes: 4 additions & 0 deletions include/pokeagb/battle/trainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "../pokemon.h"
#include "../overworld/item.h"
#include "../overworld/npc.h"
#include "../graphics/sprites.h"

#define TRAINER_COUNT 743
#define TRAINER_CLASS_COUNT 107
Expand Down Expand Up @@ -117,6 +118,9 @@ const struct Trainer trainer_data[TRAINER_COUNT];
*/
extern pchar trainer_class_names[TRAINER_CLASS_COUNT][13];

extern struct SpriteTiles trainer_battle_sprites[];
extern struct SpritePalette trainer_battle_palettes[];

/**
* Fill the trainer party using the Pokemon from the trainer data.
*
Expand Down
1 change: 1 addition & 0 deletions include/pokeagb/core/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ extern volatile __writeonly u8 REG_HALTCNT;
#define WINOUT_BUILD(outside, object) ((outside) | ((object) << 8))

#define WIN_ENALL_NO_BLD (WIN_BG0 | WIN_BG1 | WIN_BG2 | WIN_BG3 | WIN_OBJ)
#define WIN_ENALL_BLD (WIN_BG0 | WIN_BG1 | WIN_BG2 | WIN_BG3 | WIN_OBJ | WIN_BLD)

#define BLDCNT_BG0_SRC (1 << 0)
#define BLDCNT_BG1_SRC (1 << 1)
Expand Down
22 changes: 22 additions & 0 deletions include/pokeagb/core/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,18 @@ POKEAGB_EXTERN u8 rboxid_clean(u8 id, bool update);
*/
POKEAGB_EXTERN u8 rboxid_free(u8 id);

/**
* Shows the choose a name dialog
* @param mode Mode (0: OW, 5: pkmn)
* @param out String output
* @param sprite sprite ID
* @param a4 pa4
* @param pid Pokémon PID (mode 5)
* @param func return function
* @address{BPRE,0809D954}
*/
POKEAGB_EXTERN void name_chooser_enter(u8 mode, pchar* out, u16 sprite, u16 a4, u32 pid, void (*func)());

/**
*
* @address{BPRE,080F7768}
Expand Down Expand Up @@ -364,6 +376,16 @@ POKEAGB_EXTERN u32 rboxid_get_field(u8 rid, u8 field);
*/
POKEAGB_EXTERN void rboxid_add_812E5A4(u8, u8, u8, u8, u8, u8, u32*, u8, pchar*);

/**
* @address{BPRE,080F6E9C}
*/
POKEAGB_EXTERN void textbox_setup_something(void);

/**
* @address{BPRE,08069348}
*/
POKEAGB_EXTERN void textbox_setup_something2(void);

POKEAGB_END_DECL

#endif /* POKEAGB_CORE_STRING_H_ */
3 changes: 3 additions & 0 deletions include/pokeagb/graphics/palette.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ union Color {
u16 packed;
};

#define crgb5(r,g,b) (union Color)(((u16)(((b) << 10) | ((g)<<5) | ((r)))))
#define rgb82rgb5(r,g,b) (crgb5(r/8, g/8, b/8))

/**
* @address{BPRE,02037AB8}
*/
Expand Down
5 changes: 5 additions & 0 deletions include/pokeagb/overworld/script.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ POKEAGB_EXTERN void script_env_2_enable_and_set_ctx_running(void);
*/
POKEAGB_EXTERN void script_env_2_enable_and_set_ctx_paused(void);

/**
* @address{BPRE,08069AA8}
*/
POKEAGB_EXTERN void script_execute_maybe(void);

/**
* Read a half word and advance the script pointer
* @address{BPRE,080698F8}
Expand Down

0 comments on commit c407f7e

Please sign in to comment.