Forgot to commit this.

This commit is contained in:
Martin Haye 2015-09-19 13:51:08 -07:00
parent 6ee122f942
commit 9ff4aeb793

View File

@ -0,0 +1,65 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2015 The 8-Bit Bunch. Licensed under the Apache License, Version 1.1
// (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at <http://www.apache.org/licenses/LICENSE-1.1>.
// Unless required by applicable law or agreed to in writing, software distributed under
// the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
// ANY KIND, either express or implied. See the License for the specific language
// governing permissions and limitations under the License.
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
// Structures for testing the heap system
const TYPE_GLOBAL = $80
struc Global
byte type
word id
word players
end
const TYPE_PLAYER = $81
struc Player
byte type
word id
word p_nextObj
word name
byte muscle
byte quickness
word items
word health
end
const TYPE_ITEM = $82
struc Item
byte type
word id
word p_nextObj
word name
byte kind
word cost
end
// Table per type, starts with length, then pointer offsets, ending with zero.
byte typeTbl_Global[] = Global, players, 0
byte typeTbl_Player[] = Player, p_nextObj, name, items, 0
byte typeTbl_Item[] = Item, p_nextObj, name, 0
byte typeLengths[10]
byte typeCounts[256]
byte checkCounts[256]
word nextObjID = 0
// Test strings
byte[] testStr1 = "A"
byte[] testStr2 = "By"
byte[] testStr3 = "Who"
byte[] testStr4 = "Flap"
byte[] testStr5 = "Hello"
byte[] testStr6 = "Froomy"
byte[] testStr7 = "Varmint"
byte[] testStr8 = "Octolift"
byte[] testStr9 = "Sumptuous"
byte[] testStr10 = "Gargleblah"
word[] testStrings = @testStr1, @testStr2, @testStr3, @testStr4, @testStr5
word[] = @testStr6, @testStr7, @testStr8, @testStr9, @testStr10