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


Forums > C64 Coding > File Write During A Demo
2018-09-16 23:29
Raistlin

Registered: Mar 2007
Posts: 110
File Write During A Demo

So, I want to be able to write a small file out in the middle of my demo ... ideally without interrupting the IRQ music and other stuff that's playing.

When I try to do that, though, the file ends up corrupt.

Is there a good way to do this..?

I'm of course using the Kernal functions FFBA, FFBD, FFD8. And then FFD5 to try to load back.

Loading seems fine - but saving is corrupt..

If all else fails I guess i need to fade the music down and pause interrupts............
 
... 1 post hidden. Click here to view all posts....
 
2018-09-17 06:21
Raistlin

Registered: Mar 2007
Posts: 110
Ah, haha, thanks - made by a G*P member too... I guess I should’ve asked first on the secret internal channel ... oops :-)

Thanks for the help!
2018-09-17 08:24
Krill

Registered: Apr 2002
Posts: 1063
You can actually save a file using KERNAL routines just fine while playing music with an interrupt. This might require calling the lower-level OPEN and CHROUT and other calls with some $dd00 polling in between, but interrupt variance is somewhere at 30 rasterlines, but that should not be audible for most (not all) tunes.

Of course, a couple of zeropage and lowmem variables need to be set correctly, and sprites disabled where the mainline code runs.

But, pray tell, why do you need to write data to disk in the middle of a demo? :)
2018-09-17 08:29
Adam

Registered: Jul 2009
Posts: 214
Quoting Krill
But, pray tell, why do you need to write data to disk in the middle of a demo? :)

yeah, it has caught my attention too :)
2018-09-17 11:17
Raistlin

Registered: Mar 2007
Posts: 110
"why do you need to write data to disk in the middle of a demo? :)"

Maybe it's the world's first fuzzy logic learning demo on C64? Or we made FaceSwap work in realtime on C64 using, umm, the LightPen (and probably a really bright torch)?
2018-09-17 13:13
Adam

Registered: Jul 2009
Posts: 214
Quoting Raistlin
"Or we made FaceSwap work in realtime on C64 using, umm, the LightPen (and probably a really bright torch)?

LOL. make it so!
2018-09-18 20:00
algorithm

Registered: May 2002
Posts: 690
Ram permitting. perhaps keep a buffer somewhere with the data, and then shuffle around per part to keep it non-overwritten, then utilise this data during the demo parts.

You can then at the end of the demo do a single write to disk if need be.
2018-09-19 06:38
Oswald

Registered: Apr 2002
Posts: 4291
one of my demos counts how many time it has been run, by writing to disc, and displays the # on startup :P
2018-09-19 07:54
Krill

Registered: Apr 2002
Posts: 1063
Quoting Oswald
one of my demos counts how many time it has been run, by writing to disc, and displays the # on startup :P
It probably writes to disk at start-up, with all KERNAL variables intact and no music running. Entirely different beast.
2018-09-19 12:15
bubis

Registered: Apr 2002
Posts: 16
The Plus/4 port of Bitfire has a save routine for C64 too. It works fine during interrupts, etc.

https://github.com/dotscha/bitfire/releases

"Pet's Rescue" uses Bitfire and this routine on Plus/4 for saving high scores.
2018-09-19 23:47
AlexC

Registered: Jan 2008
Posts: 250
Quoting Krill
But, pray tell, why do you need to write data to disk in the middle of a demo? :)


Sounds like a demo copy protection scheme to me ;)
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
Zoolon/AC64SID
bugjam
xIII/ATL/WOW
www.gb64.com
Dymo/G★P
jcompton
hedning/G★P
thesuperfrog
Pantaloon/Fairlight
The Dark Judge
Jazzcat/Onslaught
Matt
Guests online: 47
Top Demos
1 Uncensored  (9.7)
2 Comaland 100%  (9.7)
3 Edge of Disgrace  (9.7)
4 Coma Light 13  (9.6)
5 The Shores of Reflec..  (9.6)
6 Wonderland XII  (9.6)
7 Lunatico  (9.6)
8 We Come in Peace  (9.6)
9 Incoherent Nightmare  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 FMX Music Demo  (9.6)
2 Daah, Those Acid Pil..  (9.6)
3 Arok 20 Invitation  (9.6)
4 Merry Xmas 2017  (9.5)
5 Pandemoniac Part 2 o..  (9.5)
6 Party Horse  (9.4)
7 Dawnfall V1.1  (9.4)
8 In Memoriam BHF  (9.4)
9 Dawnfall  (9.4)
10 Synthesis  (9.4)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Finnish Gold  (9.3)
5 Crest  (9.3)
Top Original Suppliers
1 hedning  (9.7)
2 Derbyshire Ram  (9.3)
3 Jazzcat  (9.1)
4 Irata  (9.0)
5 Fungus  (9.0)

Home - Disclaimer
Copyright © No Name 2001-2018
Page generated in: 0.057 sec.