Initial Checkin

From the archives of 1991
This commit is contained in:
Rebecca Heineman 2015-07-08 12:48:09 -07:00
commit a92120827c
18 changed files with 3854 additions and 0 deletions

32
.gitignore vendored Normal file
View File

@ -0,0 +1,32 @@
#
# This file tells Git about engine files that never really belong in source control. They are usually build products, log
# files and intermediate files generated from a compiler or the engine runtime.
#
#
# NOTE:
# Paths that start with / match paths relative to the root (where the .gitignore file is)
# Paths that end with / will match a folder and all files under it (but not a regular file with no extension)
# Use * for wildcards. Wildcards stop at path separators
# Use ** for a wildcard that spans path separators
# Paths in this file should use forward slash characters, not back slashes
# Use \ to escape special characters like ! and #
# Use ! to negate a previous pattern. But it doesn't work if the parent sub-folder was masked out already.
#
# Ignore project files in the root
**/bin
**/temp
# Allow this folder to be saved
!/tools/bin
# IDE droppings
*.pdb
*.user
*.suo
*.opensdf
*.sdf
# Ignore Mac desktop services store files
.DS_Store

38
LICENSE.txt Normal file
View File

@ -0,0 +1,38 @@
The gist of the license... Have fun using this code, I won't sue you
and you can't sue me. However, please be nice about it and give me a
credit in your software that you used my code in.
Please?
--------------------------------------------
Copyright (c) 2013-2015 Rebecca Ann Heineman <becky@burgerbecky.com>
--------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
1. The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Rebecca Ann Heineman
becky@burgerbecky.com
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

56
README.rst Normal file
View File

@ -0,0 +1,56 @@
Space Ace IIgs
==============
The complete archive for Space Ace for the Apple IIgs
=====================================================
In 1990, ReadySoft released Space Ace for the Apple IIgs.
I purchased a copy and was appalled that the port was only
for ProDOS and required you to play the game on floppy disks.
Being the reverse engineering nutcase I was, I promptly
disassembled the game and converted it back into source code.
I then re-wrote the game to use the Apple IIgs hard disk
and updated all the file manager code to GS/OS. After
creating a really horrible icon for the game, I then
uploaded my new application file to friends who wanted to
play Space Ace on their hard drives and then promptly
forgot about this port.
Here it is, 2015, and after searching my archive CDs,
I found this source and decided to share it with you,
the programming public, so you can get a glimpse of what
65816 code looked like for the Apple IIgs. This code
ACTUALLY COMPILES AND RUNS using the Brutal Deluxe
a65816 assembler and my python based build scripts.
I've successfully built this on my Mac and ran the
executable using Sweet16 and in Windows with Kegs.
I've included the build tools and its source and exes for
Mac (Intel/PPC) and Windows.
In case you're wondering, yes, I did do this port just
because I wanted it running natively on my Apple IIgs
hard drive. Yes, I'm insane.
Enjoy!
http://www.whatisthe2gs.apple2.org.za/space-ace
And one more thing...
=====================
The intellectual property of Space Ace is the exclusive property of
Don Bluth and Digital Leisure.
No transfer of the intellectual property of Space Ace or any transfer of the
ownership of the sounds, art or other game assets are given nor implied.
If anyone wishes to release a version of Space Ace for the Apple IIgs commercially,
(I have absolutely no idea why? You'd sell like, what? 3 copies?)
contact Digital Leisure for a license.
The source code... Go for it.
Rebecca Ann Heineman
Olde Skuul
Seattle, WA

16
source/buildall.a65 Normal file
View File

@ -0,0 +1,16 @@
*
* Link
*
DSK ../bin/SpaceAce#b3db03
TYP $B3 ;Application
XPL
ASM spaceace.a65
DS 0
KND #$1000 ;No spec mem
ALI None
LNA SpaceAce
SNA SpaceAce

59
source/custombuild.py Normal file
View File

@ -0,0 +1,59 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import subprocess
import shutil
import burger
#
# Compile the code and data for Space Ace IIgs
#
def main(workingDir):
#
# Create the output folder if needed
#
toolfolder = os.path.dirname(workingDir)
destfolder = os.path.join(toolfolder,'bin')
burger.createfolderifneeded(destfolder)
#
# Update the map files
#
filelist = [
['icon','spaceace.icon#ca0000'], # Icon file
['buildall','SpaceAce#b3db03'], # Application file
['spaceacerez','SpaceAce#b3db03r'] # Resource file
]
error = 0
for item in filelist:
src = os.path.join(workingDir,item[0] + '.a65')
dest = os.path.join(destfolder,item[1])
if burger.isthesourcenewer(src,dest)==True:
cmd = 'a65816 . ' + item[0] + '.a65'
error = subprocess.call(cmd,cwd=workingDir,shell=True)
if error!=0:
return error
#
# Do some cleanup
#
burger.deletefileifpresent(os.path.join(workingDir,'_FileInformation.txt'))
return error
#
# If called as a function and not a class,
# call my main
#
if __name__ == "__main__":
sys.exit(main(os.path.dirname(os.path.abspath(__file__))))

197
source/icon.a65 Normal file
View File

@ -0,0 +1,197 @@
*
* Space Ace IIgs Icon file
* Read Apple II File Type Notes for $CA
* Finder Icons File July 1989
*
LST OFF
TR ON
ORG 0
*
* ICN file header
*
iBlkNext ;Handle to next icon
ADRL 0 ;Must be NULL
iBlkID
DA 1 ;Icon file ID, must be 1
iBlkPath ;Handle to the pathname
ADRL 0 ;Must be NULL
iBlkName
DS 16 ;Name if the icon file (Pascal string)
iBlkIcons
*
* Array of icons
*
iDataLen
DA iEndIcon-* ;Size of this individual icon
DS 64 ;Buffer for the name of the icon file
STR 'SPACEACE' ;16 byte buffer for the filename to match
DS 15-8
DA $B3 ;File type (Application)
DA $0000 ;Auxtype (Application)
*
* Large icon
*
DA $FFFF ;Color icon
DA 47*56/2 ;Image size in bytes
DA 47 ;Height of the big icon
DA 56 ;Width of the big icon in pixels
*
* Large icon image
*
HEX FFFFFFFFFFFFFF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F2FFFFFFFFFFFFFFFFFFFFFFF2222FFFFFFF2FFF
HEX FFF2EEEEEEEE2FFFF2FFFFFFFFFFFFFFFFFFFFFFFFFFF222FFFF2FFF
HEX FFF2EEEEEEE2FFFFFF2FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2FFF
HEX FFFF2EEEEE2FFFFFFF2FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2FFF
HEX FFFF2EEEEE2FFFFFFF2FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2FFF
HEX FFFFF2EEE2FFFFFFFF2FFFFFFFFFFF22222222FFFFFFFFFFFFFF2FFF
HEX FFFFFF2E2FFFFFFFFF2FFFFFF22222FFFFFFFFFFFFFFFFFFFFFF2FFF
HEX FFFFFFF22FFFFFFFFFF2FF222FFFFFFFFFFFFFFFFFFFFFFFFFFF2FFF
HEX FFFFFFF2FFFFFFFFFFF222FFFFFFFFFFFFFFFFFFFFFF222FFFF2FFFF
HEX FFFFFFF2FFFFFFFFFFF2FFFFFFFFFFFFF22FFFFFFFFFFFF2FF2FFFFF
HEX FFFFFF2FFFFFFFFFFFF2FFFFFFFFFFFFFFF222FFFFFFFFFF22FFFFFF
*
* Large icon mask
*
HEX 0000000000000000000000000000000FFFFFFFFFFFFFFFFFFF000000
HEX 00000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFF0000
HEX 00000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF00
HEX 000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0
HEX 0000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0
HEX 00000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
HEX 000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
HEX 0000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
HEX 000000000000000FFFFFFFFFFFFFFFFFFFFFFFFF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FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000
HEX 0000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000
HEX 000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000
*
* Small icon
*
DA $0000 ;Monochrome icon
DA 8*8/2
DA 8 ;Small icon height
DA 8 ;Small icon width
*
* Small icon image
*
HEX 0000000F
HEX 0FFFFFF0
HEX 0FFFFFF0
HEX 0FFFFFF0
HEX 0FFFFFF0
HEX 0FFFFFF0
HEX 0FFFFFF0
HEX 00000000
*
* Small icon mask
*
HEX FFFFFFF0
HEX FFFFFFFF
HEX FFFFFFFF
HEX FFFFFFFF
HEX FFFFFFFF
HEX FFFFFFFF
HEX FFFFFFFF
HEX FFFFFFFF
iEndSmallIcon
iEndIcon
DA 0 ;End of the list
SAV ../bin/spaceace.icon#ca0000

138
source/shapes.a65 Normal file
View File

@ -0,0 +1,138 @@
LST OFF
TR ON
XC
XC
REL
ENT DigitPtr,Press0Start,MissionIsOver
*
* Fonts
*
DigitPtr DA Num0,Num1,Num2,Num3,Num4
DA Num5,Num6,Num7,Num8,Num9
Num0 DB 2,20
HEX 01C00630080811C41364222224122412
HEX 24122412241224122412241222223366
HEX 11C4180C0E3803E0000001C007F00E38
HEX 0C181C1C180C180C180C180C180C180C
HEX 180C180C1C1C0C180E3807F001C00000
Num1 DB 2,20
HEX 00E0012002200420082009200F200120
HEX 01200120012001200120012001200120
HEX 01200120012001E0000000C001C003C0
HEX 07C006C000C000C000C000C000C000C0
HEX 00C000C000C000C000C000C000C00000
Num2 DB 2,20
HEX 03E00C18100423E22632241224123C12
HEX 00220046008C01180230046008C01180
HEX 23FE200220023FFE000003E00FF81C1C
HEX 180C180C180C000C001C0038007000E0
HEX 01C0038007000E001C001FFC1FFC0000
Num3 DB 2,20
HEX 03C00C30100823C42664242424243C24
HEX 01C40208020403E20032181224122422
HEX 23C6300C1C3807E0000003C00FF01C38
HEX 1818181818180018003801F001F8001C
HEX 000C000C180C181C1C380FF003C00000
Num4 DB 2,20
HEX 007800880108010802080248044804C8
HEX 08C809C81148134823CE200220023FCE
HEX 00480048004800780000007000F000F0
HEX 01F001B003B00330073006300E300C30
HEX 1C301FFC1FFC00300030003000300000
Num5 DB 2,20
HEX 3FF82004200427FC2400240027C02430
HEX 200823C43C2200120012381224122422
HEX 23C6300C1C3807E000001FF81FF81800
HEX 1800180018001BC01FF01C38001C000C
HEX 000C000C180C181C1C380FF003C00000
Num6 DB 2,20
HEX 03E00C18100423E226322412241E27C0
HEX 2430200821C422222412241224122222
HEX 31C6180C0E3803E0000003E00FF81C1C
HEX 180C180C180018001BC01FF01E381C1C
HEX 180C180C180C1C1C0E3807F001C00000
Num7 DB 2,20
HEX 3FFC200220023FE20046004C00880098
HEX 0110013002200260044004C004800880
HEX 0980090009000F0000001FFC1FFC001C
HEX 003800300070006000E000C001C00180
HEX 03800300030007000600060006000000
Num8 DB 2,20
HEX 01C00630080811C413641224122411C4
HEX 08080410080811C42222241224122222
HEX 31C6180C0E3803E0000001C007F00E38
HEX 0C180C180C180E3807F003E007F00E38
HEX 1C1C180C180C1C1C0E3807F001C00000
Num9 DB 2,20
HEX 01C00630080811C42222241224122412
HEX 2412222231C218020E1203F238122422
HEX 23C6300C1C3807E0000001C007F00E38
HEX 1C1C180C180C180C180C1C1C0E3C07FC
HEX 01EC000C000C181C1C380FF003C00000
*
* The mission is over
*
MissionIsOver DB 20,11
HEX E1C0000000C18C00000C0000000C000038000000
HEX 9240000000A29200001200000012000044000000
HEX 9240000000A29200001200000012000092000000
HEX 925E337600949E1F1F1E1E3E001E1F0139663CEC
HEX CCE14C890094A220A0A221410022208129994312
HEX 61CCCCC48088B247C7B24CCC8032478129999989
HEX 334CCCCC8080926262124CCC8012620129999999
HEX 124CCCCF8094923131124CCC8012310129C3819F
HEX 124CCCC800949238B8924CCC8012388193429F90
HEX 2161E204009CA141C1A161CC80214180C666C308
HEX 3F3F3FFC00F7BF7F7F3F3F7F803F7F007C3C7FF8
HEX 0000000000000000000000000000000000000000
HEX 6180000000410C00000C0000000C000038000000
HEX 6180000000410C00000C0000000C00006C000000
HEX 61800000006300000000000000000000C6000000
HEX 331E337600631C1F1F1C1E3E001C1F00C6663CEC
HEX 1E33333B00770C38380C3333000C3800C6666676
HEX 0C333333007F0C1C1C0C3333000C1C00C6666666
HEX 0C333330006B0C0E0E0C3333000C0E00C63C7E60
HEX 0C333330006B0C07070C3333000C07006C3C6060
HEX 1E1E1DF800631E3E3E1E1E33001E3E0038183CF0
HEX 0000000000000000000000000000000000000000
*
* Press "0" to start
*
Press0Start DB 16,9
HEX FF80000000007F00E00007F3800001C0
HEX 80C000000000C181A0000C1E80000340
HEX CE7FDFDFFFE09C833BF809CCEFEFFE70
HEX 4E447070302098820E0C08F828388C10
HEX 40E32727E7E094833CE40E3CEF9C6670
HEX 4FA7203070608C813CA40F8CF814E678
HEX CE67E7FF3F209C8134E409CCD39CFE68
HEX 824230606060C1818E0C0C1E38484318
HEX FE7E1FFFFFC07F00FBF807F3EFFFC1F0
HEX 00000000000000000000000000000000
HEX 7F00000000003E00400003E100000080
HEX 3180000000006300C000063300000180
HEX 31BB8F8FCFC06701F1F00707C7C773E0
HEX 3F1CD8D818006B00C31801C300639980
HEX 3018DFCF8F807300C318007307E31980
HEX 30181800C0C06300CB1806332C630190
HEX 7C3C0F9F9F803E0071F003E1C7B780E0
HEX 00000000000000000000000000000000

2602
source/spaceace.a65 Normal file

File diff suppressed because it is too large Load Diff

195
source/spaceacerez.a65 Normal file
View File

@ -0,0 +1,195 @@
*
* Space Ace IIgs Resource file
*
LST OFF
TR ON
rIcon = $8001 ; Icon type
rPicture = $8002 ; Picture type
rControlList = $8003 ; Control list type
rControlTemplate = $8004 ; Control template type
rC1InputString = $8005 ; GS/OS class 1 input string
rPString = $8006 ; Pascal string type
rStringList = $8007 ; String list type
rMenuBar = $8008 ; MenuBar type
rMenu = $8009 ; Menu template
rMenuItem = $800A ; Menu item definition
rTextForLETextBox2 = $800B ; Data for LineEdit LETextBox2 call
rCtlDefProc = $800C ; Control definition procedure type
rCtlColorTbl = $800D ; Color table for control
rWindParam1 = $800E ; Parameters for NewWindow2 call
rWindParam2 = $800F ; Parameters for NewWindow2 call
rWindColor = $8010 ; Window Manager color table
rTextBlock = $8011 ; Text block
rStyleBlock = $8012 ; TextEdit style information
rToolStartup = $8013 ; Tool set startup record
rResName = $8014 ; Resource name
rAlertString = $8015 ; AlertWindow input data
rText = $8016 ; Unformatted text
rCodeResource = $8017
rCDEVCode = $8018
rCDEVFlags = $8019
rTwoRects = $801A ; Two rectangles
rFileType = $801B ; Filetype descriptors--see File Type Note $42
rListRef = $801C ; List member
rCString = $801D ; C string
rXCMD = $801E
rXFCN = $801F
rErrorString = $8020 ; ErrorWindow input data
rKTransTable = $8021 ; Keystroke translation table
rWString = $8022 ; not useful--duplicates $8005
rC1OutputString = $8023 ; GS/OS class 1 output string
rSoundSample = $8024
rTERuler = $8025 ; TextEdit ruler information
rFSequence = $8026
rCursor = $8027 ; Cursor resource type
rItemStruct = $8028 ; for 6.0 Menu Manager
rVersion = $8029
rComment = $802A
rBundle = $802B
rFinderPath = $802C
rPaletteWindow = $802D ; used by HyperCard IIgs 1.1
rTaggedStrings = $802E
rPatternList = $802F
rRectList = $C001
rPrintRecord = $C002
rFont = $C003
verUS = $0000
ORG $0000
*
* Resource file header
*
ADRL 0 ;Version (0 = Little Endian)
ADRL FileToMap ;FileToMap
ADRL FileToMapEnd-FileToMap ;FileMapSize
DS 128 ;FileMemo
FileToMap
DA 0 ;Not used
ADRL 0 ;Version (0 = Little Endian)
ADRL FileToMap ;FileToMap
ADRL FileToMapEnd-FileToMap ;FileMapSize
DA ResourceList-FileToMap ;MapToIndex
DA 0 ;mapFileNum
DA 0 ;mapID
ADRL 14 ;MapIndexSize (Size per entry)
ADRL 4 ;MapIndexUsed (Number of resources)
DA 10 ;MapFreeListSize
DA 1 ;MapFreeListUsed ;Number of used entries
*
* Free data array
*
ADRL EndOfFile ;End of the file
ADRL $FFFFFFFF-EndOfFile ;Amount of free space
DS {10-1}*8 ;Rest of the data (Not used)
DS $100-* ;Pad to next sector
*
* Array of resource entries
*
ResourceList
DA rToolStartup ;resType
ADRL 1 ;resID
ADRL ToolStartup ;resOffset
DA 0 ;resAttr
ADRL ToolStartupEnd-ToolStartup ;resSize
ADRL 0 ;resHandle
DA rResName ;resType
ADRL $18013 ;resID
ADRL ResourceNames ;resOffset
DA 0 ;resAttr
ADRL ResourceNamesEnd-ResourceNames ;resSize
ADRL 0 ;resHandle
DA rVersion ;resType
ADRL 1 ;resID
ADRL Version ;resOffset
DA 0 ;resAttr
ADRL VersionEnd-Version ;resSize
ADRL 0 ;resHandle
DA rComment ;resType
ADRL 1 ;resID
ADRL Comment ;resOffset
DA 0 ;resAttr
ADRL CommentEnd-Comment ;resSize
ADRL 0 ;resHandle
DS 202
FileToMapEnd
*
* Tool startup
*
ToolStartup
DA 0 ;Flags
DA $C000 ;Start quickdraw in 320 mode
DA 0 ;Not used
ADRL 0 ;Not used
DA 7 ;Number of tools to start
DA 3
DA $300
DA 4
DA $301
DA 5
DA $302
DA 6
DA $300
DA 8
DA $301
DA 11
DA $200
DA 30
DA $100
ToolStartupEnd
Version
DB 0 ;Release number
DB $A0 ;Development / Final
DB $10 ;Version 2.1
DB 2
DA verUS ;Region code
STR 'Space Ace'
STR '(C) 1989,1991, ReadySoft Inc.'
VersionEnd
Comment
ASC 'Space Ace was rewritten by Rebecca Ann Heineman so that '
ASC 'you can use extra GS/OS memory and allow full use '
ASC 'of a hard drive. Press 'D2'Q'D3' to quit from the game.'0D0D
ASC 'Please purchase the real game from ReadySoft Inc. '
ASC '30 Wertheim Court, Unit #2, Richmond Hill, Ontario, '
ASC 'Canada, L4B 1B9'0D0D
ASC 'Tel (416)-731-4175'
CommentEnd
ResourceNames
DA 1 ;Name holder
ADRL 1 ;Number of resources
ADRL 1 ;Resource ID
STR 'MyTools' ;Name of the resource
ResourceNamesEnd
*
* Label for the end of the file, for file size
*
EndOfFile
SAV ../bin/SpaceAce#b3db03r

BIN
tools/bin/macosx/packsound Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "packsound", "packsoundv10win.vcxproj", "{8CAB6D8F-1F54-342A-A976-B3AC26EB8576}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8CAB6D8F-1F54-342A-A976-B3AC26EB8576}.Release|Win32.ActiveCfg = Release|Win32
{8CAB6D8F-1F54-342A-A976-B3AC26EB8576}.Release|Win32.Build.0 = Release|Win32
{8CAB6D8F-1F54-342A-A976-B3AC26EB8576}.Release|x64.ActiveCfg = Release|x64
{8CAB6D8F-1F54-342A-A976-B3AC26EB8576}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>packsound</ProjectName>
<FinalFolder>..\bin\windows\</FinalFolder>
<ProjectGuid>{8CAB6D8F-1F54-342A-A976-B3AC26EB8576}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(SDKS)\visualstudio\burger.toolv10.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="source\packsound.h" />
<ClCompile Include="source\packsound.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClInclude Include="source\packsound.h">
<Filter>source</Filter>
</ClInclude>
<ClCompile Include="source\packsound.cpp">
<Filter>source</Filter>
</ClCompile>
<Filter Include="source">
<UniqueIdentifier>{6A6F04C1-7342-3D5C-A6A4-779EF27C7D1F}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

View File

@ -0,0 +1,231 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
2975406015CFD4772E57E4D6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 957F7268BCFABFC0E258709B /* QuartzCore.framework */; };
457443B50A464B981B7F33A0 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB663B78C243F425CB5F622D /* IOKit.framework */; };
9ED89AC12C3D9718E3B17835 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 60566A081602146F3C8BA8CA /* Carbon.framework */; };
B54FC9256679818F58A1B7FC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04BBF96056AA4E7B57C08772 /* Cocoa.framework */; };
B68D493CFB2FE31F3D7C57A5 /* packsound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3835B6D83177655093922B5 /* packsound.cpp */; };
BD1F68D147E9B32F91C8594B /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6061B328817055E8B2E193D6 /* AppKit.framework */; };
D337DA4A07D1F3CC84F2449B /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AC54CC47F3C0DD9956B9AD3 /* OpenGL.framework */; };
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
8F5ADA69E6CF0A5F85B84100 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = com.apple.compilers.proxy.script;
filePatterns = "*.glsl";
fileType = pattern.proxy;
isEditable = 1;
outputFiles = (
"${INPUT_FILE_DIR}/${INPUT_FILE_BASE}.h",
);
script = "${SDKS}/macosx/bin/stripcomments ${INPUT_FILE_PATH} -c -l g_${INPUT_FILE_BASE} ${INPUT_FILE_DIR}/${INPUT_FILE_BASE}.h";
};
/* End PBXBuildRule section */
/* Begin PBXFileReference section */
04BBF96056AA4E7B57C08772 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
153770813E582A11A3AC4062 /* packsound */ = {isa = PBXFileReference; explicitFileType = compiled.mach-o.executable; includeInIndex = 0; path = packsound; sourceTree = BUILT_PRODUCTS_DIR; };
32398A14DA8C84502195F75F /* packsound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = packsound.h; path = source/packsound.h; sourceTree = SOURCE_ROOT; };
53A745DDC21ECBC748B26AF9 /* burger.toolxcoosx.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = burger.toolxcoosx.xcconfig; path = xcode/burger.toolxcoosx.xcconfig; sourceTree = SDKS; };
60566A081602146F3C8BA8CA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
6061B328817055E8B2E193D6 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
957F7268BCFABFC0E258709B /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
9AC54CC47F3C0DD9956B9AD3 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
CB663B78C243F425CB5F622D /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
F3835B6D83177655093922B5 /* packsound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = packsound.cpp; path = source/packsound.cpp; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
84C32067AA706885861DBAF2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
BD1F68D147E9B32F91C8594B /* AppKit.framework in Frameworks */,
9ED89AC12C3D9718E3B17835 /* Carbon.framework in Frameworks */,
B54FC9256679818F58A1B7FC /* Cocoa.framework in Frameworks */,
457443B50A464B981B7F33A0 /* IOKit.framework in Frameworks */,
D337DA4A07D1F3CC84F2449B /* OpenGL.framework in Frameworks */,
2975406015CFD4772E57E4D6 /* QuartzCore.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
4CE489F4A9041625DE5927C3 /* source */ = {
isa = PBXGroup;
children = (
F3835B6D83177655093922B5 /* packsound.cpp */,
32398A14DA8C84502195F75F /* packsound.h */,
);
path = source;
sourceTree = SOURCE_ROOT;
};
50CFB971DA7264BD50846293 /* packsound */ = {
isa = PBXGroup;
children = (
6555983C4FFDAFC88D6ED936 /* Frameworks */,
9796CE949CD3951E99BB35F6 /* Products */,
4CE489F4A9041625DE5927C3 /* source */,
53A745DDC21ECBC748B26AF9 /* burger.toolxcoosx.xcconfig */,
);
name = packsound;
sourceTree = "<group>";
};
6555983C4FFDAFC88D6ED936 /* Frameworks */ = {
isa = PBXGroup;
children = (
6061B328817055E8B2E193D6 /* AppKit.framework */,
60566A081602146F3C8BA8CA /* Carbon.framework */,
04BBF96056AA4E7B57C08772 /* Cocoa.framework */,
CB663B78C243F425CB5F622D /* IOKit.framework */,
9AC54CC47F3C0DD9956B9AD3 /* OpenGL.framework */,
957F7268BCFABFC0E258709B /* QuartzCore.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
9796CE949CD3951E99BB35F6 /* Products */ = {
isa = PBXGroup;
children = (
153770813E582A11A3AC4062 /* packsound */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
E5BAEE20F1E65333937E97F8 /* packsound */ = {
isa = PBXNativeTarget;
buildConfigurationList = 24B610ECC900D2F6B262E5AD /* Build configuration list for PBXNativeTarget "packsound" */;
buildPhases = (
193563A30A43A524C4061DC0 /* Sources */,
84C32067AA706885861DBAF2 /* Frameworks */,
B491C6B43A4AFEBA72EDE202 /* ShellScript */,
2E2CA33F02F2C6797FC94387 /* ShellScript */,
);
buildRules = (
8F5ADA69E6CF0A5F85B84100 /* PBXBuildRule */,
);
dependencies = (
);
name = packsound;
productName = packsound;
productReference = 153770813E582A11A3AC4062 /* packsound */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
D81F2798ABA480661C5010EC /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
};
buildConfigurationList = 872A09416D22001CCFA95821 /* Build configuration list for PBXProject "packsoundxc3osx" */;
compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 50CFB971DA7264BD50846293 /* packsound */;
projectDirPath = "";
projectRoot = "";
targets = (
E5BAEE20F1E65333937E97F8 /* packsound */,
);
};
/* End PBXProject section */
/* Begin PBXShellScriptBuildPhase section */
2E2CA33F02F2C6797FC94387 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${CONFIGURATION_BUILD_DIR}/${EXECUTABLE_NAME}",
);
outputPaths = (
"${CONFIGURATION_BUILD_DIR}/../../../bin/macosx/${FINAL_OUTPUT}",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ \"${CONFIGURATION}\" == \"Release\" ]; then\n${SDKS}/macosx/bin/p4 edit ../bin/macosx/${FINAL_OUTPUT}\n${CP} ${CONFIGURATION_BUILD_DIR}/${EXECUTABLE_NAME} ../bin/macosx/${FINAL_OUTPUT}\nfi\n\n";
showEnvVarsInLog = 0;
};
B491C6B43A4AFEBA72EDE202 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${CONFIGURATION_BUILD_DIR}/${EXECUTABLE_NAME}",
);
outputPaths = (
"${SRCROOT}/bin/${EXECUTABLE_NAME}${IDESUFFIX}${SUFFIX}",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ ! -d ${SRCROOT}/bin ]; then mkdir ${SRCROOT}/bin; fi\n${CP} ${CONFIGURATION_BUILD_DIR}/${EXECUTABLE_NAME} ${SRCROOT}/bin/${EXECUTABLE_NAME}${IDESUFFIX}${SUFFIX}\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
193563A30A43A524C4061DC0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B68D493CFB2FE31F3D7C57A5 /* packsound.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
0AD89479A6F9267244955A36 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 53A745DDC21ECBC748B26AF9 /* burger.toolxcoosx.xcconfig */;
buildSettings = {
};
name = Release;
};
AFD1EFE3D6FB31324ADCA0EA /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
24B610ECC900D2F6B262E5AD /* Build configuration list for PBXNativeTarget "packsound" */ = {
isa = XCConfigurationList;
buildConfigurations = (
AFD1EFE3D6FB31324ADCA0EA /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
872A09416D22001CCFA95821 /* Build configuration list for PBXProject "packsoundxc3osx" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0AD89479A6F9267244955A36 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = D81F2798ABA480661C5010EC /* Project object */;
}

View File

@ -0,0 +1,198 @@
/***************************************
Tool to process data for Space Ace IIgs
Copyright (c) 1995-2015 by Rebecca Ann Heineman <becky@burgerbecky.com>
It is released under an MIT Open Source license. Please see LICENSE
for license details. Yes, you can use it in a
commercial title without paying anything, just give me a credit.
Please? It's not like I'm asking you for money!
***************************************/
#include "packsound.h"
#define DOC_28MHZ 28636360.0f // Master Ensoniq clock rate
#define DOC_RATE (DOC_28MHZ/32.0f) // Ensoniq clock rate
#define SCAN_RATE (DOC_RATE/34.0f) // All oscillators are enabled
struct SpaceAceAudioFile_t {
Word16 m_uDOCRate; // Value to put into the Ensoniq DOC for sample rate
Word16 m_uBytesPerTick; // Number of bytes consumed per 1/60th of a second tick
Word8 m_Data[1]; // Raw audio data
};
static const Word8 g_Lookup[16] = {0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99,0xAA,0xBB,0xCC,0xDD,0xEE,0xFF};
/***************************************
Process a sound file into 4 bits per sample
***************************************/
static Word ExtractSound(OutputMemoryStream *pOutput,const Word8 *pInput,WordPtr uInputLength)
{
if (uInputLength<4) {
printf("Input is too small\n");
return 1;
}
if (MemoryCompare("RIFF",pInput,4)) {
printf("Not a sound file\n");
return 1;
}
Word32 uFileLength = LittleEndian::Load(reinterpret_cast<const Word32 *>(pInput+4));
if (uFileLength!=uInputLength) {
printf("Sound file length mismatch\n");
return 1;
}
// Calculate the DOC rate
int iSampleRate = LittleEndian::Load(reinterpret_cast<const Word32 *>(pInput+24));
// Convert from a IIgs step rate to a samples per second rate
int iDOCRate = static_cast<int>(((static_cast<float>(iSampleRate)*512.0f)/SCAN_RATE)+0.5f);
// Output the Space Ace audio header
pOutput->Append(static_cast<Word16>(iDOCRate));
pOutput->Append(static_cast<Word16>((iSampleRate+59)/60));
// WGet the number of samples
Word uSoundLength = LittleEndian::Load(reinterpret_cast<const Word32 *>(pInput+40));
uSoundLength>>=1U;
if (uSoundLength) {
const Word8 *pTemp = pInput+44;
do {
// Convert to 4 bits per sample audio
pOutput->Append(static_cast<Word8>((pTemp[0]&0xF0U)+(pTemp[1]>>4U)));
pTemp+=2;
} while (--uSoundLength);
}
return 0;
}
/***************************************
Convert a Space Ace file to a WAV file
***************************************/
static Word EncapsulateToWAV(OutputMemoryStream *pOutput,const Word8 *pInput,WordPtr uInputLength)
{
// Too small?
if (uInputLength<4) {
return 10;
}
const Word8 *pWork = pInput+4;
WordPtr uCounter = uInputLength-4;
int iSampleRate = LittleEndian::Load(&reinterpret_cast<const SpaceAceAudioFile_t *>(pInput)->m_uDOCRate);
// Convert from a IIgs step rate to a samples per second rate
iSampleRate = static_cast<int>((static_cast<float>(iSampleRate)/512.0f)*SCAN_RATE);
// Trim excess data if needed
if (uCounter) {
do {
if (pWork[uCounter-1]==0x88) {
break;
}
} while (--uCounter);
}
pOutput->Append("RIFF");
pOutput->Append(static_cast<Word32>((uCounter*2)+44));
pOutput->Append("WAVEfmt ");
pOutput->Append(static_cast<Word32>(16)); // Chunk size (Minimum)
pOutput->Append(static_cast<Word16>(1)); // Format code (PCM)
pOutput->Append(static_cast<Word16>(1)); // Mono
pOutput->Append(static_cast<Word32>(iSampleRate)); // Samples per second
pOutput->Append(static_cast<Word32>(iSampleRate)); // Bytes per second (Same as samples)
pOutput->Append(static_cast<Word16>(1)); // Byte aligned
pOutput->Append(static_cast<Word16>(8)); // Bits per sample
pOutput->Append("data");
pOutput->Append(static_cast<Word32>(uCounter*2));
// No diff
do {
pOutput->Append(g_Lookup[(pWork[0]>>4)&0xF]);
pOutput->Append(g_Lookup[pWork[0]&0xF]);
++pWork;
} while (--uCounter);
return 0;
}
/***************************************
Main dispatcher
***************************************/
int BURGER_ANSIAPI main(int argc,const char **argv)
{
ConsoleApp MyApp(argc,argv);
CommandParameterBooleanTrue DoSound("Process Sound","s");
CommandParameterBooleanTrue DoWave("Convert to Wave","w");
const CommandParameter *MyParms[] = {
&DoSound,
&DoWave
};
argc = MyApp.GetArgc();
argv = MyApp.GetArgv();
argc = CommandParameter::Process(argc,argv,MyParms,sizeof(MyParms)/sizeof(MyParms[0]),
"Usage: packsound InputFile OutputFile\n\n"
"Preprocess data for Space Ace IIgs.\nCopyright by Rebecca Ann Heineman\n",3);
if (argc<0) {
Globals::SetErrorCode(10);
} else {
MyApp.SetArgc(argc);
Filename InputName;
InputName.SetFromNative(argv[1]);
WordPtr uInputLength;
Word8 *pInput = static_cast<Word8 *>(FileManager::LoadFile(&InputName,&uInputLength));
if (!pInput) {
printf("Can't open %s!\n",argv[1]);
Globals::SetErrorCode(10);
} else {
// Convert wave to data
if (DoSound.GetValue()) {
OutputMemoryStream Output;
if (ExtractSound(&Output,pInput,uInputLength)) {
printf("Can't convert %s!\n",argv[1]);
Globals::SetErrorCode(10);
} else {
Filename OutputName;
OutputName.SetFromNative(argv[2]);
if (Output.SaveFile(&OutputName)) {
printf("Can't save %s!\n",argv[2]);
Globals::SetErrorCode(10);
}
}
// Convert raw audio to WAV
} else if (DoWave.GetValue()) {
OutputMemoryStream Output;
if (EncapsulateToWAV(&Output,pInput,uInputLength)) {
printf("Can't convert %s!\n",argv[1]);
Globals::SetErrorCode(10);
} else {
Filename OutputName;
OutputName.SetFromNative(argv[2]);
if (Output.SaveFile(&OutputName)) {
printf("Can't save %s!\n",argv[2]);
Globals::SetErrorCode(10);
}
}
} else {
printf("No conversion selected for %s!\n",argv[1]);
Globals::SetErrorCode(10);
}
Free(pInput);
}
}
return Globals::GetErrorCode();
}

View File

@ -0,0 +1,23 @@
/***************************************
Tool to pre-process data for Space Ace IIgs
Copyright (c) 1995-2015 by Rebecca Ann Heineman <becky@burgerbecky.com>
It is released under an MIT Open Source license. Please see LICENSE
for license details. Yes, you can use it in a
commercial title without paying anything, just give me a credit.
Please? It's not like I'm asking you for money!
***************************************/
#ifndef __PACKSOUND_H__
#define __PACKSOUND_H__
#ifndef __BURGER__
#include <burger.h>
#endif
extern int BURGER_ANSIAPI main(int argc,const char **argv);
#endif