ChrisOS Research ProjectOperating systems · language systems · graphics · machine emulation
DOCUMENTATION ARCHIVEMAIN BRANCH
ChrisOS/Source reference: GAMES/DOOM/I_CHRIS.CC

Source reference: GAMES/DOOM/I_CHRIS.CC

Deterministic source record. The complete textual file is reproduced below; this page does not replace architectural interpretation in the authored chapters.

File identity

Field Value
Path GAMES/DOOM/I_CHRIS.CC
Lines 62
Bytes 963
SHA-256 2eb884878af9b88217e27e429db9f9e17df8f51903e7fe2b255d6f503db1df98
ChrisOS revision da3df29cb397932c43d32373871fb9380e688ade

Detected syntactic dependencies

Line Include
— No preprocessor include detected.

Detected symbols

Line Symbol
10 DG_SetWindowTitle
14 DG_Init
29 DG_DrawFrame
33 DG_SleepMs
42 DG_GetTicksMs
47 DG_GetKey
57 I_Sound_stub
60 I_Music_stub

Complete source

The following block is the complete textual file at the recorded revision. No lines are elided, abbreviated or paraphrased.

/* doomgeneric-style backend for ChrisC / CLVM. Sound and net are stubs. */

int DG_ScreenW;
int DG_ScreenH;
char DG_Screen[64000];
char DG_Pal[768];
int DG_Ticks;
int DG_Running;

void DG_SetWindowTitle(char *title) {
  title = title;
}

void DG_Init() {
  int i;
  DG_ScreenW = 320;
  DG_ScreenH = 200;
  viewport(320, 200);
  i = 0;
  while (i < 768) {
    DG_Pal[i] = (char)((i / 3) & 255);
    i = i + 1;
  }
  setpal(DG_Pal);
  DG_Ticks = ticks();
  DG_Running = 1;
}

void DG_DrawFrame() {
  fb_blit(DG_Screen, DG_ScreenW, DG_ScreenH);
}

void DG_SleepMs(int ms) {
  int t;
  t = (ms * 60) / 1000;
  if (t < 1) {
    t = 1;
  }
  wait(t);
}

int DG_GetTicksMs() {
  return (ticks() * 1000) / 60;
}

/* doomgeneric polls this; Chris input uses I_StartTic → D_PostEvent instead. */
int DG_GetKey(int *pressed, int *key) {
  if (pressed) {
    *pressed = 0;
  }
  if (key) {
    *key = 0;
  }
  return 0;
}

void I_Sound_stub() {
}

void I_Music_stub() {
}

Role of this record

The atlas guarantees file-by-file traceability. Responsibility, invariants, ownership, concurrency, security, performance and subsystem interactions belong in authored chapters and must cite this file when applicable.

Document record ID: source-2eb884878af9b882 Reviewed source: da3df29cb397 Class: generated-source-reference