Trying to get VRAM DMA to work
For tile map
This commit is contained in:
parent
3ef2eee4b0
commit
23bdc734bb
19
test_gfx.asm
19
test_gfx.asm
@ -26,7 +26,7 @@ VBlank:
|
|||||||
Video_Port_Control
|
Video_Port_Control
|
||||||
|
|
||||||
ldx #DEST
|
ldx #DEST
|
||||||
stx $2116 ; $2116/2117 is 2byte address for VRAM upload/download. most significant bit must be 0
|
stx $2116 ; $2116/2117 is 2byte address for VRAM upload/download. most significant bit must be 0
|
||||||
|
|
||||||
lda #:SOURCE ; source bank
|
lda #:SOURCE ; source bank
|
||||||
ldx #SOURCE ; source offset
|
ldx #SOURCE ; source offset
|
||||||
@ -64,7 +64,6 @@ Start:
|
|||||||
|
|
||||||
; size (last argument) depends on color mode
|
; size (last argument) depends on color mode
|
||||||
; location is beginning of VRAM
|
; location is beginning of VRAM
|
||||||
Load_Block_to_VRAM Tiles, $0000, (8*2*2),
|
|
||||||
|
|
||||||
; put character data at VRAM $0000, tile data at $0400
|
; put character data at VRAM $0000, tile data at $0400
|
||||||
lda #$04
|
lda #$04
|
||||||
@ -72,10 +71,15 @@ Start:
|
|||||||
lda #$00
|
lda #$00
|
||||||
sta $210b ; BG1 character location ($1000 word intervals - can't go over $8000 b/c size of VRAM)
|
sta $210b ; BG1 character location ($1000 word intervals - can't go over $8000 b/c size of VRAM)
|
||||||
|
|
||||||
|
stz $1337
|
||||||
|
|
||||||
; main screen designation
|
; main screen designation
|
||||||
lda #%00000001
|
lda #%00000001
|
||||||
sta $212c ; enable bkg 1,
|
sta $212c ; enable bkg 1,
|
||||||
|
|
||||||
|
; Load_Block_to_VRAM TileMap, $0400, 16
|
||||||
|
Load_Block_to_VRAM Tiles, $0000, (8*2*2),
|
||||||
|
|
||||||
ldx #$0400 ; load $0400 (VRAM address of tile data)
|
ldx #$0400 ; load $0400 (VRAM address of tile data)
|
||||||
TileLoadLoop:
|
TileLoadLoop:
|
||||||
|
|
||||||
@ -95,7 +99,6 @@ TileLoadLoop:
|
|||||||
cpx #$0780 ; $400 - $780 seems to be limit of snes screen tile memory
|
cpx #$0780 ; $400 - $780 seems to be limit of snes screen tile memory
|
||||||
bne TileLoadLoop
|
bne TileLoadLoop
|
||||||
|
|
||||||
|
|
||||||
lda #%10000001 ; enable NMI and joypads
|
lda #%10000001 ; enable NMI and joypads
|
||||||
sta $4200
|
sta $4200
|
||||||
|
|
||||||
@ -156,4 +159,14 @@ Tiles:
|
|||||||
.db %00111100
|
.db %00111100
|
||||||
.db %00111100
|
.db %00111100
|
||||||
|
|
||||||
|
TileMap:
|
||||||
|
.db $00, $01
|
||||||
|
.db $00, $01
|
||||||
|
.db $00, $01
|
||||||
|
.db $00, $01
|
||||||
|
.db $00, $01
|
||||||
|
.db $00, $01
|
||||||
|
.db $00, $01
|
||||||
|
.db $00, $01
|
||||||
|
|
||||||
.ENDS
|
.ENDS
|
||||||
|
Loading…
Reference in New Issue
Block a user