Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pret/pokefirered into various_doc…
Browse files Browse the repository at this point in the history
…umentation
  • Loading branch information
PikalaxALT committed Apr 7, 2020
2 parents c05ca37 + 7f9e0ae commit 6451143
Show file tree
Hide file tree
Showing 277 changed files with 435 additions and 637 deletions.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
33 changes: 6 additions & 27 deletions graphics_file_rules.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
TILESETGFXDIR := data/tilesets
GLOBALGFXDIR := data/graphics
FONTGFXDIR := $(GLOBALGFXDIR)/fonts
FAMECHECKERGFXDIR := data/fame_checker
FONTGFXDIR := graphics/fonts
FAMECHECKERGFXDIR := graphics/fame_checker
INTERFACEGFXDIR := graphics/interface
BTLANMSPRGFXDIR := graphics/battle_anims/sprites
UNUSEDGFXDIR := graphics/unused
Expand All @@ -13,8 +12,6 @@ TYPESGFXDIR := graphics/types
RAYQUAZAGFXDIR := graphics/rayquaza_scene
ROULETTEGFXDIR := graphics/roulette
SLOTMACHINEGFXDIR := graphics/slot_machine
PKNAVGFXDIR := graphics/pokenav
PKNAVOPTIONSGFXDIR := graphics/pokenav/options
PSSGFXDIR := graphics/pokemon_storage
EVENTOBJGFXDIR := graphics/event_objects
MISCGFXDIR := graphics/misc
Expand Down Expand Up @@ -98,9 +95,6 @@ graphics/title_screen/pokemon_logo.gbapal: %.gbapal: %.pal
graphics/link_games/pkmnjump_bg.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 63

graphics/pokenav/region_map.8bpp: %.8bpp: %.png
$(GFX) $< $@ -num_tiles 233

$(MISCGFXDIR)/japanese_hof.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 29

Expand Down Expand Up @@ -440,21 +434,6 @@ $(BATTRANSGFXDIR)/frontier_transition.4bpp: %.4bpp: %.png

graphics/tm_case/unk_8E845D8.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 91

$(PKNAVOPTIONSGFXDIR)/options.4bpp: $(PKNAVOPTIONSGFXDIR)/hoenn_map.4bpp \
$(PKNAVOPTIONSGFXDIR)/condition.4bpp \
$(PKNAVOPTIONSGFXDIR)/match_call.4bpp \
$(PKNAVOPTIONSGFXDIR)/ribbons.4bpp \
$(PKNAVOPTIONSGFXDIR)/switch_off.4bpp \
$(PKNAVOPTIONSGFXDIR)/party.4bpp \
$(PKNAVOPTIONSGFXDIR)/search.4bpp \
$(PKNAVOPTIONSGFXDIR)/cool.4bpp \
$(PKNAVOPTIONSGFXDIR)/beauty.4bpp \
$(PKNAVOPTIONSGFXDIR)/cute.4bpp \
$(PKNAVOPTIONSGFXDIR)/smart.4bpp \
$(PKNAVOPTIONSGFXDIR)/tough.4bpp \
$(PKNAVOPTIONSGFXDIR)/cancel.4bpp
@cat $^ >$@

$(PKNAVGFXDIR)/header.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 53
Expand All @@ -474,13 +453,13 @@ $(INTERFACEGFXDIR)/region_map_affine.8bpp: %.8bpp: %.png
$(MISCGFXDIR)/birch_help.4bpp: $(MISCGFXDIR)/birch_bag.4bpp $(MISCGFXDIR)/birch_grass.4bpp
@cat $^ >$@

$(FAMECHECKERGFXDIR)/img_845cf00.4bpp: %.4bpp: %.png
$(FAMECHECKERGFXDIR)/spinning_pokeball.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 15

$(GLOBALGFXDIR)/fame_checker_bg.4bpp: %.4bpp: %.png
$(FAMECHECKERGFXDIR)/bg.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 165

data/seagallop/water.4bpp: %.4bpp: %.png
graphics/seagallop/water.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 41

$(MISCGFXDIR)/unk_846B008.4bpp: %.4bpp: %.png
Expand Down Expand Up @@ -513,7 +492,7 @@ $(TITLESCREENGFXDIR)/unk_lg_8ead788.4bpp: %.4bpp: %.png
$(CREDITSGFXDIR)/unk_8EAE548.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 77

POKEDEXAREAMARKERSDATADIR := data/pokedex_area_markers
POKEDEXAREAMARKERSDATADIR := graphics/pokedex/area_markers

POKEDEXAREAMARKERFILES := \
$(POKEDEXAREAMARKERSDATADIR)/marker_0.4bpp \
Expand Down
2 changes: 1 addition & 1 deletion include/global.fieldmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ enum
enum
{
TILE_ENCOUNTER_NONE,
TILE_ENCOUNTER_GRASS,
TILE_ENCOUNTER_LAND,
TILE_ENCOUNTER_WATER,
};

Expand Down
2 changes: 1 addition & 1 deletion src/bag.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "money.h"
#include "strings.h"

static const u16 sBagWindowPalF[] = INCBIN_U16("data/bag/bag_window_pal.gbapal");
static const u16 sBagWindowPalF[] = INCBIN_U16("graphics/item_menu/bag_window_pal.gbapal");

static const u8 sTextColors[][3] = {
{0, 1, 2},
Expand Down
191 changes: 5 additions & 186 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -6342,39 +6342,35 @@ static void atk7B_tryhealhalfhealth(void)
gBattlescriptCurrInstr += 6;
}

#ifdef NONMATCHING
static void atk7C_trymirrormove(void)
{
s32 validMovesCount;
s32 i;
u16 move;
u16 movesArray[4];
u16 movesArray[3];

// incorrect pointer load sequence
// and incorrect layout in data pools
for (i = 0; i < 3; ++i)
movesArray[i] = 0;
for (validMovesCount = 0, i = 0; i < gBattlersCount; ++i)
{

if (i != gBattlerAttacker)
{
move = *(i * 2 + gBattlerAttacker * 8 + gBattleStruct->lastTakenMoveFrom + 0)
| (*(i * 2 + gBattlerAttacker * 8 + gBattleStruct->lastTakenMoveFrom + 1) << 8);
move = T1_READ_16(i * 2 + gBattlerAttacker * 8 + gBattleStruct->lastTakenMoveFrom);
if (move != MOVE_NONE && move != 0xFFFF)
movesArray[validMovesCount++] = move;
}
}
move = *(gBattleStruct->lastTakenMove + gBattlerAttacker * 2 + 0)
| (*(gBattleStruct->lastTakenMove + gBattlerAttacker * 2 + 1) << 8);
move = T1_READ_16(gBattleStruct->lastTakenMove + gBattlerAttacker * 2);
move++;move--;
if (move != MOVE_NONE && move != 0xFFFF)
{
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
gCurrentMove = move;
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect];
}
else if (validMovesCount)
else if (validMovesCount != 0)
{
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
i = Random() % validMovesCount;
Expand All @@ -6388,183 +6384,6 @@ static void atk7C_trymirrormove(void)
++gBattlescriptCurrInstr;
}
}
#else
NAKED
static void atk7C_trymirrormove(void)
{
asm_unified("\n\
push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x8\n\
ldr r2, _080273E0 @ =gBattlersCount\n\
ldr r0, _080273E4 @ =gBattleStruct\n\
mov r10, r0\n\
movs r1, 0\n\
add r0, sp, 0x4\n\
_08027356:\n\
strh r1, [r0]\n\
subs r0, 0x2\n\
cmp r0, sp\n\
bge _08027356\n\
movs r1, 0\n\
mov r8, r1\n\
movs r5, 0\n\
ldrb r1, [r2]\n\
cmp r5, r1\n\
bge _080273AC\n\
ldr r0, _080273E8 @ =gBattlerAttacker\n\
ldrb r6, [r0]\n\
ldr r2, _080273EC @ =0x0000ffff\n\
mov r9, r2\n\
lsls r4, r6, 3\n\
mov r2, sp\n\
ldr r0, _080273E4 @ =gBattleStruct\n\
mov r12, r0\n\
adds r7, r1, 0\n\
_0802737C:\n\
cmp r5, r6\n\
beq _080273A4\n\
mov r1, r12\n\
ldr r0, [r1]\n\
adds r0, r4, r0\n\
adds r1, r0, 0\n\
adds r1, 0xE0\n\
ldrb r3, [r1]\n\
adds r0, 0xE1\n\
ldrb r0, [r0]\n\
lsls r0, 8\n\
orrs r3, r0\n\
cmp r3, 0\n\
beq _080273A4\n\
cmp r3, r9\n\
beq _080273A4\n\
strh r3, [r2]\n\
adds r2, 0x2\n\
movs r0, 0x1\n\
add r8, r0\n\
_080273A4:\n\
adds r4, 0x2\n\
adds r5, 0x1\n\
cmp r5, r7\n\
blt _0802737C\n\
_080273AC:\n\
ldr r1, _080273E8 @ =gBattlerAttacker\n\
ldrb r0, [r1]\n\
mov r2, r10\n\
ldr r1, [r2]\n\
lsls r0, 1\n\
adds r0, r1\n\
adds r1, r0, 0\n\
adds r1, 0x98\n\
ldrb r3, [r1]\n\
adds r0, 0x99\n\
ldrb r0, [r0]\n\
lsls r0, 8\n\
orrs r3, r0\n\
cmp r3, 0\n\
beq _080273FC\n\
ldr r0, _080273EC @ =0x0000ffff\n\
cmp r3, r0\n\
beq _080273FC\n\
ldr r2, _080273F0 @ =gHitMarker\n\
ldr r0, [r2]\n\
ldr r1, _080273F4 @ =0xfffffbff\n\
ands r0, r1\n\
str r0, [r2]\n\
ldr r4, _080273F8 @ =gCurrentMove\n\
strh r3, [r4]\n\
b _08027426\n\
.align 2, 0\n\
_080273E0: .4byte gBattlersCount\n\
_080273E4: .4byte gBattleStruct\n\
_080273E8: .4byte gBattlerAttacker\n\
_080273EC: .4byte 0x0000ffff\n\
_080273F0: .4byte gHitMarker\n\
_080273F4: .4byte 0xfffffbff\n\
_080273F8: .4byte gCurrentMove\n\
_080273FC:\n\
mov r0, r8\n\
cmp r0, 0\n\
beq _0802746C\n\
ldr r2, _08027450 @ =gHitMarker\n\
ldr r0, [r2]\n\
ldr r1, _08027454 @ =0xfffffbff\n\
ands r0, r1\n\
str r0, [r2]\n\
bl Random\n\
lsls r0, 16\n\
lsrs r0, 16\n\
mov r1, r8\n\
bl __modsi3\n\
adds r5, r0, 0\n\
ldr r4, _08027458 @ =gCurrentMove\n\
lsls r0, r5, 1\n\
add r0, sp\n\
ldrh r0, [r0]\n\
strh r0, [r4]\n\
_08027426:\n\
ldrh r0, [r4]\n\
movs r1, 0\n\
bl GetMoveTarget\n\
ldr r1, _0802745C @ =gBattlerTarget\n\
strb r0, [r1]\n\
ldr r5, _08027460 @ =gBattlescriptCurrInstr\n\
ldr r3, _08027464 @ =gBattleScriptsForMoveEffects\n\
ldr r2, _08027468 @ =gBattleMoves\n\
ldrh r1, [r4]\n\
lsls r0, r1, 1\n\
adds r0, r1\n\
lsls r0, 2\n\
adds r0, r2\n\
ldrb r0, [r0]\n\
lsls r0, 2\n\
adds r0, r3\n\
ldr r0, [r0]\n\
str r0, [r5]\n\
b _0802748A\n\
.align 2, 0\n\
_08027450: .4byte gHitMarker\n\
_08027454: .4byte 0xfffffbff\n\
_08027458: .4byte gCurrentMove\n\
_0802745C: .4byte gBattlerTarget\n\
_08027460: .4byte gBattlescriptCurrInstr\n\
_08027464: .4byte gBattleScriptsForMoveEffects\n\
_08027468: .4byte gBattleMoves\n\
_0802746C:\n\
ldr r2, _0802749C @ =gSpecialStatuses\n\
ldr r0, _080274A0 @ =gBattlerAttacker\n\
ldrb r1, [r0]\n\
lsls r0, r1, 2\n\
adds r0, r1\n\
lsls r0, 2\n\
adds r0, r2\n\
ldrb r1, [r0]\n\
movs r2, 0x20\n\
orrs r1, r2\n\
strb r1, [r0]\n\
ldr r1, _080274A4 @ =gBattlescriptCurrInstr\n\
ldr r0, [r1]\n\
adds r0, 0x1\n\
str r0, [r1]\n\
_0802748A:\n\
add sp, 0x8\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.align 2, 0\n\
_0802749C: .4byte gSpecialStatuses\n\
_080274A0: .4byte gBattlerAttacker\n\
_080274A4: .4byte gBattlescriptCurrInstr\n\
");
}
#endif

static void atk7D_setrain(void)
{
Expand Down
2 changes: 1 addition & 1 deletion src/braille_text.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
extern u8 gGlyphInfo[];

static const u8 gUnknown_846FB08[] = {1, 2, 4};
static const u16 sFont6BrailleGlyphs[] = INCBIN_U16("data/graphics/fonts/font6.fwjpnfont");
static const u16 sFont6BrailleGlyphs[] = INCBIN_U16("graphics/fonts/font6.fwjpnfont");

static void DecompressGlyphFont6(u16);

Expand Down
Loading

0 comments on commit 6451143

Please sign in to comment.