QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

Lua Flashing Mod Functions

This is a discussion on Lua Flashing Mod Functions within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Can someone please give me all the functions to the new lua falshing mod. I just want to see what ...

Reply
 
LinkBack Thread Tools
Old 03-13-2007, 05:56 PM   #1
 
Join Date: Sep 2006
Posts: 484
Trader Feedback: 0
Default Lua Flashing Mod Functions

Can someone please give me all the functions to the new lua falshing mod. I just want to see what it can do, no i'm not gonna create some kind of flasher so don't call me a noob. I just know it can do other things and I wanna see what it can do. Thank you.
__________________
Need a GFX Guy for EBOOT ICONS, BACkGROUNDS?? I can help you there.
Just see some of my work. PM me for GFX.
pspfreak9 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-13-2007, 05:59 PM   #2
 
OwlHuntr's Avatar
 
Join Date: Dec 2006
Posts: 50
Trader Feedback: 0
Default

They are all in the sample file Flasher in the mod download. With documentation
OwlHuntr is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-13-2007, 06:13 PM   #3

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

The new mod has the following:


Code:
-- Unassign an IO device

-- Parameters:
-- dev - IO device to unassign as a string

System.Unassign ( dev )



-- This will unassign your memory stick device
System.Unassign ( "ms0:" )
Code:
-- This will assign an IO device

-- Parameters:
-- dev1 - The device name to assign as a string 
-- dev2 - The block device to assign from as a string
-- dev3 - The filesystem device to map the block device to dev1 as a string  

System.Assign ( dev1, dev2, dev3 )



-- This will reassign flash0 (assiging gives that device read and write privelages autoatmically)
System.Assign ( "flash0", "lflash0:0,0", "flashfat0:" )
Code:
-- This allows you to write 'source' file to 'destination' file with a flag to remove 'source' file after writing to 'destination'.  NOTE - overwrites if 'destination' exists

-- Parameters:
-- source - File to be copied as a string
-- destination - Place for 'source' to be copied to as a string
-- remove - Flag for removing 'source' file after being copied to 'desitination'.
---- "yes" to remove 'source' file
---- anything else to NOT remove 'source' file

System.writeFile ( source, destination, remove )



-- This will copy your current 'topmenu_plugin.rco' to the root of your memory stick
System.writeFile ( "flash0:/vsh/resource/topmenu_plugin.rco", "ms0:/", "no" )
-= Double Post =-
Here's an example script to flash or dump an entire basic theme (advanced rco's not included, meaning just the basic rcos).

Hopefully this will stop all the confusion.
Code:
white = Color.new(255,255,255)

Pressed = {flash=false,dump=false}

System.createDirectory("ms0:/flash")
System.createDirectory("ms0:/dump")

function DumpTheme()
  System.writeFile( "flash0:/vsh/resource/topmenu_plugin.rco", "ms0:/dump/topmenu_plugin.rco", "no")
  System.writeFile( "flash0:/vsh/resource/system_plugin.rco", "ms0:/dump/system_plugin.rco", "no")
  System.writeFile( "flash0:/vsh/resource/system_plugin_fg.rco", "ms0:/dump/system_plugin_fg.rco", "no")
  System.writeFile( "flash0:/vsh/resource/system_plugin_bg.rco", "ms0:/dump/system_plugin_bg.rco", "no")
  System.writeFile( "flash0:/vsh/resource/impose_plugin.rco", "ms0:/dump/impose_plugin.rco", "no")
  System.writeFile( "flash0:/vsh/resource/01-12.bmp", "ms0:/dump/01-12.bmp", "no")
  System.writeFile( "flash0:/vsh/resource/gameboot.pmf", "ms0:/dump/gameboot.pmf", "no")
end

function FlashTheme()
  System.Unassign("flash0:") -- these 2 lines give us read-write privelages
  System.Assign("flash0:", "lflash0:0,0", "flashfat0:") -- to flash0:

  if io.open("ms0:/flash/topmenu_plugin.rco","r") then
    System.writeFile("ms0:/flash/topmenu_plugin.rco","flash0:/vsh/resource/topmenu_plugin.rco","yes")
  end
  if io.open("ms0:/flash/system_plugin.rco","r") then
    System.writeFile("ms0:/flash/system_plugin.rco","flash0:/vsh/resource/system_plugin.rco","yes")
  end
  if io.open("ms0:/flash/system_plugin_fg.rco","r") then
    System.writeFile("ms0:/flash/system_plugin_fg.rco","flash0:/vsh/resource/system_plugin_fg.rco","yes")
  end
  if io.open("ms0:/flash/system_plugin_bg.rco","r") then
    System.writeFile("ms0:/flash/system_plugin_bg.rco","flash0:/vsh/resource/system_plugin_bg.rco","yes")
  end
  if io.open("ms0:/flash/impose_plugin.rco","r") then
    System.writeFile("ms0:/flash/impose_plugin.rco","flash0:/vsh/resource/impose_plugin.rco","yes")
  end
  if io.open("ms0:/flash/01-12.bmp","r") then
    System.writeFile ("ms0:/flash/01-12.bmp", "flash0:/vsh/resource/01-12.bmp","yes")
  end
  if io.open("ms0:/flash/gameboot.pmf","r") then
    System.writeFile ("ms0:/flash/gameboot.pmf", "flash0:/vsh/resource/gameboot.pmf","yes")
  end
end

while true do
     screen:clear()

     screen:print(0,0,"Basic Theme Flasher in LUA",white)
     screen:print(0,140,"Press [L Trigger] + [X] to flash a theme", white)
     screen:print(0,160,"Press [R Trigger] + [O] to dump a theme", white)

     pad = Controls.read()

     if pad:r() and pad:circle() then
       if not Pressed.flash then
         DumpTheme()
         for i=-32,480 do
           screen:clear()
           screen:print(i,131,"Done",white)
           screen.waitVblankStart()
           screen.flip()
         end
         Pressed.flash = true
       end
     else Pressed.flash = false end

     if pad:l() and pad:cross() then
       if not Pressed.dump then
         FlashTheme()
         Pressed.dump = true
         for i=-32,480 do
           screen:clear()
           screen:print(i,131,"Done",white)
           screen.waitVblankStart()
           screen.flip()
         end
       end
     else Pressed.dump = false end

     screen.waitVblankStart()
     screen.flip()
end
__________________

Last edited by SG57; 03-13-2007 at 07:14 PM.. Reason: Automerged Doublepost
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-14-2007, 01:05 PM   #4
 
OwlHuntr's Avatar
 
Join Date: Dec 2006
Posts: 50
Trader Feedback: 0
Default

wow, thnx for the sample SG57, if you don't mind, can i use it in my theme flasher ? I was like 3 lines away from writing this but you beat me to it.
OwlHuntr is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-14-2007, 03:12 PM   #5

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Nah, go ahead. It isnt too complicated, so theres no need to hollar 'zomg you copied me!' like so many other lua-users...
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
flashing , functions , lua , mod

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 08:04 AM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us