+karri Posted April 26, 2011 Share Posted April 26, 2011 I spent some time to integrate Sage's EEPROM drivers into the daily snapshot of cc65. You should now be able to use any of these chips in your code. 93c46 - a 128 byte eeprom 93c66 - a 512 byte eeprom 93c86 - a 2048 byte eeprom In order to make the use a bit easier for programmers I suggest to add this to the config file: SYMBOLS { _lynx_eeread: type = export, value = _lynx_eeread_93c86; _lynx_eewrite: type = export, value = _lynx_eewrite_93c86; } In the file lynx.h I have already declared the routines like: unsigned _fastcall_ lynx_eeread(unsigned addr); void _fastcall_ lynx_eewrite(unsigned addr, unsigned val); You can also use the right routine directly like: lynx_eewrite_93c86(1023, 0xffff); But if you add the symbol in the config file you can write: lynx_eewrite(1023, 0xffff); and then just link in the right driver by changing the data in the config file. The old eeprom used to be similar to the 93c46. That is a 128 byte eeprom. But in the old days you also needed a separate erase-command to set the 0-bits back to 1-bits. This is now history. But for old eeprom designs there is still the old eeprom driver also. It has commands like lynx_eeprom_read, lynx_eeprom_write, lynx_eeprom_erase. -- Regards, Karri Quote Link to comment Share on other sites More sharing options...
sage Posted April 26, 2011 Share Posted April 26, 2011 Actually, as teh command are the same for 56 and 66 and 76 and 86 you should also be able to access these. 93c46 - a 128 byte eeprom 93c66 - a 512 byte eeprom (and 93c56 - a 256 byte eeprom) 93c86 - a 2048 byte eeprom (and 93c76 - a 1024 byte eeprom) Quote Link to comment Share on other sites More sharing options...
Ninjabba Posted April 26, 2011 Share Posted April 26, 2011 Great news! Can't wait for the weekend to spend some time on this.. I hope the latest snapshot is compatible with the 1.1 template I'm using. Quote Link to comment Share on other sites More sharing options...
Lynxman Posted May 29, 2011 Share Posted May 29, 2011 Please read the datasheet for 93C56 and 93C76 before using. There are 2 different adress methodes for this chips. 93C56 is in most case same addressing as 93C66. But i know there is a 93C56 with different adressing. Same maybe for 93C76. In case you use this chips read the datasheet before using. Or feel free to contact me. Quote Link to comment Share on other sites More sharing options...
sage Posted November 15, 2012 Share Posted November 15, 2012 (edited) Just to revive this thread, as there were questions regarding EEPROM support for emulation: With the following code ouy can check the functionality of an eeprom (at least the ones supported / tested by me): hmmm i hate these "You aren't permitted to upload this kind of file" messages... i will put the binary for download on my developers site. these attachment rules seems to completly junk, one cannot attach anything, neigther source code no compiled binary. Edited November 15, 2012 by sage Quote Link to comment Share on other sites More sharing options...
LX.NET Posted November 15, 2012 Share Posted November 15, 2012 Is your site's home page still OK? It seems the last bullit might contain this program/code is incomplete. Quote Link to comment Share on other sites More sharing options...
sage Posted November 15, 2012 Share Posted November 15, 2012 Is your site's home page still OK? It seems the last bullit might contain this program/code is incomplete. had some problems updating the files one the site, seems some files go corrupted but now oit should be o.k. but i did not put the source files up, anyway they should be in my newcc lib, maybe i also did some bll version of the libs, dont remember right now. Quote Link to comment Share on other sites More sharing options...
+karri Posted November 16, 2012 Author Share Posted November 16, 2012 If the check procedure is simple I could add it as a front end to the cc65 eeprom suite. Then you could have a function that returns the size of the eeprom and can handle any size automatically. You would not have to include drivers for all sizes but that could be an option. Is this ok for you? Quote Link to comment Share on other sites More sharing options...
Shawn Jefferson Posted November 16, 2012 Share Posted November 16, 2012 One problem with that is that you'd need to link all the functions for all EEPROMs (or better yet, load the proper one from the cart), but typically you are going to know the target hardware arent' you? Anyway, if you do implement a check procedure, put it in the STARTUP segment so it can be overwritten with something else later after it's used, or a constructor maybe? Probably preaching to the choir here... Quote Link to comment Share on other sites More sharing options...
+karri Posted November 16, 2012 Author Share Posted November 16, 2012 I would probably create a separate segment of the load/save/hiscore stuff that is loaded on demand and discarded after use. As it has a very limited lifetime I can live with a segment that contains all the drivers. -- Karri Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.