2010-04-16 00:25:58 +02:00
|
|
|
|
{{ ---------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
Hive-Computer-Projekt: Boulder Dash - Hive-Version
|
|
|
|
|
|
|
|
|
|
http://hive-project.de
|
|
|
|
|
|
|
|
|
|
Basierend auf dem Fanprojekt diverser Propellerk<72>pfe:
|
|
|
|
|
|
|
|
|
|
http://forums.parallax.com/forums/default.aspx?f=33&m=263404
|
|
|
|
|
|
|
|
|
|
Besonderer Dank an Pex "Mahoney" Tufvesson f<>r die coole Musik!:
|
|
|
|
|
|
|
|
|
|
http://mahoney.c64.org
|
|
|
|
|
http://www.livet.se/visa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tasten:
|
|
|
|
|
|
|
|
|
|
ESC Stop Button A
|
|
|
|
|
Space Pause Button B
|
|
|
|
|
LShift Start
|
|
|
|
|
LCTRL Select
|
|
|
|
|
Cursor
|
|
|
|
|
|
|
|
|
|
Anpassungen f<>r den Hive
|
|
|
|
|
|
|
|
|
|
09-01-2010 - Entfernung der Hardwareerkennung
|
|
|
|
|
- Anpassung Konfiguration an Hive/Bellatrix
|
|
|
|
|
- Gamecontr. entfernt
|
|
|
|
|
- Auskommentierung Sound
|
|
|
|
|
12-01-2010 - Soundadapter optimiert
|
|
|
|
|
- Scrolltext im Titelbildschirm eingef<65>gt
|
2010-04-21 19:58:44 +02:00
|
|
|
|
19-04-2010 - Anpassung an TriOS: Boulder l<>uft jetzt auch aus dem Verzeichnis. Bedingt durch das
|
|
|
|
|
neue, etwas tr<74>gere WAV-Soundsystem, habe ich einige Effekte durch HSS/SFX ersetzt.
|
2010-04-16 00:25:58 +02:00
|
|
|
|
|
|
|
|
|
Zur Hive-Version: Das Game an sich - also der urspr<70>ngliche Basiscode aus dem Parallax-Forum - l<>uft
|
|
|
|
|
auf einem einzigen Propellerchip! Was war zu tun um diese Version an den Hive anzupassen:
|
|
|
|
|
|
|
|
|
|
1. Der Code kann im wesentlichen fast ausschlie<69>lich auf Bellatrix laufen. Daf<61>r m<>ssen die entsprechenden
|
|
|
|
|
Belegungen der IO-Pins f<>r Video und Keyboard angepasst werden.
|
|
|
|
|
2. Da Bellatrix keinen Sound ausgeben kann, sondern diese Aufgabe im Hive Administra <20>bernimmt, mu<6D> die
|
|
|
|
|
Soundausgabe angepasst werden. Im Originalcode <20>bernimmt das Objekt "sound.spin" diese Aufgabe - welches
|
|
|
|
|
wieder den SIDemu in einer getrennten Cog startet. Hier zeigt sich die St<53>rke der SPIN-Objekte: F<>r die
|
|
|
|
|
Anpassung brauchte ich einfach nur ein neues Objekt gleicher Struktur definieren, ohne das Hauptprogramm
|
|
|
|
|
zu <20>ndern. Dieses neue Soundobjekt startet ebenfalls eine Cog, welche einzig die Aufgabe hat die Kommunikation
|
|
|
|
|
zu Regnatix/Administra zu realisieren.
|
|
|
|
|
3. Regnatix-Code: Tja, die K<>nigin kann bei der ganzen Sache D<>umchen drehen, denn sie hat nur folgend Aufgaben
|
|
|
|
|
in einer einzigen Cog zu bew<65>ltigen:
|
|
|
|
|
- Bellatrix-Code laden
|
|
|
|
|
- SFX-Slots in Administra initialisieren
|
|
|
|
|
- Warten bis Bellatrix einen Ton von sich geben m<>chte und <20>bermittlung dieser
|
|
|
|
|
Tonesequenz an Administra
|
|
|
|
|
|
|
|
|
|
Damit werden nat<61>rlich auf der einen Seite massig Ressourcen in Bellatrix gegen<65>ber dem urspr<70>nglichen Code frei
|
|
|
|
|
und es sind durch die Verwendung von HSS/SFX + Waveplayer + SDCard mehr M<>glichkeiten gegeben.
|
|
|
|
|
|
|
|
|
|
Bellatrix-Code : 20,5 KByte
|
|
|
|
|
Regnatix-Code : 3,2 KByte
|
|
|
|
|
|
|
|
|
|
Bei diesen Werten ist zu beachten, dass der Regnatix das blanke IOS mit 2,6 KByte eingebunden hat - ohne Optimierung,
|
|
|
|
|
denn ein Gro<72>teil der IOS-Routinen sind in diesem Fall ungenutzt.
|
|
|
|
|
|
|
|
|
|
Zeitaufwand : ca. 3 nette Abende ;)
|
|
|
|
|
|
|
|
|
|
drohne235
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------------------------------- }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OBJ
|
2010-04-21 19:58:44 +02:00
|
|
|
|
ios : "ios"
|
|
|
|
|
' debugx : "pterm" 'debug
|
2010-04-16 00:25:58 +02:00
|
|
|
|
|
|
|
|
|
CON
|
|
|
|
|
|
|
|
|
|
_CLKMODE = XTAL1 + PLL16X
|
|
|
|
|
_XINFREQ = 5_000_000
|
|
|
|
|
|
|
|
|
|
CON
|
|
|
|
|
|
|
|
|
|
_music_on = 1
|
|
|
|
|
_music_off = 2
|
|
|
|
|
_moving_sound1 = 3
|
|
|
|
|
_moving_sound2 = 4
|
|
|
|
|
_boulder_sound = 5
|
|
|
|
|
_diamond_sound = 6
|
|
|
|
|
_pick_sound = 7
|
|
|
|
|
_explosion_sound = 8
|
|
|
|
|
_crack_sound = 9
|
|
|
|
|
_magic_wall_sound_on = 10
|
|
|
|
|
_magic_wall_sound_off = 11
|
|
|
|
|
_amoeba_sound_on = 12
|
|
|
|
|
_amoeba_sound_off = 13
|
|
|
|
|
_time_ending_sound = 14
|
|
|
|
|
_bonus_point_sound = 15
|
|
|
|
|
_cover_sound = 16
|
|
|
|
|
|
|
|
|
|
VAR
|
|
|
|
|
|
|
|
|
|
byte parastr[64]
|
2010-04-21 19:58:44 +02:00
|
|
|
|
byte fl_musicon
|
2010-04-16 00:25:58 +02:00
|
|
|
|
|
2010-04-21 19:58:44 +02:00
|
|
|
|
PUB main | a,b,c,i,n,stradr
|
2010-04-16 00:25:58 +02:00
|
|
|
|
|
|
|
|
|
'initialisierung
|
|
|
|
|
ios.start 'ios initialisieren
|
2010-04-21 19:58:44 +02:00
|
|
|
|
' ios.startram 'code f<>r test im ram, sollte bei bin-datei auskommentiert werden
|
|
|
|
|
|
|
|
|
|
' debugx.start(115200)
|
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
ios.admsetsyssnd(0) 'systemsounds abschalten
|
2010-04-21 19:58:44 +02:00
|
|
|
|
ios.sddmact(ios#DM_USER) 'wieder in userverzeichnis wechseln
|
2010-04-16 00:25:58 +02:00
|
|
|
|
ios.print(string("Boulder Dash - Loading..."))
|
|
|
|
|
|
|
|
|
|
'bellatrix-code laden
|
|
|
|
|
ios.parastart
|
|
|
|
|
parastr[0] := 0
|
|
|
|
|
ios.paranext(@parastr)
|
|
|
|
|
|
|
|
|
|
case parastr[0]
|
|
|
|
|
"n":
|
|
|
|
|
ios.belload(@beln) 'grafiktreiber ntsc laden
|
|
|
|
|
other:
|
|
|
|
|
ios.belload(@belp) 'grafiktreiber pal laden
|
|
|
|
|
|
2010-04-21 19:58:44 +02:00
|
|
|
|
ios.sddmact(ios#DM_USER) '???
|
2010-04-16 00:25:58 +02:00
|
|
|
|
|
2010-04-21 19:58:44 +02:00
|
|
|
|
'sfx-slots setzen
|
|
|
|
|
ios.sfx_setslot(@fx_moving_sound1, 0)
|
|
|
|
|
ios.sfx_setslot(@fx_moving_sound2, 1)
|
|
|
|
|
ios.sfx_setslot(@fx_boulder_sound,2)
|
|
|
|
|
ios.sfx_setslot(@fx_diamond_sound,3)
|
|
|
|
|
ios.sfx_setslot(@fx_pick_sound,4)
|
|
|
|
|
ios.sfx_setslot(@fx_amoeba_sound,5)
|
|
|
|
|
ios.sfx_setslot(@fx_time_sound,6)
|
|
|
|
|
ios.sfx_setslot(@fx_cover_sound,7)
|
|
|
|
|
ios.sfx_setslot(@fx_bonus,8)
|
|
|
|
|
ios.sfx_setslot(@fx_crack,9)
|
|
|
|
|
ios.sfx_setslot(@fx_explosion,10)
|
|
|
|
|
ios.sfx_setslot(@fx_wall,11)
|
|
|
|
|
|
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
'soundadapter
|
|
|
|
|
repeat
|
2010-04-21 19:58:44 +02:00
|
|
|
|
case ios.bus_getchar2
|
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
_music_on: 'titelmusik
|
2010-04-21 19:58:44 +02:00
|
|
|
|
ios.admsetsound(ios#SND_HSSOFF) 'hss ausschalten
|
|
|
|
|
ios.admsetsound(ios#SND_WAVON) 'wav einschalten
|
|
|
|
|
n := ios.wav_play(@wav1)
|
|
|
|
|
fl_musicon := 1
|
|
|
|
|
|
|
|
|
|
_music_off:
|
|
|
|
|
if fl_musicon
|
2010-04-16 00:25:58 +02:00
|
|
|
|
ios.wav_stop
|
2010-04-21 19:58:44 +02:00
|
|
|
|
ios.admsetsound(ios#SND_WAVOFF) 'wav ausschalten
|
|
|
|
|
ios.admsetsound(ios#SND_HSSON) 'hss anschalten
|
|
|
|
|
fl_musicon := 0
|
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
_moving_sound1:
|
|
|
|
|
ios.sfx_fire(0,1)
|
2010-04-21 19:58:44 +02:00
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
_moving_sound2:
|
|
|
|
|
ios.sfx_fire(1,1)
|
2010-04-21 19:58:44 +02:00
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
_boulder_sound:
|
|
|
|
|
ios.sfx_fire(2,1)
|
|
|
|
|
waitcnt(clkfreq / 30 + cnt)
|
2010-04-21 19:58:44 +02:00
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
_diamond_sound:
|
|
|
|
|
b?
|
|
|
|
|
b := b & $FF
|
|
|
|
|
byte[@fx_diamond_sound+2] := b
|
2010-04-21 19:58:44 +02:00
|
|
|
|
ios.sfx_setslot(@fx_diamond_sound,3)
|
2010-04-16 00:25:58 +02:00
|
|
|
|
ios.sfx_fire(3,1)
|
|
|
|
|
waitcnt(clkfreq / 30 + cnt)
|
2010-04-21 19:58:44 +02:00
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
_pick_sound:
|
|
|
|
|
ios.sfx_fire(4,2)
|
|
|
|
|
waitcnt(clkfreq / 3 + cnt)
|
2010-04-21 19:58:44 +02:00
|
|
|
|
|
|
|
|
|
_explosion_sound: 'explosion
|
|
|
|
|
ios.sfx_fire(10,1)
|
|
|
|
|
waitcnt(clkfreq * 3 + cnt)
|
|
|
|
|
|
|
|
|
|
_crack_sound: 'eingang
|
|
|
|
|
ios.sfx_fire(9,1)
|
|
|
|
|
waitcnt(clkfreq / 3 + cnt)
|
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
_magic_wall_sound_on:
|
2010-04-21 19:58:44 +02:00
|
|
|
|
ios.sfx_fire(11,2)
|
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
_magic_wall_sound_off:
|
2010-04-21 19:58:44 +02:00
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
_amoeba_sound_on:
|
2010-04-21 19:58:44 +02:00
|
|
|
|
ios.sfx_fire(5,2)
|
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
_amoeba_sound_off:
|
2010-04-21 19:58:44 +02:00
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
_time_ending_sound:
|
2010-04-21 19:58:44 +02:00
|
|
|
|
ios.sfx_fire(6,2)
|
|
|
|
|
|
|
|
|
|
_bonus_point_sound: 'bonus
|
|
|
|
|
ios.sfx_fire(8,2)
|
|
|
|
|
waitcnt(clkfreq * 4 + cnt)
|
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
_cover_sound:
|
|
|
|
|
b?
|
|
|
|
|
b := b & $FF
|
|
|
|
|
byte[@fx_cover_sound+2] := b
|
2010-04-21 19:58:44 +02:00
|
|
|
|
ios.sfx_setslot(@fx_cover_sound,7)
|
|
|
|
|
ios.sfx_fire(7,1)
|
2010-04-16 00:25:58 +02:00
|
|
|
|
waitcnt(clkfreq / 30 + cnt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DAT
|
|
|
|
|
|
2010-04-21 19:58:44 +02:00
|
|
|
|
wav1 byte "bd.wav",0 ' titelmusik
|
2010-04-16 00:25:58 +02:00
|
|
|
|
|
|
|
|
|
beln byte "bd_ntsc.bel",0 ' bella-code, ntsc-version
|
|
|
|
|
belp byte "bd_pal.bel",0
|
|
|
|
|
|
|
|
|
|
'basisschwingung modulation h<>llkurve
|
|
|
|
|
'Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
|
|
|
|
|
fx_moving_sound1 byte $06, $02, $01, $08, $00, $00, $00, $00, $FF, $00, $00, $D0
|
|
|
|
|
fx_moving_sound2 byte $06, $02, $01, $0F, $00, $00, $00, $00, $FF, $00, $00, $D0
|
|
|
|
|
fx_boulder_sound byte $06, $01, $FF, $0F, $01, $03, $01, $00, $FF, $00, $00, $80
|
|
|
|
|
fx_diamond_sound byte $01, $01, $E0, $0F, $00, $00, $00, $00, $FF, $00, $00, $80
|
|
|
|
|
fx_pick_sound byte $01, $01, $E0, $0F, $00, $00, $00, $00, $FF, $00, $00, $80
|
|
|
|
|
fx_explosion_sound byte $01, $01, $E0, $0F, $00, $00, $00, $00, $FF, $00, $00, $80
|
|
|
|
|
fx_crack_sound byte $06, $02, $10, $0F, $00, $00, $00, $00, $FF, $00, $00, $D0
|
|
|
|
|
fx_magic_sound byte $01, $01, $80, $0F, $00, $00, $00, $00, $FF, $00, $00, $80
|
|
|
|
|
fx_amoeba_sound byte $01, $01, $80, $0F, $00, $00, $00, $00, $FF, $00, $00, $80
|
|
|
|
|
fx_time_sound byte $02, $05, $FF, $0F, $10, $00, $01, $00, $FF, $00, $00, $40
|
|
|
|
|
fx_bonus_sound byte $01, $01, $80, $0F, $00, $00, $00, $00, $FF, $00, $00, $80
|
|
|
|
|
fx_cover_sound byte $01, $01, $80, $0F, $00, $00, $00, $00, $FF, $00, $00, $80
|
|
|
|
|
|
2010-04-21 19:58:44 +02:00
|
|
|
|
fx_bonus
|
|
|
|
|
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
|
|
|
|
|
byte $03,$03,$FF,$0F,$02,$00,$05,$00,$FF,$01,$50,$11
|
|
|
|
|
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
|
|
|
|
|
|
|
|
|
fx_crack
|
|
|
|
|
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
|
|
|
|
|
byte $01,$22,$01,$0F,$11,$00,$05,$00,$55,$01,$50,$11
|
|
|
|
|
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
|
|
|
|
|
|
|
|
|
fx_explosion
|
|
|
|
|
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
|
|
|
|
|
byte $06,$04,$10,$0F,$00,$00,$00,$00,$FF,$01,$50,$11
|
|
|
|
|
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
|
|
|
|
|
|
|
|
|
fx_wall
|
|
|
|
|
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
|
|
|
|
|
byte $04,$FF,$FF,$0F,$01,$00,$01,$00,$FF,$06,$20,$00
|
|
|
|
|
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
|
|
|
|
|
|
2010-04-16 00:25:58 +02:00
|
|
|
|
|
|
|
|
|
DAT
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
sfx-struktur:
|
|
|
|
|
|
|
|
|
|
wav len freq vol grundschwingung
|
|
|
|
|
lfo lfw fma ama modulation
|
|
|
|
|
att dec sus rel h<>llkurve
|
|
|
|
|
seq (optional)
|
|
|
|
|
|
|
|
|
|
wav wellenform
|
|
|
|
|
0 sinus (0..500hz)
|
|
|
|
|
1 schneller sinus (0..1khz)
|
|
|
|
|
2 dreieck (0..500hz)
|
|
|
|
|
3 rechteck (0..1khz)
|
|
|
|
|
4 schnelles rechteck (0..4khz)
|
|
|
|
|
5 impulse (0..1,333hz)
|
|
|
|
|
6 rauschen
|
|
|
|
|
len tonl<6E>nge $0..$fe, $ff endlos
|
|
|
|
|
freq frequenz $00..$ff
|
|
|
|
|
vol lautst<73>rke $00..$0f
|
|
|
|
|
|
|
|
|
|
lfo low frequency oscillator $ff..$01
|
|
|
|
|
lfw low frequency waveform
|
|
|
|
|
$00 sinus (0..8hz)
|
|
|
|
|
$01 fast sine (0..16hz)
|
|
|
|
|
$02 ramp up (0..8hz)
|
|
|
|
|
$03 ramp down (0..8hz)
|
|
|
|
|
$04 square (0..32hz)
|
|
|
|
|
$05 random
|
|
|
|
|
$ff sequencer data
|
|
|
|
|
fma frequency modulation amount
|
|
|
|
|
$00 no modulation
|
|
|
|
|
$01..$ff
|
|
|
|
|
ama amplitude modulation amount
|
|
|
|
|
$00 no modulation
|
|
|
|
|
$01..$ff
|
|
|
|
|
att attack $00..$ff
|
|
|
|
|
dec decay $00..$ff
|
|
|
|
|
sus sustain $00..$ff
|
|
|
|
|
rel release $00..$ff
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|