Commit 09cae55f authored by Chris Wraight's avatar Chris Wraight Committed by ROOL
Browse files

Memory Changes

  Each Maestro file is held in memory as nine blocks of bytes: one for 'Gate' data,
  and eight for Note information for each audio channel. Maestro reserved a very big
  WimpSlot of 720K, and merely divided the space between the end of the program and
  the end of the Wimpslot by 9 to get equally spaced pointers for each byte block.
  This was very wasteful (Maestro files are typically only 1-2K in size), and there's
  no checking to prevent writes from running off the end of the Wimpslot.
  These changes
  - Add new memory management routines
  - Place all program data in resizable heap blocks
  - Remove EnsureRMA check
  Tested on a variety of Maestro files. There's still plenty of inefficiency in
  the way Maestro handles its data but typically, even with Sprites11 loaded, the
  Wimpslot goes down to 380K.

Version 2.16. Tagged as 'Maestro-2_16'
parent 29a59e31
......@@ -31,7 +31,6 @@ FILES =\
......@@ -58,7 +57,6 @@ install_ install_Maestro: ${FILES}
${CP} ${LDIR}.!Help ${INSTAPP}.!Help ${CPFLAGS}
${CP} ${LDIR}.!Run ${INSTAPP}.!Run ${CPFLAGS}
${CP} ${RDIR}.!RunImage ${INSTAPP}.!RunImage ${CPFLAGS}
${CP} ${RDIR}.GenMessage ${INSTAPP}.Messages ${CPFLAGS}
${CP} ${RDIR}.Sprites ${INSTAPP}.Sprites ${CPFLAGS}
${CP} ${RDIR}.Sprites11 ${INSTAPP}.Sprites11 ${CPFLAGS}
......@@ -78,7 +76,6 @@ install_ install_Maestro: ${FILES}
${RM} ${RDIR}.!RunImage
${RM} ${RDIR}.EnsureRMA
${RM} ${RDIR}.GenMessage
${WIPE} crunched.* ${WFLAGS}
......@@ -93,14 +90,6 @@ ${RDIR}.!RunImage: crunched.!RunImage
crunched.!RunImage: bas.!RunImage
${RUN}BasCrunch -1 bas.!RunImage $@
o.EnsureRMA: s.EnsureRMA
${MKDIR} o
${AS} ${AFLAGS} -o $@ s.EnsureRMA
$(RDIR).EnsureRMA: o.EnsureRMA
${LD} -bin -o $@ o.EnsureRMA
${SETTYPE} $@ Utility
$(RDIR).GenMessage: $(LDIR).Messages
${INSERTVERSION} $(LDIR).Messages > $(RDIR).GenMessage
......@@ -8,6 +8,6 @@ Set Maestro$Dir <Obey$Dir>
IconSprites <Maestro$Dir>.Themes.!Sprites
Set Alias$@RunType_AF1 Run <Maestro$Dir>.!Run %%*0
Set File$Type_AF1 Music
Run <Maestro$Dir>.EnsureRMA
WimpSlot -min 256k -max 720k
WimpSlot -min 360k -max 360k
Run <Maestro$Dir>.!RunImage %*0
......@@ -121,9 +121,9 @@ NoSoundQuit:Sound is not enabled. Continue to load Maestro?
Fatal:Error: %0. Program will exit.
NoVoices:No sound voices are installed
SpriteLoad:loading sprite data.
OutMem1:Not enough memory to load window templates
OutMem2:Menu too big
OutMem3:Not enough memory available for music storage
OutMem1:Not enough memory to perform this operation
OutMem2:Not enough memory to load this file
OutMem3:Not enough memory to start Maestro
SSIU:Sound system in use by Maestro
IntErr:%0 (internal error %1)
ExProg: - exit program?
/* (2.15)
/* (2.16)
* This file is automatically maintained by srccommit, do not edit manually.
#define Module_MajorVersion_CMHG 2.15
#define Module_MajorVersion_CMHG 2.16
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 10 Feb 2021
#define Module_Date_CMHG 13 Mar 2021
#define Module_MajorVersion "2.15"
#define Module_Version 215
#define Module_MajorVersion "2.16"
#define Module_Version 216
#define Module_MinorVersion ""
#define Module_Date "10 Feb 2021"
#define Module_Date "13 Mar 2021"
#define Module_ApplicationDate "10-Feb-21"
#define Module_ApplicationDate "13-Mar-21"
#define Module_ComponentName "Maestro"
#define Module_FullVersion "2.15"
#define Module_HelpVersion "2.15 (10 Feb 2021)"
#define Module_LibraryVersionInfo "2:15"
#define Module_FullVersion "2.16"
#define Module_HelpVersion "2.16 (13 Mar 2021)"
#define Module_LibraryVersionInfo "2:16"
This diff is collapsed.
; 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
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; See the License for the specific language governing permissions and
; limitations under the License.
; > s.EnsureRMA
; Make sure that RMA has at least 16K free so that !Maestro can start.
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:ModHand
GET Hdr:Proc
Entry "r0-r3"
MOV r0, #ModHandReason_RMADesc
SWI XOS_Module
CMP r3, #16*1024 ; If free space >= 16K then
EXIT GE ; do nothing.
RSB r3, r3, #16*1024 ; Otherwise, find out how much we need.
CMP r3, r2 ; If we need less than the size of the largest block then
ADDLE r3, r2, #1024 ; claiming would not increase RMA size so ask for more than largest.
MOV r0, #ModHandReason_Claim
SWI XOS_Module
MOVVC r0, #ModHandReason_Free
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