# List of shared directories
SHAREDDIRS = cbm \
common \
+ geos-common \
conio \
dbg \
em \
.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
conio \
devel \
disk \
- dlgbox \
file \
graph \
menuicon \
+++ /dev/null
-#
-# 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
+++ /dev/null
-
-;
-; 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
+++ /dev/null
-
-;
-; 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
+++ /dev/null
-
-;
-; 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
+++ /dev/null
-
-;
-; 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
+++ /dev/null
-
-;
-; 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
+++ /dev/null
-
-;
-; 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
+++ /dev/null
-
-;
-; 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
+++ /dev/null
-
-/*
- * 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 );
-}
+++ /dev/null
-
-;
-; Maciej 'YTM/Alliance' Witkowiak
-;
-; 25.12.99
-
-; char RstrFrmDialogue (void);
-
- .export _RstrFrmDialogue
-
- .include "jumptab.inc"
-
-_RstrFrmDialogue = RstrFrmDialogue
--- /dev/null
+#
+# 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
--- /dev/null
+#
+# 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
--- /dev/null
+
+;
+; 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
--- /dev/null
+
+;
+; 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
--- /dev/null
+
+;
+; 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
--- /dev/null
+
+;
+; 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
--- /dev/null
+
+;
+; 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
--- /dev/null
+
+;
+; 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
--- /dev/null
+
+;
+; 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
--- /dev/null
+
+/*
+ * 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 );
+}
--- /dev/null
+
+;
+; Maciej 'YTM/Alliance' Witkowiak
+;
+; 25.12.99
+
+; char RstrFrmDialogue (void);
+
+ .export _RstrFrmDialogue
+
+ .include "jumptab.inc"
+
+_RstrFrmDialogue = RstrFrmDialogue