dtvwiki

http://pelrun.github.io/dtvwiki

This project is maintained by pelrun

Introduction

Disclaimer

Flashing may transform your lovely DTV in a cool book-ends (especially flashing $000000-$00FFFF) so know what you are doing. Some of the instructions here are not well tested or may be outdated.

Why reflash the DTV?

What means flashing the DTV?

Note that changing BASIC and KERNAL ROM can also be done with the DTV’s Memory Mapper so if you know how to code, reflashing DTV lower memory isn’t necessary really.

Basic steps

  1. Build/get whatever data you want to flash
  2. Get this data as well as the flashing program on the DTV
  3. Reflash the device.

Requirements

Method 1 (using a C64 Drive):

Method 2 (using DTVTrans cable)

Additional requirements for 1541-III(-DTV) or MMC2IEC

Flash new programs

On the DTV, programs are located starting at $010000 (see DTV Flash File System). You can reflash that area without touching $00xxxx which contains KERNAL and BASIC ROMs that are crucial for the DTV’s booting procedure.

When booting, stock KERNAL searches for a file called INTRO, loads this, and jumps to $080d. For a standard DTV, this program displays the C= logo and copyright information, then loads DTVMENU and executes that.

When reflashing, you probably want to exchange the normal INTRO with DTVSlimIntro that immediately displays a menu of files in the flash.

Now, how to build the complete flash image?

Patch kernal

Note that normal users do NOT need to reflash the KERNAL typically. Reflashing $00xxxx can brick your DTV. If you just want to put new games on the DTV, DO NOT flash the KERNAL.

If you want to use some C64 kernal replacement, use DTVSlimIntro to start a softkernal generated by Kernalpatcher. Also see JiffyDOS.

Status of this section

The following needs some rewriting. Probably one of the easiest ways to get a DTV you can code on is flashing DTVBIOS which wasn’t available at the time the guide was written.

Setting up

This section describes hot to make a disk image that contains the required utilities.

Download

In order to flash your DTV ROM you will need some tools, download from Daniel Kahlin’s website :

Configure dtvmon (optional)

The default behavior of DTVMON is to read the user port to determine the video mode. The video mode settings can be hardcoded to the dtvmon; this allows the user port to be used for general I/O without affecting the video output.

The port used in dtvmon’s embedded dtvtrans is joystick port 1 as default. This can be changed to port 2 or user port by modifying the last configuration byte.

The following table is an example of hardcoding the (PAL) video mode to dtvmon_rom.prg. The hexadecimal values “FF FF 03 24 00 00 00 02 FF” are the configuration bytes. See the dtvmon README.txt for the details. TODO: include explanation on the conf. bytes from the README.txt here?

00000000   00 40 25 80  00 00 C4 D4  D6 38 30 2D  20 44 54 56  .@%......80- DTV
00000010   42 4F 4F 54  20 2F 20 54  4C 52 20 2D  01 00 FF FF  BOOT / TLR -....
00000020   03 24 00 00  00 02 FF A2  FF 78 9A D8  42 ED 98 AA  .$.......x..B...

Method 1 : using an IEC Drive

Creating the D64 (Method 1)

Create a D64 image flashutl.d64 that contains:

The program c1541 (included with VICE) can be used to create the image.

c1541
C1541 Version 4.00.
Copyright 1995-2003 The VICE Development Team.
C1541 is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type `show copying' to see the conditions.
There is absolutely no warranty for C1541.  Type `show warranty' for details.
c1541 #8> format flashutils,12 d64 flashutl.d64
L1: flashutl.d64
Unit: 0
Formatting in unit 8...
c1541 #8> write flash-0.9a.prg flash
Writing file `FLASH-0.9A.PRG' as `FLASH' to unit 8.
c1541 #8> write kernalpatcher-0.8.prg kerpatch
Writing file `KERNALPATCHER-0.8.PRG' as `KERPATCH' to unit 8.
c1541 #8> write dtvmon_rom.prg dtvmon
Writing file `DTVMONROM.PRG' as `DTVMON' to unit 8.
c1541 #8> list
L1: flashutl.d64
0 "flashutils      " 12 2a
28    flash             prg 
44    kerpatch          prg 
43    dtvmon            prg 
549 BLOCKS FREE.
c1541 #8> quit

Patching the kernal with x64dtv

NOTE: If you have an IEC device that can write to the disk (or disk image) then this step can be done with the DTV.

Install x64dtv (VICE with DTV support, link) and obtain the DTV FlashROM image file dtvflash.img. Start x64dtv with the command

x64dtv -c64dtvromimage dtvflash.img -8 flashutl.d64 

Hold TAB during the reset sequence to enter BASIC mode.

Saving sector00 with x64dtv

NOTE: If you have an IEC device that can write to the disk (or disk image) then this step can be done with the DTV.

Start x64dtv with the command

x64dtv -c64dtvromimage dtvflash.img -8 flashutl.d64 

Hold TAB during the reset sequence to enter BASIC mode.

Write flashutl.d64 to IEC device media

This step depends on your IEC device.

Method 2 : Using DTVtrans cable

See DTVTrans page for instructions on how to bootstrap using the DTVTrans cable.

Option 1 : Flash an existing flashROM image

Obviously, you will need a working (be sure !) DTV flashROM image dump like

To make a compliant flashROM image you can use tlr flash program (which can dump too).

Option 2 : Patch the kernal and flash it

In this case you will patch the current DTV kernal then reflash the patched version. Currently, tlr’s Kernalpatcher is the tool to use to patch the kernal.

Flashing

This section describes how to flash the patched DTV kernal and (optionally) DTVMON.

Testing

The patched kernal works if everything looks ok after reset.

Flashing the kernal

DANGER MODE ON! If something goes wrong while programming the kernel to flash, DO NOT RESET OR EXIT THE APPLICATION! See If the flashing fails…section.

If the flashing fails…

DO NOT RESET OR EXIT THE APPLICATION!

Verifying

Flashing dtvmon (optional)

The end

The kernal flashing part of this page was first written by Hannu Nuotio (based on information on this forum thread) and with his permission, reused here then edited.