Search found 114 matches

by Dafydd
Sat Feb 23, 2013 7:42 pm
Forum: Newbie Help Center
Topic: Accessing data or "strings" in data segment
Replies: 57
Views: 8097

Re: Accessing data or "strings" in data segment

Cool! The simulator does exactly what I was asking for. I tried tepples' code, changing the terminator in my string to $FF, but I would keep getting 256 of that wrong tile. I then changed the routine into @printstring: lda mystring,x bmi @printdone lda #$0E sta $2007 inx bne @printstring which would...
by Dafydd
Sat Feb 23, 2013 7:32 pm
Forum: Newbie Help Center
Topic: Accessing data or "strings" in data segment
Replies: 57
Views: 8097

Re: Accessing data or "strings" in data segment

Haha, you beat me to it. As edited above, I just found out about the Z flag - I'll read up on it and the other flags as well (the opcode ref chart I was using wasn't as informative as it should have been). Thanks for the help. It'd be pretty cool to have an editor where you have a status window or s...
by Dafydd
Sat Feb 23, 2013 7:21 pm
Forum: Newbie Help Center
Topic: Accessing data or "strings" in data segment
Replies: 57
Views: 8097

Re: Accessing data or "strings" in data segment

"inx bne" will increase X until it hits 256 and wraps to 0. You need to compare the byte to the terminator after the LDA. I thought bne compared A to 0, not whichever register you last modified. Which is it? EDIT: I just read up on the Z flag. Didn't know that thing even existed. This will certainl...
by Dafydd
Sat Feb 23, 2013 7:17 pm
Forum: Newbie Help Center
Topic: Universal background color
Replies: 50
Views: 8462

Re: Universal background color

So... in order to set PPUSCROLL to be actually 0,0 I need to write 0 to $2005 four consecutive times? And this must be done every time I've read PPUSTATUS? See, if I don't write to $2005 at all, my game starts scrolled down to 0,128 or something (in the emulator, at least), and for a while it seemed...
by Dafydd
Sat Feb 23, 2013 7:09 pm
Forum: Newbie Help Center
Topic: Accessing data or "strings" in data segment
Replies: 57
Views: 8097

Re: Accessing data or "strings" in data segment

Very nice. For now, I tried this: .segment "DATA" mystring: .byte $11, $0E, $15, $15, $18, 0 .segment "CODE" ... lda $2002 lda #$21 sta $2006 lda #$AC sta $2006 ldx #$00 @printstring: lda mystring,x sta $2007 inx bne @printstring But instead of getting the tiles listed in mystring I get other tiles ...
by Dafydd
Sat Feb 23, 2013 6:58 pm
Forum: Newbie Help Center
Topic: Universal background color
Replies: 50
Views: 8462

Re: Universal background color

So... I added some code to clear the nametables, and found that reading PPUSTATUS affects PPUSCROLL, which I now see is mentioned, but not really explained, in the wiki. Why does PPUSTATUS affect PPUSCROLL? Is this just a flaw in the hardware, or is it actually useful for something?
by Dafydd
Sat Feb 23, 2013 5:36 pm
Forum: Newbie Help Center
Topic: Accessing data or "strings" in data segment
Replies: 57
Views: 8097

Re: Accessing data or "strings" in data segment

Good thing I asked, then, hehe. Thanks for the pointer.
by Dafydd
Sat Feb 23, 2013 5:16 pm
Forum: Newbie Help Center
Topic: Accessing data or "strings" in data segment
Replies: 57
Views: 8097

Re: Accessing data or "strings" in data segment

Alright. Thanks!

One more question - is there a convention for label names, like, which labels should begin with @ and so on?
by Dafydd
Sat Feb 23, 2013 4:35 pm
Forum: Newbie Help Center
Topic: Accessing data or "strings" in data segment
Replies: 57
Views: 8097

Accessing data or "strings" in data segment

I want to make a routine that reads data from a "string" or "array" in the data segment and prints text on the screen ( very advanced stuff, I know). I think I can do .segment "DATA" .word $11, $0E, $15, $15, $18 where the numbers are the tile indexes for "hello", set $2006 to $21CD or something and...
by Dafydd
Fri Feb 22, 2013 2:00 pm
Forum: Newbie Help Center
Topic: Universal background color
Replies: 50
Views: 8462

Re: Universal background color

Thanks for the advice.

(On a side note, I ******* love you guys. Had this been the average linux forum or something, I would have been called names and made fun of for asking things like this. Instead, I get my questions answered by legends. So... thanks :))
by Dafydd
Fri Feb 22, 2013 1:47 pm
Forum: Newbie Help Center
Topic: Universal background color
Replies: 50
Views: 8462

Re: Universal background color

I'm a pretty bad programmer until further notice (at least as far as NES and assembler are concerned), so I think I'll keep running the RAM clearing routine ^^

Writing to $3F00 only once during a frame seems to have fixed the issue. I'll keep that in mind.
by Dafydd
Fri Feb 22, 2013 1:24 pm
Forum: Newbie Help Center
Topic: Universal background color
Replies: 50
Views: 8462

Re: Universal background color

Couldn't the same be said for CPU RAM, then? In the example code, CPU RAM is being cleared while waiting for the PPU to stabilize (as we don't know for sure it's all zeroes when starting up. My computer does the same when booting afaik). I guess it's more of a convenience rather than anything else, ...
by Dafydd
Fri Feb 22, 2013 1:03 pm
Forum: Newbie Help Center
Topic: Universal background color
Replies: 50
Views: 8462

Re: Universal background color

What about the pattern name tables, palettes and stuff? Don't they need to be cleared? (I might be confusing VRAM with something else.)
by Dafydd
Fri Feb 22, 2013 12:47 pm
Forum: Newbie Help Center
Topic: Universal background color
Replies: 50
Views: 8462

Re: Universal background color

I figured that part out too. Thanks though! I tried loading the resulting ROM in an emulator and it works as expected, but on my PowerPak I get a random mess of red and white (looks a lot like the pizza sprites from the TMNT games, but zoomed to 800%). I'm guessing it's because I don't have any CHR ...
by Dafydd
Fri Feb 22, 2013 9:42 am
Forum: Newbie Help Center
Topic: Universal background color
Replies: 50
Views: 8462

Re: Universal background color

I was just about to write something similar, yes. I'd missed the part about not being able to write to PPU memory directly. Thanks!

EDIT: Weeee, it's working! :D