Commit 0e25ba16 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

Spinner branch merged.

Modified to use srccommit.

Version 0.15. Tagged as 'ScrSaver-0_15'
parent b3771f37
*,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
cmhg/** gitlab-language=cmhg linguist-language=cmhg linguist-detectable=true
......@@ -58,7 +58,7 @@ EXPORTS =
# Rule patterns
#
.c.o:; ${CC} ${CFLAGS} -o $@ $<
.cmhg.o:; ${CMHG} -o $@ $<
.cmhg.o:; ${CMHG} -p -o $@ $<
.s.o:; ${AS} ${AFLAGS} $< $@
#
......@@ -82,7 +82,6 @@ install_rom: ${TARGET}
clean:
${WIPE} o.* ${WFLAGS}
${WIPE} linked.* ${WFLAGS}
${WIPE} map.* ${WFLAGS}
${RM} ${TARGET}
${RM} ${RAMTARGET}
${RM} ${APPTARGET}
......@@ -90,10 +89,11 @@ clean:
resources: ${APPTARGET}
${MKDIR} ${RESDIR}.ScrSaver
${CP} ${APPTARGET} ${RESDIR}.ScrSaver.!RunImage ${CPFLAGS}
${CP} Resources.${LOCALE}.!Run ${RESDIR}.ScrSaver.!Run ${CPFLAGS}
${CP} Resources.${LOCALE}.Templates ${RESDIR}.ScrSaver.Templates ${CPFLAGS}
${SHRINK} Resources.${LOCALE}.Sprites ${RESDIR}.ScrSaver.Sprites
${CP} ${APPTARGET} ${RESDIR}.ScrSaver.!RunImage ${CPFLAGS}
${CP} LocalRes:${UserIF}.!Run ${RESDIR}.ScrSaver.!Run ${CPFLAGS}
${CP} LocalRes:${UserIF}.Messages ${RESDIR}.ScrSaver.Messages ${CPFLAGS}
${CP} LocalRes:${UserIF}.Templates ${RESDIR}.ScrSaver.Templates ${CPFLAGS}
${SHRINK} LocalRes:${UserIF}.Sprites ${RESDIR}.ScrSaver.Sprites
@echo ${COMPONENT}: resource files copied
#
......@@ -111,9 +111,7 @@ ${APPTARGET}: ${APPOBJS}
#
rom_link:
${MKDIR} linked
${MKDIR} map
${LD} -o linked.${COMPONENT} -map -bin -base ${ADDRESS} ${TARGET} ${ABSSYM} > map.${COMPONENT}
truncate map.${COMPONENT} linked.${COMPONENT}
${LD} -o linked.${COMPONENT} -rmf -base ${ADDRESS} ${TARGET} ${ABSSYM}
${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom_link complete
......
# Initial name of all the sprites
sprname:globe
# How much to move each time
step:4
# Time delay before next sprite plot
delaytime:2
# Plot x moves before changing sprite
loopmax:5
# Initial Sprite Image
initimage:1
# Is there an initial animation sequence
initseq:0
# First Sprite of Looping Sequence
loopimage:1
# Last Sprite of Looping Sequence
maximage:18
# Amount of blank space left of sprite
leftwaste:4
# Amount of blank space right of sprite
rightwaste:4
# Amount of blank space at top of sprite
topwaste:4
# Amount of blank space at bottom of sprite
botwaste:4
Set SaverTest$Dir <Obey$Dir>
WimpSlot -min 32K -max 32K
Run <SaverTest$Dir>.!Runimage %*0
/* (0.14)
/* (0.15)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.14
#define Module_MajorVersion_CMHG 0.15
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 28 Apr 1999
#define Module_MajorVersion "0.14"
#define Module_Version 14
#define Module_MajorVersion "0.15"
#define Module_Version 15
#define Module_MinorVersion ""
#define Module_Date "28 Apr 1999"
#define Module_FullVersion "0.14"
#define Module_FullVersion "0.15"
......@@ -23,6 +23,7 @@
#include "bbc.h"
#include "colourtran.h"
#include "werr.h"
#include "msgs.h"
#define space ' '
#define linefeed '\n'
......@@ -41,20 +42,6 @@
#define OSKB_XLIMIT_FN 11 /* number of bits per pixel and */
#define OSKB_YLIMIT_FN 12 /* screen geometry */
#define SP_NAME "logo" /* Initial name of all the sprites */
#define STEP 10 /* How much to move each time */
#define DELAY_TIME 2 /* Time delay before next sprite plot */
#define LOOP_MAX 3 /* Plot x moves before changing sprite */
#define INIT_IMAGE 0 /* Initial Sprite Image */
#define LOOP_IMAGE 12 /* First Sprite of Looping Sequence */
#define MAX_IMAGE 18 /* Last Sprite of Looping Sequence */
#define LEFT_WASTE 4 /* Amount of blank space left of sprite */
#define RIGHT_WASTE 16 /* Amount of blank space right of sprite */
#define TOP_WASTE 4 /* Amount of blank space at top of sprite */
#define BOTTOM_WASTE 10 /* Amount of blank space at bottom of sprite */
#define PI 3.14159265
/***************************************************************************/
......@@ -64,7 +51,22 @@
/********* global variables **********/
/***************************************/
wimp_w main_handle; /* Main window handle */
char SP_NAME[12]; /* Initial name of all the sprites */
int STEP; /* How much to move each time */
int DELAY_TIME; /* Time delay before next sprite plot */
int LOOP_MAX; /* Plot x moves before changing sprite */
int INIT_IMAGE; /* Initial Sprite Image */
int INIT_SEQ; /* Is there an initial sequence */
int LOOP_IMAGE; /* First Sprite of Looping Sequence */
int MAX_IMAGE; /* Last Sprite of Looping Sequence */
int LEFT_WASTE; /* Amount of blank space left of sprite */
int RIGHT_WASTE; /* Amount of blank space right of sprite */
int TOP_WASTE; /* Amount of blank space at top of sprite */
int BOTTOM_WASTE; /* Amount of blank space at bottom of sprite */
wimp_w main_handle; /* Main window handle */
int *poll_word_location; /* Location of the poll word */
......@@ -392,7 +394,9 @@ static void plot_intro_animation(void)
{
if (read_time() - last_time > DELAY_TIME)
{
plot_sprite(current_image);
if (INIT_SEQ)
plot_sprite(current_image);
change_image_to_plot();
}
}
......@@ -605,6 +609,47 @@ static BOOL events_unknown_handler(wimp_eventstr *e, void *handle)
return(dealt_with);
}
/* Read in the variables from the messages file */
static void read_in_variables(void)
{
char buffer[256];
strcpy(SP_NAME, msgs_lookup("sprname:logo"));
strcpy(buffer, msgs_lookup("step:10"));
STEP = atoi(buffer);
strcpy(buffer, msgs_lookup("delaytime:2"));
DELAY_TIME = atoi(buffer);
strcpy(buffer, msgs_lookup("loopmax:3"));
LOOP_MAX = atoi(buffer);
strcpy(buffer, msgs_lookup("initimage:0"));
INIT_IMAGE = atoi(buffer);
strcpy(buffer, msgs_lookup("initseq:1"));
INIT_SEQ = atoi(buffer);
strcpy(buffer, msgs_lookup("loopimage:12"));
LOOP_IMAGE = atoi(buffer);
strcpy(buffer, msgs_lookup("maximage:18"));
MAX_IMAGE = atoi(buffer);
strcpy(buffer, msgs_lookup("leftwaste:4"));
LEFT_WASTE = atoi(buffer);
strcpy(buffer, msgs_lookup("rightwaste:16"));
RIGHT_WASTE = atoi(buffer);
strcpy(buffer, msgs_lookup("topwaste:4"));
TOP_WASTE = atoi(buffer);
strcpy(buffer, msgs_lookup("botwaste:10"));
BOTTOM_WASTE = atoi(buffer);
}
/* Initialise the application */
static BOOL initialise(void)
{
......@@ -613,6 +658,7 @@ static BOOL initialise(void)
wimpt_init(APP_NAME);
res_init(APP_NAME);
template_init();
msgs_init();
win_activeinc();
event_setmask((wimp_emask) 0); /* Ensure we got polled constantly */
......@@ -620,6 +666,8 @@ static BOOL initialise(void)
win_add_unknown_event_processor(events_unknown_handler, NULL);
set_random_seed(); /* Set up the random number generator */
read_in_variables();
os_byte(106, &ptrshape, &dummy); /* Store shape and then remove pointer */
create_main_window();
......
......@@ -14,6 +14,41 @@ int poll_word;
#define OS_Module 0x1e
#define TaskModule_StartTask 0x4d301
#define OS_Find 0x0d
#define PDriver_Info 0x80140
/*------------------------------------------------------------------------*/
/* Check if user is already printing */
static int user_currently_printing(void)
{
_kernel_swi_regs regs;
_kernel_oserror *err;
int printing = FALSE;
regs.r[0] = 0;
err = _kernel_swi(PDriver_Info, &regs, &regs); /* Get PDriver Info */
if (err)
printing = FALSE; /* printer does not exist - user not printing */
else
{
regs.r[0] = 0xc3;
regs.r[1] = (int) "printer:";
regs.r[2] = 0;
_kernel_swi(OS_Find, &regs, &regs); /* try and open printer */
if (regs.r[0] != 0) /* printer: not in use - user not printing */
{
regs.r[1] = regs.r[0];
regs.r[0] = 0;
regs.r[2] = 0;
_kernel_swi(OS_Find, &regs, &regs); /* close printer: */
printing = FALSE;
}
else
printing = TRUE; /* printer: is in use - user is printing */
}
return (printing);
}
static void blank_screen(void)
{
......@@ -53,7 +88,10 @@ module_service( int service_no, _kernel_swi_regs *r, void *pw )
{
if ( service_no == Service_ScreenBlanking )
{
blank_screen();
if (user_currently_printing() == FALSE)
{
blank_screen();
}
r->r[1]=0; /* Claim service call */
}
......
......@@ -3,9 +3,11 @@
; CMHG definition of module header
;
#include "VersionNum"
title-string: ScrSaver
help-string: ScrSaver 0.11
date-string: 16 Jun 1997
help-string: ScrSaver Module_MajorVersion_CMHG Module_MinorVersion_CMHG
date-string: Module_Date_CMHG
initialisation-code: module_initialise
; Only used if SCALE defined:
......
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