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 > Drive Code C128D N0SD0S Scanner bug.
2007-05-30 15:08
6R6

Registered: Feb 2002
Posts: 244
Drive Code C128D N0SD0S Scanner bug.

Recently Nostalgia released Legacy of the Ancients.
Legacy of the Ancients +8DIR

The program used to scan the IFFL file refuse to
work on a C128D. I got this error report from someone
in USA, so I did a test on my own C128D.

What happens is:
Installer searches for the iffl file,
then it locates track+sector of the iffl file.
At this point this text is displayed on screen.

N0SD0S V1.2

SCANNING

73, CBM DOS V3.0 1571,00,00

Then scanner get installed in the 1571 drive. Scanner now
searches the IFFL file and you can hear the drive is working
as it makes a click for each track it moves to.
But then at the end of scanning everything freezes,
drive is spinning forever and the led is on.

I tried the same game disk on my c64+1541 and it
works fine. I tried not messing with the $1c07 timer.
I tried with and without fastload cartridge on my c128D.
But I get the same bug each time. Some have said i Have a bad VIC chip, but the VSP scroller in the n0s intro works fine for me.

I am not sure if its the C128D or the disk drive that is causing the problem. I wonder if anyone of you can help
me by verifying if it works or not on these setups:

1) C128D.
2) C128D but run the game from a external 1541(II) drive.
3) C128 + 1571
4) C128 + 1541(II)
5) C64 + 1571

Please post your report here.
Also, if you have any other suggestions to what
the problem might be please post here.
Thanks!
2007-05-30 19:09
Mace

Registered: May 2002
Posts: 1799
C128 + 1571   : game loads
C128 + 1541-II: game loads
C128 + 1541   : game loads
C64 + 1571    : game loads (even using Final Cart. 3)

[edit]
I thought my C128D was broken, but the C64 mode still works, so:
C128D + internal: game loads (!!)
C128D + 1541-II : crash *)

*) with internal 1571 on, loading from external 1541-II, the light of the internal drive remains on and the game crashes with EOA logo. The DOS versions on the screen is 1571, while I load from 1541-II. Mind you, there's a device-# conflict...
2007-05-30 19:36
WVL

Registered: Mar 2002
Posts: 886
I'll try this when I get home again. Sounds like the same problem that other loaders also seem to have :(
2007-05-30 23:53
6R6

Registered: Feb 2002
Posts: 244
@mace:
Thanks for testing, so you're saying your c128d + internal 1571 works ?? i'm clueless.. :+\


2007-05-31 05:29
Mace

Registered: May 2002
Posts: 1799
@GRG: yeah, it loads perfectly. I hear music and stuff :)

Have you tested between the two models of C128-D: plastic case & metal case?
I've got a plastic case...

[edit]
Oh, btw, because I forgot to press C= key one time, I found out the C128D also works in C128 mode... it was broken before (black screen)! So thank YOU for that :-)
It doesn't work with tape, though...
2007-05-31 11:16
6R6

Registered: Feb 2002
Posts: 244
My C128D is a plastic case. Joyport #2 doesnt work though..
Could be its broken after all..

Hope someone else with a C128D can give it a try. :)
For a third opinion you know..

GRG
2007-05-31 14:34
WVL

Registered: Mar 2002
Posts: 886
I can give it a try on saturday :) first day I will be home again ;)
2007-05-31 18:43
Steppe

Registered: Jan 2002
Posts: 1510
Hey Glenn,

works fine here on my C128D-CR (metal case) and C128D (plastic case) with the internal drives. If I can be of more help, drop me a line.

/Steppe
2007-05-31 18:48
Trurl

Registered: Mar 2002
Posts: 59
I tested it on my C128D (Scandinavian, plastic case) and it played fine with the internal 1571, both with and without AR6.

I also tried using 1541-II as #9 but it didn't work, I once got it to the EOA logo but usually it jammed saying 'scanning'. This drive sometimes acts a bit funny so it may be due to that.

With a breadbox C64 + 1541-II it worked ok.
2007-05-31 19:58
QuasaR

Registered: Dec 2001
Posts: 145
I had some problems with loader and my C128D (metal case) sometime before, especially when I was playing around with dreamload, which seems to be quite similar to Nosdos, I think. With one of the latest updates of dreamload, even my C128D seems to work... ATM I can't test the game since I was moving houses, but maybe in a few weeks... ;)
2007-06-01 04:49
Fungus

Registered: Sep 2002
Posts: 619
Ok, so there must be something weird with some 128D's and DCR's because it worked perfectly on mine as well.

Very strange!
2007-06-01 17:29
6R6

Registered: Feb 2002
Posts: 244
Thanks for testing i will message you if
I need you to test something (@steppe).

I will just like to point out that my c128d works with
other games, but is having a problem with this one.

The code that is running in the disk drive looks
like this (We're running the same code for 1541
as for 1571) - I am not posting the complete
code.

Scanner is started from "scann_begin", cli
should be set at that point.

;----------- 15xx drive scanner:
sc_fileoffs = $0c ;IFFL File offset
sc_sectCnt = $0d ;IFFL Sector counter
sc_trkCnt = $0e ;IFFL Track counter
sc_trksector = $43 ;Number of sectors per track.
;FDC updates this when entering a new track.
sector_scan = $96
cmptable = $0320
sector_table = $0360
track_table = $0380


* = $0500
ldy #$1f ;clear buffer
lda #0
wed sta cmptable,y
dey
bpl wed
lda #3
sta $31 ;active buffer $0300
s41loop
jsr $f556 ;Sync
sty $30 ;Y = 0, buffer = $0300
jsr get5 ;read 5 bytes
sty $30 ;Y = 5, buffer = $0305
lda $0300
cmp #$52 ;Header block id = $52
bne s41loop ;try again
jsr $f556 ;Sync
jsr get5 ;Y = 0 read 5 bytes to $0305
ldy #0 ;buffer = $0300
sty $30
jsr $f7e8 ;convert gcr
ldx $54
stx $96
lda cmptable,x ;0 = this sector not in table
bne s41loop
dec cmptable,x ;set sector in table
ldy #5 ;gcr pointer
jsr $f7e8 ;convert gcr
ldx $96
lda $53
sta track_table,x ;store track
lda $54
sta sector_table, ;store sector
dec $43 ;Decrease # sectors for track
bne s41loop ;Complete track scanned?
...
code for checking and writing tables here..
...
lda xx
sta $0a
jmp $f418 ;Exit

get5 bvc get5 ;read 5 bytes
clv
lda $1c01
sta ($30),y
iny
cpy #5
bne get5
rts

scann_begin:
lda $024f ;allocate buffer
ora #6
sta $024f
lda #0
sta $0c
sta $0d
sta $0e
lda #$28 ;Timer hi
sta $1c07
lda $19 ;$19+$18 has T+S for file
sta $0b ;Sector
lda $18
sta $0a ;Track
more: lda #$e0 ;Exectute code at $0500->
sta $02
lda $02
bmi *-2
lda $0a
bne more
jmp $c194 ;Exit scanner
;------------- endof 15xx scanner



Now, while the drive side is scanning the iffi file
the C64/C128D side runs this code:
This routine is a waitloop, and it will
not exit until drive code has jumped $c194

lda #0
sta $90
lda Device ;zp lda $ba
jsr Rom_IECTalk
lda #$6F
jsr Rom_IECTalkSecAdr

Loop jsr Rom_IECAcPtr
bit $90
bvc Loop

jsr Rom_IECUnTalk
...

When my C128D bugs the PC is stuck inside that "Loop".
I think one thing is for sure, drive locks itself up.

GRG

2007-06-02 01:07
Ninja

Registered: Jan 2002
Posts: 405
GRG: Do you use ROM for moving the head? If not, have you tried raising the delay value for the movement?
2007-06-02 08:51
TNT
Account closed

Registered: Oct 2004
Posts: 189
ninja: he seems to be using job code $e0.
2007-06-14 01:26
6R6

Registered: Feb 2002
Posts: 244
Hello again,

Yes I'm using jobcode $e0 to move head.

Can you dump your C128D drive roms for me ?

You can use this tool I made:
Drive Memory Dump v1.0

This tool will print dos version number from
the error channel.
Please use that as filename.

Example filename:
"1541 dos v2.6"

Thanks and
Cheers!
Glenn
2007-06-14 05:16
Mace

Registered: May 2002
Posts: 1799
Okikdoki.
2007-07-02 23:44
6R6

Registered: Feb 2002
Posts: 244
( My C128D 1571 drive freaking out on Lota )

I did some more checking, and I found out that
the scanner freaks out somewhere between track 32-33.
If I exit the scanner when reaching track 32 the game
will load and run as it should.

Scanner checks the tracks in this order:
17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1
18,19,20,21,22,23,24,25,26,27,28,29,30,31,32, * freak out *

The lota game has game data in track 18.
(Not in bam t+s 18,00 and dir entry 18,01.)

lda $0a
cmp #32
bne more
jmp $c194 ;Exit scanner

badly aligned drive ? hmm..



Thanks to the ones who has sent me drive roms.
Currently I have:

3 * 1541(-II) roms (all different)
CBM 1541 64'er (73,64'er dos v3 1541,00,00)
CBM 1541 Digidos (73,digi-dos 1.0 1541,00,00)
CBM 1541 Dolphindos 2 (73,dolphindos.2 1541,00,00)
CBM 1541 Jiffydos 5 (73,jiffydos 5.0 1541,00,00)
CBM 1541 Speeddos ++ (73,speeddos ++ 1541,00,00)
CBM 1541 Speeddos 2.7 (73,speeddos 2.7 1541,00,00)
CBM 1541 Prologic System (73,Prologic Classic,00,00)
CBM 1541 Turbo Process System (73,turbo-access r2.8,00,00)
Oceanic 118 (73,cbm dos v2.6 1541,00,00)
Oceanic 118 (73,r-dos 40 tr. 1541,00,00)
3 * C128D 1571 roms (all different)
CBM 1571 (C128DCR) (73,cbm dos v3.1 1571,00,00)
CBM 1571 Jiffydos (C128D) (73,jiffydos 6.0 1571,00,00)
CBM 1581 (73,copyright cbm dos v10 1581,00,00)
CMD FD-2000 (73,cmd fd dos 1.40,00,00)
CMD FD-4000 (73,cmd fd dos 1.40,00,00)
And two versions of CMD HD v1.86 and v1.90, i havent had the time to check them.


These modified 1541 roms wont work with the current
n0sd0s identifier:
CBM 1541 Prologic System (73,Prologic Classic,00,00)
CBM 1541 Turbo Process System (73,turbo-access r2.8,00,00)

Mail me your roms if you have anything else.

Anyone have a CMD HD for sale ?
GRG
2007-07-03 06:26
Krill

Registered: Apr 2002
Posts: 2847
You're not running the thing in 2 MHz, are you?

Because in the 2 MHz mode, you must not use clv:bvc * for the byte sync but instead, poll $180f. The clv:bvc * method freezes once in a while.

But then, 2 MHz are really unnecessary for a scanner. However, they're not for loading.
2007-07-04 01:02
6R6

Registered: Feb 2002
Posts: 244
@krill: My code doesnt use the register for 2mhz mode. But thanks for the info.
2007-07-04 07:50
MagerValp

Registered: Dec 2001
Posts: 1056
I'm leaning towards bad drive alignment, where it gets bad data at track 32 and up. Have you tried modifying the scanner to send over sector checksums one sector at a time?
2007-07-04 10:42
6R6

Registered: Feb 2002
Posts: 244
A friend of mine tested on 2 different C128D's some time ago, he had no troubles...
He also said that running the game on a c128d from an external 1541,1571 and oceanic (device #9) didnt work.
Didnt even show the dos error message (73,cmd dos v2.6 1541,00,00).

A c128d is just troubles.. RR-net doesnt work on it either...


@magervalp:
I will have to try that now.
2007-07-05 01:06
6R6

Registered: Feb 2002
Posts: 244
Quote:
C128 + 1571   : game loads
C128 + 1541-II: game loads
C128 + 1541   : game loads
C64 + 1571    : game loads (even using Final Cart. 3)

[edit]
I thought my C128D was broken, but the C64 mode still works, so:
C128D + internal: game loads (!!)
C128D + 1541-II : crash *)

*) with internal 1571 on, loading from external 1541-II, the light of the internal drive remains on and the game crashes with EOA logo. The DOS versions on the screen is 1571, while I load from 1541-II. Mind you, there's a device-# conflict...


@Mace:
Can you test LOTA with a normal C128 + various drives as device #9 and see if it hangs ?


@others:

Other games with N0sd0s has similar
problems running from device #9 on the C128D.

Tests has give these results:
C128D + 1541-II (device #9) : hangs on scanning
C128D + Oceanice (device #9) : hangs on scanning
C128D + 1581 (device #9) : works

Loading game from C128D disk drive, then switching device number to 9 ( 1541-II ) gets past scanning, then the EOA logo appears and game hangs.

In general there is a problem with using C128D and 1541-II drives on Device #9.

More to follow..



2007-07-05 02:28
Krill

Registered: Apr 2002
Posts: 2847
Yes, C128D is a pain in the ass. I fixed and re-fixed my loader several times for it.
2007-07-05 04:59
Oswald

Registered: Apr 2002
Posts: 5020
krill, your earlier versions all worked fine on my 128dcr.
2007-07-05 06:26
Mace

Registered: May 2002
Posts: 1799
Quote:
@Mace:
Can you test LOTA with a normal C128 + various drives as device #9 and see if it hangs ?

Okidoki, will do so tonight.
2007-07-05 10:52
Trurl

Registered: Mar 2002
Posts: 59
I dug out my flat C128 and tested LOTA with 1541-II. It worked as drive #8 but as #9, #10 and #11 it got to the EOA screen and jammed there.

EDIT: I just tested it with my breadbox+1541-II and it jams just the same as #9.
2007-08-09 00:29
6R6

Registered: Feb 2002
Posts: 244
Hello again.


I have dug my nose into this, and done some checking on the N0sD0s 1.2 bug where we have a 1541-II/1571 drive as device #9 on the serial bus.
The first bug that happens is that the installer
stops at the n0sd0s splash screen where "scanning" is displayed.
This has been partially solved.

The second bug that happens is more interesting:
To explain the bug I have done 5 tests to show
what happens. As for equipment setup I
use a C64 with RR + RRnet, a 1541 as device #8 and
a 1541-II as device #9. (Daisy chain connection)


Test 1: C64 - 1541 (#8) - 1541-II (#9)
--------------------------------------
If I run a N0sd0s game from #9 I only get crap data when loading, sometimes i get bytes that are correct. (Mostly $aa,$a0,$a3.)

Test 2: C64 - 1541 (turned off) - 1541-II (#9)
----------------------------------------------
If I run N0sd0s game from #9 I only get crap data when loading, sometimes i get bytes that are correct. (Mostly $aa,$a0,$a3.)

Test 3: C64 - 1541 (turned off) - 1541-II (#8)
----------------------------------------------
If I run a N0sd0s game from the 1541-II drive, with dip switches set to device #8, it works fine.

Test 4: C64 - 1541-II (#9)
---------------------------
In this test i removed the 1541 drive, and connected the
C64 directly to the 1541-II as device #9.
And it doesnt work, i get a lot of crap data.

But if I turn the dip switches to device #8 it works fine
again.

Test 5: C64 - 1541 (#8) - 1581 (#9) - CMD FD 4000 (#10)
-------------------------------------------------------
In this test I have all devices turned on.
The game works fine from any of the devices.


I don't understand why this happens.
What happens in the 1541-II drive when I flip the dip switches to device position #9 ?
(I also tried setting the 1541-II to #10 and #11 and it gave the same error.)
Does the dip switching corrupt the $1800 registers when I use $dd02.
Because I am using $dd02 in the code.

The C64 side of the handshake uses $dd02 to toggle the bits in $dd00 when sending
bytes to the disk drive. The get byte routine doesnt use $dd02 registers.
I'm suspecting it has to do with $dd02.


Our old n0sd0s 1.0 works fine:
Conan +3D
Check that game from any device number.
C64 code here only uses $dd00.

Maybe Doc Bacardi, Ninja, Krill, Graham, Lasse, HCL, or some other skilled
drive coder can give me a explanation for this behaviour ?
Thanks :)
2007-08-09 05:27
TNT
Account closed

Registered: Oct 2004
Posts: 189
Device number setting changes bits 5 & 6 at $1800. If the loader assumes they are both zero (as thay are with device #8) then it will fail with other device numbers.
2007-08-09 06:47
6R6

Registered: Feb 2002
Posts: 244
Oh shit! I have forgotten to check that.

2007-08-09 17:24
6R6

Registered: Feb 2002
Posts: 244
Ah, excellent. Now it works from device #9 again.
Thanks TNT! :)
I didnt think about the device number was hard wired to the $1800 register.
2007-08-10 11:48
TNT
Account closed

Registered: Oct 2004
Posts: 189
An additional note: if you need to do some runtime modifications to the drive transfer code depending on device number, it's better to do it in drive using the value from $1800 instead of drive number. That way the loader will work even if drive number was changed with "m-w".
2007-09-12 07:03
6R6

Registered: Feb 2002
Posts: 244
All bugs found and fixed. Thanks to all for help. :)

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
Guests online: 129
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Fullscreen Graphicians
1 Carrion  (9.8)
2 Joe  (9.8)
3 Duce  (9.8)
4 Mirage  (9.7)
5 Facet  (9.7)

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