| Project #1 Changing the date stamp in a .mdl file so you can put models in any order you want on the 145MZ's model menu.
Overview: In order to do this you will need a hex editor which has the
capability to also calculate 16 bit Checksum's on a selected amount of
data. Analysis of the .mdl file:
Now you must understand that Hex Workshop displays these
"words" (2 bytes) in Low Byte / High byte format. So if we
look at the first word at offset 168 you see D607. This is the year
BUT the 2 bytes are reversed. The software in the 14mz see
this number as 07D6 which in decimal is 2006. OK so we have our date to change and the offsets are: So if we wanted this model to be higher up in the 14mz model list we could simply change the date to be before other models in the list BUT it aint that easy! The 14mz has two Checksums in the file. A Checksum is a math calculation done on the file. It adds up all the bytes is a data block and creates a Checksum number which is then stored at the end of the data block. If the Checksum is not correct then the 14mz will ignore the mdl file and not even display the model in the list. If you edit any data in the MDL file the Checksum will no longer match. So we must find these Checksums and edit them as well. This is where Hex Workshop helps as you can select a block of data (or the entire file) and have it calculate a Checksum which you can then use to make the mdl file correct again. So where are these Checksums? Well one is at byte offset 184 just after the date and time and is the Checksum for the model name and date and time stamp data block. The other is at the end of the file at byte offset 131068 and is the Checksum for the entire mdl file. This screen shows the model name / date time stamp data block Checksum location.
This screen shows the end of file Checksum location at offset 131068.
So let's now go modify the date and set the Checksums NOTE: I would NOT change the date to some time in the future of what the 14mz's date and time is set to. I have not tested what will happen!!!! So always set the date BACK. First step is to change the date. In this example I am
just going to edit the DAY but you can do this for month or year.
That's it! You just change the date of the mdl file. Now we need to set the Checksums so the mdl file will work.
After clicking the Checksum button you will get this dialog pictured below. Make sure Checksum (16 bit) is selected and SELECTION is selected (see red circles). Click the generate button and the Checksum will be calculated and the dialog will close.
The Checksum will be in the lower right box of Hex Workshop as noted in the picture below with the red circle. Now this double byte (WORD) in High byte low byte format! We need to reverse the 2 bytes when we enter this into the data at offset 184.
So reverse the bytes and enter them in location
184. In this example is was 110A. The Checksum calculation
gave us 0A0F so we reverse the Checksum order and will enter 0F0A into
that location. The screen shot below shows the summary of the
changes we made thus far.
OK last step! We need to calculate and edit the FILE Checksum. At the top of the file (the first byte) we see the value 5400. Click in front of the 5400 so the cursor is blinking in front of the 5400. Now using the window scroller on the left side of Hex Workshop, scroll all the way to the END of the mdl file. At the end of the file again you will see the value 5400 but we want the cursor to be clicked in front of the word just before the 5400. So HOLD DOWN THE SHIFT KEY and click in front of the word prior to the 5400. In this example the value there is F1D1. Once you click the entire data block from the top of the file to the end, excluding the last two words, should now be selected. See screen shot below.
Now click the generate Checksum button just like you did in the previous step and generate the Checksum. Again make sure the generate Checksum dialog has 16 bit and SELECTION is selected and click the generate button. The dialog will close and again the new Checksum will be in the lower right box of Hex Workshop. Again the Checksum is in low byte/high byte format and we must enter this into the Checksum location reversed!! Now click on the 2nd to the last word (in this example value F1D1) and enter the Checksum reversed (in this example the Checksum calculated was D1ED so we enter it as EDD1). The screen shot below shows what we just did in this example. Red Circle #1 was our new calculated Checksum and red circle #2 shows it entered with the 2 bytes reversed.
That's it! Now just go up to the FILE menu of Hex Workshop and save the file. It will ask you if you want to make a back up so say yes if you like. Now copy this file to your CF card and then copy it into your 14mz memory. If the model does not show up on the CF card this means you did not do the Checksum calculations or entries properly!!!! Toss this file and use the backup made by hex workshop and try again. So this completes project #1 Enjoy!
|