Skip to content

Commit e6cd233

Browse files
committed
initial commit
1 parent 9260162 commit e6cd233

20 files changed

Lines changed: 1962 additions & 0 deletions

Makefile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.SUFFIXES :
2+
3+
TARGET := $(shell basename $(CURDIR))
4+
AS = wla-65816
5+
ASFLAGS = -voi
6+
LD = wlalink
7+
LFLAGS = -vbsi
8+
SOURCES := .
9+
export OUTPUT := $(CURDIR)/$(TARGET)
10+
11+
IFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.inc)))
12+
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
13+
export OFILES := $(SFILES:.s=.o)
14+
LSTFILES = $(SFILES:.s=.lst)
15+
16+
SUBDIRS = smcp/dspregAcc
17+
18+
.PHONY: all $(SUBDIRS)
19+
20+
all: $(SUBDIRS) $(TARGET)
21+
22+
$(SUBDIRS):
23+
$(MAKE) -C $@
24+
25+
spcp.bin:
26+
echo [objects] > linkfile
27+
echo spcp.o >> linkfile
28+
wla-spc700 -vo spcp.asm spcp.o
29+
wlalink -vb linkfile spcp.bin
30+
31+
$(TARGET): spcp.bin $(OFILES) Makefile
32+
echo [objects] > linkfile
33+
$(foreach ofile,$(OFILES),echo $(ofile) >> linkfile;)
34+
$(LD) $(LFLAGS) linkfile $(TARGET).bin
35+
rm -f linkfile
36+
rm -f $(OFILES) spcp.o spcp.bin
37+
38+
$(OFILES): $(SFILES) $(IFILES) Makefile
39+
$(foreach src,$(SFILES),$(AS) $(ASFLAGS) $(src);)
40+
41+
clean:
42+
rm -f $(OFILES) *.lst linkfile $(TARGET).sym $(TARGET).bin
43+
(for i in $(SUBDIRS) ; do $(MAKE) -C $$i clean || true ; done)

README.md

Whitespace-only changes.

playercode.s

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
.MEMORYMAP
2+
SLOTSIZE $8000
3+
DEFAULTSLOT 0
4+
SLOT 0 $8000
5+
.ENDME
6+
7+
.ROMBANKSIZE $8000
8+
.ROMBANKS 1
9+
10+
;-------------------------------------------------
11+
; spc dsp define
12+
;-------------------------------------------------
13+
.define DSP_VOL $00
14+
.define DSP_P $02
15+
.define DSP_SRCN $04
16+
.define DSP_ADSR $05
17+
.define DSP_GAIN $07
18+
.define DSP_ENVX $08 ; *
19+
.define DSP_OUTX $09 ; *
20+
.define DSP_MVOLL $0c
21+
.define DSP_MVOLR $1c
22+
.define DSP_EVOLL $2c
23+
.define DSP_EVOLR $3c
24+
.define DSP_KON $4c
25+
.define DSP_KOF $5c
26+
.define DSP_FLG $6c
27+
.define DSP_ENDX $7c ; *
28+
.define DSP_EFB $0d
29+
.define DSP_PMON $2d
30+
.define DSP_NON $3d
31+
.define DSP_EON $4d
32+
.define DSP_DIR $5d
33+
.define DSP_ESA $6d
34+
.define DSP_EDL $7d
35+
.define DSP_FIR $0F
36+
37+
.define waittable $fa00
38+
.define dirregion $fb00
39+
.define brrregion $8000
40+
41+
.section "BANKHEADER"
42+
43+
.db "head"
44+
.dw 16,0
45+
.db "ppse song player"
46+
47+
.db "vers"
48+
.dw 4,0
49+
.dw $0319
50+
.dw $2017
51+
52+
.fopen "spcp.bin" fp
53+
.fsize fp spccode_size
54+
.fclose fp
55+
.db "spcp"
56+
.dw spccode_size,0
57+
.incbin "spcp.bin"
58+
59+
.db "ntvv"
60+
.dw 12,0
61+
.dw EmptyHandler
62+
.dw EmptyHandler
63+
.dw EmptyHandler
64+
.dw EmptyHandler
65+
.dw 0
66+
.dw irqmain
67+
68+
.db "emuv"
69+
.dw 12,0
70+
.dw EmptyHandler
71+
.dw 0
72+
.dw EmptyHandler
73+
.dw EmptyHandler
74+
.dw Start
75+
.dw EmptyHandler
76+
77+
.db "smcp"
78+
.dw endcode,0 ; smcコードの容量を取得する方法
79+
.ends
80+
81+
.include "smcp/smcplayercode.inc"
82+
83+
.section "SpcCode" semifree
84+
spccode:
85+
.incbin "smcp/dspregAcc/dspregAcc.bin"
86+
spccode_end:
87+
.ends
88+
89+
.section "EndCode" semifree
90+
endcode:
91+
.db 0 ; dummy
92+
.ends

sample/brrregion.dat

17.3 KB
Binary file not shown.

sample/dirregion.dat

1 KB
Binary file not shown.

sample/regdump.dat

256 Bytes
Binary file not shown.

sample/spclog.dat

504 Bytes
Binary file not shown.

sample/waittable.dat

64 Bytes
Binary file not shown.

smcp/Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.SUFFIXES :
2+
3+
TARGET := $(shell basename $(CURDIR))
4+
AS = wla-65816
5+
ASFLAGS = -voi
6+
LD = wlalink
7+
LFLAGS = -vsi
8+
SOURCES := .
9+
export OUTPUT := $(CURDIR)/$(TARGET)
10+
11+
IFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.inc)))
12+
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
13+
export OFILES := $(SFILES:.s=.o)
14+
LSTFILES = $(SFILES:.s=.lst)
15+
16+
SUBDIRS = dspregAcc
17+
18+
.PHONY: all $(SUBDIRS)
19+
20+
all: $(SUBDIRS) $(TARGET)
21+
22+
$(SUBDIRS):
23+
$(MAKE) -C $@
24+
25+
$(TARGET): $(OFILES) Makefile
26+
echo [objects] > linkfile
27+
$(foreach ofile,$(OFILES),echo $(ofile) >> linkfile;)
28+
$(LD) $(LFLAGS) linkfile $(TARGET).smc
29+
rm -f linkfile
30+
rm -f $(OFILES)
31+
32+
$(OFILES): $(SFILES) $(IFILES) Makefile
33+
$(foreach src,$(SFILES),$(AS) $(ASFLAGS) $(src);)
34+
35+
clean:
36+
rm -f $(OFILES) *.lst linkfile $(TARGET).sym $(TARGET).smc
37+
(for i in $(SUBDIRS) ; do $(MAKE) -C $$i clean || true ; done)

smcp/c700play.s

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
.memorymap
2+
slotsize $8000
3+
defaultslot 0
4+
slot 0 $8000
5+
.endme
6+
7+
.rombanksize $8000
8+
.rombanks 4
9+
10+
.snesheader
11+
id "SNES"
12+
name "c700play "
13+
; "123456789012345678901"
14+
fastrom
15+
lorom
16+
cartridgetype $00
17+
romsize $07
18+
sramsize $00
19+
country $00
20+
licenseecode $00
21+
version $00
22+
.endsnes
23+
24+
.snesnativevector
25+
cop EmptyHandler
26+
brk EmptyHandler
27+
abort EmptyHandler
28+
nmi EmptyHandler
29+
irq irqmain
30+
.endnativevector
31+
32+
.snesemuvector
33+
cop EmptyHandler
34+
abort EmptyHandler
35+
nmi EmptyHandler
36+
reset Start
37+
irqbrk EmptyHandler
38+
.endemuvector
39+
40+
.emptyfill $00
41+
42+
codestart:
43+
.include "smcplayercode.inc"
44+
45+
.section "SpcCode" semifree
46+
spccode:
47+
.incbin "dspregAcc/dspregAcc.bin"
48+
spccode_end:
49+
.ends
50+
codeend:
51+
52+
.org $7a00
53+
.section "WaitTable" semifree
54+
waittable:
55+
.incbin "../sample/waittable.dat"
56+
.ends
57+
58+
.org $7b00
59+
.section "DirRegion" semifree
60+
61+
dirregion:
62+
; 先頭に、アドレス、サイズが2バイトずつ
63+
.incbin "../sample/dirregion.dat"
64+
65+
.ends
66+
67+
.base $81
68+
.bank 1 slot 0
69+
.org 0
70+
.section "BrrRegion"
71+
brrregion:
72+
; 先頭に、アドレス、サイズが2バイトずつ
73+
.incbin "../sample/brrregion.dat" skip 0; read 32768
74+
.ends
75+
76+
;.base $82
77+
;.bank 2 slot 0
78+
;.org 0
79+
;.section "BrrRegion2"
80+
;brrregion2:
81+
;.incbin "../sample/brrregion.dat" skip 32768
82+
;.ends
83+
84+
85+
.base $83
86+
.bank 3 slot 0
87+
.org 0
88+
.section "RegLogRegion"
89+
reglogregion:
90+
.incbin "../sample/spclog.dat" skip 0; read 32768
91+
.ends
92+
93+
;.base $84
94+
;.bank 4 slot 0
95+
;.org 0
96+
;.section "RegLogRegion2"
97+
;.incbin "../sample/spclog.dat" skip 32768 ;read 32768
98+
;.ends
99+
100+
;
101+
;.base $85
102+
;.bank 5 slot 0
103+
;.org 0
104+
;.section "RegLogRegion3"
105+
;.incbin "../sample/spclog.dat" skip 65536; read 32768
106+
;.ends
107+
108+
;.base $86
109+
;.bank 6 slot 0
110+
;.org 0
111+
;.section "RegLogRegion6"
112+
;.incbin "../sample/spclog.dat" skip 163840 read 32768
113+
;.ends
114+
;
115+
;.base $87
116+
;.bank 7 slot 0
117+
;.org 0
118+
;.section "RegLogRegion7"
119+
;.incbin "../sample/spclog.dat" skip 196608 read 32768
120+
;.ends

0 commit comments

Comments
 (0)