Write data to disk (Software and gaming MSX Forum)MSX Resource Center PassionMSX MSX2 contest              
              
English Nederlands Español Português Russian         
 News
   Frontpage
  News archive
  News topics

 Resources
   MSX Forum
  Articles
  Reviews
  Fair reports
  Photo shoots
  Fairs and meetings
  Polls
  Links
  Search

 Software
   Downloads
  Webshop

 MRC
   Who we are
  Join our team
  Donate
  Policies
  Contact us
  Link to Us
  Statistics

 Search
 
  

  

 Login
 

Username

Password




Don't you have an account yet? Become an MSX-friend and register an account now!.


 Statistics
 

There are 141 guests and 4 MSX friends online

You are an anonymous user.
 

MSX Forum


MSX Forum

Software and gaming - Write data to disk

Author

Write data to disk

Bryan_Fury
msx friend
Posts: 12
Posted: May 30 2005, 15:55   
I need to write and read a data in a disk, it's 2 bytes i wont save a counter in the disk. I don't know if exist a function like open ... for output as#1. In that case i don't remember the syntax....... this is only my idea, if exist another command to do that ..... better.

I need to save a counter and load it after the reset, I remember in the real msx1 when push the reset button the ram don't reinitialized, but in the emulator it's different.

I try in my MSX to write Poke 34000,12 ..... i reset and when i digit print peek(34000) the result is 12, but in the emulator it's not the same.

For that i need to write this counter in the disk then i can read the correct value after the reset.

Thans.


flyguille
msx master
Posts: 1196
Posted: May 30 2005, 16:10   
in basic it is
OPEN "filename" for output as#1
print#1,var
CLOSE#1

then

OPEN"filename" for input as#1
line input#1,a$:var=val(a$)
close#1



Bryan_Fury
msx friend
Posts: 12
Posted: May 30 2005, 16:20   
Thanks, i work on it immediately.
NYYRIKKI
msx master
Posts: 1509
Posted: May 30 2005, 21:04   
Quote:


I try in my MSX to write Poke 34000,12 ..... i reset and when i digit print peek(34000) the result is 12, but in the emulator it's not the same.


Many emulators have Hard reset (power off and power back on). and Soft reset (reset button). Hard reset is the one that clears memory as well. If your program just need to reset the computer, you can use DEFUSR=0:A=USR(0) to reset the computer without clearing the memory.

flyguille
msx master
Posts: 1196
Posted: May 30 2005, 21:49   
memry DRAM can save data up to 5 seconds and more without power.

up to 3 seconds is safe to get a clean data!

later you gets a bit corruptions

10 seconds and more it is all destroyed.

but that depends on brandname and model of ram chip
 
 







(c) 1994 - 2008 MSX Resource Center Foundation. MSX is a trademark of MSX Licensing Corporation.