Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > DTV programming
2007-05-06 15:47
Oswald

Registered: Apr 2002
Posts: 5094
DTV programming

ok, are there any docs / tuts whatever except Jeri's frighteningly cryptic text? Someone can tell Jeri to atleast debug her docs ? (for example: it claims the dtv vic can read 4 bytes while displaying 8 pixels. hows 8bpp mode done then?)

how about collecting them on cswiki (if any)?

I have checked a dtv forum but its mainly about soldering, how can ppl be happy with their modded dtvs, when there's nothing to show off the HW capabilities? :P

Yesterday I was wondering about making a demo for the DTV, but the lack of information scared me away. On what I understand it should be possible to speed up ANY effetct ATLEAST by a 3.3x, but with clever coding one can take it to way much more.. and I havent yet taking into account the DMA& the Blitter... :P

anyone?
2007-05-06 16:59
Scout

Registered: Dec 2002
Posts: 1570
tlr posted some of his dtv sources here at csdb.
You might take a look at that.

As for setting up a 256 color 8bpp screen and doing dma memory transfers i can give you some help too.
Another nifty thing of the DTV is the segment mapper; this makes able to map high memory to access it as normal memory.
Take a look at this doc for that: http://picobay.com/dtv_wiki/images/2/28/Segmapper_1c.pdf

I agree about that dtv forum. Too much modding, not much coding.
I can count the total amount of DTV democoders on 1 hand over there ;(

Let's change that =)
2007-05-06 17:07
tlr

Registered: Sep 2003
Posts: 1790
So you have a DTV now Oswald?
I'm looking forward to seeing some new stuff on it! :)

There is a wiki at http://picobay.com/dtv_wiki/ but it doesn't contain much about hardware details.
There is some info at the DTV hacking forums and forum64.de.

I'm afraid it's not fully documented. There are effects left to discover. :)
You'll just have to find out how it works by experimenting.

EDIT: @scout: Fast reply! :)
2007-05-06 17:09
Oswald

Registered: Apr 2002
Posts: 5094
I have one since it was sold in hungary, but somehow was even too lazy to make the most basic hacks so far :)
2007-05-06 20:29
Shadow
Account closed

Registered: Apr 2002
Posts: 355
Great to see more people interested in the DTV. I just released my first (very simple) demo for it. I didn't even scratch the surface but I can tell the potential of that hardware is huge!
2007-05-06 20:44
tlr

Registered: Sep 2003
Posts: 1790
Quote: I have one since it was sold in hungary, but somehow was even too lazy to make the most basic hacks so far :)

I guess you'll want keyboard + IEC at least. Those are very easy to add.
You probably want the color fix aswell which is a bit fiddly.
2007-05-06 22:42
Shadow
Account closed

Registered: Apr 2002
Posts: 355
Yeah, colorfix is a must. It's not easy to do, but without it the 256 color modes are almost worthless.
2007-05-07 05:05
Oswald

Registered: Apr 2002
Posts: 5094
ok there's an awesome doc about the segment registers and virtual registers, (tho going into too much details at straightforward issues and skipping important ones) out there but I have a few questions.

what is the meaning at the SAC opcode of setting the virtual registers as source / destination ? LDA #$00 sets the destination virtual reg, and STA #$00 does write value of the source virtual reg?

how about the reserved registers? is it possible to use them or are they implementing internal registers such as program counter lo / hi, stack pointer, status reg ?

when it comes to segmenting there's one bit (most significant?) whose role is undescribed.

what does the 2 bit / segment do when I set it to rom/ram mode? does $01 does work the old way when it comes to ram/rom settings?

so much for now.

edit: wow this is wonderful, you can read at vich cpu cycle you are on a given line, and set the cycle where an irq is triggered :D
2007-05-07 09:02
Scout

Registered: Dec 2002
Posts: 1570
Quote:
what is the meaning at the SAC opcode of setting the virtual registers as source / destination ? LDA #$00 sets the destination virtual reg, and STA #$00 does write value of the source virtual reg?


I'm not sure what happens if you set SAC #$DE (source=$4000, destination=$8000) but doing a LDA *right* after a SAC actually performs the segment mapping.

LDA #$40

SAC #$DD ; Set accumulator mapping @ $4000
LDA #$04 ; Set highmem segment to $100000 (%xx0[b]00001 00[/b]000000 00000000)

LDA #$12
STA $4000 ; Writing in high memory now

SAC #$00 ; Accumulator is 'normal' again; filled with #$40


Tlr, Streetuff? Am I right about this?
2007-05-07 09:11
Oswald

Registered: Apr 2002
Posts: 5094
scout, and what does SAC #$10 or SAC #$01 do ? you seem to be mixing things up as SAC itself does not change any segmenting itself only changing the ACC register mappings afaik.
2007-05-07 09:20
Scout

Registered: Dec 2002
Posts: 1570
Quote:
scout, and what does SAC #$10 or SAC #$01 do ?


I don't know. That is something I want to test myself too.
Keep you posted about that (or maybe the other dtv coders beat me to it ;)

Quote:

you seem to be mixing things up as SAC itself does not change any segmenting itself only changing the ACC register mappings afaik.


No, i am not mixing up things.
You must see the SAC and the following LDA as a pair.
First you set up the accumulator mapping (SAC) and after that the segment mapping using a LDA.
2007-05-07 10:23
Oswald

Registered: Apr 2002
Posts: 5094
then what does this mean?

"I'm not sure what happens if you set SAC #$DE (source=$4000, destination=$8000)"

how does SAC #$de set source to $4000 and dest to $8000 ? atleast thats how I can interpret your sentence:)
2007-05-07 10:54
Scout

Registered: Dec 2002
Posts: 1570
Quote: then what does this mean?

"I'm not sure what happens if you set SAC #$DE (source=$4000, destination=$8000)"

how does SAC #$de set source to $4000 and dest to $8000 ? atleast thats how I can interpret your sentence:)


If you read about the SAC instruction in the segment mapper doc you can read "the high nibble is the destination, the low nibble is the source. For general use, set both to the same register".
SAC #$DD (or SAC #$AA etc...) is general use but SAC #$DC, for instance, isn't.
I have no clue what happens then because I haven't explored that yet.

For understanding which value to use as the nibbles (for setting the bank addresses) you have to look at the segment mapper doc:



Quote:
I'm not sure what happens if you set SAC #$DE (source=$4000, destination=$8000)

This is incorrect btw. It should be destination = $4000 and the source = $8000 in the example using SAC #$DE.
My bad.

Anyway, I hope you understand now where those values for the SAC opcode come from.
2007-05-07 11:33
Oswald

Registered: Apr 2002
Posts: 5094
I knew that, but what the heck does it mean when the ACC uses reg X as SRC and reg Y as dst :D fuck the dtv forums I have to wait for admin approval of my reg before I can post anything..
2007-05-07 15:32
tlr

Registered: Sep 2003
Posts: 1790
Quote: I knew that, but what the heck does it mean when the ACC uses reg X as SRC and reg Y as dst :D fuck the dtv forums I have to wait for admin approval of my reg before I can post anything..

LDA #$00
LDX #$01
LDY #$02
SAC #$12    ; Reading from Acc gives reg 1 (=Y), writing to Acc changes reg 2 (=X)
PHA         ; Read from Acc and push to stack
PLA         ; pop from stack and write to Acc.
SAC #$00    ; Restore normal mapping (Acc is Acc for both read and write)

results in Acc=$00, X=$01, Y=$01... confused yet? :)
2007-05-07 15:47
Oswald

Registered: Apr 2002
Posts: 5094
ok so does what I thought?

SAC #$01
lda #$ff ; put $ff into reg 1
sta $ff ; put reg 0 into $ff ?

also what does the reserved regs do ? its so sad there are no free regs to use. :( different src and dst reg doesnt looks to make much sense.
2007-05-07 15:54
tlr

Registered: Sep 2003
Posts: 1790
Quote:
what is the meaning at the SAC opcode of setting the virtual registers as source / destination ? LDA #$00 sets the destination virtual reg, and STA #$00 does write value of the source virtual reg?

Correct.
Quote:
how about the reserved registers? is it possible to use them or are they implementing internal registers such as program counter lo / hi, stack pointer, status reg ?

Writing the reserved registers seem to lock up the DTV. Maybe they do something useful? ;)
Quote:
what does the 2 bit / segment do when I set it to rom/ram mode? does $01 does work the old way when it comes to ram/rom settings?

Ah, this is pretty weird...
The $01 mapping is only applied over the lowest 64Kb of the 22-bit RAM address space (only 2 Mb in the DTV though).
This means that for example I/O and kernal is only present in segment #$02.
If you don't have segment #$02 mapped in somewhere, you can't access I/O or kernal regardless of $01.

You can have segment #$02 mapped in via any of the segment registers so you can get I/O at $1000, $5000, $9000 and $d000, even at several of those simultaneously (!).

If you map in ROM you will only see the flash in that segment, regardless of $01.
2007-05-07 16:00
Oswald

Registered: Apr 2002
Posts: 5094
thanx, finally things starts make to sense :) so the virtual registers are unusable to have much effect on code performance, as there is only 3 to use as real registers :(. IRQ handler writing also becames a nightmare, as you have no idea what mapped to what, well storing and restoring the mappings might help, but actually you cannot READ what the mapping was o_O
2007-05-07 16:01
tlr

Registered: Sep 2003
Posts: 1790
Quote: Quote:
what is the meaning at the SAC opcode of setting the virtual registers as source / destination ? LDA #$00 sets the destination virtual reg, and STA #$00 does write value of the source virtual reg?


I'm not sure what happens if you set SAC #$DE (source=$4000, destination=$8000) but doing a LDA *right* after a SAC actually performs the segment mapping.

LDA #$40

SAC #$DD ; Set accumulator mapping @ $4000
LDA #$04 ; Set highmem segment to $100000 (%xx0[b]00001 00[/b]000000 00000000)

LDA #$12
STA $4000 ; Writing in high memory now

SAC #$00 ; Accumulator is 'normal' again; filled with #$40


Tlr, Streetuff? Am I right about this?


Nope, reg D always sets the mapping of $4000, not just the following instruction.
The LDA #$12 will also end up in reg D overriding the LDA #$04.
This sets the mapping to $048000 instead of $010000.
2007-05-07 16:05
tlr

Registered: Sep 2003
Posts: 1790
Quote: thanx, finally things starts make to sense :) so the virtual registers are unusable to have much effect on code performance, as there is only 3 to use as real registers :(. IRQ handler writing also becames a nightmare, as you have no idea what mapped to what, well storing and restoring the mappings might help, but actually you cannot READ what the mapping was o_O

You can probably make use of the Accumulator source/dest mapping for something cool.
Also, if you don't use stack inside a code segment you can use reg 11 freely.
If you don't use zp you can use reg 10.
You can even use the segment register for a bank you don't use in that routine.

I agree about IRQ handlers. It will be tricky to run code with remapped registers that you want to be interrupted.
2007-05-07 16:11
Oswald

Registered: Apr 2002
Posts: 5094
more questions:

does the dma/blitter/dtv vic steal cycles from the emulated cpu when everything is set into 'native' mode? there's a bit to turn off bad line cycle stealing, how about the sprites ?
2007-05-07 16:26
tlr

Registered: Sep 2003
Posts: 1790
native? I assume you mean burst + skip internal cycle.
I haven't checked stealing in burst + skip. I'm pretty sure the blitter steals. DMA might not steal.
In skip internal cycle I don't think blitter or DMA steals anything.
I'm not sure about sprites (yet).

You really need to mod you DTV so you can try some stuff out. :)
2007-05-07 16:29
Oswald

Registered: Apr 2002
Posts: 5094
well I'd rather use the new feats, than explore them ;) btw the zp remapping is awesome, one can turn all acesses in any routine into zp stuff easily:D

the blitter is quite primitive, looks like the DMA design reused with the possiblity to logically combine 2 DMA channels... altho the a+b, a-b modes are pretty hot for calculating stuff, 8bpp sine plasmas anyone? :)
2007-05-07 16:56
tlr

Registered: Sep 2003
Posts: 1790
Quote:
well I'd rather use the new feats, than explore them ;)

Sure, but this thing hasn't been fully reversed like the c64 has. You will be limited by what's in the docs, and there are many errors in it...
Quote:
btw the zp remapping is awesome, one can turn all acesses in any routine into zp stuff easily:D

Yupp!
Quote:
the blitter is quite primitive, looks like the DMA design reused with the possiblity to logically combine 2 DMA channels... altho the a+b, a-b modes are pretty hot for calculating stuff, 8bpp sine plasmas anyone? :)

Yes it's primitive, but it is quite fast also. It reads four bytes per 1 MHz cycle (but writes only 1).
I use the a+b (or was it a-b) in the blitter scroll.

Note that there is an awful bug with transparency on earlier DTVs though. The blitter scroll does not work correctly on those for example. I think it can be worked around by wasting a number of dummy reads per blit.
2007-05-07 17:18
Oswald

Registered: Apr 2002
Posts: 5094
I have a pal dtv, is this fixed only in the hummer iirc ?
2007-05-07 18:23
tlr

Registered: Sep 2003
Posts: 1790
Quote: I have a pal dtv, is this fixed only in the hummer iirc ?

It was fixed halfway through the DTV PAL run. As far as my research goes the switch was made during batch 050927. This is stamped at the bottom of your stick. See here.
The versions are dubbed DTV2 and DTV3 respectively.
PAL DTVs are either DTV2 or DTV3. Hummer-games are always DTV3s.
I have a DTV3 (PAL DTV) myself, batch 051005.

At the time I made the blitter scroll demo no one knew how many units very affected.
If I code something now I definately try to be compatible with both versions.
2007-08-12 19:52
1570
Account closed

Registered: Jul 2007
Posts: 7
Quote: ok, are there any docs / tuts whatever except Jeri's frighteningly cryptic text? Someone can tell Jeri to atleast debug her docs ? (for example: it claims the dtv vic can read 4 bytes while displaying 8 pixels. hows 8bpp mode done then?)

how about collecting them on cswiki (if any)?

I have checked a dtv forum but its mainly about soldering, how can ppl be happy with their modded dtvs, when there's nothing to show off the HW capabilities? :P

Yesterday I was wondering about making a demo for the DTV, but the lack of information scared me away. On what I understand it should be possible to speed up ANY effetct ATLEAST by a 3.3x, but with clever coding one can take it to way much more.. and I havent yet taking into account the DMA& the Blitter... :P

anyone?


The DTV Programming Guide is now available in the DTV Hacking wiki, see http://picobay.com/dtv_wiki/index.php?title=DTV_Programming . If you find bugs please fix them :-).

Concerning analysis of the DTV, quite a lot of work has been done in the course of adding DTV emulation in VICE (see http://viceplus.sf.net/ ) so looking at its code might also be interesting.
2015-11-07 00:29
Pixman
Account closed

Registered: Dec 2001
Posts: 42
The DTV programming guide is down.

I still didn't find any overview over the registers or other stuff.

Does anybody still have the guide?

I'd be glad. Send me a PM please and post a link :)
2015-11-07 08:01
tlr

Registered: Sep 2003
Posts: 1790
There's still some here:
http://dtvhacking.cbm8bit.com/common/tech/index.html

I probably have some stuff lying around as well.
2015-11-07 13:57
Peiselulli

Registered: Oct 2006
Posts: 81
Try wayback copy of the website:

http://web.archive.org/web/20130414141033/http://picobay.com/dt..
2015-11-07 20:46
Oswald

Registered: Apr 2002
Posts: 5094
someone who is not as lazy up it to codebase64. thanks.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Magic/Nah-Kolor
csabanw
psych
JackAsser/Booze Design
bepp/ΤRIΛD
Guests online: 126
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Webmasters
1 Slaygon  (9.6)
2 Perff  (9.6)
3 Sabbi  (9.5)
4 Morpheus  (9.4)
5 CreaMD  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.072 sec.