FlashDrv 0.02 06/30/07 >What is it? FlashDrv is a library for assembly programmers (in the form of a Flash application) to do nifty things involving the Flash ROM, such as retrieving the full calculator ID, unlocking Flash, creating apps, programs, and groups directly in the archive, etc. >Which calculators does this work for? All of them! The TI-83 Plus, TI-83 Plus Silver Edition, TI-84 Plus, and TI-84 Plus Silver Edition, all known OS and boot code versions. >Why? Because manipulating the archive is a very, very tricky thing to do and a library of routines should exist which does this sort of thing. >Isn't this illegal? Well, yes, it probably is. :) The most (only?) controversial part is the unlocking Flash part. TI really doesn't want people mucking about with the Flash ROM, which is precisely what this allows. So, I suggest you take this seriously and use it for your personal amusement. I don't care what you do with this, but don't hold me responsible and don't do anything really stupid. >So how do I use this thing? I run it and it just gives me a splash screen. You don't run it, silly, it's a library. Don't ever run it. Other programs you (or others) write use it. If you don't know what any of this means and someone told you to put it on your calculator, then do it and be happy. >So how do I use this thing? (I'm not stupid, tell me the details) Okay, geez, sorry. You need to put a small loader in RAM (similar to usb8x) and then use a macro to make "FCALLs" to the FlashDrv application. The file template.z80 has an example on how to use it. It has a loader (initFlashCall) that you place anywhere in your code. At the beginning of your program/application, call it. Then you can make FCALLs whenever you like. The things you'll want to change are "FlashDriverCall" (to change where in RAM the loader will be held), and if you use something other than TASM, the FCALL macro, which is located in flashdrv.inc. >So which functions work? GetVersion: ;Returns version of FlashDrv. ;Inputs: None ;Outputs: H is major version ; L is minor version UnlockFlash: ;Unlocks Flash protection. ;Inputs: None ;Outputs: Flash is unlocked ; C set if problems ;Destroys: All registers ; tempSwapArea ; Clears the screen and affects penCol/penRow, maybe others. GarbageCollect: ;Force garbage collection of user archive. ;Inputs: None ;Outputs: User archive is restructured and cleaned up ; C set if problems ;Destroys: All registers ; tempSwapArea ;Notes: Does not touch application space DefragmentApps: ;Defragment Flash application space. ;Inputs: None ;Outputs: Flash application space is restructured and cleaned up ; C set if problems ;Destroys: All registers ; asm_ram ;Notes: Does not touch user archive GetFullCalcSerial: ;Gets full calculator serial number. ;Inputs: None ;Outputs: OP4 contains ID (two digits per byte) ; C set if problems WriteVarData: ;Writes variable data directly to user archive. ;Inputs: ADE is destination address ; HL is source address ; BC is number of bytes to write ;Outputs: Bytes written ; C set if problems ;Notes: Only use destination addresses that are output from other calls (I don't remember why I said this, so do it) BHL_plus_DE: ;Adds DE number of bytes to BHL pointer. ;Inputs: BHL is pointer ; DE is number of bytes to increment ;Outputs: BHL is new pointer CreateString: ;Creates string directly in archive. ;Inputs: OP1 is name of variable ; HL is size ;Outputs: BHL points to start of archived data (size bytes) ; C set if problems CreateProgram: ;Creates unprotected program directly in archive. ;Inputs: OP1 is name of variable ; HL is size ;Outputs: BHL points to start of archived data (size bytes) ; C set if problems CreateProtectedProgram: ;Creates protected program directly in archive. ;Inputs: OP1 is name of variable ; HL is size ;Outputs: BHL points to start of archived data (size bytes) ; C set if problems CreatePic: ;Creates picture directly in archive. ;Inputs: OP1 is name of variable ;Outputs: BHL points to start of archived data (size bytes) ; C set if problems CreateGDB: ;Creates graph database directly in archive. ;Inputs: OP1 is name of variable ; HL is size ;Outputs: BHL points to start of archived data (size bytes) ; C set if problems CreateGroup: ;Creates group variable directly in archive. ;Inputs: OP1 is type and name of variable ; HL is full size of variable ;Outputs: BHL points to start of archived data (size bytes) ; C set if problems CreateApplication: ;Creates Flash application. ;Inputs: AHL points to entire variable data (16KB minimum) ;Outputs: Flash application is created ; C set if problems ;Notes: Maximum size for variables is 64KB, so max size of app created by this routine is 4 pages. MarkVarValid: ;Marks a variable valid (so that it will be recovered on next reset). ;Inputs: OP1 contains type and name of variable ;Outputs: Variable is marked valid ;Destroys: All registers ; C set if problems >Why didn't you release the source, you jerk? Because it's so controversial. The purpose of this library is so it does all the scary stuff for you. If I just went around telling even the dumbest people how to unlock Flash, I would certainly be taken out back and shot. So, I'm a coward. >I have a question/comment/complaint and/or I'd like to send you a cease-and-desist letter. Where can I? You can't! HAHAHAHAHAHAHA!!!