Thursday, 20 November 2008
 
  Home arrow Forum  
Main Menu
Home
News
Forum
Documentation
Download
Links
Administrator
Login Form
Welcome, Guest. Please login or register.
November 20, 2008, 01:17:46 PM
Username: Password:
Login with username, password and session length

Forgot your password?
If you use DSLua as _BOOT_MP.NDS
DSLua Community
Welcome, Guest. Please login or register.
November 20, 2008, 01:17:46 PM
1723 Posts in 315 Topics by 5678 Members
Latest Member: Kefneunda
DSLua Community  |  DSLua - Best scripting language for Nintendo DS  |  Examples/Tutorials  |  If you use DSLua as _BOOT_MP.NDS « previous next »
Pages: [1]
Author Topic: If you use DSLua as _BOOT_MP.NDS  (Read 1429 times)
Jeremysr
Waxing Gibbous
****
Posts: 254



WWW
« on: October 21, 2006, 09:10:16 PM »

I don't know about other devices but the GBAMP and probably lots of others boot _BOOT_MP.NDS when they start up. If you are using DSLua as your _BOOT_MP.NDS (like when you're developing) and you want to switch it back to something else like your bootloader (moonshell, DSorganize), but you don't have access to a computer, I've created a program that fixes this problem. I made it because this happened to me. I used DSLua as the _BOOT_MP and the next day when I was going on a trip I forgot to switch it back to moonshell and so the whole trip I could only play DSLua games that I had on my CF card. Anyway, here is the program. You rename a program to _BOOT_MP2.NDS on your CF card, it can be any DS program. I would put moonshell as _BOOT_MP2.NDS. Then when DSLua is _BOOT_MP.NDS, this program will overwrite _BOOT_MP.NDS with whatever code is in _BOOT_MP2.NDS. Since this is the Examples/Tutorials forum and no one's written a files tutorial yet I'll comment the lines to explain what they do and you might learn something.

Code:
bootmp2 = io.open( "_BOOT_MP2.NDS", "rb" )          -- gets _BOOT_MP2.NDS ready. "rb" means read (r) in binary (b).
bootmp = io.open( "_BOOT_MP.NDS", "wb" )         -- same as above but the "wb" means the file will be written to in binary.
bootmp2_code = bootmp2:read( "*all" )         -- copies everything inside the _BOOT_MP2.NDS file to a variable called bootmp2_code
bootmp:write( bootmp2_code )          -- overwrites all the code inside bootmp2_code to _BOOT_MP.NDS.
« Last Edit: October 21, 2006, 09:12:18 PM by Jeremysr » Logged
daltonlaffs
Waxing Gibbous
****
Posts: 340


Freaking Insane


WWW
« Reply #1 on: October 23, 2006, 05:43:16 PM »

Nice trick, if I ever get a GBAMP, I'll take a look  Cheesy
Logged

Code:
-- Bored? Read code line below.
-- Bored? Read code line above.



^^ That works, I SWEAR! ^^
Pages: [1]
« previous next »
    Jump to:  



    (C) 2008 DSLua

    DSLua - Best scripting language for Nintendo DS home-brew!