3 * Author : Robin Krens <robin@robinkrens.nl>
5 * Last Modified Date: 09.06.2022
6 * Last Modified By : Robin Krens <robin@robinkrens.nl>
11 #include <interrupt.h>
14 unsigned char bgtile_gfx[] = {
15 0x31, 0x22, 0x31, 0x32, 0x22, 0x31, 0x23, 0x21, 0x13, 0x13, 0x31, 0x32,
16 0x32, 0x31, 0x23, 0x12, 0x21, 0x32, 0x13, 0x23, 0x23, 0x13, 0x31, 0x31,
17 0x12, 0x32, 0x13, 0x22, 0x23, 0x13, 0x22, 0x13
21 unsigned char bgtile_pal[] = {
22 0x65, 0x06, 0x67, 0x06, 0x79, 0x07, 0x8c, 0x08, 0xff, 0x0f, 0xff, 0x0f,
23 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f,
24 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f
29 unsigned char lol[5] = { 0xAA, 0x2, 0x3, 0x4, 0x5};
30 unsigned char lol2[5] = { 0x1, 0x2, 0x3, 0x4, 0x5};
31 unsigned char lol3[5] = { 0x1, 0x2, 0x3, 0x4, 0x5};
32 #define PALETTE_T (volatile unsigned *)0xFE00
33 #define SPRITE_T (volatile unsigned *)0x4000
36 static unsigned char blaat[100];
38 void outport(unsigned char portnr, unsigned char val)
44 :"r"(val), "r"(portnr)
48 unsigned char inport(unsigned char portnr)
62 __attribute__ ((naked)) void * dummy_isr(void)
71 outport(IO_INT_BASE, INT_BASE);
73 unsigned short * test_vec = (INT_BASE + INTVEC_VBLANK_START) << 2;
74 *test_vec++ = (&dummy_isr);
77 outport(IO_INT_ENABLE, INT_VBLANK_START);
88 unsigned char ret = inport(0x15);
100 outport(IO_VIDEO_MODE, VMODE_16C_CHK | VMODE_CLEANINIT);
101 unsigned short base = 0x3000; /* screens pos */
102 unsigned short sprite_pos = base - (MAP_SIZE*2) - SPR_TABLE_SIZE;
103 unsigned short scr1_pos = base - (MAP_SIZE*2); /* 0x2000 */
104 unsigned short scr2_pos = base - MAP_SIZE; /* 0x2800 */
105 outport(IO_MAP_BASE, FG_MAP(scr2_pos) | BG_MAP(scr1_pos));
106 outport(IO_SPR_TABLE, SPR_TABLE(sprite_pos));
111 unsigned char * ptr = PALETTE_T;
112 for (int i = 0; i < sizeof(bgtile_pal); ++i) {
113 *ptr++ = bgtile_pal[i];
117 for (int i = 0; i < sizeof(bgtile_gfx); ++i) {
118 *ptr++ = bgtile_gfx[i];
121 outport(IO_DISPLAY_CTRL, BG_ON | FG_ON);