40 lines
1.4 KiB
C
40 lines
1.4 KiB
C
// uncomment to use production headers
|
|
//#define PRODUCTION
|
|
|
|
#ifndef PRODUCTION
|
|
// include all tonc functions, better to only include files you're using
|
|
#include <tonc.h>
|
|
#else
|
|
// trim these down to only what you're using. if you use all of these,
|
|
// just use tonc.h
|
|
#include <tonc_types.h> // define useful data types and macros (almost required)
|
|
#include <tonc_memdef.h> // register/memory locations & register macros
|
|
#include <tonc_bios.h> // bios control flags & registers (includes compression)
|
|
#include <tonc_core.h> // many useful functions
|
|
#include <tonc_input.h> // key checking and polling functions
|
|
#include <tonc_irq.h> // used for managing interrupts
|
|
#include <tonc_math.h> // math macros and luts
|
|
#include <tonc_oam.h> // manage oam attributes (including affines)
|
|
#include <tonc_tte.h> // tonc text engine
|
|
#include <tonc_video.h> // macros, functions, & defines for various video modes
|
|
#include <tonc_surface.h> // create and manage surfaces
|
|
#include <tonc_nocash.h> // nocash debugging functions
|
|
#endif // PRODUCTION
|
|
|
|
int main(void) {
|
|
// wait for vsync (necessary for this? probably not, but good practice)
|
|
vid_vsync();
|
|
|
|
// bitmap mode 3, enable bg2 (bitmap layer)
|
|
REG_DISPCNT = DCNT_MODE3 | DCNT_BG2;
|
|
|
|
// plot rgb points
|
|
m3_plot(119, 80, RGB15(31, 0, 0)); // Red
|
|
m3_plot(120, 80, RGB15(0, 31, 0)); // Green
|
|
m3_plot(121, 80, RGB15(0, 0, 31)); // Blue
|
|
|
|
while (1); // loop so you don't get nasal demons
|
|
|
|
return 0;
|
|
|