Merge branch 'master' into master

This commit is contained in:
jedeoric
2021-03-01 23:03:34 +01:00
committed by GitHub
143 changed files with 3214 additions and 1314 deletions

80
include/_atari5200os.h Normal file
View File

@@ -0,0 +1,80 @@
/*****************************************************************************/
/* */
/* _atari5200os.h */
/* */
/* Internal include file, do not use directly */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/* warranty. In no event will the authors be held liable for any damages */
/* arising from the use of this software. */
/* */
/* Permission is granted to anyone to use this software for any purpose, */
/* including commercial applications, and to alter it and redistribute it */
/* freely, subject to the following restrictions: */
/* */
/* 1. The origin of this software must not be misrepresented; you must not */
/* claim that you wrote the original software. If you use this software */
/* in a product, an acknowledgment in the product documentation would be */
/* appreciated but is not required. */
/* 2. Altered source versions must be plainly marked as such, and must not */
/* be misrepresented as being the original software. */
/* 3. This notice may not be removed or altered from any source */
/* distribution. */
/* */
/*****************************************************************************/
#ifndef __ATARI5200OS_H
#define __ATARI5200OS_H
struct __os {
/*Page zero*/
unsigned char pokmsk; // = $00 System mask for POKEY IRQ enable
unsigned char rtclok[2]; // = $01,$02 Real time clock
unsigned char critic; // = $03 Critical section flag
unsigned char atract; // = $04 Attract mode counter
union {
struct {
unsigned char sdlstl; // = $05 Save display list LO
unsigned char sdlsth; // = $06 Save display list HI
};
void* sdlst; // = $05,$06 Display list shadow
};
unsigned char sdmctl; // = $07 DMACTL shadow
unsigned char pcolr0; // = $08 PM color 0
unsigned char pcolr1; // = $09 PM color 1
unsigned char pcolr2; // = $0A PM color 2
unsigned char pcolr3; // = $0B PM color 3
unsigned char color0; // = $0C PF color 0
unsigned char color1; // = $0D PF color 1
unsigned char color2; // = $0E PF color 2
unsigned char color3; // = $0F PF color 3
unsigned char color4; // = $10 PF color 4
unsigned char _free_1[0xEF]; // = $11-$FF User space
/*Stack*/
unsigned char stack[0x100]; // = $100-$1FF Stack
/*Page 2 OS variables*/
void (*vinter)(void); // = $200 Immediate IRQ vector
void (*vvblki)(void); // = $202 Immediate VBI vector
void (*vvblkd)(void); // = $204 Deferred VBI vector
void (*vdslst)(void); // = $206 DLI vector
void (*vkeybd)(void); // = $208 Keyboard IRQ vector
void (*vkeypd)(void); // = $20A Keyboard continuation vector
void (*vbrkky)(void); // = $20C Break key interrupt vector
void (*vbreak)(void); // = $20E BRK instruction interrupt vector
void (*vserin)(void); // = $210 Serial input ready vector
void (*vseror)(void); // = $212 Serial output data needed vector
void (*vseroc)(void); // = $214 Serial output completed vector
void (*vtimr1)(void); // = $216 POKEY timer 1 IRQ vector
void (*vtimr2)(void); // = $218 POKEY timer 2 IRQ vector
void (*vtimr4)(void); // = $21A POKEY timer 4 IRQ vector
};
#endif

View File

@@ -6,10 +6,11 @@
/* */
/* */
/* */
/* (C) 2000-2019 Mark Keates <markk@dendrite.co.uk> */
/* (C) 2000-2021 Mark Keates <markk@dendrite.co.uk> */
/* Freddy Offenga <taf_offenga@yahoo.com> */
/* Christian Groessler <chris@groessler.org> */
/* Bill Kendrick <nbs@sonic.net> */
/* et al. */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@@ -219,7 +220,7 @@
/* Color register functions */
/*****************************************************************************/
extern void __fastcall__ _setcolor (unsigned char color_reg, unsigned char hue, unsigned char luminace);
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);
@@ -227,6 +228,7 @@ extern 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);
/* numlines > 0 scrolls up */

View File

@@ -35,7 +35,7 @@
/* Check for errors */
/* check for errors */
#if !defined(__ATARI5200__)
# error This module may only be used when compiling for the Atari 5200!
#endif
@@ -46,14 +46,14 @@
/* the addresses of the static drivers */
extern void atr5200std_joy[]; /* referred to by joy_static_stddrv[] */
/* Masks for joy_read */
/* masks for joy_read */
#define JOY_UP_MASK 0x01
#define JOY_DOWN_MASK 0x02
#define JOY_LEFT_MASK 0x04
#define JOY_RIGHT_MASK 0x08
#define JOY_BTN_1_MASK 0x10
/* Character codes */
/* character codes */
#define CH_ULCORNER 0x0B /* '+' sign */
#define CH_URCORNER 0x0B
#define CH_LLCORNER 0x0B
@@ -65,7 +65,11 @@ extern void atr5200std_joy[]; /* referred to by joy_static_stddrv[] */
#define AT_NTSC 0
#define AT_PAL 1
/* Define hardware */
/* Define variables used by the OS*/
#include <_atari5200os.h>
#define OS (*(struct __os*)0x0000)
/* define hardware */
#include <_gtia.h>
#define GTIA_READ (*(struct __gtia_read*)0xC000)
#define GTIA_WRITE (*(struct __gtia_write*)0xC000)
@@ -89,5 +93,8 @@ extern void atr5200std_joy[]; /* referred to by joy_static_stddrv[] */
*/
#define _bordercolor(color) 0
/* End of atari5200.h */
/* wait for start of next frame */
extern void waitvsync (void);
/* end of atari5200.h */
#endif

View File

@@ -166,7 +166,7 @@ unsigned char get_tv (void);
unsigned char __fastcall__ kbrepeat (unsigned char mode);
/* Changes which keys have automatic repeat. */
#if !defined(__CBM610__) && !defined(__PET__)
#if !defined(__CBM610__)
void waitvsync (void);
/* Wait for the start of the next video field. */
#endif
@@ -191,6 +191,8 @@ unsigned char cbm_k_acptr (void);
unsigned char cbm_k_basin (void);
void __fastcall__ cbm_k_bsout (unsigned char C);
unsigned char __fastcall__ cbm_k_chkin (unsigned char FN);
unsigned char cbm_k_chrin (void);
void __fastcall__ cbm_k_chrout (unsigned char C);
void __fastcall__ cbm_k_ciout (unsigned char C);
unsigned char __fastcall__ cbm_k_ckout (unsigned char FN);
void cbm_k_clall (void);
@@ -295,7 +297,15 @@ unsigned char __fastcall__ cbm_readdir (unsigned char lfn,
/* Reads one directory line into cbm_dirent structure.
** Returns 0 if reading directory-line was successful.
** Returns non-zero if reading directory failed, or no more file-names to read.
** Returns 2 on last line. Then, l_dirent->size = the number of "blocks free."
** Returns 2 on last line. Then, l_dirent->size = the number of "blocks free",
** "blocks used", or "mb free". Return codes:
** 0 = read file-name
** 1 = couldn't read directory
** 2 = read "blocks free", "blocks used", or "mb free"
** 3 = couldn't find start of file-name
** 4 = couldn't find end of file-name
** 5 = couldn't read file-type
** 6 = premature end of file
*/
void __fastcall__ cbm_closedir (unsigned char lfn);

View File

@@ -83,46 +83,31 @@ extern struct _timezone {
#if defined(__ATARI__)
/* The clock depends on the video standard, so read it at runtime */
unsigned _clocks_per_sec (void);
# define CLK_TCK _clocks_per_sec()
# define CLOCKS_PER_SEC _clocks_per_sec()
#elif defined(__ATARI5200__)
# define CLK_TCK 60 /* POSIX */
# define CLOCKS_PER_SEC 60 /* ANSI */
#if defined(__ATARI5200__)
# define CLOCKS_PER_SEC 60
#elif defined(__ATMOS__)
# define CLK_TCK 100 /* POSIX */
# define CLOCKS_PER_SEC 100 /* ANSI */
# define CLOCKS_PER_SEC 100
#elif defined(__CBM__)
# if defined(__CBM510__) || defined(__CBM610__)
/* The 510/610 gets its clock from the AC current */
# define CLK_TCK 50 /* POSIX */
# define CLOCKS_PER_SEC 50 /* ANSI */
# define CLOCKS_PER_SEC 50
# else
# define CLK_TCK 60 /* POSIX */
# define CLOCKS_PER_SEC 60 /* ANSI */
# define CLOCKS_PER_SEC 60
# endif
#elif defined(__NES__)
# define CLK_TCK 50 /* POSIX */
# define CLOCKS_PER_SEC 50 /* ANSI */
# define CLOCKS_PER_SEC 50
#elif defined(__PCE__)
# define CLK_TCK 60 /* POSIX */
# define CLOCKS_PER_SEC 60 /* ANSI */
# define CLOCKS_PER_SEC 60
#elif defined(__GAMATE__)
# define CLK_TCK 135 /* POSIX */ /* FIXME */
# define CLOCKS_PER_SEC 135 /* ANSI */ /* FIXME */
# define CLOCKS_PER_SEC 135 /* FIXME */
#elif defined(__GEOS__)
# define CLK_TCK 1 /* POSIX */
# define CLOCKS_PER_SEC 1 /* ANSI */
#elif defined(__LYNX__)
/* The clock-rate depends on the video scan-rate;
** so, read it at run-time.
*/
extern clock_t _clk_tck (void);
# define CLK_TCK _clk_tck()
# define CLOCKS_PER_SEC _clk_tck()
# define CLOCKS_PER_SEC 1
#else
/* Read the clock rate at runtime */
clock_t _clocks_per_sec (void);
# define CLOCKS_PER_SEC _clocks_per_sec()
#endif
#define CLK_TCK CLOCKS_PER_SEC
#define CLOCK_REALTIME 0
@@ -149,6 +134,3 @@ int __fastcall__ clock_settime (clockid_t clock_id, const struct timespec *tp);
/* End of time.h */
#endif