syscalls.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 2018 Tom Li <tomli at tomli.me>.
  3. *
  4. * This software is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU Lesser General Public License as published by
  6. * the Free Software Foundation; either version 3, or (at your option) any
  7. * later version.
  8. *
  9. * This software is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. * or FITNESS FOR A PARTICULAR PURPOSE.
  12. *
  13. * See COPYING for terms and conditions.
  14. *
  15. * GPL or LGPL does __not__ require attribution beyond preserving and
  16. * following the license, but if you find my code is useful or inspirational
  17. * to your own project, I'd be thankful if you attribute my name.
  18. */
  19. #define USED_IN_ASM(x) (x)
  20. #define CPUCLK_NORMAL (0)
  21. #define CPUCLK_FULL (3)
  22. #define FINDSYM_APPVAR (0x15)
  23. uint16_t bank1_get(void);
  24. void bank1_swap(const uint16_t page) __z88dk_fastcall __naked;
  25. void bank1_fastswap(const uint8_t page) __z88dk_fastcall __naked;
  26. uint8_t cpuclk_get(void);
  27. void cpuclk_set(const uint8_t speed);
  28. void clear_screen(void);
  29. void getkey(void);
  30. void disphl(uint8_t, uint8_t, const uint16_t);
  31. void fillrect(uint16_t x1, uint16_t x2, uint8_t y1, uint8_t y2);
  32. const bool findsym(const uint8_t, const unsigned char *, uint16_t *, uint16_t *);
  33. const bool findapp(const unsigned char *name, uint16_t *page, uint16_t *addr);
  34. void lcd_halfres(void);
  35. void lcd_fullres(void);
  36. /* DCSE routines */
  37. void clear_lcd(void);
  38. void drawsprite_1bit(uint16_t x, uint16_t y, uint8_t *palatte, uint8_t *sprite);
  39. void drawsprite_8bit(uint16_t x, uint16_t y, uint8_t *palette, uint8_t *sprite);
  40. __at(0x4000) static uint8_t bank1[16384];
  41. __at(0x8459) static uint8_t cursor_row;
  42. __at(0x845A) static uint8_t cursor_col;