@@ 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