Commit Graph

57 Commits

Author SHA1 Message Date
Bryan Bishop 5e70ac56ea remove ItemFragment from preprocessor
It's not required.

see #178
2013-08-30 18:36:14 -05:00
Bryan Bishop 69adf48a54 remove "skippable_macros" from preprocessor
The preprocessor no longer has the concept of skippable_macros and now
always skips any line that starts with "db" or "dw" because neither of
these should be treated as macros.

fixes #178
2013-08-30 18:27:03 -05:00
Bryan Bishop 8fe7f4c3a5 HACK: re-instate the ItemFragment macro hack
This is to fix the preprocessor temporarily. Maybe ItemFragment can be
removed completely.
2013-08-30 17:23:43 -05:00
Bryan Bishop 3fb03e9981 two more unused imports from preprocessor 2013-08-28 20:31:17 -05:00
Bryan Bishop e4d3ea7256 don't use globals in the preprocessor
Macros are now passed around as lists and dicts.
2013-08-28 17:53:26 -05:00
Bryan Bishop 16bfc01124 use generic skippable macros in preprocessor
This removes TextEndingCommand from the preprocessor. Instead, there is
a generic concept of a skippable type of macro like "db".

This adds SkippableMacro to the preprocessor.
2013-08-28 17:18:29 -05:00
Bryan Bishop b602cc9bd6 don't directly reference two macro classes
Ideally the macro classes will be removed from the preprocessor core
soon, there's no reason they should be infecting these functions.
2013-08-28 16:48:29 -05:00
Bryan Bishop 6d612c8828 remove MoneyByteParam from preprocessor
It didn't belong in there. All of the references were removed.
2013-08-28 16:33:27 -05:00
Bryan Bishop a4782d9b5a Merge branch 'master' into remove-another-moneybyteparam-special-case 2013-08-28 16:32:15 -05:00
Bryan Bishop 0236b59360 remove another MoneyByteParam special case
This updates the preprocessor to just look for a from_asm method on the
class for the parameter it's processing. If there's a from_asm method,
then it uses it to spit out the right asm.
2013-08-28 16:30:47 -05:00
Bryan Bishop 00b36922d2 remove a special case for MoneyByteParam
The preprocessor should ideally have no special cases for macros at all
in the first place. But it does. This one doesn't seem to be necessary.
2013-08-28 16:14:23 -05:00
Bryan Bishop 3453879756 Merge branch 'master' into remove-extras 2013-08-27 10:51:30 -05:00
Bryan Bishop 2a421c54b6 fix preprocessor imports for the latest submodule
I am surprised this worked. Maybe it's not actually working, and I just
have cached files everywhere.
2013-08-03 16:25:14 -05:00
yenatch d4e6ccca3b jp char ァ 2013-07-31 18:02:08 -04:00
yenatch d3872d1aa9 chars: ▷ 2013-07-10 19:17:02 -04:00
Bryan Bishop b710b8721e don't mix tabs/whitespace 2013-06-25 22:25:50 -05:00
yenatch 8d2df72cb8 pre: restore separate_comment's behavior 2013-06-25 21:24:09 -04:00
yenatch e733c4234c preprocess asm files individually
this fixes a lot of previous hacks

first off, rgbds requires that labels from includes be marked as globals.
instead, 3626ddeb stuffed includes into the parent file in the preprocessor.
this meant one huge file got preprocessed every time, adding an additional
ten seconds to compile time.

running the preprocessor once for each file would create too much overhead,
so a list is fed into prequeue.py, which then makes calls to preprocessor.py.

this paves the way for compiling source files separately some day.

next, compiling previously required `make clean` to be executed first.
f3340de6 touched main.asm to force a fresh compile instead. this behavior
has been reverted. now, `make all` will only attempt to recompile if a
source file has changed.

preprocessor.py has some marginal changes. prequeue.py is created to keep
the original functionality of preprocessor.py intact. so many files are
preprocessed on first compile (1951 as of this commit) that the prequeue
call has been hidden.

compile time is reduced to 15-30 seconds on first compile, and 5-10 seconds
subsequently. the majority of this time is spent in rgbasm.
2013-06-21 16:12:40 -04:00
yenatch ffd562351b preprocessor: minor optimization in separate_comment 2013-05-15 14:39:43 -04:00
yenatch ac391b7b8e preprocessor: print macro automatically inserts newlines 2013-05-11 13:51:30 -04:00
Bryan Bishop 2a44711fa7 Merge pull request #126 from yenatch/master
map scripts + ai + disabled line ending correction
2013-05-06 22:15:41 -07:00
yenatch 2acb46f6b5 downward triangle character 0xee 2013-05-01 23:18:38 -04:00
Bryan Bishop 0e47273378 Merge yenatch/master. 2013-04-27 17:29:29 -05:00
yenatch dc81d0cfcf dump move effects 2013-03-29 18:54:42 -04:00
Bryan Bishop 4332a25bd5 fix docstring formatting everywhere 2013-03-21 15:15:42 -05:00
Bryan Bishop 393b4971f4 include some http ascii from the ROM 2013-03-01 21:40:01 -06:00
Bryan Bishop 80fc1f42c4 clean up the preprocessor macro list 2013-01-27 17:45:23 -06:00
yenatch dd16a25768 allow labels and includes on the same line 2013-01-23 15:27:14 -05:00
Bryan Bishop 01f48a54e8 speed up text conversion in preprocessor 2013-01-10 16:33:14 -06:00
Bryan Bishop 458709fc77 combine multiple calls to sys.stdout.write 2013-01-10 16:25:57 -06:00
Bryan Bishop 849a57c9f1 disable macro error checking by default 2013-01-10 15:58:24 -06:00
Bryan Bishop fe8476d6bc make include_file faster in the preprocessor 2013-01-10 15:52:18 -06:00
Bryan Bishop 662f442221 disable '; original line' by default 2013-01-10 15:42:43 -06:00
Bryan Bishop f558edafff even faster preprocessor 2013-01-10 15:34:30 -06:00
Bryan Bishop f2fd544e20 make the preprocessor a little faster
This reduced the preprocessing time from 8s to 2.7s.
2013-01-10 15:19:56 -06:00
Bryan Bishop 3f95529102 saner import syntax in preprocessor 2013-01-10 15:07:36 -06:00
Bryan Bishop 9d68470e0f even better preprocessor formatting 2012-11-30 10:26:49 -06:00
Bryan Bishop 3d8e7a1776 make preprocessor includable as a module
The preprocessor only runs against stdin when __main__ is activated,
instead of always running on stdin. This allows the file to be included
in an interactive python session or in other scenarios.
2012-11-30 10:12:27 -06:00
Bryan Bishop 935384f931 update spacing for read_line in preprocessor 2012-11-30 10:04:56 -06:00
Bryan Bishop 44c3eb1ccf make the include macro check better
The include macro is now checked against only the beginning of the line,
and comments in the asm file can say "INCLUDE \"" if they need to. In
addition, the preprocessor now supports INCLUDE lines that are preceded
by a tab character. However, if this included file has multiple lines,
the output will not be automatically aligned with the initial tab. This
might cause problems with rgbasm.
2012-11-30 10:01:33 -06:00
Bryan Bishop 1e6f295573 more preprocessor comments 2012-11-30 09:58:57 -06:00
Bryan Bishop 9b4718d0c7 clean up formatting in preprocessor 2012-11-30 09:56:15 -06:00
Bryan Bishop a1a9fa5560 move allowed_lengths for music macros out
This moves the allowed_lengths setting out of the preprocessor. Special
cases should not be hardcoded in the preprocessor.
2012-11-30 09:54:02 -06:00
padz 3626ddebd1 implement music macros; INCLUDE injection in pre 2012-11-30 05:58:00 -05:00
IIMarckus fa019d2f51 Add some functions from Mobile Stadium. 2012-07-07 19:51:02 -06:00
Bryan Bishop 01756965ba remove extra whitespace from preprocessor.py 2012-05-23 03:14:15 -05:00
Bryan Bishop a049ef74f8 use db instead of item_frag on ItemFragment remote chunks 2012-05-16 21:16:28 -05:00
Bryan Bishop 611016ae40 add a 'correction' to preprocessor to account for storetext issues 2012-05-16 18:34:03 -05:00
Bryan Bishop 079afeea46 fix preprocessor/givepoke for variable-number-of-parameter macros 2012-05-16 12:44:55 -05:00
Bryan Bishop e905f9f1f1 better movement command/macro support 2012-05-13 21:53:48 -05:00