mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-11-22 14:33:51 +00:00
nes: updated presets
This commit is contained in:
parent
2f55ba9bf0
commit
f806ba6a25
@ -35,6 +35,19 @@ Start:
|
||||
.endless
|
||||
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
|
||||
HelloVRAM: subroutine
|
||||
; set PPU address to name table A (row 1, col 1)
|
||||
@ -54,19 +67,6 @@ HelloMsg:
|
||||
.byte "Hello, World!"
|
||||
.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
|
||||
|
||||
include "nesppu.dasm"
|
||||
|
@ -37,6 +37,18 @@ Start:
|
||||
.endless
|
||||
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
|
||||
FillVRAM: subroutine
|
||||
PPU_SETADDR $2000
|
||||
@ -55,18 +67,6 @@ PageData:
|
||||
hex 42424242 ; 'B'
|
||||
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
|
||||
|
||||
|
@ -41,6 +41,18 @@ Start:
|
||||
.endless
|
||||
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
|
||||
FillVRAM: subroutine
|
||||
PPU_SETADDR $2000
|
||||
@ -81,18 +93,6 @@ MoveSprites: subroutine
|
||||
bne .loop ; loop until X wraps
|
||||
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
|
||||
|
||||
|
@ -36,6 +36,18 @@ Start:
|
||||
.endless
|
||||
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
|
||||
FillVRAM: subroutine
|
||||
PPU_SETADDR $2000
|
||||
@ -49,18 +61,6 @@ FillVRAM: subroutine
|
||||
bne .loop
|
||||
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
|
||||
|
||||
|
@ -80,7 +80,7 @@ ShowTimeEnd:
|
||||
|
||||
include "nesppu.dasm"
|
||||
|
||||
include "famitone2.asm"
|
||||
include "famitone2.dasm"
|
||||
|
||||
;;;;; INTERRUPT HANDLERS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user