Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user maak ! (Registered 2024-04-18) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Kernal save (again)
2018-10-08 13:00
JackAsser

Registered: Jun 2002
Posts: 1987
Kernal save (again)

After calling JSR $FFD8 to save a file the motor keeps spinning and the file isn't really "finalised". Works fine with Jiffy DOS, but not using the regular Kernal.

When SAVE returns I immediately throw out the kernal again and take over the system. Is there a call I need to make to "shut it down" properly or wait for it to complete the operation? Feels like some kind of race condition to me..
2018-10-08 13:03
chatGPZ

Registered: Dec 2001
Posts: 11100
  $FFE7/65511      Close All Channels And Files


it shouldnt be necessary though, SAVE alone should work
2018-10-08 13:11
JackAsser

Registered: Jun 2002
Posts: 1987
Quote:
  $FFE7/65511      Close All Channels And Files


it shouldnt be necessary though, SAVE alone should work


Exactly. I have no open files or channels... I'll try it still.

I will also add a jmp * after the save and see if the drive settles eventually. If it doesn't I guess my staged kernel environment isn't fully operational.
2018-10-08 13:16
chatGPZ

Registered: Dec 2001
Posts: 11100
wiggling dd00 a bit too much perhaps? :)
2018-10-08 13:18
JackAsser

Registered: Jun 2002
Posts: 1987
Quote: wiggling dd00 a bit too much perhaps? :)

only once every now and then to #$3c. Should be fine I suppose.
2018-10-08 13:39
Krill

Registered: Apr 2002
Posts: 2825
You're not manipulating $DD00 in an IRQ handler while saving, are you?
2018-10-08 13:57
JackAsser

Registered: Jun 2002
Posts: 1987
Quote: You're not manipulating $DD00 in an IRQ handler while saving, are you?

No, but immediatly after save returns I take over and relaunch my IRQ handlers
2018-10-08 13:59
JackAsser

Registered: Jun 2002
Posts: 1987
Prior to save I stop all IRQs (not just SEI but proper disabling all generators) Then swaps in the kernel and reinitialise io and vectors. Then I disable the timers the kernel setsup for cursor and keyscan. Then I call save.
2018-10-08 14:08
JackAsser

Registered: Jun 2002
Posts: 1987
If I do not immediately take over the kernel and instead just busy waits for a while the drive motor will stop properly and the file properly "finalised" with a correct filesize and type. If I don't wait the file will be 0 blocks big and have prg* as type.

And since all IRQ sources are disabled on the C64-side and my busy wait loop just do nothing the only explanation is that the drive must do some stuff by itself after SAVE returns which I disrupts when I take over the kernel and starts manipulating dd00 again or something along those lines.
2018-10-08 14:50
JackAsser

Registered: Jun 2002
Posts: 1987
Narrowing down. :) Totally reproducible from basic.

10 REM STUPID DRIVE

SAVE "TEST",8:POKE 56576,63

This will keep the drive motor on indefinitely.
2018-10-08 14:51
JackAsser

Registered: Jun 2002
Posts: 1987
So, follow up question. When is it safe to touch $dd00?!
 
... 8 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - 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
csio/monarchy c+4
Alakran_64
megasoftargentina
celticdesign/G★P/M..
CA$H/TRiAD
Dymo/G★P
Guests online: 93
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 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 Wafer Demo  (9.5)
7 TRSAC, Gabber & Pebe..  (9.5)
8 Onscreen 5k  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Graphicians
1 Sulevi  (10)
2 Mirage  (9.8)
3 Lobo  (9.7)
4 Mikael  (9.7)
5 Archmage  (9.7)

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