Omnimaga
Calculator Community => TI Calculators => ASM => Topic started by: thepenguin77 on May 05, 2013, 06:58:52 pm
-
A long time ago, I accidentally deleted the source to my Impossible Game with a batch file. Since I did it with a batch file, it didn't go to the recycle bin and was gone forever.
This is a backup technique that would have prevented that from happening. This won't protect you from hard drive crashes and the like, but it's so simple that you really have no reason not to do it.
Step 1:
Make a folder somewhere far away from your sources folder
My sources are C:\Asm\Sources so I made C:\Backups (a different drive would have been better, but oh well)
Step 2:
Edit your asm.bat (or whatever you use) to include this line to copy whatever source you are compiling into that folder
Mine looks like this:
@echo off
copy c:\asm\source\%1.z80 %1.z80 > nul
copy %1.z80 c:\backups\%1.z80 > nul -- this is the new line
spasm %1.z80 c:\asm\exec\%1.8xp
del %1.z80 > nul
time /T -- displays the current time, also a good idea
Done!
What this protects against:
- Deleting a source file
- Weird .bat file mistakes
- Deleting your source folder (!)
- Saving over your source file (as long as you don't assembling the new one)
What this doesn't protect against:
- Deleting everything in the file, saving, assembling
- Hard drive crashes
- Losing your computer
So, while this isn't the most thorough option, it would have prevented me from losing my source.
-
Nice idea, and how did you restore your impossible game files O.O
-
Nice idea indeed. This could be improved by copying to Dropbox (IIRC it even has version management).
-
Nice idea, and how did you restore your impossible game files O.O
I disassembled it with IDA almost immediately. Since I had just written it, I was able to get all of my labels and variable names back to what they were originally, but the formatting of the whole thing was a mess. About a year later I wrote a program to remove all of the stupid comments and put it back in the format that I write programs in.