Import coco-planes 0.1.0 upstream source snapshot
Original author: Pierre Sarrazin. Preserve upstream GPLv3-or-later and file-specific notices. Source: http://sarrazip.com/dev/coco-planes-0.1.0.tar.gz Archive SHA-256: 29191e6ba225965caa637ee726e1189639dc7fcdf2b68310fb93fbffd56c9c52
This commit is contained in:
commit
7939132267
78 files changed
+6990
No files matched your search
+89
@@ -0,0 +1,89 @@
|
||||
/* constants.h
|
||||
Copyright (C) 2026 Pierre Sarrazin <http://sarrazip.com/>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _H_constants
|
||||
#define _H_constants
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
// PMODE 4 constants.
|
||||
PMODE = 4,
|
||||
PMODE4_SAMV_VALUE = 6, // value for the 3-bit SAM V register (display mode control register)
|
||||
page0 = 7, // first PMODE 4 screen (for 7-bit SAM F register value, i.e., buffer address / 512)
|
||||
page1 = 19, // second PMODE 4 screen
|
||||
grbuf0 = page0 * 512, // address of 1st screen
|
||||
grbuf1 = page1 * 512, // address of 2nd screen
|
||||
PIXELS_PER_BYTE = 8,
|
||||
BYTES_PER_ROW = 32,
|
||||
COLS_PER_SCREEN = 256,
|
||||
ROWS_PER_SCREEN = 192,
|
||||
VIDRAM = 0x0400, // location of Basic's 32x16 text screen
|
||||
TEXT_SCREEN_SIZE_IN_BYTES = 512, // 32x16 screen
|
||||
PALETREG = 0xFFB0, // CoCo 3 color palette register (16 bytes)
|
||||
|
||||
STACK_BOTTOM = grbuf0,
|
||||
RSTFLG = 0x0071, // reset flag used by Color Basic upon warm start
|
||||
RSTVEC = 0x0072, // where Color Basic jumps upon warm start
|
||||
WARM_START_ENTRY_POINT = 0x0074, // this game's warm start routine
|
||||
COCO12_INTR_VECTORS = 0x0100, // 18-byte region containing CoCo 1/2 interrupt vectors
|
||||
RAM_END = 0xFEEE, // first byte NOT part of usable RAM (interrupt vectors on CoCo 3)
|
||||
COCO3_FIRST_CODE_MMU_BLOCK = 0x30, // up to 6 blocks from this one receive .app file
|
||||
|
||||
// Version of BYTES_PER_SCREEN that can be used in an EQU directive
|
||||
// in an inline asm block. BYTES_PER_SCREEN is a #define, which the
|
||||
// C preprocessor expands with an additional trailing space, which causes
|
||||
// the EQU expression to become incomplete and get the wrong numerical value.
|
||||
//
|
||||
BYTES_PER_SCREEN_ = 6144,
|
||||
|
||||
// Game constants.
|
||||
VSYNCS_PER_FLIP = 3,
|
||||
START_PROMPT_COL = (32 - 20) / 2, // column (0..31) in the 32x24 cardgame text screen
|
||||
START_PROMPT_ROW = 17, // row (0..23) in the 32x24 cardgame text screen
|
||||
WRAPPED_TEXT_LEFT_MARGIN = 1,
|
||||
DIGIT_WIDTH = 8, // width in pixels of the digit pixmaps (digit0_bm, etc.)
|
||||
DIGIT_HEIGHT = 5, // height in pixels
|
||||
THIN_BITMAP_Y_POS = ROWS_PER_SCREEN - 1 - DIGIT_HEIGHT,
|
||||
SCORE_WIDTH = 9,
|
||||
TOWER_WIDTH = 16,
|
||||
TOWER_HEIGHT = 17,
|
||||
TOWER_LEFT_X = (COLS_PER_SCREEN - TOWER_WIDTH) / 2,
|
||||
TOWER_TOP_Y = ROWS_PER_SCREEN - TOWER_HEIGHT,
|
||||
MAX_EXPLOSIONS = 3,
|
||||
FRAMES_PER_EXPLOSION = 40, // duration of an explosion animation
|
||||
MAX_BULLETS_PER_PLANE = 2,
|
||||
FRAMES_PER_SHORT_RANGE_BULLET = 10,
|
||||
FRAMES_PER_LONG_RANGE_BULLET = 20,
|
||||
BULLET_MARGIN = 6,
|
||||
BULLET_WIDTH = 4,
|
||||
BALLOON_HEIGHT = 14, // see balloon.bm
|
||||
MIN_BALLOON_TAKE_OFF_TIME = 5 * 20, // min number of frames
|
||||
MAX_BALLOON_TAKE_OFF_TIME = 45 * 20, // max number of frames
|
||||
FRAMES_PER_BALLON_DIR_CHANGE = 1,
|
||||
WINNING_SCORE = 15,
|
||||
MAX_CLOUDS = 2,
|
||||
|
||||
// Speeds in pixels per frame. Horizontal speeds must all be even numbers.
|
||||
|
||||
// Misc.
|
||||
BREAK_KEY = 3, // ASCII code of Break key
|
||||
INVERTED_COLOR_TOGGLE_CHAR = '^', // re: printWrapped()
|
||||
};
|
||||
|
||||
|
||||
#endif /* _H_constants */
|
||||
Reference in new issue
Block a user