Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: thepenguin77 on May 05, 2013, 06:58:52 pm

Title: Simple way to backup sources
Post 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:
Code: [Select]
@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:


What this doesn't protect against:


So, while this isn't the most thorough option, it would have prevented me from losing my source.
Title: Re: Simple way to backup sources
Post by: Sorunome on May 05, 2013, 07:40:11 pm
Nice idea, and how did you restore your impossible game files O.O
Title: Re: Simple way to backup sources
Post by: Streetwalrus on May 06, 2013, 11:03:48 am
Nice idea indeed. This could be improved by copying to Dropbox (IIRC it even has version management).
Title: Re: Simple way to backup sources
Post by: thepenguin77 on May 06, 2013, 11:45:31 am
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.