If you open a file on a disk drive with secondary address >=2, you need to supply file type and access method appended to the file name: in your case ",P,R", without the quotes, appended to MASTER.
With PRG files on disk drives, secondary address 0 is equivalent to ",P,R", secondary address 1 is equivalent to ",P,W".
In VICE, VDrive accesses to a directory on the host's harddrive ignore the filetype, but the access method must still match (either ",R"/",W" or secondary address 0/1). Same applies to file accesses on SD2IEC devices outside disk images.
BTW, your first JSR to "CHKIN" at $FFBD in fact calls SETNAM.
Also, checking the carry flag on CHRIN for errors (like EOF) doesn't work at all from IEC devices. Some time ago I devised a small subroutine, which actually does the Right Thing™:
Code: Select all
.GetByte
JSR $FFCF
PHA
LDA $90
CMP #1 ; set carry when ST>=1 (i.e., <>0!)
PLA ; keep carry, and possibly set Z flag for byte=0
RTS