1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-26 10:49:17 +00:00

nes: updated presets

This commit is contained in:
Steven Hugg 2019-07-21 22:55:50 -04:00
parent 2f55ba9bf0
commit f806ba6a25
5 changed files with 50 additions and 50 deletions

View File

@ -35,6 +35,19 @@ Start:
.endless .endless
jmp .endless ; endless loop jmp .endless ; endless loop
; set palette colors
SetPalette: subroutine
; set PPU address to palette start
PPU_SETADDR $3f00
ldy #0
.loop:
lda Palette,y ; lookup byte in ROM
sta PPU_DATA ; store byte to PPU data
iny ; Y = Y + 1
cpy #32 ; is Y equal to 32?
bne .loop ; not yet, loop
rts ; return to caller
; fill video RAM with "Hello World" msg ; fill video RAM with "Hello World" msg
HelloVRAM: subroutine HelloVRAM: subroutine
; set PPU address to name table A (row 1, col 1) ; set PPU address to name table A (row 1, col 1)
@ -54,19 +67,6 @@ HelloMsg:
.byte "Hello, World!" .byte "Hello, World!"
.byte 0 ; zero terminator .byte 0 ; zero terminator
; set palette colors
SetPalette: subroutine
; set PPU address to palette start
PPU_SETADDR $3f00
ldy #0
.loop:
lda Palette,y ; lookup byte in ROM
sta PPU_DATA ; store byte to PPU data
iny ; Y = Y + 1
cpy #32 ; is Y equal to 32?
bne .loop ; not yet, loop
rts ; return to caller
;;;;; COMMON SUBROUTINES ;;;;; COMMON SUBROUTINES
include "nesppu.dasm" include "nesppu.dasm"

View File

@ -37,6 +37,18 @@ Start:
.endless .endless
jmp .endless ; endless loop jmp .endless ; endless loop
; set palette colors
SetPalette: subroutine
PPU_SETADDR $3f00
ldy #0
.loop:
lda Palette,y ; lookup byte in ROM
sta PPU_DATA ; store byte to PPU data
iny ; Y = Y + 1
cpy #32 ; is Y equal to 32?
bne .loop ; not yet, loop
rts ; return to caller
; fill video RAM ; fill video RAM
FillVRAM: subroutine FillVRAM: subroutine
PPU_SETADDR $2000 PPU_SETADDR $2000
@ -55,18 +67,6 @@ PageData:
hex 42424242 ; 'B' hex 42424242 ; 'B'
hex 41414141 ; 'A' hex 41414141 ; 'A'
; set palette colors
SetPalette: subroutine
PPU_SETADDR $3f00
ldy #0
.loop:
lda Palette,y ; lookup byte in ROM
sta PPU_DATA ; store byte to PPU data
iny ; Y = Y + 1
cpy #32 ; is Y equal to 32?
bne .loop ; not yet, loop
rts ; return to caller
;;;;; COMMON SUBROUTINES ;;;;; COMMON SUBROUTINES

View File

@ -41,6 +41,18 @@ Start:
.endless .endless
jmp .endless ;endless loop jmp .endless ;endless loop
; set palette colors
SetPalette: subroutine
PPU_SETADDR $3f00
ldy #0
.loop:
lda Palette,y ; lookup byte in ROM
sta PPU_DATA ; store byte to PPU data
iny ; Y = Y + 1
cpy #32 ; is Y equal to 32?
bne .loop ; not yet, loop
rts ; return to caller
; fill video RAM ; fill video RAM
FillVRAM: subroutine FillVRAM: subroutine
PPU_SETADDR $2000 PPU_SETADDR $2000
@ -81,18 +93,6 @@ MoveSprites: subroutine
bne .loop ; loop until X wraps bne .loop ; loop until X wraps
rts ; return to caller rts ; return to caller
; set palette colors
SetPalette: subroutine
PPU_SETADDR $3f00
ldy #0
.loop:
lda Palette,y ; lookup byte in ROM
sta PPU_DATA ; store byte to PPU data
iny ; Y = Y + 1
cpy #32 ; is Y equal to 32?
bne .loop ; not yet, loop
rts ; return to caller
;;;;; COMMON SUBROUTINES ;;;;; COMMON SUBROUTINES

View File

@ -36,6 +36,18 @@ Start:
.endless .endless
jmp .endless ;endless loop jmp .endless ;endless loop
; set palette colors
SetPalette: subroutine
PPU_SETADDR $3f00
ldy #0
.loop:
lda Palette,y ; lookup byte in ROM
sta PPU_DATA ; store byte to PPU data
iny ; Y = Y + 1
cpy #32 ; is Y equal to 32?
bne .loop ; not yet, loop
rts ; return to caller
; fill video RAM ; fill video RAM
FillVRAM: subroutine FillVRAM: subroutine
PPU_SETADDR $2000 PPU_SETADDR $2000
@ -49,18 +61,6 @@ FillVRAM: subroutine
bne .loop bne .loop
rts rts
; set palette colors
SetPalette: subroutine
PPU_SETADDR $3f00
ldy #0
.loop:
lda Palette,y ; lookup byte in ROM
sta PPU_DATA ; store byte to PPU data
iny ; Y = Y + 1
cpy #32 ; is Y equal to 32?
bne .loop ; not yet, loop
rts ; return to caller
;;;;; COMMON SUBROUTINES ;;;;; COMMON SUBROUTINES

View File

@ -80,7 +80,7 @@ ShowTimeEnd:
include "nesppu.dasm" include "nesppu.dasm"
include "famitone2.asm" include "famitone2.dasm"
;;;;; INTERRUPT HANDLERS ;;;;; INTERRUPT HANDLERS