Browse Source

full out map export

SBird1337 7 years ago
parent
commit
e52d77ea08
5 changed files with 160 additions and 133 deletions
  1. 11
    7
      charmap.txt
  2. 12
    2
      makefile
  3. 1
    1
      sots-private
  4. 112
    109
      src/include/pymap_constants.h
  5. 24
    14
      src/include/script_language.h

+ 11
- 7
charmap.txt View File

@@ -74,13 +74,13 @@ RIGHT_ARROW = 7C
74 74
 '.'         = AD
75 75
 '-'         = AE
76 76
 DOTS        = B0
77
-'“'         = B1
78
-'”'         = B2
77
+QUOTE        = B1
78
+'\q'        = B2
79 79
 '‘'         = B3
80
-''         = B4
80
+'\''         = B4
81 81
 '♂'         = B5
82 82
 '♀'         = B6
83
-'¥'         = B7
83
+'\$'         = B7
84 84
 ','         = B8
85 85
 '×'         = B9
86 86
 '/'         = BA
@@ -325,9 +325,9 @@ STRING = FD
325 325
 
326 326
 @ string placeholders
327 327
 PLAYER         = FD 01
328
-STR_VAR_1      = FD 02
329
-STR_VAR_2      = FD 03
330
-STR_VAR_3      = FD 04
328
+BUFFER_1       = FD 02
329
+BUFFER_2       = FD 03
330
+BUFFER_3       = FD 04
331 331
 KUN            = FD 05
332 332
 RIVAL          = FD 06
333 333
 @ version-dependent strings
@@ -362,12 +362,16 @@ NAME_END = FC 00
362 362
 
363 363
 @ more text functions
364 364
 
365
+TEXT_DELAY = FC 08 23
366
+TEXT_DELAY_LONG = FC 08 32
367
+
365 368
 COLOR = FC 01 @ use a color listed below right after
366 369
 HIGHLIGHT = FC 02 @ same as fc 01
367 370
 SHADOW = FC 03 @ same as fc 01
368 371
 COLOR_HIGHLIGHT_SHADOW = FC 04 @ takes 3 bytes
369 372
 PALETTE = FC 05 @ used in credits
370 373
 SIZE = FC 06 @ note that anything other than "SMALL" is invalid
374
+SMALL = FC 06 00
371 375
 UNKNOWN_7 = FC 07
372 376
 PAUSE = FC 08 @ manually print the wait byte after this, havent mapped them
373 377
 PAUSE_UNTIL_PRESS = FC 09

+ 12
- 2
makefile View File

@@ -30,6 +30,9 @@ BLDPATH   := object
30 30
 OUTPATH	  := build
31 31
 SOURCEDIR := src
32 32
 STRINGDIR := string
33
+MAPROOT	  := sots-private/map
34
+MAPMAPS	  := $(MAPROOT)/maps
35
+MAPTS	  := $(MAPROOT)/tilesets
33 36
 
34 37
 MAIN_OBJ  := $(BLDPATH)/linked.o
35 38
 B_ENGINE  := battle_engine/build/linked.o
@@ -37,6 +40,8 @@ SPRITES   := $(BLDPATH)/pkmn_sprites.o
37 40
 ICONS_AR  := $(BLDPATH)/pkmn_icons.a
38 41
 DYN_OVER  := built/dynamic_overworld.o
39 42
 
43
+TMP_LD	  := tmp.ld
44
+
40 45
 SND_ROOT := sots-private/sound
41 46
 MUSIC_AR := $(SND_ROOT)/Music/music.a
42 47
 SMPL_AR  := $(SND_ROOT)/Samples/sample.a
@@ -54,13 +59,16 @@ C_SRC       := $(call rwildcard,src/,*.c)
54 59
 DATA_SRC    := $(call rwildcard,data/,*.s)
55 60
 STRING		:= $(call rwildcard,string/$(LAN)/,*.txt)
56 61
 STRING_SRC	:= $(STRING:%.txt=%.s)
62
+SCRIPT_SRC	:= $(call rwildcard,$(MAPMAPS)/,*.s)
63
+
57 64
 
58 65
 GEN_OBJ		:= $(GEN_SRC:%.c=$(BLDPATH)/%.o)
59 66
 STRING_OBJ	:= $(STRING_SRC:%.s=$(BLDPATH)/%.o)
60 67
 ASM_OBJ     := $(ASM_SRC:%.s=$(BLDPATH)/%.o)
61 68
 C_OBJ       := $(C_SRC:%.c=$(BLDPATH)/%.o)
62 69
 DATA_OBJ    := $(DATA_SRC:%.s=$(BLDPATH)/%.o)
63
-ALL_OBJ     := $(GEN_OBJ) $(C_OBJ) $(ASM_OBJ) $(DATA_OBJ) $(STRING_OBJ)
70
+SCRIPT_OBJ	:= $(SCRIPT_SRC:%.s=$(BLDPATH)/%.o)
71
+ALL_OBJ     := $(GEN_OBJ) $(C_OBJ) $(ASM_OBJ) $(DATA_OBJ) $(STRING_OBJ) $(SCRIPT_OBJ)
64 72
 
65 73
 $(STRINGDIR)/%.s: $(STRINGDIR)/%.txt
66 74
 	@echo -e "\e[93mGenerating strings $<\e[0m"
@@ -100,7 +108,9 @@ rom: main.asm $(MAIN_OBJ)
100 108
 $(MAIN_OBJ): $(ALL_OBJ) $(ICONS_AR) $(SPRITES) $(MUSIC_AR) $(SMPL_AR) $(VOICE_AR) $(LIST_AR) $(CRY_AR) $()#$(B_ENGINE)
101 109
 	$(MAKE) -f assets.makefile
102 110
 	@echo -e "\e[1;32mLinking ELF binary $@\e[0m"
103
-	$(LD) $(LDFLAGS) -T $(PAGB_LINK) -T linker.ld -T bpre.sym --whole-archive -r -o $@ --start-group $^ --end-group
111
+	@echo "INPUT($^)" > $(TMP_LD)
112
+	$(LD) $(LDFLAGS) -T $(PAGB_LINK) -T linker.ld -T bpre.sym --whole-archive -r -o $@ --start-group -T $(TMP_LD) --end-group
113
+	@rm -f $(TMP_LD)
104 114
 
105 115
 .PHONY: $(B_ENGINE)
106 116
 $(B_ENGINE):

+ 1
- 1
sots-private

@@ -1 +1 @@
1
-Subproject commit 7fd26679a5fbf886c57440f7090ca16f02d0361e
1
+Subproject commit 04d6d99a48f025594551fe535770abbc3b9d8075

src/include/pymap_constants.s → src/include/pymap_constants.h View File

@@ -1378,6 +1378,23 @@
1378 1378
 .equ PKMNMENU, 0x828
1379 1379
 .equ POKEDEX, 0x829
1380 1380
 .equ RUNNING_SHOES, 0x830
1381
+.equ BATTLE_LOSABLE, 0x90f
1382
+.equ TRANS_PALETTE_FETCH, 0x910
1383
+.equ TRANS_DISABLE, 0x911
1384
+.equ WONDERTRADE, 0x915
1385
+.equ MAP_BGN_AUTO_ALIGN_OFF, 0x916
1386
+.equ POKERADAR_POKEMON_SPAWNED, 0x917
1387
+.equ ABILITY_SPARSAM_TRIGGER, 0x918
1388
+.equ WONDERTRADE_MEW_RECEIVED, 0x91f
1389
+.equ MEGA_EVOLUTION_PERFORMED, 0x920
1390
+.equ PLAYER_ABLE_TO_MEGA_EVOLVE, 0x921
1391
+.equ MAP_LOAD_DYNAMIC, 0x922
1392
+.equ DUNGEON_BUFFERED, 0x923
1393
+.equ PLAYER_CAN_ENTER_DUNGEONS, 0x924
1394
+.equ POKEDEX_FEATURE_HABITAT, 0x927
1395
+.equ POKEDEX_FEATURE_0, 0x928
1396
+.equ POKEDEX_FEATURE_1, 0x929
1397
+.equ POKEDEX_FEATURE_2, 0x92a
1381 1398
 
1382 1399
 
1383 1400
 
@@ -1431,12 +1448,12 @@
1431 1448
 @ARM Assembly macro definitions for ord
1432 1449
 
1433 1450
 
1434
-.equ B_LT, 0x0
1435
-.equ B_EQ, 0x1
1436
-.equ B_GT, 0x2
1437
-.equ B_LE, 0x3
1438
-.equ B_GE, 0x4
1439
-.equ B_NE, 0x5
1451
+.equ LESS, 0x0
1452
+.equ EQUAL, 0x1
1453
+.equ HIGHER, 0x2
1454
+.equ LESS_OR_EQUAL, 0x3
1455
+.equ HIGHER_OR_EQUAL, 0x4
1456
+.equ NOT_EQUAL, 0x5
1440 1457
 
1441 1458
 
1442 1459
 
@@ -1449,115 +1466,101 @@
1449 1466
 .equ MSG_SIGN, 0x3
1450 1467
 .equ MSG_KEEPOPEN, 0x4
1451 1468
 .equ MSG_YES_NO, 0x5
1452
-.equ MSG_STD, 0x6
1469
+.equ MSG, 0x6
1453 1470
 
1454 1471
 
1455 1472
 
1456 1473
 @ARM Assembly macro definitions for moves
1457 1474
 
1458 1475
 
1459
-.equ APPLYMOVE_LOOK_DOWN, 0x0
1460
-.equ APPLYMOVE_LOOK_UP, 0x1
1461
-.equ APPLYMOVE_LOOK_LEFT, 0x2
1462
-.equ APPLYMOVE_LOOK_RIGHT, 0x3
1463
-.equ APPLYMOVE_GO_DOWN_VERY_SLOW, 0x8
1464
-.equ APPLYMOVE_GO_UP_VERY_SLOW, 0x9
1465
-.equ APPLYMOVE_GO_LEFT_VERY_SLOW, 0xa
1466
-.equ APPLYMOVE_GO_RIGHT_VERY_SLOW, 0xb
1467
-.equ APPLYMOVE_GO_DOWN_SLOW, 0xc
1468
-.equ APPLYMOVE_GO_UP_SLOW, 0xd
1469
-.equ APPLYMOVE_GO_LEFT_SLOW, 0xe
1470
-.equ APPLYMOVE_GO_RIGHT_SLOW, 0xf
1471
-.equ APPLYMOVE_GO_DOWN, 0x10
1472
-.equ APPLYMOVE_GO_UP, 0x11
1473
-.equ APPLYMOVE_GO_LEFT, 0x12
1474
-.equ APPLYMOVE_GO_RIGHT, 0x13
1475
-.equ APPLYMOVE_JUMP_TWO_DOWN, 0x14
1476
-.equ APPLYMOVE_JUMP_TWO_UP, 0x15
1477
-.equ APPLYMOVE_JUMP_TWO_LEFT, 0x16
1478
-.equ APPLYMOVE_JUMP_TWO_RIGHT, 0x17
1479
-.equ APPLYMOVE_DELAY1, 0x18
1480
-.equ APPLYMOVE_DELAY2, 0x19
1481
-.equ APPLYMOVE_DELAY3, 0x1a
1482
-.equ APPLYMOVE_DELAY4, 0x1b
1483
-.equ APPLYMOVE_DELAY5, 0x1c
1484
-.equ APPLYMOVE_GO_DOWN_FAST, 0x1d
1485
-.equ APPLYMOVE_GO_UP_FAST, 0x1e
1486
-.equ APPLYMOVE_GO_LEFT_FAST, 0x1f
1487
-.equ APPLYMOVE_GO_RIGHT_FAST, 0x20
1488
-.equ APPLYMOVE_GO_DOWN_ON_POINT, 0x21
1489
-.equ APPLYMOVE_GO_UP_ON_POINT, 0x22
1490
-.equ APPLYMOVE_GO_LEFT_ON_POINT, 0x23
1491
-.equ APPLYMOVE_GO_RIGHT_ON_POINT, 0x24
1492
-.equ APPLYMOVE_GO_DOWN_ON_POINT_FAST, 0x25
1493
-.equ APPLYMOVE_GO_UP_ON_POINT_FAST, 0x26
1494
-.equ APPLYMOVE_GO_LEFT_ON_POINT_FAST, 0x27
1495
-.equ APPLYMOVE_GO_RIGHT_ON_POINT_FAST, 0x28
1496
-.equ APPLYMOVE_GO_DOWN_ON_POINT_VERY_FAST, 0x29
1497
-.equ APPLYMOVE_GO_UP_ON_POINT_VERY_FAST, 0x2a
1498
-.equ APPLYMOVE_GO_LEFT_ON_POINT_VERY_FAST, 0x2b
1499
-.equ APPLYMOVE_GO_RIGHT_ON_POINT_VERY_FAST, 0x2c
1500
-.equ APPLYMOVE_LOOK_DOWN_DELAY, 0x2d
1501
-.equ APPLYMOVE_LOOK_UP_DELAY, 0x2e
1502
-.equ APPLYMOVE_LOOK_LEFT_DELAY, 0x2f
1503
-.equ APPLYMOVE_LOOK_RIGHT_DELAY, 0x30
1504
-.equ APPLYMOVE_GO_DOWN_VERY_FAST, 0x35
1505
-.equ APPLYMOVE_GO_UP_VERY_FAST, 0x36
1506
-.equ APPLYMOVE_GO_LEFT_VERY_FAST, 0x37
1507
-.equ APPLYMOVE_GO_RIGHT_VERY_FAST, 0x38
1508
-.equ APPLYMOVE_SLIDE_DOWN_FAST, 0x39
1509
-.equ APPLYMOVE_SLIDE_UP_FAST, 0x3a
1510
-.equ APPLYMOVE_SLIDE_LEFT_FAST, 0x3b
1511
-.equ APPLYMOVE_SLIDE_RIGHT_FAST, 0x3c
1512
-.equ APPLYMOVE_GO_LOOP, 0x45
1513
-.equ APPLYMOVE_RUN_LOOP, 0x46
1514
-.equ APPLYMOVE_LOOK_PLAYER, 0x4a
1515
-.equ APPLYMOVE_LOOK_NOT_PLAYER, 0x4b
1516
-.equ APPLYMOVE_FREEZE_LOOK, 0x4c
1517
-.equ APPLYMOVE_FREE_LOOK, 0x4d
1518
-.equ APPLYMOVE_JUMP_ONE_DOWN, 0x4e
1519
-.equ APPLYMOVE_JUMP_ONE_UP, 0x4f
1520
-.equ APPLYMOVE_JUMP_ONE_LEFT, 0x50
1521
-.equ APPLYMOVE_JUMP_ONE_RIGHT, 0x51
1522
-.equ APPLYMOVE_JUMP_ON_POINT_DOWN, 0x52
1523
-.equ APPLYMOVE_JUMP_ON_POINT_UP, 0x53
1524
-.equ APPLYMOVE_JUMP_ON_POINT_LEFT, 0x54
1525
-.equ APPLYMOVE_JUMP_ON_POINT_RIGHT, 0x55
1526
-.equ APPLYMOVE_JUMP_ON_POINT_UP_DOWN, 0x56
1527
-.equ APPLYMOVE_JUMP_ON_POINT_DOWN_UP, 0x57
1528
-.equ APPLYMOVE_JUMP_ON_POINT_RIGHT_LEFT, 0x58
1529
-.equ APPLYMOVE_JUMP_ON_POINT_LEFT_RIGHT, 0x59
1530
-.equ APPLYMOVE_HIDESPRITE, 0x60
1531
-.equ APPLYMOVE_SHOWSPRITE, 0x61
1532
-.equ APPLYMOVE_EXCL, 0x62
1533
-.equ APPLYMOVE_QUEST, 0x63
1534
-.equ APPLYMOVE_IDEA, 0x64
1535
-.equ APPLYMOVE_ANGRY, 0x65
1536
-.equ APPLYMOVE_CONCERNED, 0x66
1537
-.equ APPLYMOVE_TREESMASH, 0x69
1538
-.equ APPLYMOVE_RUN_DOWN, 0x74
1539
-.equ APPLYMOVE_RUN_UP, 0x75
1540
-.equ APPLYMOVE_RUN_LEFT, 0x76
1541
-.equ APPLYMOVE_RUN_RIGHT, 0x77
1542
-.equ APPLYMOVE_JUMP_TWO_DOWN, 0x84
1543
-.equ APPLYMOVE_JUMP_TWO_UP, 0x85
1544
-.equ APPLYMOVE_JUMP_TWO_LEFT, 0x86
1545
-.equ APPLYMOVE_JUMP_TWO_RIGHT, 0x87
1546
-.equ APPLYMOVE_GO_CLOCKWISE_DOWN, 0x94
1547
-.equ APPLYMOVE_GO_CLOCKWISE_UP, 0x95
1548
-.equ APPLYMOVE_GO_CLOCKWISE_LEFT, 0x96
1549
-.equ APPLYMOVE_GO_CLOCKWISE_RIGHT, 0x97
1550
-.equ APPLYMOVE_GO_PIXELWISE_DOWN, 0x9b
1551
-.equ APPLYMOVE_GO_PIXELWISE_UP, 0x9c
1552
-.equ APPLYMOVE_GO_PIXELWISE_LEFT, 0x9d
1553
-.equ APPLYMOVE_GO_PIXELWISE_RIGHT, 0x9e
1554
-.equ APPLYMOVE_SLIDE_NO_MOVEMENT_DOWN, 0xa0
1555
-.equ APPLYMOVE_SLIDE_NO_MOVEMENT_UP, 0xa1
1556
-.equ APPLYMOVE_SLIDE_NO_MOVEMENT_LEFT, 0xa2
1557
-.equ APPLYMOVE_SLIDE_NO_MOVEMENT_RIGHT, 0xa3
1558
-.equ APPLYMOVE_TELEPORT_MOVE, 0xa4
1559
-.equ APPLYMOVE_FALLING_DOWN_MOVE, 0xa5
1560
-.equ APPLYMOVE_END, 0xfe
1476
+.equ LOOK_UP, 0x1
1477
+.equ LOOK_LEFT, 0x2
1478
+.equ LOOK_RIGHT, 0x3
1479
+.equ LOOK_DOWN, 0x4
1480
+.equ STEP_DOWN_VERY_SLOW, 0x8
1481
+.equ STEP_UP_VERY_SLOW, 0x9
1482
+.equ STEP_LEFT_VERY_SLOW, 0xa
1483
+.equ STEP_RIGHT_VERY_SLOW, 0xb
1484
+.equ STEP_DOWN_SLOW, 0xc
1485
+.equ STEP_UP_SLOW, 0xd
1486
+.equ STEP_LEFT_SLOW, 0xe
1487
+.equ STEP_RIGHT_SLOW, 0xf
1488
+.equ STEP_DOWN, 0x10
1489
+.equ STEP_UP, 0x11
1490
+.equ STEP_LEFT, 0x12
1491
+.equ STEP_RIGHT, 0x13
1492
+.equ JUMP_DOWN2, 0x14
1493
+.equ JUMP_UP2, 0x15
1494
+.equ JUMP_LEFT2, 0x16
1495
+.equ JUMP_RIGHT2, 0x17
1496
+.equ STEP_DOWN_FAST, 0x1d
1497
+.equ STEP_UP_FAST, 0x1e
1498
+.equ STEP_LEFT_FAST, 0x1f
1499
+.equ STEP_RIGHT_FAST, 0x20
1500
+.equ STEP_IN_PLACE_DOWN, 0x21
1501
+.equ STEP_IN_PLACE_UP, 0x22
1502
+.equ STEP_IN_PLACE_LEFT, 0x23
1503
+.equ STEP_IN_PLACE_RIGHT, 0x24
1504
+.equ STEP_IN_PLACE_DOWN_FAST, 0x25
1505
+.equ STEP_IN_PLACE_UP_FAST, 0x26
1506
+.equ STEP_IN_PLACE_LEFT_FAST, 0x27
1507
+.equ STEP_IN_PLACE_RIGHT_FAST, 0x28
1508
+.equ STEP_IN_PLACE_DOWN_VERY_FAST, 0x29
1509
+.equ STEP_IN_PLACE_UP_VERY_FAST, 0x2a
1510
+.equ STEP_IN_PLACE_LEFT_VERY_FAST, 0x2b
1511
+.equ STEP_IN_PLACE_RIGHT_VERY_FAST, 0x2c
1512
+.equ LOOK_DOWN_DELAYED, 0x2d
1513
+.equ LOOK_UP_DELAYED, 0x2e
1514
+.equ LOOK_LEFT_DELAYED, 0x2f
1515
+.equ LOOK_RIGHT_DELAYED, 0x30
1516
+.equ SLIDE_DOWN, 0x31
1517
+.equ SLIDE_UP, 0x32
1518
+.equ SLIDE_LEFT, 0x33
1519
+.equ SLIDE_RIGHT, 0x34
1520
+.equ SLIDE_DOWN_ON_RIGHT_FOOT, 0x3d
1521
+.equ SLIDE_UP_ON_RIGHT_FOOT, 0x3e
1522
+.equ SLIDE_LEFT_ON_RIGHT_FOOT, 0x3f
1523
+.equ SLIDE_RIGHT_ON_RIGHT_FOOT, 0x40
1524
+.equ SLIDE_DOWN_ON_LEFT_FOOT, 0x41
1525
+.equ SLIDE_UP_ON_LEFT_FOOT, 0x42
1526
+.equ SLIDE_LEFT_ON_LEFT_FOOT, 0x43
1527
+.equ SLIDE_RIGHT_ON_LEFT_FOOT, 0x44
1528
+.equ RUN_INFINITLY, 0x45
1529
+.equ JUMP_DOWN_RUNNING, 0x46
1530
+.equ JUMP_UP_RUNNING, 0x47
1531
+.equ JUMP_LEFT_RUNNING, 0x48
1532
+.equ JUMP_RIGHT_RUNNING, 0x49
1533
+.equ FACE_PLAYER, 0x4a
1534
+.equ FACE_AWAY_FROM_PLAYER, 0x4b
1535
+.equ JUMP_DOWN, 0x4e
1536
+.equ JUMP_UP, 0x4f
1537
+.equ JUMP_LEFT, 0x50
1538
+.equ JUMP_RIGHT, 0x51
1539
+.equ JUMP_IN_PLACE_FACE_DOWN, 0x52
1540
+.equ JUMP_IN_PLACE_FACE_UP, 0x53
1541
+.equ JUMP_IN_PLACE_FACE_LEFT, 0x54
1542
+.equ JUMP_IN_PLACE_FACE_RIGHT, 0x55
1543
+.equ JUMP_IN_PLACE_FACE_DOWN_TO_UP, 0x56
1544
+.equ JUMP_IN_PLACE_FACE_UP_TO_DOWN, 0x57
1545
+.equ JUMP_IN_PLACE_FACE_LEFT_TO_RIGHT, 0x58
1546
+.equ JUMP_IN_PLACE_FACE_RIGHT_TO_LEFT, 0x59
1547
+.equ HIDE_SPRITE, 0x60
1548
+.equ SHOW_SPRITE, 0x61
1549
+.equ SAY_EXCLAM, 0x62
1550
+.equ SAY_QUESTION, 0x63
1551
+.equ SAY_X, 0x64
1552
+.equ SAY_DOUBLE_EXCLAM, 0x65
1553
+.equ SAY_SMILE, 0x66
1554
+.equ MOVEX_DOWN, 0x6e
1555
+.equ MOVEY_DOWN, 0x6f
1556
+.equ LOOK_RIGHT_LEFT_DOWNFACING, 0x78
1557
+.equ LIFT_DOWN, 0xa0
1558
+.equ LIFT_UP, 0xa1
1559
+.equ LIFT_LEFT, 0xa2
1560
+.equ LIFT_RIGHT, 0xa3
1561
+.equ FLY_OUT_OF_SCREEN, 0xa5
1562
+.equ FLY_FROM_SCREEN, 0xa6
1563
+.equ STOP, 0xfe
1561 1564
 
1562 1565
 
1563 1566
 

+ 24
- 14
src/include/script_language.h View File

@@ -167,13 +167,13 @@ clearflag FLAG_ENABLE_MUSIC_OVERRIDES
167 167
 .macro callif if1_value:req if1_pointer:req
168 168
 .byte 0x6
169 169
 .byte \if1_value
170
-.word \if1_address
170
+.word \if1_pointer
171 171
 .endm
172 172
 
173 173
 .macro gotoif if2_value:req if2_pointer:req
174 174
 .byte 0x7
175 175
 .byte \if2_value
176
-.word \if2_address
176
+.word \if2_pointer
177 177
 .endm
178 178
 
179 179
 .macro callstd callstd_call:req
@@ -217,14 +217,14 @@ clearflag FLAG_ENABLE_MUSIC_OVERRIDES
217 217
 
218 218
 .macro copyvar copyvar_variableADestin:req copyvar_variableBSource:req
219 219
 .byte 0x19
220
-.hword copyvar_variableADestin
221
-.hword copyvar_variableBSource
220
+.hword \copyvar_variableADestin
221
+.hword \copyvar_variableBSource
222 222
 .endm
223 223
 
224
-.macro setvarifnotzero setvarifnotzero_variableADestin:req setvarifnotzero_variableBSource:req
224
+.macro copyvarifnotzero copyvarifnotzero_variableADestin:req copyvarifnotzero_variableBSource:req
225 225
 .byte 0x1A
226
-.hword setvarifnotzero_variableADestin
227
-.hword setvarifnotzero_variableBSource
226
+.hword \copyvarifnotzero_variableADestin
227
+.hword \copyvarifnotzero_variableBSource
228 228
 .endm
229 229
 
230 230
 .macro compare compare_variable:req compare_value:req
@@ -312,7 +312,7 @@ clearflag FLAG_ENABLE_MUSIC_OVERRIDES
312 312
 .hword \playsong2_song
313 313
 .endm
314 314
 
315
-.macro fadedefault
315
+.macro songfadedefault
316 316
 .byte 0x35
317 317
 .endm
318 318
 
@@ -490,7 +490,7 @@ clearflag FLAG_ENABLE_MUSIC_OVERRIDES
490 490
 .hword \movesprite_y
491 491
 .endm
492 492
 
493
-.macro spritevisible spritevisible_people:req spritevisible_bank:req movesprite_map:req
493
+.macro spritevisible spritevisible_people:req spritevisible_bank:req spritevisible_map:req
494 494
 .byte 0x58
495 495
 .hword \spritevisible_people
496 496
 .byte \spritevisible_bank
@@ -514,7 +514,7 @@ clearflag FLAG_ENABLE_MUSIC_OVERRIDES
514 514
 .byte \spriteface_facing
515 515
 .endm
516 516
 
517
-.macro trainerbattle trainerbattle_kind:req trainerbattle_id:req trainerbattle_value:req trainerbattle_before:req trainerbattle_after:req trainerbattle_later:req
517
+.macro trainerbattle trainerbattle_kind:req trainerbattle_id:req trainerbattle_value:req trainerbattle_before:req trainerbattle_after:req trainerbattle_later
518 518
 .byte 0x5C
519 519
 .byte \trainerbattle_kind
520 520
 .hword \trainerbattle_id
@@ -566,7 +566,7 @@ clearflag FLAG_ENABLE_MUSIC_OVERRIDES
566 566
 .macro spritebehave spritebehave_people:req spritebehave_facing:req
567 567
 .byte 0x65
568 568
 .hword \spritebehave_people
569
-.byte \spritebehave_behaviour
569
+.byte \spritebehave_facing
570 570
 .endm
571 571
 
572 572
 .macro waitmsg
@@ -650,7 +650,7 @@ clearflag FLAG_ENABLE_MUSIC_OVERRIDES
650 650
 .word \braile_data
651 651
 .endm
652 652
 
653
-.macro givepokemon givepokemon_spezies:req givepokemon_level:req givepokemon_item:req
653
+.macro givepokemon givepokemon_spezies:req givepokemon_level:req givepokemon_item:req givepokemon_one givepokemon_two givepokemon_three
654 654
 .byte 0x79
655 655
 .hword \givepokemon_spezies
656 656
 .byte \givepokemon_level
@@ -721,7 +721,7 @@ clearflag FLAG_ENABLE_MUSIC_OVERRIDES
721 721
 .macro bufferstring bufferstring_buffernumber:req bufferstring_string:req
722 722
 .byte 0x85
723 723
 .byte \bufferstring_buffernumber
724
-.hword \bufferstring_string
724
+.word \bufferstring_string
725 725
 .endm
726 726
 
727 727
 .macro pokemart pokemart_list:req
@@ -729,6 +729,11 @@ clearflag FLAG_ENABLE_MUSIC_OVERRIDES
729 729
 .word \pokemart_list
730 730
 .endm
731 731
 
732
+.macro pokemart3 pokemart_list_three:req
733
+.byte 0x86
734
+.word \pokemart_list_three
735
+.endm
736
+
732 737
 .macro random random_possiblities:req
733 738
 .byte 0x8F
734 739
 .hword \random_possiblities
@@ -746,7 +751,7 @@ clearflag FLAG_ENABLE_MUSIC_OVERRIDES
746 751
 .byte \paymoney_command
747 752
 .endm
748 753
 
749
-.macro checkmoney checkmoney_quantity:req paymoney_command:req
754
+.macro checkmoney checkmoney_quantity:req checkmoney_command:req
750 755
 .byte 0x92
751 756
 .word \checkmoney_quantity
752 757
 .byte \checkmoney_command
@@ -920,6 +925,11 @@ clearflag FLAG_ENABLE_MUSIC_OVERRIDES
920 925
 .byte 0xB7
921 926
 .endm
922 927
 
928
+.macro savincrementkey attr:req
929
+.byte 0xC3
930
+.byte \attr
931
+.endm
932
+
923 933
 .macro waitcry
924 934
 .byte 0xC5
925 935
 .endm