Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Bug] Six Control Unit Fixes
#1
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):
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)