c64-dtv hacking - · pdf filewhat is the c64-dtv? handheld tv game with 30 games clone of...

56
C64-DTV Hacking

Upload: vuonghuong

Post on 16-Feb-2018

234 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

C64-DTV Hacking

Page 2: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

About myself

● Hi, I'm Peter● electrical engineering student● Interests

– Electronics– Microcontrollers– Programmable Logic/ FPGAs– Retro computing

● Member of Das Labor

Page 3: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Das Labor

Page 4: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

What is the C64-DTV?

Page 5: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

What is the C64-DTV?

● Handheld TV game with 30 games● Clone of the real C64 in an ASIC● Designed by Jeri Ellsworth● manufactured in China● introduced in Europe in 2005● costs about 25€● presumably out of production by now

Page 6: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Some Specs

● 6502ish CPU● 1MHz CPU clock● 32MHz System clock● 2MB RAM● 2MB Flash● 320x200 dots resolution● 256 colors

Page 7: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Topics

● Hardware modifications● How to transfer Data● Structure of the System / differences to

C64● Flashing the Flash● Adding new Games● Development tools● Some nice casemods● Maybe: watch a demo

Page 8: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Problems

● We don't have a real keyboard● It only runs on batteries● The colors aren't right● It doesn't run our favorite games/demos

Page 9: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Hardware modifications

● We need:– keyboard connector– diskdrive connector– joystick connector

● nice to have:– power supply connector– color fix

● maybe:– SST flash fix

Page 10: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China
Page 11: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Power Supply

● DTV's supply is strange:– switch switches GND– LED is part of discrete 3.3V regulator.

● 2 Options:– Use regulated 5V supply instead of Battery– Replace discrete regulator with integrated

3.3V regulator

Page 12: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Color fix

Info and pictures fromhttp://www.kahlin.net/daniel/dtv/

Page 13: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Broken Colors

Page 14: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Should look like this

Page 15: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Video DAC & mixer

Page 16: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Schematic

Page 17: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Sugested fix

Page 18: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Flash Filesystem

● Directory of files in flash at $010000● Directory entrys consist of

– Filename– Start of file in flash– Load target address

● Files are RLE encoded– filelength is determined by decoding

● Additional $ file for basic directory listing

Page 19: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

How to transfer Data

● By floppy disk● By dtvtrans

Page 20: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Transfer via disk

● Using 1541 or 1581 floppy drive● Connect drive via XA1541 Cable to PC● Connect drive to added conector on DTV● Most games run this way● Tip: To connect PC and DTV to the

diskdrive at the same time:– POKE56576,3 on DTV– modprobe cbm hold_clk=0 on PC

Page 21: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

dtvtrans

● cable– connects PC parport to DTV joyport– consists only of 2 plugs and 5 diodes

● software– special software on dtv & pc– BASIC programm for bootstraping– transfers data from and to DTV RAM– can read the DTVs flash– can now even directly write to FLASH!

Page 22: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Structure

● Most features inherited from C64– 64k Address space– memmory mapped i/o– i/o registers resemble C64– C64 Bankswitching scheme through $00/$01

Page 23: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Structure

● Additional Features added– 2MB RAM and 2MB Flash through additional

bankswitcher– CPU registers remappable– Burst Modes– VIC improved– SID improved– DMA Unit added– Blitter added

Page 24: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

CPU improvements

● Skip internal cycle mode● Burst mode

– can fetch and execute 8 RAM bytes per 1MHz cycle!

Page 25: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

new VIC features

● 256 color mode● Can address full 2MB of RAM● 320x200 @ 256 colors possible!● Video timing programmable● Bad line emulation can be disabled● Borders can be disabled

Page 26: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

SID modifications

● audio filters removed● 8bit sample playback possible● some other features

Page 27: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Memory map of the C64

Page 28: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Memory map of the C64-DTV

Page 29: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Bankswitching

● 15 CPU registers instead of 3 (a, x, y)● new registers mappable to a, x, y

registers by special opcodes● registers 12, 13, 14, 15 select the base

Address for the 4 memmory banks

Page 30: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Official Guide

Provides in depth info on programming the new features:

DTVprogramming.pdf

Page 31: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Known limitations

● No SID filters● Some VIC bugs● No RTC in CIAs● The keyboard matrix can only be read in

one dircetion

Page 32: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Flashing the Flash

● Hardware fix needed for SST Flash● Software:

– flash tool from TLR– dtvtrans +– TULF

Page 33: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

SST Flash fix

Analyzed and fixed by mehttp://www.kahlin.net/daniel/dtv/sstfix.php

Page 34: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Magic sequence to write flash

● $xxxAAA <- $AA● $xxx555 <- $55● $xxxAAA <- $F0● target <- Byte

Page 35: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

DTV's write access to flash

● green is only the triggerpoint● problem occurs at the edge before● that edge is seen twice by flash

Page 36: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Fix: 47pF Capacitor

Page 37: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

TLR's flash utility

● Can dump and write blocks● Can flash new Kernal● no file-level access

Page 38: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

TLR's flash utility

Page 39: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

TLR's flash utility

Page 40: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Patching the Kernal

● Why?– fix bugs– add hook to start bootup programm or soft

Kernal– other features

● How?– use TLR's kernalpatcher– write new kernal using TLR's flash utility

Page 41: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

dtvtrans +

● Is a mod to dtvtrans done by 1570● Can type in the bootstrap programm

using the joystick keyboard● Can sync the DTV's flash to an image on

the PC (takes ca. 8-20 minutes)

Page 42: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

TULF (Tixiv's ULtimate Flasher)

● My work● Can do file level access on flash● Can patch the DTV's game menu● Can load files from disk or via dtvtrans● needs patched dtvtrans version● http://noname.c64.org/csdb/release/?

id=56394

Page 43: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

DTV fixed games repository

● http://symlink.dk/nostalgia/dtv/fixed/● resource for C64 games patched to run

from DTV's flash● games are in dtvmkfs format (special zip

files)● use dtvmkfs or TULF to get them on the

DTV

Page 44: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

dtvmkfs

● Utility from Spaceman Spiff● generates flash filesystem for DTV on PC● takes games in dtvmkfs format as input

Page 45: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

VICEplus emulator

● version of vice that can emulate the C64-DTV

● supports almost all of the DTV's features by now

● great for patching games or developing demos

Page 46: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Coding tools

● acme assembler● dasm assembler● cc65 C-compiler

– TULF is written using it– a little slow

● exomizer cross compressor– can use DTV's burst mode

Page 47: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Diskdrive emulators

● Microcontroller + MMC card emulates diskdrive

● Slow as a 1541● Doesn't work with floppy speeders● Can be integrated in DTV case● Two projects:

– MMC2IEC– 1541-III

Page 48: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Diskdrive emulators

Page 49: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Some nice Casemods

Page 50: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China
Page 51: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China
Page 52: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China
Page 53: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China
Page 54: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China
Page 55: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

I want one, where can I buy it?

● Weltbild – only 14,99€● Conrad Electronic 22,95€● Pearl seems to have only NTSC-DTVs –

don't buy!

Page 56: C64-DTV Hacking -   · PDF fileWhat is the C64-DTV? Handheld TV game with 30 games Clone of the real C64 in an ASIC Designed by Jeri Ellsworth manufactured in China

Some Links

● http://www.powerglitch.com● http://picobay.com/dtv_wiki/● http://www.kahlin.net/daniel/dtv/● http://galaxy22.dyndns.org/dtv/