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:
ol.sc
2012-02-04 22:17:46 +00:00
parent 8a06174cb4
commit 5f4129f14d
13 changed files with 3 additions and 3 deletions

View 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

View 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);
}

View 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);
}
}

View 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);
}

View 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

View 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

View 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

View 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

View 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);
}
}

View 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;
}

View 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