Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
;
|
||||
; time_t _systime (void);
|
||||
; /* Similar to time(), but:
|
||||
; * - Is not ISO C
|
||||
; * - Does not take the additional pointer
|
||||
; * - Does not set errno when returning -1
|
||||
; */
|
||||
; ** - Is not ISO C
|
||||
; ** - Does not take the additional pointer
|
||||
; ** - Does not set errno when returning -1
|
||||
; */
|
||||
;
|
||||
|
||||
.include "time.inc"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
; This file defines the EXE file "trailer" which sets the entry point
|
||||
|
||||
.export __AUTOSTART__: absolute = 1
|
||||
.import start
|
||||
.import start
|
||||
|
||||
.include "atari.inc"
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ delay1: ldx #0
|
||||
end:
|
||||
|
||||
.ifndef __ATARIXL__
|
||||
tmp: ; outside of the load chunk, some kind of poor man's .bss
|
||||
tmp: ; outside of the load chunk, some kind of poor man's .bss
|
||||
.endif
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
;
|
||||
; time_t _systime (void);
|
||||
; /* Similar to time(), but:
|
||||
; * - Is not ISO C
|
||||
; * - Does not take the additional pointer
|
||||
; * - Does not set errno when returning -1
|
||||
; */
|
||||
; ** - Is not ISO C
|
||||
; ** - Does not take the additional pointer
|
||||
; ** - Does not set errno when returning -1
|
||||
; */
|
||||
;
|
||||
|
||||
.export __systime
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/* w2cas.c -- write file to cassette
|
||||
*
|
||||
* This program writes a boot file (typically linked with
|
||||
* 'atari-cassette.cfg') to the cassette.
|
||||
* Only files < 32K are supported, since the loading of
|
||||
* larger files requires a special loader inside the program.
|
||||
*
|
||||
* Christian Groessler, chris@groessler.org, 2014
|
||||
*/
|
||||
**
|
||||
** This program writes a boot file (typically linked with
|
||||
** 'atari-cassette.cfg') to the cassette.
|
||||
** Only files < 32K are supported, since the loading of
|
||||
** larger files requires a special loader inside the program.
|
||||
**
|
||||
** Christian Groessler, chris@groessler.org, 2014
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
;
|
||||
; time_t _systime (void);
|
||||
; /* Similar to time(), but:
|
||||
; * - Is not ISO C
|
||||
; * - Does not take the additional pointer
|
||||
; * - Does not set errno when returning -1
|
||||
; */
|
||||
; ** - Is not ISO C
|
||||
; ** - Does not take the additional pointer
|
||||
; ** - Does not set errno when returning -1
|
||||
; */
|
||||
;
|
||||
|
||||
.export __systime
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; void fast (void);
|
||||
; /* Switch the CPU into 2MHz mode. Note: This will disable video when in
|
||||
; * 40 column mode.
|
||||
; */
|
||||
; ** 40 column mode.
|
||||
; */
|
||||
;
|
||||
|
||||
.export _fast
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
;
|
||||
; time_t _systime (void);
|
||||
; /* Similar to time(), but:
|
||||
; * - Is not ISO C
|
||||
; * - Does not take the additional pointer
|
||||
; * - Does not set errno when returning -1
|
||||
; */
|
||||
; ** - Is not ISO C
|
||||
; ** - Does not take the additional pointer
|
||||
; ** - Does not set errno when returning -1
|
||||
; */
|
||||
;
|
||||
|
||||
.include "time.inc"
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
;
|
||||
; time_t _systime (void);
|
||||
; /* Similar to time(), but:
|
||||
; * - Is not ISO C
|
||||
; * - Does not take the additional pointer
|
||||
; * - Does not set errno when returning -1
|
||||
; */
|
||||
; ** - Is not ISO C
|
||||
; ** - Does not take the additional pointer
|
||||
; ** - Does not set errno when returning -1
|
||||
; */
|
||||
;
|
||||
|
||||
.export __systime
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
;
|
||||
; time_t _systime (void);
|
||||
; /* Similar to time(), but:
|
||||
; * - Is not ISO C
|
||||
; * - Does not take the additional pointer
|
||||
; * - Does not set errno when returning -1
|
||||
; */
|
||||
; ** - Is not ISO C
|
||||
; ** - Does not take the additional pointer
|
||||
; ** - Does not set errno when returning -1
|
||||
; */
|
||||
;
|
||||
|
||||
.include "time.inc"
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
/*
|
||||
* Marc 'BlackJack' Rintsch, 06.03.2001
|
||||
*
|
||||
* unsigned int cbm_load(const char* name,
|
||||
* unsigned char device,
|
||||
* const unsigned char* data);
|
||||
*/
|
||||
** Marc 'BlackJack' Rintsch, 06.03.2001
|
||||
**
|
||||
** unsigned int cbm_load(const char* name,
|
||||
** unsigned char device,
|
||||
** const unsigned char* data);
|
||||
*/
|
||||
|
||||
#include <cbm.h>
|
||||
|
||||
/* loads file "name" from given device to given address or to the load address
|
||||
* of the file if "data" is 0
|
||||
*/
|
||||
** of the file if "data" is 0
|
||||
*/
|
||||
unsigned int cbm_load(const char* name, unsigned char device, void* data)
|
||||
{
|
||||
/* LFN is set to 0 but it's not needed for loading.
|
||||
* (BASIC V2 sets it to the value of the SA for LOAD) */
|
||||
/* LFN is set to 0; but, it's not needed for loading
|
||||
** (BASIC V2 sets it to the value of the SA for LOAD).
|
||||
*/
|
||||
cbm_k_setlfs(0, device, data == 0);
|
||||
cbm_k_setnam(name);
|
||||
return (cbm_k_load(0, (unsigned int)data) - (unsigned int)data);
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
; unsigned char sec_addr,
|
||||
; const char* name);
|
||||
; /* Opens a file. Works just like the BASIC command.
|
||||
; * Returns 0 if opening was successful, otherwise an errorcode (see table
|
||||
; * below).
|
||||
; */
|
||||
; ** Returns 0 if opening was successful, otherwise an errorcode (see table
|
||||
; ** below).
|
||||
; */
|
||||
; {
|
||||
; cbm_k_setlfs(lfn, device, sec_addr);
|
||||
; cbm_k_setnam(name);
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
;
|
||||
; int __fastcall__ cbm_read (unsigned char lfn, void* buffer, unsigned int size)
|
||||
; /* Reads up to "size" bytes from a file to "buffer".
|
||||
; * Returns the number of actually read bytes, 0 if there are no bytes left
|
||||
; * (EOF) or -1 in case of an error. _oserror contains an errorcode then (see
|
||||
; * table below).
|
||||
; */
|
||||
; ** Returns the number of actually read bytes, 0 if there are no bytes left
|
||||
; ** (EOF) or -1 in case of an error. _oserror contains an errorcode then (see
|
||||
; ** table below).
|
||||
; */
|
||||
; {
|
||||
; static unsigned int bytesread;
|
||||
; static unsigned char tmp;
|
||||
@@ -22,9 +22,10 @@
|
||||
; tmp = cbm_k_basin();
|
||||
;
|
||||
; /* the kernal routine BASIN sets ST to EOF if the end of file
|
||||
; * is reached the first time, then we have store tmp.
|
||||
; * every subsequent call returns EOF and READ ERROR in ST, then
|
||||
; * we have to exit the loop here immidiatly. */
|
||||
; ** is reached the first time, then we have store tmp.
|
||||
; ** every subsequent call returns EOF and READ ERROR in ST, then
|
||||
; ** we have to exit the loop here immediatly.
|
||||
; */
|
||||
; if (cbm_k_readst() & 0xBF) break;
|
||||
;
|
||||
; ((unsigned char*)buffer)[bytesread++] = tmp;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* Marc 'BlackJack' Rintsch, 11.03.2001
|
||||
*
|
||||
* unsigned char cbm_save(const char* name,
|
||||
* char device,
|
||||
* unsigned char* data,
|
||||
* unsigned int size);
|
||||
*/
|
||||
** Marc 'BlackJack' Rintsch, 11.03.2001
|
||||
**
|
||||
** unsigned char cbm_save(const char* name,
|
||||
** char device,
|
||||
** unsigned char* data,
|
||||
** unsigned int size);
|
||||
*/
|
||||
|
||||
#include <cbm.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* saves a memory area from start to end-1 to a file.
|
||||
*/
|
||||
*/
|
||||
unsigned char __fastcall__ cbm_save (const char* name,
|
||||
unsigned char device,
|
||||
const void* data,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Internal include file, do not use directly.
|
||||
* Written by Ullrich von Bassewitz. Based on code by Groepaz.
|
||||
*/
|
||||
** Internal include file, do not use directly.
|
||||
** Written by Ullrich von Bassewitz. Based on code by Groepaz.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -36,15 +36,15 @@ struct DIR {
|
||||
|
||||
unsigned char __fastcall__ _dirread (DIR* dir, void* buf, unsigned char count);
|
||||
/* Read characters from the directory into the supplied buffer. Makes sure,
|
||||
* errno is set in case of a short read. Return true if the read was
|
||||
* successful and false otherwise.
|
||||
*/
|
||||
** errno is set in case of a short read. Return true if the read was
|
||||
** successful and false otherwise.
|
||||
*/
|
||||
|
||||
unsigned char __fastcall__ _dirread1 (DIR* dir, void* buf);
|
||||
/* Read one byte from the directory into the supplied buffer. Makes sure,
|
||||
* errno is set in case of a short read. Return true if the read was
|
||||
* successful and false otherwise.
|
||||
*/
|
||||
** errno is set in case of a short read. Return true if the read was
|
||||
** successful and false otherwise.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
;
|
||||
; unsigned char __fastcall__ _dirread1 (DIR* dir, void* buf);
|
||||
; /* Read one byte from the directory into the supplied buffer. Makes sure,
|
||||
; * errno is set in case of a short read. Return true if the read was
|
||||
; * successful and false otherwise.
|
||||
; */
|
||||
; ** errno is set in case of a short read. Return true if the read was
|
||||
; ** successful and false otherwise.
|
||||
; */
|
||||
|
||||
__dirread1:
|
||||
|
||||
@@ -31,9 +31,9 @@ __dirread1:
|
||||
;
|
||||
; unsigned char __fastcall__ _dirread (DIR* dir, void* buf, unsigned char count);
|
||||
; /* Read characters from the directory into the supplied buffer. Makes sure,
|
||||
; * errno is set in case of a short read. Return true if the read was
|
||||
; * successful and false otherwise.
|
||||
; */
|
||||
; ** errno is set in case of a short read. Return true if the read was
|
||||
; ** successful and false otherwise.
|
||||
; */
|
||||
|
||||
__dirread:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Ullrich von Bassewitz, 2012-05-30. Based on code by Groepaz.
|
||||
*/
|
||||
** Ullrich von Bassewitz, 2012-05-30. Based on code by Groepaz.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -18,8 +18,8 @@ DIR* __fastcall__ opendir (register const char* name)
|
||||
DIR d;
|
||||
|
||||
/* Setup the actual file name that is sent to the disk. We accept "0:",
|
||||
* "1:" and "." as directory names.
|
||||
*/
|
||||
** "1:" and "." as directory names.
|
||||
*/
|
||||
d.name[0] = '$';
|
||||
if (name == 0 || name[0] == '\0' || (name[0] == '.' && name[1] == '\0')) {
|
||||
d.name[1] = '\0';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Ullrich von Bassewitz, 2012-05-30. Based on code by Groepaz.
|
||||
*/
|
||||
** Ullrich von Bassewitz, 2012-05-30. Based on code by Groepaz.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@ struct dirent* __fastcall__ readdir (register DIR* dir)
|
||||
dir->off += count + 4;
|
||||
|
||||
/* End of directory is reached if the buffer contains "blocks free". It is
|
||||
* sufficient here to check for the leading 'b'. buffer will contain at
|
||||
* least one byte if we come here.
|
||||
*/
|
||||
** sufficient here to check for the leading 'b'. buffer will contain at
|
||||
** least one byte if we come here.
|
||||
*/
|
||||
if (buffer[0] == 'b') {
|
||||
goto exitpoint;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Ullrich von Bassewitz, 2012-06-03. Based on code by Groepaz.
|
||||
*/
|
||||
** Ullrich von Bassewitz, 2012-06-03. Based on code by Groepaz.
|
||||
*/
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
;
|
||||
; time_t _systime (void);
|
||||
; /* Similar to time(), but:
|
||||
; * - Is not ISO C
|
||||
; * - Does not take the additional pointer
|
||||
; * - Does not set errno when returning -1
|
||||
; */
|
||||
; ** - Is not ISO C
|
||||
; ** - Does not take the additional pointer
|
||||
; ** - Does not set errno when returning -1
|
||||
; */
|
||||
;
|
||||
|
||||
.include "time.inc"
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
;
|
||||
; time_t _systime (void);
|
||||
; /* Similar to time(), but:
|
||||
; * - Is not ISO C
|
||||
; * - Does not take the additional pointer
|
||||
; * - Does not set errno when returning -1
|
||||
; */
|
||||
; ** - Is not ISO C
|
||||
; ** - Does not take the additional pointer
|
||||
; ** - Does not set errno when returning -1
|
||||
; */
|
||||
;
|
||||
|
||||
.include "time.inc"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* _afailed.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 06.06.1998
|
||||
*/
|
||||
** _afailed.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 06.06.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* _file.h
|
||||
*
|
||||
* (C) Copyright 1998, 2002 Ullrich von Bassewitz (uz@cc65.org)
|
||||
*
|
||||
*/
|
||||
** _file.h
|
||||
**
|
||||
** (C) Copyright 1998, 2002 Ullrich von Bassewitz (uz@cc65.org)
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Ullrich von Bassewitz, 11.08.1998
|
||||
*
|
||||
* Hex conversion table. Must be in C since the compiler will convert
|
||||
* to the correct character set for the target platform.
|
||||
*/
|
||||
** Ullrich von Bassewitz, 11.08.1998
|
||||
**
|
||||
** Hex conversion table. Must be in C since the compiler will convert
|
||||
** to the correct character set for the target platform.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Ullrich von Bassewitz, 2012-11-26
|
||||
*
|
||||
* Minimum value of a long. Is used in ascii conversions, since this value
|
||||
* has no positive counterpart than can be represented in 32 bits. In C,
|
||||
* since the compiler will convert to the correct character set for the
|
||||
* target platform.
|
||||
*/
|
||||
** Ullrich von Bassewitz, 2012-11-26
|
||||
**
|
||||
** Minimum value of a long. Is used in ascii conversions, since this value
|
||||
** has no positive counterpart than can be represented in 32 bits. In C,
|
||||
** since the compiler will convert to the correct character set for the
|
||||
** target platform.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* _printf.h
|
||||
*
|
||||
* (C) Copyright 1998 Ullrich von Bassewitz (uz@cc65.org)
|
||||
*
|
||||
*/
|
||||
** _printf.h
|
||||
**
|
||||
** (C) Copyright 1998 Ullrich von Bassewitz (uz@cc65.org)
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ typedef void (*outfunc) (struct outdesc* desc, const char* buf, unsigned count);
|
||||
|
||||
|
||||
/* Control structure passed to the low level worker function.
|
||||
* Beware: This function will access the structure on the assembly level,
|
||||
* so check this when altering the structure.
|
||||
*/
|
||||
** Beware: This function will access the structure on the assembly level,
|
||||
** so check this when altering the structure.
|
||||
*/
|
||||
struct outdesc {
|
||||
int ccount; /* Character counter */
|
||||
outfunc fout; /* Routine used to output data */
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* _scanf.c
|
||||
*
|
||||
* (c) Copyright 2001-2005, Ullrich von Bassewitz <uz@cc65.org>
|
||||
* 2005-01-24, Greg King <gngking@erols.com>
|
||||
*
|
||||
* This is the basic layer for all scanf-type functions. It should be
|
||||
* rewritten in assembly, at some time in the future. So, some of the code
|
||||
* is not as elegant as it could be.
|
||||
*/
|
||||
** _scanf.c
|
||||
**
|
||||
** (c) Copyright 2001-2005, Ullrich von Bassewitz <uz@cc65.org>
|
||||
** 2005-01-24, Greg King <greg.king5@ver5z6n.net>
|
||||
**
|
||||
** This is the basic layer for all scanf-type functions. It should be
|
||||
** rewritten in assembly, at some time in the future. So, some of the code
|
||||
** is not as elegant as it could be.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -76,12 +76,12 @@ static const unsigned char Bits[CHAR_BIT] = {
|
||||
};
|
||||
|
||||
/* We need C to be 16 bits since we cannot check for EOF otherwise.
|
||||
* Unfortunately, this causes the code to be quite larger, even if for most
|
||||
* purposes, checking the low byte would be enough, since if C is EOF, the
|
||||
* low byte will not match any useful character anyway (at least for the
|
||||
* supported platforms - I know that this is not portable). So the following
|
||||
* macro is used to access just the low byte of C.
|
||||
*/
|
||||
** Unfortunately, this causes the code to be quite larger, even if for most
|
||||
** purposes, checking the low byte would be enough, since if C is EOF, the
|
||||
** low byte will not match any useful character anyway (at least for the
|
||||
** supported platforms - I know that this is not portable). So the following
|
||||
** macro is used to access just the low byte of C.
|
||||
*/
|
||||
#define CHAR(c) (*((unsigned char*)&(c)))
|
||||
|
||||
|
||||
@@ -93,16 +93,16 @@ static const unsigned char Bits[CHAR_BIT] = {
|
||||
|
||||
|
||||
/* We don't want the optimizer to ruin our "perfect" ;-)
|
||||
* assembly code!
|
||||
*/
|
||||
** assembly code!
|
||||
*/
|
||||
#pragma optimize (push, off)
|
||||
|
||||
static unsigned FindBit (void)
|
||||
/* Locate the character's bit in the charset array.
|
||||
* < .A - Argument character
|
||||
* > .X - Offset of the byte in the character-set mask
|
||||
* > .A - Bit-mask
|
||||
*/
|
||||
** < .A - Argument character
|
||||
** > .X - Offset of the byte in the character-set mask
|
||||
** > .A - Bit-mask
|
||||
*/
|
||||
{
|
||||
asm ("pha");
|
||||
asm ("lsr a"); /* Divide by CHAR_BIT */
|
||||
@@ -250,8 +250,8 @@ static void ReadChar (void)
|
||||
asm ("stx %v+1", C);
|
||||
|
||||
/* If C is EOF, don't bump the character counter.
|
||||
* Only the high-byte needs to be checked.
|
||||
*/
|
||||
** Only the high-byte needs to be checked.
|
||||
*/
|
||||
asm ("inx");
|
||||
asm ("beq %g", Done);
|
||||
|
||||
@@ -311,12 +311,12 @@ static void SkipWhite (void)
|
||||
|
||||
static void ReadSign (void)
|
||||
/* Read an optional sign and skip it. Store 1 in Positive if the value is
|
||||
* positive, store 0 otherwise.
|
||||
*/
|
||||
** positive, store 0 otherwise.
|
||||
*/
|
||||
{
|
||||
/* We can ignore the high byte of C here, since if it is EOF, the lower
|
||||
* byte won't match anyway.
|
||||
*/
|
||||
** byte won't match anyway.
|
||||
*/
|
||||
asm ("lda %v", C);
|
||||
asm ("cmp #'-'");
|
||||
asm ("bne %g", NotNeg);
|
||||
@@ -380,11 +380,11 @@ static void __fastcall__ ReadInt (unsigned char Base)
|
||||
|
||||
static void AssignInt (void)
|
||||
/* Assign the integer value in Val to the next argument. The function makes
|
||||
* several non-portable assumptions, to reduce code size:
|
||||
* - signed and unsigned types have the same representation.
|
||||
* - short and int have the same representation.
|
||||
* - all pointer types have the same representation.
|
||||
*/
|
||||
** several non-portable assumptions, to reduce code size:
|
||||
** - signed and unsigned types have the same representation.
|
||||
** - short and int have the same representation.
|
||||
** - all pointer types have the same representation.
|
||||
*/
|
||||
{
|
||||
if (NoAssign == false) {
|
||||
|
||||
@@ -416,8 +416,8 @@ Done: ;
|
||||
|
||||
static void __fastcall__ ScanInt (unsigned char Base)
|
||||
/* Scan an integer including white space, sign and optional base spec,
|
||||
* and store it into IntVal.
|
||||
*/
|
||||
** and store it into IntVal.
|
||||
*/
|
||||
{
|
||||
/* Skip whitespace */
|
||||
SkipWhite ();
|
||||
@@ -440,8 +440,8 @@ static void __fastcall__ ScanInt (unsigned char Base)
|
||||
Base = 8;
|
||||
|
||||
/* Restart at the beginning of the number because it might
|
||||
* be only a single zero digit (which already was read).
|
||||
*/
|
||||
** be only a single zero digit (which already was read).
|
||||
*/
|
||||
PushBack ();
|
||||
C = '0';
|
||||
}
|
||||
@@ -483,8 +483,8 @@ static char GetFormat (void)
|
||||
int __fastcall__ _scanf (const struct scanfdata* D,
|
||||
const char* format_, va_list ap_)
|
||||
/* This is the routine used to do the actual work. It is called from several
|
||||
* types of wrappers to implement the actual ISO xxscanf functions.
|
||||
*/
|
||||
** types of wrappers to implement the actual ISO xxscanf functions.
|
||||
*/
|
||||
{
|
||||
register char* S;
|
||||
bool HaveWidth; /* True if a width was given */
|
||||
@@ -492,9 +492,9 @@ int __fastcall__ _scanf (const struct scanfdata* D,
|
||||
char Start; /* Walks over a range */
|
||||
|
||||
/* Place copies of the arguments into global variables. This is not very
|
||||
* nice, but on a 6502 platform it gives better code, since the values
|
||||
* do not have to be passed as parameters.
|
||||
*/
|
||||
** nice, but on a 6502 platform it gives better code, since the values
|
||||
** do not have to be passed as parameters.
|
||||
*/
|
||||
D_ = D;
|
||||
format = format_;
|
||||
ap = ap_;
|
||||
@@ -505,8 +505,8 @@ int __fastcall__ _scanf (const struct scanfdata* D,
|
||||
CharCount = 0;
|
||||
|
||||
/* Set up the jump "label". CheckEnd() will use that label when EOF
|
||||
* is reached. ReadInt() will use it when number-conversion fails.
|
||||
*/
|
||||
** is reached. ReadInt() will use it when number-conversion fails.
|
||||
*/
|
||||
if ((unsigned char) setjmp (JumpBuf) == RC_OK) {
|
||||
Again:
|
||||
|
||||
@@ -523,9 +523,9 @@ Again:
|
||||
if ((bool) isspace ((int) F)) {
|
||||
|
||||
/* Special white space handling: Any whitespace in the
|
||||
* format string matches any amount of whitespace including
|
||||
* none(!). So this match will never fail.
|
||||
*/
|
||||
** format string matches any amount of whitespace including
|
||||
** none(!). So this match will never fail.
|
||||
*/
|
||||
SkipWhite ();
|
||||
continue;
|
||||
}
|
||||
@@ -537,8 +537,8 @@ Percent:
|
||||
if (C != (int) F) {
|
||||
|
||||
/* A mismatch -- we will stop scanning the input,
|
||||
* and return the number of assigned conversions.
|
||||
*/
|
||||
** and return the number of assigned conversions.
|
||||
*/
|
||||
goto NoConv;
|
||||
}
|
||||
|
||||
@@ -572,18 +572,18 @@ Percent:
|
||||
if (Width == 0) {
|
||||
/* Invalid specification */
|
||||
/* Note: This method of leaving the function might seem
|
||||
* to be crude, but it optimizes very well because
|
||||
* the four exits can share this code.
|
||||
*/
|
||||
** to be crude, but it optimizes very well because
|
||||
** the four exits can share this code.
|
||||
*/
|
||||
_seterrno (EINVAL);
|
||||
Assignments = EOF;
|
||||
PushBack ();
|
||||
return Assignments;
|
||||
}
|
||||
/* Increment-and-test makes better code than test-and-decrement
|
||||
* does. So, change the width into a form that can be used in
|
||||
* that way.
|
||||
*/
|
||||
** does. So, change the width into a form that can be used in
|
||||
** that way.
|
||||
*/
|
||||
Width = ~Width;
|
||||
|
||||
/* 3. Length modifier */
|
||||
@@ -618,9 +618,9 @@ Percent:
|
||||
/* 4. Conversion specifier */
|
||||
switch (F) {
|
||||
/* 'd' and 'u' conversions are actually the same, since the
|
||||
* standard says that even the 'u' modifier allows an
|
||||
* optionally signed integer.
|
||||
*/
|
||||
** standard says that even the 'u' modifier allows an
|
||||
** optionally signed integer.
|
||||
*/
|
||||
case 'd': /* Optionally signed decimal integer */
|
||||
case 'u':
|
||||
ScanInt (10);
|
||||
@@ -676,9 +676,9 @@ Percent:
|
||||
if (NoAssign == false) {
|
||||
S = va_arg (ap, char*);
|
||||
/* ## This loop is convenient for us, but it isn't
|
||||
* standard C. The standard implies that a failure
|
||||
* shouldn't put anything into the array argument.
|
||||
*/
|
||||
** standard C. The standard implies that a failure
|
||||
** shouldn't put anything into the array argument.
|
||||
*/
|
||||
while (++Width) {
|
||||
CheckEnd (); /* Is it a matching failure? */
|
||||
*S++ = C;
|
||||
@@ -705,8 +705,8 @@ Percent:
|
||||
}
|
||||
if (F == ']') {
|
||||
/* Empty sets aren't allowed; so, a right-bracket
|
||||
* at the beginning must be a member of the set.
|
||||
*/
|
||||
** at the beginning must be a member of the set.
|
||||
*/
|
||||
AddCharToSet (F);
|
||||
GetFormat ();
|
||||
}
|
||||
@@ -725,8 +725,8 @@ Percent:
|
||||
break;
|
||||
default:
|
||||
/* Include all characters
|
||||
* that are in the range.
|
||||
*/
|
||||
** that are in the range.
|
||||
*/
|
||||
while (1) {
|
||||
AddCharToSet (Start);
|
||||
if (Start == F) {
|
||||
@@ -756,9 +756,9 @@ Percent:
|
||||
}
|
||||
|
||||
/* We have the set in CharSet. Read characters and
|
||||
* store them into a string while they are part of
|
||||
* the set.
|
||||
*/
|
||||
** store them into a string while they are part of
|
||||
** the set.
|
||||
*/
|
||||
Match = false;
|
||||
if (NoAssign == false) {
|
||||
S = va_arg (ap, char*);
|
||||
@@ -782,10 +782,10 @@ Percent:
|
||||
|
||||
case 'p':
|
||||
/* Pointer, general format is 0xABCD.
|
||||
* %hhp --> zero-page pointer
|
||||
* %hp --> near pointer
|
||||
* %lp --> far pointer
|
||||
*/
|
||||
** %hhp --> zero-page pointer
|
||||
** %hp --> near pointer
|
||||
** %lp --> far pointer
|
||||
*/
|
||||
SkipWhite ();
|
||||
if (CHAR (C) != '0') {
|
||||
goto NoConv;
|
||||
@@ -806,8 +806,8 @@ Percent:
|
||||
|
||||
case 'n':
|
||||
/* Store the number of characters consumed so far
|
||||
* (the read-ahead character hasn't been consumed).
|
||||
*/
|
||||
** (the read-ahead character hasn't been consumed).
|
||||
*/
|
||||
IntVal = (long) (CharCount - (C == EOF ? 0u : 1u));
|
||||
AssignInt ();
|
||||
/* Don't count it. */
|
||||
@@ -849,9 +849,9 @@ Percent:
|
||||
NoConv:
|
||||
|
||||
/* Coming here means a failure. If that happens at EOF, with no
|
||||
* conversion attempts, then it is considered an error; otherwise,
|
||||
* the number of assignments is returned (the default behaviour).
|
||||
*/
|
||||
** conversion attempts, then it is considered an error; otherwise,
|
||||
** the number of assignments is returned (the default behaviour).
|
||||
*/
|
||||
if (C == EOF && Converted == false) {
|
||||
Assignments = EOF; /* Special case: error */
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* _scanf.h
|
||||
*
|
||||
* (c) Copyright 2004, Ullrich von Bassewitz <uz@cc65.org>
|
||||
*
|
||||
*/
|
||||
** _scanf.h
|
||||
**
|
||||
** (c) Copyright 2004, Ullrich von Bassewitz <uz@cc65.org>
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
|
||||
/* Type of the function that is called to input data. The function will
|
||||
* return EOF if no more data is available.
|
||||
*/
|
||||
** return EOF if no more data is available.
|
||||
*/
|
||||
typedef int __fastcall__ (*getfunc) (void* data);
|
||||
|
||||
/* Type of the function that is called to put back unused data */
|
||||
@@ -23,9 +23,9 @@ typedef int __fastcall__ (*ungetfunc) (int c, void* data);
|
||||
|
||||
|
||||
/* Control structure passed to the low level worker function.
|
||||
* Beware: This structure is mirrored in the _scanf.inc assembler include
|
||||
* file, so check this when altering the structure.
|
||||
*/
|
||||
** Beware: This structure is mirrored in the _scanf.inc assembler include
|
||||
** file, so check this when altering the structure.
|
||||
*/
|
||||
struct scanfdata {
|
||||
getfunc get; /* Pointer to input routine */
|
||||
ungetfunc unget; /* Pointer to pushback routine */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* abort.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 02.06.1998
|
||||
*/
|
||||
** abort.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 02.06.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* bsearch.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 17.06.1998
|
||||
*/
|
||||
** bsearch.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 17.06.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ void* __fastcall__ bsearch (const void* key, const void* base, size_t n,
|
||||
last = current - 1;
|
||||
if (result == 0) {
|
||||
/* Found one entry that matches the search key. However there may be
|
||||
* more than one entry with the same key value and ANSI guarantees
|
||||
* that we return the first of a row of items with the same key.
|
||||
*/
|
||||
** more than one entry with the same key value and ANSI guarantees
|
||||
** that we return the first of a row of items with the same key.
|
||||
*/
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
; ----------------------------------------------------------------------------
|
||||
; int __fastcall__ _directerrno (unsigned char code);
|
||||
; /* Set errno to a specific error code, clear _oserror and return -1. Used
|
||||
; * by the library.
|
||||
; */
|
||||
; ** by the library.
|
||||
; */
|
||||
|
||||
__directerrno:
|
||||
jsr __seterrno ; Set errno, returns with A = 0
|
||||
@@ -23,10 +23,10 @@ __directerrno:
|
||||
; ----------------------------------------------------------------------------
|
||||
; int __fastcall__ _mappederrno (unsigned char code);
|
||||
; /* Set _oserror to the given platform specific error code. If it is a real
|
||||
; * error code (not zero) set errno to the corresponding system error code
|
||||
; * and return -1. Otherwise return zero.
|
||||
; * Used by the library.
|
||||
; */
|
||||
; ** error code (not zero) set errno to the corresponding system error code
|
||||
; ** and return -1. Otherwise return zero.
|
||||
; ** Used by the library.
|
||||
; */
|
||||
|
||||
__mappederrno:
|
||||
sta __oserror ; Store the error code
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
/*
|
||||
* errormsg.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 17.05.2000
|
||||
*
|
||||
* Must be a C function, since we have otherwise problems with the different
|
||||
* character sets.
|
||||
*/
|
||||
** errormsg.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 17.05.2000
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* fdopen.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 17.06.1998
|
||||
*/
|
||||
** fdopen.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 17.06.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* fgetc.c
|
||||
*
|
||||
* (C) Copyright 1998, 2002 Ullrich von Bassewitz (uz@cc65.org)
|
||||
*
|
||||
*/
|
||||
** fgetc.c
|
||||
**
|
||||
** (C) Copyright 1998, 2002 Ullrich von Bassewitz (uz@cc65.org)
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* fgetpos.c
|
||||
*
|
||||
* Christian Groessler, 07-Aug-2000
|
||||
*/
|
||||
** fgetpos.c
|
||||
**
|
||||
** Christian Groessler, 07-Aug-2000
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Ullrich von Bassewitz, 11.08.1998
|
||||
*
|
||||
* char* fgets (char* s, int size, FILE* f);
|
||||
*/
|
||||
** Ullrich von Bassewitz, 11.08.1998
|
||||
**
|
||||
** char* fgets (char* s, int size, FILE* f);
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* fputc.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 02.06.1998
|
||||
*/
|
||||
** fputc.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 02.06.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* int fputs (const char* s, FILE* f);
|
||||
*
|
||||
* Ullrich von Bassewitz, 11.08.1998
|
||||
*/
|
||||
** int fputs (const char* s, FILE* f);
|
||||
**
|
||||
** Ullrich von Bassewitz, 11.08.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
;
|
||||
; void free (void* block)
|
||||
; /* Release an allocated memory block. The function will accept NULL pointers
|
||||
; * (and do nothing in this case).
|
||||
; */
|
||||
; ** (and do nothing in this case).
|
||||
; */
|
||||
; {
|
||||
; unsigned* b;
|
||||
; unsigned size;
|
||||
@@ -34,8 +34,8 @@
|
||||
; _hptr = (unsigned*) (((int) _hptr) - size);
|
||||
;
|
||||
; /* Check if the last block in the freelist is now at heap top. If so,
|
||||
; * remove this block from the freelist.
|
||||
; */
|
||||
; ** remove this block from the freelist.
|
||||
; */
|
||||
; if (f = _hlast) {
|
||||
; if (((int) f) + f->size == (int) _hptr) {
|
||||
; /* Remove the last block */
|
||||
@@ -185,10 +185,10 @@ _free: sta ptr2
|
||||
;
|
||||
; void _hadd (void* mem, size_t size)
|
||||
; /* Add an arbitrary memory block to the heap. This function is used by
|
||||
; * free(), but it does also allow usage of otherwise unused memory
|
||||
; * blocks as heap space. The given block is entered in the free list
|
||||
; * without any checks, so beware!
|
||||
; */
|
||||
; ** free(), but it does also allow usage of otherwise unused memory
|
||||
; ** blocks as heap space. The given block is entered in the free list
|
||||
; ** without any checks, so beware!
|
||||
; */
|
||||
; {
|
||||
; struct freeblock* f;
|
||||
; struct freeblock* left;
|
||||
@@ -212,10 +212,10 @@ _free: sta ptr2
|
||||
; } else {
|
||||
;
|
||||
; /* We have to search the free list. As we are doing so, we check
|
||||
; * if it is possible to combine this block with another already
|
||||
; * existing block. Beware: The block may be the "missing link"
|
||||
; * between *two* other blocks.
|
||||
; */
|
||||
; ** if it is possible to combine this block with another already
|
||||
; ** existing block. Beware: The block may be the "missing link"
|
||||
; ** between *two* other blocks.
|
||||
; */
|
||||
; left = 0;
|
||||
; right = _hfirst;
|
||||
; while (right && f > right) {
|
||||
@@ -224,10 +224,10 @@ _free: sta ptr2
|
||||
; }
|
||||
;
|
||||
;
|
||||
; /* Ok, the current block must be inserted between left and right (but
|
||||
; * beware: one of the two may be zero!). Also check for the condition
|
||||
; * that we have to merge two or three blocks.
|
||||
; */
|
||||
; /* OK, the current block must be inserted between left and right (but
|
||||
; ** beware: one of the two may be zero!). Also check for the condition
|
||||
; ** that we have to merge two or three blocks.
|
||||
; */
|
||||
; if (right) {
|
||||
; /* Check if we must merge the block with the right one */
|
||||
; if (((unsigned) f) + size == (unsigned) right) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* freopen.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 17.06.1998
|
||||
*/
|
||||
** freopen.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 17.06.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ FILE* __fastcall__ freopen (const char* name, const char* mode, FILE* f)
|
||||
}
|
||||
|
||||
/* Close the file. Don't bother setting the flag, it will get
|
||||
* overwritten by _fopen.
|
||||
*/
|
||||
** overwritten by _fopen.
|
||||
*/
|
||||
if (close (f->f_fd) < 0) {
|
||||
/* An error occured, errno is already set */
|
||||
return 0;
|
||||
|
||||
@@ -27,8 +27,8 @@ ParamSize: .res 1 ; Number of parameter bytes
|
||||
; va_start (ap, format);
|
||||
;
|
||||
; /* Call vfscanf(). Since we know that va_end won't do anything, we will
|
||||
; * save the call and return the value directly.
|
||||
; */
|
||||
; ** save the call and return the value directly.
|
||||
; */
|
||||
; return vfscanf (f, format, ap);
|
||||
; }
|
||||
;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* fseek.c
|
||||
*
|
||||
* Christian Groessler, 2000-08-07
|
||||
* Ullrich von Bassewitz, 2004-05-12
|
||||
*/
|
||||
** fseek.c
|
||||
**
|
||||
** Christian Groessler, 2000-08-07
|
||||
** Ullrich von Bassewitz, 2004-05-12
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ int __fastcall__ fseek (register FILE* f, long offset, int whence)
|
||||
}
|
||||
|
||||
/* If we have a pushed back character, and whence is relative to the
|
||||
* current position, correct the offset.
|
||||
*/
|
||||
** current position, correct the offset.
|
||||
*/
|
||||
if ((f->f_flags & _FPUSHBACK) && whence == SEEK_CUR) {
|
||||
--offset;
|
||||
}
|
||||
@@ -41,11 +41,11 @@ int __fastcall__ fseek (register FILE* f, long offset, int whence)
|
||||
res = lseek(f->f_fd, offset, whence);
|
||||
|
||||
/* If the seek was successful. Discard any effects of the ungetc function,
|
||||
* and clear the end-of-file indicator. Otherwise set the error indicator
|
||||
* on the stream, and return -1. We will check for >= 0 here, because that
|
||||
* saves some code, and we don't have files with 2 gigabytes in size
|
||||
* anyway:-)
|
||||
*/
|
||||
** and clear the end-of-file indicator. Otherwise set the error indicator
|
||||
** on the stream, and return -1. We will check for >= 0 here, because that
|
||||
** saves some code, and we don't have files with 2 gigabytes in size
|
||||
** anyway:-)
|
||||
*/
|
||||
if (res >= 0) {
|
||||
f->f_flags &= ~(_FEOF | _FPUSHBACK);
|
||||
return 0;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* fsetpos.c
|
||||
*
|
||||
* Christian Groessler, 07-Aug-2000
|
||||
*/
|
||||
** fsetpos.c
|
||||
**
|
||||
** Christian Groessler, 07-Aug-2000
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* ftell.c
|
||||
*
|
||||
* Christian Groessler, 2000-08-07
|
||||
* Ullrich von Bassewitz, 2004-05-13
|
||||
*/
|
||||
** ftell.c
|
||||
**
|
||||
** Christian Groessler, 2000-08-07
|
||||
** Ullrich von Bassewitz, 2004-05-13
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ long __fastcall__ ftell (register FILE* f)
|
||||
pos = lseek (f->f_fd, 0L, SEEK_CUR);
|
||||
|
||||
/* If we didn't have an error, correct the return value in case we have
|
||||
* a pushed back character.
|
||||
*/
|
||||
** a pushed back character.
|
||||
*/
|
||||
if (pos > 0 && (f->f_flags & _FPUSHBACK)) {
|
||||
--pos;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* getchar.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 11.12.1998
|
||||
*/
|
||||
** getchar.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 11.12.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* This is part of a changed public domain getopt implementation that
|
||||
* had the following text on top:
|
||||
*
|
||||
* I got this off net.sources from Henry Spencer.
|
||||
* It is a public domain getopt(3) like in System V.
|
||||
* I have made the following modifications:
|
||||
*
|
||||
* A test main program was added, ifdeffed by GETOPT.
|
||||
* This main program is a public domain implementation
|
||||
* of the getopt(1) program like in System V. The getopt
|
||||
* program can be used to standardize shell option handling.
|
||||
* e.g. cc -DGETOPT getopt.c -o getopt
|
||||
*/
|
||||
** This is part of a changed public domain getopt implementation that
|
||||
** had the following text on top:
|
||||
**
|
||||
** I got this off net.sources from Henry Spencer.
|
||||
** It is a public domain getopt(3) like in System V.
|
||||
** I have made the following modifications:
|
||||
**
|
||||
** A test main program was added, ifdeffed by GETOPT.
|
||||
** This main program is a public domain implementation
|
||||
** of the getopt(1) program like in System V. The getopt
|
||||
** program can be used to standardize shell option handling.
|
||||
** e.g. cc -DGETOPT getopt.c -o getopt
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* gets.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 11.08.1998
|
||||
*/
|
||||
** gets.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 11.08.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* locale.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 11.12.1998
|
||||
*/
|
||||
** locale.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 11.12.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -55,9 +55,9 @@ struct tm* __fastcall__ localtime (const time_t* timep)
|
||||
}
|
||||
|
||||
/* Since our ints are just 16 bits, split the given time into seconds,
|
||||
* hours and days. Each of the values will fit in a 16 bit variable.
|
||||
* The mktime routine will then do the rest.
|
||||
*/
|
||||
** hours and days. Each of the values will fit in a 16 bit variable.
|
||||
** The mktime routine will then do the rest.
|
||||
*/
|
||||
timebuf.tm_sec = t % 3600;
|
||||
timebuf.tm_min = 0;
|
||||
timebuf.tm_hour = (t / 3600) % 24;
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
;
|
||||
; void* malloc (size_t size)
|
||||
; /* Allocate memory from the given heap. The function returns a pointer to the
|
||||
; * allocated memory block or a NULL pointer if not enough memory is available.
|
||||
; * Allocating a zero size block is not allowed.
|
||||
; */
|
||||
; ** allocated memory block or a NULL pointer if not enough memory is available.
|
||||
; ** Allocating a zero size block is not allowed.
|
||||
; */
|
||||
; {
|
||||
; struct freeblock* f;
|
||||
; unsigned* p;
|
||||
;
|
||||
;
|
||||
; /* Check for a size of zero, then add the administration space and round
|
||||
; * up the size if needed.
|
||||
; */
|
||||
; ** up the size if needed.
|
||||
; */
|
||||
; if (size == 0) {
|
||||
; return 0;
|
||||
; }
|
||||
@@ -39,10 +39,10 @@
|
||||
; if (f) {
|
||||
;
|
||||
; /* We found a block big enough. If the block can hold just the
|
||||
; * requested size, use the block in full. Beware: When slicing blocks,
|
||||
; * there must be space enough to create a new one! If this is not the
|
||||
; * case, then use the complete block.
|
||||
; */
|
||||
; ** requested size, use the block in full. Beware: When slicing blocks,
|
||||
; ** there must be space enough to create a new one! If this is not the
|
||||
; ** case, then use the complete block.
|
||||
; */
|
||||
; if (f->size - size < sizeof (struct freeblock)) {
|
||||
;
|
||||
; /* Use the actual size */
|
||||
@@ -66,9 +66,9 @@
|
||||
;
|
||||
; } else {
|
||||
;
|
||||
; /* We must slice the block found. Cut off space from the upper
|
||||
; * end, so we can leave the actual free block chain intact.
|
||||
; */
|
||||
; /* We must slice the block found. Cut off space from the upper
|
||||
; ** end, so we can leave the actual free block chain intact.
|
||||
; */
|
||||
;
|
||||
; /* Decrement the size of the block */
|
||||
; f->size -= size;
|
||||
@@ -84,8 +84,8 @@
|
||||
; } else {
|
||||
;
|
||||
; /* We did not find a block big enough. Try to use new space from the
|
||||
; * heap top.
|
||||
; */
|
||||
; ** heap top.
|
||||
; */
|
||||
; if (((unsigned) _hend) - ((unsigned) _hptr) < size) {
|
||||
; /* Out of heap space */
|
||||
; return 0;
|
||||
|
||||
@@ -77,9 +77,9 @@ static unsigned char __fastcall__ IsLeapYear (unsigned Year)
|
||||
|
||||
time_t __fastcall__ mktime (register struct tm* TM)
|
||||
/* Make a time in seconds since 1/1/1970 from the broken down time in TM.
|
||||
* A call to mktime does also correct the time in TM to contain correct
|
||||
* values.
|
||||
*/
|
||||
** A call to mktime does also correct the time in TM to contain correct
|
||||
** values.
|
||||
*/
|
||||
{
|
||||
register div_t D;
|
||||
int Max;
|
||||
@@ -118,8 +118,8 @@ time_t __fastcall__ mktime (register struct tm* TM)
|
||||
TM->tm_mday += D.quot;
|
||||
|
||||
/* Adjust month and year. This is an iterative process, since changing
|
||||
* the month will change the allowed days for this month.
|
||||
*/
|
||||
** the month will change the allowed days for this month.
|
||||
*/
|
||||
while (1) {
|
||||
|
||||
/* Make sure, month is in the range 0..11 */
|
||||
@@ -131,8 +131,8 @@ time_t __fastcall__ mktime (register struct tm* TM)
|
||||
TM->tm_year += D.quot;
|
||||
|
||||
/* Now check if mday is in the correct range, if not, correct month
|
||||
* and eventually year and repeat the process.
|
||||
*/
|
||||
** and eventually year and repeat the process.
|
||||
*/
|
||||
if (TM->tm_mon == FEBRUARY && IsLeapYear (TM->tm_year + 1900)) {
|
||||
Max = 29;
|
||||
} else {
|
||||
@@ -154,18 +154,18 @@ time_t __fastcall__ mktime (register struct tm* TM)
|
||||
}
|
||||
|
||||
/* Ok, all time/date fields are now correct. Calculate the days in this
|
||||
* year.
|
||||
*/
|
||||
** year.
|
||||
*/
|
||||
TM->tm_yday = MonthDays[TM->tm_mon] + TM->tm_mday - 1;
|
||||
if (TM->tm_mon > FEBRUARY && IsLeapYear (TM->tm_year + 1900)) {
|
||||
++TM->tm_yday;
|
||||
}
|
||||
|
||||
/* Calculate days since 1/1/1970. In the complete epoch (1/1/1970 to
|
||||
* somewhere in 2038) all years dividable by 4 are leap years, so
|
||||
* dividing by 4 gives the days that must be added cause of leap years.
|
||||
* (and the last leap year before 1970 was 1968)
|
||||
*/
|
||||
** somewhere in 2038) all years dividable by 4 are leap years, so
|
||||
** dividing by 4 gives the days that must be added cause of leap years.
|
||||
** (and the last leap year before 1970 was 1968)
|
||||
*/
|
||||
DayCount = ((unsigned) (TM->tm_year-70)) * 365U +
|
||||
(((unsigned) (TM->tm_year-(68+1))) / 4) +
|
||||
TM->tm_yday;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2004-2005 Ullrich von Bassewitz */
|
||||
/* R<EFBFBD>merstrasse 52 */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
@@ -43,23 +43,23 @@
|
||||
|
||||
|
||||
/* This is a very simple version of an aligned memory allocator. We will
|
||||
* allocate a greater block, so that we can place the aligned block (that is
|
||||
* returned) within it. We use our knowledge about the internal heap
|
||||
* structures to free the unused parts of the bigger block (the two chunks
|
||||
* below and above the aligned block).
|
||||
*/
|
||||
** allocate a greater block, so that we can place the aligned block (that is
|
||||
** returned) within it. We use our knowledge about the internal heap
|
||||
** structures to free the unused parts of the bigger block (the two chunks
|
||||
** below and above the aligned block).
|
||||
*/
|
||||
|
||||
|
||||
|
||||
int __fastcall__ posix_memalign (void** memptr, size_t alignment, size_t size)
|
||||
/* Allocate a block of memory with the given "size", which is aligned to a
|
||||
* memory address that is a multiple of "alignment". "alignment" MUST NOT be
|
||||
* zero, and MUST be a power of two; otherwise, this function will return
|
||||
* EINVAL. The function returns ENOMEM if not enough memory is available
|
||||
* to satisfy the request. "memptr" must point to a variable; that variable
|
||||
* will return the address of the allocated memory. Use free() to release that
|
||||
* allocated block.
|
||||
*/
|
||||
** memory address that is a multiple of "alignment". "alignment" MUST NOT be
|
||||
** zero, and MUST be a power of two; otherwise, this function will return
|
||||
** EINVAL. The function returns ENOMEM if not enough memory is available
|
||||
** to satisfy the request. "memptr" must point to a variable; that variable
|
||||
** will return the address of the allocated memory. Use free() to release that
|
||||
** allocated block.
|
||||
*/
|
||||
{
|
||||
size_t rawsize;
|
||||
size_t uppersize;
|
||||
@@ -81,11 +81,11 @@ int __fastcall__ posix_memalign (void** memptr, size_t alignment, size_t size)
|
||||
}
|
||||
|
||||
/* Augment the block size up to the alignment, and allocate memory.
|
||||
* We don't need to account for the additional admin. data that's needed to
|
||||
* manage the used block, because the block returned by malloc() has that
|
||||
* overhead added one time; and, the worst thing that might happen is that
|
||||
* we cannot free the upper and lower blocks.
|
||||
*/
|
||||
** We don't need to account for the additional admin. data that's needed to
|
||||
** manage the used block, because the block returned by malloc() has that
|
||||
** overhead added one time; and, the worst thing that might happen is that
|
||||
** we cannot free the upper and lower blocks.
|
||||
*/
|
||||
b = malloc (size + alignment);
|
||||
|
||||
/* Handle out-of-memory */
|
||||
@@ -95,26 +95,26 @@ int __fastcall__ posix_memalign (void** memptr, size_t alignment, size_t size)
|
||||
}
|
||||
|
||||
/* Create (and return) a new pointer that points to the user-visible
|
||||
* aligned block.
|
||||
*/
|
||||
** aligned block.
|
||||
*/
|
||||
u = *memptr = (struct usedblock*) (((unsigned)b + alignment) & ~alignment);
|
||||
|
||||
/* Get a pointer to the (raw) upper block */
|
||||
p = (struct usedblock*) ((char*)u + size);
|
||||
|
||||
/* Get the raw-block pointer, which is located just below the visible
|
||||
* unaligned block. The first word of this raw block is the total size
|
||||
* of the block, including the admin. space.
|
||||
*/
|
||||
** unaligned block. The first word of this raw block is the total size
|
||||
** of the block, including the admin. space.
|
||||
*/
|
||||
b = (b-1)->start;
|
||||
rawsize = b->size;
|
||||
|
||||
/* Check if we can free the space above the user block. That is the case
|
||||
* if the size of the block is at least sizeof (struct freeblock) bytes,
|
||||
* and the size of the remaining block is at least that size, too.
|
||||
* If the upper block is smaller, then we just will pass it to the caller,
|
||||
* together with the requested aligned block.
|
||||
*/
|
||||
** if the size of the block is at least sizeof (struct freeblock) bytes,
|
||||
** and the size of the remaining block is at least that size, too.
|
||||
** If the upper block is smaller, then we just will pass it to the caller,
|
||||
** together with the requested aligned block.
|
||||
*/
|
||||
uppersize = rawsize - (lowersize = (char*)p - (char*)b);
|
||||
if (uppersize >= sizeof (struct freeblock) &&
|
||||
lowersize >= sizeof (struct freeblock)) {
|
||||
@@ -131,20 +131,20 @@ int __fastcall__ posix_memalign (void** memptr, size_t alignment, size_t size)
|
||||
}
|
||||
|
||||
/* Check if we can free the space below the user block. That is the case
|
||||
* if the size of the block is at least sizeof (struct freeblock) bytes,
|
||||
* and the size of the remaining block is at least that size, too. If the
|
||||
* lower block is smaller, we just will pass it to the caller, together
|
||||
* with the requested aligned block.
|
||||
* Beware: We need an additional struct usedblock, in the lower block,
|
||||
* which is part of the block that is passed back to the caller.
|
||||
*/
|
||||
** if the size of the block is at least sizeof (struct freeblock) bytes,
|
||||
** and the size of the remaining block is at least that size, too. If the
|
||||
** lower block is smaller, we just will pass it to the caller, together
|
||||
** with the requested aligned block.
|
||||
** Beware: We need an additional struct usedblock, in the lower block,
|
||||
** which is part of the block that is passed back to the caller.
|
||||
*/
|
||||
lowersize = ((char*)u - (char*)b) - sizeof (struct usedblock);
|
||||
if ( lowersize >= sizeof (struct freeblock) &&
|
||||
(rawsize - lowersize) >= sizeof (struct freeblock)) {
|
||||
|
||||
/* b already points to the raw lower-block.
|
||||
* Set up the usedblock structure.
|
||||
*/
|
||||
** Set up the usedblock structure.
|
||||
*/
|
||||
b->size = lowersize;
|
||||
b->start = b;
|
||||
|
||||
@@ -159,11 +159,11 @@ int __fastcall__ posix_memalign (void** memptr, size_t alignment, size_t size)
|
||||
}
|
||||
|
||||
/* u points to the user-visible block, while b points to the raw block,
|
||||
* and rawsize contains the length of the raw block. Set up the usedblock
|
||||
* structure, but beware: If we didn't free the lower block, then it is
|
||||
* split; which means that we must use b to write the size,
|
||||
* and u to write the start field.
|
||||
*/
|
||||
** and rawsize contains the length of the raw block. Set up the usedblock
|
||||
** structure, but beware: If we didn't free the lower block, then it is
|
||||
** split; which means that we must use b to write the size,
|
||||
** and u to write the start field.
|
||||
*/
|
||||
b->size = rawsize;
|
||||
(u-1)->start = b;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* puts.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 11.08.1998
|
||||
*/
|
||||
** puts.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 11.08.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* qsort.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 09.12.1998
|
||||
*/
|
||||
** qsort.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 09.12.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ static void QuickSort (register unsigned char* Base, int Lo, int Hi,
|
||||
register size_t Size,
|
||||
int (*Compare)(const void*, const void*))
|
||||
/* Internal recursive function. Works with ints, but this shouldn't be
|
||||
* a problem.
|
||||
*/
|
||||
** a problem.
|
||||
*/
|
||||
{
|
||||
int I, J;
|
||||
|
||||
@@ -62,5 +62,3 @@ void __fastcall__ qsort (void* base, size_t nmemb, size_t size,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -66,10 +66,10 @@ void* __fastcall__ realloc (void* block, register size_t size)
|
||||
}
|
||||
|
||||
/* The word below the user block contains a pointer to the start of the
|
||||
* raw memory block. The first word of this raw memory block is the full
|
||||
* size of the block. Get a pointer to the real block, get the old block
|
||||
* size.
|
||||
*/
|
||||
** raw memory block. The first word of this raw memory block is the full
|
||||
** size of the block. Get a pointer to the real block, get the old block
|
||||
** size.
|
||||
*/
|
||||
b = (((struct usedblock*) block) - 1)->start;
|
||||
oldsize = b->size;
|
||||
|
||||
@@ -87,16 +87,16 @@ void* __fastcall__ realloc (void* block, register size_t size)
|
||||
}
|
||||
|
||||
/* The given block was not located on top of the heap, or there's no
|
||||
* room left. Try to allocate a new block and copy the data.
|
||||
*/
|
||||
** room left. Try to allocate a new block and copy the data.
|
||||
*/
|
||||
if (newblock = malloc (size)) {
|
||||
|
||||
/* Adjust the old size to the user visible portion */
|
||||
oldsize -= HEAP_ADMIN_SPACE;
|
||||
|
||||
/* If the new block is larger than the old one, copy the old
|
||||
* data only
|
||||
*/
|
||||
** data only
|
||||
*/
|
||||
if (size > oldsize) {
|
||||
size = oldsize;
|
||||
}
|
||||
@@ -110,4 +110,3 @@ void* __fastcall__ realloc (void* block, register size_t size)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* rewind.c
|
||||
*
|
||||
* Christian Groessler, 07-Aug-2000
|
||||
*/
|
||||
** rewind.c
|
||||
**
|
||||
** Christian Groessler, 07-Aug-2000
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
* sleep.c
|
||||
*
|
||||
* Stefan Haubenthal, 2003-06-11
|
||||
* Ullrich von Bassewitz, 2003-06-12
|
||||
*
|
||||
*/
|
||||
** sleep.c
|
||||
**
|
||||
** Stefan Haubenthal, 2003-06-11
|
||||
** Ullrich von Bassewitz, 2003-06-12
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ ParamSize: .res 1 ; Number of parameter bytes
|
||||
; va_start (ap, format);
|
||||
;
|
||||
; /* Call vsscanf(). Since we know that va_end won't do anything, we will
|
||||
; * save the call and return the value directly.
|
||||
; */
|
||||
; ** save the call and return the value directly.
|
||||
; */
|
||||
; return vsscanf (str, format, ap);
|
||||
; }
|
||||
;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
/*
|
||||
* strqtok() is like strtok(): It finds pieces of text, in a string, that are
|
||||
* surrounded by given delimiter characters. It returns each piece, in turn,
|
||||
* as a string, until every piece has been found. Then, it returns NULL. But,
|
||||
* strqtok() recognizes quotation marks. A mark makes delimiters look ordinary
|
||||
* until another quotation mark is seen. That allows us to include delimiters
|
||||
* in tokens. (This version doesn't allow escaped quotation marks.)
|
||||
*
|
||||
* 2014-04-19, Daniel Serpell
|
||||
* 2014-04-21, Paul Foerster
|
||||
* 2014-04-25, Greg King
|
||||
*/
|
||||
** strqtok() is like strtok(): It finds pieces of text, in a string, that are
|
||||
** surrounded by given delimiter characters. It returns each piece, in turn,
|
||||
** as a string, until every piece has been found. Then, it returns NULL. But,
|
||||
** strqtok() recognizes quotation marks. A mark makes delimiters look ordinary
|
||||
** until another quotation mark is seen. That allows us to include delimiters
|
||||
** in tokens. (This version doesn't allow escaped quotation marks.)
|
||||
**
|
||||
** 2014-04-19, Daniel Serpell
|
||||
** 2014-04-21, Paul Foerster
|
||||
** 2014-04-25, Greg King
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
@@ -49,8 +49,8 @@ char* __fastcall__ strqtok (register char* s1, const char* s2)
|
||||
}
|
||||
if (c == '\0') {
|
||||
/* The end of the last token is the end of the token list;
|
||||
* don't go beyond it.
|
||||
*/
|
||||
** don't go beyond it.
|
||||
*/
|
||||
goto found;
|
||||
}
|
||||
|
||||
@@ -70,8 +70,8 @@ char* __fastcall__ strqtok (register char* s1, const char* s2)
|
||||
/* Search for the end of a quoted token. */
|
||||
if ((s1 = strchr (s1, '\"')) == NULL) {
|
||||
/* The quoted token ended with '\0'; therefore, point to a '\0',
|
||||
* so that the next call will return NULL.
|
||||
*/
|
||||
** so that the next call will return NULL.
|
||||
*/
|
||||
next = "";
|
||||
return start;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* strtok.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 11.12.1998
|
||||
*/
|
||||
** strtok.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 11.12.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ char* __fastcall__ strtok (register char* s1, const char* s2)
|
||||
}
|
||||
|
||||
/* Search the address of the first element in s1 that equals none
|
||||
* of the characters in s2.
|
||||
*/
|
||||
** of the characters in s2.
|
||||
*/
|
||||
while ((c = *s1) && strchr (s2, c) != 0) {
|
||||
++s1;
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ long __fastcall__ strtol (const char* nptr, char** endptr, int base)
|
||||
}
|
||||
|
||||
/* If base is zero, we may have a 0 or 0x prefix. If base is 16, we may
|
||||
* have a 0x prefix.
|
||||
*/
|
||||
** have a 0x prefix.
|
||||
*/
|
||||
if (base == 0) {
|
||||
if (*S == '0') {
|
||||
++S;
|
||||
@@ -52,8 +52,8 @@ long __fastcall__ strtol (const char* nptr, char** endptr, int base)
|
||||
}
|
||||
|
||||
/* Determine the maximum valid number and (if the number is equal to this
|
||||
* value) the maximum valid digit.
|
||||
*/
|
||||
** value) the maximum valid digit.
|
||||
*/
|
||||
if (Minus) {
|
||||
MaxVal = LONG_MIN;
|
||||
} else {
|
||||
@@ -98,8 +98,8 @@ long __fastcall__ strtol (const char* nptr, char** endptr, int base)
|
||||
}
|
||||
|
||||
/* Store the end pointer. If no conversion was performed, the value of
|
||||
* nptr is returned in endptr.
|
||||
*/
|
||||
** nptr is returned in endptr.
|
||||
*/
|
||||
if (endptr) {
|
||||
if (CvtCount > 0) {
|
||||
*endptr = (char*) S;
|
||||
|
||||
@@ -33,8 +33,8 @@ unsigned long __fastcall__ strtoul (const char* nptr, char** endptr, int base)
|
||||
}
|
||||
|
||||
/* If base is zero, we may have a 0 or 0x prefix. If base is 16, we may
|
||||
* have a 0x prefix.
|
||||
*/
|
||||
** have a 0x prefix.
|
||||
*/
|
||||
if (base == 0) {
|
||||
if (*S == '0') {
|
||||
++S;
|
||||
@@ -52,8 +52,8 @@ unsigned long __fastcall__ strtoul (const char* nptr, char** endptr, int base)
|
||||
}
|
||||
|
||||
/* Determine the maximum valid number and (if the number is equal to this
|
||||
* value) the maximum valid digit.
|
||||
*/
|
||||
** value) the maximum valid digit.
|
||||
*/
|
||||
MaxDigit = ULONG_MAX % base;
|
||||
MaxVal = ULONG_MAX / base;
|
||||
|
||||
@@ -93,8 +93,8 @@ unsigned long __fastcall__ strtoul (const char* nptr, char** endptr, int base)
|
||||
}
|
||||
|
||||
/* Store the end pointer. If no conversion was performed, the value of
|
||||
* nptr is returned in endptr.
|
||||
*/
|
||||
** nptr is returned in endptr.
|
||||
*/
|
||||
if (endptr) {
|
||||
if (CvtCount > 0) {
|
||||
*endptr = (char*) S;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* strxfrm.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 11.12.1998
|
||||
*/
|
||||
** strxfrm.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 11.12.1998
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* system.c
|
||||
*
|
||||
* Stefan Haubenthal, 2003-05-26
|
||||
* Ullrich von Bassewitz, 2003-05-27
|
||||
*/
|
||||
** system.c
|
||||
**
|
||||
** Stefan Haubenthal, 2003-05-26
|
||||
** Ullrich von Bassewitz, 2003-05-27
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -31,9 +31,9 @@ d: .addr _fgetc ; GET
|
||||
; /* Standard C function */
|
||||
; {
|
||||
; /* Initialize the data struct. We do only need the given file as user data,
|
||||
; * because the (getfunc) and (ungetfunc) functions are crafted so that they
|
||||
; * match the standard-I/O fgetc() and ungetc().
|
||||
; */
|
||||
; ** because the (getfunc) and (ungetfunc) functions are crafted so that they
|
||||
; ** match the standard-I/O fgetc() and ungetc().
|
||||
; */
|
||||
; static struct scanfdata d = {
|
||||
; ( getfunc) fgetc,
|
||||
; (ungetfunc) ungetc
|
||||
|
||||
@@ -94,8 +94,8 @@ L1: tax ; Save return value
|
||||
; /* Push back a character onto the input stream */
|
||||
; {
|
||||
; /* We do assume here that the _scanf routine will not push back anything
|
||||
; * not read, so we can ignore c safely and won't check the index.
|
||||
; */
|
||||
; ** not read, so we can ignore c safely and won't check the index.
|
||||
; */
|
||||
; --d->index;
|
||||
; return c;
|
||||
; }
|
||||
@@ -129,8 +129,8 @@ L1: tax ; Save return value
|
||||
; /* Standard C function */
|
||||
; {
|
||||
; /* Initialize the data structs. The sscanfdata struct will be passed back
|
||||
; * to the get and unget functions by _scanf().
|
||||
; */
|
||||
; ** to the get and unget functions by _scanf().
|
||||
; */
|
||||
; static struct sscanfdata sd;
|
||||
; static const struct scanfdata d = {
|
||||
; ( getfunc) get,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* dbg.c
|
||||
*
|
||||
* Ullrich von Bassewitz, 08.08.1998
|
||||
*
|
||||
*/
|
||||
** dbg.c
|
||||
**
|
||||
** Ullrich von Bassewitz, 08.08.1998
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -335,8 +335,8 @@ BreakPoint* DbgGetBreakSlot (void);
|
||||
|
||||
BreakPoint* DbgIsBreak (unsigned Addr);
|
||||
/* Check if there is a user breakpoint at the given address, if so, return
|
||||
* a pointer to the slot, else return 0.
|
||||
*/
|
||||
** a pointer to the slot, else return 0.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -729,8 +729,8 @@ static void DbgResetTmpBreaks (void)
|
||||
|
||||
static unsigned char DbgTmpBreaksOk (void)
|
||||
/* Check if the temporary breakpoints can be set, if so, return 1, if not,
|
||||
* reset them all and return 0.
|
||||
*/
|
||||
** reset them all and return 0.
|
||||
*/
|
||||
{
|
||||
unsigned char i;
|
||||
BreakPoint* B = DbgBreaks;
|
||||
@@ -755,8 +755,8 @@ static unsigned char DbgTmpBreaksOk (void)
|
||||
|
||||
static unsigned AsmBack (unsigned mem, unsigned char lines)
|
||||
/* Go back in the assembler window the given number of lines (calculate
|
||||
* new start address).
|
||||
*/
|
||||
** new start address).
|
||||
*/
|
||||
{
|
||||
unsigned cur;
|
||||
unsigned adr [32];
|
||||
@@ -776,8 +776,8 @@ static unsigned AsmBack (unsigned mem, unsigned char lines)
|
||||
return adr [(in - lines - 1) & 0x1F];
|
||||
} else {
|
||||
/* The requested address is inside an instruction, go back
|
||||
* one more byte and try again.
|
||||
*/
|
||||
** one more byte and try again.
|
||||
*/
|
||||
++offs;
|
||||
break;
|
||||
}
|
||||
@@ -1347,8 +1347,8 @@ static void SingleStep (char StepInto)
|
||||
case OPC_BNE:
|
||||
case OPC_BEQ:
|
||||
/* Be sure not to set the breakpoint twice if this is a jump to
|
||||
* the following instruction.
|
||||
*/
|
||||
** the following instruction.
|
||||
*/
|
||||
Offs = ((signed char*)brk_pc)[1];
|
||||
if (Offs) {
|
||||
DbgSetTmpBreak (brk_pc + Offs + 2);
|
||||
@@ -1491,8 +1491,8 @@ void DbgEntry (void)
|
||||
}
|
||||
|
||||
/* Only initialize variables here, don't do a display update. The actual
|
||||
* display update will be done while waiting for user input.
|
||||
*/
|
||||
** display update will be done while waiting for user input.
|
||||
*/
|
||||
AsmHome ();
|
||||
UpdateReg (); /* Must update this (static later) */
|
||||
StackHome ();
|
||||
|
||||
@@ -94,8 +94,8 @@ copy: lda (ptr1),y
|
||||
;----------------------------------------------------------------------------
|
||||
; unsigned char em_uninstall (void);
|
||||
; /* Uninstall the currently loaded driver and return an error code.
|
||||
; * Note: This call does not free allocated memory.
|
||||
; */
|
||||
; ** Note: This call does not free allocated memory.
|
||||
; */
|
||||
|
||||
_em_uninstall:
|
||||
jsr emd_uninstall ; Call driver routine
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
;
|
||||
; void em_commit (void);
|
||||
; /* Commit changes in the memory window to extended storage. If the contents
|
||||
; * of the memory window have been changed, these changes may be lost if
|
||||
; * em_map, em_copyfrom or em_copyto are called without calling em_commit
|
||||
; * first. Note: Not calling em_commit does not mean that the changes are
|
||||
; * discarded, it does just mean that some drivers will discard the changes.
|
||||
; */
|
||||
; ** of the memory window have been changed, these changes may be lost if
|
||||
; ** em_map, em_copyfrom or em_copyto are called without calling em_commit
|
||||
; ** first. Note: Not calling em_commit does not mean that the changes are
|
||||
; ** discarded, it does just mean that some drivers will discard the changes.
|
||||
; */
|
||||
|
||||
.include "em-kernel.inc"
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; void* __fastcall__ em_map (unsigned page);
|
||||
; /* Unmap the current page from memory and map a new one. The function returns
|
||||
; * a pointer to the location of the page in memory.
|
||||
; */
|
||||
; ** a pointer to the location of the page in memory.
|
||||
; */
|
||||
|
||||
|
||||
.include "em-kernel.inc"
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
;
|
||||
; void* __fastcall__ em_use (unsigned page);
|
||||
; /* Tell the driver that the memory window is associated with a given page.
|
||||
; * This call is very similar to em_map. The difference is that the driver
|
||||
; * does not necessarily transfer the current contents of the extended
|
||||
; * memory into the returned window. If you're going to just write to the
|
||||
; * window and the current contents of the window are invalid or no longer
|
||||
; * use, this call may perform better than em_map.
|
||||
; */
|
||||
; ** This call is very similar to em_map. The difference is that the driver
|
||||
; ** does not necessarily transfer the current contents of the extended
|
||||
; ** memory into the returned window. If you're going to just write to the
|
||||
; ** window and the current contents of the window are invalid or no longer
|
||||
; ** use, this call may perform better than em_map.
|
||||
; */
|
||||
|
||||
|
||||
.include "em-kernel.inc"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* _afailed.c
|
||||
*
|
||||
* Maciej 'YTM/Elysium' Witkowiak 28.10.2001
|
||||
*/
|
||||
** _afailed.c
|
||||
**
|
||||
** Maciej 'YTM/Elysium' Witkowiak 28.10.2001
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* _poserror.c
|
||||
*
|
||||
* Maciej 'YTM/Elysium' Witkowiak, 25.04.2003
|
||||
*/
|
||||
** _poserror.c
|
||||
**
|
||||
** Maciej 'YTM/Elysium' Witkowiak, 25.04.2003
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* abort.c
|
||||
*
|
||||
* Maciej 'YTM/Elysium' Witkowiak 15.7.2001
|
||||
*/
|
||||
** abort.c
|
||||
**
|
||||
** Maciej 'YTM/Elysium' Witkowiak 15.7.2001
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <geos.h>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* perror.c
|
||||
*
|
||||
* Maciej 'YTM/Elysium' Witkowiak, 15.07.2001
|
||||
*/
|
||||
** perror.c
|
||||
**
|
||||
** Maciej 'YTM/Elysium' Witkowiak, 15.07.2001
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* sleep.c
|
||||
*
|
||||
* Maciej 'YTM/Elysium' Witkowiak, 16.08.2003
|
||||
*
|
||||
*/
|
||||
** sleep.c
|
||||
**
|
||||
** Maciej 'YTM/Elysium' Witkowiak, 16.08.2003
|
||||
**
|
||||
*/
|
||||
|
||||
#include <geos.h>
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
/*
|
||||
* char MessageBox (char mode, const char *format, ...)
|
||||
*
|
||||
* Maciej 'YTM/Elysium' Witkowiak, 17.08.2003
|
||||
*
|
||||
*/
|
||||
** char MessageBox (char mode, const char *format, ...)
|
||||
**
|
||||
** Maciej 'YTM/Elysium' Witkowiak, 17.08.2003
|
||||
**
|
||||
*/
|
||||
|
||||
#include <geos.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* systime.c
|
||||
*
|
||||
* Maciej 'YTM/Elysium' Witkowiak, 22.11.2002
|
||||
*/
|
||||
** systime.c
|
||||
**
|
||||
** Maciej 'YTM/Elysium' Witkowiak, 22.11.2002
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
#include <geos.h>
|
||||
|
||||
@@ -116,8 +116,8 @@ set: sta joy_vectors,x
|
||||
;----------------------------------------------------------------------------
|
||||
; unsigned char joy_uninstall (void);
|
||||
; /* Uninstall the currently loaded driver. Note: This call does not free
|
||||
; * allocated memory.
|
||||
; */
|
||||
; ** allocated memory.
|
||||
; */
|
||||
|
||||
_joy_uninstall:
|
||||
lda #$60 ; RTS opcode
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; unsigned char mouse_buttons (void);
|
||||
; /* Return a bit mask encoding the states of the mouse buttons. Use the
|
||||
; * MOUSE_BTN_XXX flags to decode a specific button.
|
||||
; */
|
||||
; ** MOUSE_BTN_XXX flags to decode a specific button.
|
||||
; */
|
||||
;
|
||||
|
||||
.include "mouse-kernel.inc"
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
;
|
||||
; void mouse_hide (void);
|
||||
; /* Hide the mouse. The function manages a counter and may be called more than
|
||||
; * once. For each call to mouse_hide there must be a call to mouse_show to make
|
||||
; * the mouse visible again.
|
||||
; */
|
||||
; ** once. For each call to mouse_hide there must be a call to mouse_show to make
|
||||
; ** the mouse visible again.
|
||||
; */
|
||||
;
|
||||
|
||||
.include "mouse-kernel.inc"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; unsigned char __fastcall__ mouse_ioctl (unsigned char code, void* data);
|
||||
; /* Call the driver specific ioctl function. NON PORTABLE! Returns an error
|
||||
; * code.
|
||||
; */
|
||||
; ** code.
|
||||
; */
|
||||
;
|
||||
|
||||
.import popa
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
;
|
||||
; void __fastcall__ mouse_move (int x, int y);
|
||||
; /* Set the mouse cursor to the given position. If a mouse cursor is defined
|
||||
; * and currently visible, the mouse cursor is also moved.
|
||||
; * NOTE: This function does not check if the given position is valid and
|
||||
; * inside the bounding box.
|
||||
; */
|
||||
; ** and currently visible, the mouse cursor is also moved.
|
||||
; ** NOTE: This function does not check if the given position is valid and
|
||||
; ** inside the bounding box.
|
||||
; */
|
||||
;
|
||||
|
||||
.import incsp2
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
;
|
||||
; void __fastcall__ mouse_setbox (const struct mouse_box* box);
|
||||
; /* Set the bounding box for the mouse pointer movement. The mouse X and Y
|
||||
; * coordinates will never go outside the given box.
|
||||
; * NOTE: The function does *not* check if the mouse is currently inside the
|
||||
; * given margins. The proper way to use this function therefore is:
|
||||
; *
|
||||
; * - Hide the mouse
|
||||
; * - Set the bounding box
|
||||
; * - Place the mouse at the desired position
|
||||
; * - Show the mouse again.
|
||||
; *
|
||||
; * NOTE2: When setting the box to something that is larger than the actual
|
||||
; * screen, the positioning of the mouse cursor can fail. If such margins
|
||||
; * are really what you want, you have to use your own cursor routines.
|
||||
; */
|
||||
; ** coordinates will never go outside the given box.
|
||||
; ** NOTE: The function does *not* check if the mouse is currently inside the
|
||||
; ** given margins. The proper way to use this function therefore is:
|
||||
; **
|
||||
; ** - Hide the mouse
|
||||
; ** - Set the bounding box
|
||||
; ** - Place the mouse at the desired position
|
||||
; ** - Show the mouse again.
|
||||
; **
|
||||
; ** NOTE2: When setting the box to something that is larger than the actual
|
||||
; ** screen, the positioning of the mouse cursor can fail. If such margins
|
||||
; ** are really what you want, you have to use your own cursor routines.
|
||||
; */
|
||||
;
|
||||
;
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
;
|
||||
; time_t _systime (void);
|
||||
; /* Similar to time(), but:
|
||||
; * - Is not ISO C
|
||||
; * - Does not take the additional pointer
|
||||
; * - Does not set errno when returning -1
|
||||
; */
|
||||
; ** - Is not ISO C
|
||||
; ** - Does not take the additional pointer
|
||||
; ** - Does not set errno when returning -1
|
||||
; */
|
||||
;
|
||||
|
||||
.export __systime
|
||||
|
||||
@@ -103,8 +103,8 @@ copy: lda (ptr1),y
|
||||
;----------------------------------------------------------------------------
|
||||
; unsigned char ser_uninstall (void);
|
||||
; /* Uninstall the currently loaded driver and return an error code.
|
||||
; * Note: This call does not free allocated memory.
|
||||
; */
|
||||
; ** Note: This call does not free allocated memory.
|
||||
; */
|
||||
|
||||
_ser_uninstall:
|
||||
jsr ser_uninstall ; Call driver routine
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; unsigned char __fastcall__ ser_get (char* b);
|
||||
; /* Get a character from the serial port. If no characters are available, the
|
||||
; * function will return SER_ERR_NO_DATA, so this is not a fatal error.
|
||||
; */
|
||||
; ** function will return SER_ERR_NO_DATA, so this is not a fatal error.
|
||||
; */
|
||||
|
||||
|
||||
.importzp ptr1
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
;
|
||||
; unsigned char __fastcall__ ser_put (char b);
|
||||
; /* Send a character via the serial port. There is a transmit buffer, but
|
||||
; * transmitting is not done via interrupt. The function returns
|
||||
; * SER_ERR_OVERFLOW if there is no space left in the transmit buffer.
|
||||
; */
|
||||
; ** transmitting is not done via interrupt. The function returns
|
||||
; ** SER_ERR_OVERFLOW if there is no space left in the transmit buffer.
|
||||
; */
|
||||
|
||||
|
||||
.include "ser-kernel.inc"
|
||||
|
||||
@@ -198,8 +198,8 @@ tgi_set_ptr:
|
||||
;----------------------------------------------------------------------------
|
||||
; void tgi_uninstall (void);
|
||||
; /* Uninstall the currently loaded driver but do not unload it. Will call
|
||||
; * tgi_done if necessary.
|
||||
; */
|
||||
; ** tgi_done if necessary.
|
||||
; */
|
||||
|
||||
_tgi_uninstall:
|
||||
jsr _tgi_done ; Switch off graphics
|
||||
|
||||
@@ -48,10 +48,10 @@
|
||||
void __fastcall__ tgi_arc (int x, int y, unsigned char rx, unsigned char ry,
|
||||
unsigned sa, unsigned ea)
|
||||
/* Draw an ellipse arc with center at x/y and radii rx/ry using the current
|
||||
* drawing color. The arc covers the angle between sa and ea (startangle and
|
||||
* endangle), which must be in the range 0..360 (otherwise the function may
|
||||
* bevave unextectedly).
|
||||
*/
|
||||
** drawing color. The arc covers the angle between sa and ea (startangle and
|
||||
** endangle), which must be in the range 0..360 (otherwise the function may
|
||||
** bevave unextectedly).
|
||||
*/
|
||||
{
|
||||
int x1, y1, x2, y2;
|
||||
unsigned char inc;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; void __fastcall__ tgi_ellipse (int x, int y, unsigned char rx, unsigned char ry);
|
||||
; /* Draw a full ellipse with center at x/y and radii rx/ry using the current
|
||||
; * drawing color.
|
||||
; */
|
||||
; ** drawing color.
|
||||
; */
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; unsigned tgi_getaspectratio (void);
|
||||
; /* Returns the aspect ratio for the loaded driver. The aspect ratio is an
|
||||
; * 8.8 fixed point value.
|
||||
; */
|
||||
; ** 8.8 fixed point value.
|
||||
; */
|
||||
;
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; const unsigned char* tgi_getdefpalette (void);
|
||||
; /* Return the default palette. Will return NULL for drivers that do not
|
||||
; * support palettes.
|
||||
; */
|
||||
; ** support palettes.
|
||||
; */
|
||||
;
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; unsigned char tgi_geterror (void);
|
||||
; /* Return the error code for the last operation. This will also clear the
|
||||
; * error.
|
||||
; */
|
||||
; ** error.
|
||||
; */
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; unsigned char tgi_getmaxcolor (void);
|
||||
; /* Return the maximum supported color number (the number of colors would
|
||||
; * then be getmaxcolor()+1).
|
||||
; */
|
||||
; ** then be getmaxcolor()+1).
|
||||
; */
|
||||
;
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; unsigned tgi_getmaxx (void);
|
||||
; /* Return the maximum x coordinate. The resolution in x direction is
|
||||
; * getmaxx() + 1
|
||||
; */
|
||||
; ** getmaxx() + 1
|
||||
; */
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; unsigned tgi_getmaxy (void);
|
||||
; /* Return the maximum y coordinate. The resolution in y direction is
|
||||
; * getmaxy() + 1
|
||||
; */
|
||||
; ** getmaxy() + 1
|
||||
; */
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;
|
||||
; const unsigned char* tgi_getpalette (void);
|
||||
; /* Return the current palette. Will return NULL for drivers that do not
|
||||
; * support palettes.
|
||||
; */
|
||||
; ** support palettes.
|
||||
; */
|
||||
;
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
;-----------------------------------------------------------------------------
|
||||
; unsigned __fastcall__ tgi_gettextheight (const char* s);
|
||||
; /* Calculate the height of the text in pixels according to the current text
|
||||
; * style.
|
||||
; */
|
||||
; ** style.
|
||||
; */
|
||||
;
|
||||
|
||||
.proc _tgi_gettextheight
|
||||
|
||||
@@ -22,8 +22,8 @@ Text := ptr3
|
||||
;-----------------------------------------------------------------------------
|
||||
; unsigned __fastcall__ tgi_gettextwidth (const char* s);
|
||||
; /* Calculate the width of the text in pixels according to the current text
|
||||
; * style.
|
||||
; */
|
||||
; ** style.
|
||||
; */
|
||||
;
|
||||
; Result is strlen (s) * tgi_textmagw * tgi_fontsizex
|
||||
;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user