03-14-2016, 11:54 AM
(This post was last modified: 03-14-2016, 03:02 PM by Rubidium_Bradford. Edited 2 times in total.)
I took a look at the Control Unit code to check out the jumping bug and fixed a few more things along the way. I'm new to coding for BYOND so I hope the code is okay. Running locally the bugs I noticed and fixed are gone as far as I can tell.
Summary of changes (Line #s refer to lines in the altered version):
Link here
Summary of changes (Line #s refer to lines in the altered version):
Code:
LINE 334: An error in the JMP instruction made backwards jumps act as though the argument were one less than the actual value, not only leading to confusing behaviour but also making an unexpected infinite loop possible with a "C0" instruction
Line 55, removes the Set Send Signal verb from the CU, as it has no use. Inspired by Hyphz's patch of a similar nature
Lines 167 and 193, move the Set ROM and Toggle Active verbs to "Local" where the other Mechcomp verbs are.
Line 183: MAX_ROM_SIZE was not being used, I replaced the hardcoded value with the defined limit.
Line 207: Previously, stopping and starting the CU would not reset the PC, leading to very odd behaviour when resuming and especially when altering the program.
Various deletions, resolved in lines 76,77: PC bounds checking previously was odd and behaved strangely when jumping out of bounds. New code simply resolves an out of bounds PC back to 0.
Link here