Newer
Older
Scratch / lockwasher / src / sys / lib / ogprintf.cpp
@Christopher W. Olsen Christopher W. Olsen on 25 Oct 2019 718 bytes Scratch
#include <objgfx/objgfx30.h>
#include <objgfx/objfont.h>

extern "C" {
int ogPrintf(char *s);
}

  TDPFont * font = 0x0;
  TGfx0 * buf    = 0x0;
  int screenRow  = 0x0;
  
int ogPrintf(char *s) {
  bool result;


 
  if (!buf) {
    font = new TDPFont();
    buf  = new TGfx0();
    // Creat Screen Object
    buf->ogCreate(800,600,DEF_PIXFMT_8BPP);
    // Set Our Font
    result = font->load("ROM8X14.DPF");
    // change the buffer pointer to screen mem
    buf->Buffer = (void *)0xE4000000;
    // Set Font Color To White
    font->setColor(255,255,255);
    }
  font->putText(*buf,0,screenRow,s);
  screenRow += 14;
  if (screenRow > 588) {
    buf->ogClear(0);
    screenRow = 0;
    }
  return 0;
} // ogPrintf