move testcode/grc to samples/geos

This commit is contained in:
mrdudz
2020-09-29 19:08:40 +02:00
parent bbece736f5
commit 3d8e787e66
6 changed files with 0 additions and 0 deletions

View File

@@ -1,52 +0,0 @@
# Just the usual way to find out if we're
# using cmd.exe to execute make rules.
ifneq ($(shell echo),)
CMD_EXE = 1
endif
ifdef CMD_EXE
NULLDEV = nul:
DEL = -del /f
RMDIR = rmdir /s /q
else
NULLDEV = /dev/null
DEL = $(RM)
RMDIR = $(RM) -r
endif
ifdef CC65_HOME
AS = $(CC65_HOME)/bin/ca65
CC = $(CC65_HOME)/bin/cc65
CL = $(CC65_HOME)/bin/cl65
LD = $(CC65_HOME)/bin/ld65
GRC = $(CC65_HOME)/bin/grc65
else
AS := $(if $(wildcard ../../../bin/ca65*),../../../bin/ca65,ca65)
CC := $(if $(wildcard ../../../bin/cc65*),../../../bin/cc65,cc65)
CL := $(if $(wildcard ../../../bin/cl65*),../../../bin/cl65,cl65)
LD := $(if $(wildcard ../../../bin/ld65*),../../../bin/ld65,ld65)
GRC := $(if $(wildcard ../../../bin/grc65*),../../../bin/grc65,grc65)
endif
all: test.s vlir.cvt
test.s: test.grc
$(GRC) -s test.s test.grc
vlir.cvt: vlir.grc vlir0.s vlir1.s vlir2.s
# using seperate calls here for demonstration purposes:
$(GRC) -t geos-cbm -s vlir.s vlir.grc
$(AS) -t geos-cbm vlir.s
$(AS) -t geos-cbm vlir0.s
$(AS) -t geos-cbm vlir1.s
$(AS) -t geos-cbm vlir2.s
$(LD) -t geos-cbm -o vlir.cvt vlir.o vlir0.o vlir1.o vlir2.o geos-cbm.lib
# you can also do the above in one command:
# $(CL) -t geos-cbm -o vlir.cvt vlir.grc vlir0.s vlir1.s vlir2.s
clean:
$(RM) test.s test.h
$(RM) vlir.s vlir.cvt vlir.c vlir.h
$(RM) *.o

View File

@@ -1,35 +0,0 @@
; This is the proposed syntax of a general GEOS resource file for the upcoming resource compiler.
; token MENU, topname (will be escaped with _), x,y of top-left corner, bottom-right will be
; counted according to BSW font table (in x) and a multiply 15 (14?) in y
; Note that MENU is either MENU and SUBMENU
; Note that if you want to use any C operators (like '|', '&' etc.) do it WITHOUT spaces
; between arguments (parser is simple and weak)
; format: MENU "name" left,top ALIGN { "itemname" TYPE pointer ... }
MENU subMenu1 15,0 VERTICAL
{
"subitem1" MENU_ACTION smenu1
"mubitem2" MENU_ACTION|DYN_SUB_MENU smenu2
"subitem3" MENU_ACTION smenu3
}
MENU mainMenu 0,0 HORIZONTAL
{
"sub menu1" SUB_MENU subMenu1 ; goes for _subMenu1
"quit" MENU_ACTION EnterDeskTop ; goes for _EnterDeskTop
}
; format: HEADER GEOS_TYPE "dosname" "classname" "version"
HEADER APPLICATION "123456789 1234567" "Class Name" "V1.0.0"
{
; not all fields are required, default and current values will be used
author "Maciej Witkowiak" ; always in quotes!
info "Information text" ; always in quotes!
; date yy mm dd hh ss ; always 5 fields!
; dostype seq ; can be PRG, SEQ, USR
mode c64only ; can be any, 40only, 80only, c64only
}

View File

@@ -1,12 +0,0 @@
HEADER APPLICATION "test" "TestApp" "V1.0" {
structure VLIR
dostype USR
author "Maciej Witkowiak"
info "This is just an example."
}
MEMORY {
stacksize 0x0000
overlaysize 0x1000
overlaynums 0 1 2
}

View File

@@ -1,78 +0,0 @@
; Maciej 'YTM/Elysium' Witkowiak
; 06.06.2002
; This is the source for the main VLIR-structured program part
; include some GEOS defines
.include "../../libsrc/geos-common/const.inc"
.include "../../libsrc/geos-cbm/jumptab.inc"
.include "../../libsrc/geos-cbm/geossym.inc"
.include "../../libsrc/geos-common/geosmac.inc"
; import load addresses for all VLIR chains
; these labels are defined upon linking with ld65
.import __OVERLAYADDR__
.import __OVERLAYSIZE__
; import names of functions defined (and exported) in each VLIR part
; of your application
; here I used an OVERLAYx_ prefix to prevent name clashes
.import OVERLAY1_Function1
.import OVERLAY2_Function1
; segments "STARTUP", "CODE", "DATA", "RODATA" and "BSS" all go to VLIR0 chain
.segment "STARTUP"
; code segment for VLIR 0 chain
ProgExec:
LoadW r0, paramString ; show something
jsr DoDlgBox
MoveW dirEntryBuf+OFF_DE_TR_SC, r1
LoadW r4, fileHeader
jsr GetBlock ; load back VLIR t&s table
bnex error
lda #1
jsr PointRecord ; we want next module (#1)
LoadW r2, __OVERLAYSIZE__ ; length - as many bytes as we have room for
LoadW r7, __OVERLAYADDR__ ; all VLIR segments have the same load address
jsr ReadRecord ; load it
bnex error
jsr OVERLAY1_Function1 ; execute something
lda #2
jsr PointRecord ; next module
LoadW r2, __OVERLAYSIZE__
LoadW r7, __OVERLAYADDR__
jsr ReadRecord ; load it
bnex error
jsr OVERLAY2_Function1 ; execute something
error: jmp EnterDeskTop ; end of application
.segment "RODATA"
; read-only data segment
paramString:
.byte DEF_DB_POS | 1
.byte DBTXTSTR, TXT_LN_X, TXT_LN_2_Y
.word line1
.byte DBTXTSTR, TXT_LN_X, TXT_LN_3_Y
.word line2
.byte OK, DBI_X_0, DBI_Y_2
.byte NULL
line1: .byte BOLDON, "Hello World!",0
line2: .byte OUTLINEON,"Hello",PLAINTEXT," world!",0
.segment "DATA"
; read/write initialized data segment
counter: .word 0
.segment "BSS"
; read/write uninitialized data segment
; this space doesn't go into output file, only its size and
; position is remembered

View File

@@ -1,45 +0,0 @@
; Maciej 'YTM/Elysium' Witkowiak
; 06.06.2002
; This is the source for the loadable VLIR-structured program part
; include some GEOS defines
.include "../../libsrc/geos-common/const.inc"
.include "../../libsrc/geos-cbm/jumptab.inc"
.include "../../libsrc/geos-cbm/geossym.inc"
.include "../../libsrc/geos-common/geosmac.inc"
; export names of functions that will be used in the main program
.export OVERLAY1_Function1
.export OVERLAY1_Function2
; go into OVERLAY1 segment - everything that is here will go into
; VLIR chain #1
.segment "OVERLAY1"
OVERLAY1_Function1: jmp Function1 ; jump table, not really necessary
OVERLAY1_Function2: jmp Function2
; etc.
; rodata - if this is defined in .segment "RODATA"
; it will end up in the VLIR0 part, you don't want that
paramString:
.byte DEF_DB_POS | 1
.byte DBTXTSTR, TXT_LN_X, TXT_LN_2_Y
.word line1
.byte DBTXTSTR, TXT_LN_X, TXT_LN_3_Y
.word line2
.byte OK, DBI_X_0, DBI_Y_2
.byte NULL
line1: .byte "This is in module 1",0
line2: .byte "This is in module 1",0
; code
Function1: LoadW r0, paramString
jsr DoDlgBox
Function2: rts

View File

@@ -1,36 +0,0 @@
; Maciej 'YTM/Elysium' Witkowiak
; 06.06.2002
; This is the source for the loadable VLIR-structured program part
; similar to vlir1.s except the fact that this is chain #2
.include "../../libsrc/geos-common/const.inc"
.include "../../libsrc/geos-cbm/jumptab.inc"
.include "../../libsrc/geos-cbm/geossym.inc"
.include "../../libsrc/geos-common/geosmac.inc"
.export OVERLAY2_Function1
.export OVERLAY2_Function2
.segment "OVERLAY2"
OVERLAY2_Function1: jmp Function1
OVERLAY2_Function2: jmp Function2
; etc.
paramString:
.byte DEF_DB_POS | 1
.byte DBTXTSTR, TXT_LN_X, TXT_LN_2_Y
.word line1
.byte DBTXTSTR, TXT_LN_X, TXT_LN_3_Y
.word line2
.byte OK, DBI_X_0, DBI_Y_2
.byte NULL
Function2: LoadW r0, paramString
jsr DoDlgBox
Function1: rts
line1: .byte "This is in module 2",0
line2: .byte "This is in module 2",0