Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OneLua
09-21-2014, 01:56 PM (This post was last modified: 06-25-2015 08:58 PM by jkpwed.)
Post: #1
OneLua
ONElua v3

gdljjrod wrote: "ONELua is a brand new Lua Interpreter to create our homebrews to both PSP as PSVita.
As LuaDEV, OneLua is based on OSLib, so there are many similar functions (with slightly different syntax).
In this version there are enough modules to make decent homebrews.
Autors: gdljjrod and Rober Galarga."
ONElua
http://wololo.net/talk/viewtopic.php?f=2&t=38576

[Changelog ONElua v3 AKA: Oneluav3en.txt]
Code:
========= Added by GDL 25/06/15 ========
Changes:
--Added Support to run in VHBL mode (allows executing in user mode Homebrews VHBL (PSVita)).
Bit --Added the Lua library that allows Operations bitwise level.
More info here http://bitop.luajit.org/

--New Module Maps, for can generate maps with Tiles.

--Added Buttons.interval function ()
--Added Amg.screenshot function ()

--Added The callback "onPbpPack" for new functions:
game.pack () to package the resources of a PBP and make corresponding EBOOT.PBP.
game.add () lets you change or add a resource from a EBOOT.PBP.
game.remove () Deletes a resource from a EBOOT.PBP

--Added Functions:
image.loadv () lets you upload images directly to VRAM.
image.loadfromdata () Loads an image from data in memory.
image.move () Moves an image of VRAM to RAM and vice versa.
Image.Save () now allows saving an image with transpariencia.
image.blittint () Allows blitear an image with tinted effect.
image.blitadd () Allows blitear an image with great color effect.
image.blitsub () Allows blitear an image with color effect remains.

--Upgrade The value in the ini.read () Now you can read up to 1024 characters.

'Now the () Detects "VHBL" os.cfw function.
--Added New features:
os.messagebox () displays a message on screen in a window.
os.modetv () Turns the TV output in progressive mode. (720x480).
os.cabletv () lets you know the type of cable connected to the TV.

--Added The print with SCROLL:
Left.
Right.
Left (via).
Left Right.

--Added Full alignment with the print

--Added The screen.clip () function.

--Fix The screen.textheigth () function.

'Now the timers.new and timer.reset can give the initial value.

[Changelog V2R1]
Code:
V2R1
Added new module SIO.

Add the new Debugger
os.debug() To enable debug mode.
Added new Callback onDebug() that serve to replace our screen error

Added onelua_rdriver.prx for game.launch() function that returns you to ONElua.
(Requires onelua_rdriver.prx in seplugins to PSPGo should go in ef0:/seplugins).

New functions (batt):
batt.tonormal()
batt.topandora()
batt.toautoboot()
batt.backupbat()
batt.restorebat()

New functions (files):
files.scan()
files.extractfile()

New function (3D):
amg.rendertrans() for models with transparencies.
Fixed some bus with reflections.

New functions (hw):
hw.ofwinitial()
hw.fuseid()
hw.fusecfg()
hw.kirk()
hw.spock()
hw.nandseed()
hw.placa changed by hw.board()
hw.getmodel() now detects PSVITA model.

New functions (screen):
screen.toimage()
screen.buffertoimage()

New functions (math):
math.bitnot()
math.bitand()
math.bitor()

New functions (os):
os.getpassword()
Update os.getcfw now detects TNV/ARK
os.reset() changed by os.restart()

Modified image.save() and screen.shot() only accept PNG format.
Changed the function osk.init() Now put two modes: Normal Keyboard and Numeric Keyboard.

Code:
"This version includes a 3D demo by Mills (Downloads are in our web)"
ONElua v2 Bundle Demo:
https://dl.dropboxusercontent.com/u/48796093/Onelua/ONEluav2Bundle.rar
memstick/PSP/Game/Demo3D ONELUAv2


[Changelog]
++ Added the all-new 3D Module (special thanks to Andresmargar for AMGLib and his invaluable help... YOU ROCK MAN!).
++ Added a new error screen, now you can edit the error line directly in your PSP (no PC needed). This is still in development and tests, so some errors will not be fixable in this way.
++ Now you can access correctly to both ms0 and ef0 on PSP Go.
++ Fixed MOD sounds loading (.mod, .it, .s3m and .xm).
++ Fixed os.message(), now it returns your choice correctly.
++ files.list(),files.listfiles() and files.listdirs() were optimized.
++ Utils module renamed to game.
++ sound.getid3() got a new field: "cover", which contains the album art if available.
++ Added three new functions: image.pixel(), screen.brightness() and os.delay() (please refer the docs to get further details).
++ Now files.size() also works on directories.
-- Disabled AT3 files loading.

[TO DO]
++ Finish the new error screen, adding more support, the new OSK and the new GUI.

OneLua features basic functions, as sound load (mp3), images, ini files, functions to copy & paste and many more (feel free to explore the docs).

However, there are a bug: there aren't functions to delete sounds, images, timers and other objects, so to free them you'll need to use the basic way:

var = nil

Maybe you'll want to call collectgarbage("collect") after that to clean effectively the memory used by the object.

Features:
-Most math module functions now uses the VFPU, so the trigonometric calculations will be VERY fast.
-Color masking while loading images. This allow, for example, remove a solid-color background in your images.
-Dedicated HW module, which contains plenty of new functions, as PSP model detection, battery mode detection (normal, pandora or autoboot... only works for unbrickeable consoles), motherboard type and model detection...
-Detects correctly the free space in both ms0 and ef0 (for PSP Go).
-Detects the CFW that you're running.
-UMD functions: info and dump directly.
-Files: copy, rename, delete, fast-move (using the Total_Noob sample), unzip & unrar (with or without password).
-Unified and easy-to-use buttons reading, using constants (see the docs for an example).
-WiFi configs backup & restore.
-callbacks and constants in several functions, to ease your life

FOR PSP GO USERS
-If you want to read both ms0 and ef0 devices, your HB should be placed in ms0. <--Fixed v2.
-The function files.move doesn't work properly between devices (ms0 to ef0 and vice versa), only performs a copy. Other functions work fine.

We'll appreciate if you report us all the bugs you encounter. Any other feedback is welcomed, too.

Impotent Missing text: Solution replace jpn0.pgf in flash0 folder with original PSP fonts to get text working (or try JPCSP jpn0.pgf unconfirmed if this will fix the text). Tested with Notepad++: UTF-8 without BOM

memstick/PSP/Game/ONEluav2R1
flash0/font/jpn0.pgf

Last tested with: ppsspp-v1.0-59-gc9e6938-windows-amd64

PPSSPP issue #1 missing text with following lua code:
Code:
screen.print(0,100,"Test 1: Must replace jpn0.pgf font to see this massage")
screen.print(0,110,"Test 2: Must replace jpn0.pgf font to see this massage",0.4,color.new(250,0,0))
screen.print(0,120,"FPS: Must replace jpn0.pgf font to see this massage"..screen.fps())

New Settings:
Code:
Fast memory (unstable) -Unchecked (if this is checked it will crash)
Multithreaded (experimental) -Checked *optional speedup
(Edit) Change emulated PSP's CPU clock: 1000  *optional speedup (helps sequential images/frame by frame images)
Save path in My Documents -Checked *optional


Attached File(s) Thumbnail(s)
   

ASRock Fatal1ty Z97 Killer | Intel i5-4690k @ 3.50GHz | G.Skill Ripjaws X Series 2x4GB DDR3 1600MHz | ASUS Radeon R9 270X DirectCU II TOP 2GB | Windows 7 Ultimate x64

ASRock Z97 Anniversary | Intel Pentium G3258 @ 3.20GHz | Corsair Vengeancez 2x4GB DDR3 1600MHz | Evga GeForce GTX 750 2GB SC | W7 Ultimate x64
Find all posts by this user
Quote this message in a reply
10-11-2014, 08:29 PM (This post was last modified: 06-25-2015 08:58 PM by jkpwed.)
Post: #2
RE: ONElua v2
(Edit)Nice 3D was added on 10/8/2014 AMGLib by Andresmargar
(Edit)3D Demo by Mills

v0.9.9.1-619-g25a26ee
Fast Memory (unstable): Off
Used PSP fonts to show text

Optional:
Multithreaded (experimental): On

Other notes: To change PSP/PPSSPP CPU Clock open up script.lua and add a double hyphen so it looks like to: --os.setcpu(333)

tested with:ppsspp-v0.9.9.1-619-g25a26ee-windows-amd64


Attached File(s) Thumbnail(s)
   

ASRock Fatal1ty Z97 Killer | Intel i5-4690k @ 3.50GHz | G.Skill Ripjaws X Series 2x4GB DDR3 1600MHz | ASUS Radeon R9 270X DirectCU II TOP 2GB | Windows 7 Ultimate x64

ASRock Z97 Anniversary | Intel Pentium G3258 @ 3.20GHz | Corsair Vengeancez 2x4GB DDR3 1600MHz | Evga GeForce GTX 750 2GB SC | W7 Ultimate x64
Find all posts by this user
Quote this message in a reply
10-14-2014, 06:40 PM (This post was last modified: 02-11-2015 01:51 PM by jkpwed.)
Post: #3
RE: ONElua v2
(Edit) Now just messing around with stuff/testing this are random 3D characters models with no movement what so ever and are not part of this homebrew game.Note:Japanese Hiragana text are working great. DOA5 notes 4th image: textures were scaled down from (1024x1024 to 512x512) and (512x1024 to 256x512).


Attached File(s) Thumbnail(s)
               

ASRock Fatal1ty Z97 Killer | Intel i5-4690k @ 3.50GHz | G.Skill Ripjaws X Series 2x4GB DDR3 1600MHz | ASUS Radeon R9 270X DirectCU II TOP 2GB | Windows 7 Ultimate x64

ASRock Z97 Anniversary | Intel Pentium G3258 @ 3.20GHz | Corsair Vengeancez 2x4GB DDR3 1600MHz | Evga GeForce GTX 750 2GB SC | W7 Ultimate x64
Find all posts by this user
Quote this message in a reply
10-21-2014, 07:36 PM (This post was last modified: 02-11-2015 01:52 PM by jkpwed.)
Post: #4
RE: ONElua v2
***(Edit)11/5/2014 I am no-longer working on this.
Here is a slightly different version incomplete (just messing around with stuff this is not a port, I don't recommend using this on a real PSP) this is all trial and error.

Fast Memory (unstable): Off

Optional:
Tab key/` to speed up loading
Multithreaded (experimental): On

11/4/2014 script r25 targets scale: https://www.mediafire.com/?mxa4nnsan9k1qfj

Change log:
Code:
Other: stable version: r10 (Mario run 23/23, only 4 models have texture).
Notes: movement isn't correct at the moment, Mario has some wrong vertex.

*disabled the cameras
*circle has infinite jump/ cross jump broken kind of
*fixed the wrong texture on Temple Stage(still needs work)
*1 song added
*(animation/movement) 23/23 models of Mario, 4/23 models have textures, Forces mesh translations export
*removed the ball render and plane render
*missing Mario# = nil and collectgarbage() (All test have failed to unload Mario)
*the 2 cube are now at Temple
*maze stage,ring and sound removed, I based it back to r10
*pad movement
*logo is fixed (light fix)
*Respawn: R, Camera: Select
*Zako-Girl/Blue Alloy (broken pieces head,arms,legs...) (no movement yet)
*swapped Mario for Zako-Girl
*plus Mario (no textures) (later I'll try to unload Mario)
*menu
*targets

10/29/2014 script r11.09 stage clean, (solving for multiple 3D model/s unload has proven to far to difficult which is why it's now based on r5/10)


Attached File(s) Thumbnail(s)
           

ASRock Fatal1ty Z97 Killer | Intel i5-4690k @ 3.50GHz | G.Skill Ripjaws X Series 2x4GB DDR3 1600MHz | ASUS Radeon R9 270X DirectCU II TOP 2GB | Windows 7 Ultimate x64

ASRock Z97 Anniversary | Intel Pentium G3258 @ 3.20GHz | Corsair Vengeancez 2x4GB DDR3 1600MHz | Evga GeForce GTX 750 2GB SC | W7 Ultimate x64
Find all posts by this user
Quote this message in a reply
02-15-2015, 12:07 PM
Post: #5
RE: OneLua
ONElua v2R1 NEW UPDATE
"gdljjrod wrote: Update" @ http://wololo.net/talk/viewtopic.php?f=2...6&start=30

ASRock Fatal1ty Z97 Killer | Intel i5-4690k @ 3.50GHz | G.Skill Ripjaws X Series 2x4GB DDR3 1600MHz | ASUS Radeon R9 270X DirectCU II TOP 2GB | Windows 7 Ultimate x64

ASRock Z97 Anniversary | Intel Pentium G3258 @ 3.20GHz | Corsair Vengeancez 2x4GB DDR3 1600MHz | Evga GeForce GTX 750 2GB SC | W7 Ultimate x64
Find all posts by this user
Quote this message in a reply
06-23-2015, 12:00 AM
Post: #6
RE: OneLua
gdljjrod wrote: "ONElua v3 soon!!!"
https://twitter.com/gdljjrod

ASRock Fatal1ty Z97 Killer | Intel i5-4690k @ 3.50GHz | G.Skill Ripjaws X Series 2x4GB DDR3 1600MHz | ASUS Radeon R9 270X DirectCU II TOP 2GB | Windows 7 Ultimate x64

ASRock Z97 Anniversary | Intel Pentium G3258 @ 3.20GHz | Corsair Vengeancez 2x4GB DDR3 1600MHz | Evga GeForce GTX 750 2GB SC | W7 Ultimate x64
Find all posts by this user
Quote this message in a reply
06-25-2015, 08:33 PM (This post was last modified: 06-25-2015 08:38 PM by jkpwed.)
Post: #7
RE: OneLua
gdljjrod wrote: "ONELua v3 ready!!"
http://onelua.x10.mx/
http://wololo.net/talk/viewtopic.php?p=350260

ASRock Fatal1ty Z97 Killer | Intel i5-4690k @ 3.50GHz | G.Skill Ripjaws X Series 2x4GB DDR3 1600MHz | ASUS Radeon R9 270X DirectCU II TOP 2GB | Windows 7 Ultimate x64

ASRock Z97 Anniversary | Intel Pentium G3258 @ 3.20GHz | Corsair Vengeancez 2x4GB DDR3 1600MHz | Evga GeForce GTX 750 2GB SC | W7 Ultimate x64
Find all posts by this user
Quote this message in a reply
06-29-2015, 12:44 PM (This post was last modified: 06-29-2015 12:44 PM by Haseeb.)
Post: #8
RE: OneLua
I am interested in PSP game development. I'm a programmer, 3D artist , animator and developer in general.
I have always wanted to create something for PSP.
Although the English documentation is not working and why is there no windows version of this engine?
I mean we can't develop inside PSP of course!

The Signature!
Find all posts by this user
Quote this message in a reply
06-30-2015, 12:24 PM (This post was last modified: 07-12-2015 01:28 PM by jkpwed.)
Post: #9
RE: OneLua
@Haseeb Their is anther version in c/c++ but, it's not a windows version called AMGLib Plus by Andres Margar, more info at wololo.net. For programing in the psp use OneLua IDE by David Nunez Aguilera as showed in this video I can't find the link (psp.scenebeta.com & wololo.net). I was unable to unload 3D stuff on both ONELua v3 (well without textures but the frame rate was 2) and AMGLib Plus (this looks amazing but I can't add that much 3D stuff like SSBB stage and DOA5 Christie maybe do to textures idk).

Main.c (so sorry for the messy code)
Note: Mostly all of the code was copy past and unloading 3D objects did not go so well (also c/c++ is new to me do not try this on the PSP).
Code:
/*
* AMGlib Template
* Powered by Andresmargar
* from SCENEBETA
*/
// Includes AMG
#include <AMG/AMGLib.h>
#include <dirent.h> //C:\pspsdk\psp\sdk\Examples\Multimedia\MP3Player\Source
#include <pspsdk.h>


//google:psp 3d homebrew library

// Module info
AMG_MODULE_INFO("AMG_Model Mod", 0, 1, 1);

float M = 1;
float INFINITE = 1;

int pspDveMgrCheckVideoOut();
int pspDveMgrSetVideoOut(int, int, int, int, int, int, int);
    int    U = 0;
    int    MODE = 0x1D2;
    int    AMG_W = 480;
    int    AMG_H = 272;
int TV_Cable = 0;

void TV_OUT(){

    //esta ya esta cargada
    pspSdkLoadStartModule("dvemgr.prx", PSP_MEMORY_PARTITION_KERNEL);
    
    //Detecta PSP y firmware AQUI ...
    //..
    //..
    //if PSP no es slim, sal de la funcion.
    //O si vuelves de TV a LCD
    
    //Detectar cable
    /*
    # LCD OUT
    # 0, 0x000, 480, 272, 1, 15, 0
    # Composite OUT / Progressive
    # 2, 0x1D2, 720, 503, 1, 15, 0
    # Composite OUT / Interlace
    # 2, 0x1D1, 720, 503, 1, 15, 0
    # Component OUT / Progressive
    # 0, 0x1D2, 720, 480, 1, 15, 0
    # Component OUT / Interlace
    # 0, 0x1D1, 720, 503, 1, 15, 0
    */    
    TV_Cable = pspDveMgrCheckVideoOut();
    
    if (TV_Cable == 0) {}  ///"no hay cable"
    if (TV_Cable == 1){ //SDTV
        U = 2,
        MODE = 0x1D2;
        AMG_W = 720;
        AMG_H = 503;
    }    
    if (TV_Cable == 2){ //HDTV
        U = 0,
        MODE = 0x1D2;
        AMG_W = 720;
        AMG_H = 480;
    }        

    pspDveMgrSetVideoOut(U, MODE, AMG_W, AMG_H, 1, 15, 0);
}

char text[256];
//Main()
int main(int argc, char **argv){
    
    // Init PS
    AMG_SetupCallbacks();        // Inicializa los callbacks
    
    TV_OUT();
  
    //GU_PSM_5650 GU_PSM_5551 GU_PSM_4444 GU_PSM_8888
  
    AMG_Init3D(GU_PSM_8888| AMG_DOUBLEBUFFER | AMG_SCREEN_DIMENSIONS(AMG_W,AMG_H));// Inicializa el motor 3D
    AMG_InitMultimedia();
    AMG_InitAudio();
    
    AMG_InitTimeSystem();
    AMG_SetCpuSpeed(333);
    AMG_InitMatrixSystem(36.0f);// Perspectiva
    //AMG_SetPerspectiveFOV(fov) AMG_InitMatrixSystem(fov)
    AMG_SetAntialias(1);
    
    AMG_MP3 *fairy;
    
    //fairy = AMG_LoadMP3("Test.mp3");
    fairy = NULL;
    
    //AMG_LinkMP3(fairy);
    AMG_SetLoopMP3(fairy, 1);
    //fairy->Play = 1;
    AMG_PlayMP3(fairy);
    fairy->Play = 1;
    
    AMG.ClearColor = 0;                            //black bg
    //AMG_EnableFog(10.0f, -10.0f, 0xFFFFFFFF);
    
    //AMG_AllocateSharedTexture(256, 256, GU_PSM_8888);
    
    // Load Models (Planet model contains a lot of models inside, it was exported using Blender
    // Carga la fuente de texto
    
    /*
    AMG_Texture *font = AMG_LoadTexture("Files/font.png", AMG_TEX_RAM);
    AMG_DeleteColor(font, GU_RGBA(0, 0, 0, 0xFF));                        // Make the black colour transparent
    AMG_Create2dObject(font, GU_PSM_5551, 1);
    AMG_SwizzleTexture(font);
    */
    
    // Carga el modelo 3D    // Load the 3D model

    
    
    AMG.TextureQuality = GU_PSM_8888;    // Set Texture Quality GU_PSM_4444, GU_PSM_5650 or GU_PSM_5551
    AMG.TextureDest = AMG_TEX_RAM;
    AMG.TextureSwizzle = 1;
    
    
    AMG_Model *tie_fighter = AMG_LoadModel("Files/Tie-Fighter.obj");
    //AMG_Model *tie_fighter = AMG_LoadModel("Temple/Temple4.obj");
    
    //AMG_Texture *cri_body_base = AMG_LoadTexture("Files/cri_body_base.png", AMG_TEX_VRAM);
    
    //AMG_Model *tie_fighter = AMG_LoadModelA("Temple/Temple4.obj", 1);
    
    
    //AMG_Model *tie_fighter = NULL;
    

    //AMG_TransferTextureVram(GU_PSM_8888);
    //AMG_Model *tie_fighter = NULL;
    //tie_fighter->CelShading = 1;        // Activa CelShading    // Enable Cel-Shading (enable light before using this)
    //tie_fighter->Object[0].Lighting = 0;
    
    //AMG_AllocateSharedTexture(512, 512, GU_PSM_8888); //Couldn't allocate 1024kb in VRAM
    
    //AMG_Texture *Material__25 = AMG_LoadTexture("Files/DLC_CRI_102_02_base.png", AMG_TEX_VRAM);
    //AMG_Create2dObject(Material__25, GU_PSM_5551, 1);
    
    //AMG_UnloadTexture(Material__25);
    
    //AMG_Texture *Material__26 = AMG_LoadTexture("Files/DLC_CRI_102_01_base.png", AMG_TEX_VRAM);
    //AMG_Create2dObject(Material__26, GU_PSM_5551, 1);
    
    //AMG_Texture *Material__30 = AMG_LoadTexture("Files/cri_face_base.png", AMG_TEX_VRAM);
    //AMG_Create2dObject(Material__30, GU_PSM_5551, 1);
    
    //AMG_Texture *Material__35 = AMG_LoadTexture("Files/cri_body_base.png", AMG_TEX_VRAM);
    //AMG_Create2dObject(Material__35, GU_PSM_5551, 1);
    //map_Kd = cri_body_base.png;
    
    /*
    tie_fighter->Object[0].Pos.x = 0.0f;        // Posicionamos el modelo        // Set model position
    tie_fighter->Object[0].Pos.y = 7.0f;
    tie_fighter->Object[0].Pos.z = 4.0f;
    tie_fighter->Object[0].Scale.x = 0.8f;        // Configuramos la escala        // Set model scale
    tie_fighter->Object[0].Scale.y = 0.8f;
    tie_fighter->Object[0].Scale.z = 0.8f;
    */
    tie_fighter->Object[0].Pos.z = -250.0f;        // Set model position
    
    //AMG_Texture *black = AMG_LoadTexture("Files/black.png", AMG_TEX_RAM);    // Carga el lienzo en RAM        // Load it in RAM
    //AMG_Create2dObject(black, GU_PSM_8888, AMG_TEX_RAM);                            // Conviértelo en un sprite 2D    // Create 2D Object
    //black->X = (480 / 2);                                                    // Centramos el lienzo en el eje X...        // Center in X
    //black->Y = (272 / 2);
    
    //Light type
    AMG_Light[0].Type = GU_DIRECTIONAL;
    //Light parameters
    AMG_Light[0].Diffuse = GU_RGBA(250, 250, 250, 0x0F);
    AMG_Light[0].Ambient = GU_RGBA(90, 90, 110, 0x0F);
    AMG_Light[0].Specular = GU_RGBA(50, 50, 50, 0x0F);
    
    //Light position (direction vector)
    AMG_Light[0].Pos.x = 4.0f;
    AMG_Light[0].Pos.y = 4.0f;
    AMG_Light[0].Pos.z = 4.0f;
    
    //set a camera
    AMG_Camera *camera = AMG_InitCamera();
    camera->Pos.z = 20.0f;
    //camera->Pos.y = 0.0f;
    //camera->Pos.x = 0.0f;
    //camera->Rot.x = AMG_Deg2Rad(0.0f);
    //camera->Eye.x = 0.0f;
    //camera->Up.y = 1.0f;
    
    // Variables adicionales    // Additional stuff
    float alpha = 1.0f;            // Variable para controlar la transparencia del modelo    // Variable used to control model alpha-component
    float angle = 0.0f;            // El ángulo de rotación de la luz    // Light rotation angle
    
    //int M = 1;
    
    /*
    pspDebugScreenInit();
    //pspDebugScreenSetXY(40, 40);
    pspDebugScreenPrintf("HelloWorld!!");
    */

    while(!AMG.Exit){
                
        // Start 3d drawing
        AMG_Begin3D();    
        
        AMG_ReadButtons();
        
        AMG_SetCamera(camera);
        
        //AMG_LookAt(&camera->Pos.z, &camera->Eye.x, &camera->Up.y);
        //AMG_LookAt(&tie_fighter->Object[0].Pos.z, &tie_fighter->Object[0].Pos.x, &camera->Up.y);
        //AMG_LookAt(&tie_fighter->Object[0].Pos.z, &tie_fighter->Object[0].Pos.x, &tie_fighter->Object[0].Pos.y);
        
        // Activa la luz 0        // Enable light 0
        AMG_EnableLight(0);
        AMG_Light[0].Pos.x = AMG_Cos(angle) * 6.0f;
        AMG_Light[0].Pos.y = AMG_Sin(angle) * 6.0f;
        angle += AMG_Deg2Rad(1.0f);
        
        // Rotacion del modelo 3D    // 3D model rotation
        
        //if(AMG_Button.Held &PSP_CTRL_CROSS) tie_fighter->Object[0].Pos.z += AMG_Deg2Rad(1.0f); //kbd.Z
        //if(AMG_Button.Held &PSP_CTRL_CIRCLE) tie_fighter->Object[0].Pos.z -= AMG_Deg2Rad(1.0f); //kbd.X

        if(AMG_Button.Down &PSP_CTRL_START) M++;
        if(M > 10) M = 1;
        else if(M < 0) M = 1;
        
        //Move        
        //c++ case
        //http://www.cplusplus.com/doc/tutorial/control/
        
        if (M == 1) {
        //cout << "x is 1";
        //camera->Pos.z = 20.0f
        if(AMG_Button.Held &PSP_CTRL_UP) camera->Pos.y -= AMG_Deg2Rad(1.0f);
        if(AMG_Button.Held &PSP_CTRL_DOWN) camera->Pos.y += AMG_Deg2Rad(1.0f);
        if(AMG_Button.Held &PSP_CTRL_RIGHT) camera->Pos.x += AMG_Deg2Rad(1.0f);
        if(AMG_Button.Held &PSP_CTRL_LEFT) camera->Pos.x -= AMG_Deg2Rad(1.0f);
        if(AMG_Button.Held &PSP_CTRL_TRIANGLE) camera->Pos.z += AMG_Deg2Rad(1.0f); //kbd.S
        if(AMG_Button.Held &PSP_CTRL_SQUARE) camera->Pos.z -= AMG_Deg2Rad(1.0f);
        }
        else if (M == 2) {
        //cout << "x is 2";
        tie_fighter->Object[0].Pos.z -= AMG_Deg2Rad(1.0f);
        }
        else if (M == 3) {
        //cout << "x is 3";
        //tie_fighter->Object[0].Pos.z += AMG_Deg2Rad(1.0f);
        }
        else if (M == 4) {
        //cout << "x is 4";
        tie_fighter->Object[0].Pos.z += AMG_Deg2Rad(1.0f);
        }
        else {
        //cout << "value of x unknown";
        if(AMG_Button.Held &PSP_CTRL_UP) tie_fighter->Object[0].Rot.x -= AMG_Deg2Rad(1.0f);
        if(AMG_Button.Held &PSP_CTRL_DOWN) tie_fighter->Object[0].Rot.x += AMG_Deg2Rad(1.0f);
        if(AMG_Button.Held &PSP_CTRL_RIGHT) tie_fighter->Object[0].Rot.y += AMG_Deg2Rad(1.0f);
        if(AMG_Button.Held &PSP_CTRL_LEFT) tie_fighter->Object[0].Rot.y -= AMG_Deg2Rad(1.0f);    
        if(AMG_Button.Held &PSP_CTRL_TRIANGLE) tie_fighter->Object[0].Pos.z += AMG_Deg2Rad(1.0f); //kbd.S
        if(AMG_Button.Held &PSP_CTRL_SQUARE) tie_fighter->Object[0].Pos.z -= AMG_Deg2Rad(1.0f);  //kbd.A
        tie_fighter->Object[0].Pos.y -= AMG_Deg2Rad(((float)AMG_Button.JoyY / 64.0f));
        tie_fighter->Object[0].Pos.x += AMG_Deg2Rad(((float)AMG_Button.JoyX / 64.0f));
        }
        
        /*
        switch (M) {
            case 1:
                //cout << "x is 1";
                break;
            case 2:
                //cout << "x is 2";
                tie_fighter->Object[0].Pos.z -= AMG_Deg2Rad(1.0f);
                break;
            case 3:
                //cout << "x is 3";
                tie_fighter->Object[0].Pos.z += AMG_Deg2Rad(1.0f);
                break;
            default:
                //cout << "value of x unknown";
                break;
        }
        */
        
        //use useful variable for cam
        //cam->Eye.x +=
        
        if(AMG_Button.Held &PSP_CTRL_SELECT) tie_fighter->Object[0].Pos.z -= AMG_Deg2Rad(1.0f);
        
        //if(AMG_Button.Down &PSP_CTRL_CROSS) AMG_Screenshot("Photo.png");

        // Cambiamos el Alpha    // Time to change alpha-component
        if(AMG_Button.Held &PSP_CTRL_RTRIGGER) alpha += 0.05f;
        else if(AMG_Button.Held &PSP_CTRL_LTRIGGER) alpha -= 0.05f;
        if(alpha > 1.0f) alpha = 1.0f;
        else if(alpha < 0.0f) alpha = 0.0f;
        tie_fighter->Object[0].Group[0].Diffuse = GU_COLOR(1.0f, 1.0f, 1.0f, alpha);
        
        INFINITE++;
        if (INFINITE == 1000) {
        //if (INFINITE >= 1000 &INFINITE <= 2000) {

        //AMG_Model *tie_fighter = AMG_LoadModel("Files/Tie-Fighter.obj");

        //AMG_Update3D();    
        }
        else if (INFINITE == 2000) {
        //AMG_Model *tie_fighter = AMG_LoadModel("Temple/Temple4.obj");
        
        AMG_UnloadModel(tie_fighter);
        //AMG_UpdateMP3(fairy);
        //AMG_Update3D();    
        //AMG_UpdateAudio();
        //AMG_UpdateTime();
        //AMG_Finish3D();
        }
        else if (INFINITE == 3000) {
        //else if (INFINITE >= 3000 &INFINITE <= 4000) {
        //tie_fighter == NULL;
        //AMG_UnloadModel(tie_fighter);
        //AMG_UnloadTexture(tie_fighter);
        //AMG_UpdateMatrices();
        //AMG_Update3D();
        //AMG_UpdateTime();
        
        //AMG_Model *tie_fighter = AMG_LoadModel("Files/Tie-Fighter.obj");
        
        //AMG_UnloadTexture((tie_fighter)AMG.Lightmap);
        //free(amg_vram.block);
        
        //AMG_UnloadModelT(tie_fighter);
        
        //AMG_UnloadObject(tie_fighter);
        //AMG_UnloadTexture(tie_fighter);
        //AMG_UnloadModel(tie_fighter);
        
        //tie_fighter == NULL;
        //AMG_DestroyMatrixSystem();
        //AMG_Update3D();    
        //AMG_UpdateTime();
        
        //free(amg_scrfade); amg_scrfade = NULL;
        //AMG_UnloadTexture((AMG_Texture*)AMG.Lightmap);
        //AMG_DestroyMatrixSystem();
        
        //return NULL;
        //tie_fighter == NULL;
        //sceKernelDcacheWritebackAll(); // flush cache so that no stray data remains
        //AMG_UnloadModel(tie_fighter);
        
        //AMG_UnloadModel(AMG_Model *model);
        //AMG_UnloadObject(AMG_Object *model);
        
        //AMG_UnloadObject(tie_fighter); //????
        }
        else if (INFINITE == 4000) {
        //else if (INFINITE >= 4000 &INFINITE <= 5000) {
        //AMG.TextureQuality = GU_PSM_8888;    // Set Texture Quality GU_PSM_4444, GU_PSM_5650 or GU_PSM_5551
        //AMG.TextureDest = AMG_TEX_VRAM;
        //AMG.TextureSwizzle = 1;
        
        //AMG_Model *tie_fighter = AMG_LoadModel("Files/Tie-Fighter.obj");
        //AMG_EnableLight(0);
        
        //AMG_DrawSprite(black);
        //AMG_RenderModel(tie_fighter);
        
        //AMG_DisableLight(0);
        //AMG_Update3D();    
        }
        else {
        //cout << "value of x unknown";
        }
        
        AMG_EnableLight(0);
        
        //AMG_DrawSprite(black);
        AMG_RenderModel(tie_fighter);
        
        AMG_DisableLight(0);
        
        //bones:C:\pspsdk\psp\sdk\samples\gu\morphskin

        AMG_OrthoMode(1);    // Modo 2D
        /*
        sprintf(text, "FPS: %d", AMG.FPS);
        AMG_Printf(font, 0, 0, 0xFFFFFFFF, text);
        
        sprintf(text, "M: %f", M);
        AMG_Printf(font, 0, 10, 0xFFFFFFFF, text);
        
        //sprintf(text, "CABLE: %u", pspDveMgrCheckVideoOut());
        //AMG_Printf(font, 0, 30, 0xFFFFFFFF, text);
        
        //sprintf(text, "POS Z: %f", tie_fighter->Object[0].Pos.z);

        sprintf(text, "INFINITE: %f", INFINITE);
        AMG_Printf(font, 0, 50, 0xFFFFFFFF, text);
        
        if (M == 1) {
        sprintf(text, "Cam POS x: %.2f y: %.2f z: %.2f", camera->Pos.x, camera->Pos.y, camera->Pos.z);
        AMG_Printf(font, 0, 20, 0xFFFFFFFF, text);
        }
        else if (M == 2) {
        sprintf(text, "Auto Cri POS Z: %.2f", tie_fighter->Object[0].Pos.z);
        AMG_Printf(font, 0, 20, 0xFFFFFFFF, text);
        }
        else if (M == 3) {
        sprintf(text, "Locked");
        AMG_Printf(font, 0, 20, 0xFFFFFFFF, text);
        }
        else if (M == 4) {
        sprintf(text, "Auto Cri POS Z: %.2f", tie_fighter->Object[0].Pos.z);
        AMG_Printf(font, 0, 20, 0xFFFFFFFF, text);
        }
        else {
        sprintf(text, "Cri POS x: %.2f y: %.2f z: %.2f", tie_fighter->Object[0].Pos.x, tie_fighter->Object[0].Pos.y, tie_fighter->Object[0].Pos.z);
        AMG_Printf(font, 0, 20, 0xFFFFFFFF, text);
        sprintf(text, "Cri ROT x: %.2f y: %.2f z: %.2f", tie_fighter->Object[0].Rot.x, tie_fighter->Object[0].Rot.y, tie_fighter->Object[0].Rot.z);
        AMG_Printf(font, 0, 30, 0xFFFFFFFF, text);
        }
        //wrong
        //sprintf(text, "AMG_GetVramSize: %.2f", AMG_GetVramSize(10, 10, GU_PSM_8888));
        //AMG_Printf(font, 0, 40, 0xFFFFFFFF, text);
        
        //std::cout << "File already exists" << std::endl;
        
        */
        
        //f = fopen("log.txt", "wb");
        //fprintf(f, "Cri POS x: %.2f y: %.2f z: %.2f\n", tie_fighter->Object[0].Pos.x, tie_fighter->Object[0].Pos.y, tie_fighter->Object[0].Pos.z);
        //fclose(f); f = NULL;
        
        
        AMG_OrthoMode(0);    // Fin del modo 2D    
        
        //AMG_UpdateMatrices();
        AMG_UpdateMP3(fairy);
        AMG_Update3D();    
        AMG_UpdateAudio();
        AMG_UpdateTime();    // Actualiza el tiempo    // Update time
        
        //AMG_ReadButtons();
        // Capturas de pantalla
        if(AMG_Button.Down &PSP_CTRL_CIRCLE) AMG_Screenshot("Photo2.png");
    }
    
    // End
    AMG_UnloadMP3(fairy); // I think this is correct it was missing
    AMG_UnloadModel(tie_fighter);    // Elimina el modelo 3D            // Unload the 3D model
    //AMG_UnloadTexture(black);
    //AMG_UnloadTexture(font);
    AMG_Finish3D();                //
    return AMG_ReturnXMB();        //
}


Attached File(s) Thumbnail(s)
       

ASRock Fatal1ty Z97 Killer | Intel i5-4690k @ 3.50GHz | G.Skill Ripjaws X Series 2x4GB DDR3 1600MHz | ASUS Radeon R9 270X DirectCU II TOP 2GB | Windows 7 Ultimate x64

ASRock Z97 Anniversary | Intel Pentium G3258 @ 3.20GHz | Corsair Vengeancez 2x4GB DDR3 1600MHz | Evga GeForce GTX 750 2GB SC | W7 Ultimate x64
Find all posts by this user
Quote this message in a reply
06-30-2015, 01:54 PM
Post: #10
RE: OneLua
Thank you jkpwed , I'll check that out Smile

The Signature!
Find all posts by this user
Quote this message in a reply
06-30-2015, 02:49 PM
Post: #11
RE: OneLua
(06-30-2015 01:54 PM)Haseeb Wrote:  Thank you jkpwed , I'll check that out Smile
no problem

ASRock Fatal1ty Z97 Killer | Intel i5-4690k @ 3.50GHz | G.Skill Ripjaws X Series 2x4GB DDR3 1600MHz | ASUS Radeon R9 270X DirectCU II TOP 2GB | Windows 7 Ultimate x64

ASRock Z97 Anniversary | Intel Pentium G3258 @ 3.20GHz | Corsair Vengeancez 2x4GB DDR3 1600MHz | Evga GeForce GTX 750 2GB SC | W7 Ultimate x64
Find all posts by this user
Quote this message in a reply
07-12-2015, 01:19 PM (This post was last modified: 07-12-2015 01:34 PM by jkpwed.)
Post: #12
RE: OneLua
ONEDEMO_(F_EXPLOSION) by Mills and Video

ASRock Fatal1ty Z97 Killer | Intel i5-4690k @ 3.50GHz | G.Skill Ripjaws X Series 2x4GB DDR3 1600MHz | ASUS Radeon R9 270X DirectCU II TOP 2GB | Windows 7 Ultimate x64

ASRock Z97 Anniversary | Intel Pentium G3258 @ 3.20GHz | Corsair Vengeancez 2x4GB DDR3 1600MHz | Evga GeForce GTX 750 2GB SC | W7 Ultimate x64
Find all posts by this user
Quote this message in a reply
07-23-2015, 01:39 PM
Post: #13
RE: OneLua
SpaceBall v2 by Mills @ hackinformer.com

ASRock Fatal1ty Z97 Killer | Intel i5-4690k @ 3.50GHz | G.Skill Ripjaws X Series 2x4GB DDR3 1600MHz | ASUS Radeon R9 270X DirectCU II TOP 2GB | Windows 7 Ultimate x64

ASRock Z97 Anniversary | Intel Pentium G3258 @ 3.20GHz | Corsair Vengeancez 2x4GB DDR3 1600MHz | Evga GeForce GTX 750 2GB SC | W7 Ultimate x64
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: