Commit Graph

897 Commits

Author SHA1 Message Date
haven1433
c2c968920f bugfixes
parse "rX = <anchor>" correctly
2023-12-01 12:26:09 -06:00
haven1433
b7f5a3cad6 make data.battle.text expandable (FR/LG)
the constant in R/S/E has a `lsl 1` on it, so the table cannot be naturally expanded. It may be better to just remove the limiter, which is near the 2nd-to-last pointer to the table.
2023-12-01 10:44:06 -06:00
haven1433
fab59ae727 minor bugfixes
xor as an alias for eor
r1 >>= 2 should compile correctly
fix crash when writing thumb code
2023-12-01 10:43:01 -06:00
haven1433
d88aeb535f minor features
add teachy-tv table
add comment explaining how ListMenu works. Add table that ListMenu uses.
setweather takes a weather enum now instead of a number
setworldmapflag values are displayed in hex, and no longer offer flag-picking since it's a different list of flags
choose-save background palette
2023-11-29 21:54:40 -06:00
haven1433
dcc551396f msgbox.item only works in FR/LG 2023-11-29 21:03:10 -06:00
haven1433
7dccc53e53 fixing bugs
script args should be able to handle <null>
don't add/remove runs inside the method that isn't supposed to touch the runs collection
handle race condition where UI may be aware of tab being removed before ViewModel gets a chance to notify it
fix bounds checking in map editor collision counting
better default value for newly added map script tables
fix width/height double-check when failing to import multi-sprites
fix cutoff text
fix spelling error
2023-11-27 23:29:44 -06:00
haven1433
69e03b7c08 use script variables for specials documentations 2023-11-17 22:19:39 -06:00
haven1433
9d9b0d7f7f update documentation to use varX instead of 0x800X for scripts 2023-11-17 22:11:19 -06:00
haven1433
32bf8d0ea4 add specialvar as an alias for special2
still prefers `special2` when decompiling scripts
2023-11-17 21:54:26 -06:00
haven1433
7aacb8ef27 Script compare: Prefer == over =, but make sure = still works
Also fix a bug where "abc" was preferred over "cde" if we're looking for a partial match of "c". Prefer matching the start of the text.
2023-11-17 21:48:35 -06:00
haven1433
417383584a msgbox.item now includes actually giving the player an item.
fix bug where some macros don't decompile correctly
2023-11-17 20:05:16 -06:00
haven1433
ad7eed0b9b support rA = table[rB].field syntax in thumb code 2023-11-16 23:11:39 -06:00
haven1433
1fb5a9296f support expanding fly locations 2023-11-15 16:33:34 -06:00
haven1433
acd42046ae update initial "open map" button logic 2023-11-15 07:43:54 -06:00
haven1433
ae873de5bd improve command-show conditions
makes it more likely to show line completion for things like trainerbattle
2023-11-15 07:09:00 -06:00
haven1433
0d1100e4d4 fix ldr =(a+b) style commands 2023-11-14 19:34:01 -06:00
haven1433
48b68d5cee support for more thumb operator macros
*=
^=
|=
&=
<<=
>>=
2023-11-10 23:39:21 -06:00
haven1433
aa03f98aa8 support for branch-link macros
You can now use branch-link like a function call. For example, instead of:
```arm
    mov r0, #1
    bl <thumb.new_menu_helpers.ScheduleBgCopyTilemapToVram>
    mov r0, #2
    bl <thumb.new_menu_helpers.ScheduleBgCopyTilemapToVram>
    mov r0, #3
    bl <thumb.new_menu_helpers.ScheduleBgCopyTilemapToVram>
```
you can do
```arm
    thumb.new_menu_helpers.ScheduleBgCopyTilemapToVram(1)
    thumb.new_menu_helpers.ScheduleBgCopyTilemapToVram(2)
    thumb.new_menu_helpers.ScheduleBgCopyTilemapToVram(3)
```
2023-11-05 00:34:00 -05:00
ShinyTillDawn
77dd163d73
Reimported the changes from Pull Req #179 (#199) 2023-11-04 10:42:31 -05:00
haven1433
143752d918 add support for add/subtract macros in thumb code
See the new tests for examples of what you can do with this feature.
The first value in an = operation is allowed to be outside the range [0, 255]. All other values must be inside the range. You may add registers.
If you're doing += or -=, even the first value must be within the range [0, 255].
No support for parenthesis. High registers are supported only for addition or equality. So you could do:
`r8 = r9 + r10` or `r8 = r9`
but not
`r9 = 3` or `r9 = r2 + 3`
2023-11-03 23:11:28 -05:00
haven1433
97d2a4ae6b thumb code improvements
* support `rX = 7` as an alias for mov (and ldr) commands
* make commas optional to make successful compile more likely
2023-11-03 20:05:40 -05:00
haven1433
20839f6a85 more hubol features
randomizer exclusion lists
set wild pokemon moves
2023-11-02 21:02:23 -05:00
haven1433
8efac2c6c9 more CFRU support
roaming pokemon
trainer class-based music
expanded tutors / tms
2023-11-01 22:34:00 -05:00
haven1433
5cef223bf6 initial updates for supporting Leon's DPE/CFRU 2023-10-30 22:10:36 -05:00
haven1433
6217060449 fix long-branch-link code
When pushing, the low registers are put at lower addresses, followed by lr. Pushing decreases sp.

When popping, the low registers taken from lower addresses, then pc is pulled from a higher address. Popping increases sp.

So we want to push r0/r1 and pop r0/pc, which means we want to manipulate r0, not r1. We only pop r1 so we have a space to pop pc from, not because we actually want to store the value.
2023-10-29 21:18:16 -05:00
haven1433
44aeed4e91 fix math for determining length of array arguments
need to account for the command name token
2023-10-29 18:43:16 -05:00
haven1433
5f31a51ca5 titlescreen clouds
thanks Phoenix :)
2023-10-29 18:23:17 -05:00
haven1433
7c11b6dbcc improve script documentation
* "from game X address Y" is now a comment in the examples (starts with leading #)
* include "from game X address Y" for macros as well
* examples should use the new script variable aliases
* prefer FireRed/Emerald for examples
2023-10-29 10:51:10 -05:00
haven1433
fa8def2e77 support <auto> for sprite templates 2023-10-28 22:54:39 -05:00
haven1433
32ebdd13d8 fix broken tests 2023-10-28 20:36:14 -05:00
haven1433
545b3b316e add names for common variables
temps and vars
2023-10-28 20:36:07 -05:00
haven1433
a82a022fdc use signed values for showpokepic 2023-10-28 17:01:01 -05:00
haven1433
eafdfaf038 update documentation
use correct `trainerbattle` in examples
2023-10-28 12:55:32 -05:00
haven1433
18ebf4082f berrrycheck
Thanks VersekrDarkYT
2023-10-28 09:32:57 -05:00
haven1433
b053c4e58c fix sort order of macro argument for autocomplete / help 2023-10-27 06:53:00 -05:00
ShinyTillDawn
888c8d37d2
Added the E4 mugshot palettes. (#198)
* Added the E4 mugshot palettes.

The pointers have not been tested in FR 1.1 and LeafGreen yet.

* Added a [[List]] for the trainer names.
2023-10-24 13:25:14 -05:00
haven1433
75de1ed0aa friendship changes for R/S/E 2023-10-02 20:43:38 -05:00
haven1433
61ec2893e1 add friendship changes table for FR 2023-10-01 17:35:46 -05:00
haven1433
0f187a8e77 allow mod operations for calculated fields
also allow enums resulting from calculated fields
2023-10-01 17:20:43 -05:00
haven1433
b202c6df8b add safari ball count constant 2023-10-01 16:51:14 -05:00
haven1433
dcdb3189d2 update script reference examples 2023-10-01 16:31:52 -05:00
haven1433
4771532e09 add warp.center macro 2023-10-01 14:17:47 -05:00
haven1433
5dc5706c85 re-add warp changes
lost during merging
2023-10-01 14:12:59 -05:00
PhoenixBound
2dd69848d1
Document a few script commands (#196)
* Document a few script commands

* Undo change to initclock parameters

Variable numbers will display in hex even without a |h, so this change
was misguided.

---------

Co-authored-by: haven1433 <haven1433@gmail.com>
2023-10-01 14:09:20 -05:00
haven1433
6366403e7c fix broken tests 2023-10-01 13:58:06 -05:00
haven1433
53b4ed35e0 allow scripts to see scripts before they start 2023-10-01 12:50:07 -05:00
haven1433
c12d15bb04 scripts should continue formatting after an early end 2023-10-01 12:12:46 -05:00
haven1433
5dc7eaecda refactor
ScriptParser.cs is getting too long
* move ScriptLine and related types to their own file
* move ScriptArg and related types to their own file
2023-10-01 12:12:10 -05:00
haven1433
abc23f6ea2 wild pokemon rate comments for pokemon in the grass 2023-10-01 09:52:39 -05:00
haven1433
8a7cd6746e add puzzle tables for fortree / trickhouse
R/S addresses later if anyone cares
2023-09-30 18:53:02 -05:00