Jump to content
IGNORED

Writing to SaveKey (please move to 2600 programming)


Wickeycolumbus

Recommended Posts

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 by Wickeycolumbus
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...