From cb3700ef665b7d59c18cfc82456bb64448cc3def Mon Sep 17 00:00:00 2001 From: polluks Date: Tue, 5 Jan 2016 17:45:18 +0100 Subject: [PATCH] Changed stdout to stderr to separate sim65's output streams. Suggested doc edit. --- doc/index.sgml | 2 +- doc/sim65.sgml | 4 ++-- src/sim65/main.c | 4 ++-- src/sim65/paravirt.c | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/index.sgml b/doc/index.sgml index c78426f2a..b6ef06ef9 100644 --- a/doc/index.sgml +++ b/doc/index.sgml @@ -89,7 +89,7 @@ An overview over the cc65 runtime and C libraries. - Describes Christian Krügers macro package for writing self modifying + Describes Christian Krüger's macro package for writing self modifying assembler code. Input and output

-The simulator will read one binary file per invocation and can log some -library calls. +The simulator will read one binary file per invocation and can log the +program loading and paravirtualization calls to stderr. Example output for the command diff --git a/src/sim65/main.c b/src/sim65/main.c index 22f6831e4..dab9b0be8 100644 --- a/src/sim65/main.c +++ b/src/sim65/main.c @@ -156,7 +156,7 @@ static void ReadProgramFile (void) /* Close the file */ fclose (F); - Print (stdout, 1, "Loaded `%s' at $0200-$%04X\n", ProgramFile, Addr - 1); + Print (stderr, 1, "Loaded `%s' at $0200-$%04X\n", ProgramFile, Addr - 1); } @@ -238,7 +238,7 @@ int main (int argc, char* argv[]) ExecuteInsn (); if (MaxCycles && (GetCycles () >= MaxCycles)) { Error ("Maximum number of cycles reached."); - exit (-99); /* do not ues EXIT_FAILURE to avoid conflicts with the + exit (-99); /* do not use EXIT_FAILURE to avoid conflicts with the same value being used in a test program */ } } diff --git a/src/sim65/paravirt.c b/src/sim65/paravirt.c index 0deb59a5f..56211b5c1 100644 --- a/src/sim65/paravirt.c +++ b/src/sim65/paravirt.c @@ -128,7 +128,7 @@ static void PVArgs (CPURegs* Regs) unsigned SP = MemReadZPWord (0x00); unsigned Args = SP - (ArgC + 1) * 2; - Print (stdout, 2, "PVArgs ($%04X)\n", ArgV); + Print (stderr, 2, "PVArgs ($%04X)\n", ArgV); MemWriteWord (ArgV, Args); @@ -155,7 +155,7 @@ static void PVArgs (CPURegs* Regs) static void PVExit (CPURegs* Regs) { - Print (stdout, 1, "PVExit ($%02X)\n", Regs->AC); + Print (stderr, 1, "PVExit ($%02X)\n", Regs->AC); exit (Regs->AC); } @@ -177,7 +177,7 @@ static void PVOpen (CPURegs* Regs) } while (Path[I++]); - Print (stdout, 2, "PVOpen (\"%s\", $%04X)\n", Path, Flags); + Print (stderr, 2, "PVOpen (\"%s\", $%04X)\n", Path, Flags); switch (Flags & 0x03) { case 0x01: @@ -219,7 +219,7 @@ static void PVClose (CPURegs* Regs) unsigned FD = GetAX (Regs); - Print (stdout, 2, "PVClose ($%04X)\n", FD); + Print (stderr, 2, "PVClose ($%04X)\n", FD); RetVal = close (FD); @@ -237,7 +237,7 @@ static void PVRead (CPURegs* Regs) unsigned Buf = PopParam (2); unsigned FD = PopParam (2); - Print (stdout, 2, "PVRead ($%04X, $%04X, $%04X)\n", FD, Buf, Count); + Print (stderr, 2, "PVRead ($%04X, $%04X, $%04X)\n", FD, Buf, Count); Data = xmalloc (Count); @@ -264,7 +264,7 @@ static void PVWrite (CPURegs* Regs) unsigned Buf = PopParam (2); unsigned FD = PopParam (2); - Print (stdout, 2, "PVWrite ($%04X, $%04X, $%04X)\n", FD, Buf, Count); + Print (stderr, 2, "PVWrite ($%04X, $%04X, $%04X)\n", FD, Buf, Count); Data = xmalloc (Count); while (I < Count) { -- 2.39.2