Moved the first couple of 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@5435 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
ol.sc
2012-02-04 13:47:31 +00:00
parent d5fa3e3153
commit 2bf9cd2ee1
13 changed files with 53 additions and 2 deletions

View File

@@ -48,7 +48,6 @@ DIRS = common \
conio \
devel \
disk \
dlgbox \
file \
graph \
menuicon \

View File

@@ -1,17 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
C_OBJS += messagebox.o
S_OBJS += dodlgbox.o \
rstrfrmdialogue.o \
dbget2lines.o \
dlgboxyesno.o \
dlgboxokcancel.o \
dlgboxok.o \
dlgboxgetstring.o \
dlgboxfileselect.o

View File

@@ -1,37 +0,0 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; 25.12.99
.export DB_get2lines
.importzp ptr3,ptr4
.import popax
.code
DB_get2lines:
sta ptr4 ; fetch line 2
stx ptr4+1
jsr popax
sta ptr3 ; fetch line 1
stx ptr3+1
ldx #ptr3
jsr checknull
ldx #ptr4
jmp checknull
checknull:
lda $0,x
ora $1,x
bne cn_end
lda #<nullstring
sta $0,x
lda #>nullstring
sta $1,x
cn_end: rts
.rodata
nullstring:
.byte 0

View File

@@ -1,59 +0,0 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; 25.12.99
; char DlgBoxFileSelect (char *class, char ftype, char *fname);
.export _DlgBoxFileSelect
.import popa, popax
.import _DoDlgBox
.include "jumptab.inc"
.include "geossym.inc"
.include "const.inc"
.include "geosmac.ca65.inc"
.code
_DlgBoxFileSelect:
sta tmp_r5
stx tmp_r5+1
jsr popa
sta tmp_r7L
jsr popax
sta tmp_r10
stx tmp_r10+1
DB_FS_reload:
MoveW tmp_r5, r5
MoveW tmp_r10, r10
MoveB tmp_r7L, r7L
lda #<paramStrFileSelect
ldx #>paramStrFileSelect
jsr _DoDlgBox
cmp #DISK
bne DB_FS_Fin
jsr OpenDisk
txa
beq DB_FS_reload
DB_FS_Fin: rts
.rodata
paramStrFileSelect:
.byte DEF_DB_POS | 1
.byte DBGETFILES, 4, 4
.byte OPEN, DBI_X_2, DBI_Y_0+16
.byte DISK, DBI_X_2, DBI_Y_0+32+1
.byte CANCEL, DBI_X_2, DBI_Y_0+64+3
.byte NULL
.bss
tmp_r5: .res 2
tmp_r7L: .res 1
tmp_r10: .res 2

View File

@@ -1,39 +0,0 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; 25.12.99
; char DlgBoxGetString (char *string, char strlen, char *line1,char *line2);
.export _DlgBoxGetString
.import DB_get2lines, _DoDlgBox
.importzp ptr2, ptr3, ptr4
.import popa, popax
.include "geossym.inc"
.include "const.inc"
.code
_DlgBoxGetString:
jsr DB_get2lines
jsr popa
sta DB_strlen
jsr popax
sta ptr2
stx ptr2+1
lda #<paramStrGetString
ldx #>paramStrGetString
jmp _DoDlgBox
.data
paramStrGetString:
.byte DEF_DB_POS | 1
.byte DBVARSTR, TXT_LN_X, TXT_LN_1_Y, ptr3
.byte DBVARSTR, TXT_LN_X, TXT_LN_2_Y, ptr4
.byte DBGETSTRING, TXT_LN_X, TXT_LN_3_Y, ptr2
DB_strlen: .byte 17
.byte CANCEL, DBI_X_2, DBI_Y_2
.byte NULL

View File

@@ -1,31 +0,0 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; 25.12.99
; char DlgBoxOk (char *line1,char *line2);
.export _DlgBoxOk
.import DB_get2lines, _DoDlgBox
.importzp ptr3, ptr4
.include "geossym.inc"
.include "const.inc"
.code
_DlgBoxOk:
jsr DB_get2lines
lda #<paramStrOk
ldx #>paramStrOk
jmp _DoDlgBox
.rodata
paramStrOk:
.byte DEF_DB_POS | 1
.byte DBVARSTR, TXT_LN_X, TXT_LN_2_Y, ptr3
.byte DBVARSTR, TXT_LN_X, TXT_LN_3_Y, ptr4
.byte OK, DBI_X_0, DBI_Y_2
.byte NULL

View File

@@ -1,32 +0,0 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; 25.12.99
; char DlgBoxOkCancel (char *line1,char *line2);
.export _DlgBoxOkCancel
.import DB_get2lines, _DoDlgBox
.importzp ptr3, ptr4
.include "geossym.inc"
.include "const.inc"
.code
_DlgBoxOkCancel:
jsr DB_get2lines
lda #<paramStrOkCancel
ldx #>paramStrOkCancel
jmp _DoDlgBox
.rodata
paramStrOkCancel:
.byte DEF_DB_POS | 1
.byte DBVARSTR, TXT_LN_X, TXT_LN_2_Y, ptr3
.byte DBVARSTR, TXT_LN_X, TXT_LN_3_Y, ptr4
.byte OK, DBI_X_0, DBI_Y_2
.byte CANCEL, DBI_X_2, DBI_Y_2
.byte NULL

View File

@@ -1,32 +0,0 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; 25.12.99
; char DlgBoxYesNo (char *line1,char *line2);
.export _DlgBoxYesNo
.import DB_get2lines, _DoDlgBox
.importzp ptr3, ptr4
.include "geossym.inc"
.include "const.inc"
.code
_DlgBoxYesNo:
jsr DB_get2lines
lda #<paramStrYesNo
ldx #>paramStrYesNo
jmp _DoDlgBox
.rodata
paramStrYesNo:
.byte DEF_DB_POS | 1
.byte DBVARSTR, TXT_LN_X, TXT_LN_2_Y, ptr3
.byte DBVARSTR, TXT_LN_X, TXT_LN_3_Y, ptr4
.byte YES, DBI_X_0, DBI_Y_2
.byte NO, DBI_X_2, DBI_Y_2
.byte NULL

View File

@@ -1,20 +0,0 @@
;
; Maciej 'YTM/Elysium' Witkowiak
;
; 25.12.1999, 2.1.2003
; char DoDlgBox (char *myParamString);
.export _DoDlgBox
.include "jumptab.inc"
.include "geossym.inc"
_DoDlgBox:
sta r0L
stx r0H
jsr DoDlgBox
ldx #0
lda r0L
rts

View File

@@ -1,85 +0,0 @@
/*
* char MessageBox (char mode, const char *format, ...)
*
* Maciej 'YTM/Elysium' Witkowiak, 17.08.2003
*
*/
#include <geos.h>
#include <stdio.h>
void _mbprintout(void);
static dlgBoxStr _mbdlg_EMPTY = {
DB_DEFPOS(1),
DB_OPVEC(&RstrFrmDialogue),
DB_USRROUT(&_mbprintout),
DB_END,
};
static dlgBoxStr _mbdlg_OK = {
DB_DEFPOS(1),
DB_USRROUT(&_mbprintout),
DB_ICON(OK, DBI_X_1, DBI_Y_2),
DB_END,
};
static dlgBoxStr _mbdlg_OKCANCEL = {
DB_DEFPOS(1),
DB_USRROUT(&_mbprintout),
DB_ICON(OK, DBI_X_0, DBI_Y_2),
DB_ICON(CANCEL, DBI_X_2, DBI_Y_2),
DB_END,
};
static dlgBoxStr _mbdlg_YESNO = {
DB_DEFPOS(1),
DB_USRROUT(&_mbprintout),
DB_ICON(YES, DBI_X_0, DBI_Y_2),
DB_ICON(NO, DBI_X_2, DBI_Y_2),
DB_END,
};
static dlgBoxStr *_mbboxes[] = {
&_mbdlg_EMPTY,
&_mbdlg_OK,
&_mbdlg_OKCANCEL,
&_mbdlg_YESNO
};
static char _mbbuffer[256];
char MessageBox(char mode, const char *format, ...)
{
register char *buf;
va_list ap;
/* first format out things */
va_start(ap, format);
vsprintf(_mbbuffer, format, ap);
va_end(ap);
/* replace LFs by CRs */
buf = &_mbbuffer[0];
while (*buf) {
if (*buf==LF) *buf=CR;
++buf;
}
/* validate mode */
if (mode>=MB_LAST)
mode = MB_EMPTY;
return DoDlgBox(_mbboxes[mode]);
}
void _mbprintout(void)
{
UseSystemFont();
curWindow.top = DEF_DB_TOP;
curWindow.left = DEF_DB_LEFT+10;
curWindow.right = DEF_DB_RIGHT-10;
curWindow.bot = DEF_DB_BOT;
PutString(_mbbuffer, DEF_DB_TOP+10+curFontDesc.height, DEF_DB_LEFT+10 );
}

View File

@@ -1,13 +0,0 @@
;
; Maciej 'YTM/Alliance' Witkowiak
;
; 25.12.99
; char RstrFrmDialogue (void);
.export _RstrFrmDialogue
.include "jumptab.inc"
_RstrFrmDialogue = RstrFrmDialogue