ipatix 7 years ago
parent
commit
56d90095a0
47 changed files with 1323 additions and 206 deletions
  1. 8
    0
      .gitattributes
  2. 2
    1
      .gitignore
  3. 1
    0
      build/.gitignore
  4. 94
    0
      data/string/map_names.s
  5. 32
    0
      generated_image/bootscreen/boot_tileset.h
  6. 28
    0
      generated_image/char/bag/hero_bag.h
  7. 28
    0
      generated_image/char/bag/heroine_bag.h
  8. 28
    0
      generated_image/char/throw_out/hero_backsprite.h
  9. 28
    0
      generated_image/char/throw_out/heroine_backsprite.h
  10. 33
    0
      generated_image/cutscene_meteor/met_background.h
  11. 32
    0
      generated_image/cutscene_meteor/met_clouds.h
  12. 32
    0
      generated_image/cutscene_meteor/met_foreground.h
  13. 28
    0
      generated_image/cutscene_meteor/met_foreground_red.h
  14. 28
    0
      generated_image/cutscene_meteor/met_meteor.h
  15. 32
    0
      generated_image/cutscene_meteor/met_sky.h
  16. 28
    0
      generated_image/cutscene_meteor/met_sky_red.h
  17. 24
    0
      generated_image/emoticons/emot_arrows.h
  18. 28
    0
      generated_image/mugshots/mug_00.h
  19. 28
    0
      generated_image/mugshots/mug_01.h
  20. 28
    0
      generated_image/mugshots/mug_02.h
  21. 28
    0
      generated_image/mugshots/mug_03.h
  22. 28
    0
      generated_image/mugshots/mug_04.h
  23. 28
    0
      generated_image/mugshots/mug_05.h
  24. 28
    0
      generated_image/mugshots/mug_06.h
  25. 28
    0
      generated_image/mugshots/mug_07.h
  26. 28
    0
      generated_image/mugshots/mug_08.h
  27. 28
    0
      generated_image/mugshots/mug_09.h
  28. 28
    0
      generated_image/titlescreen/title_sprite_sky.h
  29. 28
    0
      generated_image/titlescreen/title_tileset_background.h
  30. 28
    0
      generated_image/titlescreen/title_tileset_latias_latios_deoxys.h
  31. 28
    0
      generated_image/titlescreen/title_tileset_logo_name.h
  32. 28
    0
      generated_image/titlescreen/title_tileset_press_start.h
  33. 1
    1
      main.asm
  34. 52
    4
      makefile
  35. 21
    3
      patches/dynamic_overworld_hooks.asm
  36. 15
    4
      patches/game_engine/quick_hacks.asm
  37. 13
    0
      patches/maps.asm
  38. 2
    2
      patches/overworlds/overworld.asm
  39. 1
    1
      sots-private
  40. 33
    0
      src/game_engine/whiteout_hook.s
  41. 7
    0
      src/include/hiddenflags.h
  42. 15
    0
      src/include/mugssprites.h
  43. 24
    132
      src/include/pymap_constants.h
  44. 140
    42
      src/include/script_language.h
  45. 13
    6
      src/overworld/dyn_npc_hooks.S
  46. 13
    6
      src/overworld/dyn_npc_hooks.s
  47. 67
    4
      src/overworld/dynamic_overworld.c

+ 8
- 0
.gitattributes View File

1
+.s text eol=lf
2
+.txt text eol=lf
3
+.c text eol=lf
4
+.h text eol=lf
5
+.json text
6
+
7
+.png binary
8
+.bin binary

+ 2
- 1
.gitignore View File

7
 *.mid
7
 *.mid
8
 *.a
8
 *.a
9
 base/*.*
9
 base/*.*
10
-nbproject/private/tools/
10
+nbproject/private/tools/
11
+build/*

+ 1
- 0
build/.gitignore View File

3
 *.bak
3
 *.bak
4
 *.sav
4
 *.sav
5
 *.sgm
5
 *.sgm
6
+*.png

+ 94
- 0
data/string/map_names.s View File

1
+.align 2
2
+.thumb
3
+.text
4
+
5
+.global map_name_table
6
+map_name_table:
7
+.word str_map_name_hesperia
8
+.word str_map_name_carun
9
+.word str_map_name_veternia
10
+.word str_map_name_urbania
11
+.word str_map_name_route_one
12
+.word str_map_name_route_two
13
+.word str_map_name_route_three
14
+.word str_map_name_invalid
15
+.word str_map_name_invalid
16
+.word str_map_name_invalid
17
+.word str_map_name_invalid
18
+.word str_map_name_invalid
19
+.word str_map_name_invalid
20
+.word str_map_name_invalid
21
+.word str_map_name_invalid
22
+.word str_map_name_invalid
23
+.word str_map_name_invalid
24
+.word str_map_name_invalid
25
+.word str_map_name_invalid
26
+.word str_map_name_invalid
27
+.word str_map_name_invalid
28
+.word str_map_name_invalid
29
+.word str_map_name_invalid
30
+.word str_map_name_invalid
31
+.word str_map_name_invalid
32
+.word str_map_name_invalid
33
+.word str_map_name_invalid
34
+.word str_map_name_invalid
35
+.word str_map_name_invalid
36
+.word str_map_name_invalid
37
+.word str_map_name_invalid
38
+.word str_map_name_invalid
39
+.word str_map_name_invalid
40
+.word str_map_name_invalid
41
+.word str_map_name_invalid
42
+.word str_map_name_invalid
43
+.word str_map_name_invalid
44
+.word str_map_name_invalid
45
+.word str_map_name_invalid
46
+.word str_map_name_invalid
47
+.word str_map_name_invalid
48
+.word str_map_name_invalid
49
+.word str_map_name_invalid
50
+.word str_map_name_invalid
51
+.word str_map_name_invalid
52
+.word str_map_name_invalid
53
+.word str_map_name_invalid
54
+.word str_map_name_invalid
55
+.word str_map_name_invalid
56
+.word str_map_name_invalid
57
+.word str_map_name_invalid
58
+.word str_map_name_invalid
59
+.word str_map_name_invalid
60
+.word str_map_name_invalid
61
+.word str_map_name_invalid
62
+.word str_map_name_invalid
63
+.word str_map_name_invalid
64
+.word str_map_name_invalid
65
+.word str_map_name_invalid
66
+.word str_map_name_invalid
67
+.word str_map_name_invalid
68
+.word str_map_name_invalid
69
+
70
+
71
+str_map_name_hesperia:
72
+.string LAN_DE "Hesperia"
73
+
74
+str_map_name_carun:
75
+.string LAN_DE "Carun City"
76
+
77
+str_map_name_veternia:
78
+.string LAN_DE "Veternia City"
79
+
80
+str_map_name_urbania:
81
+.string LAN_DE "Urbania City"
82
+
83
+str_map_name_route_one:
84
+.string LAN_DE "Route 1"
85
+
86
+str_map_name_route_two:
87
+.string LAN_DE "Route 2"
88
+
89
+str_map_name_route_three:
90
+.string LAN_DE "Route 3"
91
+
92
+str_map_name_invalid:
93
+.string LAN_DE "Invalider Name"
94
+.string LAN_EN "Invalid Name"

+ 32
- 0
generated_image/bootscreen/boot_tileset.h View File

1
+
2
+//{{BLOCK(boot_tileset)
3
+
4
+//======================================================================
5
+//
6
+//	boot_tileset, 256x160@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 68 tiles (t|f|p reduced) lz77 compressed
9
+//	+ regular map (flat), lz77 compressed, 32x20 
10
+//	Total size: 32 + 672 + 412 = 1116
11
+//
12
+//	Time-stamp: 2017-08-31, 14:41:54
13
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
14
+//	( http://www.coranac.com/projects/#grit )
15
+//
16
+//======================================================================
17
+
18
+#ifndef GRIT_BOOT_TILESET_H
19
+#define GRIT_BOOT_TILESET_H
20
+
21
+#define boot_tilesetTilesLen 672
22
+extern const unsigned int boot_tilesetTiles[168];
23
+
24
+#define boot_tilesetMapLen 412
25
+extern const unsigned short boot_tilesetMap[206];
26
+
27
+#define boot_tilesetPalLen 32
28
+extern const unsigned short boot_tilesetPal[16];
29
+
30
+#endif // GRIT_BOOT_TILESET_H
31
+
32
+//}}BLOCK(boot_tileset)

+ 28
- 0
generated_image/char/bag/hero_bag.h View File

1
+
2
+//{{BLOCK(hero_bag)
3
+
4
+//======================================================================
5
+//
6
+//	hero_bag, 64x384@4, 
7
+//	+ palette 20 entries, lz77 compressed
8
+//	+ 384 tiles lz77 compressed
9
+//	Total size: 40 + 3564 = 3604
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:57
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_HERO_BAG_H
18
+#define GRIT_HERO_BAG_H
19
+
20
+#define hero_bagTilesLen 3564
21
+extern const unsigned int hero_bagTiles[891];
22
+
23
+#define hero_bagPalLen 40
24
+extern const unsigned short hero_bagPal[20];
25
+
26
+#endif // GRIT_HERO_BAG_H
27
+
28
+//}}BLOCK(hero_bag)

+ 28
- 0
generated_image/char/bag/heroine_bag.h View File

1
+
2
+//{{BLOCK(heroine_bag)
3
+
4
+//======================================================================
5
+//
6
+//	heroine_bag, 64x384@4, 
7
+//	+ palette 20 entries, lz77 compressed
8
+//	+ 384 tiles lz77 compressed
9
+//	Total size: 40 + 4044 = 4084
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:57
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_HEROINE_BAG_H
18
+#define GRIT_HEROINE_BAG_H
19
+
20
+#define heroine_bagTilesLen 4044
21
+extern const unsigned int heroine_bagTiles[1011];
22
+
23
+#define heroine_bagPalLen 40
24
+extern const unsigned short heroine_bagPal[20];
25
+
26
+#endif // GRIT_HEROINE_BAG_H
27
+
28
+//}}BLOCK(heroine_bag)

+ 28
- 0
generated_image/char/throw_out/hero_backsprite.h View File

1
+
2
+//{{BLOCK(hero_backsprite)
3
+
4
+//======================================================================
5
+//
6
+//	hero_backsprite, 64x320@4, 
7
+//	+ palette 20 entries, lz77 compressed
8
+//	+ 320 tiles not compressed
9
+//	Total size: 40 + 10240 = 10280
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:58
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_HERO_BACKSPRITE_H
18
+#define GRIT_HERO_BACKSPRITE_H
19
+
20
+#define hero_backspriteTilesLen 10240
21
+extern const unsigned int hero_backspriteTiles[2560];
22
+
23
+#define hero_backspritePalLen 40
24
+extern const unsigned short hero_backspritePal[20];
25
+
26
+#endif // GRIT_HERO_BACKSPRITE_H
27
+
28
+//}}BLOCK(hero_backsprite)

+ 28
- 0
generated_image/char/throw_out/heroine_backsprite.h View File

1
+
2
+//{{BLOCK(heroine_backsprite)
3
+
4
+//======================================================================
5
+//
6
+//	heroine_backsprite, 64x320@4, 
7
+//	+ palette 20 entries, lz77 compressed
8
+//	+ 320 tiles not compressed
9
+//	Total size: 40 + 10240 = 10280
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:58
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_HEROINE_BACKSPRITE_H
18
+#define GRIT_HEROINE_BACKSPRITE_H
19
+
20
+#define heroine_backspriteTilesLen 10240
21
+extern const unsigned int heroine_backspriteTiles[2560];
22
+
23
+#define heroine_backspritePalLen 40
24
+extern const unsigned short heroine_backspritePal[20];
25
+
26
+#endif // GRIT_HEROINE_BACKSPRITE_H
27
+
28
+//}}BLOCK(heroine_backsprite)

+ 33
- 0
generated_image/cutscene_meteor/met_background.h View File

1
+
2
+//{{BLOCK(met_background)
3
+
4
+//======================================================================
5
+//
6
+//	met_background, 256x160@4, 
7
+//	Transparent color : 00,FF,00
8
+//	+ palette 6 entries, lz77 compressed
9
+//	+ 2 tiles (t|f reduced) lz77 compressed
10
+//	+ regular map (flat), lz77 compressed, 32x20 
11
+//	Total size: 12 + 20 + 164 = 196
12
+//
13
+//	Time-stamp: 2017-08-31, 14:41:55
14
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
15
+//	( http://www.coranac.com/projects/#grit )
16
+//
17
+//======================================================================
18
+
19
+#ifndef GRIT_MET_BACKGROUND_H
20
+#define GRIT_MET_BACKGROUND_H
21
+
22
+#define met_backgroundTilesLen 20
23
+extern const unsigned int met_backgroundTiles[5];
24
+
25
+#define met_backgroundMapLen 164
26
+extern const unsigned short met_backgroundMap[82];
27
+
28
+#define met_backgroundPalLen 12
29
+extern const unsigned short met_backgroundPal[6];
30
+
31
+#endif // GRIT_MET_BACKGROUND_H
32
+
33
+//}}BLOCK(met_background)

+ 32
- 0
generated_image/cutscene_meteor/met_clouds.h View File

1
+
2
+//{{BLOCK(met_clouds)
3
+
4
+//======================================================================
5
+//
6
+//	met_clouds, 256x160@4, 
7
+//	+ palette 14 entries, lz77 compressed
8
+//	+ 46 tiles (t|f reduced) lz77 compressed
9
+//	+ regular map (flat), lz77 compressed, 32x20 
10
+//	Total size: 28 + 448 + 256 = 732
11
+//
12
+//	Time-stamp: 2017-08-31, 14:41:56
13
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
14
+//	( http://www.coranac.com/projects/#grit )
15
+//
16
+//======================================================================
17
+
18
+#ifndef GRIT_MET_CLOUDS_H
19
+#define GRIT_MET_CLOUDS_H
20
+
21
+#define met_cloudsTilesLen 448
22
+extern const unsigned int met_cloudsTiles[112];
23
+
24
+#define met_cloudsMapLen 256
25
+extern const unsigned short met_cloudsMap[128];
26
+
27
+#define met_cloudsPalLen 28
28
+extern const unsigned short met_cloudsPal[14];
29
+
30
+#endif // GRIT_MET_CLOUDS_H
31
+
32
+//}}BLOCK(met_clouds)

+ 32
- 0
generated_image/cutscene_meteor/met_foreground.h View File

1
+
2
+//{{BLOCK(met_foreground)
3
+
4
+//======================================================================
5
+//
6
+//	met_foreground, 256x160@4, 
7
+//	+ palette 18 entries, lz77 compressed
8
+//	+ 140 tiles (t|f reduced) lz77 compressed
9
+//	+ regular map (flat), lz77 compressed, 32x20 
10
+//	Total size: 36 + 2356 + 464 = 2856
11
+//
12
+//	Time-stamp: 2017-08-31, 14:41:55
13
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
14
+//	( http://www.coranac.com/projects/#grit )
15
+//
16
+//======================================================================
17
+
18
+#ifndef GRIT_MET_FOREGROUND_H
19
+#define GRIT_MET_FOREGROUND_H
20
+
21
+#define met_foregroundTilesLen 2356
22
+extern const unsigned int met_foregroundTiles[589];
23
+
24
+#define met_foregroundMapLen 464
25
+extern const unsigned short met_foregroundMap[232];
26
+
27
+#define met_foregroundPalLen 36
28
+extern const unsigned short met_foregroundPal[18];
29
+
30
+#endif // GRIT_MET_FOREGROUND_H
31
+
32
+//}}BLOCK(met_foreground)

+ 28
- 0
generated_image/cutscene_meteor/met_foreground_red.h View File

1
+
2
+//{{BLOCK(met_foreground_red)
3
+
4
+//======================================================================
5
+//
6
+//	met_foreground_red, 256x160@8, 
7
+//	+ palette 256 entries, not compressed
8
+//	+ 640 tiles not compressed
9
+//	Total size: 512 + 40960 = 41472
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:55
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MET_FOREGROUND_RED_H
18
+#define GRIT_MET_FOREGROUND_RED_H
19
+
20
+#define met_foreground_redTilesLen 40960
21
+extern const unsigned int met_foreground_redTiles[10240];
22
+
23
+#define met_foreground_redPalLen 512
24
+extern const unsigned short met_foreground_redPal[256];
25
+
26
+#endif // GRIT_MET_FOREGROUND_RED_H
27
+
28
+//}}BLOCK(met_foreground_red)

+ 28
- 0
generated_image/cutscene_meteor/met_meteor.h View File

1
+
2
+//{{BLOCK(met_meteor)
3
+
4
+//======================================================================
5
+//
6
+//	met_meteor, 32x96@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 48 tiles lz77 compressed
9
+//	Total size: 32 + 1168 = 1200
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:56
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MET_METEOR_H
18
+#define GRIT_MET_METEOR_H
19
+
20
+#define met_meteorTilesLen 1168
21
+extern const unsigned int met_meteorTiles[292];
22
+
23
+#define met_meteorPalLen 32
24
+extern const unsigned short met_meteorPal[16];
25
+
26
+#endif // GRIT_MET_METEOR_H
27
+
28
+//}}BLOCK(met_meteor)

+ 32
- 0
generated_image/cutscene_meteor/met_sky.h View File

1
+
2
+//{{BLOCK(met_sky)
3
+
4
+//======================================================================
5
+//
6
+//	met_sky, 256x160@4, 
7
+//	+ palette 14 entries, lz77 compressed
8
+//	+ 25 tiles (t|f reduced) lz77 compressed
9
+//	+ regular map (flat), lz77 compressed, 32x20 
10
+//	Total size: 28 + 204 + 240 = 472
11
+//
12
+//	Time-stamp: 2017-08-31, 14:41:56
13
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
14
+//	( http://www.coranac.com/projects/#grit )
15
+//
16
+//======================================================================
17
+
18
+#ifndef GRIT_MET_SKY_H
19
+#define GRIT_MET_SKY_H
20
+
21
+#define met_skyTilesLen 204
22
+extern const unsigned int met_skyTiles[51];
23
+
24
+#define met_skyMapLen 240
25
+extern const unsigned short met_skyMap[120];
26
+
27
+#define met_skyPalLen 28
28
+extern const unsigned short met_skyPal[14];
29
+
30
+#endif // GRIT_MET_SKY_H
31
+
32
+//}}BLOCK(met_sky)

+ 28
- 0
generated_image/cutscene_meteor/met_sky_red.h View File

1
+
2
+//{{BLOCK(met_sky_red)
3
+
4
+//======================================================================
5
+//
6
+//	met_sky_red, 256x160@8, 
7
+//	+ palette 256 entries, not compressed
8
+//	+ 640 tiles not compressed
9
+//	Total size: 512 + 40960 = 41472
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:55
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MET_SKY_RED_H
18
+#define GRIT_MET_SKY_RED_H
19
+
20
+#define met_sky_redTilesLen 40960
21
+extern const unsigned int met_sky_redTiles[10240];
22
+
23
+#define met_sky_redPalLen 512
24
+extern const unsigned short met_sky_redPal[256];
25
+
26
+#endif // GRIT_MET_SKY_RED_H
27
+
28
+//}}BLOCK(met_sky_red)

+ 24
- 0
generated_image/emoticons/emot_arrows.h View File

1
+
2
+//{{BLOCK(emot_arrows)
3
+
4
+//======================================================================
5
+//
6
+//	emot_arrows, 16x96@4, 
7
+//	+ 24 tiles not compressed
8
+//	Total size: 768 = 768
9
+//
10
+//	Time-stamp: 2017-08-31, 14:41:54
11
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
12
+//	( http://www.coranac.com/projects/#grit )
13
+//
14
+//======================================================================
15
+
16
+#ifndef GRIT_EMOT_ARROWS_H
17
+#define GRIT_EMOT_ARROWS_H
18
+
19
+#define emot_arrowsTilesLen 768
20
+extern const unsigned int emot_arrowsTiles[192];
21
+
22
+#endif // GRIT_EMOT_ARROWS_H
23
+
24
+//}}BLOCK(emot_arrows)

+ 28
- 0
generated_image/mugshots/mug_00.h View File

1
+
2
+//{{BLOCK(mug_00)
3
+
4
+//======================================================================
5
+//
6
+//	mug_00, 32x32@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 16 tiles lz77 compressed
9
+//	Total size: 32 + 400 = 432
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:59
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MUG_00_H
18
+#define GRIT_MUG_00_H
19
+
20
+#define mug_00TilesLen 400
21
+extern const unsigned int mug_00Tiles[100];
22
+
23
+#define mug_00PalLen 32
24
+extern const unsigned short mug_00Pal[16];
25
+
26
+#endif // GRIT_MUG_00_H
27
+
28
+//}}BLOCK(mug_00)

+ 28
- 0
generated_image/mugshots/mug_01.h View File

1
+
2
+//{{BLOCK(mug_01)
3
+
4
+//======================================================================
5
+//
6
+//	mug_01, 32x32@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 16 tiles lz77 compressed
9
+//	Total size: 32 + 428 = 460
10
+//
11
+//	Time-stamp: 2017-08-31, 14:42:00
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MUG_01_H
18
+#define GRIT_MUG_01_H
19
+
20
+#define mug_01TilesLen 428
21
+extern const unsigned int mug_01Tiles[107];
22
+
23
+#define mug_01PalLen 32
24
+extern const unsigned short mug_01Pal[16];
25
+
26
+#endif // GRIT_MUG_01_H
27
+
28
+//}}BLOCK(mug_01)

+ 28
- 0
generated_image/mugshots/mug_02.h View File

1
+
2
+//{{BLOCK(mug_02)
3
+
4
+//======================================================================
5
+//
6
+//	mug_02, 32x32@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 16 tiles lz77 compressed
9
+//	Total size: 32 + 460 = 492
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:59
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MUG_02_H
18
+#define GRIT_MUG_02_H
19
+
20
+#define mug_02TilesLen 460
21
+extern const unsigned int mug_02Tiles[115];
22
+
23
+#define mug_02PalLen 32
24
+extern const unsigned short mug_02Pal[16];
25
+
26
+#endif // GRIT_MUG_02_H
27
+
28
+//}}BLOCK(mug_02)

+ 28
- 0
generated_image/mugshots/mug_03.h View File

1
+
2
+//{{BLOCK(mug_03)
3
+
4
+//======================================================================
5
+//
6
+//	mug_03, 32x32@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 16 tiles lz77 compressed
9
+//	Total size: 32 + 512 = 544
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:58
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MUG_03_H
18
+#define GRIT_MUG_03_H
19
+
20
+#define mug_03TilesLen 512
21
+extern const unsigned int mug_03Tiles[128];
22
+
23
+#define mug_03PalLen 32
24
+extern const unsigned short mug_03Pal[16];
25
+
26
+#endif // GRIT_MUG_03_H
27
+
28
+//}}BLOCK(mug_03)

+ 28
- 0
generated_image/mugshots/mug_04.h View File

1
+
2
+//{{BLOCK(mug_04)
3
+
4
+//======================================================================
5
+//
6
+//	mug_04, 32x32@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 16 tiles lz77 compressed
9
+//	Total size: 32 + 444 = 476
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:59
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MUG_04_H
18
+#define GRIT_MUG_04_H
19
+
20
+#define mug_04TilesLen 444
21
+extern const unsigned int mug_04Tiles[111];
22
+
23
+#define mug_04PalLen 32
24
+extern const unsigned short mug_04Pal[16];
25
+
26
+#endif // GRIT_MUG_04_H
27
+
28
+//}}BLOCK(mug_04)

+ 28
- 0
generated_image/mugshots/mug_05.h View File

1
+
2
+//{{BLOCK(mug_05)
3
+
4
+//======================================================================
5
+//
6
+//	mug_05, 32x32@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 16 tiles lz77 compressed
9
+//	Total size: 32 + 492 = 524
10
+//
11
+//	Time-stamp: 2017-08-31, 14:42:00
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MUG_05_H
18
+#define GRIT_MUG_05_H
19
+
20
+#define mug_05TilesLen 492
21
+extern const unsigned int mug_05Tiles[123];
22
+
23
+#define mug_05PalLen 32
24
+extern const unsigned short mug_05Pal[16];
25
+
26
+#endif // GRIT_MUG_05_H
27
+
28
+//}}BLOCK(mug_05)

+ 28
- 0
generated_image/mugshots/mug_06.h View File

1
+
2
+//{{BLOCK(mug_06)
3
+
4
+//======================================================================
5
+//
6
+//	mug_06, 32x32@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 16 tiles lz77 compressed
9
+//	Total size: 32 + 476 = 508
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:59
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MUG_06_H
18
+#define GRIT_MUG_06_H
19
+
20
+#define mug_06TilesLen 476
21
+extern const unsigned int mug_06Tiles[119];
22
+
23
+#define mug_06PalLen 32
24
+extern const unsigned short mug_06Pal[16];
25
+
26
+#endif // GRIT_MUG_06_H
27
+
28
+//}}BLOCK(mug_06)

+ 28
- 0
generated_image/mugshots/mug_07.h View File

1
+
2
+//{{BLOCK(mug_07)
3
+
4
+//======================================================================
5
+//
6
+//	mug_07, 32x32@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 16 tiles lz77 compressed
9
+//	Total size: 32 + 484 = 516
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:58
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MUG_07_H
18
+#define GRIT_MUG_07_H
19
+
20
+#define mug_07TilesLen 484
21
+extern const unsigned int mug_07Tiles[121];
22
+
23
+#define mug_07PalLen 32
24
+extern const unsigned short mug_07Pal[16];
25
+
26
+#endif // GRIT_MUG_07_H
27
+
28
+//}}BLOCK(mug_07)

+ 28
- 0
generated_image/mugshots/mug_08.h View File

1
+
2
+//{{BLOCK(mug_08)
3
+
4
+//======================================================================
5
+//
6
+//	mug_08, 32x32@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 16 tiles lz77 compressed
9
+//	Total size: 32 + 504 = 536
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:59
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MUG_08_H
18
+#define GRIT_MUG_08_H
19
+
20
+#define mug_08TilesLen 504
21
+extern const unsigned int mug_08Tiles[126];
22
+
23
+#define mug_08PalLen 32
24
+extern const unsigned short mug_08Pal[16];
25
+
26
+#endif // GRIT_MUG_08_H
27
+
28
+//}}BLOCK(mug_08)

+ 28
- 0
generated_image/mugshots/mug_09.h View File

1
+
2
+//{{BLOCK(mug_09)
3
+
4
+//======================================================================
5
+//
6
+//	mug_09, 32x32@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 16 tiles lz77 compressed
9
+//	Total size: 32 + 468 = 500
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:59
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_MUG_09_H
18
+#define GRIT_MUG_09_H
19
+
20
+#define mug_09TilesLen 468
21
+extern const unsigned int mug_09Tiles[117];
22
+
23
+#define mug_09PalLen 32
24
+extern const unsigned short mug_09Pal[16];
25
+
26
+#endif // GRIT_MUG_09_H
27
+
28
+//}}BLOCK(mug_09)

+ 28
- 0
generated_image/titlescreen/title_sprite_sky.h View File

1
+
2
+//{{BLOCK(title_sprite_sky)
3
+
4
+//======================================================================
5
+//
6
+//	title_sprite_sky, 16x160@4, 
7
+//	+ palette 16 entries, not compressed
8
+//	+ 40 tiles lz77 compressed
9
+//	Total size: 32 + 780 = 812
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:57
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_TITLE_SPRITE_SKY_H
18
+#define GRIT_TITLE_SPRITE_SKY_H
19
+
20
+#define title_sprite_skyTilesLen 780
21
+extern const unsigned int title_sprite_skyTiles[195];
22
+
23
+#define title_sprite_skyPalLen 32
24
+extern const unsigned short title_sprite_skyPal[16];
25
+
26
+#endif // GRIT_TITLE_SPRITE_SKY_H
27
+
28
+//}}BLOCK(title_sprite_sky)

+ 28
- 0
generated_image/titlescreen/title_tileset_background.h View File

1
+
2
+//{{BLOCK(title_tileset_background)
3
+
4
+//======================================================================
5
+//
6
+//	title_tileset_background, 256x160@4, 
7
+//	+ 255 tiles (t|f reduced) lz77 compressed
8
+//	+ regular map (flat), lz77 compressed, 32x20 
9
+//	Total size: 2456 + 736 = 3192
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:56
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_TITLE_TILESET_BACKGROUND_H
18
+#define GRIT_TITLE_TILESET_BACKGROUND_H
19
+
20
+#define title_tileset_backgroundTilesLen 2456
21
+extern const unsigned int title_tileset_backgroundTiles[614];
22
+
23
+#define title_tileset_backgroundMapLen 736
24
+extern const unsigned short title_tileset_backgroundMap[368];
25
+
26
+#endif // GRIT_TITLE_TILESET_BACKGROUND_H
27
+
28
+//}}BLOCK(title_tileset_background)

+ 28
- 0
generated_image/titlescreen/title_tileset_latias_latios_deoxys.h View File

1
+
2
+//{{BLOCK(title_tileset_latias_latios_deoxys)
3
+
4
+//======================================================================
5
+//
6
+//	title_tileset_latias_latios_deoxys, 256x160@4, 
7
+//	+ 296 tiles (t|f reduced) lz77 compressed
8
+//	+ regular map (flat), lz77 compressed, 32x20 
9
+//	Total size: 5656 + 784 = 6440
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:57
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_TITLE_TILESET_LATIAS_LATIOS_DEOXYS_H
18
+#define GRIT_TITLE_TILESET_LATIAS_LATIOS_DEOXYS_H
19
+
20
+#define title_tileset_latias_latios_deoxysTilesLen 5656
21
+extern const unsigned int title_tileset_latias_latios_deoxysTiles[1414];
22
+
23
+#define title_tileset_latias_latios_deoxysMapLen 784
24
+extern const unsigned short title_tileset_latias_latios_deoxysMap[392];
25
+
26
+#endif // GRIT_TITLE_TILESET_LATIAS_LATIOS_DEOXYS_H
27
+
28
+//}}BLOCK(title_tileset_latias_latios_deoxys)

+ 28
- 0
generated_image/titlescreen/title_tileset_logo_name.h View File

1
+
2
+//{{BLOCK(title_tileset_logo_name)
3
+
4
+//======================================================================
5
+//
6
+//	title_tileset_logo_name, 256x160@8, 
7
+//	+ 168 tiles (t|f reduced) lz77 compressed
8
+//	+ regular map (flat), lz77 compressed, 32x20 
9
+//	Total size: 3616 + 500 = 4116
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:57
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_TITLE_TILESET_LOGO_NAME_H
18
+#define GRIT_TITLE_TILESET_LOGO_NAME_H
19
+
20
+#define title_tileset_logo_nameTilesLen 3616
21
+extern const unsigned int title_tileset_logo_nameTiles[904];
22
+
23
+#define title_tileset_logo_nameMapLen 500
24
+extern const unsigned short title_tileset_logo_nameMap[250];
25
+
26
+#endif // GRIT_TITLE_TILESET_LOGO_NAME_H
27
+
28
+//}}BLOCK(title_tileset_logo_name)

+ 28
- 0
generated_image/titlescreen/title_tileset_press_start.h View File

1
+
2
+//{{BLOCK(title_tileset_press_start)
3
+
4
+//======================================================================
5
+//
6
+//	title_tileset_press_start, 256x160@4, 
7
+//	+ 35 tiles (t|f reduced) lz77 compressed
8
+//	+ regular map (flat), lz77 compressed, 32x20 
9
+//	Total size: 676 + 240 = 916
10
+//
11
+//	Time-stamp: 2017-08-31, 14:41:56
12
+//	Exported by Cearn's GBA Image Transmogrifier, v0.8.6
13
+//	( http://www.coranac.com/projects/#grit )
14
+//
15
+//======================================================================
16
+
17
+#ifndef GRIT_TITLE_TILESET_PRESS_START_H
18
+#define GRIT_TITLE_TILESET_PRESS_START_H
19
+
20
+#define title_tileset_press_startTilesLen 676
21
+extern const unsigned int title_tileset_press_startTiles[169];
22
+
23
+#define title_tileset_press_startMapLen 240
24
+extern const unsigned short title_tileset_press_startMap[120];
25
+
26
+#endif // GRIT_TITLE_TILESET_PRESS_START_H
27
+
28
+//}}BLOCK(title_tileset_press_start)

+ 1
- 1
main.asm View File

1
 .gba
1
 .gba
2
 .thumb
2
 .thumb
3
 .open "base/bpre0.gba","build/pkmn_sots.gba",0x08000000
3
 .open "base/bpre0.gba","build/pkmn_sots.gba",0x08000000
4
-
5
 //exclude for now
4
 //exclude for now
6
 //.include "patches/split_physical_special.asm"
5
 //.include "patches/split_physical_special.asm"
7
 .include "patches/hooks.asm"
6
 .include "patches/hooks.asm"
8
 
7
 
8
+.include "patches/maps.asm"
9
 
9
 
10
 .include "patches/dynamic_overworld_hooks.asm"
10
 .include "patches/dynamic_overworld_hooks.asm"
11
 
11
 

+ 52
- 4
makefile View File

10
 VBA		:= vba
10
 VBA		:= vba
11
 LAN	:= de
11
 LAN	:= de
12
 STRAGB	:= string2agb
12
 STRAGB	:= string2agb
13
+PYPROJS := @python ../tools/v_tools/pyproj2s.py
14
+PYMAPS	:= @python ../tools/v_tools/pymap2s.py
15
+PYSETS	:= @python ../tools/v_tools/pyset2s.py
13
 
16
 
14
 export PATH := $(realpath ../tools):$(PATH)
17
 export PATH := $(realpath ../tools):$(PATH)
15
 
18
 
21
 
24
 
22
 CHARMAP := charmap.txt
25
 CHARMAP := charmap.txt
23
 
26
 
24
-DEFINES   := -DBPRE -DSOFTWARE_VERSION=0
27
+DEFINES   := -DBPRE -DSOFTWARE_VERSION=0 -DLAN_DE
25
 ASFLAGS   := -mthumb
28
 ASFLAGS   := -mthumb
26
 CFLAGS    := -mthumb -mthumb-interwork -g -mcpu=arm7tdmi -fno-inline -fdiagnostics-show-option -fdiagnostics-color -mlong-calls -march=armv4t -Og -std=c11 -Wall -Wextra -Wunreachable-code -I$(PAGB_INCLUDE) -Isrc/include -Igenerated_image -fdiagnostics-color $(DEFINES)
29
 CFLAGS    := -mthumb -mthumb-interwork -g -mcpu=arm7tdmi -fno-inline -fdiagnostics-show-option -fdiagnostics-color -mlong-calls -march=armv4t -Og -std=c11 -Wall -Wextra -Wunreachable-code -I$(PAGB_INCLUDE) -Isrc/include -Igenerated_image -fdiagnostics-color $(DEFINES)
27
 GRITFLAGS := -ftc -fa
30
 GRITFLAGS := -ftc -fa
32
 STRINGDIR := string
35
 STRINGDIR := string
33
 MAPROOT	  := sots-private/map
36
 MAPROOT	  := sots-private/map
34
 MAPMAPS	  := $(MAPROOT)/maps
37
 MAPMAPS	  := $(MAPROOT)/maps
35
-MAPTS	  := $(MAPROOT)/tilesets
38
+MAPTS	  := $(MAPROOT)/tileset
39
+MAP_PROJ	:= $(MAPROOT)/sots.json
40
+SCRIPTROOT := $(MAPROOT)/script
36
 
41
 
37
 MAIN_OBJ  := $(BLDPATH)/linked.o
42
 MAIN_OBJ  := $(BLDPATH)/linked.o
38
 B_ENGINE  := battle_engine/build/linked.o
43
 B_ENGINE  := battle_engine/build/linked.o
53
 
58
 
54
 IMAGES=$(call rwildcard,$(AUTO_ASSET_ROOT),*.png)
59
 IMAGES=$(call rwildcard,$(AUTO_ASSET_ROOT),*.png)
55
 
60
 
61
+TSPNG=$(call rwildcard,$(MAPTS)/,*.png)
62
+TS_GEN_SRC	:= $(TSPNG:%.png=%.s)
63
+TS_GEN_O	:= $(TSPNG:%.png=$(BLDPATH)/%.o)
64
+
56
 GEN_SRC		:= $(IMAGES:$(AUTO_ASSET_ROOT)/%.png=generated_image/%.c)
65
 GEN_SRC		:= $(IMAGES:$(AUTO_ASSET_ROOT)/%.png=generated_image/%.c)
57
 ASM_SRC     := $(call rwildcard,src/,*.s)
66
 ASM_SRC     := $(call rwildcard,src/,*.s)
58
 C_SRC       := $(call rwildcard,src/,*.c)
67
 C_SRC       := $(call rwildcard,src/,*.c)
59
 DATA_SRC    := $(call rwildcard,data/,*.s)
68
 DATA_SRC    := $(call rwildcard,data/,*.s)
60
 STRING		:= $(call rwildcard,string/$(LAN)/,*.txt)
69
 STRING		:= $(call rwildcard,string/$(LAN)/,*.txt)
61
 STRING_SRC	:= $(STRING:%.txt=%.s)
70
 STRING_SRC	:= $(STRING:%.txt=%.s)
62
-SCRIPT_SRC	:= $(call rwildcard,$(MAPMAPS)/,*.s)
71
+SCRIPT_SRC	:= $(call rwildcard,$(SCRIPTROOT)/,*.s)
72
+
73
+MAP_PROJ_S	:= $(MAP_PROJ:%.json=%.s)
74
+MAP_PROJ_O	:= $(MAP_PROJ:%.json=$(BLDPATH)/%.o)
63
 
75
 
76
+MAP_FILES	:= $(call rwildcard,$(MAPMAPS)/,*.pmh)
77
+MAP_FILES_S	:= $(MAP_FILES:%.pmh=%.s)
78
+MAP_FILES_O	:= $(MAP_FILES:%.pmh=$(BLDPATH)/%.o)
79
+
80
+TS_FILES	:= $(call rwildcard,$(MAPTS)/,*.pts)
81
+TS_FILES_S	:= $(TS_FILES:%.pts=%.s)
82
+TS_FILES_O	:= $(TS_FILES:%.pts=$(BLDPATH)/%.o)
64
 
83
 
65
 GEN_OBJ		:= $(GEN_SRC:%.c=$(BLDPATH)/%.o)
84
 GEN_OBJ		:= $(GEN_SRC:%.c=$(BLDPATH)/%.o)
66
 STRING_OBJ	:= $(STRING_SRC:%.s=$(BLDPATH)/%.o)
85
 STRING_OBJ	:= $(STRING_SRC:%.s=$(BLDPATH)/%.o)
68
 C_OBJ       := $(C_SRC:%.c=$(BLDPATH)/%.o)
87
 C_OBJ       := $(C_SRC:%.c=$(BLDPATH)/%.o)
69
 DATA_OBJ    := $(DATA_SRC:%.s=$(BLDPATH)/%.o)
88
 DATA_OBJ    := $(DATA_SRC:%.s=$(BLDPATH)/%.o)
70
 SCRIPT_OBJ	:= $(SCRIPT_SRC:%.s=$(BLDPATH)/%.o)
89
 SCRIPT_OBJ	:= $(SCRIPT_SRC:%.s=$(BLDPATH)/%.o)
71
-ALL_OBJ     := $(GEN_OBJ) $(C_OBJ) $(ASM_OBJ) $(DATA_OBJ) $(STRING_OBJ) $(SCRIPT_OBJ)
90
+ALL_OBJ     := $(GEN_OBJ) $(C_OBJ) $(ASM_OBJ) $(DATA_OBJ) $(STRING_OBJ) $(SCRIPT_OBJ) $(MAP_PROJ_O) $(MAP_FILES_O) $(TS_FILES_O) $(TS_GEN_O)
91
+
92
+$(MAPMAPS)/%.s: $(MAPMAPS)/%.pmh
93
+	@echo -e "\e[96mGenerating map $<\e[0m"
94
+	$(PYMAPS) -o $@ $<
95
+
96
+$(MAPTS)/%.s: $(MAPTS)/%.pts
97
+	@echo -e "\e[94mGenerating tileset $<\e[0m"
98
+	$(PYSETS) -o $@ $<
72
 
99
 
73
 $(STRINGDIR)/%.s: $(STRINGDIR)/%.txt
100
 $(STRINGDIR)/%.s: $(STRINGDIR)/%.txt
74
 	@echo -e "\e[93mGenerating strings $<\e[0m"
101
 	@echo -e "\e[93mGenerating strings $<\e[0m"
86
 	$(CC) $(CFLAGS) -c -x assembler-with-cpp $*.i -o $@
113
 	$(CC) $(CFLAGS) -c -x assembler-with-cpp $*.i -o $@
87
 	@rm -f $*.i
114
 	@rm -f $*.i
88
 
115
 
116
+$(MAPTS)/%.s: $(MAPTS)/%.png
117
+	@echo -e "\e[34mProcessing image (tileset) $<\e[0m"
118
+	$(GRIT) $< -o $@ -fts -gzl -pz! -pu16 -gB4 -m! -mR!
119
+
89
 generated_image/%.c: $(AUTO_ASSET_ROOT)/%.png $(AUTO_ASSET_ROOT)/%.grit
120
 generated_image/%.c: $(AUTO_ASSET_ROOT)/%.png $(AUTO_ASSET_ROOT)/%.grit
90
 	@echo -e "\e[34mProcessing image $<\e[0m"
121
 	@echo -e "\e[34mProcessing image $<\e[0m"
91
 	$(shell mkdir -p $(dir $@))
122
 	$(shell mkdir -p $(dir $@))
104
 	$(NM) $(BLDPATH)/linked.o -n -g --defined-only | \
135
 	$(NM) $(BLDPATH)/linked.o -n -g --defined-only | \
105
 		sed -e '{s/^/0x/g};{/.*\sA\s.*/d};{s/\sT\s/ /g}' > $(OUTPATH)/__symbols.sym
136
 		sed -e '{s/^/0x/g};{/.*\sA\s.*/d};{s/\sT\s/ /g}' > $(OUTPATH)/__symbols.sym
106
 	@echo "*** SUCCESSFULLY BUILT PROJECT ***"
137
 	@echo "*** SUCCESSFULLY BUILT PROJECT ***"
138
+	@echo "*** REMOVING INTERMEDIATE FILES ***"
107
 	
139
 	
108
 $(MAIN_OBJ): $(ALL_OBJ) $(ICONS_AR) $(SPRITES) $(MUSIC_AR) $(SMPL_AR) $(VOICE_AR) $(LIST_AR) $(CRY_AR) $()#$(B_ENGINE)
140
 $(MAIN_OBJ): $(ALL_OBJ) $(ICONS_AR) $(SPRITES) $(MUSIC_AR) $(SMPL_AR) $(VOICE_AR) $(LIST_AR) $(CRY_AR) $()#$(B_ENGINE)
109
 	$(MAKE) -f assets.makefile
141
 	$(MAKE) -f assets.makefile
112
 	$(LD) $(LDFLAGS) -T $(PAGB_LINK) -T linker.ld -T bpre.sym --whole-archive -r -o $@ --start-group -T $(TMP_LD) --end-group
144
 	$(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)
145
 	@rm -f $(TMP_LD)
114
 
146
 
147
+$(MAP_PROJ_S): $(MAP_PROJ)
148
+	@echo -e "\e[91mGenerating map project $<\e[0m"
149
+	$(PYPROJS) -b sovereign_banks -f sovereign_footer -o $@ $<
150
+
115
 .PHONY: $(B_ENGINE)
151
 .PHONY: $(B_ENGINE)
116
 $(B_ENGINE):
152
 $(B_ENGINE):
117
 	$(MAKE) -C battle_engine build/linked.o
153
 	$(MAKE) -C battle_engine build/linked.o
131
 
167
 
132
 .PHONY: $(ASSETS)
168
 .PHONY: $(ASSETS)
133
 $(ASSETS):
169
 $(ASSETS):
170
+	@echo -e "\e[95mMaking Assets\e[0m"
134
 	$(MAKE) -f assets.makefile
171
 	$(MAKE) -f assets.makefile
135
 
172
 
136
 .PHONY: $(SPRITES)
173
 .PHONY: $(SPRITES)
137
 $(SPRITES):
174
 $(SPRITES):
175
+	@echo -e "\e[95mMaking Sprites\e[0m"
138
 	$(MAKE) -f sprites.makefile
176
 	$(MAKE) -f sprites.makefile
139
 
177
 
140
 .PHONY: $(ICONS_AR)
178
 .PHONY: $(ICONS_AR)
141
 $(ICONS_AR):
179
 $(ICONS_AR):
180
+	@echo -e "\e[95mMaking Icons\e[0m"
142
 	$(MAKE) -f icons.makefile
181
 	$(MAKE) -f icons.makefile
143
 
182
 
144
 .PHONY: $(MUSIC_AR)
183
 .PHONY: $(MUSIC_AR)
145
 $(MUSIC_AR):
184
 $(MUSIC_AR):
185
+	@echo -e "\e[95mMaking Music\e[0m"
146
 	$(MAKE) -C $(dir $@) all
186
 	$(MAKE) -C $(dir $@) all
147
 
187
 
148
 .PHONY: $(SMPL_AR)
188
 .PHONY: $(SMPL_AR)
149
 $(SMPL_AR):
189
 $(SMPL_AR):
190
+	@echo -e "\e[95mMaking Sampler\e[0m"
150
 	$(MAKE) -C $(dir $@) all
191
 	$(MAKE) -C $(dir $@) all
151
 
192
 
152
 .PHONY: $(VOICE_AR)
193
 .PHONY: $(VOICE_AR)
153
 $(VOICE_AR):
194
 $(VOICE_AR):
195
+	@echo -e "\e[95mMaking Voice\e[0m"
154
 	$(MAKE) -C $(dir $@) all
196
 	$(MAKE) -C $(dir $@) all
155
 
197
 
156
 .PHONY: $(LIST_AR)
198
 .PHONY: $(LIST_AR)
157
 $(LIST_AR):
199
 $(LIST_AR):
200
+	@echo -e "\e[95mMaking Songlist\e[0m"
158
 	$(MAKE) -C $(dir $@) all
201
 	$(MAKE) -C $(dir $@) all
159
 
202
 
160
 .PHONY: $(CRY_AR)
203
 .PHONY: $(CRY_AR)
161
 $(CRY_AR):
204
 $(CRY_AR):
205
+	@echo -e "\e[95mMaking Cries\e[0m"
162
 	$(MAKE) -C $(dir $@) all
206
 	$(MAKE) -C $(dir $@) all
163
 
207
 
208
+.PHONY: constants
209
+constants:
210
+	python ../tools/v_tools/constants.py src/include/
211
+
164
 run: rom
212
 run: rom
165
 	$(VBA) "build/pkmn_sots.gba"
213
 	$(VBA) "build/pkmn_sots.gba"

+ 21
- 3
patches/dynamic_overworld_hooks.asm View File

255
 
255
 
256
 .pool
256
 .pool
257
 
257
 
258
-.org 0x08007280
258
+/*.org 0x08007280
259
 ldr r1, =obj_delete_and_free_tiles_hook|1
259
 ldr r1, =obj_delete_and_free_tiles_hook|1
260
 bx r1
260
 bx r1
261
-
262
-.pool
261
+.pool*/
263
 
262
 
264
 .org 0x0800779A
263
 .org 0x0800779A
265
 ldr r1, =obj_delete_all_hook|1
264
 ldr r1, =obj_delete_all_hook|1
277
 
276
 
278
 bxr4:
277
 bxr4:
279
 bx r4
278
 bx r4
279
+.pool
280
 
280
 
281
+/*.org 0x0808265C
282
+ldr r3, =ov_emot_load|1
283
+bx r3
284
+.pool*/
285
+
286
+/*.org 0x08083614
287
+ldr r1, =oec01_load_pal_impl|1
288
+bx r1
289
+.pool
290
+
291
+.org 0x0808365C
292
+ldr r1, =oec02_load_pal_impl|1
293
+bx r1
294
+.pool*/
295
+
296
+.org 0x0805E510
297
+ldr r1, =npc_delete_obj_and_free_tiles_for_npc_hack|1
298
+bx r1
281
 .pool
299
 .pool

+ 15
- 4
patches/game_engine/quick_hacks.asm View File

72
 .word 0x00000000
72
 .word 0x00000000
73
 
73
 
74
 .org 0x08054A08
74
 .org 0x08054A08
75
-//.byte 0x7
75
+.byte 0x7
76
 
76
 
77
 .org 0x08054A00
77
 .org 0x08054A00
78
-//.byte 0x13
78
+.byte 0x13
79
 
79
 
80
 .org 0x08054A04
80
 .org 0x08054A04
81
-//.byte 0x5
81
+.byte 0x5
82
 
82
 
83
 .org 0x08054A06
83
 .org 0x08054A06
84
-//.byte 0x0
84
+.byte 0x0
85
+
86
+.org 0x0807F5EC
87
+.word scr_whiteout_mom
88
+
89
+.org 0x0807F5CC
90
+.word scr_whiteout_center
91
+
92
+.org 0x080BFD54
93
+ldr r0, =whiteout_hook|1
94
+bx r0
95
+.pool

+ 13
- 0
patches/maps.asm View File

1
+/* all map bank table symbols and map footer tables go here */
2
+
3
+.org 0x0805524C
4
+.word sovereign_banks
5
+
6
+.org 0x08055194
7
+.word sovereign_footer
8
+
9
+.org 0x080C0C94
10
+.word map_name_table
11
+
12
+.org 0x080C4DB8
13
+.word map_name_table

+ 2
- 2
patches/overworlds/overworld.asm View File

16
 ldrb r0, [r5, #3]
16
 ldrb r0, [r5, #3]
17
 strb r0, [r4, #0x1A]
17
 strb r0, [r4, #0x1A]
18
 
18
 
19
-.org 0x0805E510
19
+/*.org 0x0805E510
20
     ldr r1, =overworld_h_two+1
20
     ldr r1, =overworld_h_two+1
21
     bx r1
21
     bx r1
22
-    .pool
22
+    .pool*/
23
 
23
 
24
 .org 0x0805E744
24
 .org 0x0805E744
25
     lsl r4, r4, #0x10
25
     lsl r4, r4, #0x10

+ 1
- 1
sots-private

1
-Subproject commit 04d6d99a48f025594551fe535770abbc3b9d8075
1
+Subproject commit f9e6ee59b56752bf25f71986a0fcd69690992ff2

+ 33
- 0
src/game_engine/whiteout_hook.s View File

1
+#include <config.h>
2
+
3
+.align 2
4
+.thumb
5
+.text
6
+
7
+.global whiteout_hook
8
+whiteout_hook:
9
+ldr r0, =HEALING_BANK_MAP_VAR
10
+bl var_get_rekt
11
+lsl r1, r0, #0x18
12
+lsr r0, r0, #8
13
+lsr r1, r1, #0x18
14
+strb r1, [r4]
15
+strb r0, [r4,#1]
16
+mov r0, #0xFF
17
+strb r0, [r4, #2]
18
+ldr r0, =HEALING_X_VAR
19
+bl var_get_rekt
20
+lsl r0, #0x10
21
+lsr r0, #0x10
22
+strh r0, [r4, #4]
23
+ldr r0, =HEALING_Y_VAR
24
+bl var_get_rekt
25
+lsl r0, #0x10
26
+lsr r0, #0x10
27
+strh r0, [r4,#6]
28
+ldr r0, =0x080BFDF5
29
+bx r0
30
+
31
+var_get_rekt:
32
+ldr r1, =var_get
33
+bx r1

+ 7
- 0
src/include/hiddenflags.h View File

1
+#include <script_language.h>
2
+
3
+.macro sethiddenflags
4
+setflag 0x501
5
+setflag 0x507
6
+setflag 0x509
7
+.endm

+ 15
- 0
src/include/mugssprites.h View File

1
+#ifndef MUG_IDS_H_
2
+#define MUG_IDS_H_
3
+
4
+#define MUG_NOAH 0x1
5
+#define MUG_EMMA 0x2
6
+#define MUG_LINDA 0x3
7
+#define MUG_IDAN 0x4
8
+#define MUG_ACHIM 0x5
9
+#define MUG_NORMAN 0x6
10
+#define MUG_JANA 0x7
11
+#define MUG_VORSTAND 0x8
12
+#define MUG_VORSTANDIN 0x9
13
+#define MUG_DIANA 0xA
14
+
15
+#endif /* MUG_IDS_H */

+ 24
- 132
src/include/pymap_constants.h View File

1336
 .equ REGENMUT, 0x55
1336
 .equ REGENMUT, 0x55
1337
 .equ KAELTEWAHN, 0x56
1337
 .equ KAELTEWAHN, 0x56
1338
 .equ SANDHERZ, 0x57
1338
 .equ SANDHERZ, 0x57
1339
-.equ WANDLUNGSK., 0x58
1339
+.equ WANDLUNGSKUNST, 0x58
1340
 .equ TOLLWUT, 0x59
1340
 .equ TOLLWUT, 0x59
1341
 .equ ZEITSPIEL, 0x5a
1341
 .equ ZEITSPIEL, 0x5a
1342
 .equ STROLCH, 0x5b
1342
 .equ STROLCH, 0x5b
1343
-.equ ORKANSCHW., 0x5c
1343
+.equ ORKANSCHWINGE, 0x5c
1344
 .equ DUNKLE_MAGIE, 0x5d
1344
 .equ DUNKLE_MAGIE, 0x5d
1345
 .equ LERNFAEHIG, 0x5e
1345
 .equ LERNFAEHIG, 0x5e
1346
 .equ HAGELALARM, 0x5f
1346
 .equ HAGELALARM, 0x5f
1347
 .equ HOCHMUT, 0x60
1347
 .equ HOCHMUT, 0x60
1348
 .equ AP_SPARER, 0x61
1348
 .equ AP_SPARER, 0x61
1349
-.equ TAKTIKWECHS., 0x62
1349
+.equ TAKTIKWECHSEL, 0x62
1350
 .equ LUZID, 0x63
1350
 .equ LUZID, 0x63
1351
 .equ UNGEBROCHEN, 0x64
1351
 .equ UNGEBROCHEN, 0x64
1352
 .equ LEBENSRAEUBER, 0x65
1352
 .equ LEBENSRAEUBER, 0x65
1358
 .equ ALLROUNDER, 0x6b
1358
 .equ ALLROUNDER, 0x6b
1359
 .equ HITZEWAHN, 0x6c
1359
 .equ HITZEWAHN, 0x6c
1360
 .equ GIFTWAHN, 0x6d
1360
 .equ GIFTWAHN, 0x6d
1361
-.equ XXX, 0x6e
1362
-.equ XXX, 0x6f
1363
-.equ XXX, 0x70
1364
 
1361
 
1365
 
1362
 
1366
 
1363
 
1593
 .equ MUS_KAMPF_GEGEN_TRAINER_HOENN, 0x10a
1590
 .equ MUS_KAMPF_GEGEN_TRAINER_HOENN, 0x10a
1594
 .equ MUS_CHANEIRA_TANZ, 0x10b
1591
 .equ MUS_CHANEIRA_TANZ, 0x10b
1595
 .equ MUS_SOUND_GLUCKWUNSCH, 0x10c
1592
 .equ MUS_SOUND_GLUCKWUNSCH, 0x10c
1596
-.equ MUS_SOUND_GLUCKWUNSCH, 0x10d
1593
+.equ MUS_SOUND_GLUCKWUNSCH_TWO, 0x10d
1597
 .equ MUS_VERRUCKTER_SOUND, 0x10e
1594
 .equ MUS_VERRUCKTER_SOUND, 0x10e
1598
-.equ MUS_VERRUCKTER_SOUND, 0x10f
1595
+.equ MUS_VERRUCKTER_SOUND_TWO, 0x10f
1599
 .equ MUS_KOMMT_MIT_SPIELER_WIRD_HERUMGEFUHRT, 0x110
1596
 .equ MUS_KOMMT_MIT_SPIELER_WIRD_HERUMGEFUHRT, 0x110
1600
 .equ MUS_SPIELHALLE, 0x111
1597
 .equ MUS_SPIELHALLE, 0x111
1601
 .equ MUS_ROCKET_HQ_AND_AZURIA_HOHLE_AND_TOP_4_BRUNO, 0x112
1598
 .equ MUS_ROCKET_HQ_AND_AZURIA_HOHLE_AND_TOP_4_BRUNO, 0x112
1702
 .equ BEHAVIOUR_UMHERBLICKEN, 0x1
1699
 .equ BEHAVIOUR_UMHERBLICKEN, 0x1
1703
 .equ BEHAVIOUR_HERUMGEHEN, 0x2
1700
 .equ BEHAVIOUR_HERUMGEHEN, 0x2
1704
 .equ BEHAVIOUR_GEHE_AUF_UND_AB, 0x3
1701
 .equ BEHAVIOUR_GEHE_AUF_UND_AB, 0x3
1705
-.equ BEHAVIOUR_GEHE_AUF_UND_AB, 0x4
1702
+.equ BEHAVIOUR_GEHE_AUF_UND_AB_TWO, 0x4
1706
 .equ BEHAVIOUR_GEHE_HIN_UND_HER, 0x5
1703
 .equ BEHAVIOUR_GEHE_HIN_UND_HER, 0x5
1707
-.equ BEHAVIOUR_GEHE_HIN_UND_HER, 0x6
1704
+.equ BEHAVIOUR_GEHE_HIN_UND_HER_TWO, 0x6
1708
 .equ BEHAVIOUR_BLICKE_NACH_OBEN, 0x7
1705
 .equ BEHAVIOUR_BLICKE_NACH_OBEN, 0x7
1709
 .equ BEHAVIOUR_BLICKE_NACH_UNTEN, 0x8
1706
 .equ BEHAVIOUR_BLICKE_NACH_UNTEN, 0x8
1710
 .equ BEHAVIOUR_BLICKE_NACH_LINKS, 0x9
1707
 .equ BEHAVIOUR_BLICKE_NACH_LINKS, 0x9
1724
 .equ BEHAVIOUR_BLICKE_RUNDUM_GEGEN_DEN_UHRZEIGERSINN, 0x17
1721
 .equ BEHAVIOUR_BLICKE_RUNDUM_GEGEN_DEN_UHRZEIGERSINN, 0x17
1725
 .equ BEHAVIOUR_BLICKE_RUNDUM_IM_UHRZEIGERSINN, 0x18
1722
 .equ BEHAVIOUR_BLICKE_RUNDUM_IM_UHRZEIGERSINN, 0x18
1726
 .equ BEHAVIOUR_LAUFE_AUF_UND_AB, 0x19
1723
 .equ BEHAVIOUR_LAUFE_AUF_UND_AB, 0x19
1727
-.equ BEHAVIOUR_LAUFE_AUF_UND_AB, 0x1a
1724
+.equ BEHAVIOUR_LAUFE_AUF_UND_AB_TWO, 0x1a
1728
 .equ BEHAVIOUR_LAUFE_HIN_UND_HER, 0x1b
1725
 .equ BEHAVIOUR_LAUFE_HIN_UND_HER, 0x1b
1729
-.equ BEHAVIOUR_LAUFE_HIN_UND_HER, 0x1c
1726
+.equ BEHAVIOUR_LAUFE_HIN_UND_HER_TWO, 0x1c
1730
 .equ BEHAVIOUR_LAUFE_HOCH__RECHTS__LINKS__RUNTER, 0x1d
1727
 .equ BEHAVIOUR_LAUFE_HOCH__RECHTS__LINKS__RUNTER, 0x1d
1731
 .equ BEHAVIOUR_LAUFE_RECHTS__LINKS__HOCH__RUNTER, 0x1e
1728
 .equ BEHAVIOUR_LAUFE_RECHTS__LINKS__HOCH__RUNTER, 0x1e
1732
 .equ BEHAVIOUR_LAUFE_RUNTER__HOCH__RECHTS__LINKS, 0x1f
1729
 .equ BEHAVIOUR_LAUFE_RUNTER__HOCH__RECHTS__LINKS, 0x1f
1737
 .equ BEHAVIOUR_LAUFE_RECHTS__RUNTER__HOCH__LINKS, 0x24
1734
 .equ BEHAVIOUR_LAUFE_RECHTS__RUNTER__HOCH__LINKS, 0x24
1738
 .equ BEHAVIOUR_LAUFE_LINKS__HOCH__RUNTER__RECHTS, 0x25
1735
 .equ BEHAVIOUR_LAUFE_LINKS__HOCH__RUNTER__RECHTS, 0x25
1739
 .equ BEHAVIOUR_LAUFE_HOCH__RUNTER__RECHTS__LINKS, 0x26
1736
 .equ BEHAVIOUR_LAUFE_HOCH__RUNTER__RECHTS__LINKS, 0x26
1740
-.equ BEHAVIOUR_LAUFE_RECHTS__LINKS__HOCH__RUNTER, 0x27
1737
+.equ BEHAVIOUR_LAUFE_RECHTS__LINKS__HOCH__RUNTER_TWO, 0x27
1741
 .equ BEHAVIOUR_LAUFE_RUNTER__RECHTS__LINKS__HOCH, 0x28
1738
 .equ BEHAVIOUR_LAUFE_RUNTER__RECHTS__LINKS__HOCH, 0x28
1742
 .equ BEHAVIOUR_LAUFE_RECHTS__HOCH__RUNTER__LINKS, 0x29
1739
 .equ BEHAVIOUR_LAUFE_RECHTS__HOCH__RUNTER__LINKS, 0x29
1743
 .equ BEHAVIOUR_LAUFE_HOCH__RUNTER__LINKS__RECHTS, 0x2a
1740
 .equ BEHAVIOUR_LAUFE_HOCH__RUNTER__LINKS__RECHTS, 0x2a
1744
 .equ BEHAVIOUR_LAUFE_LINKS__RECHTS__HOCH__RUNTER, 0x2b
1741
 .equ BEHAVIOUR_LAUFE_LINKS__RECHTS__HOCH__RUNTER, 0x2b
1745
 .equ BEHAVIOUR_LAUFE_RUNTER__LINKS__RECHTS__HOCH, 0x2c
1742
 .equ BEHAVIOUR_LAUFE_RUNTER__LINKS__RECHTS__HOCH, 0x2c
1746
 .equ BEHAVIOUR_LAUFE_GEGEN_DEN_UHRZEIGERSINN, 0x2d
1743
 .equ BEHAVIOUR_LAUFE_GEGEN_DEN_UHRZEIGERSINN, 0x2d
1747
-.equ BEHAVIOUR_LAUFE_GEGEN_DEN_UHRZEIGERSINN, 0x2e
1748
-.equ BEHAVIOUR_LAUFE_GEGEN_DEN_UHRZEIGERSINN, 0x2f
1749
-.equ BEHAVIOUR_LAUFE_GEGEN_DEN_UHRZEIGERSINN, 0x30
1750
-.equ BEHAVIOUR_LAUFE_GEGEN_DEN_UHRZEIGERSINN, 0x31
1744
+.equ BEHAVIOUR_LAUFE_GEGEN_DEN_UHRZEIGERSINN_TWO, 0x2e
1745
+.equ BEHAVIOUR_LAUFE_GEGEN_DEN_UHRZEIGERSINN_THREE, 0x2f
1746
+.equ BEHAVIOUR_LAUFE_GEGEN_DEN_UHRZEIGERSINN_FOUR, 0x30
1747
+.equ BEHAVIOUR_LAUFE_GEGEN_DEN_UHRZEIGERSINN_FIVE, 0x31
1751
 .equ BEHAVIOUR_LAUFE_IM_UHRZEIGERSINN, 0x32
1748
 .equ BEHAVIOUR_LAUFE_IM_UHRZEIGERSINN, 0x32
1752
-.equ BEHAVIOUR_LAUFE_IM_UHRZEIGERSINN, 0x33
1753
-.equ BEHAVIOUR_LAUFE_IM_UHRZEIGERSINN, 0x34
1749
+.equ BEHAVIOUR_LAUFE_IM_UHRZEIGERSINN_TWO, 0x33
1750
+.equ BEHAVIOUR_LAUFE_IM_UHRZEIGERSINN_THREE, 0x34
1754
 .equ BEHAVIOUR_SPIELER_KOPIEREN, 0x35
1751
 .equ BEHAVIOUR_SPIELER_KOPIEREN, 0x35
1755
 .equ BEHAVIOUR_SPIELER_SPIEGELN, 0x36
1752
 .equ BEHAVIOUR_SPIELER_SPIEGELN, 0x36
1756
-.equ BEHAVIOUR_SPIELER_SPIEGELN, 0x37
1757
-.equ BEHAVIOUR_SPIELER_SPIEGELN, 0x38
1753
+.equ BEHAVIOUR_SPIELER_SPIEGELN_TWO, 0x37
1754
+.equ BEHAVIOUR_SPIELER_SPIEGELN_THREE, 0x38
1758
 .equ BEHAVIOUR_BAUM_WAND_VERKLEIDUNG, 0x39
1755
 .equ BEHAVIOUR_BAUM_WAND_VERKLEIDUNG, 0x39
1759
 .equ BEHAVIOUR_FELS_WAND_VERKLEIDUNG, 0x3a
1756
 .equ BEHAVIOUR_FELS_WAND_VERKLEIDUNG, 0x3a
1760
 .equ BEHAVIOUR_SPIELER_SPIEGELN_IM_STAND, 0x3b
1757
 .equ BEHAVIOUR_SPIELER_SPIEGELN_IM_STAND, 0x3b
1761
-.equ BEHAVIOUR_SPIELER_KOPIEREN_IM_STAND, 0x3c
1762
-.equ BEHAVIOUR_SPIELER_SPIEGELN_IM_STAND, 0x3d
1763
-.equ BEHAVIOUR_SPIELER_SPIEGELN_IM_STAND, 0x3e
1764
-.equ BEHAVIOUR_VERSTECKT, 0x3f
1758
+.equ BEHAVIOUR_SPIELER_KOPIEREN_IM_STAND_TWO, 0x3c
1759
+.equ BEHAVIOUR_SPIELER_SPIEGELN_IM_STAND_THREE, 0x3d
1760
+.equ BEHAVIOUR_SPIELER_SPIEGELN_IM_STAND_FOUR, 0x3e
1761
+.equ BEHAVIOUR_VERSTECKT_TWO, 0x3f
1765
 .equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_UNTEN, 0x40
1762
 .equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_UNTEN, 0x40
1766
 .equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_OBEN, 0x41
1763
 .equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_OBEN, 0x41
1767
 .equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_LINKS, 0x42
1764
 .equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_LINKS, 0x42
1774
 .equ BEHAVIOUR_AUF_DER_STELLE_LAUFEN_OBEN, 0x49
1771
 .equ BEHAVIOUR_AUF_DER_STELLE_LAUFEN_OBEN, 0x49
1775
 .equ BEHAVIOUR_AUF_DER_STELLE_LAUFEN_LINKS, 0x4a
1772
 .equ BEHAVIOUR_AUF_DER_STELLE_LAUFEN_LINKS, 0x4a
1776
 .equ BEHAVIOUR_AUF_DER_STELLE_LAUFEN_RECHTS, 0x4b
1773
 .equ BEHAVIOUR_AUF_DER_STELLE_LAUFEN_RECHTS, 0x4b
1777
-.equ BEHAVIOUR_VERSTECKT, 0x4c
1774
+.equ BEHAVIOUR_VERSTECKT_THREE, 0x4c
1778
 .equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_UNTEN_, 0x4d
1775
 .equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_UNTEN_, 0x4d
1779
 .equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_OBEN_, 0x4e
1776
 .equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_OBEN_, 0x4e
1780
 .equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_LINKS_, 0x4f
1777
 .equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_LINKS_, 0x4f
1781
-.equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_RECHTS, 0x50
1778
+.equ BEHAVIOUR_AUF_DER_STELLE_GEHEN_RECHTS_TWO, 0x50
1782
 
1779
 
1783
 
1780
 
1784
 
1781
 
1789
 .equ MAP_MERIANA_CITY, 0x59
1786
 .equ MAP_MERIANA_CITY, 0x59
1790
 .equ MAP_AKTANIA, 0x5a
1787
 .equ MAP_AKTANIA, 0x5a
1791
 .equ MAP_SILVANIA, 0x5b
1788
 .equ MAP_SILVANIA, 0x5b
1792
-.equ MAP_KASKADA, 0x5c
1793
-.equ MAP_ORINA_CITY, 0x5d
1794
-.equ MAP_INFERIOR, 0x5e
1795
-.equ MAP_CEOMETRIA, 0x5f
1796
-.equ MAP_ZINNOBERINSEL, 0x60
1797
-.equ MAP_INDIGO_PLATEAU, 0x61
1798
-.equ MAP_SAFFRONIA_CITY, 0x62
1799
-.equ MAP_ROUTE_4, 0x63
1800
-.equ MAP_ROUTE_10, 0x64
1801
-.equ MAP_ROUTE_1, 0x65
1802
-.equ MAP_ROUTE_3, 0x66
1803
-.equ MAP_FELSIGE_OEDNIS, 0x67
1804
-.equ MAP_ROUTE_4, 0x68
1805
-.equ MAP_ROUTE_5, 0x69
1806
-.equ MAP_ROUTE_6, 0x6a
1807
-.equ MAP_ROUTE_7, 0x6b
1808
-.equ MAP_ROUTE_8, 0x6c
1809
-.equ MAP_ROUTE_9, 0x6d
1810
-.equ MAP_ROUTE_10, 0x6e
1811
-.equ MAP_ROUTE_11, 0x6f
1812
-.equ MAP_ROUTE_12, 0x70
1813
-.equ MAP_ROUTE_13, 0x71
1814
-.equ MAP_ROUTE_14, 0x72
1815
-.equ MAP_ROUTE_15, 0x73
1816
-.equ MAP_ROUTE_16, 0x74
1817
-.equ MAP_ROUTE_17, 0x75
1818
-.equ MAP_ROUTE_18, 0x76
1819
-.equ MAP_ROUTE_19, 0x77
1820
-.equ MAP_ROUTE_20, 0x78
1821
-.equ MAP_ROUTE_21, 0x79
1822
-.equ MAP_ROUTE_2, 0x7a
1823
-.equ MAP_ROUTE_23, 0x7b
1824
-.equ MAP_ROUTE_24, 0x7c
1825
-.equ MAP_ROUTE_25, 0x7d
1826
-.equ MAP_SILVANIA_WALD, 0x7e
1827
-.equ MAP_PKMN_FRIEDHOF, 0x7f
1828
-.equ MAP_KUESTENBERG, 0x80
1829
-.equ MAP_ASCHHAIN, 0x81
1830
-.equ MAP_TUNNELPFAD, 0x82
1831
-.equ MAP_WASSERPFAD, 0x83
1832
-.equ MAP_SIEGESSTRASSE, 0x84
1833
-.equ MAP_ROCKET_HQ, 0x85
1834
-.equ MAP_SILPH_CO., 0x86
1835
-.equ MAP_KUESTENBERG, 0x87
1836
-.equ MAP_SAFARI_ZONE, 0x88
1837
-.equ MAP_POKEMON_LIGA, 0x89
1838
-.equ MAP_VULCANO, 0x8a
1839
-.equ MAP_SEESCHAUMINSELN, 0x8b
1840
-.equ MAP_POKEMON_TURM, 0x8c
1841
-.equ MAP_AZURIA_HOEHLE, 0x8d
1842
-.equ MAP_KRAFTWERK, 0x8e
1843
-.equ MAP_EILAND_EINS, 0x8f
1844
-.equ MAP_EILAND_ZWEI, 0x90
1845
-.equ MAP_EILAND_DREI, 0x91
1846
-.equ MAP_EILAND_VIER, 0x92
1847
-.equ MAP_EILAND_FUENF, 0x93
1848
-.equ MAP_EILAND_SIEBEN, 0x94
1849
-.equ MAP_EILAND_SECHS, 0x95
1850
-.equ MAP_GLUEHWEG, 0x96
1851
-.equ MAP_SCHATZGESTADE, 0x97
1852
-.equ MAP_KAP_KANTE, 0x98
1853
-.equ MAP_BUNDBRUECKE, 0x99
1854
-.equ MAP_TRI_EILAND_HAFEN, 0x9a
1855
-.equ MAP_SEVII_EILAND_6, 0x9b
1856
-.equ MAP_SEVII_EILAND_7, 0x9c
1857
-.equ MAP_SEVII_EILAND_8, 0x9d
1858
-.equ MAP_SEVII_EILAND_9, 0x9e
1859
-.equ MAP_FERIENPARADIES, 0x9f
1860
-.equ MAP_WASSERIRRGARTEN, 0xa0
1861
-.equ MAP_EILAND_5_WEIDE, 0xa1
1862
-.equ MAP_TRAINERSCHULE, 0xa2
1863
-.equ MAP_FERN_EILAND, 0xa3
1864
-.equ MAP_GRUENER_PFAD, 0xa4
1865
-.equ MAP_WASSERWEG, 0xa5
1866
-.equ MAP_RUINENTAL, 0xa6
1867
-.equ MAP_TRAINERTURM, 0xa7
1868
-.equ MAP_SCHLUCHTEINGANG, 0xa8
1869
-.equ MAP_7_SCHATZSCHLUCHT, 0xa9
1870
-.equ MAP_TANIBO_RUINEN, 0xaa
1871
-.equ MAP_SEVII_EILAND_22, 0xab
1872
-.equ MAP_SEVII_EILAND_23, 0xac
1873
-.equ MAP_SEVII_EILAND_24, 0xad
1874
-.equ MAP_NABELFELS, 0xae
1875
-.equ MAP_GLUTBERG, 0xaf
1876
-.equ MAP_BEERENFORST, 0xb0
1877
-.equ MAP_EISKASKADENHOEHLE, 0xb1
1878
-.equ MAP_ROCKET_LAGER, 0xb2
1879
-.equ MAP_TRAINERTURM, 0xb3
1880
-.equ MAP_PUNKTLOCH, 0xb4
1881
-.equ MAP_VERLORENE_HOEHLE, 0xb5
1882
-.equ MAP_MUSTERBUSCHWALD, 0xb6
1883
-.equ MAP_WANDELHOEHLE, 0xb7
1884
-.equ MAP_TANIBO_KAMMER, 0xb8
1885
-.equ MAP_TRI_EILAND_PFAD, 0xb9
1886
-.equ MAP_TANIBO_SCHLUESSEL, 0xba
1887
-.equ MAP_ENTSTEHUNGSINSEL, 0xbb
1888
-.equ MAP_WUESTENKAMMER, 0xbc
1889
-.equ MAP_PEZWULP_KAMMER, 0xbd
1890
-.equ MAP_DREICKE_KAMMER, 0xbe
1891
-.equ MAP_VIERZISSE_KAMMER, 0xbf
1892
-.equ MAP_FUENIBISKU_KAMMER, 0xc0
1893
-.equ MAP_LILECHS_KAMMER, 0xc1
1894
-.equ MAP_ARC_SCRIM, 0xc2
1895
-.equ MAP_GLUTTHERME, 0xc3
1896
-.equ MAP_PRISMANIA_EINK, 0xc4
1897
 
1789
 
1898
 
1790
 
1899
 
1791
 

+ 140
- 42
src/include/script_language.h View File

1
+#ifndef SCRIPT_LANG_H_
2
+#define SCRIPT_LANG_H_
3
+
1
 #include <config.h>
4
 #include <config.h>
2
 #include <applymovements.h>
5
 #include <applymovements.h>
6
+#include <hiddenflags.h>
7
+#include <mugssprites.h>
8
+
9
+@@ Costum Specials
10
+.equ SP_BATCHMAPTILE, 0x7
3
 
11
 
4
 @@ Compare operands
12
 @@ Compare operands
5
 .equ B_LT, 0x0
13
 .equ B_LT, 0x0
9
 .equ B_GE, 0x4
17
 .equ B_GE, 0x4
10
 .equ B_NE, 0x5
18
 .equ B_NE, 0x5
11
 
19
 
20
+@@ Important flags
21
+.equ FLAG_PKMN_MENU, 0x828
22
+.equ FLAG_POKDEX, 0x829
23
+.equ FLAG_RUNNING_SHOES, 0x82F
24
+.equ FLAG_ORDEN_1, 0x820
25
+.equ FLAG_ORDEN_2, 0x821
26
+.equ FLAG_ORDEN_3, 0x822
27
+.equ FLAG_ORDEN_4, 0x823
28
+.equ FLAG_ORDEN_5, 0x824
29
+.equ FLAG_ORDEN_6, 0x825
30
+.equ FLAG_ORDEN_7, 0x826
31
+.equ FLAG_ORDEN_8, 0x827
32
+
12
 @@ Flag operands
33
 @@ Flag operands
13
 .equ B_T, 0x0
34
 .equ B_T, 0x0
14
 .equ B_F, 0x1
35
 .equ B_F, 0x1
15
 
36
 
16
 @@ callstd alias
37
 @@ callstd alias
17
-.equ ITEM_OBTAIN, 0
18
-.equ ITEM_FIND, 1
19
-.equ MSG_FACE, 2
20
-.equ MSG_SIGN, 3
21
-.equ MSG_KEYOPEN, 4
22
-.equ MSG_YES_NO, 5
23
-.equ MSG_STD, 6
24
-
38
+.equ ITEM_OBTAIN, 0x0
39
+.equ ITEM_FIND, 0x1
40
+.equ MSG_FACE, 0x2
41
+.equ MSG_SIGN, 0x3
42
+.equ MSG_KEYOPEN, 0x4
43
+.equ MSG_YES_NO, 0x5
44
+.equ MSG_STD, 0x6
45
+
46
+@@ Definition
47
+.equ MUGFACE_LEFT, 0x0
48
+.equ MUGFACE_RIGHT, 0x1
49
+
50
+@@ Effect
51
+.equ EFFECT_NORMAL, 0x0
52
+.equ EFFECT_GREY, 0x1
53
+.equ EFFECT_SERPIA, 0x2
25
 
54
 
26
 @@@@@@@@@@@@@@@@@ Macro
55
 @@@@@@@@@@@@@@@@@ Macro
27
 
56
 
28
 @@ Custom commands
57
 @@ Custom commands
29
 
58
 
59
+.macro batchmaptile batchmaptile_tiles_from:req batchmaptile_tiles_to:req batchmaptile_kollision_from:req batchmaptile_kollision_to:req
60
+setvar 0x8000 \batchmaptile_tiles_from
61
+setvar 0x8001 \batchmaptile_tiles_to
62
+setvar 0x8002 \batchmaptile_kollision_from
63
+setvar 0x8003 \batchmaptile_kollision_to
64
+setvar 0x5006 SP_BATCHMAPTILE
65
+special 0x68
66
+.endm
67
+
68
+.macro seteffect seteffect_effect_id:req
69
+writebytetooffset \seteffect_effect_id 0x02036E28
70
+.endm
71
+
72
+.macro setecutscene
73
+writebytetooffset 0x80 0x4000044
74
+writebytetooffset 0x20 0x4000045
75
+.endm
76
+
77
+.macro clearcutscene
78
+writebytetooffset 0xFF 0x4000044
79
+writebytetooffset 0x00 0x4000045
80
+.endm
81
+
82
+.macro pokemsg pokemsg_string:req pokemsg_callstd:req pokemsg_ID:req
83
+checksound
84
+cry \pokemsg_ID 0x0
85
+showpokepic \pokemsg_ID 0x0 0x5
86
+loadpointer 0x0 \pokemsg_string
87
+callstd \pokemsg_callstd
88
+hidepokepic
89
+waitcry
90
+.endm
91
+
92
+.macro earthquake earthquake_horri:req earthquake_tiles:req earthquake_sec:req earthquake_vert:req
93
+setvar 0x8004 \earthquake_horri
94
+setvar 0x8005 \earthquake_tiles
95
+setvar 0x8006 \earthquake_sec
96
+setvar 0x8007 \earthquake_vert
97
+special 0x136
98
+.endm
99
+
100
+.macro lookbattle lookbattle_id:req lookbattle_before:req lookbattle_after:req
101
+trainerbattle 0x0 \lookbattle_id 0x0 \lookbattle_before \lookbattle_after
102
+.endm
103
+
104
+.macro gymbattle gymbattle_id:req gymbattle_before:req gymbattle_after:req
105
+trainerbattle 0x1 \gymbattle_id 0x0 \gymbattle_before \gymbattle_after \gymbattle_later
106
+.endm
107
+
108
+.macro betweenbattle betweenbattle_id:req betweenbattle_before:req betweenbattle_after:req betweenbattle_between:req
109
+trainerbattle 0x2 \betweenbattle_id 0x0 \betweenbattle_before \betweenbattle_after \betweenbattle_between
110
+.endm
111
+
112
+.macro scriptbattle scriptbattle_id:req scriptbattle_after:req
113
+trainerbattle 0x3 \scriptbattle_id 0x0 \scriptbattle_after
114
+.endm
115
+
116
+.macro doublebattle doublebattle_id:req doublebattle_before:req doublebattle_after:req doublebattle_onepoke:req
117
+trainerbattle 0x4 \doublebattle_id 0x0 \doublebattle_before \doublebattle_after \doublebattle_onepoke
118
+.endm
119
+
120
+.macro doublegymbattle doublegymbattle_id:req doublegymbattle_before:req doublegymbattle_after:req doublegymbattle_later:req doublegymbattle_onepoke:req
121
+trainerbattle 0x8 \doublegymbattle_id 0x0 \doublegymbattle_before \doublegymbattle_after \doublegymbattle_later \doublegymbattle_onepoke
122
+.endm
123
+
124
+.macro winlosebattle winlosebattle_id:req winlosebattle_win:req winlosebattle_lose:req
125
+trainerbattle 0x9 \winlosebattle_id 0x3 \winlosebattle_win \winlosebattle_lose
126
+.endm
127
+
30
 .macro msgbox msgbox_textpointer:req msgbox_callstd:req
128
 .macro msgbox msgbox_textpointer:req msgbox_callstd:req
31
 loadpointer 0x0 \msgbox_textpointer
129
 loadpointer 0x0 \msgbox_textpointer
32
 callstd \msgbox_callstd
130
 callstd \msgbox_callstd
56
 waitstate
154
 waitstate
57
 .endm
155
 .endm
58
 
156
 
59
-.macro msgmugr msgmugr_textpointer:req msgmugr_callstd:req msgmugr_sprite:req
60
-setvar MUGHSOT_1_TABLE \msgmugr_sprite
157
+.macro wildbattlemusic wildbattlemusic_spezies:req wildbattlemusic_level:req wildbattlemusic_item:req wildbattlemusic_music:req
158
+setwildbattle \wildbattlemusic_spezies \wildbattlemusic_level \wildbattlemusic_item
159
+special 0x138
160
+playsong \wildbattlemusic_music 0x0
161
+.endm
162
+
163
+.macro costumtrainerbattlemusic costumtrainerbattlemusic_id:req
164
+special 0x3B
165
+playsong \costumtrainerbattlemusic_id 0x0
166
+.endm
167
+
168
+.macro mugmsgr mugmsgr_textpointer:req mugmsgr_callstd:req mugmsgr_sprite:req
169
+setvar MUGHSOT_1_TABLE \mugmsgr_sprite
61
 setvar MUGSHOT_1_X 0xD0
170
 setvar MUGSHOT_1_X 0xD0
62
 setvar MUGSHOT_1_Y 0x60
171
 setvar MUGSHOT_1_Y 0x60
63
-msgbox \msgmugr_textpointer \msgmugr_callstd
172
+msgbox \mugmsgr_textpointer \mugmsgr_callstd
64
 setvar MUGHSOT_1_TABLE 0x0
173
 setvar MUGHSOT_1_TABLE 0x0
65
 .endm
174
 .endm
66
 
175
 
67
-.macro msgmugl msgmugl_textpointer:req msgmugl_callstd:req msgmugl_sprite:req
68
-setvar MUGHSOT_1_TABLE \msgmugl_sprite
176
+.macro mugmsgl mugmsgl_textpointer:req mugmsgl_callstd:req mugmsgl_sprite:req
177
+setvar MUGHSOT_1_TABLE \mugmsgl_sprite | 0x8000
69
 setvar MUGSHOT_1_X 0x16
178
 setvar MUGSHOT_1_X 0x16
70
 setvar MUGSHOT_1_Y 0x60
179
 setvar MUGSHOT_1_Y 0x60
71
-msgbox \msgmugl_textpointer \msgmugl_callstd
180
+msgbox \mugmsgl_textpointer \mugmsgl_callstd
181
+setvar MUGHSOT_1_TABLE 0x0
182
+.endm
183
+
184
+.macro mugrival mugrival_textpointer:req mugrival_callstd:req mugrival_facing:req
185
+setvar 0x8000 \mugrival_facing
186
+call scr_mugrival
187
+msgbox \mugrival_textpointer \mugrival_callstd
72
 setvar MUGHSOT_1_TABLE 0x0
188
 setvar MUGHSOT_1_TABLE 0x0
73
 .endm
189
 .endm
74
 
190
 
104
 clearflag FLAG_WALK_SCRIPT
220
 clearflag FLAG_WALK_SCRIPT
105
 .endm
221
 .endm
106
 
222
 
107
-.macro writemusikto1 writemusikto1_from:req writemusikto1_to:req
108
-setflag FLAG_ENABLE_MUSIC_OVERRIDES
109
-setvar VAR_FROM_1 \writemusikto1_from
110
-setvar VAR_TO_1 \writemusikto1_to
111
-.endm
112
-
113
-.macro writemusikto2 writemusikto2_from:req writemusikto2_to:req
114
-setflag FLAG_ENABLE_MUSIC_OVERRIDES
115
-setvar VAR_FROM_2 \writemusikto2_from
116
-setvar VAR_TO_2 \writemusikto2_to
117
-.endm
118
-
119
-.macro writemusikto3 writemusikto3_from:req writemusikto3_to:req
120
-setflag FLAG_ENABLE_MUSIC_OVERRIDES
121
-setvar VAR_FROM_3 \writemusikto3_from
122
-setvar VAR_TO_3 \writemusikto3_to
123
-.endm
124
-
125
 .macro writemusikwithmapmusik writemusikwithmapmusik_mapmusik:req
223
 .macro writemusikwithmapmusik writemusikwithmapmusik_mapmusik:req
126
 setflag FLAG_ENABLE_MUSIC_OVERRIDES
224
 setflag FLAG_ENABLE_MUSIC_OVERRIDES
127
 setvar VAR_FROM_1 \writemusikwithmapmusik_mapmusik
225
 setvar VAR_FROM_1 \writemusikwithmapmusik_mapmusik
132
 clearflag FLAG_ENABLE_MUSIC_OVERRIDES
230
 clearflag FLAG_ENABLE_MUSIC_OVERRIDES
133
 .endm
231
 .endm
134
 
232
 
135
-
136
-
137
-
138
-
139
 @@ Index commands
233
 @@ Index commands
140
 
234
 
141
 .macro nop
235
 .macro nop
164
 .word \goto_address
258
 .word \goto_address
165
 .endm
259
 .endm
166
 
260
 
167
-.macro callif if1_value:req if1_pointer:req
261
+.macro gotoif if1_value:req if1_pointer:req
168
 .byte 0x6
262
 .byte 0x6
169
 .byte \if1_value
263
 .byte \if1_value
170
 .word \if1_pointer
264
 .word \if1_pointer
171
 .endm
265
 .endm
172
 
266
 
173
-.macro gotoif if2_value:req if2_pointer:req
267
+.macro callif if2_value:req if2_pointer:req
174
 .byte 0x7
268
 .byte 0x7
175
 .byte \if2_value
269
 .byte \if2_value
176
 .word \if2_pointer
270
 .word \if2_pointer
514
 .byte \spriteface_facing
608
 .byte \spriteface_facing
515
 .endm
609
 .endm
516
 
610
 
517
-.macro trainerbattle trainerbattle_kind:req trainerbattle_id:req trainerbattle_value:req trainerbattle_before:req trainerbattle_after:req trainerbattle_later
611
+.macro trainerbattle trainerbattle_kind:req trainerbattle_id:req trainerbattle_value:req trainerbattle_before:req trainerbattle_after trainerbattle_later trainerbattle_onepoke
518
 .byte 0x5C
612
 .byte 0x5C
519
 .byte \trainerbattle_kind
613
 .byte \trainerbattle_kind
520
 .hword \trainerbattle_id
614
 .hword \trainerbattle_id
522
 .word \trainerbattle_before
616
 .word \trainerbattle_before
523
 .word \trainerbattle_after
617
 .word \trainerbattle_after
524
 .word \trainerbattle_later
618
 .word \trainerbattle_later
619
+.word \trainerbattle_onepoke
525
 .endm
620
 .endm
526
 
621
 
527
 .macro repeattrainerbattle
622
 .macro repeattrainerbattle
814
 .hword \checkanimation_animation
909
 .hword \checkanimation_animation
815
 .endm
910
 .endm
816
 
911
 
817
-.macro sethealingplace sethealingplace_flightspot:req
818
-.byte 0x9F
819
-.hword \sethealingplace_flightspot
912
+.macro sethealingplace shp_bank:req shp_map:req shp_x:req shp_y:req
913
+    setvar HEALING_BANK_MAP_VAR \shp_map << 8 | \shp_bank
914
+    setvar HEALING_X_VAR \shp_x
915
+    setvar HEALING_Y_VAR \shp_y
820
 .endm
916
 .endm
821
 
917
 
822
 .macro checkgender
918
 .macro checkgender
945
 .hword \bufferitems_item
1041
 .hword \bufferitems_item
946
 .hword \bufferitems_quantity
1042
 .hword \bufferitems_quantity
947
 .endm
1043
 .endm
1044
+
1045
+#endif

+ 13
- 6
src/overworld/dyn_npc_hooks.S View File

6
 obj_delete_and_free_tiles_hook:
6
 obj_delete_and_free_tiles_hook:
7
 	push {r4-r7,lr}
7
 	push {r4-r7,lr}
8
 	mov r5, r0
8
 	mov r5, r0
9
+	ldr r0, [r5, #0x14] @template
10
+	ldr r1, =0x8231D00 @ template for empty OBJ
11
+	cmp r0, r1
12
+	beq no_entry_remove
9
     ldrb r0, [r5,#5]
13
     ldrb r0, [r5,#5]
14
+	ldr r1, [r5, #0x14]
15
+	ldrh r1, [r1,#2] @tag
10
     lsr r0, #4
16
     lsr r0, #4
11
     bl npc_dynamic_remove_entry
17
     bl npc_dynamic_remove_entry
18
+no_entry_remove:
12
 	mov r0, r5
19
 	mov r0, r5
13
 	add r0, #0x3E
20
 	add r0, #0x3E
14
 	ldrb r1, [r0]
21
 	ldrb r1, [r0]
17
 
24
 
18
 .global obj_delete_all_hook
25
 .global obj_delete_all_hook
19
 obj_delete_all_hook:
26
 obj_delete_all_hook:
20
-ldr r1, =obj_delete
21
-bl bxr1
22
-bl npc_dynamic_reset
23
-pop {r4-r5}
24
-pop {r0}
25
-bx r0
27
+	ldr r1, =obj_delete
28
+	bl bxr1
29
+	bl npc_dynamic_reset
30
+	pop {r4-r5}
31
+	pop {r0}
32
+	bx r0
26
 
33
 
27
 bxr1:
34
 bxr1:
28
 bx r1
35
 bx r1

+ 13
- 6
src/overworld/dyn_npc_hooks.s View File

6
 obj_delete_and_free_tiles_hook:
6
 obj_delete_and_free_tiles_hook:
7
 	push {r4-r7,lr}
7
 	push {r4-r7,lr}
8
 	mov r5, r0
8
 	mov r5, r0
9
+	ldr r0, [r5, #0x14] @template
10
+	ldr r1, =0x8231D00 @ template for empty OBJ
11
+	cmp r0, r1
12
+	beq no_entry_remove
9
     ldrb r0, [r5,#5]
13
     ldrb r0, [r5,#5]
14
+	ldr r1, [r5, #0x14]
15
+	ldrh r1, [r1,#2] @tag
10
     lsr r0, #4
16
     lsr r0, #4
11
     bl npc_dynamic_remove_entry
17
     bl npc_dynamic_remove_entry
18
+no_entry_remove:
12
 	mov r0, r5
19
 	mov r0, r5
13
 	add r0, #0x3E
20
 	add r0, #0x3E
14
 	ldrb r1, [r0]
21
 	ldrb r1, [r0]
17
 
24
 
18
 .global obj_delete_all_hook
25
 .global obj_delete_all_hook
19
 obj_delete_all_hook:
26
 obj_delete_all_hook:
20
-ldr r1, =obj_delete
21
-bl bxr1
22
-bl npc_dynamic_reset
23
-pop {r4-r5}
24
-pop {r0}
25
-bx r0
27
+	ldr r1, =obj_delete
28
+	bl bxr1
29
+	bl npc_dynamic_reset
30
+	pop {r4-r5}
31
+	pop {r0}
32
+	bx r0
26
 
33
 
27
 bxr1:
34
 bxr1:
28
 bx r1
35
 bx r1

+ 67
- 4
src/overworld/dynamic_overworld.c View File

62
     return (u8)store_entry;
62
     return (u8)store_entry;
63
 }
63
 }
64
 
64
 
65
+void ov_emot_load(struct Object *obj, u16 a2, u8 a3) {
66
+    (void)npc_dynamic_load_palette(0x1100);
67
+    obj->final_oam.priority = 2;
68
+    obj->bitfield2 |= 2;
69
+    obj->priv[0] = oe_state.effect_pos.x;
70
+    obj->priv[1] = oe_state.effect_pos.y;
71
+    obj->priv[2] = oe_state.priority;
72
+    obj->priv[3] = -5;
73
+    obj->priv[7] = a2;
74
+    obj_anim_image_start(obj, a3);
75
+}
76
+
65
 void npc_dynamic_reset() {
77
 void npc_dynamic_reset() {
66
     for (u8 i = 0; i < MAX_PAL_STORE; ++i) {
78
     for (u8 i = 0; i < MAX_PAL_STORE; ++i) {
67
         stored_palettes[i].reference_count = 0;
79
         stored_palettes[i].reference_count = 0;
87
     }
99
     }
88
 
100
 
89
     struct NpcState *npc_to_load = &npc_states[id];
101
     struct NpcState *npc_to_load = &npc_states[id];
90
-    struct NpcType *type_to_load = npc_get_type(((u16)npc_to_load->type_id) | (((u16)npc_to_load->field1A << 8)));
102
+    u16 type_id = ((u16)npc_to_load->type_id) | (((u16)npc_to_load->field1A << 8));
103
+    struct NpcType *type_to_load = npc_get_type(type_id);
91
 
104
 
92
     struct Template template_to_load;
105
     struct Template template_to_load;
93
     u32 f14;
106
     u32 f14;
94
-    npc_to_objtemplate__with_indexed_objfunc(npc_to_load->type_id, npc_to_load->running_behavior, &template_to_load,
95
-                                             &f14);
107
+    npc_to_objtemplate__with_indexed_objfunc(type_id, npc_to_load->running_behavior, &template_to_load, &f14);
96
     template_to_load.pal_tag = 0xFFFF;
108
     template_to_load.pal_tag = 0xFFFF;
97
     s8 pal_slot = npc_dynamic_load_palette(type_to_load->pal_num);
109
     s8 pal_slot = npc_dynamic_load_palette(type_to_load->pal_num);
110
+
111
+    /*template_to_load.pal_tag = type_to_load->pal_num;
112
+    gpu_pal_obj_alloc_tag_and_apply(&npc_palettes[npc_pal_idx_for_given_tag(type_to_load->pal_num)]);
113
+    u8 pal_slot = gpu_pal_tags_index_of(type_to_load->pal_num);*/
114
+
98
     u8 obj_id = template_instanciate_forward_search(&template_to_load, 0, 0, 0);
115
     u8 obj_id = template_instanciate_forward_search(&template_to_load, 0, 0, 0);
99
 
116
 
100
     if (obj_id == 64)
117
     if (obj_id == 64)
113
     }
130
     }
114
 
131
 
115
     if (f14 != 0) {
132
     if (f14 != 0) {
116
-        (void) obj_set_f18_to_r0_f42_to_40(npc_obj, f14);
133
+        (void)obj_set_f18_to_r0_f42_to_40(npc_obj, f14);
117
     }
134
     }
118
 
135
 
119
     npc_obj->final_oam.palette_num = pal_slot;
136
     npc_obj->final_oam.palette_num = pal_slot;
135
 
152
 
136
     struct NpcState *created_state = &npc_states[state];
153
     struct NpcState *created_state = &npc_states[state];
137
     struct NpcType *type = npc_get_type(created_state->type_id | (npc->field3 << 8));
154
     struct NpcType *type = npc_get_type(created_state->type_id | (npc->field3 << 8));
155
+
138
     s8 pal_slot = npc_dynamic_load_palette(type->pal_num);
156
     s8 pal_slot = npc_dynamic_load_palette(type->pal_num);
139
 
157
 
158
+    // gpu_pal_obj_alloc_tag_and_apply(&npc_palettes[npc_pal_idx_for_given_tag(type->pal_num)]);
159
+    // u8 pal_slot = gpu_pal_tags_index_of(type->pal_num);
160
+
140
     if (created_state->running_behavior == 76)
161
     if (created_state->running_behavior == 76)
141
         created_state->field1 |= 0x20;
162
         created_state->field1 |= 0x20;
142
     template->pal_tag = 0xFFFF;
163
     template->pal_tag = 0xFFFF;
164
+    // template->pal_tag = type->pal_num;
143
     u8 obj_id = template_instanciate_forward_search(template, 0, 0, 0);
165
     u8 obj_id = template_instanciate_forward_search(template, 0, 0, 0);
144
     if (obj_id == 64) {
166
     if (obj_id == 64) {
145
         created_state->bitfield &= 0xFE;
167
         created_state->bitfield &= 0xFE;
168
     npc_obj_offscreen_culling_and_flag_update(created_state, npc_object);
190
     npc_obj_offscreen_culling_and_flag_update(created_state, npc_object);
169
     return state;
191
     return state;
170
 }
192
 }
193
+
194
+void oec01_load_pal_impl(u32 *oe_script) {
195
+    struct SpritePalette *pal = (struct SpritePalette *)oe_read_word(oe_script);
196
+    s8 allocated = npc_dynamic_find_palette(pal->tag);
197
+    if (allocated == -1)
198
+        allocated = npc_dynamic_allocate_palette(pal->tag);
199
+    if (allocated > 0) {
200
+        gpu_pal_apply(pal->data, 256 + (16 * allocated), 32);
201
+        tint_palette_switch(allocated);
202
+        palette_obj_807AA8C(allocated);
203
+    } else {
204
+        dprintf("ERROR: RAN OUT OF PALETTES FOR DYNAMIC SYSTEM\n");
205
+    }
206
+    *oe_script += 4;
207
+}
208
+
209
+void oec02_load_pal_impl(u32 *oe_script) {
210
+    struct SpritePalette *pal = (struct SpritePalette *)oe_read_word(oe_script);
211
+    s8 allocated = npc_dynamic_find_palette(pal->tag);
212
+    if (allocated == -1)
213
+        allocated = npc_dynamic_allocate_palette(pal->tag);
214
+    if (allocated > 0) {
215
+        gpu_pal_apply(pal->data, 256 + (16 * allocated), 32);
216
+        tint_palette_switch(allocated);
217
+    } else {
218
+        dprintf("ERROR: RAN OUT OF PALETTES FOR DYNAMIC SYSTEM\n");
219
+    }
220
+    *oe_script += 4;
221
+}
222
+
223
+void npc_delete_obj_and_free_tiles_for_npc_hack(struct NpcState *state) {
224
+    struct SpriteTiles tiles;
225
+    u16 npc_id = ((u16)state->type_id) | (((u16)state->field1A << 8));
226
+    struct NpcType *type = npc_get_type(npc_id);
227
+    tiles.size = type->field_6;
228
+    objects[state->oam_id].gfx_table = &tiles;
229
+    u8 pal_num = objects[state->oam_id].final_oam.palette_num;
230
+    obj_delete_and_free(&objects[state->oam_id]);
231
+    npc_dynamic_remove_entry(pal_num);
232
+    dprintf("deleted npc state at x: %d y: %d\n", state->to.x, state->to.y);
233
+}