mirror of
https://github.com/cc65/cc65.git
synced 2025-01-21 15:32:41 +00:00
Use && and || in preprocessor #if statements. Other minor changes.
git-svn-id: svn://svn.cc65.org/cc65/trunk@866 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
def6300556
commit
6e29f555d2
@ -39,34 +39,16 @@
|
||||
|
||||
|
||||
/* Load the system specific files here, if needed */
|
||||
#ifdef __C64__
|
||||
#ifndef _C64_H
|
||||
#include <c64.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __C128__
|
||||
#ifndef _C128_H
|
||||
#include <c128.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __PLUS4__
|
||||
#ifndef _PLUS4_H
|
||||
#include <plus4.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __CBM610__
|
||||
#ifndef _CBM610_H
|
||||
#include <cbm610.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __PET__
|
||||
#ifndef _PET_H
|
||||
#include <pet.h>
|
||||
#endif
|
||||
#if defined(__C64__) && !defined(_C64_H)
|
||||
# include <c64.h>
|
||||
#elif defined(__C128__) && !defined(_C128_H)
|
||||
# include <c128.h>
|
||||
#elif defined(__PLUS4__) && !defined(_PLUS4_H)
|
||||
# include <plus4.h>
|
||||
#elif defined(__CBM610__) && !defined(_CBM610_H)
|
||||
# include <cbm610.h>
|
||||
#elif defined(__PET__) && !defined(_PET_H)
|
||||
# include <pet.h>
|
||||
#endif
|
||||
|
||||
|
||||
@ -109,11 +91,16 @@ unsigned char __fastcall__ cbm_k_basin (void);
|
||||
void __fastcall__ cbm_k_bsout (unsigned char C);
|
||||
void __fastcall__ cbm_k_clrch (void);
|
||||
|
||||
/* BASIC-like functions
|
||||
|
||||
|
||||
/* BASIC-like file I/O functions
|
||||
*
|
||||
* All cbm_* IO functions set extern unsigned char _oserror in case
|
||||
* of an error. For the meaning of the errorcode see the table below.
|
||||
* All cbm_* IO functions set _oserror (see errno.h) in case of an
|
||||
* error. For the meaning of the errorcode see the table below.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
unsigned char cbm_load(const char* name, unsigned char device,
|
||||
unsigned int addr);
|
||||
/* Loads file "name" from given device to given address or to the load
|
||||
@ -166,5 +153,9 @@ int cbm_write(unsigned char lfn, void* buffer, unsigned int size);
|
||||
* 9 = illegal device number
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* End of cbm.h */
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -54,27 +54,17 @@
|
||||
|
||||
|
||||
|
||||
#ifndef _STDARG_H
|
||||
#if !defined(_STDARG_H)
|
||||
# include <stdarg.h>
|
||||
#endif
|
||||
|
||||
/* Read the CBM file if we're compiling for a CBM machine */
|
||||
#ifdef __CBM__
|
||||
# ifndef _CBM_H
|
||||
# include <cbm.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE2__
|
||||
# ifndef _APPLE2_H
|
||||
# include <apple2.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __ATARI__
|
||||
# ifndef _ATARI_H
|
||||
# include <atari.h>
|
||||
# endif
|
||||
/* Include the correct machine specific file */
|
||||
#if defined(__CBM__) && !defined(_CBM_H)
|
||||
# include <cbm.h>
|
||||
#elif defined(__APPLE2__) && !defined(_APPLE2_H)
|
||||
# include <apple2.h>
|
||||
#elif defined(__ATARI__) && !defined(_ATARI_H)
|
||||
# include <atari.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -67,18 +67,18 @@ int __fastcall__ tolower (int c); /* Always external */
|
||||
|
||||
extern unsigned char _ctype[256];
|
||||
|
||||
#define isalnum(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$07"), __AX__)
|
||||
#define isalpha(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$03"), __AX__)
|
||||
#define isblank(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$80"), __AX__)
|
||||
#define iscntrl(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$10"), __AX__)
|
||||
#define isdigit(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$04"), __AX__)
|
||||
#define isgraph(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\teor\t#$30\n\tand\t#$30"), __AX__)
|
||||
#define islower(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$01"), __AX__)
|
||||
#define isprint(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\teor\t#$10\n\tand\t#$10"), __AX__)
|
||||
#define ispunct(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\teor\t#$37\n\tand\t#$37"), __AX__)
|
||||
#define isspace(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$60"), __AX__)
|
||||
#define isupper(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$02"), __AX__)
|
||||
#define isxdigit(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$08"), __AX__)
|
||||
#define isalnum(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$07"), __AX__)
|
||||
#define isalpha(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$03"), __AX__)
|
||||
#define isblank(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$80"), __AX__)
|
||||
#define iscntrl(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$10"), __AX__)
|
||||
#define isdigit(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$04"), __AX__)
|
||||
#define isgraph(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n eor #$30\n and #$30"), __AX__)
|
||||
#define islower(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$01"), __AX__)
|
||||
#define isprint(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n eor #$10\n and #$10"), __AX__)
|
||||
#define ispunct(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n eor #$37\n and #$37"), __AX__)
|
||||
#define isspace(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$60"), __AX__)
|
||||
#define isupper(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$02"), __AX__)
|
||||
#define isxdigit(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$08"), __AX__)
|
||||
|
||||
|
||||
|
||||
|
@ -39,16 +39,7 @@
|
||||
|
||||
|
||||
/* Define __JOYSTICK__ for systems that support a joystick */
|
||||
#ifdef __ATARI__
|
||||
# define __JOYSTICK__
|
||||
#endif
|
||||
#ifdef __C64__
|
||||
# define __JOYSTICK__
|
||||
#endif
|
||||
#ifdef __C128__
|
||||
# define __JOYSTICK__
|
||||
#endif
|
||||
#ifdef __PLUS4__
|
||||
#if defined(__ATARI__) || defined(__C64__) || defined(__C128__) || defined(__PLUS4__)
|
||||
# define __JOYSTICK__
|
||||
#endif
|
||||
|
||||
|
@ -39,13 +39,7 @@
|
||||
|
||||
|
||||
/* Define __MOUSE__ for systems that support a mouse */
|
||||
#ifdef __C64__
|
||||
# define __MOUSE__
|
||||
#endif
|
||||
#ifdef __C128__
|
||||
# define __MOUSE__
|
||||
#endif
|
||||
#ifdef __ATARI__
|
||||
#if defined(__ATARI__) || defined(__C64__) || defined(__C128__)
|
||||
# define __MOUSE__
|
||||
#endif
|
||||
|
||||
@ -74,8 +68,8 @@
|
||||
|
||||
|
||||
|
||||
unsigned char __fastcall__ mouse_init (unsigned char port,
|
||||
unsigned char sprite,
|
||||
unsigned char __fastcall__ mouse_init (unsigned char port,
|
||||
unsigned char sprite,
|
||||
unsigned char type);
|
||||
/* Setup the mouse interrupt handler. If the sprite value is != zero, the
|
||||
* mouse routines will manage the sprite with this number. That means, it
|
||||
|
Loading…
x
Reference in New Issue
Block a user