Rev 8426 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8426 | Rev 8464 | ||
---|---|---|---|
Line 38... | Line 38... | ||
38 | #define IMAGE 1 |
38 | #define IMAGE 1 |
39 | #define RAW 2 |
39 | #define RAW 2 |
Line 40... | Line 40... | ||
40 | 40 | ||
41 | //Read/Write data as type (int char, etc.) at address "addr" with offset "offset". eg DATA(int, buff, 8); |
41 | //Read/Write data as type (int char, etc.) at address "addr" with offset "offset". eg DATA(int, buff, 8); |
- | 42 | #define DATA(type, addr, offset) *((type*)((uint8_t*)addr+offset)) |
|
- | 43 | #define X_W(X, W) ((X<<16)+W) |
|
Line 42... | Line 44... | ||
42 | #define DATA(type, addr, offset) *((type*)((uint8_t*)addr+offset)) |
44 | #define Y_H X_W |
43 | 45 | ||
44 | typedef struct { |
46 | typedef struct { |
45 | uint8_t blue; |
47 | uint8_t blue; |
Line 746... | Line 748... | ||
746 | asm volatile ("int $0x40":"=a"(val):"a"(70), "b"(&file_op)); |
748 | asm volatile ("int $0x40":"=a"(val):"a"(70), "b"(&file_op)); |
Line 747... | Line 749... | ||
747 | 749 | ||
748 | return val; |
750 | return val; |
Line 749... | Line -... | ||
749 | } |
- | |
750 | - | ||
751 | //added nonstatic inline because incomfortabre stepping in in debugger |
- | |
752 | void __attribute__ ((noinline)) debug_board_write_str(const char* str); |
- | |
753 | void __attribute__ ((noinline)) debug_board_printf(const char *format,...); |
- | |
754 | - | ||
755 | /* copy body to only one project file |
- | |
756 | void __attribute__ ((noinline)) debug_board_write_str(const char* str){ |
- | |
757 | while(*str) |
- | |
758 | debug_board_write_byte(*str++); |
- | |
759 | } |
- | |
760 | - | ||
761 | void __attribute__ ((noinline)) debug_board_printf(const char *format,...) |
- | |
762 | { |
- | |
763 | va_list ap; |
- | |
764 | char log_board[300]; |
- | |
765 | - | ||
766 | va_start (ap, format); |
- | |
767 | vsnprintf(log_board, sizeof log_board, format, ap); |
- | |
768 | va_end(ap); |
- | |
769 | debug_board_write_str(log_board); |
- | |
770 | } |
- | |
771 | */ |
751 | } |
772 | 752 | ||
773 | // TinyC don't support aliasing of static inline funcs, but support #define :) |
753 | // TinyC don't support aliasing of static inline funcs, but support #define :) |
774 | #ifndef __TINYC__ |
754 | #ifndef __TINYC__ |
775 | static inline void BeginDraw(void) __attribute__ ((alias ("begin_draw"))); |
755 | static inline void BeginDraw(void) __attribute__ ((alias ("begin_draw"))); |