// REMOVE ME

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef ___ASURA_PS2_OLDOBJECTDEFINES_H___
#define ___ASURA_PS2_OLDOBJECTDEFINES_H___ 1

// M A C R O S ///////////////////////////////////////////////////////////////

// Per Packet Rendering Flags, compiled into the packet data at export time - lower 7 bits contain the vertex count
#define ASURA_PS2_OBJECT__PACKET_MASK__VERTEX_QTY       (0x07F)
#define ASURA_PS2_OBJECT__PACKET_FLAG__FULLBRIGHT       (0x100)

// ITOP data : Per Object Rendering Flags, based on texture flags + Num Lights
#define ASURA_PS2_OBJECT__MASK__LIGHT_QTY               (0x00F)
#define ASURA_PS2_OBJECT__MASK__MULTIPASS               (0x060)
#define ASURA_PS2_OBJECT__FLAG__CLIP                    (0x010)
#define ASURA_PS2_OBJECT__FLAG__SELFILLUMINATED         (0x020)
#define ASURA_PS2_OBJECT__FLAG__REFLECTIVE              (0x040)

// Which planes need clipping against - these match the VU1 clipping bits
#define ASURA_PS2_OBJECT__CLIP_RIGHT                    (0x001)
#define ASURA_PS2_OBJECT__CLIP_LEFT                     (0x002)
#define ASURA_PS2_OBJECT__CLIP_BOTTOM                   (0x004)
#define ASURA_PS2_OBJECT__CLIP_TOP                      (0x008)
#define ASURA_PS2_OBJECT__CLIP_FAR                      (0x010)
#define ASURA_PS2_OBJECT__CLIP_NEAR                     (0x020)
#define ASURA_PS2_OBJECT__CLIP_ALL                      (0x03F)

// Data size break-downs - lights
#define ASURA_PS2_OBJECT__SIZE__PER_LIGHT               (    2)

// Data size break-downs - cameras
#define ASURA_PS2_OBJECT_CAMERA_VIEWPORT_QWS            (    2)
#define ASURA_PS2_OBJECT_CAMERA_MATRIX_QWS              (    7)
#define ASURA_PS2_OBJECT_CAMERA_REFLECTION_MATRIX_QWS   (    8)
#define ASURA_PS2_OBJECT_CAMERA_TOTAL_QWS               (ASURA_PS2_OBJECT_CAMERA_VIEWPORT_QWS+ASURA_PS2_OBJECT_CAMERA_MATRIX_QWS+ASURA_PS2_OBJECT_CAMERA_REFLECTION_MATRIX_QWS)

// Setup GIFTAG, Drawing Giftag, Base pass ALPHA + TEX0, Self-illuminating pass ALPHA, Reflective pass ALPHA + TEX0
#define ASURA_PS2_OBJECT__SIZE__PASS_SETUP_DATA         (    7)

// Data start locations
#define ASURA_PS2_OBJECT__ADDR__COLOUR                  (    0)
#define ASURA_PS2_OBJECT__ADDR__LIGHT_DATA              (    1)
#define ASURA_PS2_OBJECT__ADDR__CAMERA_DATA             (   41)
#define ASURA_PS2_OBJECT__ADDR__SETUP_GIF_TAG           (  105)
#define ASURA_PS2_OBJECT__ADDR__DRAWING_GIF_TAG         (  106)
#define ASURA_PS2_OBJECT__ADDR__BASE_PASS_ALPHA         (  107)
#define ASURA_PS2_OBJECT__ADDR__BASE_PASS_TEX0          (  108)
#define ASURA_PS2_OBJECT__ADDR__SELF_PASS_ALPHA         (  109)
#define ASURA_PS2_OBJECT__ADDR__REFL_PASS_ALPHA         (  110)
#define ASURA_PS2_OBJECT__ADDR__REFL_PASS_TEX0          (  111)
#define ASURA_PS2_OBJECT__ADDR__STQ_BUFFER              (  115)
#define ASURA_PS2_OBJECT__ADDR__INPUT_BUFFER1           (  171)
#define ASURA_PS2_OBJECT__ADDR__INPUT_BUFFER2           (  351)
#define ASURA_PS2_OBJECT__ADDR__OUTPUT_BUFFER1          (  531) // 141
#define ASURA_PS2_OBJECT__ADDR__OUTPUT_BUFFER2          (  672)
#define ASURA_PS2_OBJECT__ADDR__CLIPPER_INPUT_BFR       (  813)

// Data area sizes
#define ASURA_PS2_OBJECT__SIZE__LIGHT_DATA              ( ASURA_PS2_OBJECT_MAX_LIGHTS * ASURA_PS2_OBJECT__SIZE__PER_LIGHT )
#define ASURA_PS2_OBJECT__SIZE__CAMERA_DATA             ( ASURA_MAX_NO_OF_CAMERAS * ASURA_PS2_OBJECT_CAMERA_TOTAL_QWS )
#define ASURA_PS2_OBJECT__SIZE__INPUT_BUFFER            ( ASURA_PS2_OBJECT__ADDR__INPUT_BUFFER2 - ASURA_PS2_OBJECT__ADDR__INPUT_BUFFER1 )
#define ASURA_PS2_OBJECT__SIZE__OUTPUT_BUFFER           ( ASURA_PS2_OBJECT__ADDR__OUTPUT_BUFFER2 - ASURA_PS2_OBJECT__ADDR__OUTPUT_BUFFER1 )
#define ASURA_PS2_OBJECT__SIZE__CLIPPER_INPUT_BFR       (  168)

// Clipper defines
// 14
#define ASURA_PS2_OBJECT__SIZE__CLIP_WORKSPACE          (   36) // Up to 9 vertices with 4 QWs per vertex.
#define ASURA_PS2_OBJECT__SIZE__CLIPPED_STS             (   24) // See memory map above for calculations.
#define ASURA_PS2_OBJECT__OFFSET__CLIPPED_STS           (  123) // Offset within clip buffer. See memory map above for calculations.
#define ASURA_PS2_OBJECT__OFFSET__CLIP_WORKSPACE        (   51) //               "                        "

// We have to stack a load of vi registers to allow clipper enough vi registers
#define ASURA_PS2_OBJECT__VI_STACK0                     (  112)
#define ASURA_PS2_OBJECT__VI_STACK1                     (  113)
#define ASURA_PS2_OBJECT__VI_STACK2                     (  114)

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

#endif // #ifndef ___ASURA_PS2_OLDOBJECTDEFINES_H___

