Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • saframa9/apo_semestral
1 result
Show changes
Commits on Source (12)
......@@ -5,18 +5,16 @@ Theme: Rogue-like game
Main task: Port "legendary" videogame Rogue to the Microzed control unit.
What should be inplemented:
-Movement of character using control knobs
-Small menu using one control knob
-Sending image to the display
-(LED blicking when hit, or when hitting something)
-???(random map generation)???
What should be inplemented:
-Movement of character using control knobs
-Small menu using one control knob
-Sending image to the display
-(LED blicking when hit, or when hitting something)
-???(random map generation)???
Short introduction in czech:
Rogue je hra, ve které musite procházet několik místnosti podzemí (tzv. dungeon=crawler) a vaším úkolem je bojovat s příšerami. Když zemře poslední příśera, hra skončí, pokud vás ale zabije příśera, tak budete muset začínat znovu.
Rogue je hra, ve které musite procházet několik místnosti podzemí (tzv. dungeon=crawler) a vaším úkolem je bojovat s příšerami. Když zemře poslední příśera, hra skončí, pokud vás ale zabije příśera, tak budete muset začínat znovu.
Vaše postava bude mít určitý počet úrovní, které se budou zvyšovat po zabití monster. S větší úrovní přichází velká síla (a s ní velká zodpovědnost)
Ovládat hrdinu budete pomocí dvou otočných koleček, jeden pro pohyb doprava/doleva, druhy pro pohyb nahoru/dolu. Navíc jedno z koleček bude ovládat menu, kdyby jste náhodou chtěli ukončit hru dřiv.
Ve hře se bude zobrazovat vaše úroveň, počet hp, a kolik pośkození budete zpusobovat nepřátelům.
Ovládat hrdinu bud
\ No newline at end of file
......@@ -16,7 +16,7 @@ SOURCES = Rogue.c movement.c knobs.c draw_map.c
SOURCES += mzapo_phys.c mzapo_parlcd.c serialize_lock.c
SOURCES += font_prop14x16.c font_rom8x16.c
TARGET_EXE = Rogue
TARGET_IP ?= 192.168.223.137
TARGET_IP ?= 192.168.223.129
ifeq ($(TARGET_IP),)
ifneq ($(filter debug run,$(MAKECMDGOALS)),)
$(warning The target IP address is not set)
......
......@@ -2,13 +2,11 @@
Project main function template for MicroZed based MZ_APO board
designed by Petr Porazil at PiKRON
Game implementation by:
Game implementation by:
- Matvej Safrankov
- Daniil Partsiankou
*******************************************************************/
#define _POSIX_C_SOURCE 200112L
// STDANDART LIBRARIES ====================================================================================
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
......@@ -16,42 +14,115 @@
#include <unistd.h>
#include <math.h>
// MZAPO HARDWARE LIBRARIES ================================================================================
#include "mzapo_phys.h"
#include "mzapo_regs.h"
// OUR LIBRARIES ==========================================================================================
#include "movement.h"
#include "knobs.h"
#include "map.h"
#include "macros.h"
// MAIN ====================================================================================================
int main(int argc, char *argv[])
{
printf("Hello\n");
unsigned char *parperifery_mem_base;
unsigned char *mem_base;
unsigned char *lcd_mem_base;
int game_status = MENU_STATUS;
int option = 1;
mem_base = map_phys_address(SPILED_REG_BASE_PHYS, SPILED_REG_SIZE, 0);
hero Hero = {4, 17, 4294967295, 4294967295};
map[COORD(Hero.x, Hero.y)] = HERO_GLYPH_ID; // place hero
lcd_mem_base = draw_map(map);
lcd_mem_base = map_init();
while (1)
{
parperifery_mem_base = map_phys_address(SPILED_REG_BASE_PHYS, SPILED_REG_SIZE, 0);
uint32_t saved_knobs = *(uint32_t *)(parperifery_mem_base + SPILED_REG_KNOBS_8BIT_o);
char input = knob_input(parperifery_mem_base, saved_knobs);
Hero = move_hero(input, Hero, map);
if (input == 'p')
break;
map[COORD(Hero.x, Hero.y)] = HERO_GLYPH_ID;
*(volatile uint32_t *)(mem_base + SPILED_REG_LED_LINE_o) = Hero.HP;
lcd_mem_base = redraw_map(map, lcd_mem_base);
// MENU ====================================================================================================
if (game_status == MENU_STATUS)
{
while (1)
{
lcd_mem_base = redraw_menu(menu, lcd_mem_base, option);
parperifery_mem_base = map_phys_address(SPILED_REG_BASE_PHYS, SPILED_REG_SIZE, 0);
uint32_t saved_knobs = *(uint32_t *)(parperifery_mem_base + SPILED_REG_KNOBS_8BIT_o);
char input = knob_input(parperifery_mem_base, saved_knobs);
if (input == GREEN_UP)
{
option--;
if (option < 1)
{
option = 3;
}
}
else if (input == GREEN_DOWN)
{
option++;
if (option > 3)
{
option = 1;
}
}
else if (input == GREEN_PRESS)
{
if (option == 1)
{
game_status = 1;
break;
}
else if (option == 2)
{
game_status = 2;
break;
}
else if (option == 3)
{
exit(0);
}
}
}
}
// GAME ====================================================================================================
else
{
if (game_status == MAP1_STATUS)
{
fetch_map(map1, map);
}
else
{
fetch_map(map2, map);
}
hero Hero = {4, 17, 4294967295, 4294967295};
map[COORD(Hero.x, Hero.y)] = HERO_GLYPH_ID; // place hero
while (1)
{
parperifery_mem_base = map_phys_address(SPILED_REG_BASE_PHYS, SPILED_REG_SIZE, 0);
uint32_t saved_knobs = *(uint32_t *)(parperifery_mem_base + SPILED_REG_KNOBS_8BIT_o);
char input = knob_input(parperifery_mem_base, saved_knobs);
Hero = move_hero(input, Hero, map);
if (input == RED_PRESS)
{
game_status = 0;
break;
}
map[COORD(Hero.x, Hero.y)] = HERO_GLYPH_ID;
*(volatile uint32_t *)(mem_base + SPILED_REG_LED_LINE_o) = Hero.HP;
if (Hero.HP == 0)
{
printf("You died\n Noob\n");
game_status = MENU_STATUS;
break;
}
lcd_mem_base = redraw_map(map, lcd_mem_base);
}
}
}
printf("Goodbye\n");
exit(0);
}
{ "compressionlevel":-1,
"height":20,
"infinite":false,
"layers":[
{
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0, 0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, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":20,
"id":1,
"name":"\u0421\u043b\u043e\u0439 \u0442\u0430\u0439\u043b\u043e\u0432 1",
"opacity":1,
"type":"tilelayer",
"visible":true,
"width":60,
"x":0,
"y":0
}],
"nextlayerid":2,
"nextobjectid":1,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.10.1",
"tileheight":16,
"tilesets":[
{
"columns":64,
"firstgid":1,
"image":"Textures-16.png",
"imageheight":512,
"imagewidth":512,
"margin":0,
"name":"Textures-16",
"spacing":0,
"tilecount":2048,
"tileheight":16,
"tilewidth":8
}],
"tilewidth":8,
"type":"map",
"version":"1.10",
"width":60
}
\ No newline at end of file
......@@ -2,7 +2,6 @@
unsigned short fb[320 * 480];
font_descriptor_t *fdes;
int scale = 1;
unsigned int hsv2rgb_lcd(int hue, int saturation, int value)
{
......@@ -56,18 +55,17 @@ unsigned int hsv2rgb_lcd(int hue, int saturation, int value)
void draw_pixel(int x, int y, unsigned short color)
{
if (x >= 0 && x < 480 && y >= 0 && y < 320)
if (x >= 0 && x < SCREEN_WIDTH && y >= 0 && y < SCREEN_HEIGHT)
{
fb[x + 480 * y] = color;
fb[S_COORD(x,y)] = color;
}
}
void draw_pixel_big(int x, int y, unsigned short color)
void draw_pixel_big(int x, int y, unsigned short color, int scale)
{
int i, j;
for (i = 0; i < scale; i++)
for (int i = 0; i < scale; i++)
{
for (j = 0; j < scale; j++)
for (int j = 0; j < scale; j++)
{
draw_pixel(x + i, y + j, color);
}
......@@ -88,7 +86,7 @@ int char_width(int ch)
return width;
}
void draw_char(int x, int y, char ch, unsigned short color)
void draw_char(int x, int y, char ch, unsigned short color, int scale)
{
int w = char_width(ch);
const font_bits_t *ptr;
......@@ -111,7 +109,7 @@ void draw_char(int x, int y, char ch, unsigned short color)
{
if ((val & 0x8000) != 0)
{
draw_pixel_big(x + scale * j, y + scale * i, color);
draw_pixel_big(x + scale * j, y + scale * i, color, scale);
}
val <<= 1;
}
......@@ -142,52 +140,102 @@ char choose_glyph(unsigned char glyph)
}
}
unsigned char *draw_map(unsigned char map[])
unsigned char *map_init()
{
unsigned char *parlcd_mem_base;
int i, j;
parlcd_mem_base = map_phys_address(PARLCD_REG_BASE_PHYS, PARLCD_REG_SIZE, 0);
if (parlcd_mem_base == NULL)
exit(1);
parlcd_hx8357_init(parlcd_mem_base);
int ptr;
return parlcd_mem_base;
}
unsigned char *redraw_map(unsigned char map[], unsigned char *mem_base)
{
int scale = 1;
fdes = &font_rom8x16;
unsigned int col = hsv2rgb_lcd(255, 0, 255);
for (int ptr = 0; ptr < SCREEN_SIZE; ptr++)
{
fb[ptr] = 0;
}
for (int y = 0; y < SCREEN_HEIGHT; y++)
{
for (int x = 0; x < SCREEN_WIDTH; x++)
{
if ((y % 16 == 0) && (x % 8 == 0))
{
draw_char(x , y, choose_glyph(map[RECALC_COORD(x, y)]), hsv2rgb_lcd(255, 0, 255), scale);
parlcd_write_cmd(mem_base, 0x2c);
}
}
}
for (int ptr = 0; ptr < SCREEN_SIZE; ptr++)
{
parlcd_write_data(mem_base, fb[ptr]);
}
return redraw_map(map, parlcd_mem_base);
return mem_base;
}
unsigned char *redraw_map(unsigned char map[], unsigned char *mem_base)
unsigned char *redraw_menu(unsigned char menu[], unsigned char *mem_base, int option)
{
int scale = 2;
fdes = &font_rom8x16;
unsigned int col = hsv2rgb_lcd(255, 0, 255);
for (int ptr = 0; ptr < 320 * 480; ptr++)
for (int ptr = 0; ptr < SCREEN_SIZE; ptr++)
{
fb[ptr] = 0;
}
for (int i = 0; i < 320; i++)
for (int y = 0; y < MENU_WIDTH; ++y)
{
for (int j = 0; j < 480; j++)
for (int x = 0; x < MENU_HEIGHT; ++x)
{
if ((i % 16 == 0) && (j % 8 == 0))
unsigned int color = 0;
if (option == 1 && y == 2)
{
draw_char((int)j, (int)i, choose_glyph(map[(j / 8) + (i / 16) * 60]), col);
parlcd_write_cmd(mem_base, 0x2c);
color = hsv2rgb_lcd(110, 150, 93);
}
else if (option == 2 && y == 4)
{
color = hsv2rgb_lcd(110, 150, 93);
}
else if (option == 3 && y == 6)
{
color = hsv2rgb_lcd(110, 150, 93);
}
else
{
color = hsv2rgb_lcd(255, 0, 255);
}
if (menu[y * 30 + x] != 0)
{
draw_char(x * 8 * scale, y * 16 * scale, menu[y * 30 + x], color, scale);
}
parlcd_write_cmd(mem_base, 0x2c);
}
}
for (int ptr = 0; ptr < 320 * 480; ptr++)
for (int ptr = 0; ptr < SCREEN_SIZE; ptr++)
{
parlcd_write_data(mem_base, fb[ptr]);
}
return mem_base;
}
unsigned char *fetch_map(unsigned char map_to_fetch[], unsigned char map[])
{
for (int m = 0; m < SCREEN_SIZE; ++m)
{
map[m] = map_to_fetch[m];
}
return map;
}
......@@ -8,25 +8,15 @@
#include "mzapo_regs.h"
#include "font_types.h"
#include "hero.h"
#define WIDTH 60
#define COORD(x, y) ((y) * WIDTH + (x))
#define WALL_GLYPH_ID 1
#define ENEMY_GLYPH_ID 2
#define HEAL_GLYPH_ID 3
#define HERO_GLYPH_ID 4
#define WALL_GLYPH 0x23
#define ENEMY_GLYPH 0xec
#define HEAL_GLYPH 0x2b
#define HERO_GLYPH 0x02
#include "macros.h"
unsigned char *redraw_map(unsigned char map[], unsigned char *mem_base);
char choose_glyph(unsigned char glyph);
unsigned int hsv2rgb_lcd(int hue, int saturation, int value);
void draw_pixel(int x, int y, unsigned short color);
void draw_pixel_big(int x, int y, unsigned short color);
void draw_pixel_big(int x, int y, unsigned short color, int scale);
int char_width(int ch);
void draw_char(int x, int y, char ch, unsigned short color);
unsigned char *draw_map(unsigned char map[]);
void draw_char(int x, int y, char ch, unsigned short color, int scale);
unsigned char *map_init();
unsigned char *redraw_menu(unsigned char menu[], unsigned char *mem_base, int option);
unsigned char *fetch_map(unsigned char map_to_fetch[], unsigned char map[]);
......@@ -32,47 +32,47 @@ char knob_input(unsigned char *mem_base, uint32_t saved_knobs)
if (current_knob_press_g != saved_knob_press_g)
{
direction = 'o';
direction = GREEN_PRESS;
}
if (current_knob_press_b != saved_knob_press_b)
{
direction = 'p';
direction = BLUE_PRESS;
}
if (current_knob_press_r != saved_knob_press_r)
{
direction = 'i';
direction = RED_PRESS;
}
if (current_red_knob != saved_red_knob)
{
if (current_red_knob < saved_red_knob)
{
direction = '2';
direction = RED_DOWN;
}
else
{
direction = '8';
direction = RED_UP;
}
}
if (current_green_knob != saved_green_knob)
{
if (current_green_knob < saved_green_knob)
{
direction = '9';
direction = GREEN_DOWN;
}
else
{
direction = '3';
direction = GREEN_UP;
}
}
if (current_blue_knob != saved_blue_knob)
{
if (current_blue_knob < saved_blue_knob)
{
direction = '4';
direction = BLUE_DOWN;
}
else
{
direction = '6';
direction = BLUE_UP;
}
}
......
......@@ -5,4 +5,6 @@
#include "mzapo_phys.h"
#include "mzapo_regs.h"
#include "macros.h"
char knob_input(unsigned char *mem_base, uint32_t saved_knobs);
\ No newline at end of file
#define GREEN_PRESS 'o'
#define BLUE_PRESS 'p'
#define RED_PRESS 'i'
#define RED_UP '8'
#define RED_DOWN '2'
#define GREEN_UP '9'
#define GREEN_DOWN '3'
#define BLUE_UP '6'
#define BLUE_DOWN '4'
#define MENU_STATUS 0
#define MAP1_STATUS 1
#define MAP2_STATUS 2
#define ERROR_CALLOC_MSG "Error: Failed to allocate memory for map.\n"
#define SCREEN_WIDTH 480
#define SCREEN_HEIGHT 320
#define SCREEN_SIZE SCREEN_HEIGHT*SCREEN_WIDTH
#define S_COORD(x, y) ((y)*SCREEN_WIDTH + (x))
#define MAP_WIDTH 60
#define MAP_HEIGHT 20
#define COORD(x, y) ((y) * MAP_WIDTH + (x))
#define RECALC_COORD(x, y) (((x) / 8) + ((y) / 16) * MAP_WIDTH)
#define MENU_HEIGHT 40
#define MENU_WIDTH 120
#define WALL_GLYPH_ID 1
#define ENEMY_GLYPH_ID 2
#define HEAL_GLYPH_ID 3
#define HERO_GLYPH_ID 4
#define WALL_GLYPH 0x23
#define ENEMY_GLYPH 0xec
#define HEAL_GLYPH 0x2b
#define HERO_GLYPH 0x02
\ No newline at end of file
unsigned char map[] = {0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,3,0,1,
0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,0,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,
0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,3,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,0,0,1,
1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,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0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 'M', 'A', 'P', 0, '2', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'E', 'X', 'I', 'T', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
\ No newline at end of file
......@@ -9,11 +9,6 @@ hero get_hit(hero Hero)
{
Hero.minus_HP >>= 8;
Hero.HP = Hero.minus_HP & Hero.HP;
if (Hero.HP == 0)
{
printf("You died\n Noob\n");
exit(0);
}
return Hero;
}
......@@ -30,7 +25,7 @@ hero move_hero(char direction, hero Hero, unsigned char map[])
clear_spot(Hero, map);
switch (direction)
{
case ('8'):
case (RED_UP):
{
if (map[COORD(Hero.x, Hero.y + 1)] != 1)
{
......@@ -46,7 +41,7 @@ hero move_hero(char direction, hero Hero, unsigned char map[])
}
break;
}
case ('2'):
case (RED_DOWN):
{
if (map[COORD(Hero.x, Hero.y - 1)] != 1)
{
......@@ -62,7 +57,7 @@ hero move_hero(char direction, hero Hero, unsigned char map[])
}
break;
}
case ('4'):
case (BLUE_DOWN):
{
if (map[COORD(Hero.x - 1, Hero.y)] != 1)
{
......@@ -78,7 +73,7 @@ hero move_hero(char direction, hero Hero, unsigned char map[])
}
break;
}
case ('6'):
case (BLUE_UP):
{
if (map[COORD(Hero.x + 1, Hero.y)] != 1)
{
......