-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
345 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
"stdlib.h": "c", | ||
"menu.h": "c", | ||
"video.h": "c", | ||
"random": "c" | ||
"random": "c", | ||
"docview.h": "c" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
KAKURO | ||
------ | ||
|
||
Kakuro is a logic-based number puzzle game, often described as a cross between a | ||
crossword and Sudoku. In this game, players fill a grid with digits from 1 to 9, | ||
with the objective of matching the sum of numbers in each row or column to a | ||
given target. However, no number can be repeated within a single sum. Each clue | ||
is represented as a small number in a black cell, dictating the sum of the | ||
digits to be placed in the adjacent white cells. | ||
|
||
For the Commander X16, Kakuro offers a nostalgic experience, blending the | ||
puzzle's classic challenge with the retro charm of 8-bit computing. Players | ||
navigate the grid using the mouse and inputting numbers via keyboard. The game | ||
tests mathematical reasoning and strategic thinking, making it an engaging | ||
pastime for puzzle enthusiasts and retro gaming fans alike. The simplistic yet | ||
captivating design ensures that Kakuro on the Commander X16 is both a mental | ||
workout and a tribute to vintage gaming. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
/************************************************************************** | ||
* * | ||
* Author: Ivo Filot <ivo@ivofilot.nl> * | ||
* * | ||
* CX16-KAKURO 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. * | ||
* * | ||
* CX16-KAKURO 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/. * | ||
* * | ||
**************************************************************************/ | ||
|
||
#include "docview.h" | ||
|
||
/** | ||
* @brief Initialize screen | ||
* | ||
*/ | ||
void docview_init_screen() { | ||
// set scaling (resolution: 640 x 480) | ||
VERA.display.hscale = 128; | ||
VERA.display.vscale = 128; | ||
|
||
// layer 0 | ||
// This layer contains the game background and the puzzle background; this | ||
// includes all 'static' squares | ||
set_tilebase_layer0(TILEBASE_MENU); | ||
|
||
// layer 1 | ||
// On this layer, the values that the user fills in for the tiles are shown | ||
VERA.layer1.config = (1 << 3) | (2 << 4) | (1 << 6); // T256C | ||
VERA.layer1.tilebase = (TILEBASE_FONT8 >> 9); // 16 x 16 tiles | ||
VERA.layer1.mapbase = MAPBASE1 >> 9; | ||
|
||
// enable both layers | ||
VERA.display.video |= 0b00110000; | ||
|
||
// enable sprites | ||
//VERA.display.video |= 0b01000000; | ||
|
||
docview_clear_screen(); | ||
} | ||
|
||
/** | ||
* @brief Prepare screen to write text to it | ||
* | ||
*/ | ||
void docview_clear_screen() { | ||
fill_layer(TILE_BACKGROUND, LAYER0, PALETTEBYTE, 64, 64); | ||
fill_layer(0x20, LAYER1, 0x00, 64, 128); | ||
} | ||
|
||
/** | ||
* @brief Write string to screen | ||
* | ||
* @param s | ||
*/ | ||
void docview_write_string(const char* s) { | ||
uint8_t x = 0; | ||
uint8_t y = 0; | ||
uint32_t map_base_addr = MAPBASE1 + (y << 7 + x) * 2; | ||
|
||
VERA.address = map_base_addr; | ||
VERA.address_hi = map_base_addr >> 16; | ||
VERA.address_hi |= 0b10000; | ||
|
||
|
||
while(*s != '\0') { | ||
VERA.data0 = *s - 0x20; | ||
VERA.data0 = 0x02; | ||
|
||
x++; | ||
if(x >= 80) { | ||
x = 0; | ||
y++; | ||
map_base_addr = MAPBASE1 + (y << 7 + x) * 2; | ||
VERA.address = map_base_addr; | ||
VERA.address_hi = map_base_addr >> 16; | ||
VERA.address_hi |= 0b10000; | ||
} | ||
|
||
s++; | ||
} | ||
} | ||
|
||
/** | ||
* @brief Load file into memory | ||
* | ||
* @param s | ||
*/ | ||
void docview_load_file(const char* s) { | ||
uint8_t *ptr; | ||
asm("lda #%b", RAMBANK_DOCVIEW); | ||
asm("sta 0"); | ||
|
||
// load puzzle into memory | ||
cbm_k_setnam(s); | ||
cbm_k_setlfs(0, 8, 2); | ||
ptr = (uint8_t*)(cbm_k_load(0, BANKED_RAM)); | ||
*ptr = 0x00; // write terminating byte | ||
|
||
asm("lda 0"); | ||
asm("sta 0"); | ||
} | ||
|
||
/** | ||
* @brief Print file contents onto screen | ||
*/ | ||
void docview_show_file() { | ||
uint8_t x = 0; | ||
uint8_t y = 0; | ||
uint8_t *s = (uint8_t*)(BANKED_RAM); | ||
uint32_t map_base_addr = MAPBASE1 + (y << 7 + x) * 2; | ||
|
||
// set docview ram bank | ||
asm("lda #%b", RAMBANK_DOCVIEW); | ||
asm("sta 0"); | ||
|
||
VERA.address = map_base_addr; | ||
VERA.address_hi = map_base_addr >> 16; | ||
VERA.address_hi |= 0b10000; | ||
|
||
while(*s != '\0') { | ||
if(*s == 0x0A) { | ||
x = 0; | ||
y++; | ||
map_base_addr = MAPBASE1 + (y << 7 + x) * 2; | ||
VERA.address = map_base_addr; | ||
VERA.address_hi = map_base_addr >> 16; | ||
VERA.address_hi |= 0b10000; | ||
} else { | ||
VERA.data0 = *s - 0x20; | ||
VERA.data0 = 0x12; | ||
} | ||
|
||
s++; | ||
} | ||
|
||
// return to original ram bank | ||
asm("lda 0"); | ||
asm("sta 0"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/************************************************************************** | ||
* * | ||
* Author: Ivo Filot <ivo@ivofilot.nl> * | ||
* * | ||
* CX16-KAKURO 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. * | ||
* * | ||
* CX16-KAKURO 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 _DOCVIEW_H | ||
#define _DOCVIEW_H | ||
|
||
#include <ascii_charmap.h> | ||
|
||
#include "video.h" | ||
|
||
/** | ||
* @brief Initialize screen | ||
* | ||
*/ | ||
void docview_init_screen(); | ||
|
||
/** | ||
* @brief Prepare screen to write text to it | ||
* | ||
*/ | ||
void docview_clear_screen(); | ||
|
||
/** | ||
* @brief Write string to screen | ||
* | ||
* @param s | ||
*/ | ||
void docview_write_string(const char* s); | ||
|
||
/** | ||
* @brief Load file into memory | ||
* | ||
* @param s | ||
*/ | ||
void docview_load_file(const char* s); | ||
|
||
/** | ||
* @brief Print file contents onto screen | ||
*/ | ||
void docview_show_file(); | ||
|
||
#endif // _DOCVIEW_H |
Oops, something went wrong.