diff options
| -rw-r--r-- | README | 7 | ||||
| -rw-r--r-- | src-68k/build.68k | 21 | ||||
| -rw-r--r-- | tester/build.68k | 22 | ||||
| -rw-r--r-- | tester/core/entry.68k (renamed from src-68k/core/entry.68k) | 0 | ||||
| -rw-r--r-- | tester/core/header.68k (renamed from src-68k/core/header.68k) | 0 | ||||
| -rw-r--r-- | tester/core/menu.68k (renamed from src-68k/core/menu.68k) | 0 | ||||
| -rw-r--r-- | tester/core/songlist.68k (renamed from src-68k/core/songlist.68k) | 0 | ||||
| -rw-r--r-- | tester/core/vars.68k (renamed from src-68k/core/vars.68k) | 0 | ||||
| -rw-r--r-- | tester/input/joypad.68k (renamed from src-68k/input/joypad.68k) | 0 | ||||
| -rw-r--r-- | tester/sound/bgms.68k (renamed from src-68k/sound/bgms.68k) | 0 | ||||
| -rw-r--r-- | tester/sound/echo.68k (renamed from src-68k/sound/echo.68k) | 0 | ||||
| -rw-r--r-- | tester/sound/esf.68k | 161 | ||||
| -rw-r--r-- | tester/sound/list.68k (renamed from src-68k/sound/list.68k) | 0 | ||||
| -rw-r--r-- | tester/sound/sfxs.68k (renamed from src-68k/sound/sfxs.68k) | 0 | ||||
| -rw-r--r-- | tester/video/bg.68k (renamed from src-68k/video/bg.68k) | 0 | ||||
| -rw-r--r-- | tester/video/text.68k (renamed from src-68k/video/text.68k) | 0 | ||||
| -rw-r--r-- | tester/video/vsync.68k (renamed from src-68k/video/vsync.68k) | 0 |
17 files changed, 186 insertions, 25 deletions
@@ -23,9 +23,8 @@ tl;dr use Echo at your own risk :| ----------------------------------------------------------------------------- If you want to use Echo from asm, take the blob from "bin/prog-z80.bin" and -the "src-68k/sound/echo.68k" asm file. Include the latter in your source -code, then go to the @Z80Program label and replace the string with the path -to the blob. +the "src-68k/echo.68k" asm file. Include the latter in your source code, then +go to the @Z80Program label and replace the string with the path to the blob. If you want to use Echo from C, check the "c" subdirectory. You will find the required files. It should work with any Mega Drive C devkit that provides the @@ -57,7 +56,7 @@ How to build: * Make sure the root of this source code tree is the current directory * Assemble src-z80/build.z80 to bin/prog-z80.bin - * Assemble src-68k/build.68k to bin/prog-68k.bin (optional) + * Assemble tester/build.68k to bin/prog-68k.bin (optional) Sorry for not providing a build script but my current setup is a mess and needs to be changed x_x; Currently using z80-asm to build the Z80 code and diff --git a/src-68k/build.68k b/src-68k/build.68k deleted file mode 100644 index dc118b1..0000000 --- a/src-68k/build.68k +++ /dev/null @@ -1,21 +0,0 @@ -Echo_ProgFile equs "bin/prog-z80.bin" - - include "src-68k/core/header.68k" - include "src-68k/core/entry.68k" - include "src-68k/core/menu.68k" - include "src-68k/core/songlist.68k" - - include "src-68k/video/text.68k" - include "src-68k/video/bg.68k" - include "src-68k/video/vsync.68k" - - include "src-68k/input/joypad.68k" - - include "src-68k/sound/echo.68k" - include "src-68k/sound/list.68k" - include "src-68k/sound/bgms.68k" - include "src-68k/sound/sfxs.68k" - - cnop 0, $8000 - - include "src-68k/core/vars.68k" diff --git a/tester/build.68k b/tester/build.68k new file mode 100644 index 0000000..15dc6b6 --- /dev/null +++ b/tester/build.68k @@ -0,0 +1,22 @@ +Echo_ProgFile equs "bin/prog-z80.bin" + + include "tester/core/header.68k" + include "tester/core/entry.68k" + include "tester/core/menu.68k" + include "tester/core/songlist.68k" + + include "tester/video/text.68k" + include "tester/video/bg.68k" + include "tester/video/vsync.68k" + + include "tester/input/joypad.68k" + + include "tester/sound/echo.68k" + include "tester/sound/esf.68k" + include "tester/sound/list.68k" + include "tester/sound/bgms.68k" + include "tester/sound/sfxs.68k" + + cnop 0, $8000 + + include "tester/core/vars.68k" diff --git a/src-68k/core/entry.68k b/tester/core/entry.68k index 5da6abc..5da6abc 100644 --- a/src-68k/core/entry.68k +++ b/tester/core/entry.68k diff --git a/src-68k/core/header.68k b/tester/core/header.68k index fde18ee..fde18ee 100644 --- a/src-68k/core/header.68k +++ b/tester/core/header.68k diff --git a/src-68k/core/menu.68k b/tester/core/menu.68k index d5f7914..d5f7914 100644 --- a/src-68k/core/menu.68k +++ b/tester/core/menu.68k diff --git a/src-68k/core/songlist.68k b/tester/core/songlist.68k index 527ea6d..527ea6d 100644 --- a/src-68k/core/songlist.68k +++ b/tester/core/songlist.68k diff --git a/src-68k/core/vars.68k b/tester/core/vars.68k index 8097c73..8097c73 100644 --- a/src-68k/core/vars.68k +++ b/tester/core/vars.68k diff --git a/src-68k/input/joypad.68k b/tester/input/joypad.68k index f33d000..f33d000 100644 --- a/src-68k/input/joypad.68k +++ b/tester/input/joypad.68k diff --git a/src-68k/sound/bgms.68k b/tester/sound/bgms.68k index 4069628..4069628 100644 --- a/src-68k/sound/bgms.68k +++ b/tester/sound/bgms.68k diff --git a/src-68k/sound/echo.68k b/tester/sound/echo.68k index 1d02800..1d02800 100644 --- a/src-68k/sound/echo.68k +++ b/tester/sound/echo.68k diff --git a/tester/sound/esf.68k b/tester/sound/esf.68k new file mode 100644 index 0000000..6abecd1 --- /dev/null +++ b/tester/sound/esf.68k @@ -0,0 +1,161 @@ +;**************************************************************************** +; Channel ID constants +;**************************************************************************** + +ESF_FM1 equ $00 ; FM channel #1 +ESF_FM2 equ $01 ; FM channel #2 +ESF_FM3 equ $02 ; FM channel #3 +ESF_FM4 equ $04 ; FM channel #4 +ESF_FM5 equ $05 ; FM channel #5 +ESF_FM6 equ $06 ; FM channel #6 +ESF_PSG1 equ $08 ; PSG square channel #1 +ESF_PSG2 equ $09 ; PSG square channel #2 +ESF_PSG3 equ $0A ; PSG square channel #3 +ESF_PSG4 equ $0B ; PSG noise channel +ESF_PCM equ $0C ; PCM channel + +;**************************************************************************** +; ESF_NoteOn +; Start playing a note. +;---------------------------------------------------------------------------- +; For FM channels: +; ESF_NoteOn channel, octave, semitone +; For square PSG channels: +; ESF_NoteOn channel, octave, semitone +; For noise PSG channel: +; ESF_NoteOn channel, type +; For PCM channel: +; ESF_NoteOn channel, instrument +;---------------------------------------------------------------------------- +; param channel ...... channel to play on +; param octave ....... octave (0 to 7 for FM, 0 to 5 for PSG) +; param semitone ..... semitone (0 to 11) +; param type ......... noise type ($00 to $07) +; param instrument ... drum instrument ID ($00 to $FF) +;**************************************************************************** + +ESF_NoteOn macro + dc.b $00+(\1) + if (\1)<ESF_PSG1 + dc.b (\2)*32+(\3)*2+1 + elseif (\1)<ESF_PSG4 + dc.b (\2)*24+(\3)*2 + else + dc.b \2 + endc + endm + +;**************************************************************************** +; ESF_NoteOff +; Stop playing a note. +;---------------------------------------------------------------------------- +; Format: +; ESF_NoteOff channel +;---------------------------------------------------------------------------- +; param channel ...... channel to stop +;**************************************************************************** + +ESF_NoteOff macro + dc.b $10+(\1) + endm + +;**************************************************************************** +; ESF_SetVol +; Set the volume of a channel. +;---------------------------------------------------------------------------- +; Format: +; ESF_SetVol channel, volume +;---------------------------------------------------------------------------- +; param channel ... channel to modify +; param volume .... new volume ($00 to $7F for FM, $00 to $0F for PSG) +;**************************************************************************** + +ESF_SetVol macro + dc.b $20+(\1) + dc.b (\2) + endm + +;**************************************************************************** +; ESF_SetFreq +; Sets the frequency of a channel (allows note slides). +;---------------------------------------------------------------------------- +; For FM channels: +; ESF_SetFreq channel, octave, frequency +; For square PSG channels: +; ESF_SetFreq channel, frequency +; For noise PSG channel: +; ESF_SetFreq channel, type +;---------------------------------------------------------------------------- +; param channel ..... affected channel +; param octave ...... octave +; param frequency ... frequency (0 to $7FF for FM, 0 to $3FF for PSG) +; param type ........ noise type ($00 to $07) +;**************************************************************************** + +ESF_SetFreq macro + dc.b $30+(\1) + if (\1)<ESF_PSG1 + dc.b ((\2)<<3)|((\3)>>8) + dc.b (\3)&$FF + elseif (\1)<ESF_PSG4 + dc.b (\2)&$0F + dc.b (\2)>>6 + else + dc.b (\2) + endc + endm + +;**************************************************************************** +; ESF_SetInstr +; Set the instrument of a channel. +;---------------------------------------------------------------------------- +; Format: +; ESF_SetInstr channel, instrument +;---------------------------------------------------------------------------- +; param channel ...... Channel to lock +; param instrument ... Instrument ID ($00 to $FF) +;**************************************************************************** + +ESF_SetInstr macro + dc.b $40+(\1) + dc.b (\2) + endm + +;**************************************************************************** +; ESF_Lock +; Lock SFX channel. +;---------------------------------------------------------------------------- +; Format: +; ESF_Lock channel +;---------------------------------------------------------------------------- +; param channel ... Channel to lock +;**************************************************************************** + +ESF_Lock macro + dc.b $E0 + dc.b (\1) + endm + +;**************************************************************************** +; ESF_Delay +; Stop event. +;---------------------------------------------------------------------------- +; Format: +; ESF_Delay ticks +;---------------------------------------------------------------------------- +; param ticks ... Ticks to wait (60 = 1 second) +;**************************************************************************** + +ESF_Delay macro + dc.b $FE + dc.b (\1) + endm + +;**************************************************************************** +; ESF_Stop +; Stop event. +;**************************************************************************** + +ESF_Stop macro + dc.b $FF + endm diff --git a/src-68k/sound/list.68k b/tester/sound/list.68k index 10f7a42..10f7a42 100644 --- a/src-68k/sound/list.68k +++ b/tester/sound/list.68k diff --git a/src-68k/sound/sfxs.68k b/tester/sound/sfxs.68k index ac969dc..ac969dc 100644 --- a/src-68k/sound/sfxs.68k +++ b/tester/sound/sfxs.68k diff --git a/src-68k/video/bg.68k b/tester/video/bg.68k index c64e287..c64e287 100644 --- a/src-68k/video/bg.68k +++ b/tester/video/bg.68k diff --git a/src-68k/video/text.68k b/tester/video/text.68k index 832605e..832605e 100644 --- a/src-68k/video/text.68k +++ b/tester/video/text.68k diff --git a/src-68k/video/vsync.68k b/tester/video/vsync.68k index ed5ac17..ed5ac17 100644 --- a/src-68k/video/vsync.68k +++ b/tester/video/vsync.68k |
