From 53df6927c5101107ea921e4a68dc36d535c9d57b Mon Sep 17 00:00:00 2001 From: Kirill Kranz Date: Fri, 18 Oct 2024 17:33:06 +0200 Subject: [PATCH] removed unpreaty line endings / beginnings --- rtl/ps1/psy-q-sdk/libgpu.pas | 220 +++++++++++----- rtl/ps1/psy-q-sdk/libgs.pas | 16 +- rtl/ps1/psy-q-sdk/libgte.pas | 21 +- rtl/ps1/psy-q-sdk/libhmd.pas | 463 ++++++++++++++++----------------- rtl/ps1/psy-q-sdk/libmcgui.pas | 7 +- rtl/ps1/psy-q-sdk/libmcrd.pas | 12 +- rtl/ps1/psy-q-sdk/libstd.pas | 78 +++--- 7 files changed, 450 insertions(+), 367 deletions(-) diff --git a/rtl/ps1/psy-q-sdk/libgpu.pas b/rtl/ps1/psy-q-sdk/libgpu.pas index 08a71a9fe2..f3190c3f06 100644 --- a/rtl/ps1/psy-q-sdk/libgpu.pas +++ b/rtl/ps1/psy-q-sdk/libgpu.pas @@ -668,7 +668,7 @@ procedure setXY0(var p: POLY_G4; const x, y: smallint); procedure setXY0(var p: POLY_GT3; const x, y: smallint); procedure setXY0(var p: POLY_GT4; const x, y: smallint); procedure setXY0(var p: LINE_F2; const x, y: smallint); -procedure setXY0(var p: LINE_G2; const x, y: smallint); +procedure setXY0(var p: LINE_G2; const x, y: smallint); procedure setXY0(var p: LINE_F3; const x, y: smallint); procedure setXY0(var p: LINE_G3; const x, y: smallint); procedure setXY0(var p: LINE_F4; const x, y: smallint); @@ -867,7 +867,7 @@ procedure dumpRGB2(p: POLY_GT3); procedure dumpRGB2(p: POLY_GT4); procedure dumpRGB3(p: POLY_G4); -procedure dumpRGB3(p: POLY_GT4); +procedure dumpRGB3(p: POLY_GT4); // Primitive Handling Macros @@ -1018,7 +1018,7 @@ procedure setPolyGT4(var p: POLY_GT4); procedure setSprt8(var p: SPRT_8); procedure setSprt16(var p: SPRT_16); procedure setSprt(var p: SPRT); -//procedure setTile1(var p: TILE_1); +procedure setTile1(var p: TILE_1); procedure setTile8(var p: TILE_8); procedure setTile16(var p: TILE_16); procedure setTile(var p: TILE); @@ -1714,7 +1714,7 @@ begin p.x0:= x0; p.y0:= y0; p.x1:= x0 + w; - p.y1:= y0; + p.y1:= y0; p.x2:= x0; p.y2:= y0 + h; p.x3:= x0 + w; @@ -1740,7 +1740,7 @@ begin p.x0:= x0; p.y0:= y0; p.x1:= x0 + w; - p.y1:= y0; + p.y1:= y0; p.x2:= x0; p.y2:= y0 + h; p.x3:= x0 + w; @@ -1766,7 +1766,7 @@ begin p.x0:= x0; p.y0:= y0; p.x1:= x0 + w; - p.y1:= y0; + p.y1:= y0; p.x2:= x0; p.y2:= y0 + h; p.x3:= x0 + w; @@ -1779,7 +1779,7 @@ begin p.x0:= x0; p.y0:= y0; p.x1:= x0 + w; - p.y1:= y0; + p.y1:= y0; p.x2:= x0; p.y2:= y0 + h; p.x3:= x0 + w; @@ -2077,66 +2077,77 @@ begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; + procedure dumpXY0(p: LINE_G2); begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; - + + procedure dumpXY0(p: LINE_F3); begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; - + + procedure dumpXY0(p: LINE_G3); begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; - + + procedure dumpXY0(p: LINE_F4); begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; - + + procedure dumpXY0(p: LINE_G4); begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; - + + procedure dumpXY0(p: SPRT); begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; - + + procedure dumpXY0(p: SPRT_16); begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; - + + procedure dumpXY0(p: SPRT_8); begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; - + + procedure dumpXY0(p: TILE); begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; - + + procedure dumpXY0(p: TILE_16); begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; - + + procedure dumpXY0(p: TILE_8); begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; - + + procedure dumpXY0(p: TILE_1); begin GPU_printf('(%d,%d)\n', p.x0, p.y0); end; - procedure dumpUV0(p: POLY_FT3); @@ -2150,101 +2161,121 @@ begin GPU_printf('(%d,%d)\n', p.u0, p.v0); end; + procedure dumpUV0(p: POLY_GT3); begin GPU_printf('(%d,%d)\n', p.u0, p.v0); end; + procedure dumpUV0(p: POLY_GT4); begin GPU_printf('(%d,%d)\n', p.u0, p.v0); end; + procedure dumpUV0(p: SPRT); begin GPU_printf('(%d,%d)\n', p.u0, p.v0); end; + procedure dumpUV0(p: SPRT_16); begin GPU_printf('(%d,%d)\n', p.u0, p.v0); end; + procedure dumpUV0(p: SPRT_8); begin GPU_printf('(%d,%d)\n', p.u0, p.v0); end; + procedure dumpUV0(p: TMD_PRIM); begin GPU_printf('(%d,%d)\n', p.u0, p.v0); end; + procedure dumpXY2(p: POLY_F3); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: POLY_F4); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: POLY_FT3); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: POLY_FT4); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: POLY_G3); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: POLY_G4); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: POLY_GT3); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: POLY_GT4); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: LINE_F2); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: LINE_G2); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: LINE_F3); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: LINE_G3); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: LINE_F4); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); end; + procedure dumpXY2(p: LINE_G4); begin GPU_printf('(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1); @@ -2298,26 +2329,31 @@ begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1, p.x2, p.y2); end; + procedure dumpXY3(p: LINE_F3); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1, p.x2, p.y2); end; + procedure dumpXY3(p: LINE_G3); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1, p.x2, p.y2); end; + procedure dumpXY3(p: LINE_F4); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1, p.x2, p.y2); end; + procedure dumpXY3(p: LINE_G4); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1, p.x2, p.y2); end; + procedure dumpUV3(p: POLY_FT3); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)\n', p.u0, p.v0, p.u1, p.v1, p.u2, p.v2); @@ -2329,16 +2365,19 @@ begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)\n', p.u0, p.v0, p.u1, p.v1, p.u2, p.v2); end; + procedure dumpUV3(p: POLY_GT3); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)\n', p.u0, p.v0, p.u1, p.v1, p.u2, p.v2); end; + procedure dumpUV3(p: POLY_GT4); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)\n', p.u0, p.v0, p.u1, p.v1, p.u2, p.v2); end; + procedure dumpUV3(p: TMD_PRIM); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)\n', p.u0, p.v0, p.u1, p.v1, p.u2, p.v2); @@ -2350,78 +2389,91 @@ begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1, p.x2, p.y2, p.x3, p.y3); end; + procedure dumpXY4(p: POLY_FT4); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1, p.x2, p.y2, p.x3, p.y3); end; + procedure dumpXY4(p: POLY_G4); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1, p.x2, p.y2, p.x3, p.y3); end; + procedure dumpXY4(p: POLY_GT4); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)-(%d,%d)\n', p.x0, p.y0, p.x1, p.y1, p.x2, p.y2, p.x3, p.y3); end; - + procedure dumpUV4(p: POLY_FT4); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)-(%d,%d)\n', p.u0, p.v0, p.u1, p.v1, p.u2, p.v2, p.u3, p.v3); end; + procedure dumpUV4(p: POLY_GT4); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)-(%d,%d)\n', p.u0, p.v0, p.u1, p.v1, p.u2, p.v2, p.u3, p.v3); end; + procedure dumpUV4(p: TMD_PRIM); begin GPU_printf('(%d,%d)-(%d,%d)-(%d,%d)-(%d,%d)\n', p.u0, p.v0, p.u1, p.v1, p.u2, p.v2, p.u3, p.v3); end; - + procedure dumpRGB0(p: POLY_F3); begin GPU_printf('(%3d,%3d,%3d)\n', p.r0, p.g0, p.b0); end; + procedure dumpRGB0(p: POLY_F4); begin GPU_printf('(%3d,%3d,%3d)\n', p.r0, p.g0, p.b0); end; + procedure dumpRGB0(p: POLY_FT3); begin GPU_printf('(%3d,%3d,%3d)\n', p.r0, p.g0, p.b0); end; + procedure dumpRGB0(p: POLY_FT4); begin GPU_printf('(%3d,%3d,%3d)\n', p.r0, p.g0, p.b0); end; + procedure dumpRGB0(p: POLY_G3); begin GPU_printf('(%3d,%3d,%3d)\n', p.r0, p.g0, p.b0); end; + procedure dumpRGB0(p: POLY_G4); begin GPU_printf('(%3d,%3d,%3d)\n', p.r0, p.g0, p.b0); end; + procedure dumpRGB0(p: POLY_GT3); begin GPU_printf('(%3d,%3d,%3d)\n', p.r0, p.g0, p.b0); end; + procedure dumpRGB0(p: POLY_GT4); begin GPU_printf('(%3d,%3d,%3d)\n', p.r0, p.g0, p.b0); end; + procedure dumpRGB0(p: DRAWENV); begin GPU_printf('(%3d,%3d,%3d)\n', p.r0, p.g0, p.b0); @@ -2433,36 +2485,43 @@ begin GPU_printf('(%3d,%3d,%3d)\n', p.r1, p.g1, p.b1); end; + procedure dumpRGB1(p:POLY_G4); begin GPU_printf('(%3d,%3d,%3d)\n', p.r1, p.g1, p.b1); end; + procedure dumpRGB1(p:POLY_GT3); begin GPU_printf('(%3d,%3d,%3d)\n', p.r1, p.g1, p.b1); end; + procedure dumpRGB1(p:POLY_GT4); begin GPU_printf('(%3d,%3d,%3d)\n', p.r1, p.g1, p.b1); end; + procedure dumpRGB2(p: POLY_G3); begin GPU_printf('(%3d,%3d,%3d)\n', p.r2, p.g2, p.b2); end; + procedure dumpRGB2(p: POLY_G4); begin GPU_printf('(%3d,%3d,%3d)\n', p.r2, p.g2, p.b2); end; + procedure dumpRGB2(p: POLY_GT3); begin GPU_printf('(%3d,%3d,%3d)\n', p.r2, p.g2, p.b2); end; + procedure dumpRGB2(p: POLY_GT4); begin GPU_printf('(%3d,%3d,%3d)\n', p.r2, p.g2, p.b2); @@ -2474,13 +2533,13 @@ begin GPU_printf('(%3d,%3d,%3d)\n', p.r3, p.g3, p.b3); end; + procedure dumpRGB3(p: POLY_GT4); begin GPU_printf('(%3d,%3d,%3d)\n', p.r3, p.g3, p.b3); end; - procedure setTPage(var p: DRAWENV; tp, abr, x, y: longint); begin p.tpage:= GetTPage(tp, abr, x, y); @@ -2522,59 +2581,61 @@ begin p.clut:= getClut(x, y); end; + procedure setClut(var p: POLY_FT4; x, y: longint); begin p.clut:= getClut(x, y); end; + procedure setClut(var p: POLY_GT3; x, y: longint); begin p.clut:= getClut(x, y); end; + procedure setClut(var p: POLY_GT4; x, y: longint); begin p.clut:= getClut(x, y); end; + procedure setClut(var p: SPRT; x, y: longint); begin p.clut:= getClut(x, y); end; + procedure setClut(var p: SPRT_16; x, y: longint); begin p.clut:= getClut(x, y); end; + procedure setClut(var p: SPRT_8; x, y: longint); begin p.clut:= getClut(x, y); end; + procedure setClut(var p: TMD_PRIM; x, y: longint); begin p.clut:= getClut(x, y); end; - - - procedure dumpRECT(r: RECT); begin GPU_printf('(%d,%d)-(%d,%d)\n', r.x, r.y, r.w, r.h); end; - - - procedure setlen(var p: P_TAG; const len: byte); begin p.len:= len; end; + procedure setlen(var p: POLY_F3; const len: byte); var x : ^P_TAG; begin @@ -2582,6 +2643,7 @@ begin x^.len:= len; end; + procedure setlen(var p: POLY_FT3; const len: byte); var x : ^P_TAG; begin @@ -2589,6 +2651,7 @@ begin x^.len:= len; end; + procedure setlen(var p: POLY_G3; const len: byte); var x : ^P_TAG; begin @@ -2596,6 +2659,7 @@ begin x^.len:= len; end; + procedure setlen(var p: POLY_GT3; const len: byte); var x : ^P_TAG; begin @@ -2603,6 +2667,7 @@ begin x^.len:= len; end; + procedure setlen(var p: POLY_F4; const len: byte); var x : ^P_TAG; begin @@ -2610,6 +2675,7 @@ begin x^.len:= len; end; + procedure setlen(var p: POLY_FT4; const len: byte); var x : ^P_TAG; begin @@ -2617,6 +2683,7 @@ begin x^.len:= len; end; + procedure setlen(var p: POLY_G4; const len: byte); var x : ^P_TAG; begin @@ -2624,6 +2691,7 @@ begin x^.len:= len; end; + procedure setlen(var p: POLY_GT4; const len: byte); var x : ^P_TAG; begin @@ -2631,6 +2699,7 @@ begin x^.len:= len; end; + procedure setlen(var p: SPRT_8; const len: byte); var x : ^P_TAG; begin @@ -2638,6 +2707,7 @@ begin x^.len:= len; end; + procedure setlen(var p: SPRT_16; const len: byte); var x : ^P_TAG; begin @@ -2645,6 +2715,7 @@ begin x^.len:= len; end; + procedure setlen(var p: SPRT; const len: byte); var x : ^P_TAG; begin @@ -2652,6 +2723,7 @@ begin x^.len:= len; end; + procedure setlen(var p: TILE_1; const len: byte); var x : ^P_TAG; begin @@ -2659,6 +2731,7 @@ begin x^.len:= len; end; + procedure setlen(var p: TILE_8; const len: byte); var x : ^P_TAG; begin @@ -2666,6 +2739,7 @@ begin x^.len:= len; end; + procedure setlen(var p: TILE_16; const len: byte); var x : ^P_TAG; begin @@ -2673,6 +2747,7 @@ begin x^.len:= len; end; + procedure setlen(var p: TILE; const len: byte); var x : ^P_TAG; begin @@ -2680,6 +2755,7 @@ begin x^.len:= len; end; + procedure setlen(var p: LINE_F2; const len: byte); var x : ^P_TAG; begin @@ -2687,6 +2763,7 @@ begin x^.len:= len; end; + procedure setlen(var p: LINE_G2; const len: byte); var x : ^P_TAG; begin @@ -2694,6 +2771,7 @@ begin x^.len:= len; end; + procedure setlen(var p: LINE_F3; const len: byte); var x : ^P_TAG; begin @@ -2701,6 +2779,7 @@ begin x^.len:= len; end; + procedure setlen(var p: LINE_G3; const len: byte); var x : ^P_TAG; begin @@ -2708,6 +2787,7 @@ begin x^.len:= len; end; + procedure setlen(var p: LINE_F4; const len: byte); var x : ^P_TAG; begin @@ -2715,6 +2795,7 @@ begin x^.len:= len; end; + procedure setlen(var p: LINE_G4; const len: byte); var x : ^P_TAG; begin @@ -2723,16 +2804,12 @@ begin end; - - - - - procedure setaddr(var p: P_TAG; const addr: dword); begin p.addr:= addr; end; + procedure setcode(var p: P_TAG; const code: byte); begin p.code:= code; @@ -2746,6 +2823,7 @@ begin x^.code:= code; end; + procedure setcode(var p: POLY_FT3; const code: byte); var x : ^P_TAG; begin @@ -2753,6 +2831,7 @@ begin x^.code:= code; end; + procedure setcode(var p: POLY_G3; const code: byte); var x : ^P_TAG; begin @@ -2760,6 +2839,7 @@ begin x^.code:= code; end; + procedure setcode(var p: POLY_GT3; const code: byte); var x : ^P_TAG; begin @@ -2767,6 +2847,7 @@ begin x^.code:= code; end; + procedure setcode(var p: POLY_F4; const code: byte); var x : ^P_TAG; begin @@ -2774,6 +2855,7 @@ begin x^.code:= code; end; + procedure setcode(var p: POLY_FT4; const code: byte); var x : ^P_TAG; begin @@ -2781,6 +2863,7 @@ begin x^.code:= code; end; + procedure setcode(var p: POLY_G4; const code: byte); var x : ^P_TAG; begin @@ -2788,6 +2871,7 @@ begin x^.code:= code; end; + procedure setcode(var p: POLY_GT4; const code: byte); var x : ^P_TAG; begin @@ -2795,6 +2879,7 @@ begin x^.code:= code; end; + procedure setcode(var p: SPRT_8; const code: byte); var x : ^P_TAG; begin @@ -2802,6 +2887,7 @@ begin x^.code:= code; end; + procedure setcode(var p: SPRT_16; const code: byte); var x : ^P_TAG; begin @@ -2809,6 +2895,7 @@ begin x^.code:= code; end; + procedure setcode(var p: SPRT; const code: byte); var x : ^P_TAG; begin @@ -2816,6 +2903,7 @@ begin x^.code:= code; end; + procedure setcode(var p: TILE_1; const code: byte); var x : ^P_TAG; begin @@ -2823,6 +2911,7 @@ begin x^.code:= code; end; + procedure setcode(var p: TILE_8; const code: byte); var x : ^P_TAG; begin @@ -2830,6 +2919,7 @@ begin x^.code:= code; end; + procedure setcode(var p: TILE_16; const code: byte); var x : ^P_TAG; begin @@ -2837,6 +2927,7 @@ begin x^.code:= code; end; + procedure setcode(var p: TILE; const code: byte); var x : ^P_TAG; begin @@ -2844,6 +2935,7 @@ begin x^.code:= code; end; + procedure setcode(var p: LINE_F2; const code: byte); var x : ^P_TAG; begin @@ -2851,6 +2943,7 @@ begin x^.code:= code; end; + procedure setcode(var p: LINE_G2; const code: byte); var x : ^P_TAG; begin @@ -2858,6 +2951,7 @@ begin x^.code:= code; end; + procedure setcode(var p: LINE_F3; const code: byte); var x : ^P_TAG; begin @@ -2865,6 +2959,7 @@ begin x^.code:= code; end; + procedure setcode(var p: LINE_G3; const code: byte); var x : ^P_TAG; begin @@ -2872,6 +2967,7 @@ begin x^.code:= code; end; + procedure setcode(var p: LINE_F4; const code: byte); var x : ^P_TAG; begin @@ -2879,6 +2975,7 @@ begin x^.code:= code; end; + procedure setcode(var p: LINE_G4; const code: byte); var x : ^P_TAG; begin @@ -2892,46 +2989,42 @@ begin getlen:= p.len; end; + function getcode(p: P_TAG): byte; begin getcode:= p.code; end; + function getaddr(p: P_TAG): dword; begin getaddr:= p.addr; end; - - - - // Primitive Lentgh Code //-------------------------------------------------------------------- // - -//#define setPolyF3(p) setlen(p, 4), setcode(p, 0x20) procedure setPolyF3(var p: POLY_F3); begin setlen(p, 4); setcode(p, $20); end; -//#define setPolyFT3(p) setlen(p, 7), setcode(p, 0x24) + procedure setPolyFT3(var p: POLY_FT3); begin setlen(p, 7); setcode(p, $24); end; -//#define setPolyG3(p) setlen(p, 6), setcode(p, 0x30) + procedure setPolyG3(var p: POLY_G3); begin setlen(p, 6); setcode(p, $30); end; -//#define setPolyGT3(p) setlen(p, 9), setcode(p, 0x34) + procedure setPolyGT3(var p: POLY_GT3); begin setlen(p, 9); @@ -2939,14 +3032,13 @@ begin end; -//#define setPolyF4(p) setlen(p, 5), setcode(p, 0x28) procedure setPolyF4(var p: POLY_F4); begin setlen(p, 5); setcode(p, $28); end; -//#define setPolyFT4(p) setlen(p, 9), setcode(p, 0x2c) + procedure setPolyFT4(var p: POLY_FT4); begin setlen(p, 9); @@ -2954,14 +3046,13 @@ begin end; -//#define setPolyG4(p) setlen(p, 8), setcode(p, 0x38) procedure setPolyG4(var p: POLY_G4); begin setlen(p, 8); setcode(p, $38); end; -//#define setPolyGT4(p) setlen(p, 12), setcode(p, 0x3c) + procedure setPolyGT4(var p: POLY_GT4); begin setlen(p, 12); @@ -2969,72 +3060,69 @@ begin end; -//#define setSprt8(p) setlen(p, 3), setcode(p, 0x74) procedure setSprt8(var p: SPRT_8); begin setlen(p, 3); setcode(p, $74); end; -//#define setSprt16(p) setlen(p, 3), setcode(p, 0x7c) + procedure setSprt16(var p: SPRT_16); begin setlen(p, 3); setcode(p, $7c); - end; -//#define setSprt(p) setlen(p, 4), setcode(p, 0x64) + procedure setSprt(var p: SPRT); begin setlen(p, 4); setcode(p, $64); end; -//#define setTile1(p) setlen(p, 2), setcode(p, 0x68) -{ + procedure setTile1(var p: TILE_1); begin setlen(p, 2); setcode(p, $68); end; -} -//#define setTile8(p) setlen(p, 2), setcode(p, 0x70) + + procedure setTile8(var p: TILE_8); begin setlen(p, 2); setcode(p, $70); end; -//#define setTile16(p) setlen(p, 2), setcode(p, 0x78) + procedure setTile16(var p: TILE_16); begin setlen(p, 2); setcode(p, $78); end; -//#define setTile(p) setlen(p, 3), setcode(p, 0x60) + procedure setTile(var p: TILE); begin setlen(p, 3); setcode(p, $60); end; -//#define setLineF2(p) setlen(p, 3), setcode(p, 0x40) + procedure setLineF2(var p: LINE_F2); begin setlen(p, 3); setcode(p, $40); end; -//#define setLineG2(p) setlen(p, 4), setcode(p, 0x50) + procedure setLineG2(var p: LINE_G2); begin setlen(p, 4); setcode(p, $50); end; -//#define setLineF3(p) setlen(p, 5), setcode(p, 0x48),(p)->pad = 0x55555555 + procedure setLineF3(var p: LINE_F3); begin setlen(p, 5); @@ -3042,8 +3130,7 @@ begin p.pad:= $55555555; end; -//#define setLineG3(p) setlen(p, 7), setcode(p, 0x58),(p)->pad = 0x55555555, \ -// (p)->p2 = 0 + procedure setLineG3(var p: LINE_G3); begin setlen(p, 7); @@ -3052,7 +3139,7 @@ begin p.p2:= 0; end; -//#define setLineF4(p) setlen(p, 6), setcode(p, 0x4c),(p)->pad = 0x55555555 + procedure setLineF4(var p: LINE_F4); begin setlen(p, 6); @@ -3060,8 +3147,7 @@ begin p.pad:= $55555555; end; -//#define setLineG4(p) setlen(p, 9), setcode(p, 0x5c),(p)->pad = 0x55555555, \ -// (p)->p2 = 0, (p)->p3 = 0 + procedure setLineG4(var p: LINE_G4); begin setlen(p, 9); @@ -3074,19 +3160,21 @@ end; { function getTPage(tp, abr, x, y: longint): longint; begin - result:= ((((tp) and $3)shl 7)or(((abr) and $3) shl 5) or (((y) and $100) shr 4)|(((x)and $3ff) shr6) or (((y) and $200) shl 2)); + result:= ((((tp) and $3) shl 7) or (((abr) and $3) shl 5) or (((y) and $100) shr 4) or (((x) and $3ff) shr 6) or (((y) and $200) shl 2)); end; function getClut(x, y): longint; begin - result:= (((y) shl 6)or(((x) shr 4) and $3f)); + result:= (((y) shl 6) or (((x) shr 4) and $3f)); end; } + procedure dumpTPage(tpage: longint); begin GPU_printf('tpage: (%d,%d,%d,%d)\n', ((tpage) shr 7) and $003, ((tpage) shr 5) and $003, ((tpage) shl 6) and $7c0, (((tpage) shl 4) and $100)+(((tpage)shr 2) and $200)); end; + procedure dumpClut(clut: longint); begin GPU_printf('clut: (%d,%d)\n', (clut and $3f) shl 4, (clut shr 6)); diff --git a/rtl/ps1/psy-q-sdk/libgs.pas b/rtl/ps1/psy-q-sdk/libgs.pas index 17edf11d0f..326d9e48c1 100644 --- a/rtl/ps1/psy-q-sdk/libgs.pas +++ b/rtl/ps1/psy-q-sdk/libgs.pas @@ -175,14 +175,14 @@ type w, h : word; r, g, b : byte; end; - PGsBOXF = ^GsBOXF; + PGsBOXF = ^GsBOXF; GsFOGPARAM = packed record dqa : smallint; dqb : longint; rfc, gfc, bfc : byte; end; - PGsFOGPARAM = ^GsFOGPARAM; + PGsFOGPARAM = ^GsFOGPARAM; GsIMAGE = packed record @@ -938,7 +938,7 @@ type var CLIP2 : RECT; external; // clipping area PSDBASEX : array [0..1] of smallint; external; // double buffer base - PSDBASEY : array [0..1] of smallint; external; + PSDBASEY : array [0..1] of smallint; external; PSDIDX : smallint; external; // double buffer index PSDCNT : dword; external; // frame counter for using matrix cache POSITION : _GsPOSITION; external; // 2d offset @@ -956,7 +956,7 @@ var GsADIVW : smallint; external; GsADIVH : smallint; external; // Active sub divide condition (w,h) GsLIGHT_MODE : longint; external; // lighting mode global - GsMATE_C : dword; external; + GsMATE_C : dword; external; GsLMODE : dword; external; GsLIGNR : dword; external; GsLIOFF : dword; external; @@ -983,16 +983,16 @@ procedure GsIncFrame; begin inc(PSDCNT); - - if PSDCNT > 0 then PSDCNT:= PSDCNT else PSDCNT:= 1; - if PSDIDX = 0 then PSDIDX:=1 else PSDIDX:= 0; + + if PSDCNT > 0 then PSDCNT:= PSDCNT else PSDCNT:= 1; + if PSDIDX = 0 then PSDIDX:=1 else PSDIDX:= 0; end; procedure GsUpdateCoord; begin - + inc(PSDCNT); if PSDCNT > 0 then PSDCNT:= PSDCNT else PSDCNT:= 1; diff --git a/rtl/ps1/psy-q-sdk/libgte.pas b/rtl/ps1/psy-q-sdk/libgte.pas index d46b2b4a84..5e087d2119 100644 --- a/rtl/ps1/psy-q-sdk/libgte.pas +++ b/rtl/ps1/psy-q-sdk/libgte.pas @@ -11,18 +11,19 @@ const type + PMATRIX = ^MATRIX; MATRIX = packed record - m : array [0..2, 0..2] of smallint; // 3x3 rotation matrix - t : array [0..2] of longint; // transfer vector - end; - PMATRIX = ^MATRIX; - - VECTOR = packed record // long word type 3D vector - vx, vy : longint; - vz, pad : longint; - end; - PVECTOR = ^VECTOR; + m : array [0..2, 0..2] of smallint; // 3x3 rotation matrix + t : array [0..2] of longint; // transfer vector + end; + + VECTOR = packed record // long word type 3D vector + vx, vy : longint; + vz, pad : longint; + end; + + PVECTOR = ^VECTOR; SVECTOR = packed record // short word type 3D vector vx, vy : smallint; vz, pad : smallint; diff --git a/rtl/ps1/psy-q-sdk/libhmd.pas b/rtl/ps1/psy-q-sdk/libhmd.pas index e3b5632da4..f6155c4a48 100644 --- a/rtl/ps1/psy-q-sdk/libhmd.pas +++ b/rtl/ps1/psy-q-sdk/libhmd.pas @@ -54,7 +54,7 @@ type offset : longint; out_packetp : PPACKET; end; - + PGsWORKUNIT = ^GsWORKUNIT; GsWORKUNIT = packed record vec : DVECTOR; @@ -86,7 +86,6 @@ type nortop2 : PSVECTOR; end; - GsARGUNIT_IMAGE = packed record primp : pdword; tagp : PGsOT; @@ -196,9 +195,9 @@ type vert_sect : PSVECTOR; norm_sect : PSVECTOR; end; - + PGsARGUNIT_ANIM = ^GsARGUNIT_ANIM; - GsARGUNIT_ANIM = packed record + GsARGUNIT_ANIM = packed record primp : pdword; tagp : PGsOT; shift : longint; @@ -240,258 +239,258 @@ type const GsUF3 = $00000008; // flat triangle GsUFT3 = $00000009; // texture flat triangle - GsUG3 = $0000000c; // gour triangle - GsUGT3 = $0000000d; // texture gour triangle - GsUF4 = $00000010; // flat quad - GsUFT4 = $00000011; // texture flat quad - GsUG4 = $00000014; // gour quad - GsUGT4 = $00000015; // texture gour quad + GsUG3 = $0000000c; // gour triangle + GsUGT3 = $0000000d; // texture gour triangle + GsUF4 = $00000010; // flat quad + GsUFT4 = $00000011; // texture flat quad + GsUG4 = $00000014; // gour quad + GsUGT4 = $00000015; // texture gour quad - GsUFF3 = $00020008; // fog flat triangle - GsUFFT3 = $00020009; // fog texture flat triangle - GsUFG3 = $0002000c; // fog gour triangle - GsUFGT3 = $0002000d; // fog texture gour triangle - GsUFF4 = $00020010; // fog flat quad - GsUFFT4 = $00020011; // fog texture flat quad - GsUFG4 = $00020014; // fog gour quad - GsUFGT4 = $00020015; // fog texture gour quad + GsUFF3 = $00020008; // fog flat triangle + GsUFFT3 = $00020009; // fog texture flat triangle + GsUFG3 = $0002000c; // fog gour triangle + GsUFGT3 = $0002000d; // fog texture gour triangle + GsUFF4 = $00020010; // fog flat quad + GsUFFT4 = $00020011; // fog texture flat quad + GsUFG4 = $00020014; // fog gour quad + GsUFGT4 = $00020015; // fog texture gour quad - GsUCF3 = $0000000a; // colored flat triangle - GsUCFT3 = $0000000b; // colored texture flat triangle - GsUCG3 = $0000000e; // colored gour triangle - GsUCGT3 = $0000000f; // colored texture gour triangle - GsUCF4 = $00000012; // colored flat quad - GsUCFT4 = $00000013; // colored texture flat quad - GsUCG4 = $00000016; // colored gour quad - GsUCGT4 = $00000017; // colored texture gour quad + GsUCF3 = $0000000a; // colored flat triangle + GsUCFT3 = $0000000b; // colored texture flat triangle + GsUCG3 = $0000000e; // colored gour triangle + GsUCGT3 = $0000000f; // colored texture gour triangle + GsUCF4 = $00000012; // colored flat quad + GsUCFT4 = $00000013; // colored texture flat quad + GsUCG4 = $00000016; // colored gour quad + GsUCGT4 = $00000017; // colored texture gour quad - GsUNF3 = $00040048; // nonLight flat triangle - GsUNFT3 = $00040049; // nonLight texture flat triangle - GsUNG3 = $0004004c; // nonLight gouraud triangle - GsUNGT3 = $0004004d; // nonLight texture gouraud triangle - GsUNF4 = $00040050; // nonLight flat quad - GsUNFT4 = $00040051; // nonLight texture flat quad - GsUNG4 = $00040054; // nonLight gouraud quad - GsUNGT4 = $00040055; // nonLight texture gouraud quad + GsUNF3 = $00040048; // nonLight flat triangle + GsUNFT3 = $00040049; // nonLight texture flat triangle + GsUNG3 = $0004004c; // nonLight gouraud triangle + GsUNGT3 = $0004004d; // nonLight texture gouraud triangle + GsUNF4 = $00040050; // nonLight flat quad + GsUNFT4 = $00040051; // nonLight texture flat quad + GsUNG4 = $00040054; // nonLight gouraud quad + GsUNGT4 = $00040055; // nonLight texture gouraud quad - GsUDF3 = $00010008; // div flat triangle - GsUDFT3 = $00010009; // div texture flat triangle - GsUDG3 = $0001000c; // div gour triangle - GsUDGT3 = $0001000d; // div texture gour triangle - GsUDF4 = $00010010; // div flat quad - GsUDFT4 = $00010011; // div texture flat quad - GsUDG4 = $00010014; // div gour quad - GsUDGT4 = $00010015; // div texture gour quad + GsUDF3 = $00010008; // div flat triangle + GsUDFT3 = $00010009; // div texture flat triangle + GsUDG3 = $0001000c; // div gour triangle + GsUDGT3 = $0001000d; // div texture gour triangle + GsUDF4 = $00010010; // div flat quad + GsUDFT4 = $00010011; // div texture flat quad + GsUDG4 = $00010014; // div gour quad + GsUDGT4 = $00010015; // div texture gour quad - GsUDFF3 = $00030008; // div fog flat triangle - GsUDFFT3 = $00030009; // div fog texture flat triangle - GsUDFG3 = $0003000c; // div fog gour triangle - GsUDFGT3 = $0003000d; // div fog texture gour triangle - GsUDFF4 = $00030010; // div fog flat quad - GsUDFFT4 = $00030011; // div fog texture flat quad - GsUDFG4 = $00030014; // div fog gour quad - GsUDFGT4 = $00030015; // div fog texture gour quad + GsUDFF3 = $00030008; // div fog flat triangle + GsUDFFT3 = $00030009; // div fog texture flat triangle + GsUDFG3 = $0003000c; // div fog gour triangle + GsUDFGT3 = $0003000d; // div fog texture gour triangle + GsUDFF4 = $00030010; // div fog flat quad + GsUDFFT4 = $00030011; // div fog texture flat quad + GsUDFG4 = $00030014; // div fog gour quad + GsUDFGT4 = $00030015; // div fog texture gour quad - GsUDNF3 = $00050048; // div nonLight flat triangle - GsUDNFT3 = $00050049; // div nonLight texture flat triangle - GsUDNG3 = $0005004c; // div nonLight gouraud triangle - GsUDNGT3 = $0005004d; // div nonLight tex gouraud triangle - GsUDNF4 = $00050050; // div nonLight flat quad - GsUDNFT4 = $00050051; // div nonLight texture flat quad - GsUDNG4 = $00050054; // div nonLight gouraud quad - GsUDNGT4 = $00050055; // div nonLight tex gouraud quad + GsUDNF3 = $00050048; // div nonLight flat triangle + GsUDNFT3 = $00050049; // div nonLight texture flat triangle + GsUDNG3 = $0005004c; // div nonLight gouraud triangle + GsUDNGT3 = $0005004d; // div nonLight tex gouraud triangle + GsUDNF4 = $00050050; // div nonLight flat quad + GsUDNFT4 = $00050051; // div nonLight texture flat quad + GsUDNG4 = $00050054; // div nonLight gouraud quad + GsUDNGT4 = $00050055; // div nonLight tex gouraud quad - GsUSCAL = $01000000; // shared calculate vertex and normal - GsUSG3 = $0100000c; // shared gour triangle - GsUSGT3 = $0100000d; // shared texture gour triangle - GsUSG4 = $01000014; // shared gour quad - GsUSGT4 = $01000015; // shared texture gour quad + GsUSCAL = $01000000; // shared calculate vertex and normal + GsUSG3 = $0100000c; // shared gour triangle + GsUSGT3 = $0100000d; // shared texture gour triangle + GsUSG4 = $01000014; // shared gour quad + GsUSGT4 = $01000015; // shared texture gour quad - GsUSTGT3 = $0100020d; // shared tile texture gour triangle - GsUSTGT4 = $01000215; // shared tile texture gour quad + GsUSTGT3 = $0100020d; // shared tile texture gour triangle + GsUSTGT4 = $01000215; // shared tile texture gour quad - GsUSFG3 = $0102000c; // shared fog gour triangle - GsUSFGT3 = $0102000d; // shared fog texture gour triangle - GsUSFG4 = $01020014; // shared fog gour quad - GsUSFGT4 = $01020015; // shared fog texture gour quad + GsUSFG3 = $0102000c; // shared fog gour triangle + GsUSFGT3 = $0102000d; // shared fog texture gour triangle + GsUSFG4 = $01020014; // shared fog gour quad + GsUSFGT4 = $01020015; // shared fog texture gour quad - GsUSNF3 = $01040048; // shared nonLight flat tri - GsUSNFT3 = $01040049; // shared nonLight texture flat tri - GsUSNG3 = $0104004c; // shared nonLight gour tri - GsUSNGT3 = $0104004d; // shared nonLight texture gour tri - GsUSNF4 = $01040050; // shared nonLight flat quad - GsUSNFT4 = $01040051; // shared nonLight texture flat quad - GsUSNG4 = $01040054; // shared nonLight gour quad - GsUSNGT4 = $01040055; // shared nonLight texture gour quad + GsUSNF3 = $01040048; // shared nonLight flat tri + GsUSNFT3 = $01040049; // shared nonLight texture flat tri + GsUSNG3 = $0104004c; // shared nonLight gour tri + GsUSNGT3 = $0104004d; // shared nonLight texture gour tri + GsUSNF4 = $01040050; // shared nonLight flat quad + GsUSNFT4 = $01040051; // shared nonLight texture flat quad + GsUSNG4 = $01040054; // shared nonLight gour quad + GsUSNGT4 = $01040055; // shared nonLight texture gour quad - GsUMF3 = $00000018; // mesh flat tri - GsUMFT3 = $00000019; // mesh texture flat tri - GsUMG3 = $0000001c; // mesh gour triangle - GsUMGT3 = $0000001d; // mesh texture gour triangle - GsUMNF3 = $00040058; // mesh nonLight flat tri - GsUMNFT3 = $00040059; // mesh nonLight tex flat tri - GsUMNG3 = $0004005c; // mesh nonLight gour triangle - GsUMNGT3 = $0004005d; // mesh nonLight tex gour tri + GsUMF3 = $00000018; // mesh flat tri + GsUMFT3 = $00000019; // mesh texture flat tri + GsUMG3 = $0000001c; // mesh gour triangle + GsUMGT3 = $0000001d; // mesh texture gour triangle + GsUMNF3 = $00040058; // mesh nonLight flat tri + GsUMNFT3 = $00040059; // mesh nonLight tex flat tri + GsUMNG3 = $0004005c; // mesh nonLight gour triangle + GsUMNGT3 = $0004005d; // mesh nonLight tex gour tri - GsUTFT3 = $00000209; // tile texture flat triangle - GsUTGT3 = $0000020d; // tile texture gour triangle - GsUTFT4 = $00000211; // tile texture flat quad - GsUTGT4 = $00000215; // tile texture gour quad + GsUTFT3 = $00000209; // tile texture flat triangle + GsUTGT3 = $0000020d; // tile texture gour triangle + GsUTFT4 = $00000211; // tile texture flat quad + GsUTGT4 = $00000215; // tile texture gour quad - GsUPNF3 = $00040148; // preset nonLight flat triangle - GsUPNFT3 = $00040149; // preset nonLight tex flat triangle - GsUPNG3 = $0004014c; // preset nonLight gouraud triangle - GsUPNGT3 = $0004014d; // preset nonLight tex gour triangle - GsUPNF4 = $00040150; // preset nonLight flat quad - GsUPNFT4 = $00040151; // preset nonLight tex flat quad - GsUPNG4 = $00040154; // preset nonLight gouraud quad - GsUPNGT4 = $00040155; // preset nonLight tex gour quad + GsUPNF3 = $00040148; // preset nonLight flat triangle + GsUPNFT3 = $00040149; // preset nonLight tex flat triangle + GsUPNG3 = $0004014c; // preset nonLight gouraud triangle + GsUPNGT3 = $0004014d; // preset nonLight tex gour triangle + GsUPNF4 = $00040150; // preset nonLight flat quad + GsUPNFT4 = $00040151; // preset nonLight tex flat quad + GsUPNG4 = $00040154; // preset nonLight gouraud quad + GsUPNGT4 = $00040155; // preset nonLight tex gour quad - GsUSTPF3 = $00200008; // semi-trans flat triangle - GsUSTPFT3 = $00200009; // semi-trans texture flat triangle - GsUSTPG3 = $0020000c; // semi-trans gour triangle - GsUSTPGT3 = $0020000d; // semi-trans texture gour triangle - GsUSTPF4 = $00200010; // semi-trans flat quad - GsUSTPFT4 = $00200011; // semi-trans texture flat quad - GsUSTPG4 = $00200014; // semi-trans gour quad - GsUSTPGT4 = $00200015; // semi-trans texture gour quad - GsUSTPSG3 = $0120000c; // semi-trans shared gour tri - GsUSTPSGT3 = $0120000d; // semi-trans shared tex gour tri - GsUSTPSG4 = $01200014; // semi-trans shared gour quad - GsUSTPSGT4 = $01200015; // semi-trans shared tex gour quad + GsUSTPF3 = $00200008; // semi-trans flat triangle + GsUSTPFT3 = $00200009; // semi-trans texture flat triangle + GsUSTPG3 = $0020000c; // semi-trans gour triangle + GsUSTPGT3 = $0020000d; // semi-trans texture gour triangle + GsUSTPF4 = $00200010; // semi-trans flat quad + GsUSTPFT4 = $00200011; // semi-trans texture flat quad + GsUSTPG4 = $00200014; // semi-trans gour quad + GsUSTPGT4 = $00200015; // semi-trans texture gour quad + GsUSTPSG3 = $0120000c; // semi-trans shared gour tri + GsUSTPSGT3 = $0120000d; // semi-trans shared tex gour tri + GsUSTPSG4 = $01200014; // semi-trans shared gour quad + GsUSTPSGT4 = $01200015; // semi-trans shared tex gour quad - GsUSTPNF3 = $00240048; // semi-trans nonLight flat tri - GsUSTPNFT3 = $00240049; // semi-trans nonLight tex flat tri - GsUSTPNG3 = $0024004c; // semi-trans nonLight gour tri - GsUSTPNGT3 = $0024004d; // semi-trans nonLight tex gour tri - GsUSTPNF4 = $00240050; // semi-trans nonLight flat quad - GsUSTPNFT4 = $00240051; // semi-trans nonLight tex flat quad - GsUSTPNG4 = $00240054; // semi-trans nonLight gour quad - GsUSTPNGT4 = $00240055; // semi-trans nonLight tex gour quad + GsUSTPNF3 = $00240048; // semi-trans nonLight flat tri + GsUSTPNFT3 = $00240049; // semi-trans nonLight tex flat tri + GsUSTPNG3 = $0024004c; // semi-trans nonLight gour tri + GsUSTPNGT3 = $0024004d; // semi-trans nonLight tex gour tri + GsUSTPNF4 = $00240050; // semi-trans nonLight flat quad + GsUSTPNFT4 = $00240051; // semi-trans nonLight tex flat quad + GsUSTPNG4 = $00240054; // semi-trans nonLight gour quad + GsUSTPNGT4 = $00240055; // semi-trans nonLight tex gour quad - GsUSTPSNF3 = $01240048; // stp shared nonLight flat tri - GsUSTPSNFT3 = $01240049; // stp shared nonLight tex flat tri - GsUSTPSNG3 = $0124004c; // stp shared nonLight gour tri - GsUSTPSNGT3 = $0124004d; // stp shared nonLight tex gour tri - GsUSTPSNF4 = $01240050; // stp shared nonLight flat quad - GsUSTPSNFT4 = $01240051; // stp shared nonLight tex flat quad - GsUSTPSNG4 = $01240054; // stp shared nonLight gour quad - GsUSTPSNGT4 = $01240055; // stp shared nonLight tex gour quad + GsUSTPSNF3 = $01240048; // stp shared nonLight flat tri + GsUSTPSNFT3 = $01240049; // stp shared nonLight tex flat tri + GsUSTPSNG3 = $0124004c; // stp shared nonLight gour tri + GsUSTPSNGT3 = $0124004d; // stp shared nonLight tex gour tri + GsUSTPSNF4 = $01240050; // stp shared nonLight flat quad + GsUSTPSNFT4 = $01240051; // stp shared nonLight tex flat quad + GsUSTPSNG4 = $01240054; // stp shared nonLight gour quad + GsUSTPSNGT4 = $01240055; // stp shared nonLight tex gour quad - GsUADF3 = $00080008; // active-div flat triangle - GsUADFT3 = $00080009; // active-div texture flat triangle - GsUADG3 = $0008000c; // active-div gour triangle - GsUADGT3 = $0008000d; // active-div texture gour triangle - GsUADF4 = $00080010; // active-div flat quad - GsUADFT4 = $00080011; // active-div texture flat quad - GsUADG4 = $00080014; // active-div gour quad - GsUADGT4 = $00080015; // active-div texture gour quad + GsUADF3 = $00080008; // active-div flat triangle + GsUADFT3 = $00080009; // active-div texture flat triangle + GsUADG3 = $0008000c; // active-div gour triangle + GsUADGT3 = $0008000d; // active-div texture gour triangle + GsUADF4 = $00080010; // active-div flat quad + GsUADFT4 = $00080011; // active-div texture flat quad + GsUADG4 = $00080014; // active-div gour quad + GsUADGT4 = $00080015; // active-div texture gour quad - GsUADFF3 = $000a0008; // active-div fog flat tri - GsUADFFT3 = $000a0009; // active-div fog texture flat tri - GsUADFG3 = $000a000c; // active-div fog gour tri - GsUADFGT3 = $000a000d; // active-div fog texture gour tri - GsUADFF4 = $000a0010; // active-div fog flat quad - GsUADFFT4 = $000a0011; // active-div fog texture flat quad - GsUADFG4 = $000a0014; // active-div fog gour quad - GsUADFGT4 = $000a0015; // active-div fog texture gour quad + GsUADFF3 = $000a0008; // active-div fog flat tri + GsUADFFT3 = $000a0009; // active-div fog texture flat tri + GsUADFG3 = $000a000c; // active-div fog gour tri + GsUADFGT3 = $000a000d; // active-div fog texture gour tri + GsUADFF4 = $000a0010; // active-div fog flat quad + GsUADFFT4 = $000a0011; // active-div fog texture flat quad + GsUADFG4 = $000a0014; // active-div fog gour quad + GsUADFGT4 = $000a0015; // active-div fog texture gour quad - GsUADNF3 = $000c0048; // active-div nonLight flat tri - GsUADNFT3 = $000c0049; // active-div nonLight tex flat tri - GsUADNG3 = $000c004c; // active-div nonLight gour tri - GsUADNGT3 = $000c004d; // active-div nonLight tex gour tri - GsUADNF4 = $000c0050; // active-div nonLight flat quad - GsUADNFT4 = $000c0051; // active-div nonLight tex flat quad - GsUADNG4 = $000c0054; // active-div nonLight gour quad - GsUADNGT4 = $000c0055; // active-div nonLight tex gour quad + GsUADNF3 = $000c0048; // active-div nonLight flat tri + GsUADNFT3 = $000c0049; // active-div nonLight tex flat tri + GsUADNG3 = $000c004c; // active-div nonLight gour tri + GsUADNGT3 = $000c004d; // active-div nonLight tex gour tri + GsUADNF4 = $000c0050; // active-div nonLight flat quad + GsUADNFT4 = $000c0051; // active-div nonLight tex flat quad + GsUADNG4 = $000c0054; // active-div nonLight gour quad + GsUADNGT4 = $000c0055; // active-div nonLight tex gour quad - GsUBF3 = $00100008; // back-f flat tri - GsUBFT3 = $00100009; // back-f tex flat tri - GsUBG3 = $0010000c; // back-f gour tri - GsUBGT3 = $0010000d; // back-f tex gour tri - GsUBF4 = $00100010; // back-f flat quad - GsUBFT4 = $00100011; // back-f tex flat quad - GsUBG4 = $00100014; // back-f gour quad - GsUBGT4 = $00100015; // back-f tex gour quad + GsUBF3 = $00100008; // back-f flat tri + GsUBFT3 = $00100009; // back-f tex flat tri + GsUBG3 = $0010000c; // back-f gour tri + GsUBGT3 = $0010000d; // back-f tex gour tri + GsUBF4 = $00100010; // back-f flat quad + GsUBFT4 = $00100011; // back-f tex flat quad + GsUBG4 = $00100014; // back-f gour quad + GsUBGT4 = $00100015; // back-f tex gour quad - GsUBCF3 = $0010000a; // back-f colored flat tri - GsUBCFT3 = $0010000b; // back-f colored tex flat tri - GsUBCG3 = $0010000e; // back-f colored gour tri - GsUBCGT3 = $0010000f; // back-f colored tex gour tri - GsUBCF4 = $00100012; // back-f colored flat quad - GsUBCFT4 = $00100013; // back-f colored tex flat quad - GsUBCG4 = $00100016; // back-f colored gour quad - GsUBCGT4 = $00100017; // back-f colored tex gour quad + GsUBCF3 = $0010000a; // back-f colored flat tri + GsUBCFT3 = $0010000b; // back-f colored tex flat tri + GsUBCG3 = $0010000e; // back-f colored gour tri + GsUBCGT3 = $0010000f; // back-f colored tex gour tri + GsUBCF4 = $00100012; // back-f colored flat quad + GsUBCFT4 = $00100013; // back-f colored tex flat quad + GsUBCG4 = $00100016; // back-f colored gour quad + GsUBCGT4 = $00100017; // back-f colored tex gour quad - GsUBSTPF3 = $00300008; // back-f semi-trans flat tri - GsUBSTPFT3 = $00300009; // back-f semi-trans tex flat tri - GsUBSTPG3 = $0030000c; // back-f semi-trans gour tri - GsUBSTPGT3 = $0030000d; // back-f semi-trans tex gour tri - GsUBSTPF4 = $00300010; // back-f semi-trans flat quad - GsUBSTPFT4 = $00300011; // back-f semi-trans tex flat quad - GsUBSTPG4 = $00300014; // back-f semi-trans gour quad - GsUBSTPGT4 = $00300015; // back-f semi-trans tex gour quad + GsUBSTPF3 = $00300008; // back-f semi-trans flat tri + GsUBSTPFT3 = $00300009; // back-f semi-trans tex flat tri + GsUBSTPG3 = $0030000c; // back-f semi-trans gour tri + GsUBSTPGT3 = $0030000d; // back-f semi-trans tex gour tri + GsUBSTPF4 = $00300010; // back-f semi-trans flat quad + GsUBSTPFT4 = $00300011; // back-f semi-trans tex flat quad + GsUBSTPG4 = $00300014; // back-f semi-trans gour quad + GsUBSTPGT4 = $00300015; // back-f semi-trans tex gour quad - GsUBNF3 = $00140048; // back-f noLgt flat tri - GsUBNFT3 = $00140049; // back-f noLgt tex flat tri - GsUBNG3 = $0014004c; // back-f noLgt gouraud tri - GsUBNGT3 = $0014004d; // back-f noLgt tex gouraud tri - GsUBNF4 = $00140050; // back-f noLgt flat quad - GsUBNFT4 = $00140051; // back-f noLgt tex flat quad - GsUBNG4 = $00140054; // back-f noLgt gouraud quad - GsUBNGT4 = $00140055; // back-f noLgt tex gouraud quad + GsUBNF3 = $00140048; // back-f noLgt flat tri + GsUBNFT3 = $00140049; // back-f noLgt tex flat tri + GsUBNG3 = $0014004c; // back-f noLgt gouraud tri + GsUBNGT3 = $0014004d; // back-f noLgt tex gouraud tri + GsUBNF4 = $00140050; // back-f noLgt flat quad + GsUBNFT4 = $00140051; // back-f noLgt tex flat quad + GsUBNG4 = $00140054; // back-f noLgt gouraud quad + GsUBNGT4 = $00140055; // back-f noLgt tex gouraud quad - GsUBSTPNF3 = $00340048; // back-f stp noLgt flat tri - GsUBSTPNFT3 = $00340049; // back-f stp noLgt tex flat tri - GsUBSTPNG3 = $0034004c; // back-f stp noLgt gour tri - GsUBSTPNGT3 = $0034004d; // back-f stp noLgt tex gour tri - GsUBSTPNF4 = $00340050; // back-f stp noLgt flat quad - GsUBSTPNFT4 = $00340051; // back-f stp noLgt tex flat quad - GsUBSTPNG4 = $00340054; // back-f stp noLgt gour quad - GsUBSTPNGT4 = $00340055; // back-f stp noLgt tex gour quad + GsUBSTPNF3 = $00340048; // back-f stp noLgt flat tri + GsUBSTPNFT3 = $00340049; // back-f stp noLgt tex flat tri + GsUBSTPNG3 = $0034004c; // back-f stp noLgt gour tri + GsUBSTPNGT3 = $0034004d; // back-f stp noLgt tex gour tri + GsUBSTPNF4 = $00340050; // back-f stp noLgt flat quad + GsUBSTPNFT4 = $00340051; // back-f stp noLgt tex flat quad + GsUBSTPNG4 = $00340054; // back-f stp noLgt gour quad + GsUBSTPNGT4 = $00340055; // back-f stp noLgt tex gour quad - GsUBSNF3 = $01140048; // back-f shrd noLgt flat tri - GsUBSNFT3 = $01140049; // back-f shrd noLgt tex flat tri - GsUBSNG3 = $0114004c; // back-f shrd noLgt gour tri - GsUBSNGT3 = $0114004d; // back-f shrd noLgt tex gour tri - GsUBSNF4 = $01140050; // back-f shrd noLgt flat quad - GsUBSNFT4 = $01140051; // back-f shrd noLgt tex flat quad - GsUBSNG4 = $01140054; // back-f shrd noLgt gour quad - GsUBSNGT4 = $01140055; // back-f shrd noLgt tex gour quad + GsUBSNF3 = $01140048; // back-f shrd noLgt flat tri + GsUBSNFT3 = $01140049; // back-f shrd noLgt tex flat tri + GsUBSNG3 = $0114004c; // back-f shrd noLgt gour tri + GsUBSNGT3 = $0114004d; // back-f shrd noLgt tex gour tri + GsUBSNF4 = $01140050; // back-f shrd noLgt flat quad + GsUBSNFT4 = $01140051; // back-f shrd noLgt tex flat quad + GsUBSNG4 = $01140054; // back-f shrd noLgt gour quad + GsUBSNGT4 = $01140055; // back-f shrd noLgt tex gour quad - GsUBSTPSNF3 = $01340048; // back-f stp shrd noLgt flat tri - GsUBSTPSNFT3 = $01340049; // back-f stp shrd noLgt tex flat tri - GsUBSTPSNG3 = $0134004c; // back-f stp shrd noLgt gour tri - GsUBSTPSNGT3 = $0134004d; // back-f stp shrd noLgt tex gour tri - GsUBSTPSNF4 = $01340050; // back-f stp shrd noLgt flat quad + GsUBSTPSNF3 = $01340048; // back-f stp shrd noLgt flat tri + GsUBSTPSNFT3 = $01340049; // back-f stp shrd noLgt tex flat tri + GsUBSTPSNG3 = $0134004c; // back-f stp shrd noLgt gour tri + GsUBSTPSNGT3 = $0134004d; // back-f stp shrd noLgt tex gour tri + GsUBSTPSNF4 = $01340050; // back-f stp shrd noLgt flat quad GsUBSTPSNFT4 = $01340051; // back-f stp shrd noLgt tex flat quad - GsUBSTPSNG4 = $01340054; // back-f stp shrd noLgt gour quad + GsUBSTPSNG4 = $01340054; // back-f stp shrd noLgt gour quad GsUBSTPSNGT4 = $01340055; // back-f stp shrd noLgt tex gour quad - GsUIMG0 = $02000000; // image data with no-clut - GsUIMG1 = $02000001; // image data with clut + GsUIMG0 = $02000000; // image data with no-clut + GsUIMG1 = $02000001; // image data with clut - GsUGNDF = $05000000; // ground flat - GsUGNDFT = $05000001; // ground flat texture + GsUGNDF = $05000000; // ground flat + GsUGNDFT = $05000001; // ground flat texture - GsUSCAL2 = $06000100; // envmap shared calculate - GsUE1G3 = $0600100c; // envmap 1D gour tri - GsUE1G4 = $06001014; // envmap 1D gour quad - GsUE1SG3 = $0600110c; // envmap 1D shared gour tri - GsUE1SG4 = $06001114; // envmap 1D shared gour quad - GsUE2LG3 = $0600200c; // envmap 2D reflect gour tri - GsUE2LG4 = $06002014; // envmap 2D reflect gour quad - GsUE2RG3 = $0600300c; // envmap 2D refract gour tri - GsUE2RG4 = $06003014; // envmap 2D refract gour quad - GsUE2RLG3 = $0600400c; // envmap 2D both gour tri - GsUE2RLG4 = $06004014; // envmap 2D both gour quad - GsUE2OLG3 = $0600500c; // envmap 2D org+reflect gour tri - GsUE2OLG4 = $06005014; // envmap 2D org+reflect gour quad + GsUSCAL2 = $06000100; // envmap shared calculate + GsUE1G3 = $0600100c; // envmap 1D gour tri + GsUE1G4 = $06001014; // envmap 1D gour quad + GsUE1SG3 = $0600110c; // envmap 1D shared gour tri + GsUE1SG4 = $06001114; // envmap 1D shared gour quad + GsUE2LG3 = $0600200c; // envmap 2D reflect gour tri + GsUE2LG4 = $06002014; // envmap 2D reflect gour quad + GsUE2RG3 = $0600300c; // envmap 2D refract gour tri + GsUE2RG4 = $06003014; // envmap 2D refract gour quad + GsUE2RLG3 = $0600400c; // envmap 2D both gour tri + GsUE2RLG4 = $06004014; // envmap 2D both gour quad + GsUE2OLG3 = $0600500c; // envmap 2D org+reflect gour tri + GsUE2OLG4 = $06005014; // envmap 2D org+reflect gour quad - GsVtxMIMe = $04010020; // Vertex-MIMe - GsNrmMIMe = $04010021; // Normal-MIMe - GsRstVtxMIMe = $04010028; // Reset-Vertex-MIMe - GsRstNrmMIMe = $04010029; // Reset-Normal-MIMe + GsVtxMIMe = $04010020; // Vertex-MIMe + GsNrmMIMe = $04010021; // Normal-MIMe + GsRstVtxMIMe = $04010028; // Reset-Vertex-MIMe + GsRstNrmMIMe = $04010029; // Reset-Normal-MIMe GsJntAxesMIMe = $04010010; // Joint-Axes-MIMe GsRstJntAxesMIMe = $04010018; // Reset-Joint-Axes-MIMe GsJntRPYMIMe = $04010011; // Joint-RPY-MIMe @@ -748,7 +747,7 @@ const function GsU_01020016(arg: PGsARGUNIT): pdword; external; function GsU_01020017(arg: PGsARGUNIT): pdword; external; - // tiled texture + // tiled texture function GsU_0000020b(arg: PGsARGUNIT): pdword; external; function GsU_0000020f(arg: PGsARGUNIT): pdword; external; function GsU_00000213(arg: PGsARGUNIT): pdword; external; @@ -833,22 +832,22 @@ const function GsU_05000000(arg: PGsARGUNIT): pdword; external; function GsU_05000001(arg: PGsARGUNIT): pdword; external; - // camera + // camera function GsU_07000100(arg: PGsARGUNIT): pdword; external; function GsU_07010100(arg: PGsARGUNIT): pdword; external; function GsU_07020100(arg: PGsARGUNIT): pdword; external; function GsU_07030100(arg: PGsARGUNIT): pdword; external; - // light + // light function GsU_07000200(arg: PGsARGUNIT): pdword; external; function GsU_07010200(arg: PGsARGUNIT): pdword; external; function GsU_07020200(arg: PGsARGUNIT): pdword; external; function GsU_07030200(arg: PGsARGUNIT): pdword; external; - // update driver + // update driver function GsU_03000000(sp: PGsARGUNIT_ANIM): pdword; external; - // interpolation driver + // interpolation driver function GsU_03000001(sp: PGsARGUNIT_ANIM): longint; external; function GsU_03000002(sp: PGsARGUNIT_ANIM): longint; external; function GsU_03000003(sp: PGsARGUNIT_ANIM): longint; external; @@ -1069,7 +1068,7 @@ const function GsU_03010371(sp: PGsARGUNIT_ANIM): longint; external; function GsU_03010372(sp: PGsARGUNIT_ANIM): longint; external; - // envmap driver + // envmap driver function GsU_06000100(arg: PGsARGUNIT): longint; external; function GsU_0600100c(arg: PGsARGUNIT): longint; external; function GsU_06001014(arg: PGsARGUNIT): longint; external; @@ -1084,7 +1083,7 @@ const function GsU_0600500c(arg: PGsARGUNIT): longint; external; function GsU_06005014(arg: PGsARGUNIT): longint; external; - // MIMe driver + // MIMe driver function GsU_04010020(arg: PGsARGUNIT): longint; external; function GsU_04010021(arg: PGsARGUNIT): longint; external; function GsU_04010028(arg: PGsARGUNIT): longint; external; @@ -1109,7 +1108,7 @@ const function GsScanAnim(p: pdword; ut: PGsTYPEUNIT): pdword; external; function GsLinkAnim(seq: PPGsSEQ; p: dword): longint; external; - // for MIMe + // for MIMe procedure GsInitRstVtxMIMe(primtop, hp: pdword); external; procedure GsInitRstNrmMIMe(primtop, hp: pdword); external; diff --git a/rtl/ps1/psy-q-sdk/libmcgui.pas b/rtl/ps1/psy-q-sdk/libmcgui.pas index cabcc8cb63..19fff1129e 100644 --- a/rtl/ps1/psy-q-sdk/libmcgui.pas +++ b/rtl/ps1/psy-q-sdk/libmcgui.pas @@ -11,14 +11,13 @@ const MCGUI_EXTERNAL_FONT = 1; type - + // Texture Information Structure sMcGuiTexture = packed record addr : pointer; end; - -// Memory Card Information Structure */ +// Memory Card Information Structure sMcGuiCards = packed record _file : array [0..20] of char; title : array [0..64] of char; @@ -37,14 +36,12 @@ type timadr : pointer; end; - // Cursor Information Structure sMcGuiCursor = packed record mode : byte; r, g, b : byte; end; - // BGM,Sound Effects Information Structure Tbgm = packed record isbgm : longint; diff --git a/rtl/ps1/psy-q-sdk/libmcrd.pas b/rtl/ps1/psy-q-sdk/libmcrd.pas index d30bf8f564..d2fdf5c061 100644 --- a/rtl/ps1/psy-q-sdk/libmcrd.pas +++ b/rtl/ps1/psy-q-sdk/libmcrd.pas @@ -5,12 +5,12 @@ uses libstd; type MemCB = function(cmds, rslt: longint): pointer; const - McFuncExist = 1; - McFuncAccept = 2; - McFuncReadFile = 3; - McFuncWriteFile = 4; - McFuncReadData = 5; - McFuncWriteData = 6; + McFuncExist = 1; + McFuncAccept = 2; + McFuncReadFile = 3; + McFuncWriteFile = 4; + McFuncReadData = 5; + McFuncWriteData = 6; McErrNone = 0; McErrCardNotExist = 1; diff --git a/rtl/ps1/psy-q-sdk/libstd.pas b/rtl/ps1/psy-q-sdk/libstd.pas index 79ed20b95d..8d77897c76 100644 --- a/rtl/ps1/psy-q-sdk/libstd.pas +++ b/rtl/ps1/psy-q-sdk/libstd.pas @@ -183,7 +183,7 @@ const R_CAUSE= 36; NREGS = 40; - + // compiler defined bindings R_ZERO = R_R0; R_AT = R_R1; @@ -217,7 +217,7 @@ const R_SP = R_R29; R_FP = R_R30; R_RA = R_R31; - + // types.h type @@ -663,9 +663,9 @@ type dt_firstfile : function(): plongint;// directory serach routine dt_nextfile : function(): plongint; // directory serach routine dt_format : function(): plongint; - dt_cd : function(): plongint; - dt_rename : function(): plongint; - dt_remove : function(): plongint; + dt_cd : function(): plongint; + dt_rename : function(): plongint; + dt_remove : function(): plongint; dt_else : function(): plongint; end; Pdevice_table = ^Tdevice_table; @@ -780,14 +780,7 @@ const SR_SWC = $00020000; // swap cache SR_ISC = $00010000; // Isolate data cache - SR_MM_MODE = $00010000; // lwl/swl/etc become scache/etc - { - define: - lcache lwl - scache swl - flush lwr $0, - inval swr $0, -} + SR_MM_MODE = $00010000; // lwl/swl/etc become scache/etc // Interrupt enable bits @@ -911,19 +904,19 @@ const NF_NENTRIES = 8; // TLB size constants - TLBWIREDBASE = 0; // WAG for now - NWIREDENTRIES = 8; // WAG for now - TLBRANDOMBASE = NWIREDENTRIES; - NTLBENTRIES = 64; - NRANDOMENTRIES = (NTLBENTRIES - NWIREDENTRIES); - + TLBWIREDBASE = 0; // WAG for now + NWIREDENTRIES = 8; // WAG for now + TLBRANDOMBASE = NWIREDENTRIES; + NTLBENTRIES = 64; + NRANDOMENTRIES = (NTLBENTRIES - NWIREDENTRIES); - TLBRAND_RANDMASK = $00003f00; + + TLBRAND_RANDMASK = $00003f00; TLBRAND_RANDSHIFT = 8; // Chip interrupt vector - NC0VECS = 8; + NC0VECS = 8; @@ -933,12 +926,12 @@ var const - BRK_KERNEL = $f1; - EXCEPT_NORM = 1; - EXCEPT_UTLB = 2; - EXCEPT_BRKPT = 3; - EXCEPT_DB = 4; - EXCEPT_GDB = 4; + BRK_KERNEL = $f1; + EXCEPT_NORM = 1; + EXCEPT_UTLB = 2; + EXCEPT_BRKPT = 3; + EXCEPT_DB = 4; + EXCEPT_GDB = 4; EXCEPT_INT = 9; EXCEPT_ELSE = $ff; @@ -974,13 +967,13 @@ procedure longjmp(buf: jmp_buf; i: longint); external; // status bits const SR_IRQ = $200; - SR_CTS = $100; - SR_DSR = $80; - SR_FE = $20; - SR_OE = $10; - SR_PERROR = $8; - SR_TXU = $4; - SR_RXRDY = $2; + SR_CTS = $100; + SR_DSR = $80; + SR_FE = $20; + SR_OE = $10; + SR_PERROR = $8; + SR_TXU = $4; + SR_RXRDY = $2; SR_TXRDY = $1; SIO_CTS = $100; @@ -1041,23 +1034,28 @@ generic procedure va_start(out AP: Pointer; var LastArg: T); procedure va_end(out AP: Pointer); generic function va_arg(var AP: Pointer):T; + implementation + generic function __va_rounded_size: SizeInt;inline; begin Result := ((sizeof(T) + sizeof (longint) - 1) div sizeof (longint)) * sizeof (longint); end; - + + generic procedure va_start(out AP: Pointer; var LastArg: T);inline; begin AP := Pointer(@LastArg) + specialize __va_rounded_size; end; - + + procedure va_end(out AP: Pointer);inline; begin AP := nil; end; - + + generic function va_arg(var AP: Pointer):T;inline; type PT=^T; @@ -1067,7 +1065,7 @@ begin end; -function strdup(p: pchar): pchar; +function strdup(p: pchar): pchar; begin strdup:= malloc2(strlen(p) + 1); strcpy(strdup, p); @@ -1267,7 +1265,7 @@ end; // Address conversion macros -function K0_TO_K1(x: dword): dword; +function K0_TO_K1(x: dword): dword; begin result:= x or $A0000000; end; @@ -1299,7 +1297,7 @@ end; // Address predicates function IS_KSEG0(x: dword): boolean; -begin +begin result:= ((x >= K0BASE) and (x < K1BASE)); end;