Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master' into some-b…
Browse files Browse the repository at this point in the history
…ug-fixes

# Conflicts:
#	pop-beeb-side-a.ssd
#	pop-beeb.dsd
  • Loading branch information
kieranhj committed Mar 25, 2018
2 parents 6277a95 + 84fcff7 commit fec7d47
Show file tree
Hide file tree
Showing 31 changed files with 99 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
},
"args": [
"BeebAsm.exe -v -i pop-beeb.asm -do pop-beeb.ssd -boot Core && bin\\bbcim.exe -interss sd pop-beeb.ssd pop-beeb-side-b.ssd pop-beeb.dsd"
"make.bat"
],
"isBuildCommand": true
},
Expand Down
1 change: 1 addition & 0 deletions Other/bitshifters2.mode7.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
� �5 */ 5 j /%j/ j � �?oj*?%?/j/55o/*o/ ~} ?% 5 � �5jj 5 upj 55j j j55h|5 � �5jj 5 #kj 55j j bss15j/% � �}~j }4|~j 55j j|"o?!5j � �5 */ 5 j /%j/ j � �?oj*?%?/j/55o/*o/ ~} ?% 5 � �5jj 5 upj 55j j j55h|5 � �5jj  s15j/% � �}~j ��Prince Of Persia��?!5j � Prince Of Persia�� � �5 */  � �?oj*?%?/j/55o/*o/ ~} ?% 5 � �5jj 5 upj 55j j j55h|5 � �5jj 5 #kj 55j j bss15j/% � �}~j }4|~j 55j j|"o?!5j � �5 */ 5 j /%j/ j � �?oj*?%?/j/55o/*o/ ~} ?% 5 � �5jj 5 upj 55j j j55h|5 � �5jj 5 #kj 55j j bss15j/% � �}~j }4|~j 55j j|"o?!5j
25 changes: 25 additions & 0 deletions Other/bitshifters2.mode7.bin.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

� �5 */ 5 j /%j/ j
� �?oj*?%?/j/55o/*o/ ~} ?% 5
� �5jj 5 upj 55j j j55h|5
� �5jj 5 #kj 55j j bss15j/%
� �}~j }4|~j 55j j|"o?!5j

� �5 */ 5 j /%j/ j
� �?oj*?%?/j/55o/*o/ ~} ?% 5
� �5jj 5 upj 55j j j55h|5
� �5jj  s15j/%
� �}~j ��Prince Of Persia��?!5j
� Prince Of Persia��
� �5 */ 
� �?oj*?%?/j/55o/*o/ ~} ?% 5
� �5jj 5 upj 55j j j55h|5
� �5jj 5 #kj 55j j bss15j/%
� �}~j }4|~j 55j j|"o?!5j

� �5 */ 5 j /%j/ j
� �?oj*?%?/j/55o/*o/ ~} ?% 5
� �5jj 5 upj 55j j j55h|5
� �5jj 5 #kj 55j j bss15j/%
� �}~j }4|~j 55j j|"o?!5j

Binary file removed audio/ip/3glugs.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-begin.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-cutscene-pre2_4_6_C-alt.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-cutscene-pre2_4_6_C.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-e4-killedbyshadow.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-intro-wrongsignaturevgm.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-lifepotion-sliced.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-lifepotion.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-playerdeath-reg.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-playerdeath-sword.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-potion-sliced.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-potion.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-story2.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-story4-endsright.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-story4.raw.exo
Binary file not shown.
Binary file modified audio/ip/m-story5-end-merge-bla.raw.exo
Binary file not shown.
Binary file modified audio/music/Prince of Persia - 02 - Intro.raw.exo
Binary file not shown.
Binary file modified audio/sfx/06 mirrorcrack.raw
Binary file not shown.
File renamed without changes.
Binary file added audio/sfx/vgm/3glugs.vgm
Binary file not shown.
35 changes: 34 additions & 1 deletion audio/vgmconverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,8 +1048,41 @@ def recalc_frequency(tone_frequency, is_periodic_noise_tone = False):
#if latched_channel == 2:
# qw = qw & 0xf0
# quantized_command_list[n]["data"] = struct.pack('B', qw)

#------------------------------------------------------------------------------------------------------------
# extra test for scenarios where channel 2 and channel 3 volumes are audible together during tuned PN
# AND we are targetting an SN76489 chip with 15 bit duty cycle (SR) because these are not harmonious
# Explanation:
# On some SN76489 chips the periodic noise cycle is 16 bits and on some it is 15 bits.
# SN tone generators output continuous squarewaves at the given frequency, whereas the periodic noise generator
# emits a squarewave at the given frequency on channel 2 *every duty cycle* -
# which is either every 1/16 clocks or every 1/15 clocks (depending on chip config)
# At 1/16, the output frequency is in harmony with channel 2. So 440Hz on tone2
# will be 27.5Hz on PN channel3 (exactly 4 octaves lower).
# With the BBC, 440Hz on tone2 will deliver 29.33Hz on PN channel3 (*almost* 4 octaves lower - but out of tune).
#
# So some tunes are able to play all 4 channels with channel 3 in tuned PN mode, in harmony.
# Such tunes are not compatible with SN chip variants with 15-bit LFSR registers.
#
# Our coping strategy here is to detect and prioritize any currently playing tuned periodic noise, and ignore
# any volume changes on channel 2.
# We could attempt to stop the PN from playing if we detect volume changes on channel 2, but that would lead
# to much more complexity in how the registers are updated.
#
# remember that on SN chip, volume 15 is silent, and 0 is full

new_volume = qw & 15
if latched_channel == 2:
if new_volume != 15:
if latched_volumes[3] != 15:
if (latched_tone_frequencies[3]) & 3 == 3:
print "WARNING: Volume non zero on channel 2 when channel 3 is playing periodic noise, channel 2 was muted."
new_volume = 15

lo_data = (qw & 0b11110000) | (new_volume & 0b00001111)
self.command_list[n]["data"] = struct.pack('B', lo_data)

latched_volumes[latched_channel] = qw & 15
latched_volumes[latched_channel] = new_volume
else:

# save the index of this tone write if it's channel 2 (used below)
Expand Down
30 changes: 30 additions & 0 deletions bin/teletext2bin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/python

import sys

if len(sys.argv) != 3:
print "teletext2bin.py <infile> <outfile>"
exit()

infile = sys.argv[1]
outfile = sys.argv[2]

print "converting " + infile + " to " + outfile

fh = open(infile, 'rb')

ba = bytearray(fh.read())
fh.close()
bo = bytearray()
for byte in ba:
if byte != 10 and byte != 13:
bo.append(byte)


print "length " + str(len(bo)) + " bytes"

fh = open(outfile, 'wb')
fh.write(bo)
fh.close()

print "Done."
2 changes: 1 addition & 1 deletion disc/boot.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*BASIC*RUN Core
*BASIC*RUN Prince
Expand Down
2 changes: 1 addition & 1 deletion lib/beeb_sfx_bank.asm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ INCBIN "audio/sfx/19 jawsclash.raw"
INCBIN "audio/sfx/annoyshort.raw"

.pop_music_glug
INCBIN "audio/ip/3glugs.raw"
INCBIN "audio/sfx/3glugs.raw"

.pop_sfx_end
5 changes: 4 additions & 1 deletion make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ set HH=%TIME:~0,2%
if %HH% leq 9 set HH=0%HH:~1,1%
echo EQUB $%DATE:~8,2%, $%DATE:~3,2%, $%DATE:~0,2%, $%HH%, $%TIME:~3,2%, "%USERNAME:~0,2%" > version.txt
del pop-beeb-side-a.ssd
bin\BeebAsm.exe -v -i pop-beeb.asm -di disc/template-side-a.ssd.bin -do pop-beeb-side-a.ssd > compile.txt

rem SM: selfishly not sending compiler output to compile.txt so I can use VS.code console instead
rem bin\BeebAsm.exe -v -i pop-beeb.asm -di disc/template-side-a.ssd.bin -do pop-beeb-side-a.ssd > compile.txt
bin\BeebAsm.exe -v -i pop-beeb.asm -di disc/template-side-a.ssd.bin -do pop-beeb-side-a.ssd

if %ERRORLEVEL% neq 0 (
echo Assemble failed!
Expand Down
Binary file modified pop-beeb-side-a.ssd
Binary file not shown.
4 changes: 2 additions & 2 deletions pop-beeb.asm
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ INCLUDE "game/beeb-plot-layrsave.asm"

; Save Core executable

SAVE "Core", pop_beeb_start, pop_beeb_end, pop_beeb_entry
SAVE "Prince", pop_beeb_start, pop_beeb_end, pop_beeb_entry

; Core RAM stats

Expand Down Expand Up @@ -962,7 +962,7 @@ PAGE_ALIGN
\ All character sprites on SIDE B

\ Loading screen
PUTFILE "Other/bitshifters.mode7.bin", "BITS", &7C00, 0
PUTFILE "Other/bitshifters2.mode7.bin", "BITS", &7C00, 0

\ Attract files
PUTFILE "Other/splash.pu.bin", "SPLASH", &3000, 0
Expand Down
Binary file modified pop-beeb.dsd
Binary file not shown.

0 comments on commit fec7d47

Please sign in to comment.