Integrate CardGame with VCC Plus disk builds and verified graphics demo
Preserve the upstream library, demo sources and Makefile unchanged. Add the vccplus-disk target, project settings, delivered CardGame.DSK and actual public-MCP screenshot with build-43 validation.
This commit is contained in:
1 parent
d3a54e24ee
commit
f6676b83f0
10 files changed
+292
-100
No files matched your search
@@ -1,115 +1,48 @@
|
||||
CardGame
|
||||
========
|
||||
# CardGame graphics demo
|
||||
|
||||
By Pierre Sarrazin (<http://sarrazip.com/>).
|
||||
A playing-card and PMODE 4 graphics library by **Pierre Sarrazin**, with its
|
||||
original demonstration program. This repository contains upstream version
|
||||
**0.1.15** with a VCC Plus project and disk launcher.
|
||||
|
||||
This library is in the public domain.
|
||||

|
||||
|
||||
It is a C library that offers a PMODE 4 game library that can display
|
||||
playing cards. It targets the Tandy Color Computer but should also work
|
||||
on the Dragon. Most of the features should also work on CoCo-based
|
||||
versions of OS-9.
|
||||
## Download and run
|
||||
|
||||
Download [CardGame.DSK](CardGame.DSK). Mount a writable copy in drive 0 of a
|
||||
**512 KB CoCo 3 / 6809 / Disk BASIC** machine, then type:
|
||||
|
||||
# OS-9 Support
|
||||
```basic
|
||||
LOADM"CARDGAME":EXEC
|
||||
```
|
||||
|
||||
OS-9 was suspended with version 0.1.11 but has been restored with version 0.1.12.
|
||||
The demonstration displays a complete four-suit deck and the prompt
|
||||
**PRESS BREAK TO QUIT**. Use the CoCo Break key to leave the demonstration.
|
||||
|
||||
Note that the sound features of this version of the library are not supported under OS-9.
|
||||
## Build in VCC Plus
|
||||
|
||||
To compile with OS-9, pass TARGET=os9 to make.
|
||||
1. Open this repository’s root folder in **Develop → C Development → Open**.
|
||||
2. Select **Release**, then choose **Build Disk**.
|
||||
3. Use **Show Build Products** to find `CardGame.DSK` and `cardgame.bin` in the
|
||||
build snapshot. Launch the disk with the command above.
|
||||
|
||||
The "cardgame" demo program MUST be run from a 32x16 VDG terminal.
|
||||
Use the Clear key to find one.
|
||||
If none exists, create one with the "shell i=/v1" command, then use Clear to find it.
|
||||
The project selects `VCCPlus.mk`, which includes the original `Makefile` and adds
|
||||
the `vccplus-disk` packaging target. It uses VCC Plus’s bundled CMOC and disk tools.
|
||||
|
||||
The "os9timer" demo program can be run from any terminal.
|
||||
The disk build and illustrated run were verified through the public MCP
|
||||
interface in **VCC Plus 3.5.0 build 43**, using the configuration above.
|
||||
[Validation details](docs/VALIDATION.md) describe the checked behavior and limits.
|
||||
|
||||
There is no "beep" demo program for OS-9.
|
||||
## Original source
|
||||
|
||||
- Author: [Pierre Sarrazin](http://sarrazip.com/).
|
||||
- [CMOC project index](http://sarrazip.com/dev/cmoc.html).
|
||||
- [Cardgame 0.1.15 source archive](http://sarrazip.com/dev/cardgame-0.1.15.tar.gz).
|
||||
- Archive SHA-256: `ca706dddd96fec63b829f8958c2e47485b0e1166129d45fda0b6369404c1bb54`.
|
||||
|
||||
# Adapting to version 0.1.11
|
||||
The [original README](docs/UPSTREAM_README.md) and source notices are preserved.
|
||||
See [source provenance](docs/PROVENANCE.md) for the import and integration history.
|
||||
|
||||
openPMode4GameScreenMode() and closePMode4GameScreenMode() have been renamed to
|
||||
openPMode4Game() and closePMode4Game() because the latter does not restore
|
||||
the screen mode anymore. It cannot know in which mode the screen was initially.
|
||||
## License
|
||||
|
||||
openPMode4Game() does not call resetPalette() anymore, which assumed that Basic
|
||||
was present. That call was made only when TRUE was passed for emulatePMode4OnCoCo3.
|
||||
Now, in this case, only palette slots 0..3 are initialized.
|
||||
|
||||
openCardGameScreenMode() and closeCardGameScreenMode() have been renamed to
|
||||
openCardGame() and closeCardGame() for similar reasons.
|
||||
|
||||
restoreOriginalTextMode() has been removed from the interface, since it relied
|
||||
on Basic. The program must restore the text mode itself, if needed.
|
||||
|
||||
Under OS-9, this can be done this way:
|
||||
|
||||
putstr("\x12\x0E", 2);
|
||||
|
||||
Under the native environment:
|
||||
|
||||
screen(0, 0);
|
||||
|
||||
Function waitForKeyWithAnimatedCursor() and readLineFromKeyboard() must now
|
||||
be passed a callback to a function that returns a timer value that increments
|
||||
60 times per second. See pmode4game.h for details.
|
||||
|
||||
|
||||
# Text font
|
||||
|
||||
The text font supports ASCII characters 32 to 96 inclusively. It does not
|
||||
support lower-case letters.
|
||||
|
||||
The font is 8 bits wide, which makes it relatively efficient to write.
|
||||
|
||||
See 8-bit-wide-font.h and 8-bit-wide-font.c.
|
||||
|
||||
|
||||
# Version history
|
||||
|
||||
0.1.0 - 2015-08-12 - First public release.
|
||||
0.1.1 - 2016-03-12 - New #defines. New function drawFaceDownCard().
|
||||
0.1.2 - 2016-03-25 - setConsoleOutHook() and resetConsoleOutHook() now taken
|
||||
from <coco.h>.
|
||||
0.1.3 - 2017-12-01 - openCardGameScreenMode() now optionally emulates PMODE 4
|
||||
in a CoCo 3 mode to approximate the artifact colors.
|
||||
Assumes RGB mode. Adapted to compile in linker mode.
|
||||
0.1.4 - 2018-04-03 - Adaptation to CMOC 0.1.51 (const).
|
||||
0.1.5 - 2018-08-04 - Added square brackets and backslash to 8-bit-wide-font.c.
|
||||
Added sound routines.
|
||||
0.1.6 - 2018-09-20 - Adapted to CMOC 0.1.53.
|
||||
Sound functions now declared by cardgame.h. beep.h now obsolete.
|
||||
0.1.7 - 2018-10-04 - Fixed openPMode4GameScreenMode() re: CoCo 3 mode.
|
||||
0.1.8 - 2018-11-25 - Now compilable for the Dragon (make TARGET=dragon).
|
||||
0.1.9 - 2019-06-03 - OS-9 supported, except for sound.
|
||||
0.1.10 - 2020-06-28 - Functions added: drawCharWithoutMovingCursor(), moveCursorLeft(),
|
||||
invertCharAtCursor(), waitForKeyWithAnimatedCursor(), readLineFromKeyboard().
|
||||
Removed PMODE4_PAGE0 and PMODE4_PAGE1: use
|
||||
(byte *) (((word) * (byte *) 0x00BC) << 8)
|
||||
to get the ECB PMODE buffer address instead.
|
||||
0.1.11 - 2023-06-27 - The library does not assume the presence of Basic anymore.
|
||||
See section "Adapting to version 0.1.11" for details.
|
||||
OS-9 support is suspended [restored with 0.1.12].
|
||||
0.1.12 - 2024-06-08 - Added setScreenBuffer2(), which allows to omit showing the screen.
|
||||
Put several functions in individual C files to help reduce the size
|
||||
of programs that do not use all functions of this library.
|
||||
Added os9timer-demo.c to the archive generated by 'make dist'.
|
||||
0.1.13 - 2025-11-16 Added drawCompiledCard2(), which supports drawing the suit a little
|
||||
higher or lower than the default, and supports only drawing the top
|
||||
of a card, by specifying the number of pixel rows to draw.
|
||||
Fixed drawCompiledPixMap() so that its inline assembly does not
|
||||
refer to any global C variable in the code section that uses
|
||||
the Y register. (That register is used under OS-9 to point to
|
||||
the current process's global variables segment.) The old code
|
||||
was not defective but its structure was error prone.
|
||||
Added getCursor(), which returns the current position of the cursor.
|
||||
Removed runPMode4GameDoubleBufferLoop(), which is obsolete.
|
||||
0.1.14 - 2026-02-05 Added setInvertedColorsParameters(), which determines how caracters
|
||||
are rendered in inverted colors mode, from parameters drawRowOverGlyph
|
||||
and drawColumnAtRightOfGlyph.
|
||||
Added makeSpacesTransparent(), which determines if space characters
|
||||
are drawn (the pixels take the background color) or not (the pixels
|
||||
remain unmodified).
|
||||
0.1.15 - 2026-09-06 Added ^, _ and ` to the 8-bit-wide font.
|
||||
The upstream library and demonstration code are in the public domain.
|
||||
Original file-level author notices are retained.
|
||||
Reference in new issue
Block a user