mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-25 11:14:15 +01:00
split asm/emerald.s
This commit is contained in:
parent
a05857f889
commit
b12e80fc04
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,5 +1,6 @@
|
||||
*.exe
|
||||
*.o
|
||||
*.i
|
||||
*.elf
|
||||
*.gba
|
||||
*.1bpp
|
||||
@ -7,10 +8,13 @@
|
||||
*.8bpp
|
||||
*.gbapal
|
||||
*.lz
|
||||
*.rl
|
||||
*.latfont
|
||||
*.hwjpnfont
|
||||
*.fwjpnfont
|
||||
pokeas
|
||||
pokeld
|
||||
pokeobjcopy
|
||||
genasm/*
|
||||
src/*.s
|
||||
tools/agbcc
|
||||
*.map
|
||||
|
110
Makefile
110
Makefile
@ -1,8 +1,18 @@
|
||||
AS := pokeas
|
||||
AS := $(DEVKITARM)/bin/arm-none-eabi-as
|
||||
ASFLAGS := -mcpu=arm7tdmi
|
||||
|
||||
CC := gbacc
|
||||
CFLAGS := -mthumb-interwork -O2 -Iinclude
|
||||
CC1 := tools/agbcc/bin/agbcc
|
||||
CFLAGS := -mthumb-interwork -O2
|
||||
|
||||
CPP := $(DEVKITARM)/bin/arm-none-eabi-cpp
|
||||
CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef
|
||||
|
||||
LD := $(DEVKITARM)/bin/arm-none-eabi-ld
|
||||
LDFLAGS := -T ld_script.txt -T iwram_syms.txt -T ewram_syms.txt -Map pokeemerald.map
|
||||
|
||||
OBJCOPY := $(DEVKITARM)/bin/arm-none-eabi-objcopy
|
||||
|
||||
LIBGCC := tools/agbcc/lib/libgcc.a
|
||||
|
||||
SHA1 := sha1sum -c
|
||||
|
||||
@ -10,47 +20,73 @@ GFX := @tools/gbagfx/gbagfx
|
||||
|
||||
SCANINC := tools/scaninc/scaninc
|
||||
|
||||
PREPROC := tools/preproc/preproc
|
||||
|
||||
# Clear the default suffixes.
|
||||
.SUFFIXES:
|
||||
|
||||
# Secondary expansion is required for dependency variables in object rules.
|
||||
.SECONDEXPANSION:
|
||||
|
||||
.PRECIOUS: %.1bpp %.4bpp %.8bpp %.gbapal %.lz
|
||||
.PRECIOUS: %.1bpp %.4bpp %.8bpp %.gbapal %.lz %.rl
|
||||
|
||||
.PHONY: rom tools gbagfx scaninc clean compare deps
|
||||
.PHONY: rom clean compare tidy
|
||||
|
||||
CSRCS := $(wildcard src/*.c)
|
||||
OBJS := asm/emerald.o
|
||||
C_SRCS := $(wildcard src/*.c)
|
||||
C_OBJS := $(C_SRCS:%.c=%.o)
|
||||
|
||||
$(foreach obj, $(OBJS), \
|
||||
$(eval $(obj)_deps := $(shell $(SCANINC) $(obj:.o=.s))) \
|
||||
)
|
||||
ASM_OBJS := \
|
||||
asm/crt0.o \
|
||||
asm/main.o \
|
||||
asm/dma3_manager.o \
|
||||
asm/gpu_bg.o \
|
||||
asm/pixel_buffer.o \
|
||||
asm/window.o \
|
||||
asm/text_renderer.o \
|
||||
asm/gpu_obj.o \
|
||||
asm/string_util.o \
|
||||
asm/rom_80093CC.o \
|
||||
asm/rtc.o \
|
||||
asm/main_menu.o \
|
||||
asm/rom_8032654.o \
|
||||
asm/tileset_animation.o \
|
||||
asm/rom_80A18F4.o \
|
||||
asm/task.o \
|
||||
asm/rom_80A92F4.o \
|
||||
asm/multiboot.o \
|
||||
asm/rom_81BAD84.o \
|
||||
asm/libgcnmultiboot.o \
|
||||
asm/libmks4agb.o \
|
||||
asm/libagbbackup.o \
|
||||
asm/librtc.o \
|
||||
asm/librfu.o \
|
||||
asm/libagbsyscall.o \
|
||||
asm/libc.o
|
||||
|
||||
DATA_ASM_OBJS := data/data1.o data/data2.o
|
||||
|
||||
OBJS := $(C_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS)
|
||||
|
||||
ROM := pokeemerald.gba
|
||||
ELF := $(ROM:.gba=.elf)
|
||||
|
||||
rom: $(ROM)
|
||||
|
||||
tools: gbagfx scaninc
|
||||
|
||||
gbagfx:
|
||||
cd tools/gbagfx && make
|
||||
|
||||
scaninc:
|
||||
cd tools/scaninc && make
|
||||
|
||||
# For contributors to make sure a change didn't affect the contents of the ROM.
|
||||
compare: $(ROM)
|
||||
@$(SHA1) rom.sha1
|
||||
|
||||
clean:
|
||||
$(RM) $(ROM) $(ELF) $(OBJS)
|
||||
$(RM) genasm/*
|
||||
rm -f $(ROM) $(ELF) $(OBJS) $(C_SRCS:%.c=%.i) pokeemerald.map
|
||||
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} +
|
||||
|
||||
tidy:
|
||||
rm -f $(ROM) $(ELF) $(OBJS) $(C_SRCS:%.c=%.i) pokeemerald.map
|
||||
|
||||
include graphics_file_rules.mk
|
||||
|
||||
%.s: ;
|
||||
%.bin: ;
|
||||
%.png: ;
|
||||
%.pal: ;
|
||||
%.1bpp: %.png ; $(GFX) $< $@
|
||||
@ -58,28 +94,32 @@ include graphics_file_rules.mk
|
||||
%.8bpp: %.png ; $(GFX) $< $@
|
||||
%.gbapal: %.pal ; $(GFX) $< $@
|
||||
%.lz: % ; $(GFX) $< $@
|
||||
%.rl: % ; $(GFX) $< $@
|
||||
|
||||
$(OBJS): $(CSRCS:src/%.c=genasm/%.s)
|
||||
src/siirtc.o: CFLAGS := -mthumb-interwork
|
||||
|
||||
# TODO: fix this .syntax hack
|
||||
src/agb_flash.o: CFLAGS := -O -mthumb-interwork
|
||||
src/agb_flash_1m.o: CFLAGS := -O -mthumb-interwork
|
||||
src/agb_flash_mx.o: CFLAGS := -O -mthumb-interwork
|
||||
|
||||
genasm/prefix.tmp:
|
||||
echo -e "\t.syntax divided" >$@
|
||||
src/m4a_2.o: CC1 := tools/agbcc/bin/old_agbcc
|
||||
src/m4a_4.o: CC1 := tools/agbcc/bin/old_agbcc
|
||||
|
||||
genasm/suffix.tmp:
|
||||
echo -e "\t.syntax unified" >$@
|
||||
$(C_OBJS): %.o : %.c
|
||||
@$(CPP) $(CPPFLAGS) $< -o $*.i
|
||||
@$(PREPROC) $*.i charmap.txt | $(CC1) $(CFLAGS) -o $*.s
|
||||
@echo -e ".text\n\t.align\t2, 0\n" >> $*.s
|
||||
$(AS) $(ASFLAGS) -o $@ $*.s
|
||||
|
||||
genasm/%.s: src/%.c genasm/prefix.tmp genasm/suffix.tmp
|
||||
mkdir -p genasm
|
||||
$(CC) $(CFLAGS) -o $@.tmp $< -S
|
||||
cat genasm/prefix.tmp $@.tmp genasm/suffix.tmp >$@.tmp2
|
||||
perl fix_local_labels.pl $@.tmp2 $@
|
||||
$(RM) $@.tmp $@.tmp2
|
||||
%.o : dep = $(shell $(SCANINC) $*.s)
|
||||
|
||||
%.o: %.s $$($$@_deps)
|
||||
$(ASM_OBJS): %.o: %.s $$(dep)
|
||||
$(AS) $(ASFLAGS) -o $@ $<
|
||||
|
||||
$(DATA_ASM_OBJS): %.o: %.s $$(dep)
|
||||
$(PREPROC) $< charmap.txt | $(AS) $(ASFLAGS) -o $@
|
||||
|
||||
# Link objects to produce the ROM.
|
||||
$(ROM): $(OBJS)
|
||||
./pokeld -T ld_script.txt -T wram_syms.txt -o $(ELF) $(OBJS)
|
||||
./pokeobjcopy -O binary $(ELF) $(ROM)
|
||||
$(LD) $(LDFLAGS) -o $(ELF) $(OBJS) $(LIBGCC)
|
||||
$(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0x9000000 $(ELF) $(ROM)
|
||||
|
213
asm/libc.s
Normal file
213
asm/libc.s
Normal file
@ -0,0 +1,213 @@
|
||||
.include "asm/macros.s"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start memcpy
|
||||
@ void *memcpy(void *dest, void *src, int size)
|
||||
memcpy: @ 82E93D4
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
adds r4, r5, 0
|
||||
adds r3, r1, 0
|
||||
cmp r2, 0xF
|
||||
bls _082E9414
|
||||
adds r0, r3, 0
|
||||
orrs r0, r5
|
||||
movs r1, 0x3
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _082E9414
|
||||
adds r1, r5, 0
|
||||
_082E93EE:
|
||||
ldm r3!, {r0}
|
||||
stm r1!, {r0}
|
||||
ldm r3!, {r0}
|
||||
stm r1!, {r0}
|
||||
ldm r3!, {r0}
|
||||
stm r1!, {r0}
|
||||
ldm r3!, {r0}
|
||||
stm r1!, {r0}
|
||||
subs r2, 0x10
|
||||
cmp r2, 0xF
|
||||
bhi _082E93EE
|
||||
cmp r2, 0x3
|
||||
bls _082E9412
|
||||
_082E9408:
|
||||
ldm r3!, {r0}
|
||||
stm r1!, {r0}
|
||||
subs r2, 0x4
|
||||
cmp r2, 0x3
|
||||
bhi _082E9408
|
||||
_082E9412:
|
||||
adds r4, r1, 0
|
||||
_082E9414:
|
||||
subs r2, 0x1
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
cmp r2, r0
|
||||
beq _082E942E
|
||||
adds r1, r0, 0
|
||||
_082E9420:
|
||||
ldrb r0, [r3]
|
||||
strb r0, [r4]
|
||||
adds r3, 0x1
|
||||
adds r4, 0x1
|
||||
subs r2, 0x1
|
||||
cmp r2, r1
|
||||
bne _082E9420
|
||||
_082E942E:
|
||||
adds r0, r5, 0
|
||||
pop {r4,r5,pc}
|
||||
thumb_func_end memcpy
|
||||
|
||||
thumb_func_start memset
|
||||
@ void *memset(void *dest, char c, int size)
|
||||
memset: @ 82E9434
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
adds r4, r1, 0
|
||||
adds r3, r5, 0
|
||||
cmp r2, 0x3
|
||||
bls _082E947A
|
||||
movs r0, 0x3
|
||||
ands r0, r5
|
||||
cmp r0, 0
|
||||
bne _082E947A
|
||||
adds r1, r5, 0
|
||||
movs r0, 0xFF
|
||||
ands r4, r0
|
||||
lsls r3, r4, 8
|
||||
orrs r3, r4
|
||||
lsls r0, r3, 16
|
||||
orrs r3, r0
|
||||
cmp r2, 0xF
|
||||
bls _082E946E
|
||||
_082E945A:
|
||||
stm r1!, {r3}
|
||||
stm r1!, {r3}
|
||||
stm r1!, {r3}
|
||||
stm r1!, {r3}
|
||||
subs r2, 0x10
|
||||
cmp r2, 0xF
|
||||
bhi _082E945A
|
||||
b _082E946E
|
||||
_082E946A:
|
||||
stm r1!, {r3}
|
||||
subs r2, 0x4
|
||||
_082E946E:
|
||||
cmp r2, 0x3
|
||||
bhi _082E946A
|
||||
adds r3, r1, 0
|
||||
b _082E947A
|
||||
_082E9476:
|
||||
strb r4, [r3]
|
||||
adds r3, 0x1
|
||||
_082E947A:
|
||||
adds r0, r2, 0
|
||||
subs r2, 0x1
|
||||
cmp r0, 0
|
||||
bne _082E9476
|
||||
adds r0, r5, 0
|
||||
pop {r4,r5,pc}
|
||||
thumb_func_end memset
|
||||
|
||||
thumb_func_start strcmp
|
||||
@ int strcmp(char *s1, char *s2)
|
||||
strcmp: @ 82E9488
|
||||
push {r4,r5,lr}
|
||||
adds r2, r0, 0
|
||||
adds r3, r1, 0
|
||||
orrs r0, r3
|
||||
movs r1, 0x3
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _082E94CE
|
||||
ldr r1, [r2]
|
||||
ldr r0, [r3]
|
||||
cmp r1, r0
|
||||
bne _082E94CE
|
||||
ldr r5, _082E94B4
|
||||
ldr r4, _082E94B8
|
||||
_082E94A4:
|
||||
ldr r1, [r2]
|
||||
adds r0, r1, r5
|
||||
bics r0, r1
|
||||
ands r0, r4
|
||||
cmp r0, 0
|
||||
beq _082E94BC
|
||||
movs r0, 0
|
||||
b _082E94E0
|
||||
.align 2, 0
|
||||
_082E94B4: .4byte 0xfefefeff
|
||||
_082E94B8: .4byte 0x80808080
|
||||
_082E94BC:
|
||||
adds r2, 0x4
|
||||
adds r3, 0x4
|
||||
ldr r1, [r2]
|
||||
ldr r0, [r3]
|
||||
cmp r1, r0
|
||||
beq _082E94A4
|
||||
b _082E94CE
|
||||
_082E94CA:
|
||||
adds r2, 0x1
|
||||
adds r3, 0x1
|
||||
_082E94CE:
|
||||
ldrb r0, [r2]
|
||||
cmp r0, 0
|
||||
beq _082E94DA
|
||||
ldrb r1, [r3]
|
||||
cmp r0, r1
|
||||
beq _082E94CA
|
||||
_082E94DA:
|
||||
ldrb r2, [r2]
|
||||
ldrb r3, [r3]
|
||||
subs r0, r2, r3
|
||||
_082E94E0:
|
||||
pop {r4,r5,pc}
|
||||
thumb_func_end strcmp
|
||||
|
||||
thumb_func_start strcat
|
||||
strcat: @ 82E94E4
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
adds r3, r6, 0
|
||||
adds r2, r1, 0
|
||||
adds r0, r2, 0
|
||||
orrs r0, r6
|
||||
movs r1, 0x3
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _082E951C
|
||||
ldr r1, [r2]
|
||||
ldr r5, _082E9504
|
||||
adds r0, r1, r5
|
||||
bics r0, r1
|
||||
ldr r4, _082E9508
|
||||
b _082E9516
|
||||
.align 2, 0
|
||||
_082E9504: .4byte 0xfefefeff
|
||||
_082E9508: .4byte 0x80808080
|
||||
_082E950C:
|
||||
ldm r2!, {r0}
|
||||
stm r3!, {r0}
|
||||
ldr r1, [r2]
|
||||
adds r0, r1, r5
|
||||
bics r0, r1
|
||||
_082E9516:
|
||||
ands r0, r4
|
||||
cmp r0, 0
|
||||
beq _082E950C
|
||||
_082E951C:
|
||||
ldrb r0, [r2]
|
||||
strb r0, [r3]
|
||||
lsls r0, 24
|
||||
adds r2, 0x1
|
||||
adds r3, 0x1
|
||||
cmp r0, 0
|
||||
bne _082E951C
|
||||
adds r0, r6, 0
|
||||
pop {r4-r6,pc}
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
5238
asm/libgcc.s
5238
asm/libgcc.s
File diff suppressed because it is too large
Load Diff
73847
asm/rom_80093CC.s
Normal file
73847
asm/rom_80093CC.s
Normal file
File diff suppressed because it is too large
Load Diff
212175
asm/rom_8032654.s
Normal file
212175
asm/rom_8032654.s
Normal file
File diff suppressed because it is too large
Load Diff
14849
asm/rom_80A18F4.s
Normal file
14849
asm/rom_80A18F4.s
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
63142
asm/rom_81BAD84.s
Normal file
63142
asm/rom_81BAD84.s
Normal file
File diff suppressed because it is too large
Load Diff
19
charmap.txt
19
charmap.txt
@ -330,14 +330,15 @@ STR_VAR_2 = FD 03
|
||||
STR_VAR_3 = FD 04
|
||||
KUN = FD 05
|
||||
RIVAL = FD 06
|
||||
@ version-dependent strings
|
||||
VERSION = FD 07 @ "RUBY" / "SAPPHIRE"
|
||||
EVIL_TEAM = FD 08 @ "MAGMA" / "AQUA"
|
||||
GOOD_TEAM = FD 09 @ "AQUA" / "MAGMA"
|
||||
EVIL_LEADER = FD 0A @ "MAXIE" / "ARCHIE"
|
||||
GOOD_LEADER = FD 0B @ "ARCHIE" / "MAXIE"
|
||||
EVIL_LEGENDARY = FD 0C @ "GROUDON" / "KYOGRE"
|
||||
GOOD_LEGENDARY = FD 0D @ "KYOGRE" / "GROUDON"
|
||||
@ version-dependent strings (originally made for Ruby/Sapphire differences)
|
||||
@ Emerald uses the Sapphire strings (except for VERSION).
|
||||
VERSION = FD 07 @ "EMERALD"
|
||||
AQUA = FD 08
|
||||
MAGMA = FD 09
|
||||
ARCHIE = FD 0A
|
||||
MAXIE = FD 0B
|
||||
KYOGRE = FD 0C
|
||||
GROUDON = FD 0D
|
||||
|
||||
@ battle macros
|
||||
|
||||
@ -366,7 +367,7 @@ PAUSE_UNTIL_PRESS = FC 09
|
||||
UNKNOWN_A = FC 0A
|
||||
PLAY_BGM = FC 0B
|
||||
ESCAPE = FC 0C
|
||||
SHIFT_TEXT = FC 0D
|
||||
SHIFT_TEXT = FC 0D
|
||||
UNKNOWN_E = FC 0E
|
||||
UNKNOWN_F = FC 0F
|
||||
PLAY_SE = FC 10
|
||||
|
@ -21,7 +21,7 @@
|
||||
.set EC_GROUP_TRENDY_SAYING, 0x14
|
||||
.set EC_GROUP_POKEMON2, 0x15
|
||||
|
||||
; Trainer
|
||||
@ Trainer
|
||||
.set EC_WORD_I_CHOOSE_YOU, (EC_GROUP_TRAINER << 9) | 0x0
|
||||
.set EC_WORD_GOTCHA, (EC_GROUP_TRAINER << 9) | 0x1
|
||||
.set EC_WORD_TRADE, (EC_GROUP_TRAINER << 9) | 0x2
|
||||
@ -50,7 +50,7 @@
|
||||
.set EC_WORD_SILVER, (EC_GROUP_TRAINER << 9) | 0x19
|
||||
.set EC_WORD_EMERALD, (EC_GROUP_TRAINER << 9) | 0x1a
|
||||
|
||||
; Status
|
||||
@ Status
|
||||
.set EC_WORD_DARK, (EC_GROUP_STATUS << 9) | 0x0
|
||||
.set EC_WORD_STENCH, (EC_GROUP_STATUS << 9) | 0x1
|
||||
.set EC_WORD_THICK_FAT, (EC_GROUP_STATUS << 9) | 0x2
|
||||
@ -161,7 +161,7 @@
|
||||
.set EC_WORD_PURE_POWER, (EC_GROUP_STATUS << 9) | 0x6b
|
||||
.set EC_WORD_SHIELD_DUST, (EC_GROUP_STATUS << 9) | 0x6c
|
||||
|
||||
; Battle
|
||||
@ Battle
|
||||
.set EC_WORD_MATCH_UP, (EC_GROUP_BATTLE << 9) | 0x0
|
||||
.set EC_WORD_GO, (EC_GROUP_BATTLE << 9) | 0x1
|
||||
.set EC_WORD_NO_1, (EC_GROUP_BATTLE << 9) | 0x2
|
||||
@ -226,7 +226,7 @@
|
||||
.set EC_WORD_RULE, (EC_GROUP_BATTLE << 9) | 0x3d
|
||||
.set EC_WORD_MOVE, (EC_GROUP_BATTLE << 9) | 0x3e
|
||||
|
||||
; Greetings
|
||||
@ Greetings
|
||||
.set EC_WORD_THANKS, (EC_GROUP_GREETINGS << 9) | 0x0
|
||||
.set EC_WORD_YES, (EC_GROUP_GREETINGS << 9) | 0x1
|
||||
.set EC_WORD_HERE_GOES, (EC_GROUP_GREETINGS << 9) | 0x2
|
||||
@ -270,7 +270,7 @@
|
||||
.set EC_WORD_COME_OVER, (EC_GROUP_GREETINGS << 9) | 0x28
|
||||
.set EC_WORD_COUNT_ON, (EC_GROUP_GREETINGS << 9) | 0x29
|
||||
|
||||
; People
|
||||
@ People
|
||||
.set EC_WORD_OPPONENT, (EC_GROUP_PEOPLE << 9) | 0x0
|
||||
.set EC_WORD_I, (EC_GROUP_PEOPLE << 9) | 0x1
|
||||
.set EC_WORD_YOU, (EC_GROUP_PEOPLE << 9) | 0x2
|
||||
@ -347,7 +347,7 @@
|
||||
.set EC_WORD_SHE_IS, (EC_GROUP_PEOPLE << 9) | 0x49
|
||||
.set EC_WORD_SOME, (EC_GROUP_PEOPLE << 9) | 0x4a
|
||||
|
||||
; Voices
|
||||
@ Voices
|
||||
.set EC_WORD_EXCL, (EC_GROUP_VOICES << 9) | 0x0
|
||||
.set EC_WORD_EXCL_EXCL, (EC_GROUP_VOICES << 9) | 0x1
|
||||
.set EC_WORD_QUES_EXCL, (EC_GROUP_VOICES << 9) | 0x2
|
||||
@ -412,7 +412,7 @@
|
||||
.set EC_WORD_GWAH, (EC_GROUP_VOICES << 9) | 0x3d
|
||||
.set EC_WORD_WAHAHAHA, (EC_GROUP_VOICES << 9) | 0x3e
|
||||
|
||||
; Speech
|
||||
@ Speech
|
||||
.set EC_WORD_LISTEN, (EC_GROUP_SPEECH << 9) | 0x0
|
||||
.set EC_WORD_NOT_VERY, (EC_GROUP_SPEECH << 9) | 0x1
|
||||
.set EC_WORD_MEAN, (EC_GROUP_SPEECH << 9) | 0x2
|
||||
@ -474,7 +474,7 @@
|
||||
.set EC_WORD_INSTEAD, (EC_GROUP_SPEECH << 9) | 0x3a
|
||||
.set EC_WORD_FANTASTIC, (EC_GROUP_SPEECH << 9) | 0x3b
|
||||
|
||||
; Endings
|
||||
@ Endings
|
||||
.set EC_WORD_WILL, (EC_GROUP_ENDINGS << 9) | 0x0
|
||||
.set EC_WORD_WILL_BE_HERE, (EC_GROUP_ENDINGS << 9) | 0x1
|
||||
.set EC_WORD_OR, (EC_GROUP_ENDINGS << 9) | 0x2
|
||||
@ -545,7 +545,7 @@
|
||||
.set EC_WORD_ONCE, (EC_GROUP_ENDINGS << 9) | 0x43
|
||||
.set EC_WORD_ANYWHERE, (EC_GROUP_ENDINGS << 9) | 0x44
|
||||
|
||||
; Feelings
|
||||
@ Feelings
|
||||
.set EC_WORD_MEET, (EC_GROUP_FEELINGS << 9) | 0x0
|
||||
.set EC_WORD_PLAY, (EC_GROUP_FEELINGS << 9) | 0x1
|
||||
.set EC_WORD_HURRIED, (EC_GROUP_FEELINGS << 9) | 0x2
|
||||
@ -616,7 +616,7 @@
|
||||
.set EC_WORD_UNDERSTAND, (EC_GROUP_FEELINGS << 9) | 0x43
|
||||
.set EC_WORD_UNDERSTANDS, (EC_GROUP_FEELINGS << 9) | 0x44
|
||||
|
||||
; Conditions
|
||||
@ Conditions
|
||||
.set EC_WORD_HOT, (EC_GROUP_CONDITIONS << 9) | 0x0
|
||||
.set EC_WORD_EXISTS, (EC_GROUP_CONDITIONS << 9) | 0x1
|
||||
.set EC_WORD_EXCESS, (EC_GROUP_CONDITIONS << 9) | 0x2
|
||||
@ -687,7 +687,7 @@
|
||||
.set EC_WORD_SEEMS, (EC_GROUP_CONDITIONS << 9) | 0x43
|
||||
.set EC_WORD_BADLY, (EC_GROUP_CONDITIONS << 9) | 0x44
|
||||
|
||||
; Actions
|
||||
@ Actions
|
||||
.set EC_WORD_MEETS, (EC_GROUP_ACTIONS << 9) | 0x0
|
||||
.set EC_WORD_CONCEDE, (EC_GROUP_ACTIONS << 9) | 0x1
|
||||
.set EC_WORD_GIVE, (EC_GROUP_ACTIONS << 9) | 0x2
|
||||
@ -767,7 +767,7 @@
|
||||
.set EC_WORD_FAINT, (EC_GROUP_ACTIONS << 9) | 0x4c
|
||||
.set EC_WORD_FAINTED, (EC_GROUP_ACTIONS << 9) | 0x4d
|
||||
|
||||
; Lifestyle
|
||||
@ Lifestyle
|
||||
.set EC_WORD_CHORES, (EC_GROUP_LIFESTYLE << 9) | 0x0
|
||||
.set EC_WORD_HOME, (EC_GROUP_LIFESTYLE << 9) | 0x1
|
||||
.set EC_WORD_MONEY, (EC_GROUP_LIFESTYLE << 9) | 0x2
|
||||
@ -814,7 +814,7 @@
|
||||
.set EC_WORD_RENTAL, (EC_GROUP_LIFESTYLE << 9) | 0x2b
|
||||
.set EC_WORD_WORLD, (EC_GROUP_LIFESTYLE << 9) | 0x2c
|
||||
|
||||
; Hobbies
|
||||
@ Hobbies
|
||||
.set EC_WORD_IDOL, (EC_GROUP_HOBBIES << 9) | 0x0
|
||||
.set EC_WORD_ANIME, (EC_GROUP_HOBBIES << 9) | 0x1
|
||||
.set EC_WORD_SONG, (EC_GROUP_HOBBIES << 9) | 0x2
|
||||
@ -870,7 +870,7 @@
|
||||
.set EC_WORD_VACATION, (EC_GROUP_HOBBIES << 9) | 0x34
|
||||
.set EC_WORD_LOOK, (EC_GROUP_HOBBIES << 9) | 0x35
|
||||
|
||||
; Time
|
||||
@ Time
|
||||
.set EC_WORD_FALL, (EC_GROUP_TIME << 9) | 0x0
|
||||
.set EC_WORD_MORNING, (EC_GROUP_TIME << 9) | 0x1
|
||||
.set EC_WORD_TOMORROW, (EC_GROUP_TIME << 9) | 0x2
|
||||
@ -917,7 +917,7 @@
|
||||
.set EC_WORD_NIGHT, (EC_GROUP_TIME << 9) | 0x2b
|
||||
.set EC_WORD_WEEK, (EC_GROUP_TIME << 9) | 0x2c
|
||||
|
||||
; Misc.
|
||||
@ Misc.
|
||||
.set EC_WORD_HIGHS, (EC_GROUP_MISC << 9) | 0x0
|
||||
.set EC_WORD_LOWS, (EC_GROUP_MISC << 9) | 0x1
|
||||
.set EC_WORD_UM, (EC_GROUP_MISC << 9) | 0x2
|
||||
@ -961,7 +961,7 @@
|
||||
.set EC_WORD_LEFT, (EC_GROUP_MISC << 9) | 0x28
|
||||
.set EC_WORD_RIGHT, (EC_GROUP_MISC << 9) | 0x29
|
||||
|
||||
; Adjectives
|
||||
@ Adjectives
|
||||
.set EC_WORD_WANDERING, (EC_GROUP_ADJECTIVES << 9) | 0x0
|
||||
.set EC_WORD_RICKETY, (EC_GROUP_ADJECTIVES << 9) | 0x1
|
||||
.set EC_WORD_ROCK_SOLID, (EC_GROUP_ADJECTIVES << 9) | 0x2
|
||||
@ -999,7 +999,7 @@
|
||||
.set EC_WORD_HAPPILY, (EC_GROUP_ADJECTIVES << 9) | 0x22
|
||||
.set EC_WORD_ANTICIPATION, (EC_GROUP_ADJECTIVES << 9) | 0x23
|
||||
|
||||
; Events
|
||||
@ Events
|
||||
.set EC_WORD_APPEAL, (EC_GROUP_EVENTS << 9) | 0x0
|
||||
.set EC_WORD_EVENTS, (EC_GROUP_EVENTS << 9) | 0x1
|
||||
.set EC_WORD_STAY_AT_HOME, (EC_GROUP_EVENTS << 9) | 0x2
|
||||
@ -1030,7 +1030,7 @@
|
||||
.set EC_WORD_WIRELESS, (EC_GROUP_EVENTS << 9) | 0x1b
|
||||
.set EC_WORD_FRONTIER, (EC_GROUP_EVENTS << 9) | 0x1c
|
||||
|
||||
; Trendy Saying
|
||||
@ Trendy Saying
|
||||
.set EC_WORD_KTHX_BYE, (EC_GROUP_TRENDY_SAYING << 9) | 0x0
|
||||
.set EC_WORD_YES_SIR_EXCL, (EC_GROUP_TRENDY_SAYING << 9) | 0x1
|
||||
.set EC_WORD_AVANT_GARDE, (EC_GROUP_TRENDY_SAYING << 9) | 0x2
|
||||
|
@ -32,9 +32,9 @@
|
||||
.set INTR_FLAG_KEYPAD, 1 << 12
|
||||
.set INTR_FLAG_GAMEPAK, 1 << 13
|
||||
|
||||
.set REG_BASE, 0x4000000 ; I/O register base address
|
||||
.set REG_BASE, 0x4000000 @ I/O register base address
|
||||
|
||||
; I/O register offsets
|
||||
@ I/O register offsets
|
||||
.set OFFSET_REG_DISPCNT, 0x0
|
||||
.set OFFSET_REG_DISPSTAT, 0x4
|
||||
.set OFFSET_REG_VCOUNT, 0x6
|
||||
@ -201,7 +201,7 @@
|
||||
|
||||
.set OFFSET_REG_WAITCNT, 0x204
|
||||
|
||||
; I/O register addresses
|
||||
@ I/O register addresses
|
||||
.set REG_DISPCNT, REG_BASE + OFFSET_REG_DISPCNT
|
||||
.set REG_DISPSTAT, REG_BASE + OFFSET_REG_DISPSTAT
|
||||
.set REG_VCOUNT, REG_BASE + OFFSET_REG_VCOUNT
|
||||
@ -368,7 +368,7 @@
|
||||
|
||||
.set REG_WAITCNT, REG_BASE + OFFSET_REG_WAITCNT
|
||||
|
||||
; OAM attribute constants
|
||||
@ OAM attribute constants
|
||||
|
||||
.set OAM_OBJ_NORMAL, 0x00000000
|
||||
.set OAM_OBJ_BLEND, 0x00000400
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -61,18 +61,18 @@
|
||||
|
||||
.set F_SUMMARY_SCREEN_FLIP_SPRITE, 0x80
|
||||
|
||||
.set EVO_FRIENDSHIP, 0x0001 ; Pokémon levels up with friendship ≥ 220
|
||||
.set EVO_FRIENDSHIP_DAY, 0x0002 ; Pokémon levels up during the day with friendship ≥ 220
|
||||
.set EVO_FRIENDSHIP_NIGHT, 0x0003 ; Pokémon levels up at night with friendship ≥ 220
|
||||
.set EVO_LEVEL, 0x0004 ; Pokémon reaches the specified level
|
||||
.set EVO_TRADE, 0x0005 ; Pokémon is traded
|
||||
.set EVO_TRADE_ITEM, 0x0006 ; Pokémon is traded while it's holding the specified item
|
||||
.set EVO_ITEM, 0x0007 ; specified item is used on Pokémon
|
||||
.set EVO_LEVEL_ATK_GT_DEF, 0x0008 ; Pokémon reaches the specified level with attack > defense
|
||||
.set EVO_LEVEL_ATK_EQ_DEF, 0x0009 ; Pokémon reaches the specified level with attack = defense
|
||||
.set EVO_LEVEL_ATK_LT_DEF, 0x000a ; Pokémon reaches the specified level with attack < defense
|
||||
.set EVO_LEVEL_SILCOON, 0x000b ; Pokémon reaches the specified level with a Silcoon personality value
|
||||
.set EVO_LEVEL_CASCOON, 0x000c ; Pokémon reaches the specified level with a Cascoon personality value
|
||||
.set EVO_LEVEL_NINJASK, 0x000d ; Pokémon reaches the specified level (special value for Ninjask)
|
||||
.set EVO_LEVEL_SHEDINJA, 0x000e ; Pokémon reaches the specified level (special value for Shedinja)
|
||||
.set EVO_BEAUTY, 0x000f ; Pokémon levels up with beauty ≥ specified value
|
||||
.set EVO_FRIENDSHIP, 0x0001 @ Pokémon levels up with friendship ≥ 220
|
||||
.set EVO_FRIENDSHIP_DAY, 0x0002 @ Pokémon levels up during the day with friendship ≥ 220
|
||||
.set EVO_FRIENDSHIP_NIGHT, 0x0003 @ Pokémon levels up at night with friendship ≥ 220
|
||||
.set EVO_LEVEL, 0x0004 @ Pokémon reaches the specified level
|
||||
.set EVO_TRADE, 0x0005 @ Pokémon is traded
|
||||
.set EVO_TRADE_ITEM, 0x0006 @ Pokémon is traded while it's holding the specified item
|
||||
.set EVO_ITEM, 0x0007 @ specified item is used on Pokémon
|
||||
.set EVO_LEVEL_ATK_GT_DEF, 0x0008 @ Pokémon reaches the specified level with attack > defense
|
||||
.set EVO_LEVEL_ATK_EQ_DEF, 0x0009 @ Pokémon reaches the specified level with attack = defense
|
||||
.set EVO_LEVEL_ATK_LT_DEF, 0x000a @ Pokémon reaches the specified level with attack < defense
|
||||
.set EVO_LEVEL_SILCOON, 0x000b @ Pokémon reaches the specified level with a Silcoon personality value
|
||||
.set EVO_LEVEL_CASCOON, 0x000c @ Pokémon reaches the specified level with a Cascoon personality value
|
||||
.set EVO_LEVEL_NINJASK, 0x000d @ Pokémon reaches the specified level (special value for Ninjask)
|
||||
.set EVO_LEVEL_SHEDINJA, 0x000e @ Pokémon reaches the specified level (special value for Shedinja)
|
||||
.set EVO_BEAUTY, 0x000f @ Pokémon levels up with beauty ≥ specified value
|
||||
|
@ -1098,25 +1098,25 @@
|
||||
.set TRAINER_CLASS_NAME_PYRAMID_KING, 0x40
|
||||
.set TRAINER_CLASS_NAME_PKMN_TRAINER_4, 0x41
|
||||
|
||||
.set TRAINER_ENCOUNTER_MUSIC_MALE, 0 ; standard male encounter music
|
||||
.set TRAINER_ENCOUNTER_MUSIC_FEMALE, 1 ; standard female encounter music
|
||||
.set TRAINER_ENCOUNTER_MUSIC_GIRL, 2 ; used for male Tubers and Young Couples too
|
||||
.set TRAINER_ENCOUNTER_MUSIC_MALE, 0 @ standard male encounter music
|
||||
.set TRAINER_ENCOUNTER_MUSIC_FEMALE, 1 @ standard female encounter music
|
||||
.set TRAINER_ENCOUNTER_MUSIC_GIRL, 2 @ used for male Tubers and Young Couples too
|
||||
.set TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, 3
|
||||
.set TRAINER_ENCOUNTER_MUSIC_INTENSE, 4
|
||||
.set TRAINER_ENCOUNTER_MUSIC_COOL, 5
|
||||
.set TRAINER_ENCOUNTER_MUSIC_AQUA, 6
|
||||
.set TRAINER_ENCOUNTER_MUSIC_MAGMA, 7
|
||||
.set TRAINER_ENCOUNTER_MUSIC_SWIMMER, 8
|
||||
.set TRAINER_ENCOUNTER_MUSIC_TWINS, 9 ; used for other trainer classes too
|
||||
.set TRAINER_ENCOUNTER_MUSIC_TWINS, 9 @ used for other trainer classes too
|
||||
.set TRAINER_ENCOUNTER_MUSIC_ELITE_FOUR, 10
|
||||
.set TRAINER_ENCOUNTER_MUSIC_HIKER, 11 ; used for other trainer classes too
|
||||
.set TRAINER_ENCOUNTER_MUSIC_HIKER, 11 @ used for other trainer classes too
|
||||
.set TRAINER_ENCOUNTER_MUSIC_INTERVIEWER, 12
|
||||
.set TRAINER_ENCOUNTER_MUSIC_RICH, 13 ; Rich Boys and Gentlemen
|
||||
.set TRAINER_ENCOUNTER_MUSIC_RICH, 13 @ Rich Boys and Gentlemen
|
||||
|
||||
.set F_TRAINER_FEMALE, 1 << 7
|
||||
|
||||
; All trainer parties specify the IV, level, and species for each Pokémon in the
|
||||
; party. Some trainer parties also specify held items and custom moves for each
|
||||
; Pokémon.
|
||||
@ All trainer parties specify the IV, level, and species for each Pokémon in the
|
||||
@ party. Some trainer parties also specify held items and custom moves for each
|
||||
@ Pokémon.
|
||||
.set F_TRAINER_PARTY_CUSTOM_MOVESET, 1 << 0
|
||||
.set F_TRAINER_PARTY_HELD_ITEM, 1 << 1
|
||||
|
@ -1,5 +1,10 @@
|
||||
@ the first big chunk of data
|
||||
|
||||
.include "asm/macros.s"
|
||||
.include "constants/constants.s"
|
||||
|
||||
.section script_data, "aw", %progbits
|
||||
|
||||
@ 81DB67C
|
||||
.include "data/event_script_command_function_table.s"
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
@ the second big chunk of data
|
||||
|
||||
.align 2, 0
|
||||
.include "asm/macros.s"
|
||||
.include "constants/constants.s"
|
||||
|
||||
.section .rodata
|
||||
|
||||
gUnknown_82E9530: @ 82E9530
|
||||
.byte 3
|
||||
|
0
ewram_syms.txt
Normal file
0
ewram_syms.txt
Normal file
@ -1,28 +0,0 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
open(IN_FILE, $ARGV[0]);
|
||||
open(OUT_FILE, ">", $ARGV[1]);
|
||||
|
||||
my @labels = ();
|
||||
|
||||
while (<IN_FILE>) {
|
||||
if ($_ =~ /^\.(.+):/) {
|
||||
push(@labels, $1);
|
||||
}
|
||||
}
|
||||
|
||||
seek IN_FILE, 0, 0;
|
||||
|
||||
while (<IN_FILE>) {
|
||||
for (my $i = 0; $i < scalar(@labels); $i++) {
|
||||
my $find = quotemeta '.' . $labels[$i];
|
||||
my $replace = '$' . $labels[$i];
|
||||
$_ =~ s/$find/$replace/;
|
||||
}
|
||||
|
||||
print OUT_FILE $_;
|
||||
}
|
||||
|
||||
close(IN_FILE);
|
||||
close(OUT_FILE);
|
@ -1,6 +1,92 @@
|
||||
ENTRY(Start)
|
||||
|
||||
gNumMusicPlayers = 4;
|
||||
gMaxLines = 60;
|
||||
|
||||
SECTIONS {
|
||||
. = 0x2020000;
|
||||
|
||||
ewram (NOLOAD) :
|
||||
ALIGN(4)
|
||||
{
|
||||
}
|
||||
|
||||
. = 0x3000000;
|
||||
|
||||
iwram (NOLOAD) :
|
||||
ALIGN(4)
|
||||
{
|
||||
}
|
||||
|
||||
. = 0x8000000;
|
||||
.text : { *(.text); }
|
||||
|
||||
.text :
|
||||
ALIGN(4)
|
||||
{
|
||||
asm/crt0.o(.text);
|
||||
asm/main.o(.text);
|
||||
src/malloc.o(.text);
|
||||
asm/dma3_manager.o(.text);
|
||||
src/gpu_regs.o(.text);
|
||||
asm/gpu_bg.o(.text);
|
||||
asm/pixel_buffer.o(.text);
|
||||
asm/window.o(.text);
|
||||
asm/text_renderer.o(.text);
|
||||
asm/gpu_obj.o(.text);
|
||||
asm/string_util.o(.text);
|
||||
asm/rom_80093CC.o(.text);
|
||||
asm/rtc.o(.text);
|
||||
asm/main_menu.o(.text);
|
||||
asm/rom_8032654.o(.text);
|
||||
asm/tileset_animation.o(.text);
|
||||
asm/rom_80A18F4.o(.text);
|
||||
asm/task.o(.text);
|
||||
asm/rom_80A92F4.o(.text);
|
||||
asm/multiboot.o(.text);
|
||||
asm/rom_81BAD84.o(.text);
|
||||
} =0
|
||||
|
||||
script_data :
|
||||
ALIGN(4)
|
||||
{
|
||||
data/data1.o(script_data);
|
||||
} =0
|
||||
|
||||
lib_text :
|
||||
ALIGN(4)
|
||||
{
|
||||
asm/libgcnmultiboot.o(.text);
|
||||
asm/libmks4agb.o(.text);
|
||||
asm/libagbbackup.o(.text);
|
||||
asm/librtc.o(.text);
|
||||
asm/librfu.o(.text);
|
||||
asm/libagbsyscall.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:_call_via_rX.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:_divsi3.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:_dvmd_tls.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:_fixunsdfsi.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:_fixunssfsi.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:_modsi3.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:_muldi3.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:_udivdi3.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:_udivsi3.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:_umodsi3.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:dp-bit.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:fp-bit.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:_lshrdi3.o(.text);
|
||||
tools/agbcc/lib/libgcc.a:_negdi2.o(.text);
|
||||
asm/libc.o(.text);
|
||||
} =0
|
||||
|
||||
.rodata :
|
||||
ALIGN(4)
|
||||
{
|
||||
data/data2.o(.rodata);
|
||||
} =0
|
||||
|
||||
/* Discard everything not specifically mentioned above. */
|
||||
/DISCARD/ :
|
||||
{
|
||||
*(*);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user