It is currently Sat Jul 21, 2018 10:22 am

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 103 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
PostPosted: Tue Apr 17, 2018 8:07 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 301
OK I'll add them. And do you think that's the reason why I can't alter the base addresses for my OAM locations in vram?


Top
 Profile  
 
PostPosted: Tue Apr 17, 2018 11:27 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3435
Location: Mountain View, CA
We wouldn't have any way of knowing that without looking at full source code + putting in the time for a full debugging session. That's all you right now, esp. since you had it working. ;-)


Top
 Profile  
 
PostPosted: Tue Apr 17, 2018 3:11 pm 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 301
Ok. :-) What I have so far...
Code:
;initialize snes
008000 sei                    A:0000 X:0000 Y:0000 S:01ff D:0000 DB:00 nv1BdIzc V:  0 H: 46 F: 0
008001 clc                    A:0000 X:0000 Y:0000 S:01ff D:0000 DB:00 nv1BdIzc V:  0 H: 50 F: 0
008002 xce                    A:0000 X:0000 Y:0000 S:01ff D:0000 DB:00 nv1BdIzc V:  0 H: 53 F: 0
008003 jml $808007   [808007] A:0000 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMXdIzC V:  0 H: 57 F: 0
808007 rep #$10               A:0000 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMXdIzC V:  0 H: 65 F: 0
808009 sep #$20               A:0000 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  0 H: 70 F: 0
80800b lda #$8f               A:0000 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  0 H: 76 F: 0
80800d sta $2100     [002100] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H: 80 F: 0
808010 stz $2101     [002101] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H: 87 F: 0
808013 stz $2102     [002102] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H: 95 F: 0
808016 stz $2103     [002103] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:102 F: 0
808019 stz $2105     [002105] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:110 F: 0
80801c stz $2106     [002106] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:117 F: 0
80801f stz $2107     [002107] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:125 F: 0
808022 stz $2108     [002108] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:132 F: 0
808025 stz $2109     [002109] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:150 F: 0
808028 stz $210a     [00210a] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:157 F: 0
80802b stz $210b     [00210b] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:165 F: 0
80802e stz $210c     [00210c] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:172 F: 0
808031 stz $210d     [00210d] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:180 F: 0
808034 stz $210d     [00210d] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:187 F: 0
808037 stz $210e     [00210e] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:195 F: 0
80803a stz $210e     [00210e] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:202 F: 0
80803d stz $210f     [00210f] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:210 F: 0
808040 stz $210f     [00210f] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:217 F: 0
808043 stz $2110     [002110] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:225 F: 0
808046 stz $2110     [002110] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:232 F: 0
808049 stz $2111     [002111] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:240 F: 0
80804c stz $2111     [002111] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:247 F: 0
80804f stz $2112     [002112] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:255 F: 0
808052 stz $2112     [002112] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:262 F: 0
808055 stz $2113     [002113] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:270 F: 0
808058 stz $2113     [002113] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:277 F: 0
80805b stz $2114     [002114] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:285 F: 0
80805e stz $2114     [002114] A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:292 F: 0
808061 lda #$80               A:008f X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:300 F: 0
808063 sta $2115     [002115] A:0080 X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:304 F: 0
808066 stz $2116     [002116] A:0080 X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:311 F: 0
808069 stz $2117     [002117] A:0080 X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:319 F: 0
80806c stz $211a     [00211a] A:0080 X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:326 F: 0
80806f stz $211b     [00211b] A:0080 X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  0 H:333 F: 0
808072 lda #$01               A:0080 X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:  0 F: 0
808074 sta $211b     [00211b] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:  4 F: 0
808077 stz $211c     [00211c] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H: 12 F: 0
80807a stz $211c     [00211c] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H: 19 F: 0
80807d stz $211d     [00211d] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H: 27 F: 0
808080 stz $211d     [00211d] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H: 34 F: 0
808083 stz $211e     [00211e] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H: 42 F: 0
808086 sta $211e     [00211e] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H: 49 F: 0
808089 stz $211f     [00211f] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H: 57 F: 0
80808c stz $211f     [00211f] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H: 64 F: 0
80808f stz $2120     [002120] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H: 72 F: 0
808092 stz $2120     [002120] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H: 79 F: 0
808095 stz $2121     [002121] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H: 87 F: 0
808098 stz $2123     [002123] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H: 94 F: 0
80809b stz $2124     [002124] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:102 F: 0
80809e stz $2125     [002125] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:109 F: 0
8080a1 stz $2126     [002126] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:117 F: 0
8080a4 stz $2127     [002127] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:124 F: 0
8080a7 stz $2128     [002128] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:132 F: 0
8080aa stz $2129     [002129] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:149 F: 0
8080ad stz $212a     [00212a] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:157 F: 0
8080b0 stz $212b     [00212b] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:164 F: 0
8080b3 stz $212c     [00212c] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:172 F: 0
8080b6 stz $212d     [00212d] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:179 F: 0
8080b9 stz $212e     [00212e] A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:187 F: 0
8080bc lda #$30               A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:194 F: 0
8080be sta $2130     [002130] A:0030 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:198 F: 0
8080c1 stz $2131     [002131] A:0030 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:206 F: 0
8080c4 lda #$e0               A:0030 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  1 H:213 F: 0
8080c6 sta $2132     [002132] A:00e0 X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:217 F: 0
8080c9 stz $2133     [002133] A:00e0 X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:225 F: 0
8080cc stz $4200     [004200] A:00e0 X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:232 F: 0
8080cf lda #$ff               A:00e0 X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:240 F: 0
8080d1 sta $4201     [004201] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:244 F: 0
8080d4 stz $4202     [004202] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:251 F: 0
8080d7 stz $4203     [004203] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:259 F: 0
8080da stz $4204     [004204] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:266 F: 0
8080dd stz $4205     [004205] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:274 F: 0
8080e0 stz $4206     [004206] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:281 F: 0
8080e3 stz $4207     [004207] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:289 F: 0
8080e6 stz $4208     [004208] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:296 F: 0
8080e9 stz $4209     [004209] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:304 F: 0
8080ec stz $420a     [00420a] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:311 F: 0
8080ef stz $420b     [00420b] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:319 F: 0
8080f2 stz $420c     [00420c] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:326 F: 0
8080f5 stz $420d     [00420d] A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  1 H:333 F: 0

;here i'm loading and storing to CGRAM using DMA
8080f8 lda #$00               A:00ff X:0000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  2 H:  0 F: 0
8080fa sta $2121     [002121] A:0000 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIZC V:  2 H:  4 F: 0
8080fd lda #$01               A:0000 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIZC V:  2 H: 12 F: 0
8080ff ldx #$ce00             A:0001 X:0000 Y:0000 S:01ff D:0000 DB:00 nvMxdIzC V:  2 H: 16 F: 0
808102 ldy #$0200             A:0001 X:ce00 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V:  2 H: 22 F: 0
808105 stx $4302     [004302] A:0001 X:ce00 Y:0200 S:01ff D:0000 DB:00 nvMxdIzC V:  2 H: 28 F: 0
808108 sta $4304     [004304] A:0001 X:ce00 Y:0200 S:01ff D:0000 DB:00 nvMxdIzC V:  2 H: 37 F: 0
80810b sty $4305     [004305] A:0001 X:ce00 Y:0200 S:01ff D:0000 DB:00 nvMxdIzC V:  2 H: 44 F: 0
80810e stz $4300     [004300] A:0001 X:ce00 Y:0200 S:01ff D:0000 DB:00 nvMxdIzC V:  2 H: 53 F: 0
808111 lda #$22               A:0001 X:ce00 Y:0200 S:01ff D:0000 DB:00 nvMxdIzC V:  2 H: 61 F: 0
808113 sta $4301     [004301] A:0022 X:ce00 Y:0200 S:01ff D:0000 DB:00 nvMxdIzC V:  2 H: 65 F: 0
808116 lda #$01               A:0022 X:ce00 Y:0200 S:01ff D:0000 DB:00 nvMxdIzC V:  2 H: 72 F: 0
808118 sta $420b     [00420b] A:0001 X:ce00 Y:0200 S:01ff D:0000 DB:00 nvMxdIzC V:  2 H: 76 F: 0

;here i'm loading 2bpp bg tiles into VRAM using DMA
80811b lda #$80               A:0001 X:ce00 Y:0200 S:01ff D:0000 DB:00 nvMxdIzC V:  2 H: 84 F: 0
80811d sta $2115     [002115] A:0080 X:ce00 Y:0200 S:01ff D:0000 DB:00 NvMxdIzC V:  5 H:127 F: 0
808120 ldx #$0000             A:0080 X:ce00 Y:0200 S:01ff D:0000 DB:00 NvMxdIzC V:  5 H:144 F: 0
808123 stx $2116     [002116] A:0080 X:0000 Y:0200 S:01ff D:0000 DB:00 nvMxdIZC V:  5 H:150 F: 0
808126 lda #$01               A:0080 X:0000 Y:0200 S:01ff D:0000 DB:00 nvMxdIZC V:  5 H:159 F: 0
808128 ldx #$d000             A:0001 X:0000 Y:0200 S:01ff D:0000 DB:00 nvMxdIzC V:  5 H:163 F: 0
80812b ldy #$1000             A:0001 X:d000 Y:0200 S:01ff D:0000 DB:00 NvMxdIzC V:  5 H:169 F: 0
80812e stx $4302     [004302] A:0001 X:d000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V:  5 H:175 F: 0
808131 sta $4304     [004304] A:0001 X:d000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V:  5 H:184 F: 0
808134 sty $4305     [004305] A:0001 X:d000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V:  5 H:192 F: 0
808137 lda #$01               A:0001 X:d000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V:  5 H:201 F: 0
808139 sta $4300     [004300] A:0001 X:d000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V:  5 H:205 F: 0
80813c lda #$18               A:0001 X:d000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V:  5 H:212 F: 0
80813e sta $4301     [004301] A:0018 X:d000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V:  5 H:216 F: 0
808141 lda #$01               A:0018 X:d000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V:  5 H:224 F: 0
808143 sta $420b     [00420b] A:0001 X:d000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V:  5 H:228 F: 0

;here im loading 4bpp sprite gfx into VRAM using DMA
808146 lda #$80               A:0001 X:d000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V:  5 H:235 F: 0
808148 sta $2115     [002115] A:0080 X:d000 Y:1000 S:01ff D:0000 DB:00 NvMxdIzC V: 30 H:162 F: 0
80814b ldx #$2000             A:0080 X:d000 Y:1000 S:01ff D:0000 DB:00 NvMxdIzC V: 30 H:170 F: 0
80814e stx $2116     [002116] A:0080 X:2000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:176 F: 0
808151 lda #$01               A:0080 X:2000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:185 F: 0
808153 ldx #$e000             A:0001 X:2000 Y:1000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:189 F: 0
808156 ldy #$2000             A:0001 X:e000 Y:1000 S:01ff D:0000 DB:00 NvMxdIzC V: 30 H:195 F: 0
808159 stx $4302     [004302] A:0001 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:201 F: 0
80815c sta $4304     [004304] A:0001 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:210 F: 0
80815f sty $4305     [004305] A:0001 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:217 F: 0
808162 lda #$01               A:0001 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:226 F: 0
808164 sta $4300     [004300] A:0001 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:230 F: 0
808167 lda #$18               A:0001 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:238 F: 0
808169 sta $4301     [004301] A:0018 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:242 F: 0
80816c lda #$01               A:0018 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:249 F: 0
80816e sta $420b     [00420b] A:0001 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:253 F: 0

;this code i think i'm doing incorrectly, i think i was tyring to set the addresses in vram for BG's 1-4... the more i look at this, i feel this is incorrect....
808171 lda #$00               A:0001 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 30 H:261 F: 0
808173 sta $2105     [002105] A:0000 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIZC V: 80 H: 95 F: 0
808176 lda #$0f               A:0000 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIZC V: 80 H:102 F: 0
808178 sta $2106     [002106] A:000f X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:106 F: 0
80817b lda #$51               A:000f X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:114 F: 0
80817d sta $2107     [002107] A:0051 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:118 F: 0
808180 lda #$58               A:0051 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:125 F: 0
808182 sta $2108     [002108] A:0058 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:129 F: 0
808185 lda #$60               A:0058 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:147 F: 0
808187 sta $2109     [002109] A:0060 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:151 F: 0
80818a lda #$68               A:0060 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:158 F: 0
80818c sta $210a     [00210a] A:0068 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:162 F: 0
80818f stz $210b     [00210b] A:0068 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:170 F: 0
808192 lda #$1f               A:0068 X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:177 F: 0
808194 sta $212c     [00212c] A:001f X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:181 F: 0
808197 sta $212d     [00212d] A:001f X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:189 F: 0
80819a lda #$0f               A:001f X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:196 F: 0
80819c sta $2100     [002100] A:000f X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:200 F: 0

;my routine to wipe out snes ram $0000-$1FFF
80819f rep #$10               A:000f X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:208 F: 0
8081a1 ldy #$1fff             A:000f X:e000 Y:2000 S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:213 F: 0
8081a4 lda #$00               A:000f X:e000 Y:1fff S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:219 F: 0
8081a6 sta $0000,y   [001fff] A:0000 X:e000 Y:1fff S:01ff D:0000 DB:00 nvMxdIZC V: 80 H:223 F: 0
8081a9 dey                    A:0000 X:e000 Y:1fff S:01ff D:0000 DB:00 nvMxdIZC V: 80 H:233 F: 0
8081aa bne $81a6     [8081a6] A:0000 X:e000 Y:1ffe S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:236 F: 0
8081a6 sta $0000,y   [001ffe] A:0000 X:e000 Y:1ffe S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:242 F: 0
8081a9 dey                    A:0000 X:e000 Y:1ffe S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:251 F: 0
8081aa bne $81a6     [8081a6] A:0000 X:e000 Y:1ffd S:01ff D:0000 DB:00 nvMxdIzC V: 80 H:255 F: 0
8081ac sta $0000     [000000] A:0000 X:e000 Y:0000 S:01ff D:0000 DB:00 nvMxdIZC V: 81 H:121 F: 0

;my preperation for OAM at $800 in RAM, have all Y positions set to #$E0
8081af ldy #$0000             A:0000 X:e000 Y:0000 S:01ff D:0000 DB:00 nvMxdIZC V: 81 H:129 F: 0
8081b2 lda #$e0               A:0000 X:e000 Y:0000 S:01ff D:0000 DB:00 nvMxdIZC V: 81 H:145 F: 0
8081b4 sta $0801,y   [000801] A:00e0 X:e000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V: 81 H:149 F: 0
8081b7 iny                    A:00e0 X:e000 Y:0000 S:01ff D:0000 DB:00 NvMxdIzC V: 81 H:159 F: 0
8081b8 iny                    A:00e0 X:e000 Y:0001 S:01ff D:0000 DB:00 nvMxdIzC V: 81 H:162 F: 0
8081b9 iny                    A:00e0 X:e000 Y:0002 S:01ff D:0000 DB:00 nvMxdIzC V: 81 H:166 F: 0
8081ba iny                    A:00e0 X:e000 Y:0003 S:01ff D:0000 DB:00 nvMxdIzC V: 81 H:169 F: 0
8081bb cpy #$0200             A:00e0 X:e000 Y:0004 S:01ff D:0000 DB:00 nvMxdIzC V: 81 H:173 F: 0
8081be bne $81b4     [8081b4] A:00e0 X:e000 Y:0004 S:01ff D:0000 DB:00 NvMxdIzc V: 81 H:179 F: 0

;enable nmi, infinte loop at end of reset vector
8081c0 lda #$81               A:00e0 X:e000 Y:0200 S:01ff D:0000 DB:00 nvMxdIZC V: 81 H:288 F: 0
8081c2 sta $4200     [004200] A:0081 X:e000 Y:0200 S:01ff D:0000 DB:00 NvMxdIzC V: 81 H:292 F: 0
8081c5 jmp $81c5     [8081c5] A:0081 X:e000 Y:0200 S:01ff D:0000 DB:00 NvMxdIzC V: 81 H:299 F: 0

;nmi routine
;load OAM table from RAM to OAM with DMA
008230 rep #$10               A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:229 H: 47 F: 0
008232 sep #$20               A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:229 H: 53 F: 0
008234 lda #$00               A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvMxdIZC V:229 H: 58 F: 0
008236 sta $2102     [002102] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvMxdIZC V:229 H: 62 F: 0
008239 lda #$00               A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvMxdIZC V:229 H: 70 F: 0
00823b sta $2103     [002103] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvMxdIZC V:229 H: 74 F: 0
00823e ldy #$0400             A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvMxdIZC V:229 H: 81 F: 0
008241 sty $4300     [004300] A:0000 X:0000 Y:0400 S:01fb D:0000 DB:00 nvMxdIzC V:229 H: 87 F: 0
008244 stz $4302     [004302] A:0000 X:0000 Y:0400 S:01fb D:0000 DB:00 nvMxdIzC V:229 H: 96 F: 0
008247 lda #$08               A:0000 X:0000 Y:0400 S:01fb D:0000 DB:00 nvMxdIzC V:229 H:104 F: 0
008249 sta $4303     [004303] A:0008 X:0000 Y:0400 S:01fb D:0000 DB:00 nvMxdIzC V:229 H:108 F: 0
00824c lda #$7e               A:0008 X:0000 Y:0400 S:01fb D:0000 DB:00 nvMxdIzC V:229 H:115 F: 0
00824e sta $4304     [004304] A:007e X:0000 Y:0400 S:01fb D:0000 DB:00 nvMxdIzC V:229 H:119 F: 0
008251 ldy #$0220             A:007e X:0000 Y:0400 S:01fb D:0000 DB:00 nvMxdIzC V:229 H:127 F: 0
008254 sty $4305     [004305] A:007e X:0000 Y:0220 S:01fb D:0000 DB:00 nvMxdIzC V:229 H:133 F: 0
008257 lda #$01               A:007e X:0000 Y:0220 S:01fb D:0000 DB:00 nvMxdIzC V:229 H:152 F: 0
008259 sta $420b     [00420b] A:0001 X:0000 Y:0220 S:01fb D:0000 DB:00 nvMxdIzC V:229 H:156 F: 0

;joypad routine
00825c rep #$32               A:0001 X:0000 Y:0220 S:01fb D:0000 DB:00 nvMxdIzC V:229 H:163 F: 0
00825e lda $4218     [004218] A:0001 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIzC V:232 H:270 F: 0
008261 tax                    A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:232 H:279 F: 0
008262 and #$000f             A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:232 H:282 F: 0
008265 beq $826a     [00826a] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:232 H:288 F: 0
00826a stx $a7       [0000a7] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:232 H:294 F: 0
00826c txa                    A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:232 H:302 F: 0
00826d eor $a9       [0000a9] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:232 H:305 F: 0
00826f and $a7       [0000a7] A:7fff X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIzC V:232 H:313 F: 0
008271 sta $ab       [0000ab] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:232 H:321 F: 0
008273 lda $ad       [0000ad] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:232 H:328 F: 0
008275 sta $af       [0000af] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:232 H:336 F: 0
008277 lda $421a     [00421a] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:233 H:  4 F: 0
00827a tax                    A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:233 H: 13 F: 0
00827b and #$000f             A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:233 H: 17 F: 0
00827e beq $8283     [008283] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:233 H: 23 F: 0
008283 stx $ad       [0000ad] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:233 H: 28 F: 0
008285 txa                    A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:233 H: 36 F: 0
008286 eor $af       [0000af] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:233 H: 40 F: 0
008288 and $ad       [0000ad] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:233 H: 48 F: 0
00828a sta $b1       [0000b1] A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:233 H: 56 F: 0

;rti
00828c rti                    A:0000 X:0000 Y:0220 S:01fb D:0000 DB:00 nvmxdIZC V:237 H: 86 F: 0


For some reason, I'm only able to have my OAM base address load correctly if it is constantly read within my reset vector? It doesn't work in my NMI.


Top
 Profile  
 
PostPosted: Wed Apr 18, 2018 3:38 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 301
Thoughts? :-)


Top
 Profile  
 
PostPosted: Wed Apr 18, 2018 1:00 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3435
Location: Mountain View, CA
Yes, I have many thoughts, but it will take me literally hours to reverse-engineer that disassembly dump and break it all down, especially without actual graphical data. I remember sprites being particularly annoying/painful/quirky -- I'm having to remember things from 25 years ago and my memory is not what it used to be -- particularly with the "hows" of OAM specification via $2102/2103 and data via $2014. Something in the back of my mind says "are you sure this is identical to PPU RAM methodology?" despite what I said before.

I just started a new job last Monday, so that kind of has priority right now. I wrote up a very long reply last night, but in the end opted to not post it because I felt it was too premature. I am hoping someone else has the time/cycles to look at this in the meantime. There are minor things I noticed *not* relating to OAM/OBJ, but didn't want to get you sidetracked.


Top
 Profile  
 
PostPosted: Wed Apr 18, 2018 1:32 pm 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 301
Oh I wasn't looking for anyone to reverse engineer or anything like that with the code! I just wanted to know if I'm using the addresses correctly.


Top
 Profile  
 
PostPosted: Wed Apr 18, 2018 2:04 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3435
Location: Mountain View, CA
Most of my brain "broke" when I was trying to figure out all the DMA parameters vs. the addresses you were transferring from vs. the sizes for OBJ/OAM vs. the format of the data vs. how the MMIO registers are actually accessed.

Page A-3 (I attached it earlier) is frustrating because it's easy to overlook things like how 4 bytes of data are per-sprite (not including X-loc MSB and large/size specifier) when on the left it's showing the indexes as incrementing by 1 (because, again: things are in words / 16-bits).

This, combined with (and I'm not sure I have the right to talk badly about this) good-yet-bad resources on sprites (two examples: https://wiki.superfamicom.org/snes-sprites and https://github.com/michielvoo/SNES/wiki/Sprites), none of which actually cover doing this with DMA in NMI... well... point is, it's obviously a neglected subject. The more I read that 2nd link the more things from 25 years ago "trickled back" into my mind, but nothing definitively came forth. Like I can't explain why the MMIO register model used there writes to $2103 before $2102, and there's some additional math being applied to the sprite index/offset (*2, maybe due to the fact that two 16-bit words represent data for a sprite?). Then there's nocash's resource which talks about how $2102/2103 are re-set at the start of VBlank (note the "Caution" part). This is all stuff that's new to me vs. when I last worked with sprites 25 years ago.

In short: there is no terse way for me to summarise what went through my mind when reviewing that dump of code vs. what the behaviour of the console is.


Top
 Profile  
 
PostPosted: Mon Apr 23, 2018 6:04 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 301
I appreciate all of your guidance and info koitsu! I ran I to another issue with BG layers.

I'm trying to do another test from scratch, to see if I'm understanding the proper usage of the systems addresses.

I'm unable to have all 4 bg layers appear at once, I think it's $212C that enables/disables all 4.

Now, I have my tileset in vram, starting at $0000. This tileset contains all the tiles of want to use for the 4 bg layers.

So my 4 bg base addresses are all pointing to $0000 in vram.

My tilemaps for all 4 bg layers are in is order, $4000 for bg1, $6000 for bg2, $8000 for bg3, $A000 for bg4.

Using bsnes's debugger, I'm able to view the tilemaps, they correctly displays the vrams base addresses, and tile map addresses.

When I go to the tilemap location for bg1, I manually insert a tile I'd using the hex editor. I see the tile display on the main screen.

I do this for the other 3 tile map addresses, and nothing gets displayed. Bg1 I put the tile I'd at $4000, bg2 at $6002, bg3 at $8004, and bg4 at $A006.

Now here's the thing, the tilemap viewer in bsnes, actually let's you view all 4 bag's tilemaps. And when I view all 4 tilemaps, I see the individual tile that I placed of all 4 bg layers.

What am I missing, or doing wrong? Thanks!


Top
 Profile  
 
PostPosted: Mon Apr 23, 2018 6:33 am 
Offline
User avatar

Joined: Mon Jan 23, 2006 7:47 am
Posts: 118
Are you in BG mode 0?

You could also post your source and/or ROM.


Top
 Profile  
 
PostPosted: Mon Apr 23, 2018 6:38 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 301
I'm at work now. I believe I'm in mode 0 from the STZ'S I did in my initialization of all the systems addresses.


Top
 Profile  
 
PostPosted: Mon Apr 23, 2018 2:48 pm 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 301
This is my code, so again my tilemaps for all 4 BG's display the tile I place, but the main screen only shows BG1 on, when I have $212C set to enable all 4 BG layers....

Code:
;snes initialize
008000 sei
008001 clc
008002 xce
008003 rep #$18
008005 ldx #$1fff
008008 txs
008009 jml $80800d
80800d sep #$30
80800f lda #$8f
808011 sta $2100
808014 stz $2101
808017 stz $2102
80801a stz $2103
80801d stz $2105
808020 stz $2106
808023 stz $2107
808026 stz $2108
808029 stz $2109
80802c stz $210a
80802f stz $210b
808032 stz $210c
808035 stz $210d
808038 stz $210d
80803b lda #$ff
80803d sta $210e
808040 sta $2110
808043 sta $2112
808046 sta $2114
808049 lda #$07
80804b sta $210e
80804e sta $2110
808051 sta $2112
808054 sta $2114
808057 stz $210f
80805a stz $210f
80805d stz $2111
808060 stz $2111
808063 stz $2113
808066 stz $2113
808069 lda #$80
80806b sta $2115
80806e stz $2116
808071 stz $2117
808074 stz $211a
808077 stz $211b
80807a lda #$01
80807c sta $211b
80807f stz $211c
808082 stz $211c
808085 stz $211d
808088 stz $211d
80808b stz $211e
80808e sta $211e
808091 stz $211f
808094 stz $211f
808097 stz $2120
80809a stz $2120
80809d stz $2121
8080a0 stz $2123
8080a3 stz $2124
8080a6 stz $2125
8080a9 stz $2126
8080ac stz $2127
8080af stz $2128
8080b2 stz $2129
8080b5 stz $212a
8080b8 stz $212b
8080bb sta $212c
8080be stz $212d
8080c1 stz $212e
8080c4 stz $212f
8080c7 lda #$30
8080c9 sta $2130
8080cc stz $2131
8080cf lda #$e0
8080d1 sta $2132
8080d4 stz $2133
8080d7 stz $4200
8080da lda #$ff
8080dc sta $4201
8080df stz $4202
8080e2 stz $4203
8080e5 stz $4204
8080e8 stz $4205
8080eb stz $4206
8080ee stz $4207
8080f1 stz $4208
8080f4 stz $4209
8080f7 stz $420a
8080fa stz $420b
8080fd stz $420c
808100 stz $420d
808103 cli

;wipe out snes $0000-$1FFF
808104 rep #$10
808106 ldy #$1fff
808109 lda #$00
80810b sta $0000,y
80810e dey
80810f bpl $810b

;enable sprites, & all 4 BG layers, and back up value to $0800 RAM
808111 lda #$1f
808113 sta $212c
808116 sta $0800

;BG 1-2 tile data location ($0000 VRAM)
;BG 3-4 tile data location ($0000 VRAM)
808119 lda #$00
80811b sta $210b
80811e lda #$00
808120 sta $210c

;sprite register??
808123 lda #$00
808125 sta $2101

;prepare OAM buffer at $200-$2FF, and set all Y positions to #$E0
808128 sep #$10
80812a ldy #$00
80812c lda #$e0
80812e sta $0201,y
808131 iny
808132 iny
808133 iny
808134 iny
808135 cpy #$00
808137 bne $812e

;store OAM buffer from $200-$2FF to OAM $0000-$00FF via DMA
808139 rep #$10
80813b sep #$20
80813d lda #$00
80813f sta $2102
808142 lda #$00
808144 sta $2103
808147 ldy #$0400
80814a sty $4300
80814d stz $4302
808150 lda #$02
808152 sta $4303
808155 lda #$7e
808157 sta $4304
80815a ldy #$0100
80815d sty $4305
808160 lda #$01
808162 sta $420b

;store OAM buffer from $200-$2FF to OAM $0100-$01FF via DMA
808165 lda #$80
808167 sta $2102
80816a lda #$00
80816c sta $2103
80816f ldy #$0400
808172 sty $4300
808175 stz $4302
808178 lda #$02
80817a sta $4303
80817d lda #$7e
80817f sta $4304
808182 ldy #$0100
808185 sty $4305
808188 lda #$01
80818a sta $420b

;set BG 1-4 tile map locations
80818d lda #$20
80818f sta $2107
808192 lda #$30
808194 sta $2108
808197 lda #$40
808199 sta $2109
80819c lda #$50
80819e sta $210a

;turn on brightness to full
8081a1 lda #$0f
8081a3 sta $2100

;infinite loop to brigtness full address
8081a6 jmp $81a1


Top
 Profile  
 
PostPosted: Mon Apr 23, 2018 3:46 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3435
Location: Mountain View, CA
Again: don't have linear time (i.e. hours) to allocate to this, but I did notice you're enabling main ***and*** sub screens on all your BGs (or most of them), but I haven't looked to see what screen add/sub settings you're using. I wasn't sure why you were tinkering with those registers (esp. sub screen) at all.


Top
 Profile  
 
PostPosted: Tue Apr 24, 2018 1:04 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 301
I'll rework the initi, because I was able to have 4bg layers before. Thanks for your info! :-)


Top
 Profile  
 
PostPosted: Wed Apr 25, 2018 1:51 pm 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 301
I'm having one hell of a time trying to write to the oam without using dma. I wanted to write specifically to $0100, so I set $2102 00, $2103 to 01, and then I picked a random value as FF, and wrote that to $2104. Nothing happens. :-/


Top
 Profile  
 
PostPosted: Wed Apr 25, 2018 2:09 pm 
Offline
User avatar

Joined: Mon Jan 23, 2006 7:47 am
Posts: 118
Are you writing in F/VBlank?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 103 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 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