~rabbits/spacetime

af9478f9bda916fc8ca7b28e2a1857072011d800 — Devine Lu Linvega 4 years ago 50a3b2d
*
2 files changed, 57 insertions(+), 62 deletions(-)

M src/cart.asm
M src/sprite.chr
M src/cart.asm => src/cart.asm +57 -62
@@ 44,89 44,84 @@ clrmem:                        ;
vblankwait2:                   ; Second wait for vblank, PPU is ready after this
	BIT $2002
	BPL vblankwait2
	JSR LoadPalettes
	JSR LoadAttributes
	JSR Redraw

;; Main
EnableSprites:                 ;
	LDA #%10010000               ; enable NMI, sprites from Pattern Table 0, background from Pattern Table 1
	STA $2000
	LDA #%00011110               ; enable sprites, enable background, no clipping on left side
	STA $2001
	LDA #$00                     ; No background scrolling
	STA $2006
	STA $2006
	STA $2005
	STA $2005

	LDA #$10
	LDX #$04
Forever:                       ;
	JMP Forever                  ; jump back to Forever, infinite loop

;; interface

RedrawMeter:
	; selector
	LDA #$04
	LDX #$2d
	LDY #$22
	JSR DrawAt
	LDA #$11
	LDX #$05
	; speed
	LDA #$24
	LDX #$48
	LDY #$22
	JSR DrawAt
	LDA #$12
	LDX #$06
	LDA #$2a
	LDX #$49
	LDY #$22
	JSR DrawAt
	LDA #$13
	LDX #$07
	; note
	LDA #$2e
	LDX #$57
	LDY #$22
	JSR DrawAt
	LDA #$14
	LDX #$08
	LDA #$2f
	LDX #$58
	LDY #$22
	JSR DrawAt
	LDA #$15
	LDX #$09
	; time
	LDA #$23
	LDX #$50
	LDY #$22
	JSR DrawAt
	LDA #$16
	LDX #$0a
	LDA #$2b
	LDX #$51
	LDY #$22
	JSR DrawAt
	LDA #$17
	LDX #$0b
	; selection
	LDA #$1d
	LDX #$16
	LDY #$22
	JSR DrawAt
	RTS 

RedrawLine:
	RTS 

RedrawTimeline:
	LDA #$10
	LDX #$0c
	LDY #$22
	JSR DrawAt
	LDA #$11
	LDX #$0d
	LDY #$22
	JSR DrawAt
	LDA #$19
	LDX #$0e
	LDY #$22
	JSR DrawAt
	LDA #$13
	LDX #$0f
	LDY #$22
	JSR DrawAt
	LDA #$14
	LDX #$10
	LDY #$22
	JSR DrawAt
	LDA #$15
	LDX #$11
	LDY #$22
	JSR DrawAt
	LDA #$16
	LDX #$12
	LDY #$22
	JSR DrawAt
	LDA #$17
	LDX #$13
	LDX #$07
	LDY #$22
@loop:                         ;
	INX 
	JSR DrawAt
	JSR LoadPalettes
	JSR LoadAttributes

EnableSprites:                 ;
	LDA #%10010000               ; enable NMI, sprites from Pattern Table 0, background from Pattern Table 1
	STA $2000
	LDA #%00011110               ; enable sprites, enable background, no clipping on left side
	STA $2001
	LDA #$00                     ; No background scrolling
	STA $2006
	STA $2006
	STA $2005
	STA $2005
	CPX #$18
	BNE @loop
	RTS 

Forever:                       ;
	JMP Forever                  ; jump back to Forever, infinite loop
Redraw:
	JSR RedrawTimeline
	JSR RedrawMeter
	RTS 

DrawAt:                        ; (a:id,x,y)
	STY $2006


@@ 186,7 181,7 @@ attributes:                    ;
	.db %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000

palettes:                      ;
	.db $0F,$3B,$16,$2D, $3B,$3B,$0F,$0F, $0F,$3B,$0F,$0F, $0F,$3B,$0F,$0F
	.db $0F,$3B,$16,$30, $3B,$3B,$0F,$0F, $0F,$3B,$0F,$0F, $0F,$3B,$0F,$0F
	.db $0F,$10,$17,$07, $0F,$3B,$0F,$0F, $0F,$0F,$0F,$0F, $0F,$0F,$0F,$0F

;; Vectors

M src/sprite.chr => src/sprite.chr +0 -0