Publish VCC Plus OSS source distribution for 3.6.2 build 60
This commit is contained in:
commit
c652a5276d
1192 files changed
+272368
No files matched your search
@@ -0,0 +1,6 @@
|
||||
obj/
|
||||
LANDER.bin
|
||||
LANDER.dsk
|
||||
LANDER.map
|
||||
LANDER.link
|
||||
.vccplus-build/
|
||||
@@ -0,0 +1,49 @@
|
||||
# Generated by VCC Plus — edit Project Settings to regenerate.
|
||||
# Ordinary GNU Make; no VCC Plus project parser is required to build it.
|
||||
CMOC ?= cmoc
|
||||
PERL ?= perl
|
||||
WRITECOCOFILE ?= writecocofile
|
||||
INSTALL_LOADER ?= install-coco-boot-loader
|
||||
VCC_CONFIGURATION ?= Debug
|
||||
ifeq ($(VCC_CONFIGURATION),Release)
|
||||
OPTIM ?= -O2
|
||||
else
|
||||
OPTIM ?= -O0
|
||||
DEBUG_FRAME ?= -fno-omit-frame-pointer
|
||||
endif
|
||||
define VCC_DEFINES
|
||||
|
||||
endef
|
||||
define VCC_COMPILER_OPTIONS
|
||||
|
||||
endef
|
||||
define VCC_LINKER_OPTIONS
|
||||
|
||||
endef
|
||||
export VCC_CMOC_COMPAT = 1
|
||||
CPPFLAGS += $(VCC_DEFINES)
|
||||
CFLAGS += --coco --intermediate --deps --stack-space=2048 $(OPTIM) $(DEBUG_FRAME) $(VCC_COMPILER_OPTIONS)
|
||||
LDFLAGS += --coco --intermediate --org=2800 $(VCC_LINKER_OPTIONS)
|
||||
LDLIBS += -lssc -lorch90 -lbcontrol -lvcccompat
|
||||
OBJECTS := obj/main.o
|
||||
.PHONY: all build clean disk libraries
|
||||
all: build
|
||||
build: LANDER.bin
|
||||
LANDER.bin: $(OBJECTS) Makefile
|
||||
@mkdir -p $(dir $@)
|
||||
"$(CMOC)" $(LDFLAGS) -o $@ $(OBJECTS) $(LDLIBS)
|
||||
obj/main.o: main.c Makefile
|
||||
@mkdir -p $(dir $@)
|
||||
"$(CMOC)" $(CPPFLAGS) $(CFLAGS) --intdir=$(dir $@) -c -o $@ $<
|
||||
|
||||
disk: LANDER.dsk
|
||||
LANDER.dsk: LANDER.bin Makefile
|
||||
@mkdir -p $(dir $@)
|
||||
$(PERL) -e 'print chr(255) x (35*18*256)' > $@
|
||||
$(WRITECOCOFILE) $@ LANDER.bin
|
||||
|
||||
clean:
|
||||
rm -rf obj
|
||||
rm -f LANDER.bin LANDER.map LANDER.link LANDER.dsk
|
||||
|
||||
-include $(OBJECTS:.o=.d)
|
||||
@@ -0,0 +1,11 @@
|
||||
# Talking Planet Lander
|
||||
|
||||
Start the Disk BASIC system profile. In Cartridges, enable the Multi-Pak and install Speech/Sound in slot 1 and Orchestra-90 in slot 2. Keep the floppy controller in startup slot 4. Speech/Sound needs its PIC and speech ROMs. Orchestra-90 works in sound-only mode. Use normal CoCo CPU speed for the beacon.
|
||||
|
||||
Build and Run in C Development, then press **1** for Earth or **2** for Mars in the emulator window. Listen for a low note on the left and a higher one on the right. The pilot announces the destination and landing. During either phrase, press the primary fire button on either CoCo joystick to print **THRUST**. Each press counts once. With either cartridge omitted the visual landing still works.
|
||||
|
||||
The project uses VCC Plus's optional bounded formatter, Speech/Sound and Orchestra-90 libraries, plus BControl for buttons. The source shows how to poll the guest while the cartridge speaks. The stereo beacon uses foreground playback and briefly occupies the processor.
|
||||
|
||||
Use **Build Disk** for a floppy copy. Mount LANDER.dsk in FD0 and enter `LOADM"LANDER":EXEC`. Building on the command line uses the bundled toolchain on PATH and ordinary Make.
|
||||
|
||||
The original example and VCC Plus guest libraries are licensed GPL-3.0-or-later. BControl retains its upstream license.
|
||||
@@ -0,0 +1,80 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#include <cmoc.h>
|
||||
#include <coco.h>
|
||||
#include <stdio.h>
|
||||
#include <Joystick.h>
|
||||
#include <vcc/orch90.h>
|
||||
#include <vcc/ssc.h>
|
||||
|
||||
// Poll the two primary buttons. Reading buttons alone preserves the audio mux.
|
||||
static unsigned char buttonDown;
|
||||
static void checkThruster(void)
|
||||
{
|
||||
unsigned char down = (Joystick_getButtonStates2() & 3) != 3;
|
||||
if (down && !buttonDown)
|
||||
printf("THRUST\n");
|
||||
buttonDown = down;
|
||||
}
|
||||
|
||||
// Send one byte at a time so the player can fire while the cartridge is busy.
|
||||
// The firmware asserts busy after accepting the terminator. Give it time to
|
||||
// start, then wait for it to finish before sending another announcement.
|
||||
static unsigned char announce(const char *words)
|
||||
{
|
||||
ssc_phrase phrase;
|
||||
unsigned int start = getTimer();
|
||||
if (ssc_begin_phrase(&phrase, words) != SSC_OK)
|
||||
return 0;
|
||||
while (ssc_service(&phrase) == SSC_PENDING) {
|
||||
checkThruster();
|
||||
if ((unsigned int)(getTimer() - start) >= 90)
|
||||
return 0;
|
||||
}
|
||||
start = getTimer();
|
||||
while (ssc_status() & SSC_SPEECH_IDLE) {
|
||||
checkThruster();
|
||||
if ((unsigned int)(getTimer() - start) >= 60)
|
||||
return 0;
|
||||
}
|
||||
while (!(ssc_status() & SSC_SPEECH_IDLE)) {
|
||||
checkThruster();
|
||||
if ((unsigned int)(getTimer() - start) >= 600)
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Make an original two-note beacon. At normal CPU speed 16 frames repeat
|
||||
// about 250 times a second. The right-hand note is one octave higher.
|
||||
static void beacon(void)
|
||||
{
|
||||
struct orch90_frame block[128];
|
||||
unsigned char side, i, repeat;
|
||||
for (side = 0; side < 2; ++side) {
|
||||
for (i = 0; i < 128; ++i) {
|
||||
block[i].left = side ? 128 : (i & 8 ? 152 : 104);
|
||||
block[i].right = side ? (i & 4 ? 152 : 104) : 128;
|
||||
}
|
||||
for (repeat = 0; repeat < 6; ++repeat)
|
||||
orch90_play(block, 128, ORCH90_CLOCK_NORMAL);
|
||||
}
|
||||
orch90_write(128, 128);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char key, message[24];
|
||||
unsigned int route;
|
||||
cls(1);
|
||||
printf("TALKING PLANET LANDER\n1 EARTH 2 MARS\n");
|
||||
do { key = waitkey(0); } while (key != '1' && key != '2');
|
||||
snprintf(message, sizeof(message), "DESTINATION %s", key == '1' ? "EARTH" : "MARS");
|
||||
printf("%s\nPRESS FIRE FOR THRUST\n", message);
|
||||
route = ssc_route_audio();
|
||||
beacon();
|
||||
if (announce(message))
|
||||
announce("LANDING COMPLETE");
|
||||
ssc_restore_audio(route);
|
||||
printf("TOUCHDOWN\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"binary": "LANDER.bin",
|
||||
"buildTarget": "build",
|
||||
"cleanTarget": "clean",
|
||||
"configurations": [
|
||||
{
|
||||
"makeArguments": [],
|
||||
"name": "Debug"
|
||||
},
|
||||
{
|
||||
"makeArguments": [
|
||||
"VCC_CONFIGURATION=Release"
|
||||
],
|
||||
"name": "Release"
|
||||
}
|
||||
],
|
||||
"diskImage": "LANDER.dsk",
|
||||
"diskTarget": "disk",
|
||||
"entrySource": "main.c",
|
||||
"jobs": 4,
|
||||
"launchCommands": [],
|
||||
"launchMode": "quickload",
|
||||
"makefile": "Makefile",
|
||||
"makefileSettings": {
|
||||
"compilerOptions": [],
|
||||
"defines": [],
|
||||
"diskBootMode": "none",
|
||||
"diskFiles": [],
|
||||
"diskImage": "LANDER.dsk",
|
||||
"executable": "LANDER.bin",
|
||||
"generatedResources": [],
|
||||
"includePaths": [],
|
||||
"libraries": [
|
||||
"ssc",
|
||||
"orch90",
|
||||
"bcontrol",
|
||||
"vcccompat"
|
||||
],
|
||||
"libraryPaths": [],
|
||||
"libraryProjects": [],
|
||||
"linkerOptions": [],
|
||||
"origin": "2800",
|
||||
"releaseOptimization": "-O2",
|
||||
"sources": [
|
||||
"main.c"
|
||||
],
|
||||
"stackSpace": 2048
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user