menu progress, led pwm, db tweaks

This commit is contained in:
ikari
2009-11-04 19:11:10 +01:00
parent c685f9a09f
commit 3b4b1b8069
11 changed files with 94 additions and 60 deletions

View File

@@ -1,4 +1,4 @@
OBJS = header.ips reset.o65 main.o65 font.o65 palette.o65 data.o65 const.o65 logo.o65 text.o65 dma.o65 # gfx.o65 # vars.o65
OBJS = header.ips reset.o65 main.o65 font.o65 palette.o65 data.o65 const.o65 logo.o65 text.o65 dma.o65 menu.o65 # gfx.o65 # vars.o65
all: menu.bin

View File

@@ -1,6 +1,13 @@
.data
;don't anger the stack!
;padding is necessary because snescom wouldn't heed *=$7E0200.
dirlog .word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
stack .word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
@@ -9,14 +16,6 @@ stack .word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
;----------parameters for text output----------
print_x .byt 0 ;x coordinate
@@ -35,6 +34,7 @@ dma_len .word 0
dma_mode .byt 0
;----------state information----------
isr_done .byt 0 ; isr done flag
bar_xl .byt 0 ; logical x position of select bar
bar_yl .byt 0 ; logical y position of select bar
bar_x .byt 0 ; pixel x position of select bar

View File

@@ -45,7 +45,7 @@ NMI_8bit:
*= $C0FFB0
.byt "01" ;2 bytes - company id
.byt "MR" ;2 bytes - company id
.byt "SNSD" ;4 bytes - rom id
*= $C0FFC0

View File

@@ -8,17 +8,16 @@ GAME_MAIN:
jsr setup_hdma
jsr tests
jsr colortest
sep #$20 : .as
lda #$00
sta @$306000
lda #$50
sta @$306001
lda #$11
sta @$306002
lda #$00
sta @$306003
lda #$01
sta @$306004
sta @$AVR_CMD
sta @$AVR_BANK
rep #$20 : .al
sta @$AVR_ADDR
sep #$20 : .as
jsr menuloop
cli
stz $4200
jmp @infloop ;infinite loop in WRAM
colortest:
@@ -163,6 +162,8 @@ tests:
sta print_bank
stx print_src
jsr loprint
lda #10
sta bar_yl
rts
snes_init:

View File

@@ -23,17 +23,19 @@ NMI_ROUTINE:
ldx #BG2_TILE_BASE+32*10
stx $2116
DMA0(#$01, #$380*2-64*10, #^BG2_TILE_BUF, #!BG2_TILE_BUF+64*10, #$18);
DMA0(#$01, #$380*2-64*10, #^BG2_TILE_BUF, #!BG2_TILE_BUF+64*10, #$18)
ldx #BG2_TILE_BASE
stx $2116
DMA0(#$01, #64*10, #^BG2_TILE_BUF, #!BG2_TILE_BUF, #$18);
DMA0(#$01, #64*10, #^BG2_TILE_BUF, #!BG2_TILE_BUF, #$18)
lda bar_yl
asl
asl
asl
sta bar_y
lda bar_y
inc
bne +
inc
+
cmp #224
bne +
lda #1
@@ -47,16 +49,18 @@ NMI_ROUTINE:
bra math_cont
lower_half
clc
sbc #111
sbc #110
sta hdma_math+3
lda #112
sta hdma_math
math_cont
lda #$3e ; ch. 1-5
sta @$420c ; trigger HDMA
lda #$01
sta isr_done
rtl
; IRQ - called when triggered (which is..?)
; IRQ - called when triggered
IRQ_ROUTINE:
sep #$20 : .as
lda $4211 ;Acknowledge irq