-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[common][msx2] switch between tilesets feature
- Loading branch information
1 parent
a6e4ea8
commit c02a40c
Showing
14 changed files
with
356 additions
and
53 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
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,40 @@ | ||
#include "msx2.h" | ||
|
||
/* cursor sprite */ | ||
#define CURSOR_PATTERN_ID 0 | ||
#define CURSOR_SPRITE_ID 0 | ||
#define CURSOR_X_OFFSET 0 | ||
#define CURSOR_Y_OFFSET 0 | ||
|
||
const uint8_t cursor_pattern[32] = { | ||
0x00,0x70,0x40,0x40,0x00,0x00,0x00,0x00, | ||
0x00,0x00,0x00,0x00,0x40,0x40,0x70,0x00, | ||
0x00,0x0E,0x02,0x02,0x00,0x00,0x00,0x00, | ||
0x00,0x00,0x00,0x00,0x02,0x02,0x0E,0x00 | ||
}; | ||
|
||
|
||
/* all black */ | ||
const uint8_t cursor_colors[16] = { | ||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
}; | ||
|
||
|
||
/* mouse sprite */ | ||
#define MOUSE_PATTERN_ID 4 | ||
#define MOUSE_SPRITE_ID 1 | ||
|
||
const uint8_t mouse_pattern[32] = { | ||
0x01,0x01,0x01,0x01,0x01,0x03,0x04,0xFD, | ||
0x04,0x03,0x01,0x01,0x01,0x01,0x01,0x00, | ||
0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x7E, | ||
0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00 | ||
}; | ||
|
||
|
||
/* all black */ | ||
const uint8_t mouse_colors[16] = { | ||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
}; |
5 changes: 0 additions & 5 deletions
5
platforms/msx2/tile_coords.c → platforms/msx2/16x16_tilemap.h
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,41 @@ | ||
#include "msx2.h" | ||
|
||
|
||
/* cursor sprite */ | ||
#define CURSOR_PATTERN_ID 0 | ||
#define CURSOR_SPRITE_ID 0 | ||
#define CURSOR_X_OFFSET -3 | ||
#define CURSOR_Y_OFFSET -3 | ||
|
||
const uint8_t cursor_pattern[32] = { | ||
0x07,0x18,0x23,0x5F,0x50,0x90,0xB0,0xB0, | ||
0x90,0x50,0x5F,0x23,0x18,0x07,0x00,0x00, | ||
0x80,0x60,0x10,0xE8,0x28,0x24,0x34,0x34, | ||
0x24,0x28,0xE8,0x10,0x60,0x80,0x00,0x00, | ||
}; | ||
|
||
|
||
/* all black */ | ||
const uint8_t cursor_colors[16] = { | ||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
}; | ||
|
||
|
||
/* mouse sprite */ | ||
#define MOUSE_PATTERN_ID 4 | ||
#define MOUSE_SPRITE_ID 1 | ||
|
||
const uint8_t mouse_pattern[32] = { | ||
0x01,0x01,0x01,0x01,0x01,0x03,0x04,0xFD, | ||
0x04,0x03,0x01,0x01,0x01,0x01,0x01,0x00, | ||
0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x7E, | ||
0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00 | ||
}; | ||
|
||
|
||
/* all black */ | ||
const uint8_t mouse_colors[16] = { | ||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
}; |
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,161 @@ | ||
#define TILE_POS_X(x, y) ((x) * 8) | ||
static const uint8_t TILE_X[MAX_VIDEO_TILES] = { | ||
[ONE_BOMB] = TILE_POS_X(2, 0), | ||
[TWO_BOMBS] = TILE_POS_X(4, 0), | ||
[THREE_BOMBS] = TILE_POS_X(6, 0), | ||
[FOUR_BOMBS] = TILE_POS_X(8, 0), | ||
[FIVE_BOMBS] = TILE_POS_X(10, 0), | ||
[SIX_BOMBS] = TILE_POS_X(12, 0), | ||
[SEVEN_BOMBS] = TILE_POS_X(14, 0), | ||
[EIGHT_BOMBS] = TILE_POS_X(16, 0), | ||
[BLANK] = TILE_POS_X(18, 0), | ||
[FLAG] = TILE_POS_X(20, 0), | ||
[QUESTION_MARK] = TILE_POS_X(22, 0), | ||
[EMPTY_FLAG] = TILE_POS_X(24, 0), | ||
[BOMB] = TILE_POS_X(26, 0), | ||
[EXPLOSION] = TILE_POS_X(28, 0), | ||
[GROUND] = TILE_POS_X(30, 0), | ||
|
||
[BOMB_ICON] = TILE_POS_X(0, 1), | ||
[HOURGLASS] = TILE_POS_X(1, 1), | ||
|
||
[MINEFIELD_CORNER_TOP_LEFT] = TILE_POS_X(0, 2), | ||
[MINEFIELD_TOP_TEE] = TILE_POS_X(1, 2), | ||
[MINEFIELD_HORIZONTAL_TOP] = TILE_POS_X(2, 2), | ||
[MINEFIELD_HORIZONTAL_MIDDLE] = TILE_POS_X(2, 3), | ||
[MINEFIELD_HORIZONTAL_BOTTOM] = TILE_POS_X(2, 5), | ||
[MINEFIELD_CORNER_TOP_RIGHT] = TILE_POS_X(4, 2), | ||
|
||
[MINEFIELD_LEFT_TEE] = TILE_POS_X(0, 3), | ||
[MINEFIELD_CROSS] = TILE_POS_X(1, 3), | ||
[MINEFIELD_RIGHT_TEE] = TILE_POS_X(4, 3), | ||
|
||
[MINEFIELD_VERTICAL_LEFT] = TILE_POS_X(0, 4), | ||
[MINEFIELD_VERTICAL_MIDDLE] = TILE_POS_X(2, 3), | ||
[MINEFIELD_VERTICAL_RIGHT] = TILE_POS_X(4, 4), | ||
[CLOSED_CELL] = TILE_POS_X(2, 4), | ||
|
||
[MINEFIELD_CORNER_BOTTOM_LEFT] = TILE_POS_X(0, 5), | ||
[MINEFIELD_BOTTOM_TEE] = TILE_POS_X(1, 5), | ||
[MINEFIELD_CORNER_BOTTOM_RIGHT] = TILE_POS_X(4, 5), | ||
|
||
[FRAME_TOP_LEFT] = TILE_POS_X(30, 0), | ||
[FRAME_TOP_CENTER] = TILE_POS_X(30, 0), | ||
[FRAME_TOP_RIGHT] = TILE_POS_X(30, 0), | ||
[FRAME_VERTICAL_LEFT] = TILE_POS_X(30, 0), | ||
[FRAME_VERTICAL_RIGHT] = TILE_POS_X(30, 0), | ||
[FRAME_BOTTOM_LEFT] = TILE_POS_X(30, 0), | ||
[FRAME_BOTTOM_CENTER] = TILE_POS_X(30, 0), | ||
[FRAME_BOTTOM_RIGHT] = TILE_POS_X(30, 0), | ||
|
||
[CORNER_TOP_LEFT] = TILE_POS_X(7, 2), | ||
[CORNER_TOP_RIGHT] = TILE_POS_X(10, 2), | ||
[CORNER_BOTTOM_LEFT] = TILE_POS_X(7, 5), | ||
[CORNER_BOTTOM_RIGHT] = TILE_POS_X(10, 5), | ||
|
||
[TOP_BORDER__LEFT] = TILE_POS_X(8, 2), | ||
[TOP_BORDER__RIGHT] = TILE_POS_X(9, 2), | ||
[BOTTOM_BORDER__LEFT] = TILE_POS_X(8, 5), | ||
[BOTTOM_BORDER__RIGHT] = TILE_POS_X(9, 5), | ||
|
||
[LEFT_BORDER__TOP] = TILE_POS_X(7, 3), | ||
[LEFT_BORDER__BOTTOM] = TILE_POS_X(7, 4), | ||
[RIGHT_BORDER__TOP] = TILE_POS_X(10, 3), | ||
[RIGHT_BORDER__BOTTOM] = TILE_POS_X(10, 4), | ||
|
||
[COLON] = TILE_POS_X(0, 6), | ||
[NO_SIGN] = TILE_POS_X(12, 6), | ||
[MINUS_SIGN] = TILE_POS_X(1, 6), | ||
[ZERO_DIGIT] = TILE_POS_X(2, 6), | ||
[ONE_DIGIT] = TILE_POS_X(3, 6), | ||
[TWO_DIGIT] = TILE_POS_X(4, 6), | ||
[THREE_DIGIT] = TILE_POS_X(5, 6), | ||
[FOUR_DIGIT] = TILE_POS_X(6, 6), | ||
[FIVE_DIGIT] = TILE_POS_X(7, 6), | ||
[SIX_DIGIT] = TILE_POS_X(8, 6), | ||
[SEVEN_DIGIT] = TILE_POS_X(9, 6), | ||
[EIGHT_DIGIT] = TILE_POS_X(10, 6), | ||
[NINE_DIGIT] = TILE_POS_X(11, 6), | ||
}; | ||
|
||
|
||
#define PAGE2_OFFSET 256 | ||
#define TILE_POS_Y(x, y) ((y) * 8 + PAGE2_OFFSET) | ||
static const uint16_t TILE_Y[MAX_VIDEO_TILES] = { | ||
[ONE_BOMB] = TILE_POS_Y(2, 0), | ||
[TWO_BOMBS] = TILE_POS_Y(4, 0), | ||
[THREE_BOMBS] = TILE_POS_Y(6, 0), | ||
[FOUR_BOMBS] = TILE_POS_Y(8, 0), | ||
[FIVE_BOMBS] = TILE_POS_Y(10, 0), | ||
[SIX_BOMBS] = TILE_POS_Y(12, 0), | ||
[SEVEN_BOMBS] = TILE_POS_Y(14, 0), | ||
[EIGHT_BOMBS] = TILE_POS_Y(16, 0), | ||
[BLANK] = TILE_POS_Y(18, 0), | ||
[FLAG] = TILE_POS_Y(20, 0), | ||
[QUESTION_MARK] = TILE_POS_Y(22, 0), | ||
[EMPTY_FLAG] = TILE_POS_Y(24, 0), | ||
[BOMB] = TILE_POS_Y(26, 0), | ||
[EXPLOSION] = TILE_POS_Y(28, 0), | ||
[GROUND] = TILE_POS_Y(30, 0), | ||
|
||
[BOMB_ICON] = TILE_POS_Y(0, 1), | ||
[HOURGLASS] = TILE_POS_Y(1, 1), | ||
|
||
[MINEFIELD_CORNER_TOP_LEFT] = TILE_POS_Y(0, 2), | ||
[MINEFIELD_TOP_TEE] = TILE_POS_Y(1, 2), | ||
[MINEFIELD_HORIZONTAL_TOP] = TILE_POS_Y(2, 2), | ||
[MINEFIELD_HORIZONTAL_MIDDLE] = TILE_POS_Y(2, 3), | ||
[MINEFIELD_HORIZONTAL_BOTTOM] = TILE_POS_Y(2, 5), | ||
[MINEFIELD_CORNER_TOP_RIGHT] = TILE_POS_Y(4, 2), | ||
|
||
[MINEFIELD_LEFT_TEE] = TILE_POS_Y(0, 3), | ||
[MINEFIELD_CROSS] = TILE_POS_Y(1, 3), | ||
[MINEFIELD_RIGHT_TEE] = TILE_POS_Y(4, 3), | ||
|
||
[MINEFIELD_VERTICAL_LEFT] = TILE_POS_Y(0, 4), | ||
[MINEFIELD_VERTICAL_MIDDLE] = TILE_POS_Y(2, 3), | ||
[MINEFIELD_VERTICAL_RIGHT] = TILE_POS_Y(4, 4), | ||
[CLOSED_CELL] = TILE_POS_Y(2, 4), | ||
|
||
[MINEFIELD_CORNER_BOTTOM_LEFT] = TILE_POS_Y(0, 5), | ||
[MINEFIELD_BOTTOM_TEE] = TILE_POS_Y(1, 5), | ||
[MINEFIELD_CORNER_BOTTOM_RIGHT] = TILE_POS_Y(4, 5), | ||
|
||
[CORNER_TOP_LEFT] = TILE_POS_Y(7, 2), | ||
[CORNER_TOP_RIGHT] = TILE_POS_Y(10, 2), | ||
[CORNER_BOTTOM_LEFT] = TILE_POS_Y(7, 5), | ||
[CORNER_BOTTOM_RIGHT] = TILE_POS_Y(10, 5), | ||
|
||
[FRAME_TOP_LEFT] = TILE_POS_Y(30, 0), | ||
[FRAME_TOP_CENTER] = TILE_POS_Y(30, 0), | ||
[FRAME_TOP_RIGHT] = TILE_POS_Y(30, 0), | ||
[FRAME_VERTICAL_LEFT] = TILE_POS_Y(30, 0), | ||
[FRAME_VERTICAL_RIGHT] = TILE_POS_Y(30, 0), | ||
[FRAME_BOTTOM_LEFT] = TILE_POS_Y(30, 0), | ||
[FRAME_BOTTOM_CENTER] = TILE_POS_Y(30, 0), | ||
[FRAME_BOTTOM_RIGHT] = TILE_POS_Y(30, 0), | ||
|
||
[TOP_BORDER__LEFT] = TILE_POS_Y(8, 2), | ||
[TOP_BORDER__RIGHT] = TILE_POS_Y(9, 2), | ||
[BOTTOM_BORDER__LEFT] = TILE_POS_Y(8, 5), | ||
[BOTTOM_BORDER__RIGHT] = TILE_POS_Y(9, 5), | ||
|
||
[LEFT_BORDER__TOP] = TILE_POS_Y(7, 3), | ||
[LEFT_BORDER__BOTTOM] = TILE_POS_Y(7, 4), | ||
[RIGHT_BORDER__TOP] = TILE_POS_Y(10, 3), | ||
[RIGHT_BORDER__BOTTOM] = TILE_POS_Y(10, 4), | ||
|
||
[COLON] = TILE_POS_Y(0, 6), | ||
[NO_SIGN] = TILE_POS_Y(12, 6), | ||
[MINUS_SIGN] = TILE_POS_Y(1, 6), | ||
[ZERO_DIGIT] = TILE_POS_Y(2, 6), | ||
[ONE_DIGIT] = TILE_POS_Y(3, 6), | ||
[TWO_DIGIT] = TILE_POS_Y(4, 6), | ||
[THREE_DIGIT] = TILE_POS_Y(5, 6), | ||
[FOUR_DIGIT] = TILE_POS_Y(6, 6), | ||
[FIVE_DIGIT] = TILE_POS_Y(7, 6), | ||
[SIX_DIGIT] = TILE_POS_Y(8, 6), | ||
[SEVEN_DIGIT] = TILE_POS_Y(9, 6), | ||
[EIGHT_DIGIT] = TILE_POS_Y(10, 6), | ||
[NINE_DIGIT] = TILE_POS_Y(11, 6), | ||
}; |
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
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 |
---|---|---|
@@ -1,41 +1,5 @@ | ||
#include "msx2.h" | ||
|
||
/* cursor sprite */ | ||
#define CURSOR_PATTERN_ID 0 | ||
#define CURSOR_SPRITE_ID 0 | ||
#define CURSOR_X_OFFSET 0 | ||
#define CURSOR_Y_OFFSET 0 | ||
|
||
const uint8_t cursor_pattern[32] = { | ||
0x00,0x70,0x40,0x40,0x00,0x00,0x00,0x00, | ||
0x00,0x00,0x00,0x00,0x40,0x40,0x70,0x00, | ||
0x00,0x0E,0x02,0x02,0x00,0x00,0x00,0x00, | ||
0x00,0x00,0x00,0x00,0x02,0x02,0x0E,0x00 | ||
}; | ||
|
||
|
||
/* all black */ | ||
const uint8_t cursor_colors[16] = { | ||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
}; | ||
|
||
|
||
/* mouse sprite */ | ||
#define MOUSE_PATTERN_ID 4 | ||
#define MOUSE_SPRITE_ID 1 | ||
|
||
const uint8_t mouse_pattern[32] = { | ||
0x01,0x01,0x01,0x01,0x01,0x03,0x04,0xFD, | ||
0x04,0x03,0x01,0x01,0x01,0x01,0x01,0x00, | ||
0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x7E, | ||
0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00 | ||
}; | ||
|
||
|
||
/* all black */ | ||
const uint8_t mouse_colors[16] = { | ||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
}; | ||
|
||
#ifdef _16X16_TILES | ||
# include "16x16_cursors.h" | ||
#else | ||
# include "8x8_cursors.h" | ||
#endif |
Oops, something went wrong.