Daniel Kahlin: Software/C64DTV Friday, 29 March 2024, 10:51 (Stockholm)
 

Back to C64DTV Stuff

C64DTV Flash

The C64 DTV V2 contains a 2Mbyte Atmel AT47BV161T flash memory which contains all of its software. This flash memory can be selectively erased and written with new data.


A close up shot of the flash memory in my C64DTV PAL

Click for a larger view.

The Original ROM image

This information is valid for a DTV V2, batch "051005", flash image "2005 06 07 03:21:11" (stated at the bottom of the directory listing).
The CRC as given by the "DTVTEST5" program is 15393EC2.

$000000-$000fffUnused?
$001000-$001fffCharset ROM (identical to the original 901225-01 ROM)
$002000-$008fffUnused?
$009000-$009fffCharset ROM (identical to the other versions)
$00a000-$00bfffBASIC ROM (identical to the original 901226-01 ROM)
$00c000-$00cfffUnused?
$00d000-$00dfffCharset ROM (identical to the other versions)
$00e000-$00ffffKERNAL ROM (patched version of the original 901227-03 ROM)
$010000-$013fffDirectory
$014000-$1cffffFiles
$1d0000-$1fffffUnused
Commented Kernal Disassembly
dtv2_kernal.txt - Disassembly including description of file and directory format.

(for the Hummer-game hummer_kernal.txt)

Kernal File-format

Jim Brain describes the format in this post to the DTV-hacking board (original post). (This information is for the V1, Roland Tögel pointed out that it is different on the V2).
For the V1 it is run length encoded in a way similar to how graphics data is packed in Electronic Arts IFF ILBM format for the Amiga.
For the V2 it is a limited form of equal sequences.

Software


crc
ROM image CRC utility: crc-0.1.c (calculates the ROM checksum as done in the DTVTEST5 program)

dtvpack
C64 DTV flash file encoder/decoder: dtvpack-0.3.c (Encodes (or decodes) the packed format used in the C64 DTV V2 flash file system)
(precompiled win32: dtvpack-0.3.exe)

flash

Below is my flashing utility...

features

  • Program (arbitrary) range from buffer
  • Dump range from flash to buffer
  • Verify range against buffer
  • Erase (arbitrary) range
  • Check if range is empty
  • Program sector from buffer
  • Program single byte
  • Dump sector from flash to buffer
  • Verify sector against buffer
  • Erase sector
  • Check if sector is empty
  • Lock down sector (only on Atmel Flashes)
  • Dump complete flash status info including all sector lockdowns
  • Load data from disk to buffer
  • Save data to disk from buffer
  • Runs with roms disabled
  • Function to display a map of flash usage
  • Supports several flash types, e.g AT47BV161T, AT49BV163A, SST39VF1681, etc...
  • Fully supports the SST39VF1681 provided you have this simple hardware fix.
  • Full source code included.
Known bugs
  • Nojoopa found a bug with flashing $000000-$010000 on AT49BV163A chips (bottom bootblock).
    The problem is that the sector doesn't get erased before flashing resulting in exactly one corrupted byte. (the first one that differs)
    For a discussion see: this thread
    A fixed version by nojoopa and 1570 is: here
  • There is only limited sanity checking of the values entered for range. If you enter them wrong, it is often best to do Esc/Pause-Break, and then SYS 2069 to reenter the program.
    For program range and erase range, simply answering N is sufficient.

flash-1.0.zip (2007-09-10)

(previous versions: flash-1.0pre1.prg, flash-0.9a.zip, flash-0.9.zip, flash-20060106.prg, flash-20051228.prg, flash-20051221.prg)

Note: Erasing/reprogramming sector 00 is a very dangerous operation! You may very easily make the DTV unbootable this way!

Note: This utility is fully capable of wiping the entire flash at your command, making your C64 DTV permanently unbootable!
Make sure you really know what you are doing!
Use at your own risk!

Reporting back

I'm very interested in reports of success (or failure).
Please include the batch number as printed on the bottom of your unit with reports.
If you have the possibility of looking inside, please send the markings of the flash chip aswell.




kernalpatcher

features

  • Create patched kernal (which can be flashed using the flash utility)
    (patches: reverse function of the CTRL-key during reset, repair flash load routine, check for hook at $01f8000 in flash, improved flash directory support for future file write, optional hardcoded video timings, optional soft kernal)
  • Save kernal to disk
  • Load custom kernal
  • Install custom kernal in RAM at $01e000-$01ffff and activate
  • Install optional hook at $018000 to activate custom kernal in RAM with Left Button + Reset
  • Built-in help text.
  • Includes pre-patched kernals.
limitations
  • The ram test hook only works with the original DTV V2 (or compatible) kernal in flash.
  • A modified palette is not setup straight after reset. It is setup at the first call to $ff81/$ff5b though, so the impact is minimal.
    This can be noticed when having no dtvboot installed, going directly to basic using <ctrl>. Pressing Esc/Pause-Break sets up the colors.

kernalpatcher-1.0.zip

(previous versions: kernalpatcher-0.8.prg, kernalpatcher-20060108.prg)




dirscan

features

  • Display detailed directory of files in flash.
  • Address range used after load for each file is determined by quickly scanning the compressed file.
  • Address range used in flash is determined in the same scan.
  • Displays file sizes in equivalent disk blocks.

dirscan-1.0.prg




 

[kahlin.net]