FireEmblemUniverse / ColorzCore

A rewriting of Core.exe for EA.
GNU General Public License v3.0
7 stars 7 forks source link

Add warning when writing before first ORG #13

Closed StanHash closed 5 years ago

StanHash commented 6 years ago

if my event file only contains

WORD 0

then, when assembling, I will now get the following error:

In File Main.event, Line 1, Column 1: Writing before initializing offset. You may be breaking the ROM! (use `ORG offset` to set write offset).

But all is good if I add a ORG 0 at the start.

(the idea is to notify the few people that still use EA directly to install hacks meant for buildfiles that they're probably forgetting something).


Making this behaviour optional may be worth considering (later?).

Crazycolorz5 commented 6 years ago

Interesting design proposal. Mind writing it up as a feature proposal in Issues so I can direct FEU discussion to it?

I think the idea has merit but I am a bit concerned about potential cases as this would make valid programs a strict subset of before.

That said, I don't think any genuine EA script before legitimately wanted to write to 0.

But if someone was using it for binary file manipulation (which I can see as possible), then it might break those....

But there are probably very few cases of those and such people shouldn't have issue writing an ORG 0.

(Nevertheless, would like to hear more opinions).

Crazycolorz5 commented 5 years ago

The use of Tuple<int, bool> to store the intialized-ness of the initial block is a bit awkward, but I can't think of any other solution readily apparent. Approved.