Following the example of the VRAM map (https://nesdoug.com/2020/05/16/backgrounds/), I decided to make an identical one and I don't know how to set the TileSet 2BPP address for BGR3 in MODE1 to $ 3000 ??
VRAM MAP
$0000 4bpp BG tiles (768 of them)
$3000 2bpp BG tiles (512 of them) ; ???????
$4000 4bpp sprite tiles (512 of them)
$6000 layer 1 map (up to 2 screens)
$6800 layer 2 map (up to 2 screens)
$7000 layer 3 map (up to 2 screens)
$7800 layer 4 map (up to 2 screens)
From what I noticed, this is setting the TileMap base address for BGR3:
LDA #%00000011 ; writing $03 set $6000 VRAM addres, %0000 = $0000, %0001 = $2000, %0010 = $4000
STA $210C
But how do I set a $ 3000 address here?
Another question is how to read LOW / HIGH byte from label address (variable in frame or label in ROM) in WLA-DX?
In the case of a label in RAM, this is not a problem, because you can enter the address manually (e.g. $ 1C00)
sample code sending oam buffer to OAM:
Code: Select all
OAM_BUFFER: .res 512 ; low table (wram $1C00)
OAM_BUFFER2: .res 32 ; high table
(...)
LDX #$0000
STX $2102 ; OAM address
STZ $4300 ; transfer mode 0 = 1 register write once
LDA #4 ; $2104 oam data
STA $4301 ; destination, oam data
; LDX #$00
; STX $4302 ; source LOW (LOW/HIGH/BANK-> $4302/$4303/$4304) - adres 00x1C00
; LDA #$00
; STA $4303 ; source HIGH
; LDA #$00
; STA $4304 ; source BANK
LDX #$1C00
STX $4302
; LDX #$20
; STX $4305 ; length LOW (LOW/HIGH/BANK-> $4305/$4306/$4307) - adres 00x0220 (#544)
; LDX #$02
; STX $4305 ; length HIGHT (LOW/HIGH/BANK-> $4305/$4306/$4307)
; LDX #$00
; STX $4305 ; length BANK (LOW/HIGH/BANK-> $4305/$4306/$4307)
LDX #544
STX $4305 ; length (LOW/HIGH/BANK-> $4305/$4306/$4307)
LDA #1
STA $420B ; Start dma, channel 0
Code: Select all
LDX #.loword(OAM_BUFFER)
STX $4302 ; source (H/L $4302/$4303)
LDA #^OAM_BUFFER
STA $4304 ; bank
Code: Select all
LDA #<OAM_BUFFER ; get LO
STA $4302
; LDA #>OAM_BUFFER ; get HIGH (IN 16-BIT MODE A - I don't have to read HIGH anymore?)
; STA $4303
LDA #$00 ; bank 00 (set manually - I don't know how to read the bank from this label?)
STA $4304