Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
groessler committed Oct 7, 2024
2 parents 24798ba + 4dfbccf commit e31aca3
Show file tree
Hide file tree
Showing 83 changed files with 1,472 additions and 380 deletions.
2 changes: 1 addition & 1 deletion .github/checks/lastline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nl='
'
nl=$'\n'
r1="${nl}$"
FILES=`find $CHECK_PATH -type f \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | while read f; do
FILES=`find $CHECK_PATH -type f -size +0 \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | while read f; do
t=$(tail -c2 $f; printf x)
[[ ${t%x} =~ $r1 ]] || echo "$f"
done`
Expand Down
12 changes: 12 additions & 0 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ char* nextLine (FILE* f);

### Header files

* All Headers should start with a copyright/license banner
* Function prototypes must be a single line, not contain the redundant
"extern" keyword, and followed by a brief comment that explains what
the function does, and separated from the next prototype by a blank
line:

~~~C
void __fastcall__ cclear (unsigned char length);
/* Clear part of a line (write length spaces). */

~~~
Headers that belong to the standard library (libc) must
conform with the C standard. That means:
Expand Down
1 change: 1 addition & 0 deletions asminc/rp6502.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ RIA_OP_PHI2 := $02
RIA_OP_CODEPAGE := $03
RIA_OP_LRAND := $04
RIA_OP_STDIN_OPT := $05
RIA_OP_CLOCK := $0F
RIA_OP_CLOCK_GETRES := $10
RIA_OP_CLOCK_GETTIME := $11
RIA_OP_CLOCK_SETTIME := $12
Expand Down
6 changes: 6 additions & 0 deletions asminc/time.inc
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@
.global _clock_settime
.global _localtime
.global _mktime


;------------------------------------------------------------------------------
; Constants

CLOCK_REALTIME = 0
16 changes: 14 additions & 2 deletions doc/cc65.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Short options:
-Os Inline some standard functions
-T Include source as comment
-V Print the compiler version number
-W warning[,...] Suppress warnings
-W [-+]warning[,...] Control warnings ('-' disables, '+' enables)
-d Debug mode
-g Add debug info to object file
-h Help (this text)
Expand All @@ -84,8 +84,9 @@ Long options:
--create-full-dep name Create a full make dependency file
--data-name seg Set the name of the DATA segment
--debug Debug mode
--debug-tables name Write symbol table debug info to a file
--debug-info Add debug info to object file
--debug-opt name Configure optimizations with a file
--debug-opt name Debug optimization steps
--debug-opt-output Debug output of each optimization step
--dep-target target Use this dependency target
--disable-opt name Disable an optimization step
Expand Down Expand Up @@ -823,6 +824,11 @@ and the one defined by the ISO standard:
as it sounds, since the 6502 has so few registers that it isn't
possible to keep values in registers anyway.
<p>
<item> In <tt/cc65/ mode, <tt/main()/ cannot be called recursively. If this
is necessary, the program must be compiled in <tt/c89/ or <tt/c99/ mode
using the <tt><ref id="option--standard" name="--standard"></tt>
command line option.
<p>
</itemize>

There may be some more minor differences I'm currently not aware of. The
Expand Down Expand Up @@ -1273,6 +1279,12 @@ If the first parameter is <tt/push/, the old value is saved onto a stack
before changing it. The value may later be restored by using the <tt/pop/
parameter with the <tt/#pragma/.

For all pragma names that contain hyphens, the same name using underlines
instead of the hyphens is available as an alternative. While the former
resembles the corresponding command line option and is more orthogonal, the
latter may be more compatible with external tools that rewrite the token
sequences of the input.


<sect1><tt>#pragma allow-eager-inline ([push,] on|off)</tt><label id="pragma-allow-eager-inline"><p>

Expand Down
2 changes: 1 addition & 1 deletion doc/customizing.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ FEATURES {

SYMBOLS {
# Define the stack size for the application
__STACKSIZE__: value = $0200, weak = yes;
__STACKSIZE__: value = $0200, type = weak;
}
</code></tscreen>

Expand Down
3 changes: 3 additions & 0 deletions doc/funcref.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ function.
<item><ref id="atmos_tick" name="atmos_tick">
<item><ref id="atmos_tock" name="atmos_tock">
<item><ref id="atmos_zap" name="atmos_zap">
<item><ref id="waitvsync" name="waitvsync">
</itemize>


Expand Down Expand Up @@ -8358,13 +8359,15 @@ only in the presence of a prototype.
<descrip>
<tag/Function/Wait until the start of the next video frame.
<tag/Header/<tt/
<ref id="atmos.h" name="atmos.h">,
<ref id="cbm.h" name="cbm.h">,
<ref id="gamate.h" name="gamate.h">,
<ref id="nes.h" name="nes.h">,
<ref id="pce.h" name="pce.h">/
<tag/Declaration/<tt/void waitvsync (void);/
<tag/Description/Wait for vertical sync, to reduce flickering.
<tag/Availability/Platforms served by the headers above
(Atmos requires the VSync hack)
<tag/Example/None.
</descrip>
</quote>
Expand Down
26 changes: 13 additions & 13 deletions include/atari.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,17 @@
/* Color register functions */
/*****************************************************************************/

extern void __fastcall__ _setcolor (unsigned char color_reg, unsigned char hue, unsigned char luminance);
extern void __fastcall__ _setcolor_low (unsigned char color_reg, unsigned char color_value);
extern unsigned char __fastcall__ _getcolor (unsigned char color_reg);
void __fastcall__ _setcolor (unsigned char color_reg, unsigned char hue, unsigned char luminance);
void __fastcall__ _setcolor_low (unsigned char color_reg, unsigned char color_value);
unsigned char __fastcall__ _getcolor (unsigned char color_reg);

/*****************************************************************************/
/* Other screen functions */
/*****************************************************************************/

extern void waitvsync (void); /* wait for start of next frame */
extern int __fastcall__ _graphics (unsigned char mode); /* mode value same as in BASIC */
extern void __fastcall__ _scroll (signed char numlines);
void waitvsync (void); /* wait for start of next frame */
int __fastcall__ _graphics (unsigned char mode); /* mode value same as in BASIC */
void __fastcall__ _scroll (signed char numlines);
/* numlines > 0 scrolls up */
/* numlines < 0 scrolls down */

Expand All @@ -239,18 +239,18 @@ extern void __fastcall__ _scroll (signed char numlines);
/* Sound function */
/*****************************************************************************/

extern void __fastcall__ _sound (unsigned char voice, unsigned char frequency, unsigned char distortion, unsigned char volume);
void __fastcall__ _sound (unsigned char voice, unsigned char frequency, unsigned char distortion, unsigned char volume);

/*****************************************************************************/
/* Misc. functions */
/*****************************************************************************/

extern unsigned char get_ostype(void); /* get ROM version */
extern unsigned char get_tv(void); /* get TV system */
extern void _save_vecs(void); /* save system vectors */
extern void _rest_vecs(void); /* restore system vectors */
extern char *_getdefdev(void); /* get default floppy device */
extern unsigned char _is_cmdline_dos(void); /* does DOS support command lines */
unsigned char get_ostype(void); /* get ROM version */
unsigned char get_tv(void); /* get TV system */
void _save_vecs(void); /* save system vectors */
void _rest_vecs(void); /* restore system vectors */
char *_getdefdev(void); /* get default floppy device */
unsigned char _is_cmdline_dos(void); /* does DOS support command lines */


/*****************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion include/atari5200.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extern void atr5200std_joy[]; /* referred to by joy_static_stddrv[] */
#define _bordercolor(color) 0

/* wait for start of next frame */
extern void waitvsync (void);
void waitvsync (void);

/* end of atari5200.h */
#endif
2 changes: 1 addition & 1 deletion include/atari7800.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
/* No support for dynamically loadable drivers */
#define DYN_DRV 0

extern unsigned char get_tv(void); /* get TV system */
unsigned char get_tv(void); /* get TV system */

#include <_tia.h>
#define TIA (*(struct __tia*)0x0000)
Expand Down
3 changes: 3 additions & 0 deletions include/atmos.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ void atmos_tock (void);
void atmos_zap (void);
/* Raygun sound effect */

void waitvsync (void);
/* Wait for start of next frame */



/* End of atmos.h */
Expand Down
6 changes: 4 additions & 2 deletions include/rp6502.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ struct __RP6502
unsigned char step1;
unsigned int addr1;
unsigned char xstack;
unsigned char errno_lo;
unsigned char errno_hi;
unsigned int errno;
unsigned char op;
unsigned char irq;
const unsigned char spin;
Expand Down Expand Up @@ -101,6 +100,7 @@ long __fastcall__ ria_call_long_errno (unsigned char op);
#define RIA_OP_CODEPAGE 0x03
#define RIA_OP_LRAND 0x04
#define RIA_OP_STDIN_OPT 0x05
#define RIA_OP_CLOCK 0x0F
#define RIA_OP_CLOCK_GETRES 0x10
#define RIA_OP_CLOCK_GETTIME 0x11
#define RIA_OP_CLOCK_SETTIME 0x12
Expand All @@ -117,6 +117,8 @@ long __fastcall__ ria_call_long_errno (unsigned char op);

/* C API for the operating system. */

int __cdecl__ xregn (char device, char channel, unsigned char address, unsigned count,
...);
int __cdecl__ xreg (char device, char channel, unsigned char address, ...);
int phi2 (void);
int codepage (void);
Expand Down
76 changes: 38 additions & 38 deletions include/stdint.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ typedef unsigned char uint8_t;
typedef unsigned uint16_t;
typedef unsigned long uint32_t;

#define INT8_MIN ((int8_t) 0x80)
#define INT8_MAX ((int8_t) 0x7F)
#define INT16_MIN ((int16_t) 0x8000)
#define INT16_MAX ((int16_t) 0x7FFF)
#define INT32_MIN ((int32_t) 0x80000000)
#define INT32_MAX ((int32_t) 0x7FFFFFFF)
#define UINT8_MAX ((uint8_t) 0xFF)
#define UINT16_MAX ((uint16_t) 0xFFFF)
#define UINT32_MAX ((uint32_t) 0xFFFFFFFF)
#define INT8_MIN -128
#define INT8_MAX 127
#define INT16_MIN (-32767 - 1)
#define INT16_MAX 32767
#define INT32_MIN (-2147483647L - 1L)
#define INT32_MAX 2147483647L
#define UINT8_MAX 255
#define UINT16_MAX 65535U
#define UINT32_MAX 4294967295UL

/* Minimum-width integer types */
typedef signed char int_least8_t;
Expand All @@ -70,15 +70,15 @@ typedef unsigned char uint_least8_t;
typedef unsigned uint_least16_t;
typedef unsigned long uint_least32_t;

#define INT_LEAST8_MIN ((int_least8_t) 0x80)
#define INT_LEAST8_MAX ((int_least8_t) 0x7F)
#define INT_LEAST16_MIN ((int_least16_t) 0x8000)
#define INT_LEAST16_MAX ((int_least16_t) 0x7FFF)
#define INT_LEAST32_MIN ((int_least32_t) 0x80000000)
#define INT_LEAST32_MAX ((int_least32_t) 0x7FFFFFFF)
#define UINT_LEAST8_MAX ((uint_least8_t) 0xFF)
#define UINT_LEAST16_MAX ((uint_least16_t) 0xFFFF)
#define UINT_LEAST32_MAX ((uint_least32_t) 0xFFFFFFFF)
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST32_MAX INT32_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX

/* Fastest minimum-width integer types */
typedef signed char int_fast8_t;
Expand All @@ -88,40 +88,40 @@ typedef unsigned char uint_fast8_t;
typedef unsigned uint_fast16_t;
typedef unsigned long uint_fast32_t;

#define INT_FAST8_MIN ((int_fast8_t) 0x80)
#define INT_FAST8_MAX ((int_fast8_t) 0x7F)
#define INT_FAST16_MIN ((int_fast16_t) 0x8000)
#define INT_FAST16_MAX ((int_fast16_t) 0x7FFF)
#define INT_FAST32_MIN ((int_fast32_t) 0x80000000)
#define INT_FAST32_MAX ((int_fast32_t) 0x7FFFFFFF)
#define UINT_FAST8_MAX ((uint_fast8_t) 0xFF)
#define UINT_FAST16_MAX ((uint_fast16_t) 0xFFFF)
#define UINT_FAST32_MAX ((uint_fast32_t) 0xFFFFFFFF)
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST32_MAX INT32_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX

/* Integer types capable of holding object pointers */
typedef int intptr_t;
typedef unsigned uintptr_t;

#define INTPTR_MIN ((intptr_t)0x8000)
#define INTPTR_MAX ((intptr_t)0x7FFF)
#define UINTPTR_MAX ((uintptr_t) 0xFFFF)
#define INTPTR_MIN INT16_MIN
#define INTPTR_MAX INT16_MAX
#define UINTPTR_MAX UINT16_MAX

/* Greatest width integer types */
typedef long intmax_t;
typedef unsigned long uintmax_t;

#define INTMAX_MIN ((intmax_t) 0x80000000)
#define INTMAX_MAX ((intmax_t) 0x7FFFFFFF)
#define UINTMAX_MAX ((uintmax_t) 0xFFFFFFFF)
#define INTMAX_MIN INT32_MIN
#define INTMAX_MAX INT32_MAX
#define UINTMAX_MAX UINT32_MAX

/* Limits of other integer types */
#define PTRDIFF_MIN ((int) 0x8000)
#define PTRDIFF_MAX ((int) 0x7FFF)
#define PTRDIFF_MIN INT16_MIN
#define PTRDIFF_MAX INT16_MAX

#define SIG_ATOMIC_MIN ((unsigned char) 0x00)
#define SIG_ATOMIC_MAX ((unsigned char) 0xFF)
#define SIG_ATOMIC_MIN 0
#define SIG_ATOMIC_MAX UINT8_MAX

#define SIZE_MAX 0xFFFF
#define SIZE_MAX UINT16_MAX

/* Macros for minimum width integer constants */
#define INT8_C(c) c
Expand Down
2 changes: 2 additions & 0 deletions include/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ struct tm {
# define CLOCKS_PER_SEC 135 /* FIXME */
#elif defined(__GEOS__)
# define CLOCKS_PER_SEC 1
#elif defined (__RP6502__)
# define CLOCKS_PER_SEC 100
#elif defined(__TELESTRAT__)
# define CLOCKS_PER_SEC 10
#elif defined(__ATARI__) || defined (__LYNX__)
Expand Down
Loading

0 comments on commit e31aca3

Please sign in to comment.