Merge pull request #157 from yenatch/overworld

overworld loop and movement
This commit is contained in:
Bryan Bishop 2013-07-12 19:16:49 -07:00
commit bb8990dc3c
10 changed files with 2724 additions and 673 deletions

View File

@ -13,7 +13,7 @@ clean:
rm -f pokecrystal.o pokecrystal.gbc
@echo 'rm -f $(TEXTFILES:.asm=.tx)'
@rm -f $(TEXTFILES:.asm=.tx)
pokecrystal.o: $(TEXTFILES:.asm=.tx) $(LZ_GFX) $(TWOBPP_GFX)
pokecrystal.o: $(TEXTFILES:.asm=.tx) wram.asm constants.asm $(shell find constants/ -type f -name '*constants.asm') hram.asm gbhw.asm $(LZ_GFX) $(TWOBPP_GFX)
python prequeue.py $(TEXTQUEUE)
rgbasm -o pokecrystal.o pokecrystal.asm
.asm.tx:

View File

@ -6796,7 +6796,7 @@ BattleCommandac: ; 3658f
; jump
dec a
ld hl, .ptrs
rst $28
rst JumpTable
ret
.ptrs
dw BattleCommand19 ; paralyze
@ -9953,7 +9953,7 @@ Function0x377f5: ; 377f5
ld [$d123], a
ld a, [hl]
ld [$d124], a
ld a, $3
ld a, 3
ld [MonType], a
ld a, $14
ld hl, $4bdd

View File

@ -1,5 +1,11 @@
_CRYSTAL EQU 1
if _CRYSTAL
VERSION EQU 0
else
VERSION EQU 1
endc
INCLUDE "constants/pokemon_constants.asm"
INCLUDE "constants/move_constants.asm"
INCLUDE "constants/battle_constants.asm"
@ -10,9 +16,10 @@ INCLUDE "constants/script_constants.asm"
INCLUDE "constants/music_constants.asm"
; rst vectors
; macros require rst vectors to be defined
FarCall EQU $08
Bankswitch EQU $10
JumpTable EQU $28
dwb: MACRO
@ -184,22 +191,6 @@ ICON_SUDOWOODO EQU $25
ICON_BIGMON EQU $26
; days of the week
SUNDAY EQU 0
MONDAY EQU 1
TUESDAY EQU 2
WEDNESDAY EQU 3
THURSDAY EQU 4
FRIDAY EQU 5
SATURDAY EQU 6
; time of day
MORN EQU 0
DAY EQU 1
NITE EQU 2
DARKNESS EQU 3
; evolution types
EVOLVE_LEVEL EQU 1
EVOLVE_ITEM EQU 2
@ -220,23 +211,6 @@ ATK_LT_DEF EQU 2
ATK_EQ_DEF EQU 3
; main menu
CONTINUE EQU 0
NEW_GAME EQU 1
OPTION EQU 2
MYSTERY_GIFT EQU 3
MOBILE EQU 4
MOBILE_STUDIUM EQU 5
; kris's pc menu items
WITHDRAW_ITEM EQU 0
DEPOSIT_ITEM EQU 1
TOSS_ITEM EQU 2
MAIL_BOX EQU 3
DECORATION EQU 4
TURN_OFF EQU 5
LOG_OFF EQU 6
; name length
PLAYER_NAME_LENGTH EQU 8
PKMN_NAME_LENGTH EQU 11
@ -258,20 +232,10 @@ SET_FLAG EQU 1
CHECK_FLAG EQU 2
; player states
PLAYER_NORMAL EQU 0
PLAYER_BIKE EQU 1
PLAYER_SLIP EQU 2
PLAYER_SURF EQU 4
PLAYER_SURF_PIKA EQU 8
; joypad
BUTTONS EQU %00010000
D_PAD EQU %00100000
AUTO_INPUT EQU $ff
NO_INPUT EQU %00000000
BUTTON_A EQU %00000001
BUTTON_B EQU %00000010
@ -284,12 +248,6 @@ D_DOWN EQU %10000000
; movement
STANDING EQU -1
DOWN EQU 0
UP EQU 1
LEFT EQU 2
RIGHT EQU 3
STEP_SLOW EQU 0
STEP_WALK EQU 1
STEP_BIKE EQU 2
@ -299,19 +257,4 @@ STEP_TURN EQU 5
STEP_BACK_LEDGE EQU 6
STEP_WALK_IN_PLACE EQU 7
; facing
FACE_CURRENT EQU 0
FACE_DOWN EQU 8
FACE_UP EQU 4
FACE_LEFT EQU 2
FACE_RIGHT EQU 1
; Provisional wram bank 5 labels:
; 8 4-color palettes
Unkn1Pals EQU $d000
Unkn2Pals EQU $d040
BGPals EQU $d080
OBPals EQU $d0c0

File diff suppressed because it is too large Load Diff

View File

@ -98,6 +98,7 @@ chars = {
0xE9: "&",
0xEA: "é",
0xEB: "",
0xEC: "",
0xED: "",
0xEE: "",
0xEF: "",

View File

@ -1989,6 +1989,7 @@ movement_command_bases = {
0x3A: "remove_fixed_facing",
0x3B: "fix_facing",
0x3D: "hide_person",
0x3E: "show_person",
0x45: "accelerate_last",
0x46: ["step_sleep", ["duration", DecimalParam]],
0x47: "step_end",
@ -2000,6 +2001,8 @@ movement_command_bases = {
0x4E: "skyfall",
0x4F: "step_wait5",
0x53: "hide_emote",
0x54: "show_emote",
0x55: ["step_shake", ["displacement", DecimalParam]],
}

View File

@ -448,7 +448,7 @@ ParkBall: ; e8a2
xor a
ld [CurPartyMon], a
ld a, $2
ld a, BOXMON
ld [MonType], a
ld de, $d050
ld b, $0
@ -775,7 +775,7 @@ Function_0xed12: ; ed12
push de
ld a, [TempEnemyMonSpecies]
ld [CurPartySpecies], a
ld a, $4
ld a, WILDMON
ld [MonType], a
ld a, $14
ld hl, $4bdd

2479
main.asm

File diff suppressed because it is too large Load Diff

View File

@ -286,6 +286,7 @@ chars = {
"&": 0xE9,
"é": 0xEA,
"": 0xEB,
"": 0xEC,
"": 0xED,
"": 0xEE,
"": 0xEF,

147
wram.asm
View File

@ -10,12 +10,14 @@ SECTION "bgmap1",VRAM[$9C00]
VBGMap1:
; So far, WRAM banks 0 and 1 are included in this file.
; Any bank 2-7 labels are in constants.asm.
; WRAM banks 0 and 1 are included as BSS labels.
; Other WRAM banks (2-7) are constants for now.
SECTION "WRAMBank0",BSS[$c000]
SECTION "stack",BSS[$c000]
ds 256
ds $100
Stack: ; c100
@ -65,10 +67,7 @@ Channel1MusicAddress: ; c107
Channel1LastMusicAddress: ; c109
ds 2
; could have been meant as a third-level address
; unused? ; c10b
ds 1
; unused? ; c10c
ds 1
ds 2
Channel1NoteFlags: ; c10d
; 0:
; 1:
@ -312,8 +311,7 @@ CurMusic: ; c2c0
SECTION "auto",BSS[$c2c7]
InputType: ; c2c7
; 00 normal
; ff auto
AUTO_INPUT EQU $ff
ds 1
AutoInputAddress: ; c2c8
ds 2
@ -824,11 +822,10 @@ AttrMap: ; cdd9
ds 30
MonType: ; cf5f
; 0 partymon
; 1 otpartymon
; 2 boxmon
; 3 ????mon
; 4 wildmon
PARTYMON EQU 0
OTPARTYMON EQU 1
BOXMON EQU 2
WILDMON EQU 4
ds 1
CurSpecies: ; cf60
@ -837,9 +834,9 @@ CurSpecies: ; cf60
ds $13
MenuSelection:; cf74
ds 1
ds $cf82-$cf74
ds 1
ds 14
TileY: ; cf82
ds 1
@ -907,7 +904,9 @@ Options2: ; cfd1
ds 46
; d000
SECTION "WRAMBank1",BSS[$d000]
ds 2
DefaultFlypoint: ; d002
@ -937,10 +936,23 @@ CurFruit: ; d03f
MovementAnimation: ; d042
ds 1
WalkingDirection: ; d043
STANDING EQU -1
DOWN EQU 0
UP EQU 1
LEFT EQU 2
RIGHT EQU 3
ds 1
FacingDirection: ; d044
FACE_CURRENT EQU 0
FACE_DOWN EQU 8
FACE_UP EQU 4
FACE_LEFT EQU 2
FACE_RIGHT EQU 1
ds 1
WalkingX: ; d045
ds 1
WalkingY: ; d046
@ -1058,14 +1070,13 @@ TempMonSpclAtk: ; d13a
ds 2
TempMonSpclDef: ; d13c
ds 2
TempMonEnd: ; d13e
TempMonEnd ; d13e
ds 3
PartyMenuActionText ; d141
ds 1
ds 1
PartyMenuActionText: ; d141
ds 1
ds 1
CurPartyLevel: ; d143
ds 1
@ -1379,10 +1390,10 @@ CurDamage: ; d256
SECTION "TimeOfDay",BSS[$d269]
TimeOfDay: ; d269
; 0 morn
; 1 day
; 2 nite
; 3 darkness
MORN EQU 0
DAY EQU 1
NITE EQU 2
DARKNESS EQU 3
ds 1
SECTION "OTParty",BSS[$d280]
@ -1515,13 +1526,31 @@ OTPartyMon5Nickname: ; d416
OTPartyMon6Nickname: ; d421
ds 11
SECTION "Scripting",BSS[$d439]
SECTION "Scripting",BSS[$d434]
ScriptFlags: ; d434
SCRIPT_RUNNING EQU 2
ds 1
ds 2
ScriptMode: ; d437
SCRIPT_OFF EQU 0
SCRIPT_READ EQU 1
SCRIPT_WAIT_MOVEMENT EQU 2
SCRIPT_WAIT EQU 3
ds 1
ScriptRunning: ; d438
ds 1
ScriptBank: ; d439
ds 1
ScriptPos: ; d43a
ds 2
ds 17
ScriptDelay: ; d44d
ds 1
SECTION "Player",BSS[$d472]
PlayerGender: ; d472
; bit 0:
@ -1569,6 +1598,13 @@ GameTimeFrames: ; d4c8
ds 2
CurDay: ; d4cb
SUNDAY EQU 0
MONDAY EQU 1
TUESDAY EQU 2
WEDNESDAY EQU 3
THURSDAY EQU 4
FRIDAY EQU 5
SATURDAY EQU 6
ds 1
ds 12
@ -1612,6 +1648,16 @@ PlayerSpriteY: ; d4ee
ds 1
SECTION "Objects",BSS[$d71e]
MapObjects: ; d71e
PLAYER_OBJECT EQU 0
NUM_OBJECTS EQU $10
OBJECT_LENGTH EQU $10
ds OBJECT_LENGTH * NUM_OBJECTS
SECTION "Status",BSS[$d841]
TimeOfDayPal: ; d841
ds 1
@ -1622,7 +1668,12 @@ TimeOfDayPal: ; d841
CurTimeOfDay: ; d848
ds 1
ds 5
ds 3
StatusFlags: ; d84c
ds 1
StatusFlags2: ; d84d
ds 1
Money: ; d84e
ds 3
@ -1642,24 +1693,32 @@ TMsHMs: ; d859
NumItems: ; d892
ds 1
Items: ; d893
ds 69
ds 41
NumKeyItems: ; d8bc
ds 1
KeyItems: ; d8bd
ds 13
ds 26
NumBalls: ; d8d7
ds 1
Balls: ; d8d8
ds 25
SECTION "overworld",BSS[$d95d]
SECTION "overworld",BSS[$d95b]
WhichRegisteredItem: ; d95b
REGISTERED_POCKET EQU %11000000
REGISTERED_NUMBER EQU %00111111
ds 1
RegisteredItem: ; d95c
ds 1
PlayerState: ; d95d
; $00: normal
; $01: bicycle
; $04: surf
; $08: surf (pikachu)
PLAYER_NORMAL EQU 0
PLAYER_BIKE EQU 1
PLAYER_SLIP EQU 2
PLAYER_SURF EQU 4
PLAYER_SURF_PIKA EQU 8
ds 1
SECTION "scriptram",BSS[$d962]
@ -2001,3 +2060,17 @@ RoamMon3CurHP: ; dfe1
ds 1
RoamMon3DVs: ; dfe2
ds 2
; SECTION "WRAMBank5",BSS[$d000]
; 8 4-color palettes
Unkn1Pals EQU $d000
Unkn2Pals EQU $d040
BGPals EQU $d080
OBPals EQU $d0c0