unit ObxPal;

// commented out everything until I figure out what's actually requireed

interface

  Procedure PrintChar(C : Char);
  Function Time : Uint64;
  Function Version : Int32;

implementation

// Generated by C2OBX 2023-06-27 on 2023-09-20T20:50:52
// manually updated
{
definition ObxPal [extern 'C', dll 'Pal', prefix 'PAL_']
  
  type
    PixelFormat = ( Mono, RGB )
    
  proc version(): int32
  proc time(): int32 // milliseconds since start
  proc date(year: *[]int16; month: *[]byte; day: *[]byte);
  proc clock(hour, minute, second: *[]byte);
  proc dispose()
  proc printChar(ch: char)
  
  proc file_list(): int32 
  proc file_list_masked(mask: *[]char): int32
  proc file_list_item(i: int32): *[]char
  proc file_list_detail(i: int32; data: *[]int32): *[]char
  proc file_open(filename: *[]char): int32
  proc file_exists(filename: *[]char): int32
  proc file_key(filename: *[]char): int32
  proc file_name(buffer: int32): *[]char
  proc file_new(): int32 
  proc file_free(buffer: int32)
  proc file_save(filename: *[]char; buffer: int32): int32
  proc file_remove(filename: *[]char): int32
  proc file_rename(oldName: *[]char; newName: *[]char): int32
  proc file_length(buffer: int32): int32
  proc file_seek(buffer: int32; pos: int32): int32
  proc file_pos(buffer: int32): int32
  proc file_eof(buffer: int32): int32
  proc file_write_byte(buffer: int32; byte_: int32): int32
  proc file_read_byte(buffer: int32): int32
  
  proc open_screen(width, height, format: int32; title: *[]char; buffer: *void): int32 
  // NOTE: buffer cannot be an ARRAY OF CHAR because this one (and only this one) is marshalled on Mono
  proc process_events(sleep: int32): int32
  proc next_key(): int32
  proc pending_keys(): int32
  proc mouse_state(x, y, keys: *[1]int32): int32
  proc modifier_state(mods: *[1]int32): int32
  proc update( x, y, w, h: int32):int32
  
  proc sin(x: longreal): longreal
  proc cos(x: longreal): longreal
  proc arctan(x: longreal): longreal
  proc sqrt(x: longreal): longreal
  proc ln(x: longreal): longreal
  proc exp(x: longreal): longreal
  proc pow(x, e: longreal): longreal
 
end ObxPal
}

Uses
  SysUtils;

Procedure PrintChar(C : Char);
begin
  Write(C);
end;

Function Time : Uint64;
begin
  Time := GetTickCount64;
end;

Function Version: Int32;
Begin
  Version := 0;
end;

end.
