#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
*/
#include <memory.h>
#include <video.h>
+#include <config.h>
#include <interrupt.h>
/* sprite data */
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);
-
+
unsigned char * ptr = PALETTE_T;
for (int i = 0; i < sizeof(bgtile_pal); ++i) {
*ptr++ = bgtile_pal[i];
*ptr++ = bgtile_gfx[i];
}
- outport(IO_DISPLAY_CTRL, BG_ON);
+ outport(IO_DISPLAY_CTRL, BG_ON | FG_ON);
while(1) {
}