Skip to content

Phase error detection code safe to alter? #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
noyen1973 opened this issue Jan 16, 2024 · 1 comment
Open

Phase error detection code safe to alter? #124

noyen1973 opened this issue Jan 16, 2024 · 1 comment

Comments

@noyen1973
Copy link

The block of code surrounding line #15308 in src\mp.pas appears to detect phase errors during the the assembly process. How safe is it to change the $120 to $1 so that there is no deviance between the current assembly pass and the previous pass? Is there a possibility Mads could get stuck in an endless loop flip/flopping an address calculation?

asm65(#9'ift (?adr < ?old_adr) && (?old_adr - ?adr < $120)');

I'm trying to output to a PGZ file format but it requires the known length of Mads' final .OBX file to be used in the file header written before the object file. I have all the extra code in place and inserted a new line after the Fastmul detection, line #15042, asm65('F256BINARYSIZE'#9'= * - CODEORIGIN');. However, with the $120 value in line #15308 the value is off by several bytes for my game. Changing the value to $1 resulted in an extra pass and the correct size calculation for a working PGZ file.

@tebe6502
Copy link
Owner

The value $120 is not random, for other values there may be an endless loop, it depends on the complexity of the example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants