Commit 807f7234 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Changed to use shared TboxMake makefile.

Removed local duplication of string32 and rmensure, since the common library has these in.
Rename TextGadget.c to main.c to fall into line with the "o.mainROM" rule.
Compiles, but not tested.

Version 0.33. Tagged as 'Gadgets-0_33'
parent 62cdc19f
......@@ -13,5 +13,5 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine clean
amu_machine clean COMPONENT=TextGadget
stripdepnd Makefile
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine THROWBACK=-throwback all
amu_machine all COMPONENT=TextGadget
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine rom
amu_machine rom COMPONENT=TextGadget
......@@ -12,205 +12,43 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for TextGadget
# Makefile for a Toolbox Object module
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 12/05/97 RLougher Created
# 04/06/98 SBrodie Added RAM build into same Makefile
# $Id$
#
# Component specific options:
#
COMPONENT = TextGadget
ROM_MODULE = aof.${COMPONENT}
RAM_MODULE = rm.${COMPONENT}
RAMBOTH =
#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources2.${COMPONENT}
COMMON_OBJ = o.ModHdr o.glib o.glib3 o.MemMan o.riscos_uti o.Scrollbar \
o.ScrollList o.Sizes o.TextArea o.TextMan \
o.Font o.riscos_gra o.ScrollLisS o.TAsel_ven o.Text o.Utils
EXP_HDR = <export$dir>.^.Interface2
EXP_C_H = <Cexport$dir>.h
EXP_C_O = <Cexport$dir>.o
ROM_OBJS = o.mainROM ${COMMON_OBJ}
#
# Generic options
#
RAM_OBJS = o.main ${RAMBOTH} ${COMMON_OBJ}
MKDIR = do mkdir -p
AS = objasm
CC = cc
CMHG = cmhg
CP = copy
LD = link
RM = remove
WIPE = x wipe
CD = dir
CHMOD = access
DBG_OBJS = od.main ${RAMBOTH} od.ModHdr od.glib od.glib3 od.MemMan od.riscos_uti od.Scrollbar \
od.ScrollList od.Sizes od.TextArea od.TextMan \
od.Font od.riscos_gra od.ScrollLisS od.TAsel_ven od.Text od.Utils
#FEATURES = -zM -zps1 -g ${DFLAGS}
FEATURES = -zM -zps1 -ffah ${DFLAGS}
AFLAGS = ${THROWBACK} -depend !Depend
CFLAGS = ${THROWBACK} -depend !Depend -c ${FEATURES} ${INCLUDES}
CMHGFLAGS = ${THROWBACK} -depend !Depend -p ${DFLAGS}
CPFLAGS = ~cfr~v
WFLAGS = ~c~vr
CHMODFLAGS = RW/R
EXTRARAMLIBS = c:tboxlibs.o.wimplib c:tboxlibs.o.toolboxlib
DFLAGS = -D${SYSTEM}_BUILD #-DUSE_TINY ${DEBUG}
EXTRAROMLIBS = c:tboxlibs.o.wimplib c:tboxlibs.o.toolboxlib
INCLUDES = -IC:tboxlibint,tbox:,C:
# ------------------------------------------------------------------------------
# Libraries
#
ANSILIB = CLib:o.ansilib
CLIB = CLIB:o.stubs
RLIB = RISCOSLIB:o.risc_oslib
ROMCSTUBS = RISCOSLIB:o.romcstubs
TBOXLIB = c:tboxlibs.o.toolboxlib
WIMPLIB = c:tboxlibs.o.wimplib
RSTUBS = RISCOSLIB:o.rstubs
ROMSTUBS = RISCOSLIB:o.romstubs
REMOTEDB = <Lib$Dir>.debug.o.remotezm
# Which is correct? sbrodie 19/06/1998. Daytona uses AbsSym, Spinner/Trunk uses c_abssym
ABSSYM = RISC_OSLib:o.c_abssym
# ABSSYM = RISC_OSLib:o.AbsSym
OBJS =\
o.Modhdr \
o.TextGadget \
o.TextArea \
o.ScrollList \
o.Scrollbar \
o.riscos_uti \
o.riscos_gra \
o.Font \
o.TextMan \
o.MemMan \
o.Text \
o.ScrollLisS \
o.Utils \
o.TAsel_ven \
o.glib \
o.glib3 \
o.rmensure \
o.Sizes \
o.string32
RAM_OBJS =\
o.Modhdr \
o.TextGadget \
o.TextArea \
o.ScrollList \
o.Scrollbar \
o.riscos_uti \
o.riscos_gra \
o.Font \
o.TextMan \
o.MemMan \
o.Text \
o.ScrollLisS \
o.Utils \
o.TAsel_ven \
o.glib \
o.glib3 \
o.rmensure \
o.Sizes \
o.string32
# ------------------------------------------------------------------------------
HDR = h.ModHdr
# ------------------------------------------------------------------------------
# Rule patterns
# Get main rules
#
include C:tboxlibint.TboxMake
.SUFFIXES: .o .h .s .c .cmhg
.c.o:; @echo
@echo Compiling $< ( ${FEATURES})
@${CC} ${CFLAGS} -o $@ $<
.cmhg.o:; @echo
@echo Generating module C veneers ( -p ${DFLAGS})
@${CMHG} ${CMHGFLAGS} $< -o $@
.cmhg.h:; @echo
@echo Generating module C veneers' header file ( -p ${DFLAGS})
@${CMHG} ${CMHGFLAGS} $< -d $@
.s.o:; @echo
@echo Assembling $<
@${AS} ${AFLAGS} -o $@ $<
all: ${RAM_MODULE}
@echo
@echo ${COMPONENT}: Module built (RAM) in ${RAM_MODULE}
rom: ${ROM_MODULE}
@echo ${COMPONENT}: Module built (ROM)
install: ${RAM_MODULE}
${MKDIR} ${INSTDIR}
${CP} ${RAM_MODULE} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
install_rom: ${ROM_MODULE}
${CP} ${ROM_MODULE} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: Module installed (ROM)
export: ${EXPORTS}
@echo
@echo ${COMPONENT}: No exports
clean:
@echo
${WIPE} o.* ${WFLAGS}
${WIPE} aof ${WFLAGS}
${WIPE} rm ${WFLAGS}
${WIPE} linked ${WFLAGS}
${WIPE} map ${WFLAGS}
${RM} ${HDR}
@echo ${COMPONENT}: cleaned
${ROM_MODULE}: ${OBJS} ${TBOXLIB} ${WIMPLIB} ${ROMCSTUBS} ${HDR}
${MKDIR} aof
${LD} -o $@ -aof ${OBJS} ${TBOXLIB} ${WIMPLIB} ${ROMCSTUBS}
${RAM_MODULE}: ${RAM_OBJS} ${TBOXLIB} ${WIMPLIB} ${CLIB} ${HDR}
${mkdir} rm
${LD} -o $@ -module ${RAM_OBJS} ${TBOXLIB} ${WIMPLIB} ${CLIB}
${CHMOD} rm.${COMPONENT} ${CHMODFLAGS}
# Final link for the ROM Image (using given base address)
rom_link:
${MKDIR} linked
${MKDIR} map
${LD} -o linked.${COMPONENT} -rmf -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM} \
-map > map.${COMPONENT}
${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom_link complete
# ------------------------------------------------------------------------------
# Relocatable module target
#
# Module specific rules:
#
resources:
@echo ${COMPONENT}: not internationalised, so no files copied to Messages module
${EXP_C_H}.${COMPONENT}: h.${COMPONENT}
${CP} h.${COMPONENT} $@ ${CPFLAGS}
clean: toolbox-clean
@echo ${COMPONENT}: cleaned
# ------------------------------------------------------------------------------
#---------------------------------------------------------------------------
# Dynamic dependencies:
/* (0.32)
/* (0.33)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.32
#define Module_MajorVersion_CMHG 0.33
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 25 Jun 2011
#define Module_Date_CMHG 14 Jan 2012
#define Module_MajorVersion "0.32"
#define Module_Version 32
#define Module_MajorVersion "0.33"
#define Module_Version 33
#define Module_MinorVersion ""
#define Module_Date "25 Jun 2011"
#define Module_Date "14 Jan 2012"
#define Module_ApplicationDate "25-Jun-11"
#define Module_ApplicationDate "14-Jan-12"
#define Module_ComponentName "Gadgets"
#define Module_ComponentPath "castle/RiscOS/Sources/Toolbox/Gadgets"
#define Module_FullVersion "0.32"
#define Module_HelpVersion "0.32 (25 Jun 2011)"
#define Module_LibraryVersionInfo "0:32"
#define Module_FullVersion "0.33"
#define Module_HelpVersion "0.33 (14 Jan 2012)"
#define Module_LibraryVersionInfo "0:33"
/* Copyright 1997 Acorn Computers Ltd
/* Copyright 2012 Castle Technology Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/* Copyright 1997 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* File: rmensure.c
* Purpose: ensuring a module is loaded
* Author: IDJ
* History: 24-Jun-94: IDJ: created
*/
#include <stdio.h>
#include "kernel.h"
#include "swis.h"
#include "rmensure.h"
_kernel_oserror *rmensure (char *module_name, char *file_name, char *module_version)
{
#ifndef ROM
_kernel_swi_regs regs;
_kernel_oserror *e;
char command[256];
/*
* see if the module is there at all!
*/
sprintf (command, "*RMEnsure %s %s *RMLoad System:modules.%s", module_name,
module_version, file_name);
regs.r[0] = (int)command;
if ((e = _kernel_swi (OS_CLI, &regs, &regs)) != NULL)
return e;
sprintf (command, "*RMEnsure %s %s", module_name, module_version);
regs.r[0] = (int)command;
if ((e = _kernel_swi (OS_CLI, &regs, &regs)) != NULL)
return e;
#else
IGNORE(module_name);
IGNORE(file_name);
IGNORE(module_version);
#endif
return NULL;
}
/* Copyright 1997 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* File: string32.c
* Purpose: strings terminated by char < 32
* Author: Timothy Roddis
* History: 24-Jan-94: IDJ: created from original TGR sources
*/
#include "string32.h"
/* Strings passed to the toolbox might be terminated with any control character ... */
#define NULL 0
void string_copy (char *dst_txt, char *src_txt)
{
/*
* copy a ctrl-terminated string to a buffer big enough to
* hold the result (no length checking).
*/
if (!src_txt) src_txt = "";
while ((*(dst_txt++)=*(src_txt++))>=32);
*(--dst_txt) = '\0';
}
char *string_copy_chk (char *dst_txt, char *src_txt, int max_len)
{
int i;
/*
* copy a ctrl-terminated string to a buffer checking it is big enough to
* hold the result. Return NULL and nul-terminate, if dst buffer not
* big enough.
*/
if (dst_txt == NULL || max_len == 0)
return NULL;
if (!src_txt) src_txt = "";
for (i=1;(*dst_txt++=*src_txt++)>=32;i++)
if (i>=max_len) {
*(--dst_txt) = '\0';
return NULL;
}
*(--dst_txt) = '\0';
return dst_txt;
}
int string_length (char *txt)
{
int i=0;
/*
* return length of ctrl-terminated string
*/
if (!txt) return 0;
while ((*txt>=32) || (*txt==9))
{
txt++;
i++;
}
return i;
}
void string_to_buffer (char *dst_txt, char *src_txt, int *max_len)
{
/*
* general purpose routine to fill in a user-supplied buffer (and report
* number of bytes written), or just report size of buffer needed.
* If buffer is supplied (dst_txt != 0), then *max_len gives size of supplied
* buffer; if this is not large enough, don't return an error, but return
* size of bufer required!
*/
int src_len = string_length (src_txt) + 1;
if (dst_txt == NULL)
*max_len = src_len;
else /* user-supplied buffer */
{
if (*max_len >= src_len)
string_copy (dst_txt, src_txt);
else
string_copy_chk (dst_txt, src_txt, *max_len);
*max_len = string_length (dst_txt) + 1;
}
}
/* Copyright 1997 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* File: rmensure.h
* Purpose: ensuring a module is loaded
* Author: IDJ
* History: 24-Jun-94: IDJ: created
*/
extern _kernel_oserror *rmensure (char *module_name, char *file_name, char *module_version);
/* Copyright 1997 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* File: string32.h
* Purpose: strings terminated by char < 32
* Author: Timothy Roddis
* History: 24-Jan-94: IDJ: created from original TGR sources
*/
/* Strings passed to the toolbox might be terminated with any control character ... */
extern void string_copy (char *dst_txt, char *src_txt);
/*
* copy a ctrl-terminated string to a buffer big enough to
* hold the result (no length checking).
*/
extern char *string_copy_chk (char *dst_txt, char *src_txt, int max_len);
/*
* copy a ctrl-terminated string to a buffer checking it is big enough to
* hold the result. Return NULL and nul-terminate, if dst buffer not
* big enough.
*/
extern int string_length (char *txt);
/*
* return length of ctrl-terminated string
*/
extern void string_to_buffer (char *dst_txt, char *src_txt, int *max_len);
/*
* general purpose routine to fill in a user-supplied buffer (and report
* number of bytes written), or just report size of buffer needed.
* If buffer is supplied (dst_txt != 0), then *max_len gives size of supplied
* buffer; if this is not large enough, don't return an error, but return
* size of bufer required!
*/
......@@ -23,10 +23,8 @@
GET Hdr:System
GET Hdr:APCS.<APCS>
; IMPORT _scrolllist_redraw
; APCS compliant
; SVC mode compatible (a4/r3 used as link register)
; SVC mode compatible (link register stacked)
; Updates a scrolling list gadget
; Prototype: _kernel_oserror *scrolllist_update(PrivateScrollList *sdata,
......@@ -39,10 +37,9 @@
scrolllist_update
EXPORT scrolllist_update
[ {TRUE}
Return ,LinkNotStacked
END
|
mov ip, sp
stmfd sp!, {r4, lr}
......@@ -63,7 +60,7 @@ scrolllist_update
redraw_loop
teq r0, #0
addeq sp, sp, #44
ldmeqfd sp!, {r4, pc}^
Return "r4",,EQ
mov r0, r4
bl _scrolllist_redraw
......@@ -71,5 +68,6 @@ redraw_loop
mov r1, sp
swi XWimp_GetRectangle
b redraw_loop
]
END
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment