Merge remote-tracking branch 'upstream' into tryrenaming

This commit is contained in:
mrdudz
2025-06-24 17:51:48 +02:00
5 changed files with 50 additions and 7 deletions

View File

@@ -302,6 +302,7 @@ function.
<item><ref id="cputcxy" name="cputcxy">
<item><ref id="cputs" name="cputs">
<item><ref id="cputsxy" name="cputsxy">
<item><ref id="cscanf" name="cscanf">
<item><ref id="cursor" name="cursor">
<item><ref id="cvline" name="cvline">
<item><ref id="cvlinexy" name="cvlinexy">
@@ -2720,7 +2721,7 @@ see anything that you type. (See the description of <tt/cbm_k_scnkey()/.)
<quote>
<descrip>
<tag/Function/Input a string directly to the console.
<tag/Function/Input a string directly from the console.
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/char* __fastcall__ cgets (const char* buffer, int size);/
<tag/Description/The function inputs a string of at most <tt/size - 1/
@@ -2735,11 +2736,12 @@ be used in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cgetc" name="cgetc">
<ref id="cgetc" name="cgetc">,
<ref id="cscanf" name="cscanf">
<tag/Example/<verb>
#include &lt;conio.h&gt;
int main ()
int main (void)
{
char buffer[200], *p;
@@ -3353,6 +3355,47 @@ be used in presence of a prototype.
</quote>
<sect1>cscanf<label id="cscanf"><p>
<quote>
<descrip>
<tag/Function/Read formatted input from the console
<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
<tag/Declaration/<tt/int cscanf (const char* format, ...);/
<tag/Description/The <tt/cscanf()/ function scans input from the console under
control of the argument <tt/format/. Following the format string is a list of
addresses to receive values. The format string is identical to that of the
<tt/scanf()/ function.
<tag/Notes/<itemize>
<item>A direct call to <tt/cursor()/ may be required to show the cursor.
<item>Some control characters like backspaces are not recognized.
<item>A better user experience can sometimes be provided by using <tt/cgets()/
to retrieve the input, and then using <tt/sscanf()/ to parse it.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="cgets" name="cgets">,
<ref id="cursor" name="cursor">
<tag/Example/<verb>
#include &lt;conio.h&gt;
int main (void)
{
int a, b, c;
cputs ("Type three integers that add to 100: ");
if (cscanf ("%d %d %d", &amp;a, &amp;b, &amp;c) == 3 && a + b + c == 100)
cputs ("\r\nYou passed!\r\n");
else
cputs ("\r\nYou failed!\r\n");
return 0;
}
</verb>
</descrip>
</quote>
<sect1>cursor<label id="cursor"><p>
<quote>

View File

@@ -10,7 +10,7 @@
.zeropage
c_sp: .res 2 ; Stack pointer
c_sp: .res 2 ; Stack pointer
sreg: .res 2 ; Secondary register/high 16 bit for longs
regsave: .res 4 ; Slot to save/restore (E)AX into
ptr1: .res 2

View File

@@ -468,7 +468,7 @@ unsigned OptPtrStore2 (CodeSeg* S)
L[6]->OPC == OP65_LDX &&
L[7]->OPC == OP65_LDA &&
L[7]->AM == AM65_ZP_INDY &&
strcmp (L[7]->Arg, "c_sp") == 0 &&
strcmp (L[7]->Arg, "c_sp") == 0 &&
L[8]->OPC == OP65_LDY &&
(L[8]->AM == AM65_ABS ||
L[8]->AM == AM65_ZP ||

View File

@@ -458,7 +458,7 @@ static unsigned FindIdType (const char* TypeName)
{ "segment", SegmentId },
{ "source", SourceId },
{ "src", SourceId },
{ "c_sp", SpanId },
{ "c_sp", SpanId },
{ "span", SpanId },
{ "sym", SymbolId },
{ "symbol", SymbolId },

View File

@@ -41,7 +41,7 @@ int main(void)
printf(" data: $%04X (data)\n", &data);
printf(" _dos_type: $%04X (bss)\n", &_dos_type);
printf(" allocmem: $%04X (dyn. data)\n", allocmem);
printf(" c_sp: $%04X (stack ptr)\n", getsp());
printf(" c_sp: $%04X (stack ptr)\n", getsp());
if (allocmem) free(allocmem);
if (doesclrscrafterexit()) cgetc();