From 0d4b5cb6e0ef10ef53427a5e9b4c758a926948aa Mon Sep 17 00:00:00 2001 From: ABelliqueux Date: Sun, 25 Jul 2021 17:39:20 +0200 Subject: [PATCH] Update credits --- hello_2pads/hello_2pads.c | 7 ----- hello_bs/hello_bs.c | 1 - hello_cd/hello_cd.c | 1 - hello_cdda/hello_cdda.c | 9 ++++-- hello_cube/hello_cube.c | 13 --------- hello_cubetex/hello_cubetex.c | 14 +-------- hello_gte_opti/hello_gte_opti.c | 1 + hello_light/hello_light.c | 10 ------- hello_pad/hello_pad.c | 2 +- hello_poly/hello_poly.c | 17 +++-------- hello_poly_ft/hello_poly_ft.c | 17 +++-------- hello_poly_gt/hello_poly_gt.c | 17 +++-------- hello_poly_gt_tw/hello_poly_gt_tw.c | 17 +++-------- hello_poly_inline/hello_poly_inline.c | 1 + hello_poly_stp/hello_poly_stp.c | 41 +++++++++------------------ hello_poly_subdiv/hello_poly_subdiv.c | 3 +- hello_sio/hello_sio.c | 4 --- hello_sprt/hello_sprt.c | 4 +++ hello_tile/hello_tile.c | 3 ++ hello_world/hello_world.c | 4 ++- hello_xa/hello_xa.c | 2 +- 21 files changed, 53 insertions(+), 135 deletions(-) diff --git a/hello_2pads/hello_2pads.c b/hello_2pads/hello_2pads.c index dbbcd90..6a9323d 100644 --- a/hello_2pads/hello_2pads.c +++ b/hello_2pads/hello_2pads.c @@ -6,13 +6,6 @@ // Schnappy - 12/2020 // // Based on : ../psyq/addons/scea/CNTRL/PAD.C -// -// Controller demo -// Written by Mike Fulton -// Last Modified 6:25pm, 11/15/96 -// Copyright (c) 1996 Sony Computer Entertainment America - - #include #include #include diff --git a/hello_bs/hello_bs.c b/hello_bs/hello_bs.c index 7945c1b..d990aa1 100644 --- a/hello_bs/hello_bs.c +++ b/hello_bs/hello_bs.c @@ -1,6 +1,5 @@ // Load a BS file from CD, decompress and display it. // Schnappy 07-2021 -// based on Lameguy64's tutorial : http://lameguy64.net/svn/pstutorials/chapter1/1-display.html #include #include #include diff --git a/hello_cd/hello_cd.c b/hello_cd/hello_cd.c index b82c851..a686118 100644 --- a/hello_cd/hello_cd.c +++ b/hello_cd/hello_cd.c @@ -1,6 +1,5 @@ // Load files from CD and execute them // Schnappy 07-2021 -// based on Lameguy64's tutorial : http://lameguy64.net/svn/pstutorials/chapter1/1-display.html #include #include #include diff --git a/hello_cdda/hello_cdda.c b/hello_cdda/hello_cdda.c index 0fb6d91..5568b03 100644 --- a/hello_cdda/hello_cdda.c +++ b/hello_cdda/hello_cdda.c @@ -1,5 +1,5 @@ -// CDDA track playing example -// based on Lameguy64's tutorial : http://lameguy64.net/svn/pstutorials/chapter1/1-display.html +// CDDA track playback example +// Schnappy 07-2021 #include #include #include @@ -62,8 +62,11 @@ int main(void) // Init Spu SpuInit(); // Set master & CD volume to max - spuSettings.mask = (SPU_COMMON_MVOLL | SPU_COMMON_MVOLR | SPU_COMMON_CDVOLL | SPU_COMMON_CDVOLR | SPU_COMMON_CDMIX ); + //~ spuSettings.mask = (SPU_COMMON_MVOLL | SPU_COMMON_MVOLR | SPU_COMMON_CDVOLL | SPU_COMMON_CDVOLR | SPU_COMMON_CDMIX | SPU_COMMON_MVOLMODEL | SPU_COMMON_MVOLMODER); + spuSettings.mask = (SPU_COMMON_CDVOLL | SPU_COMMON_CDVOLR | SPU_COMMON_CDMIX | SPU_COMMON_MVOLMODEL | SPU_COMMON_MVOLMODER); // Master volume should be in range 0x0000 - 0x3fff + //~ spuSettings.mvolmode.left = SPU_VOICE_LINEARIncN; + //~ spuSettings.mvolmode.right = SPU_VOICE_LINEARIncN; spuSettings.mvol.left = 0x3fff; spuSettings.mvol.right = 0x3fff; // Cd volume should be in range 0x0000 - 0x7fff diff --git a/hello_cube/hello_cube.c b/hello_cube/hello_cube.c index 8489d1b..11af38d 100644 --- a/hello_cube/hello_cube.c +++ b/hello_cube/hello_cube.c @@ -2,9 +2,6 @@ - Draw a gouraud shaded mesh exported as a TMESH by the blender <= 2.79b plugin io_export_psx_tmesh.py based on primdraw.c by Lameguy64 (http://www.psxdev.net/forum/viewtopic.php?f=64&t=537) 2014 Meido-Tek Productions. - Demonstrates: - - Using a primitive OT to draw triangles without libgs. - - Using the GTE to rotate, translate, and project 3D primitives. Controls: Start - Toggle interactive/non-interactive mode. Select - Reset object's position and angles. @@ -13,16 +10,6 @@ Up/Down/Left/Right - Rotate object (XZ/YZ). Triangle/Cross/Square/Circle - Move object up/down/left/right. */ - /* PSX screen coordinate system - * - * Z+ - * / - * / - * +------X+ - * /| - * / | - * / Y+ - * eye */ #include #include #include diff --git a/hello_cubetex/hello_cubetex.c b/hello_cubetex/hello_cubetex.c index e45c8b2..6459ceb 100644 --- a/hello_cubetex/hello_cubetex.c +++ b/hello_cubetex/hello_cubetex.c @@ -1,7 +1,6 @@ - /* primdrawG.c, by Schnappy, 12-2020 - - Draw a gouraud shaded mesh exported as a TMESH by the blender <= 2.79b plugin io_export_psx_tmesh.py + - Draw a gouraud shaded textured mesh exported as a TMESH by the blender <= 2.79b plugin io_export_psx_tmesh.py based on primdraw.c by Lameguy64 (http://www.psxdev.net/forum/viewtopic.php?f=64&t=537) 2014 Meido-Tek Productions. @@ -19,17 +18,6 @@ Triangle/Cross/Square/Circle - Move object up/down/left/right. */ - /* PSX screen coordinate system - * - * Z+ - * / - * / - * +------X+ - * /| - * / | - * / Y+ - * eye */ - #include #include #include diff --git a/hello_gte_opti/hello_gte_opti.c b/hello_gte_opti/hello_gte_opti.c index 3bbcb25..79e982a 100644 --- a/hello_gte_opti/hello_gte_opti.c +++ b/hello_gte_opti/hello_gte_opti.c @@ -11,6 +11,7 @@ // // Credits, thanks : Nicolas Noble, Sickle, Lameguy64 @ psxdev discord : https://discord.com/invite/N2mmwp // https://discord.com/channels/642647820683444236/663664210525290507/834831466100949002 +// Schnappy 2021 #include #include #include diff --git a/hello_light/hello_light.c b/hello_light/hello_light.c index 2f0e8db..bea4946 100644 --- a/hello_light/hello_light.c +++ b/hello_light/hello_light.c @@ -10,16 +10,6 @@ based on primdraw.c by Lameguy64 (http://www.psxdev.net/forum/viewtopic.php?f=64&t=537) 2014 Meido-Tek Productions. */ - /* PSX screen coordinate system - * - * Z+ - * / - * / - * +------X+ - * /| - * / | - * / Y+ - * eye */ #include #include #include diff --git a/hello_pad/hello_pad.c b/hello_pad/hello_pad.c index c2bb71f..21281db 100644 --- a/hello_pad/hello_pad.c +++ b/hello_pad/hello_pad.c @@ -2,7 +2,7 @@ // // We're using libetc PadInit() and PadRead() that only supports the 16 buttons pad // but doesn't need the libpad lib. It's fine for prototyping and simple stuff. - +// Schnappy 2021 #include #include #include diff --git a/hello_poly/hello_poly.c b/hello_poly/hello_poly.c index 08ec86f..6e551da 100644 --- a/hello_poly/hello_poly.c +++ b/hello_poly/hello_poly.c @@ -1,18 +1,9 @@ -// With help from Nicolas Noble, Jaby smoll Seamonstah -// Based on Lameguy64's tutorial series : http://lameguy64.net/svn/pstutorials/chapter1/2-graphics.html +// Draw a colored poly primitive // -// From ../psyq/addons/graphics/MESH/RMESH/TUTO0.C : +// With help from Nicolas Noble, Jaby smoll Seamonstah, Lameguy64 // - /* PSX screen coordinate system - * - * Z+ - * / - * / - * +------X+ - * /| - * / | - * / Y+ - * eye */ +// From ../psyq/addons/graphics/MESH/RMESH/TUTO0.C : +// Schnappy 2021 #include #include diff --git a/hello_poly_ft/hello_poly_ft.c b/hello_poly_ft/hello_poly_ft.c index 8f6530c..798e65f 100644 --- a/hello_poly_ft/hello_poly_ft.c +++ b/hello_poly_ft/hello_poly_ft.c @@ -1,18 +1,9 @@ -// With help from Nicolas Noble, Jaby smoll Seamonstah -// Based on Lameguy64's tutorial series : http://lameguy64.net/svn/pstutorials/chapter1/2-graphics.html +// Draw a textured poly primitive +// +// With help from Nicolas Noble, Jaby smoll Seamonstah, Lameguy64 // // From ../psyq/addons/graphics/MESH/RMESH/TUTO0.C : -// - /* PSX screen coordinate system - * - * Z+ - * / - * / - * +------X+ - * /| - * / | - * / Y+ - * eye */ +// Schnappy 2021 #include #include diff --git a/hello_poly_gt/hello_poly_gt.c b/hello_poly_gt/hello_poly_gt.c index 8b9a9f6..1726f98 100644 --- a/hello_poly_gt/hello_poly_gt.c +++ b/hello_poly_gt/hello_poly_gt.c @@ -1,18 +1,9 @@ -// With help from Nicolas Noble, Jaby smoll Seamonstah -// Based on Lameguy64's tutorial series : http://lameguy64.net/svn/pstutorials/chapter1/2-graphics.html +// Draw a textured poly primitive with gouraud shading +// +// With help from Nicolas Noble, Jaby smoll Seamonstah, Lameguy64 // // From ../psyq/addons/graphics/MESH/RMESH/TUTO0.C : -// - /* PSX screen coordinate system - * - * Z+ - * / - * / - * +------X+ - * /| - * / | - * / Y+ - * eye */ +// Schnappy 2021 #include diff --git a/hello_poly_gt_tw/hello_poly_gt_tw.c b/hello_poly_gt_tw/hello_poly_gt_tw.c index d0b0e79..69e5e85 100644 --- a/hello_poly_gt_tw/hello_poly_gt_tw.c +++ b/hello_poly_gt_tw/hello_poly_gt_tw.c @@ -1,18 +1,9 @@ -// With help from Nicolas Noble, Jaby smoll Seamonstah -// Based on Lameguy64's tutorial series : http://lameguy64.net/svn/pstutorials/chapter1/2-graphics.html +// Draw a textured poly primitive with gouraud_shading, using a repeating texture pattern +// +// With help from Nicolas Noble, Jaby smoll Seamonstah, Lameguy64 // // From ../psyq/addons/graphics/MESH/RMESH/TUTO0.C : -// - /* PSX screen coordinate system - * - * Z+ - * / - * / - * +------X+ - * /| - * / | - * / Y+ - * eye */ +// Schnappy 2021 #include diff --git a/hello_poly_inline/hello_poly_inline.c b/hello_poly_inline/hello_poly_inline.c index 1fcbd51..84e772c 100644 --- a/hello_poly_inline/hello_poly_inline.c +++ b/hello_poly_inline/hello_poly_inline.c @@ -10,6 +10,7 @@ // // Credits, thanks : Nicolas Noble, Sickle, Lameguy64 @ psxdev discord : https://discord.com/invite/N2mmwp // https://discord.com/channels/642647820683444236/663664210525290507/834831466100949002 +// Schnappy 07-2021 #include #include #include diff --git a/hello_poly_stp/hello_poly_stp.c b/hello_poly_stp/hello_poly_stp.c index b6bb011..2584ff7 100644 --- a/hello_poly_stp/hello_poly_stp.c +++ b/hello_poly_stp/hello_poly_stp.c @@ -1,19 +1,6 @@ // Demo the different settings for pixel and primitive semi-transparency // -// Based on Lameguy64's tutorial series : http://lameguy64.net/svn/pstutorials/chapter1/2-graphics.html -// -// From ../psyq/addons/graphics/MESH/RMESH/TUTO0.C : -// - /* PSX screen coordinate system - * - * Z+ - * / - * / - * +------X+ - * /| - * / | - * / Y+ - * eye */ +// Schnappy 07-2021 #include #include #include @@ -28,7 +15,6 @@ #define CENTERY SCREENYRES/2 // Center of screen on y #define MARGINX 16 // margins for text display #define MARGINY 16 -#define FONTSIZE 8 * 8 // Text Field Height #define OTLEN 8 // Ordering Table Length DISPENV disp[2]; // Double buffered DISPENV and DRAWENV DRAWENV draw[2]; @@ -165,43 +151,44 @@ int main(void) // Init proto pad PadInit(0); int pad, oldPad; - POLY_FT4 * poly[4] = {0}; // pointer to a POLY_G4 + // Pointer to a POLY_G4 + POLY_FT4 * poly[4] = {0}; SVECTOR VertPos[4] = { // Set initial vertices position relative to 0,0 - see here : https://psx.arthus.net/docs/poly_f4.jpg {-32, -32, 1 }, // Vert 1 {-32, 32, 1 }, // Vert 2 { 32, -32, 1 }, // Vert 3 { 32, 32, 1 } // Vert 4 }; - VECTOR TransVector = { SCREENXRES/3, SCREENYRES/4, 128, 0}; // Initialize translation vector {x, y, z, pad} - SVECTOR RotVector = {0}; // Initialize rotation vector {x, y, z} + VECTOR transVector = { SCREENXRES/3, SCREENYRES/4, 128, 0}; // Initialize translation vector {x, y, z, pad} + SVECTOR rotVector = {0}; // Initialize rotation vector {x, y, z} // Load textures to VRAM - for (char tim = 0; tim < 4; tim++){ + for (char tim = 0; tim < NUM_PRIM; tim++){ LoadTexture(timFiles[tim], &timImages[tim]); } while (1) { + MATRIX Work; // Clear OT ClearOTagR(ot[db], OTLEN); // Use a temporary work matrix - MATRIX Work; // Set Trans/Rot vectors to work matrix - RotMatrix(&RotVector, &Work); // Apply rotation matrix - TransMatrix(&Work, &TransVector); // Apply translation matrix + RotMatrix(&rotVector, &Work); // Apply rotation matrix + TransMatrix(&Work, &transVector); // Apply translation matrix SetRotMatrix(&Work); // Set default rotation matrix SetTransMatrix(&Work); // Set default transformation matrix // Draw NUM_PRIM primitives for (int i = 0; i < NUM_PRIM; i++){ long p, flag; // Draw prims with an offset base on iteration number - TransVector.vx = SCREENXRES/NUM_PRIM + (i * (SCREENXRES/NUM_PRIM + 32) ) ; - TransVector.vy = SCREENYRES/NUM_PRIM; + transVector.vx = SCREENXRES/NUM_PRIM + (i * (SCREENXRES/NUM_PRIM + 32) ) ; + transVector.vy = SCREENYRES/NUM_PRIM; if ( i >= 2) { - TransVector.vx = SCREENXRES/NUM_PRIM + ((i - 2) * (SCREENXRES/NUM_PRIM + 32) ) ; - TransVector.vy = SCREENYRES/2 + 24; + transVector.vx = SCREENXRES/NUM_PRIM + ((i - 2) * (SCREENXRES/NUM_PRIM + 32) ) ; + transVector.vy = SCREENYRES/2 + 24; } - TransMatrix(&Work, &TransVector); + TransMatrix(&Work, &transVector); SetTransMatrix(&Work); // Set poly poly[i] = (POLY_FT4 *)nextpri; // Set poly to point to the address of the next primitiv in the buffer diff --git a/hello_poly_subdiv/hello_poly_subdiv.c b/hello_poly_subdiv/hello_poly_subdiv.c index be0ab5b..169b76c 100644 --- a/hello_poly_subdiv/hello_poly_subdiv.c +++ b/hello_poly_subdiv/hello_poly_subdiv.c @@ -1,4 +1,4 @@ -// Hello poly ! Inline / DMPSX version +// Hello poly subdiv ! Inline / DMPSX version // // Ref : /psyq/DOCS/Devrefs/Inlinref.pdf, p.18 // https://psx-spx.consoledev.net/geometrytransformationenginegte/ @@ -10,6 +10,7 @@ // // Credits, thanks : Nicolas Noble, Sickle, Lameguy64 @ psxdev discord : https://discord.com/invite/N2mmwp // https://discord.com/channels/642647820683444236/663664210525290507/834831466100949002 +// Schnappy 07-2021 #include #include #include diff --git a/hello_sio/hello_sio.c b/hello_sio/hello_sio.c index b1de928..816f8ae 100644 --- a/hello_sio/hello_sio.c +++ b/hello_sio/hello_sio.c @@ -1,15 +1,11 @@ // hello_sio example -// // This example will display the RX data in a 64 char rolling buffer. -// // Use minicom or any other serial comm program and a serial/USB cable. // // Relevant doc is libref47.pdf, l.1120-1127 -// // Schnappy - 04/2021 // // Based on : ../psyq/psx/sample/serial/SIO -// // sio echo back // 1.00 Jan.28.1997 shino #include diff --git a/hello_sprt/hello_sprt.c b/hello_sprt/hello_sprt.c index ba5156a..c9a8105 100644 --- a/hello_sprt/hello_sprt.c +++ b/hello_sprt/hello_sprt.c @@ -1,3 +1,7 @@ +// Draw a textured sprt primitive +// +// based on Lameguy64's tutorial : http://lameguy64.net/svn/pstutorials/chapter1/3-textures.html +// Schnappy 2020 #include #include #include diff --git a/hello_tile/hello_tile.c b/hello_tile/hello_tile.c index bd92027..29c5bce 100644 --- a/hello_tile/hello_tile.c +++ b/hello_tile/hello_tile.c @@ -1,3 +1,6 @@ +// Draw a tile primitive +// Schnappy 2021 +// based on Lameguy64's tutorial : http://lameguy64.net/svn/pstutorials/chapter1/2-graphics.html #include #include #include diff --git a/hello_world/hello_world.c b/hello_world/hello_world.c index cf49d4d..24c2a73 100644 --- a/hello_world/hello_world.c +++ b/hello_world/hello_world.c @@ -1,4 +1,6 @@ -// This is stolen from Lameguy64 tutorial : http://lameguy64.net/svn/pstutorials/chapter1/1-display.html +// Demonstrate DISP/DRAW env, font setup, and display a text. +// Schnappy 2020 +// Based on Lameguy64 tutorial : http://lameguy64.net/svn/pstutorials/chapter1/1-display.html #include #include diff --git a/hello_xa/hello_xa.c b/hello_xa/hello_xa.c index 26e04ad..80067fb 100644 --- a/hello_xa/hello_xa.c +++ b/hello_xa/hello_xa.c @@ -3,7 +3,7 @@ // Refs : http://psx.arthus.net/code/XA/XATUT.pdf // http://psx.arthus.net/code/XA/xatut.zip // http://psx.arthus.net/code/XA/XA%20ADPCM%20documentation.txt -// based on Lameguy64's tutorial : http://lameguy64.net/svn/pstutorials/chapter1/1-display.html +// Schnappy 2021 #include #include #include