The BCPL readinput_long routine returns whatever value Read() returns, shifted right by 2 bits. Read() returns -1 to indicate an error. You need to return -1 to the caller in that case, not (-1)>>2 = $3FFFFFFF.
Ah right, obviously I need to brush up on my asm skills!
Is there any theoretical case where Read() could be called with length greater than 2GB? The current code would fail because of the asr in that case. I guess you'd need to configure the emulated Amiga with a huge amount of memory.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
-1 shifted by asr is still -1.
Ah right, obviously I need to brush up on my asm skills!
Is there any theoretical case where Read() could be called with length greater than 2GB? The current code would fail because of the asr in that case. I guess you'd need to configure the emulated Amiga with a huge amount of memory.