projects
/
swan-dev
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9c724fa
)
main: set fg and bg map locations
author
Robin Krens
<robin@robinkrens.nl>
Sat, 11 Jun 2022 19:29:52 +0000
(21:29 +0200)
committer
Robin Krens
<robin@robinkrens.nl>
Sat, 11 Jun 2022 19:29:52 +0000
(21:29 +0200)
inc/video.h
patch
|
blob
|
history
src/main.c
patch
|
blob
|
history
diff --git
a/inc/video.h
b/inc/video.h
index
7a294fb
..
1fda526
100644
(file)
--- a/
inc/video.h
+++ b/
inc/video.h
@@
-6,7
+6,7
@@
#define IO_SPR_TABLE 0x04
#define IO_SPR_START 0x05
#define IO_SPR_STOP 0x06
#define IO_SPR_TABLE 0x04
#define IO_SPR_START 0x05
#define IO_SPR_STOP 0x06
-#define IO_
FGBG_MAP
0x07
+#define IO_
MAP_BASE
0x07
#define IO_FG_WIN_X0 0x08
#define IO_FG_WIN_Y0 0x09
#define IO_FG_WIN_X1 0x0A
#define IO_FG_WIN_X0 0x08
#define IO_FG_WIN_Y0 0x09
#define IO_FG_WIN_X1 0x0A
diff --git
a/src/main.c
b/src/main.c
index
9be5eeb
..
bd4a86b
100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-7,6
+7,7
@@
*/
#include <memory.h>
#include <video.h>
*/
#include <memory.h>
#include <video.h>
+#include <config.h>
#include <interrupt.h>
/* sprite data */
#include <interrupt.h>
/* sprite data */
@@
-79,9
+80,16
@@
int main(void)
setup_ivec();
init_video();
outport(IO_VIDEO_MODE, VMODE_16C_CHK | VMODE_CLEANINIT);
setup_ivec();
init_video();
outport(IO_VIDEO_MODE, VMODE_16C_CHK | VMODE_CLEANINIT);
- outport(IO_FGBG_MAP, 0x40);
+ unsigned short base = 0x3000; /* screens pos */
+ unsigned short sprite_pos = base - (MAP_SIZE*2) - SPR_TABLE_SIZE;
+ unsigned short scr1_pos = base - (MAP_SIZE*2); /* 0x2000 */
+ unsigned short scr2_pos = base - MAP_SIZE; /* 0x2800 */
+ outport(IO_MAP_BASE, FG_MAP(scr2_pos) | BG_MAP(scr1_pos));
+ outport(IO_SPR_TABLE, SPR_TABLE(sprite_pos));
+
+ /* icons */
outport(0x15, 0xEE);
outport(0x15, 0xEE);
-
+
unsigned char * ptr = PALETTE_T;
for (int i = 0; i < sizeof(bgtile_pal); ++i) {
*ptr++ = bgtile_pal[i];
unsigned char * ptr = PALETTE_T;
for (int i = 0; i < sizeof(bgtile_pal); ++i) {
*ptr++ = bgtile_pal[i];
@@
-92,7
+100,7
@@
int main(void)
*ptr++ = bgtile_gfx[i];
}
*ptr++ = bgtile_gfx[i];
}
- outport(IO_DISPLAY_CTRL, BG_ON);
+ outport(IO_DISPLAY_CTRL, BG_ON
| FG_ON
);
while(1) {
}
while(1) {
}