Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user eightbitswide ! (Registered 2024-12-24) 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:33
Krill

Registered: Apr 2002
Posts: 2980
No, i have already implemented a watchdog routine (using a timer irq) in the drive code, so any loop waiting for the c64 will be terminated and the drive reset if it just takes too long.
And it might be overkill for a demo, but i will make this loader more and more a loader suitable for games, as well.
2006-12-15 08:50
Krill

Registered: Apr 2002
Posts: 2980
Oh, and i also got rid of this stupid 2 first chars filename matching, now you can load files using their full names (1-16 chars) while still using the dir buffer, so it does still not need to be read and parsed on every load. A 16-bit hash value matching does the trick here. :)
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?
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
MWR/Visdom
CreaMD/React
Courage
CA$H/TRiAD
iceout/Avatar/HF
Guests online: 109
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 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 X-Mas Demo 2024  (9.5)
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 Censor Design  (9.3)
5 Triad  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.7)
2 Fungus  (9.3)
3 Black Beard  (9.2)
4 Baracuda  (9.2)
5 hedning  (9.1)

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