From 974188796c3f8a8817f1d2ef9623beb894accc2b Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Fri, 17 Aug 2018 10:50:16 -0700 Subject: [PATCH] sim65: If mode argument is omitted, use a reasonable default. --- src/sim65/paravirt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sim65/paravirt.c b/src/sim65/paravirt.c index 0c634dc0d..fda2839af 100644 --- a/src/sim65/paravirt.c +++ b/src/sim65/paravirt.c @@ -175,6 +175,13 @@ static void PVOpen (CPURegs* Regs) unsigned Flags = PopParam (2); unsigned Name = PopParam (2); + if (Regs->YR - 4 < 2) { + /* If the caller did not supply the mode argument, + ** use a reasonable default. + */ + Mode = 0400 | 0200; + } + do { Path[I] = MemReadByte (Name++); } -- 2.39.5