Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - OmerMor

Pages: 1 [2] 3
16
Yay, finally I got this pull request committed: https://github.com/scummvm/scummvm/pull/770
This is not my first contribution to ScummVM, but it's the first that contains real code...

* OmerMor is feeling proud

17
SCI Syntax Help / VOCABASE.VC
« on: June 20, 2016, 05:27:10 PM »


;  VOCABASE.TXT:  Basic word dictionary file
;  -----------------------------------------
;
;  for   Sierra On-line, 12/16/88
;        source file Vocabase.vc converted to new syntax 1/3/89
;
;  by    Pablo Ghenis, Parsemaster extraordinaire.
;
;
;  Special mention goes to Robert Fischbach for blazing the trail with the 
;  first sanely organized (!?) vocabulary file in Sierra On-line's history
;
;
;  Parts of speech recognized are:
;
;     ARTicle
;     CONJunction
;     PRONoun
;     ASSociative preposition
;     POSitional preposition
;     ADVerb
;     AUXVerb
;
;     ADJective
;     VERB
;     NOUN
;
;  Word numbers 1 to 999 are reserved for "system level" words, namely those
;  of the first seven classes above. Please do not modify this area, if a
;  word or part of speech is missing for any of these words let ME know and
;  I will add it ASAP; that way others may also benefit from the update.

;  Word numbers 4000 to 4095 are reserved for system hooks and kludges, If
;  you dare to use these your actors will forever stutter and your
;  lexical karma will never be the same.

;  This leaves word numbers 500 to 3999 for ADJectives, VERBS and NOUNS, which
;  is all you should HAVE to define for your game. My recommendation is to
;  allocate those numbers as follows:
;
;   500- 999   ADJectives
;  1000-1999   VERBs
;  2000-3999   NOUNs
;
;
;  Formatting suggestion if not already using the vocab preprocessor:
;  newlines are cheap, leave a blank line between distinct words,
;  cluster only synonyms


;***************************************************************************
;
;  DIRECTORY:
;
;     ART            1+
;     CONJ           50+
;     PRON           100+
;     ASS            150+
;     POS            200+
;     ADV            300+
;     AUXV           400+
;
;     system         4000+
;     end of world   4095
;
;  recommended for user file:
;
;     ADJ            500+
;     VERBS          1000+
;     NOUNS          2000+
;
;***************************************************************************
;***************************************************************************
;
;  ART(icles)
;  **********

(#art #NUMBER 1
   
   the
   a
   an
   
   ;some spanish articles for Leisure Suit Larry
   ;--------------------------------------------
   
   el
   la
   los
   
);#art

;***************************************************************************
;
;  CONJ(unctions)
;  **************

(#conj   #NUMBER 50
   
   and
   or
   nor
   ++    ;of
   if
   but
   
);#conj
;***************************************************************************
;
;  proNOUNs:   any of these will get translated to the root of the last
;  ********    previous sentence's direct object



(#pron   #NUMBER 100

   it   
   this 
   these
   that 
   those
   them 
   themselves
   him   
   himself
   her
   herself
   
);#pron

   ;;we really use the following pronouns as nouns sooo...
   
(#noun
   
   (#synonyms  I  me    myself)
   he   
   she   
   they 
   (#synonyms  you   ya)   
   yourself
   we   
   us   
   ourselves
   
);#noun

;***************************************************************************
;
;  ASS(ociative prepositions)
;  **************************

(#ass #NUMBER 150

   until
   while
   with
   without
   for
   about
   
);#ass

;***************************************************************************
;
;  POS(itional prepositions)
;  **************************

(#pos #NUMBER 200

   to       ;changed from #ass by Pablo 9/4/89
   from
   
   at
   (on upon)
   onto
   off
   (in   into  inside)
   (out  outer outside)
   (under   underneath  below beneath)
   between
   across
   (over above)
   through
   (#noun behind)
   ahead
   (#noun #verb   back)
   front
   around
   here
   there
   everywhere
   nowhere
   somewhere
   forward
   backward
   toward
   by
   near
   far
   
   of
   
);#pos

;***************************************************************************
;
;  ADV(erbs)
;  *********

(#adv #NUMBER 300

   how
   where
   when
   why
   what
   who
   soon
   sooner
   soonest
   now
   late
   later
   latest
   (#synonyms  fast  quickly  quick speedy)
   (#synonyms  slow  slowly   sluggishly)
   normal
   (#synonyms  abnormal strange)
   so
   again
   always
   never
   then
   up
   down
   together
   please
   away
   along
   overboard
   not
   almost
   (#synonyms  yes   y  ok affirmative (#noun roger)  sure certainly aye yep)
   (#synonyms  no n negative nay nope)
   (#synonyms  maybe dunno possibly probably)
   
);#adv

;***************************************************************************
;
;  AUXV(erbs)
;  **********

(#auxv   #NUMBER 400

   ;to do or not to do much ado about nothing...)
   do
   did
   (#noun   does)
   ;----------------------
   
   ;to be or not to be...
   be
   (is are youre wheres)
   (am Im)  ;Im=I'm
   ++             ; Removed "are" to make it a synonym for "is"
   was
   ;----------------------
   (#noun   can)
   (#noun   will)
   would
   go
   (stop cease)
   (start   begin)
   
   ;say what!??
   say
   says
   said
   ;----------------------
   
   ;let em have it
   have
   has
   had
   ;----------------------
   
   tell     ;tell man to break window     -> break<tell<man<to/window
   use      ;USE wire to CONNECT circuit  -> connect<use<wire<to/circuit
   
   (shout yell scream holler)
   
);#auxv


;***************************************************************************
;
;  System-level   hacks
;  ******************

;These numbers MUST be present to work around an obscure bug in findWord:
;

(#NUMBER 4000  #noun

   (#synonyms  0  zero  o)
   (#synonyms  1  one)
   (#synonyms  2  two)
   (#synonyms  3  three)
   (#synonyms  4  four)
   (#synonyms  5  five)
   (#synonyms  6  six)
   (#synonyms  7  seven)
   (#synonyms  8  eight)
   (#synonyms  9  nine)
   
   (#synonyms  10 ten)
   
   (#synonyms  11 eleven)
   (#synonyms  12 twelve)
   (#synonyms  13 thirteen)
   (#synonyms  14 forteen fourteen)
   (#synonyms  15 fifteen)
   (#synonyms  16 sixteen)
   (#synonyms  17 seventeen)
   (#synonyms  18 eighteen)
   (#synonyms  19 nineteen ninteen)
   
   (#synonyms  20 twenty)
   (#synonyms  30 thirty)
   (#synonyms  40 forty)
   (#synonyms  50 fifty)
   (#synonyms  60 sixty)
   (#synonyms  70 seventy)
   (#synonyms  80 eighty)
   (#synonyms  90 ninety)
   
   (#synonyms  100   hundred)
   (#synonyms  1000  thousand)
   (#synonyms  1000000  million)
   
   
);#NUMBER 4000

;Here come the hacks from the deep!

(#NUMBER 4093

   ;4093    Any number not explicitly in the vocabulary:
   ;        hard-coded into interpreter)
   ;
   (#noun unknownNumber)
   
   ;4094    Nothing a user would type could match this word:
   ;        hard-coded into interpreter)
   ;
   (#synonyms  !* NOWORD)
   
   ;4095    Anything will match this word:
   ;        hard-coded into interpreter)
   ;
   (#synonyms
      #noun #verb #adj  #pos  #conj #art  #adv  #auxv #pron
      *  ANY   ANYWORD
   )
)
;************************ END OF BASE VOCABULARY ***************************

18
SCI Development Tools / Sierra's Internal SCI Tools
« on: June 17, 2016, 07:41:20 PM »
Hi,
here's my collection of Sierra's internal SCI tools (I have some AGI tools as well - stay tuned).
It's far from complete, but it spans from as early as 1987 to as late as 1996.
Some of the tools are available in several versions. For these, I suffixed their name with an underscore (_) and their version or their date (in case no version was available), e.g. SC_4.100.EXE.
Some of the tools had a protection that only allowed them to be run from a specific network share. I removed that protection.

Here're the descriptions for the tools that have it:
AMIGAPAL.EXE -
ATOS.EXE     - AGI to SCI source code translator
AUDADD.EXE   - Add audio header
AUDAIFF.EXE  -
AUDBITS.EXE  -
AUDCHANS.EXE - AUDCHANS converts stereo audio files to mono or visa-versa or reports the number of channels that audio files currently have.
AUDCHECK.EXE -
AUDCOMP.EXE  - Audio compress
AUDDCOMP.EXE - AUDDCOMP is used to decompress audio volumes during install.
AUDDISK.EXE  - Flag AUD files for disk-resident playback
AUDMAP.EXE   -
AUDMEM.EXE   - Flag AUD files for memory-resident playback
AUDPCM.EXE   - Decompress AUD to SOL files
AUDPLAY.EXE  - Audio player
AUDRATE.EXE  - Change or report rate of AUD files
AUDSCRAM.EXE - Audio scrambler
AUDSOL.EXE   -
AUDSTRIP.EXE - Strip audio header
AUDSYNC.EXE  - Remove sync editor info
AUDUCOMP.EXE - Audio decompress
AUDUSCRM.EXE - Audio unscrambler
AUDWAVE.EXE  - Rewrite AUD files in Microsoft's WAVE format
BASE36.EXE   - BASE36 converts message components into base-36 filenames or vice-versa.
BASENAME.EXE -
BETAW.EXE    -
BIT2CEL.EXE  - Convert 16 color bitmap to 16 color cel
BIT2LBM.EXE  -
BLAST.EXE    - Sound Blaster Record/Playback Utility
BUILDADL.EXE - Builds 3.PAT for use with Sierra's ADL (128 patch) driver.
BUILDGEN.EXE - Builds 4.PAT for use with Sierra's GSMIDI driver.
BUILDTDY.EXE - TANDY PATCH EDITOR
CE.EXE       - Cursor Editor
CEL2BIT.EXE  -
CEL2LBM.EXE  - Converts 256 Color Cel to LBM file
CEL2NEW.EXE  -
CEL2PCX.EXE  - Converts Cel to PCX file
CEL2RE.EXE   - Converts 256 Color Cel to Targa 16 file (.T16) for RE
CEL2TGA.EXE  - Converts 256 Color Cel to Targa 16 file (.T16)
CHKVIEW.EXE  - Checks integrity of view files
CVTPAL.EXE   -
CVTSCI.EXE   - Converts SC scripts to new syntax
DC.EXE       - Word derivative Compiler
DIMWIT.EXE   -
DIMWITSX.EXE -
DROPTGA.EXE  -
FE.EXE       - Font Editor
FIXCEL.EXE   - Correct 256 color cel file(s)
FIXVIEW.EXE  - Correct 256 color view file(s)
FIXVIEWS.EXE - Correct all 256 color view files
FORCEPAL.EXE -
GETTGA.EXE   -
GETTGA16.EXE -
INC_IT.EXE   - Increments the ASCII version number in 'version_file'.
INCVER.EXE   - Increment version number
LBM2BIT.EXE  -
LBM2CEL.EXE  - Converts LBM file to Cel file
LBM2PAL.EXE  - Creates new palette file from LBM file
LBM2VIEW.EXE - Converts LBM file back to 256 color view file
MACPIC.EXE   -
MACVIEW.EXE  -
MAKCDVOL.EXE -
MAKECEL.EXE  -
MAKEMAPS.EXE - MAKEMAPS reads individual audio and sync files creating RESOURCE.AUD and room-specific *.MAP resource files.
MAKEP16.EXE  - Converts 256 Color Pic to 16 color pic (controls & priority)
MAKEPIC.EXE  - Makes an SCI32 P56 file from 2 pcx files
MAKEV.EXE    - Converts any view to use colors in new.pal
MAKEV16.EXE  - Converts 256 Color View to 16 color view
MAKEV256.EXE -
MAKEV64.EXE  - Converts 256 Color View to standard 64 color view
MAKEV72.EXE  - Converts 256 Color View to standard 72 color view
MAKEVAUD.EXE -
MAKEVOLS.EXE -
MAKEVSEQ.EXE -
MATCHV.EXE   -
MC.EXE       - Message Compiler
ME.EXE       - SCI Message Editor
ME_ALT.EXE   - (Music Editor? Original name was ME)
MEAUDFIL.EXE - Message Audio File Utility
MECNV3_4.EXE - Message Editor Conversion v.3 to v.4
MEDUMP.EXE   - Message File Dumper
MESCRIPT.EXE -
MESSAGES.EXE -
MEXLTDIF.EXE - Message File Translation Differencer
MOVIE.EXE    -
MOVIE256.EXE -
MSCIV.EXE    -
MTEST.EXE    - Music Test
NEWPAL.EXE   - Creates new palette file from LBM file
NIGHTPAL.EXE - Creates nighttime palette from file
NO255.EXE    -
NORM.EXE     - This program normalizes audio files.
ONELINE.EXE  -
PAL.EXE      - Allows you to redefine the standard palette in pic file(s)
PAL2NEW.EXE  -
PAL2OLD.EXE  - Conversion of New Pallete to Old
PALPIC.EXE   - Allows you to redefine the standard palette in pic file(s)
PALVIEW.EXE  - Allows you to redefine the standard palette in view file(s)
PCX2CEL.EXE  - Converts PCX to Cel file
PCX2VIEW.EXE - Converts PCX file back to 256 color view file
PE.EXE       - Picture Editor (16 colors)
PE256.EXE    - Picture Editor (256 colors)
PIC2CEL.EXE  - Program converts 256 color PICTOR files to 256 color cels
PIC2NEW.EXE  -
PIC2PCX.EXE  - Converts Pic to PCX file
PICTEST.EXE  -
PMAKEVOL.EXE -
PSCIDH.EXE   -
PSCIDHV.EXE  -
PUTTGA.EXE   -
RAW2MST.EXE  -
RE.EXE       -
READPAL.EXE  -
REDOPIC.EXE  -
RENRESRC.EXE - Resource File Renamer
RESBUILD.EXE -
RESBUST.EXE  -
RESDIR.EXE   -
RESMIX.EXE   -
RMESSAGE.EXE - SCI message translator
SC.EXE       - Script Compiler
SCI.EXE      - Script Interpreter (debug)
SCID.EXE     -
SCIDH.EXE    -
SCIH.EXE     -
SCIP.EXE     -
SCITESTR.EXE - Script Interpreter (debug, menu bars enabled)
SCIUB.EXE    -
SCIV.EXE     -
SCIWH.EXE    -
SCPP.BAT     - front-end batch file for SCPPRINT.EXE
SCPPRINT.EXE - a pretty printer for SCRIPT code
SE.EXE       - Sound Editor
SIERRA.EXE   - Script Interpreter (no debug)
SIERRAH.EXE  -
SIERRAM.EXE  - Script Interpreter (no debug, menu bars enabled)
SIERRAWH.EXE -
SMF.EXE      -
SMIDI.EXE    -
SND_EDIT.EXE - SMF SOUND FILE EDITOR
STAMPVER.EXE -
STAMPVOL.EXE -
SYNCONLY.EXE -
TC.EXE       -
TESTPAL.EXE  -
TGA2MST.EXE  -
TGAPIC.EXE   -
V16LBM.EXE   - Converts 16 color views to Lbm files
V16TO72.EXE  - Converts 16 Color View to standard 72 color view
V256LBM.EXE  - Converts 'Full Color' views to Lbm files
VC.EXE       - Vocabulary Compiler
VCPP.EXE     -
VE.EXE       - View Editor (16 colors)
VE256.EXE    - View Editor (256 colors)
VIEW2LBM.EXE - Converts 256 color views to Lbm files
VIEW2NEW.EXE -
VIEW2OLD.EXE - Conversion of New View Format to Old View Format
VIEW2PCX.EXE - Converts 256 color view to PCX file
VIEWCHK.EXE  - View File Comparison Utility
VIEWMARK.EXE -
VIEWPAL.EXE  - Allows you to redefine the standard palette in view file(s)
VOLCHECK.EXE -
WE.EXE       -
WHATSON.EXE  -
XE.EXE       -
XE_RAVE.EXE  -
XEBATCH.EXE  -
XMESSAGE.EXE - SCI message extractor


I hope there'll be a community effort to document the tools more thoroughly.

Enjoy!  8)

19

      Subject: Recommended Procedures for SCI Game Programming Coordinators
     
      Date:    Monday January 30, 1989
     
      From:    Pablo Ghenis for SCI Development Group
     
      To:      Scott Murphy
               Corey Cole
               Chris Iden
               Warren Schwader
               All Game Programming Coordinators
               
      cc:      Ken Williams
               Rick Cavin
               Dale Carlson
               All SCI programmers
     
     
      As we approach the release date for some products currently under
      development, we can expect a greater potential for conflict among
      the following equally worthy goals:
     
      - To fix system bugs or shortcomings and provide enhancements in 
        order to facilitate further game development.
       
      - To isolate game developers from system instabilities while the
        above goal is being met by the system developers.
       
     
     
      The Programming Coordinators for each game can avoid disruptions
      in their projects by taking the following steps:
     
      1. Create an isolated system directory for each project and load
         a stable copy of the system into it. Also create a backup for
         it and a directory for executables.
         
         Example:
                     >md \games\ice\system
                     >md \games\ice\system\old
                     >md \games\ice\tools
                     
      2. Make sure that all "where" files are written in terms of s:
         instead of \games\sci\system. Everyone's autoexec.bat file
         should contain the line "set sinclude=s:"
         
      3. To save a version of tools such as the compilers and
         interpreter, just copy them to your project's tool directory.
         
      4. To give your project's tools precedence over the main version,
         type in a line like the following one, which should be
         appended to all project members' autoexec.bat files:
         
         pushpath g:\games\ice\tools
     
     
     
     
      5. To freeze a version of the system for your project, type in a
         line like the following one:
         
         pushsys \games\sci\system \games\ice\system \games\ice\system\old
         
         This action might require the game to be rebuilt.
         
         Everyone working on the project should have s: mapped to the
         project's system directory. This can be done by editing the
         user login file using SYSCON on the net, or by appending to
         autoexec.bat a line like the following one:
         
         map s:=g:\games\ice\system
         
      6. If the above step is determined to be premature, it can be
         undone by typing a line like the following one:
         
         savesys \games\ice\system\old \games\ice\system
     
         This action might require the game to be rebuilt.
         
      7. Software updates should be performed and tested by the project
         coordinator at times that will not hurt the team's
         productivity, with enough time to rebuild, test and even revert
         and rebuild again if needed.
         
     
      While the SCI development team will carefully test all system
      changes to avoid introducing problems, its very flexibility makes
      it impossible to test all cases. It will be the responsibility of
      each project's coordinator to follow the above (or equivalent)
      procedures.
     
      I have  provided the push*.bat and save*.bat files mentioned
      above to  facilitate this task; they are available in
      x:\public\tools. We  strongly recommend that all projects update
      to the current system version as quickly as possible, since the
      purpose of system  changes is to correct bugs and provide
      significant enhancements.
     

20
SCI Syntax Help / (More) Official SCI Documentation
« on: May 15, 2016, 03:36:11 PM »
I just got permission to publish a few more SCI documents. I hope you'll enjoy this batch!

21
AGI Community How To's & Tutorials / Official AGI Documentation
« on: April 25, 2016, 05:49:28 AM »
I don't think this was ever leaked before...
Enjoy!  8)

(Documents are dated 1986-05-30)

22
I'm trying to re-compile a decompiled script (KQ6 Spanish, script# 921).

The compiler gives the following error:
Quote
[Error]: &rest cannot be used if the send target itself contains nested procedure calls or sends. Assign the result of the procedure call or send to a temporary variable and use that instead.  Line: 17, col: 42

The relevant procedure is this:
Code: [Select]
(procedure (proc921_0 &tmp newPrint)
((= newPrint (Print new:)) addText: &rest init:)
)

I've got 2 questions:
  • Why does the decompiler output this if it's not valid?
  • What can I do to fix this?

23
SCI Syntax Help / Disassembly Help
« on: February 23, 2016, 02:24:56 PM »
Hi,
I'm trying to figure out some code in Pepper's Adventures in Time.
In script #0 (Main.sc), the following procedure failed to decompile, and I got the following assembly code:
Code: [Select]
(procedure (localproc_0ae6 param1 param2 &tmp temp0 temp1 temp2 temp3)
(asm
ldi      0
sat      temp0
code_0aec:
lst      temp0
lsp      argc
ldi      1
sub     
lt?     
bnt      code_0b5a
lat      temp0
lapi     param2
sat      temp1
push   
ldi      16
div     
sat      temp2
pushi    1
lst      temp1
ldi      16
mod     
shl     
sat      temp3
lsp      param1
dup     
ldi      1
eq?     
bnt      code_0b1a
jmp      code_0b5a
jmp      code_0b55
code_0b1a:
dup     
ldi      2
eq?     
bnt      code_0b2f
lat      temp2
lsgi     global134
lat      temp3
bnot   
and     
push   
lat      temp2
sagi     global134
jmp      code_0b55
code_0b2f:
dup     
ldi      0
eq?     
bnt      code_0b43
lat      temp2
lsgi     global134
lat      temp3
or     
push   
lat      temp2
sagi     global134
jmp      code_0b55
code_0b43:
dup     
ldi      3
eq?     
bnt      code_0b55
lat      temp2
lsgi     global134
lat      temp3
xor     
push   
lat      temp2
sagi     global134
code_0b55:
toss   
+at      temp0
jmp      code_0aec
code_0b5a:
lat      temp2
lsgi     global134
lat      temp3
and     
ret     
)
)

Any reverse engineering expert around who could decipher that?
Thanks!

24
SCI Syntax Help / Freddy Pharkas (Mac) easter egg
« on: February 19, 2016, 02:20:09 PM »
Someone over the scummvm forums is trying to unveil a rare easter egg in the Mac version of Freddy Pharkas.
You can read his question here: http://forums.scummvm.org/viewtopic.php?t=14014

I tried to decompile or disassemble the relevant script (270), but since it's a mac it uses a different format (I think big endian instead of little endian), and existing tools choke on it.
Scummvm is able to run the game, and I managed to disassemble some functions with their debugger, but I still find it hard to work that way, and I'm not that great at understand the SCI assembly.

Here is what I managed to disassemble:
Code: [Select]
rm270::doit

002c:0501: lap 01
002c:0503: aTop 14
002c:0505: push
002c:0506: dup
002c:0507: ldi 00
002c:0509: eq?
002c:050a: bnt 24  [0530]
002c:050c: pushi 018b
002c:050f: push0
002c:0510: lag 01
002c:0512: send 04
002c:0514: pushi 6f
002c:0516: push0
002c:0517: lofsa 00c6
002c:051a: send 04
002c:051c: pushi 00aa
002c:051f: pushi 06
002c:0521: dup
002c:0522: push2
002c:0523: push0
002c:0524: push0
002c:0525: pushSelf
002c:0526: pushi 010e
002c:0529: lag 5b
002c:052b: send 10
002c:052d: jmp 0125  [0655]
002c:0530: dup
002c:0531: ldi 01
002c:0533: eq?
002c:0534: bnt 15  [054b]
002c:0536: pushi 00aa
002c:0539: pushi 06
002c:053b: dup
002c:053c: push0
002c:053d: pushi 07
002c:053f: push0
002c:0540: pushSelf
002c:0541: pushi 010e
002c:0544: lag 5b
002c:0546: send 10
002c:0548: jmp 010a  [0655]
002c:054b: dup
002c:054c: ldi 02
002c:054e: eq?
002c:054f: bnt 12  [0563]
002c:0551: pushi 28
002c:0553: push1
002c:0554: pushi 0bb6
002c:0557: pushi 27
002c:0559: push1
002c:055a: pushSelf
002c:055b: lofsa 054e
002c:055e: send 0c
002c:0560: jmp 00f2  [0655]
002c:0563: dup
002c:0564: ldi 03
002c:0566: eq?
002c:0567: bnt 13  [057c]
002c:0569: pushi 00aa
002c:056c: pushi 05
002c:056e: pushi 06
002c:0570: push0
002c:0571: pushi 08
002c:0573: push0
002c:0574: pushSelf
002c:0575: lag 5b
002c:0577: send 0e
002c:0579: jmp 00d9  [0655]
002c:057c: dup
002c:057d: ldi 04
002c:057f: eq?
002c:0580: bnt 12  [0594]
002c:0582: pushi 28
002c:0584: push1
002c:0585: pushi 0bb7
002c:0588: pushi 27
002c:058a: push1
002c:058b: pushSelf
002c:058c: lofsa 054e
002c:058f: send 0c
002c:0591: jmp 00c1  [0655]
002c:0594: dup
002c:0595: ldi 05
002c:0597: eq?
002c:0598: bnt 13  [05ad]
002c:059a: pushi 00aa
002c:059d: pushi 05
002c:059f: pushi 06
002c:05a1: push0
002c:05a2: pushi 09
002c:05a4: push0
002c:05a5: pushSelf
002c:05a6: lag 5b
002c:05a8: send 0e
002c:05aa: jmp 00a8  [0655]
002c:05ad: dup
002c:05ae: ldi 06
002c:05b0: eq?
002c:05b1: bnt 13  [05c6]
002c:05b3: pushi 00aa
002c:05b6: pushi 05
002c:05b8: pushi 06
002c:05ba: push0
002c:05bb: pushi 0a
002c:05bd: push0
002c:05be: pushSelf
002c:05bf: lag 5b
002c:05c1: send 0e
002c:05c3: jmp 008f  [0655]
002c:05c6: dup
002c:05c7: ldi 07
002c:05c9: eq?
002c:05ca: bnt 14  [05e0]
002c:05cc: pushi 00e1
002c:05cf: push0
002c:05d0: pushi 00a1
002c:05d3: push2
002c:05d4: class 1c
002c:05d6: push
002c:05d7: pushSelf
002c:05d8: lofsa 0336
002c:05db: send 0c
002c:05dd: jmp 0075  [0655]
002c:05e0: dup
002c:05e1: ldi 08
002c:05e3: eq?
002c:05e4: bnt 19  [05ff]
002c:05e6: pushi 03
002c:05e8: push1
002c:05e9: push0
002c:05ea: pushi 04
002c:05ec: push1
002c:05ed: pushi 0f
002c:05ef: pushi 00a1
002c:05f2: push2
002c:05f3: class 1d
002c:05f5: push
002c:05f6: pushSelf
002c:05f7: lofsa 0336
002c:05fa: send 14
002c:05fc: jmp 0056  [0655]
002c:05ff: dup
002c:0600: ldi 09
002c:0602: eq?
002c:0603: bnt 0e  [0613]
002c:0605: pushi 66
002c:0607: push0
002c:0608: lofsa 0336
002c:060b: send 04
002c:060d: ldi 02
002c:060f: aTop 1c
002c:0611: jmp 42  [0655]
002c:0613: dup
002c:0614: ldi 0a
002c:0616: eq?
002c:0617: bnt 12  [062b]
002c:0619: pushi 00aa
002c:061c: pushi 05
002c:061e: pushi 06
002c:0620: push0
002c:0621: pushi 0b
002c:0623: push0
002c:0624: pushSelf
002c:0625: lag 5b
002c:0627: send 0e
002c:0629: jmp 2a  [0655]
002c:062b: dup
002c:062c: ldi 0b
002c:062e: eq?
002c:062f: bnt 0e  [063f]
002c:0631: pushi 018c
002c:0634: push0
002c:0635: lag 01
002c:0637: send 04
002c:0639: ldi 01
002c:063b: aTop 1a
002c:063d: jmp 16  [0655]
002c:063f: dup
002c:0640: ldi 0c
002c:0642: eq?
002c:0643: bnt 10  [0655]
002c:0645: pushi 6e
002c:0647: push0
002c:0648: pushi 66
002c:064a: push0
002c:064b: lofsa 00c6
002c:064e: send 08
002c:0650: pushi 6f
002c:0652: push0
002c:0653: self 04
002c:0655: toss
002c:0656: ret
----------------------------------------
macThing::changeState

002c:0501: lap 01
002c:0503: aTop 14
002c:0505: push
002c:0506: dup
002c:0507: ldi 00
002c:0509: eq?
002c:050a: bnt 24  [0530]
002c:050c: pushi 018b
002c:050f: push0
002c:0510: lag 01
002c:0512: send 04
002c:0514: pushi 6f
002c:0516: push0
002c:0517: lofsa 00c6
002c:051a: send 04
002c:051c: pushi 00aa
002c:051f: pushi 06
002c:0521: dup
002c:0522: push2
002c:0523: push0
002c:0524: push0
002c:0525: pushSelf
002c:0526: pushi 010e
002c:0529: lag 5b
002c:052b: send 10
002c:052d: jmp 0125  [0655]
002c:0530: dup
002c:0531: ldi 01
002c:0533: eq?
002c:0534: bnt 15  [054b]
002c:0536: pushi 00aa
002c:0539: pushi 06
002c:053b: dup
002c:053c: push0
002c:053d: pushi 07
002c:053f: push0
002c:0540: pushSelf
002c:0541: pushi 010e
002c:0544: lag 5b
002c:0546: send 10
002c:0548: jmp 010a  [0655]
002c:054b: dup
002c:054c: ldi 02
002c:054e: eq?
002c:054f: bnt 12  [0563]
002c:0551: pushi 28
002c:0553: push1
002c:0554: pushi 0bb6
002c:0557: pushi 27
002c:0559: push1
002c:055a: pushSelf
002c:055b: lofsa 054e
002c:055e: send 0c
002c:0560: jmp 00f2  [0655]
002c:0563: dup
002c:0564: ldi 03
002c:0566: eq?
002c:0567: bnt 13  [057c]
002c:0569: pushi 00aa
002c:056c: pushi 05
002c:056e: pushi 06
002c:0570: push0
002c:0571: pushi 08
002c:0573: push0
002c:0574: pushSelf
002c:0575: lag 5b
002c:0577: send 0e
002c:0579: jmp 00d9  [0655]
002c:057c: dup
002c:057d: ldi 04
002c:057f: eq?
002c:0580: bnt 12  [0594]
002c:0582: pushi 28
002c:0584: push1
002c:0585: pushi 0bb7
002c:0588: pushi 27
002c:058a: push1
002c:058b: pushSelf
002c:058c: lofsa 054e
002c:058f: send 0c
002c:0591: jmp 00c1  [0655]
002c:0594: dup
002c:0595: ldi 05
002c:0597: eq?
002c:0598: bnt 13  [05ad]
002c:059a: pushi 00aa
002c:059d: pushi 05
002c:059f: pushi 06
002c:05a1: push0
002c:05a2: pushi 09
002c:05a4: push0
002c:05a5: pushSelf
002c:05a6: lag 5b
002c:05a8: send 0e
002c:05aa: jmp 00a8  [0655]
002c:05ad: dup
002c:05ae: ldi 06
002c:05b0: eq?
002c:05b1: bnt 13  [05c6]
002c:05b3: pushi 00aa
002c:05b6: pushi 05
002c:05b8: pushi 06
002c:05ba: push0
002c:05bb: pushi 0a
002c:05bd: push0
002c:05be: pushSelf
002c:05bf: lag 5b
002c:05c1: send 0e
002c:05c3: jmp 008f  [0655]
002c:05c6: dup
002c:05c7: ldi 07
002c:05c9: eq?
002c:05ca: bnt 14  [05e0]
002c:05cc: pushi 00e1
002c:05cf: push0
002c:05d0: pushi 00a1
002c:05d3: push2
002c:05d4: class 1c
002c:05d6: push
002c:05d7: pushSelf
002c:05d8: lofsa 0336
002c:05db: send 0c
002c:05dd: jmp 0075  [0655]
002c:05e0: dup
002c:05e1: ldi 08
002c:05e3: eq?
002c:05e4: bnt 19  [05ff]
002c:05e6: pushi 03
002c:05e8: push1
002c:05e9: push0
002c:05ea: pushi 04
002c:05ec: push1
002c:05ed: pushi 0f
002c:05ef: pushi 00a1
002c:05f2: push2
002c:05f3: class 1d
002c:05f5: push
002c:05f6: pushSelf
002c:05f7: lofsa 0336
002c:05fa: send 14
002c:05fc: jmp 0056  [0655]
002c:05ff: dup
002c:0600: ldi 09
002c:0602: eq?
002c:0603: bnt 0e  [0613]
002c:0605: pushi 66
002c:0607: push0
002c:0608: lofsa 0336
002c:060b: send 04
002c:060d: ldi 02
002c:060f: aTop 1c
002c:0611: jmp 42  [0655]
002c:0613: dup
002c:0614: ldi 0a
002c:0616: eq?
002c:0617: bnt 12  [062b]
002c:0619: pushi 00aa
002c:061c: pushi 05
002c:061e: pushi 06
002c:0620: push0
002c:0621: pushi 0b
002c:0623: push0
002c:0624: pushSelf
002c:0625: lag 5b
002c:0627: send 0e
002c:0629: jmp 2a  [0655]
002c:062b: dup
002c:062c: ldi 0b
002c:062e: eq?
002c:062f: bnt 0e  [063f]
002c:0631: pushi 018c
002c:0634: push0
002c:0635: lag 01
002c:0637: send 04
002c:0639: ldi 01
002c:063b: aTop 1a
002c:063d: jmp 16  [0655]
002c:063f: dup
002c:0640: ldi 0c
002c:0642: eq?
002c:0643: bnt 10  [0655]
002c:0645: pushi 6e
002c:0647: push0
002c:0648: pushi 66
002c:064a: push0
002c:064b: lofsa 00c6
002c:064e: send 08
002c:0650: pushi 6f
002c:0652: push0
002c:0653: self 04
002c:0655: toss
002c:0656: ret

Anyone here feels up to it? (lskovlund, I'm looking at you...  ;))

25
  • Ken Williams published a computer graphics programming book for the Apple II (pdf)
  • Mark Crowe was involved with a B-grade horror movie (credits, imdb, review

26
SCI Syntax Help / Sierra's SCI System Scripts
« on: February 11, 2016, 05:03:03 PM »
I decided to release the original system scripts (equivalent to SCI Companion's template game):
https://github.com/OmerMor/SCI16

The newest script (ACTOR.SC) has a timestamp of 1993-12-08.

Since it is a copyrighted work, I don't know how long I can keep it online. I hope nobody would notice/mind it. In the meantime you're welcome to take a look.
I hope it would help us all understand the class system better.

Omer.

27
Check out my video:


I explained it all in the video's description, but I'll paste it here as well:
The Colonel's Bequest features a very elusive easter egg of a flying statue.
Using SCI Companion (http://sciprogramming.com/community/index.php?topic=1420.0), I was able to decompile the game's scripts and figure out what triggers it.
It turned out, the egg will trigger randomly when entering the room outside the back of the mansion, with a chance of 1:200.
So this very low chance explains the very few reports of this egg.

I changed the script to increase the triggering probability, and was finally able to trigger the egg.

But wait - there's more! =)

The script refers to an airplane, and not a statue. Looking at the object's view (104) I noticed it contains 3 loops. The first is a statue, the second shows the benches, and the third is a never-before-seen airplane.
The script sets the airplane's loop to 3, but since we use zero-based counting, the airplane's loop should've been 2.
Fixing the script once again, I was able to trigger the egg as it was meant to be seen.

For the curious, here are the relevant snippets from the decompiled script: http://pastebin.com/DbqCf3p6

The patched script can be downloaded from here:
https://drive.google.com/file/d/0B5j-_ZMS8_UoODNSczlEY0o0TUU/view?usp=sharing
The archive contains 2 flavors: the original flying statue, and the fixed airplane.
To use it, simply rename the one you want to SCRIPT.004, put it in the game's folder, and run the game.

28
SCI Development Tools / Decompiler Changes
« on: December 17, 2015, 03:36:33 AM »
troflip,
I compiled the latest SciCompanion version, and tried the decompiler with the christmas demo.
I noticed it decompiled many scripts a bit differently.
I have a question about one of these changes.

In room 950, method passChecks, the previous decompiler gave this code:
Code: [Select]
    (method (passedChecks param1)
        (var temp0)

        (if (<= param1 4)
            verbChecks1
        )(else
            verbChecks2
        )
        (if ((not ((not (& (= temp0 (& (>> verbChecks2 (* 4 (% (- param1 1) 4))) $000f)) $0008) or (self:isNotHidden())) and (not (& temp0 $0004) or (self:farCheck()))) or not (not (& temp0 $0002) or (self:nearCheck()))) or not (& temp0 $0001))
        )(else
            (self:facingMe())
        )
    )

The new decompiler, gave this:
Code: [Select]
(method (passedChecks param1)
(var temp0)
(if ((((not (& (= temp0 (& (>>
(if (<= param1 4)
verbChecks1
)(else
verbChecks2
)
 (* 4 (% (- param1 1) 4))) $000f)) $0008) or (self:isNotHidden())) and (not (& temp0 $0004) or (self:farCheck()))) and (not (& temp0 $0002) or (self:nearCheck()))) and not not (& temp0 $0001))

(self:facingMe())
)
)

Being a non-expert in SCI, I wonder what does the statement 'verbChecks1' means?
I noticed in the disassembly it calls ptoa (push to accumulator). Doesn't that have side effects? If so, then the new decompiled version behaves differently?

29
Everything-Else / The Habitat - Tech Transfer
« on: December 12, 2015, 11:15:20 AM »
Just found this cool piece of gaming history.
Lucas Art's Habitat was a very early attempt at online community/rpg, a bit like Sierra's ImagiNation Network.

In 1989 Lucas Arts licensed the technology to Fujitsu, and today I found a document used for this technology transfer.
It makes a very cool read.


30
SCI Development Tools / Leaked Original SCI Source
« on: November 26, 2015, 03:34:56 PM »
Hi,
I got my hands on leaked sci source code. Unfortunately I can't share it in its entirety.
Please don't try to pressure me on this.

I will however share a few bits. Hopefully it'll help us all understand SCI better.

Here's the SAVE.SC script:
Code: [Select]
;;;;
;;;;  SAVE.SC
;;;;
;;;;  (c) Sierra On-Line, Inc, 1992
;;;;
;;;;  Author:  Jeff Stephenson
;;;;  Updated: Brian K. Hughes
;;;;
;;;;  Classes which create the save/restore game user interface.  Also
;;;;  contains a number of instances of Dialogs and associated DItems
;;;;  used in the interface.
;;;;
;;;;  Classes:
;;;;     SRDialog
;;;;     Save
;;;;     Restore


(script# SAVE)


(include "990.shm")

(define  GAMESSHOWN 8)     ;the number of games displayed in the selector
(define  MAXGAMES 20)      ;maximum number of games in a save directory
(define  COMMENTSIZE 36)   ;size of user's description of the game
(define  COMMENTBUFF (/ (+ 1 COMMENTSIZE) 2))

(define  DIRECTORYSIZE 29) ;size of the save directory name
(define  DIRECTORYBUFF (/ (+ 1 DIRECTORYSIZE) 2))

(define  BUFFERSIZE (+ (* MAXGAMES COMMENTBUFF) 1))


(procedure
   GetDirectory
   HaveSpace
   GetStatus
   NeedDescription
)

(public
   GetDirectory   0
)

(local
   default
   i
   numGames
   selected
   theStatus
   [butbuf1 15]
   [butbuf2 15]
   [butbuf3 15]
   [butbuf4 15]
   [SRbuf 25]
)



(enum
   RESTORE        ;Restore games
   HAVESPACE      ;Save, with space on disk
   NOSPACE        ;Save, no space on disk but games to replace
   NOREPLACE      ;Save, no space on disk, no games to replace
)

(class SRDialog kindof Dialog
   ;;; The SRDialog class implements the user interface for save/restore.
   ;;; Its subclasses are the specific save and restore game dialogs,
   ;;; Save and Restore.

   (method (dispose)
      (super dispose: &rest)
   )

   (method (init theComment names nums
         &tmp [buf 250]
      )

      ;; Initialize the dialog.

      ; give ourself the system window as our window
      (= window systemWindow)

      ;Re-init our size, with no elements.
      (= nsBottom 0)

      ;Get some files for this directory.
      (= numGames (GetSaveFiles (theGame name?) names nums))
      (if (== numGames -1)
         (return FALSE)
      )

      (= theStatus (GetStatus))

      ;Set up the edit item for saved games.
      (if (== theStatus HAVESPACE)
         (editI
            text: (StrCpy theComment names),
            font: smallFont,
            setSize:,
            moveTo: MARGIN MARGIN
         )
         (self add: editI, setSize:)
      )

      ;Set up the selectorI box.
      (selectorI
         text: names,
         font: smallFont,
         setSize:,
         moveTo: MARGIN (+ nsBottom MARGIN),
         state: dExit
      )

      ;Add four buttons down the side.
      (switch theStatus
         (0
            (Message MsgGet SAVE BUTTON_RESTORE NULL NULL 1 @butbuf1)
         )
         (1
            (Message MsgGet SAVE BUTTON_SAVE NULL NULL 1 @butbuf1)
         )
         (else
            (Message MsgGet SAVE BUTTON_REPLACE NULL NULL 1 @butbuf1)
         )
      )
      (= i (+ (selectorI nsRight?) MARGIN))
      (okI
         text: @butbuf1,
         setSize:,
         moveTo: i (selectorI nsTop?),
         state:
            (if (or
                  (and (== theStatus RESTORE) (not numGames))
                  (== theStatus NOREPLACE)
                )
                  0
            else
               (| dActive dExit)
            )
      )
      (Message MsgGet SAVE BUTTON_DELETE NULL NULL 1 @butbuf2)
      (deleteI
         text:       @butbuf2,
         setSize:,
         moveTo:     i (+ (okI nsBottom?) MARGIN),
         state:      (if (not numGames)
                        0
                     else
                        (| dActive dExit)
                     )
      )
      (Message MsgGet SAVE BUTTON_CHANGE NULL NULL 1 @butbuf3)
      (changeDirI
         text:    @butbuf3,
         setSize:,
         moveTo:  i (+ (deleteI nsBottom?) MARGIN),
         state:   (& (changeDirI state?) (~ dSelected))
      )
      (Message MsgGet SAVE BUTTON_CANCEL NULL NULL 1 @butbuf4)
      (cancelI
         text:       @butbuf4,
         setSize:,
         moveTo:     i (+ (changeDirI nsBottom?) MARGIN),
         state:      (& (cancelI state?) (~ dSelected))
      )

      ;Put these elements into the dialog and size it.
      (self
         add: selectorI okI deleteI changeDirI cancelI,
         setSize:
      )

      ;Use the width of the dialog to size the text which goes into it.
      (switch theStatus
         (0
            (Message MsgGet SAVE SELECT_GAME NULL NULL 1 @buf)
         )
         (1
            (Message MsgGet SAVE TYPE_DESC NULL NULL 1 @buf)
         )
         (else
            (Message MsgGet SAVE DIR_NOROOM NULL NULL 1 @buf)
         )
      )
      (textI
         text: @buf,
         setSize: (- (- nsRight nsLeft) (* 2 MARGIN)),
         moveTo: MARGIN MARGIN
      )

      ;Now move all elements down by the height of the text.
      (= i (+ (textI nsBottom?) MARGIN))
      (self eachElementDo: #move: 0 i)

      ;Add the text to the dialog, and resize.
      (self
         add: textI,
         setSize:,
         center:,
         open: wTitled -1        ;don't save PMAP
;***        open: wTitled 15
      )

      (return TRUE)
   )




   (method  (doit theComment
                  &tmp  fd ret offset
                        [names BUFFERSIZE] [nums (+ MAXGAMES 1)]
                        [str 100] [dir 40]
            )

      ;If restore: is called with a TRUE parameter, do nothing if there
      ;are no saved games.  This allows optionally presenting the user
      ;with his saved games at the start of the game.
      (if
         (and
            (== self Restore)
            argc
            theComment
         )

         (= fd (FileIO fileOpen (Format @str {%ssg.dir} (theGame name?))))
         (if (== fd -1)
            ;no directory -> no saved games
            (return)
         )
         (FileIO fileClose fd)
      )

      (if (not (self init: theComment @names @nums))
         (return -1)
      )

      (repeat
         (= default
            (switch theStatus
               (RESTORE
                  (if numGames okI else changeDirI)
               )
               (HAVESPACE
                  ;Edit item of save games is active if present
                  editI
               )
               (NOSPACE
                  ;If there are save-games to replace, 'Replace'
                  ;button is active.
                  okI
               )
               (else
                  ;Otherwise 'Change Directory' button is active.
                  changeDirI
               )
            )
         )

         (= i (super doit: default))

         (= selected (selectorI indexOf: (selectorI cursor?)))
         (= offset (* selected COMMENTBUFF))
         (cond
            ((== i changeDirI)
               ;; kill save window to save hunk
               (self dispose:)
               (if (GetDirectory curSaveDir)
                  (= numGames
                     (GetSaveFiles (theGame name?) @names @nums)
                  )
                  (if (== numGames -1)
                     (= ret -1)
                     (break)
                  )
               )
               ;; open save back up with new directory
               (self init: theComment @names @nums)
            )

            ((and (== theStatus NOSPACE) (== i okI))
               (self dispose:)
               (if (GetReplaceName doit: (StrCpy theComment @[names offset]))
                  (= ret [nums selected])
                  (break)
               )
               (self init: theComment @names @nums)
            )

            ((and (== theStatus HAVESPACE) (or (== i okI) (== i editI)))
               (if (== (StrLen theComment) 0)
                  (self dispose:)
                  (NeedDescription)
                  (self init: theComment @names @nums)
                  (continue)
               )

               (= ret -1)
               (for  ((= i 0))
                     (< i numGames)
                     ((++ i))

                  (= ret (StrCmp theComment @[names (* i COMMENTBUFF)]))
                  (breakif (not ret))
               )

               (cond
                  ((not ret)
                     (= ret [nums i])
                  )
                  ((== numGames MAXGAMES)
                     (= ret [nums selected])
                  )
                  (else
                     ; find the lowest unused game number
                     (for ((= ret 0)) TRUE ((++ ret))
                        (for ((= i 0)) (< i numGames) ((++ i))
                           (breakif (== ret [nums i])) ; this number is used
                        )
                        (if (== i numGames)  ; checked all entries in nums
                           (break)           ; and none matched
                        )
                     )
                  )
               )
               (break)
            )
           
            ((== i deleteI)
               ;; kill save window to save hunk
               (self dispose:)
               ; confirm deletion
               (if (not
                  ((Print new:)
                     addText:    DEL_TEXT NULL NULL 1 0 0 SAVE,
                     addButton:  FALSE BUTTON_NO NULL NULL 1 0 35 SAVE,
                     addButton:  TRUE  BUTTON_YES NULL NULL 1 50 35 SAVE,
                     init:
                   ))
                  (self init: theComment @names @nums)
                  (continue)
               )
               
               ; open the saved game directory file
               ((= fd (File new:))
                  name: (DeviceInfo MakeSaveDirName @str (theGame name?)),
                  open: fTrunc,
               )
               
               ; (File write:) requires a pointer to the data it is to write,
               ; so need to put values into variables, rather than just
               ; passing them as immediates
               (= ret $0a0a)  ; so both high and low byte is correct

               ; write the number and name of each saved game, except the
               ; one that was selected for deletion
               (for ((= i 0)) (< i numGames) ((++ i))
                  (if (!= i selected)
                     (fd write: @[nums i] 2)
                     (fd writeString: @[names (* i COMMENTBUFF)])
                     (fd write: @ret 1)
                  )
               )

               ; terminate saved game directory with a word of f's
               (= ret -1)
               (fd
                  write: @ret 2,
                  close:,
                  dispose:,
               )

               ; delete the save game file itself
               (DeviceInfo MakeSaveFileName
                     @str (theGame name?) [nums selected]
               )
               (FileIO fileUnlink @str)

               ; reinit to display updated dialog
               (self init: theComment @names @nums)
            )

            ((== i okI)
               (= ret [nums selected])
               (break)
            )

            ((or (== i -1) (== i cancelI))
               (= ret -1)
               (break)
            )

            ((== theStatus HAVESPACE)
               (editI
                  cursor:
                     (StrLen (StrCpy theComment @[names offset])),
                  draw:
               )
            )
         )
      )
      (DisposeScript FILE)
      (self dispose:)
      (DisposeScript SAVE)
      (return ret)
   )

   (procedure (GetStatus)
      (return
         (cond
            ((== self Restore)
               RESTORE
            )
            ((HaveSpace)
               HAVESPACE
            )
            (numGames
               NOSPACE
            )
            (else
               NOREPLACE
            )
         )
      )
   )
)

(class Restore of SRDialog
   (method (init)
      (Message MsgGet SAVE DIALOG_RESTORE NULL NULL 1 @SRbuf)
      (= text @SRbuf)
      (super init: &rest)
   )
)

(class Save of SRDialog
   (method (init)
      (Message MsgGet SAVE DIALOG_SAVE NULL NULL 1 @SRbuf)
      (= text @SRbuf)
      (super init: &rest)
   )
)

(instance GetReplaceName of Dialog

   (method (doit theComment
         &tmp ret [buf1 15] [buf2 15] [buf3 15] [buf4 15]
      )

      ; give ourself the system window as our window
      (= window systemWindow)

      (Message MsgGet SAVE DTEXT_REPLACE NULL NULL 1 @buf1)
      (text1
         text:    @buf1,
         setSize:,
         moveTo:  MARGIN MARGIN
      )
      (self add:text1, setSize:)
      (oldName
         text: theComment,
         font: smallFont,
         setSize:,
         moveTo:MARGIN nsBottom
      )
      (self add:oldName, setSize:)
      (Message MsgGet SAVE DTEXT_WITH NULL NULL 1 @buf2)
      (text2
         text:    @buf2,
         setSize:,
         moveTo:  MARGIN nsBottom
      )
      (self add:text2, setSize:)
      (newName
         text: theComment,
         font: smallFont,
         setSize:,
         moveTo: MARGIN nsBottom
      )
      (self add:newName, setSize:)

      (Message MsgGet SAVE DTEXT_REPLACE NULL NULL 1 @buf3)
      (button1
         text:       @buf3,
         nsLeft:     0,
         nsTop:      0,
         setSize:
      )
      (Message MsgGet SAVE BUTTON_NODIRCHG NULL NULL 1 @buf4)
      (button2
         text:       @buf4,
         nsLeft:     0,
         nsTop:      0,
         setSize:
      )
      (button2
         moveTo:
            (- nsRight (+ (button2 nsRight?) MARGIN))
            nsBottom
      )
      (button1
         moveTo:
            (- (button2 nsLeft?) (+ (button1 nsRight?) MARGIN))
            nsBottom
      )

      (self
         add:button1 button2,
         setSize:,
         center:,
         open:stdWindow -1       ;don't save PMAP
;***        open:stdWindow 15
      )

      (= ret (super doit:newName))
      (self dispose:)
      (if (not (StrLen theComment))
         (NeedDescription)
         (= ret 0)
      )

      (return (or (== ret newName) (== ret button1)))
   )
)
(procedure (GetDirectory where &tmp result
            [newDir 40] [str 100] [buf1 50] len
            )
   (repeat
      (= len (+ (Max DIRECTORYSIZE (+ (StrLen where) 6)) 11))
      (= result
         ((Print new:)
            font:       SYSFONT,
            addText:    DIR_PROMPT NULL NULL 1 0 0 SAVE,
            addEdit:    (StrCpy @newDir where) len 0 20 where,
            addButton:  TRUE BUTTON_OK NULL NULL 1 0 34 SAVE,
            addButton:  FALSE BUTTON_NODIRCHG NULL NULL 1 50 34 SAVE,
            init:
         )
      )

      ;Pressed ESC -- return FALSE.
      (if (not result)
         (return FALSE)
      )

      ;No string defaults to current drive.
      (if (not (StrLen @newDir))
         (GetCWD @newDir)
      )

      ;If drive is valid, return TRUE, otherwise complain.
      (if (ValidPath @newDir)
         (StrCpy where @newDir)
         (return TRUE)
      else
         (Message MsgGet SAVE DIR_INVALID NULL NULL 1 @buf1)
         (Format @str @buf1 @newDir)
         ((Print new:)
            font:    SYSFONT,
            addText: @str,
            init:
         )
      )
   )
)

(procedure (HaveSpace)
   (return (and (< numGames MAXGAMES) (CheckFreeSpace curSaveDir)))
)

(procedure (NeedDescription)
   ((Print new:)
      font:    SYSFONT,
      addText: NO_DESC NULL NULL 1 0 0 SAVE,
      init:
   )
)


(instance selectorI of DSelector
   (properties
      x: COMMENTSIZE
      y: GAMESSHOWN
   )
)

(instance editI of DEdit
   (properties
      max: (- COMMENTSIZE 1)
   )
)

(instance okI of DButton
   (method (dispose)
      (super dispose: TRUE)
   )
)

(instance cancelI of DButton
   (method (dispose)
      (super dispose: TRUE)
   )
)

(instance changeDirI of DButton
   (method (dispose)
      (super dispose: TRUE)
   )
)

(instance deleteI of DButton
   (method (dispose)
      (super dispose: TRUE)
   )
)

(instance textI of DText
   (properties
      font: SYSFONT
   )
   (method (dispose)
      (super dispose: TRUE)
   )
)

(instance text1 of DText
   (properties
      font: SYSFONT
   )
   (method (dispose)
      (super dispose: TRUE)
   )
)

(instance text2 of DText
   (properties
      font: SYSFONT
   )
   (method (dispose)
      (super dispose: TRUE)
   )
)

(instance oldName of DText
   (method (dispose)
      (super dispose: TRUE)
   )
)

(instance newName of DEdit
   (properties
      max: (- COMMENTSIZE 1)
   )
)

(instance button1 of DButton
   (method (dispose)
      (super dispose: TRUE)
   )
)

(instance button2 of DButton
   (method (dispose)
      (super dispose: TRUE)
   )
)

Pages: 1 [2] 3

SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.147 seconds with 19 queries.