Compare commits
2 Commits
76fe4ad877
...
6c2e4cee5a
Author | SHA1 | Date | |
---|---|---|---|
|
6c2e4cee5a | ||
|
d3a383951f |
34
Makefile
34
Makefile
@ -1,34 +0,0 @@
|
||||
#all: smc
|
||||
all: test_gfx
|
||||
|
||||
BINPATH := /home/greg/code/wla-dx/binaries
|
||||
|
||||
|
||||
test_gfx: test_gfx.obj
|
||||
$(BINPATH)/wlalink -v -r test_gfx.link test_gfx.smc
|
||||
|
||||
test_gfx.obj: test_gfx.asm
|
||||
$(BINPATH)/wla-65816 -v -o test_gfx.obj test_gfx.asm
|
||||
|
||||
|
||||
tic_tac: tic_tac.obj
|
||||
$(BINPATH)/wlalink -v -r tic_tac.link tic_tac.smc
|
||||
|
||||
|
||||
tic_tac.obj: tic_tac.asm
|
||||
$(BINPATH)/wla-65816 -v -o tic_tac.obj tic_tac.asm
|
||||
|
||||
|
||||
greenspace.obj: greenspace.asm
|
||||
wla-65816 -vo greenspace.asm greenspace.obj
|
||||
|
||||
|
||||
smc: greenspace.obj
|
||||
wlalink -vr greenspace.link greenspace.smc
|
||||
|
||||
|
||||
clean:
|
||||
rm -f *.obj
|
||||
rm -f greenspace.smc
|
||||
rm -f tic_tac.smc
|
||||
rm -f test_gfx.smc
|
262
tic_tac.asm
262
tic_tac.asm
@ -1,262 +0,0 @@
|
||||
.include "header.inc"
|
||||
.include "snes_init.asm"
|
||||
.include "my_custom.asm"
|
||||
|
||||
.BANK 0 SLOT 0
|
||||
.org 0
|
||||
.section "Vblank"
|
||||
|
||||
VBlank:
|
||||
rti
|
||||
|
||||
.ENDS
|
||||
|
||||
.BANK 0 SLOT 0
|
||||
.ORG 0
|
||||
.section "Main"
|
||||
|
||||
Start:
|
||||
Snes_Init
|
||||
|
||||
; 16-bit xy, 8-bit a
|
||||
rep #%00010000
|
||||
sep #%00100000
|
||||
|
||||
; Load palette by writing to $2122
|
||||
; .db $00, $00, $E0, $7F, $1F, $00, $FF, $03
|
||||
|
||||
Load_Palette_Color $00, $00
|
||||
Load_Palette_Color $e0, $7f
|
||||
Load_Palette_Color $1f, $00
|
||||
Load_Palette_Color $ef, $0a
|
||||
|
||||
|
||||
lda #33
|
||||
sta $2121 ; address for CG RAM write
|
||||
lda.l Palette2
|
||||
sta $2122
|
||||
lda.l Palette2 + 1
|
||||
sta $2122
|
||||
|
||||
ldx #UntitledData
|
||||
lda #:UntitledData
|
||||
ldy #(15*16*2)
|
||||
|
||||
;$43X0 is DMA register X, X from 0 to 7
|
||||
stx $4302 ;A address low byte
|
||||
sta $4304 ;A address bank
|
||||
sty $4305 ;number of bytes to transfer
|
||||
|
||||
lda #%00000001 ;set mode transfer words
|
||||
sta $4300
|
||||
|
||||
lda #$18 ; $211[89]: VRAM data write
|
||||
sta $4301 ; set destination
|
||||
|
||||
ldy #$0000
|
||||
sty $2116
|
||||
|
||||
lda #%00000001
|
||||
sta $420b ;start DMA
|
||||
|
||||
|
||||
; write to BG1
|
||||
|
||||
lda #%10000000 ; VRAM writing mode
|
||||
sta $2115
|
||||
|
||||
ldx #$5000
|
||||
stx $2116 ; write to VRAM
|
||||
|
||||
;ugly code starts here - it writes the # shape I mentioned before.
|
||||
.rept 2
|
||||
;X|X|X
|
||||
.rept 2
|
||||
ldx #$0000 ; tile 0 ( )
|
||||
stx $2118
|
||||
ldx #$0002 ; tile 2 (|)
|
||||
stx $2118
|
||||
.endr
|
||||
ldx #$0000
|
||||
stx $2118
|
||||
;first line finished, add BG's
|
||||
.rept 27
|
||||
stx $2118 ; X=0
|
||||
.endr
|
||||
;beginning of 2nd line
|
||||
;-+-+-
|
||||
.rept 2
|
||||
ldx #$0004 ; tile 4 (-)
|
||||
stx $2118
|
||||
ldx #$0006 ; tile 6 (+)
|
||||
stx $2118
|
||||
.endr
|
||||
ldx #$0004 ; tile 4 (-)
|
||||
stx $2118
|
||||
ldx #$0000
|
||||
.rept 27
|
||||
stx $2118
|
||||
.endr
|
||||
.endr
|
||||
.rept 2
|
||||
ldx #$0000 ; tile 0 ( )
|
||||
stx $2118
|
||||
ldx #$0002 ; tile 2 (|)
|
||||
stx $2118
|
||||
.endr
|
||||
|
||||
|
||||
|
||||
; BG2 starts at $6000
|
||||
ldx #$6000
|
||||
stx $2116
|
||||
|
||||
ldx #$000c ;and contains one tile
|
||||
stx $2118 ;data for VRAM write register
|
||||
|
||||
|
||||
|
||||
|
||||
; set up the screen
|
||||
|
||||
lda #%00110000 ; 16x16 tiles, mode 0
|
||||
sta $2105 ; $2105 is the mode for bg mode + tile size
|
||||
|
||||
lda #$50 ; data starts from $4000
|
||||
sta $2107 ; for bg1 ; $2107 is address of tile map location for BG1
|
||||
; tile map location registers:
|
||||
; %aaaaaass
|
||||
; a's <- tile map address location, << 11
|
||||
; ss <- 32x32, 32x64, 32x64, 64x64
|
||||
|
||||
lda #60 ; and $6000
|
||||
sta $2108 ; for bg2 ; and $2108 is tile map location for BG2
|
||||
|
||||
stz $210b ; BG1 and BG2 use the $0000 tiles
|
||||
|
||||
lda #%00000011 ; enable bg1 and 2
|
||||
sta $212C
|
||||
|
||||
;The PPU doesn't process the top line, so we scroll down 1 line.
|
||||
rep #$20 ; 16bit a
|
||||
lda #$07FF ; this is -1 for BG1
|
||||
sep #$20 ; 8bit a
|
||||
sta $210E ; BG1 vert scroll
|
||||
xba
|
||||
sta $210E
|
||||
|
||||
rep #$20 ; 16bit a
|
||||
lda #$FFFF ; this is -1 for BG2
|
||||
sep #$20 ; 8bit a
|
||||
sta $2110 ; BG2 vert scroll
|
||||
xba
|
||||
sta $2110
|
||||
|
||||
lda #%00001111 ; enable screen, set brightness to 15
|
||||
sta $2100
|
||||
|
||||
lda #%10000001 ; enable NMI and joypads
|
||||
sta $4200
|
||||
|
||||
mainloop:
|
||||
Spin_Loop $02
|
||||
|
||||
Reset_Palette_Offset
|
||||
|
||||
Load_Palette_Color $00, $00
|
||||
Load_Palette_Color $e0, $7f
|
||||
Load_Palette_Color $1f, $00
|
||||
Load_Palette_Color $ff, $0a
|
||||
|
||||
lda #$00
|
||||
sta $2122
|
||||
lda #$00
|
||||
sta $2122
|
||||
lda #$e0
|
||||
sta $2122
|
||||
lda #$7f
|
||||
sta $2122
|
||||
lda #$1f
|
||||
sta $2122
|
||||
lda #$00
|
||||
sta $2122
|
||||
lda #$ff
|
||||
sta $2122
|
||||
lda #$0a
|
||||
sta $2122
|
||||
|
||||
;change brightness
|
||||
;lda #%00000011
|
||||
;sta $2100
|
||||
|
||||
;lda #%00110000
|
||||
;sta $2105
|
||||
|
||||
Spin_Loop $02
|
||||
|
||||
Reset_Palette_Offset
|
||||
|
||||
Load_Palette_Color $09, $00
|
||||
Load_Palette_Color $e0, $7f
|
||||
Load_Palette_Color $1f, $00
|
||||
Load_Palette_Color $ff, $7f
|
||||
|
||||
;lda #$0f
|
||||
;sta $2100
|
||||
|
||||
;lda #%00000000
|
||||
;sta $2105
|
||||
|
||||
jmp mainloop
|
||||
|
||||
.ENDS
|
||||
|
||||
|
||||
.BANK 1 SLOT 0
|
||||
.org 0
|
||||
.section "TileData"
|
||||
|
||||
UntitledData:
|
||||
.db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
||||
.db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
||||
.db $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03
|
||||
.db $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0
|
||||
.db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $FF, $FF, $FF, $FF
|
||||
.db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $FF, $FF, $FF, $FF
|
||||
.db $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $FF, $FF, $FF, $FF
|
||||
.db $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $FF, $FF, $FF, $FF
|
||||
.db $00, $C0, $00, $E0, $00, $70, $00, $38, $00, $1C, $00, $0E, $00, $07, $00, $03
|
||||
.db $00, $03, $00, $07, $00, $0E, $00, $1C, $00, $38, $00, $70, $00, $E0, $00, $C0
|
||||
.db $00, $07, $00, $0F, $00, $18, $00, $30, $00, $60, $00, $C0, $00, $C0, $00, $C0
|
||||
.db $00, $E0, $00, $F0, $00, $18, $00, $0C, $00, $06, $00, $03, $00, $03, $00, $03
|
||||
.db $FC, $00, $F8, $00, $F0, $00, $E0, $00, $C0, $00, $80, $00, $00, $00, $00, $00
|
||||
.db $3F, $00, $1F, $00, $0F, $00, $07, $00, $03, $00, $01, $00, $00, $00, $00, $00
|
||||
.db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
||||
.db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
||||
.db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
||||
.db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
||||
.db $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03
|
||||
.db $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0
|
||||
.db $FF, $FF, $FF, $FF, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
||||
.db $FF, $FF, $FF, $FF, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
||||
.db $FF, $FF, $FF, $FF, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03
|
||||
.db $FF, $FF, $FF, $FF, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0
|
||||
.db $00, $03, $00, $07, $00, $0E, $00, $1C, $00, $38, $00, $70, $00, $E0, $00, $C0
|
||||
.db $00, $C0, $00, $E0, $00, $70, $00, $38, $00, $1C, $00, $0E, $00, $07, $00, $03
|
||||
.db $00, $C0, $00, $C0, $00, $C0, $00, $60, $00, $30, $00, $18, $00, $0F, $00, $07
|
||||
.db $00, $03, $00, $03, $00, $03, $00, $06, $00, $0C, $00, $18, $00, $F0, $00, $E0
|
||||
.db $00, $00, $00, $00, $80, $00, $C0, $00, $E0, $00, $F0, $00, $F8, $00, $FC, $00
|
||||
.db $00, $00, $00, $00, $01, $00, $03, $00, $07, $00, $0F, $00, $1F, $00, $3F, $00
|
||||
|
||||
UntitledPalette:
|
||||
;color schema here is %0RRRRRBB BBBGGGGG
|
||||
; final 2 bytes seem to be grid
|
||||
;.db %00000000, %00000000, %11100000, %01111111, %00011111, %00000000, %00000011 %11111111
|
||||
.db $00, $00, $E0, $7F, $1F, $00, $FF, $03
|
||||
Palette2:
|
||||
.db $E0, $7F
|
||||
|
||||
; 30 tiles (2 spaces)
|
||||
; 480 bytes
|
||||
|
||||
.ENDS
|
@ -1,2 +0,0 @@
|
||||
[objects]
|
||||
tic_tac.obj
|
Loading…
Reference in New Issue
Block a user