mirror of
https://github.com/irmen/prog8.git
synced 2024-10-17 10:24:55 +00:00
36 lines
697 B
Lua
36 lines
697 B
Lua
%import textio
|
|
%import psg
|
|
%zeropage basicsafe
|
|
|
|
main {
|
|
|
|
sub start() {
|
|
ubyte @shared variable
|
|
|
|
sub nested() {
|
|
ubyte @shared variable2
|
|
|
|
variable2 = 33
|
|
nested()
|
|
|
|
sub nested() {
|
|
ubyte @shared variable3
|
|
|
|
variable3 = 33
|
|
}
|
|
}
|
|
|
|
nested()
|
|
explosion()
|
|
}
|
|
|
|
sub explosion() {
|
|
; this subroutine is not used but it is an example of how to make a sound effect using the psg library!
|
|
psg.silent()
|
|
psg.voice(0, psg.LEFT, 63, psg.NOISE, 0)
|
|
psg.voice(1, psg.RIGHT, 63, psg.NOISE, 0)
|
|
psg.freq(0, 1000)
|
|
psg.freq(1, 2000)
|
|
}
|
|
}
|