gbarubik/src/main.cpp

31 lines
651 B
C++
Raw Normal View History

2023-11-24 18:19:30 -07:00
#include "palette.hpp"
#include "vector.hpp"
2023-11-21 13:29:11 -07:00
#include <tonc.h>
int main() {
2023-11-24 18:19:30 -07:00
// interrupt & mode 4 foo
2023-11-21 13:29:11 -07:00
irq_init(NULL);
irq_enable(II_VBLANK);
2023-11-24 18:19:30 -07:00
REG_DISPCNT = DCNT_MODE4 | DCNT_BG2;
2023-11-21 13:29:11 -07:00
2023-11-24 18:19:30 -07:00
// initialize our palette
palette::put_palette((std::uint16_t *)MEM_PAL);
2023-11-21 13:29:11 -07:00
2023-11-24 18:19:30 -07:00
// begin
bmp16_line(1, 3, 1 + SCREEN_WIDTH / 2 - 2, SCREEN_HEIGHT, 0x0101, vid_page,
SCREEN_WIDTH);
vid_flip();
bmp16_line(2, 3, 2 + SCREEN_WIDTH / 2 - 2, SCREEN_HEIGHT, 0x0101, vid_page,
SCREEN_WIDTH);
std::uint32_t frame = 0;
2023-11-21 13:29:11 -07:00
while (1) {
2023-11-24 18:19:30 -07:00
frame = (frame + 1) % 60;
if (frame == 0) {
vid_flip();
}
2023-11-21 13:29:11 -07:00
VBlankIntrWait();
}
}