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 > 2 bit irq loader
2006-06-21 22:11
MRT
Account closed

Registered: Sep 2005
Posts: 149
2 bit irq loader

Hmm, just a question...

Is there a 2 bit irq loader, which doesn't require blocking other interrupts while loading a byte?

i.o.w. Is there a realy fast irq loader which doesn't block any interrupts and let me use my beloved sprites? :-)
 
... 42 posts hidden. Click here to view all posts....
 
2006-12-15 08:51
Oswald

Registered: Apr 2002
Posts: 5094
nice:)
2006-12-15 13:28
Ninja

Registered: Jan 2002
Posts: 411
Can you still use the 2Mhz-mode on faster drives then? When we tried a similar idea back then, we couldn't figure how to make a fast enough loop-routine for the good old 1541 :(
2006-12-15 14:55
Krill

Registered: Apr 2002
Posts: 2980
Oh, haven't tried that yet, but i can always clock down the drive-side sending routines to 1 mhz which should not matter much since the c64 is clocked at 1 mhz anyways.
2006-12-15 16:13
Ninja

Registered: Jan 2002
Posts: 411
Our experiments showed that it does help significantly if the drive runs at 2Mhz and can f.e. react faster to the handshaking. For the benefit of that, we let down the multiple-drive-thingie. Well, after all, it's a choice of design :)
2006-12-15 18:37
Krill

Registered: Apr 2002
Posts: 2980
Yes it is. But since the 1541 is the least common denominator, all other drive types don't really have to be faster, at least for demos. And i'd always prefer more compatibility over more speed. :)
2006-12-15 18:37
Krill

Registered: Apr 2002
Posts: 2980
And if in doubt, you can still make it optional. :)
2006-12-18 14:51
MRT
Account closed

Registered: Sep 2005
Posts: 149
Quote: Why don't you just check it yourself? Doesn't take long to code, really. :)

Ok, well I've coded something myself but it doesn't clear-up things. :-D

check out the code snipplets:
drive-code
        ;set lines to low
        lda $1800
        and #%11110000
        sta $1800
        
        ;wait for both lines high
        lda #%00000101
        and $1800
        cmp #%00000101
        bne *-7

c64 code
        ;wait for both lines low
        lda #%11000000
        bit $dd00
        bne *-3
        
        ;set both lines high
        lda $dd00
        and #%00001111
        ora #%00110000
        sta $dd00


The drive-code should set both lines (clock+data) to low and then wait for lines to go high.
The C64 code should wait for the lines to go low, and then set the lines high.

In both the drive and the c64 the interrupts are disabled by the sei command.

Now what happens is... nothing :-D
The drive sets the lines to low and waits until the lines go high again.
The C64 keeps waiting for the lines to go low.
And when I look at VIA1 ($1800) in the drive, I see that the drive actually set the lines to low, but the CIA2 register ($dd00) in the C64 still shows the lines as high. :-S

Any of you drive gurus got any idea on what I'm doing wrong?
2006-12-18 16:03
MRT
Account closed

Registered: Sep 2005
Posts: 149
K, I've got a message from Dahl, telling me that the bits get inverted. So I checked a little, and found the following table...
     |DC|DC|DC|DC| 
-----+--+--+--+--+
$1800|11|01|10|00|
-----+--+--+--+--+
$dd00|00|01|10|00|
-----+--+--+--+--+

In other words, only when setting both lines to low or high, they get inverted. But when one sets only 1 line high or low, the lines won't get inverted.

Is this correct?
2006-12-18 20:54
MagerValp

Registered: Dec 2001
Posts: 1078
Quote: K, I've got a message from Dahl, telling me that the bits get inverted. So I checked a little, and found the following table...
     |DC|DC|DC|DC| 
-----+--+--+--+--+
$1800|11|01|10|00|
-----+--+--+--+--+
$dd00|00|01|10|00|
-----+--+--+--+--+

In other words, only when setting both lines to low or high, they get inverted. But when one sets only 1 line high or low, the lines won't get inverted.

Is this correct?


No. They are always inverted. Have you setup $dd02 correctly?

Also, you can use BIT $1800 when waiting, for less jitter.
2006-12-18 21:20
MRT
Account closed

Registered: Sep 2005
Posts: 149
Hmm, didn't set the data direction registers coz I thought the default setting should be good. The both out-lines are enabled on both sides by default. But, I forgot to check if they were still correct when I made the table above... :-S

I'll check it again. :-)

bout that bit $1800...
You cannot use it when you want to check if both lines are high, can you? Then you check if at least one of the two lines (or both) is high.
Previous - 1 | 2 | 3 | 4 | 5 | 6 - Next
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
WVL/Xenon
algorithm
Acidchild/Padua
MCM/ONSLAUGHT
DnP
wil
v3nt0r/ibex-crew
Guests online: 121
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (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 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.7)
4 Acidchild  (9.7)
5 Cash  (9.6)

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