From: ol.sc Date: Sat, 4 Feb 2012 22:17:46 +0000 (+0000) Subject: Moved the 'common' files from 'geos-cbm' to 'geos-common' which are believed to work... X-Git-Tag: V2.13.3~16 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5f4129f14d24b33c44d7cec84c87c1e9900f1578;p=cc65 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 --- diff --git a/libsrc/geos-cbm/Makefile b/libsrc/geos-cbm/Makefile index 1c37df814..628990591 100644 --- a/libsrc/geos-cbm/Makefile +++ b/libsrc/geos-cbm/Makefile @@ -44,8 +44,7 @@ CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include #-------------------------------------------------------------------------- # Directories -DIRS = common \ - conio \ +DIRS = conio \ devel \ disk \ file \ diff --git a/libsrc/geos-cbm/common/Makefile b/libsrc/geos-cbm/common/Makefile deleted file mode 100644 index eeb88ff12..000000000 --- a/libsrc/geos-cbm/common/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# -# 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 diff --git a/libsrc/geos-cbm/common/_afailed.c b/libsrc/geos-cbm/common/_afailed.c deleted file mode 100644 index 10da48d0e..000000000 --- a/libsrc/geos-cbm/common/_afailed.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * _afailed.c - * - * Maciej 'YTM/Elysium' Witkowiak 28.10.2001 - */ - -#include -#include -#include - -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); -} diff --git a/libsrc/geos-cbm/common/_poserror.c b/libsrc/geos-cbm/common/_poserror.c deleted file mode 100644 index 0dc6f99d8..000000000 --- a/libsrc/geos-cbm/common/_poserror.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * _poserror.c - * - * Maciej 'YTM/Elysium' Witkowiak, 25.04.2003 - */ - -#include -#include -#include -#include - -void __fastcall__ _poserror (const char* msg) -{ - const char *errmsg = _stroserror(_oserror); - - ExitTurbo(); - if (msg && *msg) { - DlgBoxOk(msg, errmsg); - } else { - DlgBoxOk("", errmsg); - } -} diff --git a/libsrc/geos-cbm/common/abort.c b/libsrc/geos-cbm/common/abort.c deleted file mode 100644 index 3db62f03b..000000000 --- a/libsrc/geos-cbm/common/abort.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * abort.c - * - * Maciej 'YTM/Elysium' Witkowiak 15.7.2001 - */ - - - -#include -#include - -void abort (void) -{ - ExitTurbo(); - DlgBoxOk(CBOLDON "ABNORMAL PROGRAM", "TERMINATION." CPLAINTEXT); - exit(3); -} diff --git a/libsrc/geos-cbm/common/copydata.s b/libsrc/geos-cbm/common/copydata.s deleted file mode 100644 index 26e2cef10..000000000 --- a/libsrc/geos-cbm/common/copydata.s +++ /dev/null @@ -1,27 +0,0 @@ -; -; 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 diff --git a/libsrc/geos-cbm/common/memcpy.s b/libsrc/geos-cbm/common/memcpy.s deleted file mode 100644 index 54fb96372..000000000 --- a/libsrc/geos-cbm/common/memcpy.s +++ /dev/null @@ -1,10 +0,0 @@ -; -; void* __fastcall__ memcpy (void* dest, const void* src, size_t n); -; -; Maciej 'YTM/Elysium' Witkowiak, 15.07.2001 -; - - .export _memcpy - .import _MoveData - -_memcpy = _MoveData diff --git a/libsrc/geos-cbm/common/memmove.s b/libsrc/geos-cbm/common/memmove.s deleted file mode 100644 index dad3d8453..000000000 --- a/libsrc/geos-cbm/common/memmove.s +++ /dev/null @@ -1,10 +0,0 @@ -; -; void* __fastcall__ memmove (void* dest, const void* src, size_t n); -; -; Maciej 'YTM/Elysium' Witkowiak, 15.07.2001 -; - - .export _memmove - .import _MoveData - -_memmove = _MoveData diff --git a/libsrc/geos-cbm/common/memset.s b/libsrc/geos-cbm/common/memset.s deleted file mode 100644 index 77d830f6e..000000000 --- a/libsrc/geos-cbm/common/memset.s +++ /dev/null @@ -1,14 +0,0 @@ -; -; 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 diff --git a/libsrc/geos-cbm/common/perror.c b/libsrc/geos-cbm/common/perror.c deleted file mode 100644 index 6b3ed3c64..000000000 --- a/libsrc/geos-cbm/common/perror.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * perror.c - * - * Maciej 'YTM/Elysium' Witkowiak, 15.07.2001 - */ - -#include -#include -#include -#include - -void __fastcall__ perror(const char* msg) -{ - const char *errmsg = strerror(errno); - - ExitTurbo(); - if (msg && *msg) { - DlgBoxOk(msg, errmsg); - } else { - DlgBoxOk("", errmsg); - } -} diff --git a/libsrc/geos-cbm/common/sleep.c b/libsrc/geos-cbm/common/sleep.c deleted file mode 100644 index b1b3750c1..000000000 --- a/libsrc/geos-cbm/common/sleep.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * sleep.c - * - * Maciej 'YTM/Elysium' Witkowiak, 16.08.2003 - * - */ - -#include - -unsigned __fastcall__ sleep (unsigned wait) -{ - char typ; - - if ( (get_tv()) & TV_NTSC ) { - typ = 60; - } else { - typ = 50; - } - - Sleep(wait*typ); - - return 0; -} diff --git a/libsrc/geos-cbm/common/zerobss.s b/libsrc/geos-cbm/common/zerobss.s deleted file mode 100644 index 6b5bcdfa4..000000000 --- a/libsrc/geos-cbm/common/zerobss.s +++ /dev/null @@ -1,25 +0,0 @@ -; -; Maciej 'YTM/Elysium' Witkowiak -; 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 diff --git a/libsrc/geos-common/Makefile b/libsrc/geos-common/Makefile index 2f01b87cd..3a2bfbd60 100644 --- a/libsrc/geos-common/Makefile +++ b/libsrc/geos-common/Makefile @@ -29,7 +29,8 @@ CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include #-------------------------------------------------------------------------- # Directories -DIRS = dlgbox \ +DIRS = common \ + dlgbox \ disk \ file \ graph \ diff --git a/libsrc/geos-common/common/Makefile b/libsrc/geos-common/common/Makefile new file mode 100644 index 000000000..eeb88ff12 --- /dev/null +++ b/libsrc/geos-common/common/Makefile @@ -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 diff --git a/libsrc/geos-common/common/_afailed.c b/libsrc/geos-common/common/_afailed.c new file mode 100644 index 000000000..10da48d0e --- /dev/null +++ b/libsrc/geos-common/common/_afailed.c @@ -0,0 +1,33 @@ +/* + * _afailed.c + * + * Maciej 'YTM/Elysium' Witkowiak 28.10.2001 + */ + +#include +#include +#include + +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); +} diff --git a/libsrc/geos-common/common/_poserror.c b/libsrc/geos-common/common/_poserror.c new file mode 100644 index 000000000..0dc6f99d8 --- /dev/null +++ b/libsrc/geos-common/common/_poserror.c @@ -0,0 +1,22 @@ +/* + * _poserror.c + * + * Maciej 'YTM/Elysium' Witkowiak, 25.04.2003 + */ + +#include +#include +#include +#include + +void __fastcall__ _poserror (const char* msg) +{ + const char *errmsg = _stroserror(_oserror); + + ExitTurbo(); + if (msg && *msg) { + DlgBoxOk(msg, errmsg); + } else { + DlgBoxOk("", errmsg); + } +} diff --git a/libsrc/geos-common/common/abort.c b/libsrc/geos-common/common/abort.c new file mode 100644 index 000000000..3db62f03b --- /dev/null +++ b/libsrc/geos-common/common/abort.c @@ -0,0 +1,17 @@ +/* + * abort.c + * + * Maciej 'YTM/Elysium' Witkowiak 15.7.2001 + */ + + + +#include +#include + +void abort (void) +{ + ExitTurbo(); + DlgBoxOk(CBOLDON "ABNORMAL PROGRAM", "TERMINATION." CPLAINTEXT); + exit(3); +} diff --git a/libsrc/geos-common/common/copydata.s b/libsrc/geos-common/common/copydata.s new file mode 100644 index 000000000..26e2cef10 --- /dev/null +++ b/libsrc/geos-common/common/copydata.s @@ -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 diff --git a/libsrc/geos-common/common/memcpy.s b/libsrc/geos-common/common/memcpy.s new file mode 100644 index 000000000..54fb96372 --- /dev/null +++ b/libsrc/geos-common/common/memcpy.s @@ -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 diff --git a/libsrc/geos-common/common/memmove.s b/libsrc/geos-common/common/memmove.s new file mode 100644 index 000000000..dad3d8453 --- /dev/null +++ b/libsrc/geos-common/common/memmove.s @@ -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 diff --git a/libsrc/geos-common/common/memset.s b/libsrc/geos-common/common/memset.s new file mode 100644 index 000000000..77d830f6e --- /dev/null +++ b/libsrc/geos-common/common/memset.s @@ -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 diff --git a/libsrc/geos-common/common/perror.c b/libsrc/geos-common/common/perror.c new file mode 100644 index 000000000..6b3ed3c64 --- /dev/null +++ b/libsrc/geos-common/common/perror.c @@ -0,0 +1,22 @@ +/* + * perror.c + * + * Maciej 'YTM/Elysium' Witkowiak, 15.07.2001 + */ + +#include +#include +#include +#include + +void __fastcall__ perror(const char* msg) +{ + const char *errmsg = strerror(errno); + + ExitTurbo(); + if (msg && *msg) { + DlgBoxOk(msg, errmsg); + } else { + DlgBoxOk("", errmsg); + } +} diff --git a/libsrc/geos-common/common/sleep.c b/libsrc/geos-common/common/sleep.c new file mode 100644 index 000000000..b1b3750c1 --- /dev/null +++ b/libsrc/geos-common/common/sleep.c @@ -0,0 +1,23 @@ +/* + * sleep.c + * + * Maciej 'YTM/Elysium' Witkowiak, 16.08.2003 + * + */ + +#include + +unsigned __fastcall__ sleep (unsigned wait) +{ + char typ; + + if ( (get_tv()) & TV_NTSC ) { + typ = 60; + } else { + typ = 50; + } + + Sleep(wait*typ); + + return 0; +} diff --git a/libsrc/geos-common/common/zerobss.s b/libsrc/geos-common/common/zerobss.s new file mode 100644 index 000000000..6b5bcdfa4 --- /dev/null +++ b/libsrc/geos-common/common/zerobss.s @@ -0,0 +1,25 @@ +; +; Maciej 'YTM/Elysium' Witkowiak +; 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