11 March 2016 - Forum Rules
Started by yugisokubodai, June 05, 2016, 08:17:15 PM
1. Header2. Initalization3. Main code like this sep #$20 rep #$10 lda #$11 //bg1 16x16, mode 1 sta $2105 lda #$04 //Tile map location $400 Vram[b]sta $2107[/b]lda #$01 //Tileset address at $1000[b]sta $210b[/b]lda #$01sta $212c //enable bg1lda #$80sta $2115ldx #$1000[b]stx $2116[/b]wait_vblank: lda $4210 and #$80 bit #$80 beq wait_vblank ldx #$0000 REP #$20 write_tile: lda sprite,x [b]sta $2118[/b] inx inx [b]cpx #$0800[/b] //2048 bytes bne write_tilestz $210D //BG1 scrollstz $210ELDA #$02STA $2121 sep #$20 rep #$10 lda #$1f sta $2122 lda #$3c sta $2122infinity: jmp infinity sprite: incbin "sprite.smc"
Quote from: yugisokubodai on June 05, 2016, 08:17:15 PMStoring 04 to $2107 means that the tile map starts at $400 x 2 = $800 in Vram. So which register I should write to in order to make the tiles appear from $800? For example, I want the tile #02 to appear at (0,0) and tile #03 to appear at (0,1) at the upper left corner.
QuoteStoring 01 to $210B means that the tile set (graphic data) starts at $1000 x 2 = $2000 in Vram. I'm clear at this point, but not with $2116 as described below.
QuoteAccording to some documents, $2116 is described as "This register is used to set the initial address for a VRAM upload or download". So what exactly it does?
lda #$0400sta $2116 ; set PPU Addr to word address 0400lda #$FFEEsta $2118 ; write the word 'FFEE' to VRAM
QuoteAlthought the tile data appears from $2000 Vram, but actually $2118 will write the data from $800. So my understanding is, whatever the value of $210B is, the actual graphic data will be at whatever address that $2116 tells. Is my understanding right?
QuoteThis write tile (graphic data) to Vram, since I use 32x32 screen, so there're 2048 bytes to write. But I checked the Vram and there's only #$400. I wonder why. My graphic data is also 2048 bytes.
QuoteThe tile #0A will appear at (1,1) of the screen (row 1, column 1)
Quote from: yugisokubodai on June 05, 2016, 10:28:01 PMThen, how to write the actual tileset (pattern) to $1000? If $2118 is used to write tile #, then which register is used to write the graphic data to $1000?
Quote from: yugisokubodai on June 07, 2016, 07:11:37 PMThe problem is when I wrote to $2121 and $2122, it effects BG1 (the portrait) and BG3 (tex).What should I do to seperate one palette for BG1 and one for BG3?
Each entry in the tilemap is 2 bytes, formatted as (high low): vhopppcc cccccccc v/h = Vertical/Horizontal flip this tile. o = Tile priority. ppp = Tile palette. The number of entries in the palette depends on the Mode and the BG. cccccccccc = Tile number.
Quote from: UltimateUrinater on July 23, 2016, 01:53:21 AMWait..did you create those graphics yourself? Cuz I have been looking for a simple way to create snes graphics of my own...Maybe i just havent been searching hard enough.
Page created in 0.055 seconds with 19 queries.