From fad7e5a983ef957ddb55373c7d492cf3ba75500b Mon Sep 17 00:00:00 2001 From: Manuel Martinez Date: Tue, 25 Aug 2020 12:03:11 +0200 Subject: [PATCH] solved the problem where a solution with diagonal ships was accepted --- Makefile | 1 + src/common.h | 3 +++ src/level.c | 1 + src/main.c | 7 +++++-- src/opening.c | 27 +++++++++++++++------------ 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 3beb8ed..188d9ff 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,7 @@ CCFLAGS_LINUX += -DID=1012002253UL -DPSEED=27633UL ADDR_DATA = 0xC000 CCZ80 = sdcc_msx/bin/sdcc-3.9.0/bin/sdcc +ASM = sdcc_msx/bin/sdcc-3.9.0/bin/sdasz80 MAX_ALLOCS = 20000 diff --git a/src/common.h b/src/common.h index d2fdc55..d91b227 100644 --- a/src/common.h +++ b/src/common.h @@ -13,6 +13,9 @@ USING_MODULE(psg, PAGE_C); #include +#define SOTANO_EDITION 0 + + //////////////////////////////////////////////////////////////////////// // SOUND USING_MODULE(test_afb,PAGE_D); diff --git a/src/level.c b/src/level.c index f85144b..7eff507 100644 --- a/src/level.c +++ b/src/level.c @@ -248,6 +248,7 @@ static bool update_legend_counts() { for (uint8_t j=1; j<11; j++) { uint8_t c = map_display[i][j]; if (c<=WATER) continue; + if (map_correctness[i][j]==false) continue; if (c==SHIP_SUB) { countShipsFound[0]++; continue; diff --git a/src/main.c b/src/main.c index c718d00..9074609 100644 --- a/src/main.c +++ b/src/main.c @@ -23,8 +23,11 @@ int main(void) { paged_isr.f = nullptr; msxhal_install_isr(main_isr); - language = ENGLISH; - language = SPANISH; + if (SOTANO_EDITION) { + language = SPANISH; + } else { + language = ENGLISH; + } while (true) { CALL_B(opening, start_opening); diff --git a/src/opening.c b/src/opening.c index 5248c1d..252c59c 100644 --- a/src/opening.c +++ b/src/opening.c @@ -330,18 +330,21 @@ static bool draw_opening() { draw_title(); - textProperties.font_segment = MODULE_SEGMENT(font_tiny,PAGE_D); - textProperties.font_pts = font_tiny_pts; - textProperties.font_pos = font_tiny_pos; - textProperties.font_len = font_tiny_len; - textProperties.faster = true; - textProperties.x = 0; - textProperties.y = 186; - textProperties.sz = 1; - writeText(TEXT_SOTANO[language]); - rectangle(0,185,textProperties.x-1,191,0x00,FWhite+BBlack); - textProperties.x = 0; - writeText(TEXT_SOTANO[language]); + if (SOTANO_EDITION) { + + textProperties.font_segment = MODULE_SEGMENT(font_tiny,PAGE_D); + textProperties.font_pts = font_tiny_pts; + textProperties.font_pos = font_tiny_pos; + textProperties.font_len = font_tiny_len; + textProperties.faster = true; + textProperties.x = 0; + textProperties.y = 186; + textProperties.sz = 1; + writeText(TEXT_SOTANO[language]); + rectangle(0,185,textProperties.x-1,191,0x00,FWhite+BBlack); + textProperties.x = 0; + writeText(TEXT_SOTANO[language]); + }