]> git.sur5r.net Git - cc65/commitdiff
Moved the first couple of files from 'geos-cbm' to 'geos-common' which are believed...
authorol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 4 Feb 2012 13:47:31 +0000 (13:47 +0000)
committerol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 4 Feb 2012 13:47:31 +0000 (13:47 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@5435 b7a2c559-68d2-44c3-8de9-860c34a00d81

23 files changed:
libsrc/Makefile
libsrc/geos-cbm/Makefile
libsrc/geos-cbm/dlgbox/Makefile [deleted file]
libsrc/geos-cbm/dlgbox/dbget2lines.s [deleted file]
libsrc/geos-cbm/dlgbox/dlgboxfileselect.s [deleted file]
libsrc/geos-cbm/dlgbox/dlgboxgetstring.s [deleted file]
libsrc/geos-cbm/dlgbox/dlgboxok.s [deleted file]
libsrc/geos-cbm/dlgbox/dlgboxokcancel.s [deleted file]
libsrc/geos-cbm/dlgbox/dlgboxyesno.s [deleted file]
libsrc/geos-cbm/dlgbox/dodlgbox.s [deleted file]
libsrc/geos-cbm/dlgbox/messagebox.c [deleted file]
libsrc/geos-cbm/dlgbox/rstrfrmdialogue.s [deleted file]
libsrc/geos-common/Makefile [new file with mode: 0644]
libsrc/geos-common/dlgbox/Makefile [new file with mode: 0644]
libsrc/geos-common/dlgbox/dbget2lines.s [new file with mode: 0644]
libsrc/geos-common/dlgbox/dlgboxfileselect.s [new file with mode: 0644]
libsrc/geos-common/dlgbox/dlgboxgetstring.s [new file with mode: 0644]
libsrc/geos-common/dlgbox/dlgboxok.s [new file with mode: 0644]
libsrc/geos-common/dlgbox/dlgboxokcancel.s [new file with mode: 0644]
libsrc/geos-common/dlgbox/dlgboxyesno.s [new file with mode: 0644]
libsrc/geos-common/dlgbox/dodlgbox.s [new file with mode: 0644]
libsrc/geos-common/dlgbox/messagebox.c [new file with mode: 0644]
libsrc/geos-common/dlgbox/rstrfrmdialogue.s [new file with mode: 0644]

index a3dbc684daecb53f57d5134001b685e9cc70bd86..79f720eecd6e936d96274041c453b5ae41cfab98 100644 (file)
@@ -16,6 +16,7 @@ LD = ../../src/ld65/ld65
 # List of shared directories
 SHAREDDIRS =   cbm             \
                common          \
+               geos-common     \
                conio           \
                dbg             \
                em              \
@@ -250,7 +251,7 @@ cbm610lib:
 
 .PHONY:        geos-cbmlib
 geos-cbmlib:
-       for i in runtime geos-cbm common conio em joystick tgi zlib; do \
+       for i in runtime geos-cbm geos-common common conio em joystick tgi zlib; do \
            $(MAKE) SYS=geos-cbm -C $$i || exit 1; \
            $(AR) a geos-cbm.lib $$i/*.o || exit 1; \
        done
index 5218045a14ea6ac3dcbb3f5ce10341fa93cfb623..787b55cf7a2c46fc649a81e052e4eea43c5491c2 100644 (file)
@@ -48,7 +48,6 @@ DIRS =        common          \
        conio           \
        devel           \
        disk            \
-       dlgbox          \
        file            \
        graph           \
        menuicon        \
diff --git a/libsrc/geos-cbm/dlgbox/Makefile b/libsrc/geos-cbm/dlgbox/Makefile
deleted file mode 100644 (file)
index 00663c1..0000000
+++ /dev/null
@@ -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
diff --git a/libsrc/geos-cbm/dlgbox/dbget2lines.s b/libsrc/geos-cbm/dlgbox/dbget2lines.s
deleted file mode 100644 (file)
index 6e26b6a..0000000
+++ /dev/null
@@ -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
diff --git a/libsrc/geos-cbm/dlgbox/dlgboxfileselect.s b/libsrc/geos-cbm/dlgbox/dlgboxfileselect.s
deleted file mode 100644 (file)
index 4e34f10..0000000
+++ /dev/null
@@ -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
diff --git a/libsrc/geos-cbm/dlgbox/dlgboxgetstring.s b/libsrc/geos-cbm/dlgbox/dlgboxgetstring.s
deleted file mode 100644 (file)
index 2b45f9f..0000000
+++ /dev/null
@@ -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
diff --git a/libsrc/geos-cbm/dlgbox/dlgboxok.s b/libsrc/geos-cbm/dlgbox/dlgboxok.s
deleted file mode 100644 (file)
index 5d3e5e3..0000000
+++ /dev/null
@@ -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
diff --git a/libsrc/geos-cbm/dlgbox/dlgboxokcancel.s b/libsrc/geos-cbm/dlgbox/dlgboxokcancel.s
deleted file mode 100644 (file)
index 999d037..0000000
+++ /dev/null
@@ -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
diff --git a/libsrc/geos-cbm/dlgbox/dlgboxyesno.s b/libsrc/geos-cbm/dlgbox/dlgboxyesno.s
deleted file mode 100644 (file)
index 2996c0d..0000000
+++ /dev/null
@@ -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
diff --git a/libsrc/geos-cbm/dlgbox/dodlgbox.s b/libsrc/geos-cbm/dlgbox/dodlgbox.s
deleted file mode 100644 (file)
index 77b3b6b..0000000
+++ /dev/null
@@ -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
diff --git a/libsrc/geos-cbm/dlgbox/messagebox.c b/libsrc/geos-cbm/dlgbox/messagebox.c
deleted file mode 100644 (file)
index 4fba157..0000000
+++ /dev/null
@@ -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 );
-}
diff --git a/libsrc/geos-cbm/dlgbox/rstrfrmdialogue.s b/libsrc/geos-cbm/dlgbox/rstrfrmdialogue.s
deleted file mode 100644 (file)
index a676bb4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-;
-; Maciej 'YTM/Alliance' Witkowiak
-;
-; 25.12.99
-
-; char RstrFrmDialogue  (void);
-
-           .export _RstrFrmDialogue
-
-           .include "jumptab.inc"
-       
-_RstrFrmDialogue       = RstrFrmDialogue
diff --git a/libsrc/geos-common/Makefile b/libsrc/geos-common/Makefile
new file mode 100644 (file)
index 0000000..e884c1b
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# makefile for CC65 runtime library
+#
+
+.SUFFIXES: .o .s .c
+
+#--------------------------------------------------------------------------
+# Programs and flags
+
+SYS    = geos-cbm
+
+AS     = ../../src/ca65/ca65
+CC     = ../../src/cc65/cc65
+LD     = ../../src/ld65/ld65
+
+AFLAGS = -t $(SYS) --forget-inc-paths -I../$(SYS) -I../../asminc
+CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
+
+#--------------------------------------------------------------------------
+# Rules
+
+%.o:           %.c
+       @$(CC) -o $(notdir $(*).s) $(CFLAGS) $<
+       @$(AS) -o $@ $(AFLAGS) $(*).s
+
+%.o:   %.s
+       @$(AS) -g -o $@ $(AFLAGS) $<
+
+#--------------------------------------------------------------------------
+# Directories
+
+DIRS = dlgbox
+
+#--------------------------------------------------------------------------
+# Directives
+
+include $(addsuffix /Makefile, $(DIRS))
+vpath %.c $(DIRS)
+vpath %.s $(DIRS)
+
+#--------------------------------------------------------------------------
+# Targets
+
+.PHONY:        all clean zap
+
+all:   $(C_OBJS) $(S_OBJS)
+
+clean:
+       @$(RM) $(C_OBJS:.o=.s) $(C_OBJS) $(S_OBJS)
+
+zap:   clean
diff --git a/libsrc/geos-common/dlgbox/Makefile b/libsrc/geos-common/dlgbox/Makefile
new file mode 100644 (file)
index 0000000..00663c1
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# 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
diff --git a/libsrc/geos-common/dlgbox/dbget2lines.s b/libsrc/geos-common/dlgbox/dbget2lines.s
new file mode 100644 (file)
index 0000000..6e26b6a
--- /dev/null
@@ -0,0 +1,37 @@
+
+;
+; 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
diff --git a/libsrc/geos-common/dlgbox/dlgboxfileselect.s b/libsrc/geos-common/dlgbox/dlgboxfileselect.s
new file mode 100644 (file)
index 0000000..4e34f10
--- /dev/null
@@ -0,0 +1,59 @@
+
+;
+; 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
diff --git a/libsrc/geos-common/dlgbox/dlgboxgetstring.s b/libsrc/geos-common/dlgbox/dlgboxgetstring.s
new file mode 100644 (file)
index 0000000..2b45f9f
--- /dev/null
@@ -0,0 +1,39 @@
+
+;
+; 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
diff --git a/libsrc/geos-common/dlgbox/dlgboxok.s b/libsrc/geos-common/dlgbox/dlgboxok.s
new file mode 100644 (file)
index 0000000..5d3e5e3
--- /dev/null
@@ -0,0 +1,31 @@
+
+;
+; 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
diff --git a/libsrc/geos-common/dlgbox/dlgboxokcancel.s b/libsrc/geos-common/dlgbox/dlgboxokcancel.s
new file mode 100644 (file)
index 0000000..999d037
--- /dev/null
@@ -0,0 +1,32 @@
+
+;
+; 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
diff --git a/libsrc/geos-common/dlgbox/dlgboxyesno.s b/libsrc/geos-common/dlgbox/dlgboxyesno.s
new file mode 100644 (file)
index 0000000..2996c0d
--- /dev/null
@@ -0,0 +1,32 @@
+
+;
+; 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
diff --git a/libsrc/geos-common/dlgbox/dodlgbox.s b/libsrc/geos-common/dlgbox/dodlgbox.s
new file mode 100644 (file)
index 0000000..77b3b6b
--- /dev/null
@@ -0,0 +1,20 @@
+
+;
+; 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
diff --git a/libsrc/geos-common/dlgbox/messagebox.c b/libsrc/geos-common/dlgbox/messagebox.c
new file mode 100644 (file)
index 0000000..4fba157
--- /dev/null
@@ -0,0 +1,85 @@
+
+/*
+ * 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 );
+}
diff --git a/libsrc/geos-common/dlgbox/rstrfrmdialogue.s b/libsrc/geos-common/dlgbox/rstrfrmdialogue.s
new file mode 100644 (file)
index 0000000..a676bb4
--- /dev/null
@@ -0,0 +1,13 @@
+
+;
+; Maciej 'YTM/Alliance' Witkowiak
+;
+; 25.12.99
+
+; char RstrFrmDialogue  (void);
+
+           .export _RstrFrmDialogue
+
+           .include "jumptab.inc"
+       
+_RstrFrmDialogue       = RstrFrmDialogue