It is currently Mon Oct 16, 2017 5:46 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Jun 30, 2006 4:25 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
Someone sent me a message about getting an error #6 with my blargg_ppu_tests_2005.09.15b VRAM access tests, "Palette read should also read VRAM into read buffer". I'm posting my answer here since it might benefit others. The problem is likely that the emulator isn't treating a palette read as a normal read regarding the internal read buffer (I don't have my notes right now so this is all from memory):
Code:
Normal  VRAM read:  VRAM    ---> buffer -> CPU

Palette VRAM read:  VRAM    ---> buffer
                    Palette ---> CPU

Shown in code:
Code:
; Normal VRAM access
lda #$10   ; VADDR = $1000
sta $2006
lda #$00
sta $2006
lda $2007  ; A = ?? (previous contents of internal buffer)
lda $2007  ; A = VRAM at $1000

; Palette VRAM access
lda #$3F   ; VADDR = $3F12 (palette area)
sta $2006
lda #$12
sta $2006
lda $2007  ; A = Palette RAM at $12
lda $2007  ; A = Palette RAM at $13
lda #$10   ; VADDR = $1000
sta $2006
lda #$00
sta $2006
lda $2007  ; A = VRAM at $2F13 (filled earlier)
lda $2007  ; A = VRAM at $1000


Last edited by blargg on Fri Jun 30, 2006 4:42 pm, edited 3 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 30, 2006 4:37 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
I was under the impression that palette reads will return the palette without buffering, but will put the mirrored NT byte in the read buffer.

IE: reading $3F00 will give you the palette entry at $3F00 and will put the byte in VRAM[$2F00] in the read buffer.

That's what I have my emu doing and it passes.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 30, 2006 4:38 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
Yeah sorry, I just corrected the code example. My memory buffer wasn't working right.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 30, 2006 4:40 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
blargg wrote:
My memory buffer wasn't working right.



hahahahaha

oh man, we're such nerds, I swear.


EDIT -- Also, I just recalled one other weird thing that your test ROMs don't test. Reading a palette entry from $2007 when in monochrome mode will return the desired color AND $30.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot], Gilbert, Yahoo [Bot] and 9 guests


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