Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateFOVDegrees(distanceToScreen int) float32
- type ADTOutput
- type AnimBlockHeader
- type AnimFrame
- type AnimMovement
- type AnimSprite
- type AnimationFrame
- type BinOutput
- type BitReader
- func (r *BitReader) ReadBit() (int, error)
- func (r *BitReader) ReadBitLittleEndian() (int, error)
- func (r *BitReader) ReadNumBits(numBits int) (uint64, error)
- func (r *BitReader) ReadNumBitsLittleEndian(numBits int) (uint64, error)
- func (r *BitReader) UnsafeReadBit() int
- func (r *BitReader) UnsafeReadByte() byte
- func (r *BitReader) UnsafeReadNumBits(numBits int) uint64
- func (r *BitReader) UnsafeReadNumBitsLittleEndian(numBits int) uint64
- type CameraInfo
- type CollisionEntity
- type DO2FileFormat
- type DO2Output
- type EDDHeaderObject
- type EDDOutput
- type EDDTableElement
- type EMDHeader
- type EMDOffsets
- type EMDOutput
- type EMRArmature
- type EMRFrame
- type EMRHeader
- type EMROutput
- type EMRRelativePosition
- type ESPHeader
- type ESPOutput
- type FLROutput
- type FLRSound
- type ImageFile
- type LITCameraLight
- type LITLightColor
- type LITOutput
- type LITPosition
- type MD1Header
- type MD1Object
- type MD1ObjectHeader
- type MD1Output
- type MD1QuadIndex
- type MD1QuadTexture
- type MD1QuadsHeader
- type MD1TriangleIndex
- type MD1TriangleTexture
- type MD1TrianglesHeader
- type MD1Vertex
- type MSGOutput
- type MaskRectangle
- type Node
- type PLDHeader
- type PLDOffsets
- type PLDOutput
- type PRIHeader
- type PRIMaskRectangle
- type PRIMaskSquare
- type PRIOutput
- type PRIRelativeOffset
- type RDTHeader
- type RDTItemOffsets
- type RDTOffsets
- type RDTOutput
- type RIDHeader
- type RIDOutput
- type RVDHeader
- type RVDOutput
- type RoomImageOutput
- type SAPOutput
- type SCAElement
- type SCAHeader
- type SCAOutput
- type SCDOutput
- type ScriptFunction
- type ScriptInstrAotReset
- type ScriptInstrAotSet
- type ScriptInstrAotSet4p
- type ScriptInstrCalc
- type ScriptInstrCalc2
- type ScriptInstrCheckBitTest
- type ScriptInstrCompare
- type ScriptInstrCopy
- type ScriptInstrCutAuto
- type ScriptInstrCutChg
- type ScriptInstrDoorAotSet
- type ScriptInstrDoorAotSet4p
- type ScriptInstrDoorModelSet
- type ScriptInstrElseStart
- type ScriptInstrEventExec
- type ScriptInstrForStart
- type ScriptInstrGoSub
- type ScriptInstrGoto
- type ScriptInstrIfElseStart
- type ScriptInstrItemAotSet
- type ScriptInstrItemAotSet4p
- type ScriptInstrKageSet
- type ScriptInstrMemberCompare
- type ScriptInstrMemberSet
- type ScriptInstrMizuDivSet
- type ScriptInstrObjModelSet
- type ScriptInstrPlcDest
- type ScriptInstrPlcFlag
- type ScriptInstrPlcMotion
- type ScriptInstrPlcNeck
- type ScriptInstrPlcRot
- type ScriptInstrPosSet
- type ScriptInstrSave
- type ScriptInstrScaIdSet
- type ScriptInstrSceBgmControl
- type ScriptInstrSceEmSet
- type ScriptInstrSceEspr3DOn
- type ScriptInstrSceEsprControl
- type ScriptInstrSceEsprKill
- type ScriptInstrSceEsprOn
- type ScriptInstrSetBit
- type ScriptInstrSleep
- type ScriptInstrSwitch
- type ScriptInstrSwitchCase
- type ScriptInstrWorkSet
- type ScriptInstrXaOn
- type SpriteData
- type StreamReader
- type TIMHeader
- type TIMImageHeader
- type TIMOutput
- type UnpackArray
- type UnpackArray8
- type VABDataOutput
- type VABHeader
- type VABHeaderOutput
- type VABOutput
- type VABProgram
- type VABTone
Constants ¶
View Source
const ( NODE_LEFT = 0 NODE_RIGHT = 1 TOTAL_IMAGE_WIDTH = 320 TOTAL_IMAGE_HEIGHT = 240 )
View Source
const ( FLOOR_HEIGHT_UNIT = -1800 SCA_TYPE_SLOPE = 11 SCA_TYPE_STAIRS = 12 )
View Source
const ( OP_NO_OP = 0 OP_EVT_END = 1 OP_EVT_NEXT = 2 OP_EVT_CHAIN = 3 OP_EVT_EXEC = 4 OP_EVT_KILL = 5 OP_IF_START = 6 OP_ELSE_START = 7 OP_END_IF = 8 OP_SLEEP = 9 OP_SLEEPING = 10 OP_WSLEEP = 11 OP_WSLEEPING = 12 OP_FOR = 13 OP_FOR_END = 14 OP_WHILE_START = 15 OP_WHILE_END = 16 OP_DO_START = 17 OP_DO_END = 18 OP_SWITCH = 19 OP_CASE = 20 OP_DEFAULT = 21 OP_END_SWITCH = 22 OP_GOTO = 23 OP_GOSUB = 24 OP_GOSUB_RETURN = 25 OP_BREAK = 26 OP_WORK_COPY = 29 OP_NO_OP2 = 32 OP_CHECK = 33 OP_SET_BIT = 34 OP_COMPARE = 35 OP_SAVE = 36 OP_COPY = 37 OP_CALC = 38 OP_CALC2 = 39 OP_SCE_RND = 40 OP_CUT_CHG = 41 OP_CUT_OLD = 42 OP_MESSAGE_ON = 43 OP_AOT_SET = 44 OP_OBJ_MODEL_SET = 45 OP_WORK_SET = 46 OP_SPEED_SET = 47 OP_ADD_SPEED = 48 OP_ADD_ASPEED = 49 OP_POS_SET = 50 OP_DIR_SET = 51 OP_MEMBER_SET = 52 OP_MEMBER_SET2 = 53 OP_SE_ON = 54 OP_SCA_ID_SET = 55 OP_DIR_CK = 57 OP_SCE_ESPR_ON = 58 OP_DOOR_AOT_SET = 59 OP_CUT_AUTO = 60 OP_MEMBER_COPY = 61 OP_MEMBER_CMP = 62 OP_PLC_MOTION = 63 OP_PLC_DEST = 64 OP_PLC_NECK = 65 OP_PLC_RET = 66 OP_PLC_FLAG = 67 OP_SCE_EM_SET = 68 OP_AOT_RESET = 70 OP_AOT_ON = 71 OP_SUPER_SET = 72 OP_CUT_REPLACE = 75 OP_SCE_ESPR_KILL = 76 OP_DOOR_MODEL_SET = 77 OP_ITEM_AOT_SET = 78 OP_SCE_TRG_CK = 80 OP_SCE_BGM_CONTROL = 81 OP_SCE_ESPR_CONTROL = 82 OP_SCE_FADE_SET = 83 OP_SCE_ESPR3D_ON = 84 OP_SCE_BGMTBL_SET = 87 OP_PLC_ROT = 88 OP_XA_ON = 89 OP_WEAPON_CHG = 90 OP_PLC_CNT = 91 OP_SCE_SHAKE_ON = 92 OP_MIZU_DIV_SET = 93 OP_KEEP_ITEM_CK = 94 OP_XA_VOL = 95 OP_KAGE_SET = 96 OP_CUT_BE_SET = 97 OP_SCE_ITEM_LOST = 98 OP_PLC_GUN_EFF = 99 OP_SCE_ESPR_ON2 = 100 OP_SCE_ESPR_KILL2 = 101 OP_PLC_STOP = 102 OP_AOT_SET_4P = 103 OP_DOOR_AOT_SET_4P = 104 OP_ITEM_AOT_SET_4P = 105 OP_LIGHT_POS_SET = 106 OP_LIGHT_KIDO_SET = 107 OP_RBJ_RESET = 108 OP_SCE_SCR_MOVE = 109 OP_PARTS_SET = 110 OP_MOVIE_ON = 111 OP_SCE_PARTS_BOMB = 122 OP_SCE_PARTS_DOWN = 123 )
View Source
const ( TIM_BPP_4 = 8 TIM_BPP_8 = 9 TIM_BPP_16 = 2 TIM_BPP_24 = 3 )
Variables ¶
View Source
var (
InstructionSize = map[byte]int{}/* 103 elements not displayed */
)
Functions ¶
func CalculateFOVDegrees ¶
Types ¶
type ADTOutput ¶
func LoadADTFile ¶
func LoadADTStream ¶
func (*ADTOutput) ConvertToPNG ¶
func (*ADTOutput) ConvertToRenderData ¶
type AnimBlockHeader ¶
type AnimMovement ¶
type AnimSprite ¶
x and y are top-left position of sprite in TIM sprite sheet Offset is used to shift sprite frame to align it with other frames with different dimensions
type AnimationFrame ¶
type BinOutput ¶
func LoadBINFile ¶
type BitReader ¶
type BitReader struct {
// contains filtered or unexported fields
}
func NewBitReader ¶
func NewBitReader(r *io.SectionReader) *BitReader
func (*BitReader) ReadBitLittleEndian ¶
func (*BitReader) ReadNumBits ¶
Reads a sequence of bits in sequential order Do not use this function if the data is in little endian
func (*BitReader) ReadNumBitsLittleEndian ¶
func (*BitReader) UnsafeReadByte ¶
func (*BitReader) UnsafeReadNumBits ¶
func (*BitReader) UnsafeReadNumBitsLittleEndian ¶
type CameraInfo ¶
type CollisionEntity ¶
type DO2FileFormat ¶
type DO2Output ¶
type DO2Output struct { VABHeaderOutput *VABHeaderOutput MD1Output *MD1Output TIMOutput *TIMOutput DO2FileFormat *DO2FileFormat }
func LoadDO2File ¶
type EDDHeaderObject ¶
type EDDOutput ¶
type EDDOutput struct { AnimationIndexFrames [][]EDDTableElement NumFrames int }
type EDDTableElement ¶
type EMDOffsets ¶
type EMDOutput ¶
type EMDOutput struct { AnimationData1 *EDDOutput SkeletonData1 *EMROutput AnimationData2 *EDDOutput SkeletonData2 *EMROutput AnimationData3 *EDDOutput SkeletonData3 *EMROutput MeshData *MD1Output }
func LoadEMDFile ¶
type EMRArmature ¶
type EMROutput ¶
type EMROutput struct { RelativePositionData []EMRRelativePosition ArmatureData []EMRArmature ArmatureChildren [][]uint8 MeshIdList []uint8 FrameData []AnimationFrame }
type EMRRelativePosition ¶
type ESPHeader ¶
type ESPHeader struct {
Ids [8]uint8 // If value doesn't equal 0xff, there is an animation
}
type ESPOutput ¶
type ESPOutput struct { SpriteData []SpriteData ValidSpriteCount int }
func LoadESPFile ¶
func LoadESPStream ¶
func LoadRDT_ESP ¶
type LITCameraLight ¶
type LITCameraLight struct { LightType [2]uint16 Colors [3]LITLightColor // Color for each light AmbientColor LITLightColor // Ambient color for camera Positions [3]LITPosition // Position for each light Brightness [3]uint16 // Brightness for each light }
type LITLightColor ¶
type LITPosition ¶
type MD1Object ¶
type MD1Object struct { TriangleVertices []MD1Vertex TriangleNormals []MD1Vertex TriangleIndices []MD1TriangleIndex TriangleTextures []MD1TriangleTexture QuadVertices []MD1Vertex QuadNormals []MD1Vertex QuadIndices []MD1QuadIndex QuadTextures []MD1QuadTexture }
type MD1ObjectHeader ¶
type MD1ObjectHeader struct { TrianglesHeader MD1TrianglesHeader QuadsHeader MD1QuadsHeader }
type MD1QuadIndex ¶
type MD1QuadTexture ¶
type MD1QuadTexture struct { U0 uint8 // UV coordinates for vertex 0 V0 uint8 ClutId uint16 // Texture clut id, bits 0-5 U1 uint8 // UV coordinates for vertex 1 V1 uint8 Page uint16 // Texture page U2 uint8 // UV coordinates for vertex 2 V2 uint8 Zero1 uint16 U3 uint8 // UV coordinates for vertex 3 V3 uint8 Zero2 uint16 }
type MD1QuadsHeader ¶
type MD1TriangleIndex ¶
type MD1TriangleTexture ¶
type MD1TrianglesHeader ¶
type MaskRectangle ¶
type PLDOffsets ¶
type PLDOutput ¶
type PLDOutput struct { AnimationData *EDDOutput SkeletonData *EMROutput MeshData *MD1Output TextureData *TIMOutput }
func LoadPLDFile ¶
type PRIMaskRectangle ¶
type PRIMaskRectangle struct { SrcX uint8 // x-coordinate on source .tim image SrcY uint8 // x-coordinate on source .tim image DestX uint8 // destination x-coordinate DestY uint8 // destination y-coordinate DestZ uint16 // destination z-coordinate (depth/z-buffer) Zero uint16 Width uint16 // width of the mask tile Height uint16 // height of the mask tile }
type PRIMaskSquare ¶
type PRIMaskSquare struct { SrcX uint8 // x-coordinate on source .tim image SrcY uint8 // x-coordinate on source .tim image DestX uint8 // destination x-coordinate DestY uint8 // destination y-coordinate DestZ uint16 // destination z-coordinate (depth/z-buffer) Width uint16 // width of the mask tile }
type PRIOutput ¶
type PRIOutput struct {
Masks []MaskRectangle
}
type PRIRelativeOffset ¶
type RDTItemOffsets ¶
type RDTOffsets ¶
type RDTOffsets struct { OffsetRoomSound uint32 // offset to room .snd sound table data OffsetRoomVABHeader uint32 // .vh file OffsetRoomVABData uint32 // .vb file OffsetEnemyVABHeader uint32 // .vh file OffsetEnemyVABData uint32 // .vb file OffsetOTA uint32 OffsetCollisionData uint32 // .sca file OffsetCameraPosition uint32 // .rid file OffsetCameraSwitches uint32 // .rvd file OffsetLights uint32 // .lit file OffsetItems uint32 OffsetFloorSound uint32 // .flr file OffsetBlocks uint32 // .blk file OffsetLang1 uint32 // .msg file OffsetLang2 uint32 // .msg file OffsetScrollTexture uint32 // .tim file OffsetInitScript uint32 // .scd file OffsetExecuteScript uint32 // .scd file OffsetSpriteAnimations uint32 // .esp file OffsetSpriteAnimationsOffset uint32 // .esp file OffsetSpriteImage uint32 // .tim file OffsetModelImage uint32 // .tim file OffsetRBJ uint32 // .rbj file }
type RDTOutput ¶
type RDTOutput struct { Header RDTHeader RIDOutput *RIDOutput // camera positions CameraSwitchData *RVDOutput LightData *LITOutput CollisionData *SCAOutput InitScriptData *SCDOutput RoomScriptData *SCDOutput SpriteOutput *ESPOutput ItemTextureData []*TIMOutput ItemModelData []*MD1Output }
func LoadRDTFile ¶
type RIDOutput ¶
type RIDOutput struct { CameraPositions []CameraInfo CameraMasks [][]MaskRectangle }
func LoadRDT_RID ¶
type RVDOutput ¶
type RVDOutput struct {
CameraSwitches []RVDHeader
}
func LoadRDT_RVD ¶
func LoadRDT_RVD(r io.ReaderAt, fileLength int64, rdtHeader RDTHeader, offsets RDTOffsets) (*RVDOutput, error)
A camera switch is a flat zone in 3D space, where you switch from one camera to another when the player crosses it
type RoomImageOutput ¶
func ExtractItemImage ¶
func ExtractItemImage(inputFilename string, binOutput *BinOutput, imageId int) *RoomImageOutput
func ExtractRoomBackground ¶
func ExtractRoomBackground(inputFilename string, binOutput *BinOutput, roomId int) *RoomImageOutput
Room image is stored as an ADT file
type SAPOutput ¶
type SAPOutput struct {
AudioData []byte
}
func LoadSAPFile ¶
func (*SAPOutput) ConvertToWAV ¶
type SCAElement ¶
type SCDOutput ¶
type SCDOutput struct {
ScriptData ScriptFunction
}
type ScriptFunction ¶
type ScriptInstrAotReset ¶
type ScriptInstrAotSet ¶
type ScriptInstrAotSet4p ¶
type ScriptInstrCalc ¶
type ScriptInstrCalc2 ¶
type ScriptInstrCheckBitTest ¶
type ScriptInstrCompare ¶
type ScriptInstrCopy ¶
type ScriptInstrCutAuto ¶
type ScriptInstrCutChg ¶
type ScriptInstrDoorAotSet ¶
type ScriptInstrDoorAotSet struct { Opcode uint8 // 0x3b Aot uint8 // Index of item in array of room objects list Id uint8 Type uint8 Floor uint8 Super uint8 X, Z int16 // Location of door Width, Depth int16 // Size of door NextX, NextY, NextZ, NextDir int16 // Position and direction of player after door entered Stage, Room, Camera uint8 // Stage, room, camera after door entered NextFloor uint8 TextureType uint8 DoorType uint8 KnockType uint8 KeyId uint8 KeyType uint8 Free uint8 }
type ScriptInstrDoorAotSet4p ¶
type ScriptInstrDoorAotSet4p struct { Opcode uint8 // 0x68 Aot uint8 // Index of item in array of room objects list Id uint8 Type uint8 Floor uint8 Super uint8 X1, Z1 int16 X2, Z2 int16 X3, Z3 int16 X4, Z4 int16 NextX, NextY, NextZ, NextDir int16 // Position and direction of player after door entered Stage, Room, Camera uint8 // Stage, room, camera after door entered NextFloor uint8 TextureType uint8 DoorType uint8 KnockType uint8 KeyId uint8 KeyType uint8 Free uint8 }
type ScriptInstrDoorModelSet ¶
type ScriptInstrElseStart ¶
type ScriptInstrEventExec ¶
type ScriptInstrForStart ¶
type ScriptInstrGoSub ¶
type ScriptInstrGoto ¶
type ScriptInstrIfElseStart ¶
type ScriptInstrItemAotSet ¶
type ScriptInstrItemAotSet4p ¶
type ScriptInstrKageSet ¶
type ScriptInstrMemberSet ¶
type ScriptInstrMizuDivSet ¶
type ScriptInstrObjModelSet ¶
type ScriptInstrPlcDest ¶
type ScriptInstrPlcFlag ¶
type ScriptInstrPlcMotion ¶
type ScriptInstrPlcNeck ¶
type ScriptInstrPlcRot ¶
type ScriptInstrPosSet ¶
type ScriptInstrSave ¶
type ScriptInstrScaIdSet ¶
type ScriptInstrSceEmSet ¶
type ScriptInstrSceEspr3DOn ¶
type ScriptInstrSceEsprKill ¶
type ScriptInstrSceEsprOn ¶
type ScriptInstrSetBit ¶
type ScriptInstrSleep ¶
type ScriptInstrSwitch ¶
type ScriptInstrSwitchCase ¶
type ScriptInstrWorkSet ¶
type ScriptInstrXaOn ¶
type SpriteData ¶
type SpriteData struct { Id int FrameData []AnimFrame FramePositions []AnimSprite AnimMovements []AnimMovement ImageData *TIMOutput }
type StreamReader ¶
type StreamReader struct {
// contains filtered or unexported fields
}
func NewStreamReader ¶
func NewStreamReader(r *io.SectionReader) *StreamReader
func (*StreamReader) ReadData ¶
func (streamReader *StreamReader) ReadData(data interface{}) error
func (*StreamReader) SetPosition ¶
func (streamReader *StreamReader) SetPosition(newPosition int64)
type TIMImageHeader ¶
type TIMOutput ¶
type TIMOutput struct { PixelData [][]uint16 ImageWidth int ImageHeight int NumPalettes int NumBytes int }
func LoadTIMFile ¶
func LoadTIMImages ¶
func (*TIMOutput) ConvertToPNG ¶
func (*TIMOutput) ConvertToRenderData ¶
type UnpackArray ¶
type UnpackArray struct { DataCount uint64 Ptr8 []UnpackArray8 Tree []Node }
type UnpackArray8 ¶
type UnpackArray8 struct {
// contains filtered or unexported fields
}
type VABDataOutput ¶
func LoadVABDataStream ¶
func LoadVABDataStream(r io.ReaderAt, fileLength int64, vabHeaderOutput *VABHeaderOutput) (*VABDataOutput, error)
type VABHeader ¶
type VABHeader struct { Magic [4]byte // "pBAV" Version uint32 // format version Id uint32 // vab id Filesize uint32 // waveform size in bytes Reserved0 uint16 // system reserved value ProgramCount uint16 // total number of programs used ToneCount uint16 // total number of tones used WaveformCount uint16 // total number of waveforms (.vag files) used MasterVolume uint8 // master volume used MasterPan uint8 // master pan used BankAttribute1 uint8 // user defined attribute of bank 1 BankAttribute2 uint8 // user defined attribute of bank 2 Reserved1 uint32 // system reserved value }
type VABHeaderOutput ¶
func LoadVABHeaderStream ¶
func LoadVABHeaderStream(r io.ReaderAt, fileLength int64) (*VABHeaderOutput, error)
type VABProgram ¶
type VABTone ¶
type VABTone struct { Priority uint8 // tone priority (0 - 127); used for controlling allocation when more voices than can be keyed on are requested Mode uint8 // tone mode (0 = normal; 4 = reverb applied) Volume uint8 // tone volume Pan uint8 // tone pan Center uint8 // center note (0~127) Shift uint8 // pitch correction (0~127,cent units) NoteMin uint8 // minimum note limit (0~127) NoteMax uint8 // maximum note limit (0~127, provided min < max) VibratoWidth uint8 // vibrato width (1/128 rate, 0~127) VibratoTime uint8 // 1 cycle time of vibrato (tick units) PortamentoWidth uint8 // portamento width (1/128 rate, 0~127) PortamentoTime uint8 // portamento holding time (tick units) PitchBendMin uint8 // pitch bend (-0~127, 127 = 1 octave) PitchBendMax uint8 // pitch bend (+0~127, 127 = 1 octave) Reserved1 uint8 Reserved2 uint8 Adsr1 uint16 Adsr2 uint16 Program int16 // parent program Vag int16 // waveform (VAG) used Reserved3 [4]int16 }
Click to show internal directories.
Click to hide internal directories.