summaryrefslogtreecommitdiff
path: root/main.asm
diff options
context:
space:
mode:
Diffstat (limited to 'main.asm')
-rw-r--r--main.asm188
1 files changed, 7 insertions, 181 deletions
diff --git a/main.asm b/main.asm
index 8833ca81..36b63704 100644
--- a/main.asm
+++ b/main.asm
@@ -4,188 +4,14 @@ INCLUDE "constants.asm"
SECTION "bank1", ROMX
INCLUDE "engine/link/place_waiting_text.asm"
-
-DummyPredef1:
- ret
-
-WriteOAMDMACodeToHRAM:: ; 4032 (1:4032)
- ld c, hTransferVirtualOAM - $ff00
- ld b, PushOAMEnd - PushOAM
- ld hl, PushOAM
-.asm_4039
- ld a, [hli]
- ld [$ff00+c], a
- inc c
- dec b
- jr nz, .asm_4039
- ret
-
-PushOAM:
- ld a, wVirtualOAM / $100
- ldh [rDMA], a
- ld a, $28
-.asm_4046
- dec a
- jr nz, .asm_4046
- ret
-
-PushOAMEnd
-
+INCLUDE "engine/gfx/load_push_oam.asm"
INCLUDE "engine/overworld/map_objects.asm"
-INCLUDE "engine/main_menu.asm"
-INCLUDE "engine/title.asm"
-
-ReanchorBGMap_NoOAMUpdate:: ; 6551 (1:6551)
- call DelayFrame
- ldh a, [hOAMUpdate]
- push af
- ld a, $1
- ldh [hOAMUpdate], a
- ldh a, [hBGMapMode]
- push af
- xor a
- ldh [hBGMapMode], a
- call Function656b
- pop af
- ldh [hBGMapMode], a
- pop af
- ldh [hOAMUpdate], a
- ret
-
-Function656b: ; 656b (1:656b)
- xor a
- ldh [hLCDCPointer], a
- ldh [hBGMapMode], a
- ld hl, wd565
- set 7, [hl]
- res 2, [hl]
- ld a, $90
- ldh [hWY], a
- call OverworldTextModeSwitch
- ld a, $9c
- call .LoadBGMapAddrIntoHRAM
- call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap
- xor a
- ldh [hBGMapMode], a
- ldh [hWY], a
- ld a, $98
- call .LoadBGMapAddrIntoHRAM
- call .WaitTransfer
- xor a
- ld [wd05b], a
- ld a, $98
- ld [wd05c], a
- xor a
- ldh [hSCX], a
- ldh [hSCY], a
- call ApplyBGMapAnchorToObjects
- ret
-
-.LoadBGMapAddrIntoHRAM: ; 65a5 (1:65a5)
- ldh [hBGMapAddress + 1], a
- xor a
- ldh [hBGMapAddress], a
- ret
-
-.WaitTransfer: ; 65ab (1:65ab)
- ldh a, [hBGMapMode]
- push af
- xor a
- ldh [hBGMapMode], a
- ldh a, [hOAMUpdate]
- push af
- ld a, $1
- ldh [hOAMUpdate], a
- ld a, $3
- ldh [hVBlankCounter + 1], a
-.asm_65bc
- call DelayFrame
- ldh a, [hVBlankCounter + 1]
- and a
- jr nz, .asm_65bc
- pop af
- ldh [hOAMUpdate], a
- pop af
- ldh [hBGMapMode], a
- ret
-
-LoadFonts_NoOAMUpdate:: ; 65cb (1:65cb)
- ldh a, [hOAMUpdate]
- push af
- ld a, $1
- ldh [hOAMUpdate], a
- call .LoadGFX
- pop af
- ldh [hOAMUpdate], a
- ret
-
-.LoadGFX: ; 65d9 (1:65d9)
- call LoadFontsExtra
- ld a, $90
- ldh [hWY], a
- call SafeUpdateSprites
- call Functiond9e
- ret
-
-INCLUDE "engine/learn.asm"
-
-CorrectNickErrors:: ; 677e (1:677e)
- push bc
- push de
- ld b, MON_NAME_LENGTH
-.checkchar
- ld a, [de]
- cp "@"
- jr z, .done
- ld hl, .textcommands
- dec hl
-.loop
- inc hl
- ld a, [hl]
- cp $ff
- jr z, .next
- ld a, [de]
- cp [hl]
- inc hl
- jr c, .loop
- cp [hl]
- jr nc, .loop
- ld a, "?"
- ld [de], a
- jr .loop
-
-.next
- inc de
- dec b
- jr nz, .checkchar
- pop de
- push de
- ld a, "?"
- ld [de], a
- inc de
- ld a, "@"
- ld [de], a
-.done
- pop de
- pop bc
- ret
-
-.textcommands
-; table defining which characters are actually text commands
-; format:
- ; ≥ <
- db "<START>", $04 + 1
- db "<PLAY_G>", $18 + 1
- db $1d, "%" + 1
- db $35, "<GREEN>" + 1
- db "<ENEMY>", "<ENEMY>" + 1
- db $49, "<TM>" + 1
- db "<ROCKET>", "┘" + 1
- db -1 ; end
-
-INCLUDE "engine/math.asm"
-ItemAttributes:
-INCLUDE "items/item_attributes.asm"
+INCLUDE "engine/menus/intro_menu.asm"
+INCLUDE "engine/overworld/init_map.asm"
+INCLUDE "engine/pokemon/learn.asm"
+INCLUDE "engine/pokemon/correct_nick_errors.asm"
+INCLUDE "engine/math/math.asm"
+INCLUDE "data/items/attributes.asm"
INCLUDE "engine/overworld/npc_movement.asm"
INCLUDE "engine/events/happiness_egg.asm"
INCLUDE "engine/events/shuckle.asm"