8bit-Dude Posted January 15, 2021 Share Posted January 15, 2021 Sorry to revive an old thread, but I need some advice on the EEPROM code in CC65. First-of-all, while there are codes for 93C46, 93C66, 93C86, the only available function seems to be a modified version of the 93C46 code. When trying to call lynx_eeprom_write(0, 1), the program just hangs in Handy (the SAGE fixed version). Am I supposed to initialize something before calling this function? Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4725878 Share on other sites More sharing options...
Fadest Posted January 15, 2021 Share Posted January 15, 2021 Is the flag in the LNX header set up ? Also, you may need an EEProm file created before to run the ROM, IIRC. Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4725888 Share on other sites More sharing options...
8bit-Dude Posted January 15, 2021 Share Posted January 15, 2021 1 hour ago, Fadest said: Is the flag in the LNX header set up ? Is that a compilation flag for building the CC65 Lynx Lib? (the eeprom functions seems to get included by default in the makefile) You must mean something else, but I can't figure out what. 1 hour ago, Fadest said: Also, you may need an EEProm file created before to run the ROM, IIRC. I cannot understand what this means. Do you mean some kind of .incbin in CC65, or something relating to Handy? Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4725908 Share on other sites More sharing options...
+karri Posted January 15, 2021 Share Posted January 15, 2021 The eeprom functions are in the lynx.lib. If you just use them in your code they get automatically included in the build. But you can of course override this behaviour by making a local asm file and linking it in before the lynx.lib is found on the command line. In this way you can replace any driver by your modified copy. The idea has been to tell the emulator what kind of eeproms are used in a game by setting bits in the lnx header. But the header is not part of the rom. In some games people try to support the old SD cart and the code may hand in waiting for response. Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4725911 Share on other sites More sharing options...
+karri Posted January 15, 2021 Share Posted January 15, 2021 1 hour ago, 8bit-Dude said: Sorry to revive an old thread, but I need some advice on the EEPROM code in CC65. First-of-all, while there are codes for 93C46, 93C66, 93C86, the only available function seems to be a modified version of the 93C46 code. When trying to call lynx_eeprom_write(0, 1), the program just hangs in Handy (the SAGE fixed version). Am I supposed to initialize something before calling this function? Actually almost everyone is using the 93C46 as an eeprom if the game supports it. This was the first eeprom implemented. There may be some experimental carts using some other eeprom chip. But no games use anything except 93C46 afaik. I plan to make a run with the 24AA512 chip in a week or so. Perhaps it will be used by some game in the future. Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4725914 Share on other sites More sharing options...
Fadest Posted January 15, 2021 Share Posted January 15, 2021 (edited) 1 hour ago, 8bit-Dude said: Is that a compilation flag for building the CC65 Lynx Lib? (the eeprom functions seems to get included by default in the makefile) You must mean something else, but I can't figure out what. I don't know how to setup things in cc65 as I'm still using "old" BLL kit, but if you look at this page, you see that there is a flag in LNX header to tell emulators that EEProm should be used. https://atarigamer.com/lynx/lnxhdrgen Edited January 15, 2021 by Fadest Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4725929 Share on other sites More sharing options...
sage Posted January 15, 2021 Share Posted January 15, 2021 yeah, depending on the emulator used. but the emulator does not crash, an neither does the eeprom code, it will just return FF (or 00) Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4725930 Share on other sites More sharing options...
sage Posted January 15, 2021 Share Posted January 15, 2021 are you using (new)cc65 (from BLL times) or the "new one" (cc65). Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4725931 Share on other sites More sharing options...
8bit-Dude Posted January 15, 2021 Share Posted January 15, 2021 I use the official CC65 maintained by Oliver Schmidt and crew (head revision). Thanks for the LNX header link, I will study that info and see how to get the flag set in my version of CC65. 1 Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4725936 Share on other sites More sharing options...
Fadest Posted January 15, 2021 Share Posted January 15, 2021 (edited) 17 minutes ago, sage said: yeah, depending on the emulator used. but the emulator does not crash, an neither does the eeprom code, it will just return FF (or 00) For Handy modified version in order to emulate EEProm, IIRC, you must create a .sav file before, no ? Edited January 15, 2021 by Fadest Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4725940 Share on other sites More sharing options...
sage Posted January 15, 2021 Share Posted January 15, 2021 4 hours ago, Fadest said: For Handy modified version in order to emulate EEProm, IIRC, you must create a .sav file before, no ? no Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4726134 Share on other sites More sharing options...
8bit-Dude Posted January 16, 2021 Share Posted January 16, 2021 Thanks for the advice, I got the EEPROM Read/Write code working in Handy after setting the Header byte to 1! 1 Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4726736 Share on other sites More sharing options...
42bs Posted January 27, 2021 Share Posted January 27, 2021 On 1/16/2021 at 6:30 AM, 8bit-Dude said: Thanks for the advice, I got the EEPROM Read/Write code working in Handy after setting the Header byte to 1! BTW, it is a pity that you use a lot of other peoples stuff but do not credit them. Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4737022 Share on other sites More sharing options...
8bit-Dude Posted January 29, 2021 Share Posted January 29, 2021 (edited) On 1/27/2021 at 7:59 PM, 42bs said: BTW, it is a pity that you use a lot of other peoples stuff but do not credit them. I have been adding credits in source files over past year or so, including to Karri. Please let me know the offending files you spotted, I will add credit accordingly. Edited January 29, 2021 by 8bit-Dude 1 Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4738710 Share on other sites More sharing options...
42bs Posted January 29, 2021 Share Posted January 29, 2021 1 minute ago, 8bit-Dude said: I started adding credits in source files, including to Karri. Please let me know the offending files you spotted, I will add credit accordingly. I'd say the most of the files in "utils" aren't your work so you should add a huge credits file. Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4738717 Share on other sites More sharing options...
8bit-Dude Posted January 29, 2021 Share Posted January 29, 2021 1 hour ago, 42bs said: I'd say the most of the files in "utils" aren't your work so you should add a huge credits file. All the Python files in the Scripts/ folder are my work. I guess you are talking about the rest: CC65, emulators, trackers and various .exe files not yet converted to Python scripts... I will improve the credits in the installer, but it is hard to track down everyone's name. So sometimes generic credits like "cc65 team" are used. Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4738765 Share on other sites More sharing options...
Songbird Posted March 17, 2021 Author Share Posted March 17, 2021 Does anyone have a Lynx program to read and display the EEPROM contents, like a memdump tool? Even better would be a utility to dump the EEPROM so I can examine with a hex editor. Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4780202 Share on other sites More sharing options...
42bs Posted March 17, 2021 Share Posted March 17, 2021 4 hours ago, Songbird said: Does anyone have a Lynx program to read and display the EEPROM contents, like a memdump tool? Even better would be a utility to dump the EEPROM so I can examine with a hex editor. See new_bll: demos/i2c_test.o It dumps the contents to screen, now _just_ add sending it and your are done. Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4780368 Share on other sites More sharing options...
Fadest Posted March 17, 2021 Share Posted March 17, 2021 7 hours ago, Songbird said: Does anyone have a Lynx program to read and display the EEPROM contents, like a memdump tool? Even better would be a utility to dump the EEPROM so I can examine with a hex editor. Do you have Bernd's Flashcard ? It has options to manage EEProm (erase, write, read and send to terminal...). Very useful while testing and debugging. Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4780420 Share on other sites More sharing options...
sage Posted March 17, 2021 Share Posted March 17, 2021 9 hours ago, Songbird said: Does anyone have a Lynx program to read and display the EEPROM contents, like a memdump tool? Even better would be a utility to dump the EEPROM so I can examine with a hex editor. yes 1 Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4780444 Share on other sites More sharing options...
Songbird Posted March 18, 2021 Author Share Posted March 18, 2021 Does anyone have Can anyone provide such a program to me? The issue is I have a game I flashed during manufacturing which appears to have a corrupted save. I also know from other carts I have built for this game that the problem will go away (and no longer reproduce) if I simply erase the EEPROM using the in-game function. Thus I want to display or dump the contents of the EEPROM on this cart to compare against a known good version. @42bs Thanks for the tip; I see that program works in Handy. Will it boot from ROM? If not, then I admit I am forgetful here: what tool will convert a *.o to a *.lyx or *.lnx? I'm sure I could write a simple bootloader if needed... Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4781050 Share on other sites More sharing options...
42bs Posted March 18, 2021 Share Posted March 18, 2021 (edited) Can't you download .o files via ComLynx? Edit: I checked, and most of the files in new_bll/demo cannot "just" put into a card version as they start somewhere due to the BEGIN_MEM/END_MEM to store variables. Edited March 18, 2021 by 42bs Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4781138 Share on other sites More sharing options...
42bs Posted March 18, 2021 Share Posted March 18, 2021 Added an additional loader to build ROM files from single .o files: https://github.com/42Bastian/new_bll/tree/master/uloader Just do: cat bll.enc file.o > file.lyx make_lnx file.lyx -o file.lnx -b0 256k i2c_test.lnx 1 Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4781198 Share on other sites More sharing options...
Songbird Posted March 18, 2021 Author Share Posted March 18, 2021 Excellent, just what I needed and now I have dumped good and bad versions of the EEPROM for comparison purposes. Thanks, @42bs! Still supporting the Lynx since, what, 1993? That precedes me by a couple years. Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4781242 Share on other sites More sharing options...
42bs Posted March 18, 2021 Share Posted March 18, 2021 19 minutes ago, Songbird said: Still supporting the Lynx since, what, 1993 Yes, and still have fun with it! 1 Quote Link to comment https://forums.atariage.com/topic/304345-eeprom-library/page/2/#findComment-4781250 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.