├── .gitattributes ├── README.md ├── SubmapExamples ├── .gitignore ├── SubmapExamples.gbsproj ├── assets │ ├── avatars │ │ └── README.md │ ├── backgrounds │ │ ├── Intro_link_1.png │ │ ├── Pokemon_Battle.png │ │ ├── Pokemon_Battle_UI_1.png │ │ ├── README.md │ │ ├── pokemon_backs_1.png │ │ ├── pokemon_backs_2.png │ │ ├── pokemon_backs_3.png │ │ ├── pokemon_backs_4.png │ │ ├── pokemon_backs_5.png │ │ ├── pokemon_backs_6.png │ │ ├── pokemon_backs_7.png │ │ ├── pokemon_portaits_1.png │ │ ├── pokemon_portaits_2.png │ │ ├── pokemon_portaits_3.png │ │ ├── pokemon_portaits_4.png │ │ ├── pokemon_portaits_5.png │ │ ├── pokemon_portaits_6.png │ │ └── pokemon_portaits_7.png │ ├── emotes │ │ ├── README.md │ │ ├── anger.png │ │ ├── love.png │ │ ├── music.png │ │ ├── pause.png │ │ ├── question.png │ │ ├── shock.png │ │ ├── sleep.png │ │ └── sweat.png │ ├── fonts │ │ ├── README.md │ │ ├── gbs-mono.json │ │ ├── gbs-mono.png │ │ ├── gbs-var.json │ │ └── gbs-var.png │ ├── music │ │ ├── README.md │ │ └── template.mod │ ├── sounds │ │ └── README.md │ ├── sprites │ │ ├── README.md │ │ ├── actor.png │ │ ├── actor_animated.png │ │ ├── intro_tileset1.png │ │ └── static.png │ ├── tilesets │ │ ├── README.md │ │ └── pkm_battle_tileset.png │ └── ui │ │ ├── README.md │ │ ├── cursor.png │ │ └── frame.png ├── plugins │ ├── README.md │ └── SubmappingExPlugin │ │ ├── engine │ │ ├── engine.json │ │ └── src │ │ │ └── copy_scene_parts.c │ │ └── events │ │ ├── eventCopyBackgroundSubmapToOverlay.js │ │ ├── eventCopyBackgroundSubmapToOverlayBase.js │ │ ├── eventCopySceneSubmapToBkg.js │ │ ├── eventCopySceneSubmapToBkgBase.js │ │ ├── eventCopySceneSubmapToBkgTileset.js │ │ ├── eventReplaceBackgroundTile.js │ │ └── eventReplaceOverlayTile.js └── project │ ├── backgrounds │ ├── intro_link_1.gbsres │ ├── pokemon_backs_1.gbsres │ ├── pokemon_backs_2.gbsres │ ├── pokemon_backs_3.gbsres │ ├── pokemon_backs_4.gbsres │ ├── pokemon_backs_5.gbsres │ ├── pokemon_backs_6.gbsres │ ├── pokemon_backs_7.gbsres │ ├── pokemon_battle.gbsres │ ├── pokemon_battle_ui_1.gbsres │ ├── pokemon_portaits_1.gbsres │ ├── pokemon_portaits_2.gbsres │ ├── pokemon_portaits_3.gbsres │ ├── pokemon_portaits_4.gbsres │ ├── pokemon_portaits_5.gbsres │ ├── pokemon_portaits_6.gbsres │ └── pokemon_portaits_7.gbsres │ ├── emotes │ ├── anger.gbsres │ ├── love.gbsres │ ├── music.gbsres │ ├── pause.gbsres │ ├── question.gbsres │ ├── shock.gbsres │ ├── sleep.gbsres │ └── sweat.gbsres │ ├── engine_field_values.gbsres │ ├── fonts │ ├── gbs_mono.gbsres │ └── gbs_variable_width.gbsres │ ├── music │ └── template.gbsres │ ├── palettes │ ├── default_bg_1.gbsres │ ├── default_bg_2.gbsres │ ├── default_bg_3.gbsres │ ├── default_bg_4.gbsres │ ├── default_bg_5.gbsres │ ├── default_bg_6.gbsres │ ├── default_sprites.gbsres │ ├── default_ui.gbsres │ ├── link_bg_1.gbsres │ ├── link_bg_2.gbsres │ ├── link_bg_3.gbsres │ ├── pokemon_1.gbsres │ ├── pokemon_2.gbsres │ ├── pokemon_3.gbsres │ └── pokemon_bg_1.gbsres │ ├── scenes │ ├── background_submap_from_same_scene_example │ │ ├── actors │ │ │ └── linkface.gbsres │ │ └── scene.gbsres │ ├── background_submap_from_tileset_example │ │ └── scene.gbsres │ ├── pokemonback1 │ │ └── scene.gbsres │ ├── pokemonback2 │ │ └── scene.gbsres │ ├── pokemonback3 │ │ └── scene.gbsres │ ├── pokemonback4 │ │ └── scene.gbsres │ ├── pokemonback5 │ │ └── scene.gbsres │ ├── pokemonback6 │ │ └── scene.gbsres │ ├── pokemonback7 │ │ └── scene.gbsres │ ├── pokemonbattleui │ │ └── scene.gbsres │ ├── pokemonfront1 │ │ └── scene.gbsres │ ├── pokemonfront2 │ │ └── scene.gbsres │ ├── pokemonfront3 │ │ └── scene.gbsres │ ├── pokemonfront4 │ │ └── scene.gbsres │ ├── pokemonfront5 │ │ └── scene.gbsres │ ├── pokemonfront6 │ │ └── scene.gbsres │ └── pokemonfront7 │ │ └── scene.gbsres │ ├── scripts │ ├── updatebackpokemon.gbsres │ └── updatefrontpokemon.gbsres │ ├── settings.gbsres │ ├── sprites │ ├── actor.gbsres │ ├── actor_animated.gbsres │ ├── intro_tileset1.gbsres │ └── static.gbsres │ ├── tilesets │ └── pkm_battle_tileset.gbsres │ └── variables.gbsres ├── SubmappingExPlugin_v3 ├── engine │ ├── engine.json │ └── src │ │ └── copy_scene_parts.c └── events │ ├── eventCopyBackgroundSubmapToOverlayBaseLegacy.js │ ├── eventCopyBackgroundSubmapToOverlayLegacy.js │ ├── eventCopySceneSubmapToBkgBaseLegacy.js │ ├── eventCopySceneSubmapToBkgLegacy.js │ └── eventCopySceneSubmapToBkgTilesetLegacy.js └── SubmappingExPlugin_v4 ├── engine ├── engine.json └── src │ └── copy_scene_parts.c └── events ├── eventCopyBackgroundSubmapToOverlay.js ├── eventCopyBackgroundSubmapToOverlayBase.js ├── eventCopySceneSubmapToBkg.js ├── eventCopySceneSubmapToBkgBase.js ├── eventCopySceneSubmapToBkgTileset.js ├── eventReplaceBackgroundTile.js └── eventReplaceOverlayTile.js /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GBS-SubmappingExPlugin 2 | Plugin for partialy copying a scene to the overlay or background 3 | Also added events to set background/overlay tiles individualy 4 | 5 | if you are using GBS v4 use the v4 plugin version 6 | 7 | if you are using GBS v3 use the v3 plugin version (this one does not support variables in parameters) 8 | 9 | There's 2 version of the event. If you're using the common tileset between the scene you are copying from, use the "Copy scene submap to overlay" or "Copy scene submap to background" event, if you are not using a common tileset between the scenes, use the "Copy scene submap to overlay with tile offset" or "Copy scene submap to background with tile offset". 10 | 11 | The "Copy scene submap to background tileset" event allows you to do unique tile replacement, by copying the tileset of the scene submap and applying it to the current scene tileset. 12 | 13 | ![image](https://github.com/user-attachments/assets/7adaecd0-f37a-40b9-b71b-0aa801a8d27d) 14 | ![image](https://github.com/user-attachments/assets/7297cb88-d97f-4262-8f25-19c6415ce299) 15 | ![image](https://github.com/user-attachments/assets/44a44391-076f-4c3a-b16c-f67834599114) 16 | ![image](https://github.com/user-attachments/assets/fd79e9b2-e07c-4775-8fdc-fbdcdf4dda87) 17 | ![image](https://github.com/user-attachments/assets/328445ef-aa6b-41d9-b903-25fd635b7f6a) 18 | 19 | "Copy scene submap to background tileset" now has the option to specify the pointer/bank address of the scene for dynamic loading 20 | ![image](https://github.com/user-attachments/assets/0ce607ac-9a76-46fd-81e0-271803c04185) 21 | -------------------------------------------------------------------------------- /SubmapExamples/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | cache/ 3 | 4 | *.bak 5 | *.sav 6 | *.icloud 7 | 8 | user_settings.gbsres 9 | -------------------------------------------------------------------------------- /SubmapExamples/SubmapExamples.gbsproj: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "project", 3 | "name": "SubmapExamples", 4 | "author": "micka", 5 | "notes": "", 6 | "_version": "4.1.0", 7 | "_release": "1" 8 | } -------------------------------------------------------------------------------- /SubmapExamples/assets/avatars/README.md: -------------------------------------------------------------------------------- 1 | Place 16x16 .png files in this folder to use them as avatars in your dialogues 2 | 3 | Docs: https://www.gbstudio.dev/docs/assets/ui-elements#avatars 4 | -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/Intro_link_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/Intro_link_1.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/Pokemon_Battle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/Pokemon_Battle.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/Pokemon_Battle_UI_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/Pokemon_Battle_UI_1.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/README.md: -------------------------------------------------------------------------------- 1 | Place .png files in this folder to use them as backgrounds for your scenes 2 | 3 | Docs: https://www.gbstudio.dev/docs/assets/backgrounds 4 | -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_backs_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_backs_1.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_backs_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_backs_2.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_backs_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_backs_3.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_backs_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_backs_4.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_backs_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_backs_5.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_backs_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_backs_6.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_backs_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_backs_7.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_portaits_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_portaits_1.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_portaits_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_portaits_2.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_portaits_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_portaits_3.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_portaits_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_portaits_4.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_portaits_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_portaits_5.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_portaits_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_portaits_6.png -------------------------------------------------------------------------------- /SubmapExamples/assets/backgrounds/pokemon_portaits_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/backgrounds/pokemon_portaits_7.png -------------------------------------------------------------------------------- /SubmapExamples/assets/emotes/README.md: -------------------------------------------------------------------------------- 1 | Place 16x16 .png files in this folder to use them as emotes in your game 2 | 3 | Docs: https://www.gbstudio.dev/docs/assets/ui-elements#emotes 4 | -------------------------------------------------------------------------------- /SubmapExamples/assets/emotes/anger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/emotes/anger.png -------------------------------------------------------------------------------- /SubmapExamples/assets/emotes/love.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/emotes/love.png -------------------------------------------------------------------------------- /SubmapExamples/assets/emotes/music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/emotes/music.png -------------------------------------------------------------------------------- /SubmapExamples/assets/emotes/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/emotes/pause.png -------------------------------------------------------------------------------- /SubmapExamples/assets/emotes/question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/emotes/question.png -------------------------------------------------------------------------------- /SubmapExamples/assets/emotes/shock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/emotes/shock.png -------------------------------------------------------------------------------- /SubmapExamples/assets/emotes/sleep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/emotes/sleep.png -------------------------------------------------------------------------------- /SubmapExamples/assets/emotes/sweat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/emotes/sweat.png -------------------------------------------------------------------------------- /SubmapExamples/assets/fonts/README.md: -------------------------------------------------------------------------------- 1 | Place .png and .json mapping files in this folder to use them as fonts in your dialogues 2 | 3 | Docs: https://www.gbstudio.dev/docs/settings/#ui-elements--fonts 4 | -------------------------------------------------------------------------------- /SubmapExamples/assets/fonts/gbs-mono.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GBS Mono", 3 | "mapping": {} 4 | } 5 | -------------------------------------------------------------------------------- /SubmapExamples/assets/fonts/gbs-mono.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/fonts/gbs-mono.png -------------------------------------------------------------------------------- /SubmapExamples/assets/fonts/gbs-var.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GBS Variable Width", 3 | "mapping": {} 4 | } 5 | -------------------------------------------------------------------------------- /SubmapExamples/assets/fonts/gbs-var.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/fonts/gbs-var.png -------------------------------------------------------------------------------- /SubmapExamples/assets/music/README.md: -------------------------------------------------------------------------------- 1 | Place .uge and .mod files in this folder to use them as music in your game 2 | 3 | Docs: https://www.gbstudio.dev/docs/assets/music/ 4 | -------------------------------------------------------------------------------- /SubmapExamples/assets/music/template.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/music/template.mod -------------------------------------------------------------------------------- /SubmapExamples/assets/sounds/README.md: -------------------------------------------------------------------------------- 1 | Place .wav, .sav or .vgm files in this folder to use them as sound effects in your game 2 | 3 | Docs: https://www.gbstudio.dev/docs/assets/sound-effects 4 | -------------------------------------------------------------------------------- /SubmapExamples/assets/sprites/README.md: -------------------------------------------------------------------------------- 1 | Place .png files in this folder to use them as sprites for your game's actors 2 | 3 | Docs: https://www.gbstudio.dev/docs/assets/sprites 4 | -------------------------------------------------------------------------------- /SubmapExamples/assets/sprites/actor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/sprites/actor.png -------------------------------------------------------------------------------- /SubmapExamples/assets/sprites/actor_animated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/sprites/actor_animated.png -------------------------------------------------------------------------------- /SubmapExamples/assets/sprites/intro_tileset1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/sprites/intro_tileset1.png -------------------------------------------------------------------------------- /SubmapExamples/assets/sprites/static.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/sprites/static.png -------------------------------------------------------------------------------- /SubmapExamples/assets/tilesets/README.md: -------------------------------------------------------------------------------- 1 | Place .png files in this folder to use them as tilesets for your game 2 | 3 | Docs: https://www.gbstudio.dev/docs/assets/tilesets 4 | -------------------------------------------------------------------------------- /SubmapExamples/assets/tilesets/pkm_battle_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/tilesets/pkm_battle_tileset.png -------------------------------------------------------------------------------- /SubmapExamples/assets/ui/README.md: -------------------------------------------------------------------------------- 1 | Place .png files in this folder to use them as UI elements of your game 2 | 3 | Docs: https://www.gbstudio.dev/docs/assets/ui-elements 4 | -------------------------------------------------------------------------------- /SubmapExamples/assets/ui/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/ui/cursor.png -------------------------------------------------------------------------------- /SubmapExamples/assets/ui/frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mico27/GBS-SubmappingExPlugin/aaddf9c1e89aa85df4a49edb8d5a4c61bd10a49e/SubmapExamples/assets/ui/frame.png -------------------------------------------------------------------------------- /SubmapExamples/plugins/README.md: -------------------------------------------------------------------------------- 1 | Place plugin folders in this folder to extend the capabilities of your game 2 | 3 | Docs: https://www.gbstudio.dev/docs/extending-gbstudio/plugins 4 | -------------------------------------------------------------------------------- /SubmapExamples/plugins/SubmappingExPlugin/engine/engine.json: -------------------------------------------------------------------------------- 1 | {"version": "4.0.0-e0"} -------------------------------------------------------------------------------- /SubmapExamples/plugins/SubmappingExPlugin/engine/src/copy_scene_parts.c: -------------------------------------------------------------------------------- 1 | #pragma bank 255 2 | 3 | #include 4 | #include "system.h" 5 | #include "vm.h" 6 | #include "gbs_types.h" 7 | #include "scroll.h" 8 | #include "bankdata.h" 9 | #include "data_manager.h" 10 | 11 | UBYTE tmp_tile_buffer[32]; 12 | 13 | void set_xy_win_submap(const UBYTE * source, UBYTE bank, UBYTE width, UBYTE x, UBYTE y, UBYTE w, UBYTE h) OLDCALL; 14 | 15 | void copy_background_submap_to_overlay(SCRIPT_CTX * THIS) OLDCALL BANKED { 16 | 17 | uint8_t source_x = *(int8_t*)VM_REF_TO_PTR(FN_ARG0); 18 | uint8_t source_y = *(int8_t*)VM_REF_TO_PTR(FN_ARG1); 19 | uint8_t dest_x = *(int8_t*)VM_REF_TO_PTR(FN_ARG2); 20 | uint8_t dest_y = *(int8_t*)VM_REF_TO_PTR(FN_ARG3); 21 | uint8_t width = *(int8_t*)VM_REF_TO_PTR(FN_ARG4); 22 | uint8_t height = *(int8_t*)VM_REF_TO_PTR(FN_ARG5); 23 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG6); 24 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG7); 25 | scene_t scn; 26 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 27 | background_t bkg; 28 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 29 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 30 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 31 | int16_t offset = (source_y * (int16_t)bkg.width) + source_x; 32 | #ifdef CGB 33 | if (_is_CGB) { 34 | VBK_REG = 1; 35 | set_xy_win_submap(tilemap_attr_ptr + offset, bkg.cgb_tilemap_attr.bank, bkg.width, dest_x, dest_y, width, height); 36 | VBK_REG = 0; 37 | } 38 | #endif 39 | set_xy_win_submap(tilemap_ptr + offset, bkg.tilemap.bank, bkg.width, dest_x, dest_y, width, height); 40 | 41 | } 42 | 43 | void copy_background_submap_to_overlay_base(SCRIPT_CTX * THIS) OLDCALL BANKED { 44 | int16_t bkg_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG0); 45 | int16_t dest_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG1); 46 | int16_t wh = *(int16_t*)VM_REF_TO_PTR(FN_ARG2); 47 | uint8_t tile_idx_offset = *(int8_t*)VM_REF_TO_PTR(FN_ARG3); 48 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG4); 49 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG5); 50 | 51 | UBYTE source_x = bkg_pos & 0xFF; 52 | UBYTE source_y = (bkg_pos >> 8) & 0xFF; 53 | UBYTE dest_x = dest_pos & 0xFF; 54 | UBYTE dest_y = (dest_pos >> 8) & 0xFF; 55 | UBYTE width = (wh & 0xFF) & 31; 56 | UBYTE height = ((wh >> 8) & 0xFF) & 31; 57 | 58 | scene_t scn; 59 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 60 | background_t bkg; 61 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 62 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 63 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 64 | 65 | UBYTE buffer_size = sizeof(UBYTE) * width; 66 | for (uint8_t i = 0; i < height; i++){ 67 | int16_t offset = ((source_y + i) * (int16_t)bkg.width) + source_x; 68 | #ifdef CGB 69 | if (_is_CGB) { 70 | VBK_REG = 1; 71 | MemcpyBanked(tmp_tile_buffer, tilemap_attr_ptr + offset, buffer_size, bkg.cgb_tilemap_attr.bank); 72 | set_win_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer); 73 | VBK_REG = 0; 74 | } 75 | #endif 76 | MemcpyBanked(tmp_tile_buffer, tilemap_ptr + offset, buffer_size, bkg.tilemap.bank); 77 | set_win_based_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer, tile_idx_offset); 78 | } 79 | } 80 | 81 | 82 | void copy_background_submap_to_background(SCRIPT_CTX * THIS) OLDCALL BANKED { 83 | 84 | uint8_t source_x = *(int8_t*)VM_REF_TO_PTR(FN_ARG0); 85 | uint8_t source_y = *(int8_t*)VM_REF_TO_PTR(FN_ARG1); 86 | uint8_t dest_x = *(int8_t*)VM_REF_TO_PTR(FN_ARG2); 87 | uint8_t dest_y = *(int8_t*)VM_REF_TO_PTR(FN_ARG3); 88 | uint8_t width = *(int8_t*)VM_REF_TO_PTR(FN_ARG4) & 31; 89 | uint8_t height = *(int8_t*)VM_REF_TO_PTR(FN_ARG5) & 31; 90 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG6); 91 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG7); 92 | scene_t scn; 93 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 94 | background_t bkg; 95 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 96 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 97 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 98 | 99 | UBYTE buffer_size = sizeof(UBYTE) * width; 100 | for (uint8_t i = 0; i < height; i++){ 101 | int16_t offset = ((source_y + i) * (int16_t)bkg.width) + source_x; 102 | #ifdef CGB 103 | if (_is_CGB) { 104 | VBK_REG = 1; 105 | MemcpyBanked(tmp_tile_buffer, tilemap_attr_ptr + offset, buffer_size, bkg.cgb_tilemap_attr.bank); 106 | set_bkg_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer); 107 | VBK_REG = 0; 108 | } 109 | #endif 110 | MemcpyBanked(tmp_tile_buffer, tilemap_ptr + offset, buffer_size, bkg.tilemap.bank); 111 | set_bkg_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer); 112 | } 113 | 114 | } 115 | 116 | void copy_background_submap_to_background_base(SCRIPT_CTX * THIS) OLDCALL BANKED { 117 | int16_t bkg_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG0); 118 | int16_t dest_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG1); 119 | int16_t wh = *(int16_t*)VM_REF_TO_PTR(FN_ARG2); 120 | uint8_t tile_idx_offset = *(int8_t*)VM_REF_TO_PTR(FN_ARG3); 121 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG4); 122 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG5); 123 | 124 | UBYTE source_x = bkg_pos & 0xFF; 125 | UBYTE source_y = (bkg_pos >> 8) & 0xFF; 126 | UBYTE dest_x = dest_pos & 0xFF; 127 | UBYTE dest_y = (dest_pos >> 8) & 0xFF; 128 | UBYTE width = (wh & 0xFF) & 31; 129 | UBYTE height = ((wh >> 8) & 0xFF) & 31; 130 | 131 | scene_t scn; 132 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 133 | background_t bkg; 134 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 135 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 136 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 137 | 138 | UBYTE buffer_size = sizeof(UBYTE) * width; 139 | 140 | for (uint8_t i = 0; i < height; i++){ 141 | int16_t offset = ((source_y + i) * (int16_t)bkg.width) + source_x; 142 | #ifdef CGB 143 | if (_is_CGB) { 144 | VBK_REG = 1; 145 | MemcpyBanked(tmp_tile_buffer, tilemap_attr_ptr + offset, buffer_size, bkg.cgb_tilemap_attr.bank); 146 | set_bkg_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer); 147 | VBK_REG = 0; 148 | } 149 | #endif 150 | MemcpyBanked(tmp_tile_buffer, tilemap_ptr + offset, buffer_size, bkg.tilemap.bank); 151 | set_bkg_based_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer, tile_idx_offset); 152 | } 153 | } 154 | 155 | void copy_background_submap_to_tileset(SCRIPT_CTX * THIS) OLDCALL BANKED { 156 | int16_t source_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG0); 157 | int16_t dest_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG1); 158 | int16_t wh = *(int16_t*)VM_REF_TO_PTR(FN_ARG2); 159 | int16_t overlay_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG3); 160 | uint8_t copy_attributes = *(int8_t*)VM_REF_TO_PTR(FN_ARG4); 161 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG5); 162 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG6); 163 | 164 | UBYTE source_x = source_pos & 0xFF; 165 | UBYTE source_y = (source_pos >> 8) & 0xFF; 166 | UBYTE dest_x = dest_pos & 0xFF; 167 | UBYTE dest_y = (dest_pos >> 8) & 0xFF; 168 | UBYTE width = (wh & 0xFF) & 31; 169 | UBYTE height = ((wh >> 8) & 0xFF) & 31; 170 | UBYTE overlay_x = overlay_pos & 0xFF; 171 | UBYTE overlay_y = (overlay_pos >> 8) & 0xFF; 172 | 173 | scene_t scn; 174 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 175 | background_t bkg; 176 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 177 | const tileset_t* tileset = bkg.tileset.ptr; 178 | UWORD n_tiles = ReadBankedUWORD(&(tileset->n_tiles), bkg.tileset.bank); 179 | UBYTE ui_reserved_offset = (n_tiles > 128 && n_tiles < 192)? (192 - n_tiles): 0; 180 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 181 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 182 | 183 | const tileset_t* cgb_tileset = bkg.cgb_tileset.ptr; 184 | 185 | UBYTE buffer_size = sizeof(UBYTE) * width; 186 | for (uint8_t i = 0; i < height; i++){ 187 | uint16_t source_offset = ((source_y + i) * (uint16_t)bkg.width) + source_x; 188 | uint16_t dest_offset = ((dest_y + i) * (uint16_t)image_tile_width) + dest_x; 189 | for (uint8_t j = 0; j < width; j++){ 190 | UBYTE dest_tile = ReadBankedUBYTE(image_ptr + (uint16_t)(dest_offset + j), image_bank); 191 | UBYTE source_tile = ReadBankedUBYTE(tilemap_ptr + (uint16_t)(source_offset + j), bkg.tilemap.bank); 192 | if (ui_reserved_offset && source_tile >= 128){ 193 | source_tile = source_tile - ui_reserved_offset; 194 | } 195 | #ifdef CGB 196 | if (_is_CGB) { 197 | 198 | UBYTE dest_attr = ReadBankedUBYTE(image_attr_ptr + (uint16_t)(dest_offset + j), image_attr_bank); 199 | UBYTE source_attr = ReadBankedUBYTE(tilemap_attr_ptr + (uint16_t)(source_offset + j), bkg.cgb_tilemap_attr.bank); 200 | if (copy_attributes){ 201 | VBK_REG = 1; 202 | if (copy_attributes == 1){ 203 | set_bkg_tile_xy((dest_x + j) & 31, (dest_y + i) & 31, (dest_attr & 0x08)? (source_attr | 0x08): (source_attr & ~0x08)); 204 | } else if (copy_attributes == 2){ 205 | set_win_tile_xy((overlay_x + j) & 31, (overlay_y + i) & 31, (dest_attr & 0x08)? (source_attr | 0x08): (source_attr & ~0x08)); 206 | } 207 | VBK_REG = 0; 208 | } 209 | if (dest_attr & 0x08){ 210 | VBK_REG = 1; 211 | } 212 | if (cgb_tileset && (source_attr & 0x08)){ 213 | SetBankedBkgData(dest_tile, 1, cgb_tileset->tiles + (uint16_t)(source_tile << 4), bkg.cgb_tileset.bank); 214 | } else { 215 | SetBankedBkgData(dest_tile, 1, tileset->tiles + (uint16_t)(source_tile << 4), bkg.tileset.bank); 216 | } 217 | VBK_REG = 0; 218 | } else { 219 | SetBankedBkgData(dest_tile, 1, tileset->tiles + (uint16_t)(source_tile << 4), bkg.tileset.bank); 220 | } 221 | #else 222 | SetBankedBkgData(dest_tile, 1, tileset->tiles + (uint16_t)(source_tile << 4), bkg.tileset.bank); 223 | #endif 224 | } 225 | } 226 | } 227 | 228 | void vm_replace_background_tile(SCRIPT_CTX * THIS) OLDCALL BANKED { 229 | set_bkg_tile_xy(((*(uint8_t *) VM_REF_TO_PTR(FN_ARG0)) & 31), ((*(uint8_t *) VM_REF_TO_PTR(FN_ARG1)) & 31), (*(uint8_t *) VM_REF_TO_PTR(FN_ARG2))); 230 | } 231 | 232 | void vm_replace_overlay_tile(SCRIPT_CTX * THIS) OLDCALL BANKED { 233 | set_win_tile_xy(((*(uint8_t *) VM_REF_TO_PTR(FN_ARG0)) & 31), ((*(uint8_t *) VM_REF_TO_PTR(FN_ARG1)) & 31), (*(uint8_t *) VM_REF_TO_PTR(FN_ARG2))); 234 | } -------------------------------------------------------------------------------- /SubmapExamples/plugins/SubmappingExPlugin/events/eventCopyBackgroundSubmapToOverlay.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_WIN"; 2 | export const name = "Copy scene submap to overlay"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to overlay`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `bkg_x`, 19 | label: "Background X", 20 | type: "value", 21 | width: "50%", 22 | defaultValue: { 23 | type: "number", 24 | value: 0, 25 | }, 26 | }, 27 | { 28 | key: `bkg_y`, 29 | label: "Background Y", 30 | type: "value", 31 | width: "50%", 32 | defaultValue: { 33 | type: "number", 34 | value: 0, 35 | }, 36 | }, 37 | { 38 | key: `win_x`, 39 | label: "Overlay X", 40 | type: "value", 41 | width: "50%", 42 | defaultValue: { 43 | type: "number", 44 | value: 0, 45 | }, 46 | }, 47 | { 48 | key: `win_y`, 49 | label: "Overlay Y", 50 | type: "value", 51 | width: "50%", 52 | defaultValue: { 53 | type: "number", 54 | value: 0, 55 | }, 56 | }, 57 | { 58 | key: "w", 59 | label: "width", 60 | description: "width", 61 | type: "value", 62 | width: "50%", 63 | defaultValue: { 64 | type: "number", 65 | value: 0, 66 | }, 67 | }, 68 | { 69 | key: "h", 70 | label: "height", 71 | description: "height", 72 | type: "value", 73 | width: "50%", 74 | defaultValue: { 75 | type: "number", 76 | value: 0, 77 | }, 78 | }, 79 | ]; 80 | 81 | export const compile = (input, helpers) => { 82 | const { options, _callNative, _stackPushConst, _stackPush, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 83 | 84 | const { scenes } = options; 85 | const scene = scenes.find((s) => s.id === input.sceneId); 86 | if (!scene) { 87 | return; 88 | } 89 | 90 | const tmp0 = _declareLocal("tmp_bkg_x", 1, true); 91 | const tmp1 = _declareLocal("tmp_bkg_y", 1, true); 92 | const tmp2 = _declareLocal("tmp_win_x", 1, true); 93 | const tmp3 = _declareLocal("tmp_win_y", 1, true); 94 | const tmp4 = _declareLocal("tmp_w", 1, true); 95 | const tmp5 = _declareLocal("tmp_h", 1, true); 96 | 97 | variableSetToScriptValue(tmp0, input.bkg_x); 98 | variableSetToScriptValue(tmp1, input.bkg_y); 99 | variableSetToScriptValue(tmp2, input.win_x); 100 | variableSetToScriptValue(tmp3, input.win_y); 101 | variableSetToScriptValue(tmp4, input.w); 102 | variableSetToScriptValue(tmp5, input.h); 103 | 104 | 105 | _addComment("Copy scene submap to overlay"); 106 | 107 | _stackPushConst(`_${scene.symbol}`); 108 | _stackPushConst(`___bank_${scene.symbol}`); 109 | _stackPush(tmp5); 110 | _stackPush(tmp4); 111 | _stackPush(tmp3); 112 | _stackPush(tmp2); 113 | _stackPush(tmp1); 114 | _stackPush(tmp0); 115 | 116 | _callNative("copy_background_submap_to_overlay"); 117 | _stackPop(8); 118 | 119 | }; 120 | -------------------------------------------------------------------------------- /SubmapExamples/plugins/SubmappingExPlugin/events/eventCopyBackgroundSubmapToOverlayBase.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_WIN_BASE"; 2 | export const name = "Copy scene submap to overlay with tile offset"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to overlay with tile offset`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `bkg_x`, 19 | label: "Background X", 20 | type: "value", 21 | width: "50%", 22 | defaultValue: { 23 | type: "number", 24 | value: 0, 25 | }, 26 | }, 27 | { 28 | key: `bkg_y`, 29 | label: "Background Y", 30 | type: "value", 31 | width: "50%", 32 | defaultValue: { 33 | type: "number", 34 | value: 0, 35 | }, 36 | }, 37 | { 38 | key: `win_x`, 39 | label: "Overlay X", 40 | type: "value", 41 | width: "50%", 42 | defaultValue: { 43 | type: "number", 44 | value: 0, 45 | }, 46 | }, 47 | { 48 | key: `win_y`, 49 | label: "Overlay Y", 50 | type: "value", 51 | width: "50%", 52 | defaultValue: { 53 | type: "number", 54 | value: 0, 55 | }, 56 | }, 57 | { 58 | key: "w", 59 | label: "width", 60 | description: "width", 61 | type: "value", 62 | width: "50%", 63 | defaultValue: { 64 | type: "number", 65 | value: 0, 66 | }, 67 | }, 68 | { 69 | key: "h", 70 | label: "height", 71 | description: "height", 72 | type: "value", 73 | width: "50%", 74 | defaultValue: { 75 | type: "number", 76 | value: 0, 77 | }, 78 | }, 79 | { 80 | key: "tile_offset", 81 | label: "tile idx offset", 82 | description: "height", 83 | type: "value", 84 | width: "100%", 85 | defaultValue: { 86 | type: "number", 87 | value: 0, 88 | }, 89 | }, 90 | ]; 91 | 92 | export const compile = (input, helpers) => { 93 | const { options, _callNative, _rpn, _stackPushConst, _stackPush, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 94 | 95 | const { scenes } = options; 96 | const scene = scenes.find((s) => s.id === input.sceneId); 97 | if (!scene) { 98 | return; 99 | } 100 | 101 | const tmp0 = _declareLocal("tmp_bkg_x", 1, true); 102 | const tmp1 = _declareLocal("tmp_bkg_y", 1, true); 103 | const tmp2 = _declareLocal("tmp_win_x", 1, true); 104 | const tmp3 = _declareLocal("tmp_win_y", 1, true); 105 | const tmp4 = _declareLocal("tmp_w", 1, true); 106 | const tmp5 = _declareLocal("tmp_h", 1, true); 107 | const tmp6 = _declareLocal("tmp_tile_offset", 1, true); 108 | 109 | variableSetToScriptValue(tmp0, input.bkg_x); 110 | variableSetToScriptValue(tmp1, input.bkg_y); 111 | variableSetToScriptValue(tmp2, input.win_x); 112 | variableSetToScriptValue(tmp3, input.win_y); 113 | variableSetToScriptValue(tmp4, input.w); 114 | variableSetToScriptValue(tmp5, input.h); 115 | variableSetToScriptValue(tmp6, input.tile_offset); 116 | 117 | 118 | _addComment("Copy scene submap to overlay with tile offset"); 119 | 120 | _rpn() 121 | .ref(tmp1).int16(256).operator(".MUL") // (bkg_y << 8) | bkg_x 122 | .ref(tmp0) 123 | .operator(".B_OR") 124 | .refSet(tmp0) 125 | .ref(tmp3).int16(256).operator(".MUL") // (win_y << 8) | win_x 126 | .ref(tmp2) 127 | .operator(".B_OR") 128 | .refSet(tmp1) 129 | .ref(tmp5).int16(256).operator(".MUL") // (h << 8) | w 130 | .ref(tmp4) 131 | .operator(".B_OR") 132 | .refSet(tmp2) 133 | .stop(); 134 | 135 | _stackPushConst(`_${scene.symbol}`); 136 | _stackPushConst(`___bank_${scene.symbol}`); 137 | _stackPush(tmp6); 138 | _stackPush(tmp2); 139 | _stackPush(tmp1); 140 | _stackPush(tmp0); 141 | 142 | _callNative("copy_background_submap_to_overlay_base"); 143 | _stackPop(6); 144 | 145 | }; 146 | -------------------------------------------------------------------------------- /SubmapExamples/plugins/SubmappingExPlugin/events/eventCopySceneSubmapToBkg.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_BKG"; 2 | export const name = "Copy scene submap to background"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to background`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `source_x`, 19 | label: "Source X", 20 | type: "value", 21 | width: "50%", 22 | defaultValue: { 23 | type: "number", 24 | value: 0, 25 | }, 26 | }, 27 | { 28 | key: `source_y`, 29 | label: "Source Y", 30 | type: "value", 31 | width: "50%", 32 | defaultValue: { 33 | type: "number", 34 | value: 0, 35 | }, 36 | }, 37 | { 38 | key: `dest_x`, 39 | label: "Destination X", 40 | type: "value", 41 | width: "50%", 42 | defaultValue: { 43 | type: "number", 44 | value: 0, 45 | }, 46 | }, 47 | { 48 | key: `dest_y`, 49 | label: "Destination Y", 50 | type: "value", 51 | width: "50%", 52 | defaultValue: { 53 | type: "number", 54 | value: 0, 55 | }, 56 | }, 57 | { 58 | key: "w", 59 | label: "width", 60 | description: "width", 61 | type: "value", 62 | width: "50%", 63 | defaultValue: { 64 | type: "number", 65 | value: 0, 66 | }, 67 | }, 68 | { 69 | key: "h", 70 | label: "height", 71 | description: "height", 72 | type: "value", 73 | width: "50%", 74 | defaultValue: { 75 | type: "number", 76 | value: 0, 77 | }, 78 | }, 79 | ]; 80 | 81 | export const compile = (input, helpers) => { 82 | const { options, _callNative, _stackPushConst, _stackPush, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 83 | 84 | const { scenes } = options; 85 | const scene = scenes.find((s) => s.id === input.sceneId); 86 | if (!scene) { 87 | return; 88 | } 89 | 90 | const tmp0 = _declareLocal("tmp_source_x", 1, true); 91 | const tmp1 = _declareLocal("tmp_source_y", 1, true); 92 | const tmp2 = _declareLocal("tmp_dest_x", 1, true); 93 | const tmp3 = _declareLocal("tmp_dest_y", 1, true); 94 | const tmp4 = _declareLocal("tmp_w", 1, true); 95 | const tmp5 = _declareLocal("tmp_h", 1, true); 96 | 97 | variableSetToScriptValue(tmp0, input.source_x); 98 | variableSetToScriptValue(tmp1, input.source_y); 99 | variableSetToScriptValue(tmp2, input.dest_x); 100 | variableSetToScriptValue(tmp3, input.dest_y); 101 | variableSetToScriptValue(tmp4, input.w); 102 | variableSetToScriptValue(tmp5, input.h); 103 | 104 | _addComment("Copy scene submap to background"); 105 | 106 | _stackPushConst(`_${scene.symbol}`); 107 | _stackPushConst(`___bank_${scene.symbol}`); 108 | _stackPush(tmp5); 109 | _stackPush(tmp4); 110 | _stackPush(tmp3); 111 | _stackPush(tmp2); 112 | _stackPush(tmp1); 113 | _stackPush(tmp0); 114 | 115 | _callNative("copy_background_submap_to_background"); 116 | _stackPop(8); 117 | 118 | }; 119 | -------------------------------------------------------------------------------- /SubmapExamples/plugins/SubmappingExPlugin/events/eventCopySceneSubmapToBkgBase.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_BKG_BASE"; 2 | export const name = "Copy scene submap to background with tile offset"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to background with tile offset`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `source_x`, 19 | label: "Source X", 20 | type: "value", 21 | width: "50%", 22 | defaultValue: { 23 | type: "number", 24 | value: 0, 25 | }, 26 | }, 27 | { 28 | key: `source_y`, 29 | label: "Source Y", 30 | type: "value", 31 | width: "50%", 32 | defaultValue: { 33 | type: "number", 34 | value: 0, 35 | }, 36 | }, 37 | { 38 | key: `dest_x`, 39 | label: "Destination X", 40 | type: "value", 41 | width: "50%", 42 | defaultValue: { 43 | type: "number", 44 | value: 0, 45 | }, 46 | }, 47 | { 48 | key: `dest_y`, 49 | label: "Destination Y", 50 | type: "value", 51 | width: "50%", 52 | defaultValue: { 53 | type: "number", 54 | value: 0, 55 | }, 56 | }, 57 | { 58 | key: "w", 59 | label: "width", 60 | description: "width", 61 | type: "value", 62 | width: "50%", 63 | defaultValue: { 64 | type: "number", 65 | value: 0, 66 | }, 67 | }, 68 | { 69 | key: "h", 70 | label: "height", 71 | description: "height", 72 | type: "value", 73 | width: "50%", 74 | defaultValue: { 75 | type: "number", 76 | value: 0, 77 | }, 78 | }, 79 | { 80 | key: "tile_offset", 81 | label: "tile idx offset", 82 | description: "height", 83 | type: "value", 84 | width: "100%", 85 | defaultValue: { 86 | type: "number", 87 | value: 0, 88 | }, 89 | }, 90 | ]; 91 | 92 | export const compile = (input, helpers) => { 93 | const { options, _callNative, _rpn, _stackPushConst, _stackPush, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 94 | 95 | const { scenes } = options; 96 | const scene = scenes.find((s) => s.id === input.sceneId); 97 | if (!scene) { 98 | return; 99 | } 100 | 101 | const tmp0 = _declareLocal("tmp_source_x", 1, true); 102 | const tmp1 = _declareLocal("tmp_source_y", 1, true); 103 | const tmp2 = _declareLocal("tmp_dest_x", 1, true); 104 | const tmp3 = _declareLocal("tmp_dest_y", 1, true); 105 | const tmp4 = _declareLocal("tmp_w", 1, true); 106 | const tmp5 = _declareLocal("tmp_h", 1, true); 107 | const tmp6 = _declareLocal("tmp_tile_offset", 1, true); 108 | 109 | variableSetToScriptValue(tmp0, input.source_x); 110 | variableSetToScriptValue(tmp1, input.source_y); 111 | variableSetToScriptValue(tmp2, input.dest_x); 112 | variableSetToScriptValue(tmp3, input.dest_y); 113 | variableSetToScriptValue(tmp4, input.w); 114 | variableSetToScriptValue(tmp5, input.h); 115 | variableSetToScriptValue(tmp6, input.tile_offset); 116 | 117 | 118 | _addComment("Copy scene submap to background with tile offset"); 119 | 120 | _rpn() 121 | .ref(tmp1).int16(256).operator(".MUL") // (source_y << 8) | source_x 122 | .ref(tmp0) 123 | .operator(".B_OR") 124 | .refSet(tmp0) 125 | .ref(tmp3).int16(256).operator(".MUL") // (dest_y << 8) | dest_x 126 | .ref(tmp2) 127 | .operator(".B_OR") 128 | .refSet(tmp1) 129 | .ref(tmp5).int16(256).operator(".MUL") // (h << 8) | w 130 | .ref(tmp4) 131 | .operator(".B_OR") 132 | .refSet(tmp2) 133 | .stop(); 134 | 135 | _stackPushConst(`_${scene.symbol}`); 136 | _stackPushConst(`___bank_${scene.symbol}`); 137 | _stackPush(tmp6); 138 | _stackPush(tmp2); 139 | _stackPush(tmp1); 140 | _stackPush(tmp0); 141 | 142 | _callNative("copy_background_submap_to_background_base"); 143 | _stackPop(6); 144 | 145 | }; 146 | -------------------------------------------------------------------------------- /SubmapExamples/plugins/SubmappingExPlugin/events/eventCopySceneSubmapToBkgTileset.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_BKG_TILESET"; 2 | export const name = "Copy scene submap to background tileset"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to background tileset`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | type: "group", 12 | fields: [ 13 | { 14 | key: "sceneId", 15 | label: "Scene", 16 | type: "scene", 17 | width: "100%", 18 | defaultValue: "LAST_SCENE", 19 | conditions: [ 20 | { 21 | key: "use_far_ptr", 22 | ne: true 23 | }, 24 | ], 25 | }, 26 | { 27 | key: `scene_bank`, 28 | label: "Scene bank", 29 | type: "value", 30 | width: "50%", 31 | defaultValue: { 32 | type: "number", 33 | value: 0, 34 | }, 35 | conditions: [ 36 | { 37 | key: "use_far_ptr", 38 | eq: true 39 | }, 40 | ], 41 | }, 42 | { 43 | key: `scene_ptr`, 44 | label: "Scene Pointer", 45 | type: "value", 46 | width: "50%", 47 | defaultValue: { 48 | type: "number", 49 | value: 0, 50 | }, 51 | conditions: [ 52 | { 53 | key: "use_far_ptr", 54 | eq: true 55 | }, 56 | ], 57 | }, 58 | { 59 | key: "use_far_ptr", 60 | label: "Use scene's far ptr", 61 | type: "checkbox", 62 | width: "50%", 63 | }, 64 | ] 65 | }, 66 | { 67 | type: "group", 68 | fields: [ 69 | { 70 | key: `source_x`, 71 | label: "Source X", 72 | type: "value", 73 | defaultValue: { 74 | type: "number", 75 | value: 0, 76 | }, 77 | }, 78 | { 79 | key: `source_y`, 80 | label: "Source Y", 81 | type: "value", 82 | defaultValue: { 83 | type: "number", 84 | value: 0, 85 | }, 86 | }, 87 | ] 88 | }, 89 | { 90 | type: "group", 91 | fields: [ 92 | { 93 | key: `dest_x`, 94 | label: "Destination X", 95 | type: "value", 96 | width: "50%", 97 | defaultValue: { 98 | type: "number", 99 | value: 0, 100 | }, 101 | }, 102 | { 103 | key: `dest_y`, 104 | label: "Destination Y", 105 | type: "value", 106 | width: "50%", 107 | defaultValue: { 108 | type: "number", 109 | value: 0, 110 | }, 111 | }, 112 | ] 113 | }, 114 | { 115 | type: "group", 116 | fields: [ 117 | { 118 | key: "w", 119 | label: "width", 120 | description: "width", 121 | type: "value", 122 | width: "50%", 123 | defaultValue: { 124 | type: "number", 125 | value: 0, 126 | }, 127 | }, 128 | { 129 | key: "h", 130 | label: "height", 131 | description: "height", 132 | type: "value", 133 | width: "50%", 134 | defaultValue: { 135 | type: "number", 136 | value: 0, 137 | }, 138 | }, 139 | ] 140 | }, 141 | { 142 | label: "copy tile attributes to", 143 | key: "copy_attr", 144 | type: "select", 145 | width: "100%", 146 | options: [ 147 | ["none", "None"], 148 | ["background", "Background"], 149 | ["overlay", "Overlay"], 150 | ], 151 | defaultValue: "none", 152 | alignBottom: true, 153 | }, 154 | { 155 | type: "group", 156 | fields: [ 157 | { 158 | key: `overlay_x`, 159 | label: "Overlay X", 160 | type: "value", 161 | width: "50%", 162 | defaultValue: { 163 | type: "number", 164 | value: 0, 165 | }, 166 | conditions: [ 167 | { 168 | key: "copy_attr", 169 | eq: "overlay", 170 | }, 171 | ], 172 | }, 173 | { 174 | key: `overlay_y`, 175 | label: "Overlay Y", 176 | type: "value", 177 | width: "50%", 178 | defaultValue: { 179 | type: "number", 180 | value: 0, 181 | }, 182 | conditions: [ 183 | { 184 | key: "copy_attr", 185 | eq: "overlay", 186 | }, 187 | ], 188 | }, 189 | ] 190 | }, 191 | ]; 192 | 193 | export const compile = (input, helpers) => { 194 | const { options, _callNative, _stackPushConst, _rpn, _stackPush, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 195 | 196 | const tmp0 = _declareLocal("tmp0", 1, true); 197 | const tmp1 = _declareLocal("tmp1", 1, true); 198 | const tmp2 = _declareLocal("tmp2", 1, true); 199 | const tmp3 = _declareLocal("tmp3", 1, true); 200 | const tmp4 = _declareLocal("tmp4", 1, true); 201 | const tmp5 = _declareLocal("tmp5", 1, true); 202 | 203 | 204 | _addComment("Copy scene submap to background tileset"); 205 | 206 | variableSetToScriptValue(tmp0, input.source_x); 207 | variableSetToScriptValue(tmp1, input.source_y); 208 | _rpn() 209 | .ref(tmp1).int16(256).operator(".MUL") // (source_y << 8) | source_x 210 | .ref(tmp0) 211 | .operator(".B_OR") 212 | .refSet(tmp0) 213 | .stop(); 214 | 215 | 216 | 217 | 218 | variableSetToScriptValue(tmp1, input.dest_x); 219 | variableSetToScriptValue(tmp2, input.dest_y); 220 | 221 | _rpn() 222 | .ref(tmp2).int16(256).operator(".MUL") // (dest_y << 8) | dest_x 223 | .ref(tmp1) 224 | .operator(".B_OR") 225 | .refSet(tmp1) 226 | .stop(); 227 | 228 | variableSetToScriptValue(tmp2, input.w); 229 | variableSetToScriptValue(tmp3, input.h); 230 | 231 | _rpn() 232 | .ref(tmp3).int16(256).operator(".MUL") // (h << 8) | w 233 | .ref(tmp2) 234 | .operator(".B_OR") 235 | .refSet(tmp2) 236 | .stop(); 237 | 238 | if (input.copy_attr === "overlay"){ 239 | variableSetToScriptValue(tmp3, input.overlay_x); 240 | variableSetToScriptValue(tmp4, input.overlay_y); 241 | 242 | _rpn() 243 | .ref(tmp4).int16(256).operator(".MUL") // (overlay_y << 8) | overlay_x 244 | .ref(tmp3) 245 | .operator(".B_OR") 246 | .refSet(tmp3) 247 | .stop(); 248 | 249 | 250 | } 251 | 252 | if (input.use_far_ptr){ 253 | variableSetToScriptValue(tmp4, input.scene_bank); 254 | variableSetToScriptValue(tmp5, input.scene_ptr); 255 | } 256 | 257 | 258 | 259 | if (input.use_far_ptr){ 260 | _stackPush(tmp5); 261 | _stackPush(tmp4); 262 | } else { 263 | const { scenes } = options; 264 | const scene = scenes.find((s) => s.id === input.sceneId); 265 | if (!scene) { 266 | return; 267 | } 268 | _stackPushConst(`_${scene.symbol}`); 269 | _stackPushConst(`___bank_${scene.symbol}`); 270 | } 271 | 272 | if (input.copy_attr === "background"){ 273 | _stackPushConst(1); 274 | } else if (input.copy_attr === "overlay"){ 275 | _stackPushConst(2); 276 | } else { 277 | _stackPushConst(0); 278 | } 279 | _stackPush(tmp3); 280 | _stackPush(tmp2); 281 | _stackPush(tmp1); 282 | _stackPush(tmp0); 283 | 284 | _callNative("copy_background_submap_to_tileset"); 285 | _stackPop(7); 286 | 287 | }; 288 | -------------------------------------------------------------------------------- /SubmapExamples/plugins/SubmappingExPlugin/events/eventReplaceBackgroundTile.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_REPLACE_BACKGROUND_TILE"; 2 | export const name = "Set background tile"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Set background tile`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: `x`, 12 | label: "X", 13 | type: "value", 14 | width: "50%", 15 | defaultValue: { 16 | type: "number", 17 | value: 0, 18 | }, 19 | }, 20 | { 21 | key: `y`, 22 | label: "Y", 23 | type: "value", 24 | width: "50%", 25 | defaultValue: { 26 | type: "number", 27 | value: 0, 28 | }, 29 | }, 30 | { 31 | key: `tile_id`, 32 | label: "Tile id", 33 | type: "value", 34 | defaultValue: { 35 | type: "number", 36 | value: 0, 37 | }, 38 | }, 39 | ]; 40 | 41 | export const compile = (input, helpers) => { 42 | 43 | const { _callNative, _stackPush, _stackPushConst, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 44 | 45 | const tmp0 = _declareLocal("tmp0", 1, true); 46 | const tmp1 = _declareLocal("tmp1", 1, true); 47 | const tmp2 = _declareLocal("tmp2", 1, true); 48 | 49 | variableSetToScriptValue(tmp0, input.x); 50 | variableSetToScriptValue(tmp1, input.y); 51 | variableSetToScriptValue(tmp2, input.tile_id); 52 | 53 | _addComment("Replace background tile"); 54 | 55 | _stackPush(tmp2); 56 | _stackPush(tmp1); 57 | _stackPush(tmp0); 58 | 59 | _callNative("vm_replace_background_tile"); 60 | _stackPop(3); 61 | }; 62 | -------------------------------------------------------------------------------- /SubmapExamples/plugins/SubmappingExPlugin/events/eventReplaceOverlayTile.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_REPLACE_OVERLAY_TILE"; 2 | export const name = "Set overlay tile"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Set overlay tile`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: `x`, 12 | label: "X", 13 | type: "value", 14 | width: "50%", 15 | defaultValue: { 16 | type: "number", 17 | value: 0, 18 | }, 19 | }, 20 | { 21 | key: `y`, 22 | label: "Y", 23 | type: "value", 24 | width: "50%", 25 | defaultValue: { 26 | type: "number", 27 | value: 0, 28 | }, 29 | }, 30 | { 31 | key: `tile_id`, 32 | label: "Tile id", 33 | type: "value", 34 | defaultValue: { 35 | type: "number", 36 | value: 0, 37 | }, 38 | }, 39 | ]; 40 | 41 | export const compile = (input, helpers) => { 42 | 43 | const { _callNative, _stackPush, _stackPushConst, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 44 | 45 | const tmp0 = _declareLocal("tmp0", 1, true); 46 | const tmp1 = _declareLocal("tmp1", 1, true); 47 | const tmp2 = _declareLocal("tmp2", 1, true); 48 | 49 | variableSetToScriptValue(tmp0, input.x); 50 | variableSetToScriptValue(tmp1, input.y); 51 | variableSetToScriptValue(tmp2, input.tile_id); 52 | 53 | _addComment("Replace overlay tile"); 54 | 55 | _stackPush(tmp2); 56 | _stackPush(tmp1); 57 | _stackPush(tmp0); 58 | 59 | _callNative("vm_replace_overlay_tile"); 60 | _stackPop(3); 61 | }; 62 | -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/intro_link_1.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "7a758d47-8f59-4ba7-a429-ba7cabb2a017", 4 | "name": "Intro_link_1", 5 | "symbol": "bg_intro_link_1", 6 | "width": 100, 7 | "height": 19, 8 | "imageWidth": 800, 9 | "imageHeight": 152, 10 | "filename": "Intro_link_1.png", 11 | "tileColors": "00171+014+0010+014+004c+013+0011+01!022+0037+01!0015+01!0013+01!022+0025+016+00e+022+01!0011+01!02!0012+01!022+00d+017+0011+016+00c+015+0010+01!023+0010+01!023+01!00b+015+022+012+0010+012+002+012+00d+014+0010+024+0010+024+00c+012+026+01!0010+01!0012+02!013+02!00f+024+0010+024+00e+026+0010+012+022+0011+024+0010+023+0010+025+0024+023+0038+025+0060+022+00261+" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_backs_1.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "690a456f-a8b6-4791-bb18-29d8373e88cc", 4 | "name": "pokemon_backs_1", 5 | "symbol": "bg_pokemon_backs_1", 6 | "width": 18, 7 | "height": 6, 8 | "imageWidth": 144, 9 | "imageHeight": 48, 10 | "filename": "pokemon_backs_1.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_backs_2.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "fc12233c-f844-4414-9a56-0503ef95480f", 4 | "name": "pokemon_backs_2", 5 | "symbol": "bg_pokemon_backs_2", 6 | "width": 18, 7 | "height": 6, 8 | "imageWidth": 144, 9 | "imageHeight": 48, 10 | "filename": "pokemon_backs_2.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_backs_3.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "504415f3-5412-4878-9cc1-cc550768d2ba", 4 | "name": "pokemon_backs_3", 5 | "symbol": "bg_pokemon_backs_3", 6 | "width": 18, 7 | "height": 6, 8 | "imageWidth": 144, 9 | "imageHeight": 48, 10 | "filename": "pokemon_backs_3.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_backs_4.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "9c17bd3e-9fe1-4683-979a-a0e9e95f0646", 4 | "name": "pokemon_backs_4", 5 | "symbol": "bg_pokemon_backs_4", 6 | "width": 18, 7 | "height": 6, 8 | "imageWidth": 144, 9 | "imageHeight": 48, 10 | "filename": "pokemon_backs_4.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_backs_5.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "c31907ce-5702-4ec4-87d1-b7d6395ef8e2", 4 | "name": "pokemon_backs_5", 5 | "symbol": "bg_pokemon_backs_5", 6 | "width": 18, 7 | "height": 6, 8 | "imageWidth": 144, 9 | "imageHeight": 48, 10 | "filename": "pokemon_backs_5.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_backs_6.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "be7340a9-a0d1-40a4-887a-4cd3b1cd2919", 4 | "name": "pokemon_backs_6", 5 | "symbol": "bg_pokemon_backs_6", 6 | "width": 18, 7 | "height": 6, 8 | "imageWidth": 144, 9 | "imageHeight": 48, 10 | "filename": "pokemon_backs_6.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_backs_7.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "86894806-e089-4799-bbfa-792609b83eae", 4 | "name": "pokemon_backs_7", 5 | "symbol": "bg_pokemon_backs_7", 6 | "width": 12, 7 | "height": 6, 8 | "imageWidth": 96, 9 | "imageHeight": 48, 10 | "filename": "pokemon_backs_7.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_battle.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "90967605-7a69-467f-8576-943be7151f84", 4 | "name": "Pokemon_Battle", 5 | "symbol": "bg_pokemon_battle", 6 | "width": 20, 7 | "height": 18, 8 | "imageWidth": 160, 9 | "imageHeight": 144, 10 | "filename": "Pokemon_Battle.png", 11 | "tileColors": "00c+017+00d+017+00d+017+00d+017+00d+017+00d+017+003+026+004+017+003+026+00e+026+00e+026+00e+026+00e+026+0084+" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_battle_ui_1.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "f7b024a9-ecf5-487c-b624-f3f7f43b9acc", 4 | "name": "Pokemon_Battle_UI_1", 5 | "symbol": "bg_pokemon_battle_ui_1", 6 | "width": 20, 7 | "height": 40, 8 | "imageWidth": 160, 9 | "imageHeight": 320, 10 | "filename": "Pokemon_Battle_UI_1.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_portaits_1.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "eaac5a7a-944f-4cc4-84db-945c1cbb68ae", 4 | "name": "pokemon_portaits_1", 5 | "symbol": "bg_pokemon_portaits_1", 6 | "width": 21, 7 | "height": 7, 8 | "imageWidth": 168, 9 | "imageHeight": 56, 10 | "filename": "pokemon_portaits_1.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_portaits_2.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "3020b57f-4dda-4ee5-9dfe-bf73798e9443", 4 | "name": "pokemon_portaits_2", 5 | "symbol": "bg_pokemon_portaits_2", 6 | "width": 21, 7 | "height": 7, 8 | "imageWidth": 168, 9 | "imageHeight": 56, 10 | "filename": "pokemon_portaits_2.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_portaits_3.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "2ad49874-7363-450e-ae17-162f600f73a8", 4 | "name": "pokemon_portaits_3", 5 | "symbol": "bg_pokemon_portaits_3", 6 | "width": 21, 7 | "height": 7, 8 | "imageWidth": 168, 9 | "imageHeight": 56, 10 | "filename": "pokemon_portaits_3.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_portaits_4.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "9ea9aee4-6abf-40dd-b9fc-9e1d36f34f09", 4 | "name": "pokemon_portaits_4", 5 | "symbol": "bg_pokemon_portaits_4", 6 | "width": 21, 7 | "height": 7, 8 | "imageWidth": 168, 9 | "imageHeight": 56, 10 | "filename": "pokemon_portaits_4.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_portaits_5.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "43d1524e-efd6-4f7a-94be-d6d5063fec96", 4 | "name": "pokemon_portaits_5", 5 | "symbol": "bg_pokemon_portaits_5", 6 | "width": 21, 7 | "height": 7, 8 | "imageWidth": 168, 9 | "imageHeight": 56, 10 | "filename": "pokemon_portaits_5.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_portaits_6.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "243a2713-6d5f-488e-9e03-694a153e9d8c", 4 | "name": "pokemon_portaits_6", 5 | "symbol": "bg_pokemon_portaits_6", 6 | "width": 21, 7 | "height": 7, 8 | "imageWidth": 168, 9 | "imageHeight": 56, 10 | "filename": "pokemon_portaits_6.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/backgrounds/pokemon_portaits_7.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "background", 3 | "id": "33ffe7a8-ae2f-4bbf-b981-6c9b98475d79", 4 | "name": "pokemon_portaits_7", 5 | "symbol": "bg_pokemon_portaits_7", 6 | "width": 14, 7 | "height": 7, 8 | "imageWidth": 112, 9 | "imageHeight": 56, 10 | "filename": "pokemon_portaits_7.png", 11 | "tileColors": "" 12 | } -------------------------------------------------------------------------------- /SubmapExamples/project/emotes/anger.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "emote", 3 | "id": "9df5f63f-ea47-447e-9b14-cb2dbafb697d", 4 | "name": "anger", 5 | "symbol": "emote_anger", 6 | "width": 16, 7 | "height": 16, 8 | "filename": "anger.png" 9 | } -------------------------------------------------------------------------------- /SubmapExamples/project/emotes/love.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "emote", 3 | "id": "edf96d29-9a08-4813-b2d3-46e0996f89f2", 4 | "name": "love", 5 | "symbol": "emote_love", 6 | "width": 16, 7 | "height": 16, 8 | "filename": "love.png" 9 | } -------------------------------------------------------------------------------- /SubmapExamples/project/emotes/music.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "emote", 3 | "id": "f1be2ac3-04ab-482a-8b83-99ffba1a89cd", 4 | "name": "music", 5 | "symbol": "emote_music", 6 | "width": 16, 7 | "height": 16, 8 | "filename": "music.png" 9 | } -------------------------------------------------------------------------------- /SubmapExamples/project/emotes/pause.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "emote", 3 | "id": "d508e529-57eb-458b-9782-66f318243c32", 4 | "name": "pause", 5 | "symbol": "emote_pause", 6 | "width": 16, 7 | "height": 16, 8 | "filename": "pause.png" 9 | } -------------------------------------------------------------------------------- /SubmapExamples/project/emotes/question.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "emote", 3 | "id": "70a4ce25-1fe4-4ab1-aee9-21255e70fb76", 4 | "name": "question", 5 | "symbol": "emote_question", 6 | "width": 16, 7 | "height": 16, 8 | "filename": "question.png" 9 | } -------------------------------------------------------------------------------- /SubmapExamples/project/emotes/shock.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "emote", 3 | "id": "56423c9c-dca0-4f5b-ad92-28e9660d50f1", 4 | "name": "shock", 5 | "symbol": "emote_shock", 6 | "width": 16, 7 | "height": 16, 8 | "filename": "shock.png" 9 | } -------------------------------------------------------------------------------- /SubmapExamples/project/emotes/sleep.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "emote", 3 | "id": "2d4b251d-0241-40eb-98e1-e396b236772c", 4 | "name": "sleep", 5 | "symbol": "emote_sleep", 6 | "width": 16, 7 | "height": 16, 8 | "filename": "sleep.png" 9 | } -------------------------------------------------------------------------------- /SubmapExamples/project/emotes/sweat.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "emote", 3 | "id": "3c769dca-51f3-426c-942f-71c4d3af6202", 4 | "name": "sweat", 5 | "symbol": "emote_sweat", 6 | "width": 16, 7 | "height": 16, 8 | "filename": "sweat.png" 9 | } -------------------------------------------------------------------------------- /SubmapExamples/project/engine_field_values.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "engineFieldValues", 3 | "engineFieldValues": [ 4 | { 5 | "id": "fade_style", 6 | "value": 0 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /SubmapExamples/project/fonts/gbs_mono.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "font", 3 | "id": "4bd653f0-e08d-424e-9e5b-c1f3aaa21e47", 4 | "name": "GBS Mono", 5 | "symbol": "font_gbs_mono", 6 | "width": 128, 7 | "height": 112, 8 | "filename": "gbs-mono.png", 9 | "mapping": {} 10 | } -------------------------------------------------------------------------------- /SubmapExamples/project/fonts/gbs_variable_width.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "font", 3 | "id": "8ed435d9-51cb-44e7-8b0d-ca85e63ca427", 4 | "name": "GBS Variable Width", 5 | "symbol": "font_gbs_variable_width", 6 | "width": 128, 7 | "height": 112, 8 | "filename": "gbs-var.png", 9 | "mapping": {} 10 | } -------------------------------------------------------------------------------- /SubmapExamples/project/music/template.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "music", 3 | "id": "f50428ab-a084-4591-9bba-2ba10fe7b1c6", 4 | "name": "template", 5 | "symbol": "song_template", 6 | "filename": "template.mod", 7 | "settings": {}, 8 | "type": "mod" 9 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/default_bg_1.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "default-bg-1", 4 | "name": "Default BG 1", 5 | "colors": [ 6 | "F8E8C8", 7 | "D89048", 8 | "A82820", 9 | "301850" 10 | ], 11 | "defaultName": "Default BG 1", 12 | "defaultColors": [ 13 | "F8E8C8", 14 | "D89048", 15 | "A82820", 16 | "301850" 17 | ] 18 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/default_bg_2.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "default-bg-2", 4 | "name": "Default BG 2", 5 | "colors": [ 6 | "E0F8A0", 7 | "78C838", 8 | "488818", 9 | "081800" 10 | ], 11 | "defaultName": "Default BG 2", 12 | "defaultColors": [ 13 | "E0F8A0", 14 | "78C838", 15 | "488818", 16 | "081800" 17 | ] 18 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/default_bg_3.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "default-bg-3", 4 | "name": "Default BG 3", 5 | "colors": [ 6 | "F8D8A8", 7 | "E0A878", 8 | "785888", 9 | "002030" 10 | ], 11 | "defaultName": "Default BG 3", 12 | "defaultColors": [ 13 | "F8D8A8", 14 | "E0A878", 15 | "785888", 16 | "002030" 17 | ] 18 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/default_bg_4.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "default-bg-4", 4 | "name": "Default BG 4", 5 | "colors": [ 6 | "B8D0D0", 7 | "D880D8", 8 | "8000A0", 9 | "380000" 10 | ], 11 | "defaultName": "Default BG 4", 12 | "defaultColors": [ 13 | "B8D0D0", 14 | "D880D8", 15 | "8000A0", 16 | "380000" 17 | ] 18 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/default_bg_5.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "default-bg-5", 4 | "name": "Default BG 5", 5 | "colors": [ 6 | "F8F8B8", 7 | "90C8C8", 8 | "486878", 9 | "082048" 10 | ], 11 | "defaultName": "Default BG 5", 12 | "defaultColors": [ 13 | "F8F8B8", 14 | "90C8C8", 15 | "486878", 16 | "082048" 17 | ] 18 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/default_bg_6.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "default-bg-6", 4 | "name": "Default BG 6", 5 | "colors": [ 6 | "F8D8B0", 7 | "78C078", 8 | "688840", 9 | "583820" 10 | ], 11 | "defaultName": "Default BG 6", 12 | "defaultColors": [ 13 | "F8D8B0", 14 | "78C078", 15 | "688840", 16 | "583820" 17 | ] 18 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/default_sprites.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "default-sprite", 4 | "name": "Default Sprites", 5 | "colors": [ 6 | "F8F0E0", 7 | "D88078", 8 | "B05010", 9 | "000000" 10 | ], 11 | "defaultName": "Default Sprites", 12 | "defaultColors": [ 13 | "F8F0E0", 14 | "D88078", 15 | "B05010", 16 | "000000" 17 | ] 18 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/default_ui.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "default-ui", 4 | "name": "Default UI", 5 | "colors": [ 6 | "F8F8B8", 7 | "90C8C8", 8 | "486878", 9 | "082048" 10 | ], 11 | "defaultName": "Default UI", 12 | "defaultColors": [ 13 | "F8F8B8", 14 | "90C8C8", 15 | "486878", 16 | "082048" 17 | ] 18 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/link_bg_1.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "fa5b7fb0-2b7b-41d2-954c-dc6bc43faafb", 4 | "name": "Link BG 1", 5 | "colors": [ 6 | "E8F8E0", 7 | "88F0F0", 8 | "987850", 9 | "202850" 10 | ] 11 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/link_bg_2.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "c9157241-4098-438c-950f-0eeceb9b3422", 4 | "name": "Link BG 2", 5 | "colors": [ 6 | "8bf7f6", 7 | "28D860", 8 | "9c7c52", 9 | "202850" 10 | ] 11 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/link_bg_3.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "98432592-f9b3-43a7-8dec-0a40020b3ef1", 4 | "name": "Link BG 3", 5 | "colors": [ 6 | "E8F8E0", 7 | "29de62", 8 | "9c7c52", 9 | "202850" 10 | ] 11 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/pokemon_1.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "c214bb49-2fb5-4407-8b92-45be914f56cb", 4 | "name": "Pokemon 1", 5 | "colors": [ 6 | "F8F8F8", 7 | "F0B870", 8 | "A03018", 9 | "000000" 10 | ] 11 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/pokemon_2.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "fee3e829-efc0-48ad-b607-c75e4effe8c6", 4 | "name": "Pokemon 2", 5 | "colors": [ 6 | "ffffff", 7 | "78F870", 8 | "389838", 9 | "000000" 10 | ] 11 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/pokemon_3.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "eb1ed99b-dffd-4ab1-9d21-7f716b7bd978", 4 | "name": "Pokemon 3", 5 | "colors": [ 6 | "ffffff", 7 | "70C0F8", 8 | "2830B0", 9 | "000000" 10 | ] 11 | } -------------------------------------------------------------------------------- /SubmapExamples/project/palettes/pokemon_bg_1.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "palette", 3 | "id": "1afd40b5-6a01-45aa-bbcc-741ff5b7ff37", 4 | "name": "Pokemon BG 1", 5 | "colors": [ 6 | "ffffff", 7 | "B0F088", 8 | "509878", 9 | "000000" 10 | ] 11 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/background_submap_from_same_scene_example/actors/linkface.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "actor", 3 | "id": "dfcf1cfb-a539-4dfd-93fc-20da579f2963", 4 | "name": "LinkFace", 5 | "frame": 0, 6 | "animate": false, 7 | "spriteSheetId": "c4099d9b-1b21-41d6-8abd-158132c298e2", 8 | "prefabId": "", 9 | "direction": "right", 10 | "moveSpeed": 1, 11 | "animSpeed": 15, 12 | "paletteId": "", 13 | "isPinned": false, 14 | "persistent": false, 15 | "collisionGroup": "", 16 | "prefabScriptOverrides": {}, 17 | "symbol": "actor_0", 18 | "script": [], 19 | "startScript": [], 20 | "updateScript": [], 21 | "hit1Script": [], 22 | "hit2Script": [], 23 | "hit3Script": [], 24 | "x": 6, 25 | "y": 12, 26 | "_index": 0 27 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/background_submap_from_same_scene_example/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "0521885f-9af4-498b-810e-ea3071334113", 4 | "_index": 0, 5 | "name": "Background Submap From Same Scene Example", 6 | "backgroundId": "7a758d47-8f59-4ba7-a429-ba7cabb2a017", 7 | "tilesetId": "", 8 | "width": 100, 9 | "height": 19, 10 | "type": "TOPDOWN", 11 | "paletteIds": [ 12 | "fa5b7fb0-2b7b-41d2-954c-dc6bc43faafb", 13 | "c9157241-4098-438c-950f-0eeceb9b3422", 14 | "98432592-f9b3-43a7-8dec-0a40020b3ef1" 15 | ], 16 | "spritePaletteIds": [], 17 | "collisions": "", 18 | "autoFadeSpeed": 1, 19 | "symbol": "scene_1", 20 | "x": 136, 21 | "y": 80, 22 | "script": [ 23 | { 24 | "command": "EVENT_CAMERA_SET_POSITION", 25 | "args": { 26 | "x": { 27 | "type": "number", 28 | "value": 0 29 | }, 30 | "y": { 31 | "type": "number", 32 | "value": 0 33 | }, 34 | "__collapse": true 35 | }, 36 | "id": "3697e114-9928-4b3a-abf0-333ebe44e394" 37 | }, 38 | { 39 | "command": "EVENT_ACTOR_HIDE", 40 | "args": { 41 | "actorId": "$self$", 42 | "__collapse": true 43 | }, 44 | "id": "ebe4dbbe-4289-43e5-8592-7f5bb03ae9fb" 45 | }, 46 | { 47 | "command": "EVENT_ACTOR_SET_DIRECTION", 48 | "args": { 49 | "actorId": "dfcf1cfb-a539-4dfd-93fc-20da579f2963", 50 | "direction": { 51 | "type": "direction", 52 | "value": "right" 53 | }, 54 | "__collapse": true 55 | }, 56 | "id": "1c9ff4a4-05a7-4ff3-8a0d-a000f33c1565" 57 | }, 58 | { 59 | "command": "EVENT_WAIT", 60 | "args": { 61 | "time": 2, 62 | "frames": 30, 63 | "__collapse": true 64 | }, 65 | "id": "cca605e8-cc0a-4391-8e85-efb165210b1e" 66 | }, 67 | { 68 | "command": "EVENT_ACTOR_SET_DIRECTION", 69 | "args": { 70 | "actorId": "dfcf1cfb-a539-4dfd-93fc-20da579f2963", 71 | "direction": { 72 | "type": "direction", 73 | "value": "left" 74 | }, 75 | "__collapse": true 76 | }, 77 | "id": "6e4c0f12-2e84-4128-9a00-e0d6455b3e10" 78 | }, 79 | { 80 | "command": "EVENT_WAIT", 81 | "args": { 82 | "time": 1, 83 | "frames": 30, 84 | "__collapse": true 85 | }, 86 | "id": "e96ef464-804f-4ddc-80e6-b5f98db591ca" 87 | }, 88 | { 89 | "command": "EVENT_ACTOR_DEACTIVATE", 90 | "args": { 91 | "actorId": "dfcf1cfb-a539-4dfd-93fc-20da579f2963", 92 | "__collapse": true 93 | }, 94 | "id": "8e9e3ba1-c391-4548-b82c-653bd58e7b44" 95 | }, 96 | { 97 | "command": "EVENT_COPY_BKG_SUBMAP_TO_BKG", 98 | "args": { 99 | "sceneId": "0521885f-9af4-498b-810e-ea3071334113", 100 | "source_x": { 101 | "type": "number", 102 | "value": 24 103 | }, 104 | "source_y": { 105 | "type": "number", 106 | "value": 6 107 | }, 108 | "dest_x": { 109 | "type": "number", 110 | "value": 4 111 | }, 112 | "dest_y": { 113 | "type": "number", 114 | "value": 6 115 | }, 116 | "w": { 117 | "type": "number", 118 | "value": 13 119 | }, 120 | "h": { 121 | "type": "number", 122 | "value": 8 123 | }, 124 | "__collapse": true 125 | }, 126 | "id": "e48e49e6-d9d5-4679-bc45-8eed09f2e4af" 127 | }, 128 | { 129 | "command": "EVENT_WAIT", 130 | "args": { 131 | "time": 0.5, 132 | "frames": 30, 133 | "__collapse": true 134 | }, 135 | "id": "e589d8ca-2d01-4700-b25f-c1b37a6fa1d6" 136 | }, 137 | { 138 | "command": "EVENT_COPY_BKG_SUBMAP_TO_BKG", 139 | "args": { 140 | "sceneId": "0521885f-9af4-498b-810e-ea3071334113", 141 | "source_x": { 142 | "type": "number", 143 | "value": 45 144 | }, 145 | "source_y": { 146 | "type": "number", 147 | "value": 2 148 | }, 149 | "dest_x": { 150 | "type": "number", 151 | "value": 5 152 | }, 153 | "dest_y": { 154 | "type": "number", 155 | "value": 2 156 | }, 157 | "w": { 158 | "type": "number", 159 | "value": 12 160 | }, 161 | "h": { 162 | "type": "number", 163 | "value": 12 164 | }, 165 | "__collapse": true 166 | }, 167 | "id": "fc2bf740-49e2-4e65-aa33-61ad0f0bd384" 168 | }, 169 | { 170 | "command": "EVENT_ACTOR_SET_DIRECTION", 171 | "args": { 172 | "actorId": "dfcf1cfb-a539-4dfd-93fc-20da579f2963", 173 | "direction": { 174 | "type": "direction", 175 | "value": "up" 176 | }, 177 | "__collapse": true 178 | }, 179 | "id": "5c6a79e2-df5b-465f-8c6d-7c1a239a6b94" 180 | }, 181 | { 182 | "command": "EVENT_ACTOR_SET_POSITION", 183 | "args": { 184 | "actorId": "dfcf1cfb-a539-4dfd-93fc-20da579f2963", 185 | "x": { 186 | "type": "number", 187 | "value": 9 188 | }, 189 | "y": { 190 | "type": "number", 191 | "value": 7 192 | }, 193 | "__collapse": true 194 | }, 195 | "id": "f85a9b19-566e-42fe-ad48-9e420c4c3971" 196 | }, 197 | { 198 | "command": "EVENT_ACTOR_ACTIVATE", 199 | "args": { 200 | "actorId": "dfcf1cfb-a539-4dfd-93fc-20da579f2963", 201 | "__collapse": true 202 | }, 203 | "id": "fb281b95-fe5f-45d8-8e2a-e71248f46156" 204 | }, 205 | { 206 | "command": "EVENT_WAIT", 207 | "args": { 208 | "time": 1, 209 | "frames": 30, 210 | "__collapse": true 211 | }, 212 | "id": "02fbdebd-141e-4c6e-966a-fc422c08eb8e" 213 | }, 214 | { 215 | "command": "EVENT_COPY_BKG_SUBMAP_TO_BKG", 216 | "args": { 217 | "sceneId": "0521885f-9af4-498b-810e-ea3071334113", 218 | "source_x": { 219 | "type": "number", 220 | "value": 65 221 | }, 222 | "source_y": { 223 | "type": "number", 224 | "value": 2 225 | }, 226 | "dest_x": { 227 | "type": "number", 228 | "value": 5 229 | }, 230 | "dest_y": { 231 | "type": "number", 232 | "value": 2 233 | }, 234 | "w": { 235 | "type": "number", 236 | "value": 12 237 | }, 238 | "h": { 239 | "type": "number", 240 | "value": 12 241 | }, 242 | "__collapse": true 243 | }, 244 | "id": "2b6bf845-0989-4c72-8a05-3b2b306234b2" 245 | }, 246 | { 247 | "command": "EVENT_ACTOR_SET_DIRECTION", 248 | "args": { 249 | "actorId": "dfcf1cfb-a539-4dfd-93fc-20da579f2963", 250 | "direction": { 251 | "type": "direction", 252 | "value": "down" 253 | }, 254 | "__collapse": true 255 | }, 256 | "id": "1b2003da-d9b1-4ce7-b36b-1cfb02736d7b" 257 | }, 258 | { 259 | "command": "EVENT_ACTOR_SET_POSITION", 260 | "args": { 261 | "actorId": "dfcf1cfb-a539-4dfd-93fc-20da579f2963", 262 | "x": { 263 | "type": "number", 264 | "value": 11 265 | }, 266 | "y": { 267 | "type": "number", 268 | "value": 8 269 | }, 270 | "__collapse": true 271 | }, 272 | "id": "6db4ee34-1181-4615-85bf-a28ef0178e8a" 273 | }, 274 | { 275 | "command": "EVENT_WAIT", 276 | "args": { 277 | "time": 0.3, 278 | "frames": 30, 279 | "__collapse": true 280 | }, 281 | "id": "37a9f762-3303-4e34-85a4-76503de032f9" 282 | }, 283 | { 284 | "command": "EVENT_COPY_BKG_SUBMAP_TO_BKG", 285 | "args": { 286 | "sceneId": "0521885f-9af4-498b-810e-ea3071334113", 287 | "source_x": { 288 | "type": "number", 289 | "value": 93 290 | }, 291 | "source_y": { 292 | "type": "number", 293 | "value": 5 294 | }, 295 | "dest_x": { 296 | "type": "number", 297 | "value": 13 298 | }, 299 | "dest_y": { 300 | "type": "number", 301 | "value": 5 302 | }, 303 | "w": { 304 | "type": "number", 305 | "value": 2 306 | }, 307 | "h": { 308 | "type": "number", 309 | "value": 2 310 | }, 311 | "__collapse": true 312 | }, 313 | "id": "05798b87-af30-4eb7-86ec-ff9af41c5284" 314 | }, 315 | { 316 | "command": "EVENT_WAIT", 317 | "args": { 318 | "time": 3, 319 | "frames": 30, 320 | "__collapse": true 321 | }, 322 | "id": "df4dd357-7f36-4370-b112-34aeccbe8266" 323 | }, 324 | { 325 | "command": "EVENT_SWITCH_SCENE", 326 | "args": { 327 | "sceneId": "deb13e20-a423-4b40-9280-5e583a98a761", 328 | "x": { 329 | "type": "number", 330 | "value": 0 331 | }, 332 | "y": { 333 | "type": "number", 334 | "value": 0 335 | }, 336 | "direction": "", 337 | "fadeSpeed": "2", 338 | "__collapse": true 339 | }, 340 | "id": "0f039056-ed2a-48c7-a765-45d3a42509a0" 341 | } 342 | ], 343 | "playerHit1Script": [], 344 | "playerHit2Script": [], 345 | "playerHit3Script": [], 346 | "autoFadeEventCollapse": true 347 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/background_submap_from_tileset_example/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "deb13e20-a423-4b40-9280-5e583a98a761", 4 | "_index": 1, 5 | "name": "Background Submap From Tileset Example", 6 | "backgroundId": "90967605-7a69-467f-8576-943be7151f84", 7 | "tilesetId": "f21d7b04-32df-45a8-99a5-52fdcc5182ed", 8 | "width": 20, 9 | "height": 18, 10 | "type": "TOPDOWN", 11 | "paletteIds": [ 12 | "1afd40b5-6a01-45aa-bbcc-741ff5b7ff37", 13 | "c214bb49-2fb5-4407-8b92-45be914f56cb", 14 | "fee3e829-efc0-48ad-b607-c75e4effe8c6" 15 | ], 16 | "spritePaletteIds": [], 17 | "collisions": "00168+", 18 | "autoFadeSpeed": 1, 19 | "symbol": "scene_2", 20 | "x": 128, 21 | "y": 280, 22 | "script": [ 23 | { 24 | "command": "EVENT_SET_INPUT_SCRIPT", 25 | "args": { 26 | "input": [ 27 | "a" 28 | ], 29 | "override": true, 30 | "__scriptTabs": "press", 31 | "__collapse": false 32 | }, 33 | "children": { 34 | "true": [ 35 | { 36 | "command": "EVENT_SET_VALUE", 37 | "args": { 38 | "variable": "0", 39 | "value": { 40 | "type": "expression", 41 | "value": "($00$ + 1) % 20" 42 | }, 43 | "__collapse": true 44 | }, 45 | "id": "fc84c6cd-c7e0-48d2-b420-5e7b579fb34a" 46 | }, 47 | { 48 | "command": "EVENT_CALL_CUSTOM_EVENT", 49 | "args": { 50 | "customEventId": "c2065b7c-6514-4a53-b25d-d7733830605c", 51 | "__collapse": true 52 | }, 53 | "id": "49773e10-496c-4c3e-863f-551ec5c2e1c5" 54 | } 55 | ] 56 | }, 57 | "id": "a3140a9a-e6ff-46b8-bb70-42825ab4158f" 58 | }, 59 | { 60 | "command": "EVENT_SET_INPUT_SCRIPT", 61 | "args": { 62 | "input": [ 63 | "b" 64 | ], 65 | "override": true, 66 | "__scriptTabs": "press", 67 | "__collapse": false 68 | }, 69 | "children": { 70 | "true": [ 71 | { 72 | "command": "EVENT_SET_VALUE", 73 | "args": { 74 | "variable": "1", 75 | "value": { 76 | "type": "expression", 77 | "value": "($01$ + 1) % 20" 78 | }, 79 | "__collapse": true 80 | }, 81 | "id": "d4c61cba-e8be-44f9-89c1-02f1390e5cb1" 82 | }, 83 | { 84 | "command": "EVENT_CALL_CUSTOM_EVENT", 85 | "args": { 86 | "customEventId": "a3df2e02-f38e-4be7-a159-c9437e21ca8f", 87 | "__collapse": true 88 | }, 89 | "id": "314ae921-a4b7-4936-880b-9e9a4b856894" 90 | } 91 | ] 92 | }, 93 | "id": "b6f72e63-7b1f-4883-b8cc-ef85297b4fd1" 94 | }, 95 | { 96 | "command": "EVENT_CALL_CUSTOM_EVENT", 97 | "args": { 98 | "customEventId": "c2065b7c-6514-4a53-b25d-d7733830605c", 99 | "__collapse": true 100 | }, 101 | "id": "2ca924b8-19e5-490b-8526-9085380c97c0" 102 | }, 103 | { 104 | "command": "EVENT_CALL_CUSTOM_EVENT", 105 | "args": { 106 | "customEventId": "a3df2e02-f38e-4be7-a159-c9437e21ca8f", 107 | "__collapse": true 108 | }, 109 | "id": "986dbf2b-8845-4158-81af-0a5f5d181bae" 110 | }, 111 | { 112 | "command": "EVENT_COPY_BKG_SUBMAP_TO_BKG", 113 | "args": { 114 | "sceneId": "cc89d89b-3d21-44ec-9850-63e2cda8dbdc", 115 | "source_x": { 116 | "type": "number", 117 | "value": 1 118 | }, 119 | "source_y": { 120 | "type": "number", 121 | "value": 10 122 | }, 123 | "dest_x": { 124 | "type": "number", 125 | "value": 1 126 | }, 127 | "dest_y": { 128 | "type": "number", 129 | "value": 1 130 | }, 131 | "w": { 132 | "type": "number", 133 | "value": 10 134 | }, 135 | "h": { 136 | "type": "number", 137 | "value": 3 138 | }, 139 | "__collapse": true 140 | }, 141 | "id": "bef8e1e9-12fa-47e5-8329-a8bbeb25f4f0" 142 | }, 143 | { 144 | "command": "EVENT_COPY_BKG_SUBMAP_TO_BKG", 145 | "args": { 146 | "sceneId": "cc89d89b-3d21-44ec-9850-63e2cda8dbdc", 147 | "source_x": { 148 | "type": "number", 149 | "value": 1 150 | }, 151 | "source_y": { 152 | "type": "number", 153 | "value": 14 154 | }, 155 | "dest_x": { 156 | "type": "number", 157 | "value": 9 158 | }, 159 | "dest_y": { 160 | "type": "number", 161 | "value": 8 162 | }, 163 | "w": { 164 | "type": "number", 165 | "value": 10 166 | }, 167 | "h": { 168 | "type": "number", 169 | "value": 4 170 | }, 171 | "__collapse": true 172 | }, 173 | "id": "b84be314-a02e-4eaa-973d-e71dd8ee5fb2" 174 | } 175 | ], 176 | "playerHit1Script": [], 177 | "playerHit2Script": [], 178 | "playerHit3Script": [] 179 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonback1/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "11fea31c-d64a-4581-b690-e5842648d460", 4 | "_index": 3, 5 | "name": "PokemonBack1", 6 | "backgroundId": "690a456f-a8b6-4791-bb18-29d8373e88cc", 7 | "tilesetId": "", 8 | "width": 18, 9 | "height": 6, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "006c+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_4", 16 | "x": 312, 17 | "y": 280, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonback2/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "2ebcc388-8d11-4cc2-9017-2677a1256dcb", 4 | "_index": 4, 5 | "name": "PokemonBack2", 6 | "backgroundId": "fc12233c-f844-4414-9a56-0503ef95480f", 7 | "tilesetId": "", 8 | "width": 18, 9 | "height": 6, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "006c+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_5", 16 | "x": 312, 17 | "y": 360, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonback3/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "d6196c45-7258-4d24-bc02-0f1b46bd38ea", 4 | "_index": 5, 5 | "name": "PokemonBack3", 6 | "backgroundId": "504415f3-5412-4878-9cc1-cc550768d2ba", 7 | "tilesetId": "", 8 | "width": 18, 9 | "height": 6, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "006c+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_6", 16 | "x": 312, 17 | "y": 440, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonback4/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "520ba483-d93d-4d2c-930c-317d901f53d6", 4 | "_index": 6, 5 | "name": "PokemonBack4", 6 | "backgroundId": "9c17bd3e-9fe1-4683-979a-a0e9e95f0646", 7 | "tilesetId": "", 8 | "width": 18, 9 | "height": 6, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "006c+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_7", 16 | "x": 312, 17 | "y": 520, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonback5/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "c858278c-706d-455e-b9c9-dbed17d0d062", 4 | "_index": 7, 5 | "name": "PokemonBack5", 6 | "backgroundId": "c31907ce-5702-4ec4-87d1-b7d6395ef8e2", 7 | "tilesetId": "", 8 | "width": 18, 9 | "height": 6, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "006c+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_8", 16 | "x": 312, 17 | "y": 600, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonback6/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "474d5779-5892-4d34-bc6d-ce4b42472432", 4 | "_index": 8, 5 | "name": "PokemonBack6", 6 | "backgroundId": "be7340a9-a0d1-40a4-887a-4cd3b1cd2919", 7 | "tilesetId": "", 8 | "width": 18, 9 | "height": 6, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "006c+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_9", 16 | "x": 312, 17 | "y": 680, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonback7/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "b162eac3-33c9-4e33-af53-5419fd1fcf14", 4 | "_index": 9, 5 | "name": "PokemonBack7", 6 | "backgroundId": "86894806-e089-4799-bbfa-792609b83eae", 7 | "tilesetId": "", 8 | "width": 12, 9 | "height": 6, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "0048+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_10", 16 | "x": 312, 17 | "y": 760, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonbattleui/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "cc89d89b-3d21-44ec-9850-63e2cda8dbdc", 4 | "_index": 2, 5 | "name": "PokemonBattleUI", 6 | "backgroundId": "f7b024a9-ecf5-487c-b624-f3f7f43b9acc", 7 | "tilesetId": "f21d7b04-32df-45a8-99a5-52fdcc5182ed", 8 | "width": 20, 9 | "height": 40, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "00320+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_3", 16 | "x": 128, 17 | "y": 456, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonfront1/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "63a50906-9648-44ee-85da-e712186dff8b", 4 | "_index": 10, 5 | "name": "PokemonFront1", 6 | "backgroundId": "eaac5a7a-944f-4cc4-84db-945c1cbb68ae", 7 | "tilesetId": "", 8 | "width": 21, 9 | "height": 7, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "0093+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_11", 16 | "x": 472, 17 | "y": 280, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonfront2/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "9ad8fb72-0850-4cfa-bfea-e97e52b36aed", 4 | "_index": 11, 5 | "name": "PokemonFront2", 6 | "backgroundId": "3020b57f-4dda-4ee5-9dfe-bf73798e9443", 7 | "tilesetId": "", 8 | "width": 21, 9 | "height": 7, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "0093+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_12", 16 | "x": 472, 17 | "y": 360, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonfront3/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "fc206f52-c9b3-41f6-9cb9-2d3fa70fd94f", 4 | "_index": 12, 5 | "name": "PokemonFront3", 6 | "backgroundId": "2ad49874-7363-450e-ae17-162f600f73a8", 7 | "tilesetId": "", 8 | "width": 21, 9 | "height": 7, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "0093+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_13", 16 | "x": 472, 17 | "y": 440, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonfront4/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "3963a20b-5c6b-4fd3-99ec-22771be86b72", 4 | "_index": 13, 5 | "name": "PokemonFront4", 6 | "backgroundId": "9ea9aee4-6abf-40dd-b9fc-9e1d36f34f09", 7 | "tilesetId": "", 8 | "width": 21, 9 | "height": 7, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "0093+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_14", 16 | "x": 472, 17 | "y": 520, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonfront5/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "dde62a05-785a-4d2d-96ca-409423d48f79", 4 | "_index": 14, 5 | "name": "PokemonFront5", 6 | "backgroundId": "43d1524e-efd6-4f7a-94be-d6d5063fec96", 7 | "tilesetId": "", 8 | "width": 21, 9 | "height": 7, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "0093+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_15", 16 | "x": 472, 17 | "y": 600, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonfront6/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "c21ea42e-1ec5-4a42-ac4c-cf691fabdf29", 4 | "_index": 15, 5 | "name": "PokemonFront6", 6 | "backgroundId": "243a2713-6d5f-488e-9e03-694a153e9d8c", 7 | "tilesetId": "", 8 | "width": 21, 9 | "height": 7, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "0093+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_16", 16 | "x": 472, 17 | "y": 680, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/scenes/pokemonfront7/scene.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "scene", 3 | "id": "17de3d01-d7f0-467d-927f-193f7bc8d670", 4 | "_index": 16, 5 | "name": "PokemonFront7", 6 | "backgroundId": "33ffe7a8-ae2f-4bbf-b981-6c9b98475d79", 7 | "tilesetId": "", 8 | "width": 14, 9 | "height": 7, 10 | "type": "TOPDOWN", 11 | "paletteIds": [], 12 | "spritePaletteIds": [], 13 | "collisions": "0062+", 14 | "autoFadeSpeed": 1, 15 | "symbol": "scene_17", 16 | "x": 472, 17 | "y": 760, 18 | "script": [], 19 | "playerHit1Script": [], 20 | "playerHit2Script": [], 21 | "playerHit3Script": [] 22 | } -------------------------------------------------------------------------------- /SubmapExamples/project/settings.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "settings", 3 | "startSceneId": "0521885f-9af4-498b-810e-ea3071334113", 4 | "startX": 0, 5 | "startY": 0, 6 | "startMoveSpeed": 1, 7 | "startAnimSpeed": 15, 8 | "startDirection": "down", 9 | "showCollisionExtraTiles": false, 10 | "sgbEnabled": false, 11 | "customHead": "", 12 | "defaultBackgroundPaletteIds": [ 13 | "default-bg-1", 14 | "default-bg-2", 15 | "default-bg-3", 16 | "default-bg-4", 17 | "default-bg-5", 18 | "default-bg-6", 19 | "dmg", 20 | "default-ui" 21 | ], 22 | "defaultSpritePaletteIds": [ 23 | "default-sprite", 24 | "default-sprite", 25 | "default-sprite", 26 | "default-sprite", 27 | "default-sprite", 28 | "default-sprite", 29 | "default-sprite", 30 | "default-sprite" 31 | ], 32 | "defaultSpritePaletteId": "default-sprite", 33 | "defaultUIPaletteId": "default-ui", 34 | "playerPaletteId": "", 35 | "defaultFontId": "4bd653f0-e08d-424e-9e5b-c1f3aaa21e47", 36 | "defaultCharacterEncoding": "", 37 | "defaultPlayerSprites": { 38 | "TOPDOWN": "581d34d0-9591-4e6e-a609-1d94f203b0cd", 39 | "PLATFORM": "581d34d0-9591-4e6e-a609-1d94f203b0cd", 40 | "ADVENTURE": "581d34d0-9591-4e6e-a609-1d94f203b0cd", 41 | "SHMUP": "581d34d0-9591-4e6e-a609-1d94f203b0cd", 42 | "POINTNCLICK": "581d34d0-9591-4e6e-a609-1d94f203b0cd", 43 | "LOGO": "581d34d0-9591-4e6e-a609-1d94f203b0cd" 44 | }, 45 | "musicDriver": "huge", 46 | "cartType": "mbc5", 47 | "batterylessEnabled": false, 48 | "customColorsWhite": "E8F8E0", 49 | "customColorsLight": "B0F088", 50 | "customColorsDark": "509878", 51 | "customColorsBlack": "202850", 52 | "customControlsUp": [ 53 | "ArrowUp", 54 | "w" 55 | ], 56 | "customControlsDown": [ 57 | "ArrowDown", 58 | "s" 59 | ], 60 | "customControlsLeft": [ 61 | "ArrowLeft", 62 | "a" 63 | ], 64 | "customControlsRight": [ 65 | "ArrowRight", 66 | "d" 67 | ], 68 | "customControlsA": [ 69 | "Alt", 70 | "z", 71 | "j" 72 | ], 73 | "customControlsB": [ 74 | "Control", 75 | "k", 76 | "x" 77 | ], 78 | "customControlsStart": [ 79 | "Enter" 80 | ], 81 | "customControlsSelect": [ 82 | "Shift" 83 | ], 84 | "colorMode": "color", 85 | "generateDebugFilesEnabled": false, 86 | "compilerPreset": 3000, 87 | "scriptEventPresets": {}, 88 | "scriptEventDefaultPresets": {} 89 | } -------------------------------------------------------------------------------- /SubmapExamples/project/sprites/actor.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "sprite", 3 | "id": "11b5452b-187c-43a3-afb1-a1f4f74ffda2", 4 | "name": "actor", 5 | "symbol": "sprite_actor", 6 | "numFrames": 3, 7 | "filename": "actor.png", 8 | "checksum": "8646d62a30fe76f9e39e3dbdb23aab0182a33146", 9 | "width": 48, 10 | "height": 16, 11 | "states": [ 12 | { 13 | "id": "4d1efdcf-c6d6-4b25-ab89-008b990697ac", 14 | "name": "", 15 | "animationType": "multi", 16 | "flipLeft": true, 17 | "animations": [ 18 | { 19 | "id": "f0e27b77-101b-4c2f-bf52-fda0ae13dae4", 20 | "frames": [ 21 | { 22 | "id": "c905496b-7d90-4107-9728-767b51d9b563", 23 | "tiles": [ 24 | { 25 | "id": "d51763df-1353-4da7-9cf7-03fbada9edd2", 26 | "x": 0, 27 | "y": 0, 28 | "sliceX": 32, 29 | "sliceY": 0, 30 | "flipX": false, 31 | "flipY": false, 32 | "palette": 0, 33 | "paletteIndex": 0, 34 | "objPalette": "OBP0", 35 | "priority": false 36 | }, 37 | { 38 | "id": "c7f96290-0943-4855-a706-f198accdca3f", 39 | "x": 8, 40 | "y": 0, 41 | "sliceX": 40, 42 | "sliceY": 0, 43 | "flipX": false, 44 | "flipY": false, 45 | "palette": 0, 46 | "paletteIndex": 0, 47 | "objPalette": "OBP0", 48 | "priority": false 49 | } 50 | ] 51 | } 52 | ] 53 | }, 54 | { 55 | "id": "1b2a6e13-d68d-4e1e-bbdf-8d6373c32aeb", 56 | "frames": [ 57 | { 58 | "id": "c8475e7f-f140-45a2-9e17-5f03dfc0b08a", 59 | "tiles": [] 60 | } 61 | ] 62 | }, 63 | { 64 | "id": "81693f16-7557-4275-8c3a-5e0870b4fb44", 65 | "frames": [ 66 | { 67 | "id": "1eca9394-f2ce-4e64-ae8c-3c0391c82a5f", 68 | "tiles": [ 69 | { 70 | "id": "ae5c1dc0-bc0d-473e-a60f-01681ee3fd93", 71 | "x": 0, 72 | "y": 0, 73 | "sliceX": 16, 74 | "sliceY": 0, 75 | "flipX": false, 76 | "flipY": false, 77 | "palette": 0, 78 | "paletteIndex": 0, 79 | "objPalette": "OBP0", 80 | "priority": false 81 | }, 82 | { 83 | "id": "3146fbf9-70c1-4f2a-ad22-24ca660214d3", 84 | "x": 8, 85 | "y": 0, 86 | "sliceX": 24, 87 | "sliceY": 0, 88 | "flipX": false, 89 | "flipY": false, 90 | "palette": 0, 91 | "paletteIndex": 0, 92 | "objPalette": "OBP0", 93 | "priority": false 94 | } 95 | ] 96 | } 97 | ] 98 | }, 99 | { 100 | "id": "3a6307b3-dc1b-4a21-ab60-0dfddc5778f9", 101 | "frames": [ 102 | { 103 | "id": "5937f120-b849-468b-956a-4c9cb8c3c86d", 104 | "tiles": [ 105 | { 106 | "id": "d713bb5d-ce8c-44c8-8644-164bdb67f43c", 107 | "x": 0, 108 | "y": 0, 109 | "sliceX": 0, 110 | "sliceY": 0, 111 | "flipX": false, 112 | "flipY": false, 113 | "palette": 0, 114 | "paletteIndex": 0, 115 | "objPalette": "OBP0", 116 | "priority": false 117 | }, 118 | { 119 | "id": "ce71fffe-8c06-452e-ae41-58fb3c6d5ff4", 120 | "x": 8, 121 | "y": 0, 122 | "sliceX": 8, 123 | "sliceY": 0, 124 | "flipX": false, 125 | "flipY": false, 126 | "palette": 0, 127 | "paletteIndex": 0, 128 | "objPalette": "OBP0", 129 | "priority": false 130 | } 131 | ] 132 | } 133 | ] 134 | }, 135 | { 136 | "id": "336dae45-eceb-4560-b1de-216d8bc33f92", 137 | "frames": [ 138 | { 139 | "id": "58ed464b-1a79-49a9-a5fa-138776eedd4f", 140 | "tiles": [] 141 | } 142 | ] 143 | }, 144 | { 145 | "id": "1ae0034b-0586-4bb6-9b7b-ef85eff01b07", 146 | "frames": [ 147 | { 148 | "id": "4d672da2-5d75-4890-b120-dbf90102e657", 149 | "tiles": [] 150 | } 151 | ] 152 | }, 153 | { 154 | "id": "4f325c7c-6920-4931-9895-90143ab32d74", 155 | "frames": [ 156 | { 157 | "id": "9b8a8826-7fef-4046-9b5d-2623a51d4ebd", 158 | "tiles": [] 159 | } 160 | ] 161 | }, 162 | { 163 | "id": "89c7a4f2-17a2-45bb-83e5-ab51d2e9e325", 164 | "frames": [ 165 | { 166 | "id": "66acaf4e-12d0-4fc8-9212-a950f6409ca8", 167 | "tiles": [] 168 | } 169 | ] 170 | } 171 | ] 172 | } 173 | ], 174 | "numTiles": 5, 175 | "canvasWidth": 16, 176 | "canvasHeight": 16, 177 | "boundsX": 0, 178 | "boundsY": 0, 179 | "boundsWidth": 16, 180 | "boundsHeight": 16, 181 | "animSpeed": 15 182 | } -------------------------------------------------------------------------------- /SubmapExamples/project/sprites/actor_animated.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "sprite", 3 | "id": "581d34d0-9591-4e6e-a609-1d94f203b0cd", 4 | "name": "actor_animated", 5 | "symbol": "sprite_actor_animated", 6 | "numFrames": 6, 7 | "filename": "actor_animated.png", 8 | "checksum": "cd6c8ebac31ccd6a325b8a7e94a05d442ae6725e", 9 | "width": 96, 10 | "height": 16, 11 | "states": [ 12 | { 13 | "id": "ce938dce-afdb-4ffc-bd45-5685c6cf78c5", 14 | "name": "", 15 | "animationType": "multi_movement", 16 | "flipLeft": true, 17 | "animations": [ 18 | { 19 | "id": "0218ae39-514d-40e8-981b-06aadbe8b5df", 20 | "frames": [ 21 | { 22 | "id": "52ad1d99-2142-4646-806f-7e98ffb49744", 23 | "tiles": [ 24 | { 25 | "id": "4575085b-128a-46e9-9a33-70c5ad5c551f", 26 | "x": 0, 27 | "y": 0, 28 | "sliceX": 64, 29 | "sliceY": 0, 30 | "flipX": false, 31 | "flipY": false, 32 | "palette": 0, 33 | "paletteIndex": 0, 34 | "objPalette": "OBP0", 35 | "priority": false 36 | }, 37 | { 38 | "id": "f69ec50d-9308-408f-b7dc-f70910e1f28c", 39 | "x": 8, 40 | "y": 0, 41 | "sliceX": 72, 42 | "sliceY": 0, 43 | "flipX": false, 44 | "flipY": false, 45 | "palette": 0, 46 | "paletteIndex": 0, 47 | "objPalette": "OBP0", 48 | "priority": false 49 | } 50 | ] 51 | } 52 | ] 53 | }, 54 | { 55 | "id": "0e7a0652-4d65-42fa-a132-7990d6bf2be0", 56 | "frames": [ 57 | { 58 | "id": "03bebd67-2463-4591-89d7-a79fca803d97", 59 | "tiles": [] 60 | } 61 | ] 62 | }, 63 | { 64 | "id": "ea5f8749-2233-4d96-9f58-3563d1342921", 65 | "frames": [ 66 | { 67 | "id": "9a46acfc-e6d7-40ab-bc32-250210299a1b", 68 | "tiles": [ 69 | { 70 | "id": "b3c9c1d3-9457-493a-a1a0-984f10f49f09", 71 | "x": 0, 72 | "y": 0, 73 | "sliceX": 32, 74 | "sliceY": 0, 75 | "flipX": false, 76 | "flipY": false, 77 | "palette": 0, 78 | "paletteIndex": 0, 79 | "objPalette": "OBP0", 80 | "priority": false 81 | }, 82 | { 83 | "id": "cdfdf21b-e964-4bda-884b-b783da94988b", 84 | "x": 8, 85 | "y": 0, 86 | "sliceX": 40, 87 | "sliceY": 0, 88 | "flipX": false, 89 | "flipY": false, 90 | "palette": 0, 91 | "paletteIndex": 0, 92 | "objPalette": "OBP0", 93 | "priority": false 94 | } 95 | ] 96 | } 97 | ] 98 | }, 99 | { 100 | "id": "52f6a5ec-ac99-4bc2-b5d8-8962a292f1aa", 101 | "frames": [ 102 | { 103 | "id": "97cc8146-ddfd-4b90-8382-a54e1b98305a", 104 | "tiles": [ 105 | { 106 | "id": "47fad96b-1d1e-4123-ad17-b8fdddc79220", 107 | "x": 0, 108 | "y": 0, 109 | "sliceX": 0, 110 | "sliceY": 0, 111 | "flipX": false, 112 | "flipY": false, 113 | "palette": 0, 114 | "paletteIndex": 0, 115 | "objPalette": "OBP0", 116 | "priority": false 117 | }, 118 | { 119 | "id": "f040d231-2bd5-4b83-b69f-925eb46328f3", 120 | "x": 8, 121 | "y": 0, 122 | "sliceX": 8, 123 | "sliceY": 0, 124 | "flipX": false, 125 | "flipY": false, 126 | "palette": 0, 127 | "paletteIndex": 0, 128 | "objPalette": "OBP0", 129 | "priority": false 130 | } 131 | ] 132 | } 133 | ] 134 | }, 135 | { 136 | "id": "f6926ffc-a46a-4148-88c7-59cd7806da8b", 137 | "frames": [ 138 | { 139 | "id": "90a92b91-2895-4dd1-a76f-59f7a5ed4fc1", 140 | "tiles": [ 141 | { 142 | "id": "a0095ca1-f658-4d43-9f51-1f309ee12c59", 143 | "x": 0, 144 | "y": 0, 145 | "sliceX": 80, 146 | "sliceY": 0, 147 | "flipX": false, 148 | "flipY": false, 149 | "palette": 0, 150 | "paletteIndex": 0, 151 | "objPalette": "OBP0", 152 | "priority": false 153 | }, 154 | { 155 | "id": "57d24bda-991b-4da8-8b9a-27b3a84c10e2", 156 | "x": 8, 157 | "y": 0, 158 | "sliceX": 88, 159 | "sliceY": 0, 160 | "flipX": false, 161 | "flipY": false, 162 | "palette": 0, 163 | "paletteIndex": 0, 164 | "objPalette": "OBP0", 165 | "priority": false 166 | } 167 | ] 168 | }, 169 | { 170 | "id": "830648ee-3b82-474b-ba1c-78be727c4432", 171 | "tiles": [ 172 | { 173 | "id": "06d000ef-ffdb-4fb3-842b-faa6bc1825b2", 174 | "x": 0, 175 | "y": 0, 176 | "sliceX": 64, 177 | "sliceY": 0, 178 | "flipX": false, 179 | "flipY": false, 180 | "palette": 0, 181 | "paletteIndex": 0, 182 | "objPalette": "OBP0", 183 | "priority": false 184 | }, 185 | { 186 | "id": "f16d9b17-b555-4262-b9f8-b7c2f3804cf3", 187 | "x": 8, 188 | "y": 0, 189 | "sliceX": 72, 190 | "sliceY": 0, 191 | "flipX": false, 192 | "flipY": false, 193 | "palette": 0, 194 | "paletteIndex": 0, 195 | "objPalette": "OBP0", 196 | "priority": false 197 | } 198 | ] 199 | } 200 | ] 201 | }, 202 | { 203 | "id": "211cad43-2a82-4c67-a346-f9afe2fcc824", 204 | "frames": [ 205 | { 206 | "id": "ef0ab6ed-ecb7-4160-93ed-aee994561fa8", 207 | "tiles": [] 208 | } 209 | ] 210 | }, 211 | { 212 | "id": "9b7654ab-4161-4e61-b089-5b87c51ff48a", 213 | "frames": [ 214 | { 215 | "id": "c27cf825-3e90-4384-a3f1-4d38f8003c7a", 216 | "tiles": [ 217 | { 218 | "id": "5d1c7b68-7d08-4718-9a9b-ece906dcf663", 219 | "x": 0, 220 | "y": 0, 221 | "sliceX": 48, 222 | "sliceY": 0, 223 | "flipX": false, 224 | "flipY": false, 225 | "palette": 0, 226 | "paletteIndex": 0, 227 | "objPalette": "OBP0", 228 | "priority": false 229 | }, 230 | { 231 | "id": "16f71c74-33ce-4526-9a31-23426c132989", 232 | "x": 8, 233 | "y": 0, 234 | "sliceX": 56, 235 | "sliceY": 0, 236 | "flipX": false, 237 | "flipY": false, 238 | "palette": 0, 239 | "paletteIndex": 0, 240 | "objPalette": "OBP0", 241 | "priority": false 242 | } 243 | ] 244 | }, 245 | { 246 | "id": "84bdf127-b1c1-4cf9-8265-e9bc36369388", 247 | "tiles": [ 248 | { 249 | "id": "5dff43c1-42e5-49c0-893d-f42c205c7494", 250 | "x": 0, 251 | "y": 0, 252 | "sliceX": 32, 253 | "sliceY": 0, 254 | "flipX": false, 255 | "flipY": false, 256 | "palette": 0, 257 | "paletteIndex": 0, 258 | "objPalette": "OBP0", 259 | "priority": false 260 | }, 261 | { 262 | "id": "81a66d32-ce87-4dab-b884-3762b3d394ee", 263 | "x": 8, 264 | "y": 0, 265 | "sliceX": 40, 266 | "sliceY": 0, 267 | "flipX": false, 268 | "flipY": false, 269 | "palette": 0, 270 | "paletteIndex": 0, 271 | "objPalette": "OBP0", 272 | "priority": false 273 | } 274 | ] 275 | } 276 | ] 277 | }, 278 | { 279 | "id": "b0445f1a-e053-495a-bd68-1c6ecf99b2f4", 280 | "frames": [ 281 | { 282 | "id": "0d972380-a934-4318-8ebf-58a1faf5800e", 283 | "tiles": [ 284 | { 285 | "id": "43087f62-d9ed-4b9a-83ea-f4554cc48ca7", 286 | "x": 0, 287 | "y": 0, 288 | "sliceX": 16, 289 | "sliceY": 0, 290 | "flipX": false, 291 | "flipY": false, 292 | "palette": 0, 293 | "paletteIndex": 0, 294 | "objPalette": "OBP0", 295 | "priority": false 296 | }, 297 | { 298 | "id": "33e1fdfa-b0e3-4f14-ae45-9fa95b398456", 299 | "x": 8, 300 | "y": 0, 301 | "sliceX": 24, 302 | "sliceY": 0, 303 | "flipX": false, 304 | "flipY": false, 305 | "palette": 0, 306 | "paletteIndex": 0, 307 | "objPalette": "OBP0", 308 | "priority": false 309 | } 310 | ] 311 | }, 312 | { 313 | "id": "8c5cffd7-1dc4-476e-a5b2-c9f8515ec98e", 314 | "tiles": [ 315 | { 316 | "id": "6502f65f-e7d5-4f79-adfa-f76648edee7a", 317 | "x": 0, 318 | "y": 0, 319 | "sliceX": 0, 320 | "sliceY": 0, 321 | "flipX": false, 322 | "flipY": false, 323 | "palette": 0, 324 | "paletteIndex": 0, 325 | "objPalette": "OBP0", 326 | "priority": false 327 | }, 328 | { 329 | "id": "33fe1ded-44af-4c0d-ac69-7943eb0e07a7", 330 | "x": 8, 331 | "y": 0, 332 | "sliceX": 8, 333 | "sliceY": 0, 334 | "flipX": false, 335 | "flipY": false, 336 | "palette": 0, 337 | "paletteIndex": 0, 338 | "objPalette": "OBP0", 339 | "priority": false 340 | } 341 | ] 342 | } 343 | ] 344 | } 345 | ] 346 | } 347 | ], 348 | "numTiles": 10, 349 | "canvasWidth": 16, 350 | "canvasHeight": 16, 351 | "boundsX": 0, 352 | "boundsY": 0, 353 | "boundsWidth": 16, 354 | "boundsHeight": 8, 355 | "animSpeed": 15 356 | } -------------------------------------------------------------------------------- /SubmapExamples/project/sprites/intro_tileset1.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "sprite", 3 | "id": "c4099d9b-1b21-41d6-8abd-158132c298e2", 4 | "name": "intro_tileset1", 5 | "symbol": "sprite_intro_tileset1", 6 | "numFrames": 4, 7 | "filename": "intro_tileset1.png", 8 | "checksum": "c161e72a9bd8466395d7bca5114cfa16b64a43cd", 9 | "width": 64, 10 | "height": 80, 11 | "states": [ 12 | { 13 | "id": "47b02193-ad25-4053-935c-3cb55441d9b7", 14 | "name": "", 15 | "animationType": "multi_movement", 16 | "flipLeft": false, 17 | "animations": [ 18 | { 19 | "id": "b3ab4a03-adea-4065-83a5-b9172d36bd48", 20 | "frames": [ 21 | { 22 | "id": "e4aa4cb5-7db8-46dd-a36e-2bde7b020a43", 23 | "tiles": [ 24 | { 25 | "id": "5f54ee7b-535f-4c4e-9718-447f0b113320", 26 | "x": -3, 27 | "y": 11, 28 | "sliceX": 32, 29 | "sliceY": 48, 30 | "palette": 0, 31 | "flipX": false, 32 | "flipY": false, 33 | "objPalette": "OBP0", 34 | "paletteIndex": 0, 35 | "priority": false 36 | }, 37 | { 38 | "id": "64cf4a15-9c78-48ef-a024-7b733f5e5469", 39 | "x": 6, 40 | "y": 11, 41 | "sliceX": 32, 42 | "sliceY": 48, 43 | "palette": 0, 44 | "flipX": false, 45 | "flipY": false, 46 | "objPalette": "OBP0", 47 | "paletteIndex": 0, 48 | "priority": false 49 | }, 50 | { 51 | "id": "64e3bcd4-fca3-4edd-88af-682632c3d426", 52 | "x": -6, 53 | "y": 7, 54 | "sliceX": 24, 55 | "sliceY": 64, 56 | "palette": 0, 57 | "flipX": false, 58 | "flipY": false, 59 | "objPalette": "OBP0", 60 | "paletteIndex": 0, 61 | "priority": false 62 | } 63 | ] 64 | }, 65 | { 66 | "id": "716e8545-5681-4707-b0fc-be6692012a77", 67 | "tiles": [ 68 | { 69 | "id": "44f93582-8a03-43b0-b07f-fd9eba9bdc9d", 70 | "x": -3, 71 | "y": 11, 72 | "sliceX": 32, 73 | "sliceY": 48, 74 | "palette": 0, 75 | "flipX": false, 76 | "flipY": false, 77 | "objPalette": "OBP0", 78 | "paletteIndex": 0, 79 | "priority": false 80 | }, 81 | { 82 | "id": "b81d7b7c-2ab9-4a60-b0bb-c18f5424d306", 83 | "x": 6, 84 | "y": 11, 85 | "sliceX": 32, 86 | "sliceY": 48, 87 | "palette": 0, 88 | "flipX": false, 89 | "flipY": false, 90 | "objPalette": "OBP0", 91 | "paletteIndex": 0, 92 | "priority": false 93 | }, 94 | { 95 | "id": "ebe47996-bd5a-45a4-b7ab-6ae819d6a680", 96 | "x": -13, 97 | "y": 12, 98 | "sliceX": 32, 99 | "sliceY": 64, 100 | "palette": 0, 101 | "flipX": false, 102 | "flipY": false, 103 | "objPalette": "OBP0", 104 | "paletteIndex": 0, 105 | "priority": false 106 | }, 107 | { 108 | "id": "21b04654-d91e-48ef-b2c3-7c114c33c1cf", 109 | "x": -5, 110 | "y": 12, 111 | "sliceX": 40, 112 | "sliceY": 64, 113 | "palette": 0, 114 | "flipX": false, 115 | "flipY": false, 116 | "objPalette": "OBP0", 117 | "paletteIndex": 0, 118 | "priority": false 119 | } 120 | ] 121 | } 122 | ] 123 | }, 124 | { 125 | "id": "cdeea62b-724f-44a8-82b5-9537d1d1258a", 126 | "frames": [ 127 | { 128 | "id": "ee78508a-9360-4c50-8908-af75085ce8ef", 129 | "tiles": [ 130 | { 131 | "id": "7caf57fd-8c03-47f3-9877-4d8e4a6969bf", 132 | "x": -3, 133 | "y": 11, 134 | "sliceX": 32, 135 | "sliceY": 48, 136 | "palette": 0, 137 | "flipX": false, 138 | "flipY": false, 139 | "objPalette": "OBP0", 140 | "paletteIndex": 0, 141 | "priority": false 142 | }, 143 | { 144 | "id": "f3e61528-09cd-4807-a432-62171dfa51a7", 145 | "x": 6, 146 | "y": 11, 147 | "sliceX": 40, 148 | "sliceY": 48, 149 | "palette": 0, 150 | "flipX": false, 151 | "flipY": false, 152 | "objPalette": "OBP0", 153 | "paletteIndex": 0, 154 | "priority": false 155 | }, 156 | { 157 | "id": "5a9d4481-1fee-432e-8fed-0e33f17c8e2e", 158 | "x": -10, 159 | "y": 12, 160 | "sliceX": 48, 161 | "sliceY": 64, 162 | "palette": 0, 163 | "flipX": false, 164 | "flipY": false, 165 | "objPalette": "OBP0", 166 | "paletteIndex": 0, 167 | "priority": false 168 | }, 169 | { 170 | "id": "6ce9681d-d9c4-428e-a527-eb4fb6f5c80c", 171 | "x": -2, 172 | "y": 12, 173 | "sliceX": 56, 174 | "sliceY": 64, 175 | "palette": 0, 176 | "flipX": false, 177 | "flipY": false, 178 | "objPalette": "OBP0", 179 | "paletteIndex": 0, 180 | "priority": false 181 | } 182 | ] 183 | }, 184 | { 185 | "id": "03b48e89-1d9a-43ae-9d65-04a4170c0cc9", 186 | "tiles": [ 187 | { 188 | "id": "476011eb-6174-424d-b8aa-b6cfa2e46d1c", 189 | "x": 6, 190 | "y": 11, 191 | "sliceX": 40, 192 | "sliceY": 48, 193 | "palette": 0, 194 | "flipX": false, 195 | "flipY": false, 196 | "objPalette": "OBP0", 197 | "paletteIndex": 0, 198 | "priority": false 199 | }, 200 | { 201 | "id": "d6a5b826-6e5a-445a-be1e-8bd6e88a4013", 202 | "x": -4, 203 | "y": 11, 204 | "sliceX": 40, 205 | "sliceY": 48, 206 | "palette": 0, 207 | "flipX": true, 208 | "flipY": false, 209 | "objPalette": "OBP0", 210 | "paletteIndex": 0, 211 | "priority": false 212 | } 213 | ] 214 | }, 215 | { 216 | "id": "7fe2a36c-3f73-4fb9-b1f2-ab54ff7ebe08", 217 | "tiles": [ 218 | { 219 | "id": "e132e53c-d108-45bc-9aa4-015819cd65d7", 220 | "x": -3, 221 | "y": 10, 222 | "sliceX": 32, 223 | "sliceY": 48, 224 | "palette": 0, 225 | "flipX": false, 226 | "flipY": false, 227 | "objPalette": "OBP0", 228 | "paletteIndex": 0, 229 | "priority": false 230 | }, 231 | { 232 | "id": "f59ec098-72e5-461e-acf4-bee9540a1b89", 233 | "x": 6, 234 | "y": 10, 235 | "sliceX": 32, 236 | "sliceY": 48, 237 | "palette": 0, 238 | "flipX": false, 239 | "flipY": false, 240 | "objPalette": "OBP0", 241 | "paletteIndex": 0, 242 | "priority": false 243 | } 244 | ] 245 | }, 246 | { 247 | "id": "d722b8f9-ceb9-4b25-b91e-b2ab147b63d0", 248 | "tiles": [ 249 | { 250 | "id": "4659626a-1028-4b86-bb02-7b5a8c2ab318", 251 | "x": 6, 252 | "y": 11, 253 | "sliceX": 40, 254 | "sliceY": 48, 255 | "palette": 0, 256 | "flipX": false, 257 | "flipY": false, 258 | "objPalette": "OBP0", 259 | "paletteIndex": 0, 260 | "priority": false 261 | }, 262 | { 263 | "id": "45abb66e-dc64-4851-91ab-956779fa0b90", 264 | "x": -4, 265 | "y": 11, 266 | "sliceX": 40, 267 | "sliceY": 48, 268 | "palette": 0, 269 | "flipX": true, 270 | "flipY": false, 271 | "objPalette": "OBP0", 272 | "paletteIndex": 0, 273 | "priority": false 274 | } 275 | ] 276 | }, 277 | { 278 | "id": "5770fd6e-3d2c-4fa8-8290-05f6aa3b6ea9", 279 | "tiles": [ 280 | { 281 | "id": "ebd27a14-f2ef-4575-a5a4-e29bedf10bd8", 282 | "x": -3, 283 | "y": 10, 284 | "sliceX": 32, 285 | "sliceY": 48, 286 | "palette": 0, 287 | "flipX": false, 288 | "flipY": false, 289 | "objPalette": "OBP0", 290 | "paletteIndex": 0, 291 | "priority": false 292 | }, 293 | { 294 | "id": "51a18446-0ecb-442f-875a-3bcd685ac84f", 295 | "x": 6, 296 | "y": 10, 297 | "sliceX": 32, 298 | "sliceY": 48, 299 | "palette": 0, 300 | "flipX": false, 301 | "flipY": false, 302 | "objPalette": "OBP0", 303 | "paletteIndex": 0, 304 | "priority": false 305 | } 306 | ] 307 | } 308 | ] 309 | }, 310 | { 311 | "id": "c039c103-e491-4031-9c0c-832cb633506a", 312 | "frames": [ 313 | { 314 | "id": "9ce60665-2b34-433c-a6ba-f7fcb41288b6", 315 | "tiles": [ 316 | { 317 | "id": "3d1b11ec-5747-4569-9316-835fc104bad5", 318 | "x": 0, 319 | "y": 14, 320 | "sliceX": 48, 321 | "sliceY": 48, 322 | "palette": 0, 323 | "flipX": false, 324 | "flipY": false, 325 | "objPalette": "OBP0", 326 | "paletteIndex": 0, 327 | "priority": false 328 | }, 329 | { 330 | "id": "1e6d80f1-c84d-41db-b375-1171e838642b", 331 | "x": 8, 332 | "y": 14, 333 | "sliceX": 56, 334 | "sliceY": 48, 335 | "palette": 0, 336 | "flipX": false, 337 | "flipY": false, 338 | "objPalette": "OBP0", 339 | "paletteIndex": 0, 340 | "priority": false 341 | } 342 | ] 343 | }, 344 | { 345 | "id": "5c539ba6-4d17-423a-b14e-f15674a14c55", 346 | "tiles": [ 347 | { 348 | "id": "a6893aa7-16f4-4bf9-a373-c5d19424f29a", 349 | "x": 0, 350 | "y": 15, 351 | "sliceX": 0, 352 | "sliceY": 64, 353 | "palette": 0, 354 | "flipX": false, 355 | "flipY": false, 356 | "objPalette": "OBP0", 357 | "paletteIndex": 0, 358 | "priority": false 359 | }, 360 | { 361 | "id": "155e19e3-545c-43aa-b4f2-59b66ab1db8a", 362 | "x": 8, 363 | "y": 15, 364 | "sliceX": 8, 365 | "sliceY": 64, 366 | "palette": 0, 367 | "flipX": false, 368 | "flipY": false, 369 | "objPalette": "OBP0", 370 | "paletteIndex": 0, 371 | "priority": false 372 | } 373 | ] 374 | } 375 | ] 376 | }, 377 | { 378 | "id": "4472f254-e93a-454c-8b0c-9ae05526fd7a", 379 | "frames": [ 380 | { 381 | "id": "24e2ef9e-1752-4d2e-9960-b36340496497", 382 | "tiles": [ 383 | { 384 | "id": "f0ed1eb2-9953-485e-8adc-1a50594d9b54", 385 | "x": 8, 386 | "y": 16, 387 | "sliceX": 16, 388 | "sliceY": 64, 389 | "palette": 0, 390 | "flipX": false, 391 | "flipY": false, 392 | "objPalette": "OBP0", 393 | "paletteIndex": 0, 394 | "priority": false 395 | }, 396 | { 397 | "id": "a68f536a-ecc8-45ab-905e-86bc43a55768", 398 | "x": -1, 399 | "y": 16, 400 | "sliceX": 16, 401 | "sliceY": 64, 402 | "palette": 0, 403 | "flipX": true, 404 | "flipY": false, 405 | "objPalette": "OBP0", 406 | "paletteIndex": 0, 407 | "priority": false 408 | } 409 | ] 410 | }, 411 | { 412 | "id": "e32a18b5-0139-437b-8178-eff14a6fc9cf", 413 | "tiles": [ 414 | { 415 | "id": "1bc64a2d-fc74-4754-99f9-b3068c524989", 416 | "x": 0, 417 | "y": 14, 418 | "sliceX": 32, 419 | "sliceY": 48, 420 | "palette": 0, 421 | "flipX": false, 422 | "flipY": false, 423 | "objPalette": "OBP0", 424 | "paletteIndex": 0, 425 | "priority": false 426 | }, 427 | { 428 | "id": "18a634f0-610a-46ec-9543-78be03e71c4c", 429 | "x": 9, 430 | "y": 14, 431 | "sliceX": 32, 432 | "sliceY": 48, 433 | "palette": 0, 434 | "flipX": false, 435 | "flipY": false, 436 | "objPalette": "OBP0", 437 | "paletteIndex": 0, 438 | "priority": false 439 | } 440 | ] 441 | }, 442 | { 443 | "id": "c3e72a12-f8c9-488e-868c-24bf9f57cd99", 444 | "tiles": [ 445 | { 446 | "id": "07a224c4-08d6-499b-a03a-faa8ce7df171", 447 | "x": 8, 448 | "y": 16, 449 | "sliceX": 16, 450 | "sliceY": 64, 451 | "palette": 0, 452 | "flipX": false, 453 | "flipY": false, 454 | "objPalette": "OBP0", 455 | "paletteIndex": 0, 456 | "priority": false 457 | }, 458 | { 459 | "id": "199fcd25-dd24-48ad-a9ad-937c15c9d1dd", 460 | "x": -1, 461 | "y": 16, 462 | "sliceX": 16, 463 | "sliceY": 64, 464 | "palette": 0, 465 | "flipX": true, 466 | "flipY": false, 467 | "objPalette": "OBP0", 468 | "paletteIndex": 0, 469 | "priority": false 470 | } 471 | ] 472 | }, 473 | { 474 | "id": "857b50d2-5f09-48cb-887a-43db5e372b05", 475 | "tiles": [ 476 | { 477 | "id": "7042e48a-92d3-406b-842d-5f5f8b9e7e58", 478 | "x": 0, 479 | "y": 14, 480 | "sliceX": 32, 481 | "sliceY": 48, 482 | "palette": 0, 483 | "flipX": false, 484 | "flipY": false, 485 | "objPalette": "OBP0", 486 | "paletteIndex": 0, 487 | "priority": false 488 | }, 489 | { 490 | "id": "1e5701e2-ee7b-480f-a40f-6aec6c680011", 491 | "x": 9, 492 | "y": 14, 493 | "sliceX": 32, 494 | "sliceY": 48, 495 | "palette": 0, 496 | "flipX": false, 497 | "flipY": false, 498 | "objPalette": "OBP0", 499 | "paletteIndex": 0, 500 | "priority": false 501 | } 502 | ] 503 | }, 504 | { 505 | "id": "dc251dcd-a571-4df9-9daa-81564a2c581d", 506 | "tiles": [ 507 | { 508 | "id": "ce9356e1-1ebb-4e3e-ad6f-b8b71481e378", 509 | "x": 8, 510 | "y": 16, 511 | "sliceX": 16, 512 | "sliceY": 64, 513 | "palette": 0, 514 | "flipX": false, 515 | "flipY": false, 516 | "objPalette": "OBP0", 517 | "paletteIndex": 0, 518 | "priority": false 519 | }, 520 | { 521 | "id": "79ccd4da-bcd5-45a8-8747-aecbd59e2f01", 522 | "x": -1, 523 | "y": 16, 524 | "sliceX": 16, 525 | "sliceY": 64, 526 | "palette": 0, 527 | "flipX": true, 528 | "flipY": false, 529 | "objPalette": "OBP0", 530 | "paletteIndex": 0, 531 | "priority": false 532 | } 533 | ] 534 | } 535 | ] 536 | }, 537 | { 538 | "id": "01f26cc3-ed75-40fd-b60f-d03ccbb45a58", 539 | "frames": [ 540 | { 541 | "id": "d66f2b6d-75bd-4d9f-8bcb-e4daef8ed3bc", 542 | "tiles": [] 543 | } 544 | ] 545 | }, 546 | { 547 | "id": "b3e4c232-6fee-44ac-b737-50d0a6e4fcb4", 548 | "frames": [ 549 | { 550 | "id": "57979e0f-7d8a-4a7e-a03c-f2cc9b450364", 551 | "tiles": [] 552 | } 553 | ] 554 | }, 555 | { 556 | "id": "88ad9874-46fb-4dc8-a728-a0edee13c908", 557 | "frames": [ 558 | { 559 | "id": "214ac6e1-66c6-4f51-a6da-3534670e3968", 560 | "tiles": [] 561 | } 562 | ] 563 | }, 564 | { 565 | "id": "5e9429f6-2364-4d00-9d3b-9086f45cfa1e", 566 | "frames": [ 567 | { 568 | "id": "570d8086-6184-41fb-9361-bb95a61f20cc", 569 | "tiles": [] 570 | } 571 | ] 572 | } 573 | ] 574 | } 575 | ], 576 | "numTiles": 11, 577 | "canvasWidth": 64, 578 | "canvasHeight": 64, 579 | "boundsX": 0, 580 | "boundsY": 0, 581 | "boundsWidth": 16, 582 | "boundsHeight": 16, 583 | "animSpeed": 15 584 | } -------------------------------------------------------------------------------- /SubmapExamples/project/sprites/static.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "sprite", 3 | "id": "daf95270-e30d-423b-9ee7-990ae29f57f6", 4 | "name": "static", 5 | "symbol": "sprite_static", 6 | "numFrames": 1, 7 | "filename": "static.png", 8 | "checksum": "ed08d198cc3dd48f9bfba000769904ae41b36db8", 9 | "width": 16, 10 | "height": 16, 11 | "states": [ 12 | { 13 | "id": "c37ce5b9-288c-45f6-8b07-926ae6f64d52", 14 | "name": "", 15 | "animationType": "fixed", 16 | "flipLeft": false, 17 | "animations": [ 18 | { 19 | "id": "e1e8a579-58fc-4314-9592-d188b16d06b0", 20 | "frames": [ 21 | { 22 | "id": "899df7f2-fc01-4a32-87bd-621caffff6ad", 23 | "tiles": [ 24 | { 25 | "id": "b29ef538-ab11-4f4a-a40d-8a47ed874aab", 26 | "x": 0, 27 | "y": 0, 28 | "sliceX": 0, 29 | "sliceY": 0, 30 | "flipX": false, 31 | "flipY": false, 32 | "palette": 0, 33 | "paletteIndex": 0, 34 | "objPalette": "OBP0", 35 | "priority": false 36 | }, 37 | { 38 | "id": "2e22a4fc-0615-41b3-8fad-54371a5b590a", 39 | "x": 8, 40 | "y": 0, 41 | "sliceX": 8, 42 | "sliceY": 0, 43 | "flipX": false, 44 | "flipY": false, 45 | "palette": 0, 46 | "paletteIndex": 0, 47 | "objPalette": "OBP0", 48 | "priority": false 49 | } 50 | ] 51 | } 52 | ] 53 | }, 54 | { 55 | "id": "07c365c2-1226-4704-b0b5-8880c2855ff8", 56 | "frames": [ 57 | { 58 | "id": "e41a2350-6e59-4ab4-a2d4-9d43f7b4cc4e", 59 | "tiles": [] 60 | } 61 | ] 62 | }, 63 | { 64 | "id": "45a67ac2-ec73-41a0-bfb1-4ed2a5140cda", 65 | "frames": [ 66 | { 67 | "id": "2ee1b43b-1cf5-4fe5-b74e-a4c116a50b97", 68 | "tiles": [] 69 | } 70 | ] 71 | }, 72 | { 73 | "id": "62c4a826-ea90-415b-b9e6-f69ee3fe3cbb", 74 | "frames": [ 75 | { 76 | "id": "71881de0-00c9-4ce0-9908-ea8d1d825b38", 77 | "tiles": [] 78 | } 79 | ] 80 | }, 81 | { 82 | "id": "bd73b47a-7b33-4ea0-8ea4-e372be06c9fb", 83 | "frames": [ 84 | { 85 | "id": "499e3970-c673-46e5-b14d-e46754866b16", 86 | "tiles": [] 87 | } 88 | ] 89 | }, 90 | { 91 | "id": "fa4088e8-c3fb-45f2-a88d-de174898f712", 92 | "frames": [ 93 | { 94 | "id": "63539fbb-8491-4da2-90a0-9038af0d879e", 95 | "tiles": [] 96 | } 97 | ] 98 | }, 99 | { 100 | "id": "b311bbc4-2e23-4ad1-a1c9-246437c13f4e", 101 | "frames": [ 102 | { 103 | "id": "12785685-91cb-46b0-8305-7521ef45595e", 104 | "tiles": [] 105 | } 106 | ] 107 | }, 108 | { 109 | "id": "db0ebf59-c12f-4180-a0a5-b63a935fe40a", 110 | "frames": [ 111 | { 112 | "id": "7a79af70-abae-4d59-adfe-fcd24a5a95a3", 113 | "tiles": [] 114 | } 115 | ] 116 | } 117 | ] 118 | } 119 | ], 120 | "numTiles": 2, 121 | "canvasWidth": 16, 122 | "canvasHeight": 16, 123 | "boundsX": 0, 124 | "boundsY": 0, 125 | "boundsWidth": 16, 126 | "boundsHeight": 16, 127 | "animSpeed": 15 128 | } -------------------------------------------------------------------------------- /SubmapExamples/project/tilesets/pkm_battle_tileset.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "tileset", 3 | "id": "f21d7b04-32df-45a8-99a5-52fdcc5182ed", 4 | "name": "pkm_battle_tileset", 5 | "symbol": "tileset_pkm_battle_tileset", 6 | "width": 16, 7 | "height": 16, 8 | "imageWidth": 128, 9 | "imageHeight": 128, 10 | "filename": "pkm_battle_tileset.png" 11 | } -------------------------------------------------------------------------------- /SubmapExamples/project/variables.gbsres: -------------------------------------------------------------------------------- 1 | { 2 | "_resourceType": "variables", 3 | "variables": [ 4 | { 5 | "id": "0", 6 | "name": "CurrentBackId", 7 | "symbol": "var_currentbackid" 8 | }, 9 | { 10 | "id": "1", 11 | "name": "CurrentFrontId", 12 | "symbol": "var_currentfrontid" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /SubmappingExPlugin_v3/engine/engine.json: -------------------------------------------------------------------------------- 1 | {"version": "3.0.0-e0"} -------------------------------------------------------------------------------- /SubmappingExPlugin_v3/engine/src/copy_scene_parts.c: -------------------------------------------------------------------------------- 1 | #pragma bank 255 2 | 3 | #include 4 | #include "system.h" 5 | #include "vm.h" 6 | #include "gbs_types.h" 7 | #include "scroll.h" 8 | #include "bankdata.h" 9 | #include "data_manager.h" 10 | 11 | UBYTE tmp_tile_buffer[32]; 12 | 13 | void set_xy_win_submap(const UBYTE * source, UBYTE bank, UBYTE width, UBYTE x, UBYTE y, UBYTE w, UBYTE h) OLDCALL; 14 | 15 | void copy_background_submap_to_overlay(SCRIPT_CTX * THIS) OLDCALL BANKED { 16 | 17 | uint8_t source_x = *(int8_t*)VM_REF_TO_PTR(FN_ARG0); 18 | uint8_t source_y = *(int8_t*)VM_REF_TO_PTR(FN_ARG1); 19 | uint8_t dest_x = *(int8_t*)VM_REF_TO_PTR(FN_ARG2); 20 | uint8_t dest_y = *(int8_t*)VM_REF_TO_PTR(FN_ARG3); 21 | uint8_t width = *(int8_t*)VM_REF_TO_PTR(FN_ARG4); 22 | uint8_t height = *(int8_t*)VM_REF_TO_PTR(FN_ARG5); 23 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG6); 24 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG7); 25 | scene_t scn; 26 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 27 | background_t bkg; 28 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 29 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 30 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 31 | int16_t offset = (source_y * (int16_t)bkg.width) + source_x; 32 | #ifdef CGB 33 | if (_is_CGB) { 34 | VBK_REG = 1; 35 | set_xy_win_submap(tilemap_attr_ptr + offset, bkg.cgb_tilemap_attr.bank, bkg.width, dest_x, dest_y, width, height); 36 | VBK_REG = 0; 37 | } 38 | #endif 39 | set_xy_win_submap(tilemap_ptr + offset, bkg.tilemap.bank, bkg.width, dest_x, dest_y, width, height); 40 | 41 | } 42 | 43 | void copy_background_submap_to_overlay_base(SCRIPT_CTX * THIS) OLDCALL BANKED { 44 | int16_t bkg_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG0); 45 | int16_t dest_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG1); 46 | int16_t wh = *(int16_t*)VM_REF_TO_PTR(FN_ARG2); 47 | uint8_t tile_idx_offset = *(int8_t*)VM_REF_TO_PTR(FN_ARG3); 48 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG4); 49 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG5); 50 | 51 | UBYTE source_x = bkg_pos & 0xFF; 52 | UBYTE source_y = (bkg_pos >> 8) & 0xFF; 53 | UBYTE dest_x = dest_pos & 0xFF; 54 | UBYTE dest_y = (dest_pos >> 8) & 0xFF; 55 | UBYTE width = (wh & 0xFF) & 31; 56 | UBYTE height = ((wh >> 8) & 0xFF) & 31; 57 | 58 | scene_t scn; 59 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 60 | background_t bkg; 61 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 62 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 63 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 64 | 65 | UBYTE buffer_size = sizeof(UBYTE) * width; 66 | for (uint8_t i = 0; i < height; i++){ 67 | int16_t offset = ((source_y + i) * (int16_t)bkg.width) + source_x; 68 | #ifdef CGB 69 | if (_is_CGB) { 70 | VBK_REG = 1; 71 | MemcpyBanked(tmp_tile_buffer, tilemap_attr_ptr + offset, buffer_size, bkg.cgb_tilemap_attr.bank); 72 | set_win_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer); 73 | VBK_REG = 0; 74 | } 75 | #endif 76 | MemcpyBanked(tmp_tile_buffer, tilemap_ptr + offset, buffer_size, bkg.tilemap.bank); 77 | set_win_based_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer, tile_idx_offset); 78 | } 79 | } 80 | 81 | 82 | void copy_background_submap_to_background(SCRIPT_CTX * THIS) OLDCALL BANKED { 83 | 84 | uint8_t source_x = *(int8_t*)VM_REF_TO_PTR(FN_ARG0); 85 | uint8_t source_y = *(int8_t*)VM_REF_TO_PTR(FN_ARG1); 86 | uint8_t dest_x = *(int8_t*)VM_REF_TO_PTR(FN_ARG2); 87 | uint8_t dest_y = *(int8_t*)VM_REF_TO_PTR(FN_ARG3); 88 | uint8_t width = *(int8_t*)VM_REF_TO_PTR(FN_ARG4) & 31; 89 | uint8_t height = *(int8_t*)VM_REF_TO_PTR(FN_ARG5) & 31; 90 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG6); 91 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG7); 92 | scene_t scn; 93 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 94 | background_t bkg; 95 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 96 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 97 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 98 | 99 | UBYTE buffer_size = sizeof(UBYTE) * width; 100 | for (uint8_t i = 0; i < height; i++){ 101 | int16_t offset = ((source_y + i) * (int16_t)bkg.width) + source_x; 102 | #ifdef CGB 103 | if (_is_CGB) { 104 | VBK_REG = 1; 105 | MemcpyBanked(tmp_tile_buffer, tilemap_attr_ptr + offset, buffer_size, bkg.cgb_tilemap_attr.bank); 106 | set_bkg_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer); 107 | VBK_REG = 0; 108 | } 109 | #endif 110 | MemcpyBanked(tmp_tile_buffer, tilemap_ptr + offset, buffer_size, bkg.tilemap.bank); 111 | set_bkg_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer); 112 | } 113 | 114 | } 115 | 116 | void copy_background_submap_to_background_base(SCRIPT_CTX * THIS) OLDCALL BANKED { 117 | int16_t bkg_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG0); 118 | int16_t dest_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG1); 119 | int16_t wh = *(int16_t*)VM_REF_TO_PTR(FN_ARG2); 120 | uint8_t tile_idx_offset = *(int8_t*)VM_REF_TO_PTR(FN_ARG3); 121 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG4); 122 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG5); 123 | 124 | UBYTE source_x = bkg_pos & 0xFF; 125 | UBYTE source_y = (bkg_pos >> 8) & 0xFF; 126 | UBYTE dest_x = dest_pos & 0xFF; 127 | UBYTE dest_y = (dest_pos >> 8) & 0xFF; 128 | UBYTE width = (wh & 0xFF) & 31; 129 | UBYTE height = ((wh >> 8) & 0xFF) & 31; 130 | 131 | scene_t scn; 132 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 133 | background_t bkg; 134 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 135 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 136 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 137 | 138 | UBYTE buffer_size = sizeof(UBYTE) * width; 139 | 140 | for (uint8_t i = 0; i < height; i++){ 141 | int16_t offset = ((source_y + i) * (int16_t)bkg.width) + source_x; 142 | #ifdef CGB 143 | if (_is_CGB) { 144 | VBK_REG = 1; 145 | MemcpyBanked(tmp_tile_buffer, tilemap_attr_ptr + offset, buffer_size, bkg.cgb_tilemap_attr.bank); 146 | set_bkg_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer); 147 | VBK_REG = 0; 148 | } 149 | #endif 150 | MemcpyBanked(tmp_tile_buffer, tilemap_ptr + offset, buffer_size, bkg.tilemap.bank); 151 | set_bkg_based_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer, tile_idx_offset); 152 | } 153 | } 154 | 155 | void copy_background_submap_to_tileset(SCRIPT_CTX * THIS) OLDCALL BANKED { 156 | int16_t source_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG0); 157 | int16_t dest_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG1); 158 | int16_t wh = *(int16_t*)VM_REF_TO_PTR(FN_ARG2); 159 | int16_t overlay_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG3); 160 | uint8_t copy_attributes = *(int8_t*)VM_REF_TO_PTR(FN_ARG4); 161 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG5); 162 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG6); 163 | 164 | UBYTE source_x = source_pos & 0xFF; 165 | UBYTE source_y = (source_pos >> 8) & 0xFF; 166 | UBYTE dest_x = dest_pos & 0xFF; 167 | UBYTE dest_y = (dest_pos >> 8) & 0xFF; 168 | UBYTE width = (wh & 0xFF) & 31; 169 | UBYTE height = ((wh >> 8) & 0xFF) & 31; 170 | UBYTE overlay_x = overlay_pos & 0xFF; 171 | UBYTE overlay_y = (overlay_pos >> 8) & 0xFF; 172 | 173 | scene_t scn; 174 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 175 | background_t bkg; 176 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 177 | const tileset_t* tileset = bkg.tileset.ptr; 178 | UWORD n_tiles = ReadBankedUWORD(&(tileset->n_tiles), bkg.tileset.bank); 179 | UBYTE ui_reserved_offset = (n_tiles > 128 && n_tiles < 192)? (192 - n_tiles): 0; 180 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 181 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 182 | 183 | const tileset_t* cgb_tileset = bkg.cgb_tileset.ptr; 184 | 185 | UBYTE buffer_size = sizeof(UBYTE) * width; 186 | for (uint8_t i = 0; i < height; i++){ 187 | uint16_t source_offset = ((source_y + i) * (uint16_t)bkg.width) + source_x; 188 | uint16_t dest_offset = ((dest_y + i) * (uint16_t)image_tile_width) + dest_x; 189 | for (uint8_t j = 0; j < width; j++){ 190 | UBYTE dest_tile = ReadBankedUBYTE(image_ptr + (uint16_t)(dest_offset + j), image_bank); 191 | UBYTE source_tile = ReadBankedUBYTE(tilemap_ptr + (uint16_t)(source_offset + j), bkg.tilemap.bank); 192 | if (ui_reserved_offset && source_tile >= 128){ 193 | source_tile = source_tile - ui_reserved_offset; 194 | } 195 | #ifdef CGB 196 | if (_is_CGB) { 197 | 198 | UBYTE dest_attr = ReadBankedUBYTE(image_attr_ptr + (uint16_t)(dest_offset + j), image_attr_bank); 199 | UBYTE source_attr = ReadBankedUBYTE(tilemap_attr_ptr + (uint16_t)(source_offset + j), bkg.cgb_tilemap_attr.bank); 200 | if (copy_attributes){ 201 | VBK_REG = 1; 202 | if (copy_attributes == 1){ 203 | set_bkg_tile_xy((dest_x + j) & 31, (dest_y + i) & 31, (dest_attr & 0x08)? (source_attr | 0x08): (source_attr & ~0x08)); 204 | } else if (copy_attributes == 2){ 205 | set_win_tile_xy((overlay_x + j) & 31, (overlay_y + i) & 31, (dest_attr & 0x08)? (source_attr | 0x08): (source_attr & ~0x08)); 206 | } 207 | VBK_REG = 0; 208 | } 209 | if (dest_attr & 0x08){ 210 | VBK_REG = 1; 211 | } 212 | if (cgb_tileset && (source_attr & 0x08)){ 213 | SetBankedBkgData(dest_tile, 1, cgb_tileset->tiles + (uint16_t)(source_tile << 4), bkg.cgb_tileset.bank); 214 | } else { 215 | SetBankedBkgData(dest_tile, 1, tileset->tiles + (uint16_t)(source_tile << 4), bkg.tileset.bank); 216 | } 217 | VBK_REG = 0; 218 | } else { 219 | SetBankedBkgData(dest_tile, 1, tileset->tiles + (uint16_t)(source_tile << 4), bkg.tileset.bank); 220 | } 221 | #else 222 | SetBankedBkgData(dest_tile, 1, tileset->tiles + (uint16_t)(source_tile << 4), bkg.tileset.bank); 223 | #endif 224 | } 225 | } 226 | } 227 | 228 | void vm_replace_background_tile(SCRIPT_CTX * THIS) OLDCALL BANKED { 229 | set_bkg_tile_xy(((*(uint8_t *) VM_REF_TO_PTR(FN_ARG0)) & 31), ((*(uint8_t *) VM_REF_TO_PTR(FN_ARG1)) & 31), (*(uint8_t *) VM_REF_TO_PTR(FN_ARG2))); 230 | } 231 | 232 | void vm_replace_overlay_tile(SCRIPT_CTX * THIS) OLDCALL BANKED { 233 | set_win_tile_xy(((*(uint8_t *) VM_REF_TO_PTR(FN_ARG0)) & 31), ((*(uint8_t *) VM_REF_TO_PTR(FN_ARG1)) & 31), (*(uint8_t *) VM_REF_TO_PTR(FN_ARG2))); 234 | } -------------------------------------------------------------------------------- /SubmappingExPlugin_v3/events/eventCopyBackgroundSubmapToOverlayBaseLegacy.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_WIN_BASE_LEGACY"; 2 | export const name = "Copy scene submap to overlay with tile offset (GBS 3)"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to overlay with tile offset (GBS 3)`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `bkg_x`, 19 | label: "Background X", 20 | type: "number", 21 | width: "50%", 22 | defaultValue: 0, 23 | }, 24 | { 25 | key: `bkg_y`, 26 | label: "Background Y", 27 | type: "number", 28 | width: "50%", 29 | defaultValue: 0, 30 | }, 31 | { 32 | key: `win_x`, 33 | label: "Overlay X", 34 | type: "number", 35 | width: "50%", 36 | defaultValue: 0, 37 | }, 38 | { 39 | key: `win_y`, 40 | label: "Overlay Y", 41 | type: "number", 42 | width: "50%", 43 | defaultValue: 0, 44 | }, 45 | { 46 | key: "w", 47 | label: "width", 48 | description: "width", 49 | type: "number", 50 | width: "50%", 51 | defaultValue: 0, 52 | }, 53 | { 54 | key: "h", 55 | label: "height", 56 | description: "height", 57 | type: "number", 58 | width: "50%", 59 | defaultValue: 0, 60 | }, 61 | { 62 | key: "tile_offset", 63 | label: "tile idx offset", 64 | description: "height", 65 | type: "number", 66 | width: "100%", 67 | defaultValue: 0, 68 | }, 69 | ]; 70 | 71 | export const compile = (input, helpers) => { 72 | const { options, _callNative, _stackPushConst, _stackPop, _addComment } = helpers; 73 | 74 | const { scenes } = options; 75 | const scene = scenes.find((s) => s.id === input.sceneId); 76 | if (!scene) { 77 | return; 78 | } 79 | 80 | _addComment("Copy scene submap to overlay with tile offset (GBS 3)"); 81 | 82 | _stackPushConst(`_${scene.symbol}`); 83 | _stackPushConst(`___bank_${scene.symbol}`); 84 | _stackPushConst(input.tile_offset); 85 | _stackPushConst((input.h << 8) | input.w); 86 | _stackPushConst((input.win_y << 8) | input.win_x); 87 | _stackPushConst((input.bkg_y << 8) | input.bkg_x); 88 | 89 | _callNative("copy_background_submap_to_overlay_base"); 90 | _stackPop(6); 91 | 92 | }; 93 | -------------------------------------------------------------------------------- /SubmappingExPlugin_v3/events/eventCopyBackgroundSubmapToOverlayLegacy.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_WIN_LEGACY"; 2 | export const name = "Copy scene submap to overlay (GBS 3)"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to overlay (GBS 3)`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `bkg_x`, 19 | label: "Background X", 20 | type: "number", 21 | width: "50%", 22 | defaultValue: 0, 23 | }, 24 | { 25 | key: `bkg_y`, 26 | label: "Background Y", 27 | type: "number", 28 | width: "50%", 29 | defaultValue: 0, 30 | }, 31 | { 32 | key: `win_x`, 33 | label: "Overlay X", 34 | type: "number", 35 | width: "50%", 36 | defaultValue: 0, 37 | }, 38 | { 39 | key: `win_y`, 40 | label: "Overlay Y", 41 | type: "number", 42 | width: "50%", 43 | defaultValue: 0, 44 | }, 45 | { 46 | key: "w", 47 | label: "width", 48 | description: "width", 49 | type: "number", 50 | width: "50%", 51 | defaultValue: 0, 52 | }, 53 | { 54 | key: "h", 55 | label: "height", 56 | description: "height", 57 | type: "number", 58 | width: "50%", 59 | defaultValue: 0, 60 | }, 61 | ]; 62 | 63 | export const compile = (input, helpers) => { 64 | const { options, _callNative, _stackPushConst, _stackPop, _addComment } = helpers; 65 | 66 | const { scenes } = options; 67 | const scene = scenes.find((s) => s.id === input.sceneId); 68 | if (!scene) { 69 | return; 70 | } 71 | 72 | _addComment("Copy scene submap to overlay"); 73 | 74 | _stackPushConst(`_${scene.symbol}`); 75 | _stackPushConst(`___bank_${scene.symbol}`); 76 | _stackPushConst(input.h); 77 | _stackPushConst(input.w); 78 | _stackPushConst(input.win_y); 79 | _stackPushConst(input.win_x); 80 | _stackPushConst(input.bkg_y); 81 | _stackPushConst(input.bkg_x); 82 | 83 | _callNative("copy_background_submap_to_overlay"); 84 | _stackPop(8); 85 | 86 | }; 87 | -------------------------------------------------------------------------------- /SubmappingExPlugin_v3/events/eventCopySceneSubmapToBkgBaseLegacy.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_BKG_BASE_LEGACY"; 2 | export const name = "Copy scene submap to background with tile offset (GBS 3)"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to background with tile offset (GBS 3)`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `source_x`, 19 | label: "Source X", 20 | type: "number", 21 | width: "50%", 22 | defaultValue: 0, 23 | }, 24 | { 25 | key: `source_y`, 26 | label: "Source Y", 27 | type: "number", 28 | width: "50%", 29 | defaultValue: 0, 30 | }, 31 | { 32 | key: `dest_x`, 33 | label: "Destination X", 34 | type: "number", 35 | width: "50%", 36 | defaultValue: 0, 37 | }, 38 | { 39 | key: `dest_y`, 40 | label: "Destination Y", 41 | type: "number", 42 | width: "50%", 43 | defaultValue: 0, 44 | }, 45 | { 46 | key: "w", 47 | label: "width", 48 | description: "width", 49 | type: "number", 50 | width: "50%", 51 | defaultValue: 0, 52 | }, 53 | { 54 | key: "h", 55 | label: "height", 56 | description: "height", 57 | type: "number", 58 | width: "50%", 59 | defaultValue: 0, 60 | }, 61 | { 62 | key: "tile_offset", 63 | label: "tile idx offset", 64 | description: "height", 65 | type: "number", 66 | width: "100%", 67 | defaultValue: 0, 68 | }, 69 | ]; 70 | 71 | export const compile = (input, helpers) => { 72 | const { options, _callNative, _stackPushConst, _stackPop, _addComment } = helpers; 73 | 74 | const { scenes } = options; 75 | const scene = scenes.find((s) => s.id === input.sceneId); 76 | if (!scene) { 77 | return; 78 | } 79 | 80 | _addComment("Copy scene submap to background with tile offset (GBS 3)"); 81 | 82 | _stackPushConst(`_${scene.symbol}`); 83 | _stackPushConst(`___bank_${scene.symbol}`); 84 | _stackPushConst(input.tile_offset); 85 | _stackPushConst((input.h << 8) | input.w); 86 | _stackPushConst((input.dest_y << 8) | input.dest_x); 87 | _stackPushConst((input.source_y << 8) | input.source_x); 88 | 89 | _callNative("copy_background_submap_to_background_base"); 90 | _stackPop(6); 91 | 92 | }; 93 | -------------------------------------------------------------------------------- /SubmappingExPlugin_v3/events/eventCopySceneSubmapToBkgLegacy.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_BKG_LEGACY"; 2 | export const name = "Copy scene submap to background (GBS 3)"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to background (GBS 3)`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `source_x`, 19 | label: "Source X", 20 | type: "number", 21 | width: "50%", 22 | defaultValue: 0, 23 | }, 24 | { 25 | key: `source_y`, 26 | label: "Source Y", 27 | type: "number", 28 | width: "50%", 29 | defaultValue: 0, 30 | }, 31 | { 32 | key: `dest_x`, 33 | label: "Destination X", 34 | type: "number", 35 | width: "50%", 36 | defaultValue: 0, 37 | }, 38 | { 39 | key: `dest_y`, 40 | label: "Destination Y", 41 | type: "number", 42 | width: "50%", 43 | defaultValue: 0, 44 | }, 45 | { 46 | key: "w", 47 | label: "width", 48 | description: "width", 49 | type: "number", 50 | width: "50%", 51 | defaultValue: 0, 52 | }, 53 | { 54 | key: "h", 55 | label: "height", 56 | description: "height", 57 | type: "number", 58 | width: "50%", 59 | defaultValue: 0, 60 | }, 61 | ]; 62 | 63 | export const compile = (input, helpers) => { 64 | const { options, _callNative, _stackPushConst, _stackPop, _addComment } = helpers; 65 | 66 | const { scenes } = options; 67 | const scene = scenes.find((s) => s.id === input.sceneId); 68 | if (!scene) { 69 | return; 70 | } 71 | 72 | _addComment("Copy scene submap to background (GBS 3)"); 73 | 74 | _stackPushConst(`_${scene.symbol}`); 75 | _stackPushConst(`___bank_${scene.symbol}`); 76 | _stackPushConst(input.h); 77 | _stackPushConst(input.w); 78 | _stackPushConst(input.dest_y); 79 | _stackPushConst(input.dest_x); 80 | _stackPushConst(input.source_y); 81 | _stackPushConst(input.source_x); 82 | 83 | _callNative("copy_background_submap_to_background"); 84 | _stackPop(8); 85 | 86 | }; 87 | -------------------------------------------------------------------------------- /SubmappingExPlugin_v3/events/eventCopySceneSubmapToBkgTilesetLegacy.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_BKG_TILESET_LEGACY"; 2 | export const name = "Copy scene submap to background tileset (GBS 3)"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to background tileset (GBS 3)`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `source_x`, 19 | label: "Source X", 20 | type: "number", 21 | width: "50%", 22 | defaultValue: 0, 23 | }, 24 | { 25 | key: `source_y`, 26 | label: "Source Y", 27 | type: "number", 28 | width: "50%", 29 | defaultValue: 0, 30 | }, 31 | { 32 | key: `dest_x`, 33 | label: "Destination X", 34 | type: "number", 35 | width: "50%", 36 | defaultValue: 0, 37 | }, 38 | { 39 | key: `dest_y`, 40 | label: "Destination Y", 41 | type: "number", 42 | width: "50%", 43 | defaultValue: 0, 44 | }, 45 | { 46 | key: "w", 47 | label: "width", 48 | description: "width", 49 | type: "number", 50 | width: "50%", 51 | defaultValue: 0, 52 | }, 53 | { 54 | key: "h", 55 | label: "height", 56 | description: "height", 57 | type: "number", 58 | width: "50%", 59 | defaultValue: 0, 60 | }, 61 | ]; 62 | 63 | export const compile = (input, helpers) => { 64 | const { options, _callNative, _stackPushConst, _stackPop, _addComment } = helpers; 65 | 66 | const { scenes } = options; 67 | const scene = scenes.find((s) => s.id === input.sceneId); 68 | if (!scene) { 69 | return; 70 | } 71 | 72 | _addComment("Copy scene submap to background (GBS 3) tileset"); 73 | 74 | _stackPushConst(`_${scene.symbol}`); 75 | _stackPushConst(`___bank_${scene.symbol}`); 76 | _stackPushConst(input.h); 77 | _stackPushConst(input.w); 78 | _stackPushConst(input.dest_y); 79 | _stackPushConst(input.dest_x); 80 | _stackPushConst(input.source_y); 81 | _stackPushConst(input.source_x); 82 | 83 | _callNative("copy_background_submap_to_background_tileset"); 84 | _stackPop(8); 85 | 86 | }; 87 | -------------------------------------------------------------------------------- /SubmappingExPlugin_v4/engine/engine.json: -------------------------------------------------------------------------------- 1 | {"version": "4.0.0-e0"} -------------------------------------------------------------------------------- /SubmappingExPlugin_v4/engine/src/copy_scene_parts.c: -------------------------------------------------------------------------------- 1 | #pragma bank 255 2 | 3 | #include 4 | #include "system.h" 5 | #include "vm.h" 6 | #include "gbs_types.h" 7 | #include "scroll.h" 8 | #include "bankdata.h" 9 | #include "data_manager.h" 10 | 11 | UBYTE tmp_tile_buffer[32]; 12 | 13 | void set_xy_win_submap(const UBYTE * source, UBYTE bank, UBYTE width, UBYTE x, UBYTE y, UBYTE w, UBYTE h) OLDCALL; 14 | 15 | void copy_background_submap_to_overlay(SCRIPT_CTX * THIS) OLDCALL BANKED { 16 | 17 | uint8_t source_x = *(int8_t*)VM_REF_TO_PTR(FN_ARG0); 18 | uint8_t source_y = *(int8_t*)VM_REF_TO_PTR(FN_ARG1); 19 | uint8_t dest_x = *(int8_t*)VM_REF_TO_PTR(FN_ARG2); 20 | uint8_t dest_y = *(int8_t*)VM_REF_TO_PTR(FN_ARG3); 21 | uint8_t width = *(int8_t*)VM_REF_TO_PTR(FN_ARG4); 22 | uint8_t height = *(int8_t*)VM_REF_TO_PTR(FN_ARG5); 23 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG6); 24 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG7); 25 | scene_t scn; 26 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 27 | background_t bkg; 28 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 29 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 30 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 31 | int16_t offset = (source_y * (int16_t)bkg.width) + source_x; 32 | #ifdef CGB 33 | if (_is_CGB) { 34 | VBK_REG = 1; 35 | set_xy_win_submap(tilemap_attr_ptr + offset, bkg.cgb_tilemap_attr.bank, bkg.width, dest_x, dest_y, width, height); 36 | VBK_REG = 0; 37 | } 38 | #endif 39 | set_xy_win_submap(tilemap_ptr + offset, bkg.tilemap.bank, bkg.width, dest_x, dest_y, width, height); 40 | 41 | } 42 | 43 | void copy_background_submap_to_overlay_base(SCRIPT_CTX * THIS) OLDCALL BANKED { 44 | int16_t bkg_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG0); 45 | int16_t dest_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG1); 46 | int16_t wh = *(int16_t*)VM_REF_TO_PTR(FN_ARG2); 47 | uint8_t tile_idx_offset = *(int8_t*)VM_REF_TO_PTR(FN_ARG3); 48 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG4); 49 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG5); 50 | 51 | UBYTE source_x = bkg_pos & 0xFF; 52 | UBYTE source_y = (bkg_pos >> 8) & 0xFF; 53 | UBYTE dest_x = dest_pos & 0xFF; 54 | UBYTE dest_y = (dest_pos >> 8) & 0xFF; 55 | UBYTE width = (wh & 0xFF) & 31; 56 | UBYTE height = ((wh >> 8) & 0xFF) & 31; 57 | 58 | scene_t scn; 59 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 60 | background_t bkg; 61 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 62 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 63 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 64 | 65 | UBYTE buffer_size = sizeof(UBYTE) * width; 66 | for (uint8_t i = 0; i < height; i++){ 67 | int16_t offset = ((source_y + i) * (int16_t)bkg.width) + source_x; 68 | #ifdef CGB 69 | if (_is_CGB) { 70 | VBK_REG = 1; 71 | MemcpyBanked(tmp_tile_buffer, tilemap_attr_ptr + offset, buffer_size, bkg.cgb_tilemap_attr.bank); 72 | set_win_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer); 73 | VBK_REG = 0; 74 | } 75 | #endif 76 | MemcpyBanked(tmp_tile_buffer, tilemap_ptr + offset, buffer_size, bkg.tilemap.bank); 77 | set_win_based_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer, tile_idx_offset); 78 | } 79 | } 80 | 81 | 82 | void copy_background_submap_to_background(SCRIPT_CTX * THIS) OLDCALL BANKED { 83 | 84 | uint8_t source_x = *(int8_t*)VM_REF_TO_PTR(FN_ARG0); 85 | uint8_t source_y = *(int8_t*)VM_REF_TO_PTR(FN_ARG1); 86 | uint8_t dest_x = *(int8_t*)VM_REF_TO_PTR(FN_ARG2); 87 | uint8_t dest_y = *(int8_t*)VM_REF_TO_PTR(FN_ARG3); 88 | uint8_t width = *(int8_t*)VM_REF_TO_PTR(FN_ARG4) & 31; 89 | uint8_t height = *(int8_t*)VM_REF_TO_PTR(FN_ARG5) & 31; 90 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG6); 91 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG7); 92 | scene_t scn; 93 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 94 | background_t bkg; 95 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 96 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 97 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 98 | 99 | UBYTE buffer_size = sizeof(UBYTE) * width; 100 | for (uint8_t i = 0; i < height; i++){ 101 | int16_t offset = ((source_y + i) * (int16_t)bkg.width) + source_x; 102 | #ifdef CGB 103 | if (_is_CGB) { 104 | VBK_REG = 1; 105 | MemcpyBanked(tmp_tile_buffer, tilemap_attr_ptr + offset, buffer_size, bkg.cgb_tilemap_attr.bank); 106 | set_bkg_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer); 107 | VBK_REG = 0; 108 | } 109 | #endif 110 | MemcpyBanked(tmp_tile_buffer, tilemap_ptr + offset, buffer_size, bkg.tilemap.bank); 111 | set_bkg_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer); 112 | } 113 | 114 | } 115 | 116 | void copy_background_submap_to_background_base(SCRIPT_CTX * THIS) OLDCALL BANKED { 117 | int16_t bkg_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG0); 118 | int16_t dest_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG1); 119 | int16_t wh = *(int16_t*)VM_REF_TO_PTR(FN_ARG2); 120 | uint8_t tile_idx_offset = *(int8_t*)VM_REF_TO_PTR(FN_ARG3); 121 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG4); 122 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG5); 123 | 124 | UBYTE source_x = bkg_pos & 0xFF; 125 | UBYTE source_y = (bkg_pos >> 8) & 0xFF; 126 | UBYTE dest_x = dest_pos & 0xFF; 127 | UBYTE dest_y = (dest_pos >> 8) & 0xFF; 128 | UBYTE width = (wh & 0xFF) & 31; 129 | UBYTE height = ((wh >> 8) & 0xFF) & 31; 130 | 131 | scene_t scn; 132 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 133 | background_t bkg; 134 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 135 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 136 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 137 | 138 | UBYTE buffer_size = sizeof(UBYTE) * width; 139 | 140 | for (uint8_t i = 0; i < height; i++){ 141 | int16_t offset = ((source_y + i) * (int16_t)bkg.width) + source_x; 142 | #ifdef CGB 143 | if (_is_CGB) { 144 | VBK_REG = 1; 145 | MemcpyBanked(tmp_tile_buffer, tilemap_attr_ptr + offset, buffer_size, bkg.cgb_tilemap_attr.bank); 146 | set_bkg_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer); 147 | VBK_REG = 0; 148 | } 149 | #endif 150 | MemcpyBanked(tmp_tile_buffer, tilemap_ptr + offset, buffer_size, bkg.tilemap.bank); 151 | set_bkg_based_tiles(dest_x & 31, (dest_y + i) & 31, width, 1, tmp_tile_buffer, tile_idx_offset); 152 | } 153 | } 154 | 155 | void copy_background_submap_to_tileset(SCRIPT_CTX * THIS) OLDCALL BANKED { 156 | int16_t source_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG0); 157 | int16_t dest_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG1); 158 | int16_t wh = *(int16_t*)VM_REF_TO_PTR(FN_ARG2); 159 | int16_t overlay_pos = *(int16_t*)VM_REF_TO_PTR(FN_ARG3); 160 | uint8_t copy_attributes = *(int8_t*)VM_REF_TO_PTR(FN_ARG4); 161 | uint8_t scene_bank = *(uint8_t *) VM_REF_TO_PTR(FN_ARG5); 162 | const scene_t * scene_ptr = *(scene_t **) VM_REF_TO_PTR(FN_ARG6); 163 | 164 | UBYTE source_x = source_pos & 0xFF; 165 | UBYTE source_y = (source_pos >> 8) & 0xFF; 166 | UBYTE dest_x = dest_pos & 0xFF; 167 | UBYTE dest_y = (dest_pos >> 8) & 0xFF; 168 | UBYTE width = (wh & 0xFF) & 31; 169 | UBYTE height = ((wh >> 8) & 0xFF) & 31; 170 | UBYTE overlay_x = overlay_pos & 0xFF; 171 | UBYTE overlay_y = (overlay_pos >> 8) & 0xFF; 172 | 173 | scene_t scn; 174 | MemcpyBanked(&scn, scene_ptr, sizeof(scn), scene_bank); 175 | background_t bkg; 176 | MemcpyBanked(&bkg, scn.background.ptr, sizeof(bkg), scn.background.bank); 177 | const tileset_t* tileset = bkg.tileset.ptr; 178 | UWORD n_tiles = ReadBankedUWORD(&(tileset->n_tiles), bkg.tileset.bank); 179 | UBYTE ui_reserved_offset = (n_tiles > 128 && n_tiles < 192)? (192 - n_tiles): 0; 180 | unsigned char* tilemap_ptr = bkg.tilemap.ptr; 181 | unsigned char* tilemap_attr_ptr = bkg.cgb_tilemap_attr.ptr; 182 | 183 | const tileset_t* cgb_tileset = bkg.cgb_tileset.ptr; 184 | 185 | UBYTE buffer_size = sizeof(UBYTE) * width; 186 | for (uint8_t i = 0; i < height; i++){ 187 | uint16_t source_offset = ((source_y + i) * (uint16_t)bkg.width) + source_x; 188 | uint16_t dest_offset = ((dest_y + i) * (uint16_t)image_tile_width) + dest_x; 189 | for (uint8_t j = 0; j < width; j++){ 190 | UBYTE dest_tile = ReadBankedUBYTE(image_ptr + (uint16_t)(dest_offset + j), image_bank); 191 | UBYTE source_tile = ReadBankedUBYTE(tilemap_ptr + (uint16_t)(source_offset + j), bkg.tilemap.bank); 192 | if (ui_reserved_offset && source_tile >= 128){ 193 | source_tile = source_tile - ui_reserved_offset; 194 | } 195 | #ifdef CGB 196 | if (_is_CGB) { 197 | 198 | UBYTE dest_attr = ReadBankedUBYTE(image_attr_ptr + (uint16_t)(dest_offset + j), image_attr_bank); 199 | UBYTE source_attr = ReadBankedUBYTE(tilemap_attr_ptr + (uint16_t)(source_offset + j), bkg.cgb_tilemap_attr.bank); 200 | if (copy_attributes){ 201 | VBK_REG = 1; 202 | if (copy_attributes == 1){ 203 | set_bkg_tile_xy((dest_x + j) & 31, (dest_y + i) & 31, (dest_attr & 0x08)? (source_attr | 0x08): (source_attr & ~0x08)); 204 | } else if (copy_attributes == 2){ 205 | set_win_tile_xy((overlay_x + j) & 31, (overlay_y + i) & 31, (dest_attr & 0x08)? (source_attr | 0x08): (source_attr & ~0x08)); 206 | } 207 | VBK_REG = 0; 208 | } 209 | if (dest_attr & 0x08){ 210 | VBK_REG = 1; 211 | } 212 | if (cgb_tileset && (source_attr & 0x08)){ 213 | SetBankedBkgData(dest_tile, 1, cgb_tileset->tiles + (uint16_t)(source_tile << 4), bkg.cgb_tileset.bank); 214 | } else { 215 | SetBankedBkgData(dest_tile, 1, tileset->tiles + (uint16_t)(source_tile << 4), bkg.tileset.bank); 216 | } 217 | VBK_REG = 0; 218 | } else { 219 | SetBankedBkgData(dest_tile, 1, tileset->tiles + (uint16_t)(source_tile << 4), bkg.tileset.bank); 220 | } 221 | #else 222 | SetBankedBkgData(dest_tile, 1, tileset->tiles + (uint16_t)(source_tile << 4), bkg.tileset.bank); 223 | #endif 224 | } 225 | } 226 | } 227 | 228 | void vm_replace_background_tile(SCRIPT_CTX * THIS) OLDCALL BANKED { 229 | set_bkg_tile_xy(((*(uint8_t *) VM_REF_TO_PTR(FN_ARG0)) & 31), ((*(uint8_t *) VM_REF_TO_PTR(FN_ARG1)) & 31), (*(uint8_t *) VM_REF_TO_PTR(FN_ARG2))); 230 | } 231 | 232 | void vm_replace_overlay_tile(SCRIPT_CTX * THIS) OLDCALL BANKED { 233 | set_win_tile_xy(((*(uint8_t *) VM_REF_TO_PTR(FN_ARG0)) & 31), ((*(uint8_t *) VM_REF_TO_PTR(FN_ARG1)) & 31), (*(uint8_t *) VM_REF_TO_PTR(FN_ARG2))); 234 | } -------------------------------------------------------------------------------- /SubmappingExPlugin_v4/events/eventCopyBackgroundSubmapToOverlay.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_WIN"; 2 | export const name = "Copy scene submap to overlay"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to overlay`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `bkg_x`, 19 | label: "Background X", 20 | type: "value", 21 | width: "50%", 22 | defaultValue: { 23 | type: "number", 24 | value: 0, 25 | }, 26 | }, 27 | { 28 | key: `bkg_y`, 29 | label: "Background Y", 30 | type: "value", 31 | width: "50%", 32 | defaultValue: { 33 | type: "number", 34 | value: 0, 35 | }, 36 | }, 37 | { 38 | key: `win_x`, 39 | label: "Overlay X", 40 | type: "value", 41 | width: "50%", 42 | defaultValue: { 43 | type: "number", 44 | value: 0, 45 | }, 46 | }, 47 | { 48 | key: `win_y`, 49 | label: "Overlay Y", 50 | type: "value", 51 | width: "50%", 52 | defaultValue: { 53 | type: "number", 54 | value: 0, 55 | }, 56 | }, 57 | { 58 | key: "w", 59 | label: "width", 60 | description: "width", 61 | type: "value", 62 | width: "50%", 63 | defaultValue: { 64 | type: "number", 65 | value: 0, 66 | }, 67 | }, 68 | { 69 | key: "h", 70 | label: "height", 71 | description: "height", 72 | type: "value", 73 | width: "50%", 74 | defaultValue: { 75 | type: "number", 76 | value: 0, 77 | }, 78 | }, 79 | ]; 80 | 81 | export const compile = (input, helpers) => { 82 | const { options, _callNative, _stackPushConst, _stackPush, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 83 | 84 | const { scenes } = options; 85 | const scene = scenes.find((s) => s.id === input.sceneId); 86 | if (!scene) { 87 | return; 88 | } 89 | 90 | const tmp0 = _declareLocal("tmp_bkg_x", 1, true); 91 | const tmp1 = _declareLocal("tmp_bkg_y", 1, true); 92 | const tmp2 = _declareLocal("tmp_win_x", 1, true); 93 | const tmp3 = _declareLocal("tmp_win_y", 1, true); 94 | const tmp4 = _declareLocal("tmp_w", 1, true); 95 | const tmp5 = _declareLocal("tmp_h", 1, true); 96 | 97 | variableSetToScriptValue(tmp0, input.bkg_x); 98 | variableSetToScriptValue(tmp1, input.bkg_y); 99 | variableSetToScriptValue(tmp2, input.win_x); 100 | variableSetToScriptValue(tmp3, input.win_y); 101 | variableSetToScriptValue(tmp4, input.w); 102 | variableSetToScriptValue(tmp5, input.h); 103 | 104 | 105 | _addComment("Copy scene submap to overlay"); 106 | 107 | _stackPushConst(`_${scene.symbol}`); 108 | _stackPushConst(`___bank_${scene.symbol}`); 109 | _stackPush(tmp5); 110 | _stackPush(tmp4); 111 | _stackPush(tmp3); 112 | _stackPush(tmp2); 113 | _stackPush(tmp1); 114 | _stackPush(tmp0); 115 | 116 | _callNative("copy_background_submap_to_overlay"); 117 | _stackPop(8); 118 | 119 | }; 120 | -------------------------------------------------------------------------------- /SubmappingExPlugin_v4/events/eventCopyBackgroundSubmapToOverlayBase.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_WIN_BASE"; 2 | export const name = "Copy scene submap to overlay with tile offset"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to overlay with tile offset`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `bkg_x`, 19 | label: "Background X", 20 | type: "value", 21 | width: "50%", 22 | defaultValue: { 23 | type: "number", 24 | value: 0, 25 | }, 26 | }, 27 | { 28 | key: `bkg_y`, 29 | label: "Background Y", 30 | type: "value", 31 | width: "50%", 32 | defaultValue: { 33 | type: "number", 34 | value: 0, 35 | }, 36 | }, 37 | { 38 | key: `win_x`, 39 | label: "Overlay X", 40 | type: "value", 41 | width: "50%", 42 | defaultValue: { 43 | type: "number", 44 | value: 0, 45 | }, 46 | }, 47 | { 48 | key: `win_y`, 49 | label: "Overlay Y", 50 | type: "value", 51 | width: "50%", 52 | defaultValue: { 53 | type: "number", 54 | value: 0, 55 | }, 56 | }, 57 | { 58 | key: "w", 59 | label: "width", 60 | description: "width", 61 | type: "value", 62 | width: "50%", 63 | defaultValue: { 64 | type: "number", 65 | value: 0, 66 | }, 67 | }, 68 | { 69 | key: "h", 70 | label: "height", 71 | description: "height", 72 | type: "value", 73 | width: "50%", 74 | defaultValue: { 75 | type: "number", 76 | value: 0, 77 | }, 78 | }, 79 | { 80 | key: "tile_offset", 81 | label: "tile idx offset", 82 | description: "height", 83 | type: "value", 84 | width: "100%", 85 | defaultValue: { 86 | type: "number", 87 | value: 0, 88 | }, 89 | }, 90 | ]; 91 | 92 | export const compile = (input, helpers) => { 93 | const { options, _callNative, _rpn, _stackPushConst, _stackPush, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 94 | 95 | const { scenes } = options; 96 | const scene = scenes.find((s) => s.id === input.sceneId); 97 | if (!scene) { 98 | return; 99 | } 100 | 101 | const tmp0 = _declareLocal("tmp_bkg_x", 1, true); 102 | const tmp1 = _declareLocal("tmp_bkg_y", 1, true); 103 | const tmp2 = _declareLocal("tmp_win_x", 1, true); 104 | const tmp3 = _declareLocal("tmp_win_y", 1, true); 105 | const tmp4 = _declareLocal("tmp_w", 1, true); 106 | const tmp5 = _declareLocal("tmp_h", 1, true); 107 | const tmp6 = _declareLocal("tmp_tile_offset", 1, true); 108 | 109 | variableSetToScriptValue(tmp0, input.bkg_x); 110 | variableSetToScriptValue(tmp1, input.bkg_y); 111 | variableSetToScriptValue(tmp2, input.win_x); 112 | variableSetToScriptValue(tmp3, input.win_y); 113 | variableSetToScriptValue(tmp4, input.w); 114 | variableSetToScriptValue(tmp5, input.h); 115 | variableSetToScriptValue(tmp6, input.tile_offset); 116 | 117 | 118 | _addComment("Copy scene submap to overlay with tile offset"); 119 | 120 | _rpn() 121 | .ref(tmp1).int16(256).operator(".MUL") // (bkg_y << 8) | bkg_x 122 | .ref(tmp0) 123 | .operator(".B_OR") 124 | .refSet(tmp0) 125 | .ref(tmp3).int16(256).operator(".MUL") // (win_y << 8) | win_x 126 | .ref(tmp2) 127 | .operator(".B_OR") 128 | .refSet(tmp1) 129 | .ref(tmp5).int16(256).operator(".MUL") // (h << 8) | w 130 | .ref(tmp4) 131 | .operator(".B_OR") 132 | .refSet(tmp2) 133 | .stop(); 134 | 135 | _stackPushConst(`_${scene.symbol}`); 136 | _stackPushConst(`___bank_${scene.symbol}`); 137 | _stackPush(tmp6); 138 | _stackPush(tmp2); 139 | _stackPush(tmp1); 140 | _stackPush(tmp0); 141 | 142 | _callNative("copy_background_submap_to_overlay_base"); 143 | _stackPop(6); 144 | 145 | }; 146 | -------------------------------------------------------------------------------- /SubmappingExPlugin_v4/events/eventCopySceneSubmapToBkg.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_BKG"; 2 | export const name = "Copy scene submap to background"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to background`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `source_x`, 19 | label: "Source X", 20 | type: "value", 21 | width: "50%", 22 | defaultValue: { 23 | type: "number", 24 | value: 0, 25 | }, 26 | }, 27 | { 28 | key: `source_y`, 29 | label: "Source Y", 30 | type: "value", 31 | width: "50%", 32 | defaultValue: { 33 | type: "number", 34 | value: 0, 35 | }, 36 | }, 37 | { 38 | key: `dest_x`, 39 | label: "Destination X", 40 | type: "value", 41 | width: "50%", 42 | defaultValue: { 43 | type: "number", 44 | value: 0, 45 | }, 46 | }, 47 | { 48 | key: `dest_y`, 49 | label: "Destination Y", 50 | type: "value", 51 | width: "50%", 52 | defaultValue: { 53 | type: "number", 54 | value: 0, 55 | }, 56 | }, 57 | { 58 | key: "w", 59 | label: "width", 60 | description: "width", 61 | type: "value", 62 | width: "50%", 63 | defaultValue: { 64 | type: "number", 65 | value: 0, 66 | }, 67 | }, 68 | { 69 | key: "h", 70 | label: "height", 71 | description: "height", 72 | type: "value", 73 | width: "50%", 74 | defaultValue: { 75 | type: "number", 76 | value: 0, 77 | }, 78 | }, 79 | ]; 80 | 81 | export const compile = (input, helpers) => { 82 | const { options, _callNative, _stackPushConst, _stackPush, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 83 | 84 | const { scenes } = options; 85 | const scene = scenes.find((s) => s.id === input.sceneId); 86 | if (!scene) { 87 | return; 88 | } 89 | 90 | const tmp0 = _declareLocal("tmp_source_x", 1, true); 91 | const tmp1 = _declareLocal("tmp_source_y", 1, true); 92 | const tmp2 = _declareLocal("tmp_dest_x", 1, true); 93 | const tmp3 = _declareLocal("tmp_dest_y", 1, true); 94 | const tmp4 = _declareLocal("tmp_w", 1, true); 95 | const tmp5 = _declareLocal("tmp_h", 1, true); 96 | 97 | variableSetToScriptValue(tmp0, input.source_x); 98 | variableSetToScriptValue(tmp1, input.source_y); 99 | variableSetToScriptValue(tmp2, input.dest_x); 100 | variableSetToScriptValue(tmp3, input.dest_y); 101 | variableSetToScriptValue(tmp4, input.w); 102 | variableSetToScriptValue(tmp5, input.h); 103 | 104 | _addComment("Copy scene submap to background"); 105 | 106 | _stackPushConst(`_${scene.symbol}`); 107 | _stackPushConst(`___bank_${scene.symbol}`); 108 | _stackPush(tmp5); 109 | _stackPush(tmp4); 110 | _stackPush(tmp3); 111 | _stackPush(tmp2); 112 | _stackPush(tmp1); 113 | _stackPush(tmp0); 114 | 115 | _callNative("copy_background_submap_to_background"); 116 | _stackPop(8); 117 | 118 | }; 119 | -------------------------------------------------------------------------------- /SubmappingExPlugin_v4/events/eventCopySceneSubmapToBkgBase.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_BKG_BASE"; 2 | export const name = "Copy scene submap to background with tile offset"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to background with tile offset`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: "sceneId", 12 | label: "Scene", 13 | type: "scene", 14 | width: "100%", 15 | defaultValue: "LAST_SCENE", 16 | }, 17 | { 18 | key: `source_x`, 19 | label: "Source X", 20 | type: "value", 21 | width: "50%", 22 | defaultValue: { 23 | type: "number", 24 | value: 0, 25 | }, 26 | }, 27 | { 28 | key: `source_y`, 29 | label: "Source Y", 30 | type: "value", 31 | width: "50%", 32 | defaultValue: { 33 | type: "number", 34 | value: 0, 35 | }, 36 | }, 37 | { 38 | key: `dest_x`, 39 | label: "Destination X", 40 | type: "value", 41 | width: "50%", 42 | defaultValue: { 43 | type: "number", 44 | value: 0, 45 | }, 46 | }, 47 | { 48 | key: `dest_y`, 49 | label: "Destination Y", 50 | type: "value", 51 | width: "50%", 52 | defaultValue: { 53 | type: "number", 54 | value: 0, 55 | }, 56 | }, 57 | { 58 | key: "w", 59 | label: "width", 60 | description: "width", 61 | type: "value", 62 | width: "50%", 63 | defaultValue: { 64 | type: "number", 65 | value: 0, 66 | }, 67 | }, 68 | { 69 | key: "h", 70 | label: "height", 71 | description: "height", 72 | type: "value", 73 | width: "50%", 74 | defaultValue: { 75 | type: "number", 76 | value: 0, 77 | }, 78 | }, 79 | { 80 | key: "tile_offset", 81 | label: "tile idx offset", 82 | description: "height", 83 | type: "value", 84 | width: "100%", 85 | defaultValue: { 86 | type: "number", 87 | value: 0, 88 | }, 89 | }, 90 | ]; 91 | 92 | export const compile = (input, helpers) => { 93 | const { options, _callNative, _rpn, _stackPushConst, _stackPush, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 94 | 95 | const { scenes } = options; 96 | const scene = scenes.find((s) => s.id === input.sceneId); 97 | if (!scene) { 98 | return; 99 | } 100 | 101 | const tmp0 = _declareLocal("tmp_source_x", 1, true); 102 | const tmp1 = _declareLocal("tmp_source_y", 1, true); 103 | const tmp2 = _declareLocal("tmp_dest_x", 1, true); 104 | const tmp3 = _declareLocal("tmp_dest_y", 1, true); 105 | const tmp4 = _declareLocal("tmp_w", 1, true); 106 | const tmp5 = _declareLocal("tmp_h", 1, true); 107 | const tmp6 = _declareLocal("tmp_tile_offset", 1, true); 108 | 109 | variableSetToScriptValue(tmp0, input.source_x); 110 | variableSetToScriptValue(tmp1, input.source_y); 111 | variableSetToScriptValue(tmp2, input.dest_x); 112 | variableSetToScriptValue(tmp3, input.dest_y); 113 | variableSetToScriptValue(tmp4, input.w); 114 | variableSetToScriptValue(tmp5, input.h); 115 | variableSetToScriptValue(tmp6, input.tile_offset); 116 | 117 | 118 | _addComment("Copy scene submap to background with tile offset"); 119 | 120 | _rpn() 121 | .ref(tmp1).int16(256).operator(".MUL") // (source_y << 8) | source_x 122 | .ref(tmp0) 123 | .operator(".B_OR") 124 | .refSet(tmp0) 125 | .ref(tmp3).int16(256).operator(".MUL") // (dest_y << 8) | dest_x 126 | .ref(tmp2) 127 | .operator(".B_OR") 128 | .refSet(tmp1) 129 | .ref(tmp5).int16(256).operator(".MUL") // (h << 8) | w 130 | .ref(tmp4) 131 | .operator(".B_OR") 132 | .refSet(tmp2) 133 | .stop(); 134 | 135 | _stackPushConst(`_${scene.symbol}`); 136 | _stackPushConst(`___bank_${scene.symbol}`); 137 | _stackPush(tmp6); 138 | _stackPush(tmp2); 139 | _stackPush(tmp1); 140 | _stackPush(tmp0); 141 | 142 | _callNative("copy_background_submap_to_background_base"); 143 | _stackPop(6); 144 | 145 | }; 146 | -------------------------------------------------------------------------------- /SubmappingExPlugin_v4/events/eventCopySceneSubmapToBkgTileset.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_COPY_BKG_SUBMAP_TO_BKG_TILESET"; 2 | export const name = "Copy scene submap to background tileset"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Copy scene submap to background tileset`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | type: "group", 12 | fields: [ 13 | { 14 | key: "sceneId", 15 | label: "Scene", 16 | type: "scene", 17 | width: "100%", 18 | defaultValue: "LAST_SCENE", 19 | conditions: [ 20 | { 21 | key: "use_far_ptr", 22 | ne: true 23 | }, 24 | ], 25 | }, 26 | { 27 | key: `scene_bank`, 28 | label: "Scene bank", 29 | type: "value", 30 | width: "50%", 31 | defaultValue: { 32 | type: "number", 33 | value: 0, 34 | }, 35 | conditions: [ 36 | { 37 | key: "use_far_ptr", 38 | eq: true 39 | }, 40 | ], 41 | }, 42 | { 43 | key: `scene_ptr`, 44 | label: "Scene Pointer", 45 | type: "value", 46 | width: "50%", 47 | defaultValue: { 48 | type: "number", 49 | value: 0, 50 | }, 51 | conditions: [ 52 | { 53 | key: "use_far_ptr", 54 | eq: true 55 | }, 56 | ], 57 | }, 58 | { 59 | key: "use_far_ptr", 60 | label: "Use scene's far ptr", 61 | type: "checkbox", 62 | width: "50%", 63 | }, 64 | ] 65 | }, 66 | { 67 | type: "group", 68 | fields: [ 69 | { 70 | key: `source_x`, 71 | label: "Source X", 72 | type: "value", 73 | defaultValue: { 74 | type: "number", 75 | value: 0, 76 | }, 77 | }, 78 | { 79 | key: `source_y`, 80 | label: "Source Y", 81 | type: "value", 82 | defaultValue: { 83 | type: "number", 84 | value: 0, 85 | }, 86 | }, 87 | ] 88 | }, 89 | { 90 | type: "group", 91 | fields: [ 92 | { 93 | key: `dest_x`, 94 | label: "Destination X", 95 | type: "value", 96 | width: "50%", 97 | defaultValue: { 98 | type: "number", 99 | value: 0, 100 | }, 101 | }, 102 | { 103 | key: `dest_y`, 104 | label: "Destination Y", 105 | type: "value", 106 | width: "50%", 107 | defaultValue: { 108 | type: "number", 109 | value: 0, 110 | }, 111 | }, 112 | ] 113 | }, 114 | { 115 | type: "group", 116 | fields: [ 117 | { 118 | key: "w", 119 | label: "width", 120 | description: "width", 121 | type: "value", 122 | width: "50%", 123 | defaultValue: { 124 | type: "number", 125 | value: 0, 126 | }, 127 | }, 128 | { 129 | key: "h", 130 | label: "height", 131 | description: "height", 132 | type: "value", 133 | width: "50%", 134 | defaultValue: { 135 | type: "number", 136 | value: 0, 137 | }, 138 | }, 139 | ] 140 | }, 141 | { 142 | label: "copy tile attributes to", 143 | key: "copy_attr", 144 | type: "select", 145 | width: "100%", 146 | options: [ 147 | ["none", "None"], 148 | ["background", "Background"], 149 | ["overlay", "Overlay"], 150 | ], 151 | defaultValue: "none", 152 | alignBottom: true, 153 | }, 154 | { 155 | type: "group", 156 | fields: [ 157 | { 158 | key: `overlay_x`, 159 | label: "Overlay X", 160 | type: "value", 161 | width: "50%", 162 | defaultValue: { 163 | type: "number", 164 | value: 0, 165 | }, 166 | conditions: [ 167 | { 168 | key: "copy_attr", 169 | eq: "overlay", 170 | }, 171 | ], 172 | }, 173 | { 174 | key: `overlay_y`, 175 | label: "Overlay Y", 176 | type: "value", 177 | width: "50%", 178 | defaultValue: { 179 | type: "number", 180 | value: 0, 181 | }, 182 | conditions: [ 183 | { 184 | key: "copy_attr", 185 | eq: "overlay", 186 | }, 187 | ], 188 | }, 189 | ] 190 | }, 191 | ]; 192 | 193 | export const compile = (input, helpers) => { 194 | const { options, _callNative, _stackPushConst, _rpn, _stackPush, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 195 | 196 | const tmp0 = _declareLocal("tmp0", 1, true); 197 | const tmp1 = _declareLocal("tmp1", 1, true); 198 | const tmp2 = _declareLocal("tmp2", 1, true); 199 | const tmp3 = _declareLocal("tmp3", 1, true); 200 | const tmp4 = _declareLocal("tmp4", 1, true); 201 | const tmp5 = _declareLocal("tmp5", 1, true); 202 | 203 | 204 | _addComment("Copy scene submap to background tileset"); 205 | 206 | variableSetToScriptValue(tmp0, input.source_x); 207 | variableSetToScriptValue(tmp1, input.source_y); 208 | _rpn() 209 | .ref(tmp1).int16(256).operator(".MUL") // (source_y << 8) | source_x 210 | .ref(tmp0) 211 | .operator(".B_OR") 212 | .refSet(tmp0) 213 | .stop(); 214 | 215 | 216 | 217 | 218 | variableSetToScriptValue(tmp1, input.dest_x); 219 | variableSetToScriptValue(tmp2, input.dest_y); 220 | 221 | _rpn() 222 | .ref(tmp2).int16(256).operator(".MUL") // (dest_y << 8) | dest_x 223 | .ref(tmp1) 224 | .operator(".B_OR") 225 | .refSet(tmp1) 226 | .stop(); 227 | 228 | variableSetToScriptValue(tmp2, input.w); 229 | variableSetToScriptValue(tmp3, input.h); 230 | 231 | _rpn() 232 | .ref(tmp3).int16(256).operator(".MUL") // (h << 8) | w 233 | .ref(tmp2) 234 | .operator(".B_OR") 235 | .refSet(tmp2) 236 | .stop(); 237 | 238 | if (input.copy_attr === "overlay"){ 239 | variableSetToScriptValue(tmp3, input.overlay_x); 240 | variableSetToScriptValue(tmp4, input.overlay_y); 241 | 242 | _rpn() 243 | .ref(tmp4).int16(256).operator(".MUL") // (overlay_y << 8) | overlay_x 244 | .ref(tmp3) 245 | .operator(".B_OR") 246 | .refSet(tmp3) 247 | .stop(); 248 | 249 | 250 | } 251 | 252 | if (input.use_far_ptr){ 253 | variableSetToScriptValue(tmp4, input.scene_bank); 254 | variableSetToScriptValue(tmp5, input.scene_ptr); 255 | } 256 | 257 | 258 | 259 | if (input.use_far_ptr){ 260 | _stackPush(tmp5); 261 | _stackPush(tmp4); 262 | } else { 263 | const { scenes } = options; 264 | const scene = scenes.find((s) => s.id === input.sceneId); 265 | if (!scene) { 266 | return; 267 | } 268 | _stackPushConst(`_${scene.symbol}`); 269 | _stackPushConst(`___bank_${scene.symbol}`); 270 | } 271 | 272 | if (input.copy_attr === "background"){ 273 | _stackPushConst(1); 274 | } else if (input.copy_attr === "overlay"){ 275 | _stackPushConst(2); 276 | } else { 277 | _stackPushConst(0); 278 | } 279 | _stackPush(tmp3); 280 | _stackPush(tmp2); 281 | _stackPush(tmp1); 282 | _stackPush(tmp0); 283 | 284 | _callNative("copy_background_submap_to_tileset"); 285 | _stackPop(7); 286 | 287 | }; 288 | -------------------------------------------------------------------------------- /SubmappingExPlugin_v4/events/eventReplaceBackgroundTile.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_REPLACE_BACKGROUND_TILE"; 2 | export const name = "Set background tile"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Set background tile`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: `x`, 12 | label: "X", 13 | type: "value", 14 | width: "50%", 15 | defaultValue: { 16 | type: "number", 17 | value: 0, 18 | }, 19 | }, 20 | { 21 | key: `y`, 22 | label: "Y", 23 | type: "value", 24 | width: "50%", 25 | defaultValue: { 26 | type: "number", 27 | value: 0, 28 | }, 29 | }, 30 | { 31 | key: `tile_id`, 32 | label: "Tile id", 33 | type: "value", 34 | defaultValue: { 35 | type: "number", 36 | value: 0, 37 | }, 38 | }, 39 | ]; 40 | 41 | export const compile = (input, helpers) => { 42 | 43 | const { _callNative, _stackPush, _stackPushConst, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 44 | 45 | const tmp0 = _declareLocal("tmp0", 1, true); 46 | const tmp1 = _declareLocal("tmp1", 1, true); 47 | const tmp2 = _declareLocal("tmp2", 1, true); 48 | 49 | variableSetToScriptValue(tmp0, input.x); 50 | variableSetToScriptValue(tmp1, input.y); 51 | variableSetToScriptValue(tmp2, input.tile_id); 52 | 53 | _addComment("Replace background tile"); 54 | 55 | _stackPush(tmp2); 56 | _stackPush(tmp1); 57 | _stackPush(tmp0); 58 | 59 | _callNative("vm_replace_background_tile"); 60 | _stackPop(3); 61 | }; 62 | -------------------------------------------------------------------------------- /SubmappingExPlugin_v4/events/eventReplaceOverlayTile.js: -------------------------------------------------------------------------------- 1 | export const id = "EVENT_REPLACE_OVERLAY_TILE"; 2 | export const name = "Set overlay tile"; 3 | export const groups = ["EVENT_GROUP_SCREEN"]; 4 | 5 | export const autoLabel = (fetchArg) => { 6 | return `Set overlay tile`; 7 | }; 8 | 9 | export const fields = [ 10 | { 11 | key: `x`, 12 | label: "X", 13 | type: "value", 14 | width: "50%", 15 | defaultValue: { 16 | type: "number", 17 | value: 0, 18 | }, 19 | }, 20 | { 21 | key: `y`, 22 | label: "Y", 23 | type: "value", 24 | width: "50%", 25 | defaultValue: { 26 | type: "number", 27 | value: 0, 28 | }, 29 | }, 30 | { 31 | key: `tile_id`, 32 | label: "Tile id", 33 | type: "value", 34 | defaultValue: { 35 | type: "number", 36 | value: 0, 37 | }, 38 | }, 39 | ]; 40 | 41 | export const compile = (input, helpers) => { 42 | 43 | const { _callNative, _stackPush, _stackPushConst, _stackPop, _addComment, _declareLocal, variableSetToScriptValue } = helpers; 44 | 45 | const tmp0 = _declareLocal("tmp0", 1, true); 46 | const tmp1 = _declareLocal("tmp1", 1, true); 47 | const tmp2 = _declareLocal("tmp2", 1, true); 48 | 49 | variableSetToScriptValue(tmp0, input.x); 50 | variableSetToScriptValue(tmp1, input.y); 51 | variableSetToScriptValue(tmp2, input.tile_id); 52 | 53 | _addComment("Replace overlay tile"); 54 | 55 | _stackPush(tmp2); 56 | _stackPush(tmp1); 57 | _stackPush(tmp0); 58 | 59 | _callNative("vm_replace_overlay_tile"); 60 | _stackPop(3); 61 | }; 62 | --------------------------------------------------------------------------------