Commit cac4e61f authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Actually load the file when the RunType alias is used

Maestro was carefully parsing the file to load in the situation that it had been run because of the RunType alias, but not loading the file.
This is because the load operation was deferred into the null poll case after Wimp_Poll, except that Maestro only uses null polls while playing.
Also shuffled some of the init into FNinitialise.

Version 2.00. Tagged as 'Maestro-2_00'
parent 55797ab7
/* (1.99)
/* (2.00)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.99
#define Module_MajorVersion_CMHG 2.00
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 18 Dec 2013
#define Module_Date_CMHG 19 Jan 2014
#define Module_MajorVersion "1.99"
#define Module_Version 199
#define Module_MajorVersion "2.00"
#define Module_Version 200
#define Module_MinorVersion ""
#define Module_Date "18 Dec 2013"
#define Module_Date "19 Jan 2014"
#define Module_ApplicationDate "18-Dec-13"
#define Module_ApplicationDate "19-Jan-14"
#define Module_ComponentName "Maestro"
#define Module_ComponentPath "castle/RiscOS/Sources/Apps/Maestro"
#define Module_FullVersion "1.99"
#define Module_HelpVersion "1.99 (18 Dec 2013)"
#define Module_LibraryVersionInfo "1:99"
#define Module_FullVersion "2.00"
#define Module_HelpVersion "2.00 (19 Jan 2014)"
#define Module_LibraryVersionInfo "2:0"
......@@ -21,30 +21,35 @@ Task_h%=0
REM TRACE TO "serial:"
DIM menu_buffer% 40 : DIM message_buffer% 256
DIM menu_buffer% 40, message_buffer% 256, err_block% 204
messagefile_handle% = FNopen_messagefile("<Maestro$Dir>.Messages")
maestro$ = FNmessage_lookup(messagefile_handle%, "Maestro")
perc$ = FNmessage_lookup(messagefile_handle%, "Perc")
DIM ERRBLOCK% 204
REM space for an error window
SPACE%=HIMEM-END :REM check enough space available. Nice friendly way to exit...
IF SPACE%<100000 STOP
REMdebug=OPENOUT "debugfile"
ON ERROR PROCerror:END
INITIALISED%=FNinitialise
OSCLI ("Set Maestro$Running Yes")
ON ERROR PROCerror
REM get name of file to load
REM get any filename passed as an argument
SYS "OS_GetEnv" TO EnvStr$
IF INSTR(EnvStr$," -quit ") THEN
I%=INSTR(EnvStr$,"""")
I%=INSTR(EnvStr$,"""",I%+1)
REPEATI%+=1:UNTILMID$(EnvStr$,I%,1)<>" "
f$=MID$(EnvStr$,I%)
IF f$ <> "" THEN
IF FNvalid_number_of_gates (f$) THEN
PROCload_music(f$)
ELSE
ret_code% = FNCheckOK (FNmessage_lookupN(messagefile_handle%, "TooBig", f$, "", "", ""), 1)
ENDIF
ENDIF
ENDIF
INITIALISED%=FNinitialise
null%=FNGetFileInfo("") : REM Sets up strings in info window
OSCLI ("Set Maestro$Running Yes")
ON ERROR PROCerror
REPEAT
IF PLAYING% PROCCheckQ
SYS Poll%,(NOT(PLAYING% OR SCORING% OR AwaitingAck% OR SCROLLING%)AND 1),Window%+handle% TO R%
......@@ -53,14 +58,6 @@ REPEAT
WHEN 0
IF AwaitingAck% IFFNCheckOKTag("BadData",3) :AwaitingAck%=FALSE : CHANGED%=wasCHANGED%
IF SCORING% PROCsymbol_pointer
IF f$ <> "" THEN
IF FNvalid_number_of_gates (f$) THEN
PROCload_music(f$)
ELSE
ret_code% = FNCheckOK (FNmessage_lookupN(messagefile_handle%, "TooBig", FNGetStr(Window%+handle%+44), "", "", ""), 1)
ENDIF
f$=""
ENDIF
IF SCROLLING% PROCCheckScroll :REM auto-scrolling
WHEN 1
......@@ -3220,6 +3217,7 @@ Icon%!28=1 :REM use common sprite area
Icon%!32=12 :REM name length
SYS CreateIcon%, ,Icon% TO Maestro_h%
PROCload_templates
null%=FNGetFileInfo("") : REM Sets up strings in info window
ENDPROC
DEF PROCenumerate_wimp_offsets
......@@ -4040,7 +4038,6 @@ ELSE
ON ERROR END
ENDIF
IF INITIALISED% PROCexit :PROCCloseWindow(QuitQuery_h%)
REMCLOSE#debug
ON ERROR END
IF Task_h%>0 THEN SYS CloseDown, task%, Task_h%
END
......@@ -4122,9 +4119,9 @@ ENDPROC
DEF FNCheckOK(E$, boxes%)
LOCAL E%
FILE%=FILE%:IF FILE% CLOSE#FILE% : FILE%=FALSE
!ERRBLOCK%=0
$(ERRBLOCK%+4)=LEFT$(E$,200)+CHR$0
SYS "Wimp_ReportError", ERRBLOCK%, boxes%, maestro$ TO ,E%
!err_block%=0
$(err_block%+4)=LEFT$(E$,200)+CHR$0
SYS "Wimp_ReportError", err_block%, boxes%, maestro$ TO ,E%
=E%=1 : REM return TRUE if OK pressed
DEF FNCheckOKTag(E$, boxes%)
......
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