Wickeycolumbus Posted March 1, 2009 Share Posted March 1, 2009 (edited) I was experimenting with the SaveKey with the ultimate goal of dumping games using it (copying the inserted cartridge data to the save key, then dumping the eeprom). My code does not seem to work though, this is what I have: CLEAN_START jsr i2c_startwrite lda #0 jsr i2c_txbyte jsr i2c_txbyte ldx #0 Write_Loop lda SK_Data,X jsr i2c_txbyte inx cpx #14 bne Write_Loop jsr i2c_stopwrite Done jmp Done SK_Data .byte "This is a test" When I dump the eeprom, it is blank. SK_Data is in ROM, is that ok? The example in the AtariVox document has it in RAM. Could that be the problem? Also, I left out the 'bcs eeprom_error' because in this case, the savekey will always be there. Edit: I meant for this to be in the 2600 programming section, can some one move it please? Edited March 1, 2009 by Wickeycolumbus Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted March 1, 2009 Author Share Posted March 1, 2009 Never mind, it was the fact that SK_Data was in ROM. I added: buffer equ $80 ;... ldx #0 Store_loop lda SK_Data,X sta buffer,X inx cpx #14 bne Store_loop before communicating with the eeprom, and switched 'lda SK_Data,X' to buffer,X in the write loop Quote Link to comment Share on other sites More sharing options...
cd-w Posted March 2, 2009 Share Posted March 2, 2009 Never mind, it was the fact that SK_Data was in ROM. I added: ...before communicating with the eeprom, and switched 'lda SK_Data,X' to buffer,X in the write loop That is odd - it shouldn't really matter if the data is in ROM or RAM (since the accumulator is copied into the TEMP variable before transmission). I wonder if it is because you are not waiting long enough between writes (although RAM would make it even quicker). Are you testing with real hardware, or Stella? Chris Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted March 2, 2009 Author Share Posted March 2, 2009 Never mind, it was the fact that SK_Data was in ROM. I added: ...before communicating with the eeprom, and switched 'lda SK_Data,X' to buffer,X in the write loop That is odd - it shouldn't really matter if the data is in ROM or RAM (since the accumulator is copied into the TEMP variable before transmission). I wonder if it is because you are not waiting long enough between writes (although RAM would make it even quicker). Are you testing with real hardware, or Stella? Chris Real hardware. Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted March 4, 2009 Author Share Posted March 4, 2009 I am trying to cram a cartridge copying program into the 2600's internal RAM, and I have a question. Do I need to have the i2c_stopwrite subroutine at all, or for that matter, could I cut out the i2c_startwrite and just execute that before I jump to the internal RAM? I am running out of space. I currently have a 1 byte variable for the communication code, and a 4 byte buffer where the cart data waits to be sent to the eeprom and only 11 bytes left for the rest of the program. Cutting out the stop routine could potentially save 16 more bytes. I have noticed that Thomas Jentzsch optimized i2c.inc. Are his optimizations for execution time or for ROM space? 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.