Moved the 'common' files from 'geos-cbm' to 'geos-common' which are believed to work as-is on Apple GEOS too.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5449 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
17
libsrc/geos-common/common/Makefile
Normal file
17
libsrc/geos-common/common/Makefile
Normal file
@@ -0,0 +1,17 @@
|
||||
#
|
||||
# makefile for CC65 runtime library
|
||||
#
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Object files
|
||||
|
||||
C_OBJS += _afailed.o \
|
||||
abort.o \
|
||||
perror.o \
|
||||
sleep.o
|
||||
|
||||
S_OBJS += copydata.o \
|
||||
memcpy.o \
|
||||
memmove.o \
|
||||
memset.o \
|
||||
zerobss.o
|
||||
33
libsrc/geos-common/common/_afailed.c
Normal file
33
libsrc/geos-common/common/_afailed.c
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* _afailed.c
|
||||
*
|
||||
* Maciej 'YTM/Elysium' Witkowiak 28.10.2001
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <geos.h>
|
||||
|
||||
void _afailed (char* file, unsigned line)
|
||||
{
|
||||
|
||||
ExitTurbo();
|
||||
|
||||
drawWindow.top = 0;
|
||||
drawWindow.left = 0;
|
||||
drawWindow.bot = 15;
|
||||
drawWindow.right = 150;
|
||||
dispBufferOn = ST_WR_FORE|ST_WR_BACK;
|
||||
SetPattern(0);
|
||||
Rectangle();
|
||||
FrameRectangle(0xff);
|
||||
|
||||
PutString(CBOLDON "file: ", 10, 10);
|
||||
PutString(file, 10, r11);
|
||||
PutString(CBOLDON " line: ", 10, r11);
|
||||
PutDecimal(0, line, 10, r11);
|
||||
|
||||
DlgBoxOk(CBOLDON "ASSERTION FAILED", "PROGRAM TERMINATED" CPLAINTEXT);
|
||||
|
||||
exit (2);
|
||||
}
|
||||
22
libsrc/geos-common/common/_poserror.c
Normal file
22
libsrc/geos-common/common/_poserror.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* _poserror.c
|
||||
*
|
||||
* Maciej 'YTM/Elysium' Witkowiak, 25.04.2003
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <geos.h>
|
||||
|
||||
void __fastcall__ _poserror (const char* msg)
|
||||
{
|
||||
const char *errmsg = _stroserror(_oserror);
|
||||
|
||||
ExitTurbo();
|
||||
if (msg && *msg) {
|
||||
DlgBoxOk(msg, errmsg);
|
||||
} else {
|
||||
DlgBoxOk("", errmsg);
|
||||
}
|
||||
}
|
||||
17
libsrc/geos-common/common/abort.c
Normal file
17
libsrc/geos-common/common/abort.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* abort.c
|
||||
*
|
||||
* Maciej 'YTM/Elysium' Witkowiak 15.7.2001
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <geos.h>
|
||||
|
||||
void abort (void)
|
||||
{
|
||||
ExitTurbo();
|
||||
DlgBoxOk(CBOLDON "ABNORMAL PROGRAM", "TERMINATION." CPLAINTEXT);
|
||||
exit(3);
|
||||
}
|
||||
27
libsrc/geos-common/common/copydata.s
Normal file
27
libsrc/geos-common/common/copydata.s
Normal file
@@ -0,0 +1,27 @@
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak 15.07.2001
|
||||
;
|
||||
; Copy the data segment from the LOAD to the RUN location
|
||||
;
|
||||
|
||||
.export copydata
|
||||
.import __DATA_LOAD__, __DATA_RUN__, __DATA_SIZE__
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
|
||||
copydata:
|
||||
lda #<__DATA_SIZE__ ; no need to check if it is == 0
|
||||
ldx #>__DATA_SIZE__
|
||||
sta r2L
|
||||
stx r2H
|
||||
|
||||
lda #<__DATA_RUN__
|
||||
ldx #>__DATA_RUN__
|
||||
sta r1L
|
||||
stx r1H
|
||||
|
||||
lda #<__DATA_LOAD__
|
||||
ldx #>__DATA_LOAD__
|
||||
sta r0L
|
||||
stx r0H
|
||||
jmp MoveData
|
||||
10
libsrc/geos-common/common/memcpy.s
Normal file
10
libsrc/geos-common/common/memcpy.s
Normal file
@@ -0,0 +1,10 @@
|
||||
;
|
||||
; void* __fastcall__ memcpy (void* dest, const void* src, size_t n);
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak, 15.07.2001
|
||||
;
|
||||
|
||||
.export _memcpy
|
||||
.import _MoveData
|
||||
|
||||
_memcpy = _MoveData
|
||||
10
libsrc/geos-common/common/memmove.s
Normal file
10
libsrc/geos-common/common/memmove.s
Normal file
@@ -0,0 +1,10 @@
|
||||
;
|
||||
; void* __fastcall__ memmove (void* dest, const void* src, size_t n);
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak, 15.07.2001
|
||||
;
|
||||
|
||||
.export _memmove
|
||||
.import _MoveData
|
||||
|
||||
_memmove = _MoveData
|
||||
14
libsrc/geos-common/common/memset.s
Normal file
14
libsrc/geos-common/common/memset.s
Normal file
@@ -0,0 +1,14 @@
|
||||
;
|
||||
; void* memset (void* ptr, int c, size_t n);
|
||||
; void* _bzero (void* ptr, size_t n);
|
||||
; void bzero (void* ptr, size_t n);
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak, 20.08.2003
|
||||
;
|
||||
|
||||
.export _memset, _bzero, __bzero
|
||||
.import _ClearRam, _FillRam
|
||||
|
||||
_bzero = _ClearRam
|
||||
__bzero = _ClearRam
|
||||
_memset = _FillRam
|
||||
22
libsrc/geos-common/common/perror.c
Normal file
22
libsrc/geos-common/common/perror.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* perror.c
|
||||
*
|
||||
* Maciej 'YTM/Elysium' Witkowiak, 15.07.2001
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <geos.h>
|
||||
|
||||
void __fastcall__ perror(const char* msg)
|
||||
{
|
||||
const char *errmsg = strerror(errno);
|
||||
|
||||
ExitTurbo();
|
||||
if (msg && *msg) {
|
||||
DlgBoxOk(msg, errmsg);
|
||||
} else {
|
||||
DlgBoxOk("", errmsg);
|
||||
}
|
||||
}
|
||||
23
libsrc/geos-common/common/sleep.c
Normal file
23
libsrc/geos-common/common/sleep.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* sleep.c
|
||||
*
|
||||
* Maciej 'YTM/Elysium' Witkowiak, 16.08.2003
|
||||
*
|
||||
*/
|
||||
|
||||
#include <geos.h>
|
||||
|
||||
unsigned __fastcall__ sleep (unsigned wait)
|
||||
{
|
||||
char typ;
|
||||
|
||||
if ( (get_tv()) & TV_NTSC ) {
|
||||
typ = 60;
|
||||
} else {
|
||||
typ = 50;
|
||||
}
|
||||
|
||||
Sleep(wait*typ);
|
||||
|
||||
return 0;
|
||||
}
|
||||
25
libsrc/geos-common/common/zerobss.s
Normal file
25
libsrc/geos-common/common/zerobss.s
Normal file
@@ -0,0 +1,25 @@
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak <ytm@elysium.pl>
|
||||
; 23.12.2002
|
||||
;
|
||||
; Zero the bss segment.
|
||||
;
|
||||
|
||||
.export zerobss
|
||||
.import __BSS_RUN__, __BSS_SIZE__
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
.code
|
||||
|
||||
zerobss:
|
||||
lda #<__BSS_SIZE__
|
||||
ldx #>__BSS_SIZE__
|
||||
sta r0L
|
||||
stx r0H
|
||||
lda #<__BSS_RUN__
|
||||
ldx #>__BSS_RUN__
|
||||
sta r1L
|
||||
stx r1H
|
||||
jmp ClearRam
|
||||
Reference in New Issue
Block a user