MightyPirates / TIS-3D

TIS-100 inspired low-tech computing in Minecraft.
https://www.curseforge.com/minecraft/mc-mods/tis-3d
Other
108 stars 35 forks source link

[1.14-fabirc] Actively written-to RAM module keeps modifying ROM module #102

Closed Sturmlilie closed 4 years ago

Sturmlilie commented 4 years ago

Environment: Dedicated server, creative mode How to reproduce: Put an execution and RAM module side-by-side and load the following test program:

# RAMTEST
#DEFINE RAM ANY
MOV 0, ACC
SAV
LOOP:
SWP
MOV ACC, RAM
MOV ACC, RAM
ADD 1
SAV
SUB 0XFF
JNZ LOOP
END: JMP END

It will start filling up the RAM module. Then take a ROM module, and use shift-click to copy the current contents of the RAM. While the RAM continues being written to, the held ROM module will cause hand-motion, and the memory view suggests that the new values arriving in RAM are also being written to the ROM module.

Couldn't reproduce this in survival because the shift-click doesn't work there (only opens memory view).

fnuecke commented 4 years ago

I could've sworn there was a time when NBTByteArray always created a copy of the data... but apparently not, huh.

Thanks! Will fix.

That copying doesn't work in survival sounds like a bug that came in in the 1.14 port... will also have a look at that.