Skip to content

Commit

Permalink
fix clean build; update manuals
Browse files Browse the repository at this point in the history
  • Loading branch information
pinobatch committed Feb 21, 2018
1 parent 40c8608 commit de05a1d
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 46 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ __pycache__/
/sfxed/src/pently.inc
/sfxed/src/pentlysound.s
/sfxed/tools/pilbmp2nes.py
/sfxed/tools/pentlyas.py

# this is NES homebrew, not DSiWare
*.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ To use an entirely different score file, open `makefile` and change

## License

Copyright © 2009-2017 Damian Yerrick.
Copyright © 2009-2018 Damian Yerrick.
Pently is free software, under the zlib License.
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# These are used in the title of the NES program and the zip file.
title = pently
version = 0.05wip8
version = 0.05wip9

# Name of Pently score (minus .pently)
scorename = musicseq
Expand Down Expand Up @@ -48,7 +48,7 @@ PY:=
endif


.PHONY: run debug clean dist zip all
.PHONY: run debug clean dist zip all zip.in

run: $(title).nes
$(EMU) $<
Expand Down
76 changes: 36 additions & 40 deletions sfxed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,38 @@ pattern).
Save file format
----------------

When you save, the editor writes both the raw sound data and an
assembly language form of the data to SRAM.

The assembly language form is intended for Damian Yerrick's sound
engine and consists of a sound lookup table with four entries, one
for each sound, followed by the raw sound data. The lookup table
consists of the address of the sound data, followed by a mode byte,
followed by the number of rows in the sound. The mode byte has the
following form:

7654 3210
|||| ||||
|||| ||++- Unused
|||| ++--- 0: pulse; 2: triangle; 3: noise
++++------ Rate (number of frames per row) minus 1

Each row is 2 bytes: a duty/volume byte (for $4000, $4008, or $400C)
followed by a pitch byte. For melodic sounds, the pitch byte is a
semitone number; for noise, it's a value to be written directly to
$400F with timbre in bit 7 and period in bits 3-0. Silent rows are
omitted from the assembly language.

At the bottom of the .sav file is a second copy with just the hex
nibbles of the mode bytes, which is what the editor actually loads
when it starts. It consists of all rows for each sound, followed
by a mode byte for each sound, and finally a CRC-16 to detect
corruption of SRAM.
When you save, the editor writes both the raw sound data and a
human-readable form of the data to SRAM. The resulting save file
is a plain text file in ASCII encoding with UNIX newlines and can
be opened with Notepad++ or any other standard text editor.

At the end of the file is the raw data encoded in hexadecimal form.
This includes each sound's sequence of pitches, each sound's mode
byte (rate and channel), and a CRC-16 value to detect corruption of
SRAM. The editor reads this copy when it starts.

In addition, the save file includes the sounds in a form that can be
copied into a score for the Pently audio engine by Damian Yerrick.

sfx sfxed_1 on pulse
volume 10 10 10 10 10 10 10 10 10
pitch e''' a'' d'' g' e''' a'' d'' g' c'
timbre 2 2 2 2 2 2 2 2 2

The `volume` values are 0 to 15, representing volume for pulse and
noise or priority for triangle.

The `pitch` values for melodic sounds are in LilyPond's variant of
Helmholtz notation: `c` through `a` and `h` represent the octave
below middle C, and commas or apostrophes lower or raise the pitch
by one octave. Noise `pitch` is numbers from 0 to 15 representing
values of $0F through $00 written to $400E.

The `timbre` values for pulse are 0, 1, or 2 for 1/8, 1/4, or 1/2
duty. For noise, they are 0 for hiss or 1 for buzz. Again,
triangle has no timbre selection.

A `rate` appears if greater than 1.

Known issues
------------
Expand All @@ -98,19 +103,10 @@ Known issues
controller 1 to save.
* A-0 and A#0 notes on triangle aren't always played.
* Pitches between two semitones are not supported.
* Some versions of the sound engine require bit 7 of the duty/volume
byte to be set for each row of a triangle sound. If you save
something as triangle and then change it to pulse, its duty will
be all 1/2.
* Changing a sound to or from noise may produce unexpected pitches.

Legal
License
-----

The program and its manual are distributed under the following terms:

Copyright 2014 Damian Yerrick

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without any warranty.
Copyright © 2009-2018 Damian Yerrick.
Pently is free software, under the zlib License.
7 changes: 4 additions & 3 deletions sfxed/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ $(objdir)/%.o: $(srcdir)/%.s $(srcdir)/nes.inc $(srcdir)/global.inc $(srcdir)/mb
$(objdir)/%.o: $(objdir)/%.s
$(AS65) $(CFLAGS65) $< -o $@

# Files that depend on .incbin'd files
# Files that depend on included files
$(objdir)/bg.o: $(objdir)/sprites.chr $(objdir)/coltiles.ch1
$(objdir)/pentlysound.o: $(srcdir)/pently.inc $(srcdir)/pentlyconfig.inc

# Generate lookup tables

Expand All @@ -107,10 +108,10 @@ $(objdir)/ntscPeriods.s: tools/pentlyas.py

# Rules for graphics data conversion

$(objdir)/%.chr: $(imgdir)/%.png dep
$(objdir)/%.chr: $(imgdir)/%.png tools/pilbmp2nes.py
$(PY) tools/pilbmp2nes.py $< $@

$(objdir)/%.ch1: $(imgdir)/%.png dep
$(objdir)/%.ch1: $(imgdir)/%.png tools/pilbmp2nes.py
$(PY) tools/pilbmp2nes.py -1 $< $@

$(objdir)/%.s: tools/vwfbuild.py tilesets/%.png
Expand Down
1 change: 1 addition & 0 deletions sfxed/src/export.s
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ sound_lenleft = sound_rate
cpx #3
bne pitchloop_notnoise
and #$0F
eor #$0F
jsr export_putbyte_decimal
jmp pitchloop_continue
pitchloop_notnoise:
Expand Down

0 comments on commit de05a1d

Please sign in to comment.