It is currently Thu Dec 14, 2017 11:37 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Mon Nov 26, 2012 7:33 pm 
Offline
User avatar

Joined: Mon Sep 05, 2011 5:56 pm
Posts: 287
I try to convert a chr to chr-ram!
here is the code:
Code:
 LDY #$0    ; starting index into the first page
 STY $2001  ; turn off rendering just in case
 STY $2006  ; load the destination address into the PPU
 STY $2006
 
 LDX #$20   ; number of 256-byte pages to copy
 
loop:
  LDA ($0000),Y; $0000 is address at 0x8000
  STA $2007
  INY
  BNE loop  ; repeat until we finish the page
  LDA $1
  ADC #$1
  STA $1  ; go to the next page
  DEX 
  BNE loop  ; repeat until we've copied enough pages


But some time the cram is wrong!
some data is malposed!


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 7:37 pm 
Offline
Formerly 65024U

Joined: Sat Mar 27, 2010 12:57 pm
Posts: 2257
Probably didn't turn off rendering, you can't touch the PPU Data Port during rendering.


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 7:52 pm 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1046
His very first two lines shows a 0 write to $2001.

But NMIs might still be firing. Try disabling NMIs as well, if they aren't already disabled in unseen code.

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 7:53 pm 
Offline
User avatar

Joined: Mon Sep 05, 2011 5:56 pm
Posts: 287
3gengames wrote:
Probably didn't turn off rendering, you can't touch the PPU Data Port during rendering.


Always wrong :(


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 7:54 pm 
Offline
Formerly 65024U

Joined: Sat Mar 27, 2010 12:57 pm
Posts: 2257
Sorry, I use labels for those ports in my code so I didn't think he wrote to any ports like that just giving it a 5 second look. But yeah, NMI's could fire, you may not be declaring CHR-RAM in the header...hmmm...would it be impossible to get a source?

ETA: You can make the outer loop INC $01,DEX,BNE btw.


Last edited by 3gengames on Mon Nov 26, 2012 8:03 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 8:01 pm 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1046
Another issue could be it's incremented by 32 instead of 1. If you end up writing to $2000 to disable NMIs, make sure you also set it to increment by one. Another issue is this:

Code:
LDA $1
  ADC #$1
  STA $1  ; go to the next page

You don't clear the carry flag before this add, so it could be adding 2, not 1 sometimes.

Also, in this case inc $1 in place of the load, add, store would do the same thing.

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 8:06 pm 
Offline
User avatar

Joined: Mon Sep 05, 2011 5:56 pm
Posts: 287
3gengames wrote:
Sorry, I use labels for those ports in my code so I didn't think he wrote to any ports like that just giving it a 5 second look. But yeah, NMI's could fire, you may not be declaring CHR-RAM in the header...hmmm...would it be impossible to get a source?

ETA: You can make the outer loop INC $01,DEX,BNE btw.


It‘s ok now!
Thank you and the same to Kasumi!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group