TriOS-alt/zubehör/shoot/regnatix-code/shoot.spin

167 lines
14 KiB
Plaintext
Raw Normal View History

2010-11-26 23:58:06 +01:00
<EFBFBD><EFBFBD>
''***************************************
''* Shoot Demo *
''* Author: propfan *
''* Copyright (c) 2010 propfan *
''* See end of file for terms of use. *
''***************************************
{{ Hive-Computer-Projekt: Shoot - Hive-Version
http://hive-project.de
Basierend auf einem Demo von propfan:
http://propfan.wordpress.com/
Anpassung f<00>r den Hive:
26-06-2010-dr235 - Anpassung und einige kleine Verbesserungen
Der Originalcode von Propfan l<00>uft wie die meisten Demos auf nur einem Prop
(Demoboard), aber ohne Hintergrundmusik. Ich vermute (hab es nicht <00>berpr<00>ft),
dass auf einem Prop nicht genug Hubram frei ist, um noch die Musik zu laden.
Auf dem Hive nat<00>rlich kein Problem: Sound wird <00>ber Regnatix angesteuert. Im
Gegensatz zu Boulder Dash, habe ich die Verbindung hier bidirektional ausgef<00>hrt:
Bei jeder Operation werden nicht nur Soundkommandos von Bellatrix zum HSS <00>bertragen,
sondern auch Soundinfos vom HSS zu Bella. Diese Werte werden f<00>r den Sound-
monitor im Hintergrund des Gamescreens ben<00>tigt.
Ansonsten ist das Minigame nicht sehr komplex - der Name verpflichtet ;) - aber ein
tolles Demo um mit Sound und Grafik zu experimentieren.
Zeitaufwand der Anpassung: ca. 4 Stunden
Viel Spa<00>
drohne235
}}
OBJ
ios : "ios"
' debugx : "pterm" 'debug
CON
_CLKMODE = XTAL1 + PLL16X
_XINFREQ = 5_000_000
CON
VAR
byte parastr[64]
PUB main | i
'initialisierung
ios.start 'ios initialisieren
' ios.startram 'code f<00>r test im ram, sollte bei bin-datei auskommentiert werden
' debugx.start(115200)
'sfx-slots setzen
ios.sfx_setslot(@col1, 1) 'sound f<00>r explosion
ios.sfx_setslot(@phaser1, 2) 'sound f<00>r kanone
ios.sddmact(ios#DM_USER) 'wieder in userverzeichnis wechseln
ios.print(string("Shoot - Loading..."))
'bellatrix-code laden
ios.belload(@beln) 'bellatrix-code laden
ios.sddmact(ios#DM_USER)
'soundadapter
repeat
case ios.bus_getchar2 'soundkommando einlesen
1: ios.hss_playfile(@men) 'musik titelscreen ein
2: ios.hss_playfile(@bgm) 'musik ingame ein
3: ios.sfx_fire(2,1) 'explosion
4: ios.sfx_stop(2) 'phaser
ios.sfx_fire(1,2)
5: ios.hss_stop 'musik aus
repeat i from 0 to 3 'hss-register <00>bertragen
ios.bus_putlong2(ios.hss_peek(3 + i<<3))
DAT
beln byte "shoot.bel",0 ' bella-code
bgm byte "game.hss",0 ' hintergrundmusi
men byte "menu.hss",0 ' men<00>musi
phaser0
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
byte $06,$03,$80,$0F,$08,$04,$05,$00,$FF,$40,$50,$11
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
phaser1
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
byte $01,$04,$10,$0F,$00,$03,$01,$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
phaser2
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
byte $01,$04,$88,$0F,$00,$01,$01,$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
phaser3
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
byte $01,$04,$88,$0F,$00,$02,$01,$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
col1
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
byte $01,$04,$10,$0F,$88,$03,$01,$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
col2
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
byte $01,$04,$88,$0F,$00,$05,$01,$00,$FF,$01,$50,$66
byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
col3
' Wav Len Fre Vol LFO LFW FMa AMa Att Dec Sus Rel
byte $01,$02,$55,$0F,$03,$03,$FF,$FF,$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
'Wav 'Len 'Fre 'Vol 'LFO 'LFW 'FMa 'AMa
SoundFX1 byte $06, $FF, $80, $04, $00, $00, $40, $00
'Att 'Dec 'Sus 'Rel
byte $F0, $80, $00, $FF
'Wav 'Len 'Fre 'Vol 'LFO 'LFW 'FMa 'AMa
SoundFX2 byte $05, $FF, $00, $0F, $04, $FF, $01, $05
'Att 'Dec 'Sus 'Rel
byte $F1, $24, $00, $FF
'16step Sequencer Table
byte $F1, $78, $3C, $00, $00, $00, $F1, $78, $3C, $00, $00, $00, $00, $00, $00, $00
{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TERMS OF USE: MIT License %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$%
%Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation %
%files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, %
%modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software%
%is furnished to do so, subject to the following conditions: %
% %
%The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.%
% %
%THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE %
%WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR %
%COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, %
%ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}}