Commit 1831b70a authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Fix ROM resources phase to not install !Sprites22

When in ROM there's no need to stuff the sprites into ResourceFS since they're in the Wimp pool. Moreover, only !Sprites22 was being installed, so if booting into a low res mode !Edit wouldn't start because !Sprites was not found.
* Ammended Makefile to not do sprites during resources
* Ammended Makefile to do both resolution sprites for the disc install
* Used StdTools and ModuleLibs shared makefiles
* Resolved some of the easy warnings
* Changed to use '_Version' as the info box token, so allowing use of the centralised AwkVers script
* Added ROM !Boot file (as !Draw has) which is a cutdown version of the disc one
Tested briefly, still loads files and opens task windows OK.

Version 1.66. Tagged as 'Edit-1_66'
parent 24549831
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all
amu_machine all THROWBACK=-throwback
| Copyright 1996 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.
|
Dir <Obey$Dir>
amu_machine module
s/** gitlab-language=armasm linguist-language=armasm linguist-detectable=true
awk/** gitlab-language=awk linguist-language=awk linguist-detectable=true
*,ffb gitlab-language=bbcbasic linguist-language=bbcbasic linguist-detectable=true
c/** gitlab-language=c linguist-language=c linguist-detectable=true
h/** gitlab-language=c linguist-language=c linguist-detectable=true
......@@ -32,7 +32,7 @@ MODULE = rm.Edit
ROM_MODULE = aof.Edit
RDIR = Resources
LDIR = LocalRes:
MSGVERSION = ${AWK} -f Build:AwkVers
MSGS = Resources.GenMessage
#
......@@ -41,44 +41,23 @@ MSGS = Resources.GenMessage
RESDIR = <resource$dir>.Resources.${COMPONENT}
RESAPP = <resource$dir>.Apps.${APP}
#
# Generic options:
#
MKDIR = do mkdir -p
AS = objasm
CC = cc
CMHG = cmhg
CP = copy
LD = link
RM = remove
SQUEEZE = squeeze
WIPE = x wipe
XWIPE = x wipe
include StdTools
include ModuleLibs
AFLAGS = ${THROWBACK} -depend !Depend -nocache -stamp -quit
CFLAGS = ${THROWBACK} -c -depend !Depend -fah ${INCLUDES} ${DFLAGS} -wp
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
SQZFLAGS = -f
CINCLUDES = -IC:
ASFLAGS = ${STDTOOLOPTIONS} -nocache -stamp -quit
CFLAGS = ${STDTOOLOPTIONS} ${C_WARNINGS} ${CINCLUDES} -wp
WRAPPER = RISC_OSLib:s.ModuleWrap
LIBSD = ${RLIB} ${CLIB}
#
# Libraries
# Include files:
#
ANSILIB = CLib:o.ansilib
CLIB = CLib:o.stubs
RLIB = RISC_OSLib:o.risc_oslib
RSTUBS = RISC_OSLib:o.rstubs
ROMSTUBS = RISC_OSLib:o.romstubs
ROMCSTUBS = RISC_OSLib:o.romcstubs
ABSSYM = RISC_OSLib:o.abssym
WRAPPER = RISC_OSLib:s.ModuleWrap
INCLUDES = -IC:
DFLAGS =
FILES =\
${RDIR}.!Boot\
${RDIR}.!Run\
${RDIR}.!Sprites\
${RDIR}.!Sprites22\
abs.!RunImage\
${RDIR}.Export\
......@@ -98,10 +77,10 @@ OBJSD = od.edit od.editv od.message od.slist
# Rule patterns
#
.SUFFIXES: .oz .od
.c.o:; ${CC} ${CFLAGS} -ff -o $@ $<
.c.oz:; ${CC} ${CFLAGS} -ff -zM -zps1 -o $@ $<
.c.od:; ${CC} ${CFLAGS} -DTRACE=1 -g -o $@ $<
.s.o:; ${AS} ${AFLAGS} $< $@
.c.o:; ${CC} ${CFLAGS} -c ${C_NO_FNAMES} $<
.c.oz:; ${CC} ${CFLAGS} -c ${C_NO_FNAMES} ${C_MODULE} ${C_NO_STKCHK} -o $@ $<
.c.od:; ${CC} ${CFLAGS} -c -DTRACE=1 -g -o $@ $<
.s.o:; ${AS} ${ASFLAGS} $< $@
#
# Main rules:
......@@ -117,6 +96,7 @@ install: ${FILES}
${CP} ${RDIR}.!Boot ${INSTDIR}.!Boot ${CPFLAGS}
${CP} ${LDIR}!Help ${INSTDIR}.!Help ${CPFLAGS}
${CP} ${RDIR}.!Run ${INSTDIR}.!Run ${CPFLAGS}
${CP} ${RDIR}.!Sprites ${INSTDIR}.!Sprites ${CPFLAGS}
${CP} ${RDIR}.!Sprites22 ${INSTDIR}.!Sprites22 ${CPFLAGS}
${CP} abs.!RunImage ${INSTDIR}.!RunImage ${CPFLAGS}
${CP} ${RDIR}.Export ${INSTDIR}.Export ${CPFLAGS}
......@@ -125,6 +105,7 @@ install: ${FILES}
Access ${INSTDIR}.!Boot lr/r
Access ${INSTDIR}.!Help lr/r
Access ${INSTDIR}.!Run lr/r
Access ${INSTDIR}.!Sprites lr/r
Access ${INSTDIR}.!Sprites22 lr/r
Access ${INSTDIR}.!RunImage lr/r
Access ${INSTDIR}.Export lr/r
......@@ -139,10 +120,9 @@ install_rom: ${ROM_MODULE}
resources: ${MSGS}
${MKDIR} ${RESDIR}
${MKDIR} ${RESAPP}
${CP} ${RDIR}.!Boot ${RESAPP}.!Boot ${CPFLAGS}
${CP} ${RDIR}.ROM.!Boot ${RESAPP}.!Boot ${CPFLAGS}
${CP} ${LDIR}!Help ${RESAPP}.!Help ${CPFLAGS}
${CP} ${RDIR}.ROM.!Run ${RESAPP}.!Run ${CPFLAGS}
${CP} ${RDIR}.!Sprites22 ${RESAPP}.!Sprites22 ${CPFLAGS}
${CP} ${MSGS} ${RESDIR}.Messages ${CPFLAGS}
${CP} ${LDIR}Templates ${RESDIR}.Templates ${CPFLAGS}
@echo ${COMPONENT}: resource files copied to Messages module
......@@ -170,6 +150,7 @@ mod: ${MODULE}
#
abs.!RunImage: ${OBJS} ${RLIB} ${CLIB}
${LD} -o $@ ${OBJS} ${RLIB} ${CLIB}
${SQZ} ${SQZFLAGS} $@
${MODULE}: oz.ModuleWrap ${OBJSZ} ${RLIB} ${CLIB}
${LD} -o $@ -module oz.ModuleWrap ${OBJSZ} ${RLIB} ${CLIB}
......@@ -184,13 +165,13 @@ rom_link:
@echo ${COMPONENT}: rom_link complete
oz.ModuleWrap: s.ModuleWrap s.AppName ${MSGS} ${RESFILES}
${AS} ${AFLAGS} s.ModuleWrap $@
${AS} ${ASFLAGS} s.ModuleWrap $@
s.ModuleWrap: ${WRAPPER}
${CP} ${WRAPPER} $@ ${CPFLAGS}
${MSGS}: ${LDIR}Messages awk.Version
gnu.gawk -f awk.Version ${LDIR}Messages > $@
${MSGS}: ${LDIR}Messages VersionNum
${MSGVERSION} ${LDIR}Messages > $@
BBETYPE = edit
bbe-edit: bbe-generic
......
IconSprites <Obey$Dir>.!Sprites
Set Edit$BootDir <Obey$Dir>
SetMacro Alias$@RunType_FFF If "<Wimp$State>"="commands" Then Type %%*0 Else /<Edit$BootDir> %%*0
If "<TaskWindow$Server>"="" Then Set TaskWindow$Server <Obey$Dir>
IconSprites <Obey$Dir>.!Sprites
\ No newline at end of file
No preview for this file type
Set Edit$BootDir <Obey$Dir>
SetMacro Alias$@RunType_FFF If "<Wimp$State>"="commands" Then Type %%*0 Else /<Edit$BootDir> %%*0
If "<TaskWindow$Server>"="" Then Set TaskWindow$Server <Obey$Dir>
No preview for this file type
......@@ -14,10 +14,10 @@
Module_MajorVersion SETS "1.66"
Module_Version SETA 166
Module_MinorVersion SETS ""
Module_Date SETS "14 Jan 2012"
Module_ApplicationDate SETS "14-Jan-12"
Module_Date SETS "21 Aug 2012"
Module_ApplicationDate SETS "21-Aug-12"
Module_ComponentName SETS "Edit"
Module_ComponentPath SETS "castle/RiscOS/Sources/Apps/Edit"
Module_FullVersion SETS "1.66"
Module_HelpVersion SETS "1.66 (14 Jan 2012)"
Module_HelpVersion SETS "1.66 (21 Aug 2012)"
END
......@@ -6,18 +6,18 @@
*/
#define Module_MajorVersion_CMHG 1.66
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Jan 2012
#define Module_Date_CMHG 21 Aug 2012
#define Module_MajorVersion "1.66"
#define Module_Version 166
#define Module_MinorVersion ""
#define Module_Date "14 Jan 2012"
#define Module_Date "21 Aug 2012"
#define Module_ApplicationDate "14-Jan-12"
#define Module_ApplicationDate "21-Aug-12"
#define Module_ComponentName "Edit"
#define Module_ComponentPath "castle/RiscOS/Sources/Apps/Edit"
#define Module_FullVersion "1.66"
#define Module_HelpVersion "1.66 (14 Jan 2012)"
#define Module_HelpVersion "1.66 (21 Aug 2012)"
#define Module_LibraryVersionInfo "1:66"
# Generate an assembler header file containing Version and Date
# using values set in the Messages file.
#
BEGIN {
while (getline < "VersionNum" > 0) {
split($0, Version);
if (Version[1] == "#define") {
if (Version[2] == "Module_ApplicationDate") {
Date = substr(Version[3], 2, length(Version[3]) -2 );
}
if (Version[2] == "Module_MajorVersion_CMHG") {
VString = Version[3];
}
}
}
}
/^EditId/ { printf("EditId:%s (%s)\n", VString, Date); done = 1; next; }
{ print }
END {
if (!done) {
printf("EditId:%s (%s)\n", VString, Date);
}
}
......@@ -656,7 +656,7 @@ static void save_edits(int s, char *buff)
}
}
if (!reported) {
wimp_reporterror((os_error *)e, 0, "Edit");
wimp_reporterror((os_error *)e, (wimp_errflags)0, "Edit");
}
}
......@@ -707,7 +707,8 @@ int main(int argc, char *argv[])
signal(s, edit_signal_handler);
}
if (s = setjmp(SigBuf)) {
s = setjmp(SigBuf);
if (s) {
for (s = 0; s < N_SIGNALS; s++) {
signal(s, SIG_DFL);
}
......
......@@ -71,7 +71,7 @@ void arceditv_infoaboutprogram(void)
dbox_raw_eventhandler(d, help_dboxrawevents, "PROGINFO");
/* Place the version string in the dialogue box */
dbox_setfield(d, arceditv_IPVersion, msgs_lookup("EditId")); /* AMcC 17-Jan-95 */
dbox_setfield(d, arceditv_IPVersion, msgs_lookup("_Version"));
dbox_show(d);
dbox_fillin(d);
......
......@@ -83,39 +83,36 @@ typedef enum {
} message_menuopts;
/* Note menu options start at 1 really */
typedef struct selbuffer * selbuffer;
/* Linked list of blocks to be sent to the task */
typedef struct selbuffer {
selbuffer next; /* Chain of these */
char * buffer; /* the data */
int ref, /* The associated reference */
size, /* Amount of data in the buffer */
bsize, /* Amount of room in the buffer */
pos; /* Offset in the buffer */
};
typedef struct mstate * message_state;
struct selbuffer *next; /* Chain of these */
char *buffer; /* the data */
int ref, /* The associated reference */
size, /* Amount of data in the buffer */
bsize, /* Amount of room in the buffer */
pos; /* Offset in the buffer */
} selbuffer_t;
typedef struct mstate {
message_state next;
int readline; /* 1 if reading command, 0 if passing input to task */
char line[MAXLINE+2]; /* The line we're reading, valid iff readline = 1 */
wimp_t child; /* The taskid of the child */
int sentcli; /* 1 <=> a command has been sent but not replied to */
int suspended; /* 1 <=> current task is suspended */
int linked; /* 1 <=> caret linked to task display */
txt t; /* The associated text object */
char * comname; /* The command used to start the task window */
txtedit_state * edstate; /* The txtedit associated state */
txt_event_proc hand; /* And its handler */
selbuffer buff; /* Stuff pending to the task module */
};
struct mstate *next;
int readline; /* 1 if reading command, 0 if passing input to task */
char line[MAXLINE+2]; /* The line we're reading, valid iff readline = 1 */
wimp_t child; /* The taskid of the child */
int sentcli; /* 1 <=> a command has been sent but not replied to */
int suspended; /* 1 <=> current task is suspended */
int linked; /* 1 <=> caret linked to task display */
txt t; /* The associated text object */
char *comname; /* The command used to start the task window */
txtedit_state *edstate; /* The txtedit associated state */
txt_event_proc hand; /* And its handler */
selbuffer_t *buff; /* Stuff pending to the task module */
} message_state_t;
static menu message_menu; /* = NULL */
static message_state states; /* = NULL */
static message_state_t *states; /* = NULL */
static int ignoreCtl = 1; /* Default ignore control chars from task */
struct Start_Error {
static const struct {
int errnum;
char errmess[6];
} start_error = {100, "NoMem" };
......@@ -136,10 +133,9 @@ hex[1] = ' ';
hex[2] = 0;
} /* End procedure */
os_error * message_starttask(comname, t, me)
char * comname; /* Command by which to start task module */
txt t; /* The txt of this window */
wimp_t me; /* My task handle, passed to the task in STR$~ form */
static os_error * message_starttask(char *comname, /* Command by which to start task module */
txt t, /* The txt of this window */
wimp_t me /* My task handle, passed to the task in STR$~ form */)
{
char * cliline;
char hex[11];
......@@ -178,7 +174,7 @@ return wimp_sendmessage(wimp_ESEND, &msg, dest);
} /* End procedure */
void message_menu_help_handler(void *handle, char *hit)
static void message_menu_help_handler(void *handle, char *hit)
{
handle = handle;
......@@ -196,9 +192,9 @@ void message_menu_help_handler(void *handle, char *hit)
help_genmessage("HELPT", hit);
}
menu message_menumaker(void *a)
static menu message_menumaker(void *a)
{
message_state s = (message_state) a;
message_state_t *s = (message_state_t *) a;
txt t;
txtwin_setcurrentwindow(s->t);
......@@ -231,12 +227,9 @@ help_register_handler(message_menu_help_handler, 0);
return message_menu;
}
static void message_RAMTransmit(buffer, task, addr, ref)
static void message_RAMTransmit(selbuffer_t *buffer, wimp_t task,
char *addr, int ref)
/* Transmit the data and tell the recipient it's gone */
selbuffer buffer;
wimp_t task;
char * addr;
int ref;
{
wimp_msgstr data;
int n;
......@@ -256,9 +249,7 @@ buffer->size -= n;
buffer->pos += n;
} /* End procedure */
static void message_datasave(buffer, task)
selbuffer buffer;
wimp_t task;
static void message_datasave(selbuffer_t *buffer, wimp_t task)
{
wimp_msgstr data;
......@@ -276,10 +267,10 @@ wimpt_noerr(wimp_sendmessage(wimp_ESENDWANTACK, &data, task));
buffer->ref = data.hdr.my_ref;
} /* End procedure */
static message_state findstatefromtask(wimp_t task)
static message_state_t *findstatefromtask(wimp_t task)
{
/* Search the linked list of states for one with the given child */
message_state s = states;
message_state_t *s = states;
while (s)
{
......@@ -289,10 +280,10 @@ while (s)
return NULL;
} /* End procedure */
static message_state findstatefromtxt(txt t)
static message_state_t *findstatefromtxt(txt t)
{
/* Search the linked list of states for one with the given txt */
message_state s = states;
message_state_t *s = states;
while (s)
{
......@@ -308,11 +299,11 @@ return NULL;
with the rest of this file, but my brain just exploded trying
to figure out whether the brackets matched up right.
*/
BOOL message_bkg_events(wimp_eventstr *e, void *handle)
static BOOL message_bkg_events(wimp_eventstr *e, void *handle)
{
message_data * data;
txt t;
message_state s;
message_data *data;
txt t = NULL;
message_state_t *s;
handle = handle; /* not used - prevent compiler warning. */
......@@ -442,9 +433,9 @@ BOOL message_bkg_events(wimp_eventstr *e, void *handle)
if (!s->buff->size)
{
/* That buffer emptied */
selbuffer b = s->buff;
selbuffer_t *b = s->buff;
s->buff = Slist_Remove(s->buff, b);
s->buff = slist_remove(s->buff, b);
free(b->buffer);
free(b);
} /* End if */
......@@ -466,12 +457,10 @@ BOOL message_bkg_events(wimp_eventstr *e, void *handle)
return 0;
}
void message_menueventproc(v, cmd)
void * v;
char * cmd;
static void message_menueventproc(void *v, char *cmd)
{
message_state s = v;
txt t = s->t;
message_state_t *s = v;
txt t = s->t;
switch (*cmd)
{
......@@ -501,7 +490,7 @@ switch (*cmd)
{
os_error * e = message_starttask(s->comname, t, wimpt_task());
s->suspended = 1;
if (e) wimp_reporterror(e, 0, "Task"); else s->sentcli = 1;
if (e) wimp_reporterror(e, (wimp_errflags)0, "Task"); else s->sentcli = 1;
}; /* End if */
break;
......@@ -521,9 +510,9 @@ switch (*cmd)
{
int n;
/* new version using RAMTransmit */
selbuffer buffer;
int i;
char * txtdata;
selbuffer_t *buffer;
int i;
char * txtdata;
start = txt_selectstart(t);
end = txt_selectend(t);
......@@ -533,7 +522,7 @@ switch (*cmd)
/* Get first segment */
if (n > end-start) n = end-start;
start += n;
buffer = (selbuffer)malloc(sizeof(*buffer));
buffer = (selbuffer_t *)malloc(sizeof(selbuffer_t));
if (!buffer) { werr(0, msgs_lookup("ME1")); return; };
buffer->next = NULL;
buffer->size = n;
......@@ -547,7 +536,7 @@ switch (*cmd)
{
/* Already some pending stuff, so add mine to the end */
buffer->ref = 0; /* No reference yet */
s->buff = Slist_AddE(s->buff, buffer);
s->buff = slist_addend(s->buff, buffer);
} else
{
/* Nothing pending, so send straight away */
......@@ -593,10 +582,7 @@ switch (*cmd)
}; /* End switch */
} /* End procedure */
void passtotxtedit(t, s, e)
txt t;
message_state s;
txt_eventcode e;
static void passtotxtedit(txt t, message_state_t *s, txt_eventcode e)
{
txt_unget(t, e);
s->hand(t, s->edstate);
......@@ -635,7 +621,7 @@ static BOOL message_win_unknowns(wimp_eventstr *e, void *handle)
}
#endif
void message_obeyeventcode(txt t, message_state s, txt_eventcode e)
static void message_obeyeventcode(txt t, message_state_t *s, txt_eventcode e)
{
switch (e)
{
......@@ -661,13 +647,13 @@ switch (e)
else break; /* Can't kill window with child alive */
}; /* End if */
txtedit_dispose(s->edstate);
states = Slist_Remove(states, s);
states = slist_remove(states, s);
free(s->comname);
while (s->buff)
{
selbuffer b = s->buff;
selbuffer_t *b = s->buff;
s->buff = Slist_Remove(s->buff, b);
s->buff = slist_remove(s->buff, b);
free(b->buffer);
free(b);
}; /* End while */
......@@ -726,7 +712,7 @@ switch (e)
{
/* Stick the input on the end of existing stuff */
/* First find end of chain of buffers */
selbuffer b = s->buff;
selbuffer_t *b = s->buff;
while (b->next) b = b->next;
/* b now points to last buffer */
......@@ -734,7 +720,7 @@ switch (e)
/* Room in this one */
else
{
b = (selbuffer)malloc(sizeof(*b));
b = (selbuffer_t *)malloc(sizeof(selbuffer_t));
if (!b) { werr(0, msgs_lookup("ME1")); return; };
b->next = NULL;
b->buffer = malloc(64);
......@@ -744,7 +730,7 @@ switch (e)
b->bsize = 64;
b->pos = 0;
*b->buffer = ch;
s->buff = Slist_AddE(s->buff, b);
s->buff = slist_addend(s->buff, b);
}; /* End if */
} else
{
......@@ -762,9 +748,7 @@ switch (e)
} /* End switch */
} /* End procedure */
void message_eventhandler(t, s)
txt t;
void * s;
static void message_eventhandler(txt t, void *s)
{
message_obeyeventcode(t, s, txt_get(t));
} /* End procedure */
......@@ -773,12 +757,11 @@ message_obeyeventcode(t, s, txt_get(t));
void message_taskwindow(comname)
char * comname;
void message_taskwindow(char *comname)
{
/* Create the task window in which to run */
txt t;
message_state state;
txt t;
message_state_t *state;
t = txt_new(msgs_lookup("ME2")); /* "Task window" */
if (!t)
......@@ -814,7 +797,7 @@ txt_setcharoptions(t, txt_CARET + txt_UPDATED + txt_DISPLAY,
win_add_unknown_event_processor(message_win_unknowns, (void *)t);
#endif
states = Slist_Add(states, state);
states = slist_add(states, state);
{
os_error * e = message_starttask(comname, t, wimpt_task());
state->readline = 1;
......@@ -822,7 +805,7 @@ states = Slist_Add(states, state);
state->linked = 1;
if (e)
{
wimp_reporterror(e, 0, "Task");
wimp_reporterror(e, (wimp_errflags)0, "Task");
state->sentcli = 0;
} else state->sentcli = 1;
}
......@@ -831,7 +814,7 @@ return;
void killalltasks(void)
{
message_state s = states;
message_state_t *s = states;
while (s)
{
if (s->child)
......
......@@ -19,89 +19,76 @@
*/
#include <stdio.h>
typedef struct listrec * ListPtr;
#include "slist.h"
typedef struct listrec
{
ListPtr next;
};
#define next_(p) (((ListPtr)p)->next)
struct listrec *next;
} listrec_t;
void * Slist_Add(listhead, newelement)
void * listhead;
void * newelement;
#define next_(p) (((listrec_t *)(p))->next)
void * slist_add(void *listhead, void *newelement)
{
next_(newelement) = listhead;
return newelement;
} /* End procedure */